zorihq 0.7.0 → 0.9.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 +16 -0
- package/package.json +1 -1
- package/resources/v1/analytics/analytics.d.mts +22 -3
- package/resources/v1/analytics/analytics.d.mts.map +1 -1
- package/resources/v1/analytics/analytics.d.ts +22 -3
- package/resources/v1/analytics/analytics.d.ts.map +1 -1
- package/resources/v1/analytics/analytics.js.map +1 -1
- package/resources/v1/analytics/analytics.mjs.map +1 -1
- package/resources/v1/analytics/events.d.mts +49 -2
- package/resources/v1/analytics/events.d.mts.map +1 -1
- package/resources/v1/analytics/events.d.ts +49 -2
- package/resources/v1/analytics/events.d.ts.map +1 -1
- package/resources/v1/analytics/events.js +16 -1
- package/resources/v1/analytics/events.js.map +1 -1
- package/resources/v1/analytics/events.mjs +16 -1
- package/resources/v1/analytics/events.mjs.map +1 -1
- package/resources/v1/analytics/index.d.mts +2 -2
- package/resources/v1/analytics/index.d.mts.map +1 -1
- package/resources/v1/analytics/index.d.ts +2 -2
- package/resources/v1/analytics/index.d.ts.map +1 -1
- package/resources/v1/analytics/index.js.map +1 -1
- package/resources/v1/analytics/index.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -1
- 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/revenue/attribution.d.mts +62 -0
- package/resources/v1/revenue/attribution.d.mts.map +1 -0
- package/resources/v1/revenue/attribution.d.ts +62 -0
- package/resources/v1/revenue/attribution.d.ts.map +1 -0
- package/resources/v1/revenue/attribution.js +41 -0
- package/resources/v1/revenue/attribution.js.map +1 -0
- package/resources/v1/revenue/attribution.mjs +37 -0
- package/resources/v1/revenue/attribution.mjs.map +1 -0
- package/resources/v1/revenue/conversion.d.mts +34 -0
- package/resources/v1/revenue/conversion.d.mts.map +1 -0
- package/resources/v1/revenue/conversion.d.ts +34 -0
- package/resources/v1/revenue/conversion.d.ts.map +1 -0
- package/resources/v1/revenue/conversion.js +25 -0
- package/resources/v1/revenue/conversion.js.map +1 -0
- package/resources/v1/revenue/conversion.mjs +21 -0
- package/resources/v1/revenue/conversion.mjs.map +1 -0
- package/resources/v1/revenue/customers.d.mts +61 -0
- package/resources/v1/revenue/customers.d.mts.map +1 -0
- package/resources/v1/revenue/customers.d.ts +61 -0
- package/resources/v1/revenue/customers.d.ts.map +1 -0
- package/resources/v1/revenue/customers.js +40 -0
- package/resources/v1/revenue/customers.js.map +1 -0
- package/resources/v1/revenue/customers.mjs +36 -0
- package/resources/v1/revenue/customers.mjs.map +1 -0
- package/resources/v1/revenue/index.d.mts +5 -0
- package/resources/v1/revenue/index.d.mts.map +1 -0
- package/resources/v1/revenue/index.d.ts +5 -0
- package/resources/v1/revenue/index.d.ts.map +1 -0
- package/resources/v1/revenue/index.js +13 -0
- package/resources/v1/revenue/index.js.map +1 -0
- package/resources/v1/revenue/index.mjs +6 -0
- package/resources/v1/revenue/index.mjs.map +1 -0
- package/resources/v1/revenue/revenue.d.mts +255 -0
- package/resources/v1/revenue/revenue.d.mts.map +1 -0
- package/resources/v1/revenue/revenue.d.ts +255 -0
- package/resources/v1/revenue/revenue.d.ts.map +1 -0
- package/resources/v1/revenue/revenue.js +53 -0
- package/resources/v1/revenue/revenue.js.map +1 -0
- package/resources/v1/revenue/revenue.mjs +48 -0
- package/resources/v1/revenue/revenue.mjs.map +1 -0
- package/resources/v1/revenue.d.mts +2 -0
- package/resources/v1/revenue.d.mts.map +1 -0
- package/resources/v1/revenue.d.ts +2 -0
- package/resources/v1/revenue.d.ts.map +1 -0
- package/resources/v1/revenue.js +6 -0
- package/resources/v1/revenue.js.map +1 -0
- package/resources/v1/revenue.mjs +3 -0
- package/resources/v1/revenue.mjs.map +1 -0
- package/resources/v1/v1.d.mts +6 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -2
- 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 +34 -2
- package/src/resources/v1/analytics/events.ts +66 -2
- package/src/resources/v1/analytics/index.ts +2 -1
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/revenue/attribution.ts +84 -0
- package/src/resources/v1/revenue/conversion.ts +44 -0
- package/src/resources/v1/revenue/customers.ts +77 -0
- package/src/resources/v1/revenue/index.ts +23 -0
- package/src/resources/v1/revenue/revenue.ts +385 -0
- package/src/resources/v1/revenue.ts +3 -0
- package/src/resources/v1/v1.ts +42 -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
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as AttributionAPI from "./attribution.mjs";
|
|
3
|
+
import { Attribution, AttributionByOriginParams, AttributionByUtmParams } from "./attribution.mjs";
|
|
4
|
+
import * as ConversionAPI from "./conversion.mjs";
|
|
5
|
+
import { Conversion, ConversionMetricsParams } from "./conversion.mjs";
|
|
6
|
+
import * as CustomersAPI from "./customers.mjs";
|
|
7
|
+
import { CustomerProfileParams, CustomerTopParams, Customers } from "./customers.mjs";
|
|
8
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
9
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
10
|
+
export declare class Revenue extends APIResource {
|
|
11
|
+
attribution: AttributionAPI.Attribution;
|
|
12
|
+
customers: CustomersAPI.Customers;
|
|
13
|
+
conversion: ConversionAPI.Conversion;
|
|
14
|
+
/**
|
|
15
|
+
* Get key revenue metrics including total revenue, conversion rate, and average
|
|
16
|
+
* order value
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const dashboardResponse = await client.v1.revenue.dashboard(
|
|
21
|
+
* { project_id: 'project_id', time_range: 'last_hour' },
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
dashboard(query: RevenueDashboardParams, options?: RequestOptions): APIPromise<DashboardResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Get revenue metrics over time for chart visualization
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const timelineResponse = await client.v1.revenue.timeline({
|
|
32
|
+
* project_id: 'project_id',
|
|
33
|
+
* time_range: 'last_hour',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
timeline(query: RevenueTimelineParams, options?: RequestOptions): APIPromise<TimelineResponse>;
|
|
38
|
+
}
|
|
39
|
+
export interface AttributionByOriginResponse {
|
|
40
|
+
data?: Array<OriginAttributionDataPoint>;
|
|
41
|
+
}
|
|
42
|
+
export interface AttributionByUtmResponse {
|
|
43
|
+
data?: Array<UtmAttributionDataPoint>;
|
|
44
|
+
}
|
|
45
|
+
export interface ConversionMetricsResponse {
|
|
46
|
+
avg_purchases_per_customer?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Time to conversion
|
|
49
|
+
*/
|
|
50
|
+
avg_time_to_first_purchase_hours?: number;
|
|
51
|
+
/**
|
|
52
|
+
* % of visitors who paid
|
|
53
|
+
*/
|
|
54
|
+
conversion_rate?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Customer value
|
|
57
|
+
*/
|
|
58
|
+
customer_lifetime_value?: number;
|
|
59
|
+
median_time_to_first_purchase_hours?: number;
|
|
60
|
+
paying_customers?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Repeat purchase metrics
|
|
63
|
+
*/
|
|
64
|
+
repeat_purchase_rate?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Funnel metrics
|
|
67
|
+
*/
|
|
68
|
+
total_visitors?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface CustomerProfileResponse {
|
|
71
|
+
avg_order_value?: number;
|
|
72
|
+
currency?: string;
|
|
73
|
+
email?: string;
|
|
74
|
+
external_id?: string;
|
|
75
|
+
first_payment_date?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Attribution
|
|
78
|
+
*/
|
|
79
|
+
first_traffic_origin?: string;
|
|
80
|
+
first_utm_campaign?: string;
|
|
81
|
+
first_utm_medium?: string;
|
|
82
|
+
first_utm_source?: string;
|
|
83
|
+
last_payment_date?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
payment_count?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Payment history
|
|
88
|
+
*/
|
|
89
|
+
payments?: Array<Payment>;
|
|
90
|
+
/**
|
|
91
|
+
* Revenue over time (last 90 days)
|
|
92
|
+
*/
|
|
93
|
+
revenue_over_time?: Array<RevenueOverTimeDataPoint>;
|
|
94
|
+
/**
|
|
95
|
+
* Revenue summary
|
|
96
|
+
*/
|
|
97
|
+
total_revenue?: number;
|
|
98
|
+
user_id?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Identity
|
|
101
|
+
*/
|
|
102
|
+
visitor_id?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DashboardResponse {
|
|
105
|
+
/**
|
|
106
|
+
* Average metrics
|
|
107
|
+
*/
|
|
108
|
+
avg_order_value?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Average revenue per paying customer
|
|
111
|
+
*/
|
|
112
|
+
avg_revenue_per_customer?: number;
|
|
113
|
+
avg_revenue_per_identified_customer?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Average revenue per session
|
|
116
|
+
*/
|
|
117
|
+
avg_revenue_per_session?: number;
|
|
118
|
+
/**
|
|
119
|
+
* % of visitors who paid
|
|
120
|
+
*/
|
|
121
|
+
conversion_rate?: number;
|
|
122
|
+
currency?: string;
|
|
123
|
+
identified_customer_revenue?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Identified customers (have email/user_id)
|
|
126
|
+
*/
|
|
127
|
+
identified_customers?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Customer metrics
|
|
130
|
+
*/
|
|
131
|
+
paying_customers?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Count of successful payments
|
|
134
|
+
*/
|
|
135
|
+
total_payments?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Core revenue metrics
|
|
138
|
+
*/
|
|
139
|
+
total_revenue?: number;
|
|
140
|
+
}
|
|
141
|
+
export interface OriginAttributionDataPoint {
|
|
142
|
+
/**
|
|
143
|
+
* Average revenue per paying customer
|
|
144
|
+
*/
|
|
145
|
+
avg_revenue_per_customer?: number;
|
|
146
|
+
/**
|
|
147
|
+
* paying_customers / unique_visitors \* 100
|
|
148
|
+
*/
|
|
149
|
+
conversion_rate?: number;
|
|
150
|
+
currency?: string;
|
|
151
|
+
origin?: string;
|
|
152
|
+
paying_customers?: number;
|
|
153
|
+
payment_count?: number;
|
|
154
|
+
revenue_percentage?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Revenue in smallest currency unit (cents)
|
|
157
|
+
*/
|
|
158
|
+
total_revenue?: number;
|
|
159
|
+
unique_visitors?: number;
|
|
160
|
+
}
|
|
161
|
+
export interface Payment {
|
|
162
|
+
amount?: number;
|
|
163
|
+
currency?: string;
|
|
164
|
+
payment_id?: string;
|
|
165
|
+
payment_timestamp?: string;
|
|
166
|
+
product_name?: string;
|
|
167
|
+
provider_type?: string;
|
|
168
|
+
status?: string;
|
|
169
|
+
}
|
|
170
|
+
export interface RevenueOverTimeDataPoint {
|
|
171
|
+
payment_count?: number;
|
|
172
|
+
timestamp?: string;
|
|
173
|
+
total_revenue?: number;
|
|
174
|
+
}
|
|
175
|
+
export interface TimelineDataPoint {
|
|
176
|
+
currency?: string;
|
|
177
|
+
payment_count?: number;
|
|
178
|
+
timestamp?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Revenue in smallest currency unit (cents)
|
|
181
|
+
*/
|
|
182
|
+
total_revenue?: number;
|
|
183
|
+
}
|
|
184
|
+
export interface TimelineResponse {
|
|
185
|
+
data?: Array<TimelineDataPoint>;
|
|
186
|
+
}
|
|
187
|
+
export interface TopCustomer {
|
|
188
|
+
avg_order_value?: number;
|
|
189
|
+
currency?: string;
|
|
190
|
+
email?: string;
|
|
191
|
+
external_id?: string;
|
|
192
|
+
first_payment_date?: string;
|
|
193
|
+
first_traffic_origin?: string;
|
|
194
|
+
last_payment_date?: string;
|
|
195
|
+
location_country_iso?: string;
|
|
196
|
+
name?: string;
|
|
197
|
+
payment_count?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Total revenue in smallest currency unit (cents)
|
|
200
|
+
*/
|
|
201
|
+
total_revenue?: number;
|
|
202
|
+
user_id?: string;
|
|
203
|
+
visitor_id?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface TopCustomersResponse {
|
|
206
|
+
customers?: Array<TopCustomer>;
|
|
207
|
+
total?: number;
|
|
208
|
+
}
|
|
209
|
+
export interface UtmAttributionDataPoint {
|
|
210
|
+
/**
|
|
211
|
+
* Average revenue per paying customer
|
|
212
|
+
*/
|
|
213
|
+
avg_revenue_per_customer?: number;
|
|
214
|
+
/**
|
|
215
|
+
* paying_customers / unique_visitors \* 100
|
|
216
|
+
*/
|
|
217
|
+
conversion_rate?: number;
|
|
218
|
+
currency?: string;
|
|
219
|
+
paying_customers?: number;
|
|
220
|
+
payment_count?: number;
|
|
221
|
+
revenue_percentage?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Revenue in smallest currency unit (cents)
|
|
224
|
+
*/
|
|
225
|
+
total_revenue?: number;
|
|
226
|
+
unique_visitors?: number;
|
|
227
|
+
utm_value?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface RevenueDashboardParams {
|
|
230
|
+
/**
|
|
231
|
+
* Project ID
|
|
232
|
+
*/
|
|
233
|
+
project_id: string;
|
|
234
|
+
/**
|
|
235
|
+
* Time range
|
|
236
|
+
*/
|
|
237
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
238
|
+
}
|
|
239
|
+
export interface RevenueTimelineParams {
|
|
240
|
+
/**
|
|
241
|
+
* Project ID
|
|
242
|
+
*/
|
|
243
|
+
project_id: string;
|
|
244
|
+
/**
|
|
245
|
+
* Time range
|
|
246
|
+
*/
|
|
247
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
248
|
+
}
|
|
249
|
+
export declare namespace Revenue {
|
|
250
|
+
export { type AttributionByOriginResponse as AttributionByOriginResponse, type AttributionByUtmResponse as AttributionByUtmResponse, type ConversionMetricsResponse as ConversionMetricsResponse, type CustomerProfileResponse as CustomerProfileResponse, type DashboardResponse as DashboardResponse, type OriginAttributionDataPoint as OriginAttributionDataPoint, type Payment as Payment, type RevenueOverTimeDataPoint as RevenueOverTimeDataPoint, type TimelineDataPoint as TimelineDataPoint, type TimelineResponse as TimelineResponse, type TopCustomer as TopCustomer, type TopCustomersResponse as TopCustomersResponse, type UtmAttributionDataPoint as UtmAttributionDataPoint, type RevenueDashboardParams as RevenueDashboardParams, type RevenueTimelineParams as RevenueTimelineParams, };
|
|
251
|
+
export { Attribution as Attribution, type AttributionByOriginParams as AttributionByOriginParams, type AttributionByUtmParams as AttributionByUtmParams, };
|
|
252
|
+
export { Customers as Customers, type CustomerProfileParams as CustomerProfileParams, type CustomerTopParams as CustomerTopParams, };
|
|
253
|
+
export { Conversion as Conversion, type ConversionMetricsParams as ConversionMetricsParams };
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=revenue.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/revenue/revenue.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,WA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IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,CAAC;CACrF;AAMD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CAC9F"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as AttributionAPI from "./attribution.js";
|
|
3
|
+
import { Attribution, AttributionByOriginParams, AttributionByUtmParams } from "./attribution.js";
|
|
4
|
+
import * as ConversionAPI from "./conversion.js";
|
|
5
|
+
import { Conversion, ConversionMetricsParams } from "./conversion.js";
|
|
6
|
+
import * as CustomersAPI from "./customers.js";
|
|
7
|
+
import { CustomerProfileParams, CustomerTopParams, Customers } from "./customers.js";
|
|
8
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
9
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
10
|
+
export declare class Revenue extends APIResource {
|
|
11
|
+
attribution: AttributionAPI.Attribution;
|
|
12
|
+
customers: CustomersAPI.Customers;
|
|
13
|
+
conversion: ConversionAPI.Conversion;
|
|
14
|
+
/**
|
|
15
|
+
* Get key revenue metrics including total revenue, conversion rate, and average
|
|
16
|
+
* order value
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const dashboardResponse = await client.v1.revenue.dashboard(
|
|
21
|
+
* { project_id: 'project_id', time_range: 'last_hour' },
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
dashboard(query: RevenueDashboardParams, options?: RequestOptions): APIPromise<DashboardResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Get revenue metrics over time for chart visualization
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const timelineResponse = await client.v1.revenue.timeline({
|
|
32
|
+
* project_id: 'project_id',
|
|
33
|
+
* time_range: 'last_hour',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
timeline(query: RevenueTimelineParams, options?: RequestOptions): APIPromise<TimelineResponse>;
|
|
38
|
+
}
|
|
39
|
+
export interface AttributionByOriginResponse {
|
|
40
|
+
data?: Array<OriginAttributionDataPoint>;
|
|
41
|
+
}
|
|
42
|
+
export interface AttributionByUtmResponse {
|
|
43
|
+
data?: Array<UtmAttributionDataPoint>;
|
|
44
|
+
}
|
|
45
|
+
export interface ConversionMetricsResponse {
|
|
46
|
+
avg_purchases_per_customer?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Time to conversion
|
|
49
|
+
*/
|
|
50
|
+
avg_time_to_first_purchase_hours?: number;
|
|
51
|
+
/**
|
|
52
|
+
* % of visitors who paid
|
|
53
|
+
*/
|
|
54
|
+
conversion_rate?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Customer value
|
|
57
|
+
*/
|
|
58
|
+
customer_lifetime_value?: number;
|
|
59
|
+
median_time_to_first_purchase_hours?: number;
|
|
60
|
+
paying_customers?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Repeat purchase metrics
|
|
63
|
+
*/
|
|
64
|
+
repeat_purchase_rate?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Funnel metrics
|
|
67
|
+
*/
|
|
68
|
+
total_visitors?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface CustomerProfileResponse {
|
|
71
|
+
avg_order_value?: number;
|
|
72
|
+
currency?: string;
|
|
73
|
+
email?: string;
|
|
74
|
+
external_id?: string;
|
|
75
|
+
first_payment_date?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Attribution
|
|
78
|
+
*/
|
|
79
|
+
first_traffic_origin?: string;
|
|
80
|
+
first_utm_campaign?: string;
|
|
81
|
+
first_utm_medium?: string;
|
|
82
|
+
first_utm_source?: string;
|
|
83
|
+
last_payment_date?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
payment_count?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Payment history
|
|
88
|
+
*/
|
|
89
|
+
payments?: Array<Payment>;
|
|
90
|
+
/**
|
|
91
|
+
* Revenue over time (last 90 days)
|
|
92
|
+
*/
|
|
93
|
+
revenue_over_time?: Array<RevenueOverTimeDataPoint>;
|
|
94
|
+
/**
|
|
95
|
+
* Revenue summary
|
|
96
|
+
*/
|
|
97
|
+
total_revenue?: number;
|
|
98
|
+
user_id?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Identity
|
|
101
|
+
*/
|
|
102
|
+
visitor_id?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DashboardResponse {
|
|
105
|
+
/**
|
|
106
|
+
* Average metrics
|
|
107
|
+
*/
|
|
108
|
+
avg_order_value?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Average revenue per paying customer
|
|
111
|
+
*/
|
|
112
|
+
avg_revenue_per_customer?: number;
|
|
113
|
+
avg_revenue_per_identified_customer?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Average revenue per session
|
|
116
|
+
*/
|
|
117
|
+
avg_revenue_per_session?: number;
|
|
118
|
+
/**
|
|
119
|
+
* % of visitors who paid
|
|
120
|
+
*/
|
|
121
|
+
conversion_rate?: number;
|
|
122
|
+
currency?: string;
|
|
123
|
+
identified_customer_revenue?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Identified customers (have email/user_id)
|
|
126
|
+
*/
|
|
127
|
+
identified_customers?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Customer metrics
|
|
130
|
+
*/
|
|
131
|
+
paying_customers?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Count of successful payments
|
|
134
|
+
*/
|
|
135
|
+
total_payments?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Core revenue metrics
|
|
138
|
+
*/
|
|
139
|
+
total_revenue?: number;
|
|
140
|
+
}
|
|
141
|
+
export interface OriginAttributionDataPoint {
|
|
142
|
+
/**
|
|
143
|
+
* Average revenue per paying customer
|
|
144
|
+
*/
|
|
145
|
+
avg_revenue_per_customer?: number;
|
|
146
|
+
/**
|
|
147
|
+
* paying_customers / unique_visitors \* 100
|
|
148
|
+
*/
|
|
149
|
+
conversion_rate?: number;
|
|
150
|
+
currency?: string;
|
|
151
|
+
origin?: string;
|
|
152
|
+
paying_customers?: number;
|
|
153
|
+
payment_count?: number;
|
|
154
|
+
revenue_percentage?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Revenue in smallest currency unit (cents)
|
|
157
|
+
*/
|
|
158
|
+
total_revenue?: number;
|
|
159
|
+
unique_visitors?: number;
|
|
160
|
+
}
|
|
161
|
+
export interface Payment {
|
|
162
|
+
amount?: number;
|
|
163
|
+
currency?: string;
|
|
164
|
+
payment_id?: string;
|
|
165
|
+
payment_timestamp?: string;
|
|
166
|
+
product_name?: string;
|
|
167
|
+
provider_type?: string;
|
|
168
|
+
status?: string;
|
|
169
|
+
}
|
|
170
|
+
export interface RevenueOverTimeDataPoint {
|
|
171
|
+
payment_count?: number;
|
|
172
|
+
timestamp?: string;
|
|
173
|
+
total_revenue?: number;
|
|
174
|
+
}
|
|
175
|
+
export interface TimelineDataPoint {
|
|
176
|
+
currency?: string;
|
|
177
|
+
payment_count?: number;
|
|
178
|
+
timestamp?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Revenue in smallest currency unit (cents)
|
|
181
|
+
*/
|
|
182
|
+
total_revenue?: number;
|
|
183
|
+
}
|
|
184
|
+
export interface TimelineResponse {
|
|
185
|
+
data?: Array<TimelineDataPoint>;
|
|
186
|
+
}
|
|
187
|
+
export interface TopCustomer {
|
|
188
|
+
avg_order_value?: number;
|
|
189
|
+
currency?: string;
|
|
190
|
+
email?: string;
|
|
191
|
+
external_id?: string;
|
|
192
|
+
first_payment_date?: string;
|
|
193
|
+
first_traffic_origin?: string;
|
|
194
|
+
last_payment_date?: string;
|
|
195
|
+
location_country_iso?: string;
|
|
196
|
+
name?: string;
|
|
197
|
+
payment_count?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Total revenue in smallest currency unit (cents)
|
|
200
|
+
*/
|
|
201
|
+
total_revenue?: number;
|
|
202
|
+
user_id?: string;
|
|
203
|
+
visitor_id?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface TopCustomersResponse {
|
|
206
|
+
customers?: Array<TopCustomer>;
|
|
207
|
+
total?: number;
|
|
208
|
+
}
|
|
209
|
+
export interface UtmAttributionDataPoint {
|
|
210
|
+
/**
|
|
211
|
+
* Average revenue per paying customer
|
|
212
|
+
*/
|
|
213
|
+
avg_revenue_per_customer?: number;
|
|
214
|
+
/**
|
|
215
|
+
* paying_customers / unique_visitors \* 100
|
|
216
|
+
*/
|
|
217
|
+
conversion_rate?: number;
|
|
218
|
+
currency?: string;
|
|
219
|
+
paying_customers?: number;
|
|
220
|
+
payment_count?: number;
|
|
221
|
+
revenue_percentage?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Revenue in smallest currency unit (cents)
|
|
224
|
+
*/
|
|
225
|
+
total_revenue?: number;
|
|
226
|
+
unique_visitors?: number;
|
|
227
|
+
utm_value?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface RevenueDashboardParams {
|
|
230
|
+
/**
|
|
231
|
+
* Project ID
|
|
232
|
+
*/
|
|
233
|
+
project_id: string;
|
|
234
|
+
/**
|
|
235
|
+
* Time range
|
|
236
|
+
*/
|
|
237
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
238
|
+
}
|
|
239
|
+
export interface RevenueTimelineParams {
|
|
240
|
+
/**
|
|
241
|
+
* Project ID
|
|
242
|
+
*/
|
|
243
|
+
project_id: string;
|
|
244
|
+
/**
|
|
245
|
+
* Time range
|
|
246
|
+
*/
|
|
247
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
248
|
+
}
|
|
249
|
+
export declare namespace Revenue {
|
|
250
|
+
export { type AttributionByOriginResponse as AttributionByOriginResponse, type AttributionByUtmResponse as AttributionByUtmResponse, type ConversionMetricsResponse as ConversionMetricsResponse, type CustomerProfileResponse as CustomerProfileResponse, type DashboardResponse as DashboardResponse, type OriginAttributionDataPoint as OriginAttributionDataPoint, type Payment as Payment, type RevenueOverTimeDataPoint as RevenueOverTimeDataPoint, type TimelineDataPoint as TimelineDataPoint, type TimelineResponse as TimelineResponse, type TopCustomer as TopCustomer, type TopCustomersResponse as TopCustomersResponse, type UtmAttributionDataPoint as UtmAttributionDataPoint, type RevenueDashboardParams as RevenueDashboardParams, type RevenueTimelineParams as RevenueTimelineParams, };
|
|
251
|
+
export { Attribution as Attribution, type AttributionByOriginParams as AttributionByOriginParams, type AttributionByUtmParams as AttributionByUtmParams, };
|
|
252
|
+
export { Customers as Customers, type CustomerProfileParams as CustomerProfileParams, type CustomerTopParams as CustomerTopParams, };
|
|
253
|
+
export { Conversion as Conversion, type ConversionMetricsParams as ConversionMetricsParams };
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=revenue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/revenue/revenue.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,WAAW,EAAE,yBAAyB,EAAE,sBAAsB,EAAE;OAClE,KAAK,aAAa;OAClB,EAAE,UAAU,EAAE,uBAAuB,EAAE;OACvC,KAAK,YAAY;OACjB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,SAAS,EAAE;OACvD,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAC7E,UAAU,EAAE,aAAa,CAAC,UAAU,CAA8C;IAElF;;;;;;;;;;OAUG;IACH,SAAS,CAAC,KAAK,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAIjG;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;CAG/F;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,yBAA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AEF,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EAAE,UAAU,IAAI,UAAU,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CAC9F"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Revenue = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const AttributionAPI = tslib_1.__importStar(require("./attribution.js"));
|
|
8
|
+
const attribution_1 = require("./attribution.js");
|
|
9
|
+
const ConversionAPI = tslib_1.__importStar(require("./conversion.js"));
|
|
10
|
+
const conversion_1 = require("./conversion.js");
|
|
11
|
+
const CustomersAPI = tslib_1.__importStar(require("./customers.js"));
|
|
12
|
+
const customers_1 = require("./customers.js");
|
|
13
|
+
class Revenue extends resource_1.APIResource {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.attribution = new AttributionAPI.Attribution(this._client);
|
|
17
|
+
this.customers = new CustomersAPI.Customers(this._client);
|
|
18
|
+
this.conversion = new ConversionAPI.Conversion(this._client);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get key revenue metrics including total revenue, conversion rate, and average
|
|
22
|
+
* order value
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const dashboardResponse = await client.v1.revenue.dashboard(
|
|
27
|
+
* { project_id: 'project_id', time_range: 'last_hour' },
|
|
28
|
+
* );
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
dashboard(query, options) {
|
|
32
|
+
return this._client.get('/api/v1/revenue/dashboard', { query, ...options });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get revenue metrics over time for chart visualization
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const timelineResponse = await client.v1.revenue.timeline({
|
|
40
|
+
* project_id: 'project_id',
|
|
41
|
+
* time_range: 'last_hour',
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
timeline(query, options) {
|
|
46
|
+
return this._client.get('/api/v1/revenue/timeline', { query, ...options });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Revenue = Revenue;
|
|
50
|
+
Revenue.Attribution = attribution_1.Attribution;
|
|
51
|
+
Revenue.Customers = customers_1.Customers;
|
|
52
|
+
Revenue.Conversion = conversion_1.Conversion;
|
|
53
|
+
//# sourceMappingURL=revenue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.js","sourceRoot":"","sources":["../../../src/resources/v1/revenue/revenue.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,yEAAgD;AAChD,kDAA+F;AAC/F,uEAA8C;AAC9C,gDAAmE;AACnE,qEAA4C;AAC5C,8CAAkF;AAIlF,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+BpF,CAAC;IA7BC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,KAA6B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAA4B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAlCD,0BAkCC;AA8SD,OAAO,CAAC,WAAW,GAAG,yBAAW,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,qBAAS,CAAC;AAC9B,OAAO,CAAC,UAAU,GAAG,uBAAU,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as AttributionAPI from "./attribution.mjs";
|
|
4
|
+
import { Attribution } from "./attribution.mjs";
|
|
5
|
+
import * as ConversionAPI from "./conversion.mjs";
|
|
6
|
+
import { Conversion } from "./conversion.mjs";
|
|
7
|
+
import * as CustomersAPI from "./customers.mjs";
|
|
8
|
+
import { Customers } from "./customers.mjs";
|
|
9
|
+
export class Revenue extends APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.attribution = new AttributionAPI.Attribution(this._client);
|
|
13
|
+
this.customers = new CustomersAPI.Customers(this._client);
|
|
14
|
+
this.conversion = new ConversionAPI.Conversion(this._client);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get key revenue metrics including total revenue, conversion rate, and average
|
|
18
|
+
* order value
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const dashboardResponse = await client.v1.revenue.dashboard(
|
|
23
|
+
* { project_id: 'project_id', time_range: 'last_hour' },
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
dashboard(query, options) {
|
|
28
|
+
return this._client.get('/api/v1/revenue/dashboard', { query, ...options });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get revenue metrics over time for chart visualization
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const timelineResponse = await client.v1.revenue.timeline({
|
|
36
|
+
* project_id: 'project_id',
|
|
37
|
+
* time_range: 'last_hour',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
timeline(query, options) {
|
|
42
|
+
return this._client.get('/api/v1/revenue/timeline', { query, ...options });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
Revenue.Attribution = Attribution;
|
|
46
|
+
Revenue.Customers = Customers;
|
|
47
|
+
Revenue.Conversion = Conversion;
|
|
48
|
+
//# sourceMappingURL=revenue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.mjs","sourceRoot":"","sources":["../../../src/resources/v1/revenue/revenue.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,WAAW,EAAqD;OAClE,KAAK,aAAa;OAClB,EAAE,UAAU,EAA2B;OACvC,KAAK,YAAY;OACjB,EAA4C,SAAS,EAAE;AAI9D,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+BpF,CAAC;IA7BC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,KAA6B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAA4B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AA8SD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AAC9B,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.d.mts","sourceRoot":"","sources":["../../src/resources/v1/revenue.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.d.ts","sourceRoot":"","sources":["../../src/resources/v1/revenue.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./revenue/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=revenue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.js","sourceRoot":"","sources":["../../src/resources/v1/revenue.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenue.mjs","sourceRoot":"","sources":["../../src/resources/v1/revenue.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|