@wix/auto_sdk_subscription_subscriptions 1.0.0 → 1.0.2

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 (73) hide show
  1. package/build/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +5 -5
  2. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js +12 -12
  3. package/build/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  4. package/build/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  5. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js +1848 -1848
  6. package/build/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  7. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  8. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js +29 -29
  9. package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  10. package/build/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +12 -12
  11. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js +13 -13
  12. package/build/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  13. package/build/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  14. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js +59 -59
  15. package/build/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  16. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +2085 -1482
  17. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js +341 -340
  18. package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  19. package/build/es/src/billing-v1-subscription-subscriptions.context.d.ts +5 -5
  20. package/build/es/src/billing-v1-subscription-subscriptions.context.js +5 -5
  21. package/build/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  22. package/build/es/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  23. package/build/es/src/billing-v1-subscription-subscriptions.http.js +1720 -1720
  24. package/build/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  25. package/build/es/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  26. package/build/es/src/billing-v1-subscription-subscriptions.meta.js +25 -25
  27. package/build/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  28. package/build/es/src/billing-v1-subscription-subscriptions.public.d.ts +12 -12
  29. package/build/es/src/billing-v1-subscription-subscriptions.public.js +10 -10
  30. package/build/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  31. package/build/es/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  32. package/build/es/src/billing-v1-subscription-subscriptions.types.js +58 -58
  33. package/build/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  34. package/build/es/src/billing-v1-subscription-subscriptions.universal.d.ts +2085 -1482
  35. package/build/es/src/billing-v1-subscription-subscriptions.universal.js +338 -337
  36. package/build/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  37. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +6 -6
  38. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js +12 -12
  39. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  40. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  41. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js +1848 -1848
  42. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  43. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  44. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js +29 -29
  45. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  46. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +17 -17
  47. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js +13 -13
  48. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  49. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  50. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js +59 -59
  51. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  52. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +2088 -1485
  53. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js +341 -340
  54. package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  55. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.d.ts +6 -6
  56. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js +5 -5
  57. package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
  58. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.d.ts +5 -5
  59. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js +1720 -1720
  60. package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
  61. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.d.ts +7 -7
  62. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js +25 -25
  63. package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
  64. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.d.ts +17 -17
  65. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js +10 -10
  66. package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
  67. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.d.ts +1995 -1464
  68. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js +58 -58
  69. package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
  70. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.d.ts +2088 -1485
  71. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js +338 -337
  72. package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
  73. package/package.json +2 -2
@@ -115,52 +115,6 @@ export var ItemCategory;
115
115
  ItemCategory["PHYSICAL"] = "PHYSICAL";
116
116
  ItemCategory["DIGITAL"] = "DIGITAL";
117
117
  })(ItemCategory || (ItemCategory = {}));
118
- export var HistoryViewMode;
119
- (function (HistoryViewMode) {
120
- HistoryViewMode["UNKNOWN"] = "UNKNOWN";
121
- /** Comprehensive view including all history events. */
122
- HistoryViewMode["BACKOFFICE"] = "BACKOFFICE";
123
- /** User-centric view of the history. */
124
- HistoryViewMode["USER"] = "USER";
125
- })(HistoryViewMode || (HistoryViewMode = {}));
126
- export var UpdateAction;
127
- (function (UpdateAction) {
128
- UpdateAction["NONE"] = "NONE";
129
- /** Update subscription immediately, please note proration for updates changing price are not yet supported */
130
- UpdateAction["IMMEDIATELY"] = "IMMEDIATELY";
131
- /** Request updates that will take affect only at the start of the next billing cycle. */
132
- UpdateAction["NEXT_BILLING_CYCLE"] = "NEXT_BILLING_CYCLE";
133
- /** Reset all pending updates */
134
- UpdateAction["RESET_PENDING_UPDATES"] = "RESET_PENDING_UPDATES";
135
- /** Request updates that will take affect only at a specific date. */
136
- UpdateAction["SPECIFIC_DATE"] = "SPECIFIC_DATE";
137
- })(UpdateAction || (UpdateAction = {}));
138
- export var PaymentSettlementMethod;
139
- (function (PaymentSettlementMethod) {
140
- PaymentSettlementMethod["UNKNOWN"] = "UNKNOWN";
141
- /** System-defined payment settlement. */
142
- PaymentSettlementMethod["SYSTEM"] = "SYSTEM";
143
- /** Manually mark the payment as paid. */
144
- PaymentSettlementMethod["MARK_AS_PAID"] = "MARK_AS_PAID";
145
- /** Require the customer to pay immediately, by insert a new payment method. */
146
- PaymentSettlementMethod["CUSTOMER_PAY_NOW"] = "CUSTOMER_PAY_NOW";
147
- })(PaymentSettlementMethod || (PaymentSettlementMethod = {}));
148
- export var PaymentMode;
149
- (function (PaymentMode) {
150
- PaymentMode["NONE"] = "NONE";
151
- /** The latest invoice of the subscription will be charged. */
152
- PaymentMode["CHARGE"] = "CHARGE";
153
- /** An authorization invoice with zero amount will be created. */
154
- PaymentMode["AUTHORIZATION"] = "AUTHORIZATION";
155
- })(PaymentMode || (PaymentMode = {}));
156
- export var WebhookIdentityType;
157
- (function (WebhookIdentityType) {
158
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
159
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
160
- WebhookIdentityType["MEMBER"] = "MEMBER";
161
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
162
- WebhookIdentityType["APP"] = "APP";
163
- })(WebhookIdentityType || (WebhookIdentityType = {}));
164
118
  export var SortOrder;
