@adadapted/react-native-sdk 3.2.0 → 3.3.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 (74) hide show
  1. package/android/.project +1 -1
  2. package/android/.settings/org.eclipse.buildship.core.prefs +2 -2
  3. package/android/bin/build.gradle +6 -5
  4. package/android/bin/gradle.properties +4 -4
  5. package/android/build.gradle +6 -5
  6. package/android/gradle.properties +3 -3
  7. package/android/src/main/AndroidManifest.xml +1 -3
  8. package/lib/commonjs/api/adadaptedApiRequests.js.map +1 -1
  9. package/lib/commonjs/api/adadaptedApiRequests.mock.js +25 -8
  10. package/lib/commonjs/api/adadaptedApiRequests.mock.js.map +1 -1
  11. package/lib/commonjs/api/adadaptedApiTypes.js +71 -26
  12. package/lib/commonjs/api/adadaptedApiTypes.js.map +1 -1
  13. package/lib/commonjs/components/AdZone.js +53 -14
  14. package/lib/commonjs/components/AdZone.js.map +1 -1
  15. package/lib/commonjs/components/ReportAdButton.js +38 -0
  16. package/lib/commonjs/components/ReportAdButton.js.map +1 -0
  17. package/lib/commonjs/images/ReportIcon.png +0 -0
  18. package/lib/commonjs/index.js +139 -89
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/types.js +4 -0
  21. package/lib/commonjs/types.js.map +1 -1
  22. package/lib/commonjs/util.js +13 -0
  23. package/lib/commonjs/util.js.map +1 -1
  24. package/lib/module/api/adadaptedApiRequests.js.map +1 -1
  25. package/lib/module/api/adadaptedApiRequests.mock.js +25 -9
  26. package/lib/module/api/adadaptedApiRequests.mock.js.map +1 -1
  27. package/lib/module/api/adadaptedApiTypes.js +69 -24
  28. package/lib/module/api/adadaptedApiTypes.js.map +1 -1
  29. package/lib/module/components/AdZone.js +49 -14
  30. package/lib/module/components/AdZone.js.map +1 -1
  31. package/lib/module/components/ReportAdButton.js +30 -0
  32. package/lib/module/components/ReportAdButton.js.map +1 -0
  33. package/lib/module/images/ReportIcon.png +0 -0
  34. package/lib/module/index.js +139 -88
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/types.js +1 -1
  37. package/lib/module/types.js.map +1 -1
  38. package/lib/module/util.js +14 -2
  39. package/lib/module/util.js.map +1 -1
  40. package/lib/typescript/example/index.d.ts +1 -0
  41. package/lib/typescript/example/index.d.ts.map +1 -0
  42. package/lib/typescript/example/src/App.d.ts +22 -2
  43. package/lib/typescript/example/src/App.d.ts.map +1 -0
  44. package/lib/typescript/example/src/OffScreenAdZone.d.ts +38 -0
  45. package/lib/typescript/example/src/OffScreenAdZone.d.ts.map +1 -0
  46. package/lib/typescript/example/src/StandardAdZone.d.ts +38 -0
  47. package/lib/typescript/example/src/StandardAdZone.d.ts.map +1 -0
  48. package/lib/typescript/index.d.ts +2 -0
  49. package/lib/typescript/index.d.ts.map +1 -0
  50. package/lib/typescript/jest.setup.d.ts +2 -1
  51. package/lib/typescript/jest.setup.d.ts.map +1 -0
  52. package/lib/typescript/src/api/adadaptedApiRequests.d.ts +1 -0
  53. package/lib/typescript/src/api/adadaptedApiRequests.d.ts.map +1 -0
  54. package/lib/typescript/src/api/adadaptedApiRequests.mock.d.ts +1 -0
  55. package/lib/typescript/src/api/adadaptedApiRequests.mock.d.ts.map +1 -0
  56. package/lib/typescript/src/api/adadaptedApiTypes.d.ts +1 -0
  57. package/lib/typescript/src/api/adadaptedApiTypes.d.ts.map +1 -0
  58. package/lib/typescript/src/components/AdZone.d.ts +5 -4
  59. package/lib/typescript/src/components/AdZone.d.ts.map +1 -0
  60. package/lib/typescript/src/components/ReportAdButton.d.ts +19 -0
  61. package/lib/typescript/src/components/ReportAdButton.d.ts.map +1 -0
  62. package/lib/typescript/src/index.d.ts +23 -6
  63. package/lib/typescript/src/index.d.ts.map +1 -0
  64. package/lib/typescript/src/types.d.ts +3 -2
  65. package/lib/typescript/src/types.d.ts.map +1 -0
  66. package/lib/typescript/src/util.d.ts +13 -0
  67. package/lib/typescript/src/util.d.ts.map +1 -0
  68. package/package.json +155 -155
  69. package/src/api/adadaptedApiRequests.mock.ts +25 -9
  70. package/src/components/AdZone.tsx +52 -20
  71. package/src/components/ReportAdButton.tsx +46 -0
  72. package/src/images/ReportIcon.png +0 -0
  73. package/src/index.tsx +134 -68
  74. package/src/util.ts +13 -0
