@delopay/sdk 0.213.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/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,
@@ -7565,6 +7567,71 @@ var Settings = class {
7565
7567
  }
7566
7568
  };
7567
7569
 
7570
+ // src/resources/messageTemplates.ts
7571
+ var MessageTemplates = class {
7572
+ constructor(request) {
7573
+ this.request = request;
7574
+ }
7575
+ /** `GET /message-templates/shops/{profile_id}` */
7576
+ async listShop(profileId) {
7577
+ return this.request("GET", `/message-templates/shops/${encodeURIComponent(profileId)}`);
7578
+ }
7579
+ /** `GET /message-templates/shops/{profile_id}/{template_id}` */
7580
+ async retrieveShop(profileId, templateId) {
7581
+ return this.request(
7582
+ "GET",
7583
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}`
7584
+ );
7585
+ }
7586
+ /**
7587
+ * Store the shop's text in one language.
7588
+ *
7589
+ * `PUT /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7590
+ */
7591
+ async updateShopLanguage(profileId, templateId, language, params) {
7592
+ return this.request(
7593
+ "PUT",
7594
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7595
+ { body: params }
7596
+ );
7597
+ }
7598
+ /**
7599
+ * Remove the shop's text in one language, so the platform's or the built-in
7600
+ * text applies.
7601
+ *
7602
+ * `DELETE /message-templates/shops/{profile_id}/{template_id}/languages/{language}`
7603
+ */
7604
+ async resetShopLanguage(profileId, templateId, language, params = {}) {
7605
+ return this.request(
7606
+ "DELETE",
7607
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
7608
+ { query: { expected_revision: params.expected_revision } }
7609
+ );
7610
+ }
7611
+ /** `POST /message-templates/shops/{profile_id}/{template_id}/preview` */
7612
+ async previewShop(profileId, templateId, params) {
7613
+ return this.request(
7614
+ "POST",
7615
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/preview`,
7616
+ {
7617
+ body: params
7618
+ }
7619
+ );
7620
+ }
7621
+ /**
7622
+ * Send the template to the signed-in user's own address.
7623
+ *
7624
+ * `POST /message-templates/shops/{profile_id}/{template_id}/test`
7625
+ */
7626
+ async sendShopTest(profileId, templateId, params) {
7627
+ return this.request(
7628
+ "POST",
7629
+ `/message-templates/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(templateId)}/test`,
7630
+ { body: params }
7631
+ );
7632
+ }
7633
+ };
7634
+
7568
7635
  // src/resources/risk.ts
7569
7636
  var Risk = class {
7570
7637
  constructor(request) {
@@ -7827,6 +7894,7 @@ var Delopay = class {
7827
7894
  this.settlement = new Settlement(request);
7828
7895
  this.operationLimits = new OperationLimits(request);
7829
7896
  this.settings = new Settings(request);
7897
+ this.messageTemplates = new MessageTemplates(request);
7830
7898
  this.risk = new Risk(request);
7831
7899
  this.subscriptions = new Subscriptions(request);
7832
7900
  this.buyerPortal = new BuyerPortal(request);
@@ -13158,6 +13226,69 @@ function projectQuery2(query) {
13158
13226
  return query.project_id ? { project_id: query.project_id } : {};
13159
13227
  }
13160
13228
 
13229
+ // src/internal/resources/platformMessageTemplates.ts
13230
+ var PlatformMessageTemplates = class {
13231
+ constructor(request) {
13232
+ this.request = request;
13233
+ }
13234
+ /** `GET /admin-portal/message-templates` */
13235
+ async list() {
13236
+ return this.request("GET", "/admin-portal/message-templates");
13237
+ }
13238
+ /** `GET /admin-portal/message-templates/{template_id}` */
13239
+ async retrieve(templateId) {
13240
+ return this.request("GET", `/admin-portal/message-templates/${encodeURIComponent(templateId)}`);
13241
+ }
13242
+ /**
13243
+ * Store the platform's text in one language.
13244
+ *
13245
+ * `PUT /admin-portal/message-templates/{template_id}/languages/{language}`
13246
+ */
13247
+ async updateLanguage(templateId, language, params) {
13248
+ return this.request(
13249
+ "PUT",
13250
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
13251
+ {
13252
+ body: params
13253
+ }
13254
+ );
13255
+ }
13256
+ /**
13257
+ * Remove the platform's text in one language, so the built-in text applies.
13258
+ *
13259
+ * `DELETE /admin-portal/message-templates/{template_id}/languages/{language}`
13260
+ */
13261
+ async resetLanguage(templateId, language, params = {}) {
13262
+ return this.request(
13263
+ "DELETE",
13264
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,
13265
+ {
13266
+ query: { expected_revision: params.expected_revision }
13267
+ }
13268
+ );
13269
+ }
13270
+ /** `POST /admin-portal/message-templates/{template_id}/preview` */
13271
+ async preview(templateId, params) {
13272
+ return this.request(
13273
+ "POST",
13274
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/preview`,
13275
+ { body: params }
13276
+ );
13277
+ }
13278
+ /**
13279
+ * Send the template to the signed-in admin's own address.
13280
+ *
13281
+ * `POST /admin-portal/message-templates/{template_id}/test`
13282
+ */
13283
+ async sendTest(templateId, params) {
13284
+ return this.request(
13285
+ "POST",
13286
+ `/admin-portal/message-templates/${encodeURIComponent(templateId)}/test`,
13287
+ { body: params }
13288
+ );
13289
+ }
13290
+ };
13291
+
13161
13292
  // src/internal/resources/nativeRenewals.ts
13162
13293
  var NativeRenewals = class {
13163
13294
  constructor(request, serviceKey) {
@@ -13196,6 +13327,7 @@ var DelopayInternal = class extends Delopay {
13196
13327
  this.platformBilling = new PlatformBilling(request);
13197
13328
  this.platformFees = new PlatformFees(request);
13198
13329
  this.platformSettings = new PlatformSettings(request);
13330
+ this.platformMessageTemplates = new PlatformMessageTemplates(request);
13199
13331
  this.nativeRenewals = new NativeRenewals(request, args[0] ?? "");
13200
13332
  }
13201
13333
  };
@@ -13275,6 +13407,7 @@ var DelopayInternal = class extends Delopay {
13275
13407
  MAX_SECTION_ORDER,
13276
13408
  METHOD_SECTIONS,
13277
13409
  MIN_SECTION_ORDER,
13410
+ MessageTemplates,
13278
13411
  NATIVE_ELEMENT_POSITIONS,
13279
13412
  NATIVE_PANES_MAX,
13280
13413
  NATIVE_PANE_CATEGORY_KEYS,
@@ -13296,6 +13429,7 @@ var DelopayInternal = class extends Delopay {
13296
13429
  PaypalDisputes,
13297
13430
  PlatformBilling,
13298
13431
  PlatformFees,
13432
+ PlatformMessageTemplates,
13299
13433
  PlatformSettings,
13300
13434
  ProcessorCosts,
13301
13435
  Products,