@encorekit/web-sdk 2.0.0 → 2.0.2
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 +104 -95
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/encore.min.js +1 -1
- package/dist/umd/encore.min.js.map +1 -1
- package/package.json +1 -1
- package/types/analytics/events.d.ts +7 -28
- package/types/analytics/events.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +10 -6
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/models.d.ts +8 -3
- package/types/api/models.d.ts.map +1 -1
- package/types/core/Configuration.d.ts +0 -4
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts +8 -33
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/PlacementBuilder.d.ts +7 -31
- package/types/core/PlacementBuilder.d.ts.map +1 -1
- package/types/core/useCase.d.ts +54 -13
- package/types/core/useCase.d.ts.map +1 -1
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +85 -272
- package/types/types.d.ts.map +1 -1
- package/types/ui/OfferCarousel.d.ts +59 -1
- package/types/ui/OfferCarousel.d.ts.map +1 -1
- package/types/ui/RewardActions.d.ts +60 -0
- package/types/ui/RewardActions.d.ts.map +1 -0
- package/types/ui/RewardCard.d.ts +49 -0
- package/types/ui/RewardCard.d.ts.map +1 -0
- package/types/ui/RewardConfetti.d.ts +46 -0
- package/types/ui/RewardConfetti.d.ts.map +1 -0
- package/types/ui/RewardLayout.d.ts +55 -0
- package/types/ui/RewardLayout.d.ts.map +1 -0
- package/types/ui/brandTint.d.ts +61 -0
- package/types/ui/brandTint.d.ts.map +1 -0
- package/types/ui/styles.d.ts +96 -0
- package/types/ui/styles.d.ts.map +1 -1
- package/types/utils/text.d.ts +24 -0
- package/types/utils/text.d.ts.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/analytics/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/analytics/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAOxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AA+BX;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGrF;AAMD,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,cAAc,CAMhB;AAED,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,cAAc,CAMhB;AA0CD,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,GAChB,cAAc,CAMhB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,O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APIClient.d.ts
CHANGED
|
@@ -51,9 +51,12 @@ export declare class APIClient {
|
|
|
51
51
|
offers: OfferModel[];
|
|
52
52
|
}>;
|
|
53
53
|
/**
|
|
54
|
-
* Start a transaction for an offer. `useCase` is omitted for '
|
|
54
|
+
* Start a transaction for an offer. `useCase` is omitted for `'reduceChurn'` (the
|
|
55
55
|
* contract's own default) rather than sent explicitly, keeping the wire payload
|
|
56
56
|
* byte-identical to before this dimension existed for every existing caller.
|
|
57
|
+
*
|
|
58
|
+
* When it IS sent it carries the WIRE value (`post-action-reward`), never the
|
|
59
|
+
* public symbol — see `core/useCase.ts`.
|
|
57
60
|
*/
|
|
58
61
|
startTransaction(campaignId: string, userId: string, useCase?: UseCase): Promise<StartTransactionResponse>;
|
|
59
62
|
/**
|
|
@@ -89,14 +92,15 @@ export declare class APIClient {
|
|
|
89
92
|
* Fetch remote config.
|
|
90
93
|
*
|
|
91
94
|
* `useCase` selects which SURFACE the response's `ui` block resolves, and the
|
|
92
|
-
* response echoes it back as `ui.useCase
|
|
93
|
-
* `
|
|
94
|
-
* configure()-time fetch stays
|
|
95
|
-
*
|
|
95
|
+
* response echoes it back as `ui.useCase` — both in WIRE values (see
|
|
96
|
+
* `core/useCase.ts`). The param is deliberately OMITTED for both `undefined` and
|
|
97
|
+
* an explicit `'reduceChurn'`, so the eager configure()-time fetch stays
|
|
98
|
+
* byte-identical to every pre-use-case SDK — the same convention
|
|
99
|
+
* `startTransaction` already uses for this dimension.
|
|
96
100
|
*
|
|
97
101
|
* Two callers, two very different requests:
|
|
98
102
|
* - The EAGER fetch (once, at configure()) passes no use case. Its response
|
|
99
|
-
* carries
|
|
103
|
+
* carries reduceChurn in `ui` PLUS the `useCases` prefetch block.
|
|
100
104
|
* - The LAZY fetch (at most once per use case, only when the block did not
|
|
101
105
|
* carry it) passes one. Its response resolves that surface in `ui`
|
|
102
106
|
* INCLUDING experiments — which the prefetch block, carrying only default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIClient.d.ts","sourceRoot":"","sources":["../../src/api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAe,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEtG,OAAO,KAAK,EAEV,wBAAwB,EAIxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,yBAAyB,EAC1B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"APIClient.d.ts","sourceRoot":"","sources":["../../src/api/APIClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAe,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEtG,OAAO,KAAK,EAEV,wBAAwB,EAIxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AASlB,UAAU,cAAc;IACtB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAQD,qBAAa,SAAS;;gBAKR,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAM3C;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACG,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAW7E;;OAEG;IACG,IAAI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E,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7C,OAAO,CAAC,oBAAoB,CAAC;IAchC;;;;;;;;;;;;;;;;;OAiBG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,oBAAoB,CAAC;IAehC;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBjB;;OAEG;IACG,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAW3D"}
|
package/types/api/models.d.ts
CHANGED
|
@@ -29,9 +29,14 @@ export interface OfferModel {
|
|
|
29
29
|
merchantName?: string;
|
|
30
30
|
logoUrl?: string;
|
|
31
31
|
/**
|
|
32
|
-
* Campaign-level perk line, e.g. "Enjoy 30 days of Apple Music free".
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* Campaign-level perk line, e.g. "Enjoy 30 days of Apple Music free". Only set
|
|
33
|
+
* when non-empty.
|
|
34
|
+
*
|
|
35
|
+
* ⚠️ Currently UNRENDERED. It fed the paged carousel's per-card context
|
|
36
|
+
* subtitle, which lives in the carousel's own header — and the only paged
|
|
37
|
+
* consumer left (the reward composition) suppresses that header. The plumbing
|
|
38
|
+
* in `OfferCarousel.#contextSubtitleFor` is intact and correct; nothing reaches
|
|
39
|
+
* it today.
|
|
35
40
|
*/
|
|
36
41
|
perk?: string;
|
|
37
42
|
instructions?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/api/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,QAAQ,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,YAAY,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAM9C,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/api/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,QAAQ,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,YAAY,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,QA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hE,mCAAmC;AACnC,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;AAEpE,gDAAgD;AAChD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,cAAc,CAAC;AAE1D,sEAAsE;AACtE,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;AAEnF,kCAAkC;AAClC,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,QAAQ,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAC9C,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,0BAA0B,CAAC;AAE7E,4BAA4B;AAC5B,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,gBAAgB,CAAC;AAEzD,sCAAsC;AACtC,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC;AAEjE,4BAA4B;AAC5B,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,cAAc,CAAC;AAM3D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -34,10 +34,6 @@ export declare class Configuration {
|
|
|
34
34
|
* Get environment
|
|
35
35
|
*/
|
|
36
36
|
getEnvironment(): string | null;
|
|
37
|
-
/**
|
|
38
|
-
* Get the redemption mode ('deferred' default, or 'immediate' for the legacy flow)
|
|
39
|
-
*/
|
|
40
|
-
getRedemptionMode(): 'deferred' | 'immediate';
|
|
41
37
|
/**
|
|
42
38
|
* Reset configuration (primarily for testing)
|
|
43
39
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/core/Configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAQ7C,qBAAa,aAAa;;IAIxB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/core/Configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAQ7C,qBAAa,aAAa;;IAIxB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO;IA0FxC;;OAEG;IACH,SAAS,IAAI,YAAY,GAAG,IAAI;IAIhC;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,UAAU,IAAI,MAAM,GAAG,IAAI;IAI3B;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd"}
|
package/types/core/Encore.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Main Encore SDK Class
|
|
3
3
|
* Singleton class that serves as the public API entry point
|
|
4
4
|
*/
|
|
5
|
-
import type { EncoreConfig, UserAttributes, EntitlementType, EntitlementScope, EventHandler, Unsubscribe, PresentationOptions, PresentationResult, PlacementOptions, VerificationStatus, PlacementBuilder as IPlacementBuilder,
|
|
5
|
+
import type { EncoreConfig, UserAttributes, EntitlementType, EntitlementScope, EventHandler, Unsubscribe, PresentationOptions, PresentationResult, PlacementOptions, VerificationStatus, PlacementBuilder as IPlacementBuilder, ShowResult } from '../types';
|
|
6
6
|
import type { NCLExperimentState } from '../experiments/types';
|
|
7
7
|
export declare class EncoreSDK {
|
|
8
8
|
#private;
|
|
@@ -53,7 +53,6 @@ export declare class EncoreSDK {
|
|
|
53
53
|
baseURL: string;
|
|
54
54
|
analyticsBaseURL: string;
|
|
55
55
|
logLevel: string;
|
|
56
|
-
redemptionMode: 'deferred' | 'immediate';
|
|
57
56
|
} | null;
|
|
58
57
|
/**
|
|
59
58
|
* Read-only snapshot of the NCL (Net Conversion Lift) experiment state, or
|
|
@@ -82,44 +81,20 @@ export declare class EncoreSDK {
|
|
|
82
81
|
*/
|
|
83
82
|
getUserAttributes(): UserAttributes;
|
|
84
83
|
/**
|
|
85
|
-
* Show offers to the user
|
|
84
|
+
* Show offers to the user.
|
|
86
85
|
*
|
|
87
|
-
* Resolves when the user
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* one-step flow runs (redirect + success screen inline). Resolves 'dismissed' if
|
|
91
|
-
* the user closes the carousel, or 'unavailable' if there are no eligible offers.
|
|
86
|
+
* Resolves 'claimed' when the user claims an offer (a transaction is recorded and
|
|
87
|
+
* the advertiser opens in a new tab), 'dismissed' if the user closes the carousel,
|
|
88
|
+
* or 'unavailable' if there are no eligible offers.
|
|
92
89
|
*
|
|
93
|
-
* @param placementId Optional placement key —
|
|
94
|
-
* `placement(id).redeem()` can resolve exactly this transaction later.
|
|
90
|
+
* @param placementId Optional placement key — attributed on the offers request.
|
|
95
91
|
*/
|
|
96
92
|
show(options?: PresentationOptions, placementOptions?: PlacementOptions, placementId?: string): Promise<ShowResult>;
|
|
97
93
|
/**
|
|
98
|
-
* @deprecated Use `show()
|
|
99
|
-
*
|
|
100
|
-
* In 'deferred' mode a transaction resolves here as not-granted (no redirect yet) —
|
|
101
|
-
* migrate to `show()`/`redeem()` for the two-phase flow.
|
|
94
|
+
* @deprecated Use `show()`. Kept for back-compat; maps the `ShowResult` onto the
|
|
95
|
+
* legacy `PresentationResult`.
|
|
102
96
|
*/
|
|
103
97
|
presentOffer(options?: PresentationOptions, placementOptions?: PlacementOptions): Promise<PresentationResult>;
|
|
104
|
-
/**
|
|
105
|
-
* Redeem a previously-claimed offer — phase 2 of the two-phase flow. Call this
|
|
106
|
-
* after your own conversion succeeds. Renders the redemption screen for the
|
|
107
|
-
* pending transaction; on the user's CTA tap it sends them to the advertiser (the
|
|
108
|
-
* redirect fires inside that gesture, dodging popup blockers) and emits the
|
|
109
|
-
* provisional grant.
|
|
110
|
-
*
|
|
111
|
-
* Transaction resolution (internal — no handle crosses the API): `placement`
|
|
112
|
-
* resolves the transaction made at THAT placement (never crossing placements →
|
|
113
|
-
* `none` if absent); else the single most-recent transaction for this user.
|
|
114
|
-
*/
|
|
115
|
-
redeem(options?: RedeemOptions): Promise<RedeemResult>;
|
|
116
|
-
/**
|
|
117
|
-
* The pending (unredeemed) transaction for this user, resolved like redeem() but
|
|
118
|
-
* without showing any UI — lets a host check whether there's something to redeem
|
|
119
|
-
* and render its own CTA. Local-only for P0 (server recovery by app_account_id
|
|
120
|
-
* lands in P1). Pass a placement id to scope to that placement's transaction.
|
|
121
|
-
*/
|
|
122
|
-
getPendingTransaction(placementId?: string): Transaction | null;
|
|
123
98
|
/**
|
|
124
99
|
* @deprecated Client-side entitlement validation removed for security.
|
|
125
100
|
* Check entitlements on your server by calling Encore's server-side API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Encore.d.ts","sourceRoot":"","sources":["../../src/core/Encore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAEhB,kBAAkB,EAElB,gBAAgB,IAAI,iBAAiB,EACrC,
|
|
1
|
+
{"version":3,"file":"Encore.d.ts","sourceRoot":"","sources":["../../src/core/Encore.ts"],"names":[],"mappings":"AAAA;;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I,CACR,OAAO,CAAC,EAAE,mBAAmB,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,UAAU,CAAC;IAwDtB;;;OAGG;IACG,YAAY,CAChB,OAAO,CAAC,EAAE,mBAAmB,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,OAAO,CAAC,kBAAkB,CAAC;IAa9B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO;IAQ3E;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAiBtE;;;OAGG;IACG,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAqC/F;;;;OAIG;IACH,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,WAAW;IAS9E;;;;OAIG;IACH,kBAAkB,CAChB,YAAY,EAAE,eAAe,EAC7B,MAAM,CAAC,EAAE,gBAAgB,GACxB;QACD,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,KAAK,WAAW,CAAC;KACnE;IAaD;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB;CA+xClG;AAGD,eAAO,MAAM,MAAM,WAAkB,CAAC"}
|
|
@@ -2,35 +2,16 @@
|
|
|
2
2
|
* Placement Builder
|
|
3
3
|
* Fluent API for configuring and presenting offers
|
|
4
4
|
*/
|
|
5
|
-
import type { PlacementBuilder as IPlacementBuilder, PlacementOptions, ShowResult,
|
|
6
|
-
export type PresentationExecutor = (options?: PlacementOptions
|
|
7
|
-
export type RedeemExecutor = (placementId: string) => Promise<RedeemResult>;
|
|
5
|
+
import type { PlacementBuilder as IPlacementBuilder, PlacementOptions, ShowResult, NotGrantedReason, UseCase } from '../types';
|
|
6
|
+
export type PresentationExecutor = (options?: PlacementOptions) => Promise<ShowResult>;
|
|
8
7
|
export declare class PlacementBuilder implements IPlacementBuilder {
|
|
9
8
|
#private;
|
|
10
|
-
constructor(id: string, executor: PresentationExecutor, options?: PlacementOptions
|
|
9
|
+
constructor(id: string, executor: PresentationExecutor, options?: PlacementOptions);
|
|
11
10
|
/**
|
|
12
|
-
* Set this placement's use case (default `'
|
|
11
|
+
* Set this placement's use case (default `'reduceChurn'`) — the same `.useCase(...)` step
|
|
13
12
|
* the native SDKs expose, so a cross-platform integration reads the same here.
|
|
14
13
|
*/
|
|
15
14
|
useCase(useCase: UseCase): PlacementBuilder;
|
|
16
|
-
/**
|
|
17
|
-
* Set the sheet's headline for THIS presentation — the same `.headline(...)` step
|
|
18
|
-
* the native SDKs expose.
|
|
19
|
-
*
|
|
20
|
-
* This is the primary way to supply reward copy. It is a per-call override: it
|
|
21
|
-
* wins over whatever the backend resolved, and applies to both use cases (it
|
|
22
|
-
* fills the same slot the `header.title` show option does).
|
|
23
|
-
*
|
|
24
|
-
* A blank or whitespace-only value falls THROUGH to the backend-resolved copy
|
|
25
|
-
* rather than blanking the sheet, so passing an empty string is never a way to
|
|
26
|
-
* clear the headline — omit the call instead.
|
|
27
|
-
*/
|
|
28
|
-
headline(headline: string): PlacementBuilder;
|
|
29
|
-
/**
|
|
30
|
-
* Set the sheet's subheadline for THIS presentation — the counterpart to
|
|
31
|
-
* {@link headline}, same precedence and same blank-falls-through rule.
|
|
32
|
-
*/
|
|
33
|
-
subheadline(subheadline: string): PlacementBuilder;
|
|
34
15
|
/**
|
|
35
16
|
* Set callback for when user declines or offer not granted
|
|
36
17
|
*/
|
|
@@ -42,14 +23,9 @@ export declare class PlacementBuilder implements IPlacementBuilder {
|
|
|
42
23
|
/**
|
|
43
24
|
* Show the offer and execute the presentation flow.
|
|
44
25
|
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
show(options?: ShowOptions): Promise<ShowResult>;
|
|
48
|
-
/**
|
|
49
|
-
* Redeem the claim made at THIS placement — phase 2 of the two-phase flow.
|
|
50
|
-
* Resolves the claim recorded for this placement id, renders the redemption
|
|
51
|
-
* screen, and fires the advertiser redirect on the user's CTA. See Encore.redeem().
|
|
26
|
+
* Takes no arguments: everything a placement can be configured with lives in
|
|
27
|
+
* PlacementOptions, supplied to `placement()` or through the builder steps.
|
|
52
28
|
*/
|
|
53
|
-
|
|
29
|
+
show(): Promise<ShowResult>;
|
|
54
30
|
}
|
|
55
31
|
//# sourceMappingURL=PlacementBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlacementBuilder.d.ts","sourceRoot":"","sources":["../../src/core/PlacementBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,EAChB,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"PlacementBuilder.d.ts","sourceRoot":"","sources":["../../src/core/PlacementBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,OAAO,EACR,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvF,qBAAa,gBAAiB,YAAW,iBAAiB;;gBAO5C,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAMlF;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB;IAK3C;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,gBAAgB;IAK5E;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,gBAAgB;IAK9E;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA6ClC"}
|
package/types/core/useCase.d.ts
CHANGED
|
@@ -1,21 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `useCase`
|
|
3
|
-
* values (`churn-intervention`, `post-action-reward`). Deliberately the same design as the closed
|
|
4
|
-
* `feat/reject-streaks-use-case` PR (#21), which refused every non-paywall value
|
|
5
|
-
* outright before this SDK could render any of them: an unrecognised value — a typo,
|
|
6
|
-
* a use case added to the platform before this SDK knows about it, or one that gets
|
|
7
|
-
* RENAMED — must fail closed too. A `!== 'streaks'` deny-list would have kept
|
|
8
|
-
* compiling and silently served the paywall the day that value became `'post-action-reward'`.
|
|
2
|
+
* `useCase` — the PUBLIC↔WIRE seam, plus value validation.
|
|
9
3
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
4
|
+
* 🔴 THE PUBLIC SYMBOL AND THE WIRE VALUE ARE DIFFERENT STRINGS, DELIBERATELY.
|
|
5
|
+
*
|
|
6
|
+
* The public symbols (`reduceChurn`, `rewardUsers`) match iOS's `.reduceChurn` /
|
|
7
|
+
* `.rewardUsers` and Android's `REDUCE_CHURN` / `REWARD_USERS`, so a publisher
|
|
8
|
+
* shipping on three platforms reads one vocabulary. The wire values
|
|
9
|
+
* (`churn-intervention`, `post-action-reward`) are the backend's Postgres enum,
|
|
10
|
+
* frozen since `V107__Use_Case_Value_Driven_Identifiers.sql` and unrelated to the
|
|
11
|
+
* case names — exactly as Android's own enum states it: *"Wire values are frozen
|
|
12
|
+
* and unrelated to the case names."*
|
|
13
|
+
*
|
|
14
|
+
* Everything that leaves this SDK carries the WIRE value:
|
|
15
|
+
* - `GET /config?useCase=post-action-reward`
|
|
16
|
+
* - `POST /transactions { useCase: 'post-action-reward' }`
|
|
17
|
+
* - the `use_case` analytics event property
|
|
18
|
+
* - the keys of the `/config` response's `useCases` prefetch block
|
|
19
|
+
*
|
|
20
|
+
* Everything a publisher touches carries the PUBLIC symbol. This module is the ONLY
|
|
21
|
+
* place the two meet: `toWireUseCase` on the way out, `fromWireUseCase` on the way
|
|
22
|
+
* in. Changing a wire value here misattributes reward revenue permanently and
|
|
23
|
+
* silently — there is no error anywhere, the rows just land under the wrong use
|
|
24
|
+
* case. `useCase.test.ts` pins the mapping in both directions for that reason.
|
|
25
|
+
*/
|
|
26
|
+
import { type EncoreError, type UseCase } from '../types';
|
|
27
|
+
/**
|
|
28
|
+
* The values the backend speaks. INTERNAL — deliberately not re-exported from
|
|
29
|
+
* `index.ts`: a publisher never types one of these, and exporting it would invite
|
|
30
|
+
* integrations to hard-code the wire strings this seam exists to hide.
|
|
14
31
|
*/
|
|
15
|
-
|
|
32
|
+
export type WireUseCase = 'churn-intervention' | 'post-action-reward';
|
|
33
|
+
/** Public symbol → the value that goes on the wire. Total by construction. */
|
|
34
|
+
export declare function toWireUseCase(useCase: UseCase): WireUseCase;
|
|
35
|
+
/**
|
|
36
|
+
* Wire value → public symbol, or `undefined` for anything this SDK version does not
|
|
37
|
+
* recognise. Tolerant by design: the backend may serve a use case added after this
|
|
38
|
+
* SDK shipped, and an unknown key must be DROPPED (the caller no-ops) rather than
|
|
39
|
+
* coerced into one of the two we know — serving a paywall where a reward was meant
|
|
40
|
+
* is the failure this whole dimension exists to prevent.
|
|
41
|
+
*/
|
|
42
|
+
export declare function fromWireUseCase(wire: string | null | undefined): UseCase | undefined;
|
|
16
43
|
/**
|
|
17
44
|
* `null` when `value` is a recognised use case (or omitted, which defaults to
|
|
18
|
-
* `'
|
|
45
|
+
* `'reduceChurn'` elsewhere), otherwise the error describing the rejection.
|
|
46
|
+
*
|
|
47
|
+
* An ALLOW-list, not a deny-list — the same design as the closed
|
|
48
|
+
* `feat/reject-streaks-use-case` PR (#21). An unrecognised value (a typo, a use case
|
|
49
|
+
* added to the platform before this SDK knows about it, or one that gets RENAMED)
|
|
50
|
+
* must fail closed. A `!== 'streaks'` deny-list would have kept compiling and
|
|
51
|
+
* silently served the paywall the day that value was renamed.
|
|
52
|
+
*
|
|
53
|
+
* Note the allow-list is on the PUBLIC symbols, so a caller who hard-coded a wire
|
|
54
|
+
* value (`'post-action-reward'`) is rejected here rather than quietly presenting the
|
|
55
|
+
* wrong surface — which is the correct answer for a 3.0.0 rename.
|
|
56
|
+
*
|
|
57
|
+
* Distinct from ENABLEMENT (does this app have the surface turned on), which is
|
|
58
|
+
* resolved from the config response's `useCases` map at show()-time and fails closed
|
|
59
|
+
* as `no_template`, not `INVALID_REQUEST`.
|
|
19
60
|
*/
|
|
20
61
|
export declare function checkUseCase(value: unknown): EncoreError | null;
|
|
21
62
|
//# sourceMappingURL=useCase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCase.d.ts","sourceRoot":"","sources":["../../src/core/useCase.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useCase.d.ts","sourceRoot":"","sources":["../../src/core/useCase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAa,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAuBtE,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAGpF;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAS/D"}
|
package/types/core/version.d.ts
CHANGED