UNPKG

@docusign/iam-sdk

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.

73 lines 3.04 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; export const GetTokenFromJWTGrantServerList = [ /** * For the developer environment, the URI is https://account-d.docusign.com/oauth/token */ "https://account-d.docusign.com", /** * For the production environment, the URI is https://account.docusign.com/oauth/token */ "https://account.docusign.com", ]; /** * The grant type. */ export const GetTokenFromJWTGrantGrantType = { UrnIetfParamsOauthGrantTypeJwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer", }; /** @internal */ export const GetTokenFromJWTGrantGrantType$inboundSchema = z.nativeEnum(GetTokenFromJWTGrantGrantType); /** @internal */ export const GetTokenFromJWTGrantGrantType$outboundSchema = GetTokenFromJWTGrantGrantType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetTokenFromJWTGrantGrantType$; (function (GetTokenFromJWTGrantGrantType$) { /** @deprecated use `GetTokenFromJWTGrantGrantType$inboundSchema` instead. */ GetTokenFromJWTGrantGrantType$.inboundSchema = GetTokenFromJWTGrantGrantType$inboundSchema; /** @deprecated use `GetTokenFromJWTGrantGrantType$outboundSchema` instead. */ GetTokenFromJWTGrantGrantType$.outboundSchema = GetTokenFromJWTGrantGrantType$outboundSchema; })(GetTokenFromJWTGrantGrantType$ || (GetTokenFromJWTGrantGrantType$ = {})); /** @internal */ export const JWTGrant$inboundSchema = z.object({ grant_type: GetTokenFromJWTGrantGrantType$inboundSchema.default("urn:ietf:params:oauth:grant-type:jwt-bearer"), assertion: z.string(), }).transform((v) => { return remap$(v, { "grant_type": "grantType", }); }); /** @internal */ export const JWTGrant$outboundSchema = z.object({ grantType: GetTokenFromJWTGrantGrantType$outboundSchema.default("urn:ietf:params:oauth:grant-type:jwt-bearer"), assertion: z.string(), }).transform((v) => { return remap$(v, { grantType: "grant_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var JWTGrant$; (function (JWTGrant$) { /** @deprecated use `JWTGrant$inboundSchema` instead. */ JWTGrant$.inboundSchema = JWTGrant$inboundSchema; /** @deprecated use `JWTGrant$outboundSchema` instead. */ JWTGrant$.outboundSchema = JWTGrant$outboundSchema; })(JWTGrant$ || (JWTGrant$ = {})); export function jwtGrantToJSON(jwtGrant) { return JSON.stringify(JWTGrant$outboundSchema.parse(jwtGrant)); } export function jwtGrantFromJSON(jsonString) { return safeParse(jsonString, (x) => JWTGrant$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JWTGrant' from JSON`); } //# sourceMappingURL=gettokenfromjwtgrant.js.map