@delopay/sdk 0.211.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.
@@ -5026,6 +5026,94 @@ var SellToRestrictions = class {
5026
5026
  }
5027
5027
  };
5028
5028
 
5029
+ // src/resources/checkoutRecovery.ts
5030
+ var CheckoutRecovery = class {
5031
+ constructor(request) {
5032
+ this.request = request;
5033
+ }
5034
+ /**
5035
+ * A checkout's recovery: whether and when the rule reminds it, every reason
5036
+ * it does not, every message about it, and where its link goes. Any payment
5037
+ * of the checkout may be named.
5038
+ * `GET /checkout-recovery/payments/{payment_id}`
5039
+ */
5040
+ async retrieve(paymentId) {
5041
+ return this.request("GET", `/checkout-recovery/payments/${encodeURIComponent(paymentId)}`);
5042
+ }
5043
+ /**
5044
+ * No automatic reminder about this checkout from now on.
5045
+ * `POST /checkout-recovery/payments/{payment_id}/stop`
5046
+ */
5047
+ async stop(paymentId) {
5048
+ return this.request(
5049
+ "POST",
5050
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/stop`
5051
+ );
5052
+ }
5053
+ /**
5054
+ * Undo `stop`.
5055
+ * `POST /checkout-recovery/payments/{payment_id}/resume`
5056
+ */
5057
+ async resume(paymentId) {
5058
+ return this.request(
5059
+ "POST",
5060
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/resume`
5061
+ );
5062
+ }
5063
+ /**
5064
+ * A message by hand as it would be sent now: recipient, sender, text, link
5065
+ * and destination, and why it would be refused. Nothing is sent.
5066
+ * `POST /checkout-recovery/payments/{payment_id}/email/preview`
5067
+ */
5068
+ async previewEmail(paymentId, params) {
5069
+ return this.request(
5070
+ "POST",
5071
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email/preview`,
5072
+ { body: params }
5073
+ );
5074
+ }
5075
+ /**
5076
+ * Send a message by hand, once per `idempotency_key`, composed again from
5077
+ * the checkout as it is now. Refused when the checkout was paid or is being
5078
+ * paid, was cancelled, the buyer unsubscribed, or no payment method could
5079
+ * pay it.
5080
+ * `POST /checkout-recovery/payments/{payment_id}/email`
5081
+ */
5082
+ async sendEmail(paymentId, params) {
5083
+ return this.request(
5084
+ "POST",
5085
+ `/checkout-recovery/payments/${encodeURIComponent(paymentId)}/email`,
5086
+ { body: params, bodyIdempotencyKey: params.idempotency_key ?? null }
5087
+ );
5088
+ }
5089
+ /**
5090
+ * Messages to buyers, newest first.
5091
+ * `GET /checkout-recovery/reminders`
5092
+ */
5093
+ async listReminders(params) {
5094
+ if (params) {
5095
+ return this.request("GET", "/checkout-recovery/reminders", { query: { ...params } });
5096
+ }
5097
+ return this.request("GET", "/checkout-recovery/reminders");
5098
+ }
5099
+ /**
5100
+ * The shop's recent checkouts judged under a rule (the stored one, or the
5101
+ * one given) as if switched on, with every reason. Nothing is sent.
5102
+ * `POST /checkout-recovery/candidates`
5103
+ */
5104
+ async previewCandidates(params = {}) {
5105
+ return this.request("POST", "/checkout-recovery/candidates", { body: params });
5106
+ }
5107
+ /**
5108
+ * A reminder with sample values, to the signed-in user's own address.
5109
+ * Dashboard sessions only.
5110
+ * `POST /checkout-recovery/test-email`
5111
+ */
5112
+ async sendTestEmail(params) {
5113
+ return this.request("POST", "/checkout-recovery/test-email", { body: params });
5114
+ }
5115
+ };
5116
+
5029
5117
  // src/resources/costRules.ts
5030
5118
  var CostRules = class {
5031
5119
  constructor(request) {
@@ -5780,6 +5868,36 @@ var Invoices = class {
5780
5868
  ...options
5781
5869
  });
5782
5870
  }
5871
+ /**
5872
+ * Mail an issued invoice to the buyer address it carries, its PDF attached,
5873
+ * in the document's language. Each call is a new message (the next
5874
+ * `revision`) and resolves with what became of it: `sent`, or `failed` with
5875
+ * `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),
5876
+ * `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is
5877
+ * queued or being sent) and `send_limit_reached` (5 sends by hand in 24
5878
+ * hours). Shops with the `email.invoice_auto_send` setting mail every
5879
+ * invoice they issue without this call.
5880
+ *
5881
+ * The merchant's daily sending limit is **not** a refusal: the call answers
5882
+ * with the message `failed` and `error_code: 'merchant_limit_reached'`.
5883
+ * Check `status` on the result, not only that the call succeeded.
5884
+ * `POST /invoices/{invoice_id}/email`
5885
+ */
5886
+ async sendEmail(invoiceId, options) {
5887
+ return this.request("POST", `/invoices/${encodeURIComponent(invoiceId)}/email`, {
5888
+ ...options
5889
+ });
5890
+ }
5891
+ /**
5892
+ * Every message about a document to its buyer, automatic and by hand,
5893
+ * newest first, with its delivery status. The recipient is masked.
5894
+ * `GET /invoices/{invoice_id}/emails`
5895
+ */
5896
+ async listEmails(invoiceId, options) {
5897
+ return this.request("GET", `/invoices/${encodeURIComponent(invoiceId)}/emails`, {
5898
+ ...options
5899
+ });
5900
+ }
5783
5901
  };
5784
5902
 
5785
5903
  // src/resources/invoiceSettings.ts
@@ -7458,6 +7576,7 @@ var Delopay = class {
7458
7576
  this.regions = new Regions(request);
7459
7577
  this.availabilityOverrides = new AvailabilityOverrides(request);
7460
7578
  this.sellToRestrictions = new SellToRestrictions(request);
7579
+ this.checkoutRecovery = new CheckoutRecovery(request);
7461
7580
  this.costRules = new CostRules(request);
7462
7581
  this.externalRecords = new ExternalRecords(request);
7463
7582
  this.products = new Products(request);
@@ -11459,6 +11578,7 @@ export {
11459
11578
  Regions,
11460
11579
  AvailabilityOverrides,
11461
11580
  SellToRestrictions,
11581
+ CheckoutRecovery,
11462
11582
  CostRules,
11463
11583
  ExternalRecords,
11464
11584
  Products,
@@ -11662,4 +11782,4 @@ export {
11662
11782
  decodeNativePanes,
11663
11783
  encodeNativePanes
11664
11784
  };
11665
- //# sourceMappingURL=chunk-2OYT52HK.js.map
11785
+ //# sourceMappingURL=chunk-BL5Y5CSM.js.map