@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.6 kB
JavaScript
/*
* 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 CountPageviewsQueryParamSince$outboundSchema = smartUnion([z.number(), z.string()]);
export function countPageviewsQueryParamSinceToJSON(countPageviewsQueryParamSince) {
return JSON.stringify(CountPageviewsQueryParamSince$outboundSchema.parse(countPageviewsQueryParamSince));
}
/** @internal */
export const CountPageviewsQueryParamUntil$outboundSchema = smartUnion([z.number(), z.string()]);
export function countPageviewsQueryParamUntilToJSON(countPageviewsQueryParamUntil) {
return JSON.stringify(CountPageviewsQueryParamUntil$outboundSchema.parse(countPageviewsQueryParamUntil));
}
/** @internal */
export const CountPageviewsRequest$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 countPageviewsRequestToJSON(countPageviewsRequest) {
return JSON.stringify(CountPageviewsRequest$outboundSchema.parse(countPageviewsRequest));
}
/** @internal */
export const CountPageviewsQuery$inboundSchema = z.object({
since: types.string(),
until: types.string(),
filter: types.optional(types.string()),
});
export function countPageviewsQueryFromJSON(jsonString) {
return safeParse(jsonString, (x) => CountPageviewsQuery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountPageviewsQuery' from JSON`);
}
/** @internal */
export const CountPageviewsData2$inboundSchema = z.object({
visitors: types.number(),
pageviews: types.number(),
});
export function countPageviewsData2FromJSON(jsonString) {
return safeParse(jsonString, (x) => CountPageviewsData2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountPageviewsData2' from JSON`);
}
/** @internal */
export const CountPageviewsData1$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 countPageviewsData1FromJSON(jsonString) {
return safeParse(jsonString, (x) => CountPageviewsData1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountPageviewsData1' from JSON`);
}
/** @internal */
export const CountPageviewsData$inboundSchema = smartUnion([
z.lazy(() => CountPageviewsData1$inboundSchema),
z.lazy(() => CountPageviewsData2$inboundSchema),
]);
export function countPageviewsDataFromJSON(jsonString) {
return safeParse(jsonString, (x) => CountPageviewsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountPageviewsData' from JSON`);
}
/** @internal */
export const CountPageviewsResponseBody$inboundSchema = z.object({
version: types.number(),
query: z.lazy(() => CountPageviewsQuery$inboundSchema),
data: smartUnion([
z.lazy(() => CountPageviewsData1$inboundSchema),
z.lazy(() => CountPageviewsData2$inboundSchema),
]),
});
export function countPageviewsResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => CountPageviewsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountPageviewsResponseBody' from JSON`);
}
//# sourceMappingURL=countpageviewsop.js.map