@jitsu/functions-lib 1.10.4 → 2.14.0-canary.20251117.587d647

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/index.cjs.js CHANGED
@@ -23,8 +23,6 @@ function idToSnakeCaseFast(id) {
23
23
  res += id.substring(concatIndex, i) + "_";
24
24
  concatIndex = i + 1;
25
25
  }
26
- // needUnderscore is used in case next char is a capital latin letter
27
- // we add underscore only between latin letters
28
26
  needUnderscore = (c >= aCode && c <= zCode) || (c >= ACode && c <= ZCode);
29
27
  }
30
28
  if (concatIndex == 0) {
@@ -160,9 +158,6 @@ const TableNameParameter = "JITSU_TABLE_NAME";
160
158
  const DropRetryErrorName = "Drop & RetryError";
161
159
  const RetryErrorName = "RetryError";
162
160
  class RetryError extends Error {
163
- status;
164
- response;
165
- message;
166
161
  constructor(message, options) {
167
162
  if (typeof message === "object") {
168
163
  super(message.message);
@@ -186,9 +181,6 @@ class RetryError extends Error {
186
181
  }
187
182
  }
188
183
  class HTTPError extends Error {
189
- status;
190
- response;
191
- message;
192
184
  constructor(message, status, response) {
193
185
  super(message);
194
186
  this.message = message;
package/dist/index.es.js CHANGED
@@ -21,8 +21,6 @@ function idToSnakeCaseFast(id) {
21
21
  res += id.substring(concatIndex, i) + "_";
22
22
  concatIndex = i + 1;
23
23
  }
24
- // needUnderscore is used in case next char is a capital latin letter
25
- // we add underscore only between latin letters
26
24
  needUnderscore = (c >= aCode && c <= zCode) || (c >= ACode && c <= ZCode);
27
25
  }
28
26
  if (concatIndex == 0) {
@@ -158,9 +156,6 @@ const TableNameParameter = "JITSU_TABLE_NAME";
158
156
  const DropRetryErrorName = "Drop & RetryError";
159
157
  const RetryErrorName = "RetryError";
160
158
  class RetryError extends Error {
161
- status;
162
- response;
163
- message;
164
159
  constructor(message, options) {
165
160
  if (typeof message === "object") {
166
161
  super(message.message);
@@ -184,9 +179,6 @@ class RetryError extends Error {
184
179
  }
185
180
  }
186
181
  class HTTPError extends Error {
187
- status;
188
- response;
189
- message;
190
182
  constructor(message, status, response) {
191
183
  super(message);
192
184
  this.message = message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/functions-lib",
3
- "version": "1.10.4",
3
+ "version": "2.14.0-canary.20251117.587d647",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,22 +11,25 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "private": false,
14
+ "scripts": {
15
+ "//build-deps": "Required by turbo ^build-deps - builds dist/ for workspace packages that import this",
16
+ "build-deps": "pnpm run build",
17
+ "//typecheck": "Since this module generates types, we should run build during typecheck",
18
+ "typecheck": "tsc -p . && rollup -c",
19
+ "build": "tsc -p . && rollup -c",
20
+ "test": "vitest run"
21
+ },
14
22
  "devDependencies": {
23
+ "@jitsu/common-config": "workspace:*",
24
+ "@jitsu/protocols": "workspace:*",
15
25
  "rollup": "^4.24.3",
16
26
  "@rollup/plugin-typescript": "^11.1.5",
17
27
  "@rollup/plugin-node-resolve": "^16.0.0",
18
28
  "@rollup/plugin-commonjs": "^28.0.2",
19
- "@types/jest": "^29.1.1",
20
- "@types/node": "^18.15.3",
21
- "jest": "^29.1.2",
22
- "ts-jest": "29.0.5",
23
- "tslib": "^2.6.3",
29
+ "@types/node": "catalog:",
30
+ "@vitest/ui": "catalog:",
31
+ "tslib": "catalog:",
24
32
  "@jitsu/sdk-js": "^3.1.5",
25
- "@jitsu/protocols": "1.10.4"
26
- },
27
- "scripts": {
28
- "compile": "tsc -p .",
29
- "build": "pnpm compile && rollup -c",
30
- "test": "tsc -p . && jest --verbose"
33
+ "vitest": "catalog:"
31
34
  }
32
- }
35
+ }
package/tsconfig.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
+ "extends": "@jitsu/common-config/tsconfig.json",
2
3
  "compilerOptions": {
3
4
  "lib": ["dom", "esnext"],
4
5
  "rootDir": "./src",
5
6
  "outDir": "./dist",
6
7
  "declaration": true,
7
- "esModuleInterop": true,
8
- "moduleResolution": "node",
9
8
  "noEmit": true,
10
- "target": "esnext",
11
- "skipLibCheck": true
9
+ "strictPropertyInitialization": false,
10
+ "strictNullChecks": false
12
11
  },
12
+ "include": ["src/**/*"],
13
13
  "exclude": [
14
14
  "__tests__",
15
- "node_modules",
16
15
  "dist",
17
16
  "test_projects",
18
17
  "test",
@@ -0,0 +1,8 @@
1
+ import { mergeConfig } from "vitest/config";
2
+ import baseConfig from "@jitsu/common-config/vitest.config";
3
+
4
+ export default mergeConfig(baseConfig, {
5
+ test: {
6
+ setupFiles: ["@jitsu/common-config/vitest.setup.ts"],
7
+ },
8
+ });
@@ -1,12 +0,0 @@
1
- @jitsu/functions-lib:build: cache hit, replaying output 632430f3e3942c8a
2
- @jitsu/functions-lib:build: 
3
- @jitsu/functions-lib:build: > @jitsu/functions-lib@0.0.0 build /Users/ildarnurislamov/Projects/newjitsu/libs/functions
4
- @jitsu/functions-lib:build: > pnpm compile && rollup -c
5
- @jitsu/functions-lib:build: 
6
- @jitsu/functions-lib:build: 
7
- @jitsu/functions-lib:build: > @jitsu/functions-lib@0.0.0 compile /Users/ildarnurislamov/Projects/newjitsu/libs/functions
8
- @jitsu/functions-lib:build: > tsc -p .
9
- @jitsu/functions-lib:build: 
10
- @jitsu/functions-lib:build: 
11
- @jitsu/functions-lib:build: ./src/index.ts → dist/index.es.js, dist/index.cjs.js...
12
- @jitsu/functions-lib:build: created dist/index.es.js, dist/index.cjs.js in 1s
@@ -1,158 +0,0 @@
1
- @jitsu/functions-lib:test: cache hit, replaying output 9d86d3cea998628f
2
- @jitsu/functions-lib:test: 
3
- @jitsu/functions-lib:test: > @jitsu/functions-lib@0.0.0 test /Users/ildarnurislamov/Projects/newjitsu/libs/functions
4
- @jitsu/functions-lib:test: > tsc -p . && jest --verbose
5
- @jitsu/functions-lib:test: 
6
- @jitsu/functions-lib:test: ts-jest[versions] (WARN) Version 5.6.3 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
7
- @jitsu/functions-lib:test: {
8
- @jitsu/functions-lib:test:  "anon_ip": "141.136.89.0",
9
- @jitsu/functions-lib:test:  "api_key": "writeKey",
10
- @jitsu/functions-lib:test:  "doc_host": "localhost:3088",
11
- @jitsu/functions-lib:test:  "doc_path": "/basic.html",
12
- @jitsu/functions-lib:test:  "doc_search": "?utm_source=source&utm_medium=medium&utm_campaign=campaign",
13
- @jitsu/functions-lib:test:  "eventn_ctx_event_id": "a6c09b16-c2bc-4193-990f-5e2b694ae610",
14
- @jitsu/functions-lib:test:  "event_type": "identify",
15
- @jitsu/functions-lib:test:  "page_title": "Tracking page",
16
- @jitsu/functions-lib:test:  "referer": "https://referrer.com",
17
- @jitsu/functions-lib:test:  "screen_resolution": "1280x720",
18
- @jitsu/functions-lib:test:  "source_ip": "141.136.89.181",
19
- @jitsu/functions-lib:test:  "src": "jitsu",
20
- @jitsu/functions-lib:test:  "url": "https://localhost:3088/basic.html?utm_source=source&utm_medium=medium&utm_campaign=campaign",
21
- @jitsu/functions-lib:test:  "user": {
22
- @jitsu/functions-lib:test:  "id": "userId2",
23
- @jitsu/functions-lib:test:  "anonymous_id": "6638caf0-d2c2-4bc0-aecf-8b290b559a37",
24
- @jitsu/functions-lib:test:  "email": "john.doe2@gmail.com",
25
- @jitsu/functions-lib:test:  "caseName": "basic-identify",
26
- @jitsu/functions-lib:test:  "CaseLastName": "Doe",
27
- @jitsu/functions-lib:test:  "User_Name": "jj"
28
- @jitsu/functions-lib:test:  },
29
- @jitsu/functions-lib:test:  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/107.0.5304.18 Safari/537.36",
30
- @jitsu/functions-lib:test:  "user_language": "en-US",
31
- @jitsu/functions-lib:test:  "utc_time": "2022-11-14T08:56:34.387Z",
32
- @jitsu/functions-lib:test:  "_timestamp": "2022-11-14T08:56:40.000Z",
33
- @jitsu/functions-lib:test:  "utm": {
34
- @jitsu/functions-lib:test:  "medium": "medium",
35
- @jitsu/functions-lib:test:  "name": "campaign",
36
- @jitsu/functions-lib:test:  "source": "source"
37
- @jitsu/functions-lib:test:  },
38
- @jitsu/functions-lib:test:  "vp_size": "1280x720"
39
- @jitsu/functions-lib:test: }
40
- @jitsu/functions-lib:test: {
41
- @jitsu/functions-lib:test:  "api_key": "",
42
- @jitsu/functions-lib:test:  "doc_host": "localhost:3088",
43
- @jitsu/functions-lib:test:  "doc_path": "/basic.html",
44
- @jitsu/functions-lib:test:  "doc_search": "?utm_source=source&utm_medium=medium&utm_campaign=campaign",
45
- @jitsu/functions-lib:test:  "eventn_ctx_event_id": "d0c6abf6-97f7-487a-a197-8f236c728fa8",
46
- @jitsu/functions-lib:test:  "event_type": "page",
47
- @jitsu/functions-lib:test:  "page_title": "Tracking page",
48
- @jitsu/functions-lib:test:  "referer": "https://referrer.com",
49
- @jitsu/functions-lib:test:  "screen_resolution": "1280x720",
50
- @jitsu/functions-lib:test:  "src": "jitsu",
51
- @jitsu/functions-lib:test:  "url": "https://localhost:3088/basic.html?utm_source=source&utm_medium=medium&utm_campaign=campaign",
52
- @jitsu/functions-lib:test:  "user": {
53
- @jitsu/functions-lib:test:  "id": "userId2",
54
- @jitsu/functions-lib:test:  "anonymous_id": "6638caf0-d2c2-4bc0-aecf-8b290b559a37",
55
- @jitsu/functions-lib:test:  "email": "john.doe3@gmail.com",
56
- @jitsu/functions-lib:test:  "caseName": "identify-without-user-id",
57
- @jitsu/functions-lib:test:  "CaseLastName": "Doe",
58
- @jitsu/functions-lib:test:  "User_Name": "jj"
59
- @jitsu/functions-lib:test:  },
60
- @jitsu/functions-lib:test:  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/107.0.5304.18 Safari/537.36",
61
- @jitsu/functions-lib:test:  "user_language": "en-US",
62
- @jitsu/functions-lib:test:  "utc_time": "2022-11-14T08:56:34.395Z",
63
- @jitsu/functions-lib:test:  "_timestamp": "2022-11-14T08:56:40.000Z",
64
- @jitsu/functions-lib:test:  "utm": {
65
- @jitsu/functions-lib:test:  "medium": "medium",
66
- @jitsu/functions-lib:test:  "name": "campaign",
67
- @jitsu/functions-lib:test:  "source": "source"
68
- @jitsu/functions-lib:test:  },
69
- @jitsu/functions-lib:test:  "vp_size": "1280x720",
70
- @jitsu/functions-lib:test:  "caseName": "page-with-name",
71
- @jitsu/functions-lib:test:  "nestedProp": {
72
- @jitsu/functions-lib:test:  "my-Prop1": "myValue",
73
- @jitsu/functions-lib:test:  "myProp2": "myValue"
74
- @jitsu/functions-lib:test:  },
75
- @jitsu/functions-lib:test:  "hash": "",
76
- @jitsu/functions-lib:test:  "name": "test-page"
77
- @jitsu/functions-lib:test: }
78
- @jitsu/functions-lib:test: {
79
- @jitsu/functions-lib:test:  "anon_ip": "141.136.89.0",
80
- @jitsu/functions-lib:test:  "api_key": "writeKey",
81
- @jitsu/functions-lib:test:  "doc_host": "localhost:3088",
82
- @jitsu/functions-lib:test:  "doc_path": "/basic.html",
83
- @jitsu/functions-lib:test:  "doc_search": "?utm_source=source&utm_medium=medium&utm_campaign=campaign",
84
- @jitsu/functions-lib:test:  "eventn_ctx_event_id": "a6c09b16-c2bc-4193-990f-5e2b694ae610",
85
- @jitsu/functions-lib:test:  "event_type": "identify",
86
- @jitsu/functions-lib:test:  "page_title": "Tracking page",
87
- @jitsu/functions-lib:test:  "referer": "https://referrer.com",
88
- @jitsu/functions-lib:test:  "screen_resolution": "1280x720",
89
- @jitsu/functions-lib:test:  "source_ip": "141.136.89.181",
90
- @jitsu/functions-lib:test:  "src": "jitsu",
91
- @jitsu/functions-lib:test:  "url": "https://localhost:3088/basic.html?utm_source=source&utm_medium=medium&utm_campaign=campaign",
92
- @jitsu/functions-lib:test:  "user": {
93
- @jitsu/functions-lib:test:  "id": "userId2",
94
- @jitsu/functions-lib:test:  "anonymous_id": "6638caf0-d2c2-4bc0-aecf-8b290b559a37",
95
- @jitsu/functions-lib:test:  "email": "john.doe2@gmail.com",
96
- @jitsu/functions-lib:test:  "casename": "basic-identify",
97
- @jitsu/functions-lib:test:  "caselastname": "Doe",
98
- @jitsu/functions-lib:test:  "user_name": "jj"
99
- @jitsu/functions-lib:test:  },
100
- @jitsu/functions-lib:test:  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/107.0.5304.18 Safari/537.36",
101
- @jitsu/functions-lib:test:  "user_language": "en-US",
102
- @jitsu/functions-lib:test:  "utc_time": "2022-11-14T08:56:34.387Z",
103
- @jitsu/functions-lib:test:  "_timestamp": "2022-11-14T08:56:40.000Z",
104
- @jitsu/functions-lib:test:  "utm": {
105
- @jitsu/functions-lib:test:  "medium": "medium",
106
- @jitsu/functions-lib:test:  "name": "campaign",
107
- @jitsu/functions-lib:test:  "source": "source"
108
- @jitsu/functions-lib:test:  },
109
- @jitsu/functions-lib:test:  "vp_size": "1280x720"
110
- @jitsu/functions-lib:test: }
111
- @jitsu/functions-lib:test: {
112
- @jitsu/functions-lib:test:  "api_key": "",
113
- @jitsu/functions-lib:test:  "doc_host": "localhost:3088",
114
- @jitsu/functions-lib:test:  "doc_path": "/basic.html",
115
- @jitsu/functions-lib:test:  "doc_search": "?utm_source=source&utm_medium=medium&utm_campaign=campaign",
116
- @jitsu/functions-lib:test:  "eventn_ctx_event_id": "d0c6abf6-97f7-487a-a197-8f236c728fa8",
117
- @jitsu/functions-lib:test:  "event_type": "page",
118
- @jitsu/functions-lib:test:  "page_title": "Tracking page",
119
- @jitsu/functions-lib:test:  "referer": "https://referrer.com",
120
- @jitsu/functions-lib:test:  "screen_resolution": "1280x720",
121
- @jitsu/functions-lib:test:  "src": "jitsu",
122
- @jitsu/functions-lib:test:  "url": "https://localhost:3088/basic.html?utm_source=source&utm_medium=medium&utm_campaign=campaign",
123
- @jitsu/functions-lib:test:  "user": {
124
- @jitsu/functions-lib:test:  "id": "userId2",
125
- @jitsu/functions-lib:test:  "anonymous_id": "6638caf0-d2c2-4bc0-aecf-8b290b559a37",
126
- @jitsu/functions-lib:test:  "email": "john.doe3@gmail.com",
127
- @jitsu/functions-lib:test:  "casename": "identify-without-user-id",
128
- @jitsu/functions-lib:test:  "caselastname": "Doe",
129
- @jitsu/functions-lib:test:  "user_name": "jj"
130
- @jitsu/functions-lib:test:  },
131
- @jitsu/functions-lib:test:  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/107.0.5304.18 Safari/537.36",
132
- @jitsu/functions-lib:test:  "user_language": "en-US",
133
- @jitsu/functions-lib:test:  "utc_time": "2022-11-14T08:56:34.395Z",
134
- @jitsu/functions-lib:test:  "_timestamp": "2022-11-14T08:56:40.000Z",
135
- @jitsu/functions-lib:test:  "utm": {
136
- @jitsu/functions-lib:test:  "medium": "medium",
137
- @jitsu/functions-lib:test:  "name": "campaign",
138
- @jitsu/functions-lib:test:  "source": "source"
139
- @jitsu/functions-lib:test:  },
140
- @jitsu/functions-lib:test:  "vp_size": "1280x720",
141
- @jitsu/functions-lib:test:  "casename": "page-with-name",
142
- @jitsu/functions-lib:test:  "nestedprop": {
143
- @jitsu/functions-lib:test:  "my_prop1": "myValue",
144
- @jitsu/functions-lib:test:  "myprop2": "myValue"
145
- @jitsu/functions-lib:test:  },
146
- @jitsu/functions-lib:test:  "hash": "",
147
- @jitsu/functions-lib:test:  "name": "test-page"
148
- @jitsu/functions-lib:test: }
149
- @jitsu/functions-lib:test: PASS __tests__/classic-mapping.test.ts
150
- @jitsu/functions-lib:test:  ✓ legacy event s3 (5 ms)
151
- @jitsu/functions-lib:test:  ✓ legacy event warehouse (1 ms)
152
- @jitsu/functions-lib:test:  ✓ classic events mapping (1 ms)
153
- @jitsu/functions-lib:test: 
154
- @jitsu/functions-lib:test: Test Suites: 1 passed, 1 total
155
- @jitsu/functions-lib:test: Tests: 3 passed, 3 total
156
- @jitsu/functions-lib:test: Snapshots: 0 total
157
- @jitsu/functions-lib:test: Time: 1.323 s
158
- @jitsu/functions-lib:test: Ran all test suites.
package/LICENSE DELETED
@@ -1,21 +0,0 @@
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.