kv-test-lib 1.0.21 → 1.0.22
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/dist/kochava.d.ts +6 -1
- package/dist/kochava.js +37 -7
- package/package.json +3 -3
package/dist/kochava.d.ts
CHANGED
|
@@ -30,7 +30,12 @@ export interface KochavaInstance {
|
|
|
30
30
|
export declare class Kochava {
|
|
31
31
|
private instance;
|
|
32
32
|
private jobQueue;
|
|
33
|
-
constructor();
|
|
33
|
+
private constructor();
|
|
34
|
+
static create(): Kochava;
|
|
35
|
+
static createWithNode(): Kochava;
|
|
36
|
+
static createWithReact(): Kochava;
|
|
37
|
+
static createWithVue(): Kochava;
|
|
38
|
+
static createWithAngular(): Kochava;
|
|
34
39
|
useCookies(condition?: boolean): void;
|
|
35
40
|
disableAutoPage(condition?: boolean): void;
|
|
36
41
|
startWithAppGuid(appGuid: string): void;
|
package/dist/kochava.js
CHANGED
|
@@ -16,6 +16,29 @@ export class Kochava {
|
|
|
16
16
|
this.resetInstance();
|
|
17
17
|
this.jobQueue = new JobQueue();
|
|
18
18
|
}
|
|
19
|
+
static create() {
|
|
20
|
+
return new Kochava();
|
|
21
|
+
}
|
|
22
|
+
static createWithNode() {
|
|
23
|
+
const kochava = new Kochava();
|
|
24
|
+
kochava.executeAdvancedInstruction("wrapper", JSON.stringify({ name: "Node", version: "3.0.0" }));
|
|
25
|
+
return kochava;
|
|
26
|
+
}
|
|
27
|
+
static createWithReact() {
|
|
28
|
+
const kochava = new Kochava();
|
|
29
|
+
kochava.executeAdvancedInstruction("wrapper", JSON.stringify({ name: "React", version: "3.0.0" }));
|
|
30
|
+
return kochava;
|
|
31
|
+
}
|
|
32
|
+
static createWithVue() {
|
|
33
|
+
const kochava = new Kochava();
|
|
34
|
+
kochava.executeAdvancedInstruction("wrapper", JSON.stringify({ name: "Vue", version: "3.0.0" }));
|
|
35
|
+
return kochava;
|
|
36
|
+
}
|
|
37
|
+
static createWithAngular() {
|
|
38
|
+
const kochava = new Kochava();
|
|
39
|
+
kochava.executeAdvancedInstruction("wrapper", JSON.stringify({ name: "Angular", version: "3.0.0" }));
|
|
40
|
+
return kochava;
|
|
41
|
+
}
|
|
19
42
|
/*
|
|
20
43
|
Set if the SDK should also store persisted values in cookie storage.
|
|
21
44
|
- Not all values can be persisted in cookies, such as event/idlink queues
|
|
@@ -118,7 +141,16 @@ export class Kochava {
|
|
|
118
141
|
case "wrapper":
|
|
119
142
|
{
|
|
120
143
|
const wrapperVersion = JSON.parse(valueStr);
|
|
121
|
-
|
|
144
|
+
if (!this.instance.version)
|
|
145
|
+
this.instance.version = "WebTracker 3.0.0";
|
|
146
|
+
switch (wrapperVersion.name) {
|
|
147
|
+
case "Angular":
|
|
148
|
+
this.instance.version += ` (${wrapperVersion.name} ${wrapperVersion.version})`;
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
this.instance.version += ` (${wrapperVersion.name})`;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
122
154
|
}
|
|
123
155
|
break;
|
|
124
156
|
case "urls":
|
|
@@ -290,7 +322,7 @@ export class Kochava {
|
|
|
290
322
|
disableAutoPage: false,
|
|
291
323
|
useCookies: false,
|
|
292
324
|
sleep: false,
|
|
293
|
-
version: "
|
|
325
|
+
version: "",
|
|
294
326
|
buildDate: "",
|
|
295
327
|
overrideUrls: {
|
|
296
328
|
init: "",
|
|
@@ -315,8 +347,8 @@ export class Kochava {
|
|
|
315
347
|
this.instance.appGuid = appGuid;
|
|
316
348
|
this.instance.disableAutoPage = this.instance.disableAutoPage || false;
|
|
317
349
|
this.instance.useCookies = this.instance.useCookies || false;
|
|
318
|
-
this.instance.version = "
|
|
319
|
-
this.instance.buildDate = "kbd: 3/31/2022,
|
|
350
|
+
this.instance.version = this.instance.version || "WebTracker 3.0.0";
|
|
351
|
+
this.instance.buildDate = "kbd: 3/31/2022, 10:12:19 AM";
|
|
320
352
|
this.instance.kochavaSession = utils.uuidv4().substring(0, 5);
|
|
321
353
|
this.instance.startTimeMS = utils.getCurrTimeMS();
|
|
322
354
|
this.instance.retryWaterfall = [7, 30, 300, 1800];
|
|
@@ -433,6 +465,4 @@ export class Kochava {
|
|
|
433
465
|
updatePersistedValue(PersistKey.IdLinkQueue, JSON.stringify(this.jobQueue.idLinkQueue), false);
|
|
434
466
|
}
|
|
435
467
|
}
|
|
436
|
-
window.kochava = new Kochava();
|
|
437
|
-
|
|
438
|
-
window.kochava.executeAdvancedInstruction('wrapper', JSON.stringify({name: 'Node', version: '3.0.0'}));
|
|
468
|
+
// window.kochava = new Kochava();
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "kv-test-lib",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.22",
|
|
5
5
|
"main": "dist/kochava.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/"
|
|
8
8
|
],
|
|
9
9
|
"description": "",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsc -p ../../src/tsconfig.node.json
|
|
12
|
-
"test": "tsc -p .
|
|
11
|
+
"build": "tsc -p ../../src/tsconfig.node.json",
|
|
12
|
+
"test": "tsc -p ."
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"playwright": "^1.16.3",
|