@jitsu/js 1.3.0 → 1.3.1-canary.300.20231019125048

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.
@@ -1,95 +1,95 @@
1
- @jitsu/js:build: cache hit, replaying output 74ab268fd80439c7
2
- @jitsu/js:build: 
3
- @jitsu/js:build: > @jitsu/js@0.0.0 build /Users/ildarnurislamov/Projects/newjitsu/libs/jitsu-js
4
- @jitsu/js:build: > tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
5
- @jitsu/js:build: 
6
- @jitsu/js:build: 
7
- @jitsu/js:build: ./compiled/src/browser.js → dist/web/p.js.txt...
8
- @jitsu/js:build: (!) "this" has been rewritten to "undefined"
9
- @jitsu/js:build: https://rollupjs.org/troubleshooting/#error-this-is-undefined
10
- @jitsu/js:build: compiled/src/analytics-plugin.js
11
- @jitsu/js:build: 1: /* global analytics */
12
- @jitsu/js:build: 2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- @jitsu/js:build:  ^
14
- @jitsu/js:build: 3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- @jitsu/js:build: 4: return new (P || (P = Promise))(function (resolve, reject) {
16
- @jitsu/js:build: ...and 1 other occurrence
17
- @jitsu/js:build: compiled/src/destination-plugins/tag.js
18
- @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
19
- @jitsu/js:build:  ^
20
- @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21
- @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
22
- @jitsu/js:build: ...and 1 other occurrence
23
- @jitsu/js:build: compiled/src/destination-plugins/gtm.js
24
- @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
25
- @jitsu/js:build:  ^
26
- @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
28
- @jitsu/js:build: ...and 1 other occurrence
29
- @jitsu/js:build: compiled/src/destination-plugins/logrocket.js
30
- @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
- @jitsu/js:build:  ^
32
- @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
33
- @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
34
- @jitsu/js:build: ...and 1 other occurrence
35
- @jitsu/js:build: (!) Circular dependencies
36
- @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
37
- @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
38
- @jitsu/js:build: compiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
39
- @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
40
- @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
41
- @jitsu/js:build: (!) Use of eval is strongly discouraged
42
- @jitsu/js:build: https://rollupjs.org/troubleshooting/#avoiding-eval
43
- @jitsu/js:build: compiled/src/destination-plugins/tag.js
44
- @jitsu/js:build: 68: })()`;
45
- @jitsu/js:build: 69: try {
46
- @jitsu/js:build: 70: eval(iif);
47
- @jitsu/js:build:  ^
48
- @jitsu/js:build: 71: }
49
- @jitsu/js:build: 72: catch (e) {
50
- @jitsu/js:build: created dist/web/p.js.txt in 661ms
51
- @jitsu/js:build: 
52
- @jitsu/js:build: ./compiled/src/index.js, ./compiled/src/jitsu.js, ./compiled/src/analytics-plugin.js → dist/jitsu.es.js, dist/jitsu.cjs.js...
53
- @jitsu/js:build: (!) "this" has been rewritten to "undefined"
54
- @jitsu/js:build: https://rollupjs.org/troubleshooting/#error-this-is-undefined
55
- @jitsu/js:build: compiled/src/analytics-plugin.js
56
- @jitsu/js:build: 1: /* global analytics */
57
- @jitsu/js:build: 2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
58
- @jitsu/js:build:  ^
59
- @jitsu/js:build: 3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
60
- @jitsu/js:build: 4: return new (P || (P = Promise))(function (resolve, reject) {
61
- @jitsu/js:build: ...and 1 other occurrence
62
- @jitsu/js:build: compiled/src/destination-plugins/logrocket.js
63
- @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
64
- @jitsu/js:build:  ^
65
- @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
66
- @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
67
- @jitsu/js:build: ...and 1 other occurrence
68
- @jitsu/js:build: compiled/src/destination-plugins/tag.js
69
- @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
70
- @jitsu/js:build:  ^
71
- @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
72
- @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
73
- @jitsu/js:build: ...and 1 other occurrence
74
- @jitsu/js:build: compiled/src/destination-plugins/gtm.js
75
- @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
76
- @jitsu/js:build:  ^
77
- @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
79
- @jitsu/js:build: ...and 1 other occurrence
80
- @jitsu/js:build: (!) Circular dependencies
81
- @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
82
- @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
83
- @jitsu/js:build: compiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
84
- @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
85
- @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
86
- @jitsu/js:build: (!) Use of eval is strongly discouraged
87
- @jitsu/js:build: https://rollupjs.org/troubleshooting/#avoiding-eval
88
- @jitsu/js:build: compiled/src/destination-plugins/tag.js
89
- @jitsu/js:build: 68: })()`;
90
- @jitsu/js:build: 69: try {
91
- @jitsu/js:build: 70: eval(iif);
92
- @jitsu/js:build:  ^
93
- @jitsu/js:build: 71: }
94
- @jitsu/js:build: 72: catch (e) {
95
- @jitsu/js:build: created dist/jitsu.es.js, dist/jitsu.cjs.js in 572ms
1
+ @jitsu/js:build: cache hit, replaying output e032ba7866b432ba
2
+ @jitsu/js:build: 
3
+ @jitsu/js:build: > @jitsu/js@0.0.0 build /Users/ildarnurislamov/Projects/newjitsu/libs/jitsu-js
4
+ @jitsu/js:build: > tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
5
+ @jitsu/js:build: 
6
+ @jitsu/js:build: 
7
+ @jitsu/js:build: ./compiled/src/browser.js → dist/web/p.js.txt...
8
+ @jitsu/js:build: (!) "this" has been rewritten to "undefined"
9
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#error-this-is-undefined
10
+ @jitsu/js:build: compiled/src/analytics-plugin.js
11
+ @jitsu/js:build: 1: /* global analytics */
12
+ @jitsu/js:build: 2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ @jitsu/js:build:  ^
14
+ @jitsu/js:build: 3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ @jitsu/js:build: 4: return new (P || (P = Promise))(function (resolve, reject) {
16
+ @jitsu/js:build: ...and 1 other occurrence
17
+ @jitsu/js:build: compiled/src/destination-plugins/tag.js
18
+ @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
19
+ @jitsu/js:build:  ^
20
+ @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21
+ @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
22
+ @jitsu/js:build: ...and 1 other occurrence
23
+ @jitsu/js:build: compiled/src/destination-plugins/gtm.js
24
+ @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
25
+ @jitsu/js:build:  ^
26
+ @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
28
+ @jitsu/js:build: ...and 1 other occurrence
29
+ @jitsu/js:build: compiled/src/destination-plugins/logrocket.js
30
+ @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ @jitsu/js:build:  ^
32
+ @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
33
+ @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
34
+ @jitsu/js:build: ...and 1 other occurrence
35
+ @jitsu/js:build: (!) Circular dependencies
36
+ @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
37
+ @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
38
+ @jitsu/js:build: compiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
39
+ @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
40
+ @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
41
+ @jitsu/js:build: (!) Use of eval is strongly discouraged
42
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#avoiding-eval
43
+ @jitsu/js:build: compiled/src/destination-plugins/tag.js
44
+ @jitsu/js:build: 68: })()`;
45
+ @jitsu/js:build: 69: try {
46
+ @jitsu/js:build: 70: eval(iif);
47
+ @jitsu/js:build:  ^
48
+ @jitsu/js:build: 71: }
49
+ @jitsu/js:build: 72: catch (e) {
50
+ @jitsu/js:build: created dist/web/p.js.txt in 517ms
51
+ @jitsu/js:build: 
52
+ @jitsu/js:build: ./compiled/src/index.js, ./compiled/src/jitsu.js, ./compiled/src/analytics-plugin.js → dist/jitsu.es.js, dist/jitsu.cjs.js...
53
+ @jitsu/js:build: (!) "this" has been rewritten to "undefined"
54
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#error-this-is-undefined
55
+ @jitsu/js:build: compiled/src/analytics-plugin.js
56
+ @jitsu/js:build: 1: /* global analytics */
57
+ @jitsu/js:build: 2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
58
+ @jitsu/js:build:  ^
59
+ @jitsu/js:build: 3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
60
+ @jitsu/js:build: 4: return new (P || (P = Promise))(function (resolve, reject) {
61
+ @jitsu/js:build: ...and 1 other occurrence
62
+ @jitsu/js:build: compiled/src/destination-plugins/tag.js
63
+ @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
64
+ @jitsu/js:build:  ^
65
+ @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
66
+ @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
67
+ @jitsu/js:build: ...and 1 other occurrence
68
+ @jitsu/js:build: compiled/src/destination-plugins/logrocket.js
69
+ @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
70
+ @jitsu/js:build:  ^
71
+ @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
72
+ @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
73
+ @jitsu/js:build: ...and 1 other occurrence
74
+ @jitsu/js:build: compiled/src/destination-plugins/gtm.js
75
+ @jitsu/js:build: 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
76
+ @jitsu/js:build:  ^
77
+ @jitsu/js:build: 2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
+ @jitsu/js:build: 3: return new (P || (P = Promise))(function (resolve, reject) {
79
+ @jitsu/js:build: ...and 1 other occurrence
80
+ @jitsu/js:build: (!) Circular dependencies
81
+ @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
82
+ @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
83
+ @jitsu/js:build: compiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
84
+ @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
85
+ @jitsu/js:build: compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
86
+ @jitsu/js:build: (!) Use of eval is strongly discouraged
87
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#avoiding-eval
88
+ @jitsu/js:build: compiled/src/destination-plugins/tag.js
89
+ @jitsu/js:build: 68: })()`;
90
+ @jitsu/js:build: 69: try {
91
+ @jitsu/js:build: 70: eval(iif);
92
+ @jitsu/js:build:  ^
93
+ @jitsu/js:build: 71: }
94
+ @jitsu/js:build: 72: catch (e) {
95
+ @jitsu/js:build: created dist/jitsu.es.js, dist/jitsu.cjs.js in 171ms
@@ -1,5 +1,5 @@
1
- @jitsu/js:clean: cache hit, replaying output cc345e7c28980b4e
2
- @jitsu/js:clean: 
3
- @jitsu/js:clean: > @jitsu/js@0.0.0 clean /Users/ildarnurislamov/Projects/newjitsu/libs/jitsu-js
4
- @jitsu/js:clean: > rm -rf ./dist
5
- @jitsu/js:clean: 
1
+ @jitsu/js:clean: cache hit, replaying output 275761415adc1ac6
2
+ @jitsu/js:clean: 
3
+ @jitsu/js:clean: > @jitsu/js@0.0.0 clean /Users/ildarnurislamov/Projects/newjitsu/libs/jitsu-js
4
+ @jitsu/js:clean: > rm -rf ./dist
5
+ @jitsu/js:clean: 
@@ -1,6 +1,6 @@
1
1
  import { createServer, SimpleSyrup } from "../simple-syrup";
2
2
  import { AnalyticsClientEvent, AnalyticsInterface } from "@jitsu/protocols/analytics";
3
- import { parse } from "tldts";
3
+ import { getTopLevelDomain } from "../../src/tlds";
4
4
 
5
5
  const jitsuAnalytics = require("../../dist/jitsu.cjs.js").jitsuAnalytics;
6
6
  const fetchImpl = require("node-fetch-commonjs");
@@ -92,12 +92,11 @@ describe("Test Jitsu NodeJS client", () => {
92
92
  });
93
93
 
94
94
  test("tld", async () => {
95
- expect(parse("http://www.google.com").domain).toBe("google.com");
96
- expect(parse("www.trendstyle.com.au").domain).toBe("trendstyle.com.au");
97
- expect(parse("http://localhost:3000").domain).toBe(null);
98
- expect(parse("http://localhost:3000").hostname).toBe("localhost");
99
- expect(parse("http://use.jitsu.com").domain).toBe("jitsu.com");
100
- expect(parse("use.jitsu.com").domain).toBe("jitsu.com");
95
+ expect(getTopLevelDomain("www.google.com")).toBe("google.com");
96
+ expect(getTopLevelDomain("www.trendstyle.com.au")).toBe("trendstyle.com.au");
97
+ expect(getTopLevelDomain("localhost:3000")).toBe("localhost");
98
+ expect(getTopLevelDomain("use.jitsu.com")).toBe("jitsu.com");
99
+ expect(getTopLevelDomain("use.jitsu.com")).toBe("jitsu.com");
101
100
  //console.log(parse("http://localhost:3000"));
102
101
  });
103
102
  });
