zorihq 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/package.json +1 -1
- package/resources/v1/analytics/analytics.d.mts +102 -0
- package/resources/v1/analytics/analytics.d.mts.map +1 -0
- package/resources/v1/analytics/analytics.d.ts +102 -0
- package/resources/v1/analytics/analytics.d.ts.map +1 -0
- package/resources/v1/analytics/analytics.js +21 -0
- package/resources/v1/analytics/analytics.js.map +1 -0
- package/resources/v1/analytics/analytics.mjs +16 -0
- package/resources/v1/analytics/analytics.mjs.map +1 -0
- package/resources/v1/analytics/events.d.mts +32 -0
- package/resources/v1/analytics/events.d.mts.map +1 -0
- package/resources/v1/analytics/events.d.ts +32 -0
- package/resources/v1/analytics/events.d.ts.map +1 -0
- package/resources/v1/analytics/events.js +23 -0
- package/resources/v1/analytics/events.js.map +1 -0
- package/resources/v1/analytics/events.mjs +19 -0
- package/resources/v1/analytics/events.mjs.map +1 -0
- package/resources/v1/analytics/index.d.mts +4 -0
- package/resources/v1/analytics/index.d.mts.map +1 -0
- package/resources/v1/analytics/index.d.ts +4 -0
- package/resources/v1/analytics/index.d.ts.map +1 -0
- package/resources/v1/analytics/index.js +11 -0
- package/resources/v1/analytics/index.js.map +1 -0
- package/resources/v1/analytics/index.mjs +5 -0
- package/resources/v1/analytics/index.mjs.map +1 -0
- package/resources/v1/analytics/visitors.d.mts +155 -0
- package/resources/v1/analytics/visitors.d.mts.map +1 -0
- package/resources/v1/analytics/visitors.d.ts +155 -0
- package/resources/v1/analytics/visitors.d.ts.map +1 -0
- package/resources/v1/analytics/visitors.js +102 -0
- package/resources/v1/analytics/visitors.js.map +1 -0
- package/resources/v1/analytics/visitors.mjs +98 -0
- package/resources/v1/analytics/visitors.mjs.map +1 -0
- package/resources/v1/analytics.d.mts +2 -0
- package/resources/v1/analytics.d.mts.map +1 -0
- package/resources/v1/analytics.d.ts +2 -0
- package/resources/v1/analytics.d.ts.map +1 -0
- package/resources/v1/analytics.js +6 -0
- package/resources/v1/analytics.js.map +1 -0
- package/resources/v1/analytics.mjs +3 -0
- package/resources/v1/analytics.mjs.map +1 -0
- package/resources/v1/index.d.mts +1 -0
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -0
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/projects.d.mts +6 -0
- package/resources/v1/projects.d.mts.map +1 -1
- package/resources/v1/projects.d.ts +6 -0
- package/resources/v1/projects.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +4 -0
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +4 -0
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/analytics/analytics.ts +199 -0
- package/src/resources/v1/analytics/events.ts +39 -0
- package/src/resources/v1/analytics/index.ts +30 -0
- package/src/resources/v1/analytics/visitors.ts +210 -0
- package/src/resources/v1/analytics.ts +3 -0
- package/src/resources/v1/index.ts +18 -0
- package/src/resources/v1/projects.ts +12 -0
- package/src/resources/v1/v1.ts +40 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/v1/v1.mjs
CHANGED
|
@@ -4,13 +4,17 @@ import * as AuthAPI from "./auth.mjs";
|
|
|
4
4
|
import { Auth, } from "./auth.mjs";
|
|
5
5
|
import * as ProjectsAPI from "./projects.mjs";
|
|
6
6
|
import { Projects, } from "./projects.mjs";
|
|
7
|
+
import * as AnalyticsAPI from "./analytics/analytics.mjs";
|
|
8
|
+
import { Analytics, } from "./analytics/analytics.mjs";
|
|
7
9
|
export class V1 extends APIResource {
|
|
8
10
|
constructor() {
|
|
9
11
|
super(...arguments);
|
|
12
|
+
this.analytics = new AnalyticsAPI.Analytics(this._client);
|
|
10
13
|
this.projects = new ProjectsAPI.Projects(this._client);
|
|
11
14
|
this.auth = new AuthAPI.Auth(this._client);
|
|
12
15
|
}
|
|
13
16
|
}
|
|
17
|
+
V1.Analytics = Analytics;
|
|
14
18
|
V1.Projects = Projects;
|
|
15
19
|
V1.Auth = Auth;
|
|
16
20
|
//# sourceMappingURL=v1.mjs.map
|
package/resources/v1/v1.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAEL,IAAI,GAUL;OACM,KAAK,WAAW;OAChB,EAQL,QAAQ,GAET;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAED,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACvB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAEL,IAAI,GAUL;OACM,KAAK,WAAW;OAChB,EAQL,QAAQ,GAET;OACM,KAAK,YAAY;OACjB,EACL,SAAS,GAgBV;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAED,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;AACzB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACvB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
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 {
|
|
8
|
+
VisitorByCountryParams,
|
|
9
|
+
VisitorByDeviceParams,
|
|
10
|
+
VisitorByOriginParams,
|
|
11
|
+
VisitorProfileParams,
|
|
12
|
+
VisitorTimelineParams,
|
|
13
|
+
VisitorTopParams,
|
|
14
|
+
Visitors,
|
|
15
|
+
} from './visitors';
|
|
16
|
+
|
|
17
|
+
export class Analytics extends APIResource {
|
|
18
|
+
visitors: VisitorsAPI.Visitors = new VisitorsAPI.Visitors(this._client);
|
|
19
|
+
events: EventsAPI.Events = new EventsAPI.Events(this._client);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CountryDataPoint {
|
|
23
|
+
country_code?: string;
|
|
24
|
+
|
|
25
|
+
unique_visitors?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface EventsOverTimeDataPoint {
|
|
29
|
+
event_count?: number;
|
|
30
|
+
|
|
31
|
+
timestamp?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface OriginDataPoint {
|
|
35
|
+
origin?: string;
|
|
36
|
+
|
|
37
|
+
unique_visitors?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface RecentEvent {
|
|
41
|
+
browser_name?: string;
|
|
42
|
+
|
|
43
|
+
client_timestamp_utc?: string;
|
|
44
|
+
|
|
45
|
+
device_type?: string;
|
|
46
|
+
|
|
47
|
+
event_name?: string;
|
|
48
|
+
|
|
49
|
+
location_city?: string;
|
|
50
|
+
|
|
51
|
+
location_country_iso?: string;
|
|
52
|
+
|
|
53
|
+
page_path?: string;
|
|
54
|
+
|
|
55
|
+
page_url?: string;
|
|
56
|
+
|
|
57
|
+
referrer_url?: string;
|
|
58
|
+
|
|
59
|
+
visitor_id?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface RecentEventsResponse {
|
|
63
|
+
events?: Array<RecentEvent>;
|
|
64
|
+
|
|
65
|
+
total?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TopVisitor {
|
|
69
|
+
browser_name?: string;
|
|
70
|
+
|
|
71
|
+
device_type?: string;
|
|
72
|
+
|
|
73
|
+
event_count?: number;
|
|
74
|
+
|
|
75
|
+
first_seen?: string;
|
|
76
|
+
|
|
77
|
+
last_seen?: string;
|
|
78
|
+
|
|
79
|
+
location_city?: string;
|
|
80
|
+
|
|
81
|
+
location_country_iso?: string;
|
|
82
|
+
|
|
83
|
+
visitor_id?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface TopVisitorsResponse {
|
|
87
|
+
total?: number;
|
|
88
|
+
|
|
89
|
+
visitors?: Array<TopVisitor>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface UniqueVisitorsDataPoint {
|
|
93
|
+
desktop?: number;
|
|
94
|
+
|
|
95
|
+
mobile?: number;
|
|
96
|
+
|
|
97
|
+
timestamp?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface UniqueVisitorsTimelineResponse {
|
|
101
|
+
data?: Array<UniqueVisitorsDataPoint>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface VisitorDataPoint {
|
|
105
|
+
desktop?: number;
|
|
106
|
+
|
|
107
|
+
mobile?: number;
|
|
108
|
+
|
|
109
|
+
tablet?: number;
|
|
110
|
+
|
|
111
|
+
timestamp?: string;
|
|
112
|
+
|
|
113
|
+
unknown?: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface VisitorEvent {
|
|
117
|
+
browser_name?: string;
|
|
118
|
+
|
|
119
|
+
client_timestamp_utc?: string;
|
|
120
|
+
|
|
121
|
+
device_type?: string;
|
|
122
|
+
|
|
123
|
+
event_name?: string;
|
|
124
|
+
|
|
125
|
+
page_path?: string;
|
|
126
|
+
|
|
127
|
+
page_url?: string;
|
|
128
|
+
|
|
129
|
+
referrer_url?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface VisitorProfileResponse {
|
|
133
|
+
events?: Array<VisitorEvent>;
|
|
134
|
+
|
|
135
|
+
events_over_time?: Array<EventsOverTimeDataPoint>;
|
|
136
|
+
|
|
137
|
+
first_referrer_url?: string;
|
|
138
|
+
|
|
139
|
+
first_seen?: string;
|
|
140
|
+
|
|
141
|
+
first_traffic_origin?: string;
|
|
142
|
+
|
|
143
|
+
last_seen?: string;
|
|
144
|
+
|
|
145
|
+
location_city?: string;
|
|
146
|
+
|
|
147
|
+
location_country_iso?: string;
|
|
148
|
+
|
|
149
|
+
total_events?: number;
|
|
150
|
+
|
|
151
|
+
visitor_id?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface VisitorsByCountryResponse {
|
|
155
|
+
data?: Array<CountryDataPoint>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface VisitorsByDeviceResponse {
|
|
159
|
+
data?: Array<VisitorDataPoint>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface VisitorsByOriginResponse {
|
|
163
|
+
data?: Array<OriginDataPoint>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
Analytics.Visitors = Visitors;
|
|
167
|
+
Analytics.Events = Events;
|
|
168
|
+
|
|
169
|
+
export declare namespace Analytics {
|
|
170
|
+
export {
|
|
171
|
+
type CountryDataPoint as CountryDataPoint,
|
|
172
|
+
type EventsOverTimeDataPoint as EventsOverTimeDataPoint,
|
|
173
|
+
type OriginDataPoint as OriginDataPoint,
|
|
174
|
+
type RecentEvent as RecentEvent,
|
|
175
|
+
type RecentEventsResponse as RecentEventsResponse,
|
|
176
|
+
type TopVisitor as TopVisitor,
|
|
177
|
+
type TopVisitorsResponse as TopVisitorsResponse,
|
|
178
|
+
type UniqueVisitorsDataPoint as UniqueVisitorsDataPoint,
|
|
179
|
+
type UniqueVisitorsTimelineResponse as UniqueVisitorsTimelineResponse,
|
|
180
|
+
type VisitorDataPoint as VisitorDataPoint,
|
|
181
|
+
type VisitorEvent as VisitorEvent,
|
|
182
|
+
type VisitorProfileResponse as VisitorProfileResponse,
|
|
183
|
+
type VisitorsByCountryResponse as VisitorsByCountryResponse,
|
|
184
|
+
type VisitorsByDeviceResponse as VisitorsByDeviceResponse,
|
|
185
|
+
type VisitorsByOriginResponse as VisitorsByOriginResponse,
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
Visitors as Visitors,
|
|
190
|
+
type VisitorByCountryParams as VisitorByCountryParams,
|
|
191
|
+
type VisitorByDeviceParams as VisitorByDeviceParams,
|
|
192
|
+
type VisitorByOriginParams as VisitorByOriginParams,
|
|
193
|
+
type VisitorProfileParams as VisitorProfileParams,
|
|
194
|
+
type VisitorTimelineParams as VisitorTimelineParams,
|
|
195
|
+
type VisitorTopParams as VisitorTopParams,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export { Events as Events, type EventRecentParams as EventRecentParams };
|
|
199
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as AnalyticsAPI from './analytics';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Events extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get a list of the most recent events (default: 15 events)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const recentEventsResponse =
|
|
15
|
+
* await client.v1.analytics.events.recent({
|
|
16
|
+
* project_id: 'project_id',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
recent(query: EventRecentParams, options?: RequestOptions): APIPromise<AnalyticsAPI.RecentEventsResponse> {
|
|
21
|
+
return this._client.get('/api/v1/analytics/events/recent', { query, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface EventRecentParams {
|
|
26
|
+
/**
|
|
27
|
+
* Project ID
|
|
28
|
+
*/
|
|
29
|
+
project_id: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Maximum number of events to return (default: 15)
|
|
33
|
+
*/
|
|
34
|
+
limit?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare namespace Events {
|
|
38
|
+
export { type EventRecentParams as EventRecentParams };
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Analytics,
|
|
5
|
+
type CountryDataPoint,
|
|
6
|
+
type EventsOverTimeDataPoint,
|
|
7
|
+
type OriginDataPoint,
|
|
8
|
+
type RecentEvent,
|
|
9
|
+
type RecentEventsResponse,
|
|
10
|
+
type TopVisitor,
|
|
11
|
+
type TopVisitorsResponse,
|
|
12
|
+
type UniqueVisitorsDataPoint,
|
|
13
|
+
type UniqueVisitorsTimelineResponse,
|
|
14
|
+
type VisitorDataPoint,
|
|
15
|
+
type VisitorEvent,
|
|
16
|
+
type VisitorProfileResponse,
|
|
17
|
+
type VisitorsByCountryResponse,
|
|
18
|
+
type VisitorsByDeviceResponse,
|
|
19
|
+
type VisitorsByOriginResponse,
|
|
20
|
+
} from './analytics';
|
|
21
|
+
export { Events, type EventRecentParams } from './events';
|
|
22
|
+
export {
|
|
23
|
+
Visitors,
|
|
24
|
+
type VisitorByCountryParams,
|
|
25
|
+
type VisitorByDeviceParams,
|
|
26
|
+
type VisitorByOriginParams,
|
|
27
|
+
type VisitorProfileParams,
|
|
28
|
+
type VisitorTimelineParams,
|
|
29
|
+
type VisitorTopParams,
|
|
30
|
+
} from './visitors';
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as AnalyticsAPI from './analytics';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Visitors extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get unique visitor counts grouped by country code
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const visitorsByCountryResponse =
|
|
15
|
+
* await client.v1.analytics.visitors.byCountry({
|
|
16
|
+
* project_id: 'project_id',
|
|
17
|
+
* time_range: 'last_hour',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
byCountry(
|
|
22
|
+
query: VisitorByCountryParams,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<AnalyticsAPI.VisitorsByCountryResponse> {
|
|
25
|
+
return this._client.get('/api/v1/analytics/visitors/country', { query, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get visitor counts grouped by device type (mobile, desktop, tablet) over a
|
|
30
|
+
* specified time range
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const visitorsByDeviceResponse =
|
|
35
|
+
* await client.v1.analytics.visitors.byDevice({
|
|
36
|
+
* project_id: 'project_id',
|
|
37
|
+
* time_range: 'last_hour',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
byDevice(
|
|
42
|
+
query: VisitorByDeviceParams,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): APIPromise<AnalyticsAPI.VisitorsByDeviceResponse> {
|
|
45
|
+
return this._client.get('/api/v1/analytics/visitors/device', { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get unique visitor counts grouped by referrer domain (traffic source)
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const visitorsByOriginResponse =
|
|
54
|
+
* await client.v1.analytics.visitors.byOrigin({
|
|
55
|
+
* project_id: 'project_id',
|
|
56
|
+
* time_range: 'last_hour',
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
byOrigin(
|
|
61
|
+
query: VisitorByOriginParams,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): APIPromise<AnalyticsAPI.VisitorsByOriginResponse> {
|
|
64
|
+
return this._client.get('/api/v1/analytics/visitors/origin', { query, ...options });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get detailed information about a specific visitor including their event history
|
|
69
|
+
* and aggregated statistics
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const visitorProfileResponse =
|
|
74
|
+
* await client.v1.analytics.visitors.profile({
|
|
75
|
+
* project_id: 'project_id',
|
|
76
|
+
* visitor_id: 'visitor_id',
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
profile(
|
|
81
|
+
query: VisitorProfileParams,
|
|
82
|
+
options?: RequestOptions,
|
|
83
|
+
): APIPromise<AnalyticsAPI.VisitorProfileResponse> {
|
|
84
|
+
return this._client.get('/api/v1/analytics/visitors/profile', { query, ...options });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get unique visitor counts over time, split by mobile and desktop devices for
|
|
89
|
+
* chart visualization
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const uniqueVisitorsTimelineResponse =
|
|
94
|
+
* await client.v1.analytics.visitors.timeline({
|
|
95
|
+
* project_id: 'project_id',
|
|
96
|
+
* time_range: 'last_hour',
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
timeline(
|
|
101
|
+
query: VisitorTimelineParams,
|
|
102
|
+
options?: RequestOptions,
|
|
103
|
+
): APIPromise<AnalyticsAPI.UniqueVisitorsTimelineResponse> {
|
|
104
|
+
return this._client.get('/api/v1/analytics/visitors/timeline', { query, ...options });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get a list of the most active visitors ranked by event count
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const topVisitorsResponse =
|
|
113
|
+
* await client.v1.analytics.visitors.top({
|
|
114
|
+
* project_id: 'project_id',
|
|
115
|
+
* time_range: 'last_hour',
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
top(query: VisitorTopParams, options?: RequestOptions): APIPromise<AnalyticsAPI.TopVisitorsResponse> {
|
|
120
|
+
return this._client.get('/api/v1/analytics/visitors/top', { query, ...options });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface VisitorByCountryParams {
|
|
125
|
+
/**
|
|
126
|
+
* Project ID
|
|
127
|
+
*/
|
|
128
|
+
project_id: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Time range
|
|
132
|
+
*/
|
|
133
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface VisitorByDeviceParams {
|
|
137
|
+
/**
|
|
138
|
+
* Project ID
|
|
139
|
+
*/
|
|
140
|
+
project_id: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Time range
|
|
144
|
+
*/
|
|
145
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface VisitorByOriginParams {
|
|
149
|
+
/**
|
|
150
|
+
* Project ID
|
|
151
|
+
*/
|
|
152
|
+
project_id: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Time range
|
|
156
|
+
*/
|
|
157
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface VisitorProfileParams {
|
|
161
|
+
/**
|
|
162
|
+
* Project ID
|
|
163
|
+
*/
|
|
164
|
+
project_id: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Visitor ID
|
|
168
|
+
*/
|
|
169
|
+
visitor_id: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface VisitorTimelineParams {
|
|
173
|
+
/**
|
|
174
|
+
* Project ID
|
|
175
|
+
*/
|
|
176
|
+
project_id: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Time range
|
|
180
|
+
*/
|
|
181
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface VisitorTopParams {
|
|
185
|
+
/**
|
|
186
|
+
* Project ID
|
|
187
|
+
*/
|
|
188
|
+
project_id: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Time range
|
|
192
|
+
*/
|
|
193
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Maximum number of visitors to return (default: 50)
|
|
197
|
+
*/
|
|
198
|
+
limit?: number;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare namespace Visitors {
|
|
202
|
+
export {
|
|
203
|
+
type VisitorByCountryParams as VisitorByCountryParams,
|
|
204
|
+
type VisitorByDeviceParams as VisitorByDeviceParams,
|
|
205
|
+
type VisitorByOriginParams as VisitorByOriginParams,
|
|
206
|
+
type VisitorProfileParams as VisitorProfileParams,
|
|
207
|
+
type VisitorTimelineParams as VisitorTimelineParams,
|
|
208
|
+
type VisitorTopParams as VisitorTopParams,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
Analytics,
|
|
5
|
+
type CountryDataPoint,
|
|
6
|
+
type EventsOverTimeDataPoint,
|
|
7
|
+
type OriginDataPoint,
|
|
8
|
+
type RecentEvent,
|
|
9
|
+
type RecentEventsResponse,
|
|
10
|
+
type TopVisitor,
|
|
11
|
+
type TopVisitorsResponse,
|
|
12
|
+
type UniqueVisitorsDataPoint,
|
|
13
|
+
type UniqueVisitorsTimelineResponse,
|
|
14
|
+
type VisitorDataPoint,
|
|
15
|
+
type VisitorEvent,
|
|
16
|
+
type VisitorProfileResponse,
|
|
17
|
+
type VisitorsByCountryResponse,
|
|
18
|
+
type VisitorsByDeviceResponse,
|
|
19
|
+
type VisitorsByOriginResponse,
|
|
20
|
+
} from './analytics/index';
|
|
3
21
|
export {
|
|
4
22
|
Auth,
|
|
5
23
|
type Account,
|
|
@@ -93,6 +93,8 @@ export interface Project {
|
|
|
93
93
|
|
|
94
94
|
allow_local_host?: boolean;
|
|
95
95
|
|
|
96
|
+
created_at?: string;
|
|
97
|
+
|
|
96
98
|
domain?: string;
|
|
97
99
|
|
|
98
100
|
first_event_received_at?: string;
|
|
@@ -102,6 +104,10 @@ export interface Project {
|
|
|
102
104
|
organization?: AuthAPI.Organization;
|
|
103
105
|
|
|
104
106
|
organization_id?: string;
|
|
107
|
+
|
|
108
|
+
project_token?: string;
|
|
109
|
+
|
|
110
|
+
updated_at?: string;
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
export interface ProjectResponse {
|
|
@@ -109,6 +115,8 @@ export interface ProjectResponse {
|
|
|
109
115
|
|
|
110
116
|
allow_local_host?: boolean;
|
|
111
117
|
|
|
118
|
+
created_at?: string;
|
|
119
|
+
|
|
112
120
|
domain?: string;
|
|
113
121
|
|
|
114
122
|
first_event_received_at?: string;
|
|
@@ -118,6 +126,10 @@ export interface ProjectResponse {
|
|
|
118
126
|
organization?: AuthAPI.Organization;
|
|
119
127
|
|
|
120
128
|
organization_id?: string;
|
|
129
|
+
|
|
130
|
+
project_token?: string;
|
|
131
|
+
|
|
132
|
+
updated_at?: string;
|
|
121
133
|
}
|
|
122
134
|
|
|
123
135
|
export interface UpdateProjectRequest {
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -27,16 +27,56 @@ import {
|
|
|
27
27
|
Projects,
|
|
28
28
|
UpdateProjectRequest,
|
|
29
29
|
} from './projects';
|
|
30
|
+
import * as AnalyticsAPI from './analytics/analytics';
|
|
31
|
+
import {
|
|
32
|
+
Analytics,
|
|
33
|
+
CountryDataPoint,
|
|
34
|
+
EventsOverTimeDataPoint,
|
|
35
|
+
OriginDataPoint,
|
|
36
|
+
RecentEvent,
|
|
37
|
+
RecentEventsResponse,
|
|
38
|
+
TopVisitor,
|
|
39
|
+
TopVisitorsResponse,
|
|
40
|
+
UniqueVisitorsDataPoint,
|
|
41
|
+
UniqueVisitorsTimelineResponse,
|
|
42
|
+
VisitorDataPoint,
|
|
43
|
+
VisitorEvent,
|
|
44
|
+
VisitorProfileResponse,
|
|
45
|
+
VisitorsByCountryResponse,
|
|
46
|
+
VisitorsByDeviceResponse,
|
|
47
|
+
VisitorsByOriginResponse,
|
|
48
|
+
} from './analytics/analytics';
|
|
30
49
|
|
|
31
50
|
export class V1 extends APIResource {
|
|
51
|
+
analytics: AnalyticsAPI.Analytics = new AnalyticsAPI.Analytics(this._client);
|
|
32
52
|
projects: ProjectsAPI.Projects = new ProjectsAPI.Projects(this._client);
|
|
33
53
|
auth: AuthAPI.Auth = new AuthAPI.Auth(this._client);
|
|
34
54
|
}
|
|
35
55
|
|
|
56
|
+
V1.Analytics = Analytics;
|
|
36
57
|
V1.Projects = Projects;
|
|
37
58
|
V1.Auth = Auth;
|
|
38
59
|
|
|
39
60
|
export declare namespace V1 {
|
|
61
|
+
export {
|
|
62
|
+
Analytics as Analytics,
|
|
63
|
+
type CountryDataPoint as CountryDataPoint,
|
|
64
|
+
type EventsOverTimeDataPoint as EventsOverTimeDataPoint,
|
|
65
|
+
type OriginDataPoint as OriginDataPoint,
|
|
66
|
+
type RecentEvent as RecentEvent,
|
|
67
|
+
type RecentEventsResponse as RecentEventsResponse,
|
|
68
|
+
type TopVisitor as TopVisitor,
|
|
69
|
+
type TopVisitorsResponse as TopVisitorsResponse,
|
|
70
|
+
type UniqueVisitorsDataPoint as UniqueVisitorsDataPoint,
|
|
71
|
+
type UniqueVisitorsTimelineResponse as UniqueVisitorsTimelineResponse,
|
|
72
|
+
type VisitorDataPoint as VisitorDataPoint,
|
|
73
|
+
type VisitorEvent as VisitorEvent,
|
|
74
|
+
type VisitorProfileResponse as VisitorProfileResponse,
|
|
75
|
+
type VisitorsByCountryResponse as VisitorsByCountryResponse,
|
|
76
|
+
type VisitorsByDeviceResponse as VisitorsByDeviceResponse,
|
|
77
|
+
type VisitorsByOriginResponse as VisitorsByOriginResponse,
|
|
78
|
+
};
|
|
79
|
+
|
|
40
80
|
export {
|
|
41
81
|
Projects as Projects,
|
|
42
82
|
type CreateProjectRequest as CreateProjectRequest,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.3.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.3.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|