165
119
  (function (SortOrder) {
166
120
  SortOrder["ASC"] = "ASC";
@@ -194,12 +148,40 @@ export var ExtendPolicyType;
194
148
  ExtendPolicyType["PERIOD"] = "PERIOD";
195
149
  ExtendPolicyType["BILLING_CYCLE"] = "BILLING_CYCLE";
196
150
  })(ExtendPolicyType || (ExtendPolicyType = {}));
151
+ export var PaymentMode;
152
+ (function (PaymentMode) {
153
+ PaymentMode["NONE"] = "NONE";
154
+ /** The latest invoice of the subscription will be charged. */
155
+ PaymentMode["CHARGE"] = "CHARGE";
156
+ /** An authorization invoice with zero amount will be created. */
157
+ PaymentMode["AUTHORIZATION"] = "AUTHORIZATION";
158
+ })(PaymentMode || (PaymentMode = {}));
197
159
  export var OrderMethod;
198
160
  (function (OrderMethod) {
199
161
  OrderMethod["UNKNOWN"] = "UNKNOWN";
200
162
  OrderMethod["MOTO"] = "MOTO";
201
163
  OrderMethod["NOT_MOTO"] = "NOT_MOTO";
202
164
  })(OrderMethod || (OrderMethod = {}));
165
+ export var WebhookIdentityType;
166
+ (function (WebhookIdentityType) {
167
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
168
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
169
+ WebhookIdentityType["MEMBER"] = "MEMBER";
170
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
171
+ WebhookIdentityType["APP"] = "APP";
172
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
173
+ export var PaymentTestMode;
174
+ (function (PaymentTestMode) {
175
+ PaymentTestMode["REGULAR"] = "REGULAR";
176
+ PaymentTestMode["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
177
+ PaymentTestMode["FAIL_DECLINE"] = "FAIL_DECLINE";
178
+ PaymentTestMode["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
179
+ })(PaymentTestMode || (PaymentTestMode = {}));
180
+ export var RevivePolicy;
181
+ (function (RevivePolicy) {
182
+ RevivePolicy["SIMPLE"] = "SIMPLE";
183
+ RevivePolicy["RESUME"] = "RESUME";
184
+ })(RevivePolicy || (RevivePolicy = {}));
203
185
  export var ActionInitiator;
204
186
  (function (ActionInitiator) {
205
187
  ActionInitiator["UNDEFINED"] = "UNDEFINED";
@@ -207,6 +189,18 @@ export var ActionInitiator;
207
189
  ActionInitiator["CUSTOMER"] = "CUSTOMER";
208
190
  ActionInitiator["SYSTEM"] = "SYSTEM";
209
191
  })(ActionInitiator || (ActionInitiator = {}));
192
+ export var UpdateAction;
193
+ (function (UpdateAction) {
194
+ UpdateAction["NONE"] = "NONE";
195
+ /** Update subscription immediately, please note proration for updates changing price are not yet supported */
196
+ UpdateAction["IMMEDIATELY"] = "IMMEDIATELY";
197
+ /** Request updates that will take affect only at the start of the next billing cycle. */
198
+ UpdateAction["NEXT_BILLING_CYCLE"] = "NEXT_BILLING_CYCLE";
199
+ /** Reset all pending updates */
200
+ UpdateAction["RESET_PENDING_UPDATES"] = "RESET_PENDING_UPDATES";
201
+ /** Request updates that will take affect only at a specific date. */
202
+ UpdateAction["SPECIFIC_DATE"] = "SPECIFIC_DATE";
203
+ })(UpdateAction || (UpdateAction = {}));
210
204
  export var RequestedFields;
211
205
  (function (RequestedFields) {
212
206
  RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
@@ -325,260 +319,24 @@ export var Status;
325
319
  Status["ACTIVE"] = "ACTIVE";
326
320
  Status["ENDED"] = "ENDED";
327
321
  })(Status || (Status = {}));
328
- export var PaymentTestMode;
329
- (function (PaymentTestMode) {
330
- PaymentTestMode["REGULAR"] = "REGULAR";
331
- PaymentTestMode["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
332
- PaymentTestMode["FAIL_DECLINE"] = "FAIL_DECLINE";
333
- PaymentTestMode["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
334
- })(PaymentTestMode || (PaymentTestMode = {}));
335
- export var RevivePolicy;
336
- (function (RevivePolicy) {
337
- RevivePolicy["SIMPLE"] = "SIMPLE";
338
- RevivePolicy["RESUME"] = "RESUME";
339
- })(RevivePolicy || (RevivePolicy = {}));
340
- /** @public
341
- * @documentationMaturity preview
342
- * @requiredField subscriptionId
343
- * @permissionId subscriptions.view
344
- * @permissionScope Manage Events
345
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
346
- * @applicableIdentity APP
347
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
348
- */
349
- export async function listSubscriptionHistory(subscriptionId, options) {
350
- // @ts-ignore
351
- const { httpClient, sideEffects } = arguments[2];
352
- const payload = renameKeysFromSDKRequestToRESTRequest({
353
- subscriptionId: subscriptionId,
354
- mode: options?.mode,
355
- cursor: options?.cursor,
356
- });
357
- const reqOpts = ambassadorWixBillingV1Subscription.listSubscriptionHistory(payload);
358
- sideEffects?.onSiteCall?.();
359
- try {
360
- const result = await httpClient.request(reqOpts);
361
- sideEffects?.onSuccess?.(result);
362
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
363
- {
364
- transformFn: transformRESTAddressToSDKAddress,
365
- paths: [
366
- {
367
- path: 'historyEntries.event.created.subscription.billingSettings.billingAddress.address',
368
- },
369
- {
370
- path: 'historyEntries.event.created.subscription.shippingAddress.address',
371
- },
372
- {
373
- path: 'historyEntries.event.updated.current.billingSettings.billingAddress.address',
374
- },
375
- {
376
- path: 'historyEntries.event.updated.current.shippingAddress.address',
377
- },
378
- {
379
- path: 'historyEntries.event.updated.previous.billingSettings.billingAddress.address',
380
- },
381
- {
382
- path: 'historyEntries.event.updated.previous.shippingAddress.address',
383
- },
384
- {
385
- path: 'historyEntries.event.activated.subscription.billingSettings.billingAddress.address',
386
- },
387
- {
388
- path: 'historyEntries.event.activated.subscription.shippingAddress.address',
389
- },
390
- {
391
- path: 'historyEntries.event.ended.subscription.billingSettings.billingAddress.address',
392
- },
393
- {
394
- path: 'historyEntries.event.ended.subscription.shippingAddress.address',
395
- },
396
- {
397
- path: 'historyEntries.event.canceled.subscription.billingSettings.billingAddress.address',
398
- },
399
- {
400
- path: 'historyEntries.event.canceled.subscription.shippingAddress.address',
401
- },
402
- {
403
- path: 'historyEntries.event.paused.subscription.billingSettings.billingAddress.address',
404
- },
405
- {
406
- path: 'historyEntries.event.paused.subscription.shippingAddress.address',
407
- },
408
- {
409
- path: 'historyEntries.event.resumed.subscription.billingSettings.billingAddress.address',
410
- },
411
- {
412
- path: 'historyEntries.event.resumed.subscription.shippingAddress.address',
413
- },
414
- {
415
- path: 'historyEntries.event.pauseRequested.subscription.billingSettings.billingAddress.address',
416
- },
417
- {
418
- path: 'historyEntries.event.pauseRequested.subscription.shippingAddress.address',
419
- },
420
- {
421
- path: 'historyEntries.event.resumeRequested.subscription.billingSettings.billingAddress.address',
422
- },
423
- {
424
- path: 'historyEntries.event.resumeRequested.subscription.shippingAddress.address',
425
- },
426
- {
427
- path: 'historyEntries.event.scheduledPauseCanceled.subscription.billingSettings.billingAddress.address',
428
- },
429
- {
430
- path: 'historyEntries.event.scheduledPauseCanceled.subscription.shippingAddress.address',
431
- },
432
- {
433
- path: 'historyEntries.event.scheduledResumeCanceled.subscription.billingSettings.billingAddress.address',
434
- },
435
- {
436
- path: 'historyEntries.event.scheduledResumeCanceled.subscription.shippingAddress.address',
437
- },
438
- {
439
- path: 'historyEntries.event.billingCycleStarted.subscription.billingSettings.billingAddress.address',
440
- },
441
- {
442
- path: 'historyEntries.event.billingCycleStarted.subscription.shippingAddress.address',
443
- },
444
- {
445
- path: 'historyEntries.event.autoRenewalTurnedOn.subscription.billingSettings.billingAddress.address',
446
- },
447
- {
448
- path: 'historyEntries.event.autoRenewalTurnedOn.subscription.shippingAddress.address',
449
- },
450
- {
451
- path: 'historyEntries.event.autoRenewalTurnedOff.subscription.billingSettings.billingAddress.address',
452
- },
453
- {
454
- path: 'historyEntries.event.autoRenewalTurnedOff.subscription.shippingAddress.address',
455
- },
456
- {
457
- path: 'historyEntries.event.cycleReadyToPay.subscription.billingSettings.billingAddress.address',
458
- },
459
- {
460
- path: 'historyEntries.event.cycleReadyToPay.subscription.shippingAddress.address',
461
- },
462
- {
463
- path: 'historyEntries.event.extended.subscription.billingSettings.billingAddress.address',
464
- },
465
- {
466
- path: 'historyEntries.event.extended.subscription.shippingAddress.address',
467
- },
468
- {
469
- path: 'historyEntries.event.initialPurchaseCompleted.subscription.billingSettings.billingAddress.address',
470
- },
471
- {
472
- path: 'historyEntries.event.initialPurchaseCompleted.subscription.shippingAddress.address',
473
- },
474
- {
475
- path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
476
- },
477
- {
478
- path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.shippingAddress.address',
479
- },
480
- {
481
- path: 'historyEntries.event.revived.subscription.billingSettings.billingAddress.address',
482
- },
483
- {
484
- path: 'historyEntries.event.revived.subscription.shippingAddress.address',
485
- },
486
- {
487
- path: 'historyEntries.event.billingDateUpdated.subscription.billingSettings.billingAddress.address',
488
- },
489
- {
490
- path: 'historyEntries.event.billingDateUpdated.subscription.shippingAddress.address',
491
- },
492
- {
493
- path: 'historyEntries.event.futureUpdatesRequested.subscription.billingSettings.billingAddress.address',
494
- },
495
- {
496
- path: 'historyEntries.event.futureUpdatesRequested.subscription.shippingAddress.address',
497
- },
498
- {
499
- path: 'historyEntries.event.updatesApplied.subscription.billingSettings.billingAddress.address',
500
- },
501
- {
502
- path: 'historyEntries.event.updatesApplied.subscription.shippingAddress.address',
503
- },
504
- {
505
- path: 'historyEntries.event.resetPendingUpdates.subscription.billingSettings.billingAddress.address',
506
- },
507
- {
508
- path: 'historyEntries.event.resetPendingUpdates.subscription.shippingAddress.address',
509
- },
510
- {
511
- path: 'historyEntries.event.gracePeriodStarted.subscription.billingSettings.billingAddress.address',
512
- },
513
- {
514
- path: 'historyEntries.event.gracePeriodStarted.subscription.shippingAddress.address',
515
- },
516
- {
517
- path: 'historyEntries.event.gracePeriodEnded.subscription.billingSettings.billingAddress.address',
518
- },
519
- {
520
- path: 'historyEntries.event.gracePeriodEnded.subscription.shippingAddress.address',
521
- },
522
- {
523
- path: 'historyEntries.event.paymentMethodUpdated.subscription.billingSettings.billingAddress.address',
524
- },
525
- {
526
- path: 'historyEntries.event.paymentMethodUpdated.subscription.shippingAddress.address',
527
- },
528
- {
529
- path: 'historyEntries.event.collectionMethodUpdated.subscription.billingSettings.billingAddress.address',
530
- },
531
- {
532
- path: 'historyEntries.event.collectionMethodUpdated.subscription.shippingAddress.address',
533
- },
534
- {
535
- path: 'historyEntries.event.freeTrailStarted.subscription.billingSettings.billingAddress.address',
536
- },
537
- {
538
- path: 'historyEntries.event.freeTrailStarted.subscription.shippingAddress.address',
539
- },
540
- {
541
- path: 'historyEntries.event.freeTrailEnded.subscription.billingSettings.billingAddress.address',
542
- },
543
- {
544
- path: 'historyEntries.event.freeTrailEnded.subscription.shippingAddress.address',
545
- },
546
- {
547
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
548
- },
549
- {
550
- path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.shippingAddress.address',
551
- },
552
- {
553
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingSettings.billingAddress.address',
554
- },
555
- {
556
- path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.shippingAddress.address',
557
- },
558
- {
559
- path: 'historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address',
560
- },
561
- {
562
- path: 'historyEntries.event.subscriptionBoAction.subscription.shippingAddress.address',
563
- },
564
- ],
565
- },
566
- ]));
567
- }
568
- catch (err) {
569
- const transformedError = sdkTransformError(err, {
570
- spreadPathsToArguments: {},
571
- explicitPathsToArguments: {
572
- subscriptionId: '$[0]',
573
- mode: '$[1].mode',
574
- cursor: '$[1].cursor',
575
- },
576
- singleArgumentUnchanged: false,
577
- }, ['subscriptionId', 'options']);
578
- sideEffects?.onError?.(err);
579
- throw transformedError;
580
- }
581
- }
322
+ export var HistoryViewMode;
323
+ (function (HistoryViewMode) {
324
+ HistoryViewMode["UNKNOWN"] = "UNKNOWN";
325
+ /** Comprehensive view including all history events. */
326
+ HistoryViewMode["BACKOFFICE"] = "BACKOFFICE";
327
+ /** User-centric view of the history. */
328
+ HistoryViewMode["USER"] = "USER";
329
+ })(HistoryViewMode || (HistoryViewMode = {}));
330
+ export var PaymentSettlementMethod;
331
+ (function (PaymentSettlementMethod) {
332
+ PaymentSettlementMethod["UNKNOWN"] = "UNKNOWN";
333
+ /** System-defined payment settlement. */
334
+ PaymentSettlementMethod["SYSTEM"] = "SYSTEM";
335
+ /** Manually mark the payment as paid. */
336
+ PaymentSettlementMethod["MARK_AS_PAID"] = "MARK_AS_PAID";
337
+ /** Require the customer to pay immediately, by insert a new payment method. */
338
+ PaymentSettlementMethod["CUSTOMER_PAY_NOW"] = "CUSTOMER_PAY_NOW";
339
+ })(PaymentSettlementMethod || (PaymentSettlementMethod = {}));
582
340
  /**
583
341
  * Identity must be a site member and customer subscription belongs to
584
342
  * @public
@@ -911,37 +669,82 @@ export async function customerListUpcomingCharges(_id) {
911
669
  }
912
670
  }
913
671
  /**
914
- * Creates auto-charge order that can be paid by customer
672
+ * Creates auto-charge order that can be paid by customer
673
+ * @public
674
+ * @documentationMaturity preview
675
+ * @requiredField _id
676
+ * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup
677
+ */
678
+ export async function customerInitiatePaymentMethodSetup(_id, options) {
679
+ // @ts-ignore
680
+ const { httpClient, sideEffects } = arguments[2];
681
+ const payload = renameKeysFromSDKRequestToRESTRequest({
682
+ id: _id,
683
+ paymentMode: options?.paymentMode,
684
+ paymentSettings: options?.paymentSettings,
685
+ });
686
+ const reqOpts = ambassadorWixBillingV1Subscription.customerInitiatePaymentMethodSetup(payload);
687
+ sideEffects?.onSiteCall?.();
688
+ try {
689
+ const result = await httpClient.request(reqOpts);
690
+ sideEffects?.onSuccess?.(result);
691
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
692
+ }
693
+ catch (err) {
694
+ const transformedError = sdkTransformError(err, {
695
+ spreadPathsToArguments: {},
696
+ explicitPathsToArguments: {
697
+ id: '$[0]',
698
+ paymentMode: '$[1].paymentMode',
699
+ paymentSettings: '$[1].paymentSettings',
700
+ },
701
+ singleArgumentUnchanged: false,
702
+ }, ['_id', 'options']);
703
+ sideEffects?.onError?.(err);
704
+ throw transformedError;
705
+ }
706
+ }
707
+ /**
708
+ * This used only for automation and permitted tenants (QA & testing)
915
709
  * @public
916
710
  * @documentationMaturity preview
917
- * @requiredField _id
918
- * @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup
711
+ * @requiredField options.tenantId
712
+ * @requiredField subscriptionId
713
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
919
714
  */
920
- export async function customerInitiatePaymentMethodSetup(_id, options) {
715
+ export async function payCycle(subscriptionId, options) {
921
716
  // @ts-ignore
922
717
  const { httpClient, sideEffects } = arguments[2];
923
718
  const payload = renameKeysFromSDKRequestToRESTRequest({
924
- id: _id,
925
- paymentMode: options?.paymentMode,
926
- paymentSettings: options?.paymentSettings,
719
+ subscriptionId: subscriptionId,
720
+ paymentTestMode: options?.paymentTestMode,
721
+ tenantId: options?.tenantId,
927
722
  });
928
- const reqOpts = ambassadorWixBillingV1Subscription.customerInitiatePaymentMethodSetup(payload);
723
+ const reqOpts = ambassadorWixBillingV1Subscription.payCycle(payload);
929
724
  sideEffects?.onSiteCall?.();
930
725
  try {
931
726
  const result = await httpClient.request(reqOpts);
932
727
  sideEffects?.onSuccess?.(result);
933
- return renameKeysFromRESTResponseToSDKResponse(result.data);
728
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
729
+ {
730
+ transformFn: transformRESTAddressToSDKAddress,
731
+ paths: [
732
+ { path: 'subscription.billingSettings.billingAddress.address' },
733
+ { path: 'subscription.shippingAddress.address' },
734
+ ],
735
+ },
736
+ ]));
934
737
  }
935
738
  catch (err) {
936
739
  const transformedError = sdkTransformError(err, {
937
740
  spreadPathsToArguments: {},
938
741
  explicitPathsToArguments: {
939
- id: '$[0]',
940
- paymentMode: '$[1].paymentMode',
941
- paymentSettings: '$[1].paymentSettings',
742
+ subscriptionId: '$[0]',
743
+ paymentTestMode: '$[1].paymentTestMode',
744
+ tenantId: '$[1].tenantId',
942
745
  },
943
746
  singleArgumentUnchanged: false,
944
- }, ['_id', 'options']);
747
+ }, ['subscriptionId', 'options']);
945
748
  sideEffects?.onError?.(err);
946
749
  throw transformedError;
947
750
  }