@@ -179,7 +179,7 @@ test("segment-reference", async ({ browser }) => {
179
179
  test("basic", async ({ browser }) => {
180
180
  const browserContext = await browser.newContext();
181
181
 
182
- const { page: firstPage, uncaughtErrors: fistPageErrors } = await createLoggingPage(browserContext);
182
+ const { page: firstPage, uncaughtErrors: firstPageErrors } = await createLoggingPage(browserContext);
183
183
  const [pageResult] = await Promise.all([
184
184
  firstPage.goto(`${server.baseUrl}/basic.html?utm_source=source&utm_medium=medium&utm_campaign=campaign`),
185
185
  ]);
@@ -197,7 +197,7 @@ test("basic", async ({ browser }) => {
197
197
  {}
198
198
  );
199
199
  console.log("🍪 Jitsu Cookies", cookies);
200
- expect(fistPageErrors.length).toEqual(0);
200
+ expect(firstPageErrors.length).toEqual(0);
201
201
  const anonymousId = cookies["__eventn_id"];
202
202
  expect(anonymousId).toBeDefined();
203
203
  expect(cookies["__eventn_uid"]).toBe("user1");
@@ -2,7 +2,6 @@ import { JitsuOptions, PersistentStorage, RuntimeFacade } from "./jitsu";
2
2
  import { AnalyticsPlugin } from "analytics";
3
3
  export declare const parseQuery: (qs?: string) => Record<string, string>;
4
4
  export type StorageFactory = (cookieDomain: string, cookie2key: Record<string, string>) => PersistentStorage;
5
- export declare function getTopLevelDomain(opts?: JitsuOptions): string;
6
5
  export declare function windowRuntime(opts: JitsuOptions): RuntimeFacade;
7
6
  export declare const emptyRuntime: (config: JitsuOptions) => RuntimeFacade;
8
7
  export declare function isInBrowser(): boolean;
package/dist/index.d.ts CHANGED
@@ -11,3 +11,4 @@ export declare const emptyAnalytics: {
11
11
  export declare function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface;
12
12
  export * from "./jitsu";
13
13
  export * from "./analytics-plugin";
14
+ export { getTopLevelDomain } from "./tlds";