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