|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../../../core/resource'; |
| 4 | +import * as EventsAPI from './events'; |
| 5 | +import { EventRecentParams, Events } from './events'; |
| 6 | +import * as VisitorsAPI from './visitors'; |
| 7 | +import { VisitorByCountryParams, VisitorByDeviceParams, VisitorByOriginParams, Visitors } from './visitors'; |
| 8 | + |
| 9 | +export class Analytics extends APIResource { |
| 10 | + visitors: VisitorsAPI.Visitors = new VisitorsAPI.Visitors(this._client); |
| 11 | + events: EventsAPI.Events = new EventsAPI.Events(this._client); |
| 12 | +} |
| 13 | + |
| 14 | +export interface CountryDataPoint { |
| 15 | + country_code?: string; |
| 16 | + |
| 17 | + unique_visitors?: number; |
| 18 | +} |
| 19 | + |
| 20 | +export interface OriginDataPoint { |
| 21 | + origin?: string; |
| 22 | + |
| 23 | + unique_visitors?: number; |
| 24 | +} |
| 25 | + |
| 26 | +export interface RecentEvent { |
| 27 | + browser_name?: string; |
| 28 | + |
| 29 | + client_timestamp_utc?: string; |
| 30 | + |
| 31 | + device_type?: string; |
| 32 | + |
| 33 | + event_name?: string; |
| 34 | + |
| 35 | + location_city?: string; |
| 36 | + |
| 37 | + location_country_iso?: string; |
| 38 | + |
| 39 | + page_path?: string; |
| 40 | + |
| 41 | + page_url?: string; |
| 42 | + |
| 43 | + referrer_url?: string; |
| 44 | + |
| 45 | + visitor_id?: string; |
| 46 | +} |
| 47 | + |
| 48 | +export interface RecentEventsResponse { |
| 49 | + events?: Array<RecentEvent>; |
| 50 | + |
| 51 | + total?: number; |
| 52 | +} |
| 53 | + |
| 54 | +export interface VisitorDataPoint { |
| 55 | + desktop?: number; |
| 56 | + |
| 57 | + mobile?: number; |
| 58 | + |
| 59 | + tablet?: number; |
| 60 | + |
| 61 | + timestamp?: string; |
| 62 | + |
| 63 | + unknown?: number; |
| 64 | +} |
| 65 | + |
| 66 | +export interface VisitorsByCountryResponse { |
| 67 | + data?: Array<CountryDataPoint>; |
| 68 | +} |
| 69 | + |
| 70 | +export interface VisitorsByDeviceResponse { |
| 71 | + data?: Array<VisitorDataPoint>; |
| 72 | +} |
| 73 | + |
| 74 | +export interface VisitorsByOriginResponse { |
| 75 | + data?: Array<OriginDataPoint>; |
| 76 | +} |
| 77 | + |
| 78 | +Analytics.Visitors = Visitors; |
| 79 | +Analytics.Events = Events; |
| 80 | + |
| 81 | +export declare namespace Analytics { |
| 82 | + export { |
| 83 | + type CountryDataPoint as CountryDataPoint, |
| 84 | + type OriginDataPoint as OriginDataPoint, |
| 85 | + type RecentEvent as RecentEvent, |
| 86 | + type RecentEventsResponse as RecentEventsResponse, |
| 87 | + type VisitorDataPoint as VisitorDataPoint, |
| 88 | + type VisitorsByCountryResponse as VisitorsByCountryResponse, |
| 89 | + type VisitorsByDeviceResponse as VisitorsByDeviceResponse, |
| 90 | + type VisitorsByOriginResponse as VisitorsByOriginResponse, |
| 91 | + }; |
| 92 | + |
| 93 | + export { |
| 94 | + Visitors as Visitors, |
| 95 | + type VisitorByCountryParams as VisitorByCountryParams, |
| 96 | + type VisitorByDeviceParams as VisitorByDeviceParams, |
| 97 | + type VisitorByOriginParams as VisitorByOriginParams, |
| 98 | + }; |
| 99 | + |
| 100 | + export { Events as Events, type EventRecentParams as EventRecentParams }; |
| 101 | +} |
0 commit comments