@delopay/sdk 0.93.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 +318 -1
- package/dist/index.d.ts +318 -1
- 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
|
@@ -2089,6 +2089,7 @@ var Routing = class {
|
|
|
2089
2089
|
this.request = request;
|
|
2090
2090
|
this.decision = new RoutingDecisionManager(request);
|
|
2091
2091
|
this.surchargeRules = new SurchargeRules(request);
|
|
2092
|
+
this.checkoutThemeRules = new CheckoutThemeRules(request);
|
|
2092
2093
|
}
|
|
2093
2094
|
/**
|
|
2094
2095
|
* Create a new routing algorithm.
|
|
@@ -2317,6 +2318,90 @@ var SurchargeRules = class {
|
|
|
2317
2318
|
});
|
|
2318
2319
|
}
|
|
2319
2320
|
};
|
|
2321
|
+
var CheckoutThemeRules = class {
|
|
2322
|
+
constructor(request) {
|
|
2323
|
+
this.request = request;
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* Create or replace the theme program for a scope.
|
|
2327
|
+
*
|
|
2328
|
+
* `PUT /routing/checkout-theme/rules`
|
|
2329
|
+
*
|
|
2330
|
+
* Supersedes rather than overwrites: the previous active version is retired
|
|
2331
|
+
* and a new one stored, so the record of which look was live when survives.
|
|
2332
|
+
* Pass `active: false` to store a revision **without** retiring the live one —
|
|
2333
|
+
* that is where a program drafted against a variant you have not built yet
|
|
2334
|
+
* belongs.
|
|
2335
|
+
*
|
|
2336
|
+
* @example A phone in Germany gets the compact look; everyone else the house style.
|
|
2337
|
+
* ```typescript
|
|
2338
|
+
* await delopay.routing.checkoutThemeRules.upsert({
|
|
2339
|
+
* name: 'Autumn targeting',
|
|
2340
|
+
* profile_id: 'pro_...',
|
|
2341
|
+
* algorithm: {
|
|
2342
|
+
* rules: [
|
|
2343
|
+
* {
|
|
2344
|
+
* name: 'German phones',
|
|
2345
|
+
* connectorSelection: { theme: { variant: 'compact' } },
|
|
2346
|
+
* statements: [
|
|
2347
|
+
* {
|
|
2348
|
+
* condition: [
|
|
2349
|
+
* {
|
|
2350
|
+
* lhs: 'device_class',
|
|
2351
|
+
* comparison: 'equal',
|
|
2352
|
+
* value: { type: 'enum_variant', value: 'phone' },
|
|
2353
|
+
* metadata: {},
|
|
2354
|
+
* },
|
|
2355
|
+
* {
|
|
2356
|
+
* lhs: 'browser_language',
|
|
2357
|
+
* comparison: 'equal',
|
|
2358
|
+
* value: { type: 'enum_variant', value: 'de' },
|
|
2359
|
+
* metadata: {},
|
|
2360
|
+
* },
|
|
2361
|
+
* ],
|
|
2362
|
+
* },
|
|
2363
|
+
* ],
|
|
2364
|
+
* },
|
|
2365
|
+
* ],
|
|
2366
|
+
* defaultSelection: { theme: { variant: 'house' } },
|
|
2367
|
+
* metadata: {},
|
|
2368
|
+
* },
|
|
2369
|
+
* });
|
|
2370
|
+
* ```
|
|
2371
|
+
*/
|
|
2372
|
+
async upsert(params) {
|
|
2373
|
+
return this.request("PUT", "/routing/checkout-theme/rules", { body: params });
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Retrieve the active theme program for a scope, or `null` when none is set.
|
|
2377
|
+
*
|
|
2378
|
+
* `GET /routing/checkout-theme/rules?profile_id={profileId}`
|
|
2379
|
+
*
|
|
2380
|
+
* @param profileId - Shop scope. Omit for the merchant-wide program. A
|
|
2381
|
+
* shop-scoped caller that omits it gets its own shop's program.
|
|
2382
|
+
*/
|
|
2383
|
+
async retrieve(profileId) {
|
|
2384
|
+
return this.request("GET", "/routing/checkout-theme/rules", {
|
|
2385
|
+
query: { profile_id: profileId }
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
/**
|
|
2389
|
+
* Deactivate the active theme program for a scope. Idempotent.
|
|
2390
|
+
*
|
|
2391
|
+
* `DELETE /routing/checkout-theme/rules?profile_id={profileId}`
|
|
2392
|
+
*
|
|
2393
|
+
* Deactivation, not deletion — the stored row is what says which look was
|
|
2394
|
+
* live when, and that history cannot be reconstructed after the fact. Shops
|
|
2395
|
+
* go back to their default appearance immediately.
|
|
2396
|
+
*
|
|
2397
|
+
* @param profileId - Shop scope. Omit for the merchant-wide program.
|
|
2398
|
+
*/
|
|
2399
|
+
async delete(profileId) {
|
|
2400
|
+
return this.request("DELETE", "/routing/checkout-theme/rules", {
|
|
2401
|
+
query: { profile_id: profileId }
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2320
2405
|
|
|
2321
2406
|
// src/resources/search.ts
|
|
2322
2407
|
var Search = class {
|
|
@@ -5886,4 +5971,4 @@ export {
|
|
|
5886
5971
|
focusedCheckoutUrl,
|
|
5887
5972
|
CHECKOUT_EVENT_KINDS
|
|
5888
5973
|
};
|
|
5889
|
-
//# sourceMappingURL=chunk-
|
|
5974
|
+
//# sourceMappingURL=chunk-TSYU2IQK.js.map
|