@bprotsyk/aso-core 1.1.7 → 1.1.9

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.
Files changed (35) hide show
  1. package/lib/aso/offer/aso-customized-offer.d.ts +1 -1
  2. package/lib/aso/offer/aso-offer-section.d.ts +1 -1
  3. package/lib/aso/offer/config/aso-config-v0.d.ts +271 -0
  4. package/lib/aso/offer/config/aso-config-v0.js +57 -0
  5. package/lib/aso/offer/config/aso-config-v1.d.ts +263 -0
  6. package/lib/aso/offer/config/aso-config-v1.js +57 -0
  7. package/lib/aso/offer/config/aso-config-v2.d.ts +230 -0
  8. package/lib/aso/offer/config/aso-config-v2.js +55 -0
  9. package/lib/aso/offer/config/aso-config-v3.d.ts +227 -0
  10. package/lib/aso/offer/config/aso-config-v3.js +56 -0
  11. package/lib/aso/offer/config/aso-config-v4.d.ts +205 -0
  12. package/lib/aso/offer/config/aso-config-v4.js +56 -0
  13. package/lib/aso/offer/config/aso-default-config.d.ts +56 -0
  14. package/lib/aso/offer/config/aso-single-response.d.ts +5 -0
  15. package/lib/index.d.ts +5 -4
  16. package/lib/shared/push.d.ts +6 -0
  17. package/lib/shared/push.js +2 -0
  18. package/lib/shared/single-offer.d.ts +6 -0
  19. package/lib/shared/single-offer.js +2 -0
  20. package/package.json +2 -2
  21. package/src/aso/offer/aso-customized-offer.ts +1 -1
  22. package/src/aso/offer/aso-offer-section.ts +1 -1
  23. package/src/aso/offer/config/aso-config-v0.ts +428 -0
  24. package/src/aso/offer/config/aso-config-v1.ts +422 -0
  25. package/src/aso/offer/config/aso-config-v2.ts +377 -0
  26. package/src/aso/offer/config/aso-config-v3.ts +376 -0
  27. package/src/aso/offer/config/aso-config-v4.ts +300 -0
  28. package/src/aso/offer/config/aso-default-config.ts +66 -0
  29. package/src/aso/offer/config/aso-single-response.ts +6 -0
  30. package/src/index.ts +5 -4
  31. package/src/shared/push.ts +6 -0
  32. package/src/shared/single-offer.ts +6 -0
  33. package/lib/aso/aso-offer-sections.d.ts +0 -6
  34. /package/lib/aso/{aso-offer-response.js → offer/config/aso-default-config.js} +0 -0
  35. /package/lib/aso/{aso-offer-sections.js → offer/config/aso-single-response.js} +0 -0
