ouisys-engine 4.6.3 → 4.7.0-alpha.1
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/RemoteDataState-CwHLI23e.js +75 -0
- package/dist/RemoteDataState-CwHLI23e.js.map +1 -0
- package/dist/bupperizeCountry-CCDIOHP6.js +4 -0
- package/dist/bupperizeCountry-CCDIOHP6.js.map +1 -0
- package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js +27 -0
- package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js.map +1 -0
- package/dist/checkSubscriptionHander.js +53 -0
- package/dist/checkSubscriptionHander.js.map +1 -0
- package/dist/click2smsFlow.js +246 -0
- package/dist/click2smsFlow.js.map +1 -0
- package/dist/creditCardFlow.js +248 -0
- package/dist/creditCardFlow.js.map +1 -0
- package/dist/getConfig.js +14 -0
- package/dist/getConfig.js.map +1 -0
- package/dist/handleClickChainFlow.js +32 -0
- package/dist/handleClickChainFlow.js.map +1 -0
- package/dist/handleSubmitNumber.js +65 -0
- package/dist/handleSubmitNumber.js.map +1 -0
- package/dist/helpers-J_h-ZgxH.js +29 -0
- package/dist/helpers-J_h-ZgxH.js.map +1 -0
- package/dist/loadScriptInnerHtml-DPcoY467.js +26 -0
- package/dist/loadScriptInnerHtml-DPcoY467.js.map +1 -0
- package/dist/moFlow.js +275 -0
- package/dist/moFlow.js.map +1 -0
- package/dist/moRedirFlow.js +225 -0
- package/dist/moRedirFlow.js.map +1 -0
- package/dist/oneClickFlow.js +464 -0
- package/dist/oneClickFlow.js.map +1 -0
- package/dist/pinFlow.js +697 -0
- package/dist/pinFlow.js.map +1 -0
- package/dist/searchToObject.js +19 -0
- package/dist/searchToObject.js.map +1 -0
- package/dist/storeMsisdn-ChiBh8mI.js +58 -0
- package/dist/storeMsisdn-ChiBh8mI.js.map +1 -0
- package/dist/strategy.js +50 -0
- package/dist/strategy.js.map +1 -0
- package/dist/strategySlice-bF74rxDK.js +842 -0
- package/dist/strategySlice-bF74rxDK.js.map +1 -0
- package/dist/tracker-B_zsMRN2.js +79 -0
- package/dist/tracker-B_zsMRN2.js.map +1 -0
- package/dist/tracker.js +5 -0
- package/dist/tracker.js.map +1 -0
- package/dist/tryGetIPRangeName-C69HEG5W.js +42 -0
- package/dist/tryGetIPRangeName-C69HEG5W.js.map +1 -0
- package/dist/types/CreditCardTypes-B-IT-l6I.d.ts +72 -0
- package/dist/types/IHash-0OgZ_1ij.d.ts +5 -0
- package/dist/types/MoRedirTypes-4tEJjT1g.d.ts +31 -0
- package/dist/types/MoTypes-D-UK92gs.d.ts +45 -0
- package/dist/types/OneClickTypes-DF0jodl-.d.ts +69 -0
- package/dist/types/PinTypes-BLJDBZe6.d.ts +128 -0
- package/dist/types/RemoteDataState-D1aFrz8W.d.ts +61 -0
- package/dist/types/StrategyTypes-BEIYqoJV.d.ts +325 -0
- package/dist/types/UssdTypes-C7QlIW11.d.ts +34 -0
- package/dist/types/checkSubscriptionHander.d.ts +8 -0
- package/dist/types/click2smsFlow.d.ts +37 -0
- package/dist/types/creditCardFlow.d.ts +37 -0
- package/dist/types/getConfig.d.ts +38 -0
- package/dist/types/handleClickChainFlow.d.ts +6 -0
- package/dist/types/handleSubmitNumber.d.ts +26 -0
- package/dist/types/moFlow.d.ts +70 -0
- package/dist/types/moRedirFlow.d.ts +82 -0
- package/dist/types/oneClickFlow.d.ts +56 -0
- package/dist/types/pinFlow.d.ts +179 -0
- package/dist/types/searchToObject.d.ts +3 -0
- package/dist/types/strategy.d.ts +86 -0
- package/dist/types/tracker.d.ts +5 -0
- package/dist/types/ussdFlow.d.ts +84 -0
- package/dist/ussdFlow.js +211 -0
- package/dist/ussdFlow.js.map +1 -0
- package/package.json +85 -9
- package/.babelrc +0 -30
- package/.browserslistrc +0 -6
- package/.eslintrc.js +0 -3
- package/.nvmrc +0 -1
- package/.prettierignore +0 -4
- package/dist/@types/react-tracker.d.js +0 -1
- package/dist/@types/redux-cli-logger.d.js +0 -1
- package/dist/@types/tiny-async-pool.d.js +0 -1
- package/dist/@types/window.d.js +0 -1
- package/dist/api/index.d.ts +0 -43
- package/dist/api/index.js +0 -1
- package/dist/common-types/AppThunk.d.ts +0 -13
- package/dist/common-types/AppThunk.js +0 -1
- package/dist/common-types/Either.d.ts +0 -8
- package/dist/common-types/Either.js +0 -1
- package/dist/common-types/IError.d.ts +0 -3
- package/dist/common-types/IError.js +0 -1
- package/dist/common-types/IOptInFlowName.d.ts +0 -1
- package/dist/common-types/IOptInFlowName.js +0 -1
- package/dist/common-types/ITracker.d.ts +0 -9
- package/dist/common-types/ITracker.js +0 -1
- package/dist/common-types/IVisitor.d.ts +0 -14
- package/dist/common-types/IVisitor.js +0 -1
- package/dist/common-types/RemoteDataState.d.ts +0 -38
- package/dist/common-types/RemoteDataState.js +0 -1
- package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
- package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
- package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
- package/dist/custom-hooks/usePinEntryState.js +0 -1
- package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
- package/dist/custom-hooks/useStrategyConfig.js +0 -1
- package/dist/flows/click2smsFlow.d.ts +0 -6
- package/dist/flows/click2smsFlow.js +0 -1
- package/dist/flows/creditCardFlow.d.ts +0 -6
- package/dist/flows/creditCardFlow.js +0 -1
- package/dist/flows/moFlow.d.ts +0 -6
- package/dist/flows/moFlow.js +0 -1
- package/dist/flows/moRedirFlow.d.ts +0 -6
- package/dist/flows/moRedirFlow.js +0 -1
- package/dist/flows/oneClickFlow.d.ts +0 -7
- package/dist/flows/oneClickFlow.js +0 -1
- package/dist/flows/pinFlow.d.ts +0 -7
- package/dist/flows/pinFlow.js +0 -1
- package/dist/flows/strategy.d.ts +0 -14
- package/dist/flows/strategy.js +0 -1
- package/dist/flows/ussdFlow.d.ts +0 -6
- package/dist/flows/ussdFlow.js +0 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -1
- package/dist/ips/tryGetIPRangeName.d.ts +0 -2
- package/dist/ips/tryGetIPRangeName.js +0 -1
- package/dist/jest.config.js +0 -194
- package/dist/pacman/index.d.ts +0 -6
- package/dist/pacman/index.js +0 -1
- package/dist/pacman/queryString.d.ts +0 -3
- package/dist/pacman/queryString.js +0 -1
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +0 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +0 -1
- package/dist/reducers/click2smsFlow/index.d.ts +0 -5
- package/dist/reducers/click2smsFlow/index.js +0 -1
- package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
- package/dist/reducers/click2smsFlow/utils.js +0 -1
- package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
- package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
- package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
- package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
- package/dist/reducers/creditCardFlow/index.d.ts +0 -5
- package/dist/reducers/creditCardFlow/index.js +0 -1
- package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
- package/dist/reducers/creditCardFlow/utils.js +0 -1
- package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
- package/dist/reducers/moFlow/IMoConstants.js +0 -1
- package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
- package/dist/reducers/moFlow/MoTypes.js +0 -1
- package/dist/reducers/moFlow/index.d.ts +0 -16
- package/dist/reducers/moFlow/index.js +0 -1
- package/dist/reducers/moFlow/utils.d.ts +0 -12
- package/dist/reducers/moFlow/utils.js +0 -1
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +0 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +0 -1
- package/dist/reducers/moRedirFlow/index.d.ts +0 -14
- package/dist/reducers/moRedirFlow/index.js +0 -1
- package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
- package/dist/reducers/moRedirFlow/utils.js +0 -1
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +0 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
- package/dist/reducers/oneClickFlow/OneClickTypes.js +0 -1
- package/dist/reducers/oneClickFlow/index.d.ts +0 -13
- package/dist/reducers/oneClickFlow/index.js +0 -1
- package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
- package/dist/reducers/oneClickFlow/utils.js +0 -1
- package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
- package/dist/reducers/pinFlow/IPinConstants.js +0 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
- package/dist/reducers/pinFlow/PinTypes.js +0 -1
- package/dist/reducers/pinFlow/index.d.ts +0 -19
- package/dist/reducers/pinFlow/index.js +0 -1
- package/dist/reducers/pinFlow/utils.d.ts +0 -11
- package/dist/reducers/pinFlow/utils.js +0 -1
- package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
- package/dist/reducers/strategy/IStategyActionContants.js +0 -1
- package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
- package/dist/reducers/strategy/StrategyTypes.js +0 -1
- package/dist/reducers/strategy/index.d.ts +0 -13
- package/dist/reducers/strategy/index.js +0 -1
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +0 -1
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
- package/dist/reducers/strategy/strategies/ask_operator.js +0 -1
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +0 -1
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
- package/dist/reducers/strategy/strategies/header_enrichment.js +0 -1
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
- package/dist/reducers/strategy/utils.d.ts +0 -30
- package/dist/reducers/strategy/utils.js +0 -1
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
- package/dist/reducers/ussdFlow/IUssdConstants.js +0 -1
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
- package/dist/reducers/ussdFlow/UssdTypes.js +0 -1
- package/dist/reducers/ussdFlow/index.d.ts +0 -14
- package/dist/reducers/ussdFlow/index.js +0 -1
- package/dist/reducers/ussdFlow/utils.d.ts +0 -11
- package/dist/reducers/ussdFlow/utils.js +0 -1
- package/dist/store/index.d.ts +0 -14
- package/dist/store/index.js +0 -1
- package/dist/store/reducers.d.ts +0 -20
- package/dist/store/reducers.js +0 -1
- package/dist/utilities/addEmpelloToken.d.ts +0 -4
- package/dist/utilities/addEmpelloToken.js +0 -1
- package/dist/utilities/handleSubmitNumber.d.ts +0 -21
- package/dist/utilities/handleSubmitNumber.js +0 -1
- package/dist/utilities/index.d.ts +0 -17
- package/dist/utilities/index.js +0 -1
- package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
- package/dist/utilities/loadScriptInnerHtml.js +0 -1
- package/dist/utilities/loadScriptSrc.d.ts +0 -8
- package/dist/utilities/loadScriptSrc.js +0 -1
- package/dist/utilities/replaceUrlParam.d.ts +0 -1
- package/dist/utilities/replaceUrlParam.js +0 -1
- package/dist/utilities/storeMsisdn.d.ts +0 -3
- package/dist/utilities/storeMsisdn.js +0 -1
- package/index.html +0 -49
- package/mockData/config.json +0 -28
- package/setupJest.js +0 -6
- package/tsconfig.json +0 -28
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";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.object.keys.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.array.filter.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"),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/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.PinFlowActionMaps=void 0,exports.backToStart=backToStart,exports.checkLoadingAction=checkLoadingAction,exports.default=PinFlowReducer,exports.mockPinFlow=mockPinFlow,exports.reSubmitMSISDNAction=reSubmitMSISDNAction,exports.submitMSISDNAction=submitMSISDNAction,exports.submitPinAction=submitPinAction,require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _awesomePhonenumber=_interopRequireDefault(require("awesome-phonenumber")),RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_utilities=require("../../utilities"),_storeMsisdn=require("../../utilities/storeMsisdn"),_strategy=require("../strategy"),_utils=require("../strategy/utils"),_utils2=_interopRequireWildcard(require("./utils"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}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 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}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)})}}var getConfigByMsisdnPrefix=function(msisdn){var operatorByPrefix=(0,_utilities.getSAOperatorByMsisdnPrefix)(msisdn),flowObj=(0,_utils.determineFlowByOperator)(operatorByPrefix);return flowObj.flowConfig},getInputValuePrefix=function(country,international){var pn=new _awesomePhonenumber.default(international,country.toUpperCase());return country&&international?"+".concat(pn.getCountryCode()):""};function submitMSISDNAction(msisdn,extraParams){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch,store){var currentState,pinFlowCurrentState,_currentState$result,configByStrategy,isUseMsisdnPrefix,isHeaderEnrichmentSuccess,config,prefix,_window,msisdnSubmissionResult,operatorResult,operator,pinMaxLengthByOp,pinPageEvent,errorType;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(currentState=store().strategy.currentState,pinFlowCurrentState=store().pinFlow.currentState,"PIN"!==currentState.type){_context.next=39;break}return _currentState$result=currentState.result,configByStrategy=_currentState$result.config,isUseMsisdnPrefix=_currentState$result.isUseMsisdnPrefix,isHeaderEnrichmentSuccess=_currentState$result.isHeaderEnrichmentSuccess,config=isUseMsisdnPrefix?getConfigByMsisdnPrefix(msisdn):configByStrategy,"ps"===(null===config||void 0===config?void 0:config.country.toLowerCase())&&null!==config&&void 0!==config&&config.slug.includes("shemaroo")&&(prefix=getInputValuePrefix(null===config||void 0===config?void 0:config.country,msisdn),"+970"===prefix&&(msisdn=msisdn.replace("970","972"))),_context.prev=6,dispatch({type:"PIN_FLOW_MSISDN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Loading()})}),_strategy.tracker.advancedInFlow("tallyman.v1-pin","msisdn-submitted",{msisdn:msisdn}),_context.next=11,(0,_utils2.default)(window,config,msisdn,extraParams);case 11:if(msisdnSubmissionResult=_context.sent,!("SingleMSISDNSubmissionResult"===msisdnSubmissionResult.type&&msisdnSubmissionResult.redirectUrl)){_context.next=16;break}return _strategy.tracker.advancedInFlow("tallyman.v1-pin","msisdn-submission-success",{msisdn:msisdn}),_strategy.tracker.customEvent("Flow","advance-auto","msisdn-redirect",{redirectUrl:msisdnSubmissionResult.redirectUrl}),_context.abrupt("return",window.location.href=msisdnSubmissionResult.redirectUrl);case 16:if(operatorResult="SingleMSISDNSubmissionResult"===msisdnSubmissionResult.type?msisdnSubmissionResult.operator:"",operator=(0,_utilities.hasNumber)(operatorResult)?(0,_utilities.getKeyByValue)(_utilities.mapAgencyOperator,operatorResult):operatorResult,!(extraParams&&extraParams.storeMsisdn&&"true"===extraParams.storeMsisdn)){_context.next=21;break}return _context.next=21,(0,_storeMsisdn.storeMsisdn)(msisdn).then(function(data){data&&data.data&&data.data.success?_strategy.tracker.customEvent("Flow","advance-auto","msisdn-stored-success"):_strategy.tracker.customEvent("Flow","advance-auto","msisdn-stored-failed")}).catch(function(error){_strategy.tracker.customEvent("Flow","advance-auto","msisdn-stored-error",error)});case 21:pinMaxLengthByOp={SA_MOBILY:6,SA_STC:4,SA_ZAIN:4},dispatch({type:"PIN_FLOW_MSISDN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Success({})})}),_strategy.tracker.advancedInFlow("tallyman.v1-pin","msisdn-submission-success",{msisdn:msisdn}),dispatch({type:"PIN_FLOW_MSISDN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"PINEntry",result:RDS.NothingYet(),data:{actualPIN:"SingleMSISDNSubmissionResult"===msisdnSubmissionResult.type?msisdnSubmissionResult.pin:null,nextAction:"submitPinAction",msisdn:msisdn,operator:operator,pinMaxLength:""!==operator&&pinMaxLengthByOp[operator]?pinMaxLengthByOp[operator]:null}})}),pinPageEvent=new Event("onPinPage"),null===(_window=window)||void 0===_window?void 0:_window.dispatchEvent(pinPageEvent),_context.next=37;break;case 29:if(_context.prev=29,_context.t0=_context["catch"](6),console.warn(_context.t0),errorType="AlreadySubscribed"===_context.t0.type?"AlreadySubscribed":"InvalidMSISDN"===_context.t0.type?"InvalidMSISDN":"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-pin","msisdn-submission-failure",{msisdn:msisdn,errorType:errorType||"UnknownError"}),dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Failure({errorType:errorType,error:_context.t0,productUrl:_context.t0.productUrl})})}),!isHeaderEnrichmentSuccess){_context.next=37;break}return _context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:configByStrategy,msisdn:msisdn,isHeaderEnrichmentSuccess:!1}}}));case 37:_context.next=42;break;case 39:throw dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Failure({errorType:"UnknownError",error:null})})}),_strategy.tracker.recedeInFlow("tallyman.v1-pin","msisdn-submission-failure",{msisdn:msisdn,errorType:"UnexpectedState"}),new Error("Unexpected state");case 42:case"end":return _context.stop();}},_callee,null,[[6,29]])}));return function(_x,_x2){return _ref.apply(this,arguments)}}()}function checkLoadingAction(){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch,store){var pinFlowCurrentState,checkIsLoading,intervalId;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:checkIsLoading=function _checkIsLoading(){if(!0===window.isLoading)console.log("isLoading is true");else{console.log("isLoading is false"),clearInterval(intervalId),console.log("Stopped checking isLoading.");var productUrl=(0,_utilities.getCookie)("product_url");if(productUrl){var errorType="AlreadySubscribed";_strategy.tracker.recedeInFlow("tallyman.v1-pin","already-subscribed",{errorType:errorType,product_url:productUrl}),dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Failure({errorType:errorType,error:"AlreadySubscribed",productUrl:productUrl})})})}else dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:{type:"MSISDNEntry",result:RDS.NothingYet()}})}},pinFlowCurrentState=store().pinFlow.currentState,dispatch({type:"PIN_FLOW_MSISDN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Loading()})}),intervalId=setInterval(checkIsLoading,1e3);try{checkIsLoading()}catch(error){console.warn(error),dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:{type:"MSISDNEntry",result:RDS.NothingYet()}})}case 5:case"end":return _context2.stop();}},_callee2)}));return function(_x3,_x4){return _ref2.apply(this,arguments)}}()}function reSubmitMSISDNAction(msisdn,extraParams){return function(){var _ref3=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(dispatch,store){var currentState,pinFlowCurrentState,config,msisdnSubmissionResult,errorType;return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:if(currentState=store().strategy.currentState,pinFlowCurrentState=store().pinFlow.currentState,"PIN"!==currentState.type){_context3.next=23;break}return config=currentState.result.config,_context3.prev=4,_strategy.tracker.recedeInFlow("tallyman.v1-pin","msisdn-resubmission",{msisdn:msisdn}),_strategy.tracker.advancedInFlow("tallyman.v1-pin","msisdn-submitted",{msisdn:msisdn}),_context3.next=9,(0,_utils2.default)(window,config,msisdn,extraParams);case 9:msisdnSubmissionResult=_context3.sent,dispatch({type:"PIN_FLOW_MSISDN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Success({})})}),_strategy.tracker.advancedInFlow("tallyman.v1-pin","msisdn-submission-success",{msisdn:msisdn}),dispatch({type:"PIN_FLOW_MSISDN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"PINEntry",result:RDS.NothingYet(),data:{actualPIN:"SingleMSISDNSubmissionResult"===msisdnSubmissionResult.type?msisdnSubmissionResult.pin:null,nextAction:"submitPinAction",msisdn:msisdn}})}),_context3.next=21;break;case 15:_context3.prev=15,_context3.t0=_context3["catch"](4),console.warn(_context3.t0),errorType="AlreadySubscribed"===_context3.t0.type?"AlreadySubscribed":"InvalidMSISDN"===_context3.t0.type?"InvalidMSISDN":"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-pin","msisdn-submission-failure",{msisdn:msisdn,errorType:errorType||"UnknownError"}),dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Failure({errorType:errorType,error:_context3.t0,productUrl:_context3.t0.productUrl})})});case 21:_context3.next=26;break;case 23:throw dispatch({type:"PIN_FLOW_MSISDN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"MSISDNEntry",result:RDS.Failure({errorType:"UnknownError",error:null})})}),_strategy.tracker.recedeInFlow("tallyman.v1-pin","msisdn-submission-failure",{msisdn:msisdn,errorType:"UnexpectedState"}),new Error("Unexpected state");case 26:case"end":return _context3.stop();}},_callee3,null,[[4,15]])}));return function(_x5,_x6){return _ref3.apply(this,arguments)}}()}function submitPinAction(msisdn,pin,extraParams){return function(){var _ref4=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(dispatch,store){var currentState,pinFlowCurrentState,config,result,errorType;return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:if(currentState=store().strategy.currentState,pinFlowCurrentState=store().pinFlow.currentState,_context4.prev=2,dispatch({type:"PIN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"PINEntry",result:RDS.Loading()})}),_strategy.tracker.advancedInFlow("tallyman.v1-pin","pin-submitted",{msisdn:msisdn,pin:pin}),"PIN"!==currentState.type){_context4.next=18;break}return config=currentState.result.config,_context4.next=9,(0,_utils2.submitPIN)(window,pin,config,extraParams);case 9:if(result=_context4.sent,_strategy.tracker.advancedInFlow("tallyman.v1-pin","pin-submission-success",{msisdn:msisdn,pin:pin,finalUrl:result.productUrl}),result.gatewayRedirectUrl&&""!==result.gatewayRedirectUrl&&(_strategy.tracker.advancedInFlow("tallyman.v1-pin","gateway-redirect",{msisdn:msisdn,pin:pin,gatewayRedirectUrl:result.gatewayRedirectUrl}),window.location.href=result.gatewayRedirectUrl),!(extraParams&&extraParams.storeMsisdn&&"true"===extraParams.storeMsisdn)){_context4.next=15;break}return _context4.next=15,(0,_storeMsisdn.storeMsisdn)(msisdn).then(function(data){data&&data.data&&data.data.success?_strategy.tracker.customEvent("Flow","advance-auto","msisdn-stored-success"):_strategy.tracker.customEvent("Flow","advance-auto","msisdn-stored-failed")}).catch(function(error){_strategy.tracker.customEvent("Flow","advance-auto","msisdn-stored-error",error)});case 15:dispatch({type:"PIN_SUBMIT",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"PINEntry",result:RDS.Success({finalUrl:result.productUrl,isAlreadySubscribed:result.isAlreadySubscribed||!1})})}),_context4.next=21;break;case 18:throw _strategy.tracker.recedeInFlow("tallyman.v1-pin","pin-submission-failure",{msisdn:msisdn,pin:pin}),dispatch({type:"PIN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"PINEntry",result:RDS.Failure({errorType:"UnexpectedState"})})}),new Error("Unexpected state");case 21:_context4.next=30;break;case 23:_context4.prev=23,_context4.t0=_context4["catch"](2),console.error(_context4.t0),errorType=_context4.t0.type||"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-pin","pin-submission-failure",{msisdn:msisdn,pin:pin,productUrl:_context4.t0.productUrl}),dispatch({type:"PIN_SUBMIT_ERROR",payload:_objectSpread(_objectSpread({},pinFlowCurrentState),{},{type:"PINEntry",result:RDS.Failure({errorType:errorType,productUrl:_context4.t0.productUrl})})}),setTimeout(function(){_context4.t0.productUrl&&(window.location.href=_context4.t0.productUrl)},0);case 30:case"end":return _context4.stop();}},_callee4,null,[[2,23]])}));return function(_x7,_x8){return _ref4.apply(this,arguments)}}()}function mockPinFlow(mockState){return function(dispatch){var _window2,pinPageEvent=new Event("onPinPage");if(mockState!==void 0)switch(mockState){case"msisdn-failure-state":return dispatch({type:"MOCK_PIN_FLOW_STATE",payload:_utils2.mockedMSISDNEntryFailure.currentState});case"pin-state":return null===(_window2=window)||void 0===_window2?void 0:_window2.dispatchEvent(pinPageEvent),dispatch({type:"MOCK_PIN_FLOW_STATE",payload:_utils2.mockedPINState.currentState});case"completed-state":return dispatch({type:"MOCK_PIN_FLOW_STATE",payload:_utils2.mockedCompletedState.currentState});default:throw new Error("Mock Flow not supported");}}}function backToStart(){return _strategy.tracker.recedeInFlow("tallyman.v1-pin","pin-submission-backtostart","requested to change phone number"),{type:"BACK_TO_START",payload:{type:"MSISDNEntry",result:RDS.NothingYet()}}}var getInitialState=function getInitialState(){var search=(0,_utils.searchToObject)(),isPinEntryStep=search["show-pin-entry"]&&"1"===search["show-pin-entry"],isShowThankYouStep=search["show-thank-you"]&&"1"===search["show-thank-you"],isShowCustomError=search.show_custom_error&&"1"===search.show_custom_error,initialStateDefault={currentState:{type:"MSISDNEntry",result:RDS.NothingYet()}},msisdnError={currentState:{type:"MSISDNEntry",result:RDS.Failure({errorType:"SomethingWentWrong",error:null})}},thankYouState={currentState:{type:"PINEntry",result:RDS.Success({finalUrl:(null===search||void 0===search?void 0:search.product_url)||""}),data:{nextAction:"submitPinAction",msisdn:(null===search||void 0===search?void 0:search.msisdn)||"",operator:(null===search||void 0===search?void 0:search.operator)||""}}},initalPinEntryState={currentState:{type:"PINEntry",result:RDS.NothingYet(),data:{nextAction:"submitPinAction",msisdn:(null===search||void 0===search?void 0:search.msisdn)||"",operator:(null===search||void 0===search?void 0:search.operator)||""}}};return isPinEntryStep?initalPinEntryState:isShowThankYouStep?thankYouState:isShowCustomError?msisdnError:initialStateDefault},initialState=getInitialState(),PinFlowActionMaps={submitMSISDNAction:submitMSISDNAction,submitPinAction:submitPinAction};exports.PinFlowActionMaps=PinFlowActionMaps;function PinFlowReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"PIN_FLOW_MSISDN_SUBMIT":return(0,_strategy.genericHandler)(state,action.payload);case"PIN_FLOW_MSISDN_SUBMIT_ERROR":return(0,_strategy.genericHandler)(state,action.payload);case"PIN_SUBMIT":return(0,_strategy.genericHandler)(state,action.payload);case"BACK_TO_START":return(0,_strategy.genericHandler)(state,action.payload);case"PIN_SUBMIT_ERROR":return(0,_strategy.genericHandler)(state,action.payload);case"MOCK_PIN_FLOW_STATE":return(0,_strategy.genericHandler)(state,action.payload);default:return state;}}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IConfig, IHash, IMcpShieldResult, IPinFlowReducerState, MultiOperatorMSISDNSubmissionResult, SingleMSISDNSubmissionResult } from './PinTypes';
|
|
2
|
-
export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: IHash): Promise<SingleMSISDNSubmissionResult | MultiOperatorMSISDNSubmissionResult>;
|
|
3
|
-
export declare function loadMcpShield(window: Window, config: IConfig): Promise<IMcpShieldResult>;
|
|
4
|
-
export declare function submitPIN(window: Window, pin: string, config: IConfig, extraParams: IHash): Promise<{
|
|
5
|
-
productUrl?: string;
|
|
6
|
-
isAlreadySubscribed?: boolean;
|
|
7
|
-
gatewayRedirectUrl?: string;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const mockedPINState: IPinFlowReducerState;
|
|
10
|
-
export declare const mockedCompletedState: IPinFlowReducerState;
|
|
11
|
-
export declare const mockedMSISDNEntryFailure: IPinFlowReducerState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";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.object.keys.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.array.filter.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"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.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/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=submitMSISDN,exports.loadMcpShield=loadMcpShield,exports.mockedPINState=exports.mockedMSISDNEntryFailure=exports.mockedCompletedState=void 0,exports.submitPIN=submitPIN,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.match.js"),require("core-js/modules/es.string.search.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.array.map.js"),require("core-js/modules/es.array.find.js");var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_utilities=require("../../utilities"),_loadScriptInnerHtml=_interopRequireDefault(require("../../utilities/loadScriptInnerHtml")),_utils=require("../strategy/utils");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}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 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}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 submitMSISDN(){return _submitMSISDN.apply(this,arguments)}function _submitMSISDN(){return _submitMSISDN=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(window,maybeConfig,internationalMSISDN,extraParams){var config;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(config=_objectSpread({offer:window.pac_analytics.visitor.offer},maybeConfig||{}),!0!==config.automaticallySubmitAllOperators||!config.operators||!(0<config.operators.length)){_context.next=3;break}return _context.abrupt("return",submitMSISDNForMultipleOperators(window,config,internationalMSISDN,config.operators,extraParams));case 3:return _context.abrupt("return",submitMSISDNOnce(window,config,internationalMSISDN,extraParams));case 4:case"end":return _context.stop();}},_callee)})),_submitMSISDN.apply(this,arguments)}var uniqidResult="";function loadMcpShield(_x5,_x6){return _loadMcpShield.apply(this,arguments)}function _loadMcpShield(){return _loadMcpShield=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(window,config){var slug,country,device,host,offer,rockmanId,mcpShieldResult;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:if(!config){_context2.next=20;break}return slug=config.slug,country=config.country,device=config.device,host=config.host,offer=window.pac_analytics.visitor.offer,rockmanId=window.pac_analytics.visitor.rockmanId,_context2.prev=4,_context2.next=7,window.tallymanApi.mcpShield(host,country,slug,device,offer,rockmanId);case 7:if(mcpShieldResult=_context2.sent,!1!==mcpShieldResult.success){_context2.next=12;break}console.warn(mcpShieldResult.message),_context2.next=15;break;case 12:return(0,_loadScriptInnerHtml.default)(mcpShieldResult.source),uniqidResult=mcpShieldResult.uniqid,_context2.abrupt("return",mcpShieldResult);case 15:_context2.next=20;break;case 17:_context2.prev=17,_context2.t0=_context2["catch"](4),console.warn(_context2.t0);case 20:case"end":return _context2.stop();}},_callee2,null,[[4,17]])})),_loadMcpShield.apply(this,arguments)}function submitMSISDNOnce(_x7,_x8,_x9,_x10){return _submitMSISDNOnce.apply(this,arguments)}function _submitMSISDNOnce(){return _submitMSISDNOnce=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(window,config,internationalMSISDN,extraParams){var submissionError,newExtraParams,isSkipValidation,searchObj,msisdn,rockmanId,supportedSlugs,identifiedUser,slug,country,device,offer,host,search,uniqid,evinaTid,result,error,codesWithMcpShied,mcpShieldResult;return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:if(internationalMSISDN||!1!==(0,_utilities.isCookieExists)("OMEU")){_context3.next=4;break}throw submissionError=new Error("Error in submitMSISDN() trigger-pin action"),submissionError.type="InvalidMSISDN",submissionError;case 4:if(newExtraParams=extraParams||{},isSkipValidation=!1,searchObj=(0,_utils.searchToObject)(),"true"===(null===searchObj||void 0===searchObj?void 0:searchObj.success)&&"1"===searchObj["msisdn-alias"]&&(newExtraParams["skip-validation"]="1"),"1"===newExtraParams["skip-validation"]&&(isSkipValidation=!0),msisdn=isSkipValidation?internationalMSISDN:internationalMSISDN.match(/\d+/gi).join(""),rockmanId=window.pac_analytics.visitor.rockmanId,supportedSlugs={"kuwait-agency-mix-gamezone-puzzle1":"kuwait-agency-mix-gamezone-puzzle1","kuwait-agency-mix-yourspot-riddles":"kuwait-agency-mix-yourspot-riddles"},!("k2"===config.country.toLowerCase()&&supportedSlugs[config.slug])){_context3.next=17;break}return _context3.next=15,window.tallymanApi.identify(config.host,config.slug,config.country,msisdn,config.device,config.offer,rockmanId);case 15:identifiedUser=_context3.sent,identifiedUser.operator&&"K2_ZAIN"===identifiedUser.operator&&(window.hostCountry="KW",window.hostSlug="kw-mt2-hosted-flow-mobfun",config.country=window.hostCountry,config.slug=window.hostSlug);case 17:return slug=config.slug,country=config.country,device=config.device,offer=config.offer,host=config.host,search=-1===window.location.search.indexOf("redirect-back=1")?window.location.search.substr(1)||"":"",uniqid=uniqidResult&&""!==uniqidResult?"&mcpUniqid=".concat(uniqidResult):"",evinaTid="undefined"!=typeof window&&window.tid?window.tid:"",_context3.next=23,window.tallymanApi.triggerPin(host,country,slug,device,offer,msisdn,rockmanId,newExtraParams,search,uniqid,evinaTid);case 23:if(result=_context3.sent,!1!==result.success){_context3.next=32;break}throw error=new Error("Error in submitMSISDN() trigger-pin action:\n".concat(result.message)),error.type="ALREADY SUBSCRIBED"===result.message?"AlreadySubscribed":"InvalidMSISDN",error.productUrl=result.product_url?result.product_url:"",console.error(error),error;case 32:if(window.operator=result.operator,codesWithMcpShied={kw:{kw_viva:"kw_viva"},k2:{k2_viva:"k2_viva"},bh:{bh_viva:"bh_viva"}},!(country&&result.operator&&(codesWithMcpShied[country.toLowerCase()]&&codesWithMcpShied[country.toLowerCase()][result.operator.toLowerCase()]||"iq"===country.toLowerCase())&&!window.isCallBlockApi&&!window.Empello)){_context3.next=45;break}return _context3.prev=35,_context3.next=38,window.tallymanApi.mcpShield(host,country,slug,device,offer,rockmanId,result.operator,uniqid);case 38:mcpShieldResult=_context3.sent,!1===mcpShieldResult.success?console.warn(mcpShieldResult.message):((0,_loadScriptInnerHtml.default)(mcpShieldResult.source),uniqidResult=mcpShieldResult.uniqid),_context3.next=45;break;case 42:_context3.prev=42,_context3.t0=_context3["catch"](35),console.warn(_context3.t0);case 45:return result.javascript&&(0,_loadScriptInnerHtml.default)(result.javascript),_context3.abrupt("return",{type:"SingleMSISDNSubmissionResult",pin:result.pin,uniqidResult:uniqidResult,operator:result.operator,redirectUrl:null===result||void 0===result?void 0:result.redirect_to_url});case 47:case"end":return _context3.stop();}},_callee3,null,[[35,42]])})),_submitMSISDNOnce.apply(this,arguments)}function submitMSISDNForMultipleOperators(_x11,_x12,_x13,_x14,_x15){return _submitMSISDNForMultipleOperators.apply(this,arguments)}function _submitMSISDNForMultipleOperators(){return _submitMSISDNForMultipleOperators=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(window,config,internationalMSISDN,operators,extraParams){var results,alreadySubscribed;return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:return _context5.next=2,Promise.all(operators.map(function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(o){var singleResult;return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return _context4.prev=0,_context4.next=3,submitMSISDNOnce(window,config,internationalMSISDN,_objectSpread(_objectSpread({},extraParams),{},{operator:o}));case 3:return singleResult=_context4.sent,_context4.abrupt("return",(0,_utils.right)(_objectSpread(_objectSpread({},singleResult),{},{operator:o})));case 7:return _context4.prev=7,_context4.t0=_context4["catch"](0),_context4.abrupt("return",(0,_utils.left)(_context4.t0));case 10:case"end":return _context4.stop();}},_callee4,null,[[0,7]])}));return function(_x20){return _ref.apply(this,arguments)}}()));case 2:if(results=_context5.sent,alreadySubscribed=results.find(function(r){return"left"===r.type&&"AlreadySubscribed"===r.value.type}),!results.every(function(r){return"left"===r.type})){_context5.next=8;break}throw results[0].value;case 8:if(!alreadySubscribed){_context5.next=12;break}throw alreadySubscribed.value;case 12:return _context5.abrupt("return",{type:"MultiOperatorMSISDNSubmissionResult"});case 13:case"end":return _context5.stop();}},_callee5)})),_submitMSISDNForMultipleOperators.apply(this,arguments)}function submitPIN(_x16,_x17,_x18,_x19){return _submitPIN.apply(this,arguments)}function _submitPIN(){return _submitPIN=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(window,pin,config,extraParams){var slug,country,device,host,offer,newExtraParams,searchObj,rockmanId,emptyPinError,uniqid,evinaTid,pinResult,pinErrorTypeMap,errorMessage,pinError,check,checkResult,isAlreadySubscribed,_pinError,_isAlreadySubscribed;return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:if(window.hostCountry&&window.hostSlug&&(config.country=window.hostCountry,config.slug=window.hostSlug),slug=config.slug,country=config.country,device=config.device,host=config.host,offer=window.pac_analytics.visitor.offer,newExtraParams=extraParams||{},searchObj=(0,_utils.searchToObject)(),"true"===(null===searchObj||void 0===searchObj?void 0:searchObj.success)&&"1"===searchObj["msisdn-alias"]&&(newExtraParams["skip-validation"]="1"),rockmanId=window.pac_analytics.visitor.rockmanId,pin){_context6.next=11;break}throw emptyPinError=new Error("Error in submitMSISDN() verify-pin action:\n Pin Cannot Be Empty"),emptyPinError.type="InvalidPIN",emptyPinError;case 11:return uniqid=""===uniqidResult?"":"&mcpUniqid=".concat(uniqidResult),evinaTid="undefined"!=typeof window&&window.tid?window.tid:"",_context6.next=15,window.tallymanApi.verifyPin(host,country,slug,device,offer,rockmanId,pin,newExtraParams,uniqid,evinaTid);case 15:if(pinResult=_context6.sent,!1!==pinResult.success){_context6.next=24;break}throw pinErrorTypeMap={"pin does not match":"InvalidPIN","mcp blocked":"SessionBlocked"},errorMessage=pinErrorTypeMap[pinResult.message],pinError=new Error("Error in submitMSISDN() verify-pin action:\n".concat(errorMessage)),pinError.type=errorMessage||"InvalidPIN",pinError;case 24:if(!0!==pinResult.async){_context6.next=39;break}if(!(pinResult.product_url&&""!==pinResult.product_url&&"es"===(null===country||void 0===country?void 0:country.toLowerCase()))){_context6.next=27;break}return _context6.abrupt("return",{gatewayRedirectUrl:pinResult.product_url});case 27:return check=function check(){return window.tallymanApi.checkSubscription(host,country,slug,device,offer,rockmanId,pin,extraParams)},_context6.next=30,(0,_utils.loop)(check,100,function(r){return r.success},0);case 30:if(checkResult=_context6.sent,!0!==checkResult.success){_context6.next=34;break}return isAlreadySubscribed="ALREADY SUBSCRIBED"===pinResult.message,_context6.abrupt("return",{productUrl:checkResult.product_url||null,isAlreadySubscribed:isAlreadySubscribed});case 34:throw _pinError=new Error("Error in submitMSISDN() verify-pin action:\n".concat(checkResult.message)),_pinError.type="InvalidPIN",_pinError;case 39:return _isAlreadySubscribed="ALREADY SUBSCRIBED"===pinResult.message,_context6.abrupt("return",{productUrl:pinResult.product_url||null,isAlreadySubscribed:_isAlreadySubscribed});case 41:case"end":return _context6.stop();}},_callee6)})),_submitPIN.apply(this,arguments)}var mockedPINState={currentState:{type:"PINEntry",result:RDS.NothingYet(),data:{actualPIN:"",nextAction:"submitPinAction",msisdn:""}}};exports.mockedPINState=mockedPINState;var mockedCompletedState={currentState:{type:"PINEntry",result:RDS.Success({finalUrl:"/product"}),data:{actualPIN:"",nextAction:"submitPinAction",msisdn:""}}};exports.mockedCompletedState=mockedCompletedState;var mockedMSISDNEntryFailure={currentState:{type:"MSISDNEntry",result:RDS.Failure({errorType:"InvalidMSISDN",error:"Invalid Mobile Number"})}};exports.mockedMSISDNEntryFailure=mockedMSISDNEntryFailure;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare type IStategyActionContants = 'IDENTIFY_FLOW_BY_OPERATOR_SELECT' | 'IDENTIFY_STRATEGY' | 'OPERATOR_SELECT' | 'MSISDN_ENTRY_SUBMIT' | 'IDENTIFY_FLOW_BY_MSISDN' | 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT' | 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR' | 'IDENTIFY_FLOW_BY_MSISDN_ERROR' | 'DETECT_OPERATOR_BY_IP' | 'IDENTIFY_FLOW_BY_IP_OPERATOR' | 'CHECK_SUBSCRIPTION' | 'HE_IDENTIFY' | 'IDENTIFY_FLOW_BY_HE' | 'MOCK_STRATEGY_STATE';
|
|
2
|
-
export default IStategyActionContants;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
-
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
|
-
export declare type IIdentifyResult = {
|
|
4
|
-
operator: string;
|
|
5
|
-
flow?: string;
|
|
6
|
-
success: boolean;
|
|
7
|
-
rockman_id?: string;
|
|
8
|
-
message?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare type ConfigDetails = {
|
|
11
|
-
host: string;
|
|
12
|
-
slug: string;
|
|
13
|
-
country: string;
|
|
14
|
-
device?: 'smart' | 'feature';
|
|
15
|
-
queryString?: Array<[string, string]>;
|
|
16
|
-
automaticallySubmitAllOperators?: boolean;
|
|
17
|
-
operators?: string[];
|
|
18
|
-
service: string;
|
|
19
|
-
offer?: number;
|
|
20
|
-
};
|
|
21
|
-
export declare type IConfig = {
|
|
22
|
-
offer?: number;
|
|
23
|
-
slug?: string;
|
|
24
|
-
country?: string;
|
|
25
|
-
host?: string;
|
|
26
|
-
device?: 'smart' | 'feature';
|
|
27
|
-
automaticallySubmitAllOperators?: boolean;
|
|
28
|
-
operators?: string[];
|
|
29
|
-
service?: string;
|
|
30
|
-
serviceId?: string;
|
|
31
|
-
};
|
|
32
|
-
export declare type ISupportedFlows = 'pin' | 'mo' | 'oneClick' | 'click2sms' | 'moRedir' | 'ussd' | 'tpayHe' | 'creditCard';
|
|
33
|
-
export declare type IFlow = {
|
|
34
|
-
flow: ISupportedFlows;
|
|
35
|
-
flowOnWifi?: ISupportedFlows;
|
|
36
|
-
operator?: string;
|
|
37
|
-
flowConfig: ConfigDetails;
|
|
38
|
-
default?: IFlow;
|
|
39
|
-
rockman_id?: string;
|
|
40
|
-
};
|
|
41
|
-
export declare type StrategyConfig = {
|
|
42
|
-
operators: {
|
|
43
|
-
[key: string]: IFlow;
|
|
44
|
-
};
|
|
45
|
-
default: IFlow;
|
|
46
|
-
isUseMsisdnPrefix?: boolean;
|
|
47
|
-
};
|
|
48
|
-
export declare type IStrategy = {
|
|
49
|
-
strategy: IStrategyNames;
|
|
50
|
-
country: string;
|
|
51
|
-
strategyConfigs: StrategyConfig;
|
|
52
|
-
};
|
|
53
|
-
export declare type IStrategyNames = 'pin' | 'mo' | 'mo-redir' | 'click2sms' | 'one-click' | 'ussd' | 'tpay-he' | 'credit-card' | 'tallyman-one-click' | 'pin-mo-ask-operator' | 'pin-mo-ask-mobile-number' | 'pin-one-click-ask-operator' | 'pin-one-click-detect-operator-by-ip' | 'one-click-mo-pin-detect-operator-by-ip-or-msisdn' | 'pin-click2sms-ask-operator' | 'mo-redir-one-click-detect-operator-by-ip' | 'pin-mo-redir-ask-mobile-number' | 'pin-click2sms-ask-mobile-number' | 'mo-one-click-detect-operator-by-ip' | 'click2sms-one-click-detect-operator-by-ip' | 'pin-header-enrichment' | 'pin-msisdn-fowarding-pin-header-enrichment' | 'he-pin-mo-redir-header-enrichment' | 'he-pin-one-click-header-enrichment' | 'he-pin-one-click-ask-operator' | 'click2sms-one-click-ask-operator' | 'pin-mo-detect-operator-by-ip' | 'he-mo-redir-one-click-header-enrichment' | 'pin-combo-ask-mobile-number' | 'header-enrichment-script' | 'mo-redir-mo-click2sms-one-click-detect-operator-by-ip-or-msisdn' | 'pin-mo-mo-redir-ask-mobile-number';
|
|
54
|
-
export interface IHash {
|
|
55
|
-
[key: string]: string;
|
|
56
|
-
}
|
|
57
|
-
export declare type IDENTIFYMSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN';
|
|
58
|
-
export declare type IDENTIFYMSISDNEntryFailure = {
|
|
59
|
-
errorType: IDENTIFYMSISDNEntryErrorTypes;
|
|
60
|
-
error: unknown;
|
|
61
|
-
};
|
|
62
|
-
export declare type IdentifyFlowOptionsResult = {
|
|
63
|
-
config: IConfig;
|
|
64
|
-
nextAction?: unknown;
|
|
65
|
-
msisdn?: string;
|
|
66
|
-
operator?: string;
|
|
67
|
-
subscription_url?: string;
|
|
68
|
-
redirect_url?: string;
|
|
69
|
-
rockman_id?: string;
|
|
70
|
-
isHeaderEnrichmentSuccess?: boolean;
|
|
71
|
-
autoRedirect?: boolean;
|
|
72
|
-
isUseMsisdnPrefix?: boolean;
|
|
73
|
-
};
|
|
74
|
-
export declare type IDENTIFYMSISDNEntrySuccess = {};
|
|
75
|
-
export declare type OPERATORSelectFailure = {};
|
|
76
|
-
export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult;
|
|
77
|
-
export declare type IDETECTYOPERATOBYIPFailure = {};
|
|
78
|
-
export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult;
|
|
79
|
-
export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult;
|
|
80
|
-
export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult;
|
|
81
|
-
export declare type OPERATORSelectFlowIdentifyFailure = {};
|
|
82
|
-
export declare type OPERATORSelectFlowIdentifySuccess = {
|
|
83
|
-
operators: Array<string>;
|
|
84
|
-
msisdn?: string;
|
|
85
|
-
nextAction: 'selectOperator';
|
|
86
|
-
};
|
|
87
|
-
export declare type IDENTIFYFailure = {};
|
|
88
|
-
export declare type IDENTIFYSuccess = {};
|
|
89
|
-
export declare type IOperatorSelectFlowIdentifyPayload = {
|
|
90
|
-
type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
|
|
91
|
-
result: RDS.RemoteDataState<OPERATORSelectFlowIdentifyFailure, OPERATORSelectFlowIdentifySuccess>;
|
|
92
|
-
};
|
|
93
|
-
export declare type IDetectOperatorByIpPayload = {
|
|
94
|
-
type: 'DETECT_OPERATOR_BY_IP';
|
|
95
|
-
result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
|
|
96
|
-
};
|
|
97
|
-
export declare type IPossibleFlows = 'PIN' | 'MO' | 'MO_REDIR' | 'ONE_CLICK' | 'CLICK2SMS' | 'USSD' | 'TPAY_HE' | 'CREDIT_CARD';
|
|
98
|
-
export declare type IOperatorSelectPayload = {
|
|
99
|
-
type: IPossibleFlows;
|
|
100
|
-
result: OPERATORSelectSuccess;
|
|
101
|
-
};
|
|
102
|
-
export declare type ISubmitMsisdnPayload = {
|
|
103
|
-
type: IPossibleFlows;
|
|
104
|
-
result: IDENTIFY_OPERATOR_MSISDNEntrySuccess;
|
|
105
|
-
};
|
|
106
|
-
export declare type IIdentifyFlowByIpOperatorPayload = {
|
|
107
|
-
type: IPossibleFlows;
|
|
108
|
-
result: IDENTIFY_OPERATOR_MSISDNEntrySuccess;
|
|
109
|
-
};
|
|
110
|
-
export declare type IIdentifyFlowByHePayload = {
|
|
111
|
-
type: IPossibleFlows;
|
|
112
|
-
result: IDENTIFY_FLOW_HESuccess;
|
|
113
|
-
};
|
|
114
|
-
export declare type IIdentfyFlowByMsisdnNextAction = 'submitMSISDNAction' | 'loadOc2sms';
|
|
115
|
-
export declare type IIdentfyFlowByOperatorNextAction = 'submitMSISDNAction' | 'loadOc2sms';
|
|
116
|
-
export declare type IIdentfyFlowByIPOperatorNextAction = 'getRedirectUrlAction' | 'submitMSISDNAction';
|
|
117
|
-
export declare type IIdenyifyFlowByMsisdnSumbitNextData = {
|
|
118
|
-
nextAction: IIdentfyFlowByMsisdnNextAction;
|
|
119
|
-
msisdn?: string;
|
|
120
|
-
operator?: string;
|
|
121
|
-
};
|
|
122
|
-
export declare type IIdenyifyFlowByMsisdnPayload = {
|
|
123
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
124
|
-
result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
|
|
125
|
-
data: IIdenyifyFlowByMsisdnSumbitNextData;
|
|
126
|
-
};
|
|
127
|
-
export declare type IIdenyifyStrategyPayload = {
|
|
128
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
129
|
-
result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
|
|
130
|
-
data: IIdenyifyFlowByMsisdnSumbitNextData;
|
|
131
|
-
};
|
|
132
|
-
export declare type IStrategyActions = {
|
|
133
|
-
type: 'IDENTIFY_STRATEGY';
|
|
134
|
-
payload: IIdenyifyStrategyPayload;
|
|
135
|
-
} | {
|
|
136
|
-
type: 'DETECT_OPERATOR_BY_IP';
|
|
137
|
-
payload: IDetectOperatorByIpPayload;
|
|
138
|
-
} | {
|
|
139
|
-
type: 'HE_IDENTIFY';
|
|
140
|
-
payload: IIdenyifyStrategyPayload;
|
|
141
|
-
} | {
|
|
142
|
-
type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
|
|
143
|
-
payload: IOperatorSelectFlowIdentifyPayload;
|
|
144
|
-
} | {
|
|
145
|
-
type: 'IDENTIFY_FLOW_BY_IP';
|
|
146
|
-
payload: IIdentifyFlowByIpOperatorPayload;
|
|
147
|
-
} | {
|
|
148
|
-
type: 'OPERATOR_SELECT';
|
|
149
|
-
payload: IOperatorSelectPayload;
|
|
150
|
-
} | {
|
|
151
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
152
|
-
payload: IIdenyifyFlowByMsisdnPayload;
|
|
153
|
-
} | {
|
|
154
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT';
|
|
155
|
-
payload: ISubmitMsisdnPayload;
|
|
156
|
-
} | {
|
|
157
|
-
type: 'IDENTIFY_FLOW_BY_IP_OPERATOR';
|
|
158
|
-
payload: IIdentifyFlowByIpOperatorPayload;
|
|
159
|
-
} | {
|
|
160
|
-
type: 'IDENTIFY_FLOW_BY_HE';
|
|
161
|
-
payload: IIdentifyFlowByHePayload;
|
|
162
|
-
} | {
|
|
163
|
-
type: 'MOCK_STRATEGY_STATE';
|
|
164
|
-
payload: unknown;
|
|
165
|
-
};
|
|
166
|
-
export declare type IStrategyCurrentState = {
|
|
167
|
-
type: 'IDENTIFY_STRATEGY';
|
|
168
|
-
result: RDS.RemoteDataState<IDENTIFYFailure, IDENTIFYSuccess>;
|
|
169
|
-
} | {
|
|
170
|
-
type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
|
|
171
|
-
result: OPERATORSelectFlowIdentifySuccess;
|
|
172
|
-
} | {
|
|
173
|
-
type: 'DETECT_OPERATOR_BY_IP';
|
|
174
|
-
result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
|
|
175
|
-
} | {
|
|
176
|
-
type: 'HE_IDENTIFY';
|
|
177
|
-
result: RDS.RemoteDataState<IDENTIFYFailure, IDENTIFYSuccess>;
|
|
178
|
-
} | {
|
|
179
|
-
type: 'OPERATOR_SELECT';
|
|
180
|
-
result: RDS.RemoteDataState<OPERATORSelectFailure, OPERATORSelectSuccess>;
|
|
181
|
-
config: IConfig;
|
|
182
|
-
} | {
|
|
183
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
184
|
-
result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
|
|
185
|
-
nextData: IIdenyifyFlowByMsisdnSumbitNextData;
|
|
186
|
-
} | {
|
|
187
|
-
type: 'PIN';
|
|
188
|
-
result: IdentifyFlowOptionsResult;
|
|
189
|
-
} | {
|
|
190
|
-
type: 'MO';
|
|
191
|
-
result: IdentifyFlowOptionsResult;
|
|
192
|
-
} | {
|
|
193
|
-
type: 'USSD';
|
|
194
|
-
result: IdentifyFlowOptionsResult;
|
|
195
|
-
} | {
|
|
196
|
-
type: 'MO_REDIR';
|
|
197
|
-
result: IdentifyFlowOptionsResult;
|
|
198
|
-
} | {
|
|
199
|
-
type: 'ONE_CLICK';
|
|
200
|
-
result: IdentifyFlowOptionsResult;
|
|
201
|
-
} | {
|
|
202
|
-
type: 'CLICK2SMS';
|
|
203
|
-
result: IdentifyFlowOptionsResult;
|
|
204
|
-
} | {
|
|
205
|
-
type: 'TPAY_HE';
|
|
206
|
-
result: IdentifyFlowOptionsResult;
|
|
207
|
-
} | {
|
|
208
|
-
type: 'CREDIT_CARD';
|
|
209
|
-
result: IdentifyFlowOptionsResult;
|
|
210
|
-
};
|
|
211
|
-
export declare type IStrategyReducerState = {
|
|
212
|
-
currentState: IStrategyCurrentState;
|
|
213
|
-
};
|
|
214
|
-
export declare type IStrategyActionMaps = {
|
|
215
|
-
selectOperator: (operator: string) => AppThunk;
|
|
216
|
-
submitMSISDNAction: (msisdn: string) => AppThunk;
|
|
217
|
-
loadOc2sms: () => AppThunk;
|
|
218
|
-
};
|
|
219
|
-
export declare type IStrategyIDentifyUserResult = {
|
|
220
|
-
success: 'true';
|
|
221
|
-
rockman_id: string;
|
|
222
|
-
msisdn: string;
|
|
223
|
-
operator?: string;
|
|
224
|
-
subscription_url?: string;
|
|
225
|
-
redirect_url?: string;
|
|
226
|
-
'redirect-back'?: string;
|
|
227
|
-
'msisdn-alias'?: string;
|
|
228
|
-
} | {
|
|
229
|
-
success: 'false';
|
|
230
|
-
rockman_id: string;
|
|
231
|
-
message: string;
|
|
232
|
-
'redirect-back'?: string;
|
|
233
|
-
};
|
|
234
|
-
export declare type IMockFlows = 'pin' | 'mo' | 'oneclick' | 'click2sms' | 'moredir' | 'ussd' | 'tpay' | 'creditcard';
|
|
235
|
-
export interface IMockFlowParams<T> {
|
|
236
|
-
'mock-flow': IMockFlows;
|
|
237
|
-
'current-state': T;
|
|
238
|
-
'show-pin-entry': '1' | '0';
|
|
239
|
-
'show-thank-you': '1' | '0';
|
|
240
|
-
operator: string;
|
|
241
|
-
msisdn?: string;
|
|
242
|
-
}
|
|
243
|
-
export interface IScriptHeaderEnrichmentSuccess extends CustomEvent {
|
|
244
|
-
detail: {
|
|
245
|
-
msisdn: string;
|
|
246
|
-
operator_code: string;
|
|
247
|
-
};
|
|
248
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
-
import { IStrategyActionMaps, IStrategyActions, IStrategyReducerState } from './StrategyTypes';
|
|
3
|
-
export declare const tracker: import("pacman-client/.build-lib/Pacman/types").ITrackerFlowEvents;
|
|
4
|
-
export declare function mockStrategyStateByUrlParam(): AppThunk;
|
|
5
|
-
export declare function identifyStrategy(): AppThunk;
|
|
6
|
-
export declare function checkSubscriptionAction(trackingArgs: {
|
|
7
|
-
flow: string;
|
|
8
|
-
action: string;
|
|
9
|
-
args?: any;
|
|
10
|
-
}): AppThunk;
|
|
11
|
-
export declare function genericHandler<S, P>(state: S, payload: P): S;
|
|
12
|
-
export declare const StrategyFlowActionMaps: IStrategyActionMaps;
|
|
13
|
-
export default function StrategyReducer(state: IStrategyReducerState, action: IStrategyActions): IStrategyReducerState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";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"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),require("core-js/modules/es.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.StrategyFlowActionMaps=void 0,exports.checkSubscriptionAction=checkSubscriptionAction,exports.default=StrategyReducer,exports.genericHandler=genericHandler,exports.identifyStrategy=identifyStrategy,exports.mockStrategyStateByUrlParam=mockStrategyStateByUrlParam,exports.tracker=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _immutabilityHelper=_interopRequireDefault(require("immutability-helper")),RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_pacman=_interopRequireDefault(require("../../pacman")),_utilities=require("../../utilities"),_click2smsFlow=require("../click2smsFlow"),_utils=require("../click2smsFlow/utils"),_creditCardFlow=require("../creditCardFlow"),_moFlow=require("../moFlow"),_moRedirFlow=require("../moRedirFlow"),_oneClickFlow=require("../oneClickFlow"),_pinFlow=require("../pinFlow"),_ussdFlow=require("../ussdFlow"),_ask_mobile_number=_interopRequireWildcard(require("./strategies/ask_mobile_number")),_ask_operator=_interopRequireWildcard(require("./strategies/ask_operator")),_detect_operator_by_ip=_interopRequireDefault(require("./strategies/detect_operator_by_ip")),_header_enrichment=_interopRequireDefault(require("./strategies/header_enrichment")),_injectHeaderEnrichmentScript=_interopRequireDefault(require("./strategies/injectHeaderEnrichmentScript")),_utils2=require("./utils");function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}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}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)})}}var tracker=(0,_pacman.default)("undefined"==typeof window?null:window);exports.tracker=tracker;function mockStrategyStateByUrlParam(){return function(dispatch){var search=(0,_utils2.searchToObject)();if(void 0!==search["mock-flow"])switch(void 0!==search.operator&&(window.operator=search.operator),search["mock-flow"]){case"pin":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedPinFlow.currentState}),dispatch((0,_pinFlow.mockPinFlow)(search["current-state"]));break;case"mo":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedMoFlow.currentState}),dispatch((0,_moFlow.mockMoFlow)(search["current-state"]));break;case"moredir":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedMoRdirFlow.currentState}),dispatch((0,_moRedirFlow.mockMoRedirFlow)(search["current-state"]));break;case"oneclick":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedOneClickFlow.currentState}),setTimeout(function(){dispatch((0,_oneClickFlow.mockOneClickFlow)(search["current-state"]))},2e3);break;case"click2sms":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedClick2smsFlow.currentState});break;case"ussd":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedUssdFlow.currentState}),dispatch((0,_ussdFlow.mockUssdFlow)(search["current-state"]));break;case"creditcard":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedCreditCardFlow.currentState}),dispatch((0,_creditCardFlow.mockCreditCardFlow)(search["current-state"]));break;default:throw new Error("(mockStrategyStateByUrlParam) Strategy Mock Flow not supported");}}}function identifyStrategy(){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var _getConfig,strategy,strategyConfigs,isUseMsisdnPrefix,search,_strategyConfigs$defa,flowObj;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(_getConfig=(0,_utils2.getConfig)(),strategy=_getConfig.strategy,strategyConfigs=_getConfig.strategyConfigs,isUseMsisdnPrefix=strategyConfigs.isUseMsisdnPrefix,search=(0,_utils2.searchToObject)(),dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"IDENTIFY_STRATEGY",result:RDS.Loading()}}),void 0===search["mock-flow"]){_context.next=8;break}dispatch(mockStrategyStateByUrlParam()),_context.next=40;break;case 8:if(!(search["show-pin-entry"]&&"1"===search["show-pin-entry"]||search["show-thank-you"]&&"1"===search["show-thank-you"])){_context.next=13;break}flowObj=(0,_utils2.determineFlowByOperator)(search.operator),dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:(null===flowObj||void 0===flowObj?void 0:flowObj.flowConfig)||(null===strategyConfigs||void 0===strategyConfigs||null===(_strategyConfigs$defa=strategyConfigs.default)||void 0===_strategyConfigs$defa?void 0:_strategyConfigs$defa.flowConfig),isUseMsisdnPrefix:isUseMsisdnPrefix}}}),_context.next=40;break;case 13:_context.t0=strategy,_context.next="pin-mo-ask-operator"===_context.t0?16:"pin-mo-redir-ask-mobile-number"===_context.t0?17:"pin-mo-ask-mobile-number"===_context.t0?17:"pin-combo-ask-mobile-number"===_context.t0?17:"pin-mo-mo-redir-ask-mobile-number"===_context.t0?17:"pin-one-click-detect-operator-by-ip"===_context.t0?18:"one-click-mo-pin-detect-operator-by-ip-or-msisdn"===_context.t0?18:"mo-redir-one-click-detect-operator-by-ip"===_context.t0?18:"mo-one-click-detect-operator-by-ip"===_context.t0?18:"click2sms-one-click-detect-operator-by-ip"===_context.t0?18:"pin-mo-detect-operator-by-ip"===_context.t0?18:"mo-redir-mo-click2sms-one-click-detect-operator-by-ip-or-msisdn"===_context.t0?18:"pin-click2sms-ask-operator"===_context.t0?19:"he-pin-one-click-ask-operator"===_context.t0?19:"click2sms-one-click-ask-operator"===_context.t0?19:"pin-one-click-ask-operator"===_context.t0?19:"pin-header-enrichment"===_context.t0?20:"he-pin-mo-redir-header-enrichment"===_context.t0?20:"he-pin-one-click-header-enrichment"===_context.t0?20:"he-mo-redir-one-click-header-enrichment"===_context.t0?20:"header-enrichment-script"===_context.t0?21:"pin"===_context.t0?22:"mo"===_context.t0?26:"mo-redir"===_context.t0?28:"one-click"===_context.t0?30:"click2sms"===_context.t0?32:"ussd"===_context.t0?34:"tpay-he"===_context.t0?36:"credit-card"===_context.t0?38:39;break;case 16:return _context.abrupt("return",dispatch((0,_ask_operator.default)()));case 17:return _context.abrupt("return",dispatch((0,_ask_mobile_number.default)()));case 18:return _context.abrupt("return",dispatch((0,_detect_operator_by_ip.default)()));case 19:return _context.abrupt("return",dispatch((0,_ask_operator.default)()));case 20:return _context.abrupt("return",dispatch((0,_header_enrichment.default)()));case 21:return _context.abrupt("return",dispatch((0,_injectHeaderEnrichmentScript.default)()));case 22:return tracker.sendOptInFlowEvent("Pin"),search.msisdn&&tracker.customEvent("Flow","advance-auto","msisdn-detected-url-param",{msisdn:search.msisdn}),!0===window.isLoading&&dispatch((0,_pinFlow.checkLoadingAction)()),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig,isUseMsisdnPrefix:isUseMsisdnPrefix,msisdn:search.msisdn,isHeaderEnrichmentSuccess:(0,_utilities.isCookieExists)("OMEU")&&"ES"===strategyConfigs.default.flowConfig.country||search.msisdn}}}));case 26:return tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 28:return tracker.sendOptInFlowEvent("Redirect"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 30:return tracker.sendOptInFlowEvent("3G click"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:strategyConfigs.default.flowConfig}}}));case 32:return tracker.sendOptInFlowEvent("Click to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:strategyConfigs.default.flowConfig}}}));case 34:return tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"USSD",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 36:return tracker.sendOptInFlowEvent("Hybrid Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"TPAY_HE",result:{nextAction:"loadTpayAction",config:strategyConfigs.default.flowConfig}}}));case 38:return _context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"CREDIT_CARD",result:{config:strategyConfigs.default.flowConfig,isUseMsisdnPrefix:isUseMsisdnPrefix}}}));case 39:throw new Error("Strategy not supported");case 40:case"end":return _context.stop();}},_callee)}));return function(_x){return _ref.apply(this,arguments)}}()}function checkSubscriptionAction(trackingArgs){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch,store){var currentState,maybeConfig;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:currentState=store().strategy.currentState,maybeConfig=currentState.result.config;try{dispatch({type:"CHECK_SUBSCRIPTION"}),(0,_utils.checkSubscription)(window,maybeConfig).then(function(product_url){product_url&&""!==product_url&&(tracker.advancedInFlow(trackingArgs.flow,trackingArgs.action,_objectSpread(_objectSpread({},trackingArgs.args),{},{url:product_url})),setTimeout(function(){window.location.href=product_url},1e3))})}catch(ex){console.warn(ex)}case 3:case"end":return _context2.stop();}},_callee2)}));return function(_x2,_x3){return _ref2.apply(this,arguments)}}()}function genericHandler(state,payload){return(0,_immutabilityHelper.default)(state,{currentState:{$set:payload}})}var search=(0,_utils2.searchToObject)(),isPinEntryStep=search["show-pin-entry"]&&"1"===search["show-pin-entry"],configs=(0,_utils2.getConfig)(),defaultFlowConfig=configs.strategyConfigs.default,initialStateDefault={currentState:{type:"IDENTIFY_STRATEGY",result:RDS.NothingYet()}},initalPinEntryState={currentState:{type:"IDENTIFY_STRATEGY",result:RDS.Success({type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlowConfig.flowConfig}})}},initialState=isPinEntryStep?initalPinEntryState:initialStateDefault,StrategyFlowActionMaps={selectOperator:_ask_operator.selectOperator,submitMSISDNAction:_ask_mobile_number.submitMSISDNAction,loadOc2sms:_click2smsFlow.loadOc2sms};exports.StrategyFlowActionMaps=StrategyFlowActionMaps;function StrategyReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"IDENTIFY_STRATEGY":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return genericHandler(state,action.payload);case"OPERATOR_SELECT":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_MSISDN":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_MSISDN_SUBMIT":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_IP":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_IP_OPERATOR":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_HE":return genericHandler(state,action.payload);case"HE_IDENTIFY":return genericHandler(state,action.payload);case"MOCK_STRATEGY_STATE":return genericHandler(state,action.payload);default:return state;}}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../../common-types/AppThunk';
|
|
2
|
-
import { IFlow } from '../StrategyTypes';
|
|
3
|
-
export default function ask_mobile_number(payload?: {
|
|
4
|
-
msisdn: string;
|
|
5
|
-
operator: string;
|
|
6
|
-
isHeaderEnrichmentSuccess: boolean;
|
|
7
|
-
}): AppThunk;
|
|
8
|
-
export declare function submitMSISDNAction(internationalMSISDN: string, isHeSuccess?: boolean): AppThunk;
|
|
9
|
-
export declare const header_enrichment_script: (flowObj: IFlow, msisdn: string, isHeaderEnrichmentSuccess: boolean) => AppThunk;
|
|
10
|
-
export declare const pin_mo_ask_mobile_number: (flowObj: IFlow, msisdn: string) => AppThunk;
|
|
11
|
-
export declare const pin_combo_ask_mobile_number: (flowObj: IFlow, msisdn: string) => AppThunk;
|
|
12
|
-
export declare const pin_mo_redir_ask_mobile_number: (flowObj: IFlow, msisdn: string) => AppThunk;
|
|
13
|
-
export declare const pin_mo_mo_redir_ask_mobile_number: (flowObj: IFlow, msisdn: string) => AppThunk;
|
|
14
|
-
export declare const one_click_mo_pin_detect_operator_by_ip_or_msisdn: (flowObj: IFlow, msisdn: string) => AppThunk;
|
|
15
|
-
export declare const mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn: (flowObj: IFlow, msisdn: string) => AppThunk;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";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.object.keys.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.array.filter.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"),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/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=ask_mobile_number,exports.pin_mo_redir_ask_mobile_number=exports.pin_mo_mo_redir_ask_mobile_number=exports.pin_mo_ask_mobile_number=exports.pin_combo_ask_mobile_number=exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn=exports.mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=exports.header_enrichment_script=void 0,exports.submitMSISDNAction=submitMSISDNAction,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _=require(".."),RDS=_interopRequireWildcard(require("../../../common-types/RemoteDataState")),_utils=require("../utils");function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}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 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}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 ask_mobile_number(payload){return function(dispatch){try{dispatch({type:"IDENTIFY_FLOW_BY_MSISDN",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.NothingYet(),nextData:{nextAction:"submitMSISDNAction",msisdn:null===payload||void 0===payload?void 0:payload.msisdn,operator:null===payload||void 0===payload?void 0:payload.operator,isHeaderEnrichmentSuccess:(null===payload||void 0===payload?void 0:payload.isHeaderEnrichmentSuccess)||!1}}})}catch(err){dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_ERROR",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Failure(err)}})}}}function submitMSISDNAction(internationalMSISDN,isHeSuccess){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch,store){var _state$strategy,state,strategyState,nextData,_getConfig,strategy,flowObj,errorType;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return state=store(),strategyState=null===state||void 0===state||null===(_state$strategy=state.strategy)||void 0===_state$strategy?void 0:_state$strategy.currentState,nextData=null===strategyState||void 0===strategyState?void 0:strategyState.nextData,_context.prev=3,dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:{nextAction:"submitMSISDNAction"}}}),_getConfig=(0,_utils.getConfig)(),strategy=_getConfig.strategy,_context.next=8,(0,_utils.determineFlowByMsidn)(internationalMSISDN);case 8:flowObj=_context.sent,dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Success(flowObj),nextData:_objectSpread(_objectSpread({nextAction:"submitMSISDNAction"},flowObj.operator&&{operator:flowObj.operator}),nextData)}}),_context.t0=strategy,_context.next="pin-mo-redir-ask-mobile-number"===_context.t0?13:"pin-mo-ask-mobile-number"===_context.t0?14:"pin-combo-ask-mobile-number"===_context.t0?15:"header-enrichment-script"===_context.t0?16:"mo-redir-mo-click2sms-one-click-detect-operator-by-ip-or-msisdn"===_context.t0?17:"pin-mo-mo-redir-ask-mobile-number"===_context.t0?18:19;break;case 13:return _context.abrupt("return",dispatch(pin_mo_redir_ask_mobile_number(flowObj,internationalMSISDN)));case 14:return _context.abrupt("return",dispatch(pin_mo_ask_mobile_number(flowObj,internationalMSISDN)));case 15:return _context.abrupt("return",dispatch(pin_combo_ask_mobile_number(flowObj,internationalMSISDN)));case 16:return _context.abrupt("return",dispatch(header_enrichment_script(flowObj,internationalMSISDN,isHeSuccess)));case 17:return _context.abrupt("return",dispatch(mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn(flowObj,internationalMSISDN)));case 18:return _context.abrupt("return",dispatch(pin_mo_mo_redir_ask_mobile_number(flowObj,internationalMSISDN)));case 19:_context.next=26;break;case 21:_context.prev=21,_context.t1=_context["catch"](3),console.warn(_context.t1),errorType="SEAlreadySubscribed"===_context.t1.type?"AlreadySubscribed":"SEInvalidMSISDN"===_context.t1.type?"InvalidMSISDN":"UnknownError",dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Failure({errorType:errorType,error:_context.t1})}});case 26:case"end":return _context.stop();}},_callee,null,[[3,21]])}));return function(_x,_x2){return _ref.apply(this,arguments)}}()}var header_enrichment_script=function header_enrichment_script(flowObj,msisdn,isHeaderEnrichmentSuccess){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:_objectSpread({nextAction:"submitMSISDNAction",isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess},flowObj.operator&&{operator:flowObj.operator})}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess},flowObj.operator&&{operator:flowObj.operator})}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});}}};exports.header_enrichment_script=header_enrichment_script;var pin_mo_ask_mobile_number=function pin_mo_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:_objectSpread({nextAction:"submitMSISDNAction"},flowObj.operator&&{operator:flowObj.operator})}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn},flowObj.operator&&{operator:flowObj.operator})}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});}}};exports.pin_mo_ask_mobile_number=pin_mo_ask_mobile_number;var pin_combo_ask_mobile_number=function pin_combo_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:_objectSpread({nextAction:"submitMSISDNAction"},flowObj.operator&&{operator:flowObj.operator})}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn},flowObj.operator&&{operator:flowObj.operator})}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});}}};exports.pin_combo_ask_mobile_number=pin_combo_ask_mobile_number;var pin_mo_redir_ask_mobile_number=function pin_mo_redir_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:{nextAction:"submitMSISDNAction"}}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.pin_mo_redir_ask_mobile_number=pin_mo_redir_ask_mobile_number;var pin_mo_mo_redir_ask_mobile_number=function pin_mo_mo_redir_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:{nextAction:"submitMSISDNAction"}}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.pin_mo_mo_redir_ask_mobile_number=pin_mo_mo_redir_ask_mobile_number;var one_click_mo_pin_detect_operator_by_ip_or_msisdn=function one_click_mo_pin_detect_operator_by_ip_or_msisdn(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"oneClick":return _.tracker.sendOptInFlowEvent("3G click"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"ONE_CLICK",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn=one_click_mo_pin_detect_operator_by_ip_or_msisdn;var mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=function mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn(flowObj,msisdn){return function(dispatch){switch(flowObj.flowOnWifi){case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../../common-types/AppThunk';
|
|
2
|
-
import { IFlow } from '../StrategyTypes';
|
|
3
|
-
export default function ask_operator(): AppThunk;
|
|
4
|
-
export declare const he_pin_one_click_ask_operator: (flowObj: IFlow) => AppThunk;
|
|
5
|
-
export declare function selectOperator(operator: string): AppThunk;
|