@delopay/sdk 0.187.0 → 0.189.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.
@@ -6336,6 +6336,23 @@ var OperationLimits = class {
6336
6336
  async retrieveSettings(options) {
6337
6337
  return this.request("GET", "/operation-limits/settings", options);
6338
6338
  }
6339
+ /**
6340
+ * The caller's own usage against the limit on one operation: the rule that
6341
+ * applies to them, what they have used in the current window and what
6342
+ * remains.
6343
+ *
6344
+ * Refund usage needs merchant-wide refund read and is refused to a role
6345
+ * restricted to some connectors: the totals span every shop and connector,
6346
+ * as the budget does. Settlement usage needs merchant settlement read.
6347
+ *
6348
+ * `GET /operation-limits/usage`
6349
+ */
6350
+ async retrieveUsage(params, options) {
6351
+ return this.request("GET", "/operation-limits/usage", {
6352
+ query: { operation: params.operation },
6353
+ ...options
6354
+ });
6355
+ }
6339
6356
  /**
6340
6357
  * Update the enforcement settings. Only provided fields change.
6341
6358
  *
@@ -9926,19 +9943,26 @@ var CheckoutSession = class {
9926
9943
  * is what a recorder should do: every ordinary slice compresses, and the last
9927
9944
  * one is sent the way that actually arrives.
9928
9945
  *
9946
+ * For a precompressed event array, pass `compressed_events` and `gzipBody`.
9947
+ * The latter receives the complete JSON request (including the session's
9948
+ * client secret) and must return gzip bytes synchronously. Fetch then starts
9949
+ * before this method yields, including on a page-navigation slice. A
9950
+ * keepalive request is used only when that prepared body is at most 60 KiB.
9951
+ *
9929
9952
  * `POST /payments/{paymentId}/replay/slice` (publishable key)
9930
9953
  */
9931
9954
  async storeReplaySlice(params, options) {
9932
- const { keepalive, compress, ...extras } = options ?? {};
9955
+ const { keepalive, compress, gzipBody, ...extras } = options ?? {};
9933
9956
  const body = { ...params, client_secret: this.requireClientSecret() };
9934
9957
  const headers = this.pkHeaders(extras.headers);
9935
- const gzipped = compress === true && keepalive !== true ? await gzipJson(body) : null;
9958
+ const encoded = gzipBody?.(new TextEncoder().encode(JSON.stringify(body)));
9959
+ const gzipped = encoded ? Uint8Array.from(encoded).buffer : compress === true && keepalive !== true ? await gzipJson(body) : null;
9936
9960
  return this.client.request(
9937
9961
  "POST",
9938
9962
  `/payments/${encodeURIComponent(this.paymentId)}/replay/slice`,
9939
9963
  {
9940
9964
  body: gzipped ?? body,
9941
- ...keepalive !== void 0 ? { keepalive } : {},
9965
+ ...keepalive !== void 0 ? { keepalive: encoded ? keepalive && encoded.byteLength <= 60 * 1024 : keepalive } : {},
9942
9966
  ...extras,
9943
9967
  // `Content-Type` has to be stated for the compressed body: the client
9944
9968
  // only sets it for a body it serialises itself, and the bytes are
@@ -10914,4 +10938,4 @@ export {
10914
10938
  decodeNativePanes,
10915
10939
  encodeNativePanes
10916
10940
  };
10917
- //# sourceMappingURL=chunk-UI54GG2H.js.map
10941
+ //# sourceMappingURL=chunk-7M6HDH2Q.js.map