@jitsu/js 1.1.0-canary.212.20230220173912 → 1.1.0-canary.344.20230430234929
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/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-clean.log +1 -1
- package/__tests__/node/nodejs.test.ts +0 -3
- package/dist/jitsu.cjs.js +4 -2
- package/dist/jitsu.d.ts +1 -1
- package/dist/jitsu.es.js +4 -2
- package/dist/web/p.js.txt +4 -2
- package/package.json +5 -4
- package/src/analytics-plugin.ts +4 -2
- package/src/jitsu.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@jitsu/js:build: cache hit, replaying output [
|
|
1
|
+
@jitsu/js:build: cache hit, replaying output [2m126f0e7238465aa8[0m
|
|
2
2
|
[33m@jitsu/js:build: [0m
|
|
3
3
|
[33m@jitsu/js:build: [0m> @jitsu/js@0.0.0 build /Users/vklmn/dev2/onetag/libs/jitsu-js
|
|
4
4
|
[33m@jitsu/js:build: [0m> tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[33m@jitsu/js:build: [0m[36m
|
|
7
7
|
[33m@jitsu/js:build: [0m[1m./compiled/src/browser.js[22m → [1mdist/web/p.js.txt[22m...[39m
|
|
8
8
|
[33m@jitsu/js:build: [0m[1m[33m(!) "this" has been rewritten to "undefined"[39m[22m
|
|
9
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/
|
|
9
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#error-this-is-undefined[39m
|
|
10
10
|
[33m@jitsu/js:build: [0m[1mcompiled/src/analytics-plugin.js[22m
|
|
11
11
|
[33m@jitsu/js:build: [0m[90m1: /* global analytics */
|
|
12
12
|
[33m@jitsu/js:build: [0m2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
[33m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
25
25
|
[33m@jitsu/js:build: [0mcompiled/src/analytics-plugin.js -> compiled/src/destination-plugins.js -> compiled/src/analytics-plugin.js
|
|
26
26
|
[33m@jitsu/js:build: [0m[1m[33m(!) Use of eval is strongly discouraged[39m[22m
|
|
27
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/
|
|
27
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#avoiding-eval[39m
|
|
28
28
|
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins.js[22m
|
|
29
29
|
[33m@jitsu/js:build: [0m[90m75: })()`;
|
|
30
30
|
[33m@jitsu/js:build: [0m76: try {
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
[33m@jitsu/js:build: [0m ^
|
|
33
33
|
[33m@jitsu/js:build: [0m78: }
|
|
34
34
|
[33m@jitsu/js:build: [0m79: catch (e) {[39m
|
|
35
|
-
[33m@jitsu/js:build: [0m[32mcreated [1mdist/web/p.js.txt[22m in [
|
|
35
|
+
[33m@jitsu/js:build: [0m[32mcreated [1mdist/web/p.js.txt[22m in [1m872ms[22m[39m
|
|
36
36
|
[33m@jitsu/js:build: [0m[36m
|
|
37
37
|
[33m@jitsu/js:build: [0m[1m./compiled/src/index.js, ./compiled/src/jitsu.js, ./compiled/src/analytics-plugin.js[22m → [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m...[39m
|
|
38
38
|
[33m@jitsu/js:build: [0m[1m[33m(!) "this" has been rewritten to "undefined"[39m[22m
|
|
39
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/
|
|
39
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#error-this-is-undefined[39m
|
|
40
40
|
[33m@jitsu/js:build: [0m[1mcompiled/src/analytics-plugin.js[22m
|
|
41
41
|
[33m@jitsu/js:build: [0m[90m1: /* global analytics */
|
|
42
42
|
[33m@jitsu/js:build: [0m2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
[33m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
55
55
|
[33m@jitsu/js:build: [0mcompiled/src/analytics-plugin.js -> compiled/src/destination-plugins.js -> compiled/src/analytics-plugin.js
|
|
56
56
|
[33m@jitsu/js:build: [0m[1m[33m(!) Use of eval is strongly discouraged[39m[22m
|
|
57
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/
|
|
57
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#avoiding-eval[39m
|
|
58
58
|
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins.js[22m
|
|
59
59
|
[33m@jitsu/js:build: [0m[90m75: })()`;
|
|
60
60
|
[33m@jitsu/js:build: [0m76: try {
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
[33m@jitsu/js:build: [0m ^
|
|
63
63
|
[33m@jitsu/js:build: [0m78: }
|
|
64
64
|
[33m@jitsu/js:build: [0m79: catch (e) {[39m
|
|
65
|
-
[33m@jitsu/js:build: [0m[32mcreated [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m in [
|
|
65
|
+
[33m@jitsu/js:build: [0m[32mcreated [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m in [1m504ms[22m[39m
|
package/.turbo/turbo-clean.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@jitsu/js:clean: cache hit, replaying output [
|
|
1
|
+
@jitsu/js:clean: cache hit, replaying output [2ma45f0a4478c12277[0m
|
|
2
2
|
[33m@jitsu/js:clean: [0m
|
|
3
3
|
[33m@jitsu/js:clean: [0m> @jitsu/js@0.0.0 clean /Users/vklmn/dev2/onetag/libs/jitsu-js
|
|
4
4
|
[33m@jitsu/js:clean: [0m> rm -rf ./dist
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
1
|
import { createServer, SimpleSyrup } from "../simple-syrup";
|
|
4
|
-
import process from "process";
|
|
5
2
|
import { AnalyticsClientEvent, AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
6
3
|
|
|
7
4
|
const jitsuAnalytics = require("../../dist/jitsu.cjs.js").jitsuAnalytics;
|
package/dist/jitsu.cjs.js
CHANGED
|
@@ -469,7 +469,9 @@ function processDestinations(destinations, method, event, debug, analyticsInstan
|
|
|
469
469
|
const plugin = internalDestinationPlugins[destination.deviceOptions.name];
|
|
470
470
|
if (plugin) {
|
|
471
471
|
try {
|
|
472
|
-
|
|
472
|
+
//to support old versions, where credentials were stored in root
|
|
473
|
+
const credentials = destination.credentials || destination;
|
|
474
|
+
promises.push(plugin.handle(credentials, event));
|
|
473
475
|
}
|
|
474
476
|
catch (e) {
|
|
475
477
|
console.warn(`[JITSU] Error processing event with internal plugin '${destination.deviceOptions.name}': ${e === null || e === void 0 ? void 0 : e.message}`, e);
|
|
@@ -526,12 +528,12 @@ function send(method, payload, jitsuConfig, instance, store) {
|
|
|
526
528
|
if (!fetch) {
|
|
527
529
|
throw new Error("Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope");
|
|
528
530
|
}
|
|
529
|
-
const authHeader = {};
|
|
530
531
|
const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
|
|
531
532
|
// if (jitsuConfig.debug) {
|
|
532
533
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
533
534
|
// }
|
|
534
535
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
536
|
+
const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
|
|
535
537
|
return fetch(url, {
|
|
536
538
|
method: "POST",
|
|
537
539
|
headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
|
package/dist/jitsu.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type JitsuOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
debug?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Explicitly specify cookie domain. If not set, cookie domain will be set to top level
|
|
19
19
|
* of the current domain. Example: if JS lives on "app.example.com", cookie domain will be
|
|
20
20
|
* set to ".example.com". If it lives on "example.com", cookie domain will be set to ".example.com" too
|
|
21
21
|
*/
|
package/dist/jitsu.es.js
CHANGED
|
@@ -467,7 +467,9 @@ function processDestinations(destinations, method, event, debug, analyticsInstan
|
|
|
467
467
|
const plugin = internalDestinationPlugins[destination.deviceOptions.name];
|
|
468
468
|
if (plugin) {
|
|
469
469
|
try {
|
|
470
|
-
|
|
470
|
+
//to support old versions, where credentials were stored in root
|
|
471
|
+
const credentials = destination.credentials || destination;
|
|
472
|
+
promises.push(plugin.handle(credentials, event));
|
|
471
473
|
}
|
|
472
474
|
catch (e) {
|
|
473
475
|
console.warn(`[JITSU] Error processing event with internal plugin '${destination.deviceOptions.name}': ${e === null || e === void 0 ? void 0 : e.message}`, e);
|
|
@@ -524,12 +526,12 @@ function send(method, payload, jitsuConfig, instance, store) {
|
|
|
524
526
|
if (!fetch) {
|
|
525
527
|
throw new Error("Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope");
|
|
526
528
|
}
|
|
527
|
-
const authHeader = {};
|
|
528
529
|
const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
|
|
529
530
|
// if (jitsuConfig.debug) {
|
|
530
531
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
531
532
|
// }
|
|
532
533
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
534
|
+
const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
|
|
533
535
|
return fetch(url, {
|
|
534
536
|
method: "POST",
|
|
535
537
|
headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
|
package/dist/web/p.js.txt
CHANGED
|
@@ -470,7 +470,9 @@
|
|
|
470
470
|
const plugin = internalDestinationPlugins[destination.deviceOptions.name];
|
|
471
471
|
if (plugin) {
|
|
472
472
|
try {
|
|
473
|
-
|
|
473
|
+
//to support old versions, where credentials were stored in root
|
|
474
|
+
const credentials = destination.credentials || destination;
|
|
475
|
+
promises.push(plugin.handle(credentials, event));
|
|
474
476
|
}
|
|
475
477
|
catch (e) {
|
|
476
478
|
console.warn(`[JITSU] Error processing event with internal plugin '${destination.deviceOptions.name}': ${e === null || e === void 0 ? void 0 : e.message}`, e);
|
|
@@ -527,12 +529,12 @@
|
|
|
527
529
|
if (!fetch) {
|
|
528
530
|
throw new Error("Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope");
|
|
529
531
|
}
|
|
530
|
-
const authHeader = {};
|
|
531
532
|
const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
|
|
532
533
|
// if (jitsuConfig.debug) {
|
|
533
534
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
534
535
|
// }
|
|
535
536
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
537
|
+
const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
|
|
536
538
|
return fetch(url, {
|
|
537
539
|
method: "POST",
|
|
538
540
|
headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitsu/js",
|
|
3
|
-
"version": "1.1.0-canary.
|
|
3
|
+
"version": "1.1.0-canary.344.20230430234929",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Jitsu Dev Team <dev@jitsu.com>",
|
|
6
6
|
"main": "dist/jitsu.cjs.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"private": false,
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@playwright/test": "
|
|
15
|
+
"@playwright/test": "1.31.2",
|
|
16
16
|
"@rollup/plugin-commonjs": "^23.0.2",
|
|
17
17
|
"@rollup/plugin-json": "^5.0.1",
|
|
18
18
|
"@rollup/plugin-multi-entry": "^6.0.0",
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
"node-forge": "^1.3.1",
|
|
33
33
|
"raw-loader": "^4.0.2",
|
|
34
34
|
"rollup": "^3.2.5",
|
|
35
|
-
"ts-jest": "
|
|
36
|
-
"
|
|
35
|
+
"ts-jest": "29.0.5",
|
|
36
|
+
"typescript": "^4.9.5",
|
|
37
|
+
"@jitsu/protocols": "1.1.0-canary.344.20230430234929"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"analytics": "^0.8.1"
|
package/src/analytics-plugin.ts
CHANGED
|
@@ -319,7 +319,9 @@ async function processDestinations(
|
|
|
319
319
|
const plugin = internalDestinationPlugins[destination.deviceOptions.name];
|
|
320
320
|
if (plugin) {
|
|
321
321
|
try {
|
|
322
|
-
|
|
322
|
+
//to support old versions, where credentials were stored in root
|
|
323
|
+
const credentials = destination.credentials || destination;
|
|
324
|
+
promises.push(plugin.handle(credentials, event));
|
|
323
325
|
} catch (e) {
|
|
324
326
|
console.warn(
|
|
325
327
|
`[JITSU] Error processing event with internal plugin '${destination.deviceOptions.name}': ${e?.message}`,
|
|
@@ -400,13 +402,13 @@ function send(
|
|
|
400
402
|
"Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope"
|
|
401
403
|
);
|
|
402
404
|
}
|
|
403
|
-
const authHeader = {};
|
|
404
405
|
const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
|
|
405
406
|
|
|
406
407
|
// if (jitsuConfig.debug) {
|
|
407
408
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
408
409
|
// }
|
|
409
410
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
411
|
+
const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
|
|
410
412
|
return fetch(url, {
|
|
411
413
|
method: "POST",
|
|
412
414
|
headers: {
|
package/src/jitsu.ts
CHANGED
|
@@ -16,7 +16,7 @@ type JitsuOptions = {
|
|
|
16
16
|
*/
|
|
17
17
|
debug?: boolean;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Explicitly specify cookie domain. If not set, cookie domain will be set to top level
|
|
20
20
|
* of the current domain. Example: if JS lives on "app.example.com", cookie domain will be
|
|
21
21
|
* set to ".example.com". If it lives on "example.com", cookie domain will be set to ".example.com" too
|
|
22
22
|
*/
|