@delopay/sdk 0.212.0 → 0.214.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,
@@ -82,6 +83,7 @@ __export(index_exports, {
82
83
  MAX_SECTION_ORDER: () => MAX_SECTION_ORDER,
83
84
  METHOD_SECTIONS: () => METHOD_SECTIONS,
84
85
  MIN_SECTION_ORDER: () => MIN_SECTION_ORDER,
86
+ MessageTemplates: () => MessageTemplates,
85
87
  NATIVE_ELEMENT_POSITIONS: () => NATIVE_ELEMENT_POSITIONS,
86
88
  NATIVE_PANES_MAX: () => NATIVE_PANES_MAX,
87
89
  NATIVE_PANE_CATEGORY_KEYS: () => NATIVE_PANE_CATEGORY_KEYS,
@@ -5270,6 +5272,94 @@ var SellToRestrictions = class {
5270
5272
  }
5271
5273
  };
5272
5274
 
5275
+ // src/resources/checkoutRecovery.ts
5276
+ var CheckoutRecovery = class {
5277
+ constructor(request) {
5278
+ this.request = request;
5279
+ }
5280
+ /**
5281
+ * A checkout's recovery: whether and when the rule reminds it, every reason
5282
+ * it does not, every message about it, and where its link goes. Any payment
5283
+ * of the checkout may be named.
5284
+ * `GET /checkout-recovery/payments/{payment_id}`
5285
+ */
5286
+ async retrieve(paymentId) {
5287
+ return this.request("GET", `/checkout-recovery/payments/${encodeURIComponent(paymentId)}`);
5288
+ }
5289
+ /**
5290
+ * No automatic reminder about this checkout from now on.
5291
+ * `POST /checkout-recovery/payments/{payment_id}/stop`
5292
+ */
5293
+ async stop(paymentId) {
5294
+ return this.request(
5295
+ "POST",
5296
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/stop`
5297
+ );
5298
+ }
5299
+ /**
5300
+ * Undo `stop`.
5301
+ * `POST /checkout-recovery/payments/{payment_id}/resume`
5302
+ */
5303
+ async resume(paymentId) {
5304
+ return this.request(
5305
+ "POST",
5306
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
5307
+ );
5308
+ }
5309
+ /**
5310
+ * A message by hand as it would be sent now: recipient, sender, text, link
5311
+ * and destination, and why it would be refused. Nothing is sent.
5312
+ * `POST /checkout-recovery/payments/{payment_id}/email/preview`
5313
+ */
5314
+ async previewEmail(paymentId, params) {
5315
+ return this.request(
5316
+ "POST",
5317
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email/preview`,
5318
+ { body: params }
5319
+ );
5320
+ }
5321
+ /**
5322
+ * Send a message by hand, once per `idempotency_key`, composed again from
5323
+ * the checkout as it is now. Refused when the checkout was paid or is being
5324
+ * paid, was cancelled, the buyer unsubscribed, or no payment method could
5325
+ * pay it.
5326
+ * `POST /checkout-recovery/payments/{payment_id}/email`
5327
+ */
5328
+ async sendEmail(paymentId, params) {
5329
+ return this.request(
5330
+ "POST",
5331
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email`,
5332
+ { body: params, bodyIdempotencyKey: params.idempotency_key ?? null }
5333
+ );
5334
+ }
5335
+ /**
5336
+ * Messages to buyers, newest first.
5337
+ * `GET /checkout-recovery/reminders`
5338
+ */
5339
+ async listReminders(params) {
5340
+ if (params) {
5341
+ return this.request("GET", "/checkout-recovery/reminders", { query: { ...params } });
5342
+ }
5343
+ return this.request("GET", "/checkout-recovery/reminders");
5344
+ }
5345
+ /**
5346
+ * The shop's recent checkouts judged under a rule (the stored one, or the
5347
+ * one given) as if switched on, with every reason. Nothing is sent.
5348
+ * `POST /checkout-recovery/candidates`
5349
+ */
5350
+ async previewCandidates(params = {}) {
5351
+ return this.request("POST", "/checkout-recovery/candidates", { body: params });
5352
+ }
5353
+ /**
5354
+ * A reminder with sample values, to the signed-in user's own address.
5355
+ * Dashboard sessions only.
5356
+ * `POST /checkout-recovery/test-email`
5357
+ */
5358
+ async sendTestEmail(params) {
5359
+ return this.request("POST", "/checkout-recovery/test-email", { body: params });
5360
+ }
5361
+ };
5362
+
5273
5363
  // src/resources/costRules.ts
5274
5364
  var CostRules = class {
5275
5365
  constructor(request) {
@@ -7461,6 +7551,71 @@ var Settings = class {
7461
7551
  }
7462
7552
  };
7463
7553
 
7554
+ // src/resources/messageTemplates.ts
7555
+ var MessageTemplates = class {
7556
+ constructor(request) {
7557
+ this.request = request;
7558
+ }
7559
+ /** `GET /message-templates/shops/{profile_id}` */
7560
+ async listShop(profileId) {
7561
+ return this.request("GET", `/message-templates/shops/${encodeURIComponent(profileId)}`);
7562
+ }
7563
+ /** `GET /message-templates/shops/{profile_id}/{template_id}` */
7564
+ async retrieveShop(profileId, templateId) {
7565
+ return this.request(
7566
+ "GET",
7567
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}`
7568
+ );
7569
+ }
7570
+ /**
7571
+ * Store the shop's text in one language.
7572
+ *
7573
+ * `PUT /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7574
+ */
7575
+ async updateShopLanguage(profileId, templateId, language, params) {
7576
+ return this.request(
7577
+ "PUT",
7578
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7579
+ { body: params }
7580
+ );
7581
+ }
7582
+ /**
7583
+ * Remove the shop's text in one language, so the platform's or the built-in
7584
+ * text applies.
7585
+ *
7586
+ * `DELETE /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7587
+ */
7588
+ async resetShopLanguage(profileId, templateId, language, params = {}) {
7589
+ return this.request(
7590
+ "DELETE",
7591
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7592
+ { query: { expected_revision: params.expected_revision } }
7593
+ );
7594
+ }
7595
+ /** `POST /message-templates/shops/{profile_id}/{template_id}/preview` */
7596
+ async previewShop(profileId, templateId, params) {
7597
+ return this.request(
7598
+ "POST",
7599
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/preview`,
7600
+ {
7601
+ body: params
7602
+ }
7603
+ );
7604
+ }
7605
+ /**
7606
+ * Send the template to the signed-in user's own address.
7607
+ *
7608
+ * `POST /message-templates/shops/{profile_id}/{template_id}/test`
7609
+ */
7610
+ async sendShopTest(profileId, templateId, params) {
7611
+ return this.request(
7612
+ "POST",
7613
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/test`,
7614
+ { body: params }
7615
+ );
7616
+ }
7617
+ };
7618
+
7464
7619
  // src/resources/risk.ts
7465
7620
  var Risk = class {
7466
7621
  constructor(request) {
@@ -7723,6 +7878,7 @@ var Delopay = class {
7723
7878
  this.settlement = new Settlement(request);
7724
7879
  this.operationLimits = new OperationLimits(request);
7725
7880
  this.settings = new Settings(request);
7881
+ this.messageTemplates = new MessageTemplates(request);
7726
7882
  this.risk = new Risk(request);
7727
7883
  this.subscriptions = new Subscriptions(request);
7728
7884
  this.buyerPortal = new BuyerPortal(request);
@@ -7732,6 +7888,7 @@ var Delopay = class {
7732
7888
  this.regions = new Regions(request);
7733
7889
  this.availabilityOverrides = new AvailabilityOverrides(request);
7734
7890
  this.sellToRestrictions = new SellToRestrictions(request);
7891
+ this.checkoutRecovery = new CheckoutRecovery(request);
7735
7892
  this.costRules = new CostRules(request);
7736
7893
  this.externalRecords = new ExternalRecords(request);
7737
7894
  this.products = new Products(request);
@@ -11752,6 +11909,7 @@ var encodeNativePanes = encodePanes;
11752
11909
  CUSTOM_FIELD_VALUELESS_OPERATORS,
11753
11910
  Cards,
11754
11911
  CheckoutMethods,
11912
+ CheckoutRecovery,
11755
11913
  CheckoutSession,
11756
11914
  CostRules,
11757
11915
  DEFAULT_BADGES,
@@ -11777,6 +11935,7 @@ var encodeNativePanes = encodePanes;
11777
11935
  MAX_SECTION_ORDER,
11778
11936
  METHOD_SECTIONS,
11779
11937
  MIN_SECTION_ORDER,
11938
+ MessageTemplates,
11780
11939
  NATIVE_ELEMENT_POSITIONS,
11781
11940
  NATIVE_PANES_MAX,
11782
11941
  NATIVE_PANE_CATEGORY_KEYS,