@snowplow/react-native-tracker 2.1.2 → 4.0.2-dev.1

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 (273) hide show
  1. package/LICENSE +29 -203
  2. package/README.md +59 -143
  3. package/dist/commonjs/event_store.js +150 -0
  4. package/dist/commonjs/event_store.js.map +1 -0
  5. package/dist/commonjs/events.js +42 -0
  6. package/dist/commonjs/events.js.map +1 -0
  7. package/dist/commonjs/index.js +29 -0
  8. package/dist/commonjs/index.js.map +1 -0
  9. package/dist/commonjs/subject.js +82 -0
  10. package/dist/commonjs/subject.js.map +1 -0
  11. package/dist/commonjs/tracker.js +77 -0
  12. package/dist/commonjs/tracker.js.map +1 -0
  13. package/dist/commonjs/types.js +223 -0
  14. package/dist/commonjs/types.js.map +1 -0
  15. package/dist/module/event_store.js +145 -0
  16. package/dist/module/event_store.js.map +1 -0
  17. package/dist/module/events.js +38 -0
  18. package/dist/module/events.js.map +1 -0
  19. package/dist/module/index.js +7 -0
  20. package/dist/module/index.js.map +1 -0
  21. package/dist/module/subject.js +78 -0
  22. package/dist/module/subject.js.map +1 -0
  23. package/dist/module/tracker.js +74 -0
  24. package/dist/module/tracker.js.map +1 -0
  25. package/dist/module/types.js +73 -0
  26. package/dist/module/types.js.map +1 -0
  27. package/dist/typescript/commonjs/package.json +1 -0
  28. package/dist/typescript/commonjs/src/event_store.d.ts +4 -0
  29. package/dist/typescript/commonjs/src/event_store.d.ts.map +1 -0
  30. package/dist/typescript/commonjs/src/events.d.ts +10 -0
  31. package/dist/typescript/commonjs/src/events.d.ts.map +1 -0
  32. package/dist/typescript/commonjs/src/index.d.ts +4 -0
  33. package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
  34. package/dist/typescript/commonjs/src/subject.d.ts +19 -0
  35. package/dist/typescript/commonjs/src/subject.d.ts.map +1 -0
  36. package/dist/typescript/commonjs/src/tracker.d.ts +9 -0
  37. package/dist/typescript/commonjs/src/tracker.d.ts.map +1 -0
  38. package/dist/typescript/commonjs/src/types.d.ts +452 -0
  39. package/dist/typescript/commonjs/src/types.d.ts.map +1 -0
  40. package/dist/typescript/module/package.json +1 -0
  41. package/dist/typescript/module/src/event_store.d.ts +4 -0
  42. package/dist/typescript/module/src/event_store.d.ts.map +1 -0
  43. package/dist/typescript/module/src/events.d.ts +10 -0
  44. package/dist/typescript/module/src/events.d.ts.map +1 -0
  45. package/dist/typescript/module/src/index.d.ts +4 -0
  46. package/dist/typescript/module/src/index.d.ts.map +1 -0
  47. package/dist/typescript/module/src/subject.d.ts +19 -0
  48. package/dist/typescript/module/src/subject.d.ts.map +1 -0
  49. package/dist/typescript/module/src/tracker.d.ts +9 -0
  50. package/dist/typescript/module/src/tracker.d.ts.map +1 -0
  51. package/dist/typescript/module/src/types.d.ts +452 -0
  52. package/dist/typescript/module/src/types.d.ts.map +1 -0
  53. package/package.json +75 -147
  54. package/.editorconfig +0 -15
  55. package/.eslintignore +0 -6
  56. package/.gitattributes +0 -3
  57. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
  58. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  59. package/.github/actions/setup/action.yml +0 -28
  60. package/.github/workflows/build.yml +0 -155
  61. package/.github/workflows/deploy.yml +0 -97
  62. package/.github/workflows/e2e-android.yml +0 -121
  63. package/.github/workflows/e2e-ios.yml +0 -95
  64. package/.github/workflows/snyk.yml +0 -21
  65. package/.gitignore +0 -70
  66. package/.npmignore +0 -60
  67. package/.nvmrc +0 -1
  68. package/.watchmanconfig +0 -1
  69. package/.yarnrc +0 -3
  70. package/CHANGELOG +0 -184
  71. package/CONTRIBUTING.md +0 -80
  72. package/android/build.gradle +0 -110
  73. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  74. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  75. package/android/gradle.properties +0 -5
  76. package/android/gradlew +0 -234
  77. package/android/gradlew.bat +0 -89
  78. package/android/src/main/AndroidManifest.xml +0 -3
  79. package/android/src/main/AndroidManifestNew.xml +0 -2
  80. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +0 -744
  81. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +0 -17
  82. package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +0 -274
  83. package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +0 -233
  84. package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +0 -5
  85. package/babel.config.js +0 -3
  86. package/example/.watchmanconfig +0 -1
  87. package/example/Gemfile +0 -6
  88. package/example/android/app/build.gradle +0 -129
  89. package/example/android/app/debug.keystore +0 -0
  90. package/example/android/app/proguard-rules.pro +0 -10
  91. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +0 -36
  92. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +0 -21
  93. package/example/android/app/src/debug/AndroidManifest.xml +0 -13
  94. package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +0 -75
  95. package/example/android/app/src/main/AndroidManifest.xml +0 -26
  96. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +0 -32
  97. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +0 -62
  98. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
  99. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  100. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  101. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  102. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  103. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  104. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  105. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  106. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  107. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  108. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  109. package/example/android/app/src/main/res/values/strings.xml +0 -3
  110. package/example/android/app/src/main/res/values/styles.xml +0 -9
  111. package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +0 -20
  112. package/example/android/build.gradle +0 -31
  113. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  114. package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  115. package/example/android/gradle.properties +0 -44
  116. package/example/android/gradlew +0 -244
  117. package/example/android/gradlew.bat +0 -92
  118. package/example/android/settings.gradle +0 -4
  119. package/example/app.json +0 -4
  120. package/example/babel.config.js +0 -17
  121. package/example/detox.config.js +0 -92
  122. package/example/e2e/config.json +0 -10
  123. package/example/e2e/emitEvents.e2e.detox.js +0 -95
  124. package/example/e2e/environment.js +0 -23
  125. package/example/e2e/helpers/microCommands.js +0 -140
  126. package/example/e2e/helpers/microHelpers.js +0 -333
  127. package/example/e2e/helpers/microHelpers.test.js +0 -295
  128. package/example/e2e/helpers/schemas.js +0 -49
  129. package/example/e2e/jest.config.js +0 -16
  130. package/example/e2e/setup.js +0 -4
  131. package/example/e2e/testEvents.micro.test.js +0 -287
  132. package/example/index.js +0 -5
  133. package/example/ios/.xcode.env +0 -11
  134. package/example/ios/Podfile +0 -62
  135. package/example/ios/Podfile.lock +0 -730
  136. package/example/ios/ReactNativeTrackerExample/AppDelegate.h +0 -6
  137. package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +0 -26
  138. package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  139. package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +0 -6
  140. package/example/ios/ReactNativeTrackerExample/Info.plist +0 -55
  141. package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +0 -47
  142. package/example/ios/ReactNativeTrackerExample/PrivacyInfo.xcprivacy +0 -37
  143. package/example/ios/ReactNativeTrackerExample/main.m +0 -10
  144. package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +0 -3
  145. package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +0 -739
  146. package/example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme +0 -88
  147. package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +0 -10
  148. package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  149. package/example/ios/ReactNativeTrackerExampleTests/Info.plist +0 -24
  150. package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +0 -66
  151. package/example/metro.config.js +0 -45
  152. package/example/package.json +0 -54
  153. package/example/react-native.config.js +0 -10
  154. package/example/src/App.js +0 -566
  155. package/example/tsconfig.json +0 -5
  156. package/example/yarn.lock +0 -7703
  157. package/ios/ReactNativeTracker-Bridging-Header.h +0 -2
  158. package/ios/ReactNativeTracker.mm +0 -171
  159. package/ios/ReactNativeTracker.swift +0 -822
  160. package/ios/ReactNativeTracker.xcodeproj/project.pbxproj +0 -301
  161. package/ios/Util/ConfigUtils.swift +0 -209
  162. package/ios/Util/TrackerVersion.swift +0 -3
  163. package/ios/Util/Utilities.swift +0 -37
  164. package/lefthook.yml +0 -11
  165. package/lib/commonjs/api.js +0 -490
  166. package/lib/commonjs/api.js.map +0 -1
  167. package/lib/commonjs/configurations.js +0 -196
  168. package/lib/commonjs/configurations.js.map +0 -1
  169. package/lib/commonjs/constants.js +0 -77
  170. package/lib/commonjs/constants.js.map +0 -1
  171. package/lib/commonjs/events.js +0 -277
  172. package/lib/commonjs/events.js.map +0 -1
  173. package/lib/commonjs/index.js +0 -132
  174. package/lib/commonjs/index.js.map +0 -1
  175. package/lib/commonjs/jsCore.js +0 -427
  176. package/lib/commonjs/jsCore.js.map +0 -1
  177. package/lib/commonjs/native.js +0 -16
  178. package/lib/commonjs/native.js.map +0 -1
  179. package/lib/commonjs/subject.js +0 -235
  180. package/lib/commonjs/subject.js.map +0 -1
  181. package/lib/commonjs/tracker.js +0 -248
  182. package/lib/commonjs/tracker.js.map +0 -1
  183. package/lib/commonjs/types.js +0 -2
  184. package/lib/commonjs/types.js.map +0 -1
  185. package/lib/commonjs/utils.js +0 -72
  186. package/lib/commonjs/utils.js.map +0 -1
  187. package/lib/commonjs/webViewInterface.js +0 -66
  188. package/lib/commonjs/webViewInterface.js.map +0 -1
  189. package/lib/module/api.js +0 -452
  190. package/lib/module/api.js.map +0 -1
  191. package/lib/module/configurations.js +0 -184
  192. package/lib/module/configurations.js.map +0 -1
  193. package/lib/module/constants.js +0 -72
  194. package/lib/module/constants.js.map +0 -1
  195. package/lib/module/events.js +0 -259
  196. package/lib/module/events.js.map +0 -1
  197. package/lib/module/index.js +0 -120
  198. package/lib/module/index.js.map +0 -1
  199. package/lib/module/jsCore.js +0 -424
  200. package/lib/module/jsCore.js.map +0 -1
  201. package/lib/module/native.js +0 -12
  202. package/lib/module/native.js.map +0 -1
  203. package/lib/module/subject.js +0 -222
  204. package/lib/module/subject.js.map +0 -1
  205. package/lib/module/tracker.js +0 -234
  206. package/lib/module/tracker.js.map +0 -1
  207. package/lib/module/types.js +0 -2
  208. package/lib/module/types.js.map +0 -1
  209. package/lib/module/utils.js +0 -66
  210. package/lib/module/utils.js.map +0 -1
  211. package/lib/module/webViewInterface.js +0 -62
  212. package/lib/module/webViewInterface.js.map +0 -1
  213. package/lib/typescript/__tests__/api.test.d.ts +0 -2
  214. package/lib/typescript/__tests__/api.test.d.ts.map +0 -1
  215. package/lib/typescript/__tests__/configurations.test.d.ts +0 -2
  216. package/lib/typescript/__tests__/configurations.test.d.ts.map +0 -1
  217. package/lib/typescript/__tests__/events.test.d.ts +0 -2
  218. package/lib/typescript/__tests__/events.test.d.ts.map +0 -1
  219. package/lib/typescript/__tests__/index.test.d.ts +0 -2
  220. package/lib/typescript/__tests__/index.test.d.ts.map +0 -1
  221. package/lib/typescript/__tests__/jsCore.test.d.ts +0 -2
  222. package/lib/typescript/__tests__/jsCore.test.d.ts.map +0 -1
  223. package/lib/typescript/__tests__/utils.test.d.ts +0 -2
  224. package/lib/typescript/__tests__/utils.test.d.ts.map +0 -1
  225. package/lib/typescript/api.d.ts +0 -240
  226. package/lib/typescript/api.d.ts.map +0 -1
  227. package/lib/typescript/configurations.d.ts +0 -73
  228. package/lib/typescript/configurations.d.ts.map +0 -1
  229. package/lib/typescript/constants.d.ts +0 -64
  230. package/lib/typescript/constants.d.ts.map +0 -1
  231. package/lib/typescript/events.d.ts +0 -115
  232. package/lib/typescript/events.d.ts.map +0 -1
  233. package/lib/typescript/index.d.ts +0 -27
  234. package/lib/typescript/index.d.ts.map +0 -1
  235. package/lib/typescript/jsCore.d.ts +0 -152
  236. package/lib/typescript/jsCore.d.ts.map +0 -1
  237. package/lib/typescript/native.d.ts +0 -4
  238. package/lib/typescript/native.d.ts.map +0 -1
  239. package/lib/typescript/subject.d.ts +0 -91
  240. package/lib/typescript/subject.d.ts.map +0 -1
  241. package/lib/typescript/tracker.d.ts +0 -111
  242. package/lib/typescript/tracker.d.ts.map +0 -1
  243. package/lib/typescript/types.d.ts +0 -981
  244. package/lib/typescript/types.d.ts.map +0 -1
  245. package/lib/typescript/utils.d.ts +0 -35
  246. package/lib/typescript/utils.d.ts.map +0 -1
  247. package/lib/typescript/webViewInterface.d.ts +0 -15
  248. package/lib/typescript/webViewInterface.d.ts.map +0 -1
  249. package/scripts/bootstrap.js +0 -29
  250. package/snowplow-react-native-tracker.podspec +0 -42
  251. package/src/__mocks__/react-native.js +0 -7
  252. package/src/__tests__/api.test.ts +0 -21
  253. package/src/__tests__/configurations.test.ts +0 -608
  254. package/src/__tests__/events.test.ts +0 -736
  255. package/src/__tests__/index.test.ts +0 -14
  256. package/src/__tests__/jsCore.test.ts +0 -199
  257. package/src/__tests__/utils.test.ts +0 -10
  258. package/src/api.ts +0 -556
  259. package/src/configurations.ts +0 -325
  260. package/src/constants.ts +0 -97
  261. package/src/events.ts +0 -355
  262. package/src/index.ts +0 -184
  263. package/src/jsCore.ts +0 -603
  264. package/src/native.ts +0 -21
  265. package/src/subject.ts +0 -302
  266. package/src/tracker.ts +0 -377
  267. package/src/types.ts +0 -1162
  268. package/src/utils.ts +0 -65
  269. package/src/webViewInterface.ts +0 -92
  270. package/tsconfig.build.json +0 -5
  271. package/tsconfig.json +0 -28
  272. package/turbo.json +0 -34
  273. package/yarn.lock +0 -9398
