zorihq 0.8.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/resources/v1/analytics/analytics.d.mts +1 -124
  4. package/resources/v1/analytics/analytics.d.mts.map +1 -1
  5. package/resources/v1/analytics/analytics.d.ts +1 -124
  6. package/resources/v1/analytics/analytics.d.ts.map +1 -1
  7. package/resources/v1/analytics/analytics.js +0 -4
  8. package/resources/v1/analytics/analytics.js.map +1 -1
  9. package/resources/v1/analytics/analytics.mjs +0 -4
  10. package/resources/v1/analytics/analytics.mjs.map +1 -1
  11. package/resources/v1/analytics/index.d.mts +1 -2
  12. package/resources/v1/analytics/index.d.mts.map +1 -1
  13. package/resources/v1/analytics/index.d.ts +1 -2
  14. package/resources/v1/analytics/index.d.ts.map +1 -1
  15. package/resources/v1/analytics/index.js +1 -3
  16. package/resources/v1/analytics/index.js.map +1 -1
  17. package/resources/v1/analytics/index.mjs +0 -1
  18. package/resources/v1/analytics/index.mjs.map +1 -1
  19. package/resources/v1/index.d.mts +2 -1
  20. package/resources/v1/index.d.mts.map +1 -1
  21. package/resources/v1/index.d.ts +2 -1
  22. package/resources/v1/index.d.ts.map +1 -1
  23. package/resources/v1/index.js +3 -1
  24. package/resources/v1/index.js.map +1 -1
  25. package/resources/v1/index.mjs +1 -0
  26. package/resources/v1/index.mjs.map +1 -1
  27. package/resources/v1/{analytics/revenue.d.mts → revenue/attribution.d.mts} +21 -19
  28. package/resources/v1/revenue/attribution.d.mts.map +1 -0
  29. package/resources/v1/{analytics/revenue.d.ts → revenue/attribution.d.ts} +21 -19
  30. package/resources/v1/revenue/attribution.d.ts.map +1 -0
  31. package/resources/v1/revenue/attribution.js +41 -0
  32. package/resources/v1/revenue/attribution.js.map +1 -0
  33. package/resources/v1/revenue/attribution.mjs +37 -0
  34. package/resources/v1/revenue/attribution.mjs.map +1 -0
  35. package/resources/v1/revenue/conversion.d.mts +34 -0
  36. package/resources/v1/revenue/conversion.d.mts.map +1 -0
  37. package/resources/v1/revenue/conversion.d.ts +34 -0
  38. package/resources/v1/revenue/conversion.d.ts.map +1 -0
  39. package/resources/v1/revenue/conversion.js +25 -0
  40. package/resources/v1/revenue/conversion.js.map +1 -0
  41. package/resources/v1/revenue/conversion.mjs +21 -0
  42. package/resources/v1/revenue/conversion.mjs.map +1 -0
  43. package/resources/v1/revenue/customers.d.mts +61 -0
  44. package/resources/v1/revenue/customers.d.mts.map +1 -0
  45. package/resources/v1/revenue/customers.d.ts +61 -0
  46. package/resources/v1/revenue/customers.d.ts.map +1 -0
  47. package/resources/v1/revenue/customers.js +40 -0
  48. package/resources/v1/revenue/customers.js.map +1 -0
  49. package/resources/v1/revenue/customers.mjs +36 -0
  50. package/resources/v1/revenue/customers.mjs.map +1 -0
  51. package/resources/v1/revenue/index.d.mts +5 -0
  52. package/resources/v1/revenue/index.d.mts.map +1 -0
  53. package/resources/v1/revenue/index.d.ts +5 -0
  54. package/resources/v1/revenue/index.d.ts.map +1 -0
  55. package/resources/v1/revenue/index.js +13 -0
  56. package/resources/v1/revenue/index.js.map +1 -0
  57. package/resources/v1/revenue/index.mjs +6 -0
  58. package/resources/v1/revenue/index.mjs.map +1 -0
  59. package/resources/v1/revenue/revenue.d.mts +255 -0
  60. package/resources/v1/revenue/revenue.d.mts.map +1 -0
  61. package/resources/v1/revenue/revenue.d.ts +255 -0
  62. package/resources/v1/revenue/revenue.d.ts.map +1 -0
  63. package/resources/v1/revenue/revenue.js +53 -0
  64. package/resources/v1/revenue/revenue.js.map +1 -0
  65. package/resources/v1/revenue/revenue.mjs +48 -0
  66. package/resources/v1/revenue/revenue.mjs.map +1 -0
  67. package/resources/v1/revenue.d.mts +2 -0
  68. package/resources/v1/revenue.d.mts.map +1 -0
  69. package/resources/v1/revenue.d.ts +2 -0
  70. package/resources/v1/revenue.d.ts.map +1 -0
  71. package/resources/v1/revenue.js +6 -0
  72. package/resources/v1/revenue.js.map +1 -0
  73. package/resources/v1/revenue.mjs +3 -0
  74. package/resources/v1/revenue.mjs.map +1 -0
  75. package/resources/v1/v1.d.mts +6 -2
  76. package/resources/v1/v1.d.mts.map +1 -1
  77. package/resources/v1/v1.d.ts +6 -2
  78. package/resources/v1/v1.d.ts.map +1 -1
  79. package/resources/v1/v1.js +4 -0
  80. package/resources/v1/v1.js.map +1 -1
  81. package/resources/v1/v1.mjs +4 -0
  82. package/resources/v1/v1.mjs.map +1 -1
  83. package/src/resources/v1/analytics/analytics.ts +0 -183
  84. package/src/resources/v1/analytics/index.ts +0 -6
  85. package/src/resources/v1/index.ts +18 -5
  86. package/src/resources/v1/{analytics/revenue.ts → revenue/attribution.ts} +29 -24
  87. package/src/resources/v1/revenue/conversion.ts +44 -0
  88. package/src/resources/v1/revenue/customers.ts +77 -0
  89. package/src/resources/v1/revenue/index.ts +23 -0
  90. package/src/resources/v1/revenue/revenue.ts +385 -0
  91. package/src/resources/v1/revenue.ts +3 -0
  92. package/src/resources/v1/v1.ts +40 -10
  93. package/src/version.ts +1 -1
  94. package/version.d.mts +1 -1
  95. package/version.d.ts +1 -1
  96. package/version.js +1 -1
  97. package/version.mjs +1 -1
  98. package/resources/v1/analytics/revenue.d.mts.map +0 -1
  99. package/resources/v1/analytics/revenue.d.ts.map +0 -1
  100. package/resources/v1/analytics/revenue.js +0 -39
  101. package/resources/v1/analytics/revenue.js.map +0 -1
  102. package/resources/v1/analytics/revenue.mjs +0 -35
  103. package/resources/v1/analytics/revenue.mjs.map +0 -1
