@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>
52 lines • 1.93 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";
/**
* One of `LOCAL` or `REMOTE`. `LOCAL` specifies that the cache event was from the user's filesystem cache. `REMOTE` specifies that the cache event is from a remote cache.
*/
export const RecordEventsSource = {
Local: "LOCAL",
Remote: "REMOTE",
};
/**
* One of `HIT` or `MISS`. `HIT` specifies that a cached artifact for `hash` was found in the cache. `MISS` specifies that a cached artifact with `hash` was not found.
*/
export const Event = {
Hit: "HIT",
Miss: "MISS",
};
/** @internal */
export const RecordEventsSource$outboundSchema = z.nativeEnum(RecordEventsSource);
/** @internal */
export const Event$outboundSchema = z.nativeEnum(Event);
/** @internal */
export const RequestBody$outboundSchema = z.object({
sessionId: z.string(),
source: RecordEventsSource$outboundSchema,
event: Event$outboundSchema,
hash: z.string(),
duration: z.number().optional(),
});
export function requestBodyToJSON(requestBody) {
return JSON.stringify(RequestBody$outboundSchema.parse(requestBody));
}
/** @internal */
export const RecordEventsRequest$outboundSchema = z.object({
xArtifactClientCi: z.string().optional(),
xArtifactClientInteractive: z.number().int().optional(),
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.array(z.lazy(() => RequestBody$outboundSchema)),
}).transform((v) => {
return remap$(v, {
xArtifactClientCi: "x-artifact-client-ci",
xArtifactClientInteractive: "x-artifact-client-interactive",
requestBody: "RequestBody",
});
});
export function recordEventsRequestToJSON(recordEventsRequest) {
return JSON.stringify(RecordEventsRequest$outboundSchema.parse(recordEventsRequest));
}
//# sourceMappingURL=recordeventsop.js.map