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>

127 lines 7.46 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 GetMicrofrontendsConfigForProjectVersion = { One: "1", }; /** @internal */ export const GetMicrofrontendsConfigForProjectRequest$outboundSchema = z.object({ projectIdOrName: z.string(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getMicrofrontendsConfigForProjectRequestToJSON(getMicrofrontendsConfigForProjectRequest) { return JSON.stringify(GetMicrofrontendsConfigForProjectRequest$outboundSchema.parse(getMicrofrontendsConfigForProjectRequest)); } /** @internal */ export const GetMicrofrontendsConfigForProjectVersion$inboundSchema = z .nativeEnum(GetMicrofrontendsConfigForProjectVersion); /** @internal */ export const GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsLocal$inboundSchema = smartUnion([types.string(), types.number()]); export function getMicrofrontendsConfigForProjectApplicationsMicrofrontendsLocalFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsLocal$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsLocal' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsDevelopment$inboundSchema = z.object({ fallback: types.optional(types.string()), local: types.optional(smartUnion([types.string(), types.number()])), task: types.optional(types.string()), }); export function getMicrofrontendsConfigForProjectApplicationsMicrofrontendsDevelopmentFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsDevelopment$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsDevelopment' from JSON`); } /** @internal */ export const ApplicationsRouting$inboundSchema = z.object({ group: types.optional(types.string()), flag: types.optional(types.string()), paths: z.array(types.string()), }); export function applicationsRoutingFromJSON(jsonString) { return safeParse(jsonString, (x) => ApplicationsRouting$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationsRouting' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectApplications2$inboundSchema = z.object({ development: types.optional(z.lazy(() => GetMicrofrontendsConfigForProjectApplicationsMicrofrontendsDevelopment$inboundSchema)), routing: z.array(z.lazy(() => ApplicationsRouting$inboundSchema)), assetPrefix: types.optional(types.string()), packageName: types.optional(types.string()), projectId: types.string(), }); export function getMicrofrontendsConfigForProjectApplications2FromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplications2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplications2' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectApplicationsLocal$inboundSchema = smartUnion([types.string(), types.number()]); export function getMicrofrontendsConfigForProjectApplicationsLocalFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplicationsLocal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplicationsLocal' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectApplicationsDevelopment$inboundSchema = z.object({ fallback: types.string(), local: types.optional(smartUnion([types.string(), types.number()])), task: types.optional(types.string()), }); export function getMicrofrontendsConfigForProjectApplicationsDevelopmentFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplicationsDevelopment$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplicationsDevelopment' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectApplications1$inboundSchema = z.object({ development: z.lazy(() => GetMicrofrontendsConfigForProjectApplicationsDevelopment$inboundSchema), packageName: types.optional(types.string()), projectId: types.string(), }); export function getMicrofrontendsConfigForProjectApplications1FromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplications1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplications1' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectApplications$inboundSchema = smartUnion([ z.lazy(() => GetMicrofrontendsConfigForProjectApplications1$inboundSchema), z.lazy(() => GetMicrofrontendsConfigForProjectApplications2$inboundSchema), ]); export function getMicrofrontendsConfigForProjectApplicationsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectApplications$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectApplications' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectOptions$inboundSchema = z.object({ disableOverrides: types.optional(types.boolean()), localProxyPort: types.optional(types.number()), }); export function getMicrofrontendsConfigForProjectOptionsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectOptions' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectConfig$inboundSchema = z.object({ $schema: types.optional(types.string()), version: types.optional(GetMicrofrontendsConfigForProjectVersion$inboundSchema), applications: z.record(smartUnion([ z.lazy(() => GetMicrofrontendsConfigForProjectApplications1$inboundSchema), z.lazy(() => GetMicrofrontendsConfigForProjectApplications2$inboundSchema), ])), options: types.optional(z.lazy(() => GetMicrofrontendsConfigForProjectOptions$inboundSchema)), }).transform((v) => { return remap$(v, { "$schema": "dollarSchema", }); }); export function getMicrofrontendsConfigForProjectConfigFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectConfig' from JSON`); } /** @internal */ export const GetMicrofrontendsConfigForProjectResponseBody$inboundSchema = z.object({ config: types.nullable(z.lazy(() => GetMicrofrontendsConfigForProjectConfig$inboundSchema)), }); export function getMicrofrontendsConfigForProjectResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetMicrofrontendsConfigForProjectResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMicrofrontendsConfigForProjectResponseBody' from JSON`); } //# sourceMappingURL=getmicrofrontendsconfigforprojectop.js.map