@snowplow/react-native-tracker 1.3.0 → 2.0.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 (240) hide show
  1. package/.editorconfig +15 -0
  2. package/.eslintignore +6 -0
  3. package/.gitattributes +3 -0
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. package/.github/actions/setup/action.yml +28 -0
  7. package/.github/workflows/build.yml +150 -0
  8. package/.github/workflows/deploy.yml +98 -0
  9. package/.github/workflows/e2e-android.yml +121 -0
  10. package/.github/workflows/e2e-ios.yml +90 -0
  11. package/.github/workflows/snyk.yml +21 -0
  12. package/.gitignore +70 -0
  13. package/.npmignore +60 -0
  14. package/.nvmrc +1 -0
  15. package/.watchmanconfig +1 -0
  16. package/.yarnrc +3 -0
  17. package/CHANGELOG +166 -0
  18. package/CONTRIBUTING.md +80 -0
  19. package/LICENSE +1 -1
  20. package/README.md +24 -111
  21. package/android/build.gradle +93 -37
  22. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  23. package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
  24. package/android/gradle.properties +5 -2
  25. package/android/gradlew +172 -110
  26. package/android/gradlew.bat +24 -19
  27. package/android/src/main/AndroidManifest.xml +1 -3
  28. package/android/src/main/AndroidManifestNew.xml +2 -0
  29. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +704 -0
  30. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +17 -0
  31. package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +271 -0
  32. package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +213 -0
  33. package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +5 -0
  34. package/babel.config.js +3 -0
  35. package/example/.watchmanconfig +1 -0
  36. package/example/Gemfile +6 -0
  37. package/example/android/app/build.gradle +129 -0
  38. package/example/android/app/debug.keystore +0 -0
  39. package/example/android/app/proguard-rules.pro +10 -0
  40. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +36 -0
  41. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +21 -0
  42. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  43. package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +75 -0
  44. package/example/android/app/src/main/AndroidManifest.xml +26 -0
  45. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +32 -0
  46. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +62 -0
  47. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  48. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  49. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  50. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  51. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  52. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  53. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  54. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  55. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  56. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  57. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  58. package/example/android/app/src/main/res/values/strings.xml +3 -0
  59. package/example/android/app/src/main/res/values/styles.xml +9 -0
  60. package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +20 -0
  61. package/example/android/build.gradle +31 -0
  62. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  63. package/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  64. package/example/android/gradle.properties +44 -0
  65. package/example/android/gradlew +244 -0
  66. package/example/android/gradlew.bat +92 -0
  67. package/example/android/settings.gradle +4 -0
  68. package/example/app.json +4 -0
  69. package/example/babel.config.js +17 -0
  70. package/example/detox.config.js +92 -0
  71. package/example/e2e/config.json +10 -0
  72. package/example/e2e/emitEvents.e2e.detox.js +108 -0
  73. package/example/e2e/environment.js +23 -0
  74. package/example/e2e/helpers/microCommands.js +153 -0
  75. package/example/e2e/helpers/microHelpers.js +346 -0
  76. package/example/e2e/helpers/microHelpers.test.js +308 -0
  77. package/example/e2e/helpers/schemas.js +62 -0
  78. package/example/e2e/jest.config.js +16 -0
  79. package/example/e2e/setup.js +4 -0
  80. package/example/e2e/testEvents.micro.test.js +300 -0
  81. package/example/index.js +5 -0
  82. package/example/ios/.xcode.env +11 -0
  83. package/example/ios/Podfile +64 -0
  84. package/example/ios/Podfile.lock +737 -0
  85. package/example/ios/ReactNativeTrackerExample/AppDelegate.h +6 -0
  86. package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +26 -0
  87. package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  88. package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +6 -0
  89. package/example/ios/ReactNativeTrackerExample/Info.plist +55 -0
  90. package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +47 -0
  91. package/example/ios/ReactNativeTrackerExample/main.m +10 -0
  92. package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +3 -0
  93. package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +722 -0
  94. package/{ios/RNSnowplowTracker.xcodeproj/xcshareddata/xcschemes/RNSnowplowTracker.xcscheme → example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme} +29 -21
  95. package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +10 -0
  96. package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  97. package/example/ios/ReactNativeTrackerExampleTests/Info.plist +24 -0
  98. package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +66 -0
  99. package/example/metro.config.js +45 -0
  100. package/example/package.json +54 -0
  101. package/example/react-native.config.js +10 -0
  102. package/example/src/App.js +557 -0
  103. package/example/tsconfig.json +5 -0
  104. package/example/yarn.lock +7379 -0
  105. package/ios/ReactNativeTracker-Bridging-Header.h +2 -0
  106. package/ios/ReactNativeTracker.mm +165 -0
  107. package/ios/ReactNativeTracker.swift +757 -0
  108. package/ios/{RNSnowplowTracker.xcodeproj → ReactNativeTracker.xcodeproj}/project.pbxproj +55 -79
  109. package/ios/Util/ConfigUtils.swift +206 -0
  110. package/ios/Util/TrackerVersion.swift +3 -0
  111. package/ios/Util/Utilities.swift +37 -0
  112. package/lefthook.yml +11 -0
  113. package/lib/commonjs/api.js +475 -0
  114. package/lib/commonjs/api.js.map +1 -0
  115. package/lib/commonjs/configurations.js +209 -0
  116. package/lib/commonjs/configurations.js.map +1 -0
  117. package/lib/commonjs/constants.js +85 -0
  118. package/lib/commonjs/constants.js.map +1 -0
  119. package/lib/commonjs/events.js +256 -0
  120. package/lib/commonjs/events.js.map +1 -0
  121. package/lib/commonjs/index.js +141 -0
  122. package/lib/commonjs/index.js.map +1 -0
  123. package/lib/commonjs/jsCore.js +393 -0
  124. package/lib/commonjs/jsCore.js.map +1 -0
  125. package/lib/commonjs/native.js +29 -0
  126. package/lib/commonjs/native.js.map +1 -0
  127. package/lib/commonjs/subject.js +248 -0
  128. package/lib/commonjs/subject.js.map +1 -0
  129. package/lib/commonjs/tracker.js +221 -0
  130. package/lib/commonjs/tracker.js.map +1 -0
  131. package/lib/commonjs/types.js +2 -0
  132. package/lib/commonjs/types.js.map +1 -0
  133. package/lib/commonjs/utils.js +85 -0
  134. package/lib/commonjs/utils.js.map +1 -0
  135. package/lib/commonjs/webViewInterface.js +79 -0
  136. package/lib/commonjs/webViewInterface.js.map +1 -0
  137. package/lib/module/api.js +439 -0
  138. package/lib/module/api.js.map +1 -0
  139. package/lib/module/configurations.js +197 -0
  140. package/lib/module/configurations.js.map +1 -0
  141. package/lib/module/constants.js +80 -0
  142. package/lib/module/constants.js.map +1 -0
  143. package/lib/module/events.js +240 -0
  144. package/lib/module/events.js.map +1 -0
  145. package/lib/module/index.js +129 -0
  146. package/lib/module/index.js.map +1 -0
  147. package/lib/module/jsCore.js +390 -0
  148. package/lib/module/jsCore.js.map +1 -0
  149. package/lib/module/native.js +25 -0
  150. package/lib/module/native.js.map +1 -0
  151. package/lib/module/subject.js +235 -0
  152. package/lib/module/subject.js.map +1 -0
  153. package/lib/module/tracker.js +209 -0
  154. package/lib/module/tracker.js.map +1 -0
  155. package/lib/module/types.js +2 -0
  156. package/lib/module/types.js.map +1 -0
  157. package/lib/module/utils.js +79 -0
  158. package/lib/module/utils.js.map +1 -0
  159. package/lib/module/webViewInterface.js +75 -0
  160. package/lib/module/webViewInterface.js.map +1 -0
  161. package/lib/typescript/__tests__/api.test.d.ts +2 -0
  162. package/lib/typescript/__tests__/api.test.d.ts.map +1 -0
  163. package/lib/typescript/__tests__/configurations.test.d.ts +2 -0
  164. package/lib/typescript/__tests__/configurations.test.d.ts.map +1 -0
  165. package/lib/typescript/__tests__/events.test.d.ts +2 -0
  166. package/lib/typescript/__tests__/events.test.d.ts.map +1 -0
  167. package/lib/typescript/__tests__/index.test.d.ts +2 -0
  168. package/lib/typescript/__tests__/index.test.d.ts.map +1 -0
  169. package/lib/typescript/__tests__/jsCore.test.d.ts +2 -0
  170. package/lib/typescript/__tests__/jsCore.test.d.ts.map +1 -0
  171. package/lib/typescript/__tests__/utils.test.d.ts +2 -0
  172. package/lib/typescript/__tests__/utils.test.d.ts.map +1 -0
  173. package/lib/typescript/api.d.ts +226 -0
  174. package/lib/typescript/api.d.ts.map +1 -0
  175. package/lib/typescript/configurations.d.ts +73 -0
  176. package/lib/typescript/configurations.d.ts.map +1 -0
  177. package/lib/typescript/constants.d.ts +59 -0
  178. package/lib/typescript/constants.d.ts.map +1 -0
  179. package/lib/typescript/events.d.ts +101 -0
  180. package/lib/typescript/events.d.ts.map +1 -0
  181. package/lib/typescript/index.d.ts +27 -0
  182. package/lib/typescript/index.d.ts.map +1 -0
  183. package/lib/typescript/jsCore.d.ts +140 -0
  184. package/lib/typescript/jsCore.d.ts.map +1 -0
  185. package/lib/typescript/native.d.ts +4 -0
  186. package/lib/typescript/native.d.ts.map +1 -0
  187. package/lib/typescript/subject.d.ts +91 -0
  188. package/lib/typescript/subject.d.ts.map +1 -0
  189. package/lib/typescript/tracker.d.ts +93 -0
  190. package/lib/typescript/tracker.d.ts.map +1 -0
  191. package/{dist/index.d.ts → lib/typescript/types.d.ts} +188 -75
  192. package/lib/typescript/types.d.ts.map +1 -0
  193. package/lib/typescript/utils.d.ts +35 -0
  194. package/lib/typescript/utils.d.ts.map +1 -0
  195. package/lib/typescript/webViewInterface.d.ts +15 -0
  196. package/lib/typescript/webViewInterface.d.ts.map +1 -0
  197. package/package.json +138 -51
  198. package/scripts/bootstrap.js +29 -0
  199. package/snowplow-react-native-tracker.podspec +42 -0
  200. package/src/__mocks__/react-native.js +7 -0
  201. package/src/__tests__/api.test.ts +34 -0
  202. package/src/__tests__/configurations.test.ts +620 -0
  203. package/src/__tests__/events.test.ts +749 -0
  204. package/src/__tests__/index.test.ts +27 -0
  205. package/src/__tests__/jsCore.test.ts +169 -0
  206. package/src/__tests__/utils.test.ts +23 -0
  207. package/src/api.ts +535 -0
  208. package/src/configurations.ts +337 -0
  209. package/src/constants.ts +102 -0
  210. package/src/events.ts +330 -0
  211. package/src/index.ts +189 -0
  212. package/src/jsCore.ts +553 -0
  213. package/src/native.ts +34 -0
  214. package/src/subject.ts +315 -0
  215. package/src/tracker.ts +330 -0
  216. package/src/types.ts +1087 -0
  217. package/src/utils.ts +78 -0
  218. package/src/webViewInterface.ts +105 -0
  219. package/tsconfig.build.json +5 -0
  220. package/tsconfig.json +28 -0
  221. package/turbo.json +34 -0
  222. package/yarn.lock +9333 -0
  223. package/RNSnowplowTracker.podspec +0 -24
  224. package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerModule.java +0 -750
  225. package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerPackage.java +0 -29
  226. package/android/src/main/java/com/snowplowanalytics/react/util/ConfigUtil.java +0 -351
  227. package/android/src/main/java/com/snowplowanalytics/react/util/EventUtil.java +0 -339
  228. package/android/src/main/java/com/snowplowanalytics/react/util/TrackerVersion.java +0 -7
  229. package/dist/index.js +0 -1650
  230. package/dist/index.js.map +0 -1
  231. package/ios/RNSnowplowTracker.h +0 -34
  232. package/ios/RNSnowplowTracker.m +0 -911
  233. package/ios/Util/NSDictionary+RNSP_TypeMethods.h +0 -33
  234. package/ios/Util/NSDictionary+RNSP_TypeMethods.m +0 -40
  235. package/ios/Util/RNConfigUtils.h +0 -44
  236. package/ios/Util/RNConfigUtils.m +0 -209
  237. package/ios/Util/RNTrackerVersion.h +0 -27
  238. package/ios/Util/RNTrackerVersion.m +0 -27
  239. package/ios/Util/RNUtilities.h +0 -32
  240. package/ios/Util/RNUtilities.m +0 -68