@@ -1,981 +0,0 @@
1
- /**
2
- * HttpMethod type
3
- */
4
- export type HttpMethod = 'post' | 'get';
5
- /**
6
- * DevicePlatform type
7
- */
8
- export type DevicePlatform = 'web' | 'mob' | 'pc' | 'srv' | 'app' | 'tv' | 'cnsl' | 'iot';
9
- /**
10
- * LogLevel type
11
- */
12
- export type LogLevel = 'off' | 'error' | 'debug' | 'verbose';
13
- /**
14
- * BasisForProsessing
15
- */
16
- export type Basis = 'consent' | 'contract' | 'legal_obligation' | 'legitimate_interests' | 'public_task' | 'vital_interests';
17
- /**
18
- * BufferOption
19
- */
20
- export type BufferOption = 'single' | 'small' | 'large';
21
- /**
22
- * Trigger for MessageNotification event
23
- */
24
- export type Trigger = 'push' | 'location' | 'calendar' | 'timeInterval' | 'other';
25
- /**
26
- * ScreenSize
27
- */
28
- export type ScreenSize = [number, number];
29
- /**
30
- * SelfDescribing type
31
- */
32
- export type SelfDescribing<T extends Record<string, unknown> = Record<string, unknown>> = {
33
- /**
34
- * Schema
35
- */
36
- schema: string;
37
- /**
38
- * Data
39
- */
40
- data: T;
41
- };
42
- /**
43
- * EventContext type
44
- */
45
- export type EventContext = SelfDescribing;
46
- /**
47
- * NetworkConfiguration
48
- */
49
- export interface NetworkConfiguration {
50
- /**
51
- * The collector endpoint
52
- * - if the protocol is not included it defaults to https
53
- */
54
- endpoint: string;
55
- /**
56
- * The Http Method to use when sending events to the collector
57
- * @defaultValue 'post'
58
- */
59
- method?: HttpMethod;
60
- /**
61
- * A custom path which will be added to the endpoint URL to specify the
62
- * complete URL of the collector when paired with the POST method.
63
- *
64
- * @defaultValue `com.snowplowanalytics.snowplow/tp2`.
65
- */
66
- customPostPath?: string;
67
- /**
68
- * Custom headers for HTTP requests to the Collector.
69
- */
70
- requestHeaders?: Record<string, string>;
71
- }
72
- /**
73
- * TrackerConfiguration
74
- */
75
- export interface TrackerConfiguration {
76
- /**
77
- * Identifier of the app.
78
- */
79
- appId?: string;
80
- /**
81
- * The device platform the tracker runs on.
82
- * @defaultValue 'mob'
83
- */
84
- devicePlatform?: DevicePlatform;
85
- /**
86
- * Whether payload JSON data should be base64 encoded.
87
- * @defaultValue true
88
- */
89
- base64Encoding?: boolean;
90
- /**
91
- * The log level of tracker logs.
92
- * @defaultValue 'off'
93
- */
94
- logLevel?: LogLevel;
95
- /**
96
- * Whether application context is attached to tracked events.
97
- * @defaultValue true
98
- */
99
- applicationContext?: boolean;
100
- /**
101
- * Whether platform context is attached to tracked events.
102
- * @defaultValue true
103
- */
104
- platformContext?: boolean;
105
- /**
106
- * Whether geo-location context is attached to tracked events.
107
- * @defaultValue false
108
- */
109
- geoLocationContext?: boolean;
110
- /**
111
- * Whether session context is attached to tracked events.
112
- * @defaultValue true
113
- */
114
- sessionContext?: boolean;
115
- /**
116
- * Whether to attach a Deep Link entity to the first ScreenView tracked in the tracker after DeepLinkReceived event.
117
- * @defaultValue true
118
- */
119
- deepLinkContext?: boolean;
120
- /**
121
- * Whether screen context is attached to tracked events.
122
- * @defaultValue true
123
- */
124
- screenContext?: boolean;
125
- /**
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
130
- */
131
- screenViewAutotracking?: boolean;
132
- /**
133
- * Whether to enable tracking of the screen end event and the screen summary context entity.
134
- * Make sure that you have lifecycle autotracking enabled for screen summary to have complete information.
135
- * @defaultValue true
136
- */
137
- screenEngagementAutotracking?: boolean;
138
- /**
139
- * Whether enable automatic tracking of background and foreground transitions.
140
- * @defaultValue true
141
- */
142
- lifecycleAutotracking?: boolean;
143
- /**
144
- * Whether enable automatic tracking of install event.
145
- * @defaultValue true
146
- */
147
- installAutotracking?: boolean;
148
- /**
149
- * Whether enable crash reporting.
150
- * @defaultValue true
151
- */
152
- exceptionAutotracking?: boolean;
153
- /**
154
- * Whether enable diagnostic reporting.
155
- * @defaultValue false
156
- */
157
- diagnosticAutotracking?: boolean;
158
- /**
159
- * Whether to anonymise client-side user identifiers in session and platform context entities
160
- * @defaultValue false
161
- */
162
- userAnonymisation?: boolean;
163
- }
164
- /**
165
- * SessionConfiguration
166
- */
167
- export interface SessionConfiguration {
168
- /**
169
- * The amount of time in seconds before the session id is updated while the app is in the foreground
170
- * @defaultValue 1800
171
- */
172
- foregroundTimeout: number;
173
- /**
174
- * The amount of time in seconds before the session id is updated while the app is in the background
175
- * @defaultValue 1800
176
- */
177
- backgroundTimeout: number;
178
- }
179
- /**
180
- * EmitterConfiguration
181
- */
182
- export interface EmitterConfiguration {
183
- /**
184
- * The buffer option for post requests.
185
- * @defaultValue 'single'
186
- */
187
- bufferOption?: BufferOption;
188
- /**
189
- * Maximum number of events collected from the EventStore to be sent in a request.
190
- * @defaultValue 150
191
- */
192
- emitRange?: number;
193
- /**
194
- *Maximum number of threads working in parallel in the tracker to send requests.
195
- * @defaultValue 15
196
- */
197
- threadPoolSize?: number;
198
- /**
199
- * Maximum amount of bytes allowed to be sent in a payload in a POST request.
200
- * @defaultValue 40000
201
- */
202
- byteLimitPost?: number;
203
- /**
204
- * Maximum amount of bytes allowed to be sent in a payload in a GET request.
205
- * @defaultValue 40000
206
- */
207
- byteLimitGet?: number;
208
- /**
209
- * Whether to anonymise server-side user identifiers including the `network_userid` and `user_ipaddress`
210
- * @defaultValue false
211
- */
212
- serverAnonymisation?: boolean;
213
- }
214
- /**
215
- * SubjectConfiguration
216
- */
217
- export interface SubjectConfiguration {
218
- [index: string]: unknown;
219
- /**
220
- * user id
221
- */
222
- userId?: string | null;
223
- /**
224
- * network user id (UUIDv4)
225
- */
226
- networkUserId?: string | null;
227
- /**
228
- * domain user id
229
- */
230
- domainUserId?: string | null;
231
- /**
232
- * The custom user-agent. It overrides the user-agent used by default.
233
- */
234
- useragent?: string | null;
235
- /**
236
- * IP address
237
- */
238
- ipAddress?: string | null;
239
- /**
240
- * The timezone label
241
- */
242
- timezone?: string | null;
243
- /**
244
- * The language set in the device
245
- */
246
- language?: string | null;
247
- /**
248
- * The screen resolution
249
- */
250
- screenResolution?: ScreenSize | null;
251
- /**
252
- * The screen viewport size
253
- */
254
- screenViewport?: ScreenSize | null;
255
- /**
256
- * color depth (integer)
257
- */
258
- colorDepth?: number | null;
259
- }
260
- /**
261
- * GdprConfiguration
262
- */
263
- export interface GdprConfiguration {
264
- /**
265
- * Basis for processing
266
- */
267
- basisForProcessing: Basis;
268
- /**
269
- * ID of a GDPR basis document.
270
- */
271
- documentId: string;
272
- /**
273
- * Version of the document.
274
- */
275
- documentVersion: string;
276
- /**
277
- * Description of the document.
278
- */
279
- documentDescription: string;
280
- }
281
- /**
282
- * Global Context
283
- */
284
- export interface GlobalContext {
285
- /**
286
- * tag
287
- */
288
- tag: string;
289
- /**
290
- * contexts
291
- */
292
- globalContexts: SelfDescribing[];
293
- }
294
- /**
295
- * Global Contexts configuration
296
- */
297
- export type GCConfiguration = GlobalContext[];
298
- /**
299
- * The TrackerControllerConfiguration
300
- */
301
- export interface TrackerControllerConfiguration {
302
- trackerConfig?: TrackerConfiguration;
303
- sessionConfig?: SessionConfiguration;
304
- emitterConfig?: EmitterConfiguration;
305
- subjectConfig?: SubjectConfiguration;
306
- gdprConfig?: GdprConfiguration;
307
- gcConfig?: GCConfiguration;
308
- }
309
- /**
310
- * The TrackerConfiguration
311
- */
312
- export interface InitTrackerConfiguration extends TrackerControllerConfiguration {
313
- namespace: string;
314
- networkConfig: NetworkConfiguration;
315
- }
316
- /**
317
- * ScreenView event properties
318
- * schema: iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0
319
- */
320
- export type ScreenViewProps = {
321
- /**
322
- * The name of the screen viewed
323
- */
324
- name: string;
325
- /**
326
- * The id(UUID) of screen that was viewed
327
- */
328
- id?: string;
329
- /**
330
- * The type of screen that was viewed
331
- */
332
- type?: string;
333
- /**
334
- * The name of the previous screen that was viewed
335
- */
336
- previousName?: string;
337
- /**
338
- * The id(UUID) of the previous screen that was viewed
339
- */
340
- previousId?: string;
341
- /**
342
- * The type of the previous screen that was viewed
343
- */
344
- previousType?: string;
345
- /**
346
- * The type of transition that led to the screen being viewed
347
- */
348
- transitionType?: string;
349
- };
350
- /**
351
- * Event tracked when a scroll view's scroll position changes.
352
- * If screen engagement tracking is enabled, the scroll changed events will be aggregated into a `screen_summary` entity.
353
- *
354
- * Schema: `iglu:com.snowplowanalytics.mobile/scroll_changed/jsonschema/1-0-0`
355
- */
356
- export type ScrollChangedProps = {
357
- /**
358
- * Vertical scroll offset in pixels
359
- */
360
- yOffset?: number;
361
- /**
362
- * Horizontal scroll offset in pixels.
363
- */
364
- xOffset?: number;
365
- /**
366
- * The height of the scroll view in pixels
367
- */
368
- viewHeight?: number;
369
- /**
370
- * The width of the scroll view in pixels
371
- */
372
- viewWidth?: number;
373
- /**
374
- * The height of the content in the scroll view in pixels
375
- */
376
- contentHeight?: number;
377
- /**
378
- * The width of the content in the scroll view in pixels
379
- */
380
- contentWidth?: number;
381
- };
382
- /**
383
- * Event tracking the view of an item in a list.
384
- * If screen engagement tracking is enabled, the list item view events will be aggregated into a `screen_summary` entity.
385
- *
386
- * Schema: `iglu:com.snowplowanalytics.mobile/list_item_view/jsonschema/1-0-0`
387
- */
388
- export type ListItemViewProps = {
389
- /**
390
- * Index of the item in the list
391
- */
392
- index: number;
393
- /**
394
- * Total number of items in the list
395
- */
396
- itemsCount?: number;
397
- };
398
- /**
399
- * Structured event properties
400
- */
401
- export type StructuredProps = {
402
- /**
403
- * The category of the event
404
- */
405
- category: string;
406
- /**
407
- * The action the event represents
408
- */
409
- action: string;
410
- /**
411
- * The label the action refers to
412
- */
413
- label?: string;
414
- /**
415
- * The property associated with the user action
416
- */
417
- property?: string;
418
- /**
419
- * The value associated with the user action
420
- */
421
- value?: number;
422
- };
423
- /**
424
- * PageView event properties
425
- */
426
- export type PageViewProps = {
427
- /**
428
- * The page URL
429
- */
430
- pageUrl: string;
431
- /**
432
- * The page title
433
- */
434
- pageTitle?: string;
435
- /**
436
- * The referrer URL
437
- */
438
- referrer?: string;
439
- };
440
- /**
441
- * Timing event properties
442
- */
443
- export type TimingProps = {
444
- /**
445
- * The timing category
446
- */
447
- category: string;
448
- /**
449
- * The timing variable
450
- */
451
- variable: string;
452
- /**
453
- * The time
454
- */
455
- timing: number;
456
- /**
457
- * The timing label
458
- */
459
- label?: string;
460
- };
461
- /**
462
- * ConsentDocument properties
463
- */
464
- export interface ConsentDocument {
465
- /**
466
- * The consent document id
467
- */
468
- documentId: string;
469
- /**
470
- * The consent document version
471
- */
472
- version: string;
473
- /**
474
- * The consent document name
475
- */
476
- name?: string;
477
- /**
478
- * The consent document description
479
- */
480
- documentDescription?: string;
481
- }
482
- /**
483
- * ConsentGranted event properties
484
- */
485
- export interface ConsentGrantedProps extends ConsentDocument {
486
- /**
487
- * The expiry (date-time string, e.g.: '2022-01-01T00:00:00Z')
488
- */
489
- expiry: string;
490
- }
491
- /**
492
- * ConsentWithdrawn event properties
493
- */
494
- export interface ConsentWithdrawnProps extends ConsentDocument {
495
- /**
496
- * Whether user opts out of all data collection
497
- */
498
- all: boolean;
499
- }
500
- /**
501
- * EcommerceItem
502
- */
503
- export type EcommerceItem = {
504
- sku: string;
505
- price: number;
506
- quantity: number;
507
- name?: string;
508
- category?: string;
509
- currency?: string;
510
- };
511
- /**
512
- * EcommerceTransaction event properties
513
- */
514
- export type EcommerceTransactionProps = {
515
- orderId: string;
516
- totalValue: number;
517
- items: EcommerceItem[];
518
- affiliation?: string;
519
- taxValue?: number;
520
- shipping?: number;
521
- city?: string;
522
- state?: string;
523
- country?: string;
524
- currency?: string;
525
- };
526
- /**
527
- * DeepLinkReceived event properties
528
- * schema: iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0
529
- */
530
- export type DeepLinkReceivedProps = {
531
- /**
532
- * URL in the received deep-link.
533
- */
534
- url: string;
535
- /**
536
- * Referrer URL, source of this deep-link.
537
- */
538
- referrer?: string;
539
- };
540
- /**
541
- * Attachment object that identify an attachment in the MessageNotification.
542
- */
543
- export type MessageNotificationAttachmentProps = {
544
- identifier: string;
545
- type: string;
546
- url: string;
547
- };
548
- /**
549
- * MessageNotification event properties
550
- * schema: iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0
551
- */
552
- export type MessageNotificationProps = {
553
- /**
554
- * The action associated with the notification.
555
- */
556
- action?: string;
557
- attachments?: MessageNotificationAttachmentProps[];
558
- /**
559
- * The notification's body.
560
- */
561
- body: string;
562
- bodyLocArgs?: string[];
563
- /**
564
- * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.
565
- */
566
- bodyLocKey?: string;
567
- /**
568
- * The category associated to the notification.
569
- */
570
- category?: string;
571
- /**
572
- * The application is notified of the delivery of the notification if it's in the foreground or background, the app will be woken up (iOS only).
573
- */
574
- contentAvailable?: boolean;
575
- /**
576
- * The group which this notification is part of.
577
- */
578
- group?: string;
579
- /**
580
- * The icon associated to the notification (Android only).
581
- */
582
- icon?: string;
583
- /**
584
- * The number of items this notification represent.
585
- */
586
- notificationCount?: number;
587
- /**
588
- * The time when the event of the notification occurred.
589
- */
590
- notificationTimestamp?: string;
591
- /**
592
- * The sound played when the device receives the notification.
593
- */
594
- sound?: string;
595
- /**
596
- * The notification's subtitle. (iOS only)
597
- */
598
- subtitle?: string;
599
- /**
600
- * An identifier similar to 'group' but usable for different purposes (Android only).
601
- */
602
- tag?: string;
603
- /**
604
- * An identifier similar to 'group' but usable for different purposes (iOS only).
605
- */
606
- threadIdentifier?: string;
607
- /**
608
- * The notification's title.
609
- */
610
- title: string;
611
- /**
612
- * Variable string values to be used in place of the format specifiers in titleLocArgs to use to localize the title text to the user's current localization.
613
- */
614
- titleLocArgs?: string[];
615
- /**
616
- * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.
617
- */
618
- titleLocKey?: string;
619
- /**
620
- * The trigger that raised the notification message. Must be one of: push, location, calendar, timeInterval, other
621
- */
622
- trigger: Trigger;
623
- };
624
- /**
625
- * The ReactNativeTracker type
626
- */
627
- export type ReactNativeTracker = {
628
- /**
629
- * Tracks a self-describing event
630
- *
631
- * @param argmap - The self-describing event properties
632
- * @param contexts - The array of event contexts
633
- * @typeParam TData - The type of the data object within the SelfDescribing object
634
- */
635
- readonly trackSelfDescribingEvent: <TData extends Record<string, unknown> = Record<string, unknown>>(argmap: SelfDescribing<TData>, contexts?: EventContext[]) => Promise<void>;
636
- /**
637
- * Tracks a screen-view event
638
- *
639
- * @param argmap - The screen-view event's properties
640
- * @param contexts - The array of event contexts
641
- */
642
- readonly trackScreenViewEvent: (argmap: ScreenViewProps, contexts?: EventContext[]) => Promise<void>;
643
- /**
644
- * Tracks a scroll changed event
645
- *
646
- * @param argmap - The scroll changed event's properties
647
- * @param contexts - The array of event contexts
648
- */
649
- readonly trackScrollChangedEvent: (argmap: ScrollChangedProps, contexts?: EventContext[]) => Promise<void>;
650
- /**
651
- * Tracks a list item view event
652
- *
653
- * @param argmap - The list item view event's properties
654
- * @param contexts - The array of event contexts
655
- */
656
- readonly trackListItemViewEvent: (argmap: ListItemViewProps, contexts?: EventContext[]) => Promise<void>;
657
- /**
658
- * Tracks a structured event
659
- *
660
- * @param argmap - The structured event properties
661
- * @param contexts - The array of event contexts
662
- */
663
- readonly trackStructuredEvent: (argmap: StructuredProps, contexts?: EventContext[]) => Promise<void>;
664
- /**
665
- * Tracks a page-view event
666
- *
667
- * @param argmap - The page-view event properties
668
- * @param contexts - The array of event contexts
669
- */
670
- readonly trackPageViewEvent: (argmap: PageViewProps, contexts?: EventContext[]) => Promise<void>;
671
- /**
672
- * Tracks a timing event
673
- *
674
- * @param argmap - The timing event properties
675
- * @param contexts - The array of event contexts
676
- */
677
- readonly trackTimingEvent: (argmap: TimingProps, contexts?: EventContext[]) => Promise<void>;
678
- /**
679
- * Tracks a consent-granted event
680
- *
681
- * @param argmap - The consent-granted event properties
682
- * @param contexts - The array of event contexts
683
- */
684
- readonly trackConsentGrantedEvent: (argmap: ConsentGrantedProps, contexts?: EventContext[]) => Promise<void>;
685
- /**
686
- * Tracks a consent-withdrawn event
687
- *
688
- * @param argmap - The consent-withdrawn event properties
689
- * @param contexts - The array of event contexts
690
- */
691
- readonly trackConsentWithdrawnEvent: (argmap: ConsentWithdrawnProps, contexts?: EventContext[]) => Promise<void>;
692
- /**
693
- * Tracks an ecommerce-transaction event
694
- *
695
- * @param argmap - The ecommerce-transaction event properties
696
- * @param contexts - The array of event contexts
697
- */
698
- readonly trackEcommerceTransactionEvent: (argmap: EcommerceTransactionProps, contexts?: EventContext[]) => Promise<void>;
699
- /**
700
- * Tracks a deep link received event
701
- *
702
- * @param argmap - The deep link received event properties
703
- * @param contexts - The array of event contexts
704
- */
705
- readonly trackDeepLinkReceivedEvent: (argmap: DeepLinkReceivedProps, contexts?: EventContext[]) => Promise<void>;
706
- /**
707
- * Tracks a message notification event
708
- *
709
- * @param argmap - The message notification event properties
710
- * @param contexts - The array of event contexts
711
- */
712
- readonly trackMessageNotificationEvent: (argmap: MessageNotificationProps, contexts?: EventContext[]) => Promise<void>;
713
- /**
714
- * Removes global contexts
715
- *
716
- * @param tag - The tag of the global contexts to remove
717
- */
718
- readonly removeGlobalContexts: (tag: string) => Promise<void>;
719
- /**
720
- * Adds global contexts
721
- *
722
- * @param gc - The global context to add
723
- */
724
- readonly addGlobalContexts: (gc: GlobalContext) => Promise<void>;
725
- /**
726
- * Sets the userId of the tracker subject
727
- *
728
- * @param newUid - The new userId
729
- */
730
- readonly setUserId: (newUid: string | null) => Promise<void>;
731
- /**
732
- * Sets the networkUserId of the tracker subject
733
- *
734
- * @param newNuid - The new networkUserId
735
- */
736
- readonly setNetworkUserId: (newNuid: string | null) => Promise<void>;
737
- /**
738
- * Sets the domainUserId of the tracker subject
739
- *
740
- * @param newDuid - The new domainUserId
741
- */
742
- readonly setDomainUserId: (newDuid: string | null) => Promise<void>;
743
- /**
744
- * Sets the ipAddress of the tracker subject
745
- *
746
- * @param newIp - The new ipAddress
747
- */
748
- readonly setIpAddress: (newIp: string | null) => Promise<void>;
749
- /**
750
- * Sets the useragent of the tracker subject
751
- *
752
- * @param newUagent - The new useragent
753
- */
754
- readonly setUseragent: (newUagent: string | null) => Promise<void>;
755
- /**
756
- * Sets the timezone of the tracker subject
757
- *
758
- * @param newTz - The new timezone
759
- */
760
- readonly setTimezone: (newTz: string | null) => Promise<void>;
761
- /**
762
- * Sets the language of the tracker subject
763
- *
764
- * @param newLang - The new language
765
- */
766
- readonly setLanguage: (newLang: string | null) => Promise<void>;
767
- /**
768
- * Sets the screenResolution of the tracker subject
769
- *
770
- * @param newRes - The new screenResolution
771
- */
772
- readonly setScreenResolution: (newRes: ScreenSize | null) => Promise<void>;
773
- /**
774
- * Sets the screenViewport of the tracker subject
775
- *
776
- * @param newView - The new screenViewport
777
- */
778
- readonly setScreenViewport: (newView: ScreenSize | null) => Promise<void>;
779
- /**
780
- * Sets the colorDepth of the tracker subject
781
- *
782
- * @param newColorD - The new colorDepth
783
- */
784
- readonly setColorDepth: (newLang: number | null) => Promise<void>;
785
- /**
786
- * Sets subject data
787
- *
788
- * @param config - The new subject data
789
- */
790
- readonly setSubjectData: (config: SubjectConfiguration) => Promise<void>;
791
- /**
792
- * Gets the dentifier for the user of the session
793
- *
794
- * @returns {Promise<string | undefined>}
795
- */
796
- readonly getSessionUserId: () => Promise<string | undefined>;
797
- /**
798
- * Gets the identifier for the session
799
- *
800
- * @returns {Promise<string | undefined>}
801
- */
802
- readonly getSessionId: () => Promise<string | undefined>;
803
- /**
804
- * Gets the index of the current session for this user
805
- *
806
- * @returns {Promise<number | undefined>}
807
- */
808
- readonly getSessionIndex: () => Promise<number | undefined>;
809
- /**
810
- * Gets whether the app is currently in background state
811
- *
812
- * @returns {Promise<boolean | undefined>}
813
- */
814
- readonly getIsInBackground: () => Promise<boolean | undefined>;
815
- /**
816
- * Gets the number of background transitions in the current session
817
- *
818
- * @returns {Promise<number | undefined>}
819
- */
820
- readonly getBackgroundIndex: () => Promise<number | undefined>;
821
- /**
822
- * Gets the number of foreground transitions in the current session.
823
- *
824
- * @returns {Promise<number | undefined>}
825
- */
826
- readonly getForegroundIndex: () => Promise<number | undefined>;
827
- };
828
- /**
829
- * Internal event type for page views tracked using the WebView tracker.
830
- */
831
- export interface WebViewPageViewEvent {
832
- title?: string | null;
833
- url?: string;
834
- referrer?: string;
835
- }
836
- /**
837
- * Internal type exchanged in messages received from the WebView tracker in Web views through the web view callback.
838
- */
839
- export type WebViewMessage = {
840
- command: 'trackSelfDescribingEvent' | 'trackStructEvent' | 'trackPageView' | 'trackScreenView';
841
- event: StructuredProps | SelfDescribing | ScreenViewProps | WebViewPageViewEvent;
842
- context?: Array<SelfDescribing> | null;
843
- trackers?: Array<string>;
844
- };
845
- /**
846
- * Internal type for representing the interface to the native trackers.
847
- */
848
- export interface Native {
849
- createTracker: (configuration: InitTrackerConfiguration) => Promise<void>;
850
- removeTracker: (details: {
851
- tracker: string;
852
- }) => Promise<boolean>;
853
- removeAllTrackers: () => Promise<boolean>;
854
- trackSelfDescribingEvent: (details: {
855
- tracker: string | null;
856
- eventData: SelfDescribing;
857
- contexts: EventContext[];
858
- }) => Promise<void>;
859
- trackStructuredEvent: (details: {
860
- tracker: string | null;
861
- eventData: StructuredProps;
862
- contexts: EventContext[];
863
- }) => Promise<void>;
864
- trackScreenViewEvent: (details: {
865
- tracker: string | null;
866
- eventData: ScreenViewProps;
867
- contexts: EventContext[];
868
- }) => Promise<void>;
869
- trackScrollChangedEvent: (details: {
870
- tracker: string | null;
871
- eventData: ScrollChangedProps;
872
- contexts: EventContext[];
873
- }) => Promise<void>;
874
- trackListItemViewEvent: (details: {
875
- tracker: string | null;
876
- eventData: ListItemViewProps;
877
- contexts: EventContext[];
878
- }) => Promise<void>;
879
- trackPageViewEvent: (details: {
880
- tracker: string | null;
881
- eventData: PageViewProps;
882
- contexts: EventContext[];
883
- }) => Promise<void>;
884
- trackTimingEvent: (details: {
885
- tracker: string | null;
886
- eventData: TimingProps;
887
- contexts: EventContext[];
888
- }) => Promise<void>;
889
- trackConsentGrantedEvent: (details: {
890
- tracker: string | null;
891
- eventData: ConsentGrantedProps;
892
- contexts: EventContext[];
893
- }) => Promise<void>;
894
- trackConsentWithdrawnEvent: (details: {
895
- tracker: string | null;
896
- eventData: ConsentWithdrawnProps;
897
- contexts: EventContext[];
898
- }) => Promise<void>;
899
- trackEcommerceTransactionEvent: (details: {
900
- tracker: string | null;
901
- eventData: EcommerceTransactionProps;
902
- contexts: EventContext[];
903
- }) => Promise<void>;
904
- trackDeepLinkReceivedEvent: (details: {
905
- tracker: string | null;
906
- eventData: DeepLinkReceivedProps;
907
- contexts: EventContext[];
908
- }) => Promise<void>;
909
- trackMessageNotificationEvent: (details: {
910
- tracker: string | null;
911
- eventData: MessageNotificationProps;
912
- contexts: EventContext[];
913
- }) => Promise<void>;
914
- removeGlobalContexts: (details: {
915
- tracker: string;
916
- removeTag: string;
917
- }) => Promise<void>;
918
- addGlobalContexts: (details: {
919
- tracker: string;
920
- addGlobalContext: GlobalContext;
921
- }) => Promise<void>;
922
- setUserId: (details: {
923
- tracker: string;
924
- userId: string | null;
925
- }) => Promise<void>;
926
- setNetworkUserId: (details: {
927
- tracker: string;
928
- networkUserId: string | null;
929
- }) => Promise<void>;
930
- setDomainUserId: (details: {
931
- tracker: string;
932
- domainUserId: string | null;
933
- }) => Promise<void>;
934
- setIpAddress: (details: {
935
- tracker: string;
936
- ipAddress: string | null;
937
- }) => Promise<void>;
938
- setUseragent: (details: {
939
- tracker: string;
940
- useragent: string | null;
941
- }) => Promise<void>;
942
- setTimezone: (details: {
943
- tracker: string;
944
- timezone: string | null;
945
- }) => Promise<void>;
946
- setLanguage: (details: {
947
- tracker: string;
948
- language: string | null;
949
- }) => Promise<void>;
950
- setScreenResolution: (details: {
951
- tracker: string;
952
- screenResolution: ScreenSize | null;
953
- }) => Promise<void>;
954
- setScreenViewport: (details: {
955
- tracker: string;
956
- screenViewport: ScreenSize | null;
957
- }) => Promise<void>;
958
- setColorDepth: (details: {
959
- tracker: string;
960
- colorDepth: number | null;
961
- }) => Promise<void>;
962
- getSessionUserId: (details: {
963
- tracker: string;
964
- }) => Promise<string>;
965
- getSessionId: (details: {
966
- tracker: string;
967
- }) => Promise<string>;
968
- getSessionIndex: (details: {
969
- tracker: string;
970
- }) => Promise<number>;
971
- getIsInBackground: (details: {
972
- tracker: string;
973
- }) => Promise<boolean>;
974
- getBackgroundIndex: (details: {
975
- tracker: string;
976
- }) => Promise<number>;
977
- getForegroundIndex: (details: {
978
- tracker: string;
979
- }) => Promise<number>;
980
- }
981
- //# sourceMappingURL=types.d.ts.map