ouisys-engine 4.1.48 → 4.3.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/@types/window.d.js +1 -1
  2. package/dist/api/index.js +728 -1
  3. package/dist/app/store.js +20 -0
  4. package/dist/common-types/AppThunk.js +1 -1
  5. package/dist/common-types/Either.js +1 -1
  6. package/dist/common-types/IError.js +1 -1
  7. package/dist/common-types/ITracker.js +3 -1
  8. package/dist/common-types/IVisitor.js +1 -1
  9. package/dist/common-types/RemoteDataState.js +135 -1
  10. package/dist/features/strategies/categories/askMobileNumber.js +388 -0
  11. package/dist/features/strategies/categories/askOperator.js +313 -0
  12. package/dist/features/strategies/categories/detectOperatorByIp.js +599 -0
  13. package/dist/features/strategies/categories/headerEnrichment.js +665 -0
  14. package/dist/features/strategies/categories/singleFlows/pin.js +1 -0
  15. package/dist/features/strategies/identifySlice.js +355 -0
  16. package/dist/features/strategies/pinFlowSlice.js +338 -0
  17. package/dist/flows/click2smsFlow.js +19 -1
  18. package/dist/flows/moFlow.js +19 -1
  19. package/dist/flows/moRedirFlow.js +19 -1
  20. package/dist/flows/oneClickFlow.js +23 -1
  21. package/dist/flows/pinFlow.js +23 -1
  22. package/dist/flows/strategy.js +53 -1
  23. package/dist/flows/tpayHeFlow.js +23 -0
  24. package/dist/flows/ussdFlow.js +19 -1
  25. package/dist/index.js +2 -0
  26. package/dist/ips/tryGetIPRangeName.js +74 -1
  27. package/dist/mockServer/browser.js +48 -0
  28. package/dist/mockServer/handlers.js +22 -0
  29. package/dist/mockServer/server.js +48 -0
  30. package/dist/pacman/index.js +108 -1
  31. package/dist/pacman/queryString.js +45 -1
  32. package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -1
  33. package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -1
  34. package/dist/reducers/click2smsFlow/index.js +183 -1
  35. package/dist/reducers/click2smsFlow/utils.js +357 -1
  36. package/dist/reducers/moFlow/IMoConstants.js +1 -1
  37. package/dist/reducers/moFlow/MoTypes.js +1 -1
  38. package/dist/reducers/moFlow/index.js +251 -1
  39. package/dist/reducers/moFlow/utils.js +284 -1
  40. package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -1
  41. package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -1
  42. package/dist/reducers/moRedirFlow/index.js +226 -1
  43. package/dist/reducers/moRedirFlow/utils.js +186 -1
  44. package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -1
  45. package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -1
  46. package/dist/reducers/oneClickFlow/index.js +409 -1
  47. package/dist/reducers/oneClickFlow/utils.js +366 -1
  48. package/dist/reducers/pinFlow/IPinConstants.js +1 -1
  49. package/dist/reducers/pinFlow/PinTypes.js +1 -1
  50. package/dist/reducers/pinFlow/index.js +514 -1
  51. package/dist/reducers/pinFlow/utils.js +494 -1
  52. package/dist/reducers/strategy/IStategyActionContants.js +1 -1
  53. package/dist/reducers/strategy/StrategyTypes.js +1 -1
  54. package/dist/reducers/strategy/index.js +389 -1
  55. package/dist/reducers/strategy/strategies/ask_mobile_number.js +403 -1
  56. package/dist/reducers/strategy/strategies/ask_operator.js +305 -1
  57. package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +459 -1
  58. package/dist/reducers/strategy/strategies/header_enrichment.js +783 -1
  59. package/dist/reducers/strategy/utils.js +702 -1
  60. package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +1 -0
  61. package/dist/reducers/tpayHeFlow/TpayHeTypes.js +1 -0
  62. package/dist/reducers/tpayHeFlow/index.js +331 -0
  63. package/dist/reducers/tpayHeFlow/utils.js +510 -0
  64. package/dist/reducers/ussdFlow/IUssdConstants.js +1 -1
  65. package/dist/reducers/ussdFlow/UssdTypes.js +1 -1
  66. package/dist/reducers/ussdFlow/index.js +251 -1
  67. package/dist/reducers/ussdFlow/utils.js +225 -1
  68. package/dist/store/index.js +177 -1
  69. package/dist/store/reducers.js +41 -1
  70. package/dist/test/setup.js +24 -0
  71. package/dist/test/test-utils.js +51 -0
  72. package/dist/utilities/handleSubmitNumber.js +59 -1
  73. package/package.json +2 -2
  74. package/rollup.config.mjs +27 -0
  75. package/dist/api/index.d.ts +0 -43
  76. package/dist/common-types/AppThunk.d.ts +0 -13
  77. package/dist/common-types/Either.d.ts +0 -8
  78. package/dist/common-types/IError.d.ts +0 -3
  79. package/dist/common-types/IOptInFlowName.d.ts +0 -1
  80. package/dist/common-types/ITracker.d.ts +0 -9
  81. package/dist/common-types/IVisitor.d.ts +0 -14
  82. package/dist/common-types/RemoteDataState.d.ts +0 -38
  83. package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
  84. package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
  85. package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
  86. package/dist/custom-hooks/usePinEntryState.js +0 -1
  87. package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
  88. package/dist/custom-hooks/useStrategyConfig.js +0 -1
  89. package/dist/flows/click2smsFlow.d.ts +0 -6
  90. package/dist/flows/creditCardFlow.d.ts +0 -6
  91. package/dist/flows/creditCardFlow.js +0 -1
  92. package/dist/flows/moFlow.d.ts +0 -6
  93. package/dist/flows/moRedirFlow.d.ts +0 -6
  94. package/dist/flows/oneClickFlow.d.ts +0 -7
  95. package/dist/flows/pinFlow.d.ts +0 -7
  96. package/dist/flows/strategy.d.ts +0 -14
  97. package/dist/flows/ussdFlow.d.ts +0 -6
  98. package/dist/index.d.ts +0 -0
  99. package/dist/ips/tryGetIPRangeName.d.ts +0 -2
  100. package/dist/jest.config.js +0 -194
  101. package/dist/pacman/index.d.ts +0 -6
  102. package/dist/pacman/queryString.d.ts +0 -3
  103. package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
  104. package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
  105. package/dist/reducers/click2smsFlow/index.d.ts +0 -5
  106. package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
  107. package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
  108. package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
  109. package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
  110. package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
  111. package/dist/reducers/creditCardFlow/index.d.ts +0 -5
  112. package/dist/reducers/creditCardFlow/index.js +0 -1
  113. package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
  114. package/dist/reducers/creditCardFlow/utils.js +0 -1
  115. package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
  116. package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
  117. package/dist/reducers/moFlow/index.d.ts +0 -16
  118. package/dist/reducers/moFlow/utils.d.ts +0 -12
  119. package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
  120. package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
  121. package/dist/reducers/moRedirFlow/index.d.ts +0 -14
  122. package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
  123. package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
  124. package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
  125. package/dist/reducers/oneClickFlow/index.d.ts +0 -13
  126. package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
  127. package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
  128. package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
  129. package/dist/reducers/pinFlow/index.d.ts +0 -19
  130. package/dist/reducers/pinFlow/utils.d.ts +0 -11
  131. package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
  132. package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
  133. package/dist/reducers/strategy/index.d.ts +0 -13
  134. package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
  135. package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
  136. package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
  137. package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
  138. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
  139. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
  140. package/dist/reducers/strategy/utils.d.ts +0 -30
  141. package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
  142. package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
  143. package/dist/reducers/ussdFlow/index.d.ts +0 -14
  144. package/dist/reducers/ussdFlow/utils.d.ts +0 -11
  145. package/dist/store/index.d.ts +0 -14
  146. package/dist/store/reducers.d.ts +0 -20
  147. package/dist/utilities/addEmpelloToken.d.ts +0 -4
  148. package/dist/utilities/addEmpelloToken.js +0 -1
  149. package/dist/utilities/handleSubmitNumber.d.ts +0 -21
  150. package/dist/utilities/index.d.ts +0 -17
  151. package/dist/utilities/index.js +0 -1
  152. package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
  153. package/dist/utilities/loadScriptInnerHtml.js +0 -1
  154. package/dist/utilities/loadScriptSrc.d.ts +0 -8
  155. package/dist/utilities/loadScriptSrc.js +0 -1
  156. package/dist/utilities/replaceUrlParam.d.ts +0 -1
  157. package/dist/utilities/replaceUrlParam.js +0 -1
  158. package/dist/utilities/storeMsisdn.d.ts +0 -3
  159. package/dist/utilities/storeMsisdn.js +0 -1
