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>

97 lines (91 loc) 2.94 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { webAnalyticsAggregateEvents } from "../funcs/webAnalyticsAggregateEvents.js"; import { webAnalyticsAggregatePageviews } from "../funcs/webAnalyticsAggregatePageviews.js"; import { webAnalyticsCountEvents } from "../funcs/webAnalyticsCountEvents.js"; import { webAnalyticsCountPageviews } from "../funcs/webAnalyticsCountPageviews.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { AggregateEventsRequest, AggregateEventsResponseBody, } from "../models/aggregateeventsop.js"; import { AggregatePageviewsRequest, AggregatePageviewsResponseBody, } from "../models/aggregatepageviewsop.js"; import { CountEventsRequest, CountEventsResponseBody, } from "../models/counteventsop.js"; import { CountPageviewsRequest, CountPageviewsResponseBody, } from "../models/countpageviewsop.js"; import { unwrapAsync } from "../types/fp.js"; export class WebAnalytics extends ClientSDK { /** * Aggregates page views * * @remarks * Counts pageviews on a project, within the requested date range. Results are either aggregated or broken down over time. Results can additionally be broken down by one dimension, and filtered by multiple dimensions. */ async aggregatePageviews( request: AggregatePageviewsRequest, options?: RequestOptions, ): Promise<AggregatePageviewsResponseBody> { return unwrapAsync(webAnalyticsAggregatePageviews( this, request, options, )); } /** * Aggregates custom events * * @remarks * Counts custom events on a project, within the requested date range. Results are either aggregated or broken down over time. Results can additionally be broken down by one dimension, and filtered by multiple dimensions. */ async aggregateEvents( request: AggregateEventsRequest, options?: RequestOptions, ): Promise<AggregateEventsResponseBody> { return unwrapAsync(webAnalyticsAggregateEvents( this, request, options, )); } /** * Counts page views * * @remarks * Counts the number of page views on a project (production only), since Web Analytics was enabled. Results can be filtered on supported dimensions. */ async countPageviews( request: CountPageviewsRequest, options?: RequestOptions, ): Promise<CountPageviewsResponseBody> { return unwrapAsync(webAnalyticsCountPageviews( this, request, options, )); } /** * Counts custom events * * @remarks * Counts the number of custom events on a project (production only), since Web Analytics was enabled. Results can be filtered on supported dimensions. */ async countEvents( request: CountEventsRequest, options?: RequestOptions, ): Promise<CountEventsResponseBody> { return unwrapAsync(webAnalyticsCountEvents( this, request, options, )); } }