mapp-intelligence-reactnative-plugin 1.0.3 → 1.1.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 (48) hide show
  1. package/android/build.gradle +32 -60
  2. package/android/gradle.properties +7 -6
  3. package/android/src/main/AndroidManifest.xml +1 -2
  4. package/android/src/main/java/com/mappinteligenceplugin/MappinteligencePluginModule.kt +7 -2
  5. package/ios/MappinteligencePlugin.mm +50 -24
  6. package/lib/module/Converters.js +2 -0
  7. package/lib/module/Converters.js.map +1 -1
  8. package/lib/module/DataTypes.js +2 -0
  9. package/lib/module/DataTypes.js.map +1 -1
  10. package/lib/module/GlobalErrorHandler.js +3 -1
  11. package/lib/module/GlobalErrorHandler.js.map +1 -1
  12. package/lib/module/MappIntelligencePlugin.js +13 -2
  13. package/lib/module/MappIntelligencePlugin.js.map +1 -1
  14. package/lib/module/UseWebTracking.js +3 -1
  15. package/lib/module/UseWebTracking.js.map +1 -1
  16. package/lib/module/global.d.js +2 -0
  17. package/lib/module/global.d.js.map +1 -1
  18. package/lib/module/index.js +8 -6
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/typescript/src/DataTypes.d.ts +6 -6
  21. package/lib/typescript/src/DataTypes.d.ts.map +1 -1
  22. package/lib/typescript/src/GlobalErrorHandler.d.ts +1 -1
  23. package/lib/typescript/src/GlobalErrorHandler.d.ts.map +1 -1
  24. package/lib/typescript/src/MappIntelligencePlugin.d.ts +6 -0
  25. package/lib/typescript/src/MappIntelligencePlugin.d.ts.map +1 -1
  26. package/lib/typescript/src/UseWebTracking.d.ts +0 -1
  27. package/lib/typescript/src/UseWebTracking.d.ts.map +1 -1
  28. package/lib/typescript/src/promiseRejectionHandler.d.ts.map +1 -1
  29. package/mapp-intelligence-reactnative-plugin.podspec +1 -1
  30. package/package.json +48 -28
  31. package/src/GlobalErrorHandler.tsx +1 -1
  32. package/src/MappIntelligencePlugin.tsx +11 -1
  33. package/lib/commonjs/Converters.js +0 -168
  34. package/lib/commonjs/Converters.js.map +0 -1
  35. package/lib/commonjs/DataTypes.js +0 -79
  36. package/lib/commonjs/DataTypes.js.map +0 -1
  37. package/lib/commonjs/GlobalErrorHandler.js +0 -47
  38. package/lib/commonjs/GlobalErrorHandler.js.map +0 -1
  39. package/lib/commonjs/MappIntelligencePlugin.js +0 -296
  40. package/lib/commonjs/MappIntelligencePlugin.js.map +0 -1
  41. package/lib/commonjs/UseWebTracking.js +0 -96
  42. package/lib/commonjs/UseWebTracking.js.map +0 -1
  43. package/lib/commonjs/global.d.js +0 -6
  44. package/lib/commonjs/global.d.js.map +0 -1
  45. package/lib/commonjs/index.js +0 -72
  46. package/lib/commonjs/index.js.map +0 -1
  47. package/lib/commonjs/promiseRejectionHandler.js +0 -50
  48. package/lib/commonjs/promiseRejectionHandler.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MappIntelligencePlugin.d.ts","sourceRoot":"","sources":["../../../src/MappIntelligencePlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACX,MAAM,aAAa,CAAC;AAmBrB,eAAO,MAAM,sBAAsB;IACjC;;;OAGG;iBACQ,QAAQ,MAAM,CAAC;IAK1B;;;;;OAKG;sCAES,MAAM,EAAE,UACV,MAAM,KACb,QAAQ,MAAM,CAAC;IAKlB;;;;OAIG;yBACkB,QAAQ,KAAG,QAAQ,MAAM,CAAC;IAK/C;;;;OAIG;kCAC2B,aAAa,KAAG,QAAQ,MAAM,CAAC;IAI7D;;;;OAIG;mCAC4B,MAAM,KAAG,QAAQ,MAAM,CAAC;IAKvD;;;;;OAKG;sCAC+B,OAAO,KAAG,QAAQ,MAAM,CAAC;IAK3D;;;;OAIG;0CACmC,OAAO,KAAG,QAAQ,MAAM,CAAC;IAK/D;;;;OAIG;gCACyB,MAAM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ACY,OAAO,CAAC,MAAM,CAAC;IAI9B;;;OAGG;yBACgB,OAAO,CAAC,OAAO,CAAC;IAInC;;;;;OAKG;wCACiC,MAAM,GAAG,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC;IAKnE;;;;;;OAMG;uBACgB,OAAO,KAAG,OAAO,CAAC,MAAM,CAAC;IAI5C;;;;OAIG;sBACe,OAAO,KAAG,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;iBACQ,OAAO,CAAC,MAAM,CAAC;IAI1B;;;;;OAKG;gCACuB,OAAO,CAAC,MAAM,CAAC;IAIzC;;;OAGG;8BACqB,OAAO,CAAC,MAAM,CAAC;IAIvC;;;;OAIG;;CAKJ,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { WebViewMessageEvent } from 'react-native-webview';
3
2
  import { WebView } from 'react-native-webview';
4
3
  type OnMessage = (data: any) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"UseWebTracking.d.ts","sourceRoot":"","sources":["../../../src/UseWebTracking.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAU/C,KAAK,SAAS,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAErC,KAAK,MAAM,GAAG,MAAM,IAAI,CAAC;AAEzB,eAAO,MAAM,cAAc,eACb,SAAS,GAAG,IAAI,WACnB,MAAM,GAAG,IAAI;;;;qCA2FkB,MAAM,GAAG,SAAS,GAAG,IAAI;CAQlE,CAAC"}
1
+ {"version":3,"file":"UseWebTracking.d.ts","sourceRoot":"","sources":["../../../src/UseWebTracking.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAU/C,KAAK,SAAS,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAErC,KAAK,MAAM,GAAG,MAAM,IAAI,CAAC;AAEzB,eAAO,MAAM,cAAc,GACzB,YAAY,SAAS,GAAG,IAAI,EAC5B,SAAS,MAAM,GAAG,IAAI;;2BAKZ,mBAAmB;;qCAsFW,MAAM,GAAG,SAAS,GAAG,IAAI;CAQlE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"promiseRejectionHandler.d.ts","sourceRoot":"","sources":["../../../src/promiseRejectionHandler.tsx"],"names":[],"mappings":"AAuCA,eAAO,MAAM,mCAAmC,qCAAgB,CAAC;AAGjE,eAAO,MAAM,mCAAmC,wBAW/C,CAAC"}
1
+ {"version":3,"file":"promiseRejectionHandler.d.ts","sourceRoot":"","sources":["../../../src/promiseRejectionHandler.tsx"],"names":[],"mappings":"AAuCA,eAAO,MAAM,mCAAmC,qCAAgB,CAAC;AAGjE,eAAO,MAAM,mCAAmC,GAAI,YAAO,SAW1D,CAAC"}
@@ -21,5 +21,5 @@ Pod::Spec.new do |s|
21
21
  s.dependency "RCTRequired"
22
22
  s.dependency "RCTTypeSafety"
23
23
  s.dependency "ReactCommon/turbomodule/core"
24
- s.dependency "MappIntelligence", '5.0.14'
24
+ s.dependency "MappIntelligence", '5.0.15'
25
25
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapp-intelligence-reactnative-plugin",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "The MappIntelligence SDK allows you to track user activities, screen flow and media usage for an App. All data is send to the MappIntelligence tracking system for further analysis.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -52,40 +52,43 @@
52
52
  "publishConfig": {
53
53
  "registry": "https://registry.npmjs.org/"
54
54
  },
55
+ "peerDependencies": {
56
+ "react": ">=18.0.0",
57
+ "react-native": ">=0.76.0"
58
+ },
55
59
  "devDependencies": {
56
- "@react-native/babel-preset": "0.75.3",
57
- "@react-native/eslint-config": "0.75.3",
58
- "@react-native/metro-config": "0.75.3",
59
- "@react-native/typescript-config": "0.75.3",
60
- "@types/jest": "28.1.2",
61
- "@types/react": "18.2.58",
62
- "@types/react-native": "0.70.0",
63
- "eslint": "8.57.0",
64
- "eslint-config-prettier": "8.5.0",
65
- "eslint-plugin-prettier": "4.0.0",
66
- "jest": "28.1.3",
67
- "lefthook": "1.7.1",
60
+ "@commitlint/config-conventional": "^19.6.0",
61
+ "@evilmartians/lefthook": "^1.5.0",
62
+ "@react-native-community/cli": "15.0.0-alpha.2",
63
+ "@react-native/babel-preset": "0.79.2",
64
+ "@react-native/eslint-config": "^0.79.2",
65
+ "@release-it/conventional-changelog": "^9.0.2",
66
+ "@types/jest": "^29.5.14",
67
+ "@types/react": "^19.0.0",
68
+ "commitlint": "^19.6.1",
69
+ "del-cli": "^5.1.0",
70
+ "eslint": "^9.22.0",
71
+ "eslint-config-prettier": "^10.1.1",
72
+ "eslint-plugin-prettier": "^5.2.3",
73
+ "jest": "^29.7.0",
68
74
  "pod-install": "0.1.0",
69
- "prettier": "2.0.5",
70
- "react": "18.3.1",
71
- "react-native": "0.75.3",
72
- "react-native-builder-bob": "0.23.2",
73
- "react-native-webview": "13.12.2",
74
- "react-test-renderer": "18.3.1",
75
+ "prettier": "^3.0.3",
76
+ "react": "19.0.0",
77
+ "react-native": "0.79.2",
78
+ "react-native-builder-bob": "^0.35.3",
79
+ "react-native-webview": "^13.13.5",
80
+ "react-test-renderer": "19.0.0",
81
+ "release-it": "^17.2.1",
75
82
  "turbo": "^1.10.7",
76
- "typedoc": "0.25.13",
77
- "typescript": "5.0.2"
83
+ "typedoc": "^0.28.4",
84
+ "typescript": "^5.8.3"
78
85
  },
79
86
  "resolutions": {
80
87
  "@types/react": "17.0.21"
81
88
  },
82
- "peerDependencies": {
83
- "react": "*",
84
- "react-native": "*"
85
- },
86
89
  "workspaces": [
87
90
  "example",
88
- "mapp-intelligence-reactnative-plugin"
91
+ "."
89
92
  ],
90
93
  "packageManager": "yarn@3.6.1",
91
94
  "engines": {
@@ -155,8 +158,12 @@
155
158
  "source": "src",
156
159
  "output": "lib",
157
160
  "targets": [
158
- "commonjs",
159
- "module",
161
+ [
162
+ "module",
163
+ {
164
+ "esm": true
165
+ }
166
+ ],
160
167
  [
161
168
  "typescript",
162
169
  {
@@ -164,5 +171,18 @@
164
171
  }
165
172
  ]
166
173
  ]
174
+ },
175
+ "codegenConfig": {
176
+ "name": "MappIntelligencePluginSpec",
177
+ "type": "modules",
178
+ "jsSrcsDir": "src",
179
+ "android": {
180
+ "javaPackageName": "com.mappinteligenceplugin"
181
+ }
182
+ },
183
+ "create-react-native-library": {
184
+ "languages": "kotlin-objc",
185
+ "type": "turbo-module",
186
+ "version": "0.50.3"
167
187
  }
168
188
  }
@@ -16,7 +16,7 @@ var onErrorCallback: ((e: Error, isFatal: Boolean) => {}) | undefined | null =
16
16
 
17
17
  const defaultErrorHandler: GlobalErrorHandler = (error, isFatal) => {
18
18
  try {
19
- MappIntelligencePlugin.trackException(error, error.stackTrace);
19
+ MappIntelligencePlugin.trackException(error);
20
20
  console.log('GLOBAL ERROR HANDLER: ', isFatal, error);
21
21
  } catch (err) {
22
22
  console.error(err);
@@ -300,7 +300,7 @@ export const MappIntelligencePlugin = {
300
300
  message: string,
301
301
  stackTrace?: string | null
302
302
  ): Promise<number> => {
303
- return mappPlugin.trackException(
303
+ return mappPlugin.trackExceptionWithName(
304
304
  name,
305
305
  message.slice(0, 1000),
306
306
  stackTrace?.slice(0, 1000)
@@ -389,4 +389,14 @@ export const MappIntelligencePlugin = {
389
389
  printCurrentConfig: (): Promise<string> => {
390
390
  return mappPlugin.getCurrentConfig();
391
391
  },
392
+
393
+ /**
394
+ * Crash the app on native level
395
+ * @returns result if method executed succesfully or not
396
+ * ONLY FOR TESTING!!!
397
+ */
398
+ nativeCrash: async () => {
399
+ await mappPlugin.nativeCrash();
400
+ return Promise.resolve(true);
401
+ },
392
402
  };
@@ -1,168 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.convertCampaignParameters = convertCampaignParameters;
7
- exports.convertEcommerceParameters = convertEcommerceParameters;
8
- exports.convertEventParameters = convertEventParameters;
9
- exports.convertMediaEvent = convertMediaEvent;
10
- exports.convertMediaParameters = convertMediaParameters;
11
- exports.convertPageParameters = convertPageParameters;
12
- exports.convertSessionParamters = convertSessionParamters;
13
- exports.convertUserCategories = convertUserCategories;
14
- //MARK: methods for converting objects
15
- function convertUserCategories(userCategories) {
16
- if (userCategories == null) {
17
- return null;
18
- }
19
- console.log('convertUserCategories');
20
- const birthday = userCategories?.birthday;
21
- const categories = userCategories?.customCategories;
22
- const userCategorisesDict = {
23
- birthday: birthday != null ? {
24
- day: birthday.day,
25
- month: birthday.month,
26
- year: birthday.year
27
- } : null,
28
- city: userCategories?.city,
29
- country: userCategories?.country,
30
- emailAddress: userCategories?.emailAddress,
31
- emailReceiverId: userCategories?.emailReceiverId,
32
- firstName: userCategories?.firstName,
33
- gender: userCategories?.gender,
34
- customerId: userCategories?.customerId,
35
- lastName: userCategories?.lastName,
36
- newsletterSubscribed: userCategories?.newsletterSubscribed,
37
- phoneNumber: userCategories?.phoneNumber,
38
- street: userCategories?.street,
39
- streetNumber: userCategories?.streetNumber,
40
- zipCode: userCategories?.zipCode,
41
- customCategories: categories != null ? Object.fromEntries(categories.entries()) : null
42
- };
43
- return userCategorisesDict;
44
- }
45
- function convertPageParameters(pageParameters) {
46
- console.log('convertPageParameters');
47
- if (pageParameters == null) {
48
- return null;
49
- }
50
- const params = pageParameters?.params;
51
- const cat = pageParameters?.categories;
52
- const page = {
53
- params: params != null ? Object.fromEntries(params.entries()) : {},
54
- categories: cat != null ? Object.fromEntries(cat) : {},
55
- searchTerm: pageParameters?.searchTerm
56
- };
57
- return page;
58
- }
59
- function convertSessionParamters(sessionParamaters) {
60
- console.log('convertSessionParamters');
61
- if (sessionParamaters == null) {
62
- return null;
63
- }
64
- const data = sessionParamaters?.parameters;
65
- return data != null ? Object.fromEntries(data.entries()) : {};
66
- }
67
- function convertEcommerceParameters(ecommerceParameters) {
68
- console.log('convertEcommerceParameters');
69
- if (ecommerceParameters == null) {
70
- return null;
71
- }
72
- let products = [];
73
- ecommerceParameters.products?.map(item => {
74
- let categories = item.categories;
75
- let ecommercParams = item.ecommerceParameters;
76
- products.push({
77
- name: item?.name,
78
- cost: item.cost,
79
- quantity: item.quantity,
80
- productAdvertiseID: item.productAdvertiseID,
81
- productSoldOut: item.productSoldOut,
82
- productVariant: item.productVariant,
83
- categories: categories != null ? Object.fromEntries(categories.entries()) : {},
84
- ecommerceParameters: ecommercParams != null ? Object.fromEntries(ecommercParams.entries()) : {}
85
- });
86
- });
87
- const customParams = ecommerceParameters.customParameters;
88
- const ecommerce = {
89
- products: products,
90
- status: ecommerceParameters.status,
91
- currency: ecommerceParameters.currency,
92
- orderID: ecommerceParameters.orderID,
93
- orderValue: ecommerceParameters.orderValue,
94
- returningOrNewCustomer: ecommerceParameters.returningOrNewCustomer,
95
- returnValue: ecommerceParameters.returnValue,
96
- cancellationValue: ecommerceParameters.cancellationValue,
97
- couponValue: ecommerceParameters.couponValue,
98
- paymentMethod: ecommerceParameters.paymentMethod,
99
- shippingServiceProvider: ecommerceParameters.shippingServiceProvider,
100
- shippingSpeed: ecommerceParameters.shippingSpeed,
101
- shippingCost: ecommerceParameters.shippingCost,
102
- markUp: ecommerceParameters.markUp,
103
- orderStatus: ecommerceParameters.orderStatus,
104
- customParameters: customParams != null ? Object.fromEntries(customParams.entries()) : {}
105
- };
106
- return ecommerce;
107
- }
108
- function convertCampaignParameters(campaignParameters) {
109
- console.log('convertCampaignParameters');
110
- if (campaignParameters == null) {
111
- return null;
112
- }
113
- const params = campaignParameters?.customParameters;
114
- const campaign = {
115
- campaignId: campaignParameters?.campaignId,
116
- action: campaignParameters?.action,
117
- mediaCode: campaignParameters?.mediaCode,
118
- oncePerSession: campaignParameters?.oncePerSession,
119
- customParameters: params != null ? Object.fromEntries(params.entries()) : {}
120
- };
121
- return campaign;
122
- }
123
- function convertEventParameters(event) {
124
- if (event == null) {
125
- return null;
126
- }
127
- const customParams = event.customParameters != null ? Object.fromEntries(event.customParameters?.entries()) : null;
128
- const eventParams = {
129
- customParameters: customParams
130
- };
131
- return eventParams;
132
- }
133
- function convertMediaParameters(mediaParam) {
134
- if (mediaParam == null) {
135
- return null;
136
- }
137
- const params = {
138
- name: mediaParam?.name,
139
- action: mediaParam?.action,
140
- position: mediaParam?.position,
141
- duration: mediaParam?.duration,
142
- bandwith: mediaParam?.bandwith,
143
- soundIsMuted: mediaParam?.soundIsMuted,
144
- soundVolume: mediaParam?.soundVolume,
145
- customCategories: mediaParam?.customCategories != null ? Object.fromEntries(mediaParam.customCategories?.entries()) : null
146
- };
147
- return params;
148
- }
149
- function convertMediaEvent(mediaEvent) {
150
- if (mediaEvent == null) {
151
- return null;
152
- }
153
- const custom = mediaEvent.customParameters != null ? Object.fromEntries(mediaEvent?.customParameters?.entries()) : null;
154
- const eCommerce = convertEcommerceParameters(mediaEvent.eCommerceParameters);
155
- const session = convertSessionParamters(mediaEvent.sessionParameters);
156
- const event = convertEventParameters(mediaEvent.eventParameters);
157
- const mediaParams = convertMediaParameters(mediaEvent.parameters);
158
- const data = {
159
- pageName: mediaEvent.pageName,
160
- parameters: mediaParams,
161
- eventParameters: event,
162
- sessionParameters: session,
163
- eCommerceParameters: eCommerce,
164
- customParameters: custom
165
- };
166
- return data;
167
- }
168
- //# sourceMappingURL=Converters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["convertUserCategories","userCategories","console","log","birthday","categories","customCategories","userCategorisesDict","day","month","year","city","country","emailAddress","emailReceiverId","firstName","gender","customerId","lastName","newsletterSubscribed","phoneNumber","street","streetNumber","zipCode","Object","fromEntries","entries","convertPageParameters","pageParameters","params","cat","page","searchTerm","convertSessionParamters","sessionParamaters","data","parameters","convertEcommerceParameters","ecommerceParameters","products","map","item","ecommercParams","push","name","cost","quantity","productAdvertiseID","productSoldOut","productVariant","customParams","customParameters","ecommerce","status","currency","orderID","orderValue","returningOrNewCustomer","returnValue","cancellationValue","couponValue","paymentMethod","shippingServiceProvider","shippingSpeed","shippingCost","markUp","orderStatus","convertCampaignParameters","campaignParameters","campaign","campaignId","action","mediaCode","oncePerSession","convertEventParameters","event","eventParams","convertMediaParameters","mediaParam","position","duration","bandwith","soundIsMuted","soundVolume","convertMediaEvent","mediaEvent","custom","eCommerce","eCommerceParameters","session","sessionParameters","eventParameters","mediaParams","pageName"],"sourceRoot":"../../src","sources":["Converters.tsx"],"mappings":";;;;;;;;;;;;;AAWA;AACO,SAASA,qBAAqBA,CAACC,cAAsC,EAAE;EAC5E,IAAIA,cAAc,IAAI,IAAI,EAAE;IAC1B,OAAO,IAAI;EACb;EACAC,OAAO,CAACC,GAAG,CAAC,uBAAuB,CAAC;EACpC,MAAMC,QAAQ,GAAGH,cAAc,EAAEG,QAAQ;EACzC,MAAMC,UAAU,GAAGJ,cAAc,EAAEK,gBAAgB;EAEnD,MAAMC,mBAA2B,GAAG;IAClCH,QAAQ,EACNA,QAAQ,IAAI,IAAI,GACZ;MAAEI,GAAG,EAAEJ,QAAQ,CAACI,GAAG;MAAEC,KAAK,EAAEL,QAAQ,CAACK,KAAK;MAAEC,IAAI,EAAEN,QAAQ,CAACM;IAAK,CAAC,GACjE,IAAI;IACVC,IAAI,EAAEV,cAAc,EAAEU,IAAI;IAC1BC,OAAO,EAAEX,cAAc,EAAEW,OAAO;IAChCC,YAAY,EAAEZ,cAAc,EAAEY,YAAY;IAC1CC,eAAe,EAAEb,cAAc,EAAEa,eAAe;IAChDC,SAAS,EAAEd,cAAc,EAAEc,SAAS;IACpCC,MAAM,EAAEf,cAAc,EAAEe,MAAM;IAC9BC,UAAU,EAAEhB,cAAc,EAAEgB,UAAU;IACtCC,QAAQ,EAAEjB,cAAc,EAAEiB,QAAQ;IAClCC,oBAAoB,EAAElB,cAAc,EAAEkB,oBA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uB,CAACoD,UAAU,CAACK,iBAAiB,CAAC;EACrE,MAAMf,KAAK,GAAGD,sBAAsB,CAACW,UAAU,CAACM,eAAe,CAAC;EAChE,MAAMC,WAAW,GAAGf,sBAAsB,CAACQ,UAAU,CAACjD,UAAU,CAAC;EAEjE,MAAMD,IAAY,GAAG;IACnB0D,QAAQ,EAAER,UAAU,CAACQ,QAAQ;IAC7BzD,UAAU,EAAEwD,WAAW;IACvBD,eAAe,EAAEhB,KAAK;IACtBe,iBAAiB,EAAED,OAAO;IAC1BD,mBAAmB,EAAED,SAAS;IAC9BpC,gBAAgB,EAAEmC;EACpB,CAAC;EAED,OAAOnD,IAAI;AACb","ignoreList":[]}
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MediaParam = exports.MediaAction = exports.MIStatus = exports.MIGender = exports.MIAction = exports.LogLevel = exports.ExceptionType = void 0;
7
- let MIGender = exports.MIGender = /*#__PURE__*/function (MIGender) {
8
- MIGender[MIGender["unknown"] = 1] = "unknown";
9
- MIGender[MIGender["male"] = 2] = "male";
10
- MIGender[MIGender["female"] = 3] = "female";
11
- return MIGender;
12
- }({});
13
- let MIStatus = exports.MIStatus = /*#__PURE__*/function (MIStatus) {
14
- MIStatus[MIStatus["noneStatus"] = 0] = "noneStatus";
15
- MIStatus[MIStatus["addedToBasket"] = 1] = "addedToBasket";
16
- MIStatus[MIStatus["purchased"] = 2] = "purchased";
17
- MIStatus[MIStatus["viewed"] = 3] = "viewed";
18
- MIStatus[MIStatus["deletedFromBasket"] = 4] = "deletedFromBasket";
19
- MIStatus[MIStatus["addedToWishlist"] = 5] = "addedToWishlist";
20
- MIStatus[MIStatus["deletedFromWishlist"] = 6] = "deletedFromWishlist";
21
- MIStatus[MIStatus["checkout"] = 7] = "checkout";
22
- return MIStatus;
23
- }({});
24
- let MIAction = exports.MIAction = /*#__PURE__*/function (MIAction) {
25
- MIAction[MIAction["click"] = 1] = "click";
26
- MIAction[MIAction["view"] = 2] = "view";
27
- return MIAction;
28
- }({});
29
- let MediaParam = exports.MediaParam = /*#__PURE__*/function (MediaParam) {
30
- MediaParam["media_category"] = "mg";
31
- MediaParam["media_action"] = "mk";
32
- MediaParam["media_position"] = "mt1";
33
- MediaParam["media_duration"] = "mt2";
34
- MediaParam["bandwidth"] = "bw";
35
- MediaParam["volume"] = "vol";
36
- MediaParam["mute"] = "mut";
37
- MediaParam["name"] = "mi";
38
- return MediaParam;
39
- }({});
40
- let ExceptionType = exports.ExceptionType = /*#__PURE__*/function (ExceptionType) {
41
- ExceptionType[ExceptionType["none"] = 0] = "none";
42
- ExceptionType[ExceptionType["uncaught"] = 1] = "uncaught";
43
- ExceptionType[ExceptionType["caught"] = 2] = "caught";
44
- ExceptionType[ExceptionType["custom"] = 3] = "custom";
45
- ExceptionType[ExceptionType["all"] = 4] = "all";
46
- ExceptionType[ExceptionType["uncaught_and_custom"] = 5] = "uncaught_and_custom";
47
- ExceptionType[ExceptionType["uncaught_and_caught"] = 6] = "uncaught_and_caught";
48
- ExceptionType[ExceptionType["custom_and_caught"] = 7] = "custom_and_caught";
49
- return ExceptionType;
50
- }({});
51
- let MediaAction = exports.MediaAction = /*#__PURE__*/function (MediaAction) {
52
- MediaAction["init"] = "init";
53
- MediaAction["play"] = "play";
54
- MediaAction["pause"] = "pause";
55
- MediaAction["stop"] = "stop";
56
- MediaAction["seek"] = "seek";
57
- MediaAction["pos"] = "pos";
58
- MediaAction["eof"] = "eof";
59
- return MediaAction;
60
- }({});
61
- let LogLevel = exports.LogLevel = /*#__PURE__*/function (LogLevel) {
62
- LogLevel[LogLevel["all"] = 1] = "all";
63
- // All logs of the above.
64
- LogLevel[LogLevel["debug"] = 2] = "debug";
65
- // The lowest priority that you would normally log, and purely
66
- // informational in nature.
67
- LogLevel[LogLevel["warning"] = 3] = "warning";
68
- // Something is missing and might fail if not corrected
69
- LogLevel[LogLevel["error"] = 4] = "error";
70
- // Something has failed.
71
- LogLevel[LogLevel["fault"] = 5] = "fault";
72
- // A failure in a key system.
73
- LogLevel[LogLevel["info"] = 6] = "info";
74
- // Informational logs for updating configuration or migrating from
75
- // older versions of the library.
76
- LogLevel[LogLevel["none"] = 7] = "none"; // None of the logs.
77
- return LogLevel;
78
- }({});
79
- //# sourceMappingURL=DataTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["MIGender","exports","MIStatus","MIAction","MediaParam","ExceptionType","MediaAction","LogLevel"],"sourceRoot":"../../src","sources":["DataTypes.tsx"],"mappings":";;;;;;IAcYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAyDRE,QAAQ,GAAAD,OAAA,CAAAC,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAWRC,QAAQ,GAAAF,OAAA,CAAAE,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAuBRC,UAAU,GAAAH,OAAA,CAAAG,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IA+BVC,aAAa,GAAAJ,OAAA,CAAAI,aAAA,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,IAWbC,WAAW,GAAAL,OAAA,CAAAK,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAA,IAUXC,QAAQ,GAAAN,OAAA,CAAAM,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EACT;EADCA,QAAQ,CAARA,QAAQ;EAEP;EACX;EAHUA,QAAQ,CAARA,QAAQ;EAIL;EAJHA,QAAQ,CAARA,QAAQ;EAKP;EALDA,QAAQ,CAARA,QAAQ;EAMP;EANDA,QAAQ,CAARA,QAAQ;EAOR;EACV;EARUA,QAAQ,CAARA,QAAQ,wBASR;EAAA,OATAA,QAAQ;AAAA","ignoreList":[]}
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setGlobalErrorHandler = void 0;
7
- var _mappIntelligenceReactnativePlugin = require("mapp-intelligence-reactnative-plugin");
8
- const {
9
- polyfillGlobal
10
- } = require('react-native/Libraries/Utilities/PolyfillFunctions');
11
- const Promise = require('promise/setimmediate/es6-extensions');
12
- const tracking = require('promise/setimmediate/rejection-tracking');
13
- var onErrorCallback = null;
14
- const defaultErrorHandler = (error, isFatal) => {
15
- try {
16
- _mappIntelligenceReactnativePlugin.MappIntelligencePlugin.trackException(error, error.stackTrace);
17
- console.log('GLOBAL ERROR HANDLER: ', isFatal, error);
18
- } catch (err) {
19
- console.error(err);
20
- } finally {
21
- onErrorCallback?.(error, isFatal ?? false);
22
- }
23
- };
24
- const setGlobalErrorHandler = (errorCallback, errorHandler = defaultErrorHandler) => {
25
- onErrorCallback = errorCallback;
26
- polyfillGlobal('Promise', () => {
27
- tracking.enable({
28
- allRejections: true,
29
- onUnhandled: (_, error) => {
30
- errorHandler(error, false);
31
- }
32
- });
33
- return Promise;
34
- });
35
- ErrorUtils.setGlobalHandler(errorHandler);
36
- // const prevTracker = getUnhandledPromiseRejectionTracker();
37
-
38
- // setUnhandledPromiseRejectionTracker((id: any, error: any) => {
39
- // console.warn('Unhandled promise rejection!', id, error);
40
- // if (prevTracker !== undefined) {
41
- // //prevTracker(id, error);
42
- // errorHandler(error, false);
43
- // }
44
- // });
45
- };
46
- exports.setGlobalErrorHandler = setGlobalErrorHandler;
47
- //# sourceMappingURL=GlobalErrorHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_mappIntelligenceReactnativePlugin","require","polyfillGlobal","Promise","tracking","onErrorCallback","defaultErrorHandler","error","isFatal","MappIntelligencePlugin","trackException","stackTrace","console","log","err","setGlobalErrorHandler","errorCallback","errorHandler","enable","allRejections","onUnhandled","_","ErrorUtils","setGlobalHandler","exports"],"sourceRoot":"../../src","sources":["GlobalErrorHandler.tsx"],"mappings":";;;;;;AAAA,IAAAA,kCAAA,GAAAC,OAAA;AAEA,MAAM;EACJC;AACF,CAAC,GAAGD,OAAO,CAAC,oDAAoD,CAAC;AACjE,MAAME,OAAO,GAAGF,OAAO,CAAC,qCAAqC,CAAC;AAC9D,MAAMG,QAAQ,GAAGH,OAAO,CAAC,yCAAyC,CAAC;AAOnE,IAAII,eAAwE,GAC1E,IAAI;AAEN,MAAMC,mBAAuC,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAClE,IAAI;IACFC,yDAAsB,CAACC,cAAc,CAACH,KAAK,EAAEA,KAAK,CAACI,UAAU,CAAC;IAC9DC,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEL,OAAO,EAAED,KAAK,CAAC;EACvD,CAAC,CAAC,OAAOO,GAAG,EAAE;IACZF,OAAO,CAACL,KAAK,CAACO,GAAG,CAAC;EACpB,CAAC,SAAS;IACRT,eAAe,GAAGE,KAAK,EAAEC,OAAO,IAAI,KAAK,CAAC;EAC5C;AACF,CAAC;AAEM,MAAMO,qBAAqB,GAAGA,CACnCC,aAAuE,EACvEC,YAAgC,GAAGX,mBAAmB,KAC7C;EACTD,eAAe,GAAGW,aAAa;EAE/Bd,cAAc,CAAC,SAAS,EAAE,MAAM;IAC9BE,QAAQ,CAACc,MAAM,CAAC;MACdC,aAAa,EAAE,IAAI;MACnBC,WAAW,EAAEA,CAACC,CAAS,EAAEd,KAAc,KAAK;QAC1CU,YAAY,CAACV,KAAK,EAAE,KAAK,CAAC;MAC5B;IACF,CAAC,CAAC;IAEF,OAAOJ,OAAO;EAChB,CAAC,CAAC;EAEFmB,UAAU,CAACC,gBAAgB,CAACN,YAAY,CAAC;EACzC;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;AACF,CAAC;AAACO,OAAA,CAAAT,qBAAA,GAAAA,qBAAA","ignoreList":[]}