@snowplow/react-native-tracker 2.1.1 → 4.0.2-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -203
- package/README.md +59 -143
- package/dist/index.cjs.d.ts +499 -0
- package/dist/index.cjs.js +2656 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.cjs.min.d.ts +499 -0
- package/dist/index.cjs.min.js +63 -0
- package/dist/index.cjs.min.js.map +1 -0
- package/dist/index.module.d.ts +499 -0
- package/dist/index.module.js +250 -0
- package/dist/index.module.js.map +1 -0
- package/package.json +48 -158
- package/.editorconfig +0 -15
- package/.eslintignore +0 -6
- package/.gitattributes +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/actions/setup/action.yml +0 -28
- package/.github/workflows/build.yml +0 -155
- package/.github/workflows/deploy.yml +0 -97
- package/.github/workflows/e2e-android.yml +0 -121
- package/.github/workflows/e2e-ios.yml +0 -95
- package/.github/workflows/snyk.yml +0 -21
- package/.gitignore +0 -70
- package/.npmignore +0 -60
- package/.nvmrc +0 -1
- package/.watchmanconfig +0 -1
- package/.yarnrc +0 -3
- package/CHANGELOG +0 -180
- package/CONTRIBUTING.md +0 -80
- package/android/build.gradle +0 -110
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradle.properties +0 -5
- package/android/gradlew +0 -234
- package/android/gradlew.bat +0 -89
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +0 -744
- package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +0 -17
- package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +0 -274
- package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +0 -233
- package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +0 -5
- package/babel.config.js +0 -3
- package/example/.watchmanconfig +0 -1
- package/example/Gemfile +0 -6
- package/example/android/app/build.gradle +0 -129
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +0 -10
- package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +0 -36
- package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +0 -21
- package/example/android/app/src/debug/AndroidManifest.xml +0 -13
- package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +0 -75
- package/example/android/app/src/main/AndroidManifest.xml +0 -26
- package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +0 -32
- package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +0 -62
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +0 -3
- package/example/android/app/src/main/res/values/styles.xml +0 -9
- package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +0 -20
- package/example/android/build.gradle +0 -31
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/example/android/gradle.properties +0 -44
- package/example/android/gradlew +0 -244
- package/example/android/gradlew.bat +0 -92
- package/example/android/settings.gradle +0 -4
- package/example/app.json +0 -4
- package/example/babel.config.js +0 -17
- package/example/detox.config.js +0 -92
- package/example/e2e/config.json +0 -10
- package/example/e2e/emitEvents.e2e.detox.js +0 -95
- package/example/e2e/environment.js +0 -23
- package/example/e2e/helpers/microCommands.js +0 -140
- package/example/e2e/helpers/microHelpers.js +0 -333
- package/example/e2e/helpers/microHelpers.test.js +0 -295
- package/example/e2e/helpers/schemas.js +0 -49
- package/example/e2e/jest.config.js +0 -16
- package/example/e2e/setup.js +0 -4
- package/example/e2e/testEvents.micro.test.js +0 -287
- package/example/index.js +0 -5
- package/example/ios/.xcode.env +0 -11
- package/example/ios/Podfile +0 -62
- package/example/ios/Podfile.lock +0 -730
- package/example/ios/ReactNativeTrackerExample/AppDelegate.h +0 -6
- package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +0 -26
- package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
- package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +0 -6
- package/example/ios/ReactNativeTrackerExample/Info.plist +0 -55
- package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +0 -47
- package/example/ios/ReactNativeTrackerExample/PrivacyInfo.xcprivacy +0 -37
- package/example/ios/ReactNativeTrackerExample/main.m +0 -10
- package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +0 -3
- package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +0 -739
- package/example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme +0 -88
- package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/ReactNativeTrackerExampleTests/Info.plist +0 -24
- package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +0 -66
- package/example/metro.config.js +0 -45
- package/example/package.json +0 -54
- package/example/react-native.config.js +0 -10
- package/example/src/App.js +0 -566
- package/example/tsconfig.json +0 -5
- package/example/yarn.lock +0 -7703
- package/ios/ReactNativeTracker-Bridging-Header.h +0 -2
- package/ios/ReactNativeTracker.mm +0 -175
- package/ios/ReactNativeTracker.swift +0 -822
- package/ios/ReactNativeTracker.xcodeproj/project.pbxproj +0 -301
- package/ios/Util/ConfigUtils.swift +0 -209
- package/ios/Util/TrackerVersion.swift +0 -3
- package/ios/Util/Utilities.swift +0 -37
- package/lefthook.yml +0 -11
- package/lib/commonjs/api.js +0 -490
- package/lib/commonjs/api.js.map +0 -1
- package/lib/commonjs/configurations.js +0 -196
- package/lib/commonjs/configurations.js.map +0 -1
- package/lib/commonjs/constants.js +0 -77
- package/lib/commonjs/constants.js.map +0 -1
- package/lib/commonjs/events.js +0 -277
- package/lib/commonjs/events.js.map +0 -1
- package/lib/commonjs/index.js +0 -132
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/jsCore.js +0 -427
- package/lib/commonjs/jsCore.js.map +0 -1
- package/lib/commonjs/native.js +0 -16
- package/lib/commonjs/native.js.map +0 -1
- package/lib/commonjs/subject.js +0 -235
- package/lib/commonjs/subject.js.map +0 -1
- package/lib/commonjs/tracker.js +0 -248
- package/lib/commonjs/tracker.js.map +0 -1
- package/lib/commonjs/types.js +0 -2
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils.js +0 -72
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/commonjs/webViewInterface.js +0 -66
- package/lib/commonjs/webViewInterface.js.map +0 -1
- package/lib/module/api.js +0 -452
- package/lib/module/api.js.map +0 -1
- package/lib/module/configurations.js +0 -184
- package/lib/module/configurations.js.map +0 -1
- package/lib/module/constants.js +0 -72
- package/lib/module/constants.js.map +0 -1
- package/lib/module/events.js +0 -259
- package/lib/module/events.js.map +0 -1
- package/lib/module/index.js +0 -120
- package/lib/module/index.js.map +0 -1
- package/lib/module/jsCore.js +0 -424
- package/lib/module/jsCore.js.map +0 -1
- package/lib/module/native.js +0 -12
- package/lib/module/native.js.map +0 -1
- package/lib/module/subject.js +0 -222
- package/lib/module/subject.js.map +0 -1
- package/lib/module/tracker.js +0 -234
- package/lib/module/tracker.js.map +0 -1
- package/lib/module/types.js +0 -2
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils.js +0 -66
- package/lib/module/utils.js.map +0 -1
- package/lib/module/webViewInterface.js +0 -62
- package/lib/module/webViewInterface.js.map +0 -1
- package/lib/typescript/__tests__/api.test.d.ts +0 -2
- package/lib/typescript/__tests__/api.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/configurations.test.d.ts +0 -2
- package/lib/typescript/__tests__/configurations.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/events.test.d.ts +0 -2
- package/lib/typescript/__tests__/events.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/index.test.d.ts +0 -2
- package/lib/typescript/__tests__/index.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/jsCore.test.d.ts +0 -2
- package/lib/typescript/__tests__/jsCore.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/utils.test.d.ts +0 -2
- package/lib/typescript/__tests__/utils.test.d.ts.map +0 -1
- package/lib/typescript/api.d.ts +0 -240
- package/lib/typescript/api.d.ts.map +0 -1
- package/lib/typescript/configurations.d.ts +0 -73
- package/lib/typescript/configurations.d.ts.map +0 -1
- package/lib/typescript/constants.d.ts +0 -64
- package/lib/typescript/constants.d.ts.map +0 -1
- package/lib/typescript/events.d.ts +0 -115
- package/lib/typescript/events.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -27
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/jsCore.d.ts +0 -152
- package/lib/typescript/jsCore.d.ts.map +0 -1
- package/lib/typescript/native.d.ts +0 -4
- package/lib/typescript/native.d.ts.map +0 -1
- package/lib/typescript/subject.d.ts +0 -91
- package/lib/typescript/subject.d.ts.map +0 -1
- package/lib/typescript/tracker.d.ts +0 -111
- package/lib/typescript/tracker.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -981
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils.d.ts +0 -35
- package/lib/typescript/utils.d.ts.map +0 -1
- package/lib/typescript/webViewInterface.d.ts +0 -15
- package/lib/typescript/webViewInterface.d.ts.map +0 -1
- package/scripts/bootstrap.js +0 -29
- package/snowplow-react-native-tracker.podspec +0 -42
- package/src/__mocks__/react-native.js +0 -7
- package/src/__tests__/api.test.ts +0 -21
- package/src/__tests__/configurations.test.ts +0 -608
- package/src/__tests__/events.test.ts +0 -736
- package/src/__tests__/index.test.ts +0 -14
- package/src/__tests__/jsCore.test.ts +0 -199
- package/src/__tests__/utils.test.ts +0 -10
- package/src/api.ts +0 -556
- package/src/configurations.ts +0 -325
- package/src/constants.ts +0 -97
- package/src/events.ts +0 -355
- package/src/index.ts +0 -184
- package/src/jsCore.ts +0 -603
- package/src/native.ts +0 -21
- package/src/subject.ts +0 -302
- package/src/tracker.ts +0 -377
- package/src/types.ts +0 -1162
- package/src/utils.ts +0 -65
- package/src/webViewInterface.ts +0 -92
- package/tsconfig.build.json +0 -5
- package/tsconfig.json +0 -28
- package/turbo.json +0 -34
- package/yarn.lock +0 -9398
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
const Micro = require('./microHelpers.js');
|
|
2
|
-
|
|
3
|
-
describe('tests helper functions of helpers.js', () => {
|
|
4
|
-
it('tests compare with null, numbers, strings, booleans', () => {
|
|
5
|
-
// null
|
|
6
|
-
expect(Micro.compare(null, null)).toBe(true);
|
|
7
|
-
expect(Micro.compare(null, [])).toBe(false);
|
|
8
|
-
expect(Micro.compare('not null', null)).toBe(false);
|
|
9
|
-
|
|
10
|
-
// numbers
|
|
11
|
-
expect(Micro.compare(1, 1)).toBe(true);
|
|
12
|
-
expect(Micro.compare(2.3, 0)).toBe(false);
|
|
13
|
-
|
|
14
|
-
// strings
|
|
15
|
-
expect(Micro.compare('a', 'a')).toBe(true);
|
|
16
|
-
expect(Micro.compare('a', 'ab')).toBe(false);
|
|
17
|
-
expect(Micro.compare('', 'b')).toBe(false);
|
|
18
|
-
|
|
19
|
-
// booleans
|
|
20
|
-
expect(Micro.compare(false, false)).toBe(true);
|
|
21
|
-
expect(Micro.compare(true, false)).toBe(false);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('tests compare with arrays', () => {
|
|
25
|
-
// arrays and nested arrays
|
|
26
|
-
expect(Micro.compare([], [])).toBe(true);
|
|
27
|
-
|
|
28
|
-
expect(Micro.compare([], [1, 2])).toBe(true);
|
|
29
|
-
|
|
30
|
-
expect(Micro.compare([1, 2], [])).toBe(false);
|
|
31
|
-
|
|
32
|
-
expect(Micro.compare([1, 2], [2])).toBe(false);
|
|
33
|
-
|
|
34
|
-
expect(Micro.compare([1, 2], [2, 1])).toBe(true);
|
|
35
|
-
|
|
36
|
-
expect(Micro.compare([1, 2, 3], [4, 2, 5, 3, 1, 6])).toBe(true);
|
|
37
|
-
|
|
38
|
-
expect(Micro.compare([1, [2, 3], 4], [5, 4, [3, 2, 0], 0, 1])).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('tests compare with objects', () => {
|
|
42
|
-
expect(Micro.compare({}, {})).toBe(true);
|
|
43
|
-
|
|
44
|
-
expect(Micro.compare({}, {a: 1})).toBe(true);
|
|
45
|
-
|
|
46
|
-
expect(Micro.compare({a: 1}, {})).toBe(false);
|
|
47
|
-
|
|
48
|
-
expect(
|
|
49
|
-
Micro.compare(
|
|
50
|
-
{
|
|
51
|
-
a: 1,
|
|
52
|
-
b: 2,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
a: 1,
|
|
56
|
-
b: 3,
|
|
57
|
-
},
|
|
58
|
-
),
|
|
59
|
-
).toBe(false);
|
|
60
|
-
|
|
61
|
-
expect(
|
|
62
|
-
Micro.compare(
|
|
63
|
-
{
|
|
64
|
-
a: 1,
|
|
65
|
-
b: 2,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
b: 2,
|
|
69
|
-
c: 3,
|
|
70
|
-
a: 1,
|
|
71
|
-
},
|
|
72
|
-
),
|
|
73
|
-
).toBe(true);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('tests compare with arrays of objects', () => {
|
|
77
|
-
// expected, actual
|
|
78
|
-
let exp, act;
|
|
79
|
-
|
|
80
|
-
exp = [
|
|
81
|
-
{
|
|
82
|
-
a: 1,
|
|
83
|
-
b: 2,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
c: 3,
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
act = [
|
|
90
|
-
{
|
|
91
|
-
c: 3,
|
|
92
|
-
e: 5,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
b: 2,
|
|
96
|
-
a: 1,
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
d: 4,
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
expect(Micro.compare(exp, act)).toBe(true);
|
|
103
|
-
|
|
104
|
-
exp = [
|
|
105
|
-
{
|
|
106
|
-
a: 1,
|
|
107
|
-
b: 2,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
c: 3,
|
|
111
|
-
},
|
|
112
|
-
];
|
|
113
|
-
act = [
|
|
114
|
-
{
|
|
115
|
-
c: 3,
|
|
116
|
-
e: 5,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
b: 2,
|
|
120
|
-
a: 2,
|
|
121
|
-
},
|
|
122
|
-
];
|
|
123
|
-
expect(Micro.compare(exp, act)).toBe(false);
|
|
124
|
-
|
|
125
|
-
exp = [
|
|
126
|
-
{
|
|
127
|
-
a: 1,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
c: [
|
|
131
|
-
{
|
|
132
|
-
d: 4,
|
|
133
|
-
e: {
|
|
134
|
-
f: 6,
|
|
135
|
-
g: [1, 2],
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
act = [
|
|
142
|
-
{
|
|
143
|
-
z: 10,
|
|
144
|
-
c: [
|
|
145
|
-
{
|
|
146
|
-
e: {
|
|
147
|
-
g: [3, 2, 1],
|
|
148
|
-
f: 6,
|
|
149
|
-
i: 2,
|
|
150
|
-
},
|
|
151
|
-
d: 4,
|
|
152
|
-
h: 7,
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
a: 1,
|
|
158
|
-
},
|
|
159
|
-
];
|
|
160
|
-
expect(Micro.compare(exp, act)).toBe(true);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('tests compare with nested objects', () => {
|
|
164
|
-
// expected, actual
|
|
165
|
-
let exp, act_1, act_2;
|
|
166
|
-
|
|
167
|
-
exp = {
|
|
168
|
-
a: {
|
|
169
|
-
b: {
|
|
170
|
-
c: [1, 2],
|
|
171
|
-
d: 'test',
|
|
172
|
-
e: 5,
|
|
173
|
-
},
|
|
174
|
-
f: 1,
|
|
175
|
-
},
|
|
176
|
-
aa: [
|
|
177
|
-
{},
|
|
178
|
-
{
|
|
179
|
-
bb: 1,
|
|
180
|
-
cc: {
|
|
181
|
-
dd: {
|
|
182
|
-
ee: {
|
|
183
|
-
ff: 0,
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
[
|
|
189
|
-
[0, 1],
|
|
190
|
-
{
|
|
191
|
-
aaa: 'bbb',
|
|
192
|
-
ccc: [
|
|
193
|
-
{
|
|
194
|
-
ddd: 3.14,
|
|
195
|
-
},
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
|
-
0,
|
|
199
|
-
],
|
|
200
|
-
true,
|
|
201
|
-
],
|
|
202
|
-
last: 'thing',
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
// "innocent" diffs
|
|
206
|
-
act_1 = {
|
|
207
|
-
diff1: 0,
|
|
208
|
-
a: {
|
|
209
|
-
b: {
|
|
210
|
-
c: [1, 2],
|
|
211
|
-
diff2: 0,
|
|
212
|
-
d: 'test',
|
|
213
|
-
e: 5,
|
|
214
|
-
},
|
|
215
|
-
diff3: [0, 0, 0],
|
|
216
|
-
f: 1,
|
|
217
|
-
},
|
|
218
|
-
aa: [
|
|
219
|
-
{},
|
|
220
|
-
['diff41', 'diff42'],
|
|
221
|
-
{
|
|
222
|
-
bb: 1,
|
|
223
|
-
cc: {
|
|
224
|
-
dd: {
|
|
225
|
-
ee: {
|
|
226
|
-
ff: 0,
|
|
227
|
-
diff6: 0,
|
|
228
|
-
},
|
|
229
|
-
diff7: {},
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
diff8: 0,
|
|
233
|
-
},
|
|
234
|
-
[
|
|
235
|
-
[0, 1],
|
|
236
|
-
['diff9'],
|
|
237
|
-
{
|
|
238
|
-
aaa: 'bbb',
|
|
239
|
-
ccc: [
|
|
240
|
-
{
|
|
241
|
-
ddd: 3.14,
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
},
|
|
245
|
-
0,
|
|
246
|
-
],
|
|
247
|
-
true,
|
|
248
|
-
],
|
|
249
|
-
last: 'thing',
|
|
250
|
-
diff0: 'last',
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
// pi
|
|
254
|
-
act_2 = {
|
|
255
|
-
a: {
|
|
256
|
-
b: {
|
|
257
|
-
c: [1, 2],
|
|
258
|
-
d: 'test',
|
|
259
|
-
e: 5,
|
|
260
|
-
},
|
|
261
|
-
f: 1,
|
|
262
|
-
},
|
|
263
|
-
aa: [
|
|
264
|
-
{},
|
|
265
|
-
{
|
|
266
|
-
bb: 1,
|
|
267
|
-
cc: {
|
|
268
|
-
dd: {
|
|
269
|
-
ee: {
|
|
270
|
-
ff: 0,
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
[
|
|
276
|
-
[0, 1],
|
|
277
|
-
{
|
|
278
|
-
aaa: 'bbb',
|
|
279
|
-
ccc: [
|
|
280
|
-
{
|
|
281
|
-
ddd: 3.1415, // only diff with exp
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
0,
|
|
286
|
-
],
|
|
287
|
-
true,
|
|
288
|
-
],
|
|
289
|
-
last: 'thing',
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
expect(Micro.compare(exp, act_1)).toBe(true);
|
|
293
|
-
expect(Micro.compare(exp, act_2)).toBe(false);
|
|
294
|
-
});
|
|
295
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Self-describing schemas
|
|
2
|
-
const appInstall =
|
|
3
|
-
'iglu:com.snowplowanalytics.mobile/application_install/jsonschema/1-0-0';
|
|
4
|
-
const screenView =
|
|
5
|
-
'iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0';
|
|
6
|
-
const adImpression =
|
|
7
|
-
'iglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0';
|
|
8
|
-
const linkClick =
|
|
9
|
-
'iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1';
|
|
10
|
-
const consentWithdrawn =
|
|
11
|
-
'iglu:com.snowplowanalytics.snowplow/consent_withdrawn/jsonschema/1-0-0';
|
|
12
|
-
const consentGranted =
|
|
13
|
-
'iglu:com.snowplowanalytics.snowplow/consent_granted/jsonschema/1-0-0';
|
|
14
|
-
const consentDoc =
|
|
15
|
-
'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0';
|
|
16
|
-
const timing = 'iglu:com.snowplowanalytics.snowplow/timing/jsonschema/1-0-0';
|
|
17
|
-
const deepLink =
|
|
18
|
-
'iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0';
|
|
19
|
-
const messageNotification =
|
|
20
|
-
'iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0';
|
|
21
|
-
|
|
22
|
-
// Context schemas
|
|
23
|
-
const mobileApplicationContext =
|
|
24
|
-
'iglu:com.snowplowanalytics.mobile/application/jsonschema/1-0-0';
|
|
25
|
-
const mobileContext =
|
|
26
|
-
'iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-3';
|
|
27
|
-
const mobileScreenContext =
|
|
28
|
-
'iglu:com.snowplowanalytics.mobile/screen/jsonschema/1-0-0';
|
|
29
|
-
const clientSessionContext =
|
|
30
|
-
'iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2';
|
|
31
|
-
const gdprContext = 'iglu:com.snowplowanalytics.snowplow/gdpr/jsonschema/1-0-0';
|
|
32
|
-
|
|
33
|
-
module.exports = {
|
|
34
|
-
appInstall,
|
|
35
|
-
screenView,
|
|
36
|
-
adImpression,
|
|
37
|
-
linkClick,
|
|
38
|
-
consentWithdrawn,
|
|
39
|
-
consentGranted,
|
|
40
|
-
consentDoc,
|
|
41
|
-
timing,
|
|
42
|
-
mobileApplicationContext,
|
|
43
|
-
mobileContext,
|
|
44
|
-
mobileScreenContext,
|
|
45
|
-
clientSessionContext,
|
|
46
|
-
gdprContext,
|
|
47
|
-
deepLink,
|
|
48
|
-
messageNotification,
|
|
49
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @type {import('jest').Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
maxWorkers: 1,
|
|
4
|
-
globalSetup: "detox/runners/jest/globalSetup",
|
|
5
|
-
globalTeardown: "detox/runners/jest/globalTeardown",
|
|
6
|
-
testEnvironment: "detox/runners/jest/testEnvironment",
|
|
7
|
-
setupFilesAfterEnv: ["./setup.js"],
|
|
8
|
-
testRunner: "jest-circus/runner",
|
|
9
|
-
testTimeout: 300000,
|
|
10
|
-
testRegex: "\\.e2e.detox\\.js$",
|
|
11
|
-
transform: {
|
|
12
|
-
"\\.tsx?$": "ts-jest"
|
|
13
|
-
},
|
|
14
|
-
reporters: ["detox/runners/jest/reporter"],
|
|
15
|
-
verbose: true
|
|
16
|
-
};
|
package/example/e2e/setup.js
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
const commands = require('./helpers/microCommands.js');
|
|
2
|
-
const schemas = require('./helpers/schemas.js');
|
|
3
|
-
|
|
4
|
-
test('no bad events', async () => {
|
|
5
|
-
await commands.assertNoBadEvents();
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
test('number of screen_view events', async () => {
|
|
9
|
-
await commands.eventsWithSchema(schemas.screenView, 9);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('number of structured events', async () => {
|
|
13
|
-
await commands.eventsWithEventType('struct', 6);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
test('number of page_view events', async () => {
|
|
17
|
-
await commands.eventsWithEventType('page_view', 4);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test('screen_view with adImpression context', async () => {
|
|
21
|
-
await commands.eventsWithProperties(
|
|
22
|
-
{
|
|
23
|
-
schema: schemas.screenView,
|
|
24
|
-
values: {
|
|
25
|
-
name: 'withContext and screenId',
|
|
26
|
-
},
|
|
27
|
-
contexts: [
|
|
28
|
-
{
|
|
29
|
-
schema: schemas.adImpression,
|
|
30
|
-
data: {
|
|
31
|
-
impressionId: 'test_imp_id',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
1
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test('self-describing ad_impression event', async () => {
|
|
41
|
-
await commands.eventsWithProperties(
|
|
42
|
-
{
|
|
43
|
-
schema: schemas.linkClick,
|
|
44
|
-
values: {
|
|
45
|
-
targetUrl: 'test.test',
|
|
46
|
-
},
|
|
47
|
-
contexts: [
|
|
48
|
-
{ schema: schemas.mobileApplicationContext },
|
|
49
|
-
{ schema: schemas.mobileContext },
|
|
50
|
-
{ schema: schemas.mobileScreenContext },
|
|
51
|
-
{ schema: schemas.clientSessionContext },
|
|
52
|
-
{ schema: schemas.gdprContext },
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
1
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('consentWithdrawn event', async () => {
|
|
60
|
-
await commands.eventsWithProperties(
|
|
61
|
-
{
|
|
62
|
-
schema: schemas.consentWithdrawn,
|
|
63
|
-
values: {
|
|
64
|
-
all: true,
|
|
65
|
-
},
|
|
66
|
-
contexts: [
|
|
67
|
-
{
|
|
68
|
-
schema: schemas.consentDoc,
|
|
69
|
-
data: {
|
|
70
|
-
id: '0987',
|
|
71
|
-
version: '0.2.0',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
1
|
|
77
|
-
);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test('consentGranted event', async () => {
|
|
81
|
-
await commands.eventsWithProperties(
|
|
82
|
-
{
|
|
83
|
-
schema: schemas.consentGranted,
|
|
84
|
-
values: {
|
|
85
|
-
expiry: '2022-01-01T00:00:00Z',
|
|
86
|
-
},
|
|
87
|
-
contexts: [
|
|
88
|
-
{
|
|
89
|
-
schema: schemas.consentDoc,
|
|
90
|
-
data: {
|
|
91
|
-
id: '0123',
|
|
92
|
-
version: '0.1.0',
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
1
|
|
98
|
-
);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test('timing event', async () => {
|
|
102
|
-
await commands.eventsWithProperties(
|
|
103
|
-
{
|
|
104
|
-
schema: schemas.timing,
|
|
105
|
-
values: {
|
|
106
|
-
variable: 'testTimingVariable',
|
|
107
|
-
category: 'testTimingCategory',
|
|
108
|
-
timing: 10,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
1
|
|
112
|
-
);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test('transaction item event', async () => {
|
|
116
|
-
await commands.eventsWithProperties(
|
|
117
|
-
{
|
|
118
|
-
parameters: {
|
|
119
|
-
event: 'transaction_item',
|
|
120
|
-
ti_orderid: '0000',
|
|
121
|
-
ti_sku: '123',
|
|
122
|
-
ti_price: 5,
|
|
123
|
-
ti_quantity: 2,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
1
|
|
127
|
-
);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
test('ecommerce transaction event', async () => {
|
|
131
|
-
await commands.eventsWithProperties(
|
|
132
|
-
{
|
|
133
|
-
parameters: {
|
|
134
|
-
event: 'transaction',
|
|
135
|
-
tr_orderid: '0000',
|
|
136
|
-
tr_total: 10,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
1
|
|
140
|
-
);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
test('deep link event', async () => {
|
|
144
|
-
await commands.eventsWithProperties(
|
|
145
|
-
{
|
|
146
|
-
schema: schemas.deepLink,
|
|
147
|
-
values: {
|
|
148
|
-
url: 'https://deeplink.com',
|
|
149
|
-
referrer: 'http://refr.com',
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
1
|
|
153
|
-
);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
test('message notification event', async () => {
|
|
157
|
-
await commands.eventsWithProperties(
|
|
158
|
-
{
|
|
159
|
-
schema: schemas.messageNotification,
|
|
160
|
-
values: {
|
|
161
|
-
title: 'title1',
|
|
162
|
-
body: 'body1',
|
|
163
|
-
trigger: 'push',
|
|
164
|
-
action: 'action1',
|
|
165
|
-
attachments: [
|
|
166
|
-
{
|
|
167
|
-
identifier: 'att_id1',
|
|
168
|
-
type: 'att_type1',
|
|
169
|
-
url: 'http://att.url.1',
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
bodyLocArgs: ['bodyArg1', 'bodyArg2'],
|
|
173
|
-
bodyLocKey: 'bodyKey1',
|
|
174
|
-
category: 'category1',
|
|
175
|
-
contentAvailable: true,
|
|
176
|
-
group: 'group1',
|
|
177
|
-
icon: 'icon1',
|
|
178
|
-
notificationCount: 3,
|
|
179
|
-
notificationTimestamp: '2022-02-02T15:17:42.767Z',
|
|
180
|
-
sound: 'sound1',
|
|
181
|
-
subtitle: 'subtitle1',
|
|
182
|
-
tag: 'tag1',
|
|
183
|
-
threadIdentifier: 'threadIdentifier1',
|
|
184
|
-
titleLocArgs: ['titleArg1', 'titleArg2'],
|
|
185
|
-
titleLocKey: 'titleKey1',
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
1
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
test('common in all first tracker events', async () => {
|
|
193
|
-
await commands.eventsWithProperties(
|
|
194
|
-
{
|
|
195
|
-
parameters: {
|
|
196
|
-
app_id: 'DemoAppId',
|
|
197
|
-
platform: 'iot',
|
|
198
|
-
name_tracker: 'sp1',
|
|
199
|
-
},
|
|
200
|
-
header: 'test: works',
|
|
201
|
-
contexts: [
|
|
202
|
-
{ schema: schemas.mobileApplicationContext },
|
|
203
|
-
{ schema: schemas.mobileContext },
|
|
204
|
-
{ schema: schemas.mobileScreenContext },
|
|
205
|
-
{ schema: schemas.clientSessionContext },
|
|
206
|
-
{
|
|
207
|
-
schema: schemas.gdprContext,
|
|
208
|
-
data: {
|
|
209
|
-
basisForProcessing: 'consent',
|
|
210
|
-
documentDescription: 'test gdpr document',
|
|
211
|
-
documentId: 'docId',
|
|
212
|
-
documentVersion: '0.0.1',
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
schema: schemas.adImpression,
|
|
217
|
-
data: { impressionId: 'test_global_contexts_0' },
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
schema: schemas.adImpression,
|
|
221
|
-
data: { impressionId: 'test_global_contexts_1' },
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
29
|
|
226
|
-
);
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
test('events after resetting the Subject', async () => {
|
|
230
|
-
await commands.eventsWithProperties(
|
|
231
|
-
{
|
|
232
|
-
parameters: {
|
|
233
|
-
user_id: 'nextTester',
|
|
234
|
-
dvce_screenwidth: 300,
|
|
235
|
-
dvce_screenheight: 300,
|
|
236
|
-
br_lang: 'es',
|
|
237
|
-
os_timezone: 'Europe/London',
|
|
238
|
-
},
|
|
239
|
-
schema: schemas.screenView,
|
|
240
|
-
values: {
|
|
241
|
-
name: 'afterSetSubjectTestSV',
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
1
|
|
245
|
-
);
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
test('second tracker events', async () => {
|
|
249
|
-
await commands.eventsWithProperties(
|
|
250
|
-
{
|
|
251
|
-
parameters: {
|
|
252
|
-
name_tracker: 'sp2',
|
|
253
|
-
},
|
|
254
|
-
contexts: [
|
|
255
|
-
{ schema: schemas.mobileApplicationContext },
|
|
256
|
-
{ schema: schemas.mobileContext },
|
|
257
|
-
{ schema: schemas.mobileScreenContext },
|
|
258
|
-
{ schema: schemas.clientSessionContext },
|
|
259
|
-
],
|
|
260
|
-
},
|
|
261
|
-
2
|
|
262
|
-
);
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
test('anonymous tracker events', async () => {
|
|
266
|
-
await commands.eventsWithProperties(
|
|
267
|
-
{
|
|
268
|
-
parameters: {
|
|
269
|
-
name_tracker: 'sp_anon',
|
|
270
|
-
network_userid: '00000000-0000-0000-0000-000000000000',
|
|
271
|
-
},
|
|
272
|
-
event: {
|
|
273
|
-
contexts: {
|
|
274
|
-
data: [
|
|
275
|
-
{
|
|
276
|
-
schema: schemas.clientSessionContext,
|
|
277
|
-
data: {
|
|
278
|
-
userId: '00000000-0000-0000-0000-000000000000',
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
],
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
2
|
|
286
|
-
);
|
|
287
|
-
});
|
package/example/index.js
DELETED
package/example/ios/.xcode.env
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# This `.xcode.env` file is versioned and is used to source the environment
|
|
2
|
-
# used when running script phases inside Xcode.
|
|
3
|
-
# To customize your local environment, you can create an `.xcode.env.local`
|
|
4
|
-
# file that is not versioned.
|
|
5
|
-
|
|
6
|
-
# NODE_BINARY variable contains the PATH to the node executable.
|
|
7
|
-
#
|
|
8
|
-
# Customize the NODE_BINARY variable here.
|
|
9
|
-
# For example, to use nvm with brew, add the following line
|
|
10
|
-
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
11
|
-
export NODE_BINARY=$(command -v node)
|