@@ -1,35 +1,35 @@
1
1
  /**
2
2
  * HttpMethod type
3
3
  */
4
- declare type HttpMethod = 'post' | 'get';
4
+ export type HttpMethod = 'post' | 'get';
5
5
  /**
6
6
  * DevicePlatform type
7
7
  */
8
- declare type DevicePlatform = 'web' | 'mob' | 'pc' | 'srv' | 'app' | 'tv' | 'cnsl' | 'iot';
8
+ export type DevicePlatform = 'web' | 'mob' | 'pc' | 'srv' | 'app' | 'tv' | 'cnsl' | 'iot';
9
9
  /**
10
10
  * LogLevel type
11
11
  */
12
- declare type LogLevel = 'off' | 'error' | 'debug' | 'verbose';
12
+ export type LogLevel = 'off' | 'error' | 'debug' | 'verbose';
13
13
  /**
14
14
  * BasisForProsessing
15
15
  */
16
- declare type Basis = 'consent' | 'contract' | 'legal_obligation' | 'legitimate_interests' | 'public_task' | 'vital_interests';
16
+ export type Basis = 'consent' | 'contract' | 'legal_obligation' | 'legitimate_interests' | 'public_task' | 'vital_interests';
17
17
  /**
18
18
  * BufferOption
19
19
  */
