@delopay/sdk 0.92.0 → 0.94.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-BWTQ34HP.js → chunk-TSYU2IQK.js} +86 -1
- package/dist/chunk-TSYU2IQK.js.map +1 -0
- package/dist/index.cjs +85 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +374 -7
- package/dist/index.d.ts +374 -7
- package/dist/index.js +1 -1
- package/dist/internal.cjs +85 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +18 -17
- package/dist/chunk-BWTQ34HP.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2203,6 +2203,7 @@ var Routing = class {
|
|
|
2203
2203
|
this.request = request;
|
|
2204
2204
|
this.decision = new RoutingDecisionManager(request);
|
|
2205
2205
|
this.surchargeRules = new SurchargeRules(request);
|
|
2206
|
+
this.checkoutThemeRules = new CheckoutThemeRules(request);
|
|
2206
2207
|
}
|
|
2207
2208
|
/**
|
|
2208
2209
|
* Create a new routing algorithm.
|
|
@@ -2431,6 +2432,90 @@ var SurchargeRules = class {
|
|
|
2431
2432
|
});
|
|
2432
2433
|
}
|
|
2433
2434
|
};
|
|
2435
|
+
var CheckoutThemeRules = class {
|
|
2436
|
+
constructor(request) {
|
|
2437
|
+
this.request = request;
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Create or replace the theme program for a scope.
|
|
2441
|
+
*
|
|
2442
|
+
* `PUT /routing/checkout-theme/rules`
|
|
2443
|
+
*
|
|
2444
|
+
* Supersedes rather than overwrites: the previous active version is retired
|
|
2445
|
+
* and a new one stored, so the record of which look was live when survives.
|
|
2446
|
+
* Pass `active: false` to store a revision **without** retiring the live one —
|
|
2447
|
+
* that is where a program drafted against a variant you have not built yet
|
|
2448
|
+
* belongs.
|
|
2449
|
+
*
|
|
2450
|
+
* @example A phone in Germany gets the compact look; everyone else the house style.
|
|
2451
|
+
* ```typescript
|
|
2452
|
+
* await delopay.routing.checkoutThemeRules.upsert({
|
|
2453
|
+
* name: 'Autumn targeting',
|
|
2454
|
+
* profile_id: 'pro_...',
|
|
2455
|
+
* algorithm: {
|
|
2456
|
+
* rules: [
|
|
2457
|
+
* {
|
|
2458
|
+
* name: 'German phones',
|
|
2459
|
+
* connectorSelection: { theme: { variant: 'compact' } },
|
|
2460
|
+
* statements: [
|
|
2461
|
+
* {
|
|
2462
|
+
* condition: [
|
|
2463
|
+
* {
|
|
2464
|
+
* lhs: 'device_class',
|
|
2465
|
+
* comparison: 'equal',
|
|
2466
|
+
* value: { type: 'enum_variant', value: 'phone' },
|
|
2467
|
+
* metadata: {},
|
|
2468
|
+
* },
|
|
2469
|
+
* {
|
|
2470
|
+
* lhs: 'browser_language',
|
|
2471
|
+
* comparison: 'equal',
|
|
2472
|
+
* value: { type: 'enum_variant', value: 'de' },
|
|
2473
|
+
* metadata: {},
|
|
2474
|
+
* },
|
|
2475
|
+
* ],
|
|
2476
|
+
* },
|
|
2477
|
+
* ],
|
|
2478
|
+
* },
|
|
2479
|
+
* ],
|
|
2480
|
+
* defaultSelection: { theme: { variant: 'house' } },
|
|
2481
|
+
* metadata: {},
|
|
2482
|
+
* },
|
|
2483
|
+
* });
|
|
2484
|
+
* ```
|
|
2485
|
+
*/
|
|
2486
|
+
async upsert(params) {
|
|
2487
|
+
return this.request("PUT", "/routing/checkout-theme/rules", { body: params });
|
|
2488
|
+
}
|
|
2489
|
+
/**
|
|
2490
|
+
* Retrieve the active theme program for a scope, or `null` when none is set.
|
|
2491
|
+
*
|
|
2492
|
+
* `GET /routing/checkout-theme/rules?profile_id={profileId}`
|
|
2493
|
+
*
|
|
2494
|
+
* @param profileId - Shop scope. Omit for the merchant-wide program. A
|
|
2495
|
+
* shop-scoped caller that omits it gets its own shop's program.
|
|
2496
|
+
*/
|
|
2497
|
+
async retrieve(profileId) {
|
|
2498
|
+
return this.request("GET", "/routing/checkout-theme/rules", {
|
|
2499
|
+
query: { profile_id: profileId }
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Deactivate the active theme program for a scope. Idempotent.
|
|
2504
|
+
*
|
|
2505
|
+
* `DELETE /routing/checkout-theme/rules?profile_id={profileId}`
|
|
2506
|
+
*
|
|
2507
|
+
* Deactivation, not deletion — the stored row is what says which look was
|
|
2508
|
+
* live when, and that history cannot be reconstructed after the fact. Shops
|
|
2509
|
+
* go back to their default appearance immediately.
|
|
2510
|
+
*
|
|
2511
|
+
* @param profileId - Shop scope. Omit for the merchant-wide program.
|
|
2512
|
+
*/
|
|
2513
|
+
async delete(profileId) {
|
|
2514
|
+
return this.request("DELETE", "/routing/checkout-theme/rules", {
|
|
2515
|
+
query: { profile_id: profileId }
|
|
2516
|
+
});
|
|
2517
|
+
}
|
|
2518
|
+
};
|
|
2434
2519
|
|
|
2435
2520
|
// src/resources/search.ts
|
|
2436
2521
|
var Search = class {
|