@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>
61 lines • 2.53 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
import { Flag$inboundSchema } from "./flag.js";
import { MarketplaceFlag$inboundSchema, } from "./marketplaceflag.js";
/**
* The state of the flags to retrieve. Defaults to `active`.
*/
export const QueryParamState = {
Active: "active",
Archived: "archived",
};
/** @internal */
export const QueryParamState$outboundSchema = z.nativeEnum(QueryParamState);
/** @internal */
export const ListFlagsV2Request$outboundSchema = z.object({
projectIdOrName: z.string(),
state: QueryParamState$outboundSchema.optional(),
limit: z.number().int().default(25),
cursor: z.string().optional(),
search: z.string().optional(),
tags: z.array(z.string()).optional(),
createdBy: z.string().optional(),
maintainerIds: z.array(z.string()).optional(),
includeMarketplaceFlags: z.boolean().optional(),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function listFlagsV2RequestToJSON(listFlagsV2Request) {
return JSON.stringify(ListFlagsV2Request$outboundSchema.parse(listFlagsV2Request));
}
/** @internal */
export const ListFlagsV2Pagination$inboundSchema = z.object({
next: types.nullable(types.string()),
});
export function listFlagsV2PaginationFromJSON(jsonString) {
return safeParse(jsonString, (x) => ListFlagsV2Pagination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListFlagsV2Pagination' from JSON`);
}
/** @internal */
export const ListFlagsV2Data$inboundSchema = z.union([
Flag$inboundSchema.and(z.object({ typeName: z.literal("flag") })),
MarketplaceFlag$inboundSchema,
]);
export function listFlagsV2DataFromJSON(jsonString) {
return safeParse(jsonString, (x) => ListFlagsV2Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListFlagsV2Data' from JSON`);
}
/** @internal */
export const ListFlagsV2ResponseBody$inboundSchema = z.object({
pagination: z.lazy(() => ListFlagsV2Pagination$inboundSchema),
data: z.array(z.union([
Flag$inboundSchema.and(z.object({ typeName: z.literal("flag") })),
MarketplaceFlag$inboundSchema,
])),
});
export function listFlagsV2ResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => ListFlagsV2ResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListFlagsV2ResponseBody' from JSON`);
}
//# sourceMappingURL=listflagsv2op.js.map