@@ -0,0 +1,422 @@
1
+ import { DefaultConfig } from "./aso-default-config"
2
+
3
+ interface AuthorizationActionMapping {
4
+ hasNextAction: string,
5
+ nextActionIn: string,
6
+ changeNumberCaption: string,
7
+ nextActionCaption: string,
8
+ nextActionPatternCaption: string,
9
+ actualTitlePattern: string,
10
+ expiredTitlePattern: string,
11
+ subtitle: string,
12
+ when: string,
13
+ authorized: string,
14
+ canChangeNumber: string
15
+ }
16
+
17
+ export interface ASOConfig_v1 {
18
+ id: number,
19
+ name: string,
20
+ email: string,
21
+ bundle: string,
22
+ skipping?: boolean,
23
+ alghoritm?: string,
24
+ ip: string,
25
+ sshPassword: string,
26
+ trackingLink: string,
27
+ clientSideValidation: boolean,
28
+ host: string,
29
+ fullAccess: boolean,
30
+
31
+ appsflyerKey: string,
32
+ onesignalKey: string,
33
+ onesignalRestApiKey?: string,
34
+
35
+ showVideo: boolean,
36
+ appsflyerEnabled: boolean,
37
+ singleFirst: boolean,
38
+ authAdEnabled: boolean,
39
+ allowedCountries: string,
40
+ excludedCountries: string,
41
+
42
+ supportUrl?: string,
43
+ support?: {[key: string]: string},
44
+
45
+ privacyPolicyUrl: string,
46
+ callCoolDown: number,
47
+ smsCoolDown: number,
48
+ maxSmsTries: number,
49
+ maxCallTries: number,
50
+ smscLogin: string,
51
+ smscPassword: string,
52
+ autoSmsCodeCatch: boolean,
53
+ autoCallCodeCatch: boolean,
54
+
55
+ localization?: LocalizationMap | Localization,
56
+ authorizationActionMapping: AuthorizationActionMapping,
57
+ offersSectionMapping: IOfferSectionMapping
58
+ configMapping: ConfigMapping,
59
+
60
+ configEndpoint: string,
61
+ offersEndpoint: string,
62
+ offerEndpoint: string,
63
+ nextActionEndpoint: string,
64
+ currentActionEndpoint: string,
65
+ codeValidationEndpoint: string,
66
+ changeNumberEndpoint: string,
67
+ imageEndpoint: string,
68
+
69
+ categoriesQuery: string,
70
+ phoneQuery: string,
71
+ nameQuery: string,
72
+ codeQuery: string
73
+ validityQuery: string,
74
+ resetUserQuery: string,
75
+ oldPhoneQuery: string,
76
+ newPhoneQuery: string,
77
+ appsflyerDataQuery: string,
78
+ offerIdParameter: string,
79
+ countryCodeParameter?: string,
80
+
81
+ redirectHtmlName: string,
82
+ redirectJsName: string,
83
+ redirectFolderName?: string,
84
+
85
+ apiPrefix?: string,
86
+ emptyEmojiRequired?: boolean,
87
+
88
+ skipCode: boolean,
89
+ externalIpGeo: boolean,
90
+ exportedTranslations?: boolean,
91
+ newTrackingLink?: string,
92
+ readyForPanel?: boolean,
93
+
94
+ version: number
95
+ }
96
+
97
+
98
+ interface ISectionPalette {
99
+ titleBorder: string
100
+ titleText: string
101
+ offerBorder: string
102
+ buttonBorder: string
103
+ buttonBackground: string
104
+ buttonBackgroundPressed: string
105
+ buttonText: string,
106
+ emojiBackground: string,
107
+ emojiBorder: string,
108
+ emojiCaptionBorder: string,
109
+ emojiCaptionBackground: string,
110
+ emojiCaption: string
111
+ }
112
+
113
+ interface IOfferResult {
114
+ id: string,
115
+ backgroundImage: string,
116
+ foregroundImage: string,
117
+ emoji: IOfferResultEmoji | null,
118
+ buttonText: string
119
+ }
120
+
121
+ interface IOfferResultEmoji {
122
+ emoji: string | null,
123
+ caption: string | null,
124
+ }
125
+
126
+ interface IOffersSection {
127
+ id: number,
128
+ offers: IOfferResult[]
129
+ title: string
130
+ palette: ISectionPalette
131
+ }
132
+
133
+ interface ISectionPaletteMapping {
134
+ titleBorder: string
135
+ titleText: string
136
+ offerBorder: string
137
+ buttonBorder: string
138
+ buttonBackground: string
139
+ buttonBackgroundPressed: string
140
+ buttonText: string,
141
+ emojiBackground: string,
142
+ emojiBorder: string,
143
+ emojiCaptionBorder: string,
144
+ emojiCaptionBackground: string,
145
+ emojiCaption: string
146
+ }
147
+
148
+ interface IOfferSectionMapping {
149
+ id: string,
150
+ offers: string
151
+ title: string
152
+ palette: string,
153
+ internal: [string, any][]
154
+ }
155
+
156
+ interface IOfferResultMapping {
157
+ id: string,
158
+ backgroundImage: string,
159
+ foregroundImage: string,
160
+ emoji: string,
161
+ emojiCaption: string,
162
+ buttonText: string,
163
+ mappingName: string,
164
+ }
165
+
166
+ interface Localization {
167
+ numberWillReceiveACallPattern: string,
168
+ numberReceivedACallPattern: string,
169
+ numberReceivedASmsPattern: string,
170
+ numberWillReceiveASmsPattern: string,
171
+ enterLastFourDigits: string,
172
+ enterCodeFromSms: string,
173
+ callAgainSPattern: string,
174
+ callAgain: string,
175
+ smsAgain: string,
176
+ smsAgainSPattern: string,
177
+ changeNumber: string,
178
+ sendSms: string,
179
+ sendSmsSPattern: string,
180
+ hhMm: string,
181
+ unfortunatelyYourTriesLeft: string,
182
+
183
+ introDialog_title: string,
184
+ introDialog_message: string,
185
+ introDialog_exit: string
186
+ introDialog_cancel: string,
187
+
188
+ error_phone: string,
189
+ error_name: string,
190
+ error_server: string,
191
+ error_invalidCode: string
192
+
193
+ changeNumber_title: string,
194
+ changeNumber_message: string,
195
+ changeNumber_no: string,
196
+ changeNumber_yes: string,
197
+
198
+ next_title: string,
199
+ next_message: string,
200
+ next_yes: string,
201
+ next_no: string,
202
+
203
+ yes: string,
204
+ no: string,
205
+ cancel: string,
206
+ mainButton: string,
207
+ codeButton: string,
208
+ demoMode: string,
209
+ yourLevel: string,
210
+ supportCaption: string,
211
+ somethingWentWrong: string
212
+
213
+ game_spin: string,
214
+ game_balance: string,
215
+ game_balance_pattern: string,
216
+ game_win: string,
217
+ game_win_pattern: string,
218
+ game_authorize: string,
219
+ game_demo_welcome: string,
220
+ game_demo_available_after_auth: string,
221
+ game_min_rate_error_pattern: string,
222
+
223
+ auth_changeTitle: string,
224
+ auth_changeMessage: string,
225
+
226
+ auth_titleTop: ColoredString,
227
+ auth_titleBottom: ColoredString,
228
+ auth_subtitle: ColoredString
229
+ auth_nameHint: string,
230
+ auth_changeNumber: string,
231
+ auth_enterAsGuest: string,
232
+ auth_privacyPolicyAcceptance: string,
233
+ auth_privacyPolicy: ColoredString
234
+ }
235
+
236
+ interface ColoredString {
237
+ text: string,
238
+ colors: ColoredSpan[]
239
+ mappingName: string
240
+ }
241
+
242
+ interface ColoredSpan {
243
+ from: number,
244
+ to: number,
245
+ color: string
246
+ }
247
+
248
+ interface ColoredStringMapping {
249
+ text: string,
250
+ colors: string,
251
+ internal: [string, ColoredSpanMapping][]
252
+ }
253
+
254
+ interface ColoredSpanMapping {
255
+ from: string,
256
+ to: string,
257
+ color: string
258
+ }
259
+
260
+ interface ConfigMapping {
261
+ id: string,
262
+ fullAccess: string,
263
+ showVideo: string,
264
+ skipping?: string,
265
+ alghoritm?: string,
266
+ appsflyerEnabled: string,
267
+ appsflyerKey: string,
268
+ onesignalKey: string,
269
+ singleFirst: string,
270
+ allowedCountries: string,
271
+ excludedCountries: string,
272
+ supportUrl: string,
273
+ privacyPolicyUrl: string,
274
+ callCoolDown: string,
275
+ smsCoolDown: string,
276
+ maxSmsTries: string,
277
+ maxCallTries: string,
278
+ smscLogin: string,
279
+ smscPassword: string,
280
+ autoSmsCodeCatch: string,
281
+ autoCallCodeCatch: string,
282
+ localization: string,
283
+ internal: [string, LocalizationMapping][],
284
+ }
285
+
286
+ interface LocalizationMap {
287
+ [key: string]: Localization
288
+ }
289
+
290
+ interface LocalizationMapping {
291
+ numberWillReceiveACallPattern: string,
292
+ numberReceivedACallPattern: string,
293
+ numberReceivedASmsPattern: string,
294
+ numberWillReceiveASmsPattern: string,
295
+ enterLastFourDigits: string,
296
+ enterCodeFromSms: string,
297
+ callAgainSPattern: string,
298
+ callAgain: string,
299
+ smsAgain: string,
300
+ smsAgainSPattern: string,
301
+ sendSms: string,
302
+ sendSmsSPattern: string,
303
+ hhMm: string,
304
+ unfortunatelyYourTriesLeft: string
305
+
306
+ game_spin: string,
307
+ game_balance: string,
308
+ game_balance_pattern: string,
309
+ game_win: string,
310
+ game_win_pattern: string
311
+ game_authorize: string,
312
+ game_demo_welcome: string,
313
+ game_demo_available_after_auth: string,
314
+ game_min_rate_error_pattern: string,
315
+
316
+ introDialog_title: string,
317
+ introDialog_message: string,
318
+ introDialog_exit: string
319
+ introDialog_cancel: string,
320
+
321
+ error_phone: string,
322
+ error_name: string,
323
+ error_server: string,
324
+ error_invalidCode: string
325
+
326
+ changeNumber_title: string,
327
+ changeNumber_message: string,
328
+ changeNumber_no: string,
329
+ changeNumber_yes: string,
330
+
331
+ next_title: string,
332
+ next_message: string,
333
+ next_yes: string,
334
+ next_no: string,
335
+
336
+ yes: string,
337
+ no: string,
338
+ cancel: string,
339
+ mainButton: string,
340
+ codeButton: string,
341
+ demoMode: string,
342
+ yourLevel: string,
343
+ supportCaption: string,
344
+ somethingWentWrong: string
345
+
346
+ auth_changeTitle: string,
347
+ auth_changeMessage: string,
348
+ auth_titleTop: string,
349
+ auth_titleBottom: string,
350
+ auth_subtitle: string,
351
+ auth_nameHint: string,
352
+ auth_changeNumber: string,
353
+ auth_enterAsGuest: string,
354
+ auth_privacyPolicyAcceptance: string,
355
+ auth_privacyPolicy: string,
356
+
357
+ internal: [string, ColoredStringMapping][]
358
+ }
359
+
360
+ export let asoConfigToDefault_v1 = (config: ASOConfig_v1): DefaultConfig => {
361
+ return {
362
+ id: config.id,
363
+ bundle: config.bundle,
364
+ name: config.name,
365
+ email: config.email,
366
+ host: config.host,
367
+ ip: config.ip,
368
+ sshPassword: config.sshPassword,
369
+ trackingLink: config.trackingLink,
370
+
371
+ fullAccess: config.fullAccess,
372
+ appsflyerKey: config.appsflyerKey,
373
+ onesignalKey: config.onesignalKey,
374
+ onesignalRestApiKey: config.onesignalRestApiKey,
375
+ allowedCountries: config.allowedCountries,
376
+ excludedCountries: config.excludedCountries,
377
+
378
+ callCoolDown: config.callCoolDown,
379
+ smsCoolDown: config.smsCoolDown,
380
+ maxSmsTries: config.maxSmsTries,
381
+ maxCallTries: config.maxCallTries,
382
+ smscLogin: config.smscLogin,
383
+ smscPassword: config.sshPassword,
384
+
385
+ support: config.support,
386
+
387
+ configMapping: config.configMapping,
388
+ offerSectionMapping: config.offersSectionMapping,
389
+ authorizationActionMapping: config.authorizationActionMapping,
390
+
391
+ configEndpoint: config.configEndpoint,
392
+ offersEndpoint: config.offersEndpoint,
393
+ nextActionEndpoint: config.nextActionEndpoint,
394
+ currentActionEndpoint: config.currentActionEndpoint,
395
+ validationEndpoint: config.codeValidationEndpoint,
396
+ imageEndpoint: config.imageEndpoint,
397
+
398
+ sectionsParameter: config.categoriesQuery,
399
+ phoneParameter: config.phoneQuery,
400
+ codeParameter: config.codeQuery,
401
+ validityParameter: config.validityQuery,
402
+ appsflyerIdParameter: "none",
403
+ advertisingIdParameter: "none",
404
+ onesignalIdParameter: "none",
405
+ offerIdParameter: config.offerIdParameter,
406
+ countryCodeParameter: config.countryCodeParameter,
407
+
408
+ redirectHtmlName: config.redirectHtmlName,
409
+ redirectJsName: config.redirectJsName,
410
+ redirectFolderName: config.redirectFolderName,
411
+
412
+ apiPrefix: config.apiPrefix,
413
+
414
+ skipCode: config.skipCode,
415
+ externalIpGeo: config.externalIpGeo,
416
+ exportedTranslations: config.exportedTranslations,
417
+ newTrackingLink: config.newTrackingLink,
418
+ readyForPanel: config.readyForPanel,
419
+
420
+ version: 1
421
+ }
422
+ }