@@ -65,7 +65,7 @@ export declare enum PayloadApiEnv {
65
65
  Mock = "MOCK_DATA"
66
66
  }
67
67
  /**
68
- * Interface defining inputs to the {@link Sdk.initialize} method.
68
+ * Interface defining inputs to the {@link Sdk.initialize: AdadaptedReactNativeSdk} method.
69
69
  */
70
70
  export interface InitializeProps {
71
71
  /**
@@ -107,9 +107,9 @@ export interface InitializeProps {
107
107
  */
108
108
  onOutOfAppPayloadAvailable?(payloads: OutOfAppDataPayload[]): void;
109
109
  /**
110
- * Change the optional ad zone visibility default setting.
110
+ * Ad zones that contain off-screen ads.
111
111
  */
112
- defaultToInvisibleAdZone?: boolean;
112
+ offScreenAdZone?: [number];
113
113
  }
114
114
  /**
115
115
  * Interface defining properties of a user's Device.
@@ -234,6 +234,10 @@ export declare class AdadaptedReactNativeSdk {
234
234
  * The available ad zones.
235
235
  */
236
236
  private adZones;
237
+ /**
238
+ * The available off-screen ad zones.
239
+ */
240
+ private offScreenAdZones;
237
241
  /**
238
242
  * The touch sensitivity of the Ad Zone in both the X and Y directions.
239
243
  * This is used to determine the click/press sensitivity when the
@@ -291,9 +295,9 @@ export declare class AdadaptedReactNativeSdk {
291
295
  */
292
296
  private isAdZoneVisible;
293
297
  /**
294
- * Optional default ad zone visibility for off-screen ads.
298
+ * Ad zones that contain off-screen ads..
295
299
  */
296
- private defaultAdZoneVisibility;
300
+ private offScreenAdZone;
297
301
  /**
298
302
  * Gets the Session ID.
299
303
  * @returns the Session ID.
@@ -309,6 +313,11 @@ export declare class AdadaptedReactNativeSdk {
309
313
  * @returns all available ad zones.
310
314
  */
311
315
  getAdZones(): AdZoneInfo[] | undefined;
316
+ /**
317
+ * Gets the list of available off-screen Ad Zones.
318
+ * @returns all available off-screen ad zones.
319
+ */
320
+ getOffScreenAdZones(): AdZoneInfo[] | undefined;
312
321
  /**
313
322
  * @inheritDoc
314
323
  */
