@zuplo/cli 7.1.9 → 7.1.10

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.
Files changed (83) hide show
  1. package/node_modules/@hono/node-server/dist/index.cjs +151 -9
  2. package/node_modules/@hono/node-server/dist/index.mjs +151 -9
  3. package/node_modules/@hono/node-server/package.json +1 -1
  4. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +24 -3
  5. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
  6. package/node_modules/@posthog/core/dist/posthog-core-stateless.js +30 -9
  7. package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +28 -10
  8. package/node_modules/@posthog/core/dist/posthog-core.d.ts +3 -3
  9. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  10. package/node_modules/@posthog/core/dist/posthog-core.js +1 -0
  11. package/node_modules/@posthog/core/dist/posthog-core.mjs +1 -0
  12. package/node_modules/@posthog/core/dist/types.d.ts +2 -1
  13. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  14. package/node_modules/@posthog/core/dist/types.js +1 -0
  15. package/node_modules/@posthog/core/dist/types.mjs +1 -0
  16. package/node_modules/@posthog/core/package.json +2 -2
  17. package/node_modules/@posthog/core/src/posthog-core-stateless.ts +42 -10
  18. package/node_modules/@posthog/core/src/posthog-core.ts +4 -3
  19. package/node_modules/@posthog/core/src/types.ts +2 -1
  20. package/node_modules/@posthog/types/dist/capture.d.ts +1 -1
  21. package/node_modules/@posthog/types/dist/index.d.ts +1 -1
  22. package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
  23. package/node_modules/@posthog/types/dist/posthog-config.d.ts +54 -5
  24. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  25. package/node_modules/@posthog/types/dist/posthog.d.ts +3 -3
  26. package/node_modules/@posthog/types/dist/posthog.d.ts.map +1 -1
  27. package/node_modules/@posthog/types/dist/segment.d.ts +11 -2
  28. package/node_modules/@posthog/types/dist/segment.d.ts.map +1 -1
  29. package/node_modules/@posthog/types/package.json +1 -1
  30. package/node_modules/@posthog/types/src/capture.ts +1 -1
  31. package/node_modules/@posthog/types/src/index.ts +1 -0
  32. package/node_modules/@posthog/types/src/posthog-config.ts +64 -6
  33. package/node_modules/@posthog/types/src/posthog.ts +3 -3
  34. package/node_modules/@posthog/types/src/segment.ts +11 -2
  35. package/node_modules/@zuplo/core/package.json +1 -1
  36. package/node_modules/@zuplo/graphql/package.json +1 -1
  37. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  38. package/node_modules/@zuplo/otel/package.json +1 -1
  39. package/node_modules/@zuplo/runtime/out/esm/chunk-4VE55TG3.js +26 -0
  40. package/node_modules/@zuplo/runtime/out/esm/chunk-4VE55TG3.js.map +1 -0
  41. package/node_modules/@zuplo/runtime/out/esm/{chunk-MXYNCB5D.js → chunk-DEKK4CFE.js} +95 -95
  42. package/node_modules/@zuplo/runtime/out/esm/chunk-DEKK4CFE.js.map +1 -0
  43. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  44. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  45. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  46. package/node_modules/@zuplo/runtime/out/types/index.d.ts +18 -6
  47. package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +1 -0
  48. package/node_modules/@zuplo/runtime/out/types/mcp/messages/index.d.ts +1 -0
  49. package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +1 -0
  50. package/node_modules/@zuplo/runtime/out/types/mocks/index.d.ts +1 -0
  51. package/node_modules/@zuplo/runtime/out/types/sdks/aws/index.d.ts +1 -0
  52. package/node_modules/@zuplo/runtime/package.json +1 -1
  53. package/node_modules/ansi-regex/index.js +3 -2
  54. package/node_modules/ansi-regex/package.json +1 -1
  55. package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
  56. package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
  57. package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
  58. package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
  59. package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
  60. package/node_modules/hono/dist/cjs/client/client.js +3 -3
  61. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +1 -1
  62. package/node_modules/hono/dist/cjs/middleware/cors/index.js +15 -12
  63. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +47 -1
  64. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +6 -3
  65. package/node_modules/hono/dist/cjs/utils/url.js +2 -2
  66. package/node_modules/hono/dist/client/client.js +3 -3
  67. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +1 -1
  68. package/node_modules/hono/dist/middleware/cors/index.js +15 -12
  69. package/node_modules/hono/dist/middleware/etag/digest.js +47 -1
  70. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +6 -3
  71. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
  72. package/node_modules/hono/dist/utils/url.js +2 -2
  73. package/node_modules/hono/package.json +1 -1
  74. package/node_modules/type-is/node_modules/content-type/README.md +2 -0
  75. package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
  76. package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
  77. package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
  78. package/node_modules/type-is/node_modules/content-type/package.json +1 -1
  79. package/package.json +6 -6
  80. package/node_modules/@zuplo/runtime/out/esm/chunk-MXYNCB5D.js.map +0 -1
  81. package/node_modules/@zuplo/runtime/out/esm/chunk-RAZK5G27.js +0 -26
  82. package/node_modules/@zuplo/runtime/out/esm/chunk-RAZK5G27.js.map +0 -1
  83. /package/node_modules/@zuplo/runtime/out/esm/{chunk-MXYNCB5D.js.LEGAL.txt → chunk-DEKK4CFE.js.LEGAL.txt} +0 -0
