ouisys-engine 3.0.10 → 3.0.13
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/dist/api/index.d.ts +5 -0
- package/dist/api/index.js +197 -175
- package/dist/common-types/IError.d.ts +1 -2
- package/dist/common-types/RemoteDataState.d.ts +3 -3
- package/dist/common-types/RemoteDataState.js +13 -10
- package/dist/custom-hooks/useStrategyConfig.d.ts +4 -0
- package/dist/custom-hooks/useStrategyConfig.js +24 -0
- package/dist/flows/click2smsFlow.js +4 -0
- package/dist/flows/moFlow.js +4 -0
- package/dist/flows/moRedirFlow.js +4 -0
- package/dist/flows/oneClickFlow.js +6 -0
- package/dist/flows/strategy.js +3 -0
- package/dist/flows/ussdFlow.js +3 -0
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +1 -1
- package/dist/reducers/click2smsFlow/index.js +3 -3
- package/dist/reducers/click2smsFlow/utils.js +18 -23
- package/dist/reducers/moFlow/index.js +18 -28
- package/dist/reducers/moFlow/utils.js +3 -12
- package/dist/reducers/moRedirFlow/utils.js +4 -3
- package/dist/reducers/oneClickFlow/utils.js +8 -8
- package/dist/reducers/pinFlow/index.js +10 -9
- package/dist/reducers/pinFlow/utils.js +19 -24
- package/dist/reducers/strategy/StrategyTypes.d.ts +3 -2
- package/dist/reducers/strategy/index.js +2 -2
- package/dist/reducers/strategy/strategies/header_enrichment.js +50 -53
- package/dist/reducers/strategy/utils.d.ts +3 -3
- package/dist/reducers/strategy/utils.js +36 -49
- package/dist/reducers/ussdFlow/utils.js +4 -2
- package/dist/utilities/storeEmail.d.ts +3 -0
- package/dist/utilities/storeEmail.js +78 -0
- package/package.json +3 -2
|
@@ -182,7 +182,7 @@ function left(l) {
|
|
|
182
182
|
|
|
183
183
|
var getConfig = function getConfig() {
|
|
184
184
|
try {
|
|
185
|
-
if (process.env.testing
|
|
185
|
+
if (process.env.testing === 'true') {
|
|
186
186
|
var _configs2 = require('../../../mockData/config.json'); // @ts-ignore
|
|
187
187
|
|
|
188
188
|
|
|
@@ -193,7 +193,7 @@ var getConfig = function getConfig() {
|
|
|
193
193
|
|
|
194
194
|
return _configs;
|
|
195
195
|
} catch (ex) {
|
|
196
|
-
throw 'config.json not found';
|
|
196
|
+
throw new Error('config.json not found');
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
|
|
@@ -240,9 +240,7 @@ function _determineFlowByMsidn() {
|
|
|
240
240
|
throw submissionError;
|
|
241
241
|
|
|
242
242
|
case 4:
|
|
243
|
-
msisdn = internationalMSISDN.match(/\d+/gi).join(''); // tallyman API expects international msisdn without
|
|
244
|
-
|
|
245
|
-
_context5.prev = 5;
|
|
243
|
+
msisdn = internationalMSISDN.match(/\d+/gi).join(''); // tallyman API expects international msisdn without unknown special character
|
|
246
244
|
|
|
247
245
|
indentifyFlow = /*#__PURE__*/function () {
|
|
248
246
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
@@ -275,17 +273,17 @@ function _determineFlowByMsidn() {
|
|
|
275
273
|
};
|
|
276
274
|
}();
|
|
277
275
|
|
|
278
|
-
_context5.next =
|
|
276
|
+
_context5.next = 8;
|
|
279
277
|
return indentifyFlow();
|
|
280
278
|
|
|
281
|
-
case
|
|
279
|
+
case 8:
|
|
282
280
|
theResult = _context5.sent;
|
|
283
281
|
flow = operatorsConfig[theResult.operator] ? operatorsConfig[theResult.operator] : null;
|
|
284
282
|
cannotDetect = theResult.success === false && theResult.message === 'Operator could not be found for the given MSISDN';
|
|
285
283
|
hlrError = theResult.success === false && theResult.message.indexOf('HLR did not find the operator for given MSISDN') !== -1;
|
|
286
284
|
|
|
287
285
|
if (!(cannotDetect || hlrError)) {
|
|
288
|
-
_context5.next =
|
|
286
|
+
_context5.next = 19;
|
|
289
287
|
break;
|
|
290
288
|
}
|
|
291
289
|
|
|
@@ -294,9 +292,9 @@ function _determineFlowByMsidn() {
|
|
|
294
292
|
_submissionError.msisdn = msisdn;
|
|
295
293
|
throw _submissionError;
|
|
296
294
|
|
|
297
|
-
case
|
|
295
|
+
case 19:
|
|
298
296
|
if (!(flow !== null)) {
|
|
299
|
-
_context5.next =
|
|
297
|
+
_context5.next = 24;
|
|
300
298
|
break;
|
|
301
299
|
}
|
|
302
300
|
|
|
@@ -306,9 +304,9 @@ function _determineFlowByMsidn() {
|
|
|
306
304
|
}, flow);
|
|
307
305
|
return _context5.abrupt("return", flowObj);
|
|
308
306
|
|
|
309
|
-
case
|
|
307
|
+
case 24:
|
|
310
308
|
if (!(flow === null)) {
|
|
311
|
-
_context5.next =
|
|
309
|
+
_context5.next = 29;
|
|
312
310
|
break;
|
|
313
311
|
}
|
|
314
312
|
|
|
@@ -317,26 +315,17 @@ function _determineFlowByMsidn() {
|
|
|
317
315
|
}, defaultFlowConfig);
|
|
318
316
|
return _context5.abrupt("return", _flowObj);
|
|
319
317
|
|
|
320
|
-
case
|
|
318
|
+
case 29:
|
|
321
319
|
_submissionError2 = new Error("Error in submitMSISDN() trigger-pin action");
|
|
322
320
|
_submissionError2.type = 'SEInvalidMSISDN';
|
|
323
321
|
throw _submissionError2;
|
|
324
322
|
|
|
325
|
-
case
|
|
326
|
-
_context5.next = 38;
|
|
327
|
-
break;
|
|
328
|
-
|
|
329
|
-
case 35:
|
|
330
|
-
_context5.prev = 35;
|
|
331
|
-
_context5.t0 = _context5["catch"](5);
|
|
332
|
-
throw _context5.t0;
|
|
333
|
-
|
|
334
|
-
case 38:
|
|
323
|
+
case 32:
|
|
335
324
|
case "end":
|
|
336
325
|
return _context5.stop();
|
|
337
326
|
}
|
|
338
327
|
}
|
|
339
|
-
}, _callee5
|
|
328
|
+
}, _callee5);
|
|
340
329
|
}));
|
|
341
330
|
return _determineFlowByMsidn.apply(this, arguments);
|
|
342
331
|
}
|
|
@@ -350,14 +339,14 @@ function determineFlowByOperator(operator) {
|
|
|
350
339
|
return flowObj;
|
|
351
340
|
}
|
|
352
341
|
|
|
353
|
-
function determineFlowByOperatorFromIp(
|
|
342
|
+
function determineFlowByOperatorFromIp() {
|
|
354
343
|
return _determineFlowByOperatorFromIp.apply(this, arguments);
|
|
355
344
|
} // if operator from server
|
|
356
345
|
// no need for this
|
|
357
346
|
|
|
358
347
|
|
|
359
348
|
function _determineFlowByOperatorFromIp() {
|
|
360
|
-
_determineFlowByOperatorFromIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(
|
|
349
|
+
_determineFlowByOperatorFromIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
361
350
|
var operator, flowObj;
|
|
362
351
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
363
352
|
while (1) {
|
|
@@ -392,6 +381,7 @@ var fetchJsonp = function fetchJsonp(_url) {
|
|
|
392
381
|
return new Promise(function (resolve, reject) {
|
|
393
382
|
// @ts-ignore
|
|
394
383
|
window[ouisys_callback_function] = function (arg) {
|
|
384
|
+
// @ts-ignore
|
|
395
385
|
resolve(arg);
|
|
396
386
|
};
|
|
397
387
|
|
|
@@ -410,7 +400,7 @@ var fetchJsonp = function fetchJsonp(_url) {
|
|
|
410
400
|
|
|
411
401
|
var identifyUser = /*#__PURE__*/function () {
|
|
412
402
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(extraParams) {
|
|
413
|
-
var config, host, country, slug, queryString, device, bupperizeCountry, offer, rockmanId, s, search, extraParamsQs, isDMB, newHost, searchObj, isSuccess, identifyError, subscription_url, _newUrl,
|
|
403
|
+
var config, host, country, slug, queryString, device, bupperizeCountry, offer, rockmanId, s, search, extraParamsQs, isDMB, newHost, searchObj, isSuccess, identifyError, subscription_url, _newUrl, _newQueryString, _urlParams, _msisdn, _operator, url2, redirect_url, _newUrl2, _newQueryString2, _urlParams2, _msisdn2, _operator2, newUrl, newQueryString, urlParams, msisdn, operator, url, result, _identifyError;
|
|
414
404
|
|
|
415
405
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
416
406
|
while (1) {
|
|
@@ -421,14 +411,14 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
421
411
|
break;
|
|
422
412
|
}
|
|
423
413
|
|
|
424
|
-
throw
|
|
414
|
+
throw new Error('Error');
|
|
425
415
|
|
|
426
416
|
case 4:
|
|
427
417
|
config = defaultFlowConfig.flowConfig;
|
|
428
418
|
host = config.host, country = config.country, slug = config.slug, queryString = config.queryString, device = config.device;
|
|
429
419
|
|
|
430
420
|
bupperizeCountry = function bupperizeCountry(c) {
|
|
431
|
-
return c
|
|
421
|
+
return c === 'gb' ? 'uk' : c;
|
|
432
422
|
};
|
|
433
423
|
|
|
434
424
|
offer = window.pac_analytics.visitor.offer;
|
|
@@ -444,18 +434,18 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
444
434
|
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
445
435
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
446
436
|
}).join('&'));
|
|
447
|
-
isDMB = !!(window.pac_analytics.visitor.xaid
|
|
437
|
+
isDMB = !!(window.pac_analytics.visitor.xaid !== null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf('dmb') !== -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf('amb')) !== -1);
|
|
448
438
|
newHost = isDMB ? 'de.tallymans.com' : host;
|
|
449
439
|
searchObj = searchToObject();
|
|
450
440
|
|
|
451
|
-
if (!(!!searchObj['redirect-back'] && searchObj['redirect-back']
|
|
441
|
+
if (!(!!searchObj['redirect-back'] && searchObj['redirect-back'] === '1' && !!searchObj.success)) {
|
|
452
442
|
_context2.next = 50;
|
|
453
443
|
break;
|
|
454
444
|
}
|
|
455
445
|
|
|
456
|
-
isSuccess = searchObj.success
|
|
446
|
+
isSuccess = searchObj.success === 'true';
|
|
457
447
|
|
|
458
|
-
if (!(isSuccess
|
|
448
|
+
if (!(isSuccess === false)) {
|
|
459
449
|
_context2.next = 23;
|
|
460
450
|
break;
|
|
461
451
|
}
|
|
@@ -475,8 +465,8 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
475
465
|
|
|
476
466
|
subscription_url = window.atob(searchObj.subscription_url);
|
|
477
467
|
_newUrl = new URL(subscription_url);
|
|
478
|
-
|
|
479
|
-
_urlParams = new URLSearchParams(
|
|
468
|
+
_newQueryString = _newUrl.search;
|
|
469
|
+
_urlParams = new URLSearchParams(_newQueryString);
|
|
480
470
|
_msisdn = _urlParams.get('msisdn') || null;
|
|
481
471
|
_operator = _urlParams.get('operator') || null;
|
|
482
472
|
return _context2.abrupt("return", {
|
|
@@ -498,12 +488,12 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
498
488
|
|
|
499
489
|
redirect_url = window.atob(searchObj.redirect_url);
|
|
500
490
|
_newUrl2 = new URL(redirect_url);
|
|
501
|
-
|
|
502
|
-
_urlParams2 = new URLSearchParams(
|
|
491
|
+
_newQueryString2 = _newUrl2.search;
|
|
492
|
+
_urlParams2 = new URLSearchParams(_newQueryString2);
|
|
503
493
|
_msisdn2 = _urlParams2.get('msisdn') || null;
|
|
504
494
|
_operator2 = _urlParams2.get('operator') || null;
|
|
505
495
|
|
|
506
|
-
if (!(_msisdn2
|
|
496
|
+
if (!(_msisdn2 !== null)) {
|
|
507
497
|
_context2.next = 41;
|
|
508
498
|
break;
|
|
509
499
|
}
|
|
@@ -523,8 +513,8 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
523
513
|
|
|
524
514
|
case 42:
|
|
525
515
|
newUrl = new URL(window.location.href);
|
|
526
|
-
|
|
527
|
-
urlParams = new URLSearchParams(
|
|
516
|
+
newQueryString = newUrl.search;
|
|
517
|
+
urlParams = new URLSearchParams(newQueryString);
|
|
528
518
|
msisdn = urlParams.get('msisdn') || null;
|
|
529
519
|
operator = urlParams.get('operator') || null;
|
|
530
520
|
return _context2.abrupt("return", {
|
|
@@ -537,9 +527,9 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
537
527
|
break;
|
|
538
528
|
|
|
539
529
|
case 50:
|
|
540
|
-
|
|
530
|
+
url = "https://".concat(newHost, "/tallyman/v1/?action=identify-user&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&page=").concat(window.location.href, "&pixel_url=").concat(encodeURIComponent("http://".concat(window.location.host, "/pixels?xcid=").concat(window.location.pathname.replace('/', ''), "&xaid=").concat(window.pac_analytics.visitor.xaid, "&country=").concat(bupperizeCountry(country))), "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
541
531
|
_context2.next = 53;
|
|
542
|
-
return fetchJsonp(
|
|
532
|
+
return fetchJsonp(url);
|
|
543
533
|
|
|
544
534
|
case 53:
|
|
545
535
|
result = _context2.sent;
|
|
@@ -572,7 +562,7 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
572
562
|
}, _callee2);
|
|
573
563
|
}));
|
|
574
564
|
|
|
575
|
-
return function identifyUser(
|
|
565
|
+
return function identifyUser(_x6) {
|
|
576
566
|
return _ref2.apply(this, arguments);
|
|
577
567
|
};
|
|
578
568
|
}();
|
|
@@ -580,7 +570,7 @@ var identifyUser = /*#__PURE__*/function () {
|
|
|
580
570
|
exports.identifyUser = identifyUser;
|
|
581
571
|
|
|
582
572
|
var subscribe = /*#__PURE__*/function () {
|
|
583
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(
|
|
573
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_url) {
|
|
584
574
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
585
575
|
while (1) {
|
|
586
576
|
switch (_context3.prev = _context3.next) {
|
|
@@ -591,7 +581,7 @@ var subscribe = /*#__PURE__*/function () {
|
|
|
591
581
|
// subscribeError['type'] = "SubscriptionError";
|
|
592
582
|
// throw subscribeError
|
|
593
583
|
// }else{
|
|
594
|
-
'
|
|
584
|
+
'https://google.com');
|
|
595
585
|
|
|
596
586
|
case 1:
|
|
597
587
|
case "end":
|
|
@@ -601,7 +591,7 @@ var subscribe = /*#__PURE__*/function () {
|
|
|
601
591
|
}, _callee3);
|
|
602
592
|
}));
|
|
603
593
|
|
|
604
|
-
return function subscribe(
|
|
594
|
+
return function subscribe(_x7) {
|
|
605
595
|
return _ref5.apply(this, arguments);
|
|
606
596
|
};
|
|
607
597
|
}(); // }
|
|
@@ -610,9 +600,6 @@ var subscribe = /*#__PURE__*/function () {
|
|
|
610
600
|
exports.subscribe = subscribe;
|
|
611
601
|
|
|
612
602
|
function mockConfig(flow) {
|
|
613
|
-
var configs = getConfig();
|
|
614
|
-
var defaultFlowConfig = configs.strategyConfigs.default;
|
|
615
|
-
var operatorsConfig = configs.strategyConfigs.operators;
|
|
616
603
|
var opArr = Object.keys(operatorsConfig);
|
|
617
604
|
var r = opArr.filter(function (o) {
|
|
618
605
|
return operatorsConfig[o].flow === flow;
|
|
@@ -143,7 +143,7 @@ function _submitMSISDNWithConfig() {
|
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
type = result.message
|
|
146
|
+
type = result.message === 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
147
147
|
error = new Error("".concat(type, ":\n").concat(result.message));
|
|
148
148
|
error.type = type;
|
|
149
149
|
console.error(error);
|
|
@@ -196,6 +196,7 @@ function _checkSubscription() {
|
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
// eslint-disable-next-line no-param-reassign
|
|
199
200
|
window.location.href = checkResult.product_url;
|
|
200
201
|
return _context3.abrupt("return", checkResult.product_url || null);
|
|
201
202
|
|
|
@@ -216,6 +217,7 @@ function _checkSubscription() {
|
|
|
216
217
|
|
|
217
218
|
var formatSMSLink = function formatSMSLink(keywordAndShortcode) {
|
|
218
219
|
return (// @ts-ignore
|
|
220
|
+
// eslint-disable-next-line no-nested-ternary
|
|
219
221
|
!!window.pac_analytics.visitor['x-requested-with'] && // @ts-ignore
|
|
220
222
|
window.pac_analytics.visitor['x-requested-with'] !== null && // @ts-ignore
|
|
221
223
|
window.pac_analytics.visitor['x-requested-with'].indexOf('com.facebook') !== -1 ? "sms://".concat(keywordAndShortcode.shortcode, "?body=").concat(keywordAndShortcode.keyword) : typeof navigator !== 'undefined' && (/iPhone/i.test(navigator.userAgent) || /Mac OS/i.test(navigator.userAgent)) ? "sms:".concat(keywordAndShortcode.shortcode, "&body=").concat(keywordAndShortcode.keyword) : "sms:".concat(keywordAndShortcode.shortcode, "?body=").concat(keywordAndShortcode.keyword)
|
|
@@ -228,7 +230,7 @@ var mockedMSISDNEntrySuccess = {
|
|
|
228
230
|
type: 'MSISDNEntry',
|
|
229
231
|
result: RDS.Success({
|
|
230
232
|
keyword: 'TEST OK',
|
|
231
|
-
shortcode: '
|
|
233
|
+
shortcode: '777'
|
|
232
234
|
})
|
|
233
235
|
}
|
|
234
236
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.symbol.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.symbol.description.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.array.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.string.iterator.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
|
+
|
|
17
|
+
require("core-js/modules/es.symbol.async-iterator.js");
|
|
18
|
+
|
|
19
|
+
require("core-js/modules/es.symbol.to-string-tag.js");
|
|
20
|
+
|
|
21
|
+
require("core-js/modules/es.json.to-string-tag.js");
|
|
22
|
+
|
|
23
|
+
require("core-js/modules/es.math.to-string-tag.js");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
26
|
+
|
|
27
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
28
|
+
|
|
29
|
+
require("core-js/modules/es.function.name.js");
|
|
30
|
+
|
|
31
|
+
require("core-js/modules/es.object.set-prototype-of.js");
|
|
32
|
+
|
|
33
|
+
require("core-js/modules/es.array.slice.js");
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36
|
+
value: true
|
|
37
|
+
});
|
|
38
|
+
exports.storeEmail = void 0;
|
|
39
|
+
|
|
40
|
+
require("core-js/modules/es.object.to-string.js");
|
|
41
|
+
|
|
42
|
+
require("core-js/modules/es.promise.js");
|
|
43
|
+
|
|
44
|
+
require("core-js/modules/es.array.concat.js");
|
|
45
|
+
|
|
46
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
47
|
+
|
|
48
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
49
|
+
|
|
50
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
51
|
+
|
|
52
|
+
var storeEmail = /*#__PURE__*/function () {
|
|
53
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(host, slug, service, rockmanId, email) {
|
|
54
|
+
var isDMB, newHost;
|
|
55
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
56
|
+
while (1) {
|
|
57
|
+
switch (_context.prev = _context.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
isDMB = !!(window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf('dmb') !== -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf('amb')) !== -1);
|
|
60
|
+
newHost = isDMB ? 'de.tallymans.com' : host;
|
|
61
|
+
return _context.abrupt("return", fetch("https://".concat(newHost, "/tallyman/helper/?action=store-email&slug=").concat(slug, "&rockman_id=").concat(rockmanId, "&email=").concat(email, "&product_identifier=").concat(service)).then(function (x) {
|
|
62
|
+
return x.json();
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
case 3:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, _callee);
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
return function storeEmail(_x, _x2, _x3, _x4, _x5) {
|
|
74
|
+
return _ref.apply(this, arguments);
|
|
75
|
+
};
|
|
76
|
+
}();
|
|
77
|
+
|
|
78
|
+
exports.storeEmail = storeEmail;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ouisys-engine",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"directories": "dist dev-tools",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"immutability-helper": "^3.1.1",
|
|
23
23
|
"pacman-client": "^1.5.6",
|
|
24
24
|
"react-addons-update": "^15.6.3",
|
|
25
|
+
"react-redux": "^8.0.2",
|
|
25
26
|
"redux": "^4.2.0",
|
|
26
27
|
"redux-logger": "^3.0.6",
|
|
27
28
|
"redux-thunk": "^2.4.1",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"core-js": "3.23.4",
|
|
61
62
|
"eslint": "^7.16.0",
|
|
62
63
|
"eslint-config-airbnb": "^18.2.1",
|
|
63
|
-
"eslint-config-ouisys": "0.0.
|
|
64
|
+
"eslint-config-ouisys": "^0.0.6",
|
|
64
65
|
"eslint-config-prettier": "^7.1.0",
|
|
65
66
|
"eslint-plugin-import": "^2.22.1",
|
|
66
67
|
"eslint-plugin-jest": "^24.1.3",
|