@codeqr/ts 0.2.1 → 0.4.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 (57) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/internal/to-file.d.mts +1 -1
  3. package/internal/to-file.d.ts +1 -1
  4. package/internal/to-file.js +1 -1
  5. package/internal/to-file.mjs +1 -1
  6. package/package.json +1 -1
  7. package/resources/events.d.mts +14 -3
  8. package/resources/events.d.mts.map +1 -1
  9. package/resources/events.d.ts +14 -3
  10. package/resources/events.d.ts.map +1 -1
  11. package/resources/links/bulk.d.mts +4 -0
  12. package/resources/links/bulk.d.mts.map +1 -1
  13. package/resources/links/bulk.d.ts +4 -0
  14. package/resources/links/bulk.d.ts.map +1 -1
  15. package/resources/links/links.d.mts +25 -1
  16. package/resources/links/links.d.mts.map +1 -1
  17. package/resources/links/links.d.ts +25 -1
  18. package/resources/links/links.d.ts.map +1 -1
  19. package/resources/links/links.js.map +1 -1
  20. package/resources/links/links.mjs.map +1 -1
  21. package/resources/projects.d.mts +1 -1
  22. package/resources/projects.d.mts.map +1 -1
  23. package/resources/projects.d.ts +1 -1
  24. package/resources/projects.d.ts.map +1 -1
  25. package/resources/qrcodes/bulk.d.mts +4 -0
  26. package/resources/qrcodes/bulk.d.mts.map +1 -1
  27. package/resources/qrcodes/bulk.d.ts +4 -0
  28. package/resources/qrcodes/bulk.d.ts.map +1 -1
  29. package/resources/qrcodes/qrcodes.d.mts +33 -3
  30. package/resources/qrcodes/qrcodes.d.mts.map +1 -1
  31. package/resources/qrcodes/qrcodes.d.ts +33 -3
  32. package/resources/qrcodes/qrcodes.d.ts.map +1 -1
  33. package/resources/qrcodes/qrcodes.js +8 -2
  34. package/resources/qrcodes/qrcodes.js.map +1 -1
  35. package/resources/qrcodes/qrcodes.mjs +8 -2
  36. package/resources/qrcodes/qrcodes.mjs.map +1 -1
  37. package/resources/track.d.mts +73 -25
  38. package/resources/track.d.mts.map +1 -1
  39. package/resources/track.d.ts +73 -25
  40. package/resources/track.d.ts.map +1 -1
  41. package/resources/track.js +4 -5
  42. package/resources/track.js.map +1 -1
  43. package/resources/track.mjs +4 -5
  44. package/resources/track.mjs.map +1 -1
  45. package/src/internal/to-file.ts +1 -1
  46. package/src/resources/events.ts +16 -3
  47. package/src/resources/links/bulk.ts +5 -0
  48. package/src/resources/links/links.ts +31 -1
  49. package/src/resources/projects.ts +1 -9
  50. package/src/resources/qrcodes/bulk.ts +5 -0
  51. package/src/resources/qrcodes/qrcodes.ts +39 -3
  52. package/src/resources/track.ts +80 -25
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. package/version.mjs +1 -1
@@ -10,8 +10,8 @@ class Track extends resource_1.APIResource {
10
10
  * @example
11
11
  * ```ts
12
12
  * const response = await client.track.trackLead({
13
- * clickId: 'x',
14
- * customerId: 'x',
13
+ * clickId: 'clickId',
14
+ * customerExternalId: 'x',
15
15
  * eventName: 'Sign up',
16
16
  * });
17
17
  * ```
@@ -25,9 +25,8 @@ class Track extends resource_1.APIResource {
25
25
  * @example
26
26
  * ```ts
27
27
  * const response = await client.track.trackSale({
28
- * amount: 1,
29
- * customerId: 'x',
30
- * paymentProcessor: 'stripe',
28
+ * amount: 0,
29
+ * customerExternalId: 'x',
31
30
  * });
32
31
  * ```
33
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"track.js","sourceRoot":"","sources":["../src/resources/track.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF;AAhCD,sBAgCC"}
1
+ {"version":3,"file":"track.js","sourceRoot":"","sources":["../src/resources/track.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;OAUG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF;AA/BD,sBA+BC"}
@@ -7,8 +7,8 @@ export class Track extends APIResource {
7
7
  * @example
8
8
  * ```ts
9
9
  * const response = await client.track.trackLead({
10
- * clickId: 'x',
11
- * customerId: 'x',
10
+ * clickId: 'clickId',
11
+ * customerExternalId: 'x',
12
12
  * eventName: 'Sign up',
13
13
  * });
14
14
  * ```
@@ -22,9 +22,8 @@ export class Track extends APIResource {
22
22
  * @example
23
23
  * ```ts
24
24
  * const response = await client.track.trackSale({
25
- * amount: 1,
26
- * customerId: 'x',
27
- * paymentProcessor: 'stripe',
25
+ * amount: 0,
26
+ * customerExternalId: 'x',
28
27
  * });
29
28
  * ```
30
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"track.mjs","sourceRoot":"","sources":["../src/resources/track.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF"}
1
+ {"version":3,"file":"track.mjs","sourceRoot":"","sources":["../src/resources/track.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;OAUG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF"}
@@ -73,7 +73,7 @@ export type ToFileInput =
73
73
 
74
74
  /**
75
75
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
76
- * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
76
+ * @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
77
77
  * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
78
78
  * @param {Object=} options additional properties
79
79
  * @param {string=} options.type the MIME type of the content
@@ -180,6 +180,11 @@ export namespace EventListResponse {
180
180
  */
181
181
  flexible: boolean;
182
182
 
183
+ /**
184
+ * The unique ID of the folder assigned to the short link.
185
+ */
186
+ folderId: string | null;
187
+
183
188
  /**
184
189
  * Geographic targeting information for the short link in JSON format
185
190
  * `{[COUNTRY]: https://example.com }`. Learn more: https://codeqr.link/geo
@@ -710,6 +715,11 @@ export namespace EventListResponse {
710
715
  */
711
716
  flexible: boolean;
712
717
 
718
+ /**
719
+ * The unique ID of the folder assigned to the short link.
720
+ */
721
+ folderId: string | null;
722
+
713
723
  /**
714
724
  * Geographic targeting information for the short link in JSON format
715
725
  * `{[COUNTRY]: https://example.com }`. Learn more: https://codeqr.link/geo
@@ -867,19 +877,22 @@ export namespace EventListResponse {
867
877
 
868
878
  export interface Sale {
869
879
  /**
870
- * The amount of the sale. Should be passed in cents.
880
+ * The amount of the sale in cents (for all two-decimal currencies). If the sale is
881
+ * in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn
882
+ * more: https://d.to/currency
871
883
  */
872
884
  amount: number;
873
885
 
874
886
  /**
875
- * The invoice ID of the sale.
887
+ * The invoice ID of the sale. Can be used as a idempotency key – only one sale
888
+ * event can be recorded for a given invoice ID.
876
889
  */
877
890
  invoiceId: string | null;
878
891
 
879
892
  /**
880
893
  * The payment processor via which the sale was made.
881
894
  */
882
- paymentProcessor: 'stripe' | 'shopify' | 'paddle';
895
+ paymentProcessor: 'stripe' | 'shopify' | 'polar' | 'paddle' | 'revenuecat' | 'custom' | 'manual';
883
896
  }
884
897
  }
885
898
  }
@@ -144,6 +144,11 @@ export namespace BulkCreateParams {
144
144
  */
145
145
  flexible?: boolean;
146
146
 
147
+ /**
148
+ * The unique ID existing folder to assign the short link to.
149
+ */
150
+ folderId?: string | null;
151
+
147
152
  /**
148
153
  * Geographic targeting information for the short link in JSON format
149
154
  * `{[COUNTRY]: https://example.com }`.
@@ -191,6 +191,11 @@ export interface Link {
191
191
  */
192
192
  flexible: boolean;
193
193
 
194
+ /**
195
+ * The unique ID of the folder assigned to the short link.
196
+ */
197
+ folderId: string | null;
198
+
194
199
  /**
195
200
  * Geographic targeting information for the short link in JSON format
196
201
  * `{[COUNTRY]: https://example.com }`. Learn more: https://codeqr.link/geo
@@ -440,6 +445,11 @@ export interface LinkCreateParams {
440
445
  */
441
446
  flexible?: boolean;
442
447
 
448
+ /**
449
+ * The unique ID existing folder to assign the short link to.
450
+ */
451
+ folderId?: string | null;
452
+
443
453
  /**
444
454
  * Geographic targeting information for the short link in JSON format
445
455
  * `{[COUNTRY]: https://example.com }`.
@@ -1114,6 +1124,11 @@ export interface LinkUpdateParams {
1114
1124
  */
1115
1125
  flexible?: boolean;
1116
1126
 
1127
+ /**
1128
+ * The unique ID existing folder to assign the short link to.
1129
+ */
1130
+ folderId?: string | null;
1131
+
1117
1132
  /**
1118
1133
  * Geographic targeting information for the short link in JSON format
1119
1134
  * `{[COUNTRY]: https://example.com }`.
@@ -1789,6 +1804,11 @@ export interface LinkListParams {
1789
1804
  */
1790
1805
  expiresBefore?: string;
1791
1806
 
1807
+ /**
1808
+ * The folder ID to filter the links by.
1809
+ */
1810
+ folderId?: string;
1811
+
1792
1812
  /**
1793
1813
  * Geographic segmentation information for the short link in JSON format
1794
1814
  * `{[COUNTRY]: https://example.com }`.
@@ -2478,6 +2498,11 @@ export interface LinkCountParams {
2478
2498
  */
2479
2499
  expiresBefore?: string;
2480
2500
 
2501
+ /**
2502
+ * The folder ID to filter the links by.
2503
+ */
2504
+ folderId?: string;
2505
+
2481
2506
  /**
2482
2507
  * Geographic segmentation information for the short link in JSON format
2483
2508
  * `{[COUNTRY]: https://example.com }`.
@@ -2487,7 +2512,7 @@ export interface LinkCountParams {
2487
2512
  /**
2488
2513
  * The field to group the links by.
2489
2514
  */
2490
- groupBy?: 'domain' | 'tagId' | 'userId';
2515
+ groupBy?: 'domain' | 'tagId' | 'userId' | 'folderId';
2491
2516
 
2492
2517
  /**
2493
2518
  * Filter links that have comments (any comments)
@@ -3191,6 +3216,11 @@ export interface LinkUpsertParams {
3191
3216
  */
3192
3217
  flexible?: boolean;
3193
3218
 
3219
+ /**
3220
+ * The unique ID existing folder to assign the short link to.
3221
+ */
3222
+ folderId?: string | null;
3223
+
3194
3224
  /**
3195
3225
  * Geographic targeting information for the short link in JSON format
3196
3226
  * `{[COUNTRY]: https://example.com }`.
@@ -72,15 +72,7 @@ export interface Project {
72
72
  /**
73
73
  * The plan of the project.
74
74
  */
75
- plan:
76
- | 'free'
77
- | 'starter'
78
- | 'pro'
79
- | 'business'
80
- | 'business plus'
81
- | 'business extra'
82
- | 'business max'
83
- | 'enterprise';
75
+ plan: 'free' | 'starter' | 'pro' | 'business' | 'scale' | 'enterprise';
84
76
 
85
77
  /**
86
78
  * The slug of the project.
@@ -83,6 +83,11 @@ export interface BulkCreateParams {
83
83
 
84
84
  export namespace BulkCreateParams {
85
85
  export interface Body {
86
+ /**
87
+ * The unique ID of the folder assigned to the QR code.
88
+ */
89
+ folderId: string | null;
90
+
86
91
  /**
87
92
  * The type of content of the QR code.
88
93
  */
@@ -16,7 +16,10 @@ export class Qrcodes extends APIResource {
16
16
  *
17
17
  * @example
18
18
  * ```ts
19
- * const qrCode = await client.qrcodes.create({ type: 'url' });
19
+ * const qrCode = await client.qrcodes.create({
20
+ * folderId: 'folderId',
21
+ * type: 'url',
22
+ * });
20
23
  * ```
21
24
  */
22
25
  create(body: QrcodeCreateParams, options?: RequestOptions): APIPromise<QrCode> {
@@ -105,7 +108,10 @@ export class Qrcodes extends APIResource {
105
108
  *
106
109
  * @example
107
110
  * ```ts
108
- * const qrCode = await client.qrcodes.upsert({ type: 'url' });
111
+ * const qrCode = await client.qrcodes.upsert({
112
+ * folderId: 'folderId',
113
+ * type: 'url',
114
+ * });
109
115
  * ```
110
116
  */
111
117
  upsert(body: QrcodeUpsertParams, options?: RequestOptions): APIPromise<QrCode> {
@@ -217,6 +223,11 @@ export interface QrCode {
217
223
  */
218
224
  flexible: boolean;
219
225
 
226
+ /**
227
+ * The unique ID of the folder assigned to the QR code.
228
+ */
229
+ folderId: string | null;
230
+
220
231
  /**
221
232
  * Geographic segmentation information for the QR code in the JSON format
222
233
  * `{[COUNTRY]: https://example.com }`. Learn more: https://codeqr.link/geo
@@ -479,6 +490,11 @@ export interface QrcodeDeleteResponse {
479
490
  export type QrcodeCountResponse = number;
480
491
 
481
492
  export interface QrcodeCreateParams {
493
+ /**
494
+ * The unique ID of the folder assigned to the QR code.
495
+ */
496
+ folderId: string | null;
497
+
482
498
  /**
483
499
  * The type of content of the QR code.
484
500
  */
@@ -1413,6 +1429,11 @@ export interface QrcodeUpdateParams {
1413
1429
  */
1414
1430
  flexible?: boolean;
1415
1431
 
1432
+ /**
1433
+ * The unique ID of the folder assigned to the QR code.
1434
+ */
1435
+ folderId?: string | null;
1436
+
1416
1437
  /**
1417
1438
  * The type of frame of the QR code.
1418
1439
  */
@@ -2161,6 +2182,11 @@ export interface QrcodeListParams {
2161
2182
  */
2162
2183
  expiresBefore?: string;
2163
2184
 
2185
+ /**
2186
+ * The folder ID to filter the QR codes by.
2187
+ */
2188
+ folderId?: string;
2189
+
2164
2190
  /**
2165
2191
  * Filter by QR code format - static or dynamic
2166
2192
  */
@@ -2342,6 +2368,11 @@ export interface QrcodeCountParams {
2342
2368
  */
2343
2369
  expiresBefore?: string;
2344
2370
 
2371
+ /**
2372
+ * The folder ID to filter the QR codes by.
2373
+ */
2374
+ folderId?: string;
2375
+
2345
2376
  /**
2346
2377
  * Filter by QR code format - static or dynamic
2347
2378
  */
@@ -2350,7 +2381,7 @@ export interface QrcodeCountParams {
2350
2381
  /**
2351
2382
  * The field to group the QR codes.
2352
2383
  */
2353
- groupBy?: 'domain' | 'tagId' | 'userId';
2384
+ groupBy?: 'domain' | 'tagId' | 'userId' | 'folderId';
2354
2385
 
2355
2386
  /**
2356
2387
  * Filter QR codes with/without comments
@@ -2475,6 +2506,11 @@ export interface QrcodeCountParams {
2475
2506
  }
2476
2507
 
2477
2508
  export interface QrcodeUpsertParams {
2509
+ /**
2510
+ * The unique ID of the folder assigned to the QR code.
2511
+ */
2512
+ folderId: string | null;
2513
+
2478
2514
  /**
2479
2515
  * The type of content of the QR code.
2480
2516
  */
@@ -11,8 +11,8 @@ export class Track extends APIResource {
11
11
  * @example
12
12
  * ```ts
13
13
  * const response = await client.track.trackLead({
14
- * clickId: 'x',
15
- * customerId: 'x',
14
+ * clickId: 'clickId',
15
+ * customerExternalId: 'x',
16
16
  * eventName: 'Sign up',
17
17
  * });
18
18
  * ```
@@ -27,9 +27,8 @@ export class Track extends APIResource {
27
27
  * @example
28
28
  * ```ts
29
29
  * const response = await client.track.trackSale({
30
- * amount: 1,
31
- * customerId: 'x',
32
- * paymentProcessor: 'stripe',
30
+ * amount: 0,
31
+ * customerExternalId: 'x',
33
32
  * });
34
33
  * ```
35
34
  */
@@ -78,79 +77,135 @@ export interface TrackTrackSaleResponse {
78
77
 
79
78
  export interface TrackTrackLeadParams {
80
79
  /**
81
- * The ID of the click in th CodeQR. You can read this value from `cq_id` cookie.
80
+ * The unique ID of the click that the lead conversion event is attributed to. You
81
+ * can read this value from `cd_id` cookie. If an empty string is provided, CodeQR
82
+ * will try to find an existing customer with the provided `customerExternalId` and
83
+ * use the `clickId` from the customer if found.
82
84
  */
83
85
  clickId: string;
84
86
 
85
87
  /**
86
- * This is the unique identifier for the customer in the client's app. This is used
87
- * to track the customer's journey.
88
+ * The unique ID of the customer in your system. Will be used to identify and
89
+ * attribute all future events to this customer.
88
90
  */
89
- customerId: string;
91
+ customerExternalId: string;
90
92
 
91
93
  /**
92
- * The name of the event to track.
94
+ * The name of the lead event to track. Can also be used as a unique identifier to
95
+ * associate a given lead event for a customer for a subsequent sale event (via the
96
+ * `leadEventName` prop in `/track/sale`).
93
97
  */
94
98
  eventName: string;
95
99
 
96
100
  /**
97
- * Avatar of the customer in the client's app.
101
+ * The avatar URL of the customer.
98
102
  */
99
103
  customerAvatar?: string | null;
100
104
 
101
105
  /**
102
- * Email of the customer in the client's app.
106
+ * The email address of the customer.
103
107
  */
104
108
  customerEmail?: string | null;
105
109
 
106
110
  /**
107
- * Name of the customer in the client's app.
111
+ * The name of the customer. If not passed, a random name will be generated (e.g.
112
+ * “Big Red Caribou”).
108
113
  */
109
114
  customerName?: string | null;
110
115
 
111
116
  /**
112
- * Additional metadata to be stored with the lead event
117
+ * The numerical value associated with this lead event (e.g., number of provisioned
118
+ * seats in a free trial). If defined as N, the lead event will be tracked N times.
119
+ */
120
+ eventQuantity?: number | null;
121
+
122
+ /**
123
+ * Additional metadata to be stored with the lead event. Max 10,000 characters.
113
124
  */
114
125
  metadata?: { [key: string]: unknown } | null;
126
+
127
+ /**
128
+ * The mode to use for tracking the lead event. `async` will not block the request;
129
+ * `wait` will block the request until the lead event is fully recorded in Dub;
130
+ * `deferred` will defer the lead event creation to a subsequent request.
131
+ */
132
+ mode?: 'async' | 'wait' | 'deferred';
115
133
  }
116
134
 
117
135
  export interface TrackTrackSaleParams {
118
136
  /**
119
- * The amount of the sale. Should be passed in cents.
137
+ * The amount of the sale in cents (for all two-decimal currencies). If the sale is
138
+ * in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn
139
+ * more: https://d.to/currency
120
140
  */
121
141
  amount: number;
122
142
 
123
143
  /**
124
- * This is the unique identifier for the customer in the client's app. This is used
125
- * to track the customer's journey.
144
+ * The unique ID of the customer in your system. Will be used to identify and
145
+ * attribute all future events to this customer.
126
146
  */
127
- customerId: string;
147
+ customerExternalId: string;
128
148
 
129
149
  /**
130
- * The payment processor via which the sale was made.
150
+ * [For direct sale tracking]: The unique ID of the click that the sale conversion
151
+ * event is attributed to. You can read this value from `dub_id` cookie.
131
152
  */
132
- paymentProcessor: 'stripe' | 'shopify' | 'paddle';
153
+ clickId?: string | null;
133
154
 
134
155
  /**
135
- * The currency of the sale. Accepts ISO 4217 currency codes.
156
+ * The currency of the sale. Accepts ISO 4217 currency codes. Sales will be
157
+ * automatically converted and stored as USD at the latest exchange rates. Learn
158
+ * more: https://d.to/currency
136
159
  */
137
160
  currency?: string;
138
161
 
139
162
  /**
140
- * The name of the sale event. It can be used to track different types of event for
141
- * example 'Purchase', 'Upgrade', 'Payment', etc.
163
+ * [For direct sale tracking]: The avatar URL of the customer.
164
+ */
165
+ customerAvatar?: string | null;
166
+
167
+ /**
168
+ * [For direct sale tracking]: The email address of the customer.
169
+ */
170
+ customerEmail?: string | null;
171
+
172
+ /**
173
+ * [For direct sale tracking]: The name of the customer. If not passed, a random
174
+ * name will be generated (e.g. “Big Red Caribou”).
175
+ */
176
+ customerName?: string | null;
177
+
178
+ /**
179
+ * The name of the sale event. Recommended format: `Invoice paid` or
180
+ * `Subscription created`.
142
181
  */
143
182
  eventName?: string;
144
183
 
145
184
  /**
146
- * The invoice ID of the sale.
185
+ * The invoice ID of the sale. Can be used as a idempotency key – only one sale
186
+ * event can be recorded for a given invoice ID.
147
187
  */
148
188
  invoiceId?: string | null;
149
189
 
150
190
  /**
151
- * Additional metadata to be stored with the sale event.
191
+ * The name of the lead event that occurred before the sale (case-sensitive). This
192
+ * is used to associate the sale event with a particular lead event (instead of the
193
+ * latest lead event for a link-customer combination, which is the default
194
+ * behavior). For direct sale tracking, this field can also be used to specify the
195
+ * lead event name.
196
+ */
197
+ leadEventName?: string | null;
198
+
199
+ /**
200
+ * Additional metadata to be stored with the sale event. Max 10,000 characters when
201
+ * stringified.
152
202
  */
153
203
  metadata?: { [key: string]: unknown } | null;
204
+
205
+ /**
206
+ * The payment processor via which the sale was made.
207
+ */
208
+ paymentProcessor?: 'stripe' | 'shopify' | 'polar' | 'paddle' | 'revenuecat' | 'custom' | 'manual';
154
209
  }
155
210
 
156
211
  export declare namespace Track {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.1'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.1";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.1";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.1'; // x-release-please-version
4
+ exports.VERSION = '0.4.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.1'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map