@@ -13,6 +13,157 @@ var RequestError = class extends Error {
13
13
  }
14
14
  };
15
15
 
16
+ //#endregion
17
+ //#region src/headers.ts
18
+ const nonJoinedHeaders = new Set([
19
+ "age",
20
+ "authorization",
21
+ "content-length",
22
+ "content-type",
23
+ "etag",
24
+ "expires",
25
+ "from",
26
+ "host",
27
+ "if-modified-since",
28
+ "if-unmodified-since",
29
+ "last-modified",
30
+ "location",
31
+ "max-forwards",
32
+ "proxy-authorization",
33
+ "referer",
34
+ "retry-after",
35
+ "server",
36
+ "user-agent"
37
+ ]);
38
+ const validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
39
+ const isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
40
+ const normalizeHeaderValue = (value) => {
41
+ if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
42
+ let start = 0;
43
+ let end = value.length;
44
+ while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
45
+ while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
46
+ return value.slice(start, end);
47
+ };
48
+ const forbiddenHeaderValue = /[\0\r\n]/;
49
+ const GlobalHeaders = globalThis.Headers;
50
+ const materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
51
+ const headers = new HeadersCtor();
52
+ for (let i = 0; i < rawHeaders.length; i += 2) {
53
+ const name = rawHeaders[i];
54
+ if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
55
+ }
56
+ return headers;
57
+ };
58
+ var RequestHeaders = class {
59
+ #incoming;
60
+ #rawHeaders;
61
+ #headers;
62
+ #invalidValue;
63
+ constructor(incoming) {
64
+ this.#incoming = incoming;
65
+ if (incoming instanceof node_http2.Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
66
+ }
67
+ get #lazyRawHeaders() {
68
+ return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
69
+ }
70
+ get #native() {
71
+ if (!this.#headers) {
72
+ this.#headers = materializeHeaders(this.#lazyRawHeaders);
73
+ this.#rawHeaders = void 0;
74
+ }
75
+ return this.#headers;
76
+ }
77
+ #normalizedName(name) {
78
+ if (typeof name !== "string") return;
79
+ if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
80
+ return name.toLowerCase();
81
+ }
82
+ #lookupHttp1(lowerName) {
83
+ const headers = this.#incoming instanceof node_http2.Http2ServerRequest ? void 0 : this.#incoming.headers;
84
+ if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
85
+ if (!Object.hasOwn(headers, lowerName)) return null;
86
+ const rawValue = headers[lowerName];
87
+ if (typeof rawValue === "string") {
88
+ const value = normalizeHeaderValue(rawValue);
89
+ return forbiddenHeaderValue.test(value) ? void 0 : value;
90
+ }
91
+ }
92
+ #lookup(rawHeaders, lowerName) {
93
+ const separator = lowerName === "cookie" ? "; " : ", ";
94
+ let value = null;
95
+ for (let i = 0; i < rawHeaders.length; i += 2) {
96
+ const rawName = rawHeaders[i];
97
+ if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
98
+ const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
99
+ if (forbiddenHeaderValue.test(rawValue)) {
100
+ this.#invalidValue = true;
101
+ return;
102
+ }
103
+ value = value === null ? rawValue : value + separator + rawValue;
104
+ }
105
+ }
106
+ return value;
107
+ }
108
+ append(name, value) {
109
+ this.#native.append(name, value);
110
+ }
111
+ delete(name) {
112
+ this.#native.delete(name);
113
+ }
114
+ get(name) {
115
+ const lowerName = this.#normalizedName(name);
116
+ if (lowerName && !this.#headers && !this.#invalidValue) {
117
+ const http1Value = this.#lookupHttp1(lowerName);
118
+ if (http1Value !== void 0) return http1Value;
119
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
120
+ if (value !== void 0) return value;
121
+ }
122
+ return this.#native.get(name);
123
+ }
124
+ has(name) {
125
+ const lowerName = this.#normalizedName(name);
126
+ if (lowerName && !this.#headers && !this.#invalidValue) {
127
+ const http1Value = this.#lookupHttp1(lowerName);
128
+ if (http1Value !== void 0) return http1Value !== null;
129
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
130
+ if (value !== void 0) return value !== null;
131
+ }
132
+ return this.#native.has(name);
133
+ }
134
+ set(name, value) {
135
+ this.#native.set(name, value);
136
+ }
137
+ getSetCookie() {
138
+ return this.#native.getSetCookie();
139
+ }
140
+ keys() {
141
+ return this.#native.keys();
142
+ }
143
+ values() {
144
+ return this.#native.values();
145
+ }
146
+ entries() {
147
+ return this.#native.entries();
148
+ }
149
+ forEach(callback, thisArg) {
150
+ this.#native.forEach((value, key) => {
151
+ callback.call(thisArg, value, key, this);
152
+ });
153
+ }
154
+ [Symbol.iterator]() {
155
+ return this.entries();
156
+ }
157
+ };
158
+ Object.defineProperty(RequestHeaders.prototype, Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
159
+ return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
160
+ ...options,
161
+ depth: depth == null ? null : depth - 1
162
+ })}`;
163
+ } });
164
+ Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
165
+ const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
166
+
16
167
  //#endregion
17
168
  //#region src/url.ts
18
169
  const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
@@ -50,15 +201,6 @@ var Request$1 = class extends GlobalRequest {
50
201
  super(input, options);
51
202
  }
52
203
  };
53
- const newHeadersFromIncoming = (incoming) => {
54
- const headerRecord = [];
55
- const rawHeaders = incoming.rawHeaders;
56
- for (let i = 0, len = rawHeaders.length; i < len; i += 2) {
57
- const key = rawHeaders[i];
58
- if (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);
59
- }
60
- return new Headers(headerRecord);
61
- };
62
204
  const wrapBodyStream = Symbol("wrapBodyStream");
63
205
  const byteExactEncodings = new Set([
64
206
  "latin1",
@@ -12,6 +12,157 @@ var RequestError = class extends Error {
12
12
  }
13
13
  };
14
14
 
15
+ //#endregion
16
+ //#region src/headers.ts
17
+ const nonJoinedHeaders = new Set([
18
+ "age",
19
+ "authorization",
20
+ "content-length",
21
+ "content-type",
22
+ "etag",
23
+ "expires",
24
+ "from",
25
+ "host",
26
+ "if-modified-since",
27
+ "if-unmodified-since",
28
+ "last-modified",
29
+ "location",
30
+ "max-forwards",
31
+ "proxy-authorization",
32
+ "referer",
33
+ "retry-after",
34
+ "server",
35
+ "user-agent"
36
+ ]);
37
+ const validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
38
+ const isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
39
+ const normalizeHeaderValue = (value) => {
40
+ if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
41
+ let start = 0;
42
+ let end = value.length;
43
+ while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
44
+ while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
45
+ return value.slice(start, end);
46
+ };
47
+ const forbiddenHeaderValue = /[\0\r\n]/;
48
+ const GlobalHeaders = globalThis.Headers;
49
+ const materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
50
+ const headers = new HeadersCtor();
51
+ for (let i = 0; i < rawHeaders.length; i += 2) {
52
+ const name = rawHeaders[i];
53
+ if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
54
+ }
55
+ return headers;
56
+ };
57
+ var RequestHeaders = class {
58
+ #incoming;
59
+ #rawHeaders;
60
+ #headers;
61
+ #invalidValue;
62
+ constructor(incoming) {
63
+ this.#incoming = incoming;
64
+ if (incoming instanceof Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
65
+ }
66
+ get #lazyRawHeaders() {
67
+ return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
68
+ }
69
+ get #native() {
70
+ if (!this.#headers) {
71
+ this.#headers = materializeHeaders(this.#lazyRawHeaders);
72
+ this.#rawHeaders = void 0;
73
+ }
74
+ return this.#headers;
75
+ }
76
+ #normalizedName(name) {
77
+ if (typeof name !== "string") return;
78
+ if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
79
+ return name.toLowerCase();
80
+ }
81
+ #lookupHttp1(lowerName) {
82
+ const headers = this.#incoming instanceof Http2ServerRequest ? void 0 : this.#incoming.headers;
83
+ if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
84
+ if (!Object.hasOwn(headers, lowerName)) return null;
85
+ const rawValue = headers[lowerName];
86
+ if (typeof rawValue === "string") {
87
+ const value = normalizeHeaderValue(rawValue);
88
+ return forbiddenHeaderValue.test(value) ? void 0 : value;
89
+ }
90
+ }
91
+ #lookup(rawHeaders, lowerName) {
92
+ const separator = lowerName === "cookie" ? "; " : ", ";
93
+ let value = null;
94
+ for (let i = 0; i < rawHeaders.length; i += 2) {
95
+ const rawName = rawHeaders[i];
96
+ if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
97
+ const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
98
+ if (forbiddenHeaderValue.test(rawValue)) {
99
+ this.#invalidValue = true;
100
+ return;
101
+ }
102
+ value = value === null ? rawValue : value + separator + rawValue;
103
+ }
104
+ }
105
+ return value;
106
+ }
107
+ append(name, value) {
108
+ this.#native.append(name, value);
109
+ }
110
+ delete(name) {
111
+ this.#native.delete(name);
112
+ }
113
+ get(name) {
114
+ const lowerName = this.#normalizedName(name);
115
+ if (lowerName && !this.#headers && !this.#invalidValue) {
116
+ const http1Value = this.#lookupHttp1(lowerName);
117
+ if (http1Value !== void 0) return http1Value;
118
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
119
+ if (value !== void 0) return value;
120
+ }
121
+ return this.#native.get(name);
122
+ }
123
+ has(name) {
124
+ const lowerName = this.#normalizedName(name);
125
+ if (lowerName && !this.#headers && !this.#invalidValue) {
126
+ const http1Value = this.#lookupHttp1(lowerName);
127
+ if (http1Value !== void 0) return http1Value !== null;
128
+ const value = this.#lookup(this.#lazyRawHeaders, lowerName);
129
+ if (value !== void 0) return value !== null;
130
+ }
131
+ return this.#native.has(name);
132
+ }
133
+ set(name, value) {
134
+ this.#native.set(name, value);
135
+ }
136
+ getSetCookie() {
137
+ return this.#native.getSetCookie();
138
+ }
139
+ keys() {
140
+ return this.#native.keys();
141
+ }
142
+ values() {
143
+ return this.#native.values();
144
+ }
145
+ entries() {
146
+ return this.#native.entries();
147
+ }
148
+ forEach(callback, thisArg) {
149
+ this.#native.forEach((value, key) => {
150
+ callback.call(thisArg, value, key, this);
151
+ });
152
+ }
153
+ [Symbol.iterator]() {
154
+ return this.entries();
155
+ }
156
+ };
157
+ Object.defineProperty(RequestHeaders.prototype, Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
158
+ return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
159
+ ...options,
160
+ depth: depth == null ? null : depth - 1
161
+ })}`;
162
+ } });
163
+ Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
164
+ const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
165
+
15
166
  //#endregion