@@ -1521,7 +1324,7 @@ export async function markLatestInvoiceAsPaid(subscriptionId) {
1521
1324
  }
1522
1325
  }
1523
1326
  /**
1524
- * Marks the invoice associated with the subscription in the specified cycle as paid.
1327
+ * Marks the invoice associated with given subscription cycle as paid for the following scenarios:
1525
1328
  * If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
1526
1329
  * If the invoice contains items other than subscription items, an error will be thrown.
1527
1330
  *
@@ -1541,16 +1344,16 @@ export async function markLatestInvoiceAsPaid(subscriptionId) {
1541
1344
  * @permissionScope Manage Orders
1542
1345
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1543
1346
  * @applicableIdentity APP
1544
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
1347
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkBillingCycleAsPaid
1545
1348
  */
1546
- export async function markInvoiceAsPaid(subscriptionId, options) {
1349
+ export async function markBillingCycleAsPaid(subscriptionId, options) {
1547
1350
  // @ts-ignore
1548
1351
  const { httpClient, sideEffects } = arguments[2];
1549
1352
  const payload = renameKeysFromSDKRequestToRESTRequest({
1550
1353
  subscriptionId: subscriptionId,
1551
1354
  paidCycle: options?.paidCycle,
1552
1355
  });
1553
- const reqOpts = ambassadorWixBillingV1Subscription.markInvoiceAsPaid(payload);
1356
+ const reqOpts = ambassadorWixBillingV1Subscription.markBillingCycleAsPaid(payload);
1554
1357
  sideEffects?.onSiteCall?.();
1555
1358
  try {
1556
1359
  const result = await httpClient.request(reqOpts);
@@ -1616,6 +1419,7 @@ export async function getSubscriptionsStats() {
1616
1419
  * @documentationMaturity preview
1617
1420
  * @requiredField _id
1618
1421
  * @requiredField actionContext
1422
+ * @requiredField extendPolicy
1619
1423
  * @permissionId subscriptions.manage
1620
1424
  * @permissionScope Manage Orders
1621
1425
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
@@ -1740,11 +1544,10 @@ export async function listUpcomingCharges(subscriptionId, options) {
1740
1544
  * Returns all the charges applicable to a subscription based on the provided subscription information.
1741
1545
  * @public
1742
1546
  * @documentationMaturity preview
1743
- * @requiredField options
1744
- * @requiredField options.subscriptionInfo
1745
- * @requiredField options.subscriptionInfo.billingSettings
1746
- * @requiredField options.subscriptionInfo.items
1747
- * @requiredField options.subscriptionInfo.items.pricingModel
1547
+ * @requiredField subscription.subscriptionInfo
1548
+ * @requiredField subscription.subscriptionInfo.billingSettings
1549
+ * @requiredField subscription.subscriptionInfo.items
1550
+ * @requiredField subscription.subscriptionInfo.items.pricingModel
1748
1551
  * @permissionId subscriptions.view
1749
1552
  * @permissionScope Manage Events
1750
1553
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
@@ -1790,11 +1593,12 @@ export async function previewSubscriptionCharges(options) {
1790
1593
  * @public
1791
1594
  * @documentationMaturity preview
1792
1595
  * @requiredField options.subscriptionsBillingDetails.billingSettings
1793
- * @requiredField options.subscriptionsBillingDetails.billingSettings.shippingCharges.tax
1596
+ * @requiredField options.subscriptionsBillingDetails.billingSettings.shippingCharges.tax.value
1794
1597
  * @requiredField options.subscriptionsBillingDetails.externalId
1795
1598
  * @requiredField options.subscriptionsBillingDetails.items
1796
1599
  * @requiredField options.subscriptionsBillingDetails.items.pricingModel
1797
- * @requiredField options.subscriptionsBillingDetails.items.tax
1600
+ * @requiredField options.subscriptionsBillingDetails.items.pricingModel.model
1601
+ * @requiredField options.subscriptionsBillingDetails.items.tax.value
1798
1602
  * @permissionId subscriptions.view
1799
1603
  * @permissionScope Manage Events
1800
1604
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
@@ -1878,23 +1682,24 @@ export async function initiatePaymentMethodSetup(_id, options) {
1878
1682
  throw transformedError;
1879
1683
  }
1880
1684
  }
1881
- /**
1882
- * This used only for automation and permitted tenants (QA & testing)
1883
- * @public
1685
+ /** @public
1884
1686
  * @documentationMaturity preview
1885
- * @requiredField options.tenantId
1886
1687
  * @requiredField subscriptionId
1887
- * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
1688
+ * @permissionId subscriptions.view
1689
+ * @permissionScope Manage Events
1690
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1691
+ * @applicableIdentity APP
1692
+ * @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
1888
1693
  */
1889
- export async function payCycle(subscriptionId, options) {
1694
+ export async function listSubscriptionHistory(subscriptionId, options) {
1890
1695
  // @ts-ignore
1891
1696
  const { httpClient, sideEffects } = arguments[2];
1892
1697
  const payload = renameKeysFromSDKRequestToRESTRequest({
1893
1698
  subscriptionId: subscriptionId,
1894
- paymentTestMode: options?.paymentTestMode,
1895
- tenantId: options?.tenantId,
1699
+ mode: options?.mode,
1700
+ cursor: options?.cursor,
1896
1701
  });
1897
- const reqOpts = ambassadorWixBillingV1Subscription.payCycle(payload);
1702
+ const reqOpts = ambassadorWixBillingV1Subscription.listSubscriptionHistory(payload);
1898
1703
  sideEffects?.onSiteCall?.();
1899
1704
  try {
1900
1705
  const result = await httpClient.request(reqOpts);
@@ -1903,8 +1708,204 @@ export async function payCycle(subscriptionId, options) {
1903
1708
  {
1904
1709
  transformFn: transformRESTAddressToSDKAddress,
1905
1710
  paths: [
1906
- { path: 'subscription.billingSettings.billingAddress.address' },
1907
- { path: 'subscription.shippingAddress.address' },
1711
+ {
1712
+ path: 'historyEntries.event.created.subscription.billingSettings.billingAddress.address',
1713
+ },
1714
+ {
1715
+ path: 'historyEntries.event.created.subscription.shippingAddress.address',
1716
+ },
1717
+ {
1718
+ path: 'historyEntries.event.updated.current.billingSettings.billingAddress.address',
1719
+ },
1720
+ {
1721
+ path: 'historyEntries.event.updated.current.shippingAddress.address',
1722
+ },
1723
+ {
1724
+ path: 'historyEntries.event.updated.previous.billingSettings.billingAddress.address',
1725
+ },
1726
+ {
1727
+ path: 'historyEntries.event.updated.previous.shippingAddress.address',
1728
+ },
1729
+ {
1730
+ path: 'historyEntries.event.activated.subscription.billingSettings.billingAddress.address',
1731
+ },
1732
+ {
1733
+ path: 'historyEntries.event.activated.subscription.shippingAddress.address',
1734
+ },
1735
+ {
1736
+ path: 'historyEntries.event.ended.subscription.billingSettings.billingAddress.address',
1737
+ },
1738
+ {
1739
+ path: 'historyEntries.event.ended.subscription.shippingAddress.address',
1740
+ },
1741
+ {
1742
+ path: 'historyEntries.event.canceled.subscription.billingSettings.billingAddress.address',
1743
+ },
1744
+ {
1745
+ path: 'historyEntries.event.canceled.subscription.shippingAddress.address',
1746
+ },
1747
+ {
1748
+ path: 'historyEntries.event.paused.subscription.billingSettings.billingAddress.address',
1749
+ },
1750
+ {
1751
+ path: 'historyEntries.event.paused.subscription.shippingAddress.address',
1752
+ },
1753
+ {
1754
+ path: 'historyEntries.event.resumed.subscription.billingSettings.billingAddress.address',
1755
+ },
1756
+ {
1757
+ path: 'historyEntries.event.resumed.subscription.shippingAddress.address',
1758
+ },
1759
+ {
1760
+ path: 'historyEntries.event.pauseRequested.subscription.billingSettings.billingAddress.address',
1761
+ },
1762
+ {
1763
+ path: 'historyEntries.event.pauseRequested.subscription.shippingAddress.address',
1764
+ },
1765
+ {
1766
+ path: 'historyEntries.event.resumeRequested.subscription.billingSettings.billingAddress.address',
1767
+ },
1768
+ {
1769
+ path: 'historyEntries.event.resumeRequested.subscription.shippingAddress.address',
1770
+ },
1771
+ {
1772
+ path: 'historyEntries.event.scheduledPauseCanceled.subscription.billingSettings.billingAddress.address',
1773
+ },
1774
+ {
1775
+ path: 'historyEntries.event.scheduledPauseCanceled.subscription.shippingAddress.address',
1776
+ },
1777
+ {
1778
+ path: 'historyEntries.event.scheduledResumeCanceled.subscription.billingSettings.billingAddress.address',
1779
+ },
1780
+ {
1781
+ path: 'historyEntries.event.scheduledResumeCanceled.subscription.shippingAddress.address',
1782
+ },
1783
+ {
1784
+ path: 'historyEntries.event.billingCycleStarted.subscription.billingSettings.billingAddress.address',
1785
+ },
1786
+ {
1787
+ path: 'historyEntries.event.billingCycleStarted.subscription.shippingAddress.address',
1788
+ },
1789
+ {
1790
+ path: 'historyEntries.event.autoRenewalTurnedOn.subscription.billingSettings.billingAddress.address',
1791
+ },
1792
+ {
1793
+ path: 'historyEntries.event.autoRenewalTurnedOn.subscription.shippingAddress.address',
1794
+ },
1795
+ {
1796
+ path: 'historyEntries.event.autoRenewalTurnedOff.subscription.billingSettings.billingAddress.address',
1797
+ },
1798
+ {
1799
+ path: 'historyEntries.event.autoRenewalTurnedOff.subscription.shippingAddress.address',
1800
+ },
1801
+ {
1802
+ path: 'historyEntries.event.cycleReadyToPay.subscription.billingSettings.billingAddress.address',
1803
+ },
1804
+ {
1805
+ path: 'historyEntries.event.cycleReadyToPay.subscription.shippingAddress.address',
1806
+ },
1807
+ {
1808
+ path: 'historyEntries.event.extended.subscription.billingSettings.billingAddress.address',
1809
+ },
1810
+ {
1811
+ path: 'historyEntries.event.extended.subscription.shippingAddress.address',
1812
+ },
1813
+ {
1814
+ path: 'historyEntries.event.initialPurchaseCompleted.subscription.billingSettings.billingAddress.address',
1815
+ },
1816
+ {
1817
+ path: 'historyEntries.event.initialPurchaseCompleted.subscription.shippingAddress.address',
1818
+ },
1819
+ {
1820
+ path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
1821
+ },
1822
+ {
1823
+ path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.shippingAddress.address',
1824
+ },
1825
+ {
1826
+ path: 'historyEntries.event.revived.subscription.billingSettings.billingAddress.address',
1827
+ },
1828
+ {
1829
+ path: 'historyEntries.event.revived.subscription.shippingAddress.address',
1830
+ },
1831
+ {
1832
+ path: 'historyEntries.event.billingDateUpdated.subscription.billingSettings.billingAddress.address',
1833
+ },
1834
+ {
1835
+ path: 'historyEntries.event.billingDateUpdated.subscription.shippingAddress.address',
1836
+ },
1837
+ {
1838
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.billingSettings.billingAddress.address',
1839
+ },
1840
+ {
1841
+ path: 'historyEntries.event.futureUpdatesRequested.subscription.shippingAddress.address',
1842
+ },
1843
+ {
1844
+ path: 'historyEntries.event.updatesApplied.subscription.billingSettings.billingAddress.address',
1845
+ },
1846
+ {
1847
+ path: 'historyEntries.event.updatesApplied.subscription.shippingAddress.address',
1848
+ },
1849
+ {
1850
+ path: 'historyEntries.event.resetPendingUpdates.subscription.billingSettings.billingAddress.address',
1851
+ },
1852
+ {
1853
+ path: 'historyEntries.event.resetPendingUpdates.subscription.shippingAddress.address',
1854
+ },
1855
+ {
1856
+ path: 'historyEntries.event.gracePeriodStarted.subscription.billingSettings.billingAddress.address',
1857
+ },
1858
+ {
1859
+ path: 'historyEntries.event.gracePeriodStarted.subscription.shippingAddress.address',
1860
+ },
1861
+ {
1862
+ path: 'historyEntries.event.gracePeriodEnded.subscription.billingSettings.billingAddress.address',
1863
+ },
1864
+ {
1865
+ path: 'historyEntries.event.gracePeriodEnded.subscription.shippingAddress.address',
1866
+ },
1867
+ {
1868
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.billingSettings.billingAddress.address',
1869
+ },
1870
+ {
1871
+ path: 'historyEntries.event.paymentMethodUpdated.subscription.shippingAddress.address',
1872
+ },
1873
+ {
1874
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.billingSettings.billingAddress.address',
1875
+ },
1876
+ {
1877
+ path: 'historyEntries.event.collectionMethodUpdated.subscription.shippingAddress.address',
1878
+ },
1879
+ {
1880
+ path: 'historyEntries.event.freeTrailStarted.subscription.billingSettings.billingAddress.address',
1881
+ },
1882
+ {
1883
+ path: 'historyEntries.event.freeTrailStarted.subscription.shippingAddress.address',
1884
+ },
1885
+ {
1886
+ path: 'historyEntries.event.freeTrailEnded.subscription.billingSettings.billingAddress.address',
1887
+ },
1888
+ {
1889
+ path: 'historyEntries.event.freeTrailEnded.subscription.shippingAddress.address',
1890
+ },
1891
+ {
1892
+ path: 'historyEntries.event.billingCyclePaid.subscription.billingSettings.billingAddress.address',
1893
+ },
1894
+ {
1895
+ path: 'historyEntries.event.billingCyclePaid.subscription.shippingAddress.address',
1896
+ },
1897
+ {
1898
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingSettings.billingAddress.address',
1899
+ },
1900
+ {
1901
+ path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.shippingAddress.address',
1902
+ },
1903
+ {
1904
+ path: 'historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address',
1905
+ },
1906
+ {
1907
+ path: 'historyEntries.event.subscriptionBoAction.subscription.shippingAddress.address',
1908
+ },
1908
1909
  ],
1909
1910
  },
1910
1911
  ]));
@@ -1914,8 +1915,8 @@ export async function payCycle(subscriptionId, options) {
1914
1915
  spreadPathsToArguments: {},
1915
1916
  explicitPathsToArguments: {
1916
1917
  subscriptionId: '$[0]',
1917
- paymentTestMode: '$[1].paymentTestMode',
1918
- tenantId: '$[1].tenantId',
1918
+ mode: '$[1].mode',
1919
+ cursor: '$[1].cursor',
1919
1920
  },
1920
1921
  singleArgumentUnchanged: false,
1921
1922
  }, ['subscriptionId', 'options']);