Edits history of script submission #15397 for ' Create a request to exercise equity. (deel)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Create a request to exercise equity.
     * Create a request to exercise equity.
     **Token scopes**: `contracts:write`
     */
    export async function main(auth: RT.Deel, body: Body) {
    	const url = new URL(`https://api.letsdeel.com/rest/v2/equity/exercise`)
    
    	const response = await fetch(url, {
    		method: 'POST',
    		headers: {
    			'Content-Type': 'application/json',
    			Authorization: 'Bearer ' + auth.apiKey
    		},
    		body: JSON.stringify(body)
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    
    /* eslint-disable */
    /**
     * This file was automatically generated by json-schema-to-typescript.
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
     * and run json-schema-to-typescript to regenerate this file.
     */
    
    export interface Body {
    	/**
    	 * The fair market value of the equity.
    	 */
    	fmv: string
    	/**
    	 * The quantity of equity to exercise.
    	 */
    	quantity: number
    	/**
    	 * The unique identifier of the issuer.
    	 */
    	issuer_id: string
    	/**
    	 * The unique identifier of the worker.
    	 */
    	worker_id: string
    	/**
    	 * The zip code of the address.
    	 */
    	address_zip: string
    	/**
    	 * The unique identifier of the exercise.
    	 */
    	exercise_id: string
    	/**
    	 * The city of the address.
    	 */
    	address_city: string
    	/**
    	 * The state of the address.
    	 */
    	address_state: string
    	/**
    	 * The street of the address.
    	 */
    	address_street: string
    	/**
    	 * The unique identifier of the stakeholder.
    	 */
    	stakeholder_id: string
    	/**
    	 * The country of the address.
    	 */
    	address_country: string
    	/**
    	 * The unique identifier of the option grant.
    	 */
    	option_grant_id: string
    	/**
    	 * The currency code of the fair market value.
    	 */
    	fmv_currency_code: string
    	/**
    	 * The email of the stakeholder.
    	 */
    	stakeholder_email: string
    	/**
    	 * The issue of the option grant.
    	 */
    	option_grant_issue: string
    	/**
    	 * The label of the option grant.
    	 */
    	option_grant_label: string
    	/**
    	 * The currency of the option grant.
    	 */
    	option_grant_currency: string
    	/**
    	 * The issue date of the option grant.
    	 */
    	option_grant_issue_date: string
    	/**
    	 * The expiry date of the option grant.
    	 */
    	option_grant_expiry_date: string
    	/**
    	 * The relationship of the stakeholder.
    	 */
    	stakeholder_relationship: string
    	/**
    	 * The strike price of the option grant.
    	 */
    	option_grant_strike_price: string
    	[k: string]: unknown
    }
    

    Submitted by hugo697 235 days ago