@delopay/sdk 0.403.0 → 0.407.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
@@ -174,6 +174,7 @@ __export(index_exports, {
174
174
  Subscriptions: () => Subscriptions,
175
175
  Support: () => Support,
176
176
  UNKNOWN_SECTION_ORDER: () => UNKNOWN_SECTION_ORDER,
177
+ VatRates: () => VatRates,
177
178
  WCAG_AA_TEXT: () => WCAG_AA_TEXT,
178
179
  WCAG_AA_UI: () => WCAG_AA_UI,
179
180
  WHOP_ACCENT_COLORS: () => WHOP_ACCENT_COLORS,
@@ -7133,6 +7134,12 @@ var Export = class {
7133
7134
  options
7134
7135
  );
7135
7136
  }
7137
+ async vatReport(params, options) {
7138
+ return runExport(this.request, "GET", "/export/vat-report", queried(params), options);
7139
+ }
7140
+ async vatReportForProfile(params, options) {
7141
+ return runExport(this.request, "GET", "/export/profile/vat-report", queried(params), options);
7142
+ }
7136
7143
  async auditLog(params, options) {
7137
7144
  return runExport(
7138
7145
  this.request,
@@ -7431,6 +7438,24 @@ var SellToRestrictions = class {
7431
7438
  }
7432
7439
  };
7433
7440
 
7441
+ // src/resources/vatRates.ts
7442
+ var VatRates = class {
7443
+ constructor(request) {
7444
+ this.request = request;
7445
+ }
7446
+ /**
7447
+ * List the rates, by country, category and `valid_from`. With `on`, only
7448
+ * the row in force on that date for each country and category.
7449
+ *
7450
+ * `GET /vat-rates`
7451
+ */
7452
+ async list(params) {
7453
+ return this.request("GET", "/vat-rates", {
7454
+ query: { country: params?.country, on: params?.on }
7455
+ });
7456
+ }
7457
+ };
7458
+
7434
7459
  // src/resources/buyerBlocklist.ts
7435
7460
  var BuyerBlocklist = class {
7436
7461
  constructor(request) {
@@ -8532,6 +8557,54 @@ var Products = class {
8532
8557
  ...this.scoped(profileId, options)
8533
8558
  });
8534
8559
  }
8560
+ /**
8561
+ * Copy a test product to live: its names, active prices under new ids,
8562
+ * image, tax category, category, selection groups and bundle composition.
8563
+ * A test product it contains or offers is replaced by its live copy; one
8564
+ * without a live copy refuses the copy. Nothing at a payment provider is
8565
+ * copied. A repeated copy returns the existing live copy unless `another`
8566
+ * is set (`created` says which).
8567
+ * `POST /products/{product_id}/copy-to-live`
8568
+ */
8569
+ async copyToLive(productId, params, profileId, options) {
8570
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/copy-to-live`, {
8571
+ body: params,
8572
+ ...this.scoped(profileId, options)
8573
+ });
8574
+ }
8575
+ /**
8576
+ * What `copyToLive` would do, with nothing written. A copy that would be
8577
+ * refused answers with the copy's error.
8578
+ * `GET /products/{product_id}/copy-to-live/preview`
8579
+ */
8580
+ async previewCopyToLive(productId, query, profileId, options) {
8581
+ return this.request("GET", `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {
8582
+ query: query === void 0 ? void 0 : { ...query },
8583
+ ...this.scoped(profileId, options)
8584
+ });
8585
+ }
8586
+ /**
8587
+ * The shop's products from before modes, newest first, each with where it
8588
+ * is in use per mode.
8589
+ * `GET /products/legacy-usage`
8590
+ */
8591
+ async legacyUsage(params, profileId, options) {
8592
+ return this.request("GET", "/products/legacy-usage", {
8593
+ query: params === void 0 ? void 0 : { ...params },
8594
+ ...this.scoped(profileId, options)
8595
+ });
8596
+ }
8597
+ /**
8598
+ * Give a product from before modes the mode it belongs to, once. Refused
8599
+ * while the other mode still uses it, or when it already has a mode.
8600
+ * `POST /products/{product_id}/assign-mode`
8601
+ */
8602
+ async assignMode(productId, params, profileId, options) {
8603
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/assign-mode`, {
8604
+ body: params,
8605
+ ...this.scoped(profileId, options)
8606
+ });
8607
+ }
8535
8608
  /**
8536
8609
  * Put an archived product back on sale.
8537
8610
  * `POST /products/{product_id}/restore`
@@ -12011,6 +12084,7 @@ var Delopay = class {
12011
12084
  this.regions = new Regions(request);
12012
12085
  this.availabilityOverrides = new AvailabilityOverrides(request);
12013
12086
  this.sellToRestrictions = new SellToRestrictions(request);
12087
+ this.vatRates = new VatRates(request);
12014
12088
  this.buyerBlocklist = new BuyerBlocklist(request);
12015
12089
  this.persons = new Persons(request);
12016
12090
  this.shopLabels = new ShopLabels(request);
@@ -17110,6 +17184,29 @@ var CheckoutSession = class {
17110
17184
  headers: this.bearerHeaders(options?.headers)
17111
17185
  });
17112
17186
  }
17187
+ /**
17188
+ * Send the buyer's tax country, region and VAT ID while the checkout data's
17189
+ * `tax.step` is `open`, and get the VAT the payment carries for them.
17190
+ *
17191
+ * `close: false` recalculates and keeps the step open, for a live total
17192
+ * while the buyer types; it also opens a confirmed step again while nothing
17193
+ * was prepared at a provider. `close: true` recalculates and confirms: the
17194
+ * payment is charged what the answer says, and the checkout data, fetched
17195
+ * again, answers the payment methods with `tax.step` `closed`. A confirmed
17196
+ * step answers the same closing request again. A change once something was
17197
+ * prepared at a provider is refused with `DE_28` (409), as is one while the
17198
+ * add-on choice is open or after the checkout expired. A malformed country
17199
+ * or region is refused with `IR_06` (400).
17200
+ *
17201
+ * `POST /payment-link/{merchantId}/{paymentId}/tax`
17202
+ */
17203
+ async submitTax(params, options) {
17204
+ return this.client.request("POST", `${this.linkBase}/tax`, {
17205
+ body: params,
17206
+ ...options,
17207
+ headers: this.bearerHeaders(options?.headers)
17208
+ });
17209
+ }
17113
17210
  /**
17114
17211
  * The payment's identity verification step: whether the payment asked for
17115
17212
  * one, its outcome, and the provider's page while it is pending. A pending
@@ -18156,6 +18253,7 @@ var encodeNativePanes = encodePanes;
18156
18253
  Subscriptions,
18157
18254
  Support,
18158
18255
  UNKNOWN_SECTION_ORDER,
18256
+ VatRates,
18159
18257
  WCAG_AA_TEXT,
18160
18258
  WCAG_AA_UI,
18161
18259
  WHOP_ACCENT_COLORS,