@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.js CHANGED
@@ -62,6 +62,7 @@ import {
62
62
  MAX_SECTION_ORDER,
63
63
  METHOD_SECTIONS,
64
64
  MIN_SECTION_ORDER,
65
+ MessageTemplates,
65
66
  NATIVE_ELEMENT_POSITIONS,
66
67
  NATIVE_PANES_MAX,
67
68
  NATIVE_PANE_CATEGORY_KEYS,
@@ -219,7 +220,7 @@ import {
219
220
  validatePanes,
220
221
  verticalGapValue,
221
222
  visibleCustomFields
222
- } from "./chunk-BL5Y5CSM.js";
223
+ } from "./chunk-2FVZDCET.js";
223
224
  export {
224
225
  AIRWALLEX_AUTOFILL_TREATMENTS,
225
226
  AIRWALLEX_CARD_LAYOUTS,
@@ -284,6 +285,7 @@ export {
284
285
  MAX_SECTION_ORDER,
285
286
  METHOD_SECTIONS,
286
287
  MIN_SECTION_ORDER,
288
+ MessageTemplates,
287
289
  NATIVE_ELEMENT_POSITIONS,
288
290
  NATIVE_PANES_MAX,
289
291
  NATIVE_PANE_CATEGORY_KEYS,
package/dist/internal.cjs CHANGED
@@ -94,6 +94,7 @@ __export(internal_exports, {
94
94
  MAX_SECTION_ORDER: () => MAX_SECTION_ORDER,
95
95
  METHOD_SECTIONS: () => METHOD_SECTIONS,
96
96
  MIN_SECTION_ORDER: () => MIN_SECTION_ORDER,
97
+ MessageTemplates: () => MessageTemplates,
97
98
  NATIVE_ELEMENT_POSITIONS: () => NATIVE_ELEMENT_POSITIONS,
98
99
  NATIVE_PANES_MAX: () => NATIVE_PANES_MAX,
99
100
  NATIVE_PANE_CATEGORY_KEYS: () => NATIVE_PANE_CATEGORY_KEYS,
@@ -115,6 +116,7 @@ __export(internal_exports, {
115
116
  PaypalDisputes: () => PaypalDisputes,
116
117
  PlatformBilling: () => PlatformBilling,
117
118
  PlatformFees: () => PlatformFees,
119
+ PlatformMessageTemplates: () => PlatformMessageTemplates,
118
120
  PlatformSettings: () => PlatformSettings,
119
121
  ProcessorCosts: () => ProcessorCosts,
120
122
  Products: () => Products,
@@ -5320,6 +5322,36 @@ var CheckoutRecovery = class {
5320
5322
  `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
5321
5323
  );
5322
5324
  }
5325
+ /**
5326
+ * Whether the checkout can be reactivated now, why not when it cannot, and
5327
+ * what it would continue: order, amount, the current page's expiry and the
5328
+ * validity a reactivation gives. Changes nothing.
5329
+ * `GET /checkout-recovery/payments/{payment_id}/reactivation`
5330
+ */
5331
+ async previewReactivation(paymentId) {
5332
+ return this.request(
5333
+ "GET",
5334
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/reactivation`
5335
+ );
5336
+ }
5337
+ /**
5338
+ * Continue an expired, unpaid checkout on a new payment for the same order,
5339
+ * amount and currency. The payment it replaces is closed first, so the two
5340
+ * can never both be charged; nothing is charged and nothing is sent to the
5341
+ * buyer. A repeated request answers with the same checkout
5342
+ * (`already_active`). Refused (`IR_16`, `error.data.reason` a
5343
+ * `ReactivationBlockedReason`, or `invalid_validity`) while the checkout is
5344
+ * paid, being paid, awaiting capture or authentication, cancelled or still
5345
+ * open, or when no payment method could pay it.
5346
+ * `POST /checkout-recovery/payments/{payment_id}/reactivate`
5347
+ */
5348
+ async reactivate(paymentId, params = {}) {
5349
+ return this.request(
5350
+ "POST",
5351
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/reactivate`,
5352
+ { body: params }
5353
+ );
5354
+ }
5323
5355
  /**
5324
5356
  * A message by hand as it would be sent now: recipient, sender, text, link
5325
5357
  * and destination, and why it would be refused. Nothing is sent.
@@ -7565,6 +7597,71 @@ var Settings = class {
7565
7597
  }
7566
7598
  };
7567
7599
 
7600
+ // src/resources/messageTemplates.ts
7601
+ var MessageTemplates = class {
7602
+ constructor(request) {
7603
+ this.request = request;
7604
+ }
7605
+ /** `GET /message-templates/shops/{profile_id}` */
7606
+ async listShop(profileId) {
7607
+ return this.request("GET", `/message-templates/shops/${encodeURIComponent(profileId)}`);
7608
+ }
7609
+ /** `GET /message-templates/shops/{profile_id}/{template_id}` */
7610
+ async retrieveShop(profileId, templateId) {
7611
+ return this.request(
7612
+ "GET",
7613
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}`
7614
+ );
7615
+ }
7616
+ /**
7617
+ * Store the shop's text in one language.
7618
+ *
7619
+ * `PUT /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7620
+ */
7621
+ async updateShopLanguage(profileId, templateId, language, params) {
7622
+ return this.request(
7623
+ "PUT",
7624
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7625
+ { body: params }
7626
+ );
7627
+ }
7628
+ /**
7629
+ * Remove the shop's text in one language, so the platform's or the built-in
7630
+ * text applies.
7631
+ *
7632
+ * `DELETE /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7633
+ */
7634
+ async resetShopLanguage(profileId, templateId, language, params = {}) {
7635
+ return this.request(
7636
+ "DELETE",
7637
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7638
+ { query: { expected_revision: params.expected_revision } }
7639
+ );
7640
+ }
7641
+ /** `POST /message-templates/shops/{profile_id}/{template_id}/preview` */
7642
+ async previewShop(profileId, templateId, params) {
7643
+ return this.request(
7644
+ "POST",
7645
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/preview`,
7646
+ {
7647
+ body: params
7648
+ }
7649
+ );
7650
+ }
7651
+ /**
7652
+ * Send the template to the signed-in user's own address.
7653
+ *
7654
+ * `POST /message-templates/shops/{profile_id}/{template_id}/test`
7655
+ */
7656
+ async sendShopTest(profileId, templateId, params) {
7657
+ return this.request(
7658
+ "POST",
7659
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/test`,
7660
+ { body: params }
7661
+ );
7662
+ }
7663
+ };
7664
+
7568
7665
  // src/resources/risk.ts
7569
7666
  var Risk = class {
7570
7667
  constructor(request) {
@@ -7827,6 +7924,7 @@ var Delopay = class {
7827
7924
  this.settlement = new Settlement(request);
7828
7925
  this.operationLimits = new OperationLimits(request);
7829
7926
  this.settings = new Settings(request);
7927
+ this.messageTemplates = new MessageTemplates(request);
7830
7928
  this.risk = new Risk(request);
7831
7929
  this.subscriptions = new Subscriptions(request);
7832
7930
  this.buyerPortal = new BuyerPortal(request);
@@ -13158,6 +13256,69 @@ function projectQuery2(query) {
13158
13256
  return query.project_id ? { project_id: query.project_id } : {};
13159
13257
  }
13160
13258
 
13259
+ // src/internal/resources/platformMessageTemplates.ts
13260
+ var PlatformMessageTemplates = class {
13261
+ constructor(request) {
13262
+ this.request = request;
13263
+ }
13264
+ /** `GET /admin-portal/message-templates` */
13265
+ async list() {
13266
+ return this.request("GET", "/admin-portal/message-templates");
13267
+ }
13268
+ /** `GET /admin-portal/message-templates/{template_id}` */
13269
+ async retrieve(templateId) {
13270
+ return this.request("GET", `/admin-portal/message-templates/${encodeURIComponent(templateId)}`);
13271
+ }
13272
+ /**
13273
+ * Store the platform's text in one language.
13274
+ *
13275
+ * `PUT /admin-portal/message-templates/{template_id}/languages/{language}`
13276
+ */
13277
+ async updateLanguage(templateId, language, params) {
13278
+ return this.request(
13279
+ "PUT",
13280
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
13281
+ {
13282
+ body: params
13283
+ }
13284
+ );
13285
+ }
13286
+ /**
13287
+ * Remove the platform's text in one language, so the built-in text applies.
13288
+ *
13289
+ * `DELETE /admin-portal/message-templates/{template_id}/languages/{language}`
13290
+ */
13291
+ async resetLanguage(templateId, language, params = {}) {
13292
+ return this.request(
13293
+ "DELETE",
13294
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
13295
+ {
13296
+ query: { expected_revision: params.expected_revision }
13297
+ }
13298
+ );
13299
+ }
13300
+ /** `POST /admin-portal/message-templates/{template_id}/preview` */
13301
+ async preview(templateId, params) {
13302
+ return this.request(
13303
+ "POST",
13304
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/preview`,
13305
+ { body: params }
13306
+ );
13307
+ }
13308
+ /**
13309
+ * Send the template to the signed-in admin's own address.
13310
+ *
13311
+ * `POST /admin-portal/message-templates/{template_id}/test`
13312
+ */
13313
+ async sendTest(templateId, params) {
13314
+ return this.request(
13315
+ "POST",
13316
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/test`,
13317
+ { body: params }
13318
+ );
13319
+ }
13320
+ };
13321
+
13161
13322
  // src/internal/resources/nativeRenewals.ts
13162
13323
  var NativeRenewals = class {
13163
13324
  constructor(request, serviceKey) {
@@ -13196,6 +13357,7 @@ var DelopayInternal = class extends Delopay {
13196
13357
  this.platformBilling = new PlatformBilling(request);
13197
13358
  this.platformFees = new PlatformFees(request);
13198
13359
  this.platformSettings = new PlatformSettings(request);
13360
+ this.platformMessageTemplates = new PlatformMessageTemplates(request);
13199
13361
  this.nativeRenewals = new NativeRenewals(request, args[0] ?? "");
13200
13362
  }
13201
13363
  };
@@ -13275,6 +13437,7 @@ var DelopayInternal = class extends Delopay {
13275
13437
  MAX_SECTION_ORDER,
13276
13438
  METHOD_SECTIONS,
13277
13439
  MIN_SECTION_ORDER,
13440
+ MessageTemplates,
13278
13441
  NATIVE_ELEMENT_POSITIONS,
13279
13442
  NATIVE_PANES_MAX,
13280
13443
  NATIVE_PANE_CATEGORY_KEYS,
@@ -13296,6 +13459,7 @@ var DelopayInternal = class extends Delopay {
13296
13459
  PaypalDisputes,
13297
13460
  PlatformBilling,
13298
13461
  PlatformFees,
13462
+ PlatformMessageTemplates,
13299
13463
  PlatformSettings,
13300
13464
  ProcessorCosts,
13301
13465
  Products,