UNPKG

@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>

123 lines 5.65 kB
/* * 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"; /** * The version of the microfrontends config schema. */ export const GetMicrofrontendsConfigVersion = { One: "1", }; /** @internal */ export const GetMicrofrontendsConfigRequest$outboundSchema = z.object({ deploymentId: z.string(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getMicrofrontendsConfigRequestToJSON(getMicrofrontendsConfigRequest) { return JSON.stringify(GetMicrofrontendsConfigRequest$outboundSchema.parse(getMicrofrontendsConfigRequest)); } /** @internal */ export const GetMicrofrontendsConfigVersion$inboundSchema = z.nativeEnum(GetMicrofrontendsConfigVersion); /** @internal */ export const ApplicationsLocal$inboundSchema = smartUnion([types.string(), types.number()]); export function applicationsLocalFromJSON(jsonString) { return safeParse(jsonString, (x) => ApplicationsLocal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationsLocal' from JSON`); } /** @internal */ export const ApplicationsDevelopment$inboundSchema = z.object({ fallback: types.optional(types.string()), local: types.optional(smartUnion([types.string(), types.number()])), task: types.optional(types.string()), }); export function applicationsDevelopmentFromJSON(jsonString) { return safeParse(jsonString, (x) => ApplicationsDevelopment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationsDevelopment' from JSON`); } /** @internal */ export const Routing$inboundSchema = z.object({ group: types.optional(types.string()), flag: types.optional(types.string()), paths: z.array(types.string()), }); export function routingFromJSON(jsonString) { return safeParse(jsonString, (x) => Routing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Routing' from JSON`); } /** @internal */ export const Applications2$inboundSchema = z.object({ development: types.optional(z.lazy(() => ApplicationsDevelopment$inboundSchema)), routing: z.array(z.lazy(() => Routing$inboundSchema)), assetPrefix: types.optional(types.string()), packageName: types.optional(types.string()), projectId: types.string(), }); export function applications2FromJSON(jsonString) { return safeParse(jsonString, (x) => Applications2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Applications2' from JSON`); } /** @internal */ export const Local$inboundSchema = smartUnion([types.string(), types.number()]); export function localFromJSON(jsonString) { return safeParse(jsonString, (x) => Local$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Local' from JSON`); } /** @internal */ export const Development$inboundSchema = z.object({ fallback: types.string(), local: types.optional(smartUnion([types.string(), types.number()])), task: types.optional(types.string()), }); export function developmentFromJSON(jsonString) { return safeParse(jsonString, (x) => Development$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Development' from JSON`); } /** @internal */ export const Applications1$inboundSchema = z.object({ development: z.lazy(() => Development$inboundSchema), packageName: types.optional(types.string()), projectId: types.string(), }); export function applications1FromJSON(jsonString) { return safeParse(jsonString, (x) => Applications1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Applications1' from JSON`); } /** @internal */ export const Applications$inboundSchema = smartUnion([ z.lazy(() => Applications1$inboundSchema), z.lazy(() => Applications2$inboundSchema), ]); export function applicationsFromJSON(jsonString) { return safeParse(jsonString, (x) => Applications$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Applications' from JSON`); } /** @internal */ export const Options$inboundSchema = z.object({ disableOverrides: types.optional(types.boolean()), localProxyPort: types.optional(types.number()), }); export function optionsFromJSON(jsonString) { return safeParse(jsonString, (x) => Options$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Options' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigConfig$inboundSchema = z.object({ $schema: types.optional(types.string()), version: types.optional(GetMicrofrontendsConfigVersion$inboundSchema), applications: z.record(smartUnion([ z.lazy(() => Applications1$inboundSchema), z.lazy(() => Applications2$inboundSchema), ])), options: types.optional(z.lazy(() => Options$inboundSchema)), }).transform((v) => { return remap$(v, { "$schema": "dollarSchema", }); }); export function getMicrofrontendsConfigConfigFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigConfig' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigResponseBody$inboundSchema = z.object({ config: types.nullable(z.lazy(() => GetMicrofrontendsConfigConfig$inboundSchema)), }); export function getMicrofrontendsConfigResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigResponseBody' from JSON`); } //# sourceMappingURL=getmicrofrontendsconfigop.js.map