@delopay/sdk 0.181.0 → 0.183.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.
@@ -1948,7 +1948,8 @@ var Payments = class {
1948
1948
  /**
1949
1949
  * Create a new payment intent.
1950
1950
  *
1951
- * @param params - Payment creation parameters including amount and currency.
1951
+ * @param params - An explicit amount and currency, or a DeloPay one-time
1952
+ * product whose active price supplies both on the server.
1952
1953
  * @param options - Optional per-call extras: extra `headers` (e.g. an
1953
1954
  * `Idempotency-Key` to make the create safe to retry), a `timeout` override,
1954
1955
  * and an `AbortSignal`.
@@ -1962,6 +1963,16 @@ var Payments = class {
1962
1963
  * );
1963
1964
  * ```
1964
1965
  *
1966
+ * @example Charge the active default price of a shop-owned product without
1967
+ * copying the product to the payment provider:
1968
+ * ```typescript
1969
+ * const payment = await delopay.payments.create({
1970
+ * product_id: 'prd_123',
1971
+ * profile_id: 'pro_123',
1972
+ * payment_link: true,
1973
+ * });
1974
+ * ```
1975
+ *
1965
1976
  * @example Send `test_mode` to pick the environment per payment, so a staging
1966
1977
  * deploy cannot charge real cards and a forgotten processor toggle cannot
1967
1978
  * swallow production traffic:
@@ -2015,6 +2026,10 @@ var Payments = class {
2015
2026
  if (Object.keys(query).length === 0) return this.request("GET", path);
2016
2027
  return this.request("GET", path, { query });
2017
2028
  }
2029
+ /** Product names and prices as frozen when the payment was created. */
2030
+ async productLines(paymentId) {
2031
+ return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/lines`);
2032
+ }
2018
2033
  /**
2019
2034
  * List every attempt made on a payment, each with its full failure detail
2020
2035
  * (`error_code` / `error_message`, the Delopay-unified `unified_code` and
@@ -4899,6 +4914,16 @@ var Products = class {
4899
4914
  scoped(profileId, options) {
4900
4915
  return { ...options, headers: { "X-Profile-Id": profileId, ...options?.headers } };
4901
4916
  }
4917
+ /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned
4918
+ * URL in a product create or update request; upload alone changes no product. */
4919
+ async uploadImage(file, profileId, options) {
4920
+ const form = new FormData();
4921
+ form.append("file", file);
4922
+ return this.request("POST", "/products/images", {
4923
+ body: form,
4924
+ ...this.scoped(profileId, options)
4925
+ });
4926
+ }
4902
4927
  /**
4903
4928
  * Create a product together with its prices.
4904
4929
  * `POST /products`
@@ -4967,6 +4992,13 @@ var Products = class {
4967
4992
  ...this.scoped(profileId, options)
4968
4993
  });
4969
4994
  }
4995
+ /** Mark an archived product deleted. Historical payment lines keep
4996
+ * their own immutable purchase snapshots, and the catalog row remains stored. */
4997
+ async delete(productId, profileId, options) {
4998
+ return this.request("DELETE", `/products/${encodeURIComponent(productId)}`, {
4999
+ ...this.scoped(profileId, options)
5000
+ });
5001
+ }
4970
5002
  /**
4971
5003
  * Add a price to an existing product.
4972
5004
  * `POST /products/{product_id}/prices`
@@ -5953,6 +5985,85 @@ var OperationLimits = class {
5953
5985
  }
5954
5986
  };
5955
5987
 
5988
+ // src/resources/replayRetention.ts
5989
+ var ReplayRetention = class {
5990
+ constructor(request) {
5991
+ this.request = request;
5992
+ }
5993
+ /**
5994
+ * Every level that is set for the caller's merchant, plus the global level
5995
+ * when one is set.
5996
+ *
5997
+ * `GET /replay-retention`
5998
+ */
5999
+ async list() {
6000
+ return this.request("GET", "/replay-retention");
6001
+ }
6002
+ /**
6003
+ * What applies to one shop's recordings, and which level decided.
6004
+ *
6005
+ * `GET /replay-retention/shops/{profileId}/effective`
6006
+ */
6007
+ async effective(profileId) {
6008
+ return this.request(
6009
+ "GET",
6010
+ `/replay-retention/shops/${encodeURIComponent(profileId)}/effective`
6011
+ );
6012
+ }
6013
+ /**
6014
+ * Set the merchant-wide level.
6015
+ *
6016
+ * `PUT /replay-retention/merchant`
6017
+ */
6018
+ async setMerchant(params) {
6019
+ return this.request("PUT", "/replay-retention/merchant", { body: params });
6020
+ }
6021
+ /**
6022
+ * Hand the merchant-wide level back to the global one.
6023
+ *
6024
+ * `DELETE /replay-retention/merchant`
6025
+ */
6026
+ async clearMerchant() {
6027
+ await this.request("DELETE", "/replay-retention/merchant");
6028
+ }
6029
+ /**
6030
+ * Set one project's level.
6031
+ *
6032
+ * `PUT /replay-retention/projects/{projectId}`
6033
+ */
6034
+ async setProject(projectId, params) {
6035
+ return this.request("PUT", `/replay-retention/projects/${encodeURIComponent(projectId)}`, {
6036
+ body: params
6037
+ });
6038
+ }
6039
+ /**
6040
+ * Hand one project's level back to the merchant's.
6041
+ *
6042
+ * `DELETE /replay-retention/projects/{projectId}`
6043
+ */
6044
+ async clearProject(projectId) {
6045
+ await this.request("DELETE", `/replay-retention/projects/${encodeURIComponent(projectId)}`);
6046
+ }
6047
+ /**
6048
+ * Set one shop's level. A shop-scoped caller may set only its own shop.
6049
+ *
6050
+ * `PUT /replay-retention/shops/{profileId}`
6051
+ */
6052
+ async setShop(profileId, params) {
6053
+ return this.request("PUT", `/replay-retention/shops/${encodeURIComponent(profileId)}`, {
6054
+ body: params
6055
+ });
6056
+ }
6057
+ /**
6058
+ * Hand one shop's level back to its project's (or the merchant's).
6059
+ *
6060
+ * `DELETE /replay-retention/shops/{profileId}`
6061
+ */
6062
+ async clearShop(profileId) {
6063
+ await this.request("DELETE", `/replay-retention/shops/${encodeURIComponent(profileId)}`);
6064
+ }
6065
+ };
6066
+
5956
6067
  // src/resources/risk.ts
5957
6068
  var Risk = class {
5958
6069
  constructor(request) {
@@ -6214,6 +6325,7 @@ var Delopay = class {
6214
6325
  this.audit = new Audit(request);
6215
6326
  this.settlement = new Settlement(request);
6216
6327
  this.operationLimits = new OperationLimits(request);
6328
+ this.replayRetention = new ReplayRetention(request);
6217
6329
  this.risk = new Risk(request);
6218
6330
  this.subscriptions = new Subscriptions(request);
6219
6331
  this.files = new Files(request);
@@ -10171,6 +10283,7 @@ export {
10171
10283
  Audit,
10172
10284
  Settlement,
10173
10285
  OperationLimits,
10286
+ ReplayRetention,
10174
10287
  Risk,
10175
10288
  Delopay,
10176
10289
  leaf,
@@ -10362,4 +10475,4 @@ export {
10362
10475
  decodeNativePanes,
10363
10476
  encodeNativePanes
10364
10477
  };
10365
- //# sourceMappingURL=chunk-3GSFUNXW.js.map
10478
+ //# sourceMappingURL=chunk-HITQ3SXH.js.map