@jitsu/js 1.1.2 → 1.2.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.
- package/LICENSE +21 -0
- package/__tests__/playwright/integration.test.ts +1 -1
- package/dist/jitsu.cjs.js +27 -7
- package/dist/jitsu.es.js +27 -7
- package/dist/web/p.js.txt +27 -7
- package/package.json +2 -2
- package/src/analytics-plugin.ts +17 -3
- package/src/destination-plugins/index.ts +18 -6
- package/.turbo/turbo-build.log +0 -95
- package/.turbo/turbo-clean.log +0 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Jitsu Labs, Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -202,7 +202,7 @@ test("basic", async ({ browser }) => {
|
|
|
202
202
|
expect(anonymousId).toBeDefined();
|
|
203
203
|
expect(cookies["__eventn_uid"]).toBe("user1");
|
|
204
204
|
expect(cookies["__eventn_id_usr"]).toBeDefined();
|
|
205
|
-
expect(JSON.parse(cookies["__eventn_id_usr"]).email).toEqual("john.doe@gmail.com");
|
|
205
|
+
expect(JSON.parse(decodeURIComponent(cookies["__eventn_id_usr"])).email).toEqual("john.doe@gmail.com");
|
|
206
206
|
let identifies = requestLog.filter(x => x.type === "identify");
|
|
207
207
|
let pages = requestLog.filter(x => x.type === "page");
|
|
208
208
|
let tracks = requestLog.filter(x => x.type === "track");
|
package/dist/jitsu.cjs.js
CHANGED
|
@@ -391,10 +391,17 @@ function satisfyDomainFilter(filter, subject) {
|
|
|
391
391
|
}
|
|
392
392
|
function applyFilters(event, creds) {
|
|
393
393
|
const { hosts = "*", events = "*" } = creds;
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
394
|
+
try {
|
|
395
|
+
const eventsArray = Array.isArray(events) ? events : events.split("\n");
|
|
396
|
+
const hostsArray = Array.isArray(hosts) ? hosts : hosts.split("\n");
|
|
397
|
+
return (!!hostsArray.find(hostFilter => { var _a; return satisfyDomainFilter(hostFilter, (_a = event.context) === null || _a === void 0 ? void 0 : _a.host); }) &&
|
|
398
|
+
(!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.type)) ||
|
|
399
|
+
!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.event))));
|
|
400
|
+
}
|
|
401
|
+
catch (e) {
|
|
402
|
+
console.warn(`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}. Values`, events, hosts);
|
|
403
|
+
throw new Error(`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}`);
|
|
404
|
+
}
|
|
398
405
|
}
|
|
399
406
|
const internalDestinationPlugins = {
|
|
400
407
|
[tagPlugin.id]: tagPlugin,
|
|
@@ -506,7 +513,7 @@ const defaultCookie2Key = {
|
|
|
506
513
|
const cookieStorage = (cookieDomain, key2cookie) => {
|
|
507
514
|
return {
|
|
508
515
|
setItem(key, val) {
|
|
509
|
-
const strVal = typeof val === "object" && val !== null ? JSON.stringify(val) : val;
|
|
516
|
+
const strVal = typeof val === "object" && val !== null ? encodeURIComponent(JSON.stringify(val)) : val;
|
|
510
517
|
const cookieName = key2cookie[key] || key;
|
|
511
518
|
setCookie(cookieName, strVal, {
|
|
512
519
|
domain: cookieDomain,
|
|
@@ -661,7 +668,7 @@ function adjustPayload(payload, config, storage) {
|
|
|
661
668
|
},
|
|
662
669
|
campaign: parseUtms(query),
|
|
663
670
|
};
|
|
664
|
-
const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey:
|
|
671
|
+
const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), context: deepMerge(context, customContext) });
|
|
665
672
|
delete withContext.meta;
|
|
666
673
|
delete withContext.options;
|
|
667
674
|
return withContext;
|
|
@@ -734,6 +741,18 @@ function validateWriteKey(writeKey) {
|
|
|
734
741
|
}
|
|
735
742
|
return writeKey;
|
|
736
743
|
}
|
|
744
|
+
function maskWriteKey(writeKey) {
|
|
745
|
+
if (writeKey) {
|
|
746
|
+
const [id, secret] = writeKey.split(":", 2);
|
|
747
|
+
if (secret) {
|
|
748
|
+
return `${id}:***`;
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
return "***";
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return writeKey;
|
|
755
|
+
}
|
|
737
756
|
function send(method, payload, jitsuConfig, instance, store) {
|
|
738
757
|
if (jitsuConfig.echoEvents) {
|
|
739
758
|
console.log(`[JITSU] sending '${method}' event:`, payload);
|
|
@@ -749,7 +768,7 @@ function send(method, payload, jitsuConfig, instance, store) {
|
|
|
749
768
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
750
769
|
// }
|
|
751
770
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
752
|
-
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key":
|
|
771
|
+
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key": jitsuConfig.writeKey } : {};
|
|
753
772
|
return fetch(url, {
|
|
754
773
|
method: "POST",
|
|
755
774
|
headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
|
|
@@ -817,6 +836,7 @@ const jitsuAnalyticsPlugin = (pluginConfig = {}) => {
|
|
|
817
836
|
if (!config.host && !config.echoEvents) {
|
|
818
837
|
throw new Error("Please specify host variable in jitsu plugin initialization, or set echoEvents to true");
|
|
819
838
|
}
|
|
839
|
+
validateWriteKey(config.writeKey);
|
|
820
840
|
},
|
|
821
841
|
page: args => {
|
|
822
842
|
const { payload, config, instance } = args;
|
package/dist/jitsu.es.js
CHANGED
|
@@ -389,10 +389,17 @@ function satisfyDomainFilter(filter, subject) {
|
|
|
389
389
|
}
|
|
390
390
|
function applyFilters(event, creds) {
|
|
391
391
|
const { hosts = "*", events = "*" } = creds;
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
392
|
+
try {
|
|
393
|
+
const eventsArray = Array.isArray(events) ? events : events.split("\n");
|
|
394
|
+
const hostsArray = Array.isArray(hosts) ? hosts : hosts.split("\n");
|
|
395
|
+
return (!!hostsArray.find(hostFilter => { var _a; return satisfyDomainFilter(hostFilter, (_a = event.context) === null || _a === void 0 ? void 0 : _a.host); }) &&
|
|
396
|
+
(!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.type)) ||
|
|
397
|
+
!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.event))));
|
|
398
|
+
}
|
|
399
|
+
catch (e) {
|
|
400
|
+
console.warn(`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}. Values`, events, hosts);
|
|
401
|
+
throw new Error(`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}`);
|
|
402
|
+
}
|
|
396
403
|
}
|
|
397
404
|
const internalDestinationPlugins = {
|
|
398
405
|
[tagPlugin.id]: tagPlugin,
|
|
@@ -504,7 +511,7 @@ const defaultCookie2Key = {
|
|
|
504
511
|
const cookieStorage = (cookieDomain, key2cookie) => {
|
|
505
512
|
return {
|
|
506
513
|
setItem(key, val) {
|
|
507
|
-
const strVal = typeof val === "object" && val !== null ? JSON.stringify(val) : val;
|
|
514
|
+
const strVal = typeof val === "object" && val !== null ? encodeURIComponent(JSON.stringify(val)) : val;
|
|
508
515
|
const cookieName = key2cookie[key] || key;
|
|
509
516
|
setCookie(cookieName, strVal, {
|
|
510
517
|
domain: cookieDomain,
|
|
@@ -659,7 +666,7 @@ function adjustPayload(payload, config, storage) {
|
|
|
659
666
|
},
|
|
660
667
|
campaign: parseUtms(query),
|
|
661
668
|
};
|
|
662
|
-
const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey:
|
|
669
|
+
const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), context: deepMerge(context, customContext) });
|
|
663
670
|
delete withContext.meta;
|
|
664
671
|
delete withContext.options;
|
|
665
672
|
return withContext;
|
|
@@ -732,6 +739,18 @@ function validateWriteKey(writeKey) {
|
|
|
732
739
|
}
|
|
733
740
|
return writeKey;
|
|
734
741
|
}
|
|
742
|
+
function maskWriteKey(writeKey) {
|
|
743
|
+
if (writeKey) {
|
|
744
|
+
const [id, secret] = writeKey.split(":", 2);
|
|
745
|
+
if (secret) {
|
|
746
|
+
return `${id}:***`;
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
return "***";
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return writeKey;
|
|
753
|
+
}
|
|
735
754
|
function send(method, payload, jitsuConfig, instance, store) {
|
|
736
755
|
if (jitsuConfig.echoEvents) {
|
|
737
756
|
console.log(`[JITSU] sending '${method}' event:`, payload);
|
|
@@ -747,7 +766,7 @@ function send(method, payload, jitsuConfig, instance, store) {
|
|
|
747
766
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
748
767
|
// }
|
|
749
768
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
750
|
-
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key":
|
|
769
|
+
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key": jitsuConfig.writeKey } : {};
|
|
751
770
|
return fetch(url, {
|
|
752
771
|
method: "POST",
|
|
753
772
|
headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
|
|
@@ -815,6 +834,7 @@ const jitsuAnalyticsPlugin = (pluginConfig = {}) => {
|
|
|
815
834
|
if (!config.host && !config.echoEvents) {
|
|
816
835
|
throw new Error("Please specify host variable in jitsu plugin initialization, or set echoEvents to true");
|
|
817
836
|
}
|
|
837
|
+
validateWriteKey(config.writeKey);
|
|
818
838
|
},
|
|
819
839
|
page: args => {
|
|
820
840
|
const { payload, config, instance } = args;
|
package/dist/web/p.js.txt
CHANGED
|
@@ -392,10 +392,17 @@
|
|
|
392
392
|
}
|
|
393
393
|
function applyFilters(event, creds) {
|
|
394
394
|
const { hosts = "*", events = "*" } = creds;
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
395
|
+
try {
|
|
396
|
+
const eventsArray = Array.isArray(events) ? events : events.split("\n");
|
|
397
|
+
const hostsArray = Array.isArray(hosts) ? hosts : hosts.split("\n");
|
|
398
|
+
return (!!hostsArray.find(hostFilter => { var _a; return satisfyDomainFilter(hostFilter, (_a = event.context) === null || _a === void 0 ? void 0 : _a.host); }) &&
|
|
399
|
+
(!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.type)) ||
|
|
400
|
+
!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.event))));
|
|
401
|
+
}
|
|
402
|
+
catch (e) {
|
|
403
|
+
console.warn(`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}. Values`, events, hosts);
|
|
404
|
+
throw new Error(`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}`);
|
|
405
|
+
}
|
|
399
406
|
}
|
|
400
407
|
const internalDestinationPlugins = {
|
|
401
408
|
[tagPlugin.id]: tagPlugin,
|
|
@@ -507,7 +514,7 @@
|
|
|
507
514
|
const cookieStorage = (cookieDomain, key2cookie) => {
|
|
508
515
|
return {
|
|
509
516
|
setItem(key, val) {
|
|
510
|
-
const strVal = typeof val === "object" && val !== null ? JSON.stringify(val) : val;
|
|
517
|
+
const strVal = typeof val === "object" && val !== null ? encodeURIComponent(JSON.stringify(val)) : val;
|
|
511
518
|
const cookieName = key2cookie[key] || key;
|
|
512
519
|
setCookie(cookieName, strVal, {
|
|
513
520
|
domain: cookieDomain,
|
|
@@ -662,7 +669,7 @@
|
|
|
662
669
|
},
|
|
663
670
|
campaign: parseUtms(query),
|
|
664
671
|
};
|
|
665
|
-
const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey:
|
|
672
|
+
const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), context: deepMerge(context, customContext) });
|
|
666
673
|
delete withContext.meta;
|
|
667
674
|
delete withContext.options;
|
|
668
675
|
return withContext;
|
|
@@ -735,6 +742,18 @@
|
|
|
735
742
|
}
|
|
736
743
|
return writeKey;
|
|
737
744
|
}
|
|
745
|
+
function maskWriteKey(writeKey) {
|
|
746
|
+
if (writeKey) {
|
|
747
|
+
const [id, secret] = writeKey.split(":", 2);
|
|
748
|
+
if (secret) {
|
|
749
|
+
return `${id}:***`;
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
return "***";
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return writeKey;
|
|
756
|
+
}
|
|
738
757
|
function send(method, payload, jitsuConfig, instance, store) {
|
|
739
758
|
if (jitsuConfig.echoEvents) {
|
|
740
759
|
console.log(`[JITSU] sending '${method}' event:`, payload);
|
|
@@ -750,7 +769,7 @@
|
|
|
750
769
|
// console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
|
|
751
770
|
// }
|
|
752
771
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
753
|
-
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key":
|
|
772
|
+
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key": jitsuConfig.writeKey } : {};
|
|
754
773
|
return fetch(url, {
|
|
755
774
|
method: "POST",
|
|
756
775
|
headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
|
|
@@ -818,6 +837,7 @@
|
|
|
818
837
|
if (!config.host && !config.echoEvents) {
|
|
819
838
|
throw new Error("Please specify host variable in jitsu plugin initialization, or set echoEvents to true");
|
|
820
839
|
}
|
|
840
|
+
validateWriteKey(config.writeKey);
|
|
821
841
|
},
|
|
822
842
|
page: args => {
|
|
823
843
|
const { payload, config, instance } = args;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitsu/js",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Jitsu Dev Team <dev@jitsu.com>",
|
|
6
6
|
"main": "dist/jitsu.cjs.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"rollup": "^3.2.5",
|
|
35
35
|
"ts-jest": "29.0.5",
|
|
36
36
|
"typescript": "^4.9.5",
|
|
37
|
-
"@jitsu/protocols": "1.1
|
|
37
|
+
"@jitsu/protocols": "1.2.1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"analytics": "^0.8.1"
|
package/src/analytics-plugin.ts
CHANGED
|
@@ -116,7 +116,7 @@ const defaultCookie2Key = {
|
|
|
116
116
|
const cookieStorage: StorageFactory = (cookieDomain, key2cookie) => {
|
|
117
117
|
return {
|
|
118
118
|
setItem(key: string, val: any) {
|
|
119
|
-
const strVal = typeof val === "object" && val !== null ? JSON.stringify(val) : val;
|
|
119
|
+
const strVal = typeof val === "object" && val !== null ? encodeURIComponent(JSON.stringify(val)) : val;
|
|
120
120
|
const cookieName = key2cookie[key] || key;
|
|
121
121
|
setCookie(cookieName, strVal, {
|
|
122
122
|
domain: cookieDomain,
|
|
@@ -282,7 +282,7 @@ function adjustPayload(payload: any, config: JitsuOptions, storage: PersistentSt
|
|
|
282
282
|
timestamp: new Date().toISOString(),
|
|
283
283
|
sentAt: new Date().toISOString(),
|
|
284
284
|
messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)),
|
|
285
|
-
writeKey:
|
|
285
|
+
writeKey: maskWriteKey(config.writeKey),
|
|
286
286
|
context: deepMerge(context, customContext),
|
|
287
287
|
};
|
|
288
288
|
delete withContext.meta;
|
|
@@ -402,6 +402,19 @@ function validateWriteKey(writeKey?: string): string | undefined {
|
|
|
402
402
|
}
|
|
403
403
|
return writeKey;
|
|
404
404
|
}
|
|
405
|
+
|
|
406
|
+
function maskWriteKey(writeKey?: string): string | undefined {
|
|
407
|
+
if (writeKey) {
|
|
408
|
+
const [id, secret] = writeKey.split(":", 2);
|
|
409
|
+
if (secret) {
|
|
410
|
+
return `${id}:***`;
|
|
411
|
+
} else {
|
|
412
|
+
return "***";
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return writeKey;
|
|
416
|
+
}
|
|
417
|
+
|
|
405
418
|
function send(
|
|
406
419
|
method,
|
|
407
420
|
payload,
|
|
@@ -428,7 +441,7 @@ function send(
|
|
|
428
441
|
// }
|
|
429
442
|
const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
|
|
430
443
|
|
|
431
|
-
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key":
|
|
444
|
+
const authHeader = jitsuConfig.writeKey ? { "X-Write-Key": jitsuConfig.writeKey } : {};
|
|
432
445
|
|
|
433
446
|
return fetch(url, {
|
|
434
447
|
method: "POST",
|
|
@@ -507,6 +520,7 @@ const jitsuAnalyticsPlugin = (pluginConfig: JitsuOptions = {}): AnalyticsPlugin
|
|
|
507
520
|
if (!config.host && !config.echoEvents) {
|
|
508
521
|
throw new Error("Please specify host variable in jitsu plugin initialization, or set echoEvents to true");
|
|
509
522
|
}
|
|
523
|
+
validateWriteKey(config.writeKey);
|
|
510
524
|
},
|
|
511
525
|
page: args => {
|
|
512
526
|
const { payload, config, instance } = args;
|
|
@@ -32,12 +32,24 @@ export function satisfyDomainFilter(filter: string, subject: string | undefined)
|
|
|
32
32
|
|
|
33
33
|
export function applyFilters(event: AnalyticsClientEvent, creds: CommonDestinationCredentials): boolean {
|
|
34
34
|
const { hosts = "*", events = "*" } = creds;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
!!
|
|
40
|
-
|
|
35
|
+
try {
|
|
36
|
+
const eventsArray = Array.isArray(events) ? events : events.split("\n");
|
|
37
|
+
const hostsArray = Array.isArray(hosts) ? hosts : hosts.split("\n");
|
|
38
|
+
return (
|
|
39
|
+
!!hostsArray.find(hostFilter => satisfyDomainFilter(hostFilter, event.context?.host)) &&
|
|
40
|
+
(!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.type)) ||
|
|
41
|
+
!!eventsArray.find(eventFilter => satisfyFilter(eventFilter, event.event)))
|
|
42
|
+
);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.warn(
|
|
45
|
+
`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}. Values`,
|
|
46
|
+
events,
|
|
47
|
+
hosts
|
|
48
|
+
);
|
|
49
|
+
throw new Error(
|
|
50
|
+
`Failed to apply filters: ${e.message}. Typeof events: ${typeof events}, typeof hosts: ${typeof hosts}`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
export const internalDestinationPlugins: Record<string, InternalPlugin<any>> = {
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
@jitsu/js:build: cache hit, replaying output [2m528cebbe5d911d11[0m
|
|
2
|
-
[33m@jitsu/js:build: [0m
|
|
3
|
-
[33m@jitsu/js:build: [0m> @jitsu/js@0.0.0 build /Users/vklmn/dev2/newjitsu/libs/jitsu-js
|
|
4
|
-
[33m@jitsu/js:build: [0m> tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
|
|
5
|
-
[33m@jitsu/js:build: [0m
|
|
6
|
-
[33m@jitsu/js:build: [0m[36m
|
|
7
|
-
[33m@jitsu/js:build: [0m[1m./compiled/src/browser.js[22m → [1mdist/web/p.js.txt[22m...[39m
|
|
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/troubleshooting/#error-this-is-undefined[39m
|
|
10
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/analytics-plugin.js[22m
|
|
11
|
-
[33m@jitsu/js:build: [0m[90m1: /* global analytics */
|
|
12
|
-
[33m@jitsu/js:build: [0m2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
[33m@jitsu/js:build: [0m ^
|
|
14
|
-
[33m@jitsu/js:build: [0m3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
[33m@jitsu/js:build: [0m4: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
16
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
17
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
18
|
-
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
19
|
-
[33m@jitsu/js:build: [0m ^
|
|
20
|
-
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
22
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
23
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/logrocket.js[22m
|
|
24
|
-
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
25
|
-
[33m@jitsu/js:build: [0m ^
|
|
26
|
-
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
28
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
29
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/gtm.js[22m
|
|
30
|
-
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
-
[33m@jitsu/js:build: [0m ^
|
|
32
|
-
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33
|
-
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
34
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
35
|
-
[33m@jitsu/js:build: [0m[1m[33m(!) Circular dependencies[39m[22m
|
|
36
|
-
[33m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
37
|
-
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
|
|
38
|
-
[33m@jitsu/js:build: [0mcompiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
|
|
39
|
-
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
|
|
40
|
-
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
|
|
41
|
-
[33m@jitsu/js:build: [0m[1m[33m(!) Use of eval is strongly discouraged[39m[22m
|
|
42
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#avoiding-eval[39m
|
|
43
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
44
|
-
[33m@jitsu/js:build: [0m[90m68: })()`;
|
|
45
|
-
[33m@jitsu/js:build: [0m69: try {
|
|
46
|
-
[33m@jitsu/js:build: [0m70: eval(iif);
|
|
47
|
-
[33m@jitsu/js:build: [0m ^
|
|
48
|
-
[33m@jitsu/js:build: [0m71: }
|
|
49
|
-
[33m@jitsu/js:build: [0m72: catch (e) {[39m
|
|
50
|
-
[33m@jitsu/js:build: [0m[32mcreated [1mdist/web/p.js.txt[22m in [1m212ms[22m[39m
|
|
51
|
-
[33m@jitsu/js:build: [0m[36m
|
|
52
|
-
[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
|
|
53
|
-
[33m@jitsu/js:build: [0m[1m[33m(!) "this" has been rewritten to "undefined"[39m[22m
|
|
54
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#error-this-is-undefined[39m
|
|
55
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/analytics-plugin.js[22m
|
|
56
|
-
[33m@jitsu/js:build: [0m[90m1: /* global analytics */
|
|
57
|
-
[33m@jitsu/js:build: [0m2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
58
|
-
[33m@jitsu/js:build: [0m ^
|
|
59
|
-
[33m@jitsu/js:build: [0m3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
60
|
-
[33m@jitsu/js:build: [0m4: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
61
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
62
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
63
|
-
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
64
|
-
[33m@jitsu/js:build: [0m ^
|
|
65
|
-
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
66
|
-
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
67
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
68
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/gtm.js[22m
|
|
69
|
-
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
70
|
-
[33m@jitsu/js:build: [0m ^
|
|
71
|
-
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
72
|
-
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
73
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
74
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/logrocket.js[22m
|
|
75
|
-
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
76
|
-
[33m@jitsu/js:build: [0m ^
|
|
77
|
-
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
78
|
-
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
79
|
-
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
80
|
-
[33m@jitsu/js:build: [0m[1m[33m(!) Circular dependencies[39m[22m
|
|
81
|
-
[33m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
82
|
-
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
|
|
83
|
-
[33m@jitsu/js:build: [0mcompiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
|
|
84
|
-
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
|
|
85
|
-
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
|
|
86
|
-
[33m@jitsu/js:build: [0m[1m[33m(!) Use of eval is strongly discouraged[39m[22m
|
|
87
|
-
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#avoiding-eval[39m
|
|
88
|
-
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
89
|
-
[33m@jitsu/js:build: [0m[90m68: })()`;
|
|
90
|
-
[33m@jitsu/js:build: [0m69: try {
|
|
91
|
-
[33m@jitsu/js:build: [0m70: eval(iif);
|
|
92
|
-
[33m@jitsu/js:build: [0m ^
|
|
93
|
-
[33m@jitsu/js:build: [0m71: }
|
|
94
|
-
[33m@jitsu/js:build: [0m72: catch (e) {[39m
|
|
95
|
-
[33m@jitsu/js:build: [0m[32mcreated [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m in [1m139ms[22m[39m
|
package/.turbo/turbo-clean.log
DELETED