posthog-node
Advanced tools
Comparing version 3.6.0 to 3.6.1
@@ -0,1 +1,5 @@ | ||
## 3.6.1 - 2024-01-26 | ||
1. Remove new relative date operators, combine into regular date operators | ||
# 3.6.0 - 2024-01-18 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "posthog-node", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "PostHog Node.js integration", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -535,9 +535,5 @@ import { createHash } from 'rusha' | ||
case 'is_date_after': | ||
case 'is_date_before': | ||
case 'is_relative_date_before': | ||
case 'is_relative_date_after': { | ||
let parsedDate = null | ||
if (['is_relative_date_before', 'is_relative_date_after'].includes(operator)) { | ||
parsedDate = relativeDateParseForFeatureFlagMatching(String(value)) | ||
} else { | ||
case 'is_date_before': { | ||
let parsedDate = relativeDateParseForFeatureFlagMatching(String(value)) | ||
if (parsedDate == null) { | ||
parsedDate = convertToDateTime(value) | ||
@@ -550,3 +546,3 @@ } | ||
const overrideDate = convertToDateTime(overrideValue) | ||
if (['is_date_before', 'is_relative_date_before'].includes(operator)) { | ||
if (['is_date_before'].includes(operator)) { | ||
return overrideDate < parsedDate | ||
@@ -696,3 +692,3 @@ } | ||
function relativeDateParseForFeatureFlagMatching(value: string): Date | null { | ||
const regex = /^(?<number>[0-9]+)(?<interval>[a-z])$/ | ||
const regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/ | ||
const match = value.match(regex) | ||
@@ -699,0 +695,0 @@ const parsedDt = new Date(new Date().toISOString()) |
@@ -463,3 +463,3 @@ import { version } from '../package.json' | ||
): { allPersonProperties: Record<string, string>; allGroupProperties: Record<string, Record<string, string>> } { | ||
const allPersonProperties = { $current_distinct_id: distinctId, ...(personProperties || {}) } | ||
const allPersonProperties = { distinct_id: distinctId, ...(personProperties || {}) } | ||
@@ -466,0 +466,0 @@ const allGroupProperties: Record<string, Record<string, string>> = {} |
@@ -1038,3 +1038,3 @@ // import { PostHog } from '../' | ||
person_properties: { | ||
$current_distinct_id: 'some_id', | ||
distinct_id: 'some_id', | ||
x1: 'y1', | ||
@@ -1055,3 +1055,3 @@ }, | ||
groups: { company: 'id:5', instance: 'app.posthog.com' }, | ||
personProperties: { $current_distinct_id: 'override' }, | ||
personProperties: { distinct_id: 'override' }, | ||
groupProperties: { company: { $group_key: 'group_override' } }, | ||
@@ -1069,3 +1069,3 @@ }) | ||
person_properties: { | ||
$current_distinct_id: 'override', | ||
distinct_id: 'override', | ||
}, | ||
@@ -1100,3 +1100,3 @@ group_properties: { | ||
person_properties: { | ||
$current_distinct_id: 'some_id', | ||
distinct_id: 'some_id', | ||
}, | ||
@@ -1125,3 +1125,3 @@ group_properties: {}, | ||
person_properties: { | ||
$current_distinct_id: 'some_id', | ||
distinct_id: 'some_id', | ||
}, | ||
@@ -1146,3 +1146,3 @@ group_properties: { company: { $group_key: 'id:5' } }, | ||
person_properties: { | ||
$current_distinct_id: 'some_id', | ||
distinct_id: 'some_id', | ||
}, | ||
@@ -1168,3 +1168,3 @@ group_properties: {}, | ||
person_properties: { | ||
$current_distinct_id: 'some_id', | ||
distinct_id: 'some_id', | ||
}, | ||
@@ -1171,0 +1171,0 @@ group_properties: {}, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
983961
13776