posthog-node 6.2.3 → 6.4.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/MIGRATION.md +4 -2
- package/dist/capture-lane/ai-content-removal.d.ts +8 -0
- package/dist/capture-lane/ai-content-removal.d.ts.map +1 -0
- package/dist/capture-lane/ai-content-removal.js +68 -0
- package/dist/capture-lane/ai-content-removal.mjs +26 -0
- package/dist/capture-lane/lane.d.ts +5 -0
- package/dist/capture-lane/lane.d.ts.map +1 -1
- package/dist/capture-lane/lane.js +22 -4
- package/dist/capture-lane/lane.mjs +22 -4
- package/dist/client.d.ts +14 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +58 -13
- package/dist/client.mjs +59 -14
- package/dist/emails/emails.d.ts.map +1 -1
- package/dist/emails/emails.js +28 -3
- package/dist/emails/emails.mjs +29 -4
- package/dist/emails/types.d.ts +41 -0
- package/dist/emails/types.d.ts.map +1 -1
- package/dist/extensions/feature-flags/feature-flags-v2.d.ts +4 -0
- package/dist/extensions/feature-flags/feature-flags-v2.d.ts.map +1 -1
- package/dist/extensions/feature-flags/feature-flags-v2.js +5 -3
- package/dist/extensions/feature-flags/feature-flags-v2.mjs +5 -3
- package/dist/extensions/feature-flags/feature-flags.d.ts +14 -3
- package/dist/extensions/feature-flags/feature-flags.d.ts.map +1 -1
- package/dist/extensions/feature-flags/feature-flags.js +130 -41
- package/dist/extensions/feature-flags/feature-flags.mjs +128 -42
- package/dist/types.d.ts +45 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +4 -4
- package/src/capture-lane/ai-content-removal.ts +40 -0
- package/src/capture-lane/lane.ts +40 -3
- package/src/client.ts +122 -16
- package/src/emails/emails.ts +40 -5
- package/src/emails/types.ts +41 -0
- package/src/extensions/feature-flags/feature-flags-v2.ts +16 -5
- package/src/extensions/feature-flags/feature-flags.ts +340 -63
- package/src/types.ts +45 -1
- package/src/version.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -70,6 +70,22 @@ export type SendFeatureFlagsOptions = {
|
|
|
70
70
|
personProperties?: Properties
|
|
71
71
|
/** Group properties keyed by group type for evaluating group-targeted flags. */
|
|
72
72
|
groupProperties?: Record<string, Properties>
|
|
73
|
+
/**
|
|
74
|
+
* Person property keys you know this person doesn't have. Local evaluation treats a listed key as
|
|
75
|
+
* absent even when `personProperties` has a value for it, so `is_not_set` and the negated
|
|
76
|
+
* operators match and every other supported operator doesn't, without a `/flags` request. A filter
|
|
77
|
+
* with an operator the SDK can't evaluate locally, or with an operator that needs a value but has
|
|
78
|
+
* none, still falls back to `/flags`.
|
|
79
|
+
* The list is sent to `/flags` when evaluation falls back to it. At most 1000 keys, counting
|
|
80
|
+
* duplicates; with a longer list no flags are evaluated and the event is sent without flag properties.
|
|
81
|
+
*/
|
|
82
|
+
personPropertyKeysKnownAbsent?: string[]
|
|
83
|
+
/**
|
|
84
|
+
* Group property keys you know each group doesn't have, by group type name. A key applies only to
|
|
85
|
+
* its own group type. Otherwise follows `personPropertyKeysKnownAbsent`, with the 1000-key limit
|
|
86
|
+
* applying to each group type's list.
|
|
87
|
+
*/
|
|
88
|
+
groupPropertyKeysKnownAbsent?: Record<string, string[]>
|
|
73
89
|
/** Restrict evaluation to these flag keys. */
|
|
74
90
|
flagKeys?: string[]
|
|
75
91
|
}
|
|
@@ -213,6 +229,22 @@ export type BaseFlagEvaluationOptions = {
|
|
|
213
229
|
personProperties?: Properties
|
|
214
230
|
/** Group properties keyed by group type for evaluating group-targeted flags. */
|
|
215
231
|
groupProperties?: Record<string, Properties>
|
|
232
|
+
/**
|
|
233
|
+
* Person property keys you know this person doesn't have. Local evaluation treats a listed key as
|
|
234
|
+
* absent even when `personProperties` has a value for it, so `is_not_set` and the negated
|
|
235
|
+
* operators match and every other supported operator doesn't, without a `/flags` request. A filter
|
|
236
|
+
* with an operator the SDK can't evaluate locally, or with an operator that needs a value but has
|
|
237
|
+
* none, still falls back to `/flags`.
|
|
238
|
+
* The list is sent to `/flags` when evaluation falls back to it. At most 1000 keys, counting
|
|
239
|
+
* duplicates; a longer list throws an error and no flags are evaluated.
|
|
240
|
+
*/
|
|
241
|
+
personPropertyKeysKnownAbsent?: string[]
|
|
242
|
+
/**
|
|
243
|
+
* Group property keys you know each group doesn't have, by group type name. A key applies only to
|
|
244
|
+
* its own group type. Otherwise follows `personPropertyKeysKnownAbsent`, with the 1000-key limit
|
|
245
|
+
* applying to each group type's list.
|
|
246
|
+
*/
|
|
247
|
+
groupPropertyKeysKnownAbsent?: Record<string, string[]>
|
|
216
248
|
/** Skip remote fallback and omit flags that local definitions cannot resolve. */
|
|
217
249
|
onlyEvaluateLocally?: boolean
|
|
218
250
|
/** Overrides the client's `disableGeoip` setting for this evaluation call. */
|
|
@@ -877,7 +909,7 @@ export interface IPostHog {
|
|
|
877
909
|
/**
|
|
878
910
|
* Capture an AI event on the dedicated AI capture endpoint (`/i/v1/ai/events`).
|
|
879
911
|
*
|
|
880
|
-
* Beta: the signature is stable, while operational limits (per-event size cap, batching, endpoint) may change without notice. Delivery is async
|
|
912
|
+
* Beta: the signature is stable, while operational limits (per-event size cap, batching, endpoint) may change without notice. Delivery is async. The payload is sent as given, except that an event whose properties exceed the per-event size cap is sent without its content properties.
|
|
881
913
|
*
|
|
882
914
|
* @param props - AI event payload including `event`, optional `distinctId`, `properties`, `groups`, `flags`, and `options`
|
|
883
915
|
* @returns The event UUID, or `undefined` when the client is disabled
|
|
@@ -950,6 +982,8 @@ export interface IPostHog {
|
|
|
950
982
|
* @param groups optional - what groups are currently active (group analytics). Required if the flag depends on groups.
|
|
951
983
|
* @param personProperties optional - what person properties are known. Used to compute flags locally when definitions are available.
|
|
952
984
|
* @param groupProperties optional - what group properties are known. Used to compute flags locally when definitions are available.
|
|
985
|
+
* @param personPropertyKeysKnownAbsent optional - person property keys known to be absent. See {@link BaseFlagEvaluationOptions}.
|
|
986
|
+
* @param groupPropertyKeysKnownAbsent optional - group property keys known to be absent, by group type. See {@link BaseFlagEvaluationOptions}.
|
|
953
987
|
* @param onlyEvaluateLocally optional - whether to only evaluate the flag locally. Defaults to false.
|
|
954
988
|
* @param sendFeatureFlagEvents optional - whether to send feature flag events. Used for Experiments. Defaults to true.
|
|
955
989
|
*
|
|
@@ -965,6 +999,8 @@ export interface IPostHog {
|
|
|
965
999
|
groups?: Record<string, string>
|
|
966
1000
|
personProperties?: Properties
|
|
967
1001
|
groupProperties?: Record<string, Properties>
|
|
1002
|
+
personPropertyKeysKnownAbsent?: string[]
|
|
1003
|
+
groupPropertyKeysKnownAbsent?: Record<string, string[]>
|
|
968
1004
|
onlyEvaluateLocally?: boolean
|
|
969
1005
|
sendFeatureFlagEvents?: boolean
|
|
970
1006
|
}
|
|
@@ -981,6 +1017,8 @@ export interface IPostHog {
|
|
|
981
1017
|
* @param groups optional - what groups are currently active (group analytics). Required if the flag depends on groups.
|
|
982
1018
|
* @param personProperties optional - what person properties are known. Used to compute flags locally when definitions are available.
|
|
983
1019
|
* @param groupProperties optional - what group properties are known. Used to compute flags locally when definitions are available.
|
|
1020
|
+
* @param personPropertyKeysKnownAbsent optional - person property keys known to be absent. See {@link BaseFlagEvaluationOptions}.
|
|
1021
|
+
* @param groupPropertyKeysKnownAbsent optional - group property keys known to be absent, by group type. See {@link BaseFlagEvaluationOptions}.
|
|
984
1022
|
* @param onlyEvaluateLocally optional - whether to only evaluate the flag locally. Defaults to false.
|
|
985
1023
|
* @param sendFeatureFlagEvents optional - whether to send feature flag events. Used for Experiments. Defaults to true.
|
|
986
1024
|
*
|
|
@@ -996,6 +1034,8 @@ export interface IPostHog {
|
|
|
996
1034
|
groups?: Record<string, string>
|
|
997
1035
|
personProperties?: Properties
|
|
998
1036
|
groupProperties?: Record<string, Properties>
|
|
1037
|
+
personPropertyKeysKnownAbsent?: string[]
|
|
1038
|
+
groupPropertyKeysKnownAbsent?: Record<string, string[]>
|
|
999
1039
|
onlyEvaluateLocally?: boolean
|
|
1000
1040
|
sendFeatureFlagEvents?: boolean
|
|
1001
1041
|
}
|
|
@@ -1023,6 +1063,8 @@ export interface IPostHog {
|
|
|
1023
1063
|
* @param matchValue The flag value previously obtained from calling `getFeatureFlag()`. Can be a string or boolean.
|
|
1024
1064
|
* To avoid extra network calls, pass this parameter when you can.
|
|
1025
1065
|
* @param options: dict with optional parameters below
|
|
1066
|
+
* @param personPropertyKeysKnownAbsent optional - person property keys known to be absent. See {@link BaseFlagEvaluationOptions}.
|
|
1067
|
+
* @param groupPropertyKeysKnownAbsent optional - group property keys known to be absent, by group type. See {@link BaseFlagEvaluationOptions}.
|
|
1026
1068
|
* @param onlyEvaluateLocally optional - whether to only evaluate the flag locally. Defaults to false.
|
|
1027
1069
|
*
|
|
1028
1070
|
* @returns payload of a json type object
|
|
@@ -1035,6 +1077,8 @@ export interface IPostHog {
|
|
|
1035
1077
|
distinctId: string,
|
|
1036
1078
|
matchValue?: FeatureFlagValue,
|
|
1037
1079
|
options?: {
|
|
1080
|
+
personPropertyKeysKnownAbsent?: string[]
|
|
1081
|
+
groupPropertyKeysKnownAbsent?: Record<string, string[]>
|
|
1038
1082
|
onlyEvaluateLocally?: boolean
|
|
1039
1083
|
}
|
|
1040
1084
|
): Promise<JsonType | undefined>
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "6.
|
|
1
|
+
export const version = "6.4.0"
|