@os1-platform/dispatch-mobile 3.1.2 → 3.1.5
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/android/.gradle/8.0.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.0.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +41 -21
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +2 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +12 -3
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +52 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/Constants.js +3 -1
- package/lib/commonjs/utils/Constants.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +22 -0
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +7 -4
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +42 -22
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/constants.js +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/utils.js +13 -4
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +52 -0
- package/lib/module/utils/ApiUtils.js.map +1 -1
- package/lib/module/utils/Constants.js +2 -0
- package/lib/module/utils/Constants.js.map +1 -1
- package/lib/module/utils/Logger.js +22 -0
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +7 -4
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +1 -0
- package/lib/typescript/utils/Constants.d.ts +1 -0
- package/lib/typescript/utils/Logger.d.ts +1 -0
- package/package.json +2 -1
- package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +40 -19
- package/src/components/executiontasks/validateOTP/constants.ts +2 -0
- package/src/components/executiontasks/validateOTP/utils.ts +26 -4
- package/src/manager/dispatchCodes/ReasonCodeContainer.ts +1 -1
- package/src/utils/ApiUtils.ts +56 -0
- package/src/utils/Constants.ts +4 -1
- package/src/utils/Logger.ts +22 -0
- package/src/utils/SdkUtils.ts +7 -4
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
package/src/utils/ApiUtils.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { API_CONFIG } from '../constants/apiConstants';
|
|
|
4
4
|
import { getHeaders } from '../network/NetworkUtils';
|
|
5
5
|
import { RouteParams } from '../ui/uiConfig/RouteParams';
|
|
6
6
|
import { parseRequestBody } from './ExecTaskUtils';
|
|
7
|
+
import Logger from './Logger';
|
|
8
|
+
import { TAG_VERIFY_OTP } from '../components/executiontasks/validateOTP/constants';
|
|
7
9
|
|
|
8
10
|
export type HTTPMethod = 'PUT' | 'POST' | 'GET';
|
|
9
11
|
export type HeaderKey = string;
|
|
@@ -129,6 +131,60 @@ export async function getApiResponse(apiData: APIData) {
|
|
|
129
131
|
return axios(axiosConfig);
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
// Add Request Interceptor
|
|
135
|
+
axios.interceptors.request.use(
|
|
136
|
+
(config) => {
|
|
137
|
+
let requestInfo = {
|
|
138
|
+
url: config.url,
|
|
139
|
+
method: config.method,
|
|
140
|
+
headers: config.headers,
|
|
141
|
+
data: config.data,
|
|
142
|
+
};
|
|
143
|
+
// console.log('interceptors.request : ',JSON.stringify(requestInfo));
|
|
144
|
+
Logger.getInstance().log(TAG_VERIFY_OTP, `interceptors.request : ${JSON.stringify(requestInfo)}`);
|
|
145
|
+
return config;
|
|
146
|
+
},
|
|
147
|
+
(error) => {
|
|
148
|
+
// console.error('interceptors.request:error : ', error);
|
|
149
|
+
Logger.getInstance().log(TAG_VERIFY_OTP, `interceptors.request:error : ${error.message}`);
|
|
150
|
+
return Promise.reject(error);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
// Add Response Interceptor
|
|
155
|
+
axios.interceptors.response.use(
|
|
156
|
+
(response) => {
|
|
157
|
+
let responseInfo = {
|
|
158
|
+
resStatus: response.status,
|
|
159
|
+
resData: response.data,
|
|
160
|
+
reqUrl: response?.config?.url,
|
|
161
|
+
reqMethod: response.config?.method,
|
|
162
|
+
reqheaders: response.config?.headers,
|
|
163
|
+
reqData: response.config?.data
|
|
164
|
+
};
|
|
165
|
+
// console.log('interceptors.response : ',JSON.stringify(responseInfo));
|
|
166
|
+
Logger.getInstance().log(TAG_VERIFY_OTP, `interceptors.response : ${JSON.stringify(responseInfo)}`);
|
|
167
|
+
return response;
|
|
168
|
+
},
|
|
169
|
+
(error) => {
|
|
170
|
+
if (error.response) {
|
|
171
|
+
let errorInfo = {
|
|
172
|
+
resStatus: error.response.status,
|
|
173
|
+
resData: error.response.data,
|
|
174
|
+
reqUrl: error.config?.url,
|
|
175
|
+
reqMethod: error.config?.method,
|
|
176
|
+
reqheaders: error.config?.headers,
|
|
177
|
+
reqData: error.config?.data
|
|
178
|
+
};
|
|
179
|
+
// console.log('interceptors.response.error : ',JSON.stringify(errorInfo));
|
|
180
|
+
Logger.getInstance().log(TAG_VERIFY_OTP, `interceptors.response.error : ${JSON.stringify(errorInfo)}`);
|
|
181
|
+
} else {
|
|
182
|
+
// console.error('interceptors.error:network : ', error.message);
|
|
183
|
+
Logger.getInstance().log(TAG_VERIFY_OTP, `interceptors.error:network : ${error.message}`);
|
|
184
|
+
}
|
|
185
|
+
return Promise.reject(error);
|
|
186
|
+
}
|
|
187
|
+
);
|
|
132
188
|
// new
|
|
133
189
|
export async function getAxiosApiResponse(apiData: APIData) {
|
|
134
190
|
let axiosConfig: AxiosRequestConfig = {
|
package/src/utils/Constants.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
|
|
1
3
|
const KEY_STORAGE_PREFIX = '@Dsp_Executor_';
|
|
2
|
-
export const PROGRESS_GROUP = KEY_STORAGE_PREFIX + 'progressGroup';
|
|
4
|
+
export const PROGRESS_GROUP = KEY_STORAGE_PREFIX + 'progressGroup';
|
|
5
|
+
export const EXPIRY_TIME = Platform.OS === 'android' ? 216000 : 60000;
|
package/src/utils/Logger.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { CoralogixRum } from '@coralogix/react-native-sdk';
|
|
1
2
|
import type { DispatchSDKConfig } from '../models/sdk';
|
|
2
3
|
import crashlytics from '@react-native-firebase/crashlytics';
|
|
4
|
+
import { CoralogixLogSeverity } from '@coralogix/react-native-sdk/src/types-external';
|
|
5
|
+
import SdkUtils from './SdkUtils';
|
|
6
|
+
import { TAG_VERIFY_OTP } from '../components/executiontasks/validateOTP/constants';
|
|
7
|
+
import { EXPIRY_TIME } from './Constants';
|
|
3
8
|
|
|
4
9
|
export const enum LOG_TYPE {
|
|
5
10
|
SDK_ERROR = 'sdk_error',
|
|
@@ -39,8 +44,25 @@ class Logger {
|
|
|
39
44
|
) {
|
|
40
45
|
crashlytics().recordError(new Error(message), TAG);
|
|
41
46
|
}
|
|
47
|
+
|
|
42
48
|
}
|
|
43
49
|
|
|
50
|
+
async log(Tag: string, msg: string) {
|
|
51
|
+
if(Tag == TAG_VERIFY_OTP){
|
|
52
|
+
try {
|
|
53
|
+
let result = await SdkUtils.getRemoteConfig(EXPIRY_TIME);
|
|
54
|
+
if (result?.enableLogging?._value && result?.enableLogging?._value === "true") {
|
|
55
|
+
console.log("====================================");
|
|
56
|
+
console.log("Logging to Coralogix: ",Tag,msg);
|
|
57
|
+
console.log("====================================");
|
|
58
|
+
CoralogixRum.log(CoralogixLogSeverity.Info, Tag, msg);
|
|
59
|
+
}
|
|
60
|
+
} catch (error:any) {
|
|
61
|
+
this.logEvent("DispatchSDK:RemoteConfigError:", error.message, LOG_TYPE.SDK_ERROR);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
44
66
|
|
|
45
67
|
public static getInstance(): Logger {
|
|
46
68
|
if (!Logger.instance) {
|
package/src/utils/SdkUtils.ts
CHANGED
|
@@ -39,10 +39,13 @@ export default class SdkUtils {
|
|
|
39
39
|
.setDefaults({
|
|
40
40
|
cxRumDevApiKey: 'NA',
|
|
41
41
|
cxRumProdApiKey: 'NA',
|
|
42
|
-
isMandatoryUpdate:
|
|
43
|
-
isMandatoryUpdateiOS:
|
|
44
|
-
toggleInAppUpdateiOS:
|
|
45
|
-
toggleInAppUpdate:
|
|
42
|
+
isMandatoryUpdate: false,
|
|
43
|
+
isMandatoryUpdateiOS: false,
|
|
44
|
+
toggleInAppUpdateiOS: false,
|
|
45
|
+
toggleInAppUpdate: false,
|
|
46
|
+
enableLogging: true,
|
|
47
|
+
enableLoggingTenantIds: '',
|
|
48
|
+
enableLoggingUserIds: '',
|
|
46
49
|
})
|
|
47
50
|
.then(() => remoteConfig().fetchAndActivate())
|
|
48
51
|
.then((fetchedRemotely) => {
|
|
Binary file
|