ouisys-engine 4.3.0-alpha.0 → 4.5.0-alpha.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.
Files changed (158) hide show
  1. package/dist/@types/window.d.js +1 -1
  2. package/dist/api/index.d.ts +43 -0
  3. package/dist/api/index.js +1 -728
  4. package/dist/common-types/AppThunk.d.ts +13 -0
  5. package/dist/common-types/AppThunk.js +1 -1
  6. package/dist/common-types/Either.d.ts +8 -0
  7. package/dist/common-types/Either.js +1 -1
  8. package/dist/common-types/IError.d.ts +3 -0
  9. package/dist/common-types/IError.js +1 -1
  10. package/dist/common-types/IOptInFlowName.d.ts +1 -0
  11. package/dist/common-types/ITracker.d.ts +9 -0
  12. package/dist/common-types/ITracker.js +1 -3
  13. package/dist/common-types/IVisitor.d.ts +14 -0
  14. package/dist/common-types/IVisitor.js +1 -1
  15. package/dist/common-types/RemoteDataState.d.ts +38 -0
  16. package/dist/common-types/RemoteDataState.js +1 -135
  17. package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +3 -0
  18. package/dist/custom-hooks/useOneClickRedirectUrl.js +1 -0
  19. package/dist/custom-hooks/usePinEntryState.d.ts +8 -0
  20. package/dist/custom-hooks/usePinEntryState.js +1 -0
  21. package/dist/custom-hooks/useStrategyConfig.d.ts +4 -0
  22. package/dist/custom-hooks/useStrategyConfig.js +1 -0
  23. package/dist/flows/click2smsFlow.d.ts +6 -0
  24. package/dist/flows/click2smsFlow.js +1 -19
  25. package/dist/flows/creditCardFlow.d.ts +6 -0
  26. package/dist/flows/creditCardFlow.js +1 -0
  27. package/dist/flows/moFlow.d.ts +6 -0
  28. package/dist/flows/moFlow.js +1 -19
  29. package/dist/flows/moRedirFlow.d.ts +6 -0
  30. package/dist/flows/moRedirFlow.js +1 -19
  31. package/dist/flows/oneClickFlow.d.ts +7 -0
  32. package/dist/flows/oneClickFlow.js +1 -23
  33. package/dist/flows/pinFlow.d.ts +7 -0
  34. package/dist/flows/pinFlow.js +1 -23
  35. package/dist/flows/strategy.d.ts +14 -0
  36. package/dist/flows/strategy.js +1 -53
  37. package/dist/flows/ussdFlow.d.ts +6 -0
  38. package/dist/flows/ussdFlow.js +1 -19
  39. package/dist/index.d.ts +0 -0
  40. package/dist/index.js +0 -2
  41. package/dist/ips/tryGetIPRangeName.d.ts +2 -0
  42. package/dist/ips/tryGetIPRangeName.js +1 -74
  43. package/dist/jest.config.js +194 -0
  44. package/dist/pacman/index.d.ts +6 -0
  45. package/dist/pacman/index.js +1 -108
  46. package/dist/pacman/queryString.d.ts +3 -0
  47. package/dist/pacman/queryString.js +1 -45
  48. package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +76 -0
  49. package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -1
  50. package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +2 -0
  51. package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -1
  52. package/dist/reducers/click2smsFlow/index.d.ts +5 -0
  53. package/dist/reducers/click2smsFlow/index.js +1 -183
  54. package/dist/reducers/click2smsFlow/utils.d.ts +4 -0
  55. package/dist/reducers/click2smsFlow/utils.js +1 -357
  56. package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +79 -0
  57. package/dist/reducers/creditCardFlow/CreditCardTypes.js +1 -0
  58. package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +2 -0
  59. package/dist/reducers/creditCardFlow/ICreditCardConstants.js +1 -0
  60. package/dist/reducers/creditCardFlow/index.d.ts +5 -0
  61. package/dist/reducers/creditCardFlow/index.js +1 -0
  62. package/dist/reducers/creditCardFlow/utils.d.ts +8 -0
  63. package/dist/reducers/creditCardFlow/utils.js +1 -0
  64. package/dist/reducers/moFlow/IMoConstants.d.ts +2 -0
  65. package/dist/reducers/moFlow/IMoConstants.js +1 -1
  66. package/dist/reducers/moFlow/MoTypes.d.ts +88 -0
  67. package/dist/reducers/moFlow/MoTypes.js +1 -1
  68. package/dist/reducers/moFlow/index.d.ts +16 -0
  69. package/dist/reducers/moFlow/index.js +1 -251
  70. package/dist/reducers/moFlow/utils.d.ts +12 -0
  71. package/dist/reducers/moFlow/utils.js +1 -284
  72. package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +2 -0
  73. package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -1
  74. package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +64 -0
  75. package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -1
  76. package/dist/reducers/moRedirFlow/index.d.ts +14 -0
  77. package/dist/reducers/moRedirFlow/index.js +1 -226
  78. package/dist/reducers/moRedirFlow/utils.d.ts +10 -0
  79. package/dist/reducers/moRedirFlow/utils.js +1 -186
  80. package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +2 -0
  81. package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -1
  82. package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +85 -0
  83. package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -1
  84. package/dist/reducers/oneClickFlow/index.d.ts +13 -0
  85. package/dist/reducers/oneClickFlow/index.js +1 -409
  86. package/dist/reducers/oneClickFlow/utils.d.ts +16 -0
  87. package/dist/reducers/oneClickFlow/utils.js +1 -366
  88. package/dist/reducers/pinFlow/IPinConstants.d.ts +2 -0
  89. package/dist/reducers/pinFlow/IPinConstants.js +1 -1
  90. package/dist/reducers/pinFlow/PinTypes.d.ts +156 -0
  91. package/dist/reducers/pinFlow/PinTypes.js +1 -1
  92. package/dist/reducers/pinFlow/index.d.ts +19 -0
  93. package/dist/reducers/pinFlow/index.js +1 -514
  94. package/dist/reducers/pinFlow/utils.d.ts +11 -0
  95. package/dist/reducers/pinFlow/utils.js +1 -494
  96. package/dist/reducers/strategy/IStategyActionContants.d.ts +2 -0
  97. package/dist/reducers/strategy/IStategyActionContants.js +1 -1
  98. package/dist/reducers/strategy/StrategyTypes.d.ts +248 -0
  99. package/dist/reducers/strategy/StrategyTypes.js +1 -1
  100. package/dist/reducers/strategy/index.d.ts +13 -0
  101. package/dist/reducers/strategy/index.js +1 -389
  102. package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +15 -0
  103. package/dist/reducers/strategy/strategies/ask_mobile_number.js +1 -403
  104. package/dist/reducers/strategy/strategies/ask_operator.d.ts +5 -0
  105. package/dist/reducers/strategy/strategies/ask_operator.js +1 -305
  106. package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +10 -0
  107. package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +1 -459
  108. package/dist/reducers/strategy/strategies/header_enrichment.d.ts +7 -0
  109. package/dist/reducers/strategy/strategies/header_enrichment.js +1 -783
  110. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +2 -0
  111. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +1 -0
  112. package/dist/reducers/strategy/utils.d.ts +30 -0
  113. package/dist/reducers/strategy/utils.js +1 -702
  114. package/dist/reducers/ussdFlow/IUssdConstants.d.ts +2 -0
  115. package/dist/reducers/ussdFlow/IUssdConstants.js +1 -1
  116. package/dist/reducers/ussdFlow/UssdTypes.d.ts +77 -0
  117. package/dist/reducers/ussdFlow/UssdTypes.js +1 -1
  118. package/dist/reducers/ussdFlow/index.d.ts +14 -0
  119. package/dist/reducers/ussdFlow/index.js +1 -251
  120. package/dist/reducers/ussdFlow/utils.d.ts +11 -0
  121. package/dist/reducers/ussdFlow/utils.js +1 -225
  122. package/dist/store/index.d.ts +14 -0
  123. package/dist/store/index.js +1 -177
  124. package/dist/store/reducers.d.ts +20 -0
  125. package/dist/store/reducers.js +1 -41
  126. package/dist/utilities/addEmpelloToken.d.ts +4 -0
  127. package/dist/utilities/addEmpelloToken.js +1 -0
  128. package/dist/utilities/handleSubmitNumber.d.ts +21 -0
  129. package/dist/utilities/handleSubmitNumber.js +1 -59
  130. package/dist/utilities/index.d.ts +14 -0
  131. package/dist/utilities/index.js +1 -0
  132. package/dist/utilities/loadScriptInnerHtml.d.ts +2 -0
  133. package/dist/utilities/loadScriptInnerHtml.js +1 -0
  134. package/dist/utilities/loadScriptSrc.d.ts +8 -0
  135. package/dist/utilities/loadScriptSrc.js +1 -0
  136. package/dist/utilities/replaceUrlParam.d.ts +1 -0
  137. package/dist/utilities/replaceUrlParam.js +1 -0
  138. package/dist/utilities/storeMsisdn.d.ts +3 -0
  139. package/dist/utilities/storeMsisdn.js +1 -0
  140. package/package.json +1 -1
  141. package/dist/app/store.js +0 -20
  142. package/dist/features/strategies/categories/askMobileNumber.js +0 -388
  143. package/dist/features/strategies/categories/askOperator.js +0 -313
  144. package/dist/features/strategies/categories/detectOperatorByIp.js +0 -599
  145. package/dist/features/strategies/categories/headerEnrichment.js +0 -665
  146. package/dist/features/strategies/categories/singleFlows/pin.js +0 -1
  147. package/dist/features/strategies/identifySlice.js +0 -355
  148. package/dist/features/strategies/pinFlowSlice.js +0 -338
  149. package/dist/flows/tpayHeFlow.js +0 -23
  150. package/dist/mockServer/browser.js +0 -48
  151. package/dist/mockServer/handlers.js +0 -22
  152. package/dist/mockServer/server.js +0 -48
  153. package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +0 -1
  154. package/dist/reducers/tpayHeFlow/TpayHeTypes.js +0 -1
  155. package/dist/reducers/tpayHeFlow/index.js +0 -331
  156. package/dist/reducers/tpayHeFlow/utils.js +0 -510
  157. package/dist/test/setup.js +0 -24
  158. package/dist/test/test-utils.js +0 -51
