@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>
640 lines • 23.6 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export declare const QueryParam1: {
readonly Hour: "hour";
readonly Day: "day";
readonly Week: "week";
readonly Month: "month";
readonly Year: "year";
readonly Country: "country";
readonly DeviceType: "deviceType";
readonly Environment: "environment";
readonly RequestPath: "requestPath";
readonly ReferrerHostname: "referrerHostname";
readonly OsName: "osName";
readonly BrowserName: "browserName";
readonly Route: "route";
readonly UtmSource: "utmSource";
readonly UtmMedium: "utmMedium";
readonly UtmCampaign: "utmCampaign";
readonly UtmContent: "utmContent";
readonly UtmTerm: "utmTerm";
readonly Flags: "flags";
};
export type QueryParam1 = ClosedEnum<typeof QueryParam1>;
export type By = QueryParam1 | string;
/**
* Timestamp in milliseconds, or a valid Date string.
*
* @remarks
*
* Selects data from (including) this date and time.
* Will be adjusted according to the desired time granularity.
*/
export type Since = number | string;
/**
* Timestamp in milliseconds, or a valid Date string.
*
* @remarks
*
* Selects data until (including) this date.
* Will be adjusted according to the desired time granularity.
*/
export type Until = number | string;
export type AggregatePageviewsRequest = {
/**
* The project identifier or the project name
*/
projectId: string;
/**
* Up to two dimensions used to break down results.
*
* @remarks
*
* At most one time granularity is allowed: hour, day, week, month, year.
*
* Other dimensions: country, deviceType, environment, requestPath, referrerHostname, osName, browserName, route, utmSource, utmMedium, utmCampaign, utmContent, utmTerm.
*
* JSON dimensions: flags. Used bare, it breaks down results by key, for example flags returns one group per flag name. With a key, it breaks down results by that key's value, for example flags/beta_banner. Wrap keys containing characters other than letters, digits, and underscores in single quotes, for example flags/'my-flag'.
*/
by: Array<QueryParam1 | string>;
/**
* Timestamp in milliseconds, or a valid Date string.
*
* @remarks
*
* Selects data from (including) this date and time.
* Will be adjusted according to the desired time granularity.
*/
since: number | string;
/**
* Timestamp in milliseconds, or a valid Date string.
*
* @remarks
*
* Selects data until (including) this date.
* Will be adjusted according to the desired time granularity.
*/
until: number | string;
/**
* Number of distinct results, default to 10. Other results are grouped into "Others" group.
*/
limit?: number | undefined;
/**
* OData-compliant filter. Encode the value when sending it in a URL.
*
* @remarks
*
* Allows filtering on one or multiple dimensions. By default, filters for production environment only.
*
* Supported dimensions: country, deviceType, environment, requestPath, referrerHostname, osName, browserName, route, utmSource, utmMedium, utmCampaign, utmContent, utmTerm.
*
* JSON dimensions filtered by key: flags/<name>, for example flags/beta_banner eq 'true'. Wrap keys containing characters other than letters, digits, and underscores in single quotes, for example flags/'my-flag' eq 'true'.
*
* Supported operations include eq, ne, in, and logical operators and, or, not with parentheses. Functions such as startswith are supported by the OData parser.
*/
filter?: string | undefined;
/**
* The Team identifier to perform the request on behalf of.
*/
teamId?: string | undefined;
/**
* The Team slug to perform the request on behalf of.
*/
slug?: string | undefined;
};
export declare const GroupBy2: {
readonly BrowserName: "browserName";
readonly Country: "country";
readonly DeviceType: "deviceType";
readonly Environment: "environment";
readonly Flags: "flags";
readonly OsName: "osName";
readonly ReferrerHostname: "referrerHostname";
readonly RequestPath: "requestPath";
readonly Route: "route";
readonly UtmCampaign: "utmCampaign";
readonly UtmContent: "utmContent";
readonly UtmMedium: "utmMedium";
readonly UtmSource: "utmSource";
readonly UtmTerm: "utmTerm";
};
export type GroupBy2 = ClosedEnum<typeof GroupBy2>;
export type GroupBy = string | GroupBy2;
export type Query = {
since: string;
until: string;
groupBy?: Array<string | GroupBy2> | undefined;
filter?: string | undefined;
limit: number;
};
export type Data2 = {
projectId: string;
country: string;
deviceType: string;
environment: string;
requestPath: string;
referrerHostname: string;
osName: string;
browserName: string;
route: string;
utmSource: string;
utmMedium: string;
utmCampaign: string;
utmContent: string;
utmTerm: string;
flags: string;
errorMessage: string;
entryRevalidateSeconds: string;
projectName: string;
deploymentId: string;
pathType: string;
pathTypeVariant: string;
requestHostname: string;
requestResolvedIp: string;
requestMethod: string;
requestExtension: string;
requestId: string;
requestApi: string;
referrerUrl: string;
serverActionName: string;
httpStatus: string;
errorCode: string;
source: string;
edgeType: string;
reason: string;
edgeNetworkRegion: string;
functionRegion: string;
imageTransformationRegion: string;
dataCacheRegion: string;
cause: string;
runtime: string;
provider: string;
isrCacheRegion: string;
isrAction: string;
cacheResult: string;
cacheOperation: string;
cacheHostname: string;
cachePath: string;
cacheHitState: string;
cacheHitLevel: string;
cacheApi: string;
cacheReason: string;
pprState: string;
clientIp: string;
clientIpCountry: string;
clientUserAgent: string;
httpAccept: string;
clientJa4Digest: string;
asnId: string;
asnName: string;
botName: string;
botCategory: string;
botCategoryLegacy: string;
botVerified: string;
botCheckResult: string;
deepAnalysisCheck: string;
wafAction: string;
wafRuleId: string;
ruleCategory: string;
skewProtection: string;
functionStartType: string;
functionDispatcher: string;
isAdditionalRequest: string;
originHostname: string;
originPath: string;
originRoute: string;
fetchType: string;
fetchIndex: string;
imageSource: string;
sourceImage: string;
sourceImagePathname: string;
sourceImageHostname: string;
sourceImageHash: string;
optimizedQuality: string;
optimizedWidthPixels: string;
optimizedFormatMimeType: string;
vdcOperationOrigin: string;
entryName: string;
entryId: string;
entryItemId: string;
tagName: string;
cacheTags: string;
storeId: string;
storeName: string;
blobOperationType: string;
blobOperationLevel: string;
visitorId: string;
eventName: string;
attributionTarget: string;
attributionEventName: string;
metricName: string;
attributes: string;
flagKey: string;
flagVariant: string;
flagEvaluationReason: string;
flagClientName: string;
sdkKeyId: string;
sdkKeyEnvironment: string;
reportingProjectId: string;
reportingProjectName: string;
eventData: string;
middlewareAction: string;
middlewareActionTarget: string;
aiModel: string;
aiGatewayModelId: string;
aiProvider: string;
aiModelType: string;
servedSpeed: string;
virtualModelSlug: string;
virtualModelKind: string;
inferenceEndpointSlug: string;
inferenceScope: string;
inferenceGeoRegion: string;
inferenceProviderRegion: string;
requestedInferenceRegion: string;
costCurrency: string;
marketCostCurrency: string;
cachedInputTokensCurrency: string;
cacheCreationInputTokensCurrency: string;
cacheCreation1hInputTokensCurrency: string;
surchargeCostCurrency: string;
gatewayCostCurrency: string;
keyId: string;
keyName: string;
authMethod: string;
appName: string;
codingAgent: string;
isByok: string;
spendAttribution: string;
isPrivateModel: string;
isStreaming: string;
isRequestZdr: string;
hipaaRequested: string;
quotaRequested: string;
quotaEntityId: string;
quotaEntityType: string;
videoResolution: string;
videoAspectRatio: string;
piiRedactionApplied: string;
moderationApplied: string;
queueName: string;
consumerGroup: string;
messageId: string;
eventType: string;
notificationUrl: string;
queueRegion: string;
sandboxSessionId: string;
sandboxName: string;
workflowRunId: string;
workflowName: string;
workflowStatus: string;
stepRunId: string;
workflowStepName: string;
workflowEventType: string;
region: string;
specVersion: string;
contentType: string;
rewriteDestinationHostname: string;
externalRewriteTargetHost: string;
externalRewriteTargetPath: string;
commitSha: string;
reviewConclusion: string;
pullRequestNumber: string;
repositoryName: string;
repositoryOwner: string;
reviewStatus: string;
pullRequestState: string;
triggeringTag: string;
redirectLocation: string;
microfrontendsResponseReason: string;
microfrontendsMatchedPath: string;
microfrontendsDefaultAppDeploymentId: string;
microfrontendsDefaultAppProjectId: string;
service: string;
isPrefetchRequest: string;
spendReportGroupBy: string;
spendReportDatePart: string;
providerAttemptCanonicalSlug: string;
providerAttemptCredentialType: string;
providerAttemptSuccess: string;
providerAttemptStatusCode: string;
providerAttemptTimeout: string;
providerAttemptIsFinal: string;
providerAttemptNumber: string;
providerAttemptTotalInRequest: string;
generationId: string;
sessionId: string;
contentCaptureStatus: string;
contentCaptureInputs: string;
contentCaptureOutputs: string;
transcriptStatus: string;
transcriptInputs: string;
transcriptOutputs: string;
providerAttemptError: string;
providerAttemptSafetyIdentifier: string;
providerAttemptDevSafetyIdentifier: string;
providerAttemptRegion: string;
providerAttemptModelIndex: string;
toolCallType: string;
toolCallProvider: string;
toolCallSuccess: string;
toolCallErrorType: string;
toolCallStatusCode: string;
environmentId: string;
billableRegion: string;
direction: string;
networkTenancy: string;
trafficSource: string;
networkId: string;
privatelinkEndpointId: string;
privatelinkDnsName: string;
privatelinkIpAddress: string;
additionalProperties?: {
[k: string]: number | null;
} | undefined;
};
export type Data1 = {
projectId?: string | undefined;
country?: string | undefined;
deviceType?: string | undefined;
environment?: string | undefined;
requestPath?: string | undefined;
referrerHostname?: string | undefined;
osName?: string | undefined;
browserName?: string | undefined;
route?: string | undefined;
utmSource?: string | undefined;
utmMedium?: string | undefined;
utmCampaign?: string | undefined;
utmContent?: string | undefined;
utmTerm?: string | undefined;
flags?: string | undefined;
errorMessage?: string | undefined;
entryRevalidateSeconds?: string | undefined;
projectName?: string | undefined;
deploymentId?: string | undefined;
pathType?: string | undefined;
pathTypeVariant?: string | undefined;
requestHostname?: string | undefined;
requestResolvedIp?: string | undefined;
requestMethod?: string | undefined;
requestExtension?: string | undefined;
requestId?: string | undefined;
requestApi?: string | undefined;
referrerUrl?: string | undefined;
serverActionName?: string | undefined;
httpStatus?: string | undefined;
errorCode?: string | undefined;
source?: string | undefined;
edgeType?: string | undefined;
reason?: string | undefined;
edgeNetworkRegion?: string | undefined;
functionRegion?: string | undefined;
imageTransformationRegion?: string | undefined;
dataCacheRegion?: string | undefined;
cause?: string | undefined;
runtime?: string | undefined;
provider?: string | undefined;
isrCacheRegion?: string | undefined;
isrAction?: string | undefined;
cacheResult?: string | undefined;
cacheOperation?: string | undefined;
cacheHostname?: string | undefined;
cachePath?: string | undefined;
cacheHitState?: string | undefined;
cacheHitLevel?: string | undefined;
cacheApi?: string | undefined;
cacheReason?: string | undefined;
pprState?: string | undefined;
clientIp?: string | undefined;
clientIpCountry?: string | undefined;
clientUserAgent?: string | undefined;
httpAccept?: string | undefined;
clientJa4Digest?: string | undefined;
asnId?: string | undefined;
asnName?: string | undefined;
botName?: string | undefined;
botCategory?: string | undefined;
botCategoryLegacy?: string | undefined;
botVerified?: string | undefined;
botCheckResult?: string | undefined;
deepAnalysisCheck?: string | undefined;
wafAction?: string | undefined;
wafRuleId?: string | undefined;
ruleCategory?: string | undefined;
skewProtection?: string | undefined;
functionStartType?: string | undefined;
functionDispatcher?: string | undefined;
isAdditionalRequest?: string | undefined;
originHostname?: string | undefined;
originPath?: string | undefined;
originRoute?: string | undefined;
fetchType?: string | undefined;
fetchIndex?: string | undefined;
imageSource?: string | undefined;
sourceImage?: string | undefined;
sourceImagePathname?: string | undefined;
sourceImageHostname?: string | undefined;
sourceImageHash?: string | undefined;
optimizedQuality?: string | undefined;
optimizedWidthPixels?: string | undefined;
optimizedFormatMimeType?: string | undefined;
vdcOperationOrigin?: string | undefined;
entryName?: string | undefined;
entryId?: string | undefined;
entryItemId?: string | undefined;
tagName?: string | undefined;
cacheTags?: string | undefined;
storeId?: string | undefined;
storeName?: string | undefined;
blobOperationType?: string | undefined;
blobOperationLevel?: string | undefined;
visitorId?: string | undefined;
eventName?: string | undefined;
attributionTarget?: string | undefined;
attributionEventName?: string | undefined;
metricName?: string | undefined;
attributes?: string | undefined;
flagKey?: string | undefined;
flagVariant?: string | undefined;
flagEvaluationReason?: string | undefined;
flagClientName?: string | undefined;
sdkKeyId?: string | undefined;
sdkKeyEnvironment?: string | undefined;
reportingProjectId?: string | undefined;
reportingProjectName?: string | undefined;
eventData?: string | undefined;
middlewareAction?: string | undefined;
middlewareActionTarget?: string | undefined;
aiModel?: string | undefined;
aiGatewayModelId?: string | undefined;
aiProvider?: string | undefined;
aiModelType?: string | undefined;
servedSpeed?: string | undefined;
virtualModelSlug?: string | undefined;
virtualModelKind?: string | undefined;
inferenceEndpointSlug?: string | undefined;
inferenceScope?: string | undefined;
inferenceGeoRegion?: string | undefined;
inferenceProviderRegion?: string | undefined;
requestedInferenceRegion?: string | undefined;
costCurrency?: string | undefined;
marketCostCurrency?: string | undefined;
cachedInputTokensCurrency?: string | undefined;
cacheCreationInputTokensCurrency?: string | undefined;
cacheCreation1hInputTokensCurrency?: string | undefined;
surchargeCostCurrency?: string | undefined;
gatewayCostCurrency?: string | undefined;
keyId?: string | undefined;
keyName?: string | undefined;
authMethod?: string | undefined;
appName?: string | undefined;
codingAgent?: string | undefined;
isByok?: string | undefined;
spendAttribution?: string | undefined;
isPrivateModel?: string | undefined;
isStreaming?: string | undefined;
isRequestZdr?: string | undefined;
hipaaRequested?: string | undefined;
quotaRequested?: string | undefined;
quotaEntityId?: string | undefined;
quotaEntityType?: string | undefined;
videoResolution?: string | undefined;
videoAspectRatio?: string | undefined;
piiRedactionApplied?: string | undefined;
moderationApplied?: string | undefined;
queueName?: string | undefined;
consumerGroup?: string | undefined;
messageId?: string | undefined;
eventType?: string | undefined;
notificationUrl?: string | undefined;
queueRegion?: string | undefined;
sandboxSessionId?: string | undefined;
sandboxName?: string | undefined;
workflowRunId?: string | undefined;
workflowName?: string | undefined;
workflowStatus?: string | undefined;
stepRunId?: string | undefined;
workflowStepName?: string | undefined;
workflowEventType?: string | undefined;
region?: string | undefined;
specVersion?: string | undefined;
contentType?: string | undefined;
rewriteDestinationHostname?: string | undefined;
externalRewriteTargetHost?: string | undefined;
externalRewriteTargetPath?: string | undefined;
commitSha?: string | undefined;
reviewConclusion?: string | undefined;
pullRequestNumber?: string | undefined;
repositoryName?: string | undefined;
repositoryOwner?: string | undefined;
reviewStatus?: string | undefined;
pullRequestState?: string | undefined;
triggeringTag?: string | undefined;
redirectLocation?: string | undefined;
microfrontendsResponseReason?: string | undefined;
microfrontendsMatchedPath?: string | undefined;
microfrontendsDefaultAppDeploymentId?: string | undefined;
microfrontendsDefaultAppProjectId?: string | undefined;
service?: string | undefined;
isPrefetchRequest?: string | undefined;
spendReportGroupBy?: string | undefined;
spendReportDatePart?: string | undefined;
providerAttemptCanonicalSlug?: string | undefined;
providerAttemptCredentialType?: string | undefined;
providerAttemptSuccess?: string | undefined;
providerAttemptStatusCode?: string | undefined;
providerAttemptTimeout?: string | undefined;
providerAttemptIsFinal?: string | undefined;
providerAttemptNumber?: string | undefined;
providerAttemptTotalInRequest?: string | undefined;
generationId?: string | undefined;
sessionId?: string | undefined;
contentCaptureStatus?: string | undefined;
contentCaptureInputs?: string | undefined;
contentCaptureOutputs?: string | undefined;
transcriptStatus?: string | undefined;
transcriptInputs?: string | undefined;
transcriptOutputs?: string | undefined;
providerAttemptError?: string | undefined;
providerAttemptSafetyIdentifier?: string | undefined;
providerAttemptDevSafetyIdentifier?: string | undefined;
providerAttemptRegion?: string | undefined;
providerAttemptModelIndex?: string | undefined;
toolCallType?: string | undefined;
toolCallProvider?: string | undefined;
toolCallSuccess?: string | undefined;
toolCallErrorType?: string | undefined;
toolCallStatusCode?: string | undefined;
environmentId?: string | undefined;
billableRegion?: string | undefined;
direction?: string | undefined;
networkTenancy?: string | undefined;
trafficSource?: string | undefined;
networkId?: string | undefined;
privatelinkEndpointId?: string | undefined;
privatelinkDnsName?: string | undefined;
privatelinkIpAddress?: string | undefined;
timestamp: Date;
};
export type AggregatePageviewsData = Array<Data1> | Array<Data2>;
export type AggregatePageviewsResponseBody = {
version: number;
query: Query;
data: Array<Data1> | Array<Data2>;
};
/** @internal */
export declare const QueryParam1$outboundSchema: z.ZodNativeEnum<typeof QueryParam1>;
/** @internal */
export type By$Outbound = string | string;
/** @internal */
export declare const By$outboundSchema: z.ZodType<By$Outbound, z.ZodTypeDef, By>;
export declare function byToJSON(by: By): string;
/** @internal */
export type Since$Outbound = number | string;
/** @internal */
export declare const Since$outboundSchema: z.ZodType<Since$Outbound, z.ZodTypeDef, Since>;
export declare function sinceToJSON(since: Since): string;
/** @internal */
export type Until$Outbound = number | string;
/** @internal */
export declare const Until$outboundSchema: z.ZodType<Until$Outbound, z.ZodTypeDef, Until>;
export declare function untilToJSON(until: Until): string;
/** @internal */
export type AggregatePageviewsRequest$Outbound = {
projectId: string;
by: Array<string | string>;
since: number | string;
until: number | string;
limit: number;
filter?: string | undefined;
teamId?: string | undefined;
slug?: string | undefined;
};
/** @internal */
export declare const AggregatePageviewsRequest$outboundSchema: z.ZodType<AggregatePageviewsRequest$Outbound, z.ZodTypeDef, AggregatePageviewsRequest>;
export declare function aggregatePageviewsRequestToJSON(aggregatePageviewsRequest: AggregatePageviewsRequest): string;
/** @internal */
export declare const GroupBy2$inboundSchema: z.ZodNativeEnum<typeof GroupBy2>;
/** @internal */
export declare const GroupBy$inboundSchema: z.ZodType<GroupBy, z.ZodTypeDef, unknown>;
export declare function groupByFromJSON(jsonString: string): SafeParseResult<GroupBy, SDKValidationError>;
/** @internal */
export declare const Query$inboundSchema: z.ZodType<Query, z.ZodTypeDef, unknown>;
export declare function queryFromJSON(jsonString: string): SafeParseResult<Query, SDKValidationError>;
/** @internal */
export declare const Data2$inboundSchema: z.ZodType<Data2, z.ZodTypeDef, unknown>;
export declare function data2FromJSON(jsonString: string): SafeParseResult<Data2, SDKValidationError>;
/** @internal */
export declare const Data1$inboundSchema: z.ZodType<Data1, z.ZodTypeDef, unknown>;
export declare function data1FromJSON(jsonString: string): SafeParseResult<Data1, SDKValidationError>;
/** @internal */
export declare const AggregatePageviewsData$inboundSchema: z.ZodType<AggregatePageviewsData, z.ZodTypeDef, unknown>;
export declare function aggregatePageviewsDataFromJSON(jsonString: string): SafeParseResult<AggregatePageviewsData, SDKValidationError>;
/** @internal */
export declare const AggregatePageviewsResponseBody$inboundSchema: z.ZodType<AggregatePageviewsResponseBody, z.ZodTypeDef, unknown>;
export declare function aggregatePageviewsResponseBodyFromJSON(jsonString: string): SafeParseResult<AggregatePageviewsResponseBody, SDKValidationError>;
//# sourceMappingURL=aggregatepageviewsop.d.ts.map