zorihq 0.0.3 → 0.2.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 +22 -0
- package/package.json +1 -1
- package/resources/v1/analytics/analytics.d.mts +55 -0
- package/resources/v1/analytics/analytics.d.mts.map +1 -0
- package/resources/v1/analytics/analytics.d.ts +55 -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 +80 -0
- package/resources/v1/analytics/visitors.d.mts.map +1 -0
- package/resources/v1/analytics/visitors.d.ts +80 -0
- package/resources/v1/analytics/visitors.d.ts.map +1 -0
- package/resources/v1/analytics/visitors.js +55 -0
- package/resources/v1/analytics/visitors.js.map +1 -0
- package/resources/v1/analytics/visitors.mjs +51 -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 +2 -0
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -0
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +2 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/projects.d.mts +112 -0
- package/resources/v1/projects.d.mts.map +1 -0
- package/resources/v1/projects.d.ts +112 -0
- package/resources/v1/projects.d.ts.map +1 -0
- package/resources/v1/projects.js +71 -0
- package/resources/v1/projects.js.map +1 -0
- package/resources/v1/projects.mjs +67 -0
- package/resources/v1/projects.mjs.map +1 -0
- package/resources/v1/v1.d.mts +8 -0
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +8 -0
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +8 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +8 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/analytics/analytics.ts +101 -0
- package/src/resources/v1/analytics/events.ts +39 -0
- package/src/resources/v1/analytics/index.ts +20 -0
- package/src/resources/v1/analytics/visitors.ts +110 -0
- package/src/resources/v1/analytics.ts +3 -0
- package/src/resources/v1/index.ts +22 -0
- package/src/resources/v1/projects.ts +172 -0
- package/src/resources/v1/v1.ts +52 -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
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as AuthAPI from "./auth.mjs";
|
|
4
4
|
import { Auth, } from "./auth.mjs";
|
|
5
|
+
import * as ProjectsAPI from "./projects.mjs";
|
|
6
|
+
import { Projects, } from "./projects.mjs";
|
|
7
|
+
import * as AnalyticsAPI from "./analytics/analytics.mjs";
|
|
8
|
+
import { Analytics, } from "./analytics/analytics.mjs";
|
|
5
9
|
export class V1 extends APIResource {
|
|
6
10
|
constructor() {
|
|
7
11
|
super(...arguments);
|
|
12
|
+
this.analytics = new AnalyticsAPI.Analytics(this._client);
|
|
13
|
+
this.projects = new ProjectsAPI.Projects(this._client);
|
|
8
14
|
this.auth = new AuthAPI.Auth(this._client);
|
|
9
15
|
}
|
|
10
16
|
}
|
|
17
|
+
V1.Analytics = Analytics;
|
|
18
|
+
V1.Projects = Projects;
|
|
11
19
|
V1.Auth = Auth;
|
|
12
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;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAED,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,GASV;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,101 @@
|
|
|
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,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,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Analytics,
|
|
5
|
+
type CountryDataPoint,
|
|
6
|
+
type OriginDataPoint,
|
|
7
|
+
type RecentEvent,
|
|
8
|
+
type RecentEventsResponse,
|
|
9
|
+
type VisitorDataPoint,
|
|
10
|
+
type VisitorsByCountryResponse,
|
|
11
|
+
type VisitorsByDeviceResponse,
|
|
12
|
+
type VisitorsByOriginResponse,
|
|
13
|
+
} from './analytics';
|
|
14
|
+
export { Events, type EventRecentParams } from './events';
|
|
15
|
+
export {
|
|
16
|
+
Visitors,
|
|
17
|
+
type VisitorByCountryParams,
|
|
18
|
+
type VisitorByDeviceParams,
|
|
19
|
+
type VisitorByOriginParams,
|
|
20
|
+
} from './visitors';
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
export interface VisitorByCountryParams {
|
|
69
|
+
/**
|
|
70
|
+
* Project ID
|
|
71
|
+
*/
|
|
72
|
+
project_id: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Time range
|
|
76
|
+
*/
|
|
77
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface VisitorByDeviceParams {
|
|
81
|
+
/**
|
|
82
|
+
* Project ID
|
|
83
|
+
*/
|
|
84
|
+
project_id: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Time range
|
|
88
|
+
*/
|
|
89
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface VisitorByOriginParams {
|
|
93
|
+
/**
|
|
94
|
+
* Project ID
|
|
95
|
+
*/
|
|
96
|
+
project_id: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Time range
|
|
100
|
+
*/
|
|
101
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare namespace Visitors {
|
|
105
|
+
export {
|
|
106
|
+
type VisitorByCountryParams as VisitorByCountryParams,
|
|
107
|
+
type VisitorByDeviceParams as VisitorByDeviceParams,
|
|
108
|
+
type VisitorByOriginParams as VisitorByOriginParams,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
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 OriginDataPoint,
|
|
7
|
+
type RecentEvent,
|
|
8
|
+
type RecentEventsResponse,
|
|
9
|
+
type VisitorDataPoint,
|
|
10
|
+
type VisitorsByCountryResponse,
|
|
11
|
+
type VisitorsByDeviceResponse,
|
|
12
|
+
type VisitorsByOriginResponse,
|
|
13
|
+
} from './analytics/index';
|
|
3
14
|
export {
|
|
4
15
|
Auth,
|
|
5
16
|
type Account,
|
|
@@ -13,4 +24,15 @@ export {
|
|
|
13
24
|
type AuthRegisterAccountParams,
|
|
14
25
|
type AuthRequestPasswordRecoveryParams,
|
|
15
26
|
} from './auth';
|
|
27
|
+
export {
|
|
28
|
+
Projects,
|
|
29
|
+
type CreateProjectRequest,
|
|
30
|
+
type ListProjectsResponse,
|
|
31
|
+
type Project,
|
|
32
|
+
type ProjectResponse,
|
|
33
|
+
type UpdateProjectRequest,
|
|
34
|
+
type ProjectDeleteResponse,
|
|
35
|
+
type ProjectCreateParams,
|
|
36
|
+
type ProjectUpdateParams,
|
|
37
|
+
} from './projects';
|
|
16
38
|
export { V1 } from './v1';
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as AuthAPI from './auth';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Projects extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new project for the authenticated user's organization
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const projectResponse = await client.v1.projects.create({
|
|
16
|
+
* name: 'My Awesome Project',
|
|
17
|
+
* website_url: 'https://example.com',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<ProjectResponse> {
|
|
22
|
+
return this._client.post('/api/v1/projects', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Update an existing project's details
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const projectResponse = await client.v1.projects.update(
|
|
31
|
+
* 'id',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
update(id: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<ProjectResponse> {
|
|
36
|
+
return this._client.put(path`/api/v1/projects/${id}`, { body, ...options });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get a list of all projects belonging to the authenticated user's organization
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const listProjectsResponse =
|
|
45
|
+
* await client.v1.projects.list();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(options?: RequestOptions): APIPromise<ListProjectsResponse> {
|
|
49
|
+
return this._client.get('/api/v1/projects/list', options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Delete a project and all its associated data
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const project = await client.v1.projects.delete('id');
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
delete(id: string, options?: RequestOptions): APIPromise<ProjectDeleteResponse> {
|
|
61
|
+
return this._client.delete(path`/api/v1/projects/${id}`, options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get a single project by its ID
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const projectResponse = await client.v1.projects.get('id');
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
get(id: string, options?: RequestOptions): APIPromise<ProjectResponse> {
|
|
73
|
+
return this._client.get(path`/api/v1/projects/${id}`, options);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CreateProjectRequest {
|
|
78
|
+
name: string;
|
|
79
|
+
|
|
80
|
+
website_url: string;
|
|
81
|
+
|
|
82
|
+
allow_localhost?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ListProjectsResponse {
|
|
86
|
+
projects?: Array<Project>;
|
|
87
|
+
|
|
88
|
+
total?: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface Project {
|
|
92
|
+
id?: string;
|
|
93
|
+
|
|
94
|
+
allow_local_host?: boolean;
|
|
95
|
+
|
|
96
|
+
created_at?: string;
|
|
97
|
+
|
|
98
|
+
domain?: string;
|
|
99
|
+
|
|
100
|
+
first_event_received_at?: string;
|
|
101
|
+
|
|
102
|
+
name?: string;
|
|
103
|
+
|
|
104
|
+
organization?: AuthAPI.Organization;
|
|
105
|
+
|
|
106
|
+
organization_id?: string;
|
|
107
|
+
|
|
108
|
+
project_token?: string;
|
|
109
|
+
|
|
110
|
+
updated_at?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ProjectResponse {
|
|
114
|
+
id?: string;
|
|
115
|
+
|
|
116
|
+
allow_local_host?: boolean;
|
|
117
|
+
|
|
118
|
+
created_at?: string;
|
|
119
|
+
|
|
120
|
+
domain?: string;
|
|
121
|
+
|
|
122
|
+
first_event_received_at?: string;
|
|
123
|
+
|
|
124
|
+
name?: string;
|
|
125
|
+
|
|
126
|
+
organization?: AuthAPI.Organization;
|
|
127
|
+
|
|
128
|
+
organization_id?: string;
|
|
129
|
+
|
|
130
|
+
project_token?: string;
|
|
131
|
+
|
|
132
|
+
updated_at?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface UpdateProjectRequest {
|
|
136
|
+
allow_localhost?: boolean;
|
|
137
|
+
|
|
138
|
+
name?: string;
|
|
139
|
+
|
|
140
|
+
website_url?: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type ProjectDeleteResponse = { [key: string]: string };
|
|
144
|
+
|
|
145
|
+
export interface ProjectCreateParams {
|
|
146
|
+
name: string;
|
|
147
|
+
|
|
148
|
+
website_url: string;
|
|
149
|
+
|
|
150
|
+
allow_localhost?: boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface ProjectUpdateParams {
|
|
154
|
+
allow_localhost?: boolean;
|
|
155
|
+
|
|
156
|
+
name?: string;
|
|
157
|
+
|
|
158
|
+
website_url?: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export declare namespace Projects {
|
|
162
|
+
export {
|
|
163
|
+
type CreateProjectRequest as CreateProjectRequest,
|
|
164
|
+
type ListProjectsResponse as ListProjectsResponse,
|
|
165
|
+
type Project as Project,
|
|
166
|
+
type ProjectResponse as ProjectResponse,
|
|
167
|
+
type UpdateProjectRequest as UpdateProjectRequest,
|
|
168
|
+
type ProjectDeleteResponse as ProjectDeleteResponse,
|
|
169
|
+
type ProjectCreateParams as ProjectCreateParams,
|
|
170
|
+
type ProjectUpdateParams as ProjectUpdateParams,
|
|
171
|
+
};
|
|
172
|
+
}
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -15,14 +15,66 @@ import {
|
|
|
15
15
|
MessageResponse,
|
|
16
16
|
Organization,
|
|
17
17
|
} from './auth';
|
|
18
|
+
import * as ProjectsAPI from './projects';
|
|
19
|
+
import {
|
|
20
|
+
CreateProjectRequest,
|
|
21
|
+
ListProjectsResponse,
|
|
22
|
+
Project,
|
|
23
|
+
ProjectCreateParams,
|
|
24
|
+
ProjectDeleteResponse,
|
|
25
|
+
ProjectResponse,
|
|
26
|
+
ProjectUpdateParams,
|
|
27
|
+
Projects,
|
|
28
|
+
UpdateProjectRequest,
|
|
29
|
+
} from './projects';
|
|
30
|
+
import * as AnalyticsAPI from './analytics/analytics';
|
|
31
|
+
import {
|
|
32
|
+
Analytics,
|
|
33
|
+
CountryDataPoint,
|
|
34
|
+
OriginDataPoint,
|
|
35
|
+
RecentEvent,
|
|
36
|
+
RecentEventsResponse,
|
|
37
|
+
VisitorDataPoint,
|
|
38
|
+
VisitorsByCountryResponse,
|
|
39
|
+
VisitorsByDeviceResponse,
|
|
40
|
+
VisitorsByOriginResponse,
|
|
41
|
+
} from './analytics/analytics';
|
|
18
42
|
|
|
19
43
|
export class V1 extends APIResource {
|
|
44
|
+
analytics: AnalyticsAPI.Analytics = new AnalyticsAPI.Analytics(this._client);
|
|
45
|
+
projects: ProjectsAPI.Projects = new ProjectsAPI.Projects(this._client);
|
|
20
46
|
auth: AuthAPI.Auth = new AuthAPI.Auth(this._client);
|
|
21
47
|
}
|
|
22
48
|
|
|
49
|
+
V1.Analytics = Analytics;
|
|
50
|
+
V1.Projects = Projects;
|
|
23
51
|
V1.Auth = Auth;
|
|
24
52
|
|
|
25
53
|
export declare namespace V1 {
|
|
54
|
+
export {
|
|
55
|
+
Analytics as Analytics,
|
|
56
|
+
type CountryDataPoint as CountryDataPoint,
|
|
57
|
+
type OriginDataPoint as OriginDataPoint,
|
|
58
|
+
type RecentEvent as RecentEvent,
|
|
59
|
+
type RecentEventsResponse as RecentEventsResponse,
|
|
60
|
+
type VisitorDataPoint as VisitorDataPoint,
|
|
61
|
+
type VisitorsByCountryResponse as VisitorsByCountryResponse,
|
|
62
|
+
type VisitorsByDeviceResponse as VisitorsByDeviceResponse,
|
|
63
|
+
type VisitorsByOriginResponse as VisitorsByOriginResponse,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
Projects as Projects,
|
|
68
|
+
type CreateProjectRequest as CreateProjectRequest,
|
|
69
|
+
type ListProjectsResponse as ListProjectsResponse,
|
|
70
|
+
type Project as Project,
|
|
71
|
+
type ProjectResponse as ProjectResponse,
|
|
72
|
+
type UpdateProjectRequest as UpdateProjectRequest,
|
|
73
|
+
type ProjectDeleteResponse as ProjectDeleteResponse,
|
|
74
|
+
type ProjectCreateParams as ProjectCreateParams,
|
|
75
|
+
type ProjectUpdateParams as ProjectUpdateParams,
|
|
76
|
+
};
|
|
77
|
+
|
|
26
78
|
export {
|
|
27
79
|
Auth as Auth,
|
|
28
80
|
type Account as Account,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0
|
|
1
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.0
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.0
|
|
1
|
+
export declare const VERSION = "0.2.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.0
|
|
1
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|