@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
87 lines • 3.15 kB
TypeScript
import { z } from "zod";
import { DocusignIamAuthScope } from "./scopes.js";
/**
* Schema for authorization URL options.
*/
export declare const AuthorizationUrlParamsSchema: z.ZodObject<{
/**
* The type of response to request.
*
* Use `code` for authorization code flows, and `token` for implicit flows.
*
* @link https://developers.docusign.com/platform/auth/consent/obtaining-individual-consent/
*/
type: z.ZodEnum<["code", "token"]>;
/**
* The environment to use for the OAuth flow.
*
* Use `account-d-docusign.com` for demo and `account.docusign.com` for
* production.
*
* If no environment is provided, the default is `account-d.docusign.com`.
*/
oauthBasePath: z.ZodDefault<z.ZodOptional<z.ZodEnum<["account-d.docusign.com", "account.docusign.com"]>>>;
/** Client ID (AKA Integration Key) */
clientId: z.ZodString;
/**
* The URI where the user will be redirected after authorization.
*
* This must match one of the redirect URIs configured for your integration.
*/
redirectUri: z.ZodString;
/**
* Scopes for the OAuth flow.
*
* If no scopes are provided, all available scopes will be used.
*
* @link https://developers.docusign.com/platform/auth/scopes/
*/
scopes: z.ZodDefault<z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString, "many">>>>;
/**
* An opaque value used to maintain state between the request and callback.
*
* This parameter is used to prevent cross-site request forgery.
*/
state: z.ZodOptional<z.ZodString>;
/**
* The coptionsode challenge for PKCE.
*
* A Base64-URL-encoded string derived from the code verifier.
* Used in authorization code flow with PKCE for public clients.
*/
codeChallenge: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type: "code" | "token";
clientId: string;
oauthBasePath: "account-d.docusign.com" | "account.docusign.com";
redirectUri: string;
scopes: readonly string[];
state?: string | undefined;
codeChallenge?: string | undefined;
}, {
type: "code" | "token";
clientId: string;
redirectUri: string;
oauthBasePath?: "account-d.docusign.com" | "account.docusign.com" | undefined;
scopes?: readonly string[] | undefined;
state?: string | undefined;
codeChallenge?: string | undefined;
}>;
/** Options for creating an Authorization URL */
export type AuthorizationUrlSchema = Omit<z.input<typeof AuthorizationUrlParamsSchema>, "scopes"> & {
/**
* Scopes for the OAuth flow.
*
* If no scopes are provided, all available scopes will be used.
*
* @link https://developers.docusign.com/platform/auth/scopes/
*/
scopes?: Array<DocusignIamAuthScope | (string & {})> | undefined;
};
/**
* Creates an authorization URL for the Docusign OAuth flows.
*
* @link https://developers.docusign.com/platform/auth/consent/obtaining-individual-consent/
*/
export declare function createAuthorizationUrl(options: AuthorizationUrlSchema): string;
//# sourceMappingURL=authorization-url.d.ts.map