@delopay/sdk 0.512.0 → 0.514.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/README.md +23 -0
- package/dist/checkoutSession.cjs +2 -2
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/checkoutSession.js +1 -1
- package/dist/chunk-3RRZCT6E.js +1 -0
- package/dist/{chunk-X64WLQT4.js → chunk-ASDC73SO.js} +2 -2
- package/dist/chunk-FS4LIUV7.cjs +1 -0
- package/dist/{chunk-FTWGI7UZ.cjs.map → chunk-FS4LIUV7.cjs.map} +1 -1
- package/dist/{chunk-NBTLJWDQ.cjs → chunk-LLPVB3GT.cjs} +18 -14
- package/dist/chunk-LLPVB3GT.cjs.map +1 -0
- package/dist/{chunk-BF5ETTD6.cjs → chunk-OEZMFX2N.cjs} +3 -3
- package/dist/{chunk-BF5ETTD6.cjs.map → chunk-OEZMFX2N.cjs.map} +1 -1
- package/dist/chunk-P2XLQC7N.cjs +105 -0
- package/dist/chunk-P2XLQC7N.cjs.map +1 -0
- package/dist/{chunk-SC7GAGDL.js → chunk-P5JTNDLM.js} +22 -18
- package/dist/chunk-P5JTNDLM.js.map +1 -0
- package/dist/{chunk-JLGSRUHI.cjs → chunk-SBN6SQZB.cjs} +310 -6
- package/dist/chunk-SBN6SQZB.cjs.map +1 -0
- package/dist/chunk-U7HQMJVU.js +105 -0
- package/dist/chunk-U7HQMJVU.js.map +1 -0
- package/dist/{chunk-HGTNJXXY.js → chunk-ZER47MOF.js} +310 -6
- package/dist/chunk-ZER47MOF.js.map +1 -0
- package/dist/client.cjs +2 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.js +1 -1
- package/dist/index.cjs +20 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +23 -19
- package/dist/internal.cjs +27 -23
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -1
- package/dist/internal.d.ts +2 -1
- package/dist/internal.js +31 -27
- package/dist/internal.js.map +1 -1
- package/dist/resources/coupons.cjs +7 -0
- package/dist/resources/coupons.cjs.map +1 -0
- package/dist/resources/coupons.d.cts +90 -0
- package/dist/resources/coupons.d.ts +90 -0
- package/dist/resources/coupons.js +7 -0
- package/dist/resources/coupons.js.map +1 -0
- package/dist/resources/routing.cjs +2 -2
- package/dist/resources/routing.d.cts +238 -5
- package/dist/resources/routing.d.ts +238 -5
- package/dist/resources/routing.js +1 -1
- package/dist/types.d.cts +1253 -8
- package/dist/types.d.ts +1253 -8
- package/package.json +1 -1
- package/dist/chunk-FTWGI7UZ.cjs +0 -1
- package/dist/chunk-HGTNJXXY.js.map +0 -1
- package/dist/chunk-JLGSRUHI.cjs.map +0 -1
- package/dist/chunk-NBTLJWDQ.cjs.map +0 -1
- package/dist/chunk-SC7GAGDL.js.map +0 -1
- package/dist/chunk-Y5AXZVWN.js +0 -1
- /package/dist/{chunk-Y5AXZVWN.js.map → chunk-3RRZCT6E.js.map} +0 -0
- /package/dist/{chunk-X64WLQT4.js.map → chunk-ASDC73SO.js.map} +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { RequestFn, RequestExtras } from '../core.cjs';
|
|
2
|
+
import { CouponCreateRequest, CouponResponse, CouponListQuery, CouponListResponse, CouponPreviewRequest, CouponPreviewResponse, CouponUpdateRequest, CouponVersionListQuery, CouponVersionListResponse, CouponDuplicateRequest } from '../types.cjs';
|
|
3
|
+
import '../eventStream.cjs';
|
|
4
|
+
import '../error.cjs';
|
|
5
|
+
import '../currencies.cjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The merchant's coupon campaigns: a discount, the currencies it is offered
|
|
9
|
+
* in, its dates and limits, and the shops, products and prices it applies to.
|
|
10
|
+
*
|
|
11
|
+
* **A coupon belongs to the merchant, not to a shop.** Call these routes with
|
|
12
|
+
* a merchant-wide secret key or a dashboard session; a shop-scoped API key is
|
|
13
|
+
* refused with a 401 (`DelopayAuthenticationError`). Shops are narrowed inside
|
|
14
|
+
* the terms, with `eligibility.shop_ids`.
|
|
15
|
+
*
|
|
16
|
+
* A coupon reduces a price; it is not a gift card. Its life is
|
|
17
|
+
* `draft` -> `active` <-> `paused` -> `archived`: `activate`, `pause` and
|
|
18
|
+
* `archive` move it, and an archived coupon can no longer be changed. Each
|
|
19
|
+
* change of its terms makes a new version, and a payment keeps the version it
|
|
20
|
+
* accepted. A coupon is live or test (`test_mode`) for good, fixed when it is
|
|
21
|
+
* created.
|
|
22
|
+
*/
|
|
23
|
+
declare class Coupons {
|
|
24
|
+
private readonly request;
|
|
25
|
+
constructor(request: RequestFn);
|
|
26
|
+
/**
|
|
27
|
+
* Create a coupon. It starts as a draft unless `activate` is `true`.
|
|
28
|
+
* `POST /coupons`
|
|
29
|
+
*
|
|
30
|
+
* A code another coupon of the same mode uses is refused with `IR_38`.
|
|
31
|
+
*/
|
|
32
|
+
create(params: CouponCreateRequest, options?: RequestExtras): Promise<CouponResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* One page of the merchant's coupons of one mode, newest first. Without
|
|
35
|
+
* `test_mode: true` it lists live coupons.
|
|
36
|
+
* `GET /coupons`
|
|
37
|
+
*/
|
|
38
|
+
list(params?: CouponListQuery, options?: RequestExtras): Promise<CouponListResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Work out what terms take off an example amount, and what the merchant
|
|
41
|
+
* should know before activating them, such as shops whose checkout does not
|
|
42
|
+
* offer coupon entry. Nothing is saved.
|
|
43
|
+
* `POST /coupons/preview`
|
|
44
|
+
*/
|
|
45
|
+
preview(params: CouponPreviewRequest, options?: RequestExtras): Promise<CouponPreviewResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve one coupon with its current terms.
|
|
48
|
+
* `GET /coupons/{coupon_id}`
|
|
49
|
+
*/
|
|
50
|
+
retrieve(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Change a coupon's name, description, shared code or terms. Fields left out
|
|
53
|
+
* stay; new `terms` are a new version. Send `expected_version` to have the
|
|
54
|
+
* change refused (`IR_16`) when the coupon moved on since it was read. An
|
|
55
|
+
* archived coupon is refused with `IR_16`, a code in use with `IR_38`.
|
|
56
|
+
* `POST /coupons/{coupon_id}`
|
|
57
|
+
*/
|
|
58
|
+
update(couponId: string, params: CouponUpdateRequest, options?: RequestExtras): Promise<CouponResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* One page of a coupon's versions, newest first, with who wrote each.
|
|
61
|
+
* `GET /coupons/{coupon_id}/versions`
|
|
62
|
+
*/
|
|
63
|
+
versions(couponId: string, params?: CouponVersionListQuery, options?: RequestExtras): Promise<CouponVersionListResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Copy a coupon's terms into a new draft of the same mode. Without `params`
|
|
66
|
+
* the copy takes the original's name and has no shared code.
|
|
67
|
+
* `POST /coupons/{coupon_id}/duplicate`
|
|
68
|
+
*/
|
|
69
|
+
duplicate(couponId: string, params?: CouponDuplicateRequest, options?: RequestExtras): Promise<CouponResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Start a draft or paused coupon. With `valid_from` ahead its status is
|
|
72
|
+
* `scheduled` until then. Any other state is refused with `IR_16`.
|
|
73
|
+
* `POST /coupons/{coupon_id}/activate`
|
|
74
|
+
*/
|
|
75
|
+
activate(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Stop an active coupon until it is activated again. A coupon that is not
|
|
78
|
+
* active is refused with `IR_16`.
|
|
79
|
+
* `POST /coupons/{coupon_id}/pause`
|
|
80
|
+
*/
|
|
81
|
+
pause(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* End a coupon for good and free its code. Its history stays. An archived
|
|
84
|
+
* coupon is refused with `IR_16`.
|
|
85
|
+
* `POST /coupons/{coupon_id}/archive`
|
|
86
|
+
*/
|
|
87
|
+
archive(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { Coupons };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { RequestFn, RequestExtras } from '../core.js';
|
|
2
|
+
import { CouponCreateRequest, CouponResponse, CouponListQuery, CouponListResponse, CouponPreviewRequest, CouponPreviewResponse, CouponUpdateRequest, CouponVersionListQuery, CouponVersionListResponse, CouponDuplicateRequest } from '../types.js';
|
|
3
|
+
import '../eventStream.js';
|
|
4
|
+
import '../error.js';
|
|
5
|
+
import '../currencies.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The merchant's coupon campaigns: a discount, the currencies it is offered
|
|
9
|
+
* in, its dates and limits, and the shops, products and prices it applies to.
|
|
10
|
+
*
|
|
11
|
+
* **A coupon belongs to the merchant, not to a shop.** Call these routes with
|
|
12
|
+
* a merchant-wide secret key or a dashboard session; a shop-scoped API key is
|
|
13
|
+
* refused with a 401 (`DelopayAuthenticationError`). Shops are narrowed inside
|
|
14
|
+
* the terms, with `eligibility.shop_ids`.
|
|
15
|
+
*
|
|
16
|
+
* A coupon reduces a price; it is not a gift card. Its life is
|
|
17
|
+
* `draft` -> `active` <-> `paused` -> `archived`: `activate`, `pause` and
|
|
18
|
+
* `archive` move it, and an archived coupon can no longer be changed. Each
|
|
19
|
+
* change of its terms makes a new version, and a payment keeps the version it
|
|
20
|
+
* accepted. A coupon is live or test (`test_mode`) for good, fixed when it is
|
|
21
|
+
* created.
|
|
22
|
+
*/
|
|
23
|
+
declare class Coupons {
|
|
24
|
+
private readonly request;
|
|
25
|
+
constructor(request: RequestFn);
|
|
26
|
+
/**
|
|
27
|
+
* Create a coupon. It starts as a draft unless `activate` is `true`.
|
|
28
|
+
* `POST /coupons`
|
|
29
|
+
*
|
|
30
|
+
* A code another coupon of the same mode uses is refused with `IR_38`.
|
|
31
|
+
*/
|
|
32
|
+
create(params: CouponCreateRequest, options?: RequestExtras): Promise<CouponResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* One page of the merchant's coupons of one mode, newest first. Without
|
|
35
|
+
* `test_mode: true` it lists live coupons.
|
|
36
|
+
* `GET /coupons`
|
|
37
|
+
*/
|
|
38
|
+
list(params?: CouponListQuery, options?: RequestExtras): Promise<CouponListResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Work out what terms take off an example amount, and what the merchant
|
|
41
|
+
* should know before activating them, such as shops whose checkout does not
|
|
42
|
+
* offer coupon entry. Nothing is saved.
|
|
43
|
+
* `POST /coupons/preview`
|
|
44
|
+
*/
|
|
45
|
+
preview(params: CouponPreviewRequest, options?: RequestExtras): Promise<CouponPreviewResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve one coupon with its current terms.
|
|
48
|
+
* `GET /coupons/{coupon_id}`
|
|
49
|
+
*/
|
|
50
|
+
retrieve(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Change a coupon's name, description, shared code or terms. Fields left out
|
|
53
|
+
* stay; new `terms` are a new version. Send `expected_version` to have the
|
|
54
|
+
* change refused (`IR_16`) when the coupon moved on since it was read. An
|
|
55
|
+
* archived coupon is refused with `IR_16`, a code in use with `IR_38`.
|
|
56
|
+
* `POST /coupons/{coupon_id}`
|
|
57
|
+
*/
|
|
58
|
+
update(couponId: string, params: CouponUpdateRequest, options?: RequestExtras): Promise<CouponResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* One page of a coupon's versions, newest first, with who wrote each.
|
|
61
|
+
* `GET /coupons/{coupon_id}/versions`
|
|
62
|
+
*/
|
|
63
|
+
versions(couponId: string, params?: CouponVersionListQuery, options?: RequestExtras): Promise<CouponVersionListResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Copy a coupon's terms into a new draft of the same mode. Without `params`
|
|
66
|
+
* the copy takes the original's name and has no shared code.
|
|
67
|
+
* `POST /coupons/{coupon_id}/duplicate`
|
|
68
|
+
*/
|
|
69
|
+
duplicate(couponId: string, params?: CouponDuplicateRequest, options?: RequestExtras): Promise<CouponResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Start a draft or paused coupon. With `valid_from` ahead its status is
|
|
72
|
+
* `scheduled` until then. Any other state is refused with `IR_16`.
|
|
73
|
+
* `POST /coupons/{coupon_id}/activate`
|
|
74
|
+
*/
|
|
75
|
+
activate(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Stop an active coupon until it is activated again. A coupon that is not
|
|
78
|
+
* active is refused with `IR_16`.
|
|
79
|
+
* `POST /coupons/{coupon_id}/pause`
|
|
80
|
+
*/
|
|
81
|
+
pause(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* End a coupon for good and free its code. Its history stays. An archived
|
|
84
|
+
* coupon is refused with `IR_16`.
|
|
85
|
+
* `POST /coupons/{coupon_id}/archive`
|
|
86
|
+
*/
|
|
87
|
+
archive(couponId: string, options?: RequestExtras): Promise<CouponResponse>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { Coupons };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSBN6SQZBcjs = require('../chunk-SBN6SQZB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.Routing =
|
|
6
|
+
exports.Routing = _chunkSBN6SQZBcjs.Routing;
|
|
7
7
|
//# sourceMappingURL=routing.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SurchargeRuleRequest, SurchargeRuleResponse, CheckoutThemeProgramRequest, CheckoutThemeProgramResponse, CheckoutThemeConversionQuery, CheckoutThemeConversionResponse, RoutingConfigCreateRequest, RoutingDictionaryRecord, MerchantRoutingAlgorithm, RoutingActivatePayload, RoutingDeactivateRequest, RoutingConfigUpdateRequest, RoutingConfigDeleteResponse, RoutingHistoryParams, RoutingConfigHistoryResponse, RoutingConnectorCaps, RoutingConnectorCapSchedule, RoutingConnectorCapScheduleShuffle, RoutingTimePlanDocument, RoutingVolumeCounters, RoutingConnectorCapResetRequest, RoutingConnectorCapReset, ConnectorCapOverrideList, ConnectorCapOverrides, ConnectorCapOverrideLevel, ConnectorCapOverrideRequest, ConnectorCapOverride, RoutingDictionary, ProfileDeniedConnectorsResponse, LinkedRoutingConfigRetrieveResponse, RoutableConnectorChoice, ProfileDefaultRoutingConfig, DefaultRoutingConfigUpdate, RoutingRuleKeys, ProgramConnectorSelection, RoutingProgramAnalysis } from '../types.cjs';
|
|
1
|
+
import { SurchargeRuleRequest, SurchargeRuleResponse, CheckoutThemeProgramRequest, CheckoutThemeProgramResponse, ThemeProgramDeactivateResponse, CheckoutThemeConversionQuery, CheckoutThemeConversionResponse, ExperimentScopeQuery, ExperimentListResponse, ExperimentCreateRequest, ExperimentChangeResponse, ExperimentResponse, ExperimentUpdateRequest, ExperimentReorderRequest, ExperimentPreviewRequest, ExperimentPreviewResponse, ExperimentTransitionRequest, ExperimentEndRequest, ExperimentRestartRequest, ExperimentEventsResponse, ExperimentResultsQuery, ExperimentResultsResponse, ExperimentResultsSummaryQuery, ExperimentResultsSummaryResponse, TargetingSimulateRequest, TargetingSimulateResponse, TargetingCapabilitiesResponse, RoutingConfigCreateRequest, RoutingDictionaryRecord, MerchantRoutingAlgorithm, RoutingActivatePayload, RoutingDeactivateRequest, RoutingConfigUpdateRequest, RoutingConfigDeleteResponse, RoutingHistoryParams, RoutingConfigHistoryResponse, RoutingConnectorCaps, RoutingConnectorCapSchedule, RoutingConnectorCapScheduleShuffle, RoutingTimePlanDocument, RoutingVolumeCounters, RoutingConnectorCapResetRequest, RoutingConnectorCapReset, ConnectorCapOverrideList, ConnectorCapOverrides, ConnectorCapOverrideLevel, ConnectorCapOverrideRequest, ConnectorCapOverride, RoutingDictionary, ProfileDeniedConnectorsResponse, LinkedRoutingConfigRetrieveResponse, RoutableConnectorChoice, ProfileDefaultRoutingConfig, DefaultRoutingConfigUpdate, RoutingRuleKeys, ProgramConnectorSelection, RoutingProgramAnalysis } from '../types.cjs';
|
|
2
2
|
import { RequestFn, RequestExtras } from '../core.cjs';
|
|
3
3
|
import '../currencies.cjs';
|
|
4
4
|
import '../eventStream.cjs';
|
|
@@ -19,6 +19,10 @@ declare class Routing {
|
|
|
19
19
|
readonly checkoutThemeRules: CheckoutThemeRules;
|
|
20
20
|
/** Rendered-to-paid conversion per appearance variant and segment. */
|
|
21
21
|
readonly checkoutThemeConversion: CheckoutThemeConversion;
|
|
22
|
+
/** Look tests: two or more looks shown to one audience at random, by shares, with results. */
|
|
23
|
+
readonly checkoutExperiments: CheckoutExperiments;
|
|
24
|
+
/** What a described buyer would see, and what this deployment can do for a scope. */
|
|
25
|
+
readonly checkoutTargeting: CheckoutTargeting;
|
|
22
26
|
constructor(request: RequestFn);
|
|
23
27
|
/**
|
|
24
28
|
* Create a new routing algorithm.
|
|
@@ -431,6 +435,11 @@ declare class CheckoutThemeRules {
|
|
|
431
435
|
* that is where a program drafted against a variant you have not built yet
|
|
432
436
|
* belongs.
|
|
433
437
|
*
|
|
438
|
+
* Send the `revision` the last read answered (`"0:0"` when it answered
|
|
439
|
+
* `null`): the save is then refused with `IR_16` when the scope's rules
|
|
440
|
+
* changed since, instead of overwriting someone else's edit. Without it the
|
|
441
|
+
* save replaces whatever is stored.
|
|
442
|
+
*
|
|
434
443
|
* @example A phone in Germany gets the compact look; everyone else the house style.
|
|
435
444
|
* ```typescript
|
|
436
445
|
* await delopay.routing.checkoutThemeRules.upsert({
|
|
@@ -469,7 +478,9 @@ declare class CheckoutThemeRules {
|
|
|
469
478
|
*/
|
|
470
479
|
upsert(params: CheckoutThemeProgramRequest): Promise<CheckoutThemeProgramResponse>;
|
|
471
480
|
/**
|
|
472
|
-
* Retrieve the
|
|
481
|
+
* Retrieve the theme program of a scope: the one in force, else the newest
|
|
482
|
+
* one (switched off or saved as a draft, `is_active: false`), or `null` when
|
|
483
|
+
* the scope never had one. Its `revision` goes back on the next save.
|
|
473
484
|
*
|
|
474
485
|
* `GET /routing/checkout-theme/rules?profile_id={profileId}`
|
|
475
486
|
*
|
|
@@ -478,17 +489,22 @@ declare class CheckoutThemeRules {
|
|
|
478
489
|
*/
|
|
479
490
|
retrieve(profileId?: string): Promise<CheckoutThemeProgramResponse | null>;
|
|
480
491
|
/**
|
|
481
|
-
* Deactivate the active theme program for a scope. Idempotent
|
|
492
|
+
* Deactivate the active theme program for a scope. Idempotent without
|
|
493
|
+
* `revision`. The program stays readable, switched off. Answers the scope's
|
|
494
|
+
* new `revision`, to send with the next save or switch-off.
|
|
482
495
|
*
|
|
483
|
-
* `DELETE /routing/checkout-theme/rules?profile_id={profileId}`
|
|
496
|
+
* `DELETE /routing/checkout-theme/rules?profile_id={profileId}&revision={revision}`
|
|
484
497
|
*
|
|
485
498
|
* Deactivation, not deletion — the stored row is what says which look was
|
|
486
499
|
* live when, and that history cannot be reconstructed after the fact. Shops
|
|
487
500
|
* go back to their default appearance immediately.
|
|
488
501
|
*
|
|
489
502
|
* @param profileId - Shop scope. Omit for the merchant-wide program.
|
|
503
|
+
* @param revision - The `revision` the last read answered. Switching off is
|
|
504
|
+
* then refused with `IR_16` when the rules changed since. Omit it to switch
|
|
505
|
+
* off whatever is in force.
|
|
490
506
|
*/
|
|
491
|
-
delete(profileId?: string): Promise<
|
|
507
|
+
delete(profileId?: string, revision?: string): Promise<ThemeProgramDeactivateResponse>;
|
|
492
508
|
}
|
|
493
509
|
/**
|
|
494
510
|
* Rendered-to-paid conversion, per appearance variant and segment.
|
|
@@ -541,5 +557,222 @@ declare class CheckoutThemeConversion {
|
|
|
541
557
|
*/
|
|
542
558
|
retrieve(params: CheckoutThemeConversionQuery): Promise<CheckoutThemeConversionResponse>;
|
|
543
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* Look tests: show the buyers of one audience one of two or more looks at
|
|
562
|
+
* random, by shares you set, and read which converts better.
|
|
563
|
+
*
|
|
564
|
+
* A test belongs to a shop, or to a checkout template and then runs in every
|
|
565
|
+
* shop on that template. Each buyer stays on the look first drawn for them:
|
|
566
|
+
* per browser by default, or per payment. A buyer whose link names a look
|
|
567
|
+
* (`?theme=`, a checkout entry's look) sees that look and is counted as drawn
|
|
568
|
+
* but not shown. Within a scope, the first running test whose audience takes
|
|
569
|
+
* a buyer decides; a shop's own tests come before its template's.
|
|
570
|
+
*
|
|
571
|
+
* Every change sends the `revision` the test was read at, and a test changed
|
|
572
|
+
* since is refused with `IR_16`, so a stale page never overwrites a newer
|
|
573
|
+
* edit. Each change answers with an {@link ExperimentChangeResponse}: the test
|
|
574
|
+
* as it now stands, whether a new version began, and the share of returning
|
|
575
|
+
* buyers whose look moved.
|
|
576
|
+
*
|
|
577
|
+
* Reads need checkout-branding read access; creating, editing, reordering and
|
|
578
|
+
* deleting a draft need edit access; starting, pausing, resuming, ending,
|
|
579
|
+
* restarting and archiving need write access.
|
|
580
|
+
*/
|
|
581
|
+
declare class CheckoutExperiments {
|
|
582
|
+
private readonly request;
|
|
583
|
+
constructor(request: RequestFn);
|
|
584
|
+
/**
|
|
585
|
+
* The tests of a shop or template, in their order, with what an arm may name.
|
|
586
|
+
*
|
|
587
|
+
* `GET /routing/checkout-theme/experiments`
|
|
588
|
+
*
|
|
589
|
+
* For a shop on a template, the template's tests come back in `inherited`:
|
|
590
|
+
* they run in the shop after the shop's own, and are changed on the template.
|
|
591
|
+
*/
|
|
592
|
+
list(params?: ExperimentScopeQuery): Promise<ExperimentListResponse>;
|
|
593
|
+
/**
|
|
594
|
+
* Create a test as a draft. Nothing is shown to buyers until it is started.
|
|
595
|
+
*
|
|
596
|
+
* `POST /routing/checkout-theme/experiments`
|
|
597
|
+
*
|
|
598
|
+
* A definition that cannot be stored (fewer than two arms, shares that do not
|
|
599
|
+
* add up to 10 000, an unknown control arm) is refused with a 400 naming why;
|
|
600
|
+
* a scope that holds the most tests it may is refused with `IR_16`.
|
|
601
|
+
*
|
|
602
|
+
* @example Half the phones in Germany see the compact look, half what they see today.
|
|
603
|
+
* ```typescript
|
|
604
|
+
* const { experiment } = await delopay.routing.checkoutExperiments.create({
|
|
605
|
+
* profile_id: 'pro_...',
|
|
606
|
+
* name: 'Compact on German phones',
|
|
607
|
+
* audience: { devices: ['phone'], countries: { countries: ['DE'] } },
|
|
608
|
+
* arms: [
|
|
609
|
+
* { key: 'current', look: null, share_bp: 5000 },
|
|
610
|
+
* { key: 'compact', look: 'compact', share_bp: 5000 },
|
|
611
|
+
* ],
|
|
612
|
+
* control_arm: 'current',
|
|
613
|
+
* });
|
|
614
|
+
* await delopay.routing.checkoutExperiments.start(experiment.id, {
|
|
615
|
+
* revision: experiment.revision,
|
|
616
|
+
* });
|
|
617
|
+
* ```
|
|
618
|
+
*/
|
|
619
|
+
create(params: ExperimentCreateRequest): Promise<ExperimentChangeResponse>;
|
|
620
|
+
/**
|
|
621
|
+
* Retrieve one test.
|
|
622
|
+
*
|
|
623
|
+
* `GET /routing/checkout-theme/experiments/{experiment_id}`
|
|
624
|
+
*/
|
|
625
|
+
retrieve(experimentId: string): Promise<ExperimentResponse>;
|
|
626
|
+
/**
|
|
627
|
+
* Change a test. Fields left out stay as they are.
|
|
628
|
+
*
|
|
629
|
+
* `PATCH /routing/checkout-theme/experiments/{experiment_id}`
|
|
630
|
+
*
|
|
631
|
+
* Once a test has started, a change to the audience, the arms, the control or
|
|
632
|
+
* the unit begins a new version and needs `new_version: true`; the results of
|
|
633
|
+
* each version stay apart. Use {@link CheckoutExperiments.preview} first to
|
|
634
|
+
* see what the change would do.
|
|
635
|
+
*/
|
|
636
|
+
update(experimentId: string, params: ExperimentUpdateRequest): Promise<ExperimentChangeResponse>;
|
|
637
|
+
/**
|
|
638
|
+
* Delete a draft that never started. Anything else is refused with `IR_16`:
|
|
639
|
+
* archive it instead.
|
|
640
|
+
*
|
|
641
|
+
* `DELETE /routing/checkout-theme/experiments/{experiment_id}?revision={revision}`
|
|
642
|
+
*
|
|
643
|
+
* @param revision - The `revision` the test was read at.
|
|
644
|
+
*/
|
|
645
|
+
delete(experimentId: string, revision: number): Promise<void>;
|
|
646
|
+
/**
|
|
647
|
+
* Set the order of a scope's tests: the first whose audience takes a buyer
|
|
648
|
+
* decides. Names every test of the scope that is not archived.
|
|
649
|
+
*
|
|
650
|
+
* `POST /routing/checkout-theme/experiments/reorder`
|
|
651
|
+
*
|
|
652
|
+
* Send the list's `order_token`: a reorder made on an order someone else
|
|
653
|
+
* changed since is then refused with `IR_16` instead of replacing theirs.
|
|
654
|
+
*/
|
|
655
|
+
reorder(params: ExperimentReorderRequest): Promise<ExperimentListResponse>;
|
|
656
|
+
/**
|
|
657
|
+
* What a create or a change would do, without saving it: why it would be
|
|
658
|
+
* refused, the warnings the test would carry and, for a started test,
|
|
659
|
+
* whether it begins a new version and how many returning buyers it moves.
|
|
660
|
+
*
|
|
661
|
+
* `POST /routing/checkout-theme/experiments/preview`
|
|
662
|
+
*/
|
|
663
|
+
preview(params: ExperimentPreviewRequest): Promise<ExperimentPreviewResponse>;
|
|
664
|
+
/**
|
|
665
|
+
* Start a draft. It draws buyers from its `starts_at`, or at once without one.
|
|
666
|
+
*
|
|
667
|
+
* `POST /routing/checkout-theme/experiments/{experiment_id}/start`
|
|
668
|
+
*/
|
|
669
|
+
start(experimentId: string, params: ExperimentTransitionRequest): Promise<ExperimentChangeResponse>;
|
|
670
|
+
/**
|
|
671
|
+
* Pause a started test: its audience sees what it would without the test.
|
|
672
|
+
*
|
|
673
|
+
* `POST /routing/checkout-theme/experiments/{experiment_id}/pause`
|
|
674
|
+
*/
|
|
675
|
+
pause(experimentId: string, params: ExperimentTransitionRequest): Promise<ExperimentChangeResponse>;
|
|
676
|
+
/**
|
|
677
|
+
* Resume a paused test. Returning buyers keep the look drawn for them.
|
|
678
|
+
*
|
|
679
|
+
* `POST /routing/checkout-theme/experiments/{experiment_id}/resume`
|
|
680
|
+
*/
|
|
681
|
+
resume(experimentId: string, params: ExperimentTransitionRequest): Promise<ExperimentChangeResponse>;
|
|
682
|
+
/**
|
|
683
|
+
* End a test. With `keep_arm`, its audience keeps seeing that arm's look;
|
|
684
|
+
* without it, what it would see without the test.
|
|
685
|
+
*
|
|
686
|
+
* `POST /routing/checkout-theme/experiments/{experiment_id}/end`
|
|
687
|
+
*/
|
|
688
|
+
end(experimentId: string, params: ExperimentEndRequest): Promise<ExperimentChangeResponse>;
|
|
689
|
+
/**
|
|
690
|
+
* Start an ended test again, as a new version, optionally changing what it
|
|
691
|
+
* compares in the same step.
|
|
692
|
+
*
|
|
693
|
+
* `POST /routing/checkout-theme/experiments/{experiment_id}/restart`
|
|
694
|
+
*/
|
|
695
|
+
restart(experimentId: string, params: ExperimentRestartRequest): Promise<ExperimentChangeResponse>;
|
|
696
|
+
/**
|
|
697
|
+
* Put a draft or an ended test away. Its results stay readable. A test that
|
|
698
|
+
* is scheduled, running or paused is refused with `IR_16`: end it first.
|
|
699
|
+
*
|
|
700
|
+
* `POST /routing/checkout-theme/experiments/{experiment_id}/archive`
|
|
701
|
+
*/
|
|
702
|
+
archive(experimentId: string, params: ExperimentTransitionRequest): Promise<ExperimentChangeResponse>;
|
|
703
|
+
/**
|
|
704
|
+
* A test's history: who created, changed, started, paused, ended or moved it.
|
|
705
|
+
*
|
|
706
|
+
* `GET /routing/checkout-theme/experiments/{experiment_id}/events`
|
|
707
|
+
*/
|
|
708
|
+
events(experimentId: string): Promise<ExperimentEventsResponse>;
|
|
709
|
+
/**
|
|
710
|
+
* A test's results for one version and one environment.
|
|
711
|
+
*
|
|
712
|
+
* `GET /routing/checkout-theme/experiments/{experiment_id}/results`
|
|
713
|
+
*
|
|
714
|
+
* Rates, intervals, verdicts and the sample-ratio check are computed
|
|
715
|
+
* server-side and shipped as values: show them as they are rather than
|
|
716
|
+
* recomputing them. A 404 means no such test or version, or a test that has
|
|
717
|
+
* not started.
|
|
718
|
+
*
|
|
719
|
+
* @example
|
|
720
|
+
* ```typescript
|
|
721
|
+
* const results = await delopay.routing.checkoutExperiments.results('cexp_...', {
|
|
722
|
+
* segment: 'device',
|
|
723
|
+
* });
|
|
724
|
+
* for (const c of results.comparisons) {
|
|
725
|
+
* if (c.verdict === 'better') console.log(`${c.arm} converts better than ${c.control_arm}`);
|
|
726
|
+
* }
|
|
727
|
+
* ```
|
|
728
|
+
*/
|
|
729
|
+
results(experimentId: string, params?: ExperimentResultsQuery): Promise<ExperimentResultsResponse>;
|
|
730
|
+
/**
|
|
731
|
+
* Every started, not archived test of a shop or template, in brief: the
|
|
732
|
+
* version in force, its counts, and the arm clearly ahead, if any.
|
|
733
|
+
*
|
|
734
|
+
* `GET /routing/checkout-theme/experiments/results-summary`
|
|
735
|
+
*/
|
|
736
|
+
resultsSummary(params?: ExperimentResultsSummaryQuery): Promise<ExperimentResultsSummaryResponse>;
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Which look a buyer would see, and why, and what look targeting can do in
|
|
740
|
+
* this deployment.
|
|
741
|
+
*/
|
|
742
|
+
declare class CheckoutTargeting {
|
|
743
|
+
private readonly request;
|
|
744
|
+
constructor(request: RequestFn);
|
|
745
|
+
/**
|
|
746
|
+
* What a described buyer would see in a shop or template, and why: the look
|
|
747
|
+
* the link names, the tests in their order, the look rules, the look for the
|
|
748
|
+
* kind of payment, the default. Reads what is stored now and writes nothing;
|
|
749
|
+
* a test answers with its arms rather than drawing one.
|
|
750
|
+
*
|
|
751
|
+
* `POST /routing/checkout-theme/simulate`
|
|
752
|
+
*
|
|
753
|
+
* Pass `program` to try look rules before saving them: they stand in for the
|
|
754
|
+
* stored rules of their scope for this dry run only.
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
757
|
+
* ```typescript
|
|
758
|
+
* const outcome = await delopay.routing.checkoutTargeting.simulate({
|
|
759
|
+
* profile_id: 'pro_...',
|
|
760
|
+
* device: 'phone',
|
|
761
|
+
* country: 'DE',
|
|
762
|
+
* });
|
|
763
|
+
* console.log(outcome.source, outcome.look ?? 'default look');
|
|
764
|
+
* ```
|
|
765
|
+
*/
|
|
766
|
+
simulate(params: TargetingSimulateRequest): Promise<TargetingSimulateResponse>;
|
|
767
|
+
/**
|
|
768
|
+
* Whether looks are chosen at render, whether renders are measured, whether
|
|
769
|
+
* buyer signals and browser identity are available, and the test limits.
|
|
770
|
+
*
|
|
771
|
+
* `GET /routing/checkout-theme/capabilities?profile_id={profileId}`
|
|
772
|
+
*
|
|
773
|
+
* @param profileId - The shop or template. A shop-scoped caller may omit it.
|
|
774
|
+
*/
|
|
775
|
+
capabilities(profileId?: string): Promise<TargetingCapabilitiesResponse>;
|
|
776
|
+
}
|
|
544
777
|
|
|
545
778
|
export { Routing };
|