@@ -324,6 +333,12 @@ export declare class AdadaptedReactNativeSdk {
324
333
  * @returns the array of Ad Zone Info objects.
325
334
  */
326
335
  private generateAdZones;
336
+ /**
337
+ * Creates all off-screen Ad Zone Info objects based on provided off-screen Ad Zones.
338
+ * @param adZones - The object of available zones.
339
+ * @returns the array of off-screen Ad Zone Info objects.
340
+ */
341
+ private generateOffScreenAdZones;
327
342
  /**
328
343
  * Triggered when session data is initialized or refreshed. Creates
329
344
  * a timer based on the session data refresh value.
@@ -371,8 +386,9 @@ export declare class AdadaptedReactNativeSdk {
371
386
  private getPayloadItemData;
372
387
  /**
373
388
  * Notify the ad zone of visibility status change for off-screen ads.
389
+ * @param isVisible - Ad Zone visibility tracking.
374
390
  */
375
- onAdZoneVisibilityChanged(): void;
391
+ onAdZoneVisibilityChanged(isVisible: boolean): void;
376
392
  /**
377
393
  * Notify the adZone to send ad interaction report.
378
394
  * @param itemName - Detailed list item title from ad that was clicked.
@@ -449,3 +465,4 @@ export declare class AdadaptedReactNativeSdk {
449
465
  */
450
466
  unmount(): void;
451
467
  }
468
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":";AAYA,OAAO,EAEH,gBAAgB,EAEhB,iBAAiB,EAIjB,mBAAmB,EAMtB,MAAM,yBAAyB,CAAC;AAMjC;;GAEG;AACH,oBAAY,QAAQ;IAChB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,GAAG,QAAQ;CACd;AAED;;GAEG;AACH,oBAAY,MAAM;IACd;;OAEG;IACH,IAAI,8BAA8B;IAClC;;OAEG;IACH,GAAG,kCAAkC;IACrC;;OAEG;IACH,IAAI,cAAc;CACrB;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB;;OAEG;IACH,IA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AiDpE;;;;;OAKG;IACI,sBAAsB,CACzB,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,CAAC,EAAE,MAAM,GAClB,IAAI;IAoBP;;;;;OAKG;IACI,yBAAyB,CAC5B,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,CAAC,EAAE,MAAM,GAClB,IAAI;IAoBP;;;;;OAKG;IACI,0BAA0B,CAC7B,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,CAAC,EAAE,MAAM,GAClB,IAAI;IAoBP;;;;OAIG;IACI,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAuB9D;;;;OAIG;IACI,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAuB1D;;;;OAIG;IACI,OAAO,IAAI,IAAI;CAazB"}
@@ -2,9 +2,10 @@ import * as React from "react";
2
2
  /**
3
3
  * A type that can be null or undefined.
4
4
  */
5
- export declare type nil = null | undefined;
5
+ export type nil = null | undefined;
6
6
  /**
7
7
  * Extracts the type of a React component's props from the React component type T.
8
8
  * Usage example: type MyComponentProps = ExtractReactPropsType<typeof MyComponent>;
9
9
  */
10
- export declare type ExtractReactPropsType<T> = T extends React.ComponentType<infer P> ? P : T extends React.Component<infer P> ? P : never;
10
+ export type ExtractReactPropsType<T> = T extends React.ComponentType<infer P> ? P : T extends React.Component<infer P> ? P : never;
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnC;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GACvE,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAClC,CAAC,GACD,KAAK,CAAC"}
@@ -13,6 +13,8 @@ export declare function safeInvoke<R>(func: (() => R) | nil): R | undefined;
13
13
  * See main definition above.
14
14
  * @param func - The function to call.
15
15
  * @param arg1 - Function argument.
16
+ * @returns The return value of the executed function, or undefined if
17
+ * the function is null/undefined
16
18
  */
17
19
  export declare function safeInvoke<A1, R>(func: ((arg1: A1) => R) | nil, arg1: NoInfer<A1>): R | undefined;
18
20
  /**
@@ -20,6 +22,8 @@ export declare function safeInvoke<A1, R>(func: ((arg1: A1) => R) | nil, arg1: N
20
22
  * @param func - The function to call.
21
23
  * @param arg1 - Function argument.
22
24
  * @param arg2 - Function argument.
25
+ * @returns The return value of the executed function, or undefined if
26
+ * the function is null/undefined
23
27
  */