@@ -1,74 +1 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.to-string");
4
-
5
- require("core-js/modules/es.promise");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.default = tryGetIPRangeName;
11
-
12
- require("regenerator-runtime/runtime");
13
-
14
- var _queryString = _interopRequireDefault(require("../pacman/queryString"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- 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); } }
19
-
20
- 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); }); }; }
21
-
22
- function tryGetIPRangeName(_x) {
23
- return _tryGetIPRangeName.apply(this, arguments);
24
- }
25
-
26
- function _tryGetIPRangeName() {
27
- _tryGetIPRangeName = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(visitor) {
28
- var mockip, res;
29
- return regeneratorRuntime.wrap(function _callee$(_context) {
30
- while (1) {
31
- switch (_context.prev = _context.next) {
32
- case 0:
33
- mockip = (0, _queryString.default)(window.location.href, "mock-ip") || process.env.mock_ip;
34
- console.log("mockip", mockip);
35
-
36
- if (visitor.ip) {
37
- _context.next = 17;
38
- break;
39
- }
40
-
41
- _context.prev = 3;
42
- _context.next = 6;
43
- return fetch('https://c1.ouisys.com/api/v1/ip' + (!!mockip ? "?mock-ip=".concat(mockip) : "")).then(function (x) {
44
- return x.json();
45
- });
46
-
47
- case 6:
48
- res = _context.sent;
49
- // return isIPInRange('37.200.146.28')
50
- visitor.ip = res.ip;
51
- visitor.ip_range_name = res.ip_range_name;
52
- return _context.abrupt("return", res.ip_range_name);
53
-
54
- case 12:
55
- _context.prev = 12;
56
- _context.t0 = _context["catch"](3);
57
- console.warn("IP Lookup failed", _context.t0);
58
-
59
- case 15:
60
- _context.next = 18;
61
- break;
62
-
63
- case 17:
64
- return _context.abrupt("return", visitor.ip_range_name);
65
-
66
- case 18:
67
- case "end":
68
- return _context.stop();
69
- }
70
- }
71
- }, _callee, null, [[3, 12]]);
72
- }));
73
- return _tryGetIPRangeName.apply(this, arguments);
74
- }
1
+ "use strict";var _queryString=_interopRequireDefault(require("../pacman/queryString"));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)}require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=tryGetIPRangeName,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.concat.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _regeneratorRuntime(){"use strict";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}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}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}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(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,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=void 0),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=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){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";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},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);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=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},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){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--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(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],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 entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],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=void 0),ContinueSentinel}},exports}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function tryGetIPRangeName(){return _tryGetIPRangeName.apply(this,arguments)}function _tryGetIPRangeName(){return _tryGetIPRangeName=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(visitor){var mockip,host,res;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(mockip=(0,_queryString.default)(window.location.href,"mock-ip")||process.env.mock_ip,console.log("mockip",mockip),visitor.ip||"undefined"==typeof window){_context.next=18;break}return _context.prev=3,host=window.location.host,_context.next=7,fetch("https://".concat(host,"/api/v1/ip").concat(mockip?"?mock-ip=".concat(mockip):"")).then(function(x){return x.json()});case 7:return res=_context.sent,visitor.ip=res.ip,visitor.ip_range_name=res.ip_range_name,_context.abrupt("return",res.ip_range_name);case 13:_context.prev=13,_context.t0=_context["catch"](3),console.warn("IP Lookup failed",_context.t0);case 16:_context.next=19;break;case 18:return _context.abrupt("return",visitor.ip_range_name);case 19:case"end":return _context.stop();}},_callee,null,[[3,13]])})),_tryGetIPRangeName.apply(this,arguments)}
@@ -0,0 +1,194 @@
1
+ // For a detailed explanation regarding each configuration property, visit:
2
+ // https://jestjs.io/docs/en/configuration.html
3
+
4
+ module.exports = {
5
+ // All imported modules in your tests should be mocked automatically
6
+ // automock: false,
7
+
8
+ // Stop running tests after `n` failures
9
+ // bail: 0,
10
+
11
+ // The directory where Jest should store its cached dependency information
12
+ // cacheDirectory: "/private/var/folders/wr/8ghl3gfx0cldjmd7jhzs8gt80000gn/T/jest_dx",
13
+
14
+ // Automatically clear mock calls and instances between every test
15
+ clearMocks: true,
16
+
17
+ // Indicates whether the coverage information should be collected while executing the test
18
+ // collectCoverage: false,
19
+
20
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
21
+ // collectCoverageFrom: undefined,
22
+
23
+ // The directory where Jest should output its coverage files
24
+ coverageDirectory: 'coverage',
25
+
26
+ // An array of regexp pattern strings used to skip coverage collection
27
+ // coveragePathIgnorePatterns: [
28
+ // "/node_modules/"
29
+ // ],
30
+
31
+ // Indicates which provider should be used to instrument code for coverage
32
+ // coverageProvider: 'babel',
33
+
34
+ // A list of reporter names that Jest uses when writing coverage reports
35
+ // coverageReporters: [
36
+ // "json",
37
+ // "text",
38
+ // "lcov",
39
+ // "clover"
40
+ // ],
41
+
42
+ // An object that configures minimum threshold enforcement for coverage results
43
+ // coverageThreshold: undefined,
44
+
45
+ // A path to a custom dependency extractor
46
+ // dependencyExtractor: undefined,
47
+
48
+ // Make calling deprecated APIs throw helpful error messages
49
+ // errorOnDeprecated: false,
50
+
51
+ // Force coverage collection from ignored files using an array of glob patterns
52
+ // forceCoverageMatch: [],
53
+
54
+ collectCoverageFrom: [
55
+ 'src/**/*.{js,ts,tsx}',
56
+ '!src/serviceWorker.{ts,js}',
57
+ '!src/storybook/**',
58
+ '!src/mockServer/**'
59
+ ],
60
+
61
+ // A path to a module which exports an async function that is triggered once before all test suites
62
+ // globalSetup: undefined,
63
+
64
+ // A path to a module which exports an async function that is triggered once after all test suites
65
+ // globalTeardown: undefined,
66
+
67
+ // A set of global variables that need to be available in all test environments
68
+ // globals: {},
69
+
70
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
71
+ // maxWorkers: "50%",
72
+
73
+ // An array of directory names to be searched recursively up from the requiring module's location
74
+ moduleDirectories: ['node_modules', 'test', __dirname],
75
+
76
+ // An array of file extensions your modules use
77
+ moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'svg', 'node'],
78
+
79
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
80
+ moduleNameMapper: {
81
+ '.+\\.(css|scss|png)$': 'identity-obj-proxy'
82
+ },
83
+
84
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
85
+ // modulePathIgnorePatterns: [],
86
+
87
+ // Activates notifications for test results
88
+ // notify: false,
89
+
90
+ // An enum that specifies notification mode. Requires { notify: true }
91
+ // notifyMode: "failure-change",
92
+
93
+ // A preset that is used as a base for Jest's configuration
94
+ // preset: undefined,
95
+
96
+ // Run tests from one or more projects
97
+ // projects: undefined,
98
+
99
+ // Use this configuration option to add custom reporters to Jest
100
+ // reporters: undefined,
101
+
102
+ // Automatically reset mock state between every test
103
+ resetMocks: true,
104
+
105
+ // Reset the module registry before running each individual test
106
+ // resetModules: false,
107
+
108
+ // A path to a custom resolver
109
+ // resolver: undefined,
110
+
111
+ // Automatically restore mock state between every test
112
+ // restoreMocks: false,
113
+
114
+ // The root directory that Jest should scan for tests and modules within
115
+ // rootDir: undefined,
116
+
117
+ // A list of paths to directories that Jest should use to search for files in
118
+ roots: ['<rootDir>/src'],
119
+
120
+ // Allows you to use a custom runner instead of Jest's default test runner
121
+ // runner: "jest-runner",
122
+
123
+ // The paths to modules that run some code to configure or set up the testing environment before each test
124
+ // setupFiles: ['<rootDir>/src/test/setup.ts', 'jest-localstorage-mock'],
125
+
126
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
127
+ // setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
128
+
129
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
130
+ // slowTestThreshold: 5,
131
+
132
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
133
+ // snapshotSerializers: [],
134
+
135
+ // The test environment that will be used for testing
136
+ testEnvironment: 'jest-environment-jsdom',
137
+
138
+ // Options that will be passed to the testEnvironment
139
+ // testEnvironmentOptions: {},
140
+
141
+ // Adds a location field to test results
142
+ // testLocationInResults: false,
143
+
144
+ // The glob patterns Jest uses to detect test files
145
+ // testMatch: [
146
+ // "**/__tests__/**/*.[jt]s?(x)",
147
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
148
+ // ],
149
+
150
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
151
+ // testPathIgnorePatterns: [
152
+ // "/node_modules/"
153
+ // ],
154
+
155
+ // The regexp pattern or array of patterns that Jest uses to detect test files
156
+ testRegex: '(\\.|/)(test|spec)\\.tsx?$',
157
+
158
+ // This option allows the use of a custom results processor
159
+ // testResultsProcessor: undefined,
160
+
161
+ // This option allows use of a custom test runner
162
+ // testRunner: "jasmine2",
163
+
164
+ // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
165
+ // testURL: "http://localhost",
166
+
167
+ // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
168
+ // timers: "real",
169
+
170
+ // A map from regular expressions to paths to transformers
171
+ transform: {
172
+ '^.+\\.tsx?$': 'ts-jest',
173
+ '^.+\\.jsx?$': 'ts-jest'
174
+ // '^.+\\.svg$': '<rootDir>/src/test/svgTransformer.js'
175
+ }
176
+
177
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
178
+ // transformIgnorePatterns: [
179
+ // "/node_modules/",
180
+ // "\\.pnp\\.[^\\/]+$"
181
+ // ],
182
+
183
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
184
+ // unmockedModulePathPatterns: undefined,
185
+
186
+ // Indicates whether each individual test should be reported during the run
187
+ // verbose: undefined,
188
+
189
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
190
+ // watchPathIgnorePatterns: [],
191
+
192
+ // Whether to use watchman for file crawling
193
+ // watchman: true,
194
+ };
@@ -0,0 +1,6 @@
1
+ import { ITrackerFlowEvents } from 'pacman-client/.build-lib/Pacman/types';
2
+ import queryString from './queryString';
3
+ export { queryString };
4
+ export type { ITrackerFlowEvents as ITracker };
5
+ declare const _default: (window: Window, _country?: string, _page?: string) => ITrackerFlowEvents;
6
+ export default _default;
@@ -1,108 +1 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.symbol");
4
-
5
- require("core-js/modules/es.array.filter");
6
-
7
- require("core-js/modules/es.object.get-own-property-descriptor");
8
-
9
- require("core-js/modules/es.object.get-own-property-descriptors");
10
-
11
- require("core-js/modules/es.object.keys");
12
-
13
- require("core-js/modules/es.regexp.exec");
14
-
15
- require("core-js/modules/es.string.replace");
16
-
17
- require("core-js/modules/es.string.search");
18
-
19
- require("core-js/modules/web.dom-collections.for-each");
20
-
21
- Object.defineProperty(exports, "__esModule", {
22
- value: true
23
- });
24
- Object.defineProperty(exports, "queryString", {
25
- enumerable: true,
26
- get: function get() {
27
- return _queryString2.default;
28
- }
29
- });
30
- exports.default = void 0;
31
-
32
- var _pacmanClient = _interopRequireDefault(require("pacman-client"));
33
-
34
- var _v = _interopRequireDefault(require("uuid/v1"));
35
-
36
- var _queryString2 = _interopRequireDefault(require("./queryString"));
37
-
38
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
-
40
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
41
-
42
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
43
-
44
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
45
-
46
- var _default = function _default(window, country, page) {
47
- if (!window) {
48
- return {
49
- advancedInFlow: function advancedInFlow() {
50
- return void 6;
51
- },
52
- advancedInPreFlow: function advancedInPreFlow() {
53
- return void 6;
54
- },
55
- recedeInFlow: function recedeInFlow() {
56
- return void 6;
57
- },
58
- customEvent: function customEvent() {
59
- return void 6;
60
- },
61
- sendOptInFlowEvent: function sendOptInFlowEvent() {
62
- return void 6;
63
- }
64
- };
65
- }
66
-
67
- var url = window.pac_analytics ? window.pac_analytics.url : (0, _queryString2.default)(window.location.search, 'pacman-server') || '/analytics';
68
-
69
- if (!window.pac_analytics) {
70
- var rockmanId = (0, _v.default)().replace(/-/g, '');
71
- var campaignId = parseInt((0, _queryString2.default)(window.location.search, 'cid')) || 2;
72
- window.pac_analytics = {
73
- visitor: {
74
- rockmanId: rockmanId,
75
- impressionNumber: 1,
76
- // TODO: get impressionNumber from localStorage
77
- country: country,
78
- page: page,
79
- xaid: (0, _queryString2.default)(window.location.search, 'xaid'),
80
- cid: campaignId,
81
- offer: parseInt((0, _queryString2.default)(window.location.search, 'offer')) || 1 // default to 1 offer id
82
-
83
- },
84
- startTime: new Date().valueOf(),
85
- queryString: function queryString(key) {
86
- return (0, _queryString2.default)(window.location.search, key);
87
- },
88
- url: url,
89
- userId: rockmanId,
90
- encCampaignId: (0, _queryString2.default)(window.location.search, 'xcid'),
91
- originalUrl: document.location.href
92
- };
93
- }
94
-
95
- var pacmanClient = (0, _pacmanClient.default)({
96
- rockmanId: window.pac_analytics.visitor.rockmanId,
97
- serverUrl: process.env.pacman_server,
98
- // check webpack.config.common.js //"https://de-pacman.sam-media.com/api/v2/mstore",
99
- impressionNumber: 1,
100
- signalInterval: 1000 // in milliseconds
101
-
102
- });
103
- return _objectSpread({
104
- sendOptInFlowEvent: pacmanClient.sendOptInFlowEvent
105
- }, pacmanClient.trackerFlowEvents);
106
- };
107
-
108
- exports.default = _default;
1
+ "use strict";require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,Object.defineProperty(exports,"queryString",{enumerable:!0,get:function get(){return _queryString2.default}}),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.string.replace.js");var _pacmanClient=_interopRequireDefault(require("pacman-client")),_queryString2=_interopRequireDefault(require("./queryString"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var uuid=require("uuid").v1,_default=function(window){if(!window)return{advancedInFlow:function advancedInFlow(){},advancedInPreFlow:function advancedInPreFlow(){},recedeInFlow:function recedeInFlow(){},customEvent:function customEvent(){},sendOptInFlowEvent:function sendOptInFlowEvent(){}};var url=window.pac_analytics?window.pac_analytics.url:(0,_queryString2.default)(window.location.search,"pacman-server")||"/analytics";if(!window.pac_analytics){var rockmanId=uuid().replace(/-/g,""),campaignId=parseInt((0,_queryString2.default)(window.location.search,"cid"),10)||2;window.pac_analytics={visitor:{rockmanId:rockmanId,impressionNumber:1,country:process.env.country,page:process.env.page,xaid:(0,_queryString2.default)(window.location.search,"xaid")||window.xaid,cid:campaignId,offer:parseInt((0,_queryString2.default)(window.location.search,"offer"),10)||window.offer||1},startTime:new Date().valueOf(),queryString:function queryString(key){return(0,_queryString2.default)(window.location.search,key)},url:url,userId:rockmanId,encCampaignId:(0,_queryString2.default)(window.location.search,"xcid"),originalUrl:document.location.href}}var pacmanClient=(0,_pacmanClient.default)({rockmanId:window.pac_analytics.visitor.rockmanId,serverUrl:process.env.pacman_server,impressionNumber:1,signalInterval:1e3});return _objectSpread({sendOptInFlowEvent:pacmanClient.sendOptInFlowEvent},pacmanClient.trackerFlowEvents)};exports.default=_default;
@@ -0,0 +1,3 @@
1
+ declare const _default: (url: string, paramName: string) => string;
2
+ export default _default;
3
+ export declare function updateUrlParameter(uri: string, key: string, value: string): string;
@@ -1,45 +1 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.regexp.constructor");
4
-
5
- require("core-js/modules/es.regexp.exec");
6
-
7
- require("core-js/modules/es.regexp.to-string");
8
-
9
- require("core-js/modules/es.string.match");
10
-
11
- require("core-js/modules/es.string.replace");
12
-
13
- Object.defineProperty(exports, "__esModule", {
14
- value: true
15
- });
16
- exports.updateUrlParameter = updateUrlParameter;
17
- exports.default = void 0;
18
-
19
- var _default = function _default(url, paramName) {
20
- var name = paramName.replace(/[\[\]]/g, "\\$&");
21
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)", "i"),
22
- results = regex.exec(url);
23
- if (!results) return null;
24
- if (!results[2]) return "";
25
- return decodeURIComponent(results[2].replace(/\+/g, " "));
26
- };
27
-
28
- exports.default = _default;
29
-
30
- function updateUrlParameter(uri, key, value) {
31
- // remove the hash part before operating on the uri
32
- var i = uri.indexOf('#');
33
- var hash = i === -1 ? '' : uri.substr(i);
34
- uri = i === -1 ? uri : uri.substr(0, i);
35
- var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
36
- var separator = uri.indexOf('?') !== -1 ? "&" : "?";
37
-
38
- if (uri.match(re)) {
39
- uri = uri.replace(re, '$1' + key + "=" + value + '$2');
40
- } else {
41
- uri = uri + separator + key + "=" + value;
42
- }
43
-
44
- return uri + hash; // finally append the hash as well
45
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.updateUrlParameter=updateUrlParameter,require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.regexp.constructor.js"),require("core-js/modules/es.regexp.sticky.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.string.match.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.string.ends-with.js");var _default=function(url,paramName){var name=paramName.replace(/[\]]/g,"\\$&"),regex=new RegExp("[?&]".concat(name,"(=([^&#]*)|&|#|$)"),"i"),results=regex.exec(url);return results?results[2]?decodeURIComponent(results[2].replace(/\+/g," ")):"":null};exports.default=_default;function updateUrlParameter(uri,key,value){var i=uri.indexOf("#"),hash=-1===i?"":uri.substr(i),newUri=uri;newUri=-1===i?newUri:newUri.substr(0,i);var re=new RegExp("([?&])".concat(key,"=.*?(&|$)"),"i"),separator=-1===newUri.indexOf("?")?"?":"&";return newUri=newUri.match(re)?newUri.replace(re,"$1".concat(key,"=").concat(value,"$2")):newUri.endsWith("&")?"".concat(newUri+key,"=").concat(value):"".concat(newUri+separator+key,"=").concat(value),"".concat(newUri+hash,"&")}
@@ -0,0 +1,76 @@
1
+ import { AppThunk } from '../../common-types/AppThunk';
2
+ import * as RDS from '../../common-types/RemoteDataState';
3
+ export declare type IWithMultiKeywordShortcode = IKeywordShortcode & {
4
+ type?: string;
5
+ data?: Array<IKeywordShortcode>;
6
+ };
7
+ export declare type IClick2smsFlowCurrentState = {
8
+ type: 'LOAD_OC2SMS';
9
+ result: RDS.RemoteDataState<string, IWithMultiKeywordShortcode>;
10
+ };
11
+ export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | 'UnexpectedState';
12
+ export declare type ILOADOC2SMSFailure = {
13
+ errorType: MSISDNEntryErrorTypes;
14
+ error: unknown;
15
+ productUrl?: string;
16
+ };
17
+ export declare type ILOADOC2SMSSuccess = IKeywordShortcode;
18
+ export declare type ILoadOc2click2smsPayload = {
19
+ type: 'LOAD_OC2SMS';
20
+ payload: RDS.RemoteDataState<string, IWithMultiKeywordShortcode>;
21
+ };
22
+ export interface IClick2smsFlowReducerState {
23
+ currentState: IClick2smsFlowCurrentState;
24
+ }
25
+ export declare type IKeywordShortcode = {
26
+ keyword: string;
27
+ shortcode: string;
28
+ operator?: string;
29
+ };
30
+ declare type Config = {
31
+ host?: string;
32
+ country?: string;
33
+ slug?: string;
34
+ automaticallySubmitAllOperators?: boolean;
35
+ operators?: string[];
36
+ };
37
+ export declare type IConfig = ({
38
+ tag: 'tallyman';
39
+ } & Config) | ({
40
+ tag: 'keywordAndShortCode';
41
+ } & IKeywordShortcode & Config) | ({
42
+ tag: 'keyword';
43
+ } & Config);
44
+ export declare type SingleSubmissionResult = IKeywordShortcode & {
45
+ type: 'SingleSubmissionResult';
46
+ };
47
+ export declare type MultiOperatorSubmissionResult = {
48
+ type: 'MultiOperatorSubmissionResult';
49
+ data: Array<IKeywordShortcode>;
50
+ };
51
+ export declare type ICheckSubscriptionResult = {
52
+ success: false;
53
+ rockman_id: string;
54
+ message: string;
55
+ } | {
56
+ success: true;
57
+ msisdn: string;
58
+ product_url?: string;
59
+ rockman_id: string;
60
+ };
61
+ export declare type IClick2SmsActions = {
62
+ type: 'LOAD_OC2SMS';
63
+ payload: ILoadOc2click2smsPayload;
64
+ };
65
+ export declare type IFetchResult = {
66
+ success: boolean;
67
+ uid: string;
68
+ shortcode: string;
69
+ keyword: string;
70
+ displayKeyword: string;
71
+ message?: string;
72
+ };
73
+ export declare type IClick2SmsFlowActionMaps = {
74
+ loadOc2sms: () => AppThunk;
75
+ };
76
+ export {};
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,2 @@
1
+ declare type IClick2smsConstants = 'LOAD_OC2SMS';
2
+ export default IClick2smsConstants;
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,5 @@
1
+ import { AppThunk } from '../../common-types/AppThunk';
2
+ import { IClick2SmsActions, IClick2SmsFlowActionMaps, IClick2smsFlowReducerState } from './Click2smsTypes';
3
+ export declare function loadOc2sms(): AppThunk;
4
+ export declare const Click2smsFlowActionMaps: IClick2SmsFlowActionMaps;
5
+ export default function Click2smsFlowReducer(state: IClick2smsFlowReducerState, action: IClick2SmsActions): IClick2smsFlowReducerState;