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>

294 lines 11.4 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js"; import * as types from "../types/primitives.js"; import { smartUnion } from "../types/smartUnion.js"; /** @internal */ export const CountEventsQueryParamSince$outboundSchema = smartUnion([z.number(), z.string()]); export function countEventsQueryParamSinceToJSON(countEventsQueryParamSince) { return JSON.stringify(CountEventsQueryParamSince$outboundSchema.parse(countEventsQueryParamSince)); } /** @internal */ export const CountEventsQueryParamUntil$outboundSchema = smartUnion([z.number(), z.string()]); export function countEventsQueryParamUntilToJSON(countEventsQueryParamUntil) { return JSON.stringify(CountEventsQueryParamUntil$outboundSchema.parse(countEventsQueryParamUntil)); } /** @internal */ export const CountEventsRequest$outboundSchema = z.object({ projectId: z.string(), since: smartUnion([z.number(), z.string()]).optional(), until: smartUnion([z.number(), z.string()]).optional(), filter: z.string().optional(), teamId: z.string().optional(), slug: z.string().optional(), }); export function countEventsRequestToJSON(countEventsRequest) { return JSON.stringify(CountEventsRequest$outboundSchema.parse(countEventsRequest)); } /** @internal */ export const CountEventsQuery$inboundSchema = z.object({ since: types.string(), until: types.string(), filter: types.optional(types.string()), }); export function countEventsQueryFromJSON(jsonString) { return safeParse(jsonString, (x) => CountEventsQuery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountEventsQuery' from JSON`); } /** @internal */ export const CountEventsData2$inboundSchema = z.object({ visitors: types.number(), count: types.number(), }); export function countEventsData2FromJSON(jsonString) { return safeParse(jsonString, (x) => CountEventsData2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountEventsData2' from JSON`); } /** @internal */ export const CountEventsData1$inboundSchema = collectExtraKeys$(z.object({ projectId: types.string(), country: types.string(), deviceType: types.string(), environment: types.string(), requestPath: types.string(), referrerHostname: types.string(), osName: types.string(), browserName: types.string(), route: types.string(), utmSource: types.string(), utmMedium: types.string(), utmCampaign: types.string(), utmContent: types.string(), utmTerm: types.string(), flags: types.string(), errorMessage: types.string(), entryRevalidateSeconds: types.string(), projectName: types.string(), deploymentId: types.string(), pathType: types.string(), pathTypeVariant: types.string(), requestHostname: types.string(), requestResolvedIp: types.string(), requestMethod: types.string(), requestExtension: types.string(), requestId: types.string(), requestApi: types.string(), referrerUrl: types.string(), serverActionName: types.string(), httpStatus: types.string(), errorCode: types.string(), source: types.string(), edgeType: types.string(), reason: types.string(), edgeNetworkRegion: types.string(), functionRegion: types.string(), imageTransformationRegion: types.string(), dataCacheRegion: types.string(), cause: types.string(), runtime: types.string(), provider: types.string(), isrCacheRegion: types.string(), isrAction: types.string(), cacheResult: types.string(), cacheOperation: types.string(), cacheHostname: types.string(), cachePath: types.string(), cacheHitState: types.string(), cacheHitLevel: types.string(), cacheApi: types.string(), cacheReason: types.string(), pprState: types.string(), clientIp: types.string(), clientIpCountry: types.string(), clientUserAgent: types.string(), httpAccept: types.string(), clientJa4Digest: types.string(), asnId: types.string(), asnName: types.string(), botName: types.string(), botCategory: types.string(), botCategoryLegacy: types.string(), botVerified: types.string(), botCheckResult: types.string(), deepAnalysisCheck: types.string(), wafAction: types.string(), wafRuleId: types.string(), ruleCategory: types.string(), skewProtection: types.string(), functionStartType: types.string(), functionDispatcher: types.string(), isAdditionalRequest: types.string(), originHostname: types.string(), originPath: types.string(), originRoute: types.string(), fetchType: types.string(), fetchIndex: types.string(), imageSource: types.string(), sourceImage: types.string(), sourceImagePathname: types.string(), sourceImageHostname: types.string(), sourceImageHash: types.string(), optimizedQuality: types.string(), optimizedWidthPixels: types.string(), optimizedFormatMimeType: types.string(), vdcOperationOrigin: types.string(), entryName: types.string(), entryId: types.string(), entryItemId: types.string(), tagName: types.string(), cacheTags: types.string(), storeId: types.string(), storeName: types.string(), blobOperationType: types.string(), blobOperationLevel: types.string(), visitorId: types.string(), eventName: types.string(), attributionTarget: types.string(), attributionEventName: types.string(), metricName: types.string(), attributes: types.string(), flagKey: types.string(), flagVariant: types.string(), flagEvaluationReason: types.string(), flagClientName: types.string(), sdkKeyId: types.string(), sdkKeyEnvironment: types.string(), reportingProjectId: types.string(), reportingProjectName: types.string(), eventData: types.string(), middlewareAction: types.string(), middlewareActionTarget: types.string(), aiModel: types.string(), aiGatewayModelId: types.string(), aiProvider: types.string(), aiModelType: types.string(), servedSpeed: types.string(), virtualModelSlug: types.string(), virtualModelKind: types.string(), inferenceEndpointSlug: types.string(), inferenceScope: types.string(), inferenceGeoRegion: types.string(), inferenceProviderRegion: types.string(), requestedInferenceRegion: types.string(), costCurrency: types.string(), marketCostCurrency: types.string(), cachedInputTokensCurrency: types.string(), cacheCreationInputTokensCurrency: types.string(), cacheCreation1hInputTokensCurrency: types.string(), surchargeCostCurrency: types.string(), gatewayCostCurrency: types.string(), keyId: types.string(), keyName: types.string(), authMethod: types.string(), appName: types.string(), codingAgent: types.string(), isByok: types.string(), spendAttribution: types.string(), isPrivateModel: types.string(), isStreaming: types.string(), isRequestZdr: types.string(), hipaaRequested: types.string(), quotaRequested: types.string(), quotaEntityId: types.string(), quotaEntityType: types.string(), videoResolution: types.string(), videoAspectRatio: types.string(), piiRedactionApplied: types.string(), moderationApplied: types.string(), queueName: types.string(), consumerGroup: types.string(), messageId: types.string(), eventType: types.string(), notificationUrl: types.string(), queueRegion: types.string(), sandboxSessionId: types.string(), sandboxName: types.string(), workflowRunId: types.string(), workflowName: types.string(), workflowStatus: types.string(), stepRunId: types.string(), workflowStepName: types.string(), workflowEventType: types.string(), region: types.string(), specVersion: types.string(), contentType: types.string(), rewriteDestinationHostname: types.string(), externalRewriteTargetHost: types.string(), externalRewriteTargetPath: types.string(), commitSha: types.string(), reviewConclusion: types.string(), pullRequestNumber: types.string(), repositoryName: types.string(), repositoryOwner: types.string(), reviewStatus: types.string(), pullRequestState: types.string(), triggeringTag: types.string(), redirectLocation: types.string(), microfrontendsResponseReason: types.string(), microfrontendsMatchedPath: types.string(), microfrontendsDefaultAppDeploymentId: types.string(), microfrontendsDefaultAppProjectId: types.string(), service: types.string(), isPrefetchRequest: types.string(), spendReportGroupBy: types.string(), spendReportDatePart: types.string(), providerAttemptCanonicalSlug: types.string(), providerAttemptCredentialType: types.string(), providerAttemptSuccess: types.string(), providerAttemptStatusCode: types.string(), providerAttemptTimeout: types.string(), providerAttemptIsFinal: types.string(), providerAttemptNumber: types.string(), providerAttemptTotalInRequest: types.string(), generationId: types.string(), sessionId: types.string(), contentCaptureStatus: types.string(), contentCaptureInputs: types.string(), contentCaptureOutputs: types.string(), transcriptStatus: types.string(), transcriptInputs: types.string(), transcriptOutputs: types.string(), providerAttemptError: types.string(), providerAttemptSafetyIdentifier: types.string(), providerAttemptDevSafetyIdentifier: types.string(), providerAttemptRegion: types.string(), providerAttemptModelIndex: types.string(), toolCallType: types.string(), toolCallProvider: types.string(), toolCallSuccess: types.string(), toolCallErrorType: types.string(), toolCallStatusCode: types.string(), environmentId: types.string(), billableRegion: types.string(), direction: types.string(), networkTenancy: types.string(), trafficSource: types.string(), networkId: types.string(), privatelinkEndpointId: types.string(), privatelinkDnsName: types.string(), privatelinkIpAddress: types.string(), }).catchall(types.number()), "additionalProperties", true); export function countEventsData1FromJSON(jsonString) { return safeParse(jsonString, (x) => CountEventsData1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountEventsData1' from JSON`); } /** @internal */ export const CountEventsData$inboundSchema = smartUnion([ z.lazy(() => CountEventsData1$inboundSchema), z.lazy(() => CountEventsData2$inboundSchema), ]); export function countEventsDataFromJSON(jsonString) { return safeParse(jsonString, (x) => CountEventsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountEventsData' from JSON`); } /** @internal */ export const CountEventsResponseBody$inboundSchema = z.object({ version: types.number(), query: z.lazy(() => CountEventsQuery$inboundSchema), data: smartUnion([ z.lazy(() => CountEventsData1$inboundSchema), z.lazy(() => CountEventsData2$inboundSchema), ]), }); export function countEventsResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => CountEventsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountEventsResponseBody' from JSON`); } //# sourceMappingURL=counteventsop.js.map