24
28
  export declare function safeInvoke<A1, A2, R>(func: ((arg1: A1, arg2: A2) => R) | nil, arg1: NoInfer<A1>, arg2: NoInfer<A2>): R | undefined;
25
29
  /**
@@ -28,6 +32,8 @@ export declare function safeInvoke<A1, A2, R>(func: ((arg1: A1, arg2: A2) => R)
28
32
  * @param arg1 - Function argument.
29
33
  * @param arg2 - Function argument.
30
34
  * @param arg3 - Function argument.
35
+ * @returns The return value of the executed function, or undefined if
36
+ * the function is null/undefined
31
37
  */
32
38
  export declare function safeInvoke<A1, A2, A3, R>(func: ((arg1: A1, arg2: A2, arg3: A3) => R) | nil, arg1: NoInfer<A1>, arg2: NoInfer<A2>, arg3: NoInfer<A3>): R | undefined;
33
39
  /**
@@ -37,6 +43,8 @@ export declare function safeInvoke<A1, A2, A3, R>(func: ((arg1: A1, arg2: A2, ar
37
43
  * @param arg2 - Function argument.
38
44
  * @param arg3 - Function argument.
39
45
  * @param arg4 - Function argument.
46
+ * @returns The return value of the executed function, or undefined if
47
+ * the function is null/undefined
40
48
  */
