@namiml/web-sdk 1.3.1 → 1.4.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/CHANGELOG.md +25 -0
- package/dist/components/ContextConsumer.d.ts +1 -1
- package/dist/components/ContextProvider.d.ts +7 -7
- package/dist/components/Paywall.d.ts +4 -4
- package/dist/components/TemplateComponent.d.ts +1 -1
- package/dist/components/containers/BackgroundContainer.d.ts +2 -1
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/containers/Container.d.ts +6 -2
- package/dist/components/containers/Content.d.ts +1 -1
- package/dist/components/containers/Footer.d.ts +1 -1
- package/dist/components/containers/Header.d.ts +1 -1
- package/dist/components/containers/ProductContainer.d.ts +1 -1
- package/dist/components/containers/ResponsiveGrid.d.ts +9 -0
- package/dist/components/elements/Button.d.ts +4 -1
- package/dist/components/elements/Image.d.ts +1 -1
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
- package/dist/components/elements/Spacer.d.ts +1 -1
- package/dist/components/elements/Text.d.ts +1 -1
- package/dist/components/elements/Video.d.ts +2 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/productDetails.d.ts +2 -2
- package/dist/components/utils/actionTap.d.ts +2 -2
- package/dist/components/utils/dateTIme.d.ts +3 -0
- package/dist/components/utils/helpers.d.ts +6 -5
- package/dist/components/utils/impression.d.ts +2 -2
- package/dist/components/utils/products.d.ts +4 -3
- package/dist/components/utils/state.d.ts +6 -4
- package/dist/components/utils/styles.d.ts +4 -3
- package/dist/nami/api.d.ts +4 -3
- package/dist/nami/campaign.d.ts +36 -10
- package/dist/nami/customer.d.ts +58 -14
- package/dist/nami/entitlement.d.ts +22 -5
- package/dist/nami/index.d.ts +7 -1
- package/dist/nami/namiRefs.d.ts +1 -1
- package/dist/nami/paywalls.d.ts +49 -18
- package/dist/nami/purchase.d.ts +5 -1
- package/dist/nami/utils/campaign.d.ts +2 -2
- package/dist/nami/utils/entitlement.d.ts +4 -4
- package/dist/nami/utils/paywall.d.ts +1 -1
- package/dist/nami/utils/purchase.d.ts +2 -2
- package/dist/nami-web.cjs +14 -15
- package/dist/nami-web.d.ts +8 -879
- package/dist/nami-web.js +14 -15
- package/dist/nami-web.mjs +14 -15
- package/dist/nami-web.umd.js +14 -15
- package/dist/repositories/campaignRule.repository.d.ts +3 -3
- package/dist/repositories/config.repository.d.ts +1 -1
- package/dist/repositories/customerJourney.repository.d.ts +5 -0
- package/dist/repositories/device.repository.d.ts +1 -1
- package/dist/repositories/entitlement.repository.d.ts +1 -1
- package/dist/repositories/paywall.repository.d.ts +1 -1
- package/dist/repositories/products.repository.d.ts +1 -1
- package/dist/services/logger.service.d.ts +1 -1
- package/dist/services/storage.service.d.ts +7 -1
- package/dist/types/components/containers.d.ts +11 -2
- package/dist/types/components/elements.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/customer.d.ts +2 -0
- package/dist/types/entitlements.d.ts +2 -0
- package/dist/types/externals/campaign.d.ts +9 -1
- package/dist/types/externals/config.d.ts +27 -1
- package/dist/types/externals/customer.d.ts +18 -0
- package/dist/types/externals/entitlement.d.ts +27 -0
- package/dist/types/externals/index.d.ts +3 -0
- package/dist/types/externals/languages.d.ts +197 -1
- package/dist/types/{loglevel.d.ts → externals/loglevel.d.ts} +3 -0
- package/dist/types/externals/paywall.d.ts +31 -0
- package/dist/types/externals/product.d.ts +4 -0
- package/dist/types/externals/purchase.d.ts +24 -0
- package/dist/types/externals/sku.d.ts +14 -0
- package/dist/types/paywall.d.ts +8 -7
- package/dist/types/profile.d.ts +2 -1
- package/dist/utils/config.d.ts +2 -1
- package/dist/utils/const.d.ts +1 -1
- package/dist/utils/device.d.ts +1 -1
- package/dist/utils/fonts.d.ts +1 -1
- package/package.json +5 -4
- /package/dist/types/{errors.d.ts → externals/errors.d.ts} +0 -0
package/dist/nami-web.d.ts
CHANGED
|
@@ -1,879 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
DEEPLINK = "deeplink",
|
|
10
|
-
IN_APP = "in_app"
|
|
11
|
-
}
|
|
12
|
-
interface NamiCampaign {
|
|
13
|
-
rule: string;
|
|
14
|
-
name: string;
|
|
15
|
-
segment: string;
|
|
16
|
-
paywall: string;
|
|
17
|
-
type: string | NamiCampaignRuleType;
|
|
18
|
-
value?: string | null;
|
|
19
|
-
form_factors: FormFactor[];
|
|
20
|
-
external_segment_id: string | null;
|
|
21
|
-
conversion_event_type?: CampaignRuleConversionEventType;
|
|
22
|
-
conversion_event_url?: string;
|
|
23
|
-
}
|
|
24
|
-
declare enum NamiCampaignRuleType {
|
|
25
|
-
DEFAULT = "default",
|
|
26
|
-
LABEL = "label",
|
|
27
|
-
UNKNOWN = "unknown",
|
|
28
|
-
URL = "url"
|
|
29
|
-
}
|
|
30
|
-
type TDevice = "phone" | "tablet" | "television" | "desktop";
|
|
31
|
-
type TDeviceOrientation = "landscape" | "portrait";
|
|
32
|
-
type NamiLanguageCodes = "af" | "ar" | "ar-dz" | "ast" | "az" | "bg" | "be" | "bn" | "br" | "bs" | "ca" | "cs" | "cy" | "da" | "de" | "dsb" | "el" | "en" | "en-au" | "en-gb" | "eo" | "es" | "es-ar" | "es-co" | "es-mx" | "es-ni" | "es-ve" | "et" | "eu" | "fa" | "fi" | "fr" | "fy" | "ga" | "gd" | "gl" | "he" | "hi" | "hr" | "hsb" | "hu" | "hy" | "ia" | "id" | "ig" | "io" | "is" | "it" | "ja" | "ka" | "kab" | "kk" | "km" | "kn" | "ko" | "ky" | "lb" | "lt" | "lv" | "mk" | "ml" | "mn" | "mr" | "my" | "nb" | "ne" | "nl" | "nn" | "os" | "pa" | "pl" | "pt" | "pt-br" | "ro" | "ru" | "sk" | "sl" | "sq" | "sr" | "sr-latn" | "sv" | "sw" | "ta" | "te" | "tg" | "th" | "tk" | "tr" | "tt" | "udm" | "uk" | "ur" | "uz" | "vi" | "zh-hans" | "zh-hant";
|
|
33
|
-
type NamiLogLevel = "error" | "warn" | "info" | "debug";
|
|
34
|
-
interface NamiProductDetails {
|
|
35
|
-
name?: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
product_ref_id: string;
|
|
38
|
-
product_type: NamiSKUType;
|
|
39
|
-
subscription_period?: NamiSubscriptionPeriod;
|
|
40
|
-
offers: NamiProductOffer[];
|
|
41
|
-
}
|
|
42
|
-
type NamiProductOffer = NamiOfferPrice & {
|
|
43
|
-
offer_ref_id?: string;
|
|
44
|
-
offer_type: "promo" | "default";
|
|
45
|
-
promo_period?: NamiOfferPeriod;
|
|
46
|
-
promo_price?: NamiOfferPrice;
|
|
47
|
-
};
|
|
48
|
-
type NamiOfferPrice = {
|
|
49
|
-
price: number;
|
|
50
|
-
currency: string;
|
|
51
|
-
};
|
|
52
|
-
type NamiOfferPeriod = NamiSubscriptionPeriod;
|
|
53
|
-
type NamiSubscriptionInterval = "day" | "week" | "month" | "year" | "unknown";
|
|
54
|
-
type NamiSubscriptionPeriod = {
|
|
55
|
-
type: NamiSubscriptionInterval;
|
|
56
|
-
count: number;
|
|
57
|
-
period_start?: number;
|
|
58
|
-
period_end?: number;
|
|
59
|
-
};
|
|
60
|
-
interface SKU {
|
|
61
|
-
id: string;
|
|
62
|
-
name: string;
|
|
63
|
-
sku_ref_id: string;
|
|
64
|
-
entitlements: IEntitlements[];
|
|
65
|
-
sku_type: NamiSKUType;
|
|
66
|
-
}
|
|
67
|
-
interface PaywallSKU extends SKU {
|
|
68
|
-
display_text?: string;
|
|
69
|
-
sub_display_text?: string;
|
|
70
|
-
featured?: boolean;
|
|
71
|
-
variables?: {
|
|
72
|
-
[key: string]: any;
|
|
73
|
-
};
|
|
74
|
-
product_details?: NamiProductDetails | null;
|
|
75
|
-
}
|
|
76
|
-
type AppleProduct = unknown;
|
|
77
|
-
type GoogleProduct = unknown;
|
|
78
|
-
type AmazonProduct = unknown;
|
|
79
|
-
type NamiSKU = {
|
|
80
|
-
id: string;
|
|
81
|
-
name?: string;
|
|
82
|
-
skuId: string;
|
|
83
|
-
appleProduct?: AppleProduct;
|
|
84
|
-
googleProduct?: GoogleProduct;
|
|
85
|
-
amazonProduct?: AmazonProduct;
|
|
86
|
-
type: NamiSKUType;
|
|
87
|
-
promoId?: string | null;
|
|
88
|
-
promoToken?: string | null;
|
|
89
|
-
productDetails?: NamiProductDetails | null;
|
|
90
|
-
entitlements: IEntitlements[];
|
|
91
|
-
};
|
|
92
|
-
type NamiSKUType = "unknown" | "one_time_purchase" | "subscription";
|
|
93
|
-
// image
|
|
94
|
-
type TImageComponent = TBaseComponent & {
|
|
95
|
-
component: "image";
|
|
96
|
-
url?: string | null;
|
|
97
|
-
aspectRatio?: number;
|
|
98
|
-
imageCropping?: "fill" | "fit";
|
|
99
|
-
};
|
|
100
|
-
// segmentPicker
|
|
101
|
-
type TSegmentPicker = TBaseComponent & {
|
|
102
|
-
component: "segmentPicker";
|
|
103
|
-
components: TSegmentPickerItem[];
|
|
104
|
-
};
|
|
105
|
-
type TSegmentPickerItem = TBaseComponent & {
|
|
106
|
-
component: "segmentPickerItem";
|
|
107
|
-
ref?: any;
|
|
108
|
-
text?: string;
|
|
109
|
-
alignment?: AlignmentType;
|
|
110
|
-
activeFillColor?: string;
|
|
111
|
-
activeBorderColor?: string;
|
|
112
|
-
activeBorderRadius?: number;
|
|
113
|
-
activeBorderWidth?: number;
|
|
114
|
-
activeRoundBorders?: Array<BorderLocationType>;
|
|
115
|
-
activeFontSize?: number;
|
|
116
|
-
activeFontColor?: string;
|
|
117
|
-
activeFontName?: string;
|
|
118
|
-
inactiveBorderRadius?: number;
|
|
119
|
-
inactiveBorderColor?: string;
|
|
120
|
-
inactiveBorderWidth?: number;
|
|
121
|
-
inactiveRoundBorders?: Array<BorderLocationType>;
|
|
122
|
-
inactiveFontSize?: number;
|
|
123
|
-
inactiveFontName?: string;
|
|
124
|
-
inactiveFontColor?: string;
|
|
125
|
-
leftPadding?: number;
|
|
126
|
-
rightPadding?: number;
|
|
127
|
-
topPadding?: number;
|
|
128
|
-
bottomPadding?: number;
|
|
129
|
-
};
|
|
130
|
-
// spacer
|
|
131
|
-
type TSpacerComponent = TBaseComponent & {
|
|
132
|
-
component: "spacer";
|
|
133
|
-
};
|
|
134
|
-
// svgImage
|
|
135
|
-
type TSvgImageComponent = TBaseComponent & {
|
|
136
|
-
component: "svgImage";
|
|
137
|
-
url?: string | null;
|
|
138
|
-
fontColor?: string;
|
|
139
|
-
};
|
|
140
|
-
// Symbol
|
|
141
|
-
type TSymbolComponent = Omit<TTextComponent, "component" | "textType" | "text"> & {
|
|
142
|
-
component: "symbol";
|
|
143
|
-
// currently hardcoded, need to be updated
|
|
144
|
-
name: string;
|
|
145
|
-
};
|
|
146
|
-
// text
|
|
147
|
-
type TTextComponent = TBaseComponent & {
|
|
148
|
-
component: "text";
|
|
149
|
-
textType: "title" | "body" | "legal" | "text";
|
|
150
|
-
androidFontSize?: number;
|
|
151
|
-
fontSize?: number;
|
|
152
|
-
fontColor?: string;
|
|
153
|
-
fontName?: string;
|
|
154
|
-
text: string;
|
|
155
|
-
strikethrough?: boolean | string;
|
|
156
|
-
linkColor?: string;
|
|
157
|
-
};
|
|
158
|
-
// text-list
|
|
159
|
-
type TTextListComponent = Omit<TTextComponent, "component" | "text"> & {
|
|
160
|
-
component: "text-list";
|
|
161
|
-
texts: string[];
|
|
162
|
-
bulletComponent?: TSymbolComponent;
|
|
163
|
-
};
|
|
164
|
-
// videoUrl
|
|
165
|
-
type TVideoComponent = TBaseComponent & {
|
|
166
|
-
component: "videoUrl";
|
|
167
|
-
url?: string | null;
|
|
168
|
-
aspectRatio?: number;
|
|
169
|
-
imageCropping?: "fill" | "fit";
|
|
170
|
-
autoplayVideo?: boolean;
|
|
171
|
-
controlsType?: string;
|
|
172
|
-
fallbackImage?: string;
|
|
173
|
-
loopVideo?: boolean;
|
|
174
|
-
mute?: boolean;
|
|
175
|
-
};
|
|
176
|
-
// condition
|
|
177
|
-
type TConditionalComponent = TBaseComponent & {
|
|
178
|
-
component: "condition";
|
|
179
|
-
components?: TComponent[];
|
|
180
|
-
assertions?: TTestObject[];
|
|
181
|
-
orAssertions?: TTestObject[] | undefined;
|
|
182
|
-
};
|
|
183
|
-
// button
|
|
184
|
-
type TButtonContainer = TBaseComponent & {
|
|
185
|
-
id?: string;
|
|
186
|
-
component: "button";
|
|
187
|
-
sku?: NamiSKU;
|
|
188
|
-
components: Array<TTextComponent | TTextListComponent | TSpacerComponent | TImageComponent>;
|
|
189
|
-
screenreaderText?: string;
|
|
190
|
-
};
|
|
191
|
-
type UserAction = {
|
|
192
|
-
function: string;
|
|
193
|
-
parameters?: UserActionParameters;
|
|
194
|
-
};
|
|
195
|
-
type UserActionParameters = {
|
|
196
|
-
partialState?: Record<string, any>;
|
|
197
|
-
url?: string;
|
|
198
|
-
screen?: string;
|
|
199
|
-
promo?: string;
|
|
200
|
-
confirmationMessage?: string;
|
|
201
|
-
confirmBeforePurchase?: TTestObject[];
|
|
202
|
-
};
|
|
203
|
-
type Callback = (sku?: NamiSKU) => void;
|
|
204
|
-
// carouselContainer
|
|
205
|
-
type TCarouselContainer = Omit<TContainer, "component"> & {
|
|
206
|
-
component: "carouselContainer";
|
|
207
|
-
indicatorColor: string;
|
|
208
|
-
activeIndicatorColor: string;
|
|
209
|
-
autoplay: boolean;
|
|
210
|
-
autoplaySeconds: number;
|
|
211
|
-
};
|
|
212
|
-
type TCarouselSlidesState = {
|
|
213
|
-
[groupId: string]: {
|
|
214
|
-
[carouselName: string]: TCarouselSlide[];
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
type TCarouselSlide = {
|
|
218
|
-
id: string;
|
|
219
|
-
title: string;
|
|
220
|
-
[slideAttr: string]: any;
|
|
221
|
-
};
|
|
222
|
-
// flexProductContainer
|
|
223
|
-
type TFlexProductContainer = Omit<TContainer, "component"> & {
|
|
224
|
-
component: "flexProductContainer";
|
|
225
|
-
products: "all" | "subset";
|
|
226
|
-
flexDirection: FlexDirectionObject;
|
|
227
|
-
subsetGroup?: string;
|
|
228
|
-
productFeaturedComponents?: TContainer[];
|
|
229
|
-
productBaseComponents?: TContainer[];
|
|
230
|
-
};
|
|
231
|
-
type FlexDirectionObject = {
|
|
232
|
-
small: "vertical" | "horizontal";
|
|
233
|
-
medium: "vertical" | "horizontal";
|
|
234
|
-
large: "vertical" | "horizontal";
|
|
235
|
-
xlarge: "vertical" | "horizontal";
|
|
236
|
-
};
|
|
237
|
-
// productContainer
|
|
238
|
-
type TProductContainer = Omit<TContainer, "component"> & {
|
|
239
|
-
component: "productContainer";
|
|
240
|
-
products: "all" | "subset";
|
|
241
|
-
subsetGroup?: string;
|
|
242
|
-
productFeaturedComponents?: TContainer[];
|
|
243
|
-
productBaseComponents?: TContainer[];
|
|
244
|
-
};
|
|
245
|
-
// stack
|
|
246
|
-
type TStack = Omit<TContainer, "component"> & {
|
|
247
|
-
component: "stack";
|
|
248
|
-
};
|
|
249
|
-
type TCollapseContainer = TBaseComponent & {
|
|
250
|
-
component: "collapseContainer";
|
|
251
|
-
collapseHeader: TContainer;
|
|
252
|
-
components: TComponent[];
|
|
253
|
-
open: "collapse" | "open";
|
|
254
|
-
};
|
|
255
|
-
// type TBaseComponentMapped = {
|
|
256
|
-
// [K in keyof TBaseComponent]: TBaseComponent[K] extends number
|
|
257
|
-
// ? number | string
|
|
258
|
-
// : TBaseComponent[K];
|
|
259
|
-
// };
|
|
260
|
-
interface TBaseComponent {
|
|
261
|
-
id?: string;
|
|
262
|
-
title?: string;
|
|
263
|
-
component: string;
|
|
264
|
-
namiComponentType?: string;
|
|
265
|
-
grow?: boolean;
|
|
266
|
-
flag?: null | string;
|
|
267
|
-
context?: {
|
|
268
|
-
[key: string]: any;
|
|
269
|
-
};
|
|
270
|
-
moveX?: number | string;
|
|
271
|
-
moveY?: string | number;
|
|
272
|
-
direction?: DirectionType;
|
|
273
|
-
spacing?: number;
|
|
274
|
-
alignment?: AlignmentType;
|
|
275
|
-
leftPadding?: number;
|
|
276
|
-
rightPadding?: number;
|
|
277
|
-
topPadding?: number;
|
|
278
|
-
bottomPadding?: number;
|
|
279
|
-
leftMargin?: number;
|
|
280
|
-
rightMargin?: number;
|
|
281
|
-
topMargin?: number | string;
|
|
282
|
-
bottomMargin?: number;
|
|
283
|
-
fillColor?: string;
|
|
284
|
-
borderWidth?: number;
|
|
285
|
-
borderRadius?: number;
|
|
286
|
-
borderColor?: string;
|
|
287
|
-
borders?: Array<BorderSideType>;
|
|
288
|
-
focusedBorders?: Array<BorderSideType>;
|
|
289
|
-
focusedFillColor?: string;
|
|
290
|
-
focusedFontColor?: string;
|
|
291
|
-
focusedBorderColor?: string;
|
|
292
|
-
focusedBorderWidth?: number;
|
|
293
|
-
focusedBorderRadius?: number;
|
|
294
|
-
roundBorders?: Array<BorderLocationType>;
|
|
295
|
-
focusedRoundBorders?: Array<BorderLocationType>;
|
|
296
|
-
zIndex?: number;
|
|
297
|
-
conditionAttributes?: TConditionalAttributes;
|
|
298
|
-
height?: number | string;
|
|
299
|
-
width?: number | string;
|
|
300
|
-
dropShadow?: string;
|
|
301
|
-
onTap?: UserAction;
|
|
302
|
-
refId?: string;
|
|
303
|
-
_fields?: {
|
|
304
|
-
[attribute: string]: TFieldSettings;
|
|
305
|
-
} & {
|
|
306
|
-
_group: string;
|
|
307
|
-
_label: string;
|
|
308
|
-
_toggleAttr: string | null;
|
|
309
|
-
_toggleValue: any;
|
|
310
|
-
_collapsible: boolean;
|
|
311
|
-
_hint: string | null;
|
|
312
|
-
};
|
|
313
|
-
_fieldGroupLabel?: string;
|
|
314
|
-
_fieldLabel?: string;
|
|
315
|
-
_fieldHint?: string;
|
|
316
|
-
_fieldReadOnly?: boolean;
|
|
317
|
-
_fieldPlaceholder?: string;
|
|
318
|
-
_fieldDescription?: string;
|
|
319
|
-
_fieldOmit?: string[];
|
|
320
|
-
fixedHeight?: number;
|
|
321
|
-
fixedWidth?: number | "fitContent";
|
|
322
|
-
hidden?: boolean;
|
|
323
|
-
}
|
|
324
|
-
type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer;
|
|
325
|
-
type DirectionType = "vertical" | "horizontal";
|
|
326
|
-
type AlignmentType = "center" | "right" | "left" | "top" | "bottom";
|
|
327
|
-
type BorderLocationType = "upperLeft" | "upperRight" | "lowerLeft" | "lowerRight";
|
|
328
|
-
type BorderSideType = "left" | "right" | "top" | "bottom";
|
|
329
|
-
type TContainerPosition = `${"center" | "start" | "end"}-${"top" | "bottom" | "left" | "right"}`;
|
|
330
|
-
type TTestObject = {
|
|
331
|
-
value: any;
|
|
332
|
-
expected: any;
|
|
333
|
-
operator: "equals" | "contains" | "notEquals" | "set" | "notSet" | "notContains";
|
|
334
|
-
};
|
|
335
|
-
type TransformToString<T> = {
|
|
336
|
-
[P in keyof T]: T[P] extends number | boolean ? T[P] | string : T[P];
|
|
337
|
-
};
|
|
338
|
-
type TConditionalAttributes = Array<Omit<TConditionalComponent, "components"> & {
|
|
339
|
-
attributes: Partial<TransformToString<TBaseComponent>> & {
|
|
340
|
-
text?: string;
|
|
341
|
-
};
|
|
342
|
-
}>;
|
|
343
|
-
type TField = "image" | "listContainerComponent" | "text" | "url" | "textArea" | "fontSelect" | "splitTextArea" | "color" | "colorGradient" | "number" | "alignment" | "carouselSlides" | "option" | "iconSelect" | "toggle";
|
|
344
|
-
type TContainer = TBaseComponent & {
|
|
345
|
-
component: "container";
|
|
346
|
-
position?: TContainerPosition;
|
|
347
|
-
fillColor?: string;
|
|
348
|
-
fillImage?: string | null;
|
|
349
|
-
components: TComponent[];
|
|
350
|
-
loopVariable?: string;
|
|
351
|
-
loopSource?: any[];
|
|
352
|
-
};
|
|
353
|
-
// export type TContainerPosition = string;
|
|
354
|
-
type TFieldSettings = {
|
|
355
|
-
type: TField;
|
|
356
|
-
label: string;
|
|
357
|
-
hint: string | null;
|
|
358
|
-
description: string | null;
|
|
359
|
-
placeholder: string | null;
|
|
360
|
-
variable: string;
|
|
361
|
-
readOnly: boolean;
|
|
362
|
-
markdownHint: boolean;
|
|
363
|
-
options: {
|
|
364
|
-
label: string;
|
|
365
|
-
value: any;
|
|
366
|
-
}[] | null;
|
|
367
|
-
maxLimit: number | null;
|
|
368
|
-
minLimit: number | null;
|
|
369
|
-
aspectRatio: number | null;
|
|
370
|
-
newSlide?: TCarouselSlide;
|
|
371
|
-
carousel?: string;
|
|
372
|
-
darkModeVariable?: string;
|
|
373
|
-
conditions?: TTestObject[];
|
|
374
|
-
showOpacity?: boolean;
|
|
375
|
-
newRow?: any;
|
|
376
|
-
};
|
|
377
|
-
type NamiInitialConfig = {
|
|
378
|
-
appConfig?: IConfig;
|
|
379
|
-
platform_config?: IConfig;
|
|
380
|
-
products?: PaywallSKU[];
|
|
381
|
-
paywalls?: IPaywall[];
|
|
382
|
-
campaign_rules?: NamiCampaign[];
|
|
383
|
-
};
|
|
384
|
-
declare enum NamiPaywallAction {
|
|
385
|
-
BUY_SKU = "BUY_SKU",
|
|
386
|
-
SELECT_SKU = "SELECT_SKU",
|
|
387
|
-
RESTORE_PURCHASES = "RESTORE_PURCHASES",
|
|
388
|
-
SIGN_IN = "SIGN_IN",
|
|
389
|
-
CLOSE_PAYWALL = "CLOSE_PAYWALL",
|
|
390
|
-
SHOW_PAYWALL = "SHOW_PAYWALL",
|
|
391
|
-
PURCHASE_SELECTED_SKU = "PURCHASE_SELECTED_SKU",
|
|
392
|
-
PURCHASE_SUCCESS = "PURCHASE_SUCCESS",
|
|
393
|
-
PURCHASE_FAILED = "PURCHASE_FAILED",
|
|
394
|
-
PURCHASE_CANCELLED = "PURCHASE_CANCELLED",
|
|
395
|
-
PURCHASE_PENDING = "PURCHASE_PENDING",
|
|
396
|
-
PURCHASE_UNKNOWN = "PURCHASE_UNKNOWN",
|
|
397
|
-
PURCHASE_DEFERRED = "PURCHASE_DEFERRED",
|
|
398
|
-
DEEPLINK = "DEEPLINK",
|
|
399
|
-
TOGGLE_CHANGE = "TOGGLE_CHANGE",
|
|
400
|
-
PAGE_CHANGE = "PAGE_CHANGE",
|
|
401
|
-
SLIDE_CHANGE = "SLIDE_CHANGE",
|
|
402
|
-
COLLAPSIBLE_DRAWER_OPEN = "COLLAPSIBLE_DRAWER_OPEN",
|
|
403
|
-
COLLAPSIBLE_DRAWER_CLOSE = "COLLAPSIBLE_DRAWER_CLOSE",
|
|
404
|
-
VIDEO_STARTED = "VIDEO_STARTED",
|
|
405
|
-
VIDEO_PAUSED = "VIDEO_PAUSED",
|
|
406
|
-
VIDEO_RESUMED = "VIDEO_RESUMED",
|
|
407
|
-
VIDEO_ENDED = "VIDEO_ENDED",
|
|
408
|
-
VIDEO_CHANGED = "VIDEO_CHANGED",
|
|
409
|
-
VIDEO_MUTED = "VIDEO_MUTED",
|
|
410
|
-
VIDEO_UNMUTED = "VIDEO_UNMUTED",
|
|
411
|
-
UNKNOWN = "UNKNOWN"
|
|
412
|
-
}
|
|
413
|
-
type NamiPaywallEvent = {
|
|
414
|
-
action: NamiPaywallAction;
|
|
415
|
-
sku?: NamiSKU;
|
|
416
|
-
campaignId?: string;
|
|
417
|
-
campaignName?: string;
|
|
418
|
-
campaignType?: string;
|
|
419
|
-
campaignLabel?: string;
|
|
420
|
-
campaignUrl?: string;
|
|
421
|
-
paywallId?: string;
|
|
422
|
-
paywallName?: string;
|
|
423
|
-
componentChange?: NamiPaywallComponentChange;
|
|
424
|
-
segmentId?: string;
|
|
425
|
-
externalSegmentId: string | null;
|
|
426
|
-
deeplinkUrl?: string;
|
|
427
|
-
purchaseError?: string;
|
|
428
|
-
purchases?: NamiPurchase[];
|
|
429
|
-
timeSpentOnPaywall?: number;
|
|
430
|
-
};
|
|
431
|
-
type NamiPaywallActionHandler = (event: NamiPaywallEvent) => void;
|
|
432
|
-
type NamiPaywallLaunchContext = {
|
|
433
|
-
// Can contain multiple product group identifiers
|
|
434
|
-
productGroups?: string[];
|
|
435
|
-
// Key-value pairs used to override template values
|
|
436
|
-
customAttributes: {
|
|
437
|
-
[key: string]: string;
|
|
438
|
-
};
|
|
439
|
-
// Custom object used as data source for advanced paywall components
|
|
440
|
-
customObject?: {
|
|
441
|
-
[key: string]: any;
|
|
442
|
-
};
|
|
443
|
-
};
|
|
444
|
-
type NamiPaywallComponentChange = {
|
|
445
|
-
id?: string;
|
|
446
|
-
name?: string;
|
|
447
|
-
};
|
|
448
|
-
type NamiPaywallEventVideoMetadata = {
|
|
449
|
-
id?: string;
|
|
450
|
-
name?: string;
|
|
451
|
-
url?: string;
|
|
452
|
-
loopVideo: boolean;
|
|
453
|
-
muteByDefault: boolean;
|
|
454
|
-
autoplayVideo: boolean;
|
|
455
|
-
contentTimecode?: number;
|
|
456
|
-
contentDuration?: number;
|
|
457
|
-
};
|
|
458
|
-
type NamiPurchaseSource = "CAMPAIGN" | "MARKETPLACE" | "UNKNOWN";
|
|
459
|
-
type NamiPurchase = {
|
|
460
|
-
sku?: NamiSKU;
|
|
461
|
-
skuId: string;
|
|
462
|
-
transactionIdentifier?: string;
|
|
463
|
-
expires?: Date;
|
|
464
|
-
purchaseToken?: string;
|
|
465
|
-
purchaseInitiatedTimestamp?: Date;
|
|
466
|
-
purchaseSource?: NamiPurchaseSource;
|
|
467
|
-
};
|
|
468
|
-
type NamiPurchasesState = "pending" | "purchased" | "consumed" | "resubscribed" | "unsubscribed" | "deferred" | "failed" | "cancelled" | "unknown";
|
|
469
|
-
type NamiPurchaseDetails = {
|
|
470
|
-
skuId: string;
|
|
471
|
-
transactionId: string;
|
|
472
|
-
amount?: number;
|
|
473
|
-
currency?: string;
|
|
474
|
-
};
|
|
475
|
-
declare enum LaunchCampaignError {
|
|
476
|
-
DEFAULT_CAMPAIGN_NOT_FOUND = 0,
|
|
477
|
-
LABELED_CAMPAIGN_NOT_FOUND = 1,
|
|
478
|
-
CAMPAIGN_DATA_NOT_FOUND = 2,
|
|
479
|
-
PAYWALL_ALREADY_DISPLAYED = 3,
|
|
480
|
-
SDK_NOT_INITIALIZED = 4,
|
|
481
|
-
PAYWALL_COULD_NOT_DISPLAY = 5,
|
|
482
|
-
URL_CAMPAIGN_NOT_FOUND = 6,
|
|
483
|
-
PRODUCT_DATA_NOT_FOUND = 7,
|
|
484
|
-
PRODUCT_GROUPS_NOT_FOUND = 8
|
|
485
|
-
}
|
|
486
|
-
type TPaywallContext = TInitialState & {
|
|
487
|
-
paywallId: string;
|
|
488
|
-
livePaywalls: IPaywall[];
|
|
489
|
-
selectedPaywall?: IPaywall;
|
|
490
|
-
selectedCampaign?: NamiCampaign;
|
|
491
|
-
campaignRules: NamiCampaign[];
|
|
492
|
-
anySkuHasTrialOffer: boolean;
|
|
493
|
-
anySkuHasIntroOffer: boolean;
|
|
494
|
-
anySkuHasPromoOffer: boolean;
|
|
495
|
-
safeAreaTop: number;
|
|
496
|
-
slides?: TCarouselSlidesState;
|
|
497
|
-
currentPage: string;
|
|
498
|
-
fullScreenPresentation?: boolean;
|
|
499
|
-
isLoggedIn?: boolean;
|
|
500
|
-
darkMode?: boolean;
|
|
501
|
-
orientation: TDeviceOrientation;
|
|
502
|
-
focusedState: boolean;
|
|
503
|
-
platformId: string;
|
|
504
|
-
mediaList: {
|
|
505
|
-
[key: string]: any;
|
|
506
|
-
};
|
|
507
|
-
customer: {
|
|
508
|
-
[key: string]: any;
|
|
509
|
-
};
|
|
510
|
-
hasNotch: boolean;
|
|
511
|
-
skuItems: PaywallSKU[];
|
|
512
|
-
groups: {
|
|
513
|
-
id: string;
|
|
514
|
-
displayName: string;
|
|
515
|
-
ref: string;
|
|
516
|
-
}[];
|
|
517
|
-
currentGroupId: string;
|
|
518
|
-
selectedProducts: {
|
|
519
|
-
[currentGroupId: string]: string;
|
|
520
|
-
};
|
|
521
|
-
launch: TPaywallLaunchContext;
|
|
522
|
-
sku: {
|
|
523
|
-
[key: string]: any;
|
|
524
|
-
};
|
|
525
|
-
purchaseInProgress: boolean;
|
|
526
|
-
productBeingPurchased?: NamiSKU;
|
|
527
|
-
timeSpentOnPaywall?: number;
|
|
528
|
-
};
|
|
529
|
-
type TPaywallLaunchContext = NamiPaywallLaunchContext;
|
|
530
|
-
interface IPaywall {
|
|
531
|
-
id: string;
|
|
532
|
-
name: string;
|
|
533
|
-
paywall_type: string;
|
|
534
|
-
sku_menus: ISkuMenu[];
|
|
535
|
-
template: TPaywallTemplate;
|
|
536
|
-
fonts: FontCollection;
|
|
537
|
-
}
|
|
538
|
-
interface ISkuMenu {
|
|
539
|
-
id: string;
|
|
540
|
-
name: string;
|
|
541
|
-
display_name: string;
|
|
542
|
-
ref: string;
|
|
543
|
-
products: PaywallSKU[];
|
|
544
|
-
}
|
|
545
|
-
interface IEntitlements {
|
|
546
|
-
id: string;
|
|
547
|
-
entitlement_ref_id: string;
|
|
548
|
-
name: string;
|
|
549
|
-
description: string | null;
|
|
550
|
-
type: string;
|
|
551
|
-
}
|
|
552
|
-
type FontCollection = {
|
|
553
|
-
[fontName: string]: FontDetails;
|
|
554
|
-
};
|
|
555
|
-
type FontDetails = {
|
|
556
|
-
id: string;
|
|
557
|
-
family: string;
|
|
558
|
-
style: string;
|
|
559
|
-
file: string;
|
|
560
|
-
};
|
|
561
|
-
type TPaywallTemplate = {
|
|
562
|
-
id: string;
|
|
563
|
-
orgs?: string | null;
|
|
564
|
-
org_id: string | null;
|
|
565
|
-
changelog?: string;
|
|
566
|
-
userHasAccess?: boolean;
|
|
567
|
-
media?: {
|
|
568
|
-
[key: string]: string;
|
|
569
|
-
};
|
|
570
|
-
pages: TPages[];
|
|
571
|
-
ready?: boolean;
|
|
572
|
-
version: string | number;
|
|
573
|
-
codename: string;
|
|
574
|
-
doc_link: string;
|
|
575
|
-
thumbnail?: string;
|
|
576
|
-
skuContexts?: {
|
|
577
|
-
[skuId: string]: {
|
|
578
|
-
[key: string]: any;
|
|
579
|
-
};
|
|
580
|
-
};
|
|
581
|
-
initialState: TInitialState;
|
|
582
|
-
min_sdk_version: string;
|
|
583
|
-
capabilities?: string[];
|
|
584
|
-
displaySingleGroup?: boolean;
|
|
585
|
-
};
|
|
586
|
-
type TPages = {
|
|
587
|
-
name: string;
|
|
588
|
-
header: Array<TButtonContainer | TSpacerComponent | TTextComponent | TContainer>;
|
|
589
|
-
contentContainer: TContainer | null;
|
|
590
|
-
footer: TComponent[] | null;
|
|
591
|
-
backgroundContainer: TContainer | null;
|
|
592
|
-
};
|
|
593
|
-
type TInitialState = {
|
|
594
|
-
slides?: TCarouselSlidesState;
|
|
595
|
-
currentPage: string;
|
|
596
|
-
fullScreenPresentation?: boolean;
|
|
597
|
-
isLoggedIn?: boolean;
|
|
598
|
-
[key: string]: any;
|
|
599
|
-
groups: {
|
|
600
|
-
id: string;
|
|
601
|
-
displayName: string;
|
|
602
|
-
ref: string;
|
|
603
|
-
}[];
|
|
604
|
-
currentGroupId: string;
|
|
605
|
-
selectedProducts: {
|
|
606
|
-
[currentGroupId: string]: string;
|
|
607
|
-
};
|
|
608
|
-
};
|
|
609
|
-
type PaywallResultHandler = (success: boolean, error?: LaunchCampaignError) => void;
|
|
610
|
-
interface IConfig {
|
|
611
|
-
id: string;
|
|
612
|
-
capabilities: string[];
|
|
613
|
-
marketplace_app_id?: string | null;
|
|
614
|
-
}
|
|
615
|
-
type NamiConfiguration$0 = {
|
|
616
|
-
appPlatformID: string;
|
|
617
|
-
logLevel?: NamiLogLevel;
|
|
618
|
-
namiLanguageCode?: NamiLanguageCodes;
|
|
619
|
-
namiCommands?: string[];
|
|
620
|
-
initialConfig?: string | InitialConfig;
|
|
621
|
-
formFactor?: TDevice;
|
|
622
|
-
};
|
|
623
|
-
type InitialConfig = {
|
|
624
|
-
appConfig?: IConfig;
|
|
625
|
-
platform_config?: IConfig;
|
|
626
|
-
products?: PaywallSKU[];
|
|
627
|
-
paywalls?: IPaywall[];
|
|
628
|
-
campaign_rules?: NamiCampaign[];
|
|
629
|
-
};
|
|
630
|
-
type NamiConfigurationState = {
|
|
631
|
-
sdkInitialized: boolean;
|
|
632
|
-
configureState: string;
|
|
633
|
-
};
|
|
634
|
-
declare class Nami {
|
|
635
|
-
#private;
|
|
636
|
-
static instance: Nami;
|
|
637
|
-
get isInitialized(): boolean;
|
|
638
|
-
static configure(options: NamiConfiguration$0): Promise<NamiConfigurationState>;
|
|
639
|
-
private static setInitialConfig;
|
|
640
|
-
private initializeSDK;
|
|
641
|
-
}
|
|
642
|
-
declare class ContextConsumer implements ReactiveController {
|
|
643
|
-
host: ReactiveControllerHost;
|
|
644
|
-
state: TPaywallContext;
|
|
645
|
-
constructor(host: ReactiveControllerHost);
|
|
646
|
-
handleStateChange(): void;
|
|
647
|
-
// Implementing ReactiveController interface methods
|
|
648
|
-
hostConnected(): void;
|
|
649
|
-
hostDisconnected(): void;
|
|
650
|
-
}
|
|
651
|
-
declare class NamiElement extends LitElement {
|
|
652
|
-
contextConsumer: ContextConsumer;
|
|
653
|
-
constructor();
|
|
654
|
-
protected styles(): CSSResult;
|
|
655
|
-
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
656
|
-
protected willUpdate(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
657
|
-
disconnectedCallback(): void;
|
|
658
|
-
}
|
|
659
|
-
declare class PaywallComponent extends NamiElement {
|
|
660
|
-
formFactor: TDevice;
|
|
661
|
-
campaign: NamiCampaign;
|
|
662
|
-
paywall: IPaywall;
|
|
663
|
-
paywallEvent: Partial<NamiPaywallEvent>;
|
|
664
|
-
constructor(paywall: IPaywall, event: Partial<NamiPaywallEvent>, campaign?: NamiCampaign, context?: TPaywallLaunchContext);
|
|
665
|
-
setPaywallData(paywall: IPaywall, campaign: NamiCampaign): void;
|
|
666
|
-
firstUpdated(): void;
|
|
667
|
-
private postImpression;
|
|
668
|
-
private getTemplate;
|
|
669
|
-
styles(): import("lit").CSSResult;
|
|
670
|
-
render(): TemplateResult;
|
|
671
|
-
}
|
|
672
|
-
declare class NamiCampaignManager {
|
|
673
|
-
static instance: NamiCampaignManager;
|
|
674
|
-
private emitter;
|
|
675
|
-
static allCampaigns(): NamiCampaign[];
|
|
676
|
-
/**
|
|
677
|
-
* Checks if a campaign is available for a given argument.
|
|
678
|
-
* The argument can be a label string, or a deeplink URL.
|
|
679
|
-
*
|
|
680
|
-
* @param label - The argument to check. Can be a label string, or a deeplink URL.
|
|
681
|
-
* @returns True if the campaign is available, false otherwise.
|
|
682
|
-
*/
|
|
683
|
-
static isCampaignAvailable(label: string): boolean;
|
|
684
|
-
/**
|
|
685
|
-
* Asks Nami to fetch the latest active campaigns for this device
|
|
686
|
-
*
|
|
687
|
-
* @returns list of campaigns
|
|
688
|
-
*/
|
|
689
|
-
static refresh(): Promise<NamiCampaign[]>;
|
|
690
|
-
static registerAvailableCampaignsHandler(handler: AvailableCampaignsResponseHandler): Callback;
|
|
691
|
-
/**
|
|
692
|
-
* Launches a campaign with a given label.
|
|
693
|
-
* @param label - The label of the campaign to launch.
|
|
694
|
-
* @param withUrl - The deeplink URL of the campaign to launch.
|
|
695
|
-
* @param actionCallback - Optional handler for paywall actions.
|
|
696
|
-
* @returns - The launched paywall web component.
|
|
697
|
-
*/
|
|
698
|
-
static launch(label?: string, withUrl?: string, context?: TPaywallLaunchContext, resultCallback?: PaywallResultHandler, actionCallback?: NamiPaywallActionHandler): PaywallComponent | void;
|
|
699
|
-
/**
|
|
700
|
-
* Private Instance Methods
|
|
701
|
-
*/
|
|
702
|
-
private get sdkInitialized();
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* Represents the possible actions that can be performed on the account state.
|
|
706
|
-
*/
|
|
707
|
-
declare enum AccountStateAction {
|
|
708
|
-
LOGIN = "login",
|
|
709
|
-
LOGOUT = "logout",
|
|
710
|
-
ADVERTISING_ID_SET = "advertising_id_set",
|
|
711
|
-
ADVERTISING_ID_CLEARED = "advertising_id_cleared",
|
|
712
|
-
VENDOR_ID_SET = "vendor_id_set",
|
|
713
|
-
VENDOR_ID_CLEARED = "vendor_id_cleared",
|
|
714
|
-
CUSTOMER_DATA_PLATFORM_ID_SET = "customer_data_platform_id_set",
|
|
715
|
-
CUSTOMER_DATA_PLATFORM_ID_CLEARED = "customer_data_platform_id_cleared",
|
|
716
|
-
ANONYMOUS_MODE_ON = "anonymous_mode_on",
|
|
717
|
-
ANONYMOUS_MODE_OFF = "anonymous_mode_off",
|
|
718
|
-
NAMI_DEVICE_ID_SET = "nami_device_id_set",
|
|
719
|
-
NAMI_DEVICE_ID_CLEARED = "nami_device_id_cleared"
|
|
720
|
-
}
|
|
721
|
-
type AccountStateHandler = (action: AccountStateAction, success: boolean, error?: Error) => void;
|
|
722
|
-
/**
|
|
723
|
-
* NamiCustomerManager provides methods for managing customer-related functionality.
|
|
724
|
-
*/
|
|
725
|
-
declare class NamiCustomerManager {
|
|
726
|
-
static instance: NamiCustomerManager;
|
|
727
|
-
private emitter;
|
|
728
|
-
/**
|
|
729
|
-
* Checks if the customer is logged in.
|
|
730
|
-
*
|
|
731
|
-
* @returns {boolean} Returns true if the customer is logged in, false otherwise.
|
|
732
|
-
*/
|
|
733
|
-
static isLoggedIn(): boolean;
|
|
734
|
-
/**
|
|
735
|
-
* Returns the external ID of the currently logged in user.
|
|
736
|
-
*
|
|
737
|
-
* @returns The external ID of the logged in user.
|
|
738
|
-
*/
|
|
739
|
-
static loggedInId(): string | undefined;
|
|
740
|
-
/**
|
|
741
|
-
* Logs in a customer with the specified ID.
|
|
742
|
-
*
|
|
743
|
-
* @param id - The ID of the customer to log in. Must be a SHA256 hash or UUID.
|
|
744
|
-
* @returns A Promise that resolves when the login is successful.
|
|
745
|
-
*/
|
|
746
|
-
static login(externalId: string): Promise<void>;
|
|
747
|
-
static logout(): Promise<void>;
|
|
748
|
-
static setCustomerDataPlatformId(id: string): Promise<void>;
|
|
749
|
-
static clearCustomerDataPlatformId(): Promise<void>;
|
|
750
|
-
/**
|
|
751
|
-
* Registers a callback function to handle changes in the account state.
|
|
752
|
-
*
|
|
753
|
-
* @param callback - The callback function to be registered.
|
|
754
|
-
* @returns A function that can be used to unregister the original callback.
|
|
755
|
-
*/
|
|
756
|
-
static registerAccountStateHandler(callback: AccountStateHandler): Callback;
|
|
757
|
-
/**
|
|
758
|
-
* Sets the anonymous mode for the customer.
|
|
759
|
-
*
|
|
760
|
-
* @param enabled - A boolean value indicating whether the anonymous mode should be enabled or disabled.
|
|
761
|
-
* @returns A Promise that resolves when the anonymous mode is set.
|
|
762
|
-
*/
|
|
763
|
-
static setAnonymousMode(enabled: boolean): Promise<void>;
|
|
764
|
-
/**
|
|
765
|
-
* Returns whether or not the SDK is currently operating in anonymous mode
|
|
766
|
-
*/
|
|
767
|
-
static inAnonymousMode(): boolean;
|
|
768
|
-
/**
|
|
769
|
-
* Sets an optional customer attributes that can be used to personalize your Nami paywalls.
|
|
770
|
-
*
|
|
771
|
-
* @param key - The name of the attribute. For example: `firstName`.
|
|
772
|
-
* @param value - The value of the customer attribute. For example: `Joe`.
|
|
773
|
-
*/
|
|
774
|
-
static setCustomerAttribute(key: string, value: string): void;
|
|
775
|
-
/**
|
|
776
|
-
* Retrieves the value for a given key in the on-device customer attribute key/value store.
|
|
777
|
-
*
|
|
778
|
-
* @param key - The name of the attribute. For example: `firstName`
|
|
779
|
-
* @returns The value of the customer attribute.
|
|
780
|
-
*/
|
|
781
|
-
static getCustomerAttribute(key: string): string | null;
|
|
782
|
-
/**
|
|
783
|
-
* Clears a value of the given key in the on-device key/value store.
|
|
784
|
-
*
|
|
785
|
-
* @param key - The key of the customer attribute to clear.
|
|
786
|
-
*/
|
|
787
|
-
static clearCustomerAttribute(key: string): void;
|
|
788
|
-
/**
|
|
789
|
-
* Clear all customer attributes from the on-device key/value store.
|
|
790
|
-
*
|
|
791
|
-
*/
|
|
792
|
-
static clearAllCustomerAttributes(): void;
|
|
793
|
-
/**
|
|
794
|
-
* Private Static Methods
|
|
795
|
-
*/
|
|
796
|
-
private static invokeStateHandler;
|
|
797
|
-
/**
|
|
798
|
-
* Private Instance Methods
|
|
799
|
-
*/
|
|
800
|
-
private get isSDKInitialized();
|
|
801
|
-
private static updateCustomerDataPlatformId;
|
|
802
|
-
/**
|
|
803
|
-
* Returns whether or not the configured app platform id belongs to an anonymous mode
|
|
804
|
-
* capable Nami account.
|
|
805
|
-
*/
|
|
806
|
-
private static anonymousModeCapability;
|
|
807
|
-
private static refetchConfig;
|
|
808
|
-
}
|
|
809
|
-
declare class NamiPaywallManager {
|
|
810
|
-
static instance: NamiPaywallManager;
|
|
811
|
-
private emitter;
|
|
812
|
-
productDetails: NamiProductDetails[];
|
|
813
|
-
static allPaywalls(): IPaywall[];
|
|
814
|
-
static setProductDetails(productDetails: NamiProductDetails[]): void;
|
|
815
|
-
static registerSignInHandler(handler: Callback): Callback;
|
|
816
|
-
static registerCloseHandler(handler: Callback): Callback;
|
|
817
|
-
static registerDeeplinkActionHandler(handler: Callback): Callback;
|
|
818
|
-
static registerBuySkuHandler(handler: Callback): Callback;
|
|
819
|
-
static registerRestoreHandler(handler: Callback): Callback;
|
|
820
|
-
/**
|
|
821
|
-
* Notify the NamiPaywallManager that a purchase initiated from the
|
|
822
|
-
* [NamiBuySkuHandler] is complete. Only available for plans where Nami is
|
|
823
|
-
* not handling subscription & IAP management.
|
|
824
|
-
*/
|
|
825
|
-
static buySkuComplete(purchase: NamiPurchaseDetails): Promise<void>;
|
|
826
|
-
/**
|
|
827
|
-
Notify the NamiPaywallManager that purchase flow handled by you is cancelled.
|
|
828
|
-
Used to disable product purchase-in-progress loading indicators
|
|
829
|
-
*/
|
|
830
|
-
static buySkuCancel(): void;
|
|
831
|
-
/**
|
|
832
|
-
* Set the video details for the app supplied video
|
|
833
|
-
* @param url The URL of the video
|
|
834
|
-
* @param name The name of the video
|
|
835
|
-
*/
|
|
836
|
-
static setAppSuppliedVideoDetails(url: string, name?: string): void;
|
|
837
|
-
/**
|
|
838
|
-
* Private Instance Methods
|
|
839
|
-
*/
|
|
840
|
-
private get sdkInitialized();
|
|
841
|
-
}
|
|
842
|
-
type NamiEntitlement$0 = {
|
|
843
|
-
activePurchases: NamiPurchase[];
|
|
844
|
-
desc: string;
|
|
845
|
-
name: string;
|
|
846
|
-
namiId: string;
|
|
847
|
-
purchasedSkus: NamiSKU[];
|
|
848
|
-
referenceId: string;
|
|
849
|
-
relatedSkus: NamiSKU[];
|
|
850
|
-
};
|
|
851
|
-
type NamiActiveEntitlementsHandler = (entitlement: NamiEntitlement$0[]) => void;
|
|
852
|
-
declare class NamiEntitlementManager {
|
|
853
|
-
static instance: NamiEntitlementManager;
|
|
854
|
-
private emitter;
|
|
855
|
-
/**
|
|
856
|
-
* @returns list of currently active entitlements
|
|
857
|
-
*/
|
|
858
|
-
static active(): NamiEntitlement$0[];
|
|
859
|
-
/**
|
|
860
|
-
* Checks if a Nami Control Center defined Entitlement has at least one backing purchase
|
|
861
|
-
* and it's not expired.
|
|
862
|
-
*
|
|
863
|
-
* @param referenceId - entitlement referenceId
|
|
864
|
-
* @returns True if the entitlement is active for given referenceId, false otherwise.
|
|
865
|
-
*/
|
|
866
|
-
static isEntitlementActive(referenceId: string): boolean;
|
|
867
|
-
/**
|
|
868
|
-
* Asks Nami to fetch the latest active entitlements
|
|
869
|
-
*
|
|
870
|
-
* @returns list of NamiEntitlement
|
|
871
|
-
*/
|
|
872
|
-
static refresh(): Promise<NamiEntitlement$0[]>;
|
|
873
|
-
static registerActiveEntitlementsHandler(handler: NamiActiveEntitlementsHandler): Callback | undefined;
|
|
874
|
-
/**
|
|
875
|
-
* Private Instance Methods
|
|
876
|
-
*/
|
|
877
|
-
private get sdkInitialized();
|
|
878
|
-
}
|
|
879
|
-
export { Nami, NamiCampaignManager, NamiCustomerManager, NamiPaywallManager, NamiEntitlementManager, NamiInitialConfig, NamiConfiguration$0 as NamiConfiguration, NamiCampaign, NamiCampaignRuleType, NamiSKU, NamiSKUType, NamiPaywallAction, NamiPaywallEvent, NamiPaywallActionHandler, NamiPaywallLaunchContext, NamiPaywallComponentChange, NamiPaywallEventVideoMetadata, NamiProductDetails, NamiProductOffer, NamiSubscriptionInterval, NamiSubscriptionPeriod, NamiPurchase, NamiPurchasesState, NamiPurchaseDetails, NamiLanguageCodes, NamiEntitlement$0 as NamiEntitlement };
|
|
1
|
+
import "./utils/ssr-shim";
|
|
2
|
+
export { Nami } from "./nami";
|
|
3
|
+
export { NamiCampaignManager } from "./nami/campaign";
|
|
4
|
+
export { NamiCustomerManager } from "./nami/customer";
|
|
5
|
+
export { NamiPaywallManager } from "./nami/paywalls";
|
|
6
|
+
export { NamiEntitlementManager } from "./nami/entitlement";
|
|
7
|
+
export * from "./types/externals";
|
|
8
|
+
import "./components";
|