autotel-subscribers 16.0.1 → 17.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 +64 -64
- package/dist/amplitude.cjs.map +1 -1
- package/dist/amplitude.js +64 -64
- package/dist/amplitude.js.map +1 -1
- package/dist/factories.cjs +348 -249
- package/dist/factories.cjs.map +1 -1
- package/dist/factories.js +348 -249
- package/dist/factories.js.map +1 -1
- package/dist/index.cjs +348 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +348 -249
- package/dist/index.js.map +1 -1
- package/dist/posthog.cjs +284 -185
- package/dist/posthog.cjs.map +1 -1
- package/dist/posthog.js +284 -185
- package/dist/posthog.js.map +1 -1
- package/package.json +12 -12
- package/src/segment.test.ts +1 -0
package/dist/posthog.js
CHANGED
|
@@ -41,11 +41,11 @@ function normalizeWindowsPath(path) {
|
|
|
41
41
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
42
42
|
}
|
|
43
43
|
var init_module_node = __esm({
|
|
44
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
44
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
48
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
49
49
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
50
50
|
return {
|
|
51
51
|
key,
|
|
@@ -62,7 +62,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
62
62
|
}
|
|
63
63
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
64
64
|
var init_featureFlagUtils = __esm({
|
|
65
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
65
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
66
66
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
67
67
|
if ("flags" in flagsResponse) {
|
|
68
68
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -120,10 +120,10 @@ var init_featureFlagUtils = __esm({
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
123
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
124
124
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
125
125
|
var init_uuidv7 = __esm({
|
|
126
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
126
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
127
127
|
DIGITS = "0123456789abcdef";
|
|
128
128
|
UUID = class _UUID {
|
|
129
129
|
constructor(bytes) {
|
|
@@ -284,10 +284,10 @@ var init_uuidv7 = __esm({
|
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
286
|
|
|
287
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
287
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
288
288
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
289
289
|
var init_bot_detection = __esm({
|
|
290
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
290
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
291
291
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
292
292
|
"amazonbot",
|
|
293
293
|
"amazonproductbot",
|
|
@@ -378,10 +378,10 @@ var init_bot_detection = __esm({
|
|
|
378
378
|
}
|
|
379
379
|
});
|
|
380
380
|
|
|
381
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
382
|
-
var types_PostHogPersistedProperty;
|
|
381
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/types.mjs
|
|
382
|
+
var types_PostHogPersistedProperty, FeatureFlagError;
|
|
383
383
|
var init_types = __esm({
|
|
384
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
384
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/types.mjs"() {
|
|
385
385
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
386
386
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
387
387
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -410,16 +410,25 @@ var init_types = __esm({
|
|
|
410
410
|
PostHogPersistedProperty["FlagsEndpointWasHit"] = "flags_endpoint_was_hit";
|
|
411
411
|
return PostHogPersistedProperty;
|
|
412
412
|
})({});
|
|
413
|
+
FeatureFlagError = {
|
|
414
|
+
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
415
|
+
FLAG_MISSING: "flag_missing",
|
|
416
|
+
QUOTA_LIMITED: "quota_limited",
|
|
417
|
+
TIMEOUT: "timeout",
|
|
418
|
+
CONNECTION_ERROR: "connection_error",
|
|
419
|
+
UNKNOWN_ERROR: "unknown_error",
|
|
420
|
+
apiError: (status) => `api_error_${status}`
|
|
421
|
+
};
|
|
413
422
|
}
|
|
414
423
|
});
|
|
415
424
|
|
|
416
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
425
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
417
426
|
var init_string_utils = __esm({
|
|
418
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
427
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
|
|
419
428
|
}
|
|
420
429
|
});
|
|
421
430
|
|
|
422
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
431
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
423
432
|
function isPrimitive(value) {
|
|
424
433
|
return null === value || "object" != typeof value;
|
|
425
434
|
}
|
|
@@ -444,7 +453,7 @@ function isInstanceOf(candidate, base) {
|
|
|
444
453
|
}
|
|
445
454
|
var nativeIsArray, ObjProto, type_utils_toString, isArray, isObject, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
446
455
|
var init_type_utils = __esm({
|
|
447
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
456
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
448
457
|
init_types();
|
|
449
458
|
init_string_utils();
|
|
450
459
|
nativeIsArray = Array.isArray;
|
|
@@ -458,12 +467,12 @@ var init_type_utils = __esm({
|
|
|
458
467
|
isUndefined = (x) => void 0 === x;
|
|
459
468
|
isString = (x) => "[object String]" == type_utils_toString.call(x);
|
|
460
469
|
isEmptyString = (x) => isString(x) && 0 === x.trim().length;
|
|
461
|
-
isNumber = (x) => "[object Number]" == type_utils_toString.call(x);
|
|
470
|
+
isNumber = (x) => "[object Number]" == type_utils_toString.call(x) && x === x;
|
|
462
471
|
isPlainError = (x) => x instanceof Error;
|
|
463
472
|
}
|
|
464
473
|
});
|
|
465
474
|
|
|
466
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
475
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
467
476
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
468
477
|
if (min > max) {
|
|
469
478
|
logger.warn("min cannot be greater than max.");
|
|
@@ -481,15 +490,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
481
490
|
return clampToRange(max, min, max, logger);
|
|
482
491
|
}
|
|
483
492
|
var init_number_utils = __esm({
|
|
484
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
493
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
485
494
|
init_type_utils();
|
|
486
495
|
}
|
|
487
496
|
});
|
|
488
497
|
|
|
489
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
498
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
490
499
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
491
500
|
var init_bucketed_rate_limiter = __esm({
|
|
492
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
501
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
493
502
|
init_number_utils();
|
|
494
503
|
ONE_DAY_IN_MS = 864e5;
|
|
495
504
|
BucketedRateLimiter = class {
|
|
@@ -533,10 +542,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
533
542
|
}
|
|
534
543
|
});
|
|
535
544
|
|
|
536
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
545
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
537
546
|
var PromiseQueue;
|
|
538
547
|
var init_promise_queue = __esm({
|
|
539
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
548
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
540
549
|
init_uuidv7();
|
|
541
550
|
PromiseQueue = class {
|
|
542
551
|
add(promise) {
|
|
@@ -567,7 +576,7 @@ var init_promise_queue = __esm({
|
|
|
567
576
|
}
|
|
568
577
|
});
|
|
569
578
|
|
|
570
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
579
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
571
580
|
function createConsole(consoleLike = console) {
|
|
572
581
|
const lockedMethods = {
|
|
573
582
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -582,7 +591,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
582
591
|
}
|
|
583
592
|
var _createLogger, passThrough;
|
|
584
593
|
var init_logger = __esm({
|
|
585
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
594
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
586
595
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
587
596
|
function _log(level, ...args) {
|
|
588
597
|
maybeCall(() => {
|
|
@@ -611,10 +620,10 @@ var init_logger = __esm({
|
|
|
611
620
|
}
|
|
612
621
|
});
|
|
613
622
|
|
|
614
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
623
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
615
624
|
var MOBILE, TABLET, GENERIC;
|
|
616
625
|
var init_user_agent_utils = __esm({
|
|
617
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
626
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
618
627
|
init_string_utils();
|
|
619
628
|
init_type_utils();
|
|
620
629
|
MOBILE = "Mobile";
|
|
@@ -625,7 +634,7 @@ var init_user_agent_utils = __esm({
|
|
|
625
634
|
}
|
|
626
635
|
});
|
|
627
636
|
|
|
628
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
637
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/index.mjs
|
|
629
638
|
function assert(truthyValue, message) {
|
|
630
639
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message);
|
|
631
640
|
}
|
|
@@ -669,7 +678,7 @@ function allSettled(promises) {
|
|
|
669
678
|
}
|
|
670
679
|
var STRING_FORMAT, isError;
|
|
671
680
|
var init_utils = __esm({
|
|
672
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
681
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
673
682
|
init_bot_detection();
|
|
674
683
|
init_bucketed_rate_limiter();
|
|
675
684
|
init_number_utils();
|
|
@@ -683,10 +692,10 @@ var init_utils = __esm({
|
|
|
683
692
|
}
|
|
684
693
|
});
|
|
685
694
|
|
|
686
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
695
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
687
696
|
var SimpleEventEmitter;
|
|
688
697
|
var init_eventemitter = __esm({
|
|
689
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
698
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
690
699
|
SimpleEventEmitter = class {
|
|
691
700
|
constructor() {
|
|
692
701
|
this.events = {};
|
|
@@ -707,7 +716,7 @@ var init_eventemitter = __esm({
|
|
|
707
716
|
}
|
|
708
717
|
});
|
|
709
718
|
|
|
710
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
719
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/gzip.mjs
|
|
711
720
|
function isGzipSupported() {
|
|
712
721
|
return "CompressionStream" in globalThis;
|
|
713
722
|
}
|
|
@@ -726,11 +735,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
726
735
|
}
|
|
727
736
|
}
|
|
728
737
|
var init_gzip = __esm({
|
|
729
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
738
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
730
739
|
}
|
|
731
740
|
});
|
|
732
741
|
|
|
733
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
742
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
734
743
|
async function logFlushError(err) {
|
|
735
744
|
if (err instanceof PostHogFetchHttpError) {
|
|
736
745
|
let text = "";
|
|
@@ -750,7 +759,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
750
759
|
}
|
|
751
760
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
752
761
|
var init_posthog_core_stateless = __esm({
|
|
753
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
762
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
754
763
|
init_eventemitter();
|
|
755
764
|
init_featureFlagUtils();
|
|
756
765
|
init_gzip();
|
|
@@ -806,10 +815,11 @@ var init_posthog_core_stateless = __esm({
|
|
|
806
815
|
this.disableGeoip = options.disableGeoip ?? true;
|
|
807
816
|
this.disabled = options.disabled ?? false;
|
|
808
817
|
this.historicalMigration = options?.historicalMigration ?? false;
|
|
809
|
-
this.evaluationEnvironments = options?.evaluationEnvironments;
|
|
810
818
|
this._initPromise = Promise.resolve();
|
|
811
819
|
this._isInitialized = true;
|
|
812
820
|
this._logger = createLogger("[PostHog]", this.logMsgIfDebug.bind(this));
|
|
821
|
+
this.evaluationContexts = options?.evaluationContexts ?? options?.evaluationEnvironments;
|
|
822
|
+
if (options?.evaluationEnvironments && !options?.evaluationContexts) this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version.");
|
|
813
823
|
this.disableCompression = !isGzipSupported() || (options?.disableCompression ?? false);
|
|
814
824
|
}
|
|
815
825
|
logMsgIfDebug(fn) {
|
|
@@ -984,7 +994,7 @@ var init_posthog_core_stateless = __esm({
|
|
|
984
994
|
group_properties: groupProperties,
|
|
985
995
|
...extraPayload
|
|
986
996
|
};
|
|
987
|
-
if (this.
|
|
997
|
+
if (this.evaluationContexts && this.evaluationContexts.length > 0) requestData.evaluation_contexts = this.evaluationContexts;
|
|
988
998
|
const fetchOptions = {
|
|
989
999
|
method: "POST",
|
|
990
1000
|
headers: {
|
|
@@ -996,10 +1006,35 @@ var init_posthog_core_stateless = __esm({
|
|
|
996
1006
|
this._logger.info("Flags URL", url);
|
|
997
1007
|
return this.fetchWithRetry(url, fetchOptions, {
|
|
998
1008
|
retryCount: 0
|
|
999
|
-
}, this.featureFlagsRequestTimeoutMs).then((response) => response.json()).then((response) =>
|
|
1009
|
+
}, this.featureFlagsRequestTimeoutMs).then((response) => response.json()).then((response) => ({
|
|
1010
|
+
success: true,
|
|
1011
|
+
response: normalizeFlagsResponse(response)
|
|
1012
|
+
})).catch((error) => {
|
|
1000
1013
|
this._events.emit("error", error);
|
|
1014
|
+
return {
|
|
1015
|
+
success: false,
|
|
1016
|
+
error: this.categorizeRequestError(error)
|
|
1017
|
+
};
|
|
1001
1018
|
});
|
|
1002
1019
|
}
|
|
1020
|
+
categorizeRequestError(error) {
|
|
1021
|
+
if (error instanceof PostHogFetchHttpError) return {
|
|
1022
|
+
type: "api_error",
|
|
1023
|
+
statusCode: error.status
|
|
1024
|
+
};
|
|
1025
|
+
if (error instanceof PostHogFetchNetworkError) {
|
|
1026
|
+
const cause = error.error;
|
|
1027
|
+
if (cause instanceof Error && ("AbortError" === cause.name || "TimeoutError" === cause.name)) return {
|
|
1028
|
+
type: "timeout"
|
|
1029
|
+
};
|
|
1030
|
+
return {
|
|
1031
|
+
type: "connection_error"
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
return {
|
|
1035
|
+
type: "unknown_error"
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1003
1038
|
async getFeatureFlagStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {
|
|
1004
1039
|
await this._initPromise;
|
|
1005
1040
|
const flagDetailResponse = await this.getFeatureFlagDetailStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
@@ -1066,8 +1101,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1066
1101
|
const extraPayload = {};
|
|
1067
1102
|
if (disableGeoip ?? this.disableGeoip) extraPayload["geoip_disable"] = true;
|
|
1068
1103
|
if (flagKeysToEvaluate) extraPayload["flag_keys_to_evaluate"] = flagKeysToEvaluate;
|
|
1069
|
-
const
|
|
1070
|
-
if (
|
|
1104
|
+
const result = await this.getFlags(distinctId, groups, personProperties, groupProperties, extraPayload);
|
|
1105
|
+
if (!result.success) return;
|
|
1106
|
+
const flagsResponse = result.response;
|
|
1071
1107
|
if (flagsResponse.errorsWhileComputingFlags) console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices");
|
|
1072
1108
|
if (flagsResponse.quotaLimited?.includes("feature_flags")) {
|
|
1073
1109
|
console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts");
|
|
@@ -1134,10 +1170,15 @@ var init_posthog_core_stateless = __esm({
|
|
|
1134
1170
|
this.setPersistedProperty(types_PostHogPersistedProperty.Props, this.props);
|
|
1135
1171
|
});
|
|
1136
1172
|
}
|
|
1173
|
+
processBeforeEnqueue(message) {
|
|
1174
|
+
return message;
|
|
1175
|
+
}
|
|
1137
1176
|
enqueue(type, _message, options) {
|
|
1138
1177
|
this.wrap(() => {
|
|
1139
1178
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
1140
|
-
|
|
1179
|
+
let message = this.prepareMessage(type, _message, options);
|
|
1180
|
+
message = this.processBeforeEnqueue(message);
|
|
1181
|
+
if (null === message) return;
|
|
1141
1182
|
const queue = this.getPersistedProperty(types_PostHogPersistedProperty.Queue) || [];
|
|
1142
1183
|
if (queue.length >= this.maxQueueSize) {
|
|
1143
1184
|
queue.shift();
|
|
@@ -1156,10 +1197,13 @@ var init_posthog_core_stateless = __esm({
|
|
|
1156
1197
|
if (this.disabled) return void this._logger.warn("The client is disabled");
|
|
1157
1198
|
if (!this._isInitialized) await this._initPromise;
|
|
1158
1199
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
1200
|
+
let message = this.prepareMessage(type, _message, options);
|
|
1201
|
+
message = this.processBeforeEnqueue(message);
|
|
1202
|
+
if (null === message) return;
|
|
1159
1203
|
const data = {
|
|
1160
1204
|
api_key: this.apiKey,
|
|
1161
1205
|
batch: [
|
|
1162
|
-
|
|
1206
|
+
message
|
|
1163
1207
|
],
|
|
1164
1208
|
sent_at: currentISOTime()
|
|
1165
1209
|
};
|
|
@@ -1368,9 +1412,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1368
1412
|
}
|
|
1369
1413
|
});
|
|
1370
1414
|
|
|
1371
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1415
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1372
1416
|
var init_posthog_core = __esm({
|
|
1373
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1417
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core.mjs"() {
|
|
1374
1418
|
init_featureFlagUtils();
|
|
1375
1419
|
init_types();
|
|
1376
1420
|
init_posthog_core_stateless();
|
|
@@ -1379,7 +1423,7 @@ var init_posthog_core = __esm({
|
|
|
1379
1423
|
}
|
|
1380
1424
|
});
|
|
1381
1425
|
|
|
1382
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1426
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1383
1427
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1384
1428
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1385
1429
|
if (!chunkIdMap) return;
|
|
@@ -1412,14 +1456,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1412
1456
|
}
|
|
1413
1457
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1414
1458
|
var init_chunk_ids = __esm({
|
|
1415
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1459
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1416
1460
|
}
|
|
1417
1461
|
});
|
|
1418
1462
|
|
|
1419
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1463
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1420
1464
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1421
1465
|
var init_error_properties_builder = __esm({
|
|
1422
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1466
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1423
1467
|
init_utils();
|
|
1424
1468
|
init_chunk_ids();
|
|
1425
1469
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1533,7 +1577,7 @@ var init_error_properties_builder = __esm({
|
|
|
1533
1577
|
}
|
|
1534
1578
|
});
|
|
1535
1579
|
|
|
1536
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1580
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1537
1581
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1538
1582
|
const frame = {
|
|
1539
1583
|
platform,
|
|
@@ -1547,16 +1591,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1547
1591
|
}
|
|
1548
1592
|
var UNKNOWN_FUNCTION;
|
|
1549
1593
|
var init_base = __esm({
|
|
1550
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1594
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1551
1595
|
init_utils();
|
|
1552
1596
|
UNKNOWN_FUNCTION = "?";
|
|
1553
1597
|
}
|
|
1554
1598
|
});
|
|
1555
1599
|
|
|
1556
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1600
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1557
1601
|
var extractSafariExtensionDetails;
|
|
1558
1602
|
var init_safari = __esm({
|
|
1559
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1603
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1560
1604
|
init_base();
|
|
1561
1605
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1562
1606
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1572,10 +1616,10 @@ var init_safari = __esm({
|
|
|
1572
1616
|
}
|
|
1573
1617
|
});
|
|
1574
1618
|
|
|
1575
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1619
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1576
1620
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1577
1621
|
var init_chrome = __esm({
|
|
1578
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1622
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1579
1623
|
init_base();
|
|
1580
1624
|
init_safari();
|
|
1581
1625
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1605,10 +1649,10 @@ var init_chrome = __esm({
|
|
|
1605
1649
|
}
|
|
1606
1650
|
});
|
|
1607
1651
|
|
|
1608
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1652
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1609
1653
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1610
1654
|
var init_gecko = __esm({
|
|
1611
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1655
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1612
1656
|
init_base();
|
|
1613
1657
|
init_safari();
|
|
1614
1658
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1635,10 +1679,10 @@ var init_gecko = __esm({
|
|
|
1635
1679
|
}
|
|
1636
1680
|
});
|
|
1637
1681
|
|
|
1638
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1682
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1639
1683
|
var winjsRegex, winjsStackLineParser;
|
|
1640
1684
|
var init_winjs = __esm({
|
|
1641
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1685
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1642
1686
|
init_base();
|
|
1643
1687
|
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1644
1688
|
winjsStackLineParser = (line, platform) => {
|
|
@@ -1648,10 +1692,10 @@ var init_winjs = __esm({
|
|
|
1648
1692
|
}
|
|
1649
1693
|
});
|
|
1650
1694
|
|
|
1651
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1695
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1652
1696
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1653
1697
|
var init_opera = __esm({
|
|
1654
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1698
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1655
1699
|
init_base();
|
|
1656
1700
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1657
1701
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1666,7 +1710,7 @@ var init_opera = __esm({
|
|
|
1666
1710
|
}
|
|
1667
1711
|
});
|
|
1668
1712
|
|
|
1669
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1713
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1670
1714
|
function filenameIsInApp(filename, isNative = false) {
|
|
1671
1715
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1672
1716
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1676,7 +1720,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1676
1720
|
}
|
|
1677
1721
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1678
1722
|
var init_node = __esm({
|
|
1679
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1723
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1680
1724
|
init_base();
|
|
1681
1725
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1682
1726
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1737,7 +1781,7 @@ var init_node = __esm({
|
|
|
1737
1781
|
}
|
|
1738
1782
|
});
|
|
1739
1783
|
|
|
1740
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1784
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1741
1785
|
function reverseAndStripFrames(stack) {
|
|
1742
1786
|
if (!stack.length) return [];
|
|
1743
1787
|
const localStack = Array.from(stack);
|
|
@@ -1778,7 +1822,7 @@ function createStackParser(platform, ...parsers) {
|
|
|
1778
1822
|
}
|
|
1779
1823
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1780
1824
|
var init_parsers = __esm({
|
|
1781
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1825
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1782
1826
|
init_base();
|
|
1783
1827
|
init_chrome();
|
|
1784
1828
|
init_gecko();
|
|
@@ -1790,10 +1834,10 @@ var init_parsers = __esm({
|
|
|
1790
1834
|
}
|
|
1791
1835
|
});
|
|
1792
1836
|
|
|
1793
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1837
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1794
1838
|
var DOMExceptionCoercer;
|
|
1795
1839
|
var init_dom_exception_coercer = __esm({
|
|
1796
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1840
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1797
1841
|
init_utils();
|
|
1798
1842
|
DOMExceptionCoercer = class {
|
|
1799
1843
|
match(err) {
|
|
@@ -1827,10 +1871,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1827
1871
|
}
|
|
1828
1872
|
});
|
|
1829
1873
|
|
|
1830
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1874
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1831
1875
|
var ErrorCoercer;
|
|
1832
1876
|
var init_error_coercer = __esm({
|
|
1833
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1877
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1834
1878
|
init_utils();
|
|
1835
1879
|
ErrorCoercer = class {
|
|
1836
1880
|
match(err) {
|
|
@@ -1860,10 +1904,10 @@ var init_error_coercer = __esm({
|
|
|
1860
1904
|
}
|
|
1861
1905
|
});
|
|
1862
1906
|
|
|
1863
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1907
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1864
1908
|
var ErrorEventCoercer;
|
|
1865
1909
|
var init_error_event_coercer = __esm({
|
|
1866
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1910
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1867
1911
|
init_utils();
|
|
1868
1912
|
ErrorEventCoercer = class {
|
|
1869
1913
|
constructor() {
|
|
@@ -1885,10 +1929,10 @@ var init_error_event_coercer = __esm({
|
|
|
1885
1929
|
}
|
|
1886
1930
|
});
|
|
1887
1931
|
|
|
1888
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1932
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1889
1933
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1890
1934
|
var init_string_coercer = __esm({
|
|
1891
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1935
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1892
1936
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1893
1937
|
StringCoercer = class {
|
|
1894
1938
|
match(input) {
|
|
@@ -1920,10 +1964,10 @@ var init_string_coercer = __esm({
|
|
|
1920
1964
|
}
|
|
1921
1965
|
});
|
|
1922
1966
|
|
|
1923
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1967
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1924
1968
|
var severityLevels;
|
|
1925
1969
|
var init_types2 = __esm({
|
|
1926
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1970
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1927
1971
|
severityLevels = [
|
|
1928
1972
|
"fatal",
|
|
1929
1973
|
"error",
|
|
@@ -1935,7 +1979,7 @@ var init_types2 = __esm({
|
|
|
1935
1979
|
}
|
|
1936
1980
|
});
|
|
1937
1981
|
|
|
1938
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1982
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
1939
1983
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
1940
1984
|
const keys = Object.keys(err);
|
|
1941
1985
|
keys.sort();
|
|
@@ -1950,14 +1994,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
1950
1994
|
return "";
|
|
1951
1995
|
}
|
|
1952
1996
|
var init_utils2 = __esm({
|
|
1953
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1997
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
1954
1998
|
}
|
|
1955
1999
|
});
|
|
1956
2000
|
|
|
1957
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2001
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
1958
2002
|
var ObjectCoercer;
|
|
1959
2003
|
var init_object_coercer = __esm({
|
|
1960
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2004
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
1961
2005
|
init_utils();
|
|
1962
2006
|
init_types2();
|
|
1963
2007
|
init_utils2();
|
|
@@ -2011,10 +2055,10 @@ var init_object_coercer = __esm({
|
|
|
2011
2055
|
}
|
|
2012
2056
|
});
|
|
2013
2057
|
|
|
2014
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2058
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
2015
2059
|
var EventCoercer;
|
|
2016
2060
|
var init_event_coercer = __esm({
|
|
2017
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2061
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
2018
2062
|
init_utils();
|
|
2019
2063
|
init_utils2();
|
|
2020
2064
|
EventCoercer = class {
|
|
@@ -2034,10 +2078,10 @@ var init_event_coercer = __esm({
|
|
|
2034
2078
|
}
|
|
2035
2079
|
});
|
|
2036
2080
|
|
|
2037
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2081
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2038
2082
|
var PrimitiveCoercer;
|
|
2039
2083
|
var init_primitive_coercer = __esm({
|
|
2040
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2084
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2041
2085
|
init_utils();
|
|
2042
2086
|
PrimitiveCoercer = class {
|
|
2043
2087
|
match(candidate) {
|
|
@@ -2055,10 +2099,10 @@ var init_primitive_coercer = __esm({
|
|
|
2055
2099
|
}
|
|
2056
2100
|
});
|
|
2057
2101
|
|
|
2058
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2102
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2059
2103
|
var PromiseRejectionEventCoercer;
|
|
2060
2104
|
var init_promise_rejection_event = __esm({
|
|
2061
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2105
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
|
|
2062
2106
|
init_utils();
|
|
2063
2107
|
PromiseRejectionEventCoercer = class {
|
|
2064
2108
|
match(err) {
|
|
@@ -2087,9 +2131,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2087
2131
|
}
|
|
2088
2132
|
});
|
|
2089
2133
|
|
|
2090
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2134
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2091
2135
|
var init_coercers = __esm({
|
|
2092
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2136
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
|
|
2093
2137
|
init_dom_exception_coercer();
|
|
2094
2138
|
init_error_coercer();
|
|
2095
2139
|
init_error_event_coercer();
|
|
@@ -2101,10 +2145,10 @@ var init_coercers = __esm({
|
|
|
2101
2145
|
}
|
|
2102
2146
|
});
|
|
2103
2147
|
|
|
2104
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2148
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
2105
2149
|
var ReduceableCache;
|
|
2106
2150
|
var init_utils3 = __esm({
|
|
2107
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2151
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2108
2152
|
ReduceableCache = class {
|
|
2109
2153
|
constructor(_maxSize) {
|
|
2110
2154
|
this._maxSize = _maxSize;
|
|
@@ -2130,7 +2174,7 @@ var init_utils3 = __esm({
|
|
|
2130
2174
|
}
|
|
2131
2175
|
});
|
|
2132
2176
|
|
|
2133
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2177
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2134
2178
|
var error_tracking_exports = {};
|
|
2135
2179
|
__export(error_tracking_exports, {
|
|
2136
2180
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2154,7 +2198,7 @@ __export(error_tracking_exports, {
|
|
|
2154
2198
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2155
2199
|
});
|
|
2156
2200
|
var init_error_tracking = __esm({
|
|
2157
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2201
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2158
2202
|
init_error_properties_builder();
|
|
2159
2203
|
init_parsers();
|
|
2160
2204
|
init_coercers();
|
|
@@ -2162,9 +2206,9 @@ var init_error_tracking = __esm({
|
|
|
2162
2206
|
}
|
|
2163
2207
|
});
|
|
2164
2208
|
|
|
2165
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2209
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/index.mjs
|
|
2166
2210
|
var init_dist = __esm({
|
|
2167
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2211
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/index.mjs"() {
|
|
2168
2212
|
init_featureFlagUtils();
|
|
2169
2213
|
init_uuidv7();
|
|
2170
2214
|
init_utils();
|
|
@@ -2355,7 +2399,7 @@ function snipLine(line, colno) {
|
|
|
2355
2399
|
}
|
|
2356
2400
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2357
2401
|
var init_context_lines_node = __esm({
|
|
2358
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2402
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2359
2403
|
init_dist();
|
|
2360
2404
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2361
2405
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2365,7 +2409,7 @@ var init_context_lines_node = __esm({
|
|
|
2365
2409
|
}
|
|
2366
2410
|
});
|
|
2367
2411
|
|
|
2368
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2412
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2369
2413
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2370
2414
|
let calledFatalError = false;
|
|
2371
2415
|
return Object.assign((error) => {
|
|
@@ -2397,14 +2441,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2397
2441
|
}));
|
|
2398
2442
|
}
|
|
2399
2443
|
var init_autocapture = __esm({
|
|
2400
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2444
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2401
2445
|
}
|
|
2402
2446
|
});
|
|
2403
2447
|
|
|
2404
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2448
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2405
2449
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2406
2450
|
var init_error_tracking2 = __esm({
|
|
2407
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2451
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2408
2452
|
init_autocapture();
|
|
2409
2453
|
init_dist();
|
|
2410
2454
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2475,19 +2519,19 @@ var init_error_tracking2 = __esm({
|
|
|
2475
2519
|
}
|
|
2476
2520
|
});
|
|
2477
2521
|
|
|
2478
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2522
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/version.mjs
|
|
2479
2523
|
var version;
|
|
2480
2524
|
var init_version = __esm({
|
|
2481
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2482
|
-
version = "5.
|
|
2525
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/version.mjs"() {
|
|
2526
|
+
version = "5.24.1";
|
|
2483
2527
|
}
|
|
2484
2528
|
});
|
|
2485
2529
|
|
|
2486
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2487
|
-
var
|
|
2530
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/types.mjs
|
|
2531
|
+
var FeatureFlagError2;
|
|
2488
2532
|
var init_types3 = __esm({
|
|
2489
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2490
|
-
|
|
2533
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/types.mjs"() {
|
|
2534
|
+
FeatureFlagError2 = {
|
|
2491
2535
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2492
2536
|
FLAG_MISSING: "flag_missing",
|
|
2493
2537
|
QUOTA_LIMITED: "quota_limited",
|
|
@@ -2496,7 +2540,7 @@ var init_types3 = __esm({
|
|
|
2496
2540
|
}
|
|
2497
2541
|
});
|
|
2498
2542
|
|
|
2499
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2543
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2500
2544
|
async function hashSHA1(text) {
|
|
2501
2545
|
const subtle = globalThis.crypto?.subtle;
|
|
2502
2546
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2505,11 +2549,11 @@ async function hashSHA1(text) {
|
|
|
2505
2549
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2506
2550
|
}
|
|
2507
2551
|
var init_crypto = __esm({
|
|
2508
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2552
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2509
2553
|
}
|
|
2510
2554
|
});
|
|
2511
2555
|
|
|
2512
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2556
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2513
2557
|
async function _hash(key, distinctId, salt = "") {
|
|
2514
2558
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2515
2559
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2677,7 +2721,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2677
2721
|
}
|
|
2678
2722
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2679
2723
|
var init_feature_flags = __esm({
|
|
2680
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2724
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2681
2725
|
init_dist();
|
|
2682
2726
|
init_crypto();
|
|
2683
2727
|
SIXTY_SECONDS = 6e4;
|
|
@@ -3090,10 +3134,10 @@ var init_feature_flags = __esm({
|
|
|
3090
3134
|
}
|
|
3091
3135
|
});
|
|
3092
3136
|
|
|
3093
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3137
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3094
3138
|
var PostHogMemoryStorage;
|
|
3095
3139
|
var init_storage_memory = __esm({
|
|
3096
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3140
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3097
3141
|
PostHogMemoryStorage = class {
|
|
3098
3142
|
getProperty(key) {
|
|
3099
3143
|
return this._memoryStorage[key];
|
|
@@ -3108,10 +3152,10 @@ var init_storage_memory = __esm({
|
|
|
3108
3152
|
}
|
|
3109
3153
|
});
|
|
3110
3154
|
|
|
3111
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3155
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/client.mjs
|
|
3112
3156
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3113
3157
|
var init_client = __esm({
|
|
3114
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3158
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/client.mjs"() {
|
|
3115
3159
|
init_version();
|
|
3116
3160
|
init_dist();
|
|
3117
3161
|
init_types3();
|
|
@@ -3251,94 +3295,148 @@ var init_client = __esm({
|
|
|
3251
3295
|
});
|
|
3252
3296
|
});
|
|
3253
3297
|
}
|
|
3254
|
-
async
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3298
|
+
async _getFeatureFlagResult(key, distinctId, options = {}, matchValue) {
|
|
3299
|
+
const sendFeatureFlagEvents = options.sendFeatureFlagEvents ?? true;
|
|
3300
|
+
if (void 0 !== this._flagOverrides && key in this._flagOverrides) {
|
|
3301
|
+
const overrideValue = this._flagOverrides[key];
|
|
3302
|
+
if (void 0 === overrideValue) return;
|
|
3303
|
+
const overridePayload = this._payloadOverrides?.[key];
|
|
3304
|
+
return {
|
|
3305
|
+
key,
|
|
3306
|
+
enabled: false !== overrideValue,
|
|
3307
|
+
variant: "string" == typeof overrideValue ? overrideValue : void 0,
|
|
3308
|
+
payload: overridePayload
|
|
3309
|
+
};
|
|
3310
|
+
}
|
|
3311
|
+
const { groups, disableGeoip } = options;
|
|
3312
|
+
let { onlyEvaluateLocally, personProperties, groupProperties } = options;
|
|
3258
3313
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3259
3314
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3260
3315
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3261
3316
|
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3262
|
-
|
|
3263
|
-
let
|
|
3264
|
-
const flagWasLocallyEvaluated = void 0 !== response;
|
|
3317
|
+
let result;
|
|
3318
|
+
let flagWasLocallyEvaluated = false;
|
|
3265
3319
|
let requestId;
|
|
3266
3320
|
let evaluatedAt;
|
|
3267
|
-
let flagDetail;
|
|
3268
3321
|
let featureFlagError;
|
|
3322
|
+
let flagId;
|
|
3323
|
+
let flagVersion;
|
|
3324
|
+
let flagReason;
|
|
3325
|
+
const localEvaluationEnabled = void 0 !== this.featureFlagsPoller;
|
|
3326
|
+
if (localEvaluationEnabled) {
|
|
3327
|
+
await this.featureFlagsPoller?.loadFeatureFlags();
|
|
3328
|
+
const flag = this.featureFlagsPoller?.featureFlagsByKey[key];
|
|
3329
|
+
if (flag) try {
|
|
3330
|
+
const localResult = await this.featureFlagsPoller?.computeFlagAndPayloadLocally(flag, distinctId, groups, personProperties, groupProperties, matchValue);
|
|
3331
|
+
if (localResult) {
|
|
3332
|
+
flagWasLocallyEvaluated = true;
|
|
3333
|
+
const value = localResult.value;
|
|
3334
|
+
flagId = flag.id;
|
|
3335
|
+
flagReason = "Evaluated locally";
|
|
3336
|
+
result = {
|
|
3337
|
+
key,
|
|
3338
|
+
enabled: false !== value,
|
|
3339
|
+
variant: "string" == typeof value ? value : void 0,
|
|
3340
|
+
payload: localResult.payload ?? void 0
|
|
3341
|
+
};
|
|
3342
|
+
}
|
|
3343
|
+
} catch (e) {
|
|
3344
|
+
if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${key}: ${e.message}`);
|
|
3345
|
+
else throw e;
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3269
3348
|
if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
|
|
3270
3349
|
const flagsResponse = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [
|
|
3271
3350
|
key
|
|
3272
3351
|
]);
|
|
3273
|
-
if (void 0 === flagsResponse) featureFlagError =
|
|
3352
|
+
if (void 0 === flagsResponse) featureFlagError = FeatureFlagError2.UNKNOWN_ERROR;
|
|
3274
3353
|
else {
|
|
3275
3354
|
requestId = flagsResponse.requestId;
|
|
3276
3355
|
evaluatedAt = flagsResponse.evaluatedAt;
|
|
3277
3356
|
const errors = [];
|
|
3278
|
-
if (flagsResponse.errorsWhileComputingFlags) errors.push(
|
|
3279
|
-
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(
|
|
3280
|
-
flagDetail = flagsResponse.flags[key];
|
|
3281
|
-
if (void 0 === flagDetail) errors.push(
|
|
3357
|
+
if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError2.ERRORS_WHILE_COMPUTING);
|
|
3358
|
+
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(FeatureFlagError2.QUOTA_LIMITED);
|
|
3359
|
+
const flagDetail = flagsResponse.flags[key];
|
|
3360
|
+
if (void 0 === flagDetail) errors.push(FeatureFlagError2.FLAG_MISSING);
|
|
3361
|
+
else {
|
|
3362
|
+
flagId = flagDetail.metadata?.id;
|
|
3363
|
+
flagVersion = flagDetail.metadata?.version;
|
|
3364
|
+
flagReason = flagDetail.reason?.description ?? flagDetail.reason?.code;
|
|
3365
|
+
let parsedPayload;
|
|
3366
|
+
if (flagDetail.metadata?.payload !== void 0) try {
|
|
3367
|
+
parsedPayload = JSON.parse(flagDetail.metadata.payload);
|
|
3368
|
+
} catch {
|
|
3369
|
+
parsedPayload = flagDetail.metadata.payload;
|
|
3370
|
+
}
|
|
3371
|
+
result = {
|
|
3372
|
+
key,
|
|
3373
|
+
enabled: flagDetail.enabled,
|
|
3374
|
+
variant: flagDetail.variant,
|
|
3375
|
+
payload: parsedPayload
|
|
3376
|
+
};
|
|
3377
|
+
}
|
|
3282
3378
|
if (errors.length > 0) featureFlagError = errors.join(",");
|
|
3283
|
-
response = getFeatureFlagValue(flagDetail);
|
|
3284
3379
|
}
|
|
3285
3380
|
}
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
if (
|
|
3290
|
-
|
|
3291
|
-
featureFlagReportedKey
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3381
|
+
if (sendFeatureFlagEvents) {
|
|
3382
|
+
const response = void 0 === result ? void 0 : false === result.enabled ? false : result.variant ?? true;
|
|
3383
|
+
const featureFlagReportedKey = `${key}_${response}`;
|
|
3384
|
+
if (!(distinctId in this.distinctIdHasSentFlagCalls) || !this.distinctIdHasSentFlagCalls[distinctId].includes(featureFlagReportedKey)) {
|
|
3385
|
+
if (Object.keys(this.distinctIdHasSentFlagCalls).length >= this.maxCacheSize) this.distinctIdHasSentFlagCalls = {};
|
|
3386
|
+
if (Array.isArray(this.distinctIdHasSentFlagCalls[distinctId])) this.distinctIdHasSentFlagCalls[distinctId].push(featureFlagReportedKey);
|
|
3387
|
+
else this.distinctIdHasSentFlagCalls[distinctId] = [
|
|
3388
|
+
featureFlagReportedKey
|
|
3389
|
+
];
|
|
3390
|
+
const properties = {
|
|
3391
|
+
$feature_flag: key,
|
|
3392
|
+
$feature_flag_response: response,
|
|
3393
|
+
$feature_flag_id: flagId,
|
|
3394
|
+
$feature_flag_version: flagVersion,
|
|
3395
|
+
$feature_flag_reason: flagReason,
|
|
3396
|
+
locally_evaluated: flagWasLocallyEvaluated,
|
|
3397
|
+
[`$feature/${key}`]: response,
|
|
3398
|
+
$feature_flag_request_id: requestId,
|
|
3399
|
+
$feature_flag_evaluated_at: evaluatedAt
|
|
3400
|
+
};
|
|
3401
|
+
if (featureFlagError) properties.$feature_flag_error = featureFlagError;
|
|
3402
|
+
this.capture({
|
|
3403
|
+
distinctId,
|
|
3404
|
+
event: "$feature_flag_called",
|
|
3405
|
+
properties,
|
|
3406
|
+
groups,
|
|
3407
|
+
disableGeoip
|
|
3408
|
+
});
|
|
3409
|
+
}
|
|
3312
3410
|
}
|
|
3313
|
-
|
|
3411
|
+
if (void 0 !== result && void 0 !== this._payloadOverrides && key in this._payloadOverrides) result = {
|
|
3412
|
+
...result,
|
|
3413
|
+
payload: this._payloadOverrides[key]
|
|
3414
|
+
};
|
|
3415
|
+
return result;
|
|
3416
|
+
}
|
|
3417
|
+
async getFeatureFlag(key, distinctId, options) {
|
|
3418
|
+
const result = await this._getFeatureFlagResult(key, distinctId, {
|
|
3419
|
+
...options,
|
|
3420
|
+
sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true
|
|
3421
|
+
});
|
|
3422
|
+
if (void 0 === result) return;
|
|
3423
|
+
if (false === result.enabled) return false;
|
|
3424
|
+
return result.variant ?? true;
|
|
3314
3425
|
}
|
|
3315
3426
|
async getFeatureFlagPayload(key, distinctId, matchValue, options) {
|
|
3316
3427
|
if (void 0 !== this._payloadOverrides && key in this._payloadOverrides) return this._payloadOverrides[key];
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
if (result) {
|
|
3330
|
-
matchValue = result.value;
|
|
3331
|
-
response = result.payload;
|
|
3332
|
-
}
|
|
3333
|
-
} catch (e) {
|
|
3334
|
-
if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${flag.key}: ${e.message}`);
|
|
3335
|
-
else throw e;
|
|
3336
|
-
}
|
|
3337
|
-
}
|
|
3338
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3339
|
-
const payloadWasLocallyEvaluated = void 0 !== response;
|
|
3340
|
-
if (!payloadWasLocallyEvaluated && !onlyEvaluateLocally) response = await super.getFeatureFlagPayloadStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
3341
|
-
return response;
|
|
3428
|
+
const result = await this._getFeatureFlagResult(key, distinctId, {
|
|
3429
|
+
...options,
|
|
3430
|
+
sendFeatureFlagEvents: false
|
|
3431
|
+
}, matchValue);
|
|
3432
|
+
if (void 0 === result) return;
|
|
3433
|
+
return result.payload ?? null;
|
|
3434
|
+
}
|
|
3435
|
+
async getFeatureFlagResult(key, distinctId, options) {
|
|
3436
|
+
return this._getFeatureFlagResult(key, distinctId, {
|
|
3437
|
+
...options,
|
|
3438
|
+
sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true
|
|
3439
|
+
});
|
|
3342
3440
|
}
|
|
3343
3441
|
async getRemoteConfigPayload(flagKey) {
|
|
3344
3442
|
if (!this.options.personalApiKey) throw new Error("Personal API key is required for remote config payload decryption");
|
|
@@ -3665,7 +3763,7 @@ var init_client = __esm({
|
|
|
3665
3763
|
});
|
|
3666
3764
|
var PostHogContext;
|
|
3667
3765
|
var init_context = __esm({
|
|
3668
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3766
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3669
3767
|
PostHogContext = class {
|
|
3670
3768
|
constructor() {
|
|
3671
3769
|
this.storage = new AsyncLocalStorage();
|
|
@@ -3693,7 +3791,7 @@ var init_context = __esm({
|
|
|
3693
3791
|
}
|
|
3694
3792
|
});
|
|
3695
3793
|
|
|
3696
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3794
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3697
3795
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3698
3796
|
"error"
|
|
3699
3797
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3749,7 +3847,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3749
3847
|
}
|
|
3750
3848
|
var NAME, PostHogSentryIntegration;
|
|
3751
3849
|
var init_sentry_integration = __esm({
|
|
3752
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3850
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3753
3851
|
NAME = "posthog-node";
|
|
3754
3852
|
PostHogSentryIntegration = class {
|
|
3755
3853
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3771,7 +3869,7 @@ var init_sentry_integration = __esm({
|
|
|
3771
3869
|
}
|
|
3772
3870
|
});
|
|
3773
3871
|
|
|
3774
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3872
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3775
3873
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3776
3874
|
app.use(posthogErrorHandler(_posthog));
|
|
3777
3875
|
}
|
|
@@ -3803,21 +3901,22 @@ function posthogErrorHandler(posthog) {
|
|
|
3803
3901
|
};
|
|
3804
3902
|
}
|
|
3805
3903
|
var init_express = __esm({
|
|
3806
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3904
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3807
3905
|
init_error_tracking2();
|
|
3808
3906
|
}
|
|
3809
3907
|
});
|
|
3810
3908
|
|
|
3811
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3909
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/exports.mjs
|
|
3812
3910
|
var init_exports = __esm({
|
|
3813
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3911
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3912
|
+
init_dist();
|
|
3814
3913
|
init_sentry_integration();
|
|
3815
3914
|
init_express();
|
|
3816
3915
|
init_types3();
|
|
3817
3916
|
}
|
|
3818
3917
|
});
|
|
3819
3918
|
|
|
3820
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3919
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3821
3920
|
var index_node_exports = {};
|
|
3822
3921
|
__export(index_node_exports, {
|
|
3823
3922
|
FeatureFlagError: () => FeatureFlagError,
|
|
@@ -3829,7 +3928,7 @@ __export(index_node_exports, {
|
|
|
3829
3928
|
});
|
|
3830
3929
|
var PostHog;
|
|
3831
3930
|
var init_index_node = __esm({
|
|
3832
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3931
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3833
3932
|
init_module_node();
|
|
3834
3933
|
init_context_lines_node();
|
|
3835
3934
|
init_error_tracking2();
|