@zuplo/cli 6.72.2 → 6.72.7
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/@fastify/reply-from/.github/dependabot.yml +42 -2
- package/node_modules/@fastify/reply-from/README.md +3 -3
- package/node_modules/@fastify/reply-from/index.js +6 -1
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.gitattributes +2 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/dependabot.yml +53 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/LICENSE +21 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/README.md +188 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/eslint.config.js +6 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/index.js +67 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/lib/getPluginName.js +25 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/lib/toCamelCase.js +10 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/package.json +70 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/bundlers.test.js +110 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/checkVersion.test.js +67 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/composite.test.js +14 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/esm/esm.mjs +11 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/esm/index.test.js +11 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/extractPluginName.test.js +49 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/mu1tip1e.composite.test.js +15 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/test.js +396 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/toCamelCase.test.js +24 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/example-async.tst.ts +19 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/example-callback.tst.ts +19 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/index.d.ts +54 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/index.tst.ts +249 -0
- package/node_modules/@fastify/reply-from/package.json +6 -7
- package/node_modules/@fastify/reply-from/test/incomplete-request.test.js +142 -0
- package/node_modules/@fastify/reply-from/types/index.tst.ts +123 -0
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +35 -2
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.js +68 -56
- package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +68 -56
- package/node_modules/@posthog/core/dist/posthog-core.d.ts +2 -1
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.js +1 -0
- package/node_modules/@posthog/core/dist/posthog-core.mjs +1 -0
- package/node_modules/@posthog/core/dist/types.d.ts +1 -0
- package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/types.js +1 -0
- package/node_modules/@posthog/core/dist/types.mjs +1 -0
- package/node_modules/@posthog/core/package.json +1 -1
- package/node_modules/@posthog/core/src/posthog-core-stateless.ts +135 -72
- package/node_modules/@posthog/core/src/posthog-core.ts +3 -1
- package/node_modules/@posthog/core/src/types.ts +5 -0
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.d.ts.map +1 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.js +85 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.js.map +1 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js +82 -0
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js.map +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/out/esm/chunk-X7TLQJWO.js +26 -0
- package/node_modules/@zuplo/otel/out/esm/chunk-X7TLQJWO.js.map +1 -0
- package/node_modules/@zuplo/otel/out/esm/index.js +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-423FXHUV.js +399 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-423FXHUV.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-GBIUQ4JJ.js +30 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-GBIUQ4JJ.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +1576 -288
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +1374 -156
- package/node_modules/@zuplo/runtime/out/types/sdks/aws/index.d.ts +2281 -0
- package/node_modules/@zuplo/runtime/package.json +5 -1
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -4
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +12 -2
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -4
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +12 -2
- package/node_modules/hono/dist/cjs/client/client.js +10 -1
- package/node_modules/hono/dist/cjs/client/utils.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +2 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -1
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +5 -3
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +9 -0
- package/node_modules/hono/dist/client/client.js +10 -1
- package/node_modules/hono/dist/client/utils.js +1 -1
- package/node_modules/hono/dist/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/middleware/compress/index.js +2 -1
- package/node_modules/hono/dist/middleware/etag/index.js +2 -1
- package/node_modules/hono/dist/middleware/method-override/index.js +5 -3
- package/node_modules/hono/dist/router/trie-router/node.js +9 -0
- package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +1 -1
- package/node_modules/hono/dist/types/helper/websocket/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/language/language.d.ts +18 -0
- package/node_modules/hono/dist/types/utils/types.d.ts +1 -1
- package/node_modules/hono/package.json +4 -4
- package/package.json +6 -6
- package/node_modules/@fastify/reply-from/types/index.test-d.ts +0 -194
- package/node_modules/@zuplo/otel/out/esm/chunk-T25G5RDX.js +0 -26
- package/node_modules/@zuplo/otel/out/esm/chunk-T25G5RDX.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-IC7XGD5C.js +0 -403
- package/node_modules/@zuplo/runtime/out/esm/chunk-IC7XGD5C.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-IC7XGD5C.js.LEGAL.txt → chunk-423FXHUV.js.LEGAL.txt} +0 -0
|
@@ -60,13 +60,13 @@ export declare abstract class PostHogCoreStateless {
|
|
|
60
60
|
private flushPromises;
|
|
61
61
|
private _dequeuedMessagesCount;
|
|
62
62
|
private shutdownPromise;
|
|
63
|
-
|
|
63
|
+
protected requestTimeout: number;
|
|
64
64
|
private featureFlagsRequestTimeoutMs;
|
|
65
65
|
private featureFlagsRequestMaxRetries;
|
|
66
66
|
private remoteConfigRequestTimeoutMs;
|
|
67
67
|
private removeDebugCallback?;
|
|
68
68
|
private disableGeoip;
|
|
69
|
-
|
|
69
|
+
protected historicalMigration: boolean;
|
|
70
70
|
private evaluationContexts?;
|
|
71
71
|
protected disabled: boolean;
|
|
72
72
|
protected disableCompression: boolean;
|
|
@@ -216,6 +216,25 @@ export declare abstract class PostHogCoreStateless {
|
|
|
216
216
|
* to prevent duplicate events on app crash/restart scenarios.
|
|
217
217
|
*/
|
|
218
218
|
protected flushStorage(): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Route a message to a named queue. Events sharing a route are batched, flushed, retried,
|
|
221
|
+
* and persisted together, independently of other routes. The default keeps every event on a
|
|
222
|
+
* single route (byte-identical to the pre-partitioning behavior); override to segregate a
|
|
223
|
+
* subset of events onto their own queue and transport (see posthog-node's `$ai_*` routing).
|
|
224
|
+
*/
|
|
225
|
+
protected getQueueRouteKey(_message: PostHogEventProperties): string;
|
|
226
|
+
/**
|
|
227
|
+
* Maps a route key to the persisted-storage key its queue lives under. The default route uses
|
|
228
|
+
* the historical {@link PostHogPersistedProperty.Queue}; override to point other routes at their
|
|
229
|
+
* own storage keys (e.g. {@link PostHogPersistedProperty.AiQueue}).
|
|
230
|
+
*/
|
|
231
|
+
protected persistedQueueKeyForRoute(_route: string): PostHogPersistedProperty;
|
|
232
|
+
/**
|
|
233
|
+
* The set of routes that {@link _flush} and shutdown drain, in order. Must include every route
|
|
234
|
+
* {@link getQueueRouteKey} can return. Defaults to the single default route.
|
|
235
|
+
*/
|
|
236
|
+
protected getActiveQueueRoutes(): string[];
|
|
237
|
+
private getRouteQueue;
|
|
219
238
|
protected enqueue(type: string, _message: any, options?: PostHogCaptureOptions): void;
|
|
220
239
|
protected sendImmediate(type: string, _message: any, options?: PostHogCaptureOptions): Promise<void>;
|
|
221
240
|
private normalizeMessage;
|
|
@@ -261,7 +280,21 @@ export declare abstract class PostHogCoreStateless {
|
|
|
261
280
|
protected getCustomHeaders(): {
|
|
262
281
|
[key: string]: string;
|
|
263
282
|
};
|
|
283
|
+
/**
|
|
284
|
+
* Builds and sends one `/batch/` request for the given already-normalized
|
|
285
|
+
* messages, throwing on transport/HTTP error. Batch-size (413) shrinking,
|
|
286
|
+
* queue persistence, and error recovery stay with the callers (`_flush` and
|
|
287
|
+
* `sendImmediate`). This is the overridable seam that lets a subclass swap the
|
|
288
|
+
* capture submission transport (e.g. Capture V1) for both the batched and the
|
|
289
|
+
* immediate send paths at once.
|
|
290
|
+
*
|
|
291
|
+
* `route` identifies which queue route the batch came from (see
|
|
292
|
+
* {@link getQueueRouteKey}); a subclass can dispatch to a different transport per
|
|
293
|
+
* route. The default `/batch/` transport ignores it — every event is homogeneous.
|
|
294
|
+
*/
|
|
295
|
+
protected sendBatch(batchMessages: (PostHogEventProperties | undefined)[], retryOptions?: Partial<RetriableOptions>, _route?: string): Promise<void>;
|
|
264
296
|
private _flush;
|
|
297
|
+
private _flushRoute;
|
|
265
298
|
/**
|
|
266
299
|
* Sends a pre-built OTLP logs payload to `/i/v1/logs`. Returns a tagged
|
|
267
300
|
* outcome instead of throwing so PostHogLogs doesn't have to know about the
|
|
@@ -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,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAGnD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAGhB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EAExB,MAAM,EACN,cAAc,EAEf,MAAM,SAAS,CAAA;AAChB,OAAO,EAML,gBAAgB,EAMjB,MAAM,SAAS,C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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;;;;;;;;;;;OAWG;cACa,SAAS,CACvB,aAAa,EAAE,CAAC,sBAAsB,GAAG,SAAS,CAAC,EAAE,EACrD,YAAY,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACxC,MAAM,GAAE,MAA4B,GACnC,OAAO,CAAC,IAAI,CAAC;YAiCF,MAAM;YAmCN,WAAW;IAoEzB;;;;;;;;;OASG;IACG,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC;YAwC/D,cAAc;IAsDtB,SAAS,CAAC,iBAAiB,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAmEjE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,QAAQ,CAAC,iBAAiB,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAYjE"}
|
|
@@ -103,6 +103,7 @@ var posthog_core_stateless_QuotaLimitedFeature = /*#__PURE__*/ function(QuotaLim
|
|
|
103
103
|
QuotaLimitedFeature["Recordings"] = "recordings";
|
|
104
104
|
return QuotaLimitedFeature;
|
|
105
105
|
}({});
|
|
106
|
+
const DEFAULT_QUEUE_ROUTE = 'default';
|
|
106
107
|
class PostHogCoreStateless {
|
|
107
108
|
getErrorPropertiesBuilder() {
|
|
108
109
|
if (!this._errorPropertiesBuilder) this._errorPropertiesBuilder = this.createErrorPropertiesBuilder();
|
|
@@ -529,6 +530,20 @@ class PostHogCoreStateless {
|
|
|
529
530
|
return message;
|
|
530
531
|
}
|
|
531
532
|
async flushStorage() {}
|
|
533
|
+
getQueueRouteKey(_message) {
|
|
534
|
+
return DEFAULT_QUEUE_ROUTE;
|
|
535
|
+
}
|
|
536
|
+
persistedQueueKeyForRoute(_route) {
|
|
537
|
+
return external_types_js_namespaceObject.PostHogPersistedProperty.Queue;
|
|
538
|
+
}
|
|
539
|
+
getActiveQueueRoutes() {
|
|
540
|
+
return [
|
|
541
|
+
DEFAULT_QUEUE_ROUTE
|
|
542
|
+
];
|
|
543
|
+
}
|
|
544
|
+
getRouteQueue(route) {
|
|
545
|
+
return this.getPersistedProperty(this.persistedQueueKeyForRoute(route)) || [];
|
|
546
|
+
}
|
|
532
547
|
enqueue(type, _message, options) {
|
|
533
548
|
this.wrap(()=>{
|
|
534
549
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
@@ -536,7 +551,8 @@ class PostHogCoreStateless {
|
|
|
536
551
|
message = this.processBeforeEnqueue(message);
|
|
537
552
|
if (null === message) return;
|
|
538
553
|
message = this.normalizeMessage(message);
|
|
539
|
-
const
|
|
554
|
+
const queueKey = this.persistedQueueKeyForRoute(this.getQueueRouteKey(message));
|
|
555
|
+
const queue = this.getPersistedProperty(queueKey) || [];
|
|
540
556
|
if (queue.length >= this.maxQueueSize) {
|
|
541
557
|
queue.shift();
|
|
542
558
|
this._logger.info('Queue is full, the oldest event is dropped.');
|
|
@@ -544,7 +560,7 @@ class PostHogCoreStateless {
|
|
|
544
560
|
queue.push({
|
|
545
561
|
message
|
|
546
562
|
});
|
|
547
|
-
this.setPersistedProperty(
|
|
563
|
+
this.setPersistedProperty(queueKey, queue);
|
|
548
564
|
this._events.emit(type, message);
|
|
549
565
|
if (queue.length >= this.flushAt) this.flushBackground();
|
|
550
566
|
if (this.flushInterval && !this._flushTimer) this._flushTimer = (0, index_js_namespaceObject.safeSetTimeout)(()=>this.flushBackground(), this.flushInterval);
|
|
@@ -558,31 +574,10 @@ class PostHogCoreStateless {
|
|
|
558
574
|
message = this.processBeforeEnqueue(message);
|
|
559
575
|
if (null === message) return;
|
|
560
576
|
message = this.normalizeMessage(message);
|
|
561
|
-
const data = {
|
|
562
|
-
api_key: this.apiKey,
|
|
563
|
-
batch: [
|
|
564
|
-
message
|
|
565
|
-
],
|
|
566
|
-
sent_at: (0, index_js_namespaceObject.currentISOTime)()
|
|
567
|
-
};
|
|
568
|
-
if (this.historicalMigration) data.historical_migration = true;
|
|
569
|
-
const payload = (0, index_js_namespaceObject.safeJsonStringify)(data);
|
|
570
|
-
const url = `${this.host}/batch/`;
|
|
571
|
-
const gzippedPayload = this.disableCompression ? null : await (0, external_gzip_js_namespaceObject.gzipCompress)(payload, this.isDebug);
|
|
572
|
-
const fetchOptions = {
|
|
573
|
-
method: 'POST',
|
|
574
|
-
headers: {
|
|
575
|
-
...this.getCustomHeaders(),
|
|
576
|
-
'Content-Type': 'application/json',
|
|
577
|
-
...null !== gzippedPayload && {
|
|
578
|
-
'Content-Encoding': 'gzip'
|
|
579
|
-
}
|
|
580
|
-
},
|
|
581
|
-
body: gzippedPayload || payload
|
|
582
|
-
};
|
|
583
577
|
try {
|
|
584
|
-
|
|
585
|
-
|
|
578
|
+
await this.sendBatch([
|
|
579
|
+
message
|
|
580
|
+
], void 0, this.getQueueRouteKey(message));
|
|
586
581
|
} catch (err) {
|
|
587
582
|
this._events.emit('error', err);
|
|
588
583
|
}
|
|
@@ -686,44 +681,62 @@ class PostHogCoreStateless {
|
|
|
686
681
|
if (customUserAgent && '' !== customUserAgent) headers['User-Agent'] = customUserAgent;
|
|
687
682
|
return headers;
|
|
688
683
|
}
|
|
684
|
+
async sendBatch(batchMessages, retryOptions, _route = DEFAULT_QUEUE_ROUTE) {
|
|
685
|
+
const data = {
|
|
686
|
+
api_key: this.apiKey,
|
|
687
|
+
batch: batchMessages,
|
|
688
|
+
sent_at: (0, index_js_namespaceObject.currentISOTime)()
|
|
689
|
+
};
|
|
690
|
+
if (this.historicalMigration) data.historical_migration = true;
|
|
691
|
+
const payload = (0, index_js_namespaceObject.safeJsonStringify)(data);
|
|
692
|
+
const url = `${this.host}/batch/`;
|
|
693
|
+
const gzippedPayload = this.disableCompression ? null : await (0, external_gzip_js_namespaceObject.gzipCompress)(payload, this.isDebug);
|
|
694
|
+
const fetchOptions = {
|
|
695
|
+
method: 'POST',
|
|
696
|
+
headers: {
|
|
697
|
+
...this.getCustomHeaders(),
|
|
698
|
+
'Content-Type': 'application/json',
|
|
699
|
+
...null !== gzippedPayload && {
|
|
700
|
+
'Content-Encoding': 'gzip'
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
body: gzippedPayload || payload
|
|
704
|
+
};
|
|
705
|
+
const response = await this.fetchWithRetry(url, fetchOptions, retryOptions);
|
|
706
|
+
await response.body?.cancel()?.catch(()=>{});
|
|
707
|
+
}
|
|
689
708
|
async _flush() {
|
|
690
709
|
this.clearFlushTimer();
|
|
691
710
|
await this._initPromise;
|
|
692
|
-
|
|
693
|
-
if (!
|
|
711
|
+
const routes = this.getActiveQueueRoutes();
|
|
712
|
+
if (!routes.some((route)=>this.getRouteQueue(route).length > 0)) return;
|
|
694
713
|
const sentMessages = [];
|
|
714
|
+
let firstError;
|
|
715
|
+
for (const route of routes)try {
|
|
716
|
+
await this._flushRoute(route, sentMessages);
|
|
717
|
+
} catch (err) {
|
|
718
|
+
if (void 0 === firstError) firstError = err;
|
|
719
|
+
}
|
|
720
|
+
if (void 0 !== firstError) throw firstError;
|
|
721
|
+
this._events.emit('flush', sentMessages);
|
|
722
|
+
}
|
|
723
|
+
async _flushRoute(route, sentMessages) {
|
|
724
|
+
const queueKey = this.persistedQueueKeyForRoute(route);
|
|
725
|
+
let queue = this.getPersistedProperty(queueKey) || [];
|
|
726
|
+
if (!queue.length) return;
|
|
695
727
|
const originalQueueLength = queue.length;
|
|
696
|
-
|
|
728
|
+
let sentFromRoute = 0;
|
|
729
|
+
while(queue.length > 0 && sentFromRoute < originalQueueLength){
|
|
697
730
|
const batchItems = queue.slice(0, this.maxBatchSize);
|
|
698
731
|
const batchMessages = batchItems.map((item)=>void 0 === item.message ? item.message : this.normalizeMessage(item.message));
|
|
699
732
|
const persistQueueChange = async ()=>{
|
|
700
|
-
const refreshedQueue = this.getPersistedProperty(
|
|
733
|
+
const refreshedQueue = this.getPersistedProperty(queueKey) || [];
|
|
701
734
|
const newQueue = refreshedQueue.slice(batchItems.length);
|
|
702
|
-
this.setPersistedProperty(
|
|
735
|
+
this.setPersistedProperty(queueKey, newQueue);
|
|
703
736
|
queue = newQueue;
|
|
704
737
|
this._dequeuedMessagesCount += batchItems.length;
|
|
705
738
|
await this.flushStorage();
|
|
706
739
|
};
|
|
707
|
-
const data = {
|
|
708
|
-
api_key: this.apiKey,
|
|
709
|
-
batch: batchMessages,
|
|
710
|
-
sent_at: (0, index_js_namespaceObject.currentISOTime)()
|
|
711
|
-
};
|
|
712
|
-
if (this.historicalMigration) data.historical_migration = true;
|
|
713
|
-
const payload = (0, index_js_namespaceObject.safeJsonStringify)(data);
|
|
714
|
-
const url = `${this.host}/batch/`;
|
|
715
|
-
const gzippedPayload = this.disableCompression ? null : await (0, external_gzip_js_namespaceObject.gzipCompress)(payload, this.isDebug);
|
|
716
|
-
const fetchOptions = {
|
|
717
|
-
method: 'POST',
|
|
718
|
-
headers: {
|
|
719
|
-
...this.getCustomHeaders(),
|
|
720
|
-
'Content-Type': 'application/json',
|
|
721
|
-
...null !== gzippedPayload && {
|
|
722
|
-
'Content-Encoding': 'gzip'
|
|
723
|
-
}
|
|
724
|
-
},
|
|
725
|
-
body: gzippedPayload || payload
|
|
726
|
-
};
|
|
727
740
|
const retryOptions = {
|
|
728
741
|
retryCheck: (err)=>{
|
|
729
742
|
if (isPostHogFetchContentTooLargeError(err)) return false;
|
|
@@ -731,8 +744,7 @@ class PostHogCoreStateless {
|
|
|
731
744
|
}
|
|
732
745
|
};
|
|
733
746
|
try {
|
|
734
|
-
|
|
735
|
-
await response.body?.cancel()?.catch(()=>{});
|
|
747
|
+
await this.sendBatch(batchMessages, retryOptions, route);
|
|
736
748
|
} catch (err) {
|
|
737
749
|
if (isPostHogFetchContentTooLargeError(err) && batchMessages.length > 1) {
|
|
738
750
|
this.maxBatchSize = Math.max(1, Math.floor(batchMessages.length / 2));
|
|
@@ -745,8 +757,8 @@ class PostHogCoreStateless {
|
|
|
745
757
|
}
|
|
746
758
|
await persistQueueChange();
|
|
747
759
|
sentMessages.push(...batchMessages);
|
|
760
|
+
sentFromRoute += batchMessages.length;
|
|
748
761
|
}
|
|
749
|
-
this._events.emit('flush', sentMessages);
|
|
750
762
|
}
|
|
751
763
|
async _sendLogsBatch(payload) {
|
|
752
764
|
if (this.disabled) return {
|
|
@@ -835,8 +847,8 @@ class PostHogCoreStateless {
|
|
|
835
847
|
try {
|
|
836
848
|
await this.promiseQueue.join();
|
|
837
849
|
while(true){
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
850
|
+
const hasQueuedEvents = this.getActiveQueueRoutes().some((route)=>this.getRouteQueue(route).length > 0);
|
|
851
|
+
if (!hasQueuedEvents) break;
|
|
840
852
|
const dequeuedBeforeFlush = this._dequeuedMessagesCount;
|
|
841
853
|
await this.flush();
|
|
842
854
|
if (hasTimedOut) break;
|
|
@@ -70,6 +70,7 @@ var posthog_core_stateless_QuotaLimitedFeature = /*#__PURE__*/ function(QuotaLim
|
|
|
70
70
|
QuotaLimitedFeature["Recordings"] = "recordings";
|
|
71
71
|
return QuotaLimitedFeature;
|
|
72
72
|
}({});
|
|
73
|
+
const DEFAULT_QUEUE_ROUTE = 'default';
|
|
73
74
|
class PostHogCoreStateless {
|
|
74
75
|
getErrorPropertiesBuilder() {
|
|
75
76
|
if (!this._errorPropertiesBuilder) this._errorPropertiesBuilder = this.createErrorPropertiesBuilder();
|
|
@@ -496,6 +497,20 @@ class PostHogCoreStateless {
|
|
|
496
497
|
return message;
|
|
497
498
|
}
|
|
498
499
|
async flushStorage() {}
|
|
500
|
+
getQueueRouteKey(_message) {
|
|
501
|
+
return DEFAULT_QUEUE_ROUTE;
|
|
502
|
+
}
|
|
503
|
+
persistedQueueKeyForRoute(_route) {
|
|
504
|
+
return PostHogPersistedProperty.Queue;
|
|
505
|
+
}
|
|
506
|
+
getActiveQueueRoutes() {
|
|
507
|
+
return [
|
|
508
|
+
DEFAULT_QUEUE_ROUTE
|
|
509
|
+
];
|
|
510
|
+
}
|
|
511
|
+
getRouteQueue(route) {
|
|
512
|
+
return this.getPersistedProperty(this.persistedQueueKeyForRoute(route)) || [];
|
|
513
|
+
}
|
|
499
514
|
enqueue(type, _message, options) {
|
|
500
515
|
this.wrap(()=>{
|
|
501
516
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
@@ -503,7 +518,8 @@ class PostHogCoreStateless {
|
|
|
503
518
|
message = this.processBeforeEnqueue(message);
|
|
504
519
|
if (null === message) return;
|
|
505
520
|
message = this.normalizeMessage(message);
|
|
506
|
-
const
|
|
521
|
+
const queueKey = this.persistedQueueKeyForRoute(this.getQueueRouteKey(message));
|
|
522
|
+
const queue = this.getPersistedProperty(queueKey) || [];
|
|
507
523
|
if (queue.length >= this.maxQueueSize) {
|
|
508
524
|
queue.shift();
|
|
509
525
|
this._logger.info('Queue is full, the oldest event is dropped.');
|
|
@@ -511,7 +527,7 @@ class PostHogCoreStateless {
|
|
|
511
527
|
queue.push({
|
|
512
528
|
message
|
|
513
529
|
});
|
|
514
|
-
this.setPersistedProperty(
|
|
530
|
+
this.setPersistedProperty(queueKey, queue);
|
|
515
531
|
this._events.emit(type, message);
|
|
516
532
|
if (queue.length >= this.flushAt) this.flushBackground();
|
|
517
533
|
if (this.flushInterval && !this._flushTimer) this._flushTimer = safeSetTimeout(()=>this.flushBackground(), this.flushInterval);
|
|
@@ -525,31 +541,10 @@ class PostHogCoreStateless {
|
|
|
525
541
|
message = this.processBeforeEnqueue(message);
|
|
526
542
|
if (null === message) return;
|
|
527
543
|
message = this.normalizeMessage(message);
|
|
528
|
-
const data = {
|
|
529
|
-
api_key: this.apiKey,
|
|
530
|
-
batch: [
|
|
531
|
-
message
|
|
532
|
-
],
|
|
533
|
-
sent_at: currentISOTime()
|
|
534
|
-
};
|
|
535
|
-
if (this.historicalMigration) data.historical_migration = true;
|
|
536
|
-
const payload = safeJsonStringify(data);
|
|
537
|
-
const url = `${this.host}/batch/`;
|
|
538
|
-
const gzippedPayload = this.disableCompression ? null : await gzipCompress(payload, this.isDebug);
|
|
539
|
-
const fetchOptions = {
|
|
540
|
-
method: 'POST',
|
|
541
|
-
headers: {
|
|
542
|
-
...this.getCustomHeaders(),
|
|
543
|
-
'Content-Type': 'application/json',
|
|
544
|
-
...null !== gzippedPayload && {
|
|
545
|
-
'Content-Encoding': 'gzip'
|
|
546
|
-
}
|
|
547
|
-
},
|
|
548
|
-
body: gzippedPayload || payload
|
|
549
|
-
};
|
|
550
544
|
try {
|
|
551
|
-
|
|
552
|
-
|
|
545
|
+
await this.sendBatch([
|
|
546
|
+
message
|
|
547
|
+
], void 0, this.getQueueRouteKey(message));
|
|
553
548
|
} catch (err) {
|
|
554
549
|
this._events.emit('error', err);
|
|
555
550
|
}
|
|
@@ -653,44 +648,62 @@ class PostHogCoreStateless {
|
|
|
653
648
|
if (customUserAgent && '' !== customUserAgent) headers['User-Agent'] = customUserAgent;
|
|
654
649
|
return headers;
|
|
655
650
|
}
|
|
651
|
+
async sendBatch(batchMessages, retryOptions, _route = DEFAULT_QUEUE_ROUTE) {
|
|
652
|
+
const data = {
|
|
653
|
+
api_key: this.apiKey,
|
|
654
|
+
batch: batchMessages,
|
|
655
|
+
sent_at: currentISOTime()
|
|
656
|
+
};
|
|
657
|
+
if (this.historicalMigration) data.historical_migration = true;
|
|
658
|
+
const payload = safeJsonStringify(data);
|
|
659
|
+
const url = `${this.host}/batch/`;
|
|
660
|
+
const gzippedPayload = this.disableCompression ? null : await gzipCompress(payload, this.isDebug);
|
|
661
|
+
const fetchOptions = {
|
|
662
|
+
method: 'POST',
|
|
663
|
+
headers: {
|
|
664
|
+
...this.getCustomHeaders(),
|
|
665
|
+
'Content-Type': 'application/json',
|
|
666
|
+
...null !== gzippedPayload && {
|
|
667
|
+
'Content-Encoding': 'gzip'
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
body: gzippedPayload || payload
|
|
671
|
+
};
|
|
672
|
+
const response = await this.fetchWithRetry(url, fetchOptions, retryOptions);
|
|
673
|
+
await response.body?.cancel()?.catch(()=>{});
|
|
674
|
+
}
|
|
656
675
|
async _flush() {
|
|
657
676
|
this.clearFlushTimer();
|
|
658
677
|
await this._initPromise;
|
|
659
|
-
|
|
660
|
-
if (!
|
|
678
|
+
const routes = this.getActiveQueueRoutes();
|
|
679
|
+
if (!routes.some((route)=>this.getRouteQueue(route).length > 0)) return;
|
|
661
680
|
const sentMessages = [];
|
|
681
|
+
let firstError;
|
|
682
|
+
for (const route of routes)try {
|
|
683
|
+
await this._flushRoute(route, sentMessages);
|
|
684
|
+
} catch (err) {
|
|
685
|
+
if (void 0 === firstError) firstError = err;
|
|
686
|
+
}
|
|
687
|
+
if (void 0 !== firstError) throw firstError;
|
|
688
|
+
this._events.emit('flush', sentMessages);
|
|
689
|
+
}
|
|
690
|
+
async _flushRoute(route, sentMessages) {
|
|
691
|
+
const queueKey = this.persistedQueueKeyForRoute(route);
|
|
692
|
+
let queue = this.getPersistedProperty(queueKey) || [];
|
|
693
|
+
if (!queue.length) return;
|
|
662
694
|
const originalQueueLength = queue.length;
|
|
663
|
-
|
|
695
|
+
let sentFromRoute = 0;
|
|
696
|
+
while(queue.length > 0 && sentFromRoute < originalQueueLength){
|
|
664
697
|
const batchItems = queue.slice(0, this.maxBatchSize);
|
|
665
698
|
const batchMessages = batchItems.map((item)=>void 0 === item.message ? item.message : this.normalizeMessage(item.message));
|
|
666
699
|
const persistQueueChange = async ()=>{
|
|
667
|
-
const refreshedQueue = this.getPersistedProperty(
|
|
700
|
+
const refreshedQueue = this.getPersistedProperty(queueKey) || [];
|
|
668
701
|
const newQueue = refreshedQueue.slice(batchItems.length);
|
|
669
|
-
this.setPersistedProperty(
|
|
702
|
+
this.setPersistedProperty(queueKey, newQueue);
|
|
670
703
|
queue = newQueue;
|
|
671
704
|
this._dequeuedMessagesCount += batchItems.length;
|
|
672
705
|
await this.flushStorage();
|
|
673
706
|
};
|
|
674
|
-
const data = {
|
|
675
|
-
api_key: this.apiKey,
|
|
676
|
-
batch: batchMessages,
|
|
677
|
-
sent_at: currentISOTime()
|
|
678
|
-
};
|
|
679
|
-
if (this.historicalMigration) data.historical_migration = true;
|
|
680
|
-
const payload = safeJsonStringify(data);
|
|
681
|
-
const url = `${this.host}/batch/`;
|
|
682
|
-
const gzippedPayload = this.disableCompression ? null : await gzipCompress(payload, this.isDebug);
|
|
683
|
-
const fetchOptions = {
|
|
684
|
-
method: 'POST',
|
|
685
|
-
headers: {
|
|
686
|
-
...this.getCustomHeaders(),
|
|
687
|
-
'Content-Type': 'application/json',
|
|
688
|
-
...null !== gzippedPayload && {
|
|
689
|
-
'Content-Encoding': 'gzip'
|
|
690
|
-
}
|
|
691
|
-
},
|
|
692
|
-
body: gzippedPayload || payload
|
|
693
|
-
};
|
|
694
707
|
const retryOptions = {
|
|
695
708
|
retryCheck: (err)=>{
|
|
696
709
|
if (isPostHogFetchContentTooLargeError(err)) return false;
|
|
@@ -698,8 +711,7 @@ class PostHogCoreStateless {
|
|
|
698
711
|
}
|
|
699
712
|
};
|
|
700
713
|
try {
|
|
701
|
-
|
|
702
|
-
await response.body?.cancel()?.catch(()=>{});
|
|
714
|
+
await this.sendBatch(batchMessages, retryOptions, route);
|
|
703
715
|
} catch (err) {
|
|
704
716
|
if (isPostHogFetchContentTooLargeError(err) && batchMessages.length > 1) {
|
|
705
717
|
this.maxBatchSize = Math.max(1, Math.floor(batchMessages.length / 2));
|
|
@@ -712,8 +724,8 @@ class PostHogCoreStateless {
|
|
|
712
724
|
}
|
|
713
725
|
await persistQueueChange();
|
|
714
726
|
sentMessages.push(...batchMessages);
|
|
727
|
+
sentFromRoute += batchMessages.length;
|
|
715
728
|
}
|
|
716
|
-
this._events.emit('flush', sentMessages);
|
|
717
729
|
}
|
|
718
730
|
async _sendLogsBatch(payload) {
|
|
719
731
|
if (this.disabled) return {
|
|
@@ -802,8 +814,8 @@ class PostHogCoreStateless {
|
|
|
802
814
|
try {
|
|
803
815
|
await this.promiseQueue.join();
|
|
804
816
|
while(true){
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
817
|
+
const hasQueuedEvents = this.getActiveQueueRoutes().some((route)=>this.getRouteQueue(route).length > 0);
|
|
818
|
+
if (!hasQueuedEvents) break;
|
|
807
819
|
const dequeuedBeforeFlush = this._dequeuedMessagesCount;
|
|
808
820
|
await this.flush();
|
|
809
821
|
if (hasTimedOut) break;
|
|
@@ -26,7 +26,8 @@ export declare abstract class PostHogCore extends PostHogCoreStateless {
|
|
|
26
26
|
/**
|
|
27
27
|
* Resets the user's ID and clears all persisted properties.
|
|
28
28
|
*
|
|
29
|
-
* Note: The event
|
|
29
|
+
* Note: The event queues (`PostHogPersistedProperty.Queue` and the isolated
|
|
30
|
+
* `PostHogPersistedProperty.AiQueue`) and the logs queue
|
|
30
31
|
* (`PostHogPersistedProperty.LogsQueue`) are always preserved regardless
|
|
31
32
|
* of what is passed in `propertiesToKeep`, to ensure in-flight data
|
|
32
33
|
* is not lost when identity changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog-core.d.ts","sourceRoot":"","sources":["../src/posthog-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EAGxB,yBAAyB,EAKzB,sBAAsB,EAGvB,MAAM,SAAS,CAAA;AAahB,OAAO,EAAiC,wBAAwB,EAAE,MAAM,SAAS,CAAA;AACjF,OAAO,EAGL,oB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;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,mBAAmB,CACjB,mBAAmB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,EACjD,uBAAuB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,EACrD,kBAAkB,UAAO,GACxB,IAAI;IAkCP;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,kBAAkB,UAAO,GAAG,IAAI;IAmCxF;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,sBAAsB,GAAG,IAAI;IA+C9F;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;CAsBvB"}
|
|
@@ -92,6 +92,7 @@ class PostHogCore extends external_posthog_core_stateless_js_namespaceObject.Pos
|
|
|
92
92
|
this.wrap(()=>{
|
|
93
93
|
const allPropertiesToKeep = [
|
|
94
94
|
external_types_js_namespaceObject.PostHogPersistedProperty.Queue,
|
|
95
|
+
external_types_js_namespaceObject.PostHogPersistedProperty.AiQueue,
|
|
95
96
|
external_types_js_namespaceObject.PostHogPersistedProperty.LogsQueue,
|
|
96
97
|
...propertiesToKeep || []
|
|
97
98
|
];
|
|
@@ -263,6 +263,7 @@ export declare enum PostHogPersistedProperty {
|
|
|
263
263
|
BootstrapFeatureFlagPayloads = "bootstrap_feature_flag_payloads",
|
|
264
264
|
OverrideFeatureFlags = "override_feature_flags",
|
|
265
265
|
Queue = "queue",
|
|
266
|
+
AiQueue = "ai_queue",
|
|
266
267
|
LogsQueue = "logs_queue",
|
|
267
268
|
OptedOut = "opted_out",
|
|
268
269
|
SessionId = "session_id",
|