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