ouisys-engine 4.3.0-alpha.0 → 4.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/window.d.js +1 -1
- package/dist/api/index.d.ts +43 -0
- package/dist/api/index.js +1 -728
- package/dist/common-types/AppThunk.d.ts +13 -0
- package/dist/common-types/AppThunk.js +1 -1
- package/dist/common-types/Either.d.ts +8 -0
- package/dist/common-types/Either.js +1 -1
- package/dist/common-types/IError.d.ts +3 -0
- package/dist/common-types/IError.js +1 -1
- package/dist/common-types/IOptInFlowName.d.ts +1 -0
- package/dist/common-types/ITracker.d.ts +9 -0
- package/dist/common-types/ITracker.js +1 -3
- package/dist/common-types/IVisitor.d.ts +14 -0
- package/dist/common-types/IVisitor.js +1 -1
- package/dist/common-types/RemoteDataState.d.ts +38 -0
- package/dist/common-types/RemoteDataState.js +1 -135
- package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +3 -0
- package/dist/custom-hooks/useOneClickRedirectUrl.js +1 -0
- package/dist/custom-hooks/usePinEntryState.d.ts +8 -0
- package/dist/custom-hooks/usePinEntryState.js +1 -0
- package/dist/custom-hooks/useStrategyConfig.d.ts +4 -0
- package/dist/custom-hooks/useStrategyConfig.js +1 -0
- package/dist/flows/click2smsFlow.d.ts +6 -0
- package/dist/flows/click2smsFlow.js +1 -19
- package/dist/flows/creditCardFlow.d.ts +6 -0
- package/dist/flows/creditCardFlow.js +1 -0
- package/dist/flows/moFlow.d.ts +6 -0
- package/dist/flows/moFlow.js +1 -19
- package/dist/flows/moRedirFlow.d.ts +6 -0
- package/dist/flows/moRedirFlow.js +1 -19
- package/dist/flows/oneClickFlow.d.ts +7 -0
- package/dist/flows/oneClickFlow.js +1 -23
- package/dist/flows/pinFlow.d.ts +7 -0
- package/dist/flows/pinFlow.js +1 -23
- package/dist/flows/strategy.d.ts +14 -0
- package/dist/flows/strategy.js +1 -53
- package/dist/flows/ussdFlow.d.ts +6 -0
- package/dist/flows/ussdFlow.js +1 -19
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -2
- package/dist/ips/tryGetIPRangeName.d.ts +2 -0
- package/dist/ips/tryGetIPRangeName.js +1 -74
- package/dist/jest.config.js +194 -0
- package/dist/pacman/index.d.ts +6 -0
- package/dist/pacman/index.js +1 -108
- package/dist/pacman/queryString.d.ts +3 -0
- package/dist/pacman/queryString.js +1 -45
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +76 -0
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +2 -0
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -1
- package/dist/reducers/click2smsFlow/index.d.ts +5 -0
- package/dist/reducers/click2smsFlow/index.js +1 -183
- package/dist/reducers/click2smsFlow/utils.d.ts +4 -0
- package/dist/reducers/click2smsFlow/utils.js +1 -357
- package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +79 -0
- package/dist/reducers/creditCardFlow/CreditCardTypes.js +1 -0
- package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +2 -0
- package/dist/reducers/creditCardFlow/ICreditCardConstants.js +1 -0
- package/dist/reducers/creditCardFlow/index.d.ts +5 -0
- package/dist/reducers/creditCardFlow/index.js +1 -0
- package/dist/reducers/creditCardFlow/utils.d.ts +8 -0
- package/dist/reducers/creditCardFlow/utils.js +1 -0
- package/dist/reducers/moFlow/IMoConstants.d.ts +2 -0
- package/dist/reducers/moFlow/IMoConstants.js +1 -1
- package/dist/reducers/moFlow/MoTypes.d.ts +88 -0
- package/dist/reducers/moFlow/MoTypes.js +1 -1
- package/dist/reducers/moFlow/index.d.ts +16 -0
- package/dist/reducers/moFlow/index.js +1 -251
- package/dist/reducers/moFlow/utils.d.ts +12 -0
- package/dist/reducers/moFlow/utils.js +1 -284
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +2 -0
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +64 -0
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -1
- package/dist/reducers/moRedirFlow/index.d.ts +14 -0
- package/dist/reducers/moRedirFlow/index.js +1 -226
- package/dist/reducers/moRedirFlow/utils.d.ts +10 -0
- package/dist/reducers/moRedirFlow/utils.js +1 -186
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +2 -0
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +85 -0
- package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -1
- package/dist/reducers/oneClickFlow/index.d.ts +13 -0
- package/dist/reducers/oneClickFlow/index.js +1 -409
- package/dist/reducers/oneClickFlow/utils.d.ts +16 -0
- package/dist/reducers/oneClickFlow/utils.js +1 -366
- package/dist/reducers/pinFlow/IPinConstants.d.ts +2 -0
- package/dist/reducers/pinFlow/IPinConstants.js +1 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +156 -0
- package/dist/reducers/pinFlow/PinTypes.js +1 -1
- package/dist/reducers/pinFlow/index.d.ts +19 -0
- package/dist/reducers/pinFlow/index.js +1 -514
- package/dist/reducers/pinFlow/utils.d.ts +11 -0
- package/dist/reducers/pinFlow/utils.js +1 -494
- package/dist/reducers/strategy/IStategyActionContants.d.ts +2 -0
- package/dist/reducers/strategy/IStategyActionContants.js +1 -1
- package/dist/reducers/strategy/StrategyTypes.d.ts +248 -0
- package/dist/reducers/strategy/StrategyTypes.js +1 -1
- package/dist/reducers/strategy/index.d.ts +13 -0
- package/dist/reducers/strategy/index.js +1 -389
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +15 -0
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +1 -403
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +5 -0
- package/dist/reducers/strategy/strategies/ask_operator.js +1 -305
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +10 -0
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +1 -459
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +7 -0
- package/dist/reducers/strategy/strategies/header_enrichment.js +1 -783
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +2 -0
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +1 -0
- package/dist/reducers/strategy/utils.d.ts +30 -0
- package/dist/reducers/strategy/utils.js +1 -702
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +2 -0
- package/dist/reducers/ussdFlow/IUssdConstants.js +1 -1
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +77 -0
- package/dist/reducers/ussdFlow/UssdTypes.js +1 -1
- package/dist/reducers/ussdFlow/index.d.ts +14 -0
- package/dist/reducers/ussdFlow/index.js +1 -251
- package/dist/reducers/ussdFlow/utils.d.ts +11 -0
- package/dist/reducers/ussdFlow/utils.js +1 -225
- package/dist/store/index.d.ts +14 -0
- package/dist/store/index.js +1 -177
- package/dist/store/reducers.d.ts +20 -0
- package/dist/store/reducers.js +1 -41
- package/dist/utilities/addEmpelloToken.d.ts +4 -0
- package/dist/utilities/addEmpelloToken.js +1 -0
- package/dist/utilities/handleSubmitNumber.d.ts +21 -0
- package/dist/utilities/handleSubmitNumber.js +1 -59
- package/dist/utilities/index.d.ts +14 -0
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/loadScriptInnerHtml.d.ts +2 -0
- package/dist/utilities/loadScriptInnerHtml.js +1 -0
- package/dist/utilities/loadScriptSrc.d.ts +8 -0
- package/dist/utilities/loadScriptSrc.js +1 -0
- package/dist/utilities/replaceUrlParam.d.ts +1 -0
- package/dist/utilities/replaceUrlParam.js +1 -0
- package/dist/utilities/storeMsisdn.d.ts +3 -0
- package/dist/utilities/storeMsisdn.js +1 -0
- package/package.json +1 -1
- package/dist/app/store.js +0 -20
- package/dist/features/strategies/categories/askMobileNumber.js +0 -388
- package/dist/features/strategies/categories/askOperator.js +0 -313
- package/dist/features/strategies/categories/detectOperatorByIp.js +0 -599
- package/dist/features/strategies/categories/headerEnrichment.js +0 -665
- package/dist/features/strategies/categories/singleFlows/pin.js +0 -1
- package/dist/features/strategies/identifySlice.js +0 -355
- package/dist/features/strategies/pinFlowSlice.js +0 -338
- package/dist/flows/tpayHeFlow.js +0 -23
- package/dist/mockServer/browser.js +0 -48
- package/dist/mockServer/handlers.js +0 -22
- package/dist/mockServer/server.js +0 -48
- package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +0 -1
- package/dist/reducers/tpayHeFlow/TpayHeTypes.js +0 -1
- package/dist/reducers/tpayHeFlow/index.js +0 -331
- package/dist/reducers/tpayHeFlow/utils.js +0 -510
- package/dist/test/setup.js +0 -24
- package/dist/test/test-utils.js +0 -51
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from 'redux';
|
|
2
|
+
import { ThunkAction } from 'redux-thunk';
|
|
3
|
+
import IClick2smsConstants from '../reducers/click2smsFlow/IClick2smsConstants';
|
|
4
|
+
import ICreditCardConstants from '../reducers/creditCardFlow/ICreditCardConstants';
|
|
5
|
+
import IMoConstants from '../reducers/moFlow/IMoConstants';
|
|
6
|
+
import IMoRedirConstants from '../reducers/moRedirFlow/IMoRedirConstants';
|
|
7
|
+
import IOneClickConstants from '../reducers/oneClickFlow/IOneClickConstants';
|
|
8
|
+
import IPinConstants from '../reducers/pinFlow/IPinConstants';
|
|
9
|
+
import IStategyActionContants from '../reducers/strategy/IStategyActionContants';
|
|
10
|
+
import IUssdConstants from '../reducers/ussdFlow/IUssdConstants';
|
|
11
|
+
import { IApplicationState } from '../store/reducers';
|
|
12
|
+
export declare type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants | ICreditCardConstants;
|
|
13
|
+
export declare type AppThunk<ReturnType = void> = ThunkAction<ReturnType, IApplicationState, unknown, Action<IAllActionConstants>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare type IOptInFlowName = 'Block' | 'Click to sms' | 'Hybrid Pin' | 'Msisdn to sms' | 'Not available' | 'Pin' | 'Redirect' | 'To be determined' | 'USSD' | '3G click';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ITracker {
|
|
2
|
+
viewChanged: (view: string) => void;
|
|
3
|
+
msisdnSubmitted: (msisdn: string) => void;
|
|
4
|
+
advancedInFlow: (flow: string, action: string, args?: any) => void;
|
|
5
|
+
advancedInPreFlow: (label: string, args?: any) => void;
|
|
6
|
+
recedeInFlow: (flow: string, newState: string, args?: any) => void;
|
|
7
|
+
customEvent: (category: string, action: string, label: string, args?: any) => void;
|
|
8
|
+
}
|
|
9
|
+
export default ITracker;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type IVisitor = {
|
|
2
|
+
country: string;
|
|
3
|
+
rockmanId: string;
|
|
4
|
+
impressionNumber: number;
|
|
5
|
+
page: string;
|
|
6
|
+
xaid: string;
|
|
7
|
+
cid: number;
|
|
8
|
+
handle_name?: string;
|
|
9
|
+
chainRedirectUrl?: string;
|
|
10
|
+
offer?: number;
|
|
11
|
+
ip?: string;
|
|
12
|
+
ip_range_name?: string;
|
|
13
|
+
};
|
|
14
|
+
export default IVisitor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare type RemoteDataState<E, D> = {
|
|
2
|
+
type: 'NothingYet';
|
|
3
|
+
} | {
|
|
4
|
+
type: 'Loading';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'Failure';
|
|
7
|
+
error: E;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'Success';
|
|
10
|
+
data: D;
|
|
11
|
+
};
|
|
12
|
+
export interface IMatcher<E, D, R> {
|
|
13
|
+
nothingYet: (data?: D) => R;
|
|
14
|
+
loading: () => R;
|
|
15
|
+
failure: (error: E) => R;
|
|
16
|
+
success: (data: D) => R;
|
|
17
|
+
}
|
|
18
|
+
export interface ISuccessMatcher<E, D, R> {
|
|
19
|
+
success: (data: D) => R;
|
|
20
|
+
otherwise: (rds: RemoteDataState<E, D>) => R;
|
|
21
|
+
}
|
|
22
|
+
export declare function match<E, D, R>({ nothingYet, loading, failure, success }: IMatcher<E, D, R>): (model: RemoteDataState<E, D>) => R;
|
|
23
|
+
export declare const NothingYet: <E, D>() => RemoteDataState<E, D>;
|
|
24
|
+
export declare const Loading: <E, D>() => RemoteDataState<E, D>;
|
|
25
|
+
export declare const Failure: <E, D>(error: E) => RemoteDataState<E, D>;
|
|
26
|
+
export declare const Success: <E, D>(data: D) => RemoteDataState<E, D>;
|
|
27
|
+
export declare const IsNothingYet: <E, D>(s: RemoteDataState<E, D>) => boolean;
|
|
28
|
+
export declare const IsLoading: <E, D>(s: RemoteDataState<E, D>) => boolean;
|
|
29
|
+
export declare const IsFailure: <E, D>(s: RemoteDataState<E, D>) => boolean;
|
|
30
|
+
export declare const IsSuccess: <E, D>(s: RemoteDataState<E, D>) => boolean;
|
|
31
|
+
export declare const WhenFailure: <E, D, R>(d: R, r: (err: E) => R) => (s: RemoteDataState<E, D>) => R;
|
|
32
|
+
export declare const WhenLoading: <D, R>(d: R, r: () => R) => (s: RemoteDataState<unknown, D>) => R;
|
|
33
|
+
export declare const WhenSuccess: <D, R>(d: R, r: (data: D) => R) => (s: RemoteDataState<unknown, D>) => R;
|
|
34
|
+
export declare const MatchFailure: <E, D, R>({ failure, otherwise }: {
|
|
35
|
+
otherwise: () => R;
|
|
36
|
+
failure: (err: E) => R;
|
|
37
|
+
}) => (s: RemoteDataState<E, D>) => R;
|
|
38
|
+
export declare const MatchSuccess: <E, D, R>({ success, otherwise }: ISuccessMatcher<E, D, R>) => (s: RemoteDataState<E, D>) => R;
|
|
@@ -1,135 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.regexp.exec");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.string.match");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.match = match;
|
|
11
|
-
exports.MatchSuccess = exports.MatchFailure = exports.WhenSuccess = exports.WhenLoading = exports.WhenFailure = exports.IsSuccess = exports.IsFailure = exports.IsLoading = exports.IsNothingYet = exports.Success = exports.Failure = exports.Loading = exports.NothingYet = void 0;
|
|
12
|
-
|
|
13
|
-
function match(_ref) {
|
|
14
|
-
var nothingYet = _ref.nothingYet,
|
|
15
|
-
loading = _ref.loading,
|
|
16
|
-
failure = _ref.failure,
|
|
17
|
-
success = _ref.success;
|
|
18
|
-
return function (model) {
|
|
19
|
-
switch (model.type) {
|
|
20
|
-
case 'NothingYet':
|
|
21
|
-
return nothingYet();
|
|
22
|
-
|
|
23
|
-
case 'Loading':
|
|
24
|
-
return loading();
|
|
25
|
-
|
|
26
|
-
case 'Failure':
|
|
27
|
-
return failure(model.error);
|
|
28
|
-
|
|
29
|
-
case 'Success':
|
|
30
|
-
return success(model.data);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var NothingYet = function NothingYet(data) {
|
|
36
|
-
return {
|
|
37
|
-
type: 'NothingYet'
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.NothingYet = NothingYet;
|
|
42
|
-
|
|
43
|
-
var Loading = function Loading() {
|
|
44
|
-
return {
|
|
45
|
-
type: 'Loading'
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
exports.Loading = Loading;
|
|
50
|
-
|
|
51
|
-
var Failure = function Failure(error) {
|
|
52
|
-
return {
|
|
53
|
-
type: 'Failure',
|
|
54
|
-
error: error
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
exports.Failure = Failure;
|
|
59
|
-
|
|
60
|
-
var Success = function Success(data) {
|
|
61
|
-
return {
|
|
62
|
-
type: 'Success',
|
|
63
|
-
data: data
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.Success = Success;
|
|
68
|
-
|
|
69
|
-
var IsNothingYet = function IsNothingYet(s) {
|
|
70
|
-
return s.type == 'NothingYet';
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
exports.IsNothingYet = IsNothingYet;
|
|
74
|
-
|
|
75
|
-
var IsLoading = function IsLoading(s) {
|
|
76
|
-
return s.type == 'Loading';
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
exports.IsLoading = IsLoading;
|
|
80
|
-
|
|
81
|
-
var IsFailure = function IsFailure(s) {
|
|
82
|
-
return s.type == 'Failure';
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
exports.IsFailure = IsFailure;
|
|
86
|
-
|
|
87
|
-
var IsSuccess = function IsSuccess(s) {
|
|
88
|
-
return s.type == 'Success';
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
exports.IsSuccess = IsSuccess;
|
|
92
|
-
|
|
93
|
-
var WhenFailure = function WhenFailure(d, r) {
|
|
94
|
-
return function (s) {
|
|
95
|
-
return s.type == 'Failure' ? r(s.error) : d;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
exports.WhenFailure = WhenFailure;
|
|
100
|
-
|
|
101
|
-
var WhenLoading = function WhenLoading(d, r) {
|
|
102
|
-
return function (s) {
|
|
103
|
-
return s.type == 'Loading' ? r() : d;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
exports.WhenLoading = WhenLoading;
|
|
108
|
-
|
|
109
|
-
var WhenSuccess = function WhenSuccess(d, r) {
|
|
110
|
-
return function (s) {
|
|
111
|
-
return s.type == 'Success' ? r(s.data) : d;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
exports.WhenSuccess = WhenSuccess;
|
|
116
|
-
|
|
117
|
-
var MatchFailure = function MatchFailure(_ref2) {
|
|
118
|
-
var failure = _ref2.failure,
|
|
119
|
-
otherwise = _ref2.otherwise;
|
|
120
|
-
return function (s) {
|
|
121
|
-
return s.type == 'Failure' ? failure(s.error) : otherwise();
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
exports.MatchFailure = MatchFailure;
|
|
126
|
-
|
|
127
|
-
var MatchSuccess = function MatchSuccess(_ref3) {
|
|
128
|
-
var success = _ref3.success,
|
|
129
|
-
otherwise = _ref3.otherwise;
|
|
130
|
-
return function (s) {
|
|
131
|
-
return s.type == 'Success' ? success(s.data) : otherwise(s);
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
exports.MatchSuccess = MatchSuccess;
|
|
1
|
+
"use strict";require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.match.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.WhenSuccess=exports.WhenLoading=exports.WhenFailure=exports.Success=exports.NothingYet=exports.MatchSuccess=exports.MatchFailure=exports.Loading=exports.IsSuccess=exports.IsNothingYet=exports.IsLoading=exports.IsFailure=exports.Failure=void 0,exports.match=match;function match(_ref){var nothingYet=_ref.nothingYet,loading=_ref.loading,failure=_ref.failure,success=_ref.success;return function(model){switch(model.type){case"NothingYet":return nothingYet();case"Loading":return loading();case"Failure":return failure(model.error);case"Success":return success(model.data);default:return nothingYet();}}}var NothingYet=function(){return{type:"NothingYet"}};exports.NothingYet=NothingYet;var Loading=function(){return{type:"Loading"}};exports.Loading=Loading;var Failure=function(error){return{type:"Failure",error:error}};exports.Failure=Failure;var Success=function(data){return{type:"Success",data:data}};exports.Success=Success;var IsNothingYet=function(s){return"NothingYet"===s.type};exports.IsNothingYet=IsNothingYet;var IsLoading=function(s){return"Loading"===s.type};exports.IsLoading=IsLoading;var IsFailure=function(s){return"Failure"===s.type};exports.IsFailure=IsFailure;var IsSuccess=function(s){return"Success"===s.type};exports.IsSuccess=IsSuccess;var WhenFailure=function(d,r){return function(s){return"Failure"===s.type?r(s.error):d}};exports.WhenFailure=WhenFailure;var WhenLoading=function(d,r){return function(s){return"Loading"===s.type?r():d}};exports.WhenLoading=WhenLoading;var WhenSuccess=function(d,r){return function(s){return"Success"===s.type?r(s.data):d}};exports.WhenSuccess=WhenSuccess;var MatchFailure=function(_ref2){var failure=_ref2.failure,otherwise=_ref2.otherwise;return function(s){return"Failure"===s.type?failure(s.error):otherwise()}};exports.MatchFailure=MatchFailure;var MatchSuccess=function(_ref3){var success=_ref3.success,otherwise=_ref3.otherwise;return function(s){return"Success"===s.type?success(s.data):otherwise(s)}};exports.MatchSuccess=MatchSuccess;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useOneClickRedirectUrl=void 0;var useOneClickRedirectUrl=function(useSelector){var _currentState$result,_currentState$result$,_useSelector=useSelector(function(state){return state.oneClickFlow}),currentState=_useSelector.currentState;return(null===currentState||void 0===currentState||null===(_currentState$result=currentState.result)||void 0===_currentState$result||null===(_currentState$result$=_currentState$result.data)||void 0===_currentState$result$?void 0:_currentState$result$.redirectUrl)||"JavaScript:Void(0);"};exports.useOneClickRedirectUrl=useOneClickRedirectUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.usePinEntryState=void 0;var usePinEntryState=function(useSelector){var _useSelector=useSelector(function(state){return state.pinFlow}),currentState=_useSelector.currentState,_ref=(null===currentState||void 0===currentState?void 0:currentState.data)||{},actualPIN=_ref.actualPIN,msisdn=_ref.msisdn,operator=_ref.operator,pinMaxLength=_ref.pinMaxLength;return{actualPIN:actualPIN,msisdn:msisdn,operator:operator,pinMaxLength:pinMaxLength}};exports.usePinEntryState=usePinEntryState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useStrategyConfig=void 0;var useStrategyConfig=function(useSelector){var _config$default,_config$default2,_useSelector=useSelector(function(state){return state.strategy}),strategyCurrentState=_useSelector.currentState,_strategyCurrentState=null===strategyCurrentState||void 0===strategyCurrentState?void 0:strategyCurrentState.result,config=_strategyCurrentState.config;return null!==config&&void 0!==config&&null!==(_config$default=config.default)&&void 0!==_config$default&&_config$default.flowConfig?null===config||void 0===config||null===(_config$default2=config.default)||void 0===_config$default2?void 0:_config$default2.flowConfig:config};exports.useStrategyConfig=useStrategyConfig;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IClick2smsFlowCurrentState, IWithMultiKeywordShortcode } from '../reducers/click2smsFlow/Click2smsTypes';
|
|
3
|
+
declare function click2smsFlowMatch<R>({ load }: {
|
|
4
|
+
load: (rds: RDS.RemoteDataState<string, IWithMultiKeywordShortcode>) => R;
|
|
5
|
+
}): (state: IClick2smsFlowCurrentState) => R;
|
|
6
|
+
export default click2smsFlowMatch;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function click2smsFlowMatch(_ref) {
|
|
9
|
-
var load = _ref.load;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'LOAD_OC2SMS':
|
|
13
|
-
return load(state.result);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _default = click2smsFlowMatch;
|
|
19
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function click2smsFlowMatch(_ref){var load=_ref.load;return function(state){switch(state.type){case"LOAD_OC2SMS":return load(state.result);default:return load(state.result);}}}var _default=click2smsFlowMatch;exports.default=_default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { ICreditCardFlowCurrentState, SubmitUserDetailsFailure, SubmitUserDetailsSuccess } from '../reducers/creditCardFlow/CreditCardTypes';
|
|
3
|
+
declare function creditCardFlowMatch<R>({ userDetailsEntry }: {
|
|
4
|
+
userDetailsEntry: (rds: RDS.RemoteDataState<SubmitUserDetailsFailure, SubmitUserDetailsSuccess>) => R;
|
|
5
|
+
}): (state: ICreditCardFlowCurrentState) => R;
|
|
6
|
+
export default creditCardFlowMatch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function creditCardFlowMatch(_ref){var userDetailsEntry=_ref.userDetailsEntry;return function(state){switch(state.type){case"USER_DETAILS_ENTRY":return userDetailsEntry(state.result);}}}var _default=creditCardFlowMatch;exports.default=_default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IMoFlowCurrentState, MSISDNEntryFailure, MSISDNEntrySuccess } from '../reducers/moFlow/MoTypes';
|
|
3
|
+
declare function moFlowMatch<R>({ msisdnEntry }: {
|
|
4
|
+
msisdnEntry: (rds: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>) => R;
|
|
5
|
+
}): (state: IMoFlowCurrentState) => R;
|
|
6
|
+
export default moFlowMatch;
|
package/dist/flows/moFlow.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function moFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'MSISDNEntry':
|
|
13
|
-
return msisdnEntry(state.result);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _default = moFlowMatch;
|
|
19
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function moFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);default:return msisdnEntry(state.result);}}}var _default=moFlowMatch;exports.default=_default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IMoRedirFlowCurrentState, MSISDNEntryFailure, MSISDNEntrySuccess } from '../reducers/moRedirFlow/MoRedirTypes';
|
|
3
|
+
declare function moRedirFlowMatch<R>({ msisdnEntry }: {
|
|
4
|
+
msisdnEntry: (rds: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>) => R;
|
|
5
|
+
}): (state: IMoRedirFlowCurrentState) => R;
|
|
6
|
+
export default moRedirFlowMatch;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function moRedirFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'MSISDNEntry':
|
|
13
|
-
return msisdnEntry(state.result);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _default = moRedirFlowMatch;
|
|
19
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function moRedirFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);default:return msisdnEntry(state.result);}}}var _default=moRedirFlowMatch;exports.default=_default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess, IOneClickCurrentState, SubscribeFailure, SubscribeSuccess } from '../reducers/oneClickFlow/OneClickTypes';
|
|
3
|
+
declare function oneClickFlowMatch<R>({ getRedirectUrl, subscribe }: {
|
|
4
|
+
getRedirectUrl: (rds: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>) => R;
|
|
5
|
+
subscribe?: (rds: RDS.RemoteDataState<SubscribeFailure, SubscribeSuccess>) => R;
|
|
6
|
+
}): (state: IOneClickCurrentState) => R;
|
|
7
|
+
export default oneClickFlowMatch;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function oneClickFlowMatch(_ref) {
|
|
9
|
-
var getRedirectUrl = _ref.getRedirectUrl,
|
|
10
|
-
subscribe = _ref.subscribe;
|
|
11
|
-
return function (state) {
|
|
12
|
-
switch (state.type) {
|
|
13
|
-
case 'GET_REDIRECT_URL':
|
|
14
|
-
return getRedirectUrl(state.result);
|
|
15
|
-
|
|
16
|
-
case 'SUBCRIBE_AJAX':
|
|
17
|
-
return subscribe(state.result);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var _default = oneClickFlowMatch;
|
|
23
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function oneClickFlowMatch(_ref){var getRedirectUrl=_ref.getRedirectUrl,subscribe=_ref.subscribe;return function(state){switch(state.type){case"GET_REDIRECT_URL":return getRedirectUrl(state.result);case"SUBCRIBE_AJAX":return subscribe(state.result);default:return getRedirectUrl(state.result);}}}var _default=oneClickFlowMatch;exports.default=_default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IMsisdnSumbitNextData, IPinFlowCurrentState, MSISDNEntryFailure, MSISDNEntrySuccess, PINEntryFailure, PINEntrySuccess } from '../reducers/pinFlow/PinTypes';
|
|
3
|
+
declare function pinFlowMatch<R>({ msisdnEntry, pinEntry }: {
|
|
4
|
+
msisdnEntry: (rds: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>) => R;
|
|
5
|
+
pinEntry: (rds: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>, nextData: IMsisdnSumbitNextData) => R;
|
|
6
|
+
}): (state: IPinFlowCurrentState) => R;
|
|
7
|
+
export default pinFlowMatch;
|
package/dist/flows/pinFlow.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function pinFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry,
|
|
10
|
-
pinEntry = _ref.pinEntry;
|
|
11
|
-
return function (state) {
|
|
12
|
-
switch (state.type) {
|
|
13
|
-
case 'MSISDNEntry':
|
|
14
|
-
return msisdnEntry(state.result);
|
|
15
|
-
|
|
16
|
-
case 'PINEntry':
|
|
17
|
-
return pinEntry(state.result, state.data);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
var _default = pinFlowMatch;
|
|
23
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function pinFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry,pinEntry=_ref.pinEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);case"PINEntry":return pinEntry(state.result,state.data);}}}var _default=pinFlowMatch;exports.default=_default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IdentifyFlowOptionsResult, IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess, IIdenyifyFlowByMsisdnSumbitNextData, IStrategyCurrentState, OPERATORSelectFlowIdentifySuccess } from '../reducers/strategy/StrategyTypes';
|
|
3
|
+
declare function strategy<R>({ identifyFlowByOperatorSelect, identifyFlowByMsisdn, pinFlow, moFlow, moRedirFlow, oneClickFlow, click2smsFlow, ussdFlow, creditCardFlow }: {
|
|
4
|
+
identifyFlowByOperatorSelect: (data: OPERATORSelectFlowIdentifySuccess) => R;
|
|
5
|
+
identifyFlowByMsisdn: (rds: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>, nextData: IIdenyifyFlowByMsisdnSumbitNextData) => R;
|
|
6
|
+
pinFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
7
|
+
moFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
8
|
+
moRedirFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
9
|
+
oneClickFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
10
|
+
click2smsFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
11
|
+
ussdFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
12
|
+
creditCardFlow?: (data: IdentifyFlowOptionsResult) => R;
|
|
13
|
+
}): (state: IStrategyCurrentState) => R;
|
|
14
|
+
export default strategy;
|
package/dist/flows/strategy.js
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function strategy(_ref) {
|
|
9
|
-
var identifyFlowByOperatorSelect = _ref.identifyFlowByOperatorSelect,
|
|
10
|
-
identifyFlowByMsisdn = _ref.identifyFlowByMsisdn,
|
|
11
|
-
pinFlow = _ref.pinFlow,
|
|
12
|
-
moFlow = _ref.moFlow,
|
|
13
|
-
moRedirFlow = _ref.moRedirFlow,
|
|
14
|
-
oneClickFlow = _ref.oneClickFlow,
|
|
15
|
-
click2smsFlow = _ref.click2smsFlow,
|
|
16
|
-
ussdFlow = _ref.ussdFlow,
|
|
17
|
-
tpayHeFlow = _ref.tpayHeFlow;
|
|
18
|
-
return function (state) {
|
|
19
|
-
console.log('APPSTATE', state);
|
|
20
|
-
|
|
21
|
-
switch (state.type) {
|
|
22
|
-
case 'IDENTIFY_FLOW_BY_OPERATOR_SELECT':
|
|
23
|
-
return identifyFlowByOperatorSelect(state.result);
|
|
24
|
-
|
|
25
|
-
case 'IDENTIFY_FLOW_BY_MSISDN':
|
|
26
|
-
return identifyFlowByMsisdn(state.result, state.nextData);
|
|
27
|
-
|
|
28
|
-
case 'PIN':
|
|
29
|
-
return pinFlow(state.result);
|
|
30
|
-
|
|
31
|
-
case 'MO':
|
|
32
|
-
return moFlow(state.result);
|
|
33
|
-
|
|
34
|
-
case 'MO_REDIR':
|
|
35
|
-
return moRedirFlow(state.result);
|
|
36
|
-
|
|
37
|
-
case 'ONE_CLICK':
|
|
38
|
-
return oneClickFlow(state.result);
|
|
39
|
-
|
|
40
|
-
case 'CLICK2SMS':
|
|
41
|
-
return click2smsFlow(state.result);
|
|
42
|
-
|
|
43
|
-
case 'USSD':
|
|
44
|
-
return ussdFlow(state.result);
|
|
45
|
-
|
|
46
|
-
case 'TPAY_HE':
|
|
47
|
-
return tpayHeFlow(state.result);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var _default = strategy;
|
|
53
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function strategy(_ref){var identifyFlowByOperatorSelect=_ref.identifyFlowByOperatorSelect,identifyFlowByMsisdn=_ref.identifyFlowByMsisdn,pinFlow=_ref.pinFlow,moFlow=_ref.moFlow,moRedirFlow=_ref.moRedirFlow,oneClickFlow=_ref.oneClickFlow,click2smsFlow=_ref.click2smsFlow,ussdFlow=_ref.ussdFlow,creditCardFlow=_ref.creditCardFlow;return function(state){switch(state.type){case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return identifyFlowByOperatorSelect(state.result);case"IDENTIFY_FLOW_BY_MSISDN":return identifyFlowByMsisdn(state.result,state.nextData);case"PIN":return pinFlow(state.result);case"MO":return moFlow(state.result);case"MO_REDIR":return moRedirFlow(state.result);case"ONE_CLICK":return oneClickFlow(state.result);case"CLICK2SMS":return click2smsFlow(state.result);case"USSD":return ussdFlow(state.result);case"CREDIT_CARD":return creditCardFlow(state.result);}}}var _default=strategy;exports.default=_default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RDS from '../common-types/RemoteDataState';
|
|
2
|
+
import { IUssdFlowCurrentState, MSISDNEntryFailure, MSISDNEntrySuccess } from '../reducers/ussdFlow/UssdTypes';
|
|
3
|
+
declare function ussdFlowMatch<R>({ msisdnEntry }: {
|
|
4
|
+
msisdnEntry: (rds: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>) => R;
|
|
5
|
+
}): (state: IUssdFlowCurrentState) => R;
|
|
6
|
+
export default ussdFlowMatch;
|
package/dist/flows/ussdFlow.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function ussdFlowMatch(_ref) {
|
|
9
|
-
var msisdnEntry = _ref.msisdnEntry;
|
|
10
|
-
return function (state) {
|
|
11
|
-
switch (state.type) {
|
|
12
|
-
case 'MSISDNEntry':
|
|
13
|
-
return msisdnEntry(state.result);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _default = ussdFlowMatch;
|
|
19
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function ussdFlowMatch(_ref){var msisdnEntry=_ref.msisdnEntry;return function(state){switch(state.type){case"MSISDNEntry":return msisdnEntry(state.result);default:return msisdnEntry(state.result);}}}var _default=ussdFlowMatch;exports.default=_default;
|
package/dist/index.d.ts
ADDED
|
File without changes
|
package/dist/index.js
CHANGED