20
- declare type BufferOption = 'single' | 'default' | 'large';
20
+ export type BufferOption = 'single' | 'default' | 'large';
21
21
  /**
22
22
  * Trigger for MessageNotification event
23
23
  */
24
- declare type Trigger = 'push' | 'location' | 'calendar' | 'timeInterval' | 'other';
24
+ export type Trigger = 'push' | 'location' | 'calendar' | 'timeInterval' | 'other';
25
25
  /**
26
26
  * ScreenSize
27
27
  */
28
- declare type ScreenSize = [number, number];
28
+ export type ScreenSize = [number, number];
29
29
  /**
30
30
  * SelfDescribing type
31
31
  */
32
- declare type SelfDescribing<T extends Record<keyof T, unknown> = Record<string, unknown>> = {
32
+ export type SelfDescribing<T extends Record<keyof T, unknown> = Record<string, unknown>> = {
33
33
  /**
34
34
  * Schema
35
35
  */
@@ -42,11 +42,11 @@ declare type SelfDescribing<T extends Record<keyof T, unknown> = Record<string,
42
42
  /**
43
43
  * EventContext type
44
44
  */
45
- declare type EventContext = SelfDescribing;
45
+ export type EventContext = SelfDescribing;
46
46
  /**
47
47
  * NetworkConfiguration
48
48
  */
49
- interface NetworkConfiguration {
49
+ export interface NetworkConfiguration {
50
50
  /**
51
51
  * The collector endpoint
52
52
  * - if the protocol is not included it defaults to https
@@ -72,7 +72,7 @@ interface NetworkConfiguration {
72
72
  /**
73
73
  * TrackerConfiguration
74
74
  */
75
- interface TrackerConfiguration {
75
+ export interface TrackerConfiguration {
76
76
  /**
77
77
  * Identifier of the app.
78
78
  */
@@ -123,8 +123,10 @@ interface TrackerConfiguration {
123
123
  */
124
124
  screenContext?: boolean;
125
125
  /**
126
- * Whether enable automatic tracking of ScreenView events.
127
- * @defaultValue true
126
+ * Whether to enable automatic tracking of ScreenView events from the native side.
127
+ * Only tracking UIKit views on iOS and Activity on Android are supported.
128
+ * For tracking React Native views, see the tracker docs for manual and auto-tracking options.
129
+ * @defaultValue false
128
130
  */
129
131
  screenViewAutotracking?: boolean;
130
132
  /**
@@ -156,7 +158,7 @@ interface TrackerConfiguration {
156
158
  /**
157
159
  * SessionConfiguration
158
160
  */
159
- interface SessionConfiguration {
161
+ export interface SessionConfiguration {
160
162
  /**
161
163
  * The amount of time in seconds before the session id is updated while the app is in the foreground
162
164
  * @defaultValue 1800
@@ -171,7 +173,7 @@ interface SessionConfiguration {
171
173
  /**
172
174
  * EmitterConfiguration
173
175
  */
174
- interface EmitterConfiguration {
176
+ export interface EmitterConfiguration {
175
177
  /**
176
178
  * The buffer option for post requests.
177
179
  * @defaultValue 'single'
@@ -206,7 +208,7 @@ interface EmitterConfiguration {
206
208
  /**
207
209
  * SubjectConfiguration
208
210
  */
209
- interface SubjectConfiguration {
211
+ export interface SubjectConfiguration {
210
212
  [index: string]: unknown;
211
213
  /**
212
214
  * user id
@@ -252,7 +254,7 @@ interface SubjectConfiguration {
252
254
  /**
253
255
  * GdprConfiguration
254
256
  */
255
- interface GdprConfiguration {
257
+ export interface GdprConfiguration {
256
258
  /**
257
259
  * Basis for processing
258
260
  */
@@ -273,7 +275,7 @@ interface GdprConfiguration {
273
275
  /**
274
276
  * Global Context
275
277
  */
276
- interface GlobalContext {
278
+ export interface GlobalContext {
277
279
  /**
278
280
  * tag
279
281
  */
@@ -286,11 +288,11 @@ interface GlobalContext {
286
288
  /**
287
289
  * Global Contexts configuration
288
290
  */
289
- declare type GCConfiguration = GlobalContext[];
291
+ export type GCConfiguration = GlobalContext[];
290
292
  /**
291
293
  * The TrackerControllerConfiguration
292
294
  */
293
- interface TrackerControllerConfiguration {
295
+ export interface TrackerControllerConfiguration {
294
296
  trackerConfig?: TrackerConfiguration;
295
297
  sessionConfig?: SessionConfiguration;
296
298
  emitterConfig?: EmitterConfiguration;
@@ -298,11 +300,18 @@ interface TrackerControllerConfiguration {
298
300
  gdprConfig?: GdprConfiguration;
299
301
  gcConfig?: GCConfiguration;
300
302
  }
303
+ /**
304
+ * The TrackerConfiguration
305
+ */
306
+ export interface InitTrackerConfiguration extends TrackerControllerConfiguration {
307
+ namespace: string;
308
+ networkConfig: NetworkConfiguration;
309
+ }
301
310
  /**
302
311
  * ScreenView event properties
303
312
  * schema: iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0
304
313
  */
305
- declare type ScreenViewProps = {
314
+ export type ScreenViewProps = {
306
315
  /**
307
316
  * The name of the screen viewed
308
317
  */
@@ -320,8 +329,8 @@ declare type ScreenViewProps = {
320
329
  */
321
330
  previousName?: string;
322
331
  /**
323
- * The id(UUID) of the previous screen that was viewed
324
- */
332
+ * The id(UUID) of the previous screen that was viewed
333
+ */
325
334
  previousId?: string;
326
335
  /**
327
336
  * The type of the previous screen that was viewed
@@ -335,7 +344,7 @@ declare type ScreenViewProps = {
335
344
  /**
336
345
  * Structured event properties
337
346
  */
338
- declare type StructuredProps = {
347
+ export type StructuredProps = {
339
348
  /**
340
349
  * The category of the event
341
350
  */
@@ -360,7 +369,7 @@ declare type StructuredProps = {
360
369
  /**
361
370
  * PageView event properties
362
371
  */
363
- declare type PageViewProps = {
372
+ export type PageViewProps = {
364
373
  /**
365
374
  * The page URL
366
375
  */
@@ -377,7 +386,7 @@ declare type PageViewProps = {
377
386
  /**
378
387
  * Timing event properties
379
388
  */
380
- declare type TimingProps = {
389
+ export type TimingProps = {
381
390
  /**
382
391
  * The timing category
383
392
  */
@@ -398,7 +407,7 @@ declare type TimingProps = {
398
407
  /**
399
408
  * ConsentDocument properties
400
409
  */
401
- interface ConsentDocument {
410
+ export interface ConsentDocument {
402
411
  /**
403
412
  * The consent document id
404
413
  */
@@ -419,7 +428,7 @@ interface ConsentDocument {
419
428
  /**
420
429
  * ConsentGranted event properties
421
430
  */
422
- interface ConsentGrantedProps extends ConsentDocument {
431
+ export interface ConsentGrantedProps extends ConsentDocument {
423
432
  /**
424
433
  * The expiry (date-time string, e.g.: '2022-01-01T00:00:00Z')
425
434
  */
@@ -428,7 +437,7 @@ interface ConsentGrantedProps extends ConsentDocument {
428
437
  /**
429
438
  * ConsentWithdrawn event properties
430
439
  */
431
- interface ConsentWithdrawnProps extends ConsentDocument {
440
+ export interface ConsentWithdrawnProps extends ConsentDocument {
432
441
  /**
433
442
  * Whether user opts out of all data collection
434
443
  */
@@ -437,7 +446,7 @@ interface ConsentWithdrawnProps extends ConsentDocument {
437
446
  /**
438
447
  * EcommerceItem
439
448
  */
440
- declare type EcommerceItem = {
449
+ export type EcommerceItem = {
441
450
  sku: string;
442
451
  price: number;
443
452
  quantity: number;
@@ -448,7 +457,7 @@ declare type EcommerceItem = {
448
457
  /**
449
458
  * EcommerceTransaction event properties
450
459
  */
451
- declare type EcommerceTransactionProps = {
460
+ export type EcommerceTransactionProps = {
452
461
  orderId: string;
453
462
  totalValue: number;
454
463
  items: EcommerceItem[];
@@ -464,7 +473,7 @@ declare type EcommerceTransactionProps = {
464
473
  * DeepLinkReceived event properties
465
474
  * schema: iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0
466
475
  */
467
- declare type DeepLinkReceivedProps = {
476
+ export type DeepLinkReceivedProps = {
468
477
  /**
469
478
  * URL in the received deep-link.
470
479
  */
@@ -477,7 +486,7 @@ declare type DeepLinkReceivedProps = {
477
486
  /**
478
487
  * Attachment object that identify an attachment in the MessageNotification.
479
488
  */
480
- declare type MessageNotificationAttachmentProps = {
489
+ export type MessageNotificationAttachmentProps = {
481
490
  identifier: string;
482
491
  type: string;
483
492
  url: string;
@@ -486,7 +495,7 @@ declare type MessageNotificationAttachmentProps = {
486
495
  * MessageNotification event properties
487
496
  * schema: iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0
488
497
  */
489
- declare type MessageNotificationProps = {
498
+ export type MessageNotificationProps = {
490
499
  /**
491
500
  * The action associated with the notification.
492
501
  */
@@ -561,7 +570,7 @@ declare type MessageNotificationProps = {
561
570
  /**
562
571
  * The ReactNativeTracker type
563
572
  */
564
- declare type ReactNativeTracker = {
573
+ export type ReactNativeTracker = {
565
574
  /**
566
575
  * Tracks a self-descibing event
567
576
  *
@@ -748,43 +757,147 @@ declare type ReactNativeTracker = {
748
757
  */
749
758
  readonly getForegroundIndex: () => Promise<number | undefined>;
750
759
  };
751
-
752
- /**
753
- * Enables tracking events from apps rendered in react-native-webview components.
754
- * The apps need to use the Snowplow WebView tracker to track the events.
755
- *
756
- * To subscribe for the events, set the `onMessage` attribute:
757
- * <WebView onMessage={getWebViewCallback()} ... />
758
- *
759
- * @returns Callback to subscribe for events from Web views tracked using the Snowplow WebView tracker.
760
- */
761
- declare function getWebViewCallback(): (message: {
762
- nativeEvent: {
763
- data: string;
764
- };
765
- }) => void;
766
-
767
- /**
768
- * Creates a React Native Tracker object
769
- *
770
- * @param namespace {string} - The tracker namespace
771
- * @param networkConfig {Object} - The network configuration
772
- * @param control {Array} - The tracker controller configuration
773
- * @returns The tracker object
774
- */
775
- declare function createTracker(namespace: string, networkConfig: NetworkConfiguration, controllerConfig?: TrackerControllerConfiguration): ReactNativeTracker;
776
- /**
777
- * Removes a tracker given its namespace
778
- *
779
- * @param trackerNamespace {string}
780
- * @returns - A boolean promise
781
- */
782
- declare function removeTracker(trackerNamespace: string): Promise<boolean>;
783
- /**
784
- * Removes all trackers
785
- *
786
- * @returns - A boolean promise
787
- */
788
- declare function removeAllTrackers(): Promise<boolean>;
789
-
790
- export { Basis, BufferOption, ConsentDocument, ConsentGrantedProps, ConsentWithdrawnProps, DeepLinkReceivedProps, DevicePlatform, EcommerceItem, EcommerceTransactionProps, EmitterConfiguration, EventContext, GCConfiguration, GdprConfiguration, GlobalContext, HttpMethod, LogLevel, MessageNotificationProps, NetworkConfiguration, PageViewProps, ReactNativeTracker, ScreenSize, ScreenViewProps, SelfDescribing, SessionConfiguration, StructuredProps, SubjectConfiguration, TimingProps, TrackerConfiguration, TrackerControllerConfiguration, Trigger, createTracker, getWebViewCallback, removeAllTrackers, removeTracker };
760
+ /**
761
+ * Internal event type for page views tracked using the WebView tracker.
762
+ */
763
+ export interface WebViewPageViewEvent {
764
+ title?: string | null;
765
+ url?: string;
766
+ referrer?: string;
767
+ }
768
+ /**
769
+ * Internal type exchanged in messages received from the WebView tracker in Web views through the web view callback.
770
+ */
771
+ export type WebViewMessage = {
772
+ command: 'trackSelfDescribingEvent' | 'trackStructEvent' | 'trackPageView' | 'trackScreenView';
773
+ event: StructuredProps | SelfDescribing | ScreenViewProps | WebViewPageViewEvent;
774
+ context?: Array<SelfDescribing> | null;
775
+ trackers?: Array<string>;
776
+ };
777
+ /**
778
+ * Internal type for representing the interface to the native trackers.
779
+ */
780
+ export interface Native {
781
+ createTracker: (configuration: InitTrackerConfiguration) => Promise<void>;
782
+ removeTracker: (details: {
783
+ tracker: string;
784
+ }) => Promise<boolean>;
785
+ removeAllTrackers: () => Promise<boolean>;
786
+ trackSelfDescribingEvent: (details: {
787
+ tracker: string | null;
788
+ eventData: SelfDescribing;
789
+ contexts: EventContext[];
790
+ }) => Promise<void>;
791
+ trackStructuredEvent: (details: {
792
+ tracker: string | null;
793
+ eventData: StructuredProps;
794
+ contexts: EventContext[];
795
+ }) => Promise<void>;
796
+ trackScreenViewEvent: (details: {
797
+ tracker: string | null;
798
+ eventData: ScreenViewProps;
799
+ contexts: EventContext[];
800
+ }) => Promise<void>;
801
+ trackPageViewEvent: (details: {
802
+ tracker: string | null;
803
+ eventData: PageViewProps;
804
+ contexts: EventContext[];
805
+ }) => Promise<void>;
806
+ trackTimingEvent: (details: {
807
+ tracker: string | null;
808
+ eventData: TimingProps;
809
+ contexts: EventContext[];
810
+ }) => Promise<void>;
811
+ trackConsentGrantedEvent: (details: {
812
+ tracker: string | null;
813
+ eventData: ConsentGrantedProps;
814
+ contexts: EventContext[];
815
+ }) => Promise<void>;
816
+ trackConsentWithdrawnEvent: (details: {
817
+ tracker: string | null;
818
+ eventData: ConsentWithdrawnProps;
819
+ contexts: EventContext[];
820
+ }) => Promise<void>;
821
+ trackEcommerceTransactionEvent: (details: {
822
+ tracker: string | null;
823
+ eventData: EcommerceTransactionProps;
824
+ contexts: EventContext[];
825
+ }) => Promise<void>;
826
+ trackDeepLinkReceivedEvent: (details: {
827
+ tracker: string | null;
828
+ eventData: DeepLinkReceivedProps;
829
+ contexts: EventContext[];
830
+ }) => Promise<void>;
831
+ trackMessageNotificationEvent: (details: {
832
+ tracker: string | null;
833
+ eventData: MessageNotificationProps;
834
+ contexts: EventContext[];
835
+ }) => Promise<void>;
836
+ removeGlobalContexts: (details: {
837
+ tracker: string;
838
+ removeTag: string;
839
+ }) => Promise<void>;
840
+ addGlobalContexts: (details: {
841
+ tracker: string;
842
+ addGlobalContext: GlobalContext;
843
+ }) => Promise<void>;
844
+ setUserId: (details: {
845
+ tracker: string;
846
+ userId: string | null;
847
+ }) => Promise<void>;
848
+ setNetworkUserId: (details: {
849
+ tracker: string;
850
+ networkUserId: string | null;
851
+ }) => Promise<void>;
852
+ setDomainUserId: (details: {
853
+ tracker: string;
854
+ domainUserId: string | null;
855
+ }) => Promise<void>;
856
+ setIpAddress: (details: {
857
+ tracker: string;
858
+ ipAddress: string | null;
859
+ }) => Promise<void>;
860
+ setUseragent: (details: {
861
+ tracker: string;
862
+ useragent: string | null;
863
+ }) => Promise<void>;
864
+ setTimezone: (details: {
865
+ tracker: string;
866
+ timezone: string | null;
867
+ }) => Promise<void>;
868
+ setLanguage: (details: {
869
+ tracker: string;
870
+ language: string | null;
871
+ }) => Promise<void>;
872
+ setScreenResolution: (details: {
873
+ tracker: string;
874
+ screenResolution: ScreenSize | null;
875
+ }) => Promise<void>;
876
+ setScreenViewport: (details: {
877
+ tracker: string;
878
+ screenViewport: ScreenSize | null;
879
+ }) => Promise<void>;
880
+ setColorDepth: (details: {
881
+ tracker: string;
882
+ colorDepth: number | null;
883
+ }) => Promise<void>;
884
+ getSessionUserId: (details: {
885
+ tracker: string;
886
+ }) => Promise<string>;
887
+ getSessionId: (details: {
888
+ tracker: string;
889
+ }) => Promise<string>;
890
+ getSessionIndex: (details: {
891
+ tracker: string;
892
+ }) => Promise<number>;
893
+ getIsInBackground: (details: {
894
+ tracker: string;
895
+ }) => Promise<boolean>;
896
+ getBackgroundIndex: (details: {
897
+ tracker: string;
898
+ }) => Promise<number>;
899
+ getForegroundIndex: (details: {
900
+ tracker: string;
901
+ }) => Promise<number>;
902
+ }
903
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,GACL,IAAI,GACJ,MAAM,GACN,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,KAAK,GACb,SAAS,GACT,UAAU,GACV,kBAAkB,GAClB,sBAAsB,GACtB,aAAa,GACb,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,OAAO,GACf,MAAM,GACN,UAAU,GACV,UAAU,GACV,cAAc,GACd,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,cAAc,CACxB,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC1D;IACF;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,CAAC,CA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C;IACpB,aAAa,EAAE,CAAC,OAAO,EAAE;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,gBAAgB,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpE,YAAY,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,eAAe,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnE,iBAAiB,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,kBAAkB,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtE,kBAAkB,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Returns a function that accepts a side-effect function as its argument and subscribes
3
+ * that function to aPromise's fullfillment,
4
+ * and errHandle to aPromise's rejection.
5
+ *
6
+ * @param aPromise - A void Promise
7
+ * @param errHandle - A function to handle the promise being rejected
8
+ * @returns - A function subscribed to the Promise's fullfillment
9
+ */
10
+ declare function safeWait(aPromise: Promise<void>, errHandle: (err: Error) => void): <F extends (...args: never[]) => Promise<void>>(func: F) => (...args: Parameters<F>) => Promise<void>;
11
+ /**
12
+ * Returns a function that accepts a callback function as its argument and subscribes
13
+ * that function to aPromise's fullfillment,
14
+ * and errHandle to aPromise's rejection.
15
+ *
16
+ * @param aPromise - A void Promise
17
+ * @param errHandle - A function to handle the promise being rejected
18
+ * @returns - A function subscribed to the Promise's fullfillment
19
+ */
20
+ declare function safeWaitCallback(callPromise: Promise<void>, errHandle: (err: Error) => undefined): <T, F extends (...args: never[]) => Promise<T>>(func: F) => (...args: Parameters<F>) => ReturnType<F> | Promise<undefined>;
21
+ /**
22
+ * Handles an error.
23
+ *
24
+ * @param err - The error to be handled.
25
+ */
26
+ declare function errorHandler(err: Error): undefined;
27
+ /**
28
+ * Helper to check whether its argument is of object type
29
+ *
30
+ * @param x - The argument to check.
31
+ * @returns - A boolean
32
+ */
33
+ declare function isObject<Type>(x: Type): boolean;
34
+ export { safeWait, safeWaitCallback, errorHandler, isObject };
35
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAeA;;;;;;;;GAQG;AACH,iBAAS,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,wBAC5C,KAAK,EAAE,KAAK,QAAQ,IAAI,CAAC,0CAClB,QAAQ,IAAI,CAAC,CAIjD;AAED;;;;;;;;GAQG;AACH,iBAAS,gBAAgB,CACvB,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,EAC1B,SAAS,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,SAAS,2BAEL,KAAK,EAAE,4FAOvC;AAED;;;;GAIG;AACH,iBAAS,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,SAAS,CAM3C;AAED;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAExC;AAED,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Enables tracking events from apps rendered in react-native-webview components.
3
+ * The apps need to use the Snowplow WebView tracker to track the events.
4
+ *
5
+ * To subscribe for the events, set the `onMessage` attribute:
6
+ * <WebView onMessage={getWebViewCallback()} ... />
7
+ *
8
+ * @returns Callback to subscribe for events from Web views tracked using the Snowplow WebView tracker.
9
+ */
10
+ export declare function getWebViewCallback(): (message: {
11
+ nativeEvent: {
12
+ data: string;
13
+ };
14
+ }) => void;
15
+ //# sourceMappingURL=webViewInterface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webViewInterface.d.ts","sourceRoot":"","sources":["../../src/webViewInterface.ts"],"names":[],"mappings":"AAyCA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,cACf;IAAE,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,KAAG,IAAI,CAqD1D"}