@delopay/sdk 0.213.0 → 0.215.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
@@ -83,6 +83,7 @@ __export(index_exports, {
83
83
  MAX_SECTION_ORDER: () => MAX_SECTION_ORDER,
84
84
  METHOD_SECTIONS: () => METHOD_SECTIONS,
85
85
  MIN_SECTION_ORDER: () => MIN_SECTION_ORDER,
86
+ MessageTemplates: () => MessageTemplates,
86
87
  NATIVE_ELEMENT_POSITIONS: () => NATIVE_ELEMENT_POSITIONS,
87
88
  NATIVE_PANES_MAX: () => NATIVE_PANES_MAX,
88
89
  NATIVE_PANE_CATEGORY_KEYS: () => NATIVE_PANE_CATEGORY_KEYS,
@@ -5305,6 +5306,36 @@ var CheckoutRecovery = class {
5305
5306
  `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
5306
5307
  );
5307
5308
  }
5309
+ /**
5310
+ * Whether the checkout can be reactivated now, why not when it cannot, and
5311
+ * what it would continue: order, amount, the current page's expiry and the
5312
+ * validity a reactivation gives. Changes nothing.
5313
+ * `GET /checkout-recovery/payments/{payment_id}/reactivation`
5314
+ */
5315
+ async previewReactivation(paymentId) {
5316
+ return this.request(
5317
+ "GET",
5318
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/reactivation`
5319
+ );
5320
+ }
5321
+ /**
5322
+ * Continue an expired, unpaid checkout on a new payment for the same order,
5323
+ * amount and currency. The payment it replaces is closed first, so the two
5324
+ * can never both be charged; nothing is charged and nothing is sent to the
5325
+ * buyer. A repeated request answers with the same checkout
5326
+ * (`already_active`). Refused (`IR_16`, `error.data.reason` a
5327
+ * `ReactivationBlockedReason`, or `invalid_validity`) while the checkout is
5328
+ * paid, being paid, awaiting capture or authentication, cancelled or still
5329
+ * open, or when no payment method could pay it.
5330
+ * `POST /checkout-recovery/payments/{payment_id}/reactivate`
5331
+ */
5332
+ async reactivate(paymentId, params = {}) {
5333
+ return this.request(
5334
+ "POST",
5335
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/reactivate`,
5336
+ { body: params }
5337
+ );
5338
+ }
5308
5339
  /**
5309
5340
  * A message by hand as it would be sent now: recipient, sender, text, link
5310
5341
  * and destination, and why it would be refused. Nothing is sent.
@@ -7550,6 +7581,71 @@ var Settings = class {
7550
7581
  }
7551
7582
  };
7552
7583
 
7584
+ // src/resources/messageTemplates.ts
7585
+ var MessageTemplates = class {
7586
+ constructor(request) {
7587
+ this.request = request;
7588
+ }
7589
+ /** `GET /message-templates/shops/{profile_id}` */
7590
+ async listShop(profileId) {
7591
+ return this.request("GET", `/message-templates/shops/${encodeURIComponent(profileId)}`);
7592
+ }
7593
+ /** `GET /message-templates/shops/{profile_id}/{template_id}` */
7594
+ async retrieveShop(profileId, templateId) {
7595
+ return this.request(
7596
+ "GET",
7597
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}`
7598
+ );
7599
+ }
7600
+ /**
7601
+ * Store the shop's text in one language.
7602
+ *
7603
+ * `PUT /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7604
+ */
7605
+ async updateShopLanguage(profileId, templateId, language, params) {
7606
+ return this.request(
7607
+ "PUT",
7608
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7609
+ { body: params }
7610
+ );
7611
+ }
7612
+ /**
7613
+ * Remove the shop's text in one language, so the platform's or the built-in
7614
+ * text applies.
7615
+ *
7616
+ * `DELETE /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7617
+ */
7618
+ async resetShopLanguage(profileId, templateId, language, params = {}) {
7619
+ return this.request(
7620
+ "DELETE",
7621
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7622
+ { query: { expected_revision: params.expected_revision } }
7623
+ );
7624
+ }
7625
+ /** `POST /message-templates/shops/{profile_id}/{template_id}/preview` */
7626
+ async previewShop(profileId, templateId, params) {
7627
+ return this.request(
7628
+ "POST",
7629
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/preview`,
7630
+ {
7631
+ body: params
7632
+ }
7633
+ );
7634
+ }
7635
+ /**
7636
+ * Send the template to the signed-in user's own address.
7637
+ *
7638
+ * `POST /message-templates/shops/{profile_id}/{template_id}/test`
7639
+ */
7640
+ async sendShopTest(profileId, templateId, params) {
7641
+ return this.request(
7642
+ "POST",
7643
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/test`,
7644
+ { body: params }
7645
+ );
7646
+ }
7647
+ };
7648
+
7553
7649
  // src/resources/risk.ts
7554
7650
  var Risk = class {
7555
7651
  constructor(request) {
@@ -7812,6 +7908,7 @@ var Delopay = class {
7812
7908
  this.settlement = new Settlement(request);
7813
7909
  this.operationLimits = new OperationLimits(request);
7814
7910
  this.settings = new Settings(request);
7911
+ this.messageTemplates = new MessageTemplates(request);
7815
7912
  this.risk = new Risk(request);
7816
7913
  this.subscriptions = new Subscriptions(request);
7817
7914
  this.buyerPortal = new BuyerPortal(request);
@@ -11868,6 +11965,7 @@ var encodeNativePanes = encodePanes;
11868
11965
  MAX_SECTION_ORDER,
11869
11966
  METHOD_SECTIONS,
11870
11967
  MIN_SECTION_ORDER,
11968
+ MessageTemplates,
11871
11969
  NATIVE_ELEMENT_POSITIONS,
11872
11970
  NATIVE_PANES_MAX,
11873
11971
  NATIVE_PANE_CATEGORY_KEYS,