@encorekit/web-sdk 2.2.0 → 2.3.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 +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 +57 -5
- package/types/analytics/events.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +16 -20
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +643 -9
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +19 -7
- package/types/api/models.d.ts.map +1 -1
- package/types/api/offerBuilder.d.ts +45 -0
- package/types/api/offerBuilder.d.ts.map +1 -0
- package/types/core/Configuration.d.ts +11 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/OfferManager.d.ts +2 -2
- package/types/core/OfferManager.d.ts.map +1 -1
- package/types/core/claimScreenVariant.d.ts +3 -0
- package/types/core/claimScreenVariant.d.ts.map +1 -0
- 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/unlockCode.d.ts +4 -1
- package/types/core/unlockCode.d.ts.map +1 -1
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +120 -3
- package/types/types.d.ts.map +1 -1
- package/types/ui/ClaimScreen.d.ts +62 -0
- package/types/ui/ClaimScreen.d.ts.map +1 -0
- package/types/ui/CodeUnlock.d.ts +14 -0
- package/types/ui/CodeUnlock.d.ts.map +1 -1
- package/types/ui/GiftSheet.d.ts +48 -4
- 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/OfferCard.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +22 -4
- 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
|
*
|
|
@@ -64,7 +91,7 @@ export declare function offerPresentationFailed(distinctId: string, reason: stri
|
|
|
64
91
|
export declare function offerPresentationSuccess(distinctId: string, presentationId: string, offerCount: number, variantId?: string, useCase?: UseCase, placementId?: string): AnalyticsEvent;
|
|
65
92
|
export declare function offerPresented(distinctId: string, params: {
|
|
66
93
|
campaignId: string;
|
|
67
|
-
creativeId
|
|
94
|
+
creativeId?: string;
|
|
68
95
|
advertiserName?: string;
|
|
69
96
|
impressionId: string;
|
|
70
97
|
offerIndex: number;
|
|
@@ -77,7 +104,7 @@ export declare function offerPresented(distinctId: string, params: {
|
|
|
77
104
|
}): AnalyticsEvent;
|
|
78
105
|
export declare function offerClaimed(distinctId: string, params: {
|
|
79
106
|
campaignId: string;
|
|
80
|
-
creativeId
|
|
107
|
+
creativeId?: string;
|
|
81
108
|
advertiserName?: string;
|
|
82
109
|
impressionId: string;
|
|
83
110
|
transactionId: string;
|
|
@@ -90,7 +117,7 @@ export declare function offerClaimed(distinctId: string, params: {
|
|
|
90
117
|
}): AnalyticsEvent;
|
|
91
118
|
export declare function offerDeclined(distinctId: string, params: {
|
|
92
119
|
campaignId: string;
|
|
93
|
-
creativeId
|
|
120
|
+
creativeId?: string;
|
|
94
121
|
advertiserName?: string;
|
|
95
122
|
impressionId: string;
|
|
96
123
|
offerIndex: number;
|
|
@@ -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,eAAO,MAA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CAAC;IAAC,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
|
@@ -6,24 +6,13 @@
|
|
|
6
6
|
import type { UserAttributes, Entitlement, VerificationStatus, UseCase } from '../types';
|
|
7
7
|
import type { StartTransactionResponse, InitUserResponse, IdentifyUserResponse, RemoteConfigResponse, OfferModel, BackendVerificationStatus } from './models';
|
|
8
8
|
import type { ErrorContext } from '../core/errorContext';
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* the field's absence, is `undefined`, so a response from today's backend maps
|
|
17
|
-
* exactly as it did before this reader existed. If the BCR lands with a different
|
|
18
|
-
* name or shape, this function is the one place to change.
|
|
19
|
-
*/
|
|
20
|
-
export declare function readProposedCategory(campaign: unknown): string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* A campaign-level URL (`heroImageUrl`, `termsUrl`), read tolerantly: a non-blank string,
|
|
23
|
-
* trimmed, that passes the SDK's https guard. Anything else, a `javascript:` or plain
|
|
24
|
-
* `http:` row included, is dropped, so a bad row can never inject a scheme.
|
|
25
|
-
*/
|
|
26
|
-
export declare function readCampaignUrl(campaign: unknown, key: 'heroImageUrl' | 'termsUrl'): string | undefined;
|
|
9
|
+
/** What the offers search is scoped to; each field is omitted from the wire when absent. */
|
|
10
|
+
export interface OffersSearchScope {
|
|
11
|
+
variantId?: string;
|
|
12
|
+
useCase?: UseCase;
|
|
13
|
+
/** Cache key only (never sent): set when /config lists this label in `ruledPlacements`. */
|
|
14
|
+
ruledPlacementId?: string;
|
|
15
|
+
}
|
|
27
16
|
interface RequestOptions {
|
|
28
17
|
method: 'GET' | 'POST' | 'PATCH';
|
|
29
18
|
headers?: Record<string, string>;
|
|
@@ -71,8 +60,12 @@ export declare class APIClient {
|
|
|
71
60
|
* (`StrictUnlock.MAX_POSTBACK_TIME_MS`), never publisher input, so unlike
|
|
72
61
|
* `placementId` there is nothing to bound here: the contract's own 1000..120000
|
|
73
62
|
* range (`offers/dto.ts`) cannot be violated by a caller.
|
|
63
|
+
*
|
|
64
|
+
* `scope` adds `variantId` (UUID only) and the wire `useCase` (never for `reduceChurn`);
|
|
65
|
+
* `ruledPlacementId` in it is a cache key and never sent. The response becomes one
|
|
66
|
+
* offer per campaign, see `offerBuilder.ts`.
|
|
74
67
|
*/
|
|
75
|
-
fetchOffers(userId: string, attributes: UserAttributes, placementId?: string, maxPostbackTimeMs?: number): Promise<{
|
|
68
|
+
fetchOffers(userId: string, attributes: UserAttributes, placementId?: string, maxPostbackTimeMs?: number, scope?: OffersSearchScope): Promise<{
|
|
76
69
|
offers: OfferModel[];
|
|
77
70
|
}>;
|
|
78
71
|
/**
|
|
@@ -133,8 +126,11 @@ export declare class APIClient {
|
|
|
133
126
|
*
|
|
134
127
|
* `demoVariant` is Encore's internal demo-page override and rides both. See
|
|
135
128
|
* `EncoreConfig.demoVariant`; the backend ignores it for every non-demo app.
|
|
129
|
+
*
|
|
130
|
+
* `placementId` is sent only by the placement-scoped fetch behind
|
|
131
|
+
* `EncoreConfig.resolveVariantsByPlacement`, already normalised by the caller.
|
|
136
132
|
*/
|
|
137
|
-
fetchConfig(userId: string, sdkVersion: string, useCase?: UseCase, demoVariant?: string): Promise<RemoteConfigResponse>;
|
|
133
|
+
fetchConfig(userId: string, sdkVersion: string, useCase?: UseCase, demoVariant?: string, placementId?: string): Promise<RemoteConfigResponse>;
|
|
138
134
|
/**
|
|
139
135
|
* Report a client error (fire-and-forget)
|
|
140
136
|
*/
|
|
@@ -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;
|
|
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;AAclB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzD,4FAA4F;AAC5F,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,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,EA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