@jitsu/js 1.1.0-canary.227.20230222142636 → 1.1.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.
@@ -1,12 +1,12 @@
1
- @jitsu/js:build: cache hit, replaying output ba40be9de835fbde
1
+ @jitsu/js:build: cache hit, replaying output 126f0e7238465aa8
2
2
  @jitsu/js:build: 
3
- @jitsu/js:build: > @jitsu/js@0.0.0 build /Users/ildarnurislamov/Projects/onetag/libs/jitsu-js
3
+ @jitsu/js:build: > @jitsu/js@0.0.0 build /Users/vklmn/dev2/onetag/libs/jitsu-js
4
4
  @jitsu/js:build: > tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
5
5
  @jitsu/js:build: 
6
6
  @jitsu/js:build: 
7
7
  @jitsu/js:build: ./compiled/src/browser.js → dist/web/p.js.txt...
8
8
  @jitsu/js:build: (!) "this" has been rewritten to "undefined"
9
- @jitsu/js:build: https://rollupjs.org/guide/en/#error-this-is-undefined
9
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#error-this-is-undefined
10
10
  @jitsu/js:build: compiled/src/analytics-plugin.js
11
11
  @jitsu/js:build: 1: /* global analytics */
12
12
  @jitsu/js:build: 2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -24,7 +24,7 @@
24
24
  @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
25
25
  @jitsu/js:build: compiled/src/analytics-plugin.js -> compiled/src/destination-plugins.js -> compiled/src/analytics-plugin.js
26
26
  @jitsu/js:build: (!) Use of eval is strongly discouraged
27
- @jitsu/js:build: https://rollupjs.org/guide/en/#avoiding-eval
27
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#avoiding-eval
28
28
  @jitsu/js:build: compiled/src/destination-plugins.js
29
29
  @jitsu/js:build: 75: })()`;
30
30
  @jitsu/js:build: 76: try {
@@ -32,11 +32,11 @@
32
32
  @jitsu/js:build:  ^
33
33
  @jitsu/js:build: 78: }
34
34
  @jitsu/js:build: 79: catch (e) {
35
- @jitsu/js:build: created dist/web/p.js.txt in 388ms
35
+ @jitsu/js:build: created dist/web/p.js.txt in 872ms
36
36
  @jitsu/js:build: 
37
37
  @jitsu/js:build: ./compiled/src/index.js, ./compiled/src/jitsu.js, ./compiled/src/analytics-plugin.js → dist/jitsu.es.js, dist/jitsu.cjs.js...
38
38
  @jitsu/js:build: (!) "this" has been rewritten to "undefined"
39
- @jitsu/js:build: https://rollupjs.org/guide/en/#error-this-is-undefined
39
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#error-this-is-undefined
40
40
  @jitsu/js:build: compiled/src/analytics-plugin.js
41
41
  @jitsu/js:build: 1: /* global analytics */
42
42
  @jitsu/js:build: 2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -54,7 +54,7 @@
54
54
  @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
55
55
  @jitsu/js:build: compiled/src/analytics-plugin.js -> compiled/src/destination-plugins.js -> compiled/src/analytics-plugin.js
56
56
  @jitsu/js:build: (!) Use of eval is strongly discouraged
57
- @jitsu/js:build: https://rollupjs.org/guide/en/#avoiding-eval
57
+ @jitsu/js:build: https://rollupjs.org/troubleshooting/#avoiding-eval
58
58
  @jitsu/js:build: compiled/src/destination-plugins.js
59
59
  @jitsu/js:build: 75: })()`;
60
60
  @jitsu/js:build: 76: try {
@@ -62,4 +62,4 @@
62
62
  @jitsu/js:build:  ^
63
63
  @jitsu/js:build: 78: }