@@ -1,2 +0,0 @@
1
- declare type IMoRedirConstants = 'MO_REDIR_MSISDN_SUBMIT' | 'MO_REDIR_MSISDN_SUBMIT_ERROR' | 'MO_REDIR_BACK_TO_START' | 'MOCK_MO_REDIR_FLOW_STATE';
2
- export default IMoRedirConstants;
@@ -1,64 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- export declare type IMoRedirFlowCurrentState = {
4
- type: 'MSISDNEntry';
5
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
6
- };
7
- export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | 'UnexpectedState';
8
- export declare type MSISDNEntryFailure = {
9
- errorType: MSISDNEntryErrorTypes;
10
- error: any;
11
- productUrl?: string;
12
- };
13
- export declare type MSISDNEntrySuccess = {
14
- href: string;
15
- };
16
- export declare type IMsisnSubmitActionPayload = {
17
- type: 'MSISDNEntry';
18
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
19
- };
20
- export interface IMoRedirFlowReducerState {
21
- currentState: IMoRedirFlowCurrentState;
22
- }
23
- export declare type IConfig = {
24
- offer?: number;
25
- slug?: string;
26
- country?: string;
27
- host?: string;
28
- device?: 'smart' | 'feature';
29
- operators?: string[];
30
- };
31
- export declare type IMSISDNSubmissionResult = {
32
- success: true;
33
- rockman_id: string;
34
- redirect_url: string;
35
- } | {
36
- success: false;
37
- rockman_id: string;
38
- message: string;
39
- };
40
- export declare type IBackToStartPayload = {
41
- type: 'MSISDNEntry';
42
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
43
- };
44
- export declare type IMoRedirActions = {
45
- type: 'MO_REDIR_MSISDN_SUBMIT';
46
- payload: IMsisnSubmitActionPayload;
47
- } | {
48
- type: 'MO_REDIR_MSISDN_SUBMIT_ERROR';
49
- payload: IMsisdnSubmitErrorPayload;
50
- } | {
51
- type: 'MO_REDIR_BACK_TO_START';
52
- payload: IBackToStartPayload;
53
- } | {
54
- type: 'MOCK_MO_REDIR_FLOW_STATE';
55
- payload: IMoRedirFlowCurrentState;
56
- };
57
- export declare type IMsisdnSubmitErrorPayload = {
58
- type: 'MSISDNEntry';
59
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
60
- };
61
- export declare type IMoRedirFlowActionMaps = {
62
- submitMSISDNAction: (internationalMSISDN: string, bupperMSISDN?: string, rockman_id?: string) => AppThunk;
63
- };
64
- export declare type IMockMoRedirFlowStates = 'msisdn-entry-success-state' | 'msisdn-entry-failure-state';
@@ -1,14 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- import { IMockMoRedirFlowStates, IMoRedirActions, IMoRedirFlowActionMaps, IMoRedirFlowReducerState, MSISDNEntryFailure, MSISDNEntrySuccess } from './MoRedirTypes';
4
- export declare function submitMSISDNAction(msisdn: string): AppThunk;
5
- export declare function backToStart(): {
6
- type: string;
7
- payload: {
8
- type: string;
9
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
10
- };
11
- };
12
- export declare function mockMoRedirFlow(mockState: IMockMoRedirFlowStates): AppThunk;
13
- export declare const MoRedirFlowActionMaps: IMoRedirFlowActionMaps;
14
- export default function MoRedirFlowReducer(state: IMoRedirFlowReducerState, action: IMoRedirActions): IMoRedirFlowReducerState;
@@ -1,10 +0,0 @@
1
- import { IConfig, IMoRedirFlowReducerState } from './MoRedirTypes';
2
- export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {
3
- [key: string]: string;
4
- }): Promise<string>;
5
- export declare function submitMSISDNWithConfig(window: Window, config: IConfig, internationalMSISDN: string, extraParams?: {
6
- [key: string]: string;
7
- }): Promise<string>;
8
- export declare const startEvinaAgency: (config: IConfig) => void;
9
- export declare const mockedMSISDNEntrySuccess: IMoRedirFlowReducerState;
10
- export declare const mockedMSISDNEntryFailure: IMoRedirFlowReducerState;
@@ -1,2 +0,0 @@
1
- declare type IOneClickConstants = 'GET_REDIRECT_URL' | 'SUBCRIBE_AJAX';
2
- export default IOneClickConstants;
@@ -1,85 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- export declare type IGETREDIRECTURLFailure = {
4
- errorType: string;
5
- };
6
- export declare type IGETREDIRECTURLSuccess = {
7
- redirectUrl: string;
8
- nextAction: 'getRedirectUrlAction';
9
- };
10
- export declare type SubscribeUserErrorTypes = 'SubscriptionError' | 'UnknownError' | 'AlreadySubscribed';
11
- export declare type SubscribeSuccess = {
12
- productUrl: string;
13
- };
14
- export declare type SubscribeFailure = {
15
- errorType: SubscribeUserErrorTypes;
16
- error: Error;
17
- productUrl?: string;
18
- };
19
- export declare type IOneClickCurrentState = {
20
- type: 'GET_REDIRECT_URL';
21
- result: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>;
22
- } | {
23
- type: 'SUBCRIBE_AJAX';
24
- result: RDS.RemoteDataState<SubscribeFailure, SubscribeSuccess>;
25
- };
26
- export declare type IOneClickFlowReducerState = {
27
- currentState: IOneClickCurrentState;
28
- };
29
- export declare type IGetRedirectUrlPayload = {
30
- type: 'GET_REDIRECT_URL';
31
- result: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>;
32
- };
33
- export declare type IOneClickFlowActionMaps = {
34
- getRedirectUrlAction: (extraParams?: ILinkExtraParams, autoRedirect?: boolean) => AppThunk;
35
- };
36
- export declare type IOneClickActions = {
37
- type: 'GET_REDIRECT_URL';
38
- payload: IGetRedirectUrlPayload;
39
- };
40
- export interface ILinkExtraParams {
41
- [key: string]: string;
42
- }
43
- export declare type IClickActionTypes = 'he' | 'redirect' | 'identify-user';
44
- export declare type IConfig = {
45
- host?: string;
46
- country?: string;
47
- slug?: string;
48
- queryString?: Array<[string, string]>;
49
- device?: string;
50
- apiAction?: IClickActionTypes;
51
- };
52
- export declare type IIDentifyUserResult = {
53
- success: true;
54
- rockman_id: string;
55
- subscription_url?: string;
56
- redirect_url?: string;
57
- } | {
58
- success: false;
59
- rockman_id: string;
60
- message: string;
61
- };
62
- export declare type IHEResult = {
63
- success: true;
64
- rockman_id: string;
65
- redirectUrlWithReplacedUniqid?: string;
66
- source: string;
67
- oldUniqid: string;
68
- newUniqid: string;
69
- } | {
70
- success: false;
71
- rockman_id: string;
72
- message: string;
73
- };
74
- export declare type ISubscribeResult = {
75
- success: true;
76
- rockman_id: string;
77
- product_url: string;
78
- redirect_url?: string;
79
- } | {
80
- success: false;
81
- rockman_id: string;
82
- message: string;
83
- product_url?: string;
84
- };
85
- export declare type IMockOneClickFlowStates = 'redirect-url-success-state' | 'subscribe-ajax-state';
@@ -1,13 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import { IHash } from '../strategy/StrategyTypes';
3
- import { ILinkExtraParams, IMockOneClickFlowStates, IOneClickActions, IOneClickFlowActionMaps, IOneClickFlowReducerState } from './OneClickTypes';
4
- export declare function getRedirectUrlAction({ extraParams, autoRedirect, isGetRedirectBupperWay }: {
5
- extraParams?: ILinkExtraParams;
6
- autoRedirect?: boolean;
7
- isGetRedirectBupperWay?: boolean;
8
- ignoreUrlParams?: boolean;
9
- }): AppThunk;
10
- export declare function subscribeUrlAction(autoRedirect?: boolean, extraParams?: IHash): AppThunk;
11
- export declare function mockOneClickFlow(mockState: IMockOneClickFlowStates): AppThunk;
12
- export declare const OneClickFlowActionMaps: IOneClickFlowActionMaps;
13
- export default function OneClickFlowReducer(state: IOneClickFlowReducerState, action: IOneClickActions): IOneClickFlowReducerState;
@@ -1,16 +0,0 @@
1
- import { IHash } from '../strategy/StrategyTypes';
2
- import { IConfig, ILinkExtraParams, IOneClickFlowReducerState } from './OneClickTypes';
3
- export declare const additionalQueryString = "msisdnSubmitted=Y&legalCheckbox=Y&incentivizedCheckbox=Y&op_confirmCheckbox=N";
4
- export declare const getRedirectUrl: ({ window, maybeConfig, extraParams }: {
5
- window: Window;
6
- maybeConfig: IConfig;
7
- extraParams?: ILinkExtraParams;
8
- }) => Promise<{
9
- subscription_url?: string;
10
- redirect_url?: string;
11
- action?: () => Promise<string>;
12
- }>;
13
- export declare const subscribe: (url: string, extraParams?: IHash) => Promise<string>;
14
- export declare const getRedirectUrlBupperWay: (window: Window, maybeConfig: IConfig, extraParams?: ILinkExtraParams) => Promise<string>;
15
- export declare const mockedRedirectUrlSuccessState: IOneClickFlowReducerState;
16
- export declare const mockedSubscribeAjaxState: IOneClickFlowReducerState;
@@ -1,2 +0,0 @@
1
- declare type IPinConstants = 'PIN_FLOW_MSISDN_SUBMIT' | 'PIN_FLOW_MSISDN_SUBMIT_ERROR' | 'PIN_SUBMIT' | 'BACK_TO_START' | 'PIN_SUBMIT_ERROR' | 'MOCK_PIN_FLOW_STATE';
2
- export default IPinConstants;
@@ -1,156 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- export declare type IPinFlowCurrentState = {
4
- type: 'MSISDNEntry';
5
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
6
- } | {
7
- type: 'PINEntry';
8
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
9
- data: IMsisdnSumbitNextData;
10
- };
11
- export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | string;
12
- export declare type MSISDNEntryFailure = {
13
- errorType: MSISDNEntryErrorTypes;
14
- error: any;
15
- productUrl?: string;
16
- };
17
- export declare type MSISDNEntrySuccess = {
18
- type: 'PINEntry';
19
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
20
- };
21
- export declare type PINEntryFailure = {
22
- errorType: PINEntryErrorTypes;
23
- error?: Error;
24
- productUrl?: string;
25
- };
26
- export declare type PINEntrySuccess = {
27
- finalUrl: string;
28
- msisdn?: string;
29
- isAlreadySubscribed?: boolean;
30
- };
31
- export declare type PINEntryErrorTypes = 'UnknownError' | 'TooEarly' | 'InvalidPIN' | 'UnexpectedState' | 'SessionBlocked';
32
- export declare type IMsisdnSumbitNextData = {
33
- actualPIN: string;
34
- nextAction: 'submitPinAction';
35
- msisdn: string;
36
- pinMaxLength?: number | null;
37
- operator?: string;
38
- };
39
- export declare type IMsisnSubmitActionPayload = {
40
- type: 'MSISDNEntry';
41
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
42
- data: IMsisdnSumbitNextData;
43
- };
44
- export declare type IMsisdnSubmitErrorPayload = {
45
- type: 'MSISDNEntry';
46
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
47
- };
48
- export declare type IPinSubmitPayload = {
49
- type: 'PINEntry';
50
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
51
- actualPIN?: string;
52
- };
53
- export declare type IPinErrorPayload = {
54
- type: 'PINEntry';
55
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
56
- };
57
- export declare type IBackToStartPayload = {
58
- type: 'MSISDNEntry';
59
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
60
- };
61
- export declare type IPinActions = {
62
- type: 'PIN_FLOW_MSISDN_SUBMIT';
63
- payload: IMsisnSubmitActionPayload;
64
- } | {
65
- type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR';
66
- payload: IMsisdnSubmitErrorPayload;
67
- } | {
68
- type: 'PIN_SUBMIT';
69
- payload: IPinSubmitPayload;
70
- } | {
71
- type: 'BACK_TO_START';
72
- payload: IBackToStartPayload;
73
- } | {
74
- type: 'PIN_SUBMIT_ERROR';
75
- payload: IPinErrorPayload;
76
- } | {
77
- type: 'MOCK_PIN_FLOW_STATE';
78
- payload: IPinFlowCurrentState;
79
- };
80
- export interface IPinFlowReducerState {
81
- currentState: IPinFlowCurrentState;
82
- }
83
- export declare type IConfig = {
84
- offer?: number;
85
- slug?: string;
86
- country?: string;
87
- host?: string;
88
- device?: 'smart' | 'feature';
89
- automaticallySubmitAllOperators?: boolean;
90
- operators?: string[];
91
- };
92
- export declare type IMSISDNSubmissionResult = {
93
- success: true;
94
- rockman_id: string;
95
- pin: string;
96
- product_url?: string;
97
- operator: string;
98
- redirect_to_url?: string;
99
- javascript?: string;
100
- } | {
101
- success: false;
102
- rockman_id: string;
103
- message: string;
104
- product_url?: string;
105
- };
106
- export declare type IPINSubmissionResult = {
107
- success: true;
108
- rockman_id: string;
109
- product_url?: string;
110
- async?: boolean;
111
- message?: string;
112
- } | {
113
- success: false;
114
- rockman_id: string;
115
- message: string;
116
- };
117
- export declare type ICheckSubscriptionResult = {
118
- success: false;
119
- rockman_id: string;
120
- message: string;
121
- } | {
122
- success: true;
123
- msisdn: string;
124
- product_url?: string;
125
- rockman_id: string;
126
- };
127
- export interface IHash {
128
- [key: string]: string;
129
- }
130
- export declare type SingleMSISDNSubmissionResult = {
131
- type: 'SingleMSISDNSubmissionResult';
132
- operator: string;
133
- pin?: string;
134
- uniqidResult?: string;
135
- redirectUrl?: string;
136
- };
137
- export declare type MultiOperatorMSISDNSubmissionResult = {
138
- type: 'MultiOperatorMSISDNSubmissionResult';
139
- };
140
- export declare type IMcpShieldResult = {
141
- success: true;
142
- rockman_id: string;
143
- source: string;
144
- uniqid: string;
145
- } | {
146
- success: false;
147
- rockman_id: string;
148
- message: string;
149
- };
150
- export declare type IMockPinFlowStates = 'msisdn-state' | 'pin-state' | 'completed-state' | 'msisdn-failure-state';
151
- export declare type IPinFlowActionMaps = {
152
- submitMSISDNAction: (msisdn: string, extraParams?: IHash) => AppThunk;
153
- submitPinAction: (msisdn: string, pin: string, extraParams?: {
154
- [key: string]: string;
155
- }) => AppThunk;
156
- };
@@ -1,19 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- import { IHash, IMockPinFlowStates, IPinActions, IPinFlowActionMaps, IPinFlowReducerState, MSISDNEntryFailure, MSISDNEntrySuccess } from './PinTypes';
4
- export declare function submitMSISDNAction(msisdn: string, extraParams?: IHash): AppThunk;
5
- export declare function checkLoadingAction(): AppThunk;
6
- export declare function reSubmitMSISDNAction(msisdn: string, extraParams?: IHash): AppThunk;
7
- export declare function submitPinAction(msisdn: string, pin: string, extraParams?: {
8
- [key: string]: string;
9
- }): AppThunk;
10
- export declare function mockPinFlow(mockState: IMockPinFlowStates): AppThunk;
11
- export declare function backToStart(): {
12
- type: string;
13
- payload: {
14
- type: string;
15
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
16
- };
17
- };
18
- export declare const PinFlowActionMaps: IPinFlowActionMaps;
19
- export default function PinFlowReducer(state: IPinFlowReducerState, action: IPinActions): IPinFlowReducerState;
@@ -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,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,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,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;