@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
48 lines • 1.8 kB
JavaScript
/*
* 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";
/** @internal */
export const JWTGrantResponse$inboundSchema = z.object({
access_token: z.string(),
token_type: z.string(),
expires_in: z.number().int(),
}).transform((v) => {
return remap$(v, {
"access_token": "accessToken",
"token_type": "tokenType",
"expires_in": "expiresIn",
});
});
/** @internal */
export const JWTGrantResponse$outboundSchema = z.object({
accessToken: z.string(),
tokenType: z.string(),
expiresIn: z.number().int(),
}).transform((v) => {
return remap$(v, {
accessToken: "access_token",
tokenType: "token_type",
expiresIn: "expires_in",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var JWTGrantResponse$;
(function (JWTGrantResponse$) {
/** @deprecated use `JWTGrantResponse$inboundSchema` instead. */
JWTGrantResponse$.inboundSchema = JWTGrantResponse$inboundSchema;
/** @deprecated use `JWTGrantResponse$outboundSchema` instead. */
JWTGrantResponse$.outboundSchema = JWTGrantResponse$outboundSchema;
})(JWTGrantResponse$ || (JWTGrantResponse$ = {}));
export function jwtGrantResponseToJSON(jwtGrantResponse) {
return JSON.stringify(JWTGrantResponse$outboundSchema.parse(jwtGrantResponse));
}
export function jwtGrantResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => JWTGrantResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JWTGrantResponse' from JSON`);
}
//# sourceMappingURL=jwtgrantresponse.js.map