@rechargeapps/storefront-client 0.14.0 → 0.15.1

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 (79) hide show
  1. package/package.json +2 -2
  2. package/dist/cjs/api/address.js +0 -45
  3. package/dist/cjs/api/address.js.map +0 -1
  4. package/dist/cjs/api/auth.js +0 -36
  5. package/dist/cjs/api/auth.js.map +0 -1
  6. package/dist/cjs/api/bundle.js +0 -74
  7. package/dist/cjs/api/bundle.js.map +0 -1
  8. package/dist/cjs/api/cdn.js +0 -85
  9. package/dist/cjs/api/cdn.js.map +0 -1
  10. package/dist/cjs/api/charge.js +0 -39
  11. package/dist/cjs/api/charge.js.map +0 -1
  12. package/dist/cjs/api/customer.js +0 -38
  13. package/dist/cjs/api/customer.js.map +0 -1
  14. package/dist/cjs/api/membership.js +0 -31
  15. package/dist/cjs/api/membership.js.map +0 -1
  16. package/dist/cjs/api/onetime.js +0 -40
  17. package/dist/cjs/api/onetime.js.map +0 -1
  18. package/dist/cjs/api/order.js +0 -19
  19. package/dist/cjs/api/order.js.map +0 -1
  20. package/dist/cjs/api/paymentMethod.js +0 -27
  21. package/dist/cjs/api/paymentMethod.js.map +0 -1
  22. package/dist/cjs/api/plan.js +0 -19
  23. package/dist/cjs/api/plan.js.map +0 -1
  24. package/dist/cjs/api/subscription.js +0 -71
  25. package/dist/cjs/api/subscription.js.map +0 -1
  26. package/dist/cjs/constants/api.js +0 -14
  27. package/dist/cjs/constants/api.js.map +0 -1
  28. package/dist/cjs/index.js +0 -76
  29. package/dist/cjs/index.js.map +0 -1
  30. package/dist/cjs/mappers/cdn.js +0 -67
  31. package/dist/cjs/mappers/cdn.js.map +0 -1
  32. package/dist/cjs/mappers/utils.js +0 -38
  33. package/dist/cjs/mappers/utils.js.map +0 -1
  34. package/dist/cjs/utils/init.js +0 -55
  35. package/dist/cjs/utils/init.js.map +0 -1
  36. package/dist/cjs/utils/options.js +0 -18
  37. package/dist/cjs/utils/options.js.map +0 -1
  38. package/dist/cjs/utils/request.js +0 -98
  39. package/dist/cjs/utils/request.js.map +0 -1
  40. package/dist/esm/api/address.js +0 -35
  41. package/dist/esm/api/address.js.map +0 -1
  42. package/dist/esm/api/auth.js +0 -31
  43. package/dist/esm/api/auth.js.map +0 -1
  44. package/dist/esm/api/bundle.js +0 -69
  45. package/dist/esm/api/bundle.js.map +0 -1
  46. package/dist/esm/api/cdn.js +0 -74
  47. package/dist/esm/api/cdn.js.map +0 -1
  48. package/dist/esm/api/charge.js +0 -30
  49. package/dist/esm/api/charge.js.map +0 -1
  50. package/dist/esm/api/customer.js +0 -32
  51. package/dist/esm/api/customer.js.map +0 -1
  52. package/dist/esm/api/membership.js +0 -24
  53. package/dist/esm/api/membership.js.map +0 -1
  54. package/dist/esm/api/onetime.js +0 -32
  55. package/dist/esm/api/onetime.js.map +0 -1
  56. package/dist/esm/api/order.js +0 -14
  57. package/dist/esm/api/order.js.map +0 -1
  58. package/dist/esm/api/paymentMethod.js +0 -21
  59. package/dist/esm/api/paymentMethod.js.map +0 -1
  60. package/dist/esm/api/plan.js +0 -14
  61. package/dist/esm/api/plan.js.map +0 -1
  62. package/dist/esm/api/subscription.js +0 -59
  63. package/dist/esm/api/subscription.js.map +0 -1
  64. package/dist/esm/constants/api.js +0 -7
  65. package/dist/esm/constants/api.js.map +0 -1
  66. package/dist/esm/index.js +0 -14
  67. package/dist/esm/index.js.map +0 -1
  68. package/dist/esm/mappers/cdn.js +0 -57
  69. package/dist/esm/mappers/cdn.js.map +0 -1
  70. package/dist/esm/mappers/utils.js +0 -34
  71. package/dist/esm/mappers/utils.js.map +0 -1
  72. package/dist/esm/utils/init.js +0 -50
  73. package/dist/esm/utils/init.js.map +0 -1
  74. package/dist/esm/utils/options.js +0 -13
  75. package/dist/esm/utils/options.js.map +0 -1
  76. package/dist/esm/utils/request.js +0 -91
  77. package/dist/esm/utils/request.js.map +0 -1
  78. package/dist/index.d.ts +0 -1485
  79. package/dist/umd/recharge-client.min.js +0 -28
