@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
95 lines • 3.92 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
/**
* Whether the new key is activated automatically after its public key has propagated, or manually via the activate endpoint. Defaults to `automatic`.
*/
export const Activation = {
Automatic: "automatic",
Manual: "manual",
};
export const CreateKmsSigningKeyStatus = {
Active: "active",
Pending: "pending",
Revoking: "revoking",
};
/** @internal */
export const Activation$outboundSchema = z
.nativeEnum(Activation);
/** @internal */
export const RevokePreviousAt$outboundSchema = smartUnion([z.string(), z.number()]);
export function revokePreviousAtToJSON(revokePreviousAt) {
return JSON.stringify(RevokePreviousAt$outboundSchema.parse(revokePreviousAt));
}
/** @internal */
export const CreateKmsSigningKeyRequestBody$outboundSchema = z.object({
activation: Activation$outboundSchema.optional(),
revokePreviousAfterHours: z.number().optional(),
revokePreviousAt: smartUnion([z.string(), z.number()]).optional(),
importKey: z.string().optional(),
importKeyId: z.string().optional(),
});
export function createKmsSigningKeyRequestBodyToJSON(createKmsSigningKeyRequestBody) {
return JSON.stringify(CreateKmsSigningKeyRequestBody$outboundSchema.parse(createKmsSigningKeyRequestBody));
}
/** @internal */
export const CreateKmsSigningKeyRequest$outboundSchema = z.object({
issuerId: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => CreateKmsSigningKeyRequestBody$outboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function createKmsSigningKeyRequestToJSON(createKmsSigningKeyRequest) {
return JSON.stringify(CreateKmsSigningKeyRequest$outboundSchema.parse(createKmsSigningKeyRequest));
}
/** @internal */
export const CreateKmsSigningKeyStatus$inboundSchema = z.nativeEnum(CreateKmsSigningKeyStatus);
/** @internal */
export const PublicKey$inboundSchema = z.object({
kty: types.optional(types.string()),
kid: types.optional(types.string()),
alg: types.optional(types.string()),
use: types.optional(types.string()),
key_ops: types.optional(z.array(types.string())),
x5c: types.optional(z.array(types.string())),
"x5t#S256": types.optional(types.string()),
}).transform((v) => {
return remap$(v, {
"key_ops": "keyOps",
"x5t#S256": "x5tNumberS256",
});
});
export function publicKeyFromJSON(jsonString) {
return safeParse(jsonString, (x) => PublicKey$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicKey' from JSON`);
}
/** @internal */
export const CreateKmsSigningKeyResponseBody$inboundSchema = z.object({
keyId: types.string(),
importKeyId: types.optional(types.string()),
issuerId: types.string(),
algorithm: types.string(),
status: CreateKmsSigningKeyStatus$inboundSchema,
publicKey: types.optional(z.lazy(() => PublicKey$inboundSchema)),
publicKeyFingerprint: types.optional(types.string()),
publicKeyPem: types.optional(types.string()),
certificatePem: types.optional(types.string()),
createdAt: types.string(),
updatedAt: types.string(),
revokeAt: types.optional(types.string()),
activateAt: types.optional(types.string()),
activatedAt: types.optional(types.string()),
});
export function createKmsSigningKeyResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => CreateKmsSigningKeyResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKmsSigningKeyResponseBody' from JSON`);
}
//# sourceMappingURL=createkmssigningkeyop.js.map