@delopay/sdk 0.179.0 → 0.181.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/{chunk-LCYYPYOP.js → chunk-3GSFUNXW.js} +42 -10
- package/dist/chunk-3GSFUNXW.js.map +1 -0
- package/dist/index.cjs +41 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -62
- package/dist/index.d.ts +60 -62
- package/dist/index.js +1 -1
- package/dist/internal.cjs +42 -10
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +6 -7
- package/dist/internal.d.ts +6 -7
- package/dist/internal.js +2 -2
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-LCYYPYOP.js.map +0 -1
|
@@ -4408,15 +4408,15 @@ var Analytics = class {
|
|
|
4408
4408
|
}
|
|
4409
4409
|
/**
|
|
4410
4410
|
* Every analytics exclusion of the merchant, with the payments each one
|
|
4411
|
-
* matched in the lookback window
|
|
4411
|
+
* matched in the lookback window.
|
|
4412
4412
|
*
|
|
4413
4413
|
* These rules change what the merchant's own dashboards count. Financial
|
|
4414
4414
|
* records and transaction lists are never filtered by them.
|
|
4415
4415
|
*
|
|
4416
|
-
*
|
|
4417
|
-
*
|
|
4418
|
-
* `best_effort` and `lookback_days`
|
|
4419
|
-
* client signals that may be absent or expired, within that window.
|
|
4416
|
+
* `matched_payments` counts overlap between rules: a payment matched by
|
|
4417
|
+
* three rules is counted once by each, so the values are not additive. The
|
|
4418
|
+
* envelope's `best_effort` and `lookback_days` apply to every row — matching
|
|
4419
|
+
* runs on client signals that may be absent or expired, within that window.
|
|
4420
4420
|
* `GET /analytics/exclusions`
|
|
4421
4421
|
*/
|
|
4422
4422
|
async listExclusions() {
|
|
@@ -7680,7 +7680,7 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
7680
7680
|
var DEFAULT_BRANDING = {
|
|
7681
7681
|
...DEFAULT_BRANDING_BASE,
|
|
7682
7682
|
...LIGHT_PALETTE,
|
|
7683
|
-
// No badges by default
|
|
7683
|
+
// No badges by default any more — notices took their place.
|
|
7684
7684
|
// `DEFAULT_BADGES` stays exported because `isDefaultBadgeSet` still has to
|
|
7685
7685
|
// recognise the pair on shops saved before.
|
|
7686
7686
|
trustBadges: [],
|
|
@@ -9219,6 +9219,18 @@ function withoutHeader(headers, name) {
|
|
|
9219
9219
|
}
|
|
9220
9220
|
return out;
|
|
9221
9221
|
}
|
|
9222
|
+
async function gzipJson(value) {
|
|
9223
|
+
const ctor = globalThis.CompressionStream;
|
|
9224
|
+
if (typeof ctor !== "function") return null;
|
|
9225
|
+
try {
|
|
9226
|
+
const bytes = new TextEncoder().encode(JSON.stringify(value));
|
|
9227
|
+
return await new Response(
|
|
9228
|
+
new Blob([bytes]).stream().pipeThrough(new ctor("gzip"))
|
|
9229
|
+
).arrayBuffer();
|
|
9230
|
+
} catch {
|
|
9231
|
+
return null;
|
|
9232
|
+
}
|
|
9233
|
+
}
|
|
9222
9234
|
var CheckoutSession = class {
|
|
9223
9235
|
constructor(options) {
|
|
9224
9236
|
this.merchantId = options.merchantId;
|
|
@@ -9370,18 +9382,38 @@ var CheckoutSession = class {
|
|
|
9370
9382
|
* away (a redirect rail); browsers refuse keepalive bodies over ~64 KiB, so
|
|
9371
9383
|
* only a small final slice should carry it.
|
|
9372
9384
|
*
|
|
9385
|
+
* Pass `compress: true` to send the slice gzipped. Recorded page events
|
|
9386
|
+
* compress heavily, so this is mostly a saving on the buyer's connection. It
|
|
9387
|
+
* is opt-in and degrades silently: a runtime without `CompressionStream`
|
|
9388
|
+
* sends the same slice uncompressed rather than failing, so a caller never
|
|
9389
|
+
* has to feature-test before asking for it.
|
|
9390
|
+
*
|
|
9391
|
+
* ⚠️ `keepalive` overrides it. Compressing means awaiting a stream read
|
|
9392
|
+
* before the request is made, and `keepalive` protects a request only once
|
|
9393
|
+
* it has been initiated — so a page torn down mid-compression would drop the
|
|
9394
|
+
* final slice altogether. A slice sent with `keepalive` therefore always
|
|
9395
|
+
* travels uncompressed, whatever `compress` says. Passing both is allowed and
|
|
9396
|
+
* is what a recorder should do: every ordinary slice compresses, and the last
|
|
9397
|
+
* one is sent the way that actually arrives.
|
|
9398
|
+
*
|
|
9373
9399
|
* `POST /payments/{paymentId}/replay/slice` (publishable key)
|
|
9374
9400
|
*/
|
|
9375
9401
|
async storeReplaySlice(params, options) {
|
|
9376
|
-
const { keepalive, ...extras } = options ?? {};
|
|
9402
|
+
const { keepalive, compress, ...extras } = options ?? {};
|
|
9403
|
+
const body = { ...params, client_secret: this.requireClientSecret() };
|
|
9404
|
+
const headers = this.pkHeaders(extras.headers);
|
|
9405
|
+
const gzipped = compress === true && keepalive !== true ? await gzipJson(body) : null;
|
|
9377
9406
|
return this.client.request(
|
|
9378
9407
|
"POST",
|
|
9379
9408
|
`/payments/${encodeURIComponent(this.paymentId)}/replay/slice`,
|
|
9380
9409
|
{
|
|
9381
|
-
body:
|
|
9410
|
+
body: gzipped ?? body,
|
|
9382
9411
|
...keepalive !== void 0 ? { keepalive } : {},
|
|
9383
9412
|
...extras,
|
|
9384
|
-
|
|
9413
|
+
// `Content-Type` has to be stated for the compressed body: the client
|
|
9414
|
+
// only sets it for a body it serialises itself, and the bytes are
|
|
9415
|
+
// still JSON — gzip is how they travel, not what they are.
|
|
9416
|
+
headers: gzipped === null ? headers : { ...headers, "Content-Type": "application/json", "Content-Encoding": "gzip" }
|
|
9385
9417
|
}
|
|
9386
9418
|
);
|
|
9387
9419
|
}
|
|
@@ -10330,4 +10362,4 @@ export {
|
|
|
10330
10362
|
decodeNativePanes,
|
|
10331
10363
|
encodeNativePanes
|
|
10332
10364
|
};
|
|
10333
|
-
//# sourceMappingURL=chunk-
|
|
10365
|
+
//# sourceMappingURL=chunk-3GSFUNXW.js.map
|