@encorekit/web-sdk 2.2.0 → 2.2.1
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 +20 -0
- 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 +54 -2
- package/types/analytics/events.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +15 -1
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +39 -1
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +7 -0
- package/types/api/models.d.ts.map +1 -1
- package/types/core/Configuration.d.ts +2 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/giftVariant.d.ts +11 -8
- package/types/core/giftVariant.d.ts.map +1 -1
- package/types/core/share.d.ts +58 -0
- package/types/core/share.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +29 -0
- package/types/types.d.ts.map +1 -1
- package/types/ui/GiftSheet.d.ts +47 -3
- package/types/ui/GiftSheet.d.ts.map +1 -1
- package/types/ui/GiftUnwrap.d.ts +70 -0
- package/types/ui/GiftUnwrap.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +24 -0
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/giftUnwrapArt.d.ts +6 -0
- package/types/ui/giftUnwrapArt.d.ts.map +1 -1
- package/types/ui/giftUnwrapCopy.d.ts +20 -0
- package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
- package/types/ui/styles.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -43,6 +43,33 @@ export declare const ClaimFailureReason: {
|
|
|
43
43
|
readonly INVALID_DESTINATION_URL: "invalid_destination_url";
|
|
44
44
|
readonly POPUP_BLOCKED: "popup_blocked";
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* `properties.reason` on `sdk_offer_share_failed`, the terminal twin of a share tap
|
|
48
|
+
* that never reached anything that could take the link. `missing_share_link` is iOS's
|
|
49
|
+
* and Android's spelling (swift#156, android#93): the offer carries no `shareUrl`, and
|
|
50
|
+
* there is deliberately no fallback to another URL.
|
|
51
|
+
*
|
|
52
|
+
* `share_unavailable` is web's own, in the slot iOS fills with `no_presenter` and
|
|
53
|
+
* Android with `no_chooser`: neither the system share sheet nor the clipboard would
|
|
54
|
+
* take the link (an insecure page with the copy command refused, a frame denied both
|
|
55
|
+
* permissions). A cancel is never a failure; see `sdk_offer_share_completed`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const ShareFailureReason: {
|
|
58
|
+
readonly MISSING_SHARE_LINK: "missing_share_link";
|
|
59
|
+
readonly SHARE_UNAVAILABLE: "share_unavailable";
|
|
60
|
+
};
|
|
61
|
+
export type ShareFailureReasonValue = (typeof ShareFailureReason)[keyof typeof ShareFailureReason];
|
|
62
|
+
/**
|
|
63
|
+
* `properties.share_destination` on a completed web share. iOS reports the
|
|
64
|
+
* `UIActivity.ActivityType` the user picked; a browser never learns which app the
|
|
65
|
+
* system sheet handed the link to, so web reports which of its two routes took it:
|
|
66
|
+
* `web_share` (`navigator.share` resolved) or `clipboard` (the fallback copied it).
|
|
67
|
+
*/
|
|
68
|
+
export declare const ShareDestination: {
|
|
69
|
+
readonly SHARE_SHEET: "web_share";
|
|
70
|
+
readonly CLIPBOARD: "clipboard";
|
|
71
|
+
};
|
|
72
|
+
export type ShareDestinationValue = (typeof ShareDestination)[keyof typeof ShareDestination];
|
|
46
73
|
/**
|
|
47
74
|
* Translate an SDK-internal decline reason to its wire value.
|
|
48
75
|
*
|
|
@@ -181,6 +208,29 @@ export declare function offerClaimFailed(distinctId: string, ctx: OfferEventCont
|
|
|
181
208
|
export declare function offerClaimReturned(distinctId: string, ctx: OfferEventContext, params: {
|
|
182
209
|
transactionId?: string;
|
|
183
210
|
}): AnalyticsEvent;
|
|
211
|
+
/**
|
|
212
|
+
* The user tapped a share control, before anything is shared. Mirrors iOS
|
|
213
|
+
* `OfferShareTappedEvent` and Android's: the claim context and nothing else. A tap
|
|
214
|
+
* made while an earlier share is still open is not a new tap and is not reported.
|
|
215
|
+
*/
|
|
216
|
+
export declare function offerShareTapped(distinctId: string, ctx: OfferEventContext): AnalyticsEvent;
|
|
217
|
+
/**
|
|
218
|
+
* A share tap that never reached anything that could take the link. The twin of
|
|
219
|
+
* `sdk_offer_share_tapped`, so every tap has a terminal event. See `ShareFailureReason`.
|
|
220
|
+
*/
|
|
221
|
+
export declare function offerShareFailed(distinctId: string, ctx: OfferEventContext, params: {
|
|
222
|
+
reason: ShareFailureReasonValue;
|
|
223
|
+
}): AnalyticsEvent;
|
|
224
|
+
/**
|
|
225
|
+
* The share settled. `completed` is false when the user dismissed the share sheet
|
|
226
|
+
* without sending, and then there is no destination, which iOS also encodes by
|
|
227
|
+
* omission. Mirrors iOS `OfferShareCompletedEvent`; Android emits none because it
|
|
228
|
+
* cannot observe the chooser. See `ShareDestination` for web's destinations.
|
|
229
|
+
*/
|
|
230
|
+
export declare function offerShareCompleted(distinctId: string, ctx: OfferEventContext, params: {
|
|
231
|
+
shareDestination?: ShareDestinationValue;
|
|
232
|
+
completed: boolean;
|
|
233
|
+
}): AnalyticsEvent;
|
|
184
234
|
/**
|
|
185
235
|
* Web's advertiser handoff is a browser tab, not an embedded webview, so these
|
|
186
236
|
* keep iOS's event NAMES (the warehouse funnel is keyed on them) while reporting
|
|
@@ -343,11 +393,13 @@ export declare function sduiConfigLoaded(distinctId: string, params: {
|
|
|
343
393
|
}): AnalyticsEvent;
|
|
344
394
|
/**
|
|
345
395
|
* A control in the offer sheet was activated. `actionType` uses iOS's action
|
|
346
|
-
* vocabulary so the same query reads both platforms
|
|
396
|
+
* vocabulary so the same query reads both platforms: `share` is the share control,
|
|
397
|
+
* and `setState` is the one state change web reports, the × that opens the
|
|
398
|
+
* "keep your gift for later" panel instead of closing.
|
|
347
399
|
*/
|
|
348
400
|
export declare function sduiButtonTapped(distinctId: string, params: {
|
|
349
401
|
variantId?: string;
|
|
350
|
-
actionType: 'close' | 'claimOffer' | 'openUrl' | 'next' | 'previous';
|
|
402
|
+
actionType: 'close' | 'claimOffer' | 'openUrl' | 'next' | 'previous' | 'share' | 'setState';
|
|
351
403
|
presentationId: string;
|
|
352
404
|
currentState: string;
|
|
353
405
|
useCase?: UseCase;
|
|
@@ -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;AAQxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AA+
|
|
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;AAQxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAEnG;;;;;GAKG;AACH,eA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,MAAM,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACxE,cAAc,CAWhB;AAMD,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,GACf,cAAc,CAMhB"}
|
package/types/api/APIClient.d.ts
CHANGED
|
@@ -24,6 +24,17 @@ export declare function readProposedCategory(campaign: unknown): string | undefi
|
|
|
24
24
|
* `http:` row included, is dropped, so a bad row can never inject a scheme.
|
|
25
25
|
*/
|
|
26
26
|
export declare function readCampaignUrl(campaign: unknown, key: 'heroImageUrl' | 'termsUrl'): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The link a user can send someone for this offer (`campaign.shareUrl`, declared by
|
|
29
|
+
* backend#659 and not yet in the synced contract), read tolerantly: a non-blank string,
|
|
30
|
+
* trimmed, that parses as an ABSOLUTE `http:` or `https:` URL. Anything else is absent,
|
|
31
|
+
* which the share action reports as `missing_share_link`.
|
|
32
|
+
*
|
|
33
|
+
* Only the field is dropped, never the offer: a bad link costs one button, not the
|
|
34
|
+
* offer list. A relative value is absent too, because `navigator.share` would resolve
|
|
35
|
+
* it against the HOST page and send the publisher's own URL.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readShareUrl(campaign: unknown): string | undefined;
|
|
27
38
|
interface RequestOptions {
|
|
28
39
|
method: 'GET' | 'POST' | 'PATCH';
|
|
29
40
|
headers?: Record<string, string>;
|
|
@@ -133,8 +144,11 @@ export declare class APIClient {
|
|
|
133
144
|
*
|
|
134
145
|
* `demoVariant` is Encore's internal demo-page override and rides both. See
|
|
135
146
|
* `EncoreConfig.demoVariant`; the backend ignores it for every non-demo app.
|
|
147
|
+
*
|
|
148
|
+
* `placementId` is sent only by the placement-scoped fetch behind
|
|
149
|
+
* `EncoreConfig.resolveVariantsByPlacement`, already normalised by the caller.
|
|
136
150
|
*/
|
|
137
|
-
fetchConfig(userId: string, sdkVersion: string, useCase?: UseCase, demoVariant?: string): Promise<RemoteConfigResponse>;
|
|
151
|
+
fetchConfig(userId: string, sdkVersion: string, useCase?: UseCase, demoVariant?: string, placementId?: string): Promise<RemoteConfigResponse>;
|
|
138
152
|
/**
|
|
139
153
|
* Report a client error (fire-and-forget)
|
|
140
154
|
*/
|
|
@@ -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;AAGtG,OAAO,KAAK,EAEV,wBAAwB,EAIxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAalB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAM1E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,cAAc,GAAG,UAAU,GAC/B,MAAM,GAAG,SAAS,CAKpB;AAMD,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;IA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,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC;IAuBhC;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,6FAA6F;QAC7F,OAAO,EAAE,YAAY,CAAC;QACtB,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;IA0CjB;;OAEG;IACG,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAW3D"}
|
|
@@ -2336,7 +2336,7 @@ export interface paths {
|
|
|
2336
2336
|
path?: never;
|
|
2337
2337
|
cookie?: never;
|
|
2338
2338
|
};
|
|
2339
|
-
/** @description Get unified SDK configuration including SDUI, entitlements, experiments, and remote config. This endpoint replaces /ui-config with a cleaner structure. Entitlement mode is implicit: if entitlements.iap.productId exists, use IAP mode; otherwise use Native mode. Pass `useCase` to configure a surface other than churn-intervention; the response echoes it as ui.useCase. `demoVariant` names an SDUI variant to serve for this request. It is honoured on a TEST key (pk_test_*) for any app, and on a live key only for Encore's own demo apps; for every other app it is ignored silently (never an error). It exists for demos and previews: Encore's own demo pages, and a publisher who wants to see the other variants against their own test key. Requesting a surface is all it takes to be served it — no setup call is required. A surface Encore has explicitly switched off for this app, or one with no variant available, returns ui.template: null — clients must no-op, never reuse another use case's template. */
|
|
2339
|
+
/** @description Get unified SDK configuration including SDUI, entitlements, experiments, and remote config. This endpoint replaces /ui-config with a cleaner structure. Entitlement mode is implicit: if entitlements.iap.productId exists, use IAP mode; otherwise use Native mode. Pass `useCase` to configure a surface other than churn-intervention; the response echoes it as ui.useCase. `demoVariant` names an SDUI variant to serve for this request. It is honoured on a TEST key (pk_test_*) for any app, and on a live key only for Encore's own demo apps; for every other app it is ignored silently (never an error). It exists for demos and previews: Encore's own demo pages, and a publisher who wants to see the other variants against their own test key. `placementId` selects a variant an admin pinned to that placement, in `ui` only; any label without a pin resolves as before. Requesting a surface is all it takes to be served it — no setup call is required. A surface Encore has explicitly switched off for this app, or one with no variant available, returns ui.template: null — clients must no-op, never reuse another use case's template. */
|
|
2340
2340
|
get: {
|
|
2341
2341
|
parameters: {
|
|
2342
2342
|
query: {
|
|
@@ -2350,6 +2350,8 @@ export interface paths {
|
|
|
2350
2350
|
useCase?: "churn-intervention" | "post-action-reward";
|
|
2351
2351
|
/** @description Demos and previews only. The SDUI variant file stem to serve for this request, e.g. 'giftUnwrap'. Honoured on a TEST key (pk_test_*) for any app. On a live key it is honoured only for Encore's own demo apps; for every other app it is ignored silently and resolution is unchanged, never an error. Intended for Encore's internal demos and for a publisher previewing the other variants against their own test key. An honoured value bypasses app targeting, experiments and arm weights, and WIDENS the status filter from 'active' to 'active' or 'valid' — the filter is widened, not removed, so a draft, testing, invalid or archived variant is still refused. The use-case partition, the per-app kill switch and the SDK version gate all still apply. Note that a test key also serves the demo campaign catalog rather than live advertiser inventory, and tags the request as test traffic in analytics. */
|
|
2352
2352
|
demoVariant?: string;
|
|
2353
|
+
/** @description The publisher's placement label for the surface being configured, e.g. 'email_code'. Optional. When an admin has pinned an SDUI variant to this (app, placement), `ui` serves that variant instead of the experiment assignment, provided it is active or valid, matches the requested use case and passes its SDK version gate and app targeting. Otherwise, and for any label with no pin, resolution is unchanged. Never a 4xx on any input. Applies to `ui` only; the `useCases` prefetch block is never pinned. */
|
|
2354
|
+
placementId?: string;
|
|
2353
2355
|
};
|
|
2354
2356
|
header?: never;
|
|
2355
2357
|
path?: never;
|
|
@@ -2419,6 +2421,12 @@ export interface paths {
|
|
|
2419
2421
|
rewardHeadline?: string | null;
|
|
2420
2422
|
/** @description Subheadline for the reward template. NON-NULL whenever ui.useCase is 'post-action-reward', for the same reason as rewardHeadline — the template references ${rewardSubheadline} unconditionally. Resolution: app_use_cases.subheadline, else the shipped default. */
|
|
2421
2423
|
rewardSubheadline?: string | null;
|
|
2424
|
+
/** @description Primary button label for the reward template. Resolution: the variant's own defaultCopy.cta. Null when the variant declares none, in which case its template carries a literal instead. An SDK that predates this field receives the wording inlined in the template, not a token. */
|
|
2425
|
+
rewardCta?: string | null;
|
|
2426
|
+
/** @description Decline button label for the reward template. Same resolution and same null meaning as rewardCta. */
|
|
2427
|
+
rewardDecline?: string | null;
|
|
2428
|
+
/** @description Badge on the highlighted offer card, e.g. 'Most claimed'. Same resolution and same null meaning as rewardCta. */
|
|
2429
|
+
rewardBadge?: string | null;
|
|
2422
2430
|
};
|
|
2423
2431
|
/** @description Appearance values */
|
|
2424
2432
|
appearance: {
|
|
@@ -2487,6 +2495,12 @@ export interface paths {
|
|
|
2487
2495
|
rewardHeadline?: string | null;
|
|
2488
2496
|
/** @description Subheadline for the reward template. NON-NULL whenever ui.useCase is 'post-action-reward', for the same reason as rewardHeadline — the template references ${rewardSubheadline} unconditionally. Resolution: app_use_cases.subheadline, else the shipped default. */
|
|
2489
2497
|
rewardSubheadline?: string | null;
|
|
2498
|
+
/** @description Primary button label for the reward template. Resolution: the variant's own defaultCopy.cta. Null when the variant declares none, in which case its template carries a literal instead. An SDK that predates this field receives the wording inlined in the template, not a token. */
|
|
2499
|
+
rewardCta?: string | null;
|
|
2500
|
+
/** @description Decline button label for the reward template. Same resolution and same null meaning as rewardCta. */
|
|
2501
|
+
rewardDecline?: string | null;
|
|
2502
|
+
/** @description Badge on the highlighted offer card, e.g. 'Most claimed'. Same resolution and same null meaning as rewardCta. */
|
|
2503
|
+
rewardBadge?: string | null;
|
|
2490
2504
|
};
|
|
2491
2505
|
/** @description Appearance values */
|
|
2492
2506
|
appearance: {
|
|
@@ -2553,6 +2567,12 @@ export interface paths {
|
|
|
2553
2567
|
rewardHeadline?: string | null;
|
|
2554
2568
|
/** @description Subheadline for the reward template. NON-NULL whenever ui.useCase is 'post-action-reward', for the same reason as rewardHeadline — the template references ${rewardSubheadline} unconditionally. Resolution: app_use_cases.subheadline, else the shipped default. */
|
|
2555
2569
|
rewardSubheadline?: string | null;
|
|
2570
|
+
/** @description Primary button label for the reward template. Resolution: the variant's own defaultCopy.cta. Null when the variant declares none, in which case its template carries a literal instead. An SDK that predates this field receives the wording inlined in the template, not a token. */
|
|
2571
|
+
rewardCta?: string | null;
|
|
2572
|
+
/** @description Decline button label for the reward template. Same resolution and same null meaning as rewardCta. */
|
|
2573
|
+
rewardDecline?: string | null;
|
|
2574
|
+
/** @description Badge on the highlighted offer card, e.g. 'Most claimed'. Same resolution and same null meaning as rewardCta. */
|
|
2575
|
+
rewardBadge?: string | null;
|
|
2556
2576
|
};
|
|
2557
2577
|
/** @description Appearance values */
|
|
2558
2578
|
appearance: {
|
|
@@ -4473,6 +4493,12 @@ export interface components {
|
|
|
4473
4493
|
rewardHeadline?: string | null;
|
|
4474
4494
|
/** @description Subheadline for the reward template. NON-NULL whenever ui.useCase is 'post-action-reward', for the same reason as rewardHeadline — the template references ${rewardSubheadline} unconditionally. Resolution: app_use_cases.subheadline, else the shipped default. */
|
|
4475
4495
|
rewardSubheadline?: string | null;
|
|
4496
|
+
/** @description Primary button label for the reward template. Resolution: the variant's own defaultCopy.cta. Null when the variant declares none, in which case its template carries a literal instead. An SDK that predates this field receives the wording inlined in the template, not a token. */
|
|
4497
|
+
rewardCta?: string | null;
|
|
4498
|
+
/** @description Decline button label for the reward template. Same resolution and same null meaning as rewardCta. */
|
|
4499
|
+
rewardDecline?: string | null;
|
|
4500
|
+
/** @description Badge on the highlighted offer card, e.g. 'Most claimed'. Same resolution and same null meaning as rewardCta. */
|
|
4501
|
+
rewardBadge?: string | null;
|
|
4476
4502
|
};
|
|
4477
4503
|
/** @description Appearance values */
|
|
4478
4504
|
appearance: {
|
|
@@ -4541,6 +4567,12 @@ export interface components {
|
|
|
4541
4567
|
rewardHeadline?: string | null;
|
|
4542
4568
|
/** @description Subheadline for the reward template. NON-NULL whenever ui.useCase is 'post-action-reward', for the same reason as rewardHeadline — the template references ${rewardSubheadline} unconditionally. Resolution: app_use_cases.subheadline, else the shipped default. */
|
|
4543
4569
|
rewardSubheadline?: string | null;
|
|
4570
|
+
/** @description Primary button label for the reward template. Resolution: the variant's own defaultCopy.cta. Null when the variant declares none, in which case its template carries a literal instead. An SDK that predates this field receives the wording inlined in the template, not a token. */
|
|
4571
|
+
rewardCta?: string | null;
|
|
4572
|
+
/** @description Decline button label for the reward template. Same resolution and same null meaning as rewardCta. */
|
|
4573
|
+
rewardDecline?: string | null;
|
|
4574
|
+
/** @description Badge on the highlighted offer card, e.g. 'Most claimed'. Same resolution and same null meaning as rewardCta. */
|
|
4575
|
+
rewardBadge?: string | null;
|
|
4544
4576
|
};
|
|
4545
4577
|
/** @description Appearance values */
|
|
4546
4578
|
appearance: {
|
|
@@ -4607,6 +4639,12 @@ export interface components {
|
|
|
4607
4639
|
rewardHeadline?: string | null;
|
|
4608
4640
|
/** @description Subheadline for the reward template. NON-NULL whenever ui.useCase is 'post-action-reward', for the same reason as rewardHeadline — the template references ${rewardSubheadline} unconditionally. Resolution: app_use_cases.subheadline, else the shipped default. */
|
|
4609
4641
|
rewardSubheadline?: string | null;
|
|
4642
|
+
/** @description Primary button label for the reward template. Resolution: the variant's own defaultCopy.cta. Null when the variant declares none, in which case its template carries a literal instead. An SDK that predates this field receives the wording inlined in the template, not a token. */
|
|
4643
|
+
rewardCta?: string | null;
|
|
4644
|
+
/** @description Decline button label for the reward template. Same resolution and same null meaning as rewardCta. */
|
|
4645
|
+
rewardDecline?: string | null;
|
|
4646
|
+
/** @description Badge on the highlighted offer card, e.g. 'Most claimed'. Same resolution and same null meaning as rewardCta. */
|
|
4647
|
+
rewardBadge?: string | null;
|
|
4610
4648
|
};
|
|
4611
4649
|
/** @description Appearance values */
|
|
4612
4650
|
appearance: {
|