@magicpixel/rn-mp-client-sdk 0.2.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/LICENSE +20 -0
- package/README.md +29 -0
- package/lib/commonjs/common/app-types.js +6 -0
- package/lib/commonjs/common/app-types.js.map +1 -0
- package/lib/commonjs/common/constants.js +51 -0
- package/lib/commonjs/common/constants.js.map +1 -0
- package/lib/commonjs/common/data-store.js +361 -0
- package/lib/commonjs/common/data-store.js.map +1 -0
- package/lib/commonjs/common/event-bus.js +42 -0
- package/lib/commonjs/common/event-bus.js.map +1 -0
- package/lib/commonjs/common/logger.js +30 -0
- package/lib/commonjs/common/logger.js.map +1 -0
- package/lib/commonjs/common/network-service.js +90 -0
- package/lib/commonjs/common/network-service.js.map +1 -0
- package/lib/commonjs/common/reporter.js +107 -0
- package/lib/commonjs/common/reporter.js.map +1 -0
- package/lib/commonjs/common/utils.js +276 -0
- package/lib/commonjs/common/utils.js.map +1 -0
- package/lib/commonjs/coverage/clover.xml +6 -0
- package/lib/commonjs/coverage/coverage-final.json +1 -0
- package/lib/commonjs/coverage/lcov-report/base.css +224 -0
- package/lib/commonjs/coverage/lcov-report/block-navigation.js +83 -0
- package/lib/commonjs/coverage/lcov-report/block-navigation.js.map +1 -0
- package/lib/commonjs/coverage/lcov-report/favicon.png +0 -0
- package/lib/commonjs/coverage/lcov-report/index.html +101 -0
- package/lib/commonjs/coverage/lcov-report/prettify.css +1 -0
- package/lib/commonjs/coverage/lcov-report/prettify.js +995 -0
- package/lib/commonjs/coverage/lcov-report/prettify.js.map +1 -0
- package/lib/commonjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/lib/commonjs/coverage/lcov-report/sorter.js +212 -0
- package/lib/commonjs/coverage/lcov-report/sorter.js.map +1 -0
- package/lib/commonjs/coverage/lcov.info +0 -0
- package/lib/commonjs/eedl/eedl.js +262 -0
- package/lib/commonjs/eedl/eedl.js.map +1 -0
- package/lib/commonjs/index.js +214 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/mp-client-sdk.js +33 -0
- package/lib/commonjs/models/mp-client-sdk.js.map +1 -0
- package/lib/commonjs/processors/data-element.processor.js +191 -0
- package/lib/commonjs/processors/data-element.processor.js.map +1 -0
- package/lib/commonjs/processors/qc.processor.js +111 -0
- package/lib/commonjs/processors/qc.processor.js.map +1 -0
- package/lib/commonjs/processors/tag.processor.js +432 -0
- package/lib/commonjs/processors/tag.processor.js.map +1 -0
- package/lib/commonjs/processors/trans-function.processor.js +91 -0
- package/lib/commonjs/processors/trans-function.processor.js.map +1 -0
- package/lib/commonjs/processors/visit-id.processor.js +172 -0
- package/lib/commonjs/processors/visit-id.processor.js.map +1 -0
- package/lib/module/common/app-types.js +2 -0
- package/lib/module/common/app-types.js.map +1 -0
- package/lib/module/common/constants.js +41 -0
- package/lib/module/common/constants.js.map +1 -0
- package/lib/module/common/data-store.js +346 -0
- package/lib/module/common/data-store.js.map +1 -0
- package/lib/module/common/event-bus.js +31 -0
- package/lib/module/common/event-bus.js.map +1 -0
- package/lib/module/common/logger.js +21 -0
- package/lib/module/common/logger.js.map +1 -0
- package/lib/module/common/network-service.js +73 -0
- package/lib/module/common/network-service.js.map +1 -0
- package/lib/module/common/reporter.js +88 -0
- package/lib/module/common/reporter.js.map +1 -0
- package/lib/module/common/utils.js +263 -0
- package/lib/module/common/utils.js.map +1 -0
- package/lib/module/coverage/clover.xml +6 -0
- package/lib/module/coverage/coverage-final.json +1 -0
- package/lib/module/coverage/lcov-report/base.css +224 -0
- package/lib/module/coverage/lcov-report/block-navigation.js +81 -0
- package/lib/module/coverage/lcov-report/block-navigation.js.map +1 -0
- package/lib/module/coverage/lcov-report/favicon.png +0 -0
- package/lib/module/coverage/lcov-report/index.html +101 -0
- package/lib/module/coverage/lcov-report/prettify.css +1 -0
- package/lib/module/coverage/lcov-report/prettify.js +993 -0
- package/lib/module/coverage/lcov-report/prettify.js.map +1 -0
- package/lib/module/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/lib/module/coverage/lcov-report/sorter.js +210 -0
- package/lib/module/coverage/lcov-report/sorter.js.map +1 -0
- package/lib/module/coverage/lcov.info +0 -0
- package/lib/module/eedl/eedl.js +246 -0
- package/lib/module/eedl/eedl.js.map +1 -0
- package/lib/module/index.js +176 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/models/mp-client-sdk.js +24 -0
- package/lib/module/models/mp-client-sdk.js.map +1 -0
- package/lib/module/processors/data-element.processor.js +176 -0
- package/lib/module/processors/data-element.processor.js.map +1 -0
- package/lib/module/processors/qc.processor.js +90 -0
- package/lib/module/processors/qc.processor.js.map +1 -0
- package/lib/module/processors/tag.processor.js +396 -0
- package/lib/module/processors/tag.processor.js.map +1 -0
- package/lib/module/processors/trans-function.processor.js +73 -0
- package/lib/module/processors/trans-function.processor.js.map +1 -0
- package/lib/module/processors/visit-id.processor.js +144 -0
- package/lib/module/processors/visit-id.processor.js.map +1 -0
- package/lib/typescript/common/app-types.d.ts +101 -0
- package/lib/typescript/common/constants.d.ts +21 -0
- package/lib/typescript/common/data-store.d.ts +81 -0
- package/lib/typescript/common/event-bus.d.ts +6 -0
- package/lib/typescript/common/logger.d.ts +5 -0
- package/lib/typescript/common/network-service.d.ts +8 -0
- package/lib/typescript/common/reporter.d.ts +12 -0
- package/lib/typescript/common/utils.d.ts +38 -0
- package/lib/typescript/eedl/eedl.d.ts +46 -0
- package/lib/typescript/index.d.ts +18 -0
- package/lib/typescript/models/mp-client-sdk.d.ts +157 -0
- package/lib/typescript/processors/data-element.processor.d.ts +12 -0
- package/lib/typescript/processors/qc.processor.d.ts +4 -0
- package/lib/typescript/processors/tag.processor.d.ts +27 -0
- package/lib/typescript/processors/trans-function.processor.d.ts +12 -0
- package/lib/typescript/processors/visit-id.processor.d.ts +7 -0
- package/package.json +170 -0
- package/src/common/app-types.ts +128 -0
- package/src/common/constants.ts +43 -0
- package/src/common/data-store.ts +333 -0
- package/src/common/event-bus.ts +35 -0
- package/src/common/logger.ts +19 -0
- package/src/common/network-service.ts +85 -0
- package/src/common/reporter.ts +110 -0
- package/src/common/utils.ts +281 -0
- package/src/coverage/clover.xml +6 -0
- package/src/coverage/coverage-final.json +1 -0
- package/src/coverage/lcov-report/base.css +224 -0
- package/src/coverage/lcov-report/block-navigation.js +87 -0
- package/src/coverage/lcov-report/favicon.png +0 -0
- package/src/coverage/lcov-report/index.html +101 -0
- package/src/coverage/lcov-report/prettify.css +1 -0
- package/src/coverage/lcov-report/prettify.js +2 -0
- package/src/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/coverage/lcov-report/sorter.js +196 -0
- package/src/coverage/lcov.info +0 -0
- package/src/eedl/eedl.ts +233 -0
- package/src/index.tsx +258 -0
- package/src/models/mp-client-sdk.ts +174 -0
- package/src/processors/data-element.processor.ts +249 -0
- package/src/processors/qc.processor.ts +115 -0
- package/src/processors/tag.processor.ts +527 -0
- package/src/processors/trans-function.processor.ts +85 -0
- package/src/processors/visit-id.processor.ts +164 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 MP E <e@mp.io>
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# rn-mp-client-sdk
|
|
2
|
+
MagicPixel Client SDK
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install rn-mp-client-sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { multiply } from "rn-mp-client-sdk";
|
|
13
|
+
|
|
14
|
+
// ...
|
|
15
|
+
|
|
16
|
+
const result = await multiply(3, 7);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Contributing
|
|
20
|
+
|
|
21
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["app-types.ts"],"sourcesContent":["import type { Logger } from './logger';\n\nexport interface MapLike<T = any> {\n [key: string]: T;\n}\n\nexport interface RunQueueModel {\n sseOnly: boolean;\n name: string;\n dcrName: string;\n eventId: string;\n dcrPayload?: Record<string, any>;\n}\n\nexport type TypedAny = Record<\n string,\n | string\n | number\n | boolean\n | string[]\n | boolean[]\n | number[]\n | Record<string, string | number | boolean | string[] | boolean[] | number[]>\n>;\n\nexport type EventProcessorFn = (payload: TypedAny) => void;\n\nexport interface AppCustomerInfo {\n first_name?: string;\n last_name?: string;\n email?: string;\n phone_number: number;\n country_code: number;\n city?: string;\n state?: string;\n country?: string;\n}\n\nexport interface AppPageLoad {\n page_name: string;\n is_entry?: number;\n}\n\nexport interface DeJsvHelper {\n log: typeof Logger.logDbg;\n err: typeof Logger.logError;\n}\n\nexport interface QcInfoItem {\n nm: string;\n id: string;\n st: boolean;\n}\n\nexport interface TagInfoItem {\n id: string;\n nm: string;\n pr: string;\n prNm: string;\n status: boolean;\n qc: string | string[];\n}\n\nexport type ReplaceMode = 'kph' | 'rph';\n\nexport interface HydrateTagInfo {\n isInError: boolean;\n content: string | number | null;\n errCd: string; // error code\n errMsg: string; // any descriptive error message\n}\n\nexport interface ReportTagItem {\n st: 200 | 900 | 1000 | number; // what happened to this tag?\n t: string; // tag id\n p: string; // provider id\n tNm: string;\n req: any; // request payload\n}\n\nexport interface Report {\n envName: string; // environment name inside magic pixel\n envId: string; // environment id inside magic pixel\n pname?: string; // page name\n evt: string; // dcr event if that triggered this report\n evtId: string; // event id\n dt?: number; // device type (converted to int)\n ln?: number; // language (converted to int)\n bw?: number; // browser name (converted to int)\n dm?: string; // clean domain name\n items: ReportTagItem[]; // list of tag items fired on that page for that condition\n tagCt: number; // expected tag count on this page\n dws: 'j' | 'n'; // down stream configuration. java or node\n v: string; // client sdk version for this call\n}\n\nexport interface UrlInfo {\n tfUrl: string;\n errUrl: string;\n rptUrl: string;\n infoUrl: string;\n baseUrl: string;\n attrInfoUrl: string;\n idlUrl: string;\n}\n\nexport interface VisitInfo {\n visitId: string;\n visitTs: number;\n visitCt: number;\n visitDepth: number;\n visitVer: number;\n}\n\nexport interface VisitorInfo {\n dId: string;\n mId: string;\n st: number;\n}\n\nexport interface SdkInitOptions {\n orgId: string;\n env: string;\n projectId: string;\n baseUrl: string;\n}\n\nexport type EventBusCallback = (event: string, payload: any) => void;\n"],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Constants = void 0;
|
|
7
|
+
|
|
8
|
+
var _nonSecure = require("nanoid/non-secure");
|
|
9
|
+
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
|
|
12
|
+
class Constants {}
|
|
13
|
+
|
|
14
|
+
exports.Constants = Constants;
|
|
15
|
+
|
|
16
|
+
_defineProperty(Constants, "PLACEHOLDER_REGEX", new RegExp(/({{)([A-Z_0-9 -]+)(}})/gi));
|
|
17
|
+
|
|
18
|
+
_defineProperty(Constants, "LARGE_RANDOM_POOL", (0, _nonSecure.customAlphabet)('1234567090abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 21));
|
|
19
|
+
|
|
20
|
+
_defineProperty(Constants, "MP_DL_EVT", 'mp_dl_event');
|
|
21
|
+
|
|
22
|
+
_defineProperty(Constants, "CUST_EVT", 'custom_event');
|
|
23
|
+
|
|
24
|
+
_defineProperty(Constants, "ST_OK", 200);
|
|
25
|
+
|
|
26
|
+
_defineProperty(Constants, "ST_VAL_FAIL", 400);
|
|
27
|
+
|
|
28
|
+
_defineProperty(Constants, "ST_ERR", 500);
|
|
29
|
+
|
|
30
|
+
_defineProperty(Constants, "ST_DEP_FAIL", 1000);
|
|
31
|
+
|
|
32
|
+
_defineProperty(Constants, "ST_PR_BL", 1002);
|
|
33
|
+
|
|
34
|
+
_defineProperty(Constants, "ST_PR_EXC", 1001);
|
|
35
|
+
|
|
36
|
+
_defineProperty(Constants, "PR_TYP_JS", 'js');
|
|
37
|
+
|
|
38
|
+
_defineProperty(Constants, "PR_TYP_IMG", 'img');
|
|
39
|
+
|
|
40
|
+
_defineProperty(Constants, "PR_TYP_APP", 'app');
|
|
41
|
+
|
|
42
|
+
_defineProperty(Constants, "PR_S_TYP_R", 'r');
|
|
43
|
+
|
|
44
|
+
_defineProperty(Constants, "sortAscending", (a, b) => a.o > b.o ? 1 : -1);
|
|
45
|
+
|
|
46
|
+
_defineProperty(Constants, "KEY_MP_IDL_VISITOR_ID_INFO", 'mp_idl_visitor_info');
|
|
47
|
+
|
|
48
|
+
_defineProperty(Constants, "KEY_MP_IDL_VISIT_ID_INFO", 'mp_idl_visit_info');
|
|
49
|
+
|
|
50
|
+
_defineProperty(Constants, "KEY_MP_DEBUG_ID", 'mp_debug_id');
|
|
51
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Constants","RegExp","customAlphabet","a","b","o"],"sources":["constants.ts"],"sourcesContent":["import { customAlphabet } from 'nanoid/non-secure';\nimport type { BaseResourceParamType } from '../models/mp-client-sdk';\n\nexport class Constants {\n static PLACEHOLDER_REGEX = new RegExp(/({{)([A-Z_0-9 -]+)(}})/gi);\n\n static LARGE_RANDOM_POOL = customAlphabet(\n '1234567090abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',\n 21\n );\n\n static MP_DL_EVT = 'mp_dl_event';\n static CUST_EVT = 'custom_event';\n\n // Tag Report - Status Constants\n static ST_OK = 200; // tag fired successfully\n static ST_VAL_FAIL = 400; // tag validation failed - meaning one of the items marked as mandatory was found empty\n static ST_ERR = 500; // tag was ok, but provider side failure. may be url is constructed wrong, or provider is down\n static ST_DEP_FAIL = 1000; // processing tag dependencies failed - may be missing parameters or attributes\n static ST_PR_BL = 1002; // provider is black listed in the data governance screen\n static ST_PR_EXC = 1001; // tag was found, but no provider was bundled. SDK build issue. Report with high importance\n\n static PR_TYP_JS = 'js';\n static PR_TYP_IMG = 'img';\n static PR_TYP_APP = 'app';\n\n static PR_S_TYP_R = 'r';\n\n static sortAscending = (\n a: BaseResourceParamType,\n b: BaseResourceParamType\n ): number => (a.o > b.o ? 1 : -1);\n\n // this data structure is returned by the api and stored in this key\n // {\"dId\":\"VNiBG7JNfoGAyvqxhxMqd\",\"mId\":\"JW0FRrCtAj9K7uyNmL1ht\",\"st\":0}\n static KEY_MP_IDL_VISITOR_ID_INFO = 'mp_idl_visitor_info';\n\n // visitor info data structure\n // {\"visitId\": \"123123sdfsf\", \"visitCt\": 1, \"visitDepth\": 1, visitVer: 1}\n static KEY_MP_IDL_VISIT_ID_INFO = 'mp_idl_visit_info';\n\n static KEY_MP_DEBUG_ID = 'mp_debug_id';\n}\n"],"mappings":";;;;;;;AAAA;;;;AAGO,MAAMA,SAAN,CAAgB;;;;gBAAVA,S,uBACgB,IAAIC,MAAJ,CAAW,0BAAX,C;;gBADhBD,S,uBAGgB,IAAAE,yBAAA,EACzB,gEADyB,EAEzB,EAFyB,C;;gBAHhBF,S,eAQQ,a;;gBARRA,S,cASO,c;;gBATPA,S,WAYI,G;;gBAZJA,S,iBAaU,G;;gBAbVA,S,YAcK,G;;gBAdLA,S,iBAeU,I;;gBAfVA,S,cAgBO,I;;gBAhBPA,S,eAiBQ,I;;gBAjBRA,S,eAmBQ,I;;gBAnBRA,S,gBAoBS,K;;gBApBTA,S,gBAqBS,K;;gBArBTA,S,gBAuBS,G;;gBAvBTA,S,mBAyBY,CACrBG,CADqB,EAErBC,CAFqB,KAGTD,CAAC,CAACE,CAAF,GAAMD,CAAC,CAACC,CAAR,GAAY,CAAZ,GAAgB,CAAC,C;;gBA5BpBL,S,gCAgCyB,qB;;gBAhCzBA,S,8BAoCuB,mB;;gBApCvBA,S,qBAsCc,a"}
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DataStore = void 0;
|
|
7
|
+
|
|
8
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
9
|
+
|
|
10
|
+
var _logger = require("./logger");
|
|
11
|
+
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
|
|
14
|
+
var _expoDevice = require("expo-device");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
|
|
20
|
+
class DataStore {
|
|
21
|
+
static async init(clientSdk) {
|
|
22
|
+
var _clientSdk$s;
|
|
23
|
+
|
|
24
|
+
this.clientSdk = clientSdk;
|
|
25
|
+
this.setMpEnv((clientSdk === null || clientSdk === void 0 ? void 0 : (_clientSdk$s = clientSdk.s) === null || _clientSdk$s === void 0 ? void 0 : _clientSdk$s.ev) === 'staging' ? 'stg' : 'prd');
|
|
26
|
+
|
|
27
|
+
if (typeof _reactNative.Platform !== 'undefined' && typeof _reactNative.Platform.OS !== 'undefined') {
|
|
28
|
+
this.devicePlatform = _reactNative.Platform.OS.toLowerCase();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const dType = await (0, _expoDevice.getDeviceTypeAsync)();
|
|
32
|
+
|
|
33
|
+
if (dType === _expoDevice.DeviceType.PHONE) {
|
|
34
|
+
this.deviceType = 'mobile';
|
|
35
|
+
} else if (dType === _expoDevice.DeviceType.TABLET) {
|
|
36
|
+
this.deviceType = 'tablet';
|
|
37
|
+
} else {
|
|
38
|
+
this.deviceType = 'unknown';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
this.resetCollectorUrl(clientSdk.s.c_url, clientSdk.s.ev, clientSdk.s.v_id, clientSdk.s.p_id);
|
|
42
|
+
this.isDataStoreInitialized = true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static resetCollectorUrl(baseCollectorUrl, sdkEnv, vendorId, projectId) {
|
|
46
|
+
const tagsBaseUrl = `${baseCollectorUrl}/${sdkEnv === 'staging' ? 's' : 'p'}/${vendorId}/${projectId}`;
|
|
47
|
+
this.urls = {
|
|
48
|
+
tfUrl: tagsBaseUrl + '/sst',
|
|
49
|
+
errUrl: tagsBaseUrl + '/err',
|
|
50
|
+
rptUrl: tagsBaseUrl + '/report',
|
|
51
|
+
infoUrl: tagsBaseUrl + '/info',
|
|
52
|
+
baseUrl: baseCollectorUrl,
|
|
53
|
+
attrInfoUrl: baseCollectorUrl + `/idl/${vendorId}/attrInfo`,
|
|
54
|
+
idlUrl: baseCollectorUrl + `/idl/${vendorId}/idl${sdkEnv === 'staging' ? '-staging' : ''}`
|
|
55
|
+
};
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static enQueueTMFire(sseOnly, name, dcrName, eventId, dcrPayload) {
|
|
60
|
+
this.runQueue.push({
|
|
61
|
+
sseOnly,
|
|
62
|
+
name,
|
|
63
|
+
dcrName,
|
|
64
|
+
eventId,
|
|
65
|
+
dcrPayload
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static isDataStoreReady() {
|
|
70
|
+
return this.isDataStoreInitialized;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static getSdkPcKey() {
|
|
74
|
+
return this.clientSdk.pcKey;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static getSdkInitOptions() {
|
|
78
|
+
return this.sdkInitOptions;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static setSdkInitOptions(options) {
|
|
82
|
+
this.sdkInitOptions = options;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static deQueueTMFire() {
|
|
86
|
+
return this.runQueue.length > 0 ? this.runQueue.pop() : null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static isTagManagerProcessing() {
|
|
90
|
+
return this.isProcessing;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static setTagManagerProcessing(status) {
|
|
94
|
+
this.isProcessing = status;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static getSdkDataElements() {
|
|
98
|
+
var _this$clientSdk;
|
|
99
|
+
|
|
100
|
+
return ((_this$clientSdk = this.clientSdk) === null || _this$clientSdk === void 0 ? void 0 : _this$clientSdk.d) || {};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static getSdkQC() {
|
|
104
|
+
var _this$clientSdk2;
|
|
105
|
+
|
|
106
|
+
return ((_this$clientSdk2 = this.clientSdk) === null || _this$clientSdk2 === void 0 ? void 0 : _this$clientSdk2.qc) || [];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static hasOneSSTTag() {
|
|
110
|
+
return this.clientSdk.s.sst;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static getSSTDownStream() {
|
|
114
|
+
return this.clientSdk.s.dws_s_t;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static getClientDownStream() {
|
|
118
|
+
return this.clientSdk.s.dws_c_t;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static getClientSdk() {
|
|
122
|
+
return this.clientSdk;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
static getSSTUrl() {
|
|
126
|
+
return this.urls.tfUrl;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static getAttrInfoUrl() {
|
|
130
|
+
return this.urls.attrInfoUrl;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
static setVisitInfo(visitInfo) {
|
|
134
|
+
this.visitInfo = visitInfo;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static visitInfoToString() {
|
|
138
|
+
return this.visitInfo ? `${this.visitInfo.visitVer}|${this.visitInfo.visitId}|${this.visitInfo.visitTs}|${this.visitInfo.visitCt}|${this.visitInfo.visitDepth}` : undefined;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static setVisitorInfo(visitorInfo) {
|
|
142
|
+
this.visitorInfo = visitorInfo;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static getDebugId() {
|
|
146
|
+
return this.debugId;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static getErrorReportUrl() {
|
|
150
|
+
return this.urls.errUrl;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static getIdlUrl() {
|
|
154
|
+
var _this$urls;
|
|
155
|
+
|
|
156
|
+
return (_this$urls = this.urls) === null || _this$urls === void 0 ? void 0 : _this$urls.idlUrl;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static getSdkVersion() {
|
|
160
|
+
// TODO: Fix this
|
|
161
|
+
return 'na';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static setDebugId(dbgId) {
|
|
165
|
+
this.debugId = dbgId;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
static shouldFireSstForEvent(eventName) {
|
|
169
|
+
var _this$clientSdk3, _this$clientSdk3$sseM;
|
|
170
|
+
|
|
171
|
+
return ((_this$clientSdk3 = this.clientSdk) === null || _this$clientSdk3 === void 0 ? void 0 : (_this$clientSdk3$sseM = _this$clientSdk3.sseMpDlE) === null || _this$clientSdk3$sseM === void 0 ? void 0 : _this$clientSdk3$sseM.indexOf(eventName)) > -1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
static getUrlInfo() {
|
|
175
|
+
return this.urls;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
static getSdkTags() {
|
|
179
|
+
var _this$clientSdk4;
|
|
180
|
+
|
|
181
|
+
return (this === null || this === void 0 ? void 0 : (_this$clientSdk4 = this.clientSdk) === null || _this$clientSdk4 === void 0 ? void 0 : _this$clientSdk4.t) ?? {};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static getSdkProviders() {
|
|
185
|
+
var _this$clientSdk5;
|
|
186
|
+
|
|
187
|
+
return (this === null || this === void 0 ? void 0 : (_this$clientSdk5 = this.clientSdk) === null || _this$clientSdk5 === void 0 ? void 0 : _this$clientSdk5.p) ?? {};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static getPrivacyCompliance() {
|
|
191
|
+
return this.prStatus;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
static setPrivacyCompliance(status) {
|
|
195
|
+
this.prStatus = status;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
static async storeData(key, value) {
|
|
199
|
+
await _asyncStorage.default.setItem(key, JSON.stringify(value));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static async getDataFromStorage(key) {
|
|
203
|
+
const value = await _asyncStorage.default.getItem(key);
|
|
204
|
+
return value ? JSON.parse(value) : value;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
static getDataElements() {
|
|
208
|
+
return this.dataElements;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
static setDataElements(de) {
|
|
212
|
+
this.dataElements = de;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
static getPageLang() {
|
|
216
|
+
return this.pageLang;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static getDeviceOs() {
|
|
220
|
+
return this.devicePlatform;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static getDataElementHelpers() {
|
|
224
|
+
return {
|
|
225
|
+
log: _logger.Logger.logDbg,
|
|
226
|
+
err: _logger.Logger.logError
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
static getPageName() {
|
|
231
|
+
return this.getDataElementValue('page_name') || 'none';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
static getDataElementValue(param) {
|
|
235
|
+
return this.dataElements[param];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
static setPageLang(lang) {
|
|
239
|
+
this.pageLang = lang || 'en';
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
static getSdkPageLangKey() {
|
|
243
|
+
return this.clientSdk.langKey;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
static setDataElement(key, value) {
|
|
247
|
+
this.dataElements[key] = value;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
static setValidQc(qcList, qcInfo) {
|
|
251
|
+
this.validQcList = qcList;
|
|
252
|
+
this.validQcInfoList = qcInfo;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
static getValidQcList() {
|
|
256
|
+
return this.validQcList || [];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
static getValidQcInfo() {
|
|
260
|
+
return this.validQcInfoList || [];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
static setTransFunctions(elements) {
|
|
264
|
+
this.transFunctions = elements;
|
|
265
|
+
return this.transFunctions;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
static getTransFunctions() {
|
|
269
|
+
return this.transFunctions;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
static getOperatingSystem() {
|
|
273
|
+
return this.devicePlatform;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
static getVisitId() {
|
|
277
|
+
var _this$visitInfo;
|
|
278
|
+
|
|
279
|
+
return (_this$visitInfo = this.visitInfo) === null || _this$visitInfo === void 0 ? void 0 : _this$visitInfo.visitId;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
static getDeviceType() {
|
|
283
|
+
return this.deviceType;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
static getDeviceId() {
|
|
287
|
+
var _this$visitorInfo;
|
|
288
|
+
|
|
289
|
+
return (_this$visitorInfo = this.visitorInfo) === null || _this$visitorInfo === void 0 ? void 0 : _this$visitorInfo.dId;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
static getMpId() {
|
|
293
|
+
var _this$visitorInfo2;
|
|
294
|
+
|
|
295
|
+
return (_this$visitorInfo2 = this.visitorInfo) === null || _this$visitorInfo2 === void 0 ? void 0 : _this$visitorInfo2.mId;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
static getVisitorInfoAsString() {
|
|
299
|
+
return this.visitorInfo ? JSON.stringify(this.visitorInfo) : undefined;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
static getOrgId() {
|
|
303
|
+
var _this$clientSdk6, _this$clientSdk6$s;
|
|
304
|
+
|
|
305
|
+
return this === null || this === void 0 ? void 0 : (_this$clientSdk6 = this.clientSdk) === null || _this$clientSdk6 === void 0 ? void 0 : (_this$clientSdk6$s = _this$clientSdk6.s) === null || _this$clientSdk6$s === void 0 ? void 0 : _this$clientSdk6$s.v_id;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
static getCoreVersion() {
|
|
309
|
+
var _this$clientSdk7, _this$clientSdk7$s;
|
|
310
|
+
|
|
311
|
+
return this === null || this === void 0 ? void 0 : (_this$clientSdk7 = this.clientSdk) === null || _this$clientSdk7 === void 0 ? void 0 : (_this$clientSdk7$s = _this$clientSdk7.s) === null || _this$clientSdk7$s === void 0 ? void 0 : _this$clientSdk7$s.v;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
static getMpEnv() {
|
|
315
|
+
return this.mpEnvShort;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
static setMpEnv(shortEnv) {
|
|
319
|
+
this.mpEnvShort = shortEnv;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
exports.DataStore = DataStore;
|
|
325
|
+
|
|
326
|
+
_defineProperty(DataStore, "isDataStoreInitialized", false);
|
|
327
|
+
|
|
328
|
+
_defineProperty(DataStore, "dataElements", {});
|
|
329
|
+
|
|
330
|
+
_defineProperty(DataStore, "validQcList", void 0);
|
|
331
|
+
|
|
332
|
+
_defineProperty(DataStore, "validQcInfoList", []);
|
|
333
|
+
|
|
334
|
+
_defineProperty(DataStore, "transFunctions", {});
|
|
335
|
+
|
|
336
|
+
_defineProperty(DataStore, "prStatus", true);
|
|
337
|
+
|
|
338
|
+
_defineProperty(DataStore, "clientSdk", void 0);
|
|
339
|
+
|
|
340
|
+
_defineProperty(DataStore, "urls", void 0);
|
|
341
|
+
|
|
342
|
+
_defineProperty(DataStore, "debugId", void 0);
|
|
343
|
+
|
|
344
|
+
_defineProperty(DataStore, "visitorInfo", void 0);
|
|
345
|
+
|
|
346
|
+
_defineProperty(DataStore, "visitInfo", void 0);
|
|
347
|
+
|
|
348
|
+
_defineProperty(DataStore, "pageLang", 'en');
|
|
349
|
+
|
|
350
|
+
_defineProperty(DataStore, "mpEnvShort", void 0);
|
|
351
|
+
|
|
352
|
+
_defineProperty(DataStore, "devicePlatform", 'unknown');
|
|
353
|
+
|
|
354
|
+
_defineProperty(DataStore, "deviceType", 'mobile');
|
|
355
|
+
|
|
356
|
+
_defineProperty(DataStore, "runQueue", []);
|
|
357
|
+
|
|
358
|
+
_defineProperty(DataStore, "isProcessing", false);
|
|
359
|
+
|
|
360
|
+
_defineProperty(DataStore, "sdkInitOptions", void 0);
|
|
361
|
+
//# sourceMappingURL=data-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DataStore","init","clientSdk","setMpEnv","s","ev","Platform","OS","devicePlatform","toLowerCase","dType","getDeviceTypeAsync","DeviceType","PHONE","deviceType","TABLET","resetCollectorUrl","c_url","v_id","p_id","isDataStoreInitialized","baseCollectorUrl","sdkEnv","vendorId","projectId","tagsBaseUrl","urls","tfUrl","errUrl","rptUrl","infoUrl","baseUrl","attrInfoUrl","idlUrl","enQueueTMFire","sseOnly","name","dcrName","eventId","dcrPayload","runQueue","push","isDataStoreReady","getSdkPcKey","pcKey","getSdkInitOptions","sdkInitOptions","setSdkInitOptions","options","deQueueTMFire","length","pop","isTagManagerProcessing","isProcessing","setTagManagerProcessing","status","getSdkDataElements","d","getSdkQC","qc","hasOneSSTTag","sst","getSSTDownStream","dws_s_t","getClientDownStream","dws_c_t","getClientSdk","getSSTUrl","getAttrInfoUrl","setVisitInfo","visitInfo","visitInfoToString","visitVer","visitId","visitTs","visitCt","visitDepth","undefined","setVisitorInfo","visitorInfo","getDebugId","debugId","getErrorReportUrl","getIdlUrl","getSdkVersion","setDebugId","dbgId","shouldFireSstForEvent","eventName","sseMpDlE","indexOf","getUrlInfo","getSdkTags","t","getSdkProviders","p","getPrivacyCompliance","prStatus","setPrivacyCompliance","storeData","key","value","AsyncStorage","setItem","JSON","stringify","getDataFromStorage","getItem","parse","getDataElements","dataElements","setDataElements","de","getPageLang","pageLang","getDeviceOs","getDataElementHelpers","log","Logger","logDbg","err","logError","getPageName","getDataElementValue","param","setPageLang","lang","getSdkPageLangKey","langKey","setDataElement","setValidQc","qcList","qcInfo","validQcList","validQcInfoList","getValidQcList","getValidQcInfo","setTransFunctions","elements","transFunctions","getTransFunctions","getOperatingSystem","getVisitId","getDeviceType","getDeviceId","dId","getMpId","mId","getVisitorInfoAsString","getOrgId","getCoreVersion","v","getMpEnv","mpEnvShort","shortEnv"],"sources":["data-store.ts"],"sourcesContent":["import AsyncStorage from '@react-native-async-storage/async-storage';\nimport type {\n DeJsvHelper,\n MapLike,\n QcInfoItem,\n RunQueueModel,\n SdkInitOptions,\n UrlInfo,\n VisitInfo,\n VisitorInfo,\n} from './app-types';\nimport { Logger } from './logger';\nimport type {\n ClientSdkDeItem,\n ClientSdkPrItem,\n ClientSdkQcItem,\n ClientSdkTagItem,\n MpClientSdk,\n} from '../models/mp-client-sdk';\nimport { Platform } from 'react-native';\nimport { DeviceType, getDeviceTypeAsync } from 'expo-device';\n\nexport class DataStore {\n private static isDataStoreInitialized = false;\n private static dataElements: MapLike = {};\n private static validQcList: string[];\n private static validQcInfoList: Array<QcInfoItem> = [];\n private static transFunctions: MapLike = {};\n private static prStatus = true;\n private static clientSdk: MpClientSdk;\n private static urls: UrlInfo;\n private static debugId: string;\n private static visitorInfo: VisitorInfo;\n private static visitInfo: VisitInfo;\n private static pageLang = 'en';\n private static mpEnvShort: 'stg' | 'prd';\n private static devicePlatform = 'unknown';\n private static deviceType = 'mobile';\n private static runQueue: RunQueueModel[] = [];\n private static isProcessing = false;\n private static sdkInitOptions: SdkInitOptions;\n\n static async init(clientSdk: MpClientSdk): Promise<void> {\n this.clientSdk = clientSdk;\n this.setMpEnv(clientSdk?.s?.ev === 'staging' ? 'stg' : 'prd');\n if (typeof Platform !== 'undefined' && typeof Platform.OS !== 'undefined') {\n this.devicePlatform = Platform.OS.toLowerCase();\n }\n\n const dType = await getDeviceTypeAsync();\n if (dType === DeviceType.PHONE) {\n this.deviceType = 'mobile';\n } else if (dType === DeviceType.TABLET) {\n this.deviceType = 'tablet';\n } else {\n this.deviceType = 'unknown';\n }\n\n this.resetCollectorUrl(\n clientSdk.s.c_url,\n clientSdk.s.ev,\n clientSdk.s.v_id,\n clientSdk.s.p_id\n );\n this.isDataStoreInitialized = true;\n }\n\n static resetCollectorUrl(\n baseCollectorUrl: string,\n sdkEnv: string,\n vendorId: string,\n projectId: string\n ): boolean {\n const tagsBaseUrl = `${baseCollectorUrl}/${\n sdkEnv === 'staging' ? 's' : 'p'\n }/${vendorId}/${projectId}`;\n this.urls = {\n tfUrl: tagsBaseUrl + '/sst',\n errUrl: tagsBaseUrl + '/err',\n rptUrl: tagsBaseUrl + '/report',\n infoUrl: tagsBaseUrl + '/info',\n baseUrl: baseCollectorUrl,\n attrInfoUrl: baseCollectorUrl + `/idl/${vendorId}/attrInfo`,\n idlUrl:\n baseCollectorUrl +\n `/idl/${vendorId}/idl${sdkEnv === 'staging' ? '-staging' : ''}`,\n };\n return true;\n }\n\n static enQueueTMFire(\n sseOnly: boolean,\n name: string,\n dcrName: string,\n eventId: string,\n dcrPayload?: Record<string, any>\n ): void {\n this.runQueue.push({ sseOnly, name, dcrName, eventId, dcrPayload });\n }\n\n static isDataStoreReady(): boolean {\n return this.isDataStoreInitialized;\n }\n\n static getSdkPcKey(): string {\n return this.clientSdk.pcKey;\n }\n\n static getSdkInitOptions(): SdkInitOptions {\n return this.sdkInitOptions;\n }\n\n static setSdkInitOptions(options: SdkInitOptions): void {\n this.sdkInitOptions = options;\n }\n\n static deQueueTMFire(): RunQueueModel {\n return this.runQueue.length > 0 ? this.runQueue.pop() : null;\n }\n\n static isTagManagerProcessing(): boolean {\n return this.isProcessing;\n }\n\n static setTagManagerProcessing(status: boolean): void {\n this.isProcessing = status;\n }\n\n static getSdkDataElements(): MapLike<ClientSdkDeItem> {\n return this.clientSdk?.d || {};\n }\n\n static getSdkQC(): ClientSdkQcItem[] {\n return this.clientSdk?.qc || [];\n }\n\n static hasOneSSTTag(): boolean {\n return this.clientSdk.s.sst;\n }\n\n static getSSTDownStream(): 'j' | 'n' {\n return this.clientSdk.s.dws_s_t;\n }\n\n static getClientDownStream(): 'j' | 'n' {\n return this.clientSdk.s.dws_c_t;\n }\n\n static getClientSdk(): MpClientSdk {\n return this.clientSdk;\n }\n\n static getSSTUrl(): string {\n return this.urls.tfUrl;\n }\n\n static getAttrInfoUrl(): string {\n return this.urls.attrInfoUrl;\n }\n\n static setVisitInfo(visitInfo: VisitInfo): void {\n this.visitInfo = visitInfo;\n }\n\n static visitInfoToString(): string {\n return this.visitInfo\n ? `${this.visitInfo.visitVer}|${this.visitInfo.visitId}|${this.visitInfo.visitTs}|${this.visitInfo.visitCt}|${this.visitInfo.visitDepth}`\n : undefined;\n }\n\n static setVisitorInfo(visitorInfo: VisitorInfo): void {\n this.visitorInfo = visitorInfo;\n }\n\n static getDebugId(): string {\n return this.debugId;\n }\n\n static getErrorReportUrl(): string {\n return this.urls.errUrl;\n }\n\n static getIdlUrl(): string {\n return this.urls?.idlUrl;\n }\n\n static getSdkVersion(): string {\n // TODO: Fix this\n return 'na';\n }\n\n static setDebugId(dbgId: string): void {\n this.debugId = dbgId;\n }\n\n static shouldFireSstForEvent(eventName: string): boolean {\n return this.clientSdk?.sseMpDlE?.indexOf(eventName) > -1;\n }\n\n static getUrlInfo(): UrlInfo {\n return this.urls;\n }\n\n static getSdkTags(): MapLike<ClientSdkTagItem> {\n return this?.clientSdk?.t ?? {};\n }\n\n static getSdkProviders(): MapLike<ClientSdkPrItem> {\n return this?.clientSdk?.p ?? {};\n }\n\n static getPrivacyCompliance(): boolean {\n return this.prStatus;\n }\n\n static setPrivacyCompliance(status: boolean): void {\n this.prStatus = status;\n }\n\n static async storeData(key: string, value: any): Promise<void> {\n await AsyncStorage.setItem(key, JSON.stringify(value));\n }\n\n static async getDataFromStorage<T>(key: string): Promise<T> {\n const value = await AsyncStorage.getItem(key);\n return value ? JSON.parse(value) : value;\n }\n\n static getDataElements(): MapLike {\n return this.dataElements;\n }\n\n static setDataElements(de: MapLike): void {\n this.dataElements = de;\n }\n\n static getPageLang(): string {\n return this.pageLang;\n }\n\n static getDeviceOs(): string {\n return this.devicePlatform;\n }\n\n static getDataElementHelpers(): DeJsvHelper {\n return {\n log: Logger.logDbg,\n err: Logger.logError,\n };\n }\n\n static getPageName(): string {\n return (this.getDataElementValue('page_name') as string) || 'none';\n }\n\n static getDataElementValue(param: string): string | boolean | number {\n return this.dataElements[param];\n }\n\n static setPageLang(lang: string): void {\n this.pageLang = lang || 'en';\n }\n\n static getSdkPageLangKey(): string {\n return this.clientSdk.langKey;\n }\n\n static setDataElement(key: string, value: any): void {\n this.dataElements[key] = value;\n }\n\n static setValidQc(qcList: string[], qcInfo: QcInfoItem[]): void {\n this.validQcList = qcList;\n this.validQcInfoList = qcInfo;\n }\n\n static getValidQcList(): string[] {\n return this.validQcList || [];\n }\n\n static getValidQcInfo(): QcInfoItem[] {\n return this.validQcInfoList || [];\n }\n\n static setTransFunctions(elements: MapLike): MapLike {\n this.transFunctions = elements;\n return this.transFunctions;\n }\n\n static getTransFunctions(): MapLike {\n return this.transFunctions;\n }\n\n static getOperatingSystem(): string {\n return this.devicePlatform;\n }\n\n static getVisitId(): string {\n return this.visitInfo?.visitId;\n }\n\n static getDeviceType(): string {\n return this.deviceType;\n }\n\n static getDeviceId(): string {\n return this.visitorInfo?.dId;\n }\n\n static getMpId(): string {\n return this.visitorInfo?.mId;\n }\n\n static getVisitorInfoAsString(): string | undefined {\n return this.visitorInfo ? JSON.stringify(this.visitorInfo) : undefined;\n }\n\n static getOrgId(): string {\n return this?.clientSdk?.s?.v_id;\n }\n\n static getCoreVersion(): string {\n return this?.clientSdk?.s?.v;\n }\n\n static getMpEnv(): 'stg' | 'prd' {\n return this.mpEnvShort;\n }\n\n static setMpEnv(shortEnv: 'stg' | 'prd'): void {\n this.mpEnvShort = shortEnv;\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAWA;;AAQA;;AACA;;;;;;AAEO,MAAMA,SAAN,CAAgB;EAoBJ,aAAJC,IAAI,CAACC,SAAD,EAAwC;IAAA;;IACvD,KAAKA,SAAL,GAAiBA,SAAjB;IACA,KAAKC,QAAL,CAAc,CAAAD,SAAS,SAAT,IAAAA,SAAS,WAAT,4BAAAA,SAAS,CAAEE,CAAX,8DAAcC,EAAd,MAAqB,SAArB,GAAiC,KAAjC,GAAyC,KAAvD;;IACA,IAAI,OAAOC,qBAAP,KAAoB,WAApB,IAAmC,OAAOA,qBAAA,CAASC,EAAhB,KAAuB,WAA9D,EAA2E;MACzE,KAAKC,cAAL,GAAsBF,qBAAA,CAASC,EAAT,CAAYE,WAAZ,EAAtB;IACD;;IAED,MAAMC,KAAK,GAAG,MAAM,IAAAC,8BAAA,GAApB;;IACA,IAAID,KAAK,KAAKE,sBAAA,CAAWC,KAAzB,EAAgC;MAC9B,KAAKC,UAAL,GAAkB,QAAlB;IACD,CAFD,MAEO,IAAIJ,KAAK,KAAKE,sBAAA,CAAWG,MAAzB,EAAiC;MACtC,KAAKD,UAAL,GAAkB,QAAlB;IACD,CAFM,MAEA;MACL,KAAKA,UAAL,GAAkB,SAAlB;IACD;;IAED,KAAKE,iBAAL,CACEd,SAAS,CAACE,CAAV,CAAYa,KADd,EAEEf,SAAS,CAACE,CAAV,CAAYC,EAFd,EAGEH,SAAS,CAACE,CAAV,CAAYc,IAHd,EAIEhB,SAAS,CAACE,CAAV,CAAYe,IAJd;IAMA,KAAKC,sBAAL,GAA8B,IAA9B;EACD;;EAEuB,OAAjBJ,iBAAiB,CACtBK,gBADsB,EAEtBC,MA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C,E;;gBAJzCA,S,oBAK8B,E;;gBAL9BA,S,cAMe,I;;gBANfA,S;;gBAAAA,S;;gBAAAA,S;;gBAAAA,S;;gBAAAA,S;;gBAAAA,S,cAYe,I;;gBAZfA,S;;gBAAAA,S,oBAcqB,S;;gBAdrBA,S,gBAeiB,Q;;gBAfjBA,S,cAgBgC,E;;gBAhBhCA,S,kBAiBmB,K;;gBAjBnBA,S"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EventBus = void 0;
|
|
7
|
+
|
|
8
|
+
var _logger = require("./logger");
|
|
9
|
+
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
|
|
12
|
+
class EventBus {
|
|
13
|
+
static on(eventName, callback) {
|
|
14
|
+
_logger.Logger.logDbg(`Registering Listener for event: ${eventName}`);
|
|
15
|
+
|
|
16
|
+
if (!this.eventRegister.has(eventName)) {
|
|
17
|
+
this.eventRegister.set(eventName, [callback]);
|
|
18
|
+
} else {
|
|
19
|
+
this.eventRegister.get(eventName).push(callback);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static triggerEvent(eventName, payload) {
|
|
24
|
+
if (this.eventRegister.has(eventName)) {
|
|
25
|
+
for (const cb of this.eventRegister.get(eventName)) {
|
|
26
|
+
try {
|
|
27
|
+
_logger.Logger.logDbg(`Sending event ${eventName} to all listeners. Count = ${this.eventRegister.get(eventName).length}`);
|
|
28
|
+
|
|
29
|
+
cb(eventName, payload);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
_logger.Logger.logError('Unable to process callback for event: ' + eventName);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.EventBus = EventBus;
|
|
40
|
+
|
|
41
|
+
_defineProperty(EventBus, "eventRegister", new Map());
|
|
42
|
+
//# sourceMappingURL=event-bus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EventBus","on","eventName","callback","Logger","logDbg","eventRegister","has","set","get","push","triggerEvent","payload","cb","length","err","logError","Map"],"sources":["event-bus.ts"],"sourcesContent":["import type { EventBusCallback } from './app-types';\nimport { Logger } from './logger';\n\nexport class EventBus {\n private static eventRegister: Map<string, Array<EventBusCallback>> = new Map<\n string,\n Array<EventBusCallback>\n >();\n\n static on(eventName: string, callback: EventBusCallback): void {\n Logger.logDbg(`Registering Listener for event: ${eventName}`);\n if (!this.eventRegister.has(eventName)) {\n this.eventRegister.set(eventName, [callback]);\n } else {\n this.eventRegister.get(eventName).push(callback);\n }\n }\n\n static triggerEvent(eventName: string, payload: any): void {\n if (this.eventRegister.has(eventName)) {\n for (const cb of this.eventRegister.get(eventName)) {\n try {\n Logger.logDbg(\n `Sending event ${eventName} to all listeners. Count = ${\n this.eventRegister.get(eventName).length\n }`\n );\n cb(eventName, payload);\n } catch (err) {\n Logger.logError('Unable to process callback for event: ' + eventName);\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;AACA;;;;AAEO,MAAMA,QAAN,CAAe;EAMX,OAAFC,EAAE,CAACC,SAAD,EAAoBC,QAApB,EAAsD;IAC7DC,cAAA,CAAOC,MAAP,CAAe,mCAAkCH,SAAU,EAA3D;;IACA,IAAI,CAAC,KAAKI,aAAL,CAAmBC,GAAnB,CAAuBL,SAAvB,CAAL,EAAwC;MACtC,KAAKI,aAAL,CAAmBE,GAAnB,CAAuBN,SAAvB,EAAkC,CAACC,QAAD,CAAlC;IACD,CAFD,MAEO;MACL,KAAKG,aAAL,CAAmBG,GAAnB,CAAuBP,SAAvB,EAAkCQ,IAAlC,CAAuCP,QAAvC;IACD;EACF;;EAEkB,OAAZQ,YAAY,CAACT,SAAD,EAAoBU,OAApB,EAAwC;IACzD,IAAI,KAAKN,aAAL,CAAmBC,GAAnB,CAAuBL,SAAvB,CAAJ,EAAuC;MACrC,KAAK,MAAMW,EAAX,IAAiB,KAAKP,aAAL,CAAmBG,GAAnB,CAAuBP,SAAvB,CAAjB,EAAoD;QAClD,IAAI;UACFE,cAAA,CAAOC,MAAP,CACG,iBAAgBH,SAAU,8BACzB,KAAKI,aAAL,CAAmBG,GAAnB,CAAuBP,SAAvB,EAAkCY,MACnC,EAHH;;UAKAD,EAAE,CAACX,SAAD,EAAYU,OAAZ,CAAF;QACD,CAPD,CAOE,OAAOG,GAAP,EAAY;UACZX,cAAA,CAAOY,QAAP,CAAgB,2CAA2Cd,SAA3D;QACD;MACF;IACF;EACF;;AA9BmB;;;;gBAATF,Q,mBAC0D,IAAIiB,GAAJ,E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Logger = void 0;
|
|
7
|
+
|
|
8
|
+
class Logger {
|
|
9
|
+
static logDbg() {
|
|
10
|
+
if (console && console.log) {
|
|
11
|
+
console.log(...arguments);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static logWarn() {
|
|
16
|
+
if (console && console.warn) {
|
|
17
|
+
console.warn(...arguments);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static logError() {
|
|
22
|
+
if (console && console.error) {
|
|
23
|
+
console.error(...arguments);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.Logger = Logger;
|
|
30
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Logger","logDbg","console","log","logWarn","warn","logError","error"],"sources":["logger.ts"],"sourcesContent":["export class Logger {\n static logDbg(...args: any): void {\n if (console && console.log) {\n console.log(...args);\n }\n }\n\n static logWarn(...args: any): void {\n if (console && console.warn) {\n console.warn(...args);\n }\n }\n\n static logError(...args: any): void {\n if (console && console.error) {\n console.error(...args);\n }\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,MAAN,CAAa;EACL,OAANC,MAAM,GAAqB;IAChC,IAAIC,OAAO,IAAIA,OAAO,CAACC,GAAvB,EAA4B;MAC1BD,OAAO,CAACC,GAAR,CAAY,YAAZ;IACD;EACF;;EAEa,OAAPC,OAAO,GAAqB;IACjC,IAAIF,OAAO,IAAIA,OAAO,CAACG,IAAvB,EAA6B;MAC3BH,OAAO,CAACG,IAAR,CAAa,YAAb;IACD;EACF;;EAEc,OAARC,QAAQ,GAAqB;IAClC,IAAIJ,OAAO,IAAIA,OAAO,CAACK,KAAvB,EAA8B;MAC5BL,OAAO,CAACK,KAAR,CAAc,YAAd;IACD;EACF;;AAjBiB"}
|