package/dist/index.d.ts DELETED
@@ -1,1485 +0,0 @@
1
- /** HEXA, RGBA, HSLA */
2
- declare type ColorString = string;
3
- /** HTML String */
4
- declare type HTMLString = string;
5
- /** ISO 8601 date time, YYYY-MM-DD */
6
- declare type IsoDateString = string;
7
- interface Property {
8
- name: string;
9
- value: string;
10
- }
11
- interface ListParams<T> {
12
- /** default is 50, max is 250 */
13
- limit?: number;
14
- /** next or previous cursor returned by previous list call */
15
- cursor?: number;
16
- /** sort list by option */
17
- sort_by?: T;
18
- }
19
- interface ExternalId {
20
- /** The order ID as it appears in the external e-commerce platform. */
21
- ecommerce: string | null;
22
- }
23
- interface ExternalTransactionId {
24
- /** The ID of the associated transaction in a payment processor system (like Stripe). */
25
- payment_processor: number | null;
26
- }
27
- interface AssociatedAddress {
28
- address1: string;
29
- address2: string | null;
30
- city: string;
31
- company: string | null;
32
- country_code: string;
33
- country?: string;
34
- first_name: string;
35
- last_name: string;
36
- phone: string | null;
37
- province: string;
38
- zip: string;
39
- }
40
- interface ProductImage {
41
- /** The url where a large image file is located. */
42
- large?: string;
43
- /** The url where a medium image file is located. */
44
- medium?: string;
45
- /** The url of the original sized product image. */
46
- original?: string;
47
- /** The url where a small image file is located. */
48
- small?: string;
49
- /** The sort order in which the x image from the array should appear when displayed. */
50
- sort_order?: number;
51
- }
52
- interface LineItem {
53
- subscription_id?: number;
54
- /** The Subscription or Onetime ID associated with the line_item. */
55
- purchase_item_id: number;
56
- /** An object containing the associated product ID as it appears in the external system. */
57
- external_product_id: ExternalId;
58
- /** An object containing the associated variant ID as it appears in the external system. */
59
- external_variant_id: ExternalId;
60
- /** The weight of the item in grams. */
61
- grams: number;
62
- /** A unique, human-friendly string for the Product. */
63
- handle: string | null;
64
- /** An object containing URLs of the Product image. */
65
- images: ProductImage;
66
- /** An array of name value pairs of additional line_item attributes. */
67
- properties: Property[];
68
- /** An indicator of the type of the purchase item. */
69
- purchase_item_type: 'subscription' | 'onetime';
70
- /** The quantity of the line_item. */
71
- quantity: number;
72
- /** The SKU (stock keeping unit) of the Product associated with the line_item. */
73
- sku: string | null;
74
- /** The total tax due associated with the line_item. */
75
- tax_due: string;
76
- /** an array containing tax_line objects associated with this line_item. */
77
- tax_lines: TaxLine[];
78
- /** A boolean indicating if the line_item is taxable or non-taxable. */
79
- taxable: boolean;
80
- /** The taxable revenue associated with the line_item. */
81
- taxable_amount: string;
82
- /** The title of the Product of this line_item. */
83
- title: string;
84
- /** The total price of the line_item including tax. */
85
- total_price: string;
86
- /** The unit price of the line_item. */
87
- unit_price: string;
88
- /** A boolean indicator if tax is included in the price of an item. */
89
- unit_price_includes_tax: boolean;
90
- /** The name of a variant of the Product of this line_item. */
91
- variant_title: string | null;
92
- }
93
- interface TaxLine {
94
- /** The total tax associated with the listed jurisdiction. */
95
- price: string;
96
- /** The tax rate associated with the listed jurisdiction. */
97
- rate: string;
98
- /** The title/name of the taxing jurisdiction. */
99
- title: string;
100
- }
101
- interface Discount {
102
- /** The ID of the Discount. */
103
- id: string;
104
- /** The code of the Discount. */
105
- code: string;
106
- /** The value of the Discount. */
107
- value: number;
108
- /** The type of the value of the Discount. */
109
- value_type: 'percentage' | 'fixed_amount';
110
- }
111
- interface AnalyticsData {
112
- utm_params: {
113
- utm_campaign: string;
114
- utm_content: string;
115
- utm_data_source: string;
116
- utm_source: string;
117
- utm_medium: string;
118
- utm_term: string;
119
- utm_timestamp: string;
120
- }[];
121
- }
122
- declare type SubType<T, TRequired extends keyof T = keyof T, TOptional extends keyof T = keyof T> = Required<Pick<T, TRequired>> & Partial<Pick<T, TOptional>>;
123
-
124
- interface ShippingLine {
125
- /** The code associated with the shipping_line of a Charge. */
126
- code: string;
127
- /** The price of the shipping_line. */
128
- price: string;
129
- /** The source of the shipping_line. */
130
- source: string;
131
- /** The title of the shipping_line. */
132
- title: string;
133
- /** A boolean indicating if the shipping_line is taxable. */
134
- taxable: boolean;
135
- /** An array of tax lines associated with the shipping_line. */
136
- tax_lines: TaxLine[];
137
- }
138
- declare type OrderStatus = 'success' | 'error' | 'queued' | 'cancelled' | 'pending_charge_status';
139
- declare type OrderType = 'checkout' | 'recurring';
140
- interface Order {
141
- /** The unique numeric identifier for the order. */
142
- id: number;
143
- /** The id of the associated Address within Recharge. */
144
- address_id: number;
145
- /** The billing address at the time the order was created. See Addresses for detailed address information. */
146
- billing_address: AssociatedAddress;
147
- /** An object containing parameters of the Charge. */
148
- charge: {
149
- /** The id of the charge associated with this order. */
150
- id: number;
151
- /** An object containing external transaction ids associated with this charge, as they appear in external platforms. */
152
- external_transaction_id: ExternalTransactionId;
153
- };
154
- /** Details of the access method used by the purchase. */
155
- client_details: {
156
- /** The IP address of the buyer as detected in Checkout. */
157
- browser_ip: string;
158
- /** The user agent detected during Checkout. */
159
- user_agent: string;
160
- };
161
- /** The date when the order was created. */
162
- created_at: IsoDateString;
163
- /** The currency of the payment used to create the order. */
164
- currency: string;
165
- /** Object that contains information about the Customer. */
166
- customer: {
167
- /** The ID of the associated customer record. */
168
- id: number;
169
- /** The user email. */
170
- email: string;
171
- /** An object containing customer information associated with this charge. */
172
- external_customer_id: ExternalId;
173
- /** The hash of the Customer associated with the Charge. */
174
- hash: string;
175
- };
176
- /** An array of Discounts associated with the Order. */
177
- discounts: Discount[];
178
- /** The cart token as it appears in an external system. */
179
- external_cart_token: string;
180
- /** An object containing external order ids. */
181
- external_order_id?: ExternalId;
182
- /** An object containing the external order numbers. */
183
- external_order_number: ExternalId;
184
- /** A boolean representing if this Order is generated from a prepaid purchase. */
185
- is_prepaid?: boolean;
186
- /** A list of line_item objects. */
187
- line_items: LineItem[];
188
- /** Notes associated with the Order. */
189
- note: string;
190
- /** An array of name value pairs of note attributes on the Order. */
191
- order_attributes: Property[];
192
- /** The date time that the associated charge was processed at. */
193
- processed_at: IsoDateString | null;
194
- /** The date time of when the associated charge is/was scheduled to process. */
195
- scheduled_at: IsoDateString;
196
- /** The shipping address where the order will be shipped. See Addresses for detailed Address information. */
197
- shipping_address: AssociatedAddress;
198
- /** An array of shipping lines associated with the order. */
199
- shipping_lines: ShippingLine[];
200
- /** The status of creating the Order. */
201
- status: OrderStatus;
202
- /** The subtotal price (sum of all line items * their quantity) of the order less discounts. */
203
- subtotal_price: string;
204
- /** A comma separated list of tags on the Order. */
205
- tags: string;
206
- /** An array of tax lines that apply to the Order. */
207
- tax_lines: TaxLine[];
208
- /** A boolean indicator of the taxability of the Order. */
209
- taxable: boolean;
210
- /** The total discounted dollar value of the Order. */
211
- total_discounts: string;
212
- /** The total price of all line items of the Order. */
213
- total_line_items_price: string;
214
- /** The total amount due of the Order. */
215
- total_price: string;
216
- /** The total dollar amount of refunds associated with the Order. */
217
- total_refunds: string;
218
- /** The total tax due associated with the Order. */
219
- total_tax: string;
220
- /** The total weight of the order in grams. */
221
- total_weight_grams: number;
222
- /** An indicator of the order’s type. */
223
- type: OrderType;
224
- /** The date time at which the order was most recently updated. */
225
- updated_at: IsoDateString;
226
- /** Error information about the order if status is 'error' */
227
- error: string | null;
228
- }
229
- interface OrdersResponse {
230
- next_cursor: null | string;
231
- previous_cursor: null | string;
232
- orders: Order[];
233
- }
234
- declare type OrderSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc' | 'processed_at-asc' | 'processed_at-desc' | 'scheduled_at-asc' | 'scheduled_at-desc';
235
- interface OrderListParams extends ListParams<OrderSortBy> {
236
- address_id?: string;
237
- charge_id?: string;
238
- created_at_min?: IsoDateString;
239
- created_at_max?: IsoDateString;
240
- customer_id?: string;
241
- external_customer_id?: string;
242
- ids?: string[];
243
- scheduled_at_max?: IsoDateString;
244
- scheduled_at_min?: IsoDateString;
245
- has_external_order?: string;
246
- status?: OrderStatus;
247
- type?: OrderType;
248
- purchase_item_id?: string;
249
- updated_at_max?: IsoDateString;
250
- updated_at_min?: IsoDateString;
251
- }
252
-
253
- declare type ChargeStatus = 'success' | 'error' | 'queued' | 'skipped' | 'refunded' | 'partially_refunded' | 'pending_manual_payment' | 'pending';
254
- interface Charge {
255
- /** The unique numeric identifier for the Charge. */
256
- id: number;
257
- /** The ID of the shipping Address tied to the Charge.*/
258
- address_id: number;
259
- /** An object containing analytics data associated with the Charge. */
260
- analytics_data: AnalyticsData;
261
- /** All the billing information related to the charge. */
262
- billing_address: AssociatedAddress;
263
- /** Details of the access method used by the purchaser. */
264
- client_details: {
265
- /** The IP address of the buyer as detected in Checkout. */
266
- browser_ip: string;
267
- /** The user agent detected during Checkout. */
268
- user_agent: string;
269
- };
270
- /** The date and time when the transaction was created. */
271
- created_at: IsoDateString;
272
- /** The code of the currency for this Charge, such as USD. */
273
- currency: string;
274
- /** An object containing Customer information associated with this Charge. */
275
- customer: {
276
- /** The ID of the associated customer record. */
277
- id: number;
278
- /** The user email. */
279
- email: string;
280
- /** An object containing customer information associated with this charge. */
281
- external_customer_id: string;
282
- /** The hash of the Customer associated with the Charge. */
283
- hash: string;
284
- };
285
- /** An array of Discounts associated with the Charge. */
286
- discounts: Discount[];
287
- /** An object containing the associated external order ID. */
288
- external_order_id: ExternalId;
289
- /** An object containing the associated external transaction ID. */
290
- external_transaction_id: ExternalTransactionId;
291
- /** A list of line_item objects, each containing information about a distinct purchase item. */
292
- line_items: LineItem;
293
- /** Notes associated with the Charge. */
294
- note: string;
295
- /** An array of name-value pairs of order attributes on the Charge. */
296
- order_attributes: Property[];
297
- /** The number of Orders generated from this Charge (>1 for prepaid Subscriptions). */
298
- orders_count: number;
299
- /** The payment processor used for this Charge. */
300
- payment_processor: string;
301
- /** The date and time when the transaction was processed. */
302
- processed_at: IsoDateString;
303
- /** The date when the next attempt will be placed. */
304
- retry_date: IsoDateString;
305
- /** The date time of when the Charge is/was scheduled to process. */
306
- scheduled_at: IsoDateString;
307
- /** The shipping Address of the Charge. */
308
- shipping_address: AssociatedAddress;
309
- /** An array of shipping lines associated with the Charge. */
310
- shipping_lines: ShippingLine[];
311
- /** The status of the Charge. */
312
- status: ChargeStatus;
313
- /** The combined price of all line_items without taxes and shipping. */
314
- subtotal_price: string;
315
- /** A comma-separated list of tags on the Charge. */
316
- tags: string;
317
- /** An array of tax lines that apply to the Charge. */
318
- tax_lines: TaxLine[];
319
- /** A boolean indicator of the taxability of the Charge. */
320
- taxable: boolean;
321
- /** The sum of the Discounts applied to the Charge. */
322
- total_discounts: string;
323
- /** The total price of all line items of the Charge. */
324
- total_line_items_price: string;
325
- /** The sum of all the prices of all the items in the Charge, taxes and discounts included (must be positive). */
326
- total_price: string;
327
- /** The sum of all refunds that were applied to the Charge. */
328
- total_refunds: string;
329
- /** The total tax due associated with the Charge. */
330
- total_tax: string;
331
- /** The total weight of the Charge’s line items in grams. */
332
- total_weight_grams: number;
333
- /** An indicator of the Charge’s type, either checkout or recurring. */
334
- type: 'checkout' | 'recurring';
335
- /** The date time at which the Charge was most recently updated. */
336
- updated_at: IsoDateString;
337
- }
338
- interface ChargeResponse {
339
- charge: Charge;
340
- }
341
- interface ChargeListResponse {
342
- next_cursor: null | string;
343
- previous_cursor: null | string;
344
- charges: Charge[];
345
- }
346
- interface ApplyDiscountRequest {
347
- /** Code of the Discount you want to apply to a Charge. */
348
- discount_code?: string;
349
- /** ID of the Discount you want to apply to a Charge. */
350
- discount_id?: number;
351
- }
352
- declare type ChargeSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc' | 'scheduled_at-asc' | 'scheduled_at-desc';
353
- interface ChargeListParams extends ListParams<ChargeSortBy> {
354
- /** Filter Charges by Address. */
355
- address_id?: string;
356
- /** Filter Charges by Customer. */
357
- customer_id?: string;
358
- /** List Charges that contain the given discount_id. */
359
- discount_id?: string;
360
- /** List Charges that contain the given discount_code. */
361
- discount_code?: string;
362
- /** Filter Charges by the associated order ID in the external e-commerce platform. */
363
- external_order_id?: string;
364
- /**
365
- * Filter Charges by ID.
366
- * If passing multiple values, must be comma separated. Non-integer values will result in a 422 error.
367
- */
368
- ids?: string;
369
- /** Filter Charges by a Subscription or Onetime ID. */
370
- purchase_item_id?: string;
371
- /** Filter Charges by a comma-separated list of Subscription or Onetime IDs. */
372
- purchase_item_ids?: string;
373
- /** Filter Charges by specific scheduled charge date. */
374
- scheduled_at?: IsoDateString;
375
- /** Show Charges scheduled to be processed before the given date. */
376
- scheduled_at_max?: IsoDateString;
377
- /** Show Charges scheduled to be processed after the given date. */
378
- scheduled_at_min?: IsoDateString;
379
- /** Filter charges by status. */
380
- status?: ChargeStatus;
381
- /** Show charges updated before the given date. */
382
- updated_at_max?: IsoDateString;
383
- /** Show charges updated after the given date. */
384
- updated_at_min?: IsoDateString;
385
- /** Show charges processed after, and including, the given date. */
386
- processed_at_max?: IsoDateString;
387
- /** Show charges processed before, and including, the given date. */
388
- processed_at_min?: IsoDateString;
389
- /** Show Charges created after the given date. */
390
- created_at_min?: IsoDateString;
391
- /** Show Charges created before the given date. */
392
- created_at_max?: IsoDateString;
393
- }
394
-
395
- interface CreateAddressRequest {
396
- /** Unique numeric identifier for the customer associated with the address. */
397
- customer_id: number;
398
- /** The street associated with the Address. Minimum length is 1 character. */
399
- address1: string;
400
- /** Any additional information associated with the Address. */
401
- address2?: string;
402
- /** The city associated with the address. */
403
- city: string;
404
- /** The company associated with the address. */
405
- company?: string;
406
- /** 2-letter country code. */
407
- country_code: string;
408
- /** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
409
- discounts?: {
410
- id: number;
411
- }[];
412
- /** The customer’s first name associated with the address. */
413
- first_name: string;
414
- /** The customer’s last name associated with the address. */
415
- last_name: string;
416
- /** Replaces cart_attributes. Extra information that is added to the order. */
417
- order_attributes?: Property[];
418
- /** Notes to be added to all orders associated with the address. */
419
- order_note?: string | null;
420
- /** Payment method id for the Payment_method to be associated to this address. */
421
- payment_method_id?: number;
422
- /** The phone number associated with the address. Must be included in the request schema but can be an empty string. */
423
- phone: string;
424
- /** The currency on the subscription contract in Shopify. Only set if the currency is different from the store-level currency. Else, will be null. */
425
- presentment_currency?: string | null;
426
- /** The state or province associated with the address. */
427
- province: string | null;
428
- /** Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when Charge is created or regenerated */
429
- shipping_lines_override?: {
430
- code: string;
431
- price: string;
432
- title: string;
433
- }[] | null;
434
- /** The zip or postal code associated with the address. */
435
- zip: string;
436
- }
437
- declare type UpdateAddressRequest = Omit<Partial<CreateAddressRequest>, 'presentment_currency' | 'customer_id'>;
438
- interface MergeAddressesRequest {
439
- /** Indicates whether source addresses should be deleted. */
440
- delete_source_addresses?: boolean;
441
- /** Specifies the next charge date of the associated subscriptions on the target address. */
442
- next_charge_date?: string;
443
- /** The address all of the subscriptions should be moved to. */
444
- target_address: Address | {
445
- id: number;
446
- };
447
- /** The list of addresses that the subscriptions should move from. */
448
- source_addresses: (Address | {
449
- id: number;
450
- })[];
451
- }
452
- interface SkipFutureChargeAddressRequest {
453
- /**
454
- * The date in the future of the Charge to be skipped.
455
- * This date must be within the delivery schedules of the Customer.
456
- */
457
- date: IsoDateString;
458
- /** A list containing the Subscription IDs to be skipped. */
459
- subscription_ids: string;
460
- }
461
- interface Address {
462
- /** Unique numeric identifier for the Address. */
463
- id: number;
464
- /** The street associated with the Address. */
465
- address1: string;
466
- /** Any additional information associated with the Address. */
467
- address2?: string;
468
- /** The city associated with the address. */
469
- city: string;
470
- /** The company associated with the address. */
471
- company: string;
472
- /** 2-letter country code. */
473
- country_code: string;
474
- /** Unique numeric identifier for the customer associated with the address. */
475
- customer_id: number;
476
- /** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
477
- discounts?: {
478
- id: number;
479
- }[];
480
- /** The customer’s first name associated with the address. */
481
- first_name: string;
482
- /** The customer’s last name associated with the address. */
483
- last_name: string;
484
- /** Replaces cart_attributes. Extra information that is added to the order. */
485
- order_attributes: Property[];
486
- /** Notes to be added to all orders associated with the address. */
487
- order_note: string | null;
488
- /** Unique numeric identifier for the Payment Method associated to the Address. */
489
- payment_method_id: number;
490
- /** The phone number associated with the address. */
491
- phone: string;
492
- /** The currency on the subscription contract in Shopify. Only set if the currency is different from the store-level currency. Else, will be null. */
493
- presentment_currency: string | null;
494
- /** The state or province associated with the address. */
495
- province: string | null;
496
- /** Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when Charge is created or regenerated */
497
- shipping_lines_override: {
498
- code: string;
499
- price: string;
500
- title: string;
501
- }[] | null;
502
- /** The zip or postal code associated with the address. */
503
- zip?: string | null;
504
- /** The date and time when the address was created. */
505
- created_at: IsoDateString;
506
- /** The date and time when the address was last updated. */
507
- updated_at: IsoDateString;
508
- }
509
- interface SkipFutureChargeAddressResponse {
510
- charge: Charge;
511
- }
512
- interface AddressResponse {
513
- address: Address;
514
- }
515
- interface AddressListResponse {
516
- next_cursor: null | string;
517
- previous_cursor: null | string;
518
- addresses: Address[];
519
- }
520
- declare type AddressSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
521
- interface AddressListParams extends ListParams<AddressSortBy> {
522
- customer_id?: string;
523
- discount_id?: string;
524
- discount_code?: string;
525
- created_at_min?: IsoDateString;
526
- created_at_max?: IsoDateString;
527
- }
528
-
529
- interface Session {
530
- apiToken: string;
531
- customerId?: string;
532
- }
533
-
534
- /** Returns all addresses from the store, or addresses for the customer given in the parameter. */
535
- declare function listAddresses(session: Session, query?: AddressListParams): Promise<AddressListResponse>;
536
- /** Retrieves address for customer based on specified address id. */
537
- declare function getAddress(session: Session, id: string | number): Promise<Address>;
538
- /** Create a new address for a customer. */
539
- declare function createAddress(session: Session, createRequest: CreateAddressRequest): Promise<Address>;
540
- /** Updates an existing address to match the specified parameters. */
541
- declare function updateAddress(session: Session, id: string | number, updateRequest: UpdateAddressRequest): Promise<Address>;
542
- /** Deletes an address. Only Addresses with no active Subscriptions can be deleted. */
543
- declare function deleteAddress(session: Session, id: string | number): Promise<void>;
544
- /**
545
- * Merges up to 10 source addresses into 1 target address.
546
- */
547
- declare function mergeAddresses(session: Session, mergeRequest: MergeAddressesRequest): Promise<Address>;
548
- /**
549
- * Skip a Charge in the future for one or multiple Subscriptions associated with the Address.
550
- */
551
- declare function skipFutureCharge(session: Session, id: string | number, skipRequest: SkipFutureChargeAddressRequest): Promise<Charge>;
552
-
553
- declare function loginShopifyAppProxy(): Promise<Session>;
554
- declare function loginShopifyApi(customerAccessToken: string, storefrontAccessToken: string): Promise<Session | null>;
555
-
556
- declare function getCharge(session: Session, id: number | string): Promise<Charge>;
557
- /** Lists charges */
558
- declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
559
- /**
560
- * You cannot add a Discount to an existing queued Charge if the Charge or the associated Address already has one.
561
- * You can provide either discount_id or discount_code. If both parameters are passed, the value for discount_id will take precedence.
562
- * If a Charge has a Discount and it gets updated, or a regeneration occurs, the Discount will be lost. Regeneration is a process that refreshes the Charge JSON with new data in the case of the Subscription or Address being updated.
563
- */
564
- declare function applyDiscount(session: Session, id: number | string, applyRequest: ApplyDiscountRequest): Promise<Charge>;
565
- /**
566
- * Remove a Discount from a Charge without destroying the Discount.
567
- * In most cases the Discount should be removed from the Address. When the Discount is removed from the Address, the Discount is also removed from any future Charges.
568
- * If the Discount is on the parent Address, you cannot remove it using charge_id.
569
- * When removing your Discount, it is preferable to pass the address_id so that the Discount stays removed if the Charge is regenerated. Only pass charge_id in edge cases in which there are two or more Charges on a parent Address and you only want to remove the Discount from one Charge.
570
- * If you pass both parameters, it will remove the Discount from the Address.
571
- */
572
- declare function removeDiscount(session: Session, id: number | string): Promise<Charge>;
573
- declare function skipCharge(session: Session, id: number | string): Promise<Charge>;
574
- declare function unskipCharge(session: Session, id: number | string): Promise<Charge>;
575
-
576
- declare type Method = 'get' | 'post' | 'put' | 'delete';
577
- declare type Request = <T>(method: Method, url: string, options?: RequestOptions) => Promise<T>;
578
- interface GetRequestOptions {
579
- id?: string | number;
580
- query?: unknown;
581
- }
582
- interface CRUDRequestOptions {
583
- id?: string | number;
584
- data?: unknown;
585
- query?: unknown;
586
- }
587
- /** Custom headers we use within our storefront client */
588
- interface CustomHeaders {
589
- ['X-Recharge-App']?: 'storefront-client';
590
- }
591
- /** We only support headers with an object syntax */
592
- declare type RequestHeaders = Record<string, string> & CustomHeaders;
593
- interface RequestOptionsHeaders {
594
- headers?: RequestHeaders;
595
- }
596
- declare type RequestOptions = GetRequestOptions & CRUDRequestOptions & RequestOptionsHeaders;
597
-
598
- interface LoginResponse {
599
- api_token: string;
600
- customer_id?: string;
601
- }
602
-
603
- interface BundleSelection {
604
- collectionId: string;
605
- externalProductId: string;
606
- externalVariantId: string;
607
- quantity: number;
608
- }
609
- interface Bundle {
610
- externalVariantId: string;
611
- externalProductId: string;
612
- selections: BundleSelection[];
613
- }
614
-
615
- declare type FirstOption = 'onetime' | 'autodeliver';
616
- declare type IntervalUnit = 'day' | 'week' | 'month';
617
- declare type PriceAdjustmentsType = 'percentage';
618
- declare type StorefrontPurchaseOption = 'subscription_and_onetime' | 'subscription_only' | 'onetime_only' | 'inactive';
619
- interface BundleTranslations {
620
- cpb_add: string;
621
- cpb_add_items_to_continue: string;
622
- cpb_add_more_items: string;
623
- cpb_apply_filters: string;
624
- cpb_cancel: string;
625
- cpb_clear_all_filters: string;
626
- cpb_contents_for: string;
627
- cpb_day: string;
628
- cpb_filters: string;
629
- cpb_frequency: string;
630
- cpb_frequency_values: string;
631
- cpb_items_selected: string;
632
- cpb_items_selected_filters: string;
633
- cpb_month: string;
634
- cpb_remove: string;
635
- cpb_remove_items_to_continue: string;
636
- cpb_remove_some_items: string;
637
- cpb_save_button_text: string;
638
- cpb_saved_message: string;
639
- cpb_saving_message: string;
640
- cpb_select_bundle_contents: string;
641
- cpb_select_your_contents_to_continue_message_modal: string;
642
- cpb_select_your_contents_to_continue_title_modal: string;
643
- cpb_selection_count_alert: string;
644
- cpb_update_bundle_contents: string;
645
- cpb_week: string;
646
- cpb_your: string;
647
- cpb_your_next_order: string;
648
- pdp_add: string;
649
- pdp_add_items_to_continue: string;
650
- 'pdp_add_one-off_extras': string;
651
- 'pdp_add_one-off_extras_description': string;
652
- 'pdp_add_repeating_add-ons': string;
653
- 'pdp_add_repeating_add-ons_description': string;
654
- pdp_add_to_cart: string;
655
- pdp_add_to_cart_alert: string;
656
- pdp_add_to_cart_extras: string;
657
- pdp_add_to_cart_failed: string;
658
- pdp_apply_filters: string;
659
- pdp_back: string;
660
- pdp_bundle_contents: string;
661
- pdp_cancel: string;
662
- pdp_choose_items: string;
663
- pdp_choose_items_alert: string;
664
- pdp_choose_maximum: string;
665
- pdp_choose_range: string;
666
- pdp_clear_all_filters: string;
667
- pdp_day: string;
668
- pdp_filters: string;
669
- pdp_frequency: string;
670
- pdp_frequency_value: string;
671
- pdp_items_selected: string;
672
- pdp_items_selected_filters: string;
673
- pdp_max_per_item_reached_alert: string;
674
- pdp_month: string;
675
- pdp_next: string;
676
- 'pdp_one-off_extras': string;
677
- pdp_only_once: string;
678
- pdp_order_summary: string;
679
- pdp_plan_changed_alert: string;
680
- pdp_proceed_to_cart: string;
681
- pdp_product_added: string;
682
- pdp_regular_delivery: string;
683
- pdp_remove: string;
684
- pdp_remove_items_alert: string;
685
- pdp_remove_items_to_continue: string;
686
- 'pdp_repeating_add-ons': string;
687
- pdp_selection_completed_alert: string;
688
- pdp_selection_count_alert: string;
689
- pdp_sold_out: string;
690
- pdp_subscribe: string;
691
- pdp_total: string;
692
- pdp_update_your_selections_to_continue: string;
693
- pdp_week: string;
694
- }
695
- interface Translations {
696
- days: string;
697
- week: string;
698
- weeks: string;
699
- month: string;
700
- months: string;
701
- }
702
- declare type WidgetTemplateType = 'radio' | 'checkbox' | 'button_group' | 'radio_group';
703
- declare type WidgetIconColor = '#191D48' | 'white' | 'black' | '#ffffff';
704
- /****************** 2020-12 **********************/
705
- interface CDNProductResource {
706
- product: CDNProductRaw;
707
- meta: {
708
- version: '2020-12';
709
- };
710
- }
711
- interface CDNProductKeyObject {
712
- [key: string]: CDNProduct;
713
- }
714
- interface CDNProductsAndSettingsResource {
715
- products: {
716
- [key: string]: CDNProductRaw;
717
- }[];
718
- widget_settings: CDNWidgetSettingsRaw;
719
- store_settings?: CDNStoreSettings;
720
- meta?: {
721
- status: string;
722
- message: string;
723
- };
724
- }
725
- interface CDNSellingPlan {
726
- order_interval_frequency: string | number;
727
- created_at?: IsoDateString;
728
- order_interval_unit_type: IntervalUnit;
729
- updated_at?: IsoDateString;
730
- id: number;
731
- selling_plan_id: number;
732
- selling_plan_name: string;
733
- price_adjustments_value_type: PriceAdjustmentsType;
734
- price_adjustments_value: number;
735
- }
736
- interface CDNSellingPlanGroup {
737
- selling_plan_group_id: string | number;
738
- selling_plans: CDNSellingPlan[];
739
- subscription_product_id: number;
740
- }
741
- interface CDNSubscriptionOption {
742
- storefront_purchase_options: StorefrontPurchaseOption;
743
- updated_at: IsoDateString;
744
- is_prepaid?: boolean;
745
- }
746
- interface CDNSellingPlanAllocations {
747
- selling_plan_group_id: string | number;
748
- selling_plan_id: number;
749
- discounted_price: string;
750
- }
751
- interface CDNPrices {
752
- compare_at_price: string | null;
753
- unit_price: string;
754
- discounted_price: string;
755
- zero_decimal_currency: boolean;
756
- }
757
- interface CDNVariantOptionValue {
758
- id: number;
759
- label: string;
760
- }
761
- interface CDNVariant {
762
- id: number;
763
- option_values: CDNVariantOptionValue[];
764
- prices: CDNPrices;
765
- selling_plan_allocations: CDNSellingPlanAllocations[];
766
- }
767
- interface CDNProductOptionValue {
768
- id?: number | null;
769
- label: string;
770
- position: number;
771
- }
772
- interface CDNProductOption {
773
- id: number;
774
- name: string;
775
- position: number;
776
- values: CDNProductOptionValue[];
777
- }
778
- interface CDNProductRaw {
779
- id: number | null;
780
- bundle_product?: CDNBundleSettings | null;
781
- external_product_id: number;
782
- in_recharge: boolean;
783
- options: CDNProductOption[];
784
- variants: CDNVariant[];
785
- subscription_options: CDNSubscriptionOption;
786
- selling_plan_groups: CDNSellingPlanGroup[];
787
- }
788
- interface CDNProduct extends CDNProductRaw {
789
- /** @deprecated */
790
- isSubscriptionOnly: boolean;
791
- is_subscription_only: boolean;
792
- }
793
- interface CDNProductAndSettings {
794
- product: CDNProduct;
795
- widget_settings: CDNWidgetSettings;
796
- store_settings: CDNStoreSettings;
797
- /** @deprecated */
798
- widgetSettings: CDNWidgetSettings;
799
- /** @deprecated */
800
- storeSettings: CDNStoreSettings;
801
- }
802
- interface CDNProductsAndSettings {
803
- products: CDNProductKeyObject[];
804
- widget_settings: CDNWidgetSettings;
805
- store_settings: Partial<CDNStoreSettings>;
806
- }
807
- interface CDNBaseWidgetSettings {
808
- active_color: ColorString;
809
- auto_inject?: boolean;
810
- background_color: ColorString;
811
- bundle_translations?: BundleTranslations;
812
- delivery_dropdown_label: string;
813
- display_on: string[];
814
- first_option: FirstOption;
815
- font_color: ColorString;
816
- form_type: string;
817
- how_it_works: HTMLString;
818
- learnmore_url: string;
819
- learnmore_verbiage: string;
820
- onetime_message: string;
821
- popup_background_color: ColorString;
822
- popup_link_color: ColorString;
823
- popup_text_color: ColorString;
824
- poweredby_url: string;
825
- published: boolean;
826
- select_subscription_first: boolean;
827
- show_learnmore: boolean;
828
- show_poweredby: boolean;
829
- show_subscription_details: boolean;
830
- show_subscription_details_icon: boolean;
831
- sub_and_save_ext_label: string;
832
- subscribe_message: string;
833
- subscribe_without_discount_message: string;
834
- subscription_details_verbiage: string;
835
- translations: Translations;
836
- widget_charge_every: string;
837
- widget_deliver_every: string;
838
- widget_icon: WidgetIconColor;
839
- widget_template_type: WidgetTemplateType;
840
- }
841
- declare type CDNExcludedWidgetSettings = 'display_on' | 'first_option';
842
- interface CDNWidgetSettings extends Omit<CDNBaseWidgetSettings, CDNExcludedWidgetSettings> {
843
- /** @deprecated */
844
- autoInject: boolean;
845
- /** @deprecated */
846
- validPages: string[];
847
- /** @deprecated */
848
- isSubscriptionFirst: boolean;
849
- auto_inject: boolean;
850
- valid_pages: string[];
851
- is_subscription_first: boolean;
852
- }
853
- declare type CDNWidgetSettingsRaw = {
854
- [key in keyof CDNBaseWidgetSettings]: string;
855
- };
856
- interface CDNWidgetSettingsResource {
857
- widget_settings: CDNWidgetSettingsRaw;
858
- meta: {
859
- version: string;
860
- };
861
- }
862
- interface CDNStoreSettings {
863
- store_currency: {
864
- currency_code: string;
865
- currency_symbol: string;
866
- decimal_separator: string;
867
- thousands_separator: string;
868
- currency_symbol_location: string;
869
- zero_decimal_currency?: boolean;
870
- };
871
- }
872
- /****************** 2021-08 **********************/
873
- /**************** Bundles ****************/
874
- interface CDNBundleStepOption {
875
- content: string;
876
- defaultImage: string;
877
- }
878
- interface CDNBundleStep {
879
- data?: {
880
- optionsMeta: {
881
- [key: string]: CDNBundleStepOption;
882
- };
883
- };
884
- disable: boolean;
885
- index: string;
886
- name: string;
887
- title: string;
888
- type: 'variantSelector' | 'all-collections' | 'addons' | 'summary' | 'cross-sells';
889
- }
890
- interface CDNBundleLayoutSettings {
891
- addToCartCallback: {
892
- type: 'none';
893
- value: string;
894
- };
895
- addons: {
896
- collectionHandle: string;
897
- collectionId: string;
898
- enabled: boolean;
899
- };
900
- collapsibleSections: boolean;
901
- crossSells: {
902
- collectionId: string;
903
- enabled: boolean;
904
- collectionHandle: string;
905
- };
906
- defaultFrequency: string;
907
- defaultVariantId: string;
908
- description: string;
909
- filters: any[];
910
- learnMoreModal: boolean;
911
- published: boolean;
912
- showVariants: boolean;
913
- template: 'one-page' | 'multi-step';
914
- templateSettings: {
915
- onePage: {
916
- frequencySelector: 'dropdown';
917
- };
918
- multiStep?: {
919
- steps: CDNBundleStep[];
920
- optionImages: string;
921
- };
922
- };
923
- title: string;
924
- visibility: {
925
- portal: boolean;
926
- signup: boolean;
927
- };
928
- }
929
- interface CDNBundleVariantOptionSource {
930
- id: number;
931
- collection_id: string;
932
- quantity_max: number | null;
933
- quantity_min: number | null;
934
- }
935
- interface CDNBundleVariantSelectionDefault {
936
- id: number;
937
- quantity: number;
938
- external_variant_id: string;
939
- }
940
- interface CDNBundleVariant {
941
- enabled: boolean;
942
- external_variant_id: string;
943
- id: number;
944
- items_count: number;
945
- option_sources: CDNBundleVariantOptionSource[];
946
- selection_defaults?: CDNBundleVariantSelectionDefault[];
947
- }
948
- interface CDNBundleSettings {
949
- customization_window_disabled_message: string | null;
950
- customization_window?: number;
951
- default_bundle_variant_id?: number;
952
- description: string | null;
953
- external_product_id: string;
954
- id: number;
955
- is_customizable?: boolean;
956
- layout_settings: CDNBundleLayoutSettings;
957
- layout_settings_version: '2021-11';
958
- max_quantity_per_variant: number | null;
959
- reset_box_contents?: boolean;
960
- variants: CDNBundleVariant[];
961
- }
962
-
963
- interface PaymentDetails {
964
- /** Payment_method brand or company powering it. valid for CREDIT_CARD only. */
965
- brand?: string;
966
- /** Payment_method expiry month. valid for CREDIT_CARD only. */
967
- exp_month?: string;
968
- /** Payment_method expiry year. valid for CREDIT_CARD only. */
969
- exp_year?: string;
970
- /** last 4-digits of the identifier. valid for CREDIT_CARD only. */
971
- last4?: string;
972
- /** email linked to paypal. valid for PAYPAL only. */
973
- paypal_email?: string;
974
- /** paypal user identifier. valid for PAYPAL only. */
975
- paypal_payer_id?: string;
976
- /** If a digital wallet. */
977
- wallet_type?: string;
978
- /** Type of funding for the Payment Method. */
979
- funding_type?: string;
980
- }
981
- declare type PaymentType = 'CREDIT_CARD' | 'PAYPAL' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'SEPA_DEBIT';
982
- declare type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie';
983
- declare type PaymentMethodStatus = 'not_validated' | 'valid' | 'invalid';
984
- interface PaymentMethod {
985
- /** The unique payment method id for a customer. */
986
- id: number;
987
- /** An object with the customer’s address information. */
988
- billing_address: AssociatedAddress;
989
- /** The Recharge customer_id */
990
- customer_id: number;
991
- /** The time the payment method was created. */
992
- created_at: IsoDateString;
993
- /** If this is the default payment method for the customer */
994
- default: boolean;
995
- /** Details about the specific payment method */
996
- payment_details: PaymentDetails;
997
- /**
998
- * The type of payment this is.
999
- * If passed, must also be accompanied by one of stripe_customer_token, paypal_customer_token or authorizedotnet_customer_token in processor_payment_method_token.
1000
- */
1001
- payment_type: PaymentType;
1002
- /** The customer token at the processor. */
1003
- processor_customer_token: string;
1004
- /**
1005
- * This will impact validation on billing_details.
1006
- * Currently, shopify_payments is in read-only mode and can only be managed by Shopify.
1007
- */
1008
- processor_name: ProcessorName;
1009
- /** The payment token at the processor. */
1010
- processor_payment_method_token: string;
1011
- /** State of the Payment Method. */
1012
- status: PaymentMethodStatus;
1013
- /**
1014
- * The status reason for the payment method.
1015
- * Often used when invalid to provide background details in invalidity.
1016
- */
1017
- status_reason: string;
1018
- /** The time the payment method was last updated. */
1019
- updated_at: IsoDateString;
1020
- }
1021
- interface PaymentMethodsResponse {
1022
- next_cursor: null | string;
1023
- previous_cursor: null | string;
1024
- payment_methods: PaymentMethod[];
1025
- }
1026
- declare type PaymentMethodOptionalUpdateProps = 'billing_address' | 'default';
1027
- declare type UpdatePaymentMethodRequest = Partial<Pick<PaymentMethod, PaymentMethodOptionalUpdateProps>>;
1028
- /** no sorting options for payment_methods, always by id-desc */
1029
- declare type PaymentMethodSortBy = null;
1030
- interface PaymentMethodListParams extends ListParams<PaymentMethodSortBy> {
1031
- customer_id?: string;
1032
- processor_name?: ProcessorName;
1033
- address_id?: string;
1034
- processor_payment_method_token?: string;
1035
- }
1036
-
1037
- interface Subscription {
1038
- /** Unique numeric identifier for the subscription. */
1039
- id: number;
1040
- /** Unique numeric identifier for the address the subscription is associated with. */
1041
- address_id: number;
1042
- /** Unique numeric identifier for the customer the subscription is tied to. */
1043
- customer_id: number;
1044
- /** An object used to contain analytics data such as utm parameters. */
1045
- analytics_data: AnalyticsData;
1046
- /** Reason provided for cancellation. */
1047
- cancellation_reason: string | null;
1048
- /** Additional comment for cancellation. */
1049
- cancellation_reason_comments: string | null;
1050
- /** The time the subscription was cancelled. */
1051
- cancelled_at: string | null;
1052
- /**
1053
- * The number of units (specified in order_interval_unit) between each Charge. For example, order_interval_unit=month and charge_interval_frequency=3, indicate charge every 3 months.
1054
- * Charges must use the same unit types as orders.
1055
- * Max: 1000
1056
- */
1057
- charge_interval_frequency: number;
1058
- /** The time the subscription was created. */
1059
- created_at: IsoDateString;
1060
- /** Set the number of charges until subscription expires. */
1061
- expire_after_specific_number_of_charges: number | null;
1062
- /** An object containing the product id as it appears in external platforms. */
1063
- external_product_id: ExternalId;
1064
- /** An object containing the variant id as it appears in external platforms. */
1065
- external_variant_id: ExternalId;
1066
- /** Retrieves true if there is queued charge. Otherwise, retrieves false. */
1067
- has_queued_charges: boolean;
1068
- /** Value is set to true if it is a prepaid item. */
1069
- is_prepaid: boolean;
1070
- /** Value is set to true if it is not a prepaid item */
1071
- is_skippable: boolean;
1072
- /** Value is set to true if it is not a prepaid item and if in Customer portal settings swap is allowed for customers. */
1073
- is_swappable: boolean;
1074
- /** Retrieves true if charge has an error max retries reached. Otherwise, retrieves false. */
1075
- max_retries_reached: boolean;
1076
- /** Date of the next charge for the subscription. */
1077
- next_charge_scheduled_at: IsoDateString;
1078
- /**
1079
- * The set day of the month order is created. Default is that there isn’t a strict day of the month when the order is created.
1080
- * This is only applicable to subscriptions with order_interval_unit:“month”.
1081
- */
1082
- order_day_of_month: number | null;
1083
- /**
1084
- * The set day of the week order is created. Default is that there isn’t a strict day of the week order is created.
1085
- * This is only applicable to subscriptions with order_interval_unit = “week”.
1086
- * Value of 0 equals to Monday, 1 to Tuesday etc.
1087
- */
1088
- order_day_of_week: number | null;
1089
- /**
1090
- * The number of units (specified in order_interval_unit) between each order. For example, order_interval_unit=month and order_interval_frequency=3, indicate order every 3 months. Max value: 1000
1091
- */
1092
- order_interval_frequency: number;
1093
- /** The frequency unit used to determine when a subscription’s order is created. */
1094
- order_interval_unit: 'day' | 'week' | 'month';
1095
- /** The presentment currency of the subscription. */
1096
- presentment_currency: string | null;
1097
- /** The price of the item before discounts, taxes, or shipping have been applied. */
1098
- price: string;
1099
- /** The name of the product in a store’s catalog. */
1100
- product_title: string | null;
1101
- /** A list of line item objects, each one containing information about the subscription. Custom key-value pairs can be installed here, they will appear on the connected queued charge and after it is processed on the order itself. */
1102
- properties: Property[];
1103
- /** The number of items in the subscription. */
1104
- quantity: number;
1105
- /** A unique identifier of the item in the fulfillment. In cases where SKU is blank, it will be dynamically pulled whenever it is used. */
1106
- sku: string | null;
1107
- /** Flag that is automatically updated to true when SKU is passed on create or update. When sku_override is true, the SKU on the subscription will be used to generate charges and orders. When sku_override is false, Recharge will dynamically fetch the SKU from the corresponding external platform variant. */
1108
- sku_override: boolean;
1109
- /**
1110
- * The status of the subscription.
1111
- * expired - This status occurs when the maximum number of charges for a product has been reached.
1112
- */
1113
- status: 'active' | 'cancelled' | 'expired';
1114
- /** The date time at which the purchase_item record was last updated. */
1115
- updated_at: IsoDateString;
1116
- /** The name of the variant in a shop’s catalog. */
1117
- variant_title: string;
1118
- }
1119
- interface SubscriptionsResponse {
1120
- next_cursor: null | string;
1121
- previous_cursor: null | string;
1122
- subscriptions: Subscription[];
1123
- }
1124
- declare type SubscriptionSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
1125
- interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
1126
- created_at_min?: IsoDateString;
1127
- created_at_max?: IsoDateString;
1128
- customer_id?: string;
1129
- }
1130
- declare type SubscriptionRequiredCreateProps = 'address_id' | 'charge_interval_frequency' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity';
1131
- declare type SubscriptionOptionalCreateProps = 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'external_product_id' | 'product_title' | 'properties' | 'status';
1132
- declare type CreateSubscriptionRequest = SubType<Subscription, SubscriptionRequiredCreateProps, SubscriptionOptionalCreateProps>;
1133
- declare type SubscriptionOptionalUpdateProps = 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity' | 'external_product_id' | 'external_variant_id' | 'properties' | 'sku' | 'sku_override';
1134
- declare type UpdateSubscriptionRequest = Partial<Pick<Subscription, SubscriptionOptionalUpdateProps>>;
1135
- interface UpdateSubscriptionParams {
1136
- /** Controls whether the QUEUED charges linked to the subscription should be regenerated upon subscription update. By default the flag is set to false which will delay charge regeneration 5 seconds. This enables running multiple calls to perform changes and receive responses much faster since the API won’t wait for a charge regeneration to complete. Setting this parameter to true will cause charge regeneration to complete before returning a response. */
1137
- commit?: boolean;
1138
- }
1139
- interface CancelSubscriptionRequest {
1140
- cancellation_reason: string;
1141
- cancellation_reason_comments?: string;
1142
- send_email?: boolean;
1143
- }
1144
-
1145
- declare type CustomerIncludes = 'addresses' | 'payment_methods' | 'subscriptions';
1146
- interface GetCustomerOptions {
1147
- include: CustomerIncludes[];
1148
- }
1149
- interface Customer {
1150
- /** Unique numeric identifier for the Customer. */
1151
- id: number;
1152
- /** An object containing analytics data associated with the customer. */
1153
- analytics_data: AnalyticsData;
1154
- /** The date and time when the customer was created. */
1155
- created_at: IsoDateString;
1156
- /** The email address of the customer. */
1157
- email: string;
1158
- /** An object containing external ids for the customer record. */
1159
- external_customer_id: ExternalId;
1160
- /** Date when first charge was processed for the customer. */
1161
- first_charge_processed_at: IsoDateString;
1162
- /** The customer’s first name. */
1163
- first_name: string;
1164
- /** A boolean that indicates if the customer has a payment method that is in dunning (failed charge). */
1165
- has_payment_method_in_dunning: boolean;
1166
- /** Is the payment method valid or not. */
1167
- has_valid_payment_method: boolean;
1168
- /** The unique string identifier used in a customers portal link. */
1169
- hash: string;
1170
- /** The customer’s last name. */
1171
- last_name: string;
1172
- /** The number of active subscriptions on addresses associated with the customer. */
1173
- subscriptions_active_count: number;
1174
- /** The total number of subscriptions created on addresses associated with the customer. */
1175
- subscriptions_total_count: number;
1176
- /** The date and time when the customer was last updated. */
1177
- updated_at: IsoDateString;
1178
- /** Additional information as requested */
1179
- include?: {
1180
- addresses?: Address[];
1181
- payment_methods?: PaymentMethod[];
1182
- subscriptions?: Subscription[];
1183
- };
1184
- }
1185
- declare type CustomerOptionalUpdateProps = 'email' | 'first_name' | 'last_name' | 'external_customer_id';
1186
- declare type UpdateCustomerRequest = Partial<Pick<Customer, CustomerOptionalUpdateProps>>;
1187
- interface CustomerDeliveryScheduleParams {
1188
- delivery_count_future?: number;
1189
- future_internal?: number;
1190
- date_max?: IsoDateString;
1191
- }
1192
- interface Delivery {
1193
- date: IsoDateString;
1194
- orders: Order[];
1195
- }
1196
- interface CustomerDeliveryScheduleResponse {
1197
- customer: {
1198
- id: number;
1199
- email: string;
1200
- first_name: string;
1201
- last_name: string;
1202
- };
1203
- deliveries: Delivery[];
1204
- }
1205
-
1206
- /** @internal */
1207
- declare type MembershipStatus = 'active' | 'inactive';
1208
- /** @internal */
1209
- interface Membership {
1210
- id: string;
1211
- store_id: number;
1212
- customer_id: number;
1213
- membership_program_id: number;
1214
- purchase_item_id: number | null;
1215
- status: MembershipStatus;
1216
- created_at: IsoDateString;
1217
- deleted_at: IsoDateString | null;
1218
- expires_at: IsoDateString | null;
1219
- subscription_cancelled_at: IsoDateString | null;
1220
- image?: string;
1221
- }
1222
- /** @internal */
1223
- interface MembershipResponse {
1224
- membership: Membership;
1225
- }
1226
- /** @internal */
1227
- interface MembershipListResponse {
1228
- next_cursor: null | string;
1229
- previous_cursor: null | string;
1230
- memberships: Membership[];
1231
- }
1232
- /** @internal */
1233
- declare type MembershipsSortBy = 'id-asc' | 'id-desc';
1234
- /** @internal */
1235
- declare type membershipIncludes = 'customer' | 'subscriptions';
1236
- /** @internal */
1237
- declare type MembershipIncludes = `${membershipIncludes}` | `${membershipIncludes},${membershipIncludes}`;
1238
- /** @internal */
1239
- interface MembershipListParams extends ListParams<MembershipsSortBy> {
1240
- include?: MembershipIncludes;
1241
- customer_id?: number;
1242
- customer_name?: string;
1243
- customer_email?: string;
1244
- membership_program_ids?: string;
1245
- status?: MembershipStatus;
1246
- created_at_min?: IsoDateString;
1247
- created_at_max?: IsoDateString;
1248
- expires_at_min?: IsoDateString;
1249
- expires_at_max?: IsoDateString;
1250
- include_cancelled?: boolean;
1251
- include_deleted?: boolean;
1252
- }
1253
- /** @internal */
1254
- interface ActivateMembershipRequest {
1255
- expires_at: string | null;
1256
- }
1257
- /** @internal */
1258
- interface CancelMembershipRequest {
1259
- cancel_immediately: boolean;
1260
- cancellation_reason: string;
1261
- cancellation_reason_comments: string;
1262
- expires_at: IsoDateString;
1263
- }
1264
-
1265
- interface Onetime {
1266
- /** Unique numeric identifier for the Onetime purchase. */
1267
- id: number;
1268
- /** Unique numeric identifier for the address the Onetime Purchase is associated with (cannot be used with next_charge_scheduled_at) */
1269
- address_id: number;
1270
- /** The time the Onetime item was first created. */
1271
- created_at: IsoDateString;
1272
- /** Unique numeric identifier for the customer the Onetime purchase is tied to. */
1273
- customer_id: number;
1274
- /** An object containing the product id as it appears in external platforms. */
1275
- external_product_id: ExternalId;
1276
- /** An object containing the variant id as it appears in external platforms. */
1277
- external_variant_id: ExternalId;
1278
- /** Flag indicating if the the onetime is cancelled. */
1279
- is_cancelled: boolean;
1280
- /**
1281
- * Date of the Onetime purchase execution.
1282
- * Cannot be used with add_to_next_charge
1283
- */
1284
- next_charge_scheduled_at: IsoDateString;
1285
- /** The price of the item before discounts, taxes, or shipping have been applied. */
1286
- price: string;
1287
- /** The name of the product in a shop’s catalog. */
1288
- product_title: string;
1289
- /** An array containing key value pairs for any supplementary data. */
1290
- properties: Property[];
1291
- /** The number of items in the Onetime purchase. */
1292
- quantity: number;
1293
- /** A unique identifier of the item in the fulfillment. */
1294
- sku: string;
1295
- /** Flag that is automatically updated to true when SKU is passed on POST or PUT. */
1296
- sku_override: boolean;
1297
- /** The time the Onetime purchase was last updated. */
1298
- updated_at: IsoDateString;
1299
- /** The name of the variant in a shop’s catalog. */
1300
- variant_title: string;
1301
- /** Presentment currency */
1302
- presentment_currency: string | null;
1303
- }
1304
- declare type OnetimeRequiredCreateProps = 'address_id' | 'external_variant_id' | 'next_charge_scheduled_at' | 'product_title' | 'quantity';
1305
- declare type OnetimeOptionalCreateProps = 'external_product_id' | 'properties' | 'sku';
1306
- interface OnetimeCreateProps {
1307
- /** Instructs to add the Onetime to the next charge scheduled under this Address. */
1308
- add_to_next_charge?: boolean;
1309
- }
1310
- declare type CreateOnetimeRequest = SubType<Onetime, OnetimeRequiredCreateProps, OnetimeOptionalCreateProps> & OnetimeCreateProps;
1311
- declare type OnetimeOptionalUpdateProps = 'address_id' | 'next_charge_scheduled_at' | 'properties' | 'quantity' | 'external_variant_id' | 'sku';
1312
- declare type UpdateOnetimeRequest = Partial<Pick<Onetime, OnetimeOptionalUpdateProps>>;
1313
- interface OnetimesResponse {
1314
- next_cursor: null | string;
1315
- previous_cursor: null | string;
1316
- onetimes: Onetime[];
1317
- }
1318
- declare type OnetimesSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
1319
- declare type OnetimeListParams = ListParams<OnetimesSortBy>;
1320
-
1321
- /** @internal */
1322
- declare type StorefrontEnvironment = 'stage' | 'prod';
1323
- /** @internal */
1324
- interface StorefrontOptions {
1325
- storeIdentifier: string;
1326
- /** Recharge storefront access token */
1327
- storefrontAccessToken?: string;
1328
- /** This is only for internal use. Sets the environment where data is fetched from. */
1329
- environment: StorefrontEnvironment;
1330
- }
1331
- interface InitOptions {
1332
- storeIdentifier?: string;
1333
- /** Recharge storefront access token */
1334
- storefrontAccessToken?: string;
1335
- }
1336
-
1337
- interface ChannelSettings {
1338
- api: {
1339
- display: boolean;
1340
- };
1341
- checkout_page: {
1342
- display: boolean;
1343
- };
1344
- customer_portal: {
1345
- display: boolean;
1346
- };
1347
- merchant_portal: {
1348
- display: boolean;
1349
- };
1350
- }
1351
- interface SubscriptionPreferences {
1352
- charge_interval_frequency: number;
1353
- cutoff_day_of_month: null | number;
1354
- cutoff_day_of_week: null | number;
1355
- expire_after_specific_number_of_charges: null | number;
1356
- interval_unit: 'day' | 'week' | 'month';
1357
- order_day_of_month: number;
1358
- order_day_of_week: null | number;
1359
- order_interval_frequency: number;
1360
- }
1361
- declare type PlanType = 'subscription' | 'prepaid' | 'onetime';
1362
- interface Plan {
1363
- /** Unique numeric identifier for the Plan. */
1364
- id: number;
1365
- /** An object containing the availability of the plan through various supported channels. */
1366
- channel_settings: ChannelSettings;
1367
- /** The time the plan was created. */
1368
- created_at: IsoDateString;
1369
- /** If deleted, the time the plan was deleted. */
1370
- deleted_at: IsoDateString;
1371
- /** The discount amount applied to the product price when purchased through this Plan. All Plans for a product must have the same discount amount. */
1372
- discount_amount: string;
1373
- /** Used in combination with discount amount to determine the discount applied on a product price when purchased through this Plan. */
1374
- discount_type: 'percentage';
1375
- /** An object containing the product id as it appears in external platforms. */
1376
- external_product_id: ExternalId;
1377
- /** The number indicating the order which the plan will be in a list of related plans. */
1378
- sort_order: number;
1379
- /** An object containing the various subscription preferences associated with this plan. */
1380
- subscription_preferences: SubscriptionPreferences;
1381
- /** The title of the plan. All Plans for a product must have the same title. */
1382
- title: string;
1383
- /** The type of the plan. Products with a prepaid plan cannot have plans of other types. */
1384
- type: PlanType;
1385
- /** The time the plan was last updated. */
1386
- updated_at: IsoDateString;
1387
- }
1388
- interface PlansResponse {
1389
- next_cursor: null | string;
1390
- previous_cursor: null | string;
1391
- plans: Plan[];
1392
- }
1393
- declare type PlanSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
1394
- interface PlanListParams extends ListParams<PlanSortBy> {
1395
- external_product_id?: string;
1396
- updated_at_max?: IsoDateString;
1397
- updated_at_min?: IsoDateString;
1398
- type?: PlanType;
1399
- }
1400
-
1401
- declare function getCDNProduct(externalProductId: string | number): Promise<CDNProduct>;
1402
- declare function getCDNStoreSettings(): Promise<CDNStoreSettings>;
1403
- declare function getCDNWidgetSettings(): Promise<CDNWidgetSettings>;
1404
- declare function getCDNProductsAndSettings(): Promise<CDNProductsAndSettings>;
1405
- declare function getCDNProducts(): Promise<CDNProductKeyObject[]>;
1406
- declare function getCDNProductAndSettings(externalProductId: string | number): Promise<CDNProductAndSettings>;
1407
- declare function getCDNBundleSettings(externalProductId: string | number): Promise<CDNBundleSettings | null | undefined>;
1408
- declare function resetCDNCache(): Promise<void>;
1409
-
1410
- declare function getBundleId(bundle: Bundle): Promise<string>;
1411
- declare function validateBundle(bundle: Bundle): Promise<boolean>;
1412
-
1413
- /** @internal Retrieves membership information for passed in id */
1414
- declare function getMembership(session: Session, id: string | number): Promise<Membership>;
1415
- /** @internal Retrieves a list of memberships */
1416
- declare function listMemberships(session: Session, query?: MembershipListParams): Promise<MembershipListResponse>;
1417
- /** @internal Cancels a membership */
1418
- declare function cancelMembership(session: Session, id: string | number, cancelRequest: CancelMembershipRequest): Promise<Membership>;
1419
- /** @internal Activates a membership */
1420
- declare function activateMembership(session: Session, id: string | number, activateRequest: ActivateMembershipRequest): Promise<Membership>;
1421
-
1422
- declare function getOnetime(session: Session, id: string | number): Promise<Onetime>;
1423
- declare function listOnetimes(session: Session, query?: OnetimeListParams): Promise<OnetimesResponse>;
1424
- declare function createOnetime(session: Session, createRequest: CreateOnetimeRequest): Promise<Onetime>;
1425
- declare function updateOnetime(session: Session, id: string | number, updateRequest: UpdateOnetimeRequest): Promise<Onetime>;
1426
- declare function deleteOnetime(session: Session, id: string | number): Promise<void>;
1427
-
1428
- declare function getOrder(session: Session, id: string | number): Promise<Order>;
1429
- declare function listOrders(session: Session, query?: OrderListParams): Promise<OrdersResponse>;
1430
-
1431
- declare function getPaymentMethod(session: Session, id: string | number): Promise<PaymentMethod>;
1432
- declare function updatePaymentMethod(session: Session, id: string | number, updateRequest: UpdatePaymentMethodRequest): Promise<PaymentMethod>;
1433
- declare function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse>;
1434
-
1435
- declare function getPlan(session: Session, id: string | number): Promise<Plan>;
1436
- declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
1437
-
1438
- declare function getSubscription(session: Session, id: string | number): Promise<Subscription>;
1439
- declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
1440
- /**
1441
- * When creating a subscription via API, order_interval_frequency and charge_interval_frequency values do not necessarily
1442
- * need to match the values set in the respective Plans. The product, however, does need to have at least one Plan in order
1443
- * to be added to a subscription.
1444
- */
1445
- declare function createSubscription(session: Session, createRequest: CreateSubscriptionRequest): Promise<Subscription>;
1446
- /**
1447
- * Updating parameters like frequency, charge_interval_frequency, order_interval_frequency, order_interval_unit will cause our algorithm to automatically recalculate the next charge date (next_charge_scheduled_at).
1448
- * WARNING: This update will remove skipped and manually changed charges.
1449
- * If you want to change the next charge date (next_charge_scheduled_at) we recommend you to update these parameters first.
1450
- * When updating order_interval_unit OR order_interval_frequency OR charge_interval_frequency all three parameters are required.
1451
- */
1452
- declare function updateSubscription(session: Session, id: string | number, updateRequest: UpdateSubscriptionRequest, query?: UpdateSubscriptionParams): Promise<Subscription>;
1453
- /**
1454
- * If there are two active subscriptions with the same address_id, and you update their
1455
- * next_charge_date parameters to match, their charges will get merged into a new charge
1456
- * with a new id
1457
- */
1458
- declare function updateSubscriptionChargeDate(session: Session, id: string | number, date: IsoDateString): Promise<Subscription>;
1459
- declare function updateSubscriptionAddress(session: Session, id: string | number, address_id: string | number): Promise<Subscription>;
1460
- /**
1461
- * An involuntary subscription cancelled due to max retries reached will trigger the
1462
- * charge/max_retries_reached webhook. If this leads to the subscription being cancelled,
1463
- * the subscription/cancelled webhook will trigger.
1464
- */
1465
- declare function cancelSubscription(session: Session, id: string | number, cancelRequest: CancelSubscriptionRequest): Promise<Subscription>;
1466
- /**
1467
- * When activating subscription, following attributes will be set to null: cancelled_at, cancellation_reason
1468
- * and cancellation_reason_comments.
1469
- */
1470
- declare function activateSubscription(session: Session, id: string | number): Promise<Subscription>;
1471
- declare function skipSubscriptionCharge(session: Session, id: number | string, date: IsoDateString): Promise<Charge>;
1472
-
1473
- declare function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer>;
1474
- declare function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer>;
1475
- declare function getDeliverySchedule(session: Session, query?: CustomerDeliveryScheduleParams): Promise<Delivery[]>;
1476
-
1477
- declare const api: {
1478
- get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T>;
1479
- post<T_1>(url: string, requestOptions?: CRUDRequestOptions): Promise<T_1>;
1480
- put<T_2>(url: string, requestOptions?: CRUDRequestOptions): Promise<T_2>;
1481
- delete<T_3>(url: string, requestOptions?: CRUDRequestOptions): Promise<T_3>;
1482
- };
1483
- declare function initRecharge(opt?: InitOptions): void;
1484
-
1485
- export { ActivateMembershipRequest, Address, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, ApplyDiscountRequest, AssociatedAddress, Bundle, BundleSelection, BundleTranslations, CDNBaseWidgetSettings, CDNBundleLayoutSettings, CDNBundleSettings, CDNBundleStep, CDNBundleStepOption, CDNBundleVariant, CDNBundleVariantOptionSource, CDNBundleVariantSelectionDefault, CDNPrices, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductOption, CDNProductOptionValue, CDNProductRaw, CDNProductResource, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNSellingPlan, CDNSellingPlanAllocations, CDNSellingPlanGroup, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVariantOptionValue, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChannelSettings, Charge, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerOptionalUpdateProps, Delivery, Discount, ExternalId, ExternalTransactionId, FirstOption, GetCustomerOptions, GetRequestOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Method, Onetime, OnetimeCreateProps, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeOptionalUpdateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PaymentDetails, PaymentMethod, PaymentMethodListParams, PaymentMethodOptionalUpdateProps, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, RequestOptionsHeaders, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionOptionalUpdateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateCustomerRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscount, cancelMembership, cancelSubscription, createAddress, createOnetime, createSubscription, deleteAddress, deleteOnetime, getAddress, getBundleId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getDeliverySchedule, getMembership, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, listAddresses, listCharges, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, removeDiscount, resetCDNCache, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateCustomer, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, validateBundle };