@@ -0,0 +1,61 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as RevenueAPI from "./revenue.js";
3
+ import { APIPromise } from "../../../core/api-promise.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class Customers extends APIResource {
6
+ /**
7
+ * Get detailed revenue information for a specific customer including payment
8
+ * history and attribution
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const customerProfileResponse =
13
+ * await client.v1.revenue.customers.profile({
14
+ * project_id: 'project_id',
15
+ * visitor_id: 'visitor_id',
16
+ * });
17
+ * ```
18
+ */
19
+ profile(query: CustomerProfileParams, options?: RequestOptions): APIPromise<RevenueAPI.CustomerProfileResponse>;
20
+ /**
21
+ * Get a list of customers ranked by total revenue
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const topCustomersResponse =
26
+ * await client.v1.revenue.customers.top({
27
+ * project_id: 'project_id',
28
+ * time_range: 'last_hour',
29
+ * });
30
+ * ```
31
+ */
32
+ top(query: CustomerTopParams, options?: RequestOptions): APIPromise<RevenueAPI.TopCustomersResponse>;
33
+ }
34
+ export interface CustomerProfileParams {
35
+ /**
36
+ * Project ID
37
+ */
38
+ project_id: string;
39
+ /**
40
+ * Visitor ID
41
+ */
42
+ visitor_id: string;
43
+ }
44
+ export interface CustomerTopParams {
45
+ /**
46
+ * Project ID
47
+ */
48
+ project_id: string;
49
+ /**
50
+ * Time range
51
+ */
52
+ time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
53
+ /**
54
+ * Maximum number of customers to return (default: 50)
55
+ */
56
+ limit?: number;
57
+ }
58
+ export declare namespace Customers {
59
+ export { type CustomerProfileParams as CustomerProfileParams, type CustomerTopParams as CustomerTopParams };
60
+ }
61
+ //# sourceMappingURL=customers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/revenue/customers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;OAYG;IACH,OAAO,CACL,KAAK,EAAE,qBAAqB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAIjD;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAGrG;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,CAAC;IAEpF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CAC7G"}
@@ -0,0 +1,40 @@
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.Customers = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ class Customers extends resource_1.APIResource {
7
+ /**
8
+ * Get detailed revenue information for a specific customer including payment
9
+ * history and attribution
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const customerProfileResponse =
14
+ * await client.v1.revenue.customers.profile({
15
+ * project_id: 'project_id',
16
+ * visitor_id: 'visitor_id',
17
+ * });
18
+ * ```
19
+ */
20
+ profile(query, options) {
21
+ return this._client.get('/api/v1/revenue/customers/profile', { query, ...options });
22
+ }
23
+ /**
24
+ * Get a list of customers ranked by total revenue
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const topCustomersResponse =
29
+ * await client.v1.revenue.customers.top({
30
+ * project_id: 'project_id',
31
+ * time_range: 'last_hour',
32
+ * });
33
+ * ```
34
+ */
35
+ top(query, options) {
36
+ return this._client.get('/api/v1/revenue/customers/top', { query, ...options });
37
+ }
38
+ }
39
+ exports.Customers = Customers;
40
+ //# sourceMappingURL=customers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../src/resources/v1/revenue/customers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAKrD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;OAYG;IACH,OAAO,CACL,KAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,KAAwB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AApCD,8BAoCC"}
@@ -0,0 +1,36 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ export class Customers extends APIResource {
4
+ /**
5
+ * Get detailed revenue information for a specific customer including payment
6
+ * history and attribution
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const customerProfileResponse =
11
+ * await client.v1.revenue.customers.profile({
12
+ * project_id: 'project_id',
13
+ * visitor_id: 'visitor_id',
14
+ * });
15
+ * ```
16
+ */
17
+ profile(query, options) {
18
+ return this._client.get('/api/v1/revenue/customers/profile', { query, ...options });
19
+ }
20
+ /**
21
+ * Get a list of customers ranked by total revenue
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const topCustomersResponse =
26
+ * await client.v1.revenue.customers.top({
27
+ * project_id: 'project_id',
28
+ * time_range: 'last_hour',
29
+ * });
30
+ * ```
31
+ */
32
+ top(query, options) {
33
+ return this._client.get('/api/v1/revenue/customers/top', { query, ...options });
34
+ }
35
+ }
36
+ //# sourceMappingURL=customers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.mjs","sourceRoot":"","sources":["../../../src/resources/v1/revenue/customers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;OAYG;IACH,OAAO,CACL,KAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,KAAwB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export { Attribution, type AttributionByOriginParams, type AttributionByUtmParams } from "./attribution.mjs";
2
+ export { Conversion, type ConversionMetricsParams } from "./conversion.mjs";
3
+ export { Customers, type CustomerProfileParams, type CustomerTopParams } from "./customers.mjs";
4
+ export { Revenue, type AttributionByOriginResponse, type AttributionByUtmResponse, type ConversionMetricsResponse, type CustomerProfileResponse, type DashboardResponse, type OriginAttributionDataPoint, type Payment, type RevenueOverTimeDataPoint, type TimelineDataPoint, type TimelineResponse, type TopCustomer, type TopCustomersResponse, type UtmAttributionDataPoint, type RevenueDashboardParams, type RevenueTimelineParams, } from "./revenue.mjs";
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/revenue/index.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE,KAAK,yBAAyB,EAAE,KAAK,sBAAsB,EAAE;OAC5E,EAAE,UAAU,EAAE,KAAK,uBAAuB,EAAE;OAC5C,EAAE,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE;OACjE,EACL,OAAO,EACP,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,OAAO,EACZ,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B"}
@@ -0,0 +1,5 @@
1
+ export { Attribution, type AttributionByOriginParams, type AttributionByUtmParams } from "./attribution.js";
2
+ export { Conversion, type ConversionMetricsParams } from "./conversion.js";
3
+ export { Customers, type CustomerProfileParams, type CustomerTopParams } from "./customers.js";
4
+ export { Revenue, type AttributionByOriginResponse, type AttributionByUtmResponse, type ConversionMetricsResponse, type CustomerProfileResponse, type DashboardResponse, type OriginAttributionDataPoint, type Payment, type RevenueOverTimeDataPoint, type TimelineDataPoint, type TimelineResponse, type TopCustomer, type TopCustomersResponse, type UtmAttributionDataPoint, type RevenueDashboardParams, type RevenueTimelineParams, } from "./revenue.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/revenue/index.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE,KAAK,yBAAyB,EAAE,KAAK,sBAAsB,EAAE;OAC5E,EAAE,UAAU,EAAE,KAAK,uBAAuB,EAAE;OAC5C,EAAE,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE;OACjE,EACL,OAAO,EACP,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,OAAO,EACZ,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B"}
@@ -0,0 +1,13 @@
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 = exports.Customers = exports.Conversion = exports.Attribution = void 0;
5
+ var attribution_1 = require("./attribution.js");
6
+ Object.defineProperty(exports, "Attribution", { enumerable: true, get: function () { return attribution_1.Attribution; } });
7
+ var conversion_1 = require("./conversion.js");
8
+ Object.defineProperty(exports, "Conversion", { enumerable: true, get: function () { return conversion_1.Conversion; } });
9
+ var customers_1 = require("./customers.js");
10
+ Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
11
+ var revenue_1 = require("./revenue.js");
12
+ Object.defineProperty(exports, "Revenue", { enumerable: true, get: function () { return revenue_1.Revenue; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/v1/revenue/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAAyG;AAAhG,0GAAA,WAAW,OAAA;AACpB,8CAAwE;AAA/D,wGAAA,UAAU,OAAA;AACnB,4CAA4F;AAAnF,sGAAA,SAAS,OAAA;AAClB,wCAiBmB;AAhBjB,kGAAA,OAAO,OAAA"}
@@ -0,0 +1,6 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Attribution } from "./attribution.mjs";
3
+ export { Conversion } from "./conversion.mjs";
4
+ export { Customers } from "./customers.mjs";
5
+ export { Revenue, } from "./revenue.mjs";
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/v1/revenue/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAA+D;OAC5E,EAAE,UAAU,EAAgC;OAC5C,EAAE,SAAS,EAAsD;OACjE,EACL,OAAO,GAgBR"}
@@ -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.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