export type RecipientTokenClientURLs = {onAccessCodeFailed?: string | undefined, onCancel?: string | undefined, onDecline?: string | undefined, onException?: string | undefined, onFaxPending?: string | undefined, onIdCheckFailed?: string | undefined, onSessionTimeout?: string | undefined, onSigningComplete?: string | undefined, onTTLExpired?: string | undefined, onViewingComplete?: string | undefined}; export type RecipientViewRequest = {assertionId?: string | undefined, authenticationInstant?: string | undefined, authenticationMethod?: string | undefined, clientURLs?: RecipientTokenClientURLs | undefined, clientUserId?: string | undefined, displayFormat?: string | undefined, email?: string | undefined, frameAncestors?: Array | undefined, messageOrigins?: Array | undefined, pingFrequency?: string | undefined, pingUrl?: string | undefined, recipientId?: string | undefined, returnUrl?: string | undefined, securityDomain?: string | undefined, userId?: string | undefined, userName?: string | undefined, xFrameOptions?: string | undefined, xFrameOptionsAllowFromUrl?: string | undefined}; export type CreateApiV21AccountsAccountIdEnvelopesEnvelopeIdViewsSharedArgs = {accountId: string, envelopeId: string, body: RecipientViewRequest}; export type CreateApiV21AccountsAccountIdEnvelopesEnvelopeIdViewsSharedOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns a URL to the shared recipient view UI for an envelope. * * POST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/shared */ export const createApiV21AccountsAccountIdEnvelopesEnvelopeIdViewsShared = async (args: CreateApiV21AccountsAccountIdEnvelopesEnvelopeIdViewsSharedArgs, options?: CreateApiV21AccountsAccountIdEnvelopesEnvelopeIdViewsSharedOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/envelopes/${encodeURIComponent(String(args.envelopeId))}/views/shared${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };