autotel-subscribers 13.0.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amplitude.cjs +76 -74
- package/dist/amplitude.cjs.map +1 -1
- package/dist/amplitude.d.cts +1 -1
- package/dist/amplitude.d.ts +1 -1
- package/dist/amplitude.js +76 -74
- package/dist/amplitude.js.map +1 -1
- package/dist/factories.cjs +390 -266
- package/dist/factories.cjs.map +1 -1
- package/dist/factories.js +390 -266
- package/dist/factories.js.map +1 -1
- package/dist/index.cjs +390 -266
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +390 -266
- package/dist/index.js.map +1 -1
- package/dist/posthog.cjs +304 -182
- package/dist/posthog.cjs.map +1 -1
- package/dist/posthog.js +304 -182
- package/dist/posthog.js.map +1 -1
- package/package.json +15 -15
- package/src/amplitude.test.ts +8 -12
- package/src/amplitude.ts +14 -11
package/dist/posthog.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var path = require('path');
|
|
4
4
|
var fs = require('fs');
|
|
5
5
|
var readline = require('readline');
|
|
6
|
+
var async_hooks = require('async_hooks');
|
|
6
7
|
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
8
9
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -42,11 +43,11 @@ function normalizeWindowsPath(path) {
|
|
|
42
43
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
43
44
|
}
|
|
44
45
|
var init_module_node = __esm({
|
|
45
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
46
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
|
|
49
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
50
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
50
51
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
51
52
|
return {
|
|
52
53
|
key,
|
|
@@ -63,7 +64,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
63
64
|
}
|
|
64
65
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
65
66
|
var init_featureFlagUtils = __esm({
|
|
66
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
67
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
67
68
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
68
69
|
if ("flags" in flagsResponse) {
|
|
69
70
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -121,10 +122,10 @@ var init_featureFlagUtils = __esm({
|
|
|
121
122
|
}
|
|
122
123
|
});
|
|
123
124
|
|
|
124
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
125
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
125
126
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
126
127
|
var init_uuidv7 = __esm({
|
|
127
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
128
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
128
129
|
DIGITS = "0123456789abcdef";
|
|
129
130
|
UUID = class _UUID {
|
|
130
131
|
constructor(bytes) {
|
|
@@ -285,10 +286,10 @@ var init_uuidv7 = __esm({
|
|
|
285
286
|
}
|
|
286
287
|
});
|
|
287
288
|
|
|
288
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
289
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
289
290
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
290
291
|
var init_bot_detection = __esm({
|
|
291
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
292
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
292
293
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
293
294
|
"amazonbot",
|
|
294
295
|
"amazonproductbot",
|
|
@@ -379,10 +380,10 @@ var init_bot_detection = __esm({
|
|
|
379
380
|
}
|
|
380
381
|
});
|
|
381
382
|
|
|
382
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
383
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/types.mjs
|
|
383
384
|
var types_PostHogPersistedProperty;
|
|
384
385
|
var init_types = __esm({
|
|
385
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
386
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/types.mjs"() {
|
|
386
387
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
387
388
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
388
389
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -414,13 +415,13 @@ var init_types = __esm({
|
|
|
414
415
|
}
|
|
415
416
|
});
|
|
416
417
|
|
|
417
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
418
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
418
419
|
var init_string_utils = __esm({
|
|
419
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
420
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
|
|
420
421
|
}
|
|
421
422
|
});
|
|
422
423
|
|
|
423
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
424
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
424
425
|
function isInstanceOf(candidate, base) {
|
|
425
426
|
try {
|
|
426
427
|
return candidate instanceof base;
|
|
@@ -445,7 +446,7 @@ function isPlainObject(candidate) {
|
|
|
445
446
|
}
|
|
446
447
|
var nativeIsArray, ObjProto, type_utils_toString, isArray, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
447
448
|
var init_type_utils = __esm({
|
|
448
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
449
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
449
450
|
init_types();
|
|
450
451
|
init_string_utils();
|
|
451
452
|
nativeIsArray = Array.isArray;
|
|
@@ -463,7 +464,7 @@ var init_type_utils = __esm({
|
|
|
463
464
|
}
|
|
464
465
|
});
|
|
465
466
|
|
|
466
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
467
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
467
468
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
468
469
|
if (min > max) {
|
|
469
470
|
logger.warn("min cannot be greater than max.");
|
|
@@ -481,15 +482,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
481
482
|
return clampToRange(max, min, max, logger);
|
|
482
483
|
}
|
|
483
484
|
var init_number_utils = __esm({
|
|
484
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
485
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
485
486
|
init_type_utils();
|
|
486
487
|
}
|
|
487
488
|
});
|
|
488
489
|
|
|
489
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
490
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
490
491
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
491
492
|
var init_bucketed_rate_limiter = __esm({
|
|
492
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
493
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
493
494
|
init_number_utils();
|
|
494
495
|
ONE_DAY_IN_MS = 864e5;
|
|
495
496
|
BucketedRateLimiter = class {
|
|
@@ -533,10 +534,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
533
534
|
}
|
|
534
535
|
});
|
|
535
536
|
|
|
536
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
537
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
537
538
|
var PromiseQueue;
|
|
538
539
|
var init_promise_queue = __esm({
|
|
539
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
540
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
540
541
|
init_uuidv7();
|
|
541
542
|
PromiseQueue = class {
|
|
542
543
|
add(promise) {
|
|
@@ -567,7 +568,7 @@ var init_promise_queue = __esm({
|
|
|
567
568
|
}
|
|
568
569
|
});
|
|
569
570
|
|
|
570
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
571
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
571
572
|
function createConsole(consoleLike = console) {
|
|
572
573
|
const lockedMethods = {
|
|
573
574
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -582,7 +583,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
582
583
|
}
|
|
583
584
|
var _createLogger, passThrough;
|
|
584
585
|
var init_logger = __esm({
|
|
585
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
586
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
586
587
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
587
588
|
function _log(level, ...args) {
|
|
588
589
|
maybeCall(() => {
|
|
@@ -611,7 +612,21 @@ var init_logger = __esm({
|
|
|
611
612
|
}
|
|
612
613
|
});
|
|
613
614
|
|
|
614
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
615
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
616
|
+
var MOBILE, TABLET, GENERIC;
|
|
617
|
+
var init_user_agent_utils = __esm({
|
|
618
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
619
|
+
init_string_utils();
|
|
620
|
+
init_type_utils();
|
|
621
|
+
MOBILE = "Mobile";
|
|
622
|
+
TABLET = "Tablet";
|
|
623
|
+
GENERIC = "Generic";
|
|
624
|
+
GENERIC + " " + MOBILE.toLowerCase();
|
|
625
|
+
GENERIC + " " + TABLET.toLowerCase();
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/index.mjs
|
|
615
630
|
function assert(truthyValue, message) {
|
|
616
631
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message);
|
|
617
632
|
}
|
|
@@ -655,7 +670,7 @@ function allSettled(promises) {
|
|
|
655
670
|
}
|
|
656
671
|
var STRING_FORMAT, isError;
|
|
657
672
|
var init_utils = __esm({
|
|
658
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
673
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
659
674
|
init_bot_detection();
|
|
660
675
|
init_bucketed_rate_limiter();
|
|
661
676
|
init_number_utils();
|
|
@@ -663,15 +678,16 @@ var init_utils = __esm({
|
|
|
663
678
|
init_type_utils();
|
|
664
679
|
init_promise_queue();
|
|
665
680
|
init_logger();
|
|
681
|
+
init_user_agent_utils();
|
|
666
682
|
STRING_FORMAT = "utf8";
|
|
667
683
|
isError = (x) => x instanceof Error;
|
|
668
684
|
}
|
|
669
685
|
});
|
|
670
686
|
|
|
671
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
687
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
672
688
|
var SimpleEventEmitter;
|
|
673
689
|
var init_eventemitter = __esm({
|
|
674
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
690
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
675
691
|
SimpleEventEmitter = class {
|
|
676
692
|
constructor() {
|
|
677
693
|
this.events = {};
|
|
@@ -692,7 +708,7 @@ var init_eventemitter = __esm({
|
|
|
692
708
|
}
|
|
693
709
|
});
|
|
694
710
|
|
|
695
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
711
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/gzip.mjs
|
|
696
712
|
function isGzipSupported() {
|
|
697
713
|
return "CompressionStream" in globalThis;
|
|
698
714
|
}
|
|
@@ -711,11 +727,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
711
727
|
}
|
|
712
728
|
}
|
|
713
729
|
var init_gzip = __esm({
|
|
714
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
730
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
715
731
|
}
|
|
716
732
|
});
|
|
717
733
|
|
|
718
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
734
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
719
735
|
async function logFlushError(err) {
|
|
720
736
|
if (err instanceof PostHogFetchHttpError) {
|
|
721
737
|
let text = "";
|
|
@@ -735,7 +751,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
735
751
|
}
|
|
736
752
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
737
753
|
var init_posthog_core_stateless = __esm({
|
|
738
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
754
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
739
755
|
init_eventemitter();
|
|
740
756
|
init_featureFlagUtils();
|
|
741
757
|
init_gzip();
|
|
@@ -1009,7 +1025,8 @@ var init_posthog_core_stateless = __esm({
|
|
|
1009
1025
|
const flagDetail = featureFlags[key];
|
|
1010
1026
|
return {
|
|
1011
1027
|
response: flagDetail,
|
|
1012
|
-
requestId: flagsResponse.requestId
|
|
1028
|
+
requestId: flagsResponse.requestId,
|
|
1029
|
+
evaluatedAt: flagsResponse.evaluatedAt
|
|
1013
1030
|
};
|
|
1014
1031
|
}
|
|
1015
1032
|
async getFeatureFlagPayloadStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {
|
|
@@ -1059,7 +1076,8 @@ var init_posthog_core_stateless = __esm({
|
|
|
1059
1076
|
flags: {},
|
|
1060
1077
|
featureFlags: {},
|
|
1061
1078
|
featureFlagPayloads: {},
|
|
1062
|
-
requestId: flagsResponse?.requestId
|
|
1079
|
+
requestId: flagsResponse?.requestId,
|
|
1080
|
+
quotaLimited: flagsResponse.quotaLimited
|
|
1063
1081
|
};
|
|
1064
1082
|
}
|
|
1065
1083
|
return flagsResponse;
|
|
@@ -1351,9 +1369,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1351
1369
|
}
|
|
1352
1370
|
});
|
|
1353
1371
|
|
|
1354
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1372
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1355
1373
|
var init_posthog_core = __esm({
|
|
1356
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1374
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core.mjs"() {
|
|
1357
1375
|
init_featureFlagUtils();
|
|
1358
1376
|
init_types();
|
|
1359
1377
|
init_posthog_core_stateless();
|
|
@@ -1362,7 +1380,7 @@ var init_posthog_core = __esm({
|
|
|
1362
1380
|
}
|
|
1363
1381
|
});
|
|
1364
1382
|
|
|
1365
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1383
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1366
1384
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1367
1385
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1368
1386
|
if (!chunkIdMap) return;
|
|
@@ -1395,14 +1413,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1395
1413
|
}
|
|
1396
1414
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1397
1415
|
var init_chunk_ids = __esm({
|
|
1398
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1416
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1399
1417
|
}
|
|
1400
1418
|
});
|
|
1401
1419
|
|
|
1402
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1420
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1403
1421
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1404
1422
|
var init_error_properties_builder = __esm({
|
|
1405
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1423
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1406
1424
|
init_utils();
|
|
1407
1425
|
init_chunk_ids();
|
|
1408
1426
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1516,7 +1534,7 @@ var init_error_properties_builder = __esm({
|
|
|
1516
1534
|
}
|
|
1517
1535
|
});
|
|
1518
1536
|
|
|
1519
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1537
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1520
1538
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1521
1539
|
const frame = {
|
|
1522
1540
|
platform,
|
|
@@ -1530,16 +1548,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1530
1548
|
}
|
|
1531
1549
|
var UNKNOWN_FUNCTION;
|
|
1532
1550
|
var init_base = __esm({
|
|
1533
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1551
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1534
1552
|
init_utils();
|
|
1535
1553
|
UNKNOWN_FUNCTION = "?";
|
|
1536
1554
|
}
|
|
1537
1555
|
});
|
|
1538
1556
|
|
|
1539
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1557
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1540
1558
|
var extractSafariExtensionDetails;
|
|
1541
1559
|
var init_safari = __esm({
|
|
1542
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1560
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1543
1561
|
init_base();
|
|
1544
1562
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1545
1563
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1555,10 +1573,10 @@ var init_safari = __esm({
|
|
|
1555
1573
|
}
|
|
1556
1574
|
});
|
|
1557
1575
|
|
|
1558
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1576
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1559
1577
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1560
1578
|
var init_chrome = __esm({
|
|
1561
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1579
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1562
1580
|
init_base();
|
|
1563
1581
|
init_safari();
|
|
1564
1582
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1588,10 +1606,10 @@ var init_chrome = __esm({
|
|
|
1588
1606
|
}
|
|
1589
1607
|
});
|
|
1590
1608
|
|
|
1591
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1609
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1592
1610
|
var winjsRegex, winjsStackLineParser;
|
|
1593
1611
|
var init_winjs = __esm({
|
|
1594
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1612
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1595
1613
|
init_base();
|
|
1596
1614
|
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1597
1615
|
winjsStackLineParser = (line, platform) => {
|
|
@@ -1601,10 +1619,10 @@ var init_winjs = __esm({
|
|
|
1601
1619
|
}
|
|
1602
1620
|
});
|
|
1603
1621
|
|
|
1604
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1622
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1605
1623
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1606
1624
|
var init_gecko = __esm({
|
|
1607
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1625
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1608
1626
|
init_base();
|
|
1609
1627
|
init_safari();
|
|
1610
1628
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1631,10 +1649,10 @@ var init_gecko = __esm({
|
|
|
1631
1649
|
}
|
|
1632
1650
|
});
|
|
1633
1651
|
|
|
1634
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1652
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1635
1653
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1636
1654
|
var init_opera = __esm({
|
|
1637
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1655
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1638
1656
|
init_base();
|
|
1639
1657
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1640
1658
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1649,7 +1667,7 @@ var init_opera = __esm({
|
|
|
1649
1667
|
}
|
|
1650
1668
|
});
|
|
1651
1669
|
|
|
1652
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1670
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1653
1671
|
function filenameIsInApp(filename, isNative = false) {
|
|
1654
1672
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1655
1673
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1659,7 +1677,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1659
1677
|
}
|
|
1660
1678
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1661
1679
|
var init_node = __esm({
|
|
1662
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1680
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1663
1681
|
init_base();
|
|
1664
1682
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1665
1683
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1720,7 +1738,7 @@ var init_node = __esm({
|
|
|
1720
1738
|
}
|
|
1721
1739
|
});
|
|
1722
1740
|
|
|
1723
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1741
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1724
1742
|
function reverseAndStripFrames(stack) {
|
|
1725
1743
|
if (!stack.length) return [];
|
|
1726
1744
|
const localStack = Array.from(stack);
|
|
@@ -1758,7 +1776,7 @@ function createStackParser(platform, ...parsers) {
|
|
|
1758
1776
|
}
|
|
1759
1777
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1760
1778
|
var init_parsers = __esm({
|
|
1761
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1779
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1762
1780
|
init_base();
|
|
1763
1781
|
init_chrome();
|
|
1764
1782
|
init_winjs();
|
|
@@ -1770,10 +1788,10 @@ var init_parsers = __esm({
|
|
|
1770
1788
|
}
|
|
1771
1789
|
});
|
|
1772
1790
|
|
|
1773
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1791
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1774
1792
|
var DOMExceptionCoercer;
|
|
1775
1793
|
var init_dom_exception_coercer = __esm({
|
|
1776
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1794
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1777
1795
|
init_utils();
|
|
1778
1796
|
DOMExceptionCoercer = class {
|
|
1779
1797
|
match(err) {
|
|
@@ -1807,10 +1825,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1807
1825
|
}
|
|
1808
1826
|
});
|
|
1809
1827
|
|
|
1810
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1828
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1811
1829
|
var ErrorCoercer;
|
|
1812
1830
|
var init_error_coercer = __esm({
|
|
1813
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1831
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1814
1832
|
init_utils();
|
|
1815
1833
|
ErrorCoercer = class {
|
|
1816
1834
|
match(err) {
|
|
@@ -1840,10 +1858,10 @@ var init_error_coercer = __esm({
|
|
|
1840
1858
|
}
|
|
1841
1859
|
});
|
|
1842
1860
|
|
|
1843
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1861
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1844
1862
|
var ErrorEventCoercer;
|
|
1845
1863
|
var init_error_event_coercer = __esm({
|
|
1846
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1864
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1847
1865
|
init_utils();
|
|
1848
1866
|
ErrorEventCoercer = class {
|
|
1849
1867
|
constructor() {
|
|
@@ -1865,10 +1883,10 @@ var init_error_event_coercer = __esm({
|
|
|
1865
1883
|
}
|
|
1866
1884
|
});
|
|
1867
1885
|
|
|
1868
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1886
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1869
1887
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1870
1888
|
var init_string_coercer = __esm({
|
|
1871
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1889
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1872
1890
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1873
1891
|
StringCoercer = class {
|
|
1874
1892
|
match(input) {
|
|
@@ -1900,10 +1918,10 @@ var init_string_coercer = __esm({
|
|
|
1900
1918
|
}
|
|
1901
1919
|
});
|
|
1902
1920
|
|
|
1903
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1921
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1904
1922
|
var severityLevels;
|
|
1905
1923
|
var init_types2 = __esm({
|
|
1906
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1924
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1907
1925
|
severityLevels = [
|
|
1908
1926
|
"fatal",
|
|
1909
1927
|
"error",
|
|
@@ -1915,7 +1933,7 @@ var init_types2 = __esm({
|
|
|
1915
1933
|
}
|
|
1916
1934
|
});
|
|
1917
1935
|
|
|
1918
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1936
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
1919
1937
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
1920
1938
|
const keys = Object.keys(err);
|
|
1921
1939
|
keys.sort();
|
|
@@ -1930,14 +1948,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
1930
1948
|
return "";
|
|
1931
1949
|
}
|
|
1932
1950
|
var init_utils2 = __esm({
|
|
1933
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1951
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
1934
1952
|
}
|
|
1935
1953
|
});
|
|
1936
1954
|
|
|
1937
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1955
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
1938
1956
|
var ObjectCoercer;
|
|
1939
1957
|
var init_object_coercer = __esm({
|
|
1940
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1958
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
1941
1959
|
init_utils();
|
|
1942
1960
|
init_types2();
|
|
1943
1961
|
init_utils2();
|
|
@@ -1991,10 +2009,10 @@ var init_object_coercer = __esm({
|
|
|
1991
2009
|
}
|
|
1992
2010
|
});
|
|
1993
2011
|
|
|
1994
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2012
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
1995
2013
|
var EventCoercer;
|
|
1996
2014
|
var init_event_coercer = __esm({
|
|
1997
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2015
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
1998
2016
|
init_utils();
|
|
1999
2017
|
init_utils2();
|
|
2000
2018
|
EventCoercer = class {
|
|
@@ -2014,10 +2032,10 @@ var init_event_coercer = __esm({
|
|
|
2014
2032
|
}
|
|
2015
2033
|
});
|
|
2016
2034
|
|
|
2017
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2035
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2018
2036
|
var PrimitiveCoercer;
|
|
2019
2037
|
var init_primitive_coercer = __esm({
|
|
2020
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2038
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2021
2039
|
init_utils();
|
|
2022
2040
|
PrimitiveCoercer = class {
|
|
2023
2041
|
match(candidate) {
|
|
@@ -2035,10 +2053,10 @@ var init_primitive_coercer = __esm({
|
|
|
2035
2053
|
}
|
|
2036
2054
|
});
|
|
2037
2055
|
|
|
2038
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2056
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2039
2057
|
var PromiseRejectionEventCoercer;
|
|
2040
2058
|
var init_promise_rejection_event = __esm({
|
|
2041
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2059
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
|
|
2042
2060
|
init_utils();
|
|
2043
2061
|
PromiseRejectionEventCoercer = class {
|
|
2044
2062
|
match(err) {
|
|
@@ -2067,9 +2085,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2067
2085
|
}
|
|
2068
2086
|
});
|
|
2069
2087
|
|
|
2070
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2088
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2071
2089
|
var init_coercers = __esm({
|
|
2072
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2090
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
|
|
2073
2091
|
init_dom_exception_coercer();
|
|
2074
2092
|
init_error_coercer();
|
|
2075
2093
|
init_error_event_coercer();
|
|
@@ -2081,10 +2099,10 @@ var init_coercers = __esm({
|
|
|
2081
2099
|
}
|
|
2082
2100
|
});
|
|
2083
2101
|
|
|
2084
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2102
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
2085
2103
|
var ReduceableCache;
|
|
2086
2104
|
var init_utils3 = __esm({
|
|
2087
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2105
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2088
2106
|
ReduceableCache = class {
|
|
2089
2107
|
constructor(_maxSize) {
|
|
2090
2108
|
this._maxSize = _maxSize;
|
|
@@ -2110,7 +2128,7 @@ var init_utils3 = __esm({
|
|
|
2110
2128
|
}
|
|
2111
2129
|
});
|
|
2112
2130
|
|
|
2113
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2131
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2114
2132
|
var error_tracking_exports = {};
|
|
2115
2133
|
__export(error_tracking_exports, {
|
|
2116
2134
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2133,7 +2151,7 @@ __export(error_tracking_exports, {
|
|
|
2133
2151
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2134
2152
|
});
|
|
2135
2153
|
var init_error_tracking = __esm({
|
|
2136
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2154
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2137
2155
|
init_error_properties_builder();
|
|
2138
2156
|
init_parsers();
|
|
2139
2157
|
init_coercers();
|
|
@@ -2141,9 +2159,9 @@ var init_error_tracking = __esm({
|
|
|
2141
2159
|
}
|
|
2142
2160
|
});
|
|
2143
2161
|
|
|
2144
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2162
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/index.mjs
|
|
2145
2163
|
var init_dist = __esm({
|
|
2146
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2164
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/index.mjs"() {
|
|
2147
2165
|
init_featureFlagUtils();
|
|
2148
2166
|
init_uuidv7();
|
|
2149
2167
|
init_utils();
|
|
@@ -2334,7 +2352,7 @@ function snipLine(line, colno) {
|
|
|
2334
2352
|
}
|
|
2335
2353
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2336
2354
|
var init_context_lines_node = __esm({
|
|
2337
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2355
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2338
2356
|
init_dist();
|
|
2339
2357
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2340
2358
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2344,7 +2362,7 @@ var init_context_lines_node = __esm({
|
|
|
2344
2362
|
}
|
|
2345
2363
|
});
|
|
2346
2364
|
|
|
2347
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2365
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2348
2366
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2349
2367
|
let calledFatalError = false;
|
|
2350
2368
|
return Object.assign((error) => {
|
|
@@ -2365,10 +2383,10 @@ function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
|
2365
2383
|
});
|
|
2366
2384
|
}
|
|
2367
2385
|
function addUncaughtExceptionListener(captureFn, onFatalFn) {
|
|
2368
|
-
|
|
2386
|
+
globalThis.process?.on("uncaughtException", makeUncaughtExceptionHandler(captureFn, onFatalFn));
|
|
2369
2387
|
}
|
|
2370
2388
|
function addUnhandledRejectionListener(captureFn) {
|
|
2371
|
-
|
|
2389
|
+
globalThis.process?.on("unhandledRejection", (reason) => captureFn(reason, {
|
|
2372
2390
|
mechanism: {
|
|
2373
2391
|
type: "onunhandledrejection",
|
|
2374
2392
|
handled: false
|
|
@@ -2376,14 +2394,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2376
2394
|
}));
|
|
2377
2395
|
}
|
|
2378
2396
|
var init_autocapture = __esm({
|
|
2379
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2397
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2380
2398
|
}
|
|
2381
2399
|
});
|
|
2382
2400
|
|
|
2383
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2401
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2384
2402
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2385
2403
|
var init_error_tracking2 = __esm({
|
|
2386
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2404
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2387
2405
|
init_autocapture();
|
|
2388
2406
|
init_dist();
|
|
2389
2407
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2449,15 +2467,28 @@ var init_error_tracking2 = __esm({
|
|
|
2449
2467
|
}
|
|
2450
2468
|
});
|
|
2451
2469
|
|
|
2452
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2470
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/version.mjs
|
|
2453
2471
|
var version;
|
|
2454
2472
|
var init_version = __esm({
|
|
2455
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2456
|
-
version = "5.
|
|
2473
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/version.mjs"() {
|
|
2474
|
+
version = "5.18.1";
|
|
2475
|
+
}
|
|
2476
|
+
});
|
|
2477
|
+
|
|
2478
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/types.mjs
|
|
2479
|
+
var FeatureFlagError;
|
|
2480
|
+
var init_types3 = __esm({
|
|
2481
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/types.mjs"() {
|
|
2482
|
+
FeatureFlagError = {
|
|
2483
|
+
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2484
|
+
FLAG_MISSING: "flag_missing",
|
|
2485
|
+
QUOTA_LIMITED: "quota_limited",
|
|
2486
|
+
UNKNOWN_ERROR: "unknown_error"
|
|
2487
|
+
};
|
|
2457
2488
|
}
|
|
2458
2489
|
});
|
|
2459
2490
|
|
|
2460
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2491
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2461
2492
|
async function hashSHA1(text) {
|
|
2462
2493
|
const subtle = globalThis.crypto?.subtle;
|
|
2463
2494
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2466,11 +2497,11 @@ async function hashSHA1(text) {
|
|
|
2466
2497
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2467
2498
|
}
|
|
2468
2499
|
var init_crypto = __esm({
|
|
2469
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2500
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2470
2501
|
}
|
|
2471
2502
|
});
|
|
2472
2503
|
|
|
2473
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2504
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2474
2505
|
async function _hash(key, distinctId, salt = "") {
|
|
2475
2506
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2476
2507
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2638,7 +2669,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2638
2669
|
}
|
|
2639
2670
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2640
2671
|
var init_feature_flags = __esm({
|
|
2641
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2672
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2642
2673
|
init_dist();
|
|
2643
2674
|
init_crypto();
|
|
2644
2675
|
SIXTY_SECONDS = 6e4;
|
|
@@ -2676,7 +2707,6 @@ var init_feature_flags = __esm({
|
|
|
2676
2707
|
this.debugMode = false;
|
|
2677
2708
|
this.shouldBeginExponentialBackoff = false;
|
|
2678
2709
|
this.backOffCount = 0;
|
|
2679
|
-
this.hasAttemptedCacheLoad = false;
|
|
2680
2710
|
this.pollingInterval = pollingInterval;
|
|
2681
2711
|
this.personalApiKey = personalApiKey;
|
|
2682
2712
|
this.featureFlags = [];
|
|
@@ -2905,15 +2935,12 @@ var init_feature_flags = __esm({
|
|
|
2905
2935
|
}
|
|
2906
2936
|
}
|
|
2907
2937
|
async loadFeatureFlags(forceReload = false) {
|
|
2908
|
-
if (this.
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
this.loadingPromise = this._loadFeatureFlags();
|
|
2915
|
-
await this.loadingPromise;
|
|
2916
|
-
}
|
|
2938
|
+
if (this.loadedSuccessfullyOnce && !forceReload) return;
|
|
2939
|
+
if (!forceReload && this.nextFetchAllowedAt && Date.now() < this.nextFetchAllowedAt) return void this.logMsgIfDebug(() => console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period"));
|
|
2940
|
+
if (!this.loadingPromise) this.loadingPromise = this._loadFeatureFlags().catch((err) => this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${err}`))).finally(() => {
|
|
2941
|
+
this.loadingPromise = void 0;
|
|
2942
|
+
});
|
|
2943
|
+
return this.loadingPromise;
|
|
2917
2944
|
}
|
|
2918
2945
|
isLocalEvaluationReady() {
|
|
2919
2946
|
return (this.loadedSuccessfullyOnce ?? false) && (this.featureFlags?.length ?? 0) > 0;
|
|
@@ -2922,12 +2949,22 @@ var init_feature_flags = __esm({
|
|
|
2922
2949
|
if (!this.shouldBeginExponentialBackoff) return this.pollingInterval;
|
|
2923
2950
|
return Math.min(SIXTY_SECONDS, this.pollingInterval * 2 ** this.backOffCount);
|
|
2924
2951
|
}
|
|
2952
|
+
beginBackoff() {
|
|
2953
|
+
this.shouldBeginExponentialBackoff = true;
|
|
2954
|
+
this.backOffCount += 1;
|
|
2955
|
+
this.nextFetchAllowedAt = Date.now() + this.getPollingInterval();
|
|
2956
|
+
}
|
|
2957
|
+
clearBackoff() {
|
|
2958
|
+
this.shouldBeginExponentialBackoff = false;
|
|
2959
|
+
this.backOffCount = 0;
|
|
2960
|
+
this.nextFetchAllowedAt = void 0;
|
|
2961
|
+
}
|
|
2925
2962
|
async _loadFeatureFlags() {
|
|
2926
2963
|
if (this.poller) {
|
|
2927
2964
|
clearTimeout(this.poller);
|
|
2928
2965
|
this.poller = void 0;
|
|
2929
2966
|
}
|
|
2930
|
-
this.poller = setTimeout(() => this.
|
|
2967
|
+
this.poller = setTimeout(() => this.loadFeatureFlags(true), this.getPollingInterval());
|
|
2931
2968
|
try {
|
|
2932
2969
|
let shouldFetch = true;
|
|
2933
2970
|
if (this.cacheProvider) try {
|
|
@@ -2943,9 +2980,14 @@ var init_feature_flags = __esm({
|
|
|
2943
2980
|
const res = await this._requestFeatureFlagDefinitions();
|
|
2944
2981
|
if (!res) return;
|
|
2945
2982
|
switch (res.status) {
|
|
2983
|
+
case 304:
|
|
2984
|
+
this.logMsgIfDebug(() => console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data"));
|
|
2985
|
+
this.flagsEtag = res.headers?.get("ETag") ?? this.flagsEtag;
|
|
2986
|
+
this.loadedSuccessfullyOnce = true;
|
|
2987
|
+
this.clearBackoff();
|
|
2988
|
+
return;
|
|
2946
2989
|
case 401:
|
|
2947
|
-
this.
|
|
2948
|
-
this.backOffCount += 1;
|
|
2990
|
+
this.beginBackoff();
|
|
2949
2991
|
throw new ClientError(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);
|
|
2950
2992
|
case 402:
|
|
2951
2993
|
console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts");
|
|
@@ -2955,24 +2997,22 @@ var init_feature_flags = __esm({
|
|
|
2955
2997
|
this.cohorts = {};
|
|
2956
2998
|
return;
|
|
2957
2999
|
case 403:
|
|
2958
|
-
this.
|
|
2959
|
-
this.backOffCount += 1;
|
|
3000
|
+
this.beginBackoff();
|
|
2960
3001
|
throw new ClientError(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);
|
|
2961
3002
|
case 429:
|
|
2962
|
-
this.
|
|
2963
|
-
this.backOffCount += 1;
|
|
3003
|
+
this.beginBackoff();
|
|
2964
3004
|
throw new ClientError(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);
|
|
2965
3005
|
case 200: {
|
|
2966
3006
|
const responseJson = await res.json() ?? {};
|
|
2967
3007
|
if (!("flags" in responseJson)) return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(responseJson)}`));
|
|
3008
|
+
this.flagsEtag = res.headers?.get("ETag") ?? void 0;
|
|
2968
3009
|
const flagData = {
|
|
2969
3010
|
flags: responseJson.flags ?? [],
|
|
2970
3011
|
groupTypeMapping: responseJson.group_type_mapping || {},
|
|
2971
3012
|
cohorts: responseJson.cohorts || {}
|
|
2972
3013
|
};
|
|
2973
3014
|
this.updateFlagState(flagData);
|
|
2974
|
-
this.
|
|
2975
|
-
this.backOffCount = 0;
|
|
3015
|
+
this.clearBackoff();
|
|
2976
3016
|
if (this.cacheProvider && shouldFetch) try {
|
|
2977
3017
|
await this.cacheProvider.onFlagDefinitionsReceived(flagData);
|
|
2978
3018
|
} catch (err) {
|
|
@@ -2986,23 +3026,23 @@ var init_feature_flags = __esm({
|
|
|
2986
3026
|
}
|
|
2987
3027
|
} catch (err) {
|
|
2988
3028
|
if (err instanceof ClientError) this.onError?.(err);
|
|
2989
|
-
} finally {
|
|
2990
|
-
this.loadingPromise = void 0;
|
|
2991
3029
|
}
|
|
2992
3030
|
}
|
|
2993
|
-
getPersonalApiKeyRequestOptions(method = "GET") {
|
|
3031
|
+
getPersonalApiKeyRequestOptions(method = "GET", etag) {
|
|
3032
|
+
const headers = {
|
|
3033
|
+
...this.customHeaders,
|
|
3034
|
+
"Content-Type": "application/json",
|
|
3035
|
+
Authorization: `Bearer ${this.personalApiKey}`
|
|
3036
|
+
};
|
|
3037
|
+
if (etag) headers["If-None-Match"] = etag;
|
|
2994
3038
|
return {
|
|
2995
3039
|
method,
|
|
2996
|
-
headers
|
|
2997
|
-
...this.customHeaders,
|
|
2998
|
-
"Content-Type": "application/json",
|
|
2999
|
-
Authorization: `Bearer ${this.personalApiKey}`
|
|
3000
|
-
}
|
|
3040
|
+
headers
|
|
3001
3041
|
};
|
|
3002
3042
|
}
|
|
3003
3043
|
_requestFeatureFlagDefinitions() {
|
|
3004
3044
|
const url = `${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`;
|
|
3005
|
-
const options = this.getPersonalApiKeyRequestOptions();
|
|
3045
|
+
const options = this.getPersonalApiKeyRequestOptions("GET", this.flagsEtag);
|
|
3006
3046
|
let abortTimeout = null;
|
|
3007
3047
|
if (this.timeout && "number" == typeof this.timeout) {
|
|
3008
3048
|
const controller = new AbortController();
|
|
@@ -3034,10 +3074,10 @@ var init_feature_flags = __esm({
|
|
|
3034
3074
|
}
|
|
3035
3075
|
});
|
|
3036
3076
|
|
|
3037
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3077
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3038
3078
|
var PostHogMemoryStorage;
|
|
3039
3079
|
var init_storage_memory = __esm({
|
|
3040
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3080
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3041
3081
|
PostHogMemoryStorage = class {
|
|
3042
3082
|
getProperty(key) {
|
|
3043
3083
|
return this._memoryStorage[key];
|
|
@@ -3052,12 +3092,13 @@ var init_storage_memory = __esm({
|
|
|
3052
3092
|
}
|
|
3053
3093
|
});
|
|
3054
3094
|
|
|
3055
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3095
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/client.mjs
|
|
3056
3096
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3057
3097
|
var init_client = __esm({
|
|
3058
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3098
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/client.mjs"() {
|
|
3059
3099
|
init_version();
|
|
3060
3100
|
init_dist();
|
|
3101
|
+
init_types3();
|
|
3061
3102
|
init_feature_flags();
|
|
3062
3103
|
init_error_tracking2();
|
|
3063
3104
|
init_storage_memory();
|
|
@@ -3068,6 +3109,7 @@ var init_client = __esm({
|
|
|
3068
3109
|
constructor(apiKey, options = {}) {
|
|
3069
3110
|
super(apiKey, options), this._memoryStorage = new PostHogMemoryStorage();
|
|
3070
3111
|
this.options = options;
|
|
3112
|
+
this.context = this.initializeContext();
|
|
3071
3113
|
this.options.featureFlagsPollingInterval = "number" == typeof options.featureFlagsPollingInterval ? Math.max(options.featureFlagsPollingInterval, MINIMUM_POLLING_INTERVAL) : THIRTY_SECONDS;
|
|
3072
3114
|
if (options.personalApiKey) {
|
|
3073
3115
|
if (options.personalApiKey.includes("phc_")) throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');
|
|
@@ -3138,25 +3180,29 @@ var init_client = __esm({
|
|
|
3138
3180
|
if (err) console.error(err);
|
|
3139
3181
|
}));
|
|
3140
3182
|
}
|
|
3141
|
-
identify({ distinctId, properties, disableGeoip }) {
|
|
3142
|
-
const
|
|
3143
|
-
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3146
|
-
$set:
|
|
3147
|
-
$set_once:
|
|
3148
|
-
|
|
3183
|
+
identify({ distinctId, properties = {}, disableGeoip }) {
|
|
3184
|
+
const { $set, $set_once, $anon_distinct_id, ...rest } = properties;
|
|
3185
|
+
const setProps = $set || rest;
|
|
3186
|
+
const setOnceProps = $set_once || {};
|
|
3187
|
+
const eventProperties = {
|
|
3188
|
+
$set: setProps,
|
|
3189
|
+
$set_once: setOnceProps,
|
|
3190
|
+
$anon_distinct_id: $anon_distinct_id ?? void 0
|
|
3191
|
+
};
|
|
3192
|
+
super.identifyStateless(distinctId, eventProperties, {
|
|
3149
3193
|
disableGeoip
|
|
3150
3194
|
});
|
|
3151
3195
|
}
|
|
3152
|
-
async identifyImmediate({ distinctId, properties, disableGeoip }) {
|
|
3153
|
-
const
|
|
3154
|
-
|
|
3155
|
-
const
|
|
3156
|
-
|
|
3157
|
-
$set:
|
|
3158
|
-
$set_once:
|
|
3159
|
-
|
|
3196
|
+
async identifyImmediate({ distinctId, properties = {}, disableGeoip }) {
|
|
3197
|
+
const { $set, $set_once, $anon_distinct_id, ...rest } = properties;
|
|
3198
|
+
const setProps = $set || rest;
|
|
3199
|
+
const setOnceProps = $set_once || {};
|
|
3200
|
+
const eventProperties = {
|
|
3201
|
+
$set: setProps,
|
|
3202
|
+
$set_once: setOnceProps,
|
|
3203
|
+
$anon_distinct_id: $anon_distinct_id ?? void 0
|
|
3204
|
+
};
|
|
3205
|
+
super.identifyStatelessImmediate(distinctId, eventProperties, {
|
|
3160
3206
|
disableGeoip
|
|
3161
3207
|
});
|
|
3162
3208
|
}
|
|
@@ -3199,13 +3245,25 @@ var init_client = __esm({
|
|
|
3199
3245
|
let response = await this.featureFlagsPoller?.getFeatureFlag(key, distinctId, groups, personProperties, groupProperties);
|
|
3200
3246
|
const flagWasLocallyEvaluated = void 0 !== response;
|
|
3201
3247
|
let requestId;
|
|
3248
|
+
let evaluatedAt;
|
|
3202
3249
|
let flagDetail;
|
|
3250
|
+
let featureFlagError;
|
|
3203
3251
|
if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
|
|
3204
|
-
const
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3252
|
+
const flagsResponse = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [
|
|
3253
|
+
key
|
|
3254
|
+
]);
|
|
3255
|
+
if (void 0 === flagsResponse) featureFlagError = FeatureFlagError.UNKNOWN_ERROR;
|
|
3256
|
+
else {
|
|
3257
|
+
requestId = flagsResponse.requestId;
|
|
3258
|
+
evaluatedAt = flagsResponse.evaluatedAt;
|
|
3259
|
+
const errors = [];
|
|
3260
|
+
if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError.ERRORS_WHILE_COMPUTING);
|
|
3261
|
+
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(FeatureFlagError.QUOTA_LIMITED);
|
|
3262
|
+
flagDetail = flagsResponse.flags[key];
|
|
3263
|
+
if (void 0 === flagDetail) errors.push(FeatureFlagError.FLAG_MISSING);
|
|
3264
|
+
if (errors.length > 0) featureFlagError = errors.join(",");
|
|
3265
|
+
response = getFeatureFlagValue(flagDetail);
|
|
3266
|
+
}
|
|
3209
3267
|
}
|
|
3210
3268
|
const featureFlagReportedKey = `${key}_${response}`;
|
|
3211
3269
|
if (sendFeatureFlagEvents && (!(distinctId in this.distinctIdHasSentFlagCalls) || !this.distinctIdHasSentFlagCalls[distinctId].includes(featureFlagReportedKey))) {
|
|
@@ -3214,19 +3272,22 @@ var init_client = __esm({
|
|
|
3214
3272
|
else this.distinctIdHasSentFlagCalls[distinctId] = [
|
|
3215
3273
|
featureFlagReportedKey
|
|
3216
3274
|
];
|
|
3275
|
+
const properties = {
|
|
3276
|
+
$feature_flag: key,
|
|
3277
|
+
$feature_flag_response: response,
|
|
3278
|
+
$feature_flag_id: flagDetail?.metadata?.id,
|
|
3279
|
+
$feature_flag_version: flagDetail?.metadata?.version,
|
|
3280
|
+
$feature_flag_reason: flagDetail?.reason?.description ?? flagDetail?.reason?.code,
|
|
3281
|
+
locally_evaluated: flagWasLocallyEvaluated,
|
|
3282
|
+
[`$feature/${key}`]: response,
|
|
3283
|
+
$feature_flag_request_id: requestId,
|
|
3284
|
+
$feature_flag_evaluated_at: evaluatedAt
|
|
3285
|
+
};
|
|
3286
|
+
if (featureFlagError) properties.$feature_flag_error = featureFlagError;
|
|
3217
3287
|
this.capture({
|
|
3218
3288
|
distinctId,
|
|
3219
3289
|
event: "$feature_flag_called",
|
|
3220
|
-
properties
|
|
3221
|
-
$feature_flag: key,
|
|
3222
|
-
$feature_flag_response: response,
|
|
3223
|
-
$feature_flag_id: flagDetail?.metadata?.id,
|
|
3224
|
-
$feature_flag_version: flagDetail?.metadata?.version,
|
|
3225
|
-
$feature_flag_reason: flagDetail?.reason?.description ?? flagDetail?.reason?.code,
|
|
3226
|
-
locally_evaluated: flagWasLocallyEvaluated,
|
|
3227
|
-
[`$feature/${key}`]: response,
|
|
3228
|
-
$feature_flag_request_id: requestId
|
|
3229
|
-
},
|
|
3290
|
+
properties,
|
|
3230
3291
|
groups,
|
|
3231
3292
|
disableGeoip
|
|
3232
3293
|
});
|
|
@@ -3320,6 +3381,13 @@ var init_client = __esm({
|
|
|
3320
3381
|
async reloadFeatureFlags() {
|
|
3321
3382
|
await this.featureFlagsPoller?.loadFeatureFlags(true);
|
|
3322
3383
|
}
|
|
3384
|
+
withContext(data, fn, options) {
|
|
3385
|
+
if (!this.context) return fn();
|
|
3386
|
+
return this.context.run(data, fn, options);
|
|
3387
|
+
}
|
|
3388
|
+
getContext() {
|
|
3389
|
+
return this.context?.get();
|
|
3390
|
+
}
|
|
3323
3391
|
async _shutdown(shutdownTimeoutMs) {
|
|
3324
3392
|
this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
|
|
3325
3393
|
this.errorTracking.shutdown();
|
|
@@ -3431,10 +3499,21 @@ var init_client = __esm({
|
|
|
3431
3499
|
}
|
|
3432
3500
|
async prepareEventMessage(props) {
|
|
3433
3501
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
3502
|
+
const contextData = this.context?.get();
|
|
3503
|
+
let mergedDistinctId = distinctId || contextData?.distinctId;
|
|
3504
|
+
const mergedProperties = {
|
|
3505
|
+
...contextData?.properties || {},
|
|
3506
|
+
...properties || {}
|
|
3507
|
+
};
|
|
3508
|
+
if (!mergedDistinctId) {
|
|
3509
|
+
mergedDistinctId = uuidv7();
|
|
3510
|
+
mergedProperties.$process_person_profile = false;
|
|
3511
|
+
}
|
|
3512
|
+
if (contextData?.sessionId && !mergedProperties.$session_id) mergedProperties.$session_id = contextData.sessionId;
|
|
3434
3513
|
const eventMessage = this._runBeforeSend({
|
|
3435
|
-
distinctId,
|
|
3514
|
+
distinctId: mergedDistinctId,
|
|
3436
3515
|
event,
|
|
3437
|
-
properties,
|
|
3516
|
+
properties: mergedProperties,
|
|
3438
3517
|
groups,
|
|
3439
3518
|
sendFeatureFlags,
|
|
3440
3519
|
timestamp,
|
|
@@ -3445,8 +3524,9 @@ var init_client = __esm({
|
|
|
3445
3524
|
const eventProperties = await Promise.resolve().then(async () => {
|
|
3446
3525
|
if (sendFeatureFlags) {
|
|
3447
3526
|
const sendFeatureFlagsOptions = "object" == typeof sendFeatureFlags ? sendFeatureFlags : void 0;
|
|
3448
|
-
return await this.getFeatureFlagsForEvent(distinctId, groups, disableGeoip, sendFeatureFlagsOptions);
|
|
3527
|
+
return await this.getFeatureFlagsForEvent(eventMessage.distinctId, groups, disableGeoip, sendFeatureFlagsOptions);
|
|
3449
3528
|
}
|
|
3529
|
+
eventMessage.event;
|
|
3450
3530
|
return {};
|
|
3451
3531
|
}).then((flags) => {
|
|
3452
3532
|
const additionalProperties = {};
|
|
@@ -3502,8 +3582,37 @@ var init_client = __esm({
|
|
|
3502
3582
|
};
|
|
3503
3583
|
}
|
|
3504
3584
|
});
|
|
3585
|
+
var PostHogContext;
|
|
3586
|
+
var init_context = __esm({
|
|
3587
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3588
|
+
PostHogContext = class {
|
|
3589
|
+
constructor() {
|
|
3590
|
+
this.storage = new async_hooks.AsyncLocalStorage();
|
|
3591
|
+
}
|
|
3592
|
+
get() {
|
|
3593
|
+
return this.storage.getStore();
|
|
3594
|
+
}
|
|
3595
|
+
run(context, fn, options) {
|
|
3596
|
+
const fresh = options?.fresh === true;
|
|
3597
|
+
if (fresh) return this.storage.run(context, fn);
|
|
3598
|
+
{
|
|
3599
|
+
const currentContext = this.get() || {};
|
|
3600
|
+
const mergedContext = {
|
|
3601
|
+
distinctId: context.distinctId ?? currentContext.distinctId,
|
|
3602
|
+
sessionId: context.sessionId ?? currentContext.sessionId,
|
|
3603
|
+
properties: {
|
|
3604
|
+
...currentContext.properties || {},
|
|
3605
|
+
...context.properties || {}
|
|
3606
|
+
}
|
|
3607
|
+
};
|
|
3608
|
+
return this.storage.run(mergedContext, fn);
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3612
|
+
}
|
|
3613
|
+
});
|
|
3505
3614
|
|
|
3506
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3615
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3507
3616
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3508
3617
|
"error"
|
|
3509
3618
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3559,7 +3668,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3559
3668
|
}
|
|
3560
3669
|
var NAME, PostHogSentryIntegration;
|
|
3561
3670
|
var init_sentry_integration = __esm({
|
|
3562
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3671
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3563
3672
|
NAME = "posthog-node";
|
|
3564
3673
|
PostHogSentryIntegration = class {
|
|
3565
3674
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3581,46 +3690,55 @@ var init_sentry_integration = __esm({
|
|
|
3581
3690
|
}
|
|
3582
3691
|
});
|
|
3583
3692
|
|
|
3584
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3693
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3585
3694
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3586
|
-
app.use((
|
|
3695
|
+
app.use(posthogErrorHandler(_posthog));
|
|
3696
|
+
}
|
|
3697
|
+
function posthogErrorHandler(posthog) {
|
|
3698
|
+
return (error, req, res, next) => {
|
|
3699
|
+
const sessionId = req.headers["x-posthog-session-id"];
|
|
3700
|
+
const distinctId = req.headers["x-posthog-distinct-id"];
|
|
3701
|
+
const syntheticException = new Error("Synthetic exception");
|
|
3587
3702
|
const hint = {
|
|
3588
3703
|
mechanism: {
|
|
3589
3704
|
type: "middleware",
|
|
3590
3705
|
handled: false
|
|
3591
|
-
}
|
|
3706
|
+
},
|
|
3707
|
+
syntheticException
|
|
3592
3708
|
};
|
|
3593
|
-
ErrorTracking.buildEventMessage(error, hint,
|
|
3594
|
-
$
|
|
3595
|
-
|
|
3709
|
+
posthog.addPendingPromise(ErrorTracking.buildEventMessage(error, hint, distinctId, {
|
|
3710
|
+
$session_id: sessionId,
|
|
3711
|
+
$current_url: req.url,
|
|
3712
|
+
$request_method: req.method,
|
|
3713
|
+
$request_path: req.path,
|
|
3714
|
+
$user_agent: req.headers["user-agent"],
|
|
3715
|
+
$response_status_code: res.statusCode,
|
|
3716
|
+
$ip: req.headers["x-forwarded-for"] || req?.socket?.remoteAddress
|
|
3717
|
+
}).then((msg) => {
|
|
3718
|
+
posthog.capture(msg);
|
|
3719
|
+
}));
|
|
3596
3720
|
next(error);
|
|
3597
|
-
}
|
|
3721
|
+
};
|
|
3598
3722
|
}
|
|
3599
3723
|
var init_express = __esm({
|
|
3600
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3601
|
-
init_dist();
|
|
3724
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3602
3725
|
init_error_tracking2();
|
|
3603
3726
|
}
|
|
3604
3727
|
});
|
|
3605
3728
|
|
|
3606
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3607
|
-
var init_types3 = __esm({
|
|
3608
|
-
"../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/types.mjs"() {
|
|
3609
|
-
}
|
|
3610
|
-
});
|
|
3611
|
-
|
|
3612
|
-
// ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/exports.mjs
|
|
3729
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/exports.mjs
|
|
3613
3730
|
var init_exports = __esm({
|
|
3614
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3731
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3615
3732
|
init_sentry_integration();
|
|
3616
3733
|
init_express();
|
|
3617
3734
|
init_types3();
|
|
3618
3735
|
}
|
|
3619
3736
|
});
|
|
3620
3737
|
|
|
3621
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3738
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3622
3739
|
var index_node_exports = {};
|
|
3623
3740
|
__export(index_node_exports, {
|
|
3741
|
+
FeatureFlagError: () => FeatureFlagError,
|
|
3624
3742
|
PostHog: () => PostHog,
|
|
3625
3743
|
PostHogSentryIntegration: () => PostHogSentryIntegration,
|
|
3626
3744
|
createEventProcessor: () => createEventProcessor,
|
|
@@ -3629,12 +3747,13 @@ __export(index_node_exports, {
|
|
|
3629
3747
|
});
|
|
3630
3748
|
var PostHog;
|
|
3631
3749
|
var init_index_node = __esm({
|
|
3632
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3750
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3633
3751
|
init_module_node();
|
|
3634
3752
|
init_context_lines_node();
|
|
3635
3753
|
init_error_tracking2();
|
|
3636
3754
|
init_client();
|
|
3637
3755
|
init_dist();
|
|
3756
|
+
init_context();
|
|
3638
3757
|
init_exports();
|
|
3639
3758
|
ErrorTracking.errorPropertiesBuilder = new error_tracking_exports.ErrorPropertiesBuilder([
|
|
3640
3759
|
new error_tracking_exports.EventCoercer(),
|
|
@@ -3650,6 +3769,9 @@ var init_index_node = __esm({
|
|
|
3650
3769
|
getLibraryId() {
|
|
3651
3770
|
return "posthog-node";
|
|
3652
3771
|
}
|
|
3772
|
+
initializeContext() {
|
|
3773
|
+
return new PostHogContext();
|
|
3774
|
+
}
|
|
3653
3775
|
};
|
|
3654
3776
|
}
|
|
3655
3777
|
});
|