posthog-node
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../src/extensions/feature-flags/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAmC,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACtH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAG1G,OAAO,EAAE,2BAA2B,EAA2B,MAAM,SAAS,CAAA;AAQ9E,cAAM,WAAY,SAAQ,KAAK;gBACjB,OAAO,EAAE,MAAM;CAO5B;AAED,cAAM,sBAAuB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAS5B;AAED,cAAM,wBAAyB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAS5B;AAED,KAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACpF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAChC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACzC,aAAa,CAAC,EAAE,2BAA2B,CAAA;IAC3C,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EA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,MAAM,CAAC,CAAA;AAE3C;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CA2B/C;AAsGD,iBAAS,uCAAuC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAmC3E;AAED,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,uCAAuC,EACvC,WAAW,EACX,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,GACZ,CAAA"} |
@@ -40,3 +40,4 @@ "use strict"; | ||
| const NULL_VALUES_ALLOWED_OPERATORS = [ | ||
| 'is_not' | ||
| 'is_not', | ||
| 'is_set' | ||
| ]; | ||
@@ -170,4 +171,4 @@ class ClientError extends Error { | ||
| const { distinctId, groups, personProperties, groupProperties } = evaluationContext; | ||
| if (!flag.active) return false; | ||
| if (flag.ensure_experience_continuity) throw new InconclusiveMatchError('Flag has experience continuity enabled'); | ||
| if (!flag.active) return false; | ||
| const flagFilters = flag.filters || {}; | ||
@@ -303,3 +304,3 @@ const aggregation_group_type_index = flagFilters.aggregation_group_type_index; | ||
| let matches = false; | ||
| matches = 'cohort' === propertyType ? matchCohort(prop, properties, this.cohorts, this.debugMode) : 'flag' === propertyType ? await this.evaluateFlagDependency(prop, properties, evaluationContext) : matchProperty(prop, properties, warnFunction); | ||
| matches = 'cohort' === propertyType ? await matchCohort(prop, properties, this.cohorts, this.debugMode, (depProp)=>this.evaluateFlagDependency(depProp, properties, evaluationContext)) : 'flag' === propertyType ? await this.evaluateFlagDependency(prop, properties, evaluationContext) : matchProperty(prop, properties, warnFunction); | ||
| if (!matches) return false; | ||
@@ -515,4 +516,7 @@ } | ||
| if (key in propertyValues) { | ||
| if ('is_not_set' === operator) throw new InconclusiveMatchError("Operator is_not_set is not supported"); | ||
| } else throw new InconclusiveMatchError(`Property ${key} not found in propertyValues`); | ||
| if ('is_not_set' === operator) return false; | ||
| } else { | ||
| if ('is_not_set' === operator) return true; | ||
| throw new InconclusiveMatchError(`Property ${key} not found in propertyValues`); | ||
| } | ||
| const overrideValue = propertyValues[key]; | ||
@@ -554,9 +558,7 @@ if (null == overrideValue && !NULL_VALUES_ALLOWED_OPERATORS.includes(operator)) { | ||
| { | ||
| let parsedValue = 'number' == typeof value ? value : null; | ||
| if ('string' == typeof value) try { | ||
| parsedValue = parseFloat(value); | ||
| } catch (err) {} | ||
| if (null == parsedValue || null == overrideValue) return compare(String(overrideValue), String(value), operator); | ||
| if ('string' == typeof overrideValue) return compare(overrideValue, String(value), operator); | ||
| return compare(overrideValue, parsedValue, operator); | ||
| const parsedValue = 'number' == typeof value ? value : parseFloat(String(value)); | ||
| let parsedOverride; | ||
| parsedOverride = 'number' == typeof overrideValue ? overrideValue : null != overrideValue ? parseFloat(String(overrideValue)) : NaN; | ||
| if (Number.isFinite(parsedValue) && Number.isFinite(parsedOverride)) return compare(parsedOverride, parsedValue, operator); | ||
| return compare(String(overrideValue), String(value), operator); | ||
| } | ||
@@ -631,9 +633,9 @@ case 'is_date_after': | ||
| } | ||
| function matchCohort(property, propertyValues, cohortProperties, debugMode = false) { | ||
| async function matchCohort(property, propertyValues, cohortProperties, debugMode = false, flagDependencyEvaluator) { | ||
| const cohortId = String(property.value); | ||
| checkCohortExists(cohortId, cohortProperties); | ||
| const propertyGroup = cohortProperties[cohortId]; | ||
| return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode); | ||
| return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator); | ||
| } | ||
| function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode = false) { | ||
| async function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode = false, flagDependencyEvaluator) { | ||
| if (!propertyGroup) return true; | ||
@@ -646,3 +648,3 @@ const propertyGroupType = propertyGroup.type; | ||
| for (const prop of properties)try { | ||
| const matches = matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode); | ||
| const matches = await matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator); | ||
| if ('AND' === propertyGroupType) { | ||
@@ -663,6 +665,6 @@ if (!matches) return false; | ||
| let matches; | ||
| if ('cohort' === prop.type) matches = matchCohort(prop, propertyValues, cohortProperties, debugMode); | ||
| if ('cohort' === prop.type) matches = await matchCohort(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator); | ||
| else if ('flag' === prop.type) { | ||
| if (debugMode) console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${prop.key || 'unknown'}'`); | ||
| continue; | ||
| if (!flagDependencyEvaluator) throw new InconclusiveMatchError(`Flag dependency '${prop.key || 'unknown'}' cannot be evaluated without a flag dependency evaluator`); | ||
| matches = await flagDependencyEvaluator(prop); | ||
| } else matches = matchProperty(prop, propertyValues); | ||
@@ -669,0 +671,0 @@ const negation = prop.negation || false; |
@@ -6,3 +6,4 @@ import { safeSetTimeout } from "@posthog/core"; | ||
| const NULL_VALUES_ALLOWED_OPERATORS = [ | ||
| 'is_not' | ||
| 'is_not', | ||
| 'is_set' | ||
| ]; | ||
@@ -136,4 +137,4 @@ class ClientError extends Error { | ||
| const { distinctId, groups, personProperties, groupProperties } = evaluationContext; | ||
| if (!flag.active) return false; | ||
| if (flag.ensure_experience_continuity) throw new InconclusiveMatchError('Flag has experience continuity enabled'); | ||
| if (!flag.active) return false; | ||
| const flagFilters = flag.filters || {}; | ||
@@ -269,3 +270,3 @@ const aggregation_group_type_index = flagFilters.aggregation_group_type_index; | ||
| let matches = false; | ||
| matches = 'cohort' === propertyType ? matchCohort(prop, properties, this.cohorts, this.debugMode) : 'flag' === propertyType ? await this.evaluateFlagDependency(prop, properties, evaluationContext) : matchProperty(prop, properties, warnFunction); | ||
| matches = 'cohort' === propertyType ? await matchCohort(prop, properties, this.cohorts, this.debugMode, (depProp)=>this.evaluateFlagDependency(depProp, properties, evaluationContext)) : 'flag' === propertyType ? await this.evaluateFlagDependency(prop, properties, evaluationContext) : matchProperty(prop, properties, warnFunction); | ||
| if (!matches) return false; | ||
@@ -481,4 +482,7 @@ } | ||
| if (key in propertyValues) { | ||
| if ('is_not_set' === operator) throw new InconclusiveMatchError("Operator is_not_set is not supported"); | ||
| } else throw new InconclusiveMatchError(`Property ${key} not found in propertyValues`); | ||
| if ('is_not_set' === operator) return false; | ||
| } else { | ||
| if ('is_not_set' === operator) return true; | ||
| throw new InconclusiveMatchError(`Property ${key} not found in propertyValues`); | ||
| } | ||
| const overrideValue = propertyValues[key]; | ||
@@ -520,9 +524,7 @@ if (null == overrideValue && !NULL_VALUES_ALLOWED_OPERATORS.includes(operator)) { | ||
| { | ||
| let parsedValue = 'number' == typeof value ? value : null; | ||
| if ('string' == typeof value) try { | ||
| parsedValue = parseFloat(value); | ||
| } catch (err) {} | ||
| if (null == parsedValue || null == overrideValue) return compare(String(overrideValue), String(value), operator); | ||
| if ('string' == typeof overrideValue) return compare(overrideValue, String(value), operator); | ||
| return compare(overrideValue, parsedValue, operator); | ||
| const parsedValue = 'number' == typeof value ? value : parseFloat(String(value)); | ||
| let parsedOverride; | ||
| parsedOverride = 'number' == typeof overrideValue ? overrideValue : null != overrideValue ? parseFloat(String(overrideValue)) : NaN; | ||
| if (Number.isFinite(parsedValue) && Number.isFinite(parsedOverride)) return compare(parsedOverride, parsedValue, operator); | ||
| return compare(String(overrideValue), String(value), operator); | ||
| } | ||
@@ -597,9 +599,9 @@ case 'is_date_after': | ||
| } | ||
| function matchCohort(property, propertyValues, cohortProperties, debugMode = false) { | ||
| async function matchCohort(property, propertyValues, cohortProperties, debugMode = false, flagDependencyEvaluator) { | ||
| const cohortId = String(property.value); | ||
| checkCohortExists(cohortId, cohortProperties); | ||
| const propertyGroup = cohortProperties[cohortId]; | ||
| return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode); | ||
| return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator); | ||
| } | ||
| function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode = false) { | ||
| async function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode = false, flagDependencyEvaluator) { | ||
| if (!propertyGroup) return true; | ||
@@ -612,3 +614,3 @@ const propertyGroupType = propertyGroup.type; | ||
| for (const prop of properties)try { | ||
| const matches = matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode); | ||
| const matches = await matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator); | ||
| if ('AND' === propertyGroupType) { | ||
@@ -629,6 +631,6 @@ if (!matches) return false; | ||
| let matches; | ||
| if ('cohort' === prop.type) matches = matchCohort(prop, propertyValues, cohortProperties, debugMode); | ||
| if ('cohort' === prop.type) matches = await matchCohort(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator); | ||
| else if ('flag' === prop.type) { | ||
| if (debugMode) console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${prop.key || 'unknown'}'`); | ||
| continue; | ||
| if (!flagDependencyEvaluator) throw new InconclusiveMatchError(`Flag dependency '${prop.key || 'unknown'}' cannot be evaluated without a flag dependency evaluator`); | ||
| matches = await flagDependencyEvaluator(prop); | ||
| } else matches = matchProperty(prop, propertyValues); | ||
@@ -635,0 +637,0 @@ const negation = prop.negation || false; |
@@ -1,2 +0,2 @@ | ||
| export declare const version = "5.34.5"; | ||
| export declare const version = "5.34.6"; | ||
| //# sourceMappingURL=version.d.ts.map |
+1
-1
@@ -29,3 +29,3 @@ "use strict"; | ||
| }); | ||
| const version = '5.34.5'; | ||
| const version = '5.34.6'; | ||
| exports.version = __webpack_exports__.version; | ||
@@ -32,0 +32,0 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [ |
+1
-1
@@ -1,2 +0,2 @@ | ||
| const version = '5.34.5'; | ||
| const version = '5.34.6'; | ||
| export { version }; |
+1
-1
| { | ||
| "name": "posthog-node", | ||
| "version": "5.34.5", | ||
| "version": "5.34.6", | ||
| "description": "PostHog Node.js integration", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -12,3 +12,6 @@ import { FeatureFlagCondition, FlagProperty, FlagPropertyValue, PostHogFeatureFlag, PropertyGroup } from '../../types' | ||
| const NULL_VALUES_ALLOWED_OPERATORS = ['is_not'] | ||
| // Operators that should still run their switch case when the property value is null/undefined. | ||
| // `is_not` may legitimately compare against null; `is_set` only cares about key presence and | ||
| // must not be short-circuited by the null guard in `matchProperty`. | ||
| const NULL_VALUES_ALLOWED_OPERATORS = ['is_not', 'is_set'] | ||
| class ClientError extends Error { | ||
@@ -280,2 +283,9 @@ constructor(message: string) { | ||
| // Order matters: an inactive flag is always false regardless of continuity. Checking | ||
| // `ensure_experience_continuity` first would cause a disabled-but-continuity flag to come | ||
| // back as undefined instead of the correct `false`. | ||
| if (!flag.active) { | ||
| return false | ||
| } | ||
| if (flag.ensure_experience_continuity) { | ||
@@ -285,6 +295,2 @@ throw new InconclusiveMatchError('Flag has experience continuity enabled') | ||
| if (!flag.active) { | ||
| return false | ||
| } | ||
| const flagFilters = flag.filters || {} | ||
@@ -585,3 +591,5 @@ const aggregation_group_type_index = flagFilters.aggregation_group_type_index | ||
| if (propertyType === 'cohort') { | ||
| matches = matchCohort(prop, properties, this.cohorts, this.debugMode) | ||
| matches = await matchCohort(prop, properties, this.cohorts, this.debugMode, (depProp) => | ||
| this.evaluateFlagDependency(depProp, properties, evaluationContext) | ||
| ) | ||
| } else if (propertyType === 'flag') { | ||
@@ -1026,5 +1034,10 @@ matches = await this.evaluateFlagDependency(prop, properties, evaluationContext) | ||
| if (!(key in propertyValues)) { | ||
| // When the property is genuinely absent we can answer `is_not_set` locally — no need to | ||
| // bail out as inconclusive and force the flag to return undefined. | ||
| if (operator === 'is_not_set') { | ||
| return true | ||
| } | ||
| throw new InconclusiveMatchError(`Property ${key} not found in propertyValues`) | ||
| } else if (operator === 'is_not_set') { | ||
| throw new InconclusiveMatchError(`Operator is_not_set is not supported`) | ||
| return false | ||
| } | ||
@@ -1083,24 +1096,20 @@ | ||
| case 'lte': { | ||
| // :TRICKY: We adjust comparison based on the override value passed in, | ||
| // to make sure we handle both numeric and string comparisons appropriately. | ||
| let parsedValue = typeof value === 'number' ? value : null | ||
| if (typeof value === 'string') { | ||
| try { | ||
| parsedValue = parseFloat(value) | ||
| } catch (err) { | ||
| // pass | ||
| } | ||
| } | ||
| if (parsedValue != null && overrideValue != null) { | ||
| // check both null and undefined | ||
| if (typeof overrideValue === 'string') { | ||
| return compare(overrideValue, String(value), operator) | ||
| } else { | ||
| return compare(overrideValue, parsedValue, operator) | ||
| } | ||
| // Try a numeric comparison first; only fall back to lexicographic when one side genuinely | ||
| // isn't a number. `parseFloat` returns NaN for non-numeric strings, so `Number.isFinite` | ||
| // is the right guard — `NaN != null` would slip through and produce nonsense comparisons | ||
| // like `NaN > 5`. Likewise, when a person property arrives as the string `"10"` we want | ||
| // `"10" > "9"` to evaluate numerically (true), not lexicographically (false). | ||
| const parsedValue = typeof value === 'number' ? value : parseFloat(String(value)) | ||
| let parsedOverride: number | ||
| if (typeof overrideValue === 'number') { | ||
| parsedOverride = overrideValue | ||
| } else if (overrideValue != null) { | ||
| parsedOverride = parseFloat(String(overrideValue)) | ||
| } else { | ||
| return compare(String(overrideValue), String(value), operator) | ||
| parsedOverride = NaN | ||
| } | ||
| if (Number.isFinite(parsedValue) && Number.isFinite(parsedOverride)) { | ||
| return compare(parsedOverride, parsedValue, operator) | ||
| } | ||
| return compare(String(overrideValue), String(value), operator) | ||
| } | ||
@@ -1180,8 +1189,11 @@ case 'is_date_after': | ||
| function matchCohort( | ||
| type FlagDependencyEvaluator = (prop: FlagProperty) => Promise<boolean> | ||
| async function matchCohort( | ||
| property: FeatureFlagCondition['properties'][number], | ||
| propertyValues: Record<string, any>, | ||
| cohortProperties: FeatureFlagsPoller['cohorts'], | ||
| debugMode: boolean = false | ||
| ): boolean { | ||
| debugMode: boolean = false, | ||
| flagDependencyEvaluator?: FlagDependencyEvaluator | ||
| ): Promise<boolean> { | ||
| const cohortId = String(property.value) | ||
@@ -1191,11 +1203,12 @@ checkCohortExists(cohortId, cohortProperties) | ||
| const propertyGroup = cohortProperties[cohortId] | ||
| return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode) | ||
| return matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator) | ||
| } | ||
| function matchPropertyGroup( | ||
| async function matchPropertyGroup( | ||
| propertyGroup: PropertyGroup, | ||
| propertyValues: Record<string, any>, | ||
| cohortProperties: FeatureFlagsPoller['cohorts'], | ||
| debugMode: boolean = false | ||
| ): boolean { | ||
| debugMode: boolean = false, | ||
| flagDependencyEvaluator?: FlagDependencyEvaluator | ||
| ): Promise<boolean> { | ||
| if (!propertyGroup) { | ||
@@ -1219,3 +1232,9 @@ return true | ||
| try { | ||
| const matches = matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode) | ||
| const matches = await matchPropertyGroup( | ||
| prop, | ||
| propertyValues, | ||
| cohortProperties, | ||
| debugMode, | ||
| flagDependencyEvaluator | ||
| ) | ||
| if (propertyGroupType === 'AND') { | ||
@@ -1256,11 +1275,10 @@ if (!matches) { | ||
| if (prop.type === 'cohort') { | ||
| matches = matchCohort(prop, propertyValues, cohortProperties, debugMode) | ||
| matches = await matchCohort(prop, propertyValues, cohortProperties, debugMode, flagDependencyEvaluator) | ||
| } else if (prop.type === 'flag') { | ||
| if (debugMode) { | ||
| console.warn( | ||
| `[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. ` + | ||
| `Skipping condition with dependency on flag '${prop.key || 'unknown'}'` | ||
| if (!flagDependencyEvaluator) { | ||
| throw new InconclusiveMatchError( | ||
| `Flag dependency '${prop.key || 'unknown'}' cannot be evaluated without a flag dependency evaluator` | ||
| ) | ||
| } | ||
| continue | ||
| matches = await flagDependencyEvaluator(prop) | ||
| } else { | ||
@@ -1267,0 +1285,0 @@ matches = matchProperty(prop, propertyValues) |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export const version = '5.34.5' | ||
| export const version = '5.34.6' |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
640627
0.3%14150
0.18%46
-2.13%