autotel-subscribers 12.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.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { dirname, posix, sep } from 'path';
|
|
2
2
|
import { createReadStream } from 'fs';
|
|
3
3
|
import { createInterface } from 'readline';
|
|
4
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
4
5
|
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -40,11 +41,11 @@ function normalizeWindowsPath(path) {
|
|
|
40
41
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
41
42
|
}
|
|
42
43
|
var init_module_node = __esm({
|
|
43
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
44
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
48
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
48
49
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
49
50
|
return {
|
|
50
51
|
key,
|
|
@@ -61,7 +62,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
61
62
|
}
|
|
62
63
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
63
64
|
var init_featureFlagUtils = __esm({
|
|
64
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
65
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
65
66
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
66
67
|
if ("flags" in flagsResponse) {
|
|
67
68
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -119,10 +120,10 @@ var init_featureFlagUtils = __esm({
|
|
|
119
120
|
}
|
|
120
121
|
});
|
|
121
122
|
|
|
122
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
123
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
123
124
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
124
125
|
var init_uuidv7 = __esm({
|
|
125
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
126
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
126
127
|
DIGITS = "0123456789abcdef";
|
|
127
128
|
UUID = class _UUID {
|
|
128
129
|
constructor(bytes) {
|
|
@@ -283,10 +284,10 @@ var init_uuidv7 = __esm({
|
|
|
283
284
|
}
|
|
284
285
|
});
|
|
285
286
|
|
|
286
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
287
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
287
288
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
288
289
|
var init_bot_detection = __esm({
|
|
289
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
290
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
290
291
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
291
292
|
"amazonbot",
|
|
292
293
|
"amazonproductbot",
|
|
@@ -377,10 +378,10 @@ var init_bot_detection = __esm({
|
|
|
377
378
|
}
|
|
378
379
|
});
|
|
379
380
|
|
|
380
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
381
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/types.mjs
|
|
381
382
|
var types_PostHogPersistedProperty;
|
|
382
383
|
var init_types = __esm({
|
|
383
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
384
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/types.mjs"() {
|
|
384
385
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
385
386
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
386
387
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -412,13 +413,13 @@ var init_types = __esm({
|
|
|
412
413
|
}
|
|
413
414
|
});
|
|
414
415
|
|
|
415
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
416
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
416
417
|
var init_string_utils = __esm({
|
|
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
|
}
|
|
419
420
|
});
|
|
420
421
|
|
|
421
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
422
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
422
423
|
function isInstanceOf(candidate, base) {
|
|
423
424
|
try {
|
|
424
425
|
return candidate instanceof base;
|
|
@@ -443,7 +444,7 @@ function isPlainObject(candidate) {
|
|
|
443
444
|
}
|
|
444
445
|
var nativeIsArray, ObjProto, type_utils_toString, isArray, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
445
446
|
var init_type_utils = __esm({
|
|
446
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
447
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
447
448
|
init_types();
|
|
448
449
|
init_string_utils();
|
|
449
450
|
nativeIsArray = Array.isArray;
|
|
@@ -461,7 +462,7 @@ var init_type_utils = __esm({
|
|
|
461
462
|
}
|
|
462
463
|
});
|
|
463
464
|
|
|
464
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
465
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
465
466
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
466
467
|
if (min > max) {
|
|
467
468
|
logger.warn("min cannot be greater than max.");
|
|
@@ -479,15 +480,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
479
480
|
return clampToRange(max, min, max, logger);
|
|
480
481
|
}
|
|
481
482
|
var init_number_utils = __esm({
|
|
482
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
483
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
483
484
|
init_type_utils();
|
|
484
485
|
}
|
|
485
486
|
});
|
|
486
487
|
|
|
487
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
488
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
488
489
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
489
490
|
var init_bucketed_rate_limiter = __esm({
|
|
490
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
491
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
491
492
|
init_number_utils();
|
|
492
493
|
ONE_DAY_IN_MS = 864e5;
|
|
493
494
|
BucketedRateLimiter = class {
|
|
@@ -531,10 +532,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
531
532
|
}
|
|
532
533
|
});
|
|
533
534
|
|
|
534
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
535
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
535
536
|
var PromiseQueue;
|
|
536
537
|
var init_promise_queue = __esm({
|
|
537
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
538
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
538
539
|
init_uuidv7();
|
|
539
540
|
PromiseQueue = class {
|
|
540
541
|
add(promise) {
|
|
@@ -565,7 +566,7 @@ var init_promise_queue = __esm({
|
|
|
565
566
|
}
|
|
566
567
|
});
|
|
567
568
|
|
|
568
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
569
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
569
570
|
function createConsole(consoleLike = console) {
|
|
570
571
|
const lockedMethods = {
|
|
571
572
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -580,7 +581,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
580
581
|
}
|
|
581
582
|
var _createLogger, passThrough;
|
|
582
583
|
var init_logger = __esm({
|
|
583
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
584
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
584
585
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
585
586
|
function _log(level, ...args) {
|
|
586
587
|
maybeCall(() => {
|
|
@@ -609,7 +610,21 @@ var init_logger = __esm({
|
|
|
609
610
|
}
|
|
610
611
|
});
|
|
611
612
|
|
|
612
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
613
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
614
|
+
var MOBILE, TABLET, GENERIC;
|
|
615
|
+
var init_user_agent_utils = __esm({
|
|
616
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
617
|
+
init_string_utils();
|
|
618
|
+
init_type_utils();
|
|
619
|
+
MOBILE = "Mobile";
|
|
620
|
+
TABLET = "Tablet";
|
|
621
|
+
GENERIC = "Generic";
|
|
622
|
+
GENERIC + " " + MOBILE.toLowerCase();
|
|
623
|
+
GENERIC + " " + TABLET.toLowerCase();
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/index.mjs
|
|
613
628
|
function assert(truthyValue, message) {
|
|
614
629
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message);
|
|
615
630
|
}
|
|
@@ -653,7 +668,7 @@ function allSettled(promises) {
|
|
|
653
668
|
}
|
|
654
669
|
var STRING_FORMAT, isError;
|
|
655
670
|
var init_utils = __esm({
|
|
656
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
671
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
657
672
|
init_bot_detection();
|
|
658
673
|
init_bucketed_rate_limiter();
|
|
659
674
|
init_number_utils();
|
|
@@ -661,15 +676,16 @@ var init_utils = __esm({
|
|
|
661
676
|
init_type_utils();
|
|
662
677
|
init_promise_queue();
|
|
663
678
|
init_logger();
|
|
679
|
+
init_user_agent_utils();
|
|
664
680
|
STRING_FORMAT = "utf8";
|
|
665
681
|
isError = (x) => x instanceof Error;
|
|
666
682
|
}
|
|
667
683
|
});
|
|
668
684
|
|
|
669
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
685
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
670
686
|
var SimpleEventEmitter;
|
|
671
687
|
var init_eventemitter = __esm({
|
|
672
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
688
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
673
689
|
SimpleEventEmitter = class {
|
|
674
690
|
constructor() {
|
|
675
691
|
this.events = {};
|
|
@@ -690,7 +706,7 @@ var init_eventemitter = __esm({
|
|
|
690
706
|
}
|
|
691
707
|
});
|
|
692
708
|
|
|
693
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
709
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/gzip.mjs
|
|
694
710
|
function isGzipSupported() {
|
|
695
711
|
return "CompressionStream" in globalThis;
|
|
696
712
|
}
|
|
@@ -709,11 +725,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
709
725
|
}
|
|
710
726
|
}
|
|
711
727
|
var init_gzip = __esm({
|
|
712
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
728
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
713
729
|
}
|
|
714
730
|
});
|
|
715
731
|
|
|
716
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
732
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
717
733
|
async function logFlushError(err) {
|
|
718
734
|
if (err instanceof PostHogFetchHttpError) {
|
|
719
735
|
let text = "";
|
|
@@ -733,7 +749,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
733
749
|
}
|
|
734
750
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
735
751
|
var init_posthog_core_stateless = __esm({
|
|
736
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
752
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
737
753
|
init_eventemitter();
|
|
738
754
|
init_featureFlagUtils();
|
|
739
755
|
init_gzip();
|
|
@@ -1007,7 +1023,8 @@ var init_posthog_core_stateless = __esm({
|
|
|
1007
1023
|
const flagDetail = featureFlags[key];
|
|
1008
1024
|
return {
|
|
1009
1025
|
response: flagDetail,
|
|
1010
|
-
requestId: flagsResponse.requestId
|
|
1026
|
+
requestId: flagsResponse.requestId,
|
|
1027
|
+
evaluatedAt: flagsResponse.evaluatedAt
|
|
1011
1028
|
};
|
|
1012
1029
|
}
|
|
1013
1030
|
async getFeatureFlagPayloadStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {
|
|
@@ -1057,7 +1074,8 @@ var init_posthog_core_stateless = __esm({
|
|
|
1057
1074
|
flags: {},
|
|
1058
1075
|
featureFlags: {},
|
|
1059
1076
|
featureFlagPayloads: {},
|
|
1060
|
-
requestId: flagsResponse?.requestId
|
|
1077
|
+
requestId: flagsResponse?.requestId,
|
|
1078
|
+
quotaLimited: flagsResponse.quotaLimited
|
|
1061
1079
|
};
|
|
1062
1080
|
}
|
|
1063
1081
|
return flagsResponse;
|
|
@@ -1349,9 +1367,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1349
1367
|
}
|
|
1350
1368
|
});
|
|
1351
1369
|
|
|
1352
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1370
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1353
1371
|
var init_posthog_core = __esm({
|
|
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
|
init_featureFlagUtils();
|
|
1356
1374
|
init_types();
|
|
1357
1375
|
init_posthog_core_stateless();
|
|
@@ -1360,7 +1378,7 @@ var init_posthog_core = __esm({
|
|
|
1360
1378
|
}
|
|
1361
1379
|
});
|
|
1362
1380
|
|
|
1363
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1381
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1364
1382
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1365
1383
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1366
1384
|
if (!chunkIdMap) return;
|
|
@@ -1393,14 +1411,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1393
1411
|
}
|
|
1394
1412
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1395
1413
|
var init_chunk_ids = __esm({
|
|
1396
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1414
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1397
1415
|
}
|
|
1398
1416
|
});
|
|
1399
1417
|
|
|
1400
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1418
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1401
1419
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1402
1420
|
var init_error_properties_builder = __esm({
|
|
1403
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1421
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1404
1422
|
init_utils();
|
|
1405
1423
|
init_chunk_ids();
|
|
1406
1424
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1514,7 +1532,7 @@ var init_error_properties_builder = __esm({
|
|
|
1514
1532
|
}
|
|
1515
1533
|
});
|
|
1516
1534
|
|
|
1517
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1535
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1518
1536
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1519
1537
|
const frame = {
|
|
1520
1538
|
platform,
|
|
@@ -1528,16 +1546,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1528
1546
|
}
|
|
1529
1547
|
var UNKNOWN_FUNCTION;
|
|
1530
1548
|
var init_base = __esm({
|
|
1531
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1549
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1532
1550
|
init_utils();
|
|
1533
1551
|
UNKNOWN_FUNCTION = "?";
|
|
1534
1552
|
}
|
|
1535
1553
|
});
|
|
1536
1554
|
|
|
1537
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1555
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1538
1556
|
var extractSafariExtensionDetails;
|
|
1539
1557
|
var init_safari = __esm({
|
|
1540
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1558
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1541
1559
|
init_base();
|
|
1542
1560
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1543
1561
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1553,10 +1571,10 @@ var init_safari = __esm({
|
|
|
1553
1571
|
}
|
|
1554
1572
|
});
|
|
1555
1573
|
|
|
1556
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1574
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1557
1575
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1558
1576
|
var init_chrome = __esm({
|
|
1559
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1577
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1560
1578
|
init_base();
|
|
1561
1579
|
init_safari();
|
|
1562
1580
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1586,10 +1604,10 @@ var init_chrome = __esm({
|
|
|
1586
1604
|
}
|
|
1587
1605
|
});
|
|
1588
1606
|
|
|
1589
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1607
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1590
1608
|
var winjsRegex, winjsStackLineParser;
|
|
1591
1609
|
var init_winjs = __esm({
|
|
1592
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1610
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1593
1611
|
init_base();
|
|
1594
1612
|
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1595
1613
|
winjsStackLineParser = (line, platform) => {
|
|
@@ -1599,10 +1617,10 @@ var init_winjs = __esm({
|
|
|
1599
1617
|
}
|
|
1600
1618
|
});
|
|
1601
1619
|
|
|
1602
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1620
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1603
1621
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1604
1622
|
var init_gecko = __esm({
|
|
1605
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1623
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1606
1624
|
init_base();
|
|
1607
1625
|
init_safari();
|
|
1608
1626
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1629,10 +1647,10 @@ var init_gecko = __esm({
|
|
|
1629
1647
|
}
|
|
1630
1648
|
});
|
|
1631
1649
|
|
|
1632
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1650
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1633
1651
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1634
1652
|
var init_opera = __esm({
|
|
1635
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1653
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1636
1654
|
init_base();
|
|
1637
1655
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1638
1656
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1647,7 +1665,7 @@ var init_opera = __esm({
|
|
|
1647
1665
|
}
|
|
1648
1666
|
});
|
|
1649
1667
|
|
|
1650
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1668
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1651
1669
|
function filenameIsInApp(filename, isNative = false) {
|
|
1652
1670
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1653
1671
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1657,7 +1675,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1657
1675
|
}
|
|
1658
1676
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1659
1677
|
var init_node = __esm({
|
|
1660
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1678
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1661
1679
|
init_base();
|
|
1662
1680
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1663
1681
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1718,7 +1736,7 @@ var init_node = __esm({
|
|
|
1718
1736
|
}
|
|
1719
1737
|
});
|
|
1720
1738
|
|
|
1721
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1739
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1722
1740
|
function reverseAndStripFrames(stack) {
|
|
1723
1741
|
if (!stack.length) return [];
|
|
1724
1742
|
const localStack = Array.from(stack);
|
|
@@ -1756,7 +1774,7 @@ function createStackParser(platform, ...parsers) {
|
|
|
1756
1774
|
}
|
|
1757
1775
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1758
1776
|
var init_parsers = __esm({
|
|
1759
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1777
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1760
1778
|
init_base();
|
|
1761
1779
|
init_chrome();
|
|
1762
1780
|
init_winjs();
|
|
@@ -1768,10 +1786,10 @@ var init_parsers = __esm({
|
|
|
1768
1786
|
}
|
|
1769
1787
|
});
|
|
1770
1788
|
|
|
1771
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1789
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1772
1790
|
var DOMExceptionCoercer;
|
|
1773
1791
|
var init_dom_exception_coercer = __esm({
|
|
1774
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1792
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1775
1793
|
init_utils();
|
|
1776
1794
|
DOMExceptionCoercer = class {
|
|
1777
1795
|
match(err) {
|
|
@@ -1805,10 +1823,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1805
1823
|
}
|
|
1806
1824
|
});
|
|
1807
1825
|
|
|
1808
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1826
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1809
1827
|
var ErrorCoercer;
|
|
1810
1828
|
var init_error_coercer = __esm({
|
|
1811
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1829
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1812
1830
|
init_utils();
|
|
1813
1831
|
ErrorCoercer = class {
|
|
1814
1832
|
match(err) {
|
|
@@ -1838,10 +1856,10 @@ var init_error_coercer = __esm({
|
|
|
1838
1856
|
}
|
|
1839
1857
|
});
|
|
1840
1858
|
|
|
1841
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1859
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1842
1860
|
var ErrorEventCoercer;
|
|
1843
1861
|
var init_error_event_coercer = __esm({
|
|
1844
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1862
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1845
1863
|
init_utils();
|
|
1846
1864
|
ErrorEventCoercer = class {
|
|
1847
1865
|
constructor() {
|
|
@@ -1863,10 +1881,10 @@ var init_error_event_coercer = __esm({
|
|
|
1863
1881
|
}
|
|
1864
1882
|
});
|
|
1865
1883
|
|
|
1866
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1884
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1867
1885
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1868
1886
|
var init_string_coercer = __esm({
|
|
1869
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1887
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1870
1888
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1871
1889
|
StringCoercer = class {
|
|
1872
1890
|
match(input) {
|
|
@@ -1898,10 +1916,10 @@ var init_string_coercer = __esm({
|
|
|
1898
1916
|
}
|
|
1899
1917
|
});
|
|
1900
1918
|
|
|
1901
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1919
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1902
1920
|
var severityLevels;
|
|
1903
1921
|
var init_types2 = __esm({
|
|
1904
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1922
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1905
1923
|
severityLevels = [
|
|
1906
1924
|
"fatal",
|
|
1907
1925
|
"error",
|
|
@@ -1913,7 +1931,7 @@ var init_types2 = __esm({
|
|
|
1913
1931
|
}
|
|
1914
1932
|
});
|
|
1915
1933
|
|
|
1916
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1934
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
1917
1935
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
1918
1936
|
const keys = Object.keys(err);
|
|
1919
1937
|
keys.sort();
|
|
@@ -1928,14 +1946,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
1928
1946
|
return "";
|
|
1929
1947
|
}
|
|
1930
1948
|
var init_utils2 = __esm({
|
|
1931
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1949
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
1932
1950
|
}
|
|
1933
1951
|
});
|
|
1934
1952
|
|
|
1935
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1953
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
1936
1954
|
var ObjectCoercer;
|
|
1937
1955
|
var init_object_coercer = __esm({
|
|
1938
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1956
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
1939
1957
|
init_utils();
|
|
1940
1958
|
init_types2();
|
|
1941
1959
|
init_utils2();
|
|
@@ -1989,10 +2007,10 @@ var init_object_coercer = __esm({
|
|
|
1989
2007
|
}
|
|
1990
2008
|
});
|
|
1991
2009
|
|
|
1992
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2010
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
1993
2011
|
var EventCoercer;
|
|
1994
2012
|
var init_event_coercer = __esm({
|
|
1995
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2013
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
1996
2014
|
init_utils();
|
|
1997
2015
|
init_utils2();
|
|
1998
2016
|
EventCoercer = class {
|
|
@@ -2012,10 +2030,10 @@ var init_event_coercer = __esm({
|
|
|
2012
2030
|
}
|
|
2013
2031
|
});
|
|
2014
2032
|
|
|
2015
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2033
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2016
2034
|
var PrimitiveCoercer;
|
|
2017
2035
|
var init_primitive_coercer = __esm({
|
|
2018
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2036
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2019
2037
|
init_utils();
|
|
2020
2038
|
PrimitiveCoercer = class {
|
|
2021
2039
|
match(candidate) {
|
|
@@ -2033,10 +2051,10 @@ var init_primitive_coercer = __esm({
|
|
|
2033
2051
|
}
|
|
2034
2052
|
});
|
|
2035
2053
|
|
|
2036
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2054
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2037
2055
|
var PromiseRejectionEventCoercer;
|
|
2038
2056
|
var init_promise_rejection_event = __esm({
|
|
2039
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2057
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
|
|
2040
2058
|
init_utils();
|
|
2041
2059
|
PromiseRejectionEventCoercer = class {
|
|
2042
2060
|
match(err) {
|
|
@@ -2065,9 +2083,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2065
2083
|
}
|
|
2066
2084
|
});
|
|
2067
2085
|
|
|
2068
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2086
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2069
2087
|
var init_coercers = __esm({
|
|
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
|
init_dom_exception_coercer();
|
|
2072
2090
|
init_error_coercer();
|
|
2073
2091
|
init_error_event_coercer();
|
|
@@ -2079,10 +2097,10 @@ var init_coercers = __esm({
|
|
|
2079
2097
|
}
|
|
2080
2098
|
});
|
|
2081
2099
|
|
|
2082
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2100
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
2083
2101
|
var ReduceableCache;
|
|
2084
2102
|
var init_utils3 = __esm({
|
|
2085
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2103
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2086
2104
|
ReduceableCache = class {
|
|
2087
2105
|
constructor(_maxSize) {
|
|
2088
2106
|
this._maxSize = _maxSize;
|
|
@@ -2108,7 +2126,7 @@ var init_utils3 = __esm({
|
|
|
2108
2126
|
}
|
|
2109
2127
|
});
|
|
2110
2128
|
|
|
2111
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2129
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2112
2130
|
var error_tracking_exports = {};
|
|
2113
2131
|
__export(error_tracking_exports, {
|
|
2114
2132
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2131,7 +2149,7 @@ __export(error_tracking_exports, {
|
|
|
2131
2149
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2132
2150
|
});
|
|
2133
2151
|
var init_error_tracking = __esm({
|
|
2134
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2152
|
+
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2135
2153
|
init_error_properties_builder();
|
|
2136
2154
|
init_parsers();
|
|
2137
2155
|
init_coercers();
|
|
@@ -2139,9 +2157,9 @@ var init_error_tracking = __esm({
|
|
|
2139
2157
|
}
|
|
2140
2158
|
});
|
|
2141
2159
|
|
|
2142
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2160
|
+
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/index.mjs
|
|
2143
2161
|
var init_dist = __esm({
|
|
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
|
init_featureFlagUtils();
|
|
2146
2164
|
init_uuidv7();
|
|
2147
2165
|
init_utils();
|
|
@@ -2332,7 +2350,7 @@ function snipLine(line, colno) {
|
|
|
2332
2350
|
}
|
|
2333
2351
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2334
2352
|
var init_context_lines_node = __esm({
|
|
2335
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2353
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2336
2354
|
init_dist();
|
|
2337
2355
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2338
2356
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2342,7 +2360,7 @@ var init_context_lines_node = __esm({
|
|
|
2342
2360
|
}
|
|
2343
2361
|
});
|
|
2344
2362
|
|
|
2345
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2363
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2346
2364
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2347
2365
|
let calledFatalError = false;
|
|
2348
2366
|
return Object.assign((error) => {
|
|
@@ -2363,10 +2381,10 @@ function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
|
2363
2381
|
});
|
|
2364
2382
|
}
|
|
2365
2383
|
function addUncaughtExceptionListener(captureFn, onFatalFn) {
|
|
2366
|
-
|
|
2384
|
+
globalThis.process?.on("uncaughtException", makeUncaughtExceptionHandler(captureFn, onFatalFn));
|
|
2367
2385
|
}
|
|
2368
2386
|
function addUnhandledRejectionListener(captureFn) {
|
|
2369
|
-
|
|
2387
|
+
globalThis.process?.on("unhandledRejection", (reason) => captureFn(reason, {
|
|
2370
2388
|
mechanism: {
|
|
2371
2389
|
type: "onunhandledrejection",
|
|
2372
2390
|
handled: false
|
|
@@ -2374,14 +2392,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2374
2392
|
}));
|
|
2375
2393
|
}
|
|
2376
2394
|
var init_autocapture = __esm({
|
|
2377
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2395
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2378
2396
|
}
|
|
2379
2397
|
});
|
|
2380
2398
|
|
|
2381
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2399
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2382
2400
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2383
2401
|
var init_error_tracking2 = __esm({
|
|
2384
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2402
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2385
2403
|
init_autocapture();
|
|
2386
2404
|
init_dist();
|
|
2387
2405
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2447,15 +2465,28 @@ var init_error_tracking2 = __esm({
|
|
|
2447
2465
|
}
|
|
2448
2466
|
});
|
|
2449
2467
|
|
|
2450
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2468
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/version.mjs
|
|
2451
2469
|
var version;
|
|
2452
2470
|
var init_version = __esm({
|
|
2453
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2454
|
-
version = "5.
|
|
2471
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/version.mjs"() {
|
|
2472
|
+
version = "5.18.1";
|
|
2473
|
+
}
|
|
2474
|
+
});
|
|
2475
|
+
|
|
2476
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/types.mjs
|
|
2477
|
+
var FeatureFlagError;
|
|
2478
|
+
var init_types3 = __esm({
|
|
2479
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/types.mjs"() {
|
|
2480
|
+
FeatureFlagError = {
|
|
2481
|
+
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2482
|
+
FLAG_MISSING: "flag_missing",
|
|
2483
|
+
QUOTA_LIMITED: "quota_limited",
|
|
2484
|
+
UNKNOWN_ERROR: "unknown_error"
|
|
2485
|
+
};
|
|
2455
2486
|
}
|
|
2456
2487
|
});
|
|
2457
2488
|
|
|
2458
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2489
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2459
2490
|
async function hashSHA1(text) {
|
|
2460
2491
|
const subtle = globalThis.crypto?.subtle;
|
|
2461
2492
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2464,11 +2495,11 @@ async function hashSHA1(text) {
|
|
|
2464
2495
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2465
2496
|
}
|
|
2466
2497
|
var init_crypto = __esm({
|
|
2467
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2498
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2468
2499
|
}
|
|
2469
2500
|
});
|
|
2470
2501
|
|
|
2471
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2502
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2472
2503
|
async function _hash(key, distinctId, salt = "") {
|
|
2473
2504
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2474
2505
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2636,7 +2667,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2636
2667
|
}
|
|
2637
2668
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2638
2669
|
var init_feature_flags = __esm({
|
|
2639
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2670
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2640
2671
|
init_dist();
|
|
2641
2672
|
init_crypto();
|
|
2642
2673
|
SIXTY_SECONDS = 6e4;
|
|
@@ -2674,7 +2705,6 @@ var init_feature_flags = __esm({
|
|
|
2674
2705
|
this.debugMode = false;
|
|
2675
2706
|
this.shouldBeginExponentialBackoff = false;
|
|
2676
2707
|
this.backOffCount = 0;
|
|
2677
|
-
this.hasAttemptedCacheLoad = false;
|
|
2678
2708
|
this.pollingInterval = pollingInterval;
|
|
2679
2709
|
this.personalApiKey = personalApiKey;
|
|
2680
2710
|
this.featureFlags = [];
|
|
@@ -2903,15 +2933,12 @@ var init_feature_flags = __esm({
|
|
|
2903
2933
|
}
|
|
2904
2934
|
}
|
|
2905
2935
|
async loadFeatureFlags(forceReload = false) {
|
|
2906
|
-
if (this.
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
this.loadingPromise = this._loadFeatureFlags();
|
|
2913
|
-
await this.loadingPromise;
|
|
2914
|
-
}
|
|
2936
|
+
if (this.loadedSuccessfullyOnce && !forceReload) return;
|
|
2937
|
+
if (!forceReload && this.nextFetchAllowedAt && Date.now() < this.nextFetchAllowedAt) return void this.logMsgIfDebug(() => console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period"));
|
|
2938
|
+
if (!this.loadingPromise) this.loadingPromise = this._loadFeatureFlags().catch((err) => this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${err}`))).finally(() => {
|
|
2939
|
+
this.loadingPromise = void 0;
|
|
2940
|
+
});
|
|
2941
|
+
return this.loadingPromise;
|
|
2915
2942
|
}
|
|
2916
2943
|
isLocalEvaluationReady() {
|
|
2917
2944
|
return (this.loadedSuccessfullyOnce ?? false) && (this.featureFlags?.length ?? 0) > 0;
|
|
@@ -2920,12 +2947,22 @@ var init_feature_flags = __esm({
|
|
|
2920
2947
|
if (!this.shouldBeginExponentialBackoff) return this.pollingInterval;
|
|
2921
2948
|
return Math.min(SIXTY_SECONDS, this.pollingInterval * 2 ** this.backOffCount);
|
|
2922
2949
|
}
|
|
2950
|
+
beginBackoff() {
|
|
2951
|
+
this.shouldBeginExponentialBackoff = true;
|
|
2952
|
+
this.backOffCount += 1;
|
|
2953
|
+
this.nextFetchAllowedAt = Date.now() + this.getPollingInterval();
|
|
2954
|
+
}
|
|
2955
|
+
clearBackoff() {
|
|
2956
|
+
this.shouldBeginExponentialBackoff = false;
|
|
2957
|
+
this.backOffCount = 0;
|
|
2958
|
+
this.nextFetchAllowedAt = void 0;
|
|
2959
|
+
}
|
|
2923
2960
|
async _loadFeatureFlags() {
|
|
2924
2961
|
if (this.poller) {
|
|
2925
2962
|
clearTimeout(this.poller);
|
|
2926
2963
|
this.poller = void 0;
|
|
2927
2964
|
}
|
|
2928
|
-
this.poller = setTimeout(() => this.
|
|
2965
|
+
this.poller = setTimeout(() => this.loadFeatureFlags(true), this.getPollingInterval());
|
|
2929
2966
|
try {
|
|
2930
2967
|
let shouldFetch = true;
|
|
2931
2968
|
if (this.cacheProvider) try {
|
|
@@ -2941,9 +2978,14 @@ var init_feature_flags = __esm({
|
|
|
2941
2978
|
const res = await this._requestFeatureFlagDefinitions();
|
|
2942
2979
|
if (!res) return;
|
|
2943
2980
|
switch (res.status) {
|
|
2981
|
+
case 304:
|
|
2982
|
+
this.logMsgIfDebug(() => console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data"));
|
|
2983
|
+
this.flagsEtag = res.headers?.get("ETag") ?? this.flagsEtag;
|
|
2984
|
+
this.loadedSuccessfullyOnce = true;
|
|
2985
|
+
this.clearBackoff();
|
|
2986
|
+
return;
|
|
2944
2987
|
case 401:
|
|
2945
|
-
this.
|
|
2946
|
-
this.backOffCount += 1;
|
|
2988
|
+
this.beginBackoff();
|
|
2947
2989
|
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`);
|
|
2948
2990
|
case 402:
|
|
2949
2991
|
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");
|
|
@@ -2953,24 +2995,22 @@ var init_feature_flags = __esm({
|
|
|
2953
2995
|
this.cohorts = {};
|
|
2954
2996
|
return;
|
|
2955
2997
|
case 403:
|
|
2956
|
-
this.
|
|
2957
|
-
this.backOffCount += 1;
|
|
2998
|
+
this.beginBackoff();
|
|
2958
2999
|
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`);
|
|
2959
3000
|
case 429:
|
|
2960
|
-
this.
|
|
2961
|
-
this.backOffCount += 1;
|
|
3001
|
+
this.beginBackoff();
|
|
2962
3002
|
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`);
|
|
2963
3003
|
case 200: {
|
|
2964
3004
|
const responseJson = await res.json() ?? {};
|
|
2965
3005
|
if (!("flags" in responseJson)) return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(responseJson)}`));
|
|
3006
|
+
this.flagsEtag = res.headers?.get("ETag") ?? void 0;
|
|
2966
3007
|
const flagData = {
|
|
2967
3008
|
flags: responseJson.flags ?? [],
|
|
2968
3009
|
groupTypeMapping: responseJson.group_type_mapping || {},
|
|
2969
3010
|
cohorts: responseJson.cohorts || {}
|
|
2970
3011
|
};
|
|
2971
3012
|
this.updateFlagState(flagData);
|
|
2972
|
-
this.
|
|
2973
|
-
this.backOffCount = 0;
|
|
3013
|
+
this.clearBackoff();
|
|
2974
3014
|
if (this.cacheProvider && shouldFetch) try {
|
|
2975
3015
|
await this.cacheProvider.onFlagDefinitionsReceived(flagData);
|
|
2976
3016
|
} catch (err) {
|
|
@@ -2984,23 +3024,23 @@ var init_feature_flags = __esm({
|
|
|
2984
3024
|
}
|
|
2985
3025
|
} catch (err) {
|
|
2986
3026
|
if (err instanceof ClientError) this.onError?.(err);
|
|
2987
|
-
} finally {
|
|
2988
|
-
this.loadingPromise = void 0;
|
|
2989
3027
|
}
|
|
2990
3028
|
}
|
|
2991
|
-
getPersonalApiKeyRequestOptions(method = "GET") {
|
|
3029
|
+
getPersonalApiKeyRequestOptions(method = "GET", etag) {
|
|
3030
|
+
const headers = {
|
|
3031
|
+
...this.customHeaders,
|
|
3032
|
+
"Content-Type": "application/json",
|
|
3033
|
+
Authorization: `Bearer ${this.personalApiKey}`
|
|
3034
|
+
};
|
|
3035
|
+
if (etag) headers["If-None-Match"] = etag;
|
|
2992
3036
|
return {
|
|
2993
3037
|
method,
|
|
2994
|
-
headers
|
|
2995
|
-
...this.customHeaders,
|
|
2996
|
-
"Content-Type": "application/json",
|
|
2997
|
-
Authorization: `Bearer ${this.personalApiKey}`
|
|
2998
|
-
}
|
|
3038
|
+
headers
|
|
2999
3039
|
};
|
|
3000
3040
|
}
|
|
3001
3041
|
_requestFeatureFlagDefinitions() {
|
|
3002
3042
|
const url = `${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`;
|
|
3003
|
-
const options = this.getPersonalApiKeyRequestOptions();
|
|
3043
|
+
const options = this.getPersonalApiKeyRequestOptions("GET", this.flagsEtag);
|
|
3004
3044
|
let abortTimeout = null;
|
|
3005
3045
|
if (this.timeout && "number" == typeof this.timeout) {
|
|
3006
3046
|
const controller = new AbortController();
|
|
@@ -3032,10 +3072,10 @@ var init_feature_flags = __esm({
|
|
|
3032
3072
|
}
|
|
3033
3073
|
});
|
|
3034
3074
|
|
|
3035
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3075
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3036
3076
|
var PostHogMemoryStorage;
|
|
3037
3077
|
var init_storage_memory = __esm({
|
|
3038
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3078
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3039
3079
|
PostHogMemoryStorage = class {
|
|
3040
3080
|
getProperty(key) {
|
|
3041
3081
|
return this._memoryStorage[key];
|
|
@@ -3050,12 +3090,13 @@ var init_storage_memory = __esm({
|
|
|
3050
3090
|
}
|
|
3051
3091
|
});
|
|
3052
3092
|
|
|
3053
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3093
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/client.mjs
|
|
3054
3094
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3055
3095
|
var init_client = __esm({
|
|
3056
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3096
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/client.mjs"() {
|
|
3057
3097
|
init_version();
|
|
3058
3098
|
init_dist();
|
|
3099
|
+
init_types3();
|
|
3059
3100
|
init_feature_flags();
|
|
3060
3101
|
init_error_tracking2();
|
|
3061
3102
|
init_storage_memory();
|
|
@@ -3066,6 +3107,7 @@ var init_client = __esm({
|
|
|
3066
3107
|
constructor(apiKey, options = {}) {
|
|
3067
3108
|
super(apiKey, options), this._memoryStorage = new PostHogMemoryStorage();
|
|
3068
3109
|
this.options = options;
|
|
3110
|
+
this.context = this.initializeContext();
|
|
3069
3111
|
this.options.featureFlagsPollingInterval = "number" == typeof options.featureFlagsPollingInterval ? Math.max(options.featureFlagsPollingInterval, MINIMUM_POLLING_INTERVAL) : THIRTY_SECONDS;
|
|
3070
3112
|
if (options.personalApiKey) {
|
|
3071
3113
|
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.');
|
|
@@ -3136,25 +3178,29 @@ var init_client = __esm({
|
|
|
3136
3178
|
if (err) console.error(err);
|
|
3137
3179
|
}));
|
|
3138
3180
|
}
|
|
3139
|
-
identify({ distinctId, properties, disableGeoip }) {
|
|
3140
|
-
const
|
|
3141
|
-
|
|
3142
|
-
const
|
|
3143
|
-
|
|
3144
|
-
$set:
|
|
3145
|
-
$set_once:
|
|
3146
|
-
|
|
3181
|
+
identify({ distinctId, properties = {}, disableGeoip }) {
|
|
3182
|
+
const { $set, $set_once, $anon_distinct_id, ...rest } = properties;
|
|
3183
|
+
const setProps = $set || rest;
|
|
3184
|
+
const setOnceProps = $set_once || {};
|
|
3185
|
+
const eventProperties = {
|
|
3186
|
+
$set: setProps,
|
|
3187
|
+
$set_once: setOnceProps,
|
|
3188
|
+
$anon_distinct_id: $anon_distinct_id ?? void 0
|
|
3189
|
+
};
|
|
3190
|
+
super.identifyStateless(distinctId, eventProperties, {
|
|
3147
3191
|
disableGeoip
|
|
3148
3192
|
});
|
|
3149
3193
|
}
|
|
3150
|
-
async identifyImmediate({ distinctId, properties, disableGeoip }) {
|
|
3151
|
-
const
|
|
3152
|
-
|
|
3153
|
-
const
|
|
3154
|
-
|
|
3155
|
-
$set:
|
|
3156
|
-
$set_once:
|
|
3157
|
-
|
|
3194
|
+
async identifyImmediate({ distinctId, properties = {}, disableGeoip }) {
|
|
3195
|
+
const { $set, $set_once, $anon_distinct_id, ...rest } = properties;
|
|
3196
|
+
const setProps = $set || rest;
|
|
3197
|
+
const setOnceProps = $set_once || {};
|
|
3198
|
+
const eventProperties = {
|
|
3199
|
+
$set: setProps,
|
|
3200
|
+
$set_once: setOnceProps,
|
|
3201
|
+
$anon_distinct_id: $anon_distinct_id ?? void 0
|
|
3202
|
+
};
|
|
3203
|
+
super.identifyStatelessImmediate(distinctId, eventProperties, {
|
|
3158
3204
|
disableGeoip
|
|
3159
3205
|
});
|
|
3160
3206
|
}
|
|
@@ -3197,13 +3243,25 @@ var init_client = __esm({
|
|
|
3197
3243
|
let response = await this.featureFlagsPoller?.getFeatureFlag(key, distinctId, groups, personProperties, groupProperties);
|
|
3198
3244
|
const flagWasLocallyEvaluated = void 0 !== response;
|
|
3199
3245
|
let requestId;
|
|
3246
|
+
let evaluatedAt;
|
|
3200
3247
|
let flagDetail;
|
|
3248
|
+
let featureFlagError;
|
|
3201
3249
|
if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
|
|
3202
|
-
const
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3250
|
+
const flagsResponse = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [
|
|
3251
|
+
key
|
|
3252
|
+
]);
|
|
3253
|
+
if (void 0 === flagsResponse) featureFlagError = FeatureFlagError.UNKNOWN_ERROR;
|
|
3254
|
+
else {
|
|
3255
|
+
requestId = flagsResponse.requestId;
|
|
3256
|
+
evaluatedAt = flagsResponse.evaluatedAt;
|
|
3257
|
+
const errors = [];
|
|
3258
|
+
if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError.ERRORS_WHILE_COMPUTING);
|
|
3259
|
+
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(FeatureFlagError.QUOTA_LIMITED);
|
|
3260
|
+
flagDetail = flagsResponse.flags[key];
|
|
3261
|
+
if (void 0 === flagDetail) errors.push(FeatureFlagError.FLAG_MISSING);
|
|
3262
|
+
if (errors.length > 0) featureFlagError = errors.join(",");
|
|
3263
|
+
response = getFeatureFlagValue(flagDetail);
|
|
3264
|
+
}
|
|
3207
3265
|
}
|
|
3208
3266
|
const featureFlagReportedKey = `${key}_${response}`;
|
|
3209
3267
|
if (sendFeatureFlagEvents && (!(distinctId in this.distinctIdHasSentFlagCalls) || !this.distinctIdHasSentFlagCalls[distinctId].includes(featureFlagReportedKey))) {
|
|
@@ -3212,19 +3270,22 @@ var init_client = __esm({
|
|
|
3212
3270
|
else this.distinctIdHasSentFlagCalls[distinctId] = [
|
|
3213
3271
|
featureFlagReportedKey
|
|
3214
3272
|
];
|
|
3273
|
+
const properties = {
|
|
3274
|
+
$feature_flag: key,
|
|
3275
|
+
$feature_flag_response: response,
|
|
3276
|
+
$feature_flag_id: flagDetail?.metadata?.id,
|
|
3277
|
+
$feature_flag_version: flagDetail?.metadata?.version,
|
|
3278
|
+
$feature_flag_reason: flagDetail?.reason?.description ?? flagDetail?.reason?.code,
|
|
3279
|
+
locally_evaluated: flagWasLocallyEvaluated,
|
|
3280
|
+
[`$feature/${key}`]: response,
|
|
3281
|
+
$feature_flag_request_id: requestId,
|
|
3282
|
+
$feature_flag_evaluated_at: evaluatedAt
|
|
3283
|
+
};
|
|
3284
|
+
if (featureFlagError) properties.$feature_flag_error = featureFlagError;
|
|
3215
3285
|
this.capture({
|
|
3216
3286
|
distinctId,
|
|
3217
3287
|
event: "$feature_flag_called",
|
|
3218
|
-
properties
|
|
3219
|
-
$feature_flag: key,
|
|
3220
|
-
$feature_flag_response: response,
|
|
3221
|
-
$feature_flag_id: flagDetail?.metadata?.id,
|
|
3222
|
-
$feature_flag_version: flagDetail?.metadata?.version,
|
|
3223
|
-
$feature_flag_reason: flagDetail?.reason?.description ?? flagDetail?.reason?.code,
|
|
3224
|
-
locally_evaluated: flagWasLocallyEvaluated,
|
|
3225
|
-
[`$feature/${key}`]: response,
|
|
3226
|
-
$feature_flag_request_id: requestId
|
|
3227
|
-
},
|
|
3288
|
+
properties,
|
|
3228
3289
|
groups,
|
|
3229
3290
|
disableGeoip
|
|
3230
3291
|
});
|
|
@@ -3318,6 +3379,13 @@ var init_client = __esm({
|
|
|
3318
3379
|
async reloadFeatureFlags() {
|
|
3319
3380
|
await this.featureFlagsPoller?.loadFeatureFlags(true);
|
|
3320
3381
|
}
|
|
3382
|
+
withContext(data, fn, options) {
|
|
3383
|
+
if (!this.context) return fn();
|
|
3384
|
+
return this.context.run(data, fn, options);
|
|
3385
|
+
}
|
|
3386
|
+
getContext() {
|
|
3387
|
+
return this.context?.get();
|
|
3388
|
+
}
|
|
3321
3389
|
async _shutdown(shutdownTimeoutMs) {
|
|
3322
3390
|
this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
|
|
3323
3391
|
this.errorTracking.shutdown();
|
|
@@ -3429,10 +3497,21 @@ var init_client = __esm({
|
|
|
3429
3497
|
}
|
|
3430
3498
|
async prepareEventMessage(props) {
|
|
3431
3499
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
3500
|
+
const contextData = this.context?.get();
|
|
3501
|
+
let mergedDistinctId = distinctId || contextData?.distinctId;
|
|
3502
|
+
const mergedProperties = {
|
|
3503
|
+
...contextData?.properties || {},
|
|
3504
|
+
...properties || {}
|
|
3505
|
+
};
|
|
3506
|
+
if (!mergedDistinctId) {
|
|
3507
|
+
mergedDistinctId = uuidv7();
|
|
3508
|
+
mergedProperties.$process_person_profile = false;
|
|
3509
|
+
}
|
|
3510
|
+
if (contextData?.sessionId && !mergedProperties.$session_id) mergedProperties.$session_id = contextData.sessionId;
|
|
3432
3511
|
const eventMessage = this._runBeforeSend({
|
|
3433
|
-
distinctId,
|
|
3512
|
+
distinctId: mergedDistinctId,
|
|
3434
3513
|
event,
|
|
3435
|
-
properties,
|
|
3514
|
+
properties: mergedProperties,
|
|
3436
3515
|
groups,
|
|
3437
3516
|
sendFeatureFlags,
|
|
3438
3517
|
timestamp,
|
|
@@ -3443,8 +3522,9 @@ var init_client = __esm({
|
|
|
3443
3522
|
const eventProperties = await Promise.resolve().then(async () => {
|
|
3444
3523
|
if (sendFeatureFlags) {
|
|
3445
3524
|
const sendFeatureFlagsOptions = "object" == typeof sendFeatureFlags ? sendFeatureFlags : void 0;
|
|
3446
|
-
return await this.getFeatureFlagsForEvent(distinctId, groups, disableGeoip, sendFeatureFlagsOptions);
|
|
3525
|
+
return await this.getFeatureFlagsForEvent(eventMessage.distinctId, groups, disableGeoip, sendFeatureFlagsOptions);
|
|
3447
3526
|
}
|
|
3527
|
+
eventMessage.event;
|
|
3448
3528
|
return {};
|
|
3449
3529
|
}).then((flags) => {
|
|
3450
3530
|
const additionalProperties = {};
|
|
@@ -3500,8 +3580,37 @@ var init_client = __esm({
|
|
|
3500
3580
|
};
|
|
3501
3581
|
}
|
|
3502
3582
|
});
|
|
3583
|
+
var PostHogContext;
|
|
3584
|
+
var init_context = __esm({
|
|
3585
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3586
|
+
PostHogContext = class {
|
|
3587
|
+
constructor() {
|
|
3588
|
+
this.storage = new AsyncLocalStorage();
|
|
3589
|
+
}
|
|
3590
|
+
get() {
|
|
3591
|
+
return this.storage.getStore();
|
|
3592
|
+
}
|
|
3593
|
+
run(context, fn, options) {
|
|
3594
|
+
const fresh = options?.fresh === true;
|
|
3595
|
+
if (fresh) return this.storage.run(context, fn);
|
|
3596
|
+
{
|
|
3597
|
+
const currentContext = this.get() || {};
|
|
3598
|
+
const mergedContext = {
|
|
3599
|
+
distinctId: context.distinctId ?? currentContext.distinctId,
|
|
3600
|
+
sessionId: context.sessionId ?? currentContext.sessionId,
|
|
3601
|
+
properties: {
|
|
3602
|
+
...currentContext.properties || {},
|
|
3603
|
+
...context.properties || {}
|
|
3604
|
+
}
|
|
3605
|
+
};
|
|
3606
|
+
return this.storage.run(mergedContext, fn);
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
};
|
|
3610
|
+
}
|
|
3611
|
+
});
|
|
3503
3612
|
|
|
3504
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3613
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3505
3614
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3506
3615
|
"error"
|
|
3507
3616
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3557,7 +3666,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3557
3666
|
}
|
|
3558
3667
|
var NAME, PostHogSentryIntegration;
|
|
3559
3668
|
var init_sentry_integration = __esm({
|
|
3560
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3669
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3561
3670
|
NAME = "posthog-node";
|
|
3562
3671
|
PostHogSentryIntegration = class {
|
|
3563
3672
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3579,46 +3688,55 @@ var init_sentry_integration = __esm({
|
|
|
3579
3688
|
}
|
|
3580
3689
|
});
|
|
3581
3690
|
|
|
3582
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3691
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3583
3692
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3584
|
-
app.use((
|
|
3693
|
+
app.use(posthogErrorHandler(_posthog));
|
|
3694
|
+
}
|
|
3695
|
+
function posthogErrorHandler(posthog) {
|
|
3696
|
+
return (error, req, res, next) => {
|
|
3697
|
+
const sessionId = req.headers["x-posthog-session-id"];
|
|
3698
|
+
const distinctId = req.headers["x-posthog-distinct-id"];
|
|
3699
|
+
const syntheticException = new Error("Synthetic exception");
|
|
3585
3700
|
const hint = {
|
|
3586
3701
|
mechanism: {
|
|
3587
3702
|
type: "middleware",
|
|
3588
3703
|
handled: false
|
|
3589
|
-
}
|
|
3704
|
+
},
|
|
3705
|
+
syntheticException
|
|
3590
3706
|
};
|
|
3591
|
-
ErrorTracking.buildEventMessage(error, hint,
|
|
3592
|
-
$
|
|
3593
|
-
|
|
3707
|
+
posthog.addPendingPromise(ErrorTracking.buildEventMessage(error, hint, distinctId, {
|
|
3708
|
+
$session_id: sessionId,
|
|
3709
|
+
$current_url: req.url,
|
|
3710
|
+
$request_method: req.method,
|
|
3711
|
+
$request_path: req.path,
|
|
3712
|
+
$user_agent: req.headers["user-agent"],
|
|
3713
|
+
$response_status_code: res.statusCode,
|
|
3714
|
+
$ip: req.headers["x-forwarded-for"] || req?.socket?.remoteAddress
|
|
3715
|
+
}).then((msg) => {
|
|
3716
|
+
posthog.capture(msg);
|
|
3717
|
+
}));
|
|
3594
3718
|
next(error);
|
|
3595
|
-
}
|
|
3719
|
+
};
|
|
3596
3720
|
}
|
|
3597
3721
|
var init_express = __esm({
|
|
3598
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3599
|
-
init_dist();
|
|
3722
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3600
3723
|
init_error_tracking2();
|
|
3601
3724
|
}
|
|
3602
3725
|
});
|
|
3603
3726
|
|
|
3604
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3605
|
-
var init_types3 = __esm({
|
|
3606
|
-
"../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/types.mjs"() {
|
|
3607
|
-
}
|
|
3608
|
-
});
|
|
3609
|
-
|
|
3610
|
-
// ../../node_modules/.pnpm/posthog-node@5.14.0/node_modules/posthog-node/dist/exports.mjs
|
|
3727
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/exports.mjs
|
|
3611
3728
|
var init_exports = __esm({
|
|
3612
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3729
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3613
3730
|
init_sentry_integration();
|
|
3614
3731
|
init_express();
|
|
3615
3732
|
init_types3();
|
|
3616
3733
|
}
|
|
3617
3734
|
});
|
|
3618
3735
|
|
|
3619
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3736
|
+
// ../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3620
3737
|
var index_node_exports = {};
|
|
3621
3738
|
__export(index_node_exports, {
|
|
3739
|
+
FeatureFlagError: () => FeatureFlagError,
|
|
3622
3740
|
PostHog: () => PostHog,
|
|
3623
3741
|
PostHogSentryIntegration: () => PostHogSentryIntegration,
|
|
3624
3742
|
createEventProcessor: () => createEventProcessor,
|
|
@@ -3627,12 +3745,13 @@ __export(index_node_exports, {
|
|
|
3627
3745
|
});
|
|
3628
3746
|
var PostHog;
|
|
3629
3747
|
var init_index_node = __esm({
|
|
3630
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3748
|
+
"../../node_modules/.pnpm/posthog-node@5.18.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3631
3749
|
init_module_node();
|
|
3632
3750
|
init_context_lines_node();
|
|
3633
3751
|
init_error_tracking2();
|
|
3634
3752
|
init_client();
|
|
3635
3753
|
init_dist();
|
|
3754
|
+
init_context();
|
|
3636
3755
|
init_exports();
|
|
3637
3756
|
ErrorTracking.errorPropertiesBuilder = new error_tracking_exports.ErrorPropertiesBuilder([
|
|
3638
3757
|
new error_tracking_exports.EventCoercer(),
|
|
@@ -3648,6 +3767,9 @@ var init_index_node = __esm({
|
|
|
3648
3767
|
getLibraryId() {
|
|
3649
3768
|
return "posthog-node";
|
|
3650
3769
|
}
|
|
3770
|
+
initializeContext() {
|
|
3771
|
+
return new PostHogContext();
|
|
3772
|
+
}
|
|
3651
3773
|
};
|
|
3652
3774
|
}
|
|
3653
3775
|
});
|