@zuplo/cli 7.13.10 → 7.13.13
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/node_modules/@posthog/core/dist/cookie.d.ts +4 -0
- package/node_modules/@posthog/core/dist/cookie.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/cookie.js +8 -2
- package/node_modules/@posthog/core/dist/cookie.mjs +8 -2
- package/node_modules/@posthog/core/dist/utils/bot-detection.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/bot-detection.js +1 -0
- package/node_modules/@posthog/core/dist/utils/bot-detection.mjs +1 -0
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/cookie.ts +13 -2
- package/node_modules/@posthog/core/src/utils/bot-detection.spec.ts +7 -0
- package/node_modules/@posthog/core/src/utils/bot-detection.ts +1 -0
- package/node_modules/@zuplo/core/customer.cli.minified.js +332 -332
- package/node_modules/@zuplo/core/index.minified.js +320 -320
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-SXGSDVGB.js → chunk-3DWWKPBI.js} +85 -85
- package/node_modules/@zuplo/runtime/out/esm/chunk-3DWWKPBI.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-PXS4NOKU.js → chunk-KA4STQE7.js} +17 -17
- package/node_modules/@zuplo/runtime/out/esm/chunk-KA4STQE7.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-VP5Q3DEN.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-VP5Q3DEN.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +60 -0
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +119 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/express-rate-limit/dist/index.cjs +1 -1
- package/node_modules/express-rate-limit/dist/index.mjs +1 -1
- package/node_modules/express-rate-limit/package.json +1 -1
- package/node_modules/ip-address/README.md +39 -39
- package/node_modules/ip-address/dist/ipv6.js +1 -1
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/thread-stream/.github/workflows/ci.yml +1 -1
- package/node_modules/thread-stream/SECURITY.md +77 -0
- package/node_modules/thread-stream/index.d.ts +2 -1
- package/node_modules/thread-stream/index.js +65 -7
- package/node_modules/thread-stream/lib/wait.js +23 -5
- package/node_modules/thread-stream/package.json +10 -5
- package/node_modules/thread-stream/test/create-and-exit.js +1 -1
- package/node_modules/thread-stream/test/end.test.js +35 -0
- package/node_modules/thread-stream/test/error-flush.test.js +96 -0
- package/node_modules/thread-stream/test/error-immediate.js +17 -0
- package/node_modules/thread-stream/test/flush-ref-keeps-alive.js +23 -0
- package/node_modules/thread-stream/test/flush-unref-exit.js +23 -0
- package/node_modules/thread-stream/test/ready-race-worker.js +22 -0
- package/node_modules/thread-stream/test/ready.test.js +46 -0
- package/node_modules/thread-stream/test/thread-management.test.js +68 -0
- package/node_modules/thread-stream/test/to-file-sync.js +23 -0
- package/node_modules/thread-stream/test/types/index.test-d.ts +26 -0
- package/node_modules/thread-stream/test/wait.test.js +131 -0
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-PXS4NOKU.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-SXGSDVGB.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZCJ5QBVD.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZCJ5QBVD.js.map +0 -1
- package/node_modules/thread-stream/.claude/settings.local.json +0 -15
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-SXGSDVGB.js.LEGAL.txt → chunk-3DWWKPBI.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-PXS4NOKU.js.LEGAL.txt → chunk-KA4STQE7.js.LEGAL.txt} +0 -0
|
@@ -15,6 +15,10 @@ export interface PostHogCookieState {
|
|
|
15
15
|
distinctId: string;
|
|
16
16
|
isIdentified: boolean;
|
|
17
17
|
sessionId?: string;
|
|
18
|
+
/** When the session last had activity (`$sesid[0]`), in milliseconds since the Unix epoch. */
|
|
19
|
+
sessionLastActivityTimestamp?: number;
|
|
20
|
+
/** When the session started (`$sesid[2]`), in milliseconds since the Unix epoch. */
|
|
21
|
+
sessionStartTimestamp?: number;
|
|
18
22
|
deviceId?: string;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../src/cookie.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;CACjD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,CAmBvE;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAA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AIjG;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAY5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CA0BjF;AAMD,MAAM,WAAW,mBAAmB;IAClC,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxC,+BAA+B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAChD;AAID,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAQzF;AAED,MAAM,WAAW,aAAc,SAAQ,mBAAmB;IACxD,4BAA4B,CAAC,EAAE,OAAO,CAAA;CACvC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAUhG"}
|
|
@@ -95,17 +95,23 @@ function parsePostHogCookie(cookieValue) {
|
|
|
95
95
|
try {
|
|
96
96
|
const parsed = JSON.parse(cookieValue);
|
|
97
97
|
if (!parsed || 'object' != typeof parsed || !parsed.distinct_id) return null;
|
|
98
|
-
const sesid = (0, index_js_namespaceObject.isArray)(parsed.$sesid) ? parsed.$sesid
|
|
98
|
+
const sesid = (0, index_js_namespaceObject.isArray)(parsed.$sesid) ? parsed.$sesid : [];
|
|
99
|
+
const sessionId = sesid[1];
|
|
99
100
|
return {
|
|
100
101
|
distinctId: String(parsed.distinct_id),
|
|
101
102
|
isIdentified: 'identified' === parsed.$user_state,
|
|
102
|
-
sessionId: 'string' == typeof
|
|
103
|
+
sessionId: 'string' == typeof sessionId ? sessionId : void 0,
|
|
104
|
+
sessionLastActivityTimestamp: toTimestamp(sesid[0]),
|
|
105
|
+
sessionStartTimestamp: toTimestamp(sesid[2]),
|
|
103
106
|
deviceId: 'string' == typeof parsed.$device_id ? parsed.$device_id : void 0
|
|
104
107
|
};
|
|
105
108
|
} catch {
|
|
106
109
|
return null;
|
|
107
110
|
}
|
|
108
111
|
}
|
|
112
|
+
function toTimestamp(value) {
|
|
113
|
+
return 'number' == typeof value && Number.isFinite(value) ? value : void 0;
|
|
114
|
+
}
|
|
109
115
|
const CONSENT_PREFIX = '__ph_opt_in_out_';
|
|
110
116
|
function getConsentCookieName(apiKey, config) {
|
|
111
117
|
if (config?.consent_persistence_name) return config.consent_persistence_name;
|
|
@@ -56,17 +56,23 @@ function parsePostHogCookie(cookieValue) {
|
|
|
56
56
|
try {
|
|
57
57
|
const parsed = JSON.parse(cookieValue);
|
|
58
58
|
if (!parsed || 'object' != typeof parsed || !parsed.distinct_id) return null;
|
|
59
|
-
const sesid = isArray(parsed.$sesid) ? parsed.$sesid
|
|
59
|
+
const sesid = isArray(parsed.$sesid) ? parsed.$sesid : [];
|
|
60
|
+
const sessionId = sesid[1];
|
|
60
61
|
return {
|
|
61
62
|
distinctId: String(parsed.distinct_id),
|
|
62
63
|
isIdentified: 'identified' === parsed.$user_state,
|
|
63
|
-
sessionId: 'string' == typeof
|
|
64
|
+
sessionId: 'string' == typeof sessionId ? sessionId : void 0,
|
|
65
|
+
sessionLastActivityTimestamp: toTimestamp(sesid[0]),
|
|
66
|
+
sessionStartTimestamp: toTimestamp(sesid[2]),
|
|
64
67
|
deviceId: 'string' == typeof parsed.$device_id ? parsed.$device_id : void 0
|
|
65
68
|
};
|
|
66
69
|
} catch {
|
|
67
70
|
return null;
|
|
68
71
|
}
|
|
69
72
|
}
|
|
73
|
+
function toTimestamp(value) {
|
|
74
|
+
return 'number' == typeof value && Number.isFinite(value) ? value : void 0;
|
|
75
|
+
}
|
|
70
76
|
const CONSENT_PREFIX = '__ph_opt_in_out_';
|
|
71
77
|
function getConsentCookieName(apiKey, config) {
|
|
72
78
|
if (config?.consent_persistence_name) return config.consent_persistence_name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-detection.d.ts","sourceRoot":"","sources":["../../src/utils/bot-detection.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"bot-detection.d.ts","sourceRoot":"","sources":["../../src/utils/bot-detection.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,UAoGnC,CAAA;AAeD,0DAA0D;AAC1D,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAaD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,OAAiB,MAAM,GAAG,SAAS,4BAA2B,MAAM,EAAE,KAAQ,OAsBrG,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.63.0",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/PostHog/posthog-js/issues"
|
|
6
6
|
},
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@posthog/types": "^1.
|
|
75
|
+
"@posthog/types": "^1.419.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@rslib/core": "0.23.2",
|
|
@@ -40,6 +40,10 @@ export interface PostHogCookieState {
|
|
|
40
40
|
distinctId: string
|
|
41
41
|
isIdentified: boolean
|
|
42
42
|
sessionId?: string
|
|
43
|
+
/** When the session last had activity (`$sesid[0]`), in milliseconds since the Unix epoch. */
|
|
44
|
+
sessionLastActivityTimestamp?: number
|
|
45
|
+
/** When the session started (`$sesid[2]`), in milliseconds since the Unix epoch. */
|
|
46
|
+
sessionStartTimestamp?: number
|
|
43
47
|
deviceId?: string
|
|
44
48
|
}
|
|
45
49
|
|
|
@@ -126,12 +130,15 @@ export function parsePostHogCookie(cookieValue: string): PostHogCookieState | nu
|
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
// $sesid is stored as [lastActivityTimestamp, sessionId, sessionStartTimestamp]
|
|
129
|
-
const sesid = isArray(parsed.$sesid) ? parsed.$sesid
|
|
133
|
+
const sesid: unknown[] = isArray(parsed.$sesid) ? parsed.$sesid : []
|
|
134
|
+
const sessionId = sesid[1]
|
|
130
135
|
|
|
131
136
|
return {
|
|
132
137
|
distinctId: String(parsed.distinct_id),
|
|
133
138
|
isIdentified: parsed.$user_state === 'identified',
|
|
134
|
-
sessionId: typeof
|
|
139
|
+
sessionId: typeof sessionId === 'string' ? sessionId : undefined,
|
|
140
|
+
sessionLastActivityTimestamp: toTimestamp(sesid[0]),
|
|
141
|
+
sessionStartTimestamp: toTimestamp(sesid[2]),
|
|
135
142
|
deviceId: typeof parsed.$device_id === 'string' ? parsed.$device_id : undefined,
|
|
136
143
|
}
|
|
137
144
|
} catch {
|
|
@@ -139,6 +146,10 @@ export function parsePostHogCookie(cookieValue: string): PostHogCookieState | nu
|
|
|
139
146
|
}
|
|
140
147
|
}
|
|
141
148
|
|
|
149
|
+
function toTimestamp(value: unknown): number | undefined {
|
|
150
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined
|
|
151
|
+
}
|
|
152
|
+
|
|
142
153
|
export interface ConsentCookieConfig {
|
|
143
154
|
consent_persistence_name?: string | null
|
|
144
155
|
opt_out_capturing_cookie_prefix?: string | null
|
|
@@ -43,6 +43,13 @@ describe('isBlockedUA', () => {
|
|
|
43
43
|
expect(isBlockedUA('headlessChrome/119.0')).toBe(true)
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
+
it.each(['Lightpanda/1.0', 'lightpanda/2.3.4', 'LIGHTPANDA/10.0', 'Mozilla/5.0 (compatible; Lightpanda/1.0)'])(
|
|
47
|
+
'blocks the self-declared headless browser %s',
|
|
48
|
+
(ua) => {
|
|
49
|
+
expect(isBlockedUA(ua)).toBe(true)
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
46
53
|
it('is case-insensitive on the UA input', () => {
|
|
47
54
|
const bot = 'Mozilla/5.0 (compatible; Googlebot/2.1)'
|
|
48
55
|
expect(isBlockedUA(bot)).toBe(true)
|