16
167
  //#region src/url.ts
17
168
  const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
@@ -49,15 +200,6 @@ var Request$1 = class extends GlobalRequest {
49
200
  super(input, options);
50
201
  }
51
202
  };
52
- const newHeadersFromIncoming = (incoming) => {
53
- const headerRecord = [];
54
- const rawHeaders = incoming.rawHeaders;
55
- for (let i = 0, len = rawHeaders.length; i < len; i += 2) {
56
- const key = rawHeaders[i];
57
- if (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);
58
- }
59
- return new Headers(headerRecord);
60
- };
61
203
  const wrapBodyStream = Symbol("wrapBodyStream");
62
204
  const byteExactEncodings = new Set([
63
205
  "latin1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/node-server",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Node.js Adapter for Hono",
5
5
  "main": "dist/index.mjs",
6
6
  "type": "module",
@@ -4,6 +4,22 @@ import { SimpleEventEmitter } from './eventemitter';
4
4
  import { PostHogFlagsResponse, PostHogCoreOptions, PostHogEventProperties, PostHogCaptureOptions, JsonType, PostHogRemoteConfig, FeatureFlagValue, PostHogFeatureFlagDetails, FeatureFlagDetail, SurveyResponse, PostHogFetchResponse, PostHogFetchOptions, PostHogPersistedProperty, Logger, GetFlagsResult } from './types';
5
5
  import { RetriableOptions } from './utils';
6
6
  import { ErrorPropertiesBuilder } from './error-tracking';
7
+ declare class PostHogFetchHttpError extends Error {
8
+ response: PostHogFetchResponse;
9
+ reqByteLength: number;
10
+ private responseBodyDeadline;
11
+ private abortController;
12
+ name: string;
13
+ private responseBodyTextPromise?;
14
+ private responseBodyTimer?;
15
+ private _bodyReadTimedOut;
16
+ constructor(response: PostHogFetchResponse, reqByteLength: number, responseBodyDeadline: number, abortController: AbortController);
17
+ get status(): number;
18
+ get bodyReadTimedOut(): boolean;
19
+ get text(): Promise<string>;
20
+ get json(): Promise<any>;
21
+ cancelResponseBody(reason?: unknown): void;
22
+ }
7
23
  declare class PostHogFetchNetworkError extends Error {
8
24
  error: unknown;
9
25
  name: string;
@@ -21,6 +37,9 @@ export declare function logFlushError(err: any): Promise<void>;
21
37
  * @public
22
38
  */
23
39
  export declare function isPostHogFetchNetworkError(err: unknown): err is PostHogFetchNetworkError;
40
+ export declare function isPostHogFetchContentTooLargeError(err: unknown): err is PostHogFetchHttpError & {
41
+ status: 413;
42
+ };
24
43
  /**
25
44
  * Outcome of a logs batch send. Keeps HTTP error classification inside core
26
45
  * (single source of truth — same policy events already use in `_flush()`) so
@@ -242,9 +261,10 @@ export declare abstract class PostHogCoreStateless {
242
261
  */
243
262
  protected getActiveQueueRoutes(): string[];
244
263
  private getRouteQueue;
245
- protected enqueue(type: string, _message: any, options?: PostHogCaptureOptions): void;
246
- protected sendImmediate(type: string, _message: any, options?: PostHogCaptureOptions): Promise<void>;
264
+ protected enqueue(type: string, _message: any, options?: PostHogCaptureOptions, explicitRoute?: string): void;
265
+ protected sendImmediate(type: string, _message: any, options?: PostHogCaptureOptions, explicitRoute?: string): Promise<void>;
247
266
  private normalizeMessage;
267
+ private normalizeTimestampForWire;
248
268
  protected prepareMessage(_message: any, options?: PostHogCaptureOptions): PostHogEventProperties;
249
269
  private clearFlushTimer;
250
270
  /**
@@ -292,6 +312,7 @@ export declare abstract class PostHogCoreStateless {
292
312
  * to avoid using the Web Streams compression implementation.
293
313
  */
294
314
  protected compressPayload(payload: string): Promise<Blob | null>;
315
+ protected getBatchEndpointPath(_route: string): string;
295
316
  /**
296
317
  * Builds and sends one `/batch/` request for the given already-normalized
297
318
  * messages, throwing on transport/HTTP error. Batch-size (413) shrinking,
@@ -304,7 +325,7 @@ export declare abstract class PostHogCoreStateless {
304
325
  * {@link getQueueRouteKey}); a subclass can dispatch to a different transport per
305
326
  * route. The default `/batch/` transport ignores it — every event is homogeneous.
306
327
  */
307
- protected sendBatch(batchMessages: (PostHogEventProperties | undefined)[], retryOptions?: Partial<RetriableOptions>, _route?: string): Promise<void>;
328
+ protected sendBatch(batchMessages: (PostHogEventProperties | undefined)[], retryOptions?: Partial<RetriableOptions>, route?: string): Promise<void>;
308
329
  private _flush;
309
330
  private _flushRoute;
310
331
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"posthog-core-stateless.d.ts","sourceRoot":"","sources":["../src/posthog-core-stateless.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAA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vB;;;OAGG;IACH,OAAO,CAAC,eAAe;YAST,sBAAsB;IAsBpC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,SAAS,CAAC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAInD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,OAAO,CAAC,aAAa;IAmDrB,SAAS,CAAC,gBAAgB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAavD;;;OAGG;IACH,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAIhE,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAItD;;;;;;;;;;;OAWG;cACa,SAAS,CACvB,aAAa,EAAE,CAAC,sBAAsB,GAAG,SAAS,CAAC,EAAE,EACrD,YAAY,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACxC,KAAK,GAAE,MAA4B,GAClC,OAAO,CAAC,IAAI,CAAC;YAuCF,MAAM;YAmCN,WAAW;IAsFzB;;;;;;;;;OASG;IACG,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6C7E;;;;;OAKG;IACG,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAgDtF,OAAO,CAAC,cAAc;IAsJhB,SAAS,CAAC,iBAAiB,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA0DjE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,QAAQ,CAAC,iBAAiB,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAYjE"}
@@ -24,6 +24,7 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
+ isPostHogFetchContentTooLargeError: ()=>isPostHogFetchContentTooLargeError,
27
28
  isPostHogFetchNetworkError: ()=>isPostHogFetchNetworkError,
28
29
  maybeAdd: ()=>maybeAdd,
29
30
  logFlushError: ()=>logFlushError,
@@ -598,14 +599,14 @@ class PostHogCoreStateless {
598
599
  getRouteQueue(route) {
599
600
  return this.getPersistedProperty(this.persistedQueueKeyForRoute(route)) || [];
600
601
  }
601
- enqueue(type, _message, options) {
602
+ enqueue(type, _message, options, explicitRoute) {
602
603
  this.wrap(()=>{
603
604
  if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
604
605
  let message = this.prepareMessage(_message, options);
605
606
  message = this.processBeforeEnqueue(message);
606
607
  if (null === message) return;
607
608
  message = this.normalizeMessage(message);
608
- const queueKey = this.persistedQueueKeyForRoute(this.getQueueRouteKey(message));
609
+ const queueKey = this.persistedQueueKeyForRoute(explicitRoute ?? this.getQueueRouteKey(message));
609
610
  const queue = this.getPersistedProperty(queueKey) || [];
610
611
  if (queue.length >= this.maxQueueSize) {
611
612
  queue.shift();
@@ -620,7 +621,7 @@ class PostHogCoreStateless {
620
621
  if (this.flushInterval && !this._flushTimer) this._flushTimer = (0, index_js_namespaceObject.safeSetTimeout)(()=>this.flushBackground(), this.flushInterval);
621
622
  });
622
623
  }
623
- async sendImmediate(type, _message, options) {
624
+ async sendImmediate(type, _message, options, explicitRoute) {
624
625
  if (this.disabled) return void this._logger.warn('The client is disabled');
625
626
  if (!this._isInitialized) await this._initPromise;
626
627
  if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
@@ -631,7 +632,7 @@ class PostHogCoreStateless {
631
632
  try {
632
633
  await this.sendBatch([
633
634
  message
634
- ], void 0, this.getQueueRouteKey(message));
635
+ ], void 0, explicitRoute ?? this.getQueueRouteKey(message));
635
636
  } catch (err) {
636
637
  this._events.emit('error', err);
637
638
  }
@@ -651,6 +652,13 @@ class PostHogCoreStateless {
651
652
  sanitizedMessage.uuid = (0, index_js_namespaceObject.getEventUuid)(sanitizedMessage.uuid, uuidv7_js_namespaceObject.uuidv7);
652
653
  return sanitizedMessage;
653
654
  }
655
+ normalizeTimestampForWire(timestamp) {
656
+ const parsedTimestamp = timestamp instanceof Date ? timestamp : 'string' == typeof timestamp ? new Date(timestamp) : null;
657
+ if (!parsedTimestamp || Number.isNaN(parsedTimestamp.getTime())) return timestamp;
658
+ const normalized = parsedTimestamp.toISOString();
659
+ const fractionalSeconds = 'string' == typeof timestamp ? timestamp.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1] : void 0;
660
+ return fractionalSeconds && fractionalSeconds.length > 3 ? normalized.replace(/\.\d{3}Z$/, `.${fractionalSeconds}Z`) : normalized;
661
+ }
654
662
  prepareMessage(_message, options) {
655
663
  const message = {
656
664
  ..._message,
@@ -738,15 +746,25 @@ class PostHogCoreStateless {
738
746
  compressPayload(payload) {
739
747
  return (0, external_gzip_js_namespaceObject.gzipCompress)(payload, this.isDebug);
740
748
  }
741
- async sendBatch(batchMessages, retryOptions, _route = DEFAULT_QUEUE_ROUTE) {
749
+ getBatchEndpointPath(_route) {
750
+ return '/batch/';
751
+ }
752
+ async sendBatch(batchMessages, retryOptions, route = DEFAULT_QUEUE_ROUTE) {
742
753
  const data = {
743
754
  api_key: this.apiKey,
744
- batch: batchMessages,
755
+ batch: batchMessages.map((message)=>{
756
+ if (!message) return message;
757
+ const timestamp = this.normalizeTimestampForWire(message.timestamp);
758
+ return timestamp === message.timestamp ? message : {
759
+ ...message,
760
+ timestamp
761
+ };
762
+ }),
745
763
  sent_at: (0, index_js_namespaceObject.currentISOTime)()
746
764
  };
747
765
  if (this.historicalMigration) data.historical_migration = true;
748
766
  const payload = (0, index_js_namespaceObject.safeJsonStringify)(data);
749
- const url = `${this.host}/batch/`;
767
+ const url = `${this.host}${this.getBatchEndpointPath(route)}`;
750
768
  const gzippedPayload = this.disableCompression ? null : await this.compressPayload(payload);
751
769
  const fetchOptions = {
752
770
  method: 'POST',
@@ -1036,9 +1054,10 @@ class PostHogCoreStateless {
1036
1054
  }
1037
1055
  };
1038
1056
  return (0, index_js_namespaceObject.raceWithTimeout)(doShutdown(), shutdownTimeoutMs, ()=>{
1039
- this._logger.error('Timed out while shutting down PostHog');
1057
+ this._logger.critical('Timeout while shutting down PostHog. Some events may not have been sent.', {
1058
+ shutdownTimeoutMs
1059
+ });
1040
1060
  hasTimedOut = true;
1041
- throw 'Timeout while shutting down PostHog. Some events may not have been sent.';
1042
1061
  });
1043
1062
  }
1044
1063
  async shutdown(shutdownTimeoutMs = 30000) {
@@ -1052,6 +1071,7 @@ class PostHogCoreStateless {
1052
1071
  exports.PostHogCoreStateless = __webpack_exports__.PostHogCoreStateless;
1053
1072
  exports.QuotaLimitedFeature = __webpack_exports__.QuotaLimitedFeature;
1054
1073
  exports.applyCallerFeatureFlagOverrides = __webpack_exports__.applyCallerFeatureFlagOverrides;
1074
+ exports.isPostHogFetchContentTooLargeError = __webpack_exports__.isPostHogFetchContentTooLargeError;
1055
1075
  exports.isPostHogFetchNetworkError = __webpack_exports__.isPostHogFetchNetworkError;
1056
1076
  exports.logFlushError = __webpack_exports__.logFlushError;
1057
1077
  exports.maybeAdd = __webpack_exports__.maybeAdd;
@@ -1059,6 +1079,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
1059
1079
  "PostHogCoreStateless",
1060
1080
  "QuotaLimitedFeature",
1061
1081
  "applyCallerFeatureFlagOverrides",
1082
+ "isPostHogFetchContentTooLargeError",
1062
1083
  "isPostHogFetchNetworkError",
1063
1084
  "logFlushError",
1064
1085
  "maybeAdd"
@@ -565,14 +565,14 @@ class PostHogCoreStateless {
565
565
  getRouteQueue(route) {
566
566
  return this.getPersistedProperty(this.persistedQueueKeyForRoute(route)) || [];
567
567
  }
568
- enqueue(type, _message, options) {
568
+ enqueue(type, _message, options, explicitRoute) {
569
569
  this.wrap(()=>{
570
570
  if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
571
571
  let message = this.prepareMessage(_message, options);
572
572
  message = this.processBeforeEnqueue(message);
573
573
  if (null === message) return;
574
574
  message = this.normalizeMessage(message);
575
- const queueKey = this.persistedQueueKeyForRoute(this.getQueueRouteKey(message));
575
+ const queueKey = this.persistedQueueKeyForRoute(explicitRoute ?? this.getQueueRouteKey(message));
576
576
  const queue = this.getPersistedProperty(queueKey) || [];
577
577
  if (queue.length >= this.maxQueueSize) {
578
578
  queue.shift();
@@ -587,7 +587,7 @@ class PostHogCoreStateless {
587
587
  if (this.flushInterval && !this._flushTimer) this._flushTimer = safeSetTimeout(()=>this.flushBackground(), this.flushInterval);
588
588
  });
589
589
  }
590
- async sendImmediate(type, _message, options) {
590
+ async sendImmediate(type, _message, options, explicitRoute) {
591
591
  if (this.disabled) return void this._logger.warn('The client is disabled');
592
592
  if (!this._isInitialized) await this._initPromise;
593
593
  if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
@@ -598,7 +598,7 @@ class PostHogCoreStateless {
598
598
  try {
599
599
  await this.sendBatch([
600
600
  message
601
- ], void 0, this.getQueueRouteKey(message));
601
+ ], void 0, explicitRoute ?? this.getQueueRouteKey(message));
602
602
  } catch (err) {
603
603
  this._events.emit('error', err);
604
604
  }
@@ -618,6 +618,13 @@ class PostHogCoreStateless {
618
618
  sanitizedMessage.uuid = getEventUuid(sanitizedMessage.uuid, uuidv7);
619
619
  return sanitizedMessage;
620
620
  }
621
+ normalizeTimestampForWire(timestamp) {
622
+ const parsedTimestamp = timestamp instanceof Date ? timestamp : 'string' == typeof timestamp ? new Date(timestamp) : null;
623
+ if (!parsedTimestamp || Number.isNaN(parsedTimestamp.getTime())) return timestamp;
624
+ const normalized = parsedTimestamp.toISOString();
625
+ const fractionalSeconds = 'string' == typeof timestamp ? timestamp.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1] : void 0;
626
+ return fractionalSeconds && fractionalSeconds.length > 3 ? normalized.replace(/\.\d{3}Z$/, `.${fractionalSeconds}Z`) : normalized;
627
+ }
621
628
  prepareMessage(_message, options) {
622
629
  const message = {
623
630
  ..._message,
@@ -705,15 +712,25 @@ class PostHogCoreStateless {
705
712
  compressPayload(payload) {
706
713
  return gzipCompress(payload, this.isDebug);
707
714
  }
708
- async sendBatch(batchMessages, retryOptions, _route = DEFAULT_QUEUE_ROUTE) {
715
+ getBatchEndpointPath(_route) {
716
+ return '/batch/';
717
+ }
718
+ async sendBatch(batchMessages, retryOptions, route = DEFAULT_QUEUE_ROUTE) {
709
719
  const data = {
710
720
  api_key: this.apiKey,
711
- batch: batchMessages,
721
+ batch: batchMessages.map((message)=>{
722
+ if (!message) return message;
723
+ const timestamp = this.normalizeTimestampForWire(message.timestamp);
724
+ return timestamp === message.timestamp ? message : {
725
+ ...message,
726
+ timestamp
727
+ };
728
+ }),
712
729
  sent_at: currentISOTime()
713
730
  };
714
731
  if (this.historicalMigration) data.historical_migration = true;
715
732
  const payload = safeJsonStringify(data);
716
- const url = `${this.host}/batch/`;
733
+ const url = `${this.host}${this.getBatchEndpointPath(route)}`;
717
734
  const gzippedPayload = this.disableCompression ? null : await this.compressPayload(payload);
718
735
  const fetchOptions = {
719
736
  method: 'POST',
@@ -1003,9 +1020,10 @@ class PostHogCoreStateless {
1003
1020
  }
1004
1021
  };
1005
1022
  return raceWithTimeout(doShutdown(), shutdownTimeoutMs, ()=>{
1006
- this._logger.error('Timed out while shutting down PostHog');
1023
+ this._logger.critical('Timeout while shutting down PostHog. Some events may not have been sent.', {
1024
+ shutdownTimeoutMs
1025
+ });
1007
1026
  hasTimedOut = true;
1008
- throw 'Timeout while shutting down PostHog. Some events may not have been sent.';
1009
1027
  });
1010
1028
  }
1011
1029
  async shutdown(shutdownTimeoutMs = 30000) {
@@ -1016,4 +1034,4 @@ class PostHogCoreStateless {
1016
1034
  return this.shutdownPromise;
1017
1035
  }
1018
1036
  }
1019
- export { PostHogCoreStateless, posthog_core_stateless_QuotaLimitedFeature as QuotaLimitedFeature, applyCallerFeatureFlagOverrides, isPostHogFetchNetworkError, logFlushError, maybeAdd };
1037
+ export { PostHogCoreStateless, posthog_core_stateless_QuotaLimitedFeature as QuotaLimitedFeature, applyCallerFeatureFlagOverrides, isPostHogFetchContentTooLargeError, isPostHogFetchNetworkError, logFlushError, maybeAdd };