64
64
  @jitsu/js:build: 79: catch (e) {
65
- @jitsu/js:build: created dist/jitsu.es.js, dist/jitsu.cjs.js in 231ms
65
+ @jitsu/js:build: created dist/jitsu.es.js, dist/jitsu.cjs.js in 504ms
@@ -1,5 +1,5 @@
1
- @jitsu/js:clean: cache hit, replaying output 8fcc48ba2013f124
1
+ @jitsu/js:clean: cache hit, replaying output a45f0a4478c12277
2
2
  @jitsu/js:clean: 
3
- @jitsu/js:clean: > @jitsu/js@0.0.0 clean /Users/ildarnurislamov/Projects/onetag/libs/jitsu-js
3
+ @jitsu/js:clean: > @jitsu/js@0.0.0 clean /Users/vklmn/dev2/onetag/libs/jitsu-js
4
4
  @jitsu/js:clean: > rm -rf ./dist
5
5
  @jitsu/js:clean: 
@@ -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
@@ -528,12 +528,12 @@ function send(method, payload, jitsuConfig, instance, store) {
528
528
  if (!fetch) {
529
529
  throw new Error("Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope");
530
530
  }
531
- const authHeader = {};
532
531
  const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
533
532
  // if (jitsuConfig.debug) {
534
533
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
535
534
  // }
536
535
  const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
536
+ const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
537
537
  return fetch(url, {
538
538
  method: "POST",
539
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
- * Explicitely specify cookie domain. If not set, cookie domain will be set to top level
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
@@ -526,12 +526,12 @@ function send(method, payload, jitsuConfig, instance, store) {
526
526
  if (!fetch) {
527
527
  throw new Error("Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope");
528
528
  }
529
- const authHeader = {};
530
529
  const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
531
530
  // if (jitsuConfig.debug) {
532
531
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
533
532
  // }
534
533
  const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
534
+ const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
535
535
  return fetch(url, {
536
536
  method: "POST",
537
537
  headers: Object.assign(Object.assign({ "Content-Type": "application/json" }, authHeader), debugHeader),
package/dist/web/p.js.txt CHANGED
@@ -529,12 +529,12 @@
529
529
  if (!fetch) {
530
530
  throw new Error("Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope");
531
531
  }
532
- const authHeader = {};
533
532
  const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
534
533
  // if (jitsuConfig.debug) {
535
534
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
536
535
  // }
537
536
  const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
537
+ const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
538
538
  return fetch(url, {
539
539
  method: "POST",
540
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.227.20230222142636",
3
+ "version": "1.1.0",
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": "^1.30.0",
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": "^29.0.3",
36
- "@jitsu/protocols": "1.1.0-canary.227.20230222142636"
35
+ "ts-jest": "29.0.5",
36
+ "typescript": "^4.9.5",
37
+ "@jitsu/protocols": "1.1.0"
37
38
  },
38
39
  "dependencies": {
39
40
  "analytics": "^0.8.1"
@@ -402,13 +402,13 @@ function send(
402
402
  "Please specify fetch function in jitsu plugin initialization, fetch isn't available in global scope"
403
403
  );
404
404
  }
405
- const authHeader = {};
406
405
  const debugHeader = jitsuConfig.debug ? { "X-Enable-Debug": "true" } : {};
407
406
 
408
407
  // if (jitsuConfig.debug) {
409
408
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
410
409
  // }
411
410
  const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
411
+ const authHeader = adjustedPayload.writeKey ? { "X-Write-Key": adjustedPayload.writeKey } : {};
412
412
  return fetch(url, {
413
413
  method: "POST",
414
414
  headers: {
package/src/jitsu.ts CHANGED
@@ -16,7 +16,7 @@ type JitsuOptions = {
16
16
  */
17
17
  debug?: boolean;
18
18
  /**
19
- * Explicitely specify cookie domain. If not set, cookie domain will be set to top level
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
  */
package/.pnpm-debug.log DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "0 debug pnpm:scope": {
3
- "selected": 1,
4
- "workspacePrefix": "/Users/ildarnurislamov/Projects/onetag"
5
- },
6
- "1 error pnpm": {
7
- "code": "ELIFECYCLE",
8
- "errno": "ENOENT",
9
- "syscall": "spawn",
10
- "file": "sh",
11
- "pkgid": "@jitsu/js@0.0.0",
12
- "stage": "build",
13
- "script": "tsc -p . && rollup -c && cp src/jitsu.d.ts dist",
14
- "pkgname": "@jitsu/js",
15
- "err": {
16
- "name": "pnpm",
17
- "message": "@jitsu/js@0.0.0 build: `tsc -p . && rollup -c && cp src/jitsu.d.ts dist`\nspawn ENOENT",
18
- "code": "ELIFECYCLE",
19
- "stack": "pnpm: @jitsu/js@0.0.0 build: `tsc -p . && rollup -c && cp src/jitsu.d.ts dist`\nspawn ENOENT\n at ChildProcess.<anonymous> (/opt/homebrew/lib/node_modules/pnpm/dist/pnpm.cjs:93535:22)\n at ChildProcess.emit (node:events:527:28)\n at maybeClose (node:internal/child_process:1092:16)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)"
20
- }
21
- },
22
- "2 warn pnpm:global": " Local package.json exists, but node_modules missing, did you mean to install?"
23
- }