@delopay/sdk 0.95.0 → 0.97.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-6BVLBNEZ.js → chunk-JBBUTXXY.js} +70 -1
- package/dist/chunk-JBBUTXXY.js.map +1 -0
- package/dist/index.cjs +69 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +521 -1
- package/dist/index.d.ts +521 -1
- package/dist/index.js +1 -1
- package/dist/internal.cjs +104 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +24 -3
- package/dist/internal.d.ts +24 -3
- package/dist/internal.js +36 -1
- package/dist/internal.js.map +1 -1
- package/package.json +18 -17
- package/dist/chunk-6BVLBNEZ.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -2216,6 +2216,7 @@ var Routing = class {
|
|
|
2216
2216
|
this.decision = new RoutingDecisionManager(request);
|
|
2217
2217
|
this.surchargeRules = new SurchargeRules(request);
|
|
2218
2218
|
this.checkoutThemeRules = new CheckoutThemeRules(request);
|
|
2219
|
+
this.checkoutThemeConversion = new CheckoutThemeConversion(request);
|
|
2219
2220
|
}
|
|
2220
2221
|
/**
|
|
2221
2222
|
* Create a new routing algorithm.
|
|
@@ -2528,6 +2529,47 @@ var CheckoutThemeRules = class {
|
|
|
2528
2529
|
});
|
|
2529
2530
|
}
|
|
2530
2531
|
};
|
|
2532
|
+
var CheckoutThemeConversion = class {
|
|
2533
|
+
constructor(request) {
|
|
2534
|
+
this.request = request;
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* Rendered-to-paid conversion for a shop over a window.
|
|
2538
|
+
*
|
|
2539
|
+
* `GET /routing/checkout-theme/conversion`
|
|
2540
|
+
*
|
|
2541
|
+
* Requires `CheckoutBranding` read at profile scope - the same permission
|
|
2542
|
+
* that governs seeing how a checkout looks.
|
|
2543
|
+
*
|
|
2544
|
+
* @param params - Window (RFC3339, `start` inclusive / `end` exclusive), the
|
|
2545
|
+
* shop, and the dimension to group by.
|
|
2546
|
+
*
|
|
2547
|
+
* @example Which variant wins on which device, over the last 30 days.
|
|
2548
|
+
* ```typescript
|
|
2549
|
+
* const report = await delopay.routing.checkoutThemeConversion.retrieve({
|
|
2550
|
+
* profile_id: 'pro_...',
|
|
2551
|
+
* start: '2026-07-21T00:00:00Z',
|
|
2552
|
+
* end: '2026-08-20T00:00:00Z',
|
|
2553
|
+
* segment: 'device',
|
|
2554
|
+
* });
|
|
2555
|
+
*
|
|
2556
|
+
* for (const c of report.comparisons) {
|
|
2557
|
+
* if (!c.separates) continue; // "not shown to differ" - say nothing
|
|
2558
|
+
* console.log(`${c.variant} on ${c.segment}: ${c.higher} converts better`);
|
|
2559
|
+
* }
|
|
2560
|
+
* ```
|
|
2561
|
+
*/
|
|
2562
|
+
async retrieve(params) {
|
|
2563
|
+
return this.request("GET", "/routing/checkout-theme/conversion", {
|
|
2564
|
+
query: {
|
|
2565
|
+
profile_id: params.profile_id,
|
|
2566
|
+
start: params.start,
|
|
2567
|
+
end: params.end,
|
|
2568
|
+
segment: params.segment
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2531
2573
|
|
|
2532
2574
|
// src/resources/search.ts
|
|
2533
2575
|
var Search = class {
|
|
@@ -3343,6 +3385,33 @@ var Analytics = class {
|
|
|
3343
3385
|
query: params
|
|
3344
3386
|
});
|
|
3345
3387
|
}
|
|
3388
|
+
/**
|
|
3389
|
+
* Device analytics over the canonical client-context observation per
|
|
3390
|
+
* payment (browser/platform families, device classes and models, checkout
|
|
3391
|
+
* channel mix, time-to-pay), pinned server-side to your own merchant and
|
|
3392
|
+
* drillable via `project_id` / `shop_id` exactly like `scope`. Gated on the
|
|
3393
|
+
* client-context optimisation-use switch: when it is off the server answers
|
|
3394
|
+
* 200 with `enabled: false` and a caveat naming the switch.
|
|
3395
|
+
* `GET /analytics/devices`
|
|
3396
|
+
*/
|
|
3397
|
+
async devices(params) {
|
|
3398
|
+
return this.request("GET", "/analytics/devices", {
|
|
3399
|
+
query: params
|
|
3400
|
+
});
|
|
3401
|
+
}
|
|
3402
|
+
/**
|
|
3403
|
+
* Geo analytics over the canonical client-context observation per payment:
|
|
3404
|
+
* country totals, city bubbles (IP mode), buyer languages, buyer-local
|
|
3405
|
+
* purchase hours and the IP-vs-billing mismatch share. `mode` selects the
|
|
3406
|
+
* location claim (`ip` default, `billing`); the two are never coalesced.
|
|
3407
|
+
* Same drill, window and gating contract as `devices`.
|
|
3408
|
+
* `GET /analytics/geo`
|
|
3409
|
+
*/
|
|
3410
|
+
async geo(params) {
|
|
3411
|
+
return this.request("GET", "/analytics/geo", {
|
|
3412
|
+
query: params
|
|
3413
|
+
});
|
|
3414
|
+
}
|
|
3346
3415
|
/** Global search. `POST /analytics/search` */
|
|
3347
3416
|
async search(params) {
|
|
3348
3417
|
return this.request("POST", "/analytics/search", { body: params });
|
|
@@ -6190,6 +6259,27 @@ var AdminPortal = class {
|
|
|
6190
6259
|
query: params
|
|
6191
6260
|
});
|
|
6192
6261
|
}
|
|
6262
|
+
/**
|
|
6263
|
+
* Device analytics over the canonical client-context observation per
|
|
6264
|
+
* payment, rooted at all merchants and drillable via `merchant_id` /
|
|
6265
|
+
* `project_id` / `shop_id` like `analyticsScope`. Answers 200 with
|
|
6266
|
+
* `enabled: false` when the client-context optimisation-use switch is off.
|
|
6267
|
+
*/
|
|
6268
|
+
async analyticsDevices(params) {
|
|
6269
|
+
return this.request("GET", "/admin-portal/analytics/devices", {
|
|
6270
|
+
query: params
|
|
6271
|
+
});
|
|
6272
|
+
}
|
|
6273
|
+
/**
|
|
6274
|
+
* Geo analytics over the canonical client-context observation per payment,
|
|
6275
|
+
* rooted at all merchants. `mode` selects the location claim (`ip` default,
|
|
6276
|
+
* `billing`).
|
|
6277
|
+
*/
|
|
6278
|
+
async analyticsGeo(params) {
|
|
6279
|
+
return this.request("GET", "/admin-portal/analytics/geo", {
|
|
6280
|
+
query: params
|
|
6281
|
+
});
|
|
6282
|
+
}
|
|
6193
6283
|
/**
|
|
6194
6284
|
* Platform billing dashboard: total balance across all ledger accounts (+
|
|
6195
6285
|
* the net change), top-ups, fees collected, and the day-by-day ledger flow.
|
|
@@ -6268,6 +6358,20 @@ var AdminPortal = class {
|
|
|
6268
6358
|
{ body: { iframe_allowed_origins: origins } }
|
|
6269
6359
|
);
|
|
6270
6360
|
}
|
|
6361
|
+
/**
|
|
6362
|
+
* Set (or clear) a target merchant shop's home country — the geo
|
|
6363
|
+
* dashboard's cross-border baseline. Internal-admin route. Pass `null` to
|
|
6364
|
+
* clear back to "international / no home country" (the default).
|
|
6365
|
+
*
|
|
6366
|
+
* `POST /admin-portal/accounts/{merchantId}/business-profile/{profileId}/home-country`
|
|
6367
|
+
*/
|
|
6368
|
+
async updateShopHomeCountry(merchantId, profileId, homeCountry) {
|
|
6369
|
+
return this.request(
|
|
6370
|
+
"POST",
|
|
6371
|
+
`/admin-portal/accounts/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/home-country`,
|
|
6372
|
+
{ body: { home_country: homeCountry } }
|
|
6373
|
+
);
|
|
6374
|
+
}
|
|
6271
6375
|
/**
|
|
6272
6376
|
* Soft-delete a transaction of ANY merchant. Only payments whose status
|
|
6273
6377
|
* is in the admin delete policy can be deleted; the action is audited.
|