@delopay/sdk 0.212.0 → 0.213.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -57,6 +57,7 @@ __export(index_exports, {
57
57
  CUSTOM_FIELD_VALUELESS_OPERATORS: () => CUSTOM_FIELD_VALUELESS_OPERATORS,
58
58
  Cards: () => Cards,
59
59
  CheckoutMethods: () => CheckoutMethods,
60
+ CheckoutRecovery: () => CheckoutRecovery,
60
61
  CheckoutSession: () => CheckoutSession,
61
62
  CostRules: () => CostRules,
62
63
  DEFAULT_BADGES: () => DEFAULT_BADGES,
@@ -5270,6 +5271,94 @@ var SellToRestrictions = class {
5270
5271
  }
5271
5272
  };
5272
5273
 
5274
+ // src/resources/checkoutRecovery.ts
5275
+ var CheckoutRecovery = class {
5276
+ constructor(request) {
5277
+ this.request = request;
5278
+ }
5279
+ /**
5280
+ * A checkout's recovery: whether and when the rule reminds it, every reason
5281
+ * it does not, every message about it, and where its link goes. Any payment
5282
+ * of the checkout may be named.
5283
+ * `GET /checkout-recovery/payments/{payment_id}`
5284
+ */
5285
+ async retrieve(paymentId) {
5286
+ return this.request("GET", `/checkout-recovery/payments/${encodeURIComponent(paymentId)}`);
5287
+ }
5288
+ /**
5289
+ * No automatic reminder about this checkout from now on.
5290
+ * `POST /checkout-recovery/payments/{payment_id}/stop`
5291
+ */
5292
+ async stop(paymentId) {
5293
+ return this.request(
5294
+ "POST",
5295
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/stop`
5296
+ );
5297
+ }
5298
+ /**
5299
+ * Undo `stop`.
5300
+ * `POST /checkout-recovery/payments/{payment_id}/resume`
5301
+ */
5302
+ async resume(paymentId) {
5303
+ return this.request(
5304
+ "POST",
5305
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
5306
+ );
5307
+ }
5308
+ /**
5309
+ * A message by hand as it would be sent now: recipient, sender, text, link
5310
+ * and destination, and why it would be refused. Nothing is sent.
5311
+ * `POST /checkout-recovery/payments/{payment_id}/email/preview`
5312
+ */
5313
+ async previewEmail(paymentId, params) {
5314
+ return this.request(
5315
+ "POST",
5316
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email/preview`,
5317
+ { body: params }
5318
+ );
5319
+ }
5320
+ /**
5321
+ * Send a message by hand, once per `idempotency_key`, composed again from
5322
+ * the checkout as it is now. Refused when the checkout was paid or is being
5323
+ * paid, was cancelled, the buyer unsubscribed, or no payment method could
5324
+ * pay it.
5325
+ * `POST /checkout-recovery/payments/{payment_id}/email`
5326
+ */
5327
+ async sendEmail(paymentId, params) {
5328
+ return this.request(
5329
+ "POST",
5330
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email`,
5331
+ { body: params, bodyIdempotencyKey: params.idempotency_key ?? null }
5332
+ );
5333
+ }
5334
+ /**
5335
+ * Messages to buyers, newest first.
5336
+ * `GET /checkout-recovery/reminders`
5337
+ */
5338
+ async listReminders(params) {
5339
+ if (params) {
5340
+ return this.request("GET", "/checkout-recovery/reminders", { query: { ...params } });
5341
+ }
5342
+ return this.request("GET", "/checkout-recovery/reminders");
5343
+ }
5344
+ /**
5345
+ * The shop's recent checkouts judged under a rule (the stored one, or the
5346
+ * one given) as if switched on, with every reason. Nothing is sent.
5347
+ * `POST /checkout-recovery/candidates`
5348
+ */
5349
+ async previewCandidates(params = {}) {
5350
+ return this.request("POST", "/checkout-recovery/candidates", { body: params });
5351
+ }
5352
+ /**
5353
+ * A reminder with sample values, to the signed-in user's own address.
5354
+ * Dashboard sessions only.
5355
+ * `POST /checkout-recovery/test-email`
5356
+ */
5357
+ async sendTestEmail(params) {
5358
+ return this.request("POST", "/checkout-recovery/test-email", { body: params });
5359
+ }
5360
+ };
5361
+
5273
5362
  // src/resources/costRules.ts
5274
5363
  var CostRules = class {
5275
5364
  constructor(request) {
@@ -7732,6 +7821,7 @@ var Delopay = class {
7732
7821
  this.regions = new Regions(request);
7733
7822
  this.availabilityOverrides = new AvailabilityOverrides(request);
7734
7823
  this.sellToRestrictions = new SellToRestrictions(request);
7824
+ this.checkoutRecovery = new CheckoutRecovery(request);
7735
7825
  this.costRules = new CostRules(request);
7736
7826
  this.externalRecords = new ExternalRecords(request);
7737
7827
  this.products = new Products(request);
@@ -11752,6 +11842,7 @@ var encodeNativePanes = encodePanes;
11752
11842
  CUSTOM_FIELD_VALUELESS_OPERATORS,
11753
11843
  Cards,
11754
11844
  CheckoutMethods,
11845
+ CheckoutRecovery,
11755
11846
  CheckoutSession,
11756
11847
  CostRules,
11757
11848
  DEFAULT_BADGES,