41
49
  export declare function safeInvoke<A1, A2, A3, A4, R>(func: ((arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R) | nil, arg1: NoInfer<A1>, arg2: NoInfer<A2>, arg3: NoInfer<A3>, arg4: NoInfer<A4>): R | undefined;
42
50
  /**
@@ -47,6 +55,8 @@ export declare function safeInvoke<A1, A2, A3, A4, R>(func: ((arg1: A1, arg2: A2
47
55
  * @param arg3 - Function argument.
48
56
  * @param arg4 - Function argument.
49
57
  * @param arg5 - Function argument.
58
+ * @returns The return value of the executed function, or undefined if
59
+ * the function is null/undefined
50
60
  */
51
61
  export declare function safeInvoke<A1, A2, A3, A4, A5, R>(func: ((arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R) | nil, arg1: NoInfer<A1>, arg2: NoInfer<A2>, arg3: NoInfer<A3>, arg4: NoInfer<A4>, arg5: NoInfer<A5>): R | undefined;
52
62
  /**
@@ -58,5 +68,8 @@ export declare function safeInvoke<A1, A2, A3, A4, A5, R>(func: ((arg1: A1, arg2
58
68
  * @param arg4 - Function argument.
59
69
  * @param arg5 - Function argument.
60
70
  * @param arg6 - Function argument.
71
+ * @returns The return value of the executed function, or undefined if
72
+ * the function is null/undefined
61
73
  */
62
74
  export declare function safeInvoke<A1, A2, A3, A4, A5, A6, R>(func: ((arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, arg6: A6) => R) | nil, arg1: NoInfer<A1>, arg2: NoInfer<A2>, arg3: NoInfer<A3>, arg4: NoInfer<A4>, arg5: NoInfer<A5>, arg6: NoInfer<A6>): R | undefined;
75
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,SAAS,CAAC;AACpE;;;;;;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ED
@@ -1,164 +1,164 @@
1
1
  {
2
- "name": "@adadapted/react-native-sdk",
3
- "version": "3.2.0",
4
- "description": "The AdAdapted react-native SDK.",
5
- "main": "lib/commonjs/index.js",
6
- "module": "lib/module/index.js",
7
- "types": "lib/typescript/src/index.d.ts",
8
- "react-native": "src/index.tsx",
9
- "files": [
10
- "src",
11
- "lib",
12
- "android",
13
- "ios",
14
- "adadapted-react-native-sdk.podspec"
2
+ "name": "@adadapted/react-native-sdk",
3
+ "version": "3.3.0",
4
+ "description": "The AdAdapted react-native SDK.",
5
+ "main": "lib/commonjs/index.js",
6
+ "module": "lib/module/index.js",
7
+ "types": "lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index.tsx",
9
+ "files": [
10
+ "src",
11
+ "lib",
12
+ "!**/__tests__",
13
+ "!**/__fixtures__",
14
+ "!**/__mocks__",
15
+ "android/",
16
+ "ios/",
17
+ "adadapted-react-native-sdk.podspec"
18
+ ],
19
+ "scripts": {
20
+ "prettier-fix": "prettier --write \"*.{ts,tsx,js,jsx,json,css,scss,md}\" \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\" \"example/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
21
+ "lint": "eslint --version && eslint ./",
22
+ "compile": "tsc --version && tsc --project tsconfig.json --noEmit --noErrorTruncation --pretty",
23
+ "test-coverage": "rm -rf coverage && jest --version --clearCache && jest --coverage --clearCache",
24
+ "enable-git-hooks": "git config core.hooksPath .git-hooks",
25
+ "test": "jest --version --clearCache && jest",
26
+ "prettier": "prettier --list-different \"*.{ts,tsx,js,jsx,json,css,scss,md}\" \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
27
+ "prepack": "bob build",
28
+ "example-app-install-pods": "cd example/ios && pod install",
29
+ "npm-check-outdated": "npm outdated",
30
+ "check-peer-dependencies": "npx check-peer-dependencies --npm",
31
+ "prepare": "bob build"
32
+ },
33
+ "keywords": [
34
+ "react-native",
35
+ "ios",
36
+ "android",
37
+ "adadapted",
38
+ "sdk",
39
+ "ad",
40
+ "ads"
41
+ ],
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://gitlab.com/adadapted/adadapted-react-native-sdk"
45
+ },
46
+ "author": "Jeramy Usher <jusher@adadapted.com> (https://gitlab.com/adadapted/adadapted-react-native-sdk)",
47
+ "license": "AdAdapted Platform License",
48
+ "bugs": {
49
+ "url": "https://gitlab.com/adadapted/adadapted-react-native-sdk/issues"
50
+ },
51
+ "homepage": "https://gitlab.com/adadapted/adadapted-react-native-sdk#readme",
52
+ "dependencies": {
53
+ "@react-native-community/eslint-config": "^3.2.0",
54
+ "axios": "1.4.0",
55
+ "react-native-base64": "0.2.1",
56
+ "type-zoo": "3.4.1"
57
+ },
58
+ "peerDependencies": {
59
+ "react": "*",
60
+ "react-native": "*",
61
+ "react-native-webview": "*"
62
+ },
63
+ "devDependencies": {
64
+ "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
65
+ "@babel/plugin-transform-typescript": "7.22.5",
66
+ "@babel/preset-env": "7.22.5",
67
+ "@babel/preset-react": "7.22.5",
68
+ "@babel/preset-typescript": "7.22.5",
69
+ "@types/jest": "29.5.2",
70
+ "@types/react": "18.2.12",
71
+ "@types/react-dom": "18.2.6",
72
+ "@types/react-native": "0.72.2",
73
+ "@types/react-native-base64": "0.2.0",
74
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
75
+ "@typescript-eslint/parser": "5.60.0",
76
+ "eslint": "^8.44.0",
77
+ "eslint-config-standard-with-typescript": "^36.0.0",
78
+ "eslint-plugin-import": "^2.27.5",
79
+ "eslint-plugin-jest": "27.2.2",
80
+ "eslint-plugin-jsdoc": "46.2.6",
81
+ "eslint-plugin-n": "^15.7.0",
82
+ "eslint-plugin-prefer-arrow": "1.2.3",
83
+ "eslint-plugin-promise": "^6.1.1",
84
+ "eslint-plugin-react": "^7.32.2",
85
+ "eslint-plugin-react-native": "^4.0.0",
86
+ "jest": "29.5.0",
87
+ "prettier": "2.8.8",
88
+ "react": "18.2.0",
89
+ "react-native": "0.72.0",
90
+ "react-native-builder-bob": "^0.23.2",
91
+ "react-native-webview": "13.2.2",
92
+ "react-router-native": "6.14.0",
93
+ "ts-jest": "29.1.0",
94
+ "typescript": "^5.0.4"
95
+ },
96
+ "jest": {
97
+ "preset": "react-native",
98
+ "modulePathIgnorePatterns": [
99
+ "<rootDir>/example/node_modules",
100
+ "<rootDir>/lib/"
15
101
  ],
16
- "scripts": {
17
- "prettier-fix": "prettier --write \"*.{ts,tsx,js,jsx,json,css,scss,md}\" \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\" \"example/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
18
- "lint": "eslint --version && eslint ./",
19
- "compile": "tsc --version && tsc --project tsconfig.json --noEmit --noErrorTruncation --pretty",
20
- "test-coverage": "rm -rf coverage && jest --version --clearCache && jest --coverage --clearCache",
21
- "enable-git-hooks": "git config core.hooksPath .git-hooks",
22
- "test": "jest --version --clearCache && jest",
23
- "prettier": "prettier --list-different \"*.{ts,tsx,js,jsx,json,css,scss,md}\" \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
24
- "prepare-build": "bob build",
25
- "example-app-install-pods": "cd example/ios && pod install",
26
- "npm-check-outdated": "npm outdated",
27
- "check-peer-dependencies": "npx check-peer-dependencies --npm"
28
- },
29
- "keywords": [
30
- "react-native",
31
- "ios",
32
- "android",
33
- "adadapted",
34
- "sdk",
35
- "ad",
36
- "ads"
102
+ "setupFiles": [
103
+ "<rootDir>/jest.setup.ts"
37
104
  ],
38
- "repository": {
39
- "type": "git",
40
- "url": "https://gitlab.com/adadapted/adadapted-react-native-sdk"
41
- },
42
- "author": "Jeramy Usher <jusher@adadapted.com> (https://gitlab.com/adadapted/adadapted-react-native-sdk)",
43
- "license": "AdAdapted Platform License",
44
- "bugs": {
45
- "url": "https://gitlab.com/adadapted/adadapted-react-native-sdk/issues"
46
- },
47
- "homepage": "https://gitlab.com/adadapted/adadapted-react-native-sdk#readme",
48
- "dependencies": {
49
- "axios": "^0.21.1",
50
- "react-native-base64": "^0.2.1",
51
- "type-zoo": "^3.4.1"
52
- },
53
- "peerDependencies": {
54
- "react": "*",
55
- "react-native": "*",
56
- "react-native-webview": "*"
105
+ "transform": {
106
+ "^.+\\.[j|t]sx?$": "ts-jest"
57
107
  },
58
- "devDependencies": {
59
- "@babel/plugin-transform-typescript": "^7.12.1",
60
- "@babel/preset-env": "^7.12.7",
61
- "@babel/preset-react": "^7.12.7",
62
- "@babel/preset-typescript": "^7.12.7",
63
- "@react-native-community/bob": "^0.17.1",
64
- "@types/enzyme": "3.10.8",
65
- "@types/enzyme-adapter-react-16": "^1.0.6",
66
- "@types/jest": "^26.0.20",
67
- "@types/react": "17.0.2",
68
- "@types/react-dom": "17.0.2",
69
- "@types/react-native": "0.65.0",
70
- "@types/react-native-base64": "^0.1.0",
71
- "@types/react-router-native": "^5.1.0",
72
- "@typescript-eslint/eslint-plugin": "^4.13.0",
73
- "@typescript-eslint/eslint-plugin-tslint": "^4.13.0",
74
- "@typescript-eslint/parser": "^4.13.0",
75
- "enzyme": "^3.11.0",
76
- "enzyme-to-json": "^3.6.1",
77
- "eslint": "^7.17.0",
78
- "eslint-plugin-import": "^2.22.1",
79
- "eslint-plugin-jest": "^24.1.3",
80
- "eslint-plugin-jsdoc": "^31.0.3",
81
- "eslint-plugin-prefer-arrow": "^1.2.2",
82
- "eslint-plugin-react": "^7.22.0",
83
- "jest": "^26.6.3",
84
- "jest-enzyme": "7.1.2",
85
- "prettier": "^2.2.1",
86
- "react": "17.0.2",
87
- "react-native": "0.65.0",
88
- "react-router-native": "^5.2.0",
89
- "react-native-webview": "11.23.1",
90
- "ts-jest": "^26.4.4",
91
- "tslint": "^6.1.3",
92
- "typescript": "^4.1.3"
108
+ "transformIgnorePatterns": [
109
+ "/node_modules/(?!react-native)/.+"
110
+ ],
111
+ "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
112
+ "moduleFileExtensions": [
113
+ "ts",
114
+ "tsx",
115
+ "js",
116
+ "jsx",
117
+ "json"
118
+ ],
119
+ "modulePaths": [
120
+ "<rootDir>/node_modules"
121
+ ],
122
+ "moduleNameMapper": {
123
+ "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
124
+ "\\.(s?css)$": "<rootDir>/__mocks__/styleMock.js",
125
+ "^src/(.*)$": "<rootDir>/src/$1"
93
126
  },
94
- "jest": {
95
- "preset": "react-native",
96
- "modulePathIgnorePatterns": [
97
- "<rootDir>/example/node_modules",
98
- "<rootDir>/lib/"
99
- ],
100
- "snapshotSerializers": [
101
- "enzyme-to-json/serializer"
102
- ],
103
- "setupFiles": [
104
- "<rootDir>/jest.setup.ts"
105
- ],
106
- "transform": {
107
- "^.+\\.[j|t]sx?$": "ts-jest"
108
- },
109
- "transformIgnorePatterns": [
110
- "/node_modules/(?!react-native)/.+"
111
- ],
112
- "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
113
- "moduleFileExtensions": [
114
- "ts",
115
- "tsx",
116
- "js",
117
- "jsx",
118
- "json"
119
- ],
120
- "modulePaths": [
121
- "<rootDir>/node_modules"
122
- ],
123
- "moduleNameMapper": {
124
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
125
- "\\.(s?css)$": "<rootDir>/__mocks__/styleMock.js",
126
- "^src/(.*)$": "<rootDir>/src/$1"
127
- },
128
- "collectCoverage": false,
129
- "coverageDirectory": "coverage",
130
- "collectCoverageFrom": [
131
- "src/**/*.{js,jsx,ts,tsx}",
132
- "!src/api/**/*.*",
133
- "!src/**/*.d.ts",
134
- "!src/index.tsx"
135
- ],
136
- "coverageThreshold": {
137
- "global": {
138
- "branches": 5,
139
- "functions": 5,
140
- "lines": 5,
141
- "statements": 5
142
- }
143
- },
144
- "watchPathIgnorePatterns": [
145
- "<rootDir>/jest.json"
146
- ],
147
- "globals": {
148
- "BUILD_ENV": "dev"
149
- }
127
+ "collectCoverage": false,
128
+ "coverageDirectory": "coverage",
129
+ "collectCoverageFrom": [
130
+ "src/**/*.{js,jsx,ts,tsx}",
131
+ "!src/api/**/*.*",
132
+ "!src/**/*.d.ts",
133
+ "!src/index.tsx"
134
+ ],
135
+ "coverageThreshold": {
136
+ "global": {
137
+ "branches": 5,
138
+ "functions": 5,
139
+ "lines": 5,
140
+ "statements": 5
141
+ }
150
142
  },
151
- "tslintIgnore": [
152
- "node_modules/",
153
- "lib/"
143
+ "watchPathIgnorePatterns": [
144
+ "<rootDir>/jest.json"
154
145
  ],
155
- "@react-native-community/bob": {
156
- "source": "src",
157
- "output": "lib",
158
- "targets": [
159
- "commonjs",
160
- "module",
161
- "typescript"
162
- ]
146
+ "globals": {
147
+ "BUILD_ENV": "dev"
163
148
  }
149
+ },
150
+ "eslintIgnore": [
151
+ "node_modules/",
152
+ "lib/"
153
+ ],
154
+ "source": "src/index.tsx",
155
+ "react-native-builder-bob": {
156
+ "source": "src",
157
+ "output": "lib",
158
+ "targets": [
159
+ "commonjs",
160
+ "module",
161
+ "typescript"
162
+ ]
163
+ }
164
164
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Contains all API request mocks for the Rewards API.
3
3
  */
4
- import { AxiosResponse } from "axios";
4
+ import { AxiosHeaders, AxiosResponse } from "axios";
5
5
  import {
6
6
  AdActionType,
7
7
  AdSession,
@@ -25,7 +25,9 @@ export function initializeSession(): Promise<
25
25
  resolve({
26
26
  data: AD_SESSION_DATA,
27
27
  then: undefined,
28
- config: {},
28
+ config: {
29
+ headers: new AxiosHeaders(),
30
+ },
29
31
  headers: {},
30
32
  status: 200,
31
33
  statusText: "200",
@@ -44,7 +46,9 @@ export function refreshSessionData(): Promise<
44
46
  resolve({
45
47
  data: REFRESHED_AD_SESSION_DATA,
46
48
  then: undefined,
47
- config: {},
49
+ config: {
50
+ headers: new AxiosHeaders(),
51
+ },
48
52
  headers: {},
49
53
  status: 200,
50
54
  statusText: "200",
@@ -63,7 +67,9 @@ export function reportAdEvent(): Promise<AxiosResponse<ReportAdEventResponse>> {
63
67
  results: ["Ok"],
64
68
  },
65
69
  then: undefined,
66
- config: {},
70
+ config: {
71
+ headers: new AxiosHeaders(),
72
+ },
67
73
  headers: {},
68
74
  status: 200,
69
75
  statusText: "200",
@@ -82,7 +88,9 @@ export function getKeywordIntercepts(): Promise<
82
88
  resolve({
83
89
  data: KEYWORD_INTERCEPT_DATA,
84
90
  then: undefined,
85
- config: {},
91
+ config: {
92
+ headers: new AxiosHeaders(),
93
+ },
86
94
  headers: {},
87
95
  status: 200,
88
96
  statusText: "200",
@@ -104,7 +112,9 @@ export function reportInterceptEvent(): Promise<
104
112
  results: ["Ok"],
105
113
  },
106
114
  then: undefined,
107
- config: {},
115
+ config: {
116
+ headers: new AxiosHeaders(),
117
+ },
108
118
  headers: {},
109
119
  status: 200,
110
120
  statusText: "200",
@@ -122,7 +132,9 @@ export function reportListManagerEvents(): Promise<AxiosResponse<void>> {
122
132
  resolve({
123
133
  data: undefined,
124
134
  then: undefined,
125
- config: {},
135
+ config: {
136
+ headers: new AxiosHeaders(),
137
+ },
126
138
  headers: {},
127
139
  status: 200,
128
140
  statusText: "200",
@@ -139,7 +151,9 @@ export function reportPayloadContentStatus(): Promise<AxiosResponse<void>> {
139
151
  resolve({
140
152
  data: undefined,
141
153
  then: undefined,
142
- config: {},
154
+ config: {
155
+ headers: new AxiosHeaders(),
156
+ },
143
157
  headers: {},
144
158
  status: 200,
145
159
  statusText: "200",
@@ -176,7 +190,9 @@ export function retrievePayloadContent(): Promise<
176
190
  ],
177
191
  },
178
192
  then: undefined,
179
- config: {},
193
+ config: {
194
+ headers: new AxiosHeaders(),
195
+ },
180
196
  headers: {},
181
197
  status: 200,
182
198
  statusText: "200",