posthog-node 6.3.0 → 6.4.1

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.
Files changed (36) hide show
  1. package/MIGRATION.md +3 -1
  2. package/dist/client.d.ts +14 -8
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +55 -12
  5. package/dist/client.mjs +56 -13
  6. package/dist/emails/emails.d.ts +3 -3
  7. package/dist/emails/emails.d.ts.map +1 -1
  8. package/dist/emails/emails.js +29 -9
  9. package/dist/emails/emails.mjs +30 -10
  10. package/dist/emails/types.d.ts +42 -15
  11. package/dist/emails/types.d.ts.map +1 -1
  12. package/dist/extensions/feature-flags/feature-flags-v2.d.ts +4 -0
  13. package/dist/extensions/feature-flags/feature-flags-v2.d.ts.map +1 -1
  14. package/dist/extensions/feature-flags/feature-flags-v2.js +5 -3
  15. package/dist/extensions/feature-flags/feature-flags-v2.mjs +5 -3
  16. package/dist/extensions/feature-flags/feature-flags.d.ts +14 -3
  17. package/dist/extensions/feature-flags/feature-flags.d.ts.map +1 -1
  18. package/dist/extensions/feature-flags/feature-flags.js +130 -41
  19. package/dist/extensions/feature-flags/feature-flags.mjs +128 -42
  20. package/dist/extensions/nestjs.d.ts.map +1 -1
  21. package/dist/extensions/nestjs.js +1 -0
  22. package/dist/extensions/nestjs.mjs +1 -0
  23. package/dist/types.d.ts +46 -2
  24. package/dist/types.d.ts.map +1 -1
  25. package/dist/version.d.ts +1 -1
  26. package/dist/version.js +1 -1
  27. package/dist/version.mjs +1 -1
  28. package/package.json +3 -3
  29. package/src/client.ts +116 -18
  30. package/src/emails/emails.ts +44 -14
  31. package/src/emails/types.ts +42 -15
  32. package/src/extensions/feature-flags/feature-flags-v2.ts +16 -5
  33. package/src/extensions/feature-flags/feature-flags.ts +340 -63
  34. package/src/extensions/nestjs.ts +12 -0
  35. package/src/types.ts +46 -2
  36. package/src/version.ts +1 -1
package/MIGRATION.md CHANGED
@@ -72,7 +72,7 @@ If you send events through your own reverse proxy, update it before you upgrade:
72
72
  - **Strip other values.** Strip any other `Authorization` value, such as session tokens your app adds to its own requests. See the [proxy reference](https://posthog.com/docs/advanced/proxy/proxy-reference).
73
73
  - **Pass the other headers through.** Pass every `PostHog-*` header, `Content-Type`, `Content-Encoding`, and `User-Agent` through unchanged. PostHog answers `400` without them, and the batch fails.
74
74
  - **Accept request bodies up to 20 MB.** AI requests are often larger than 1 MB, the default limit in nginx and ingress-nginx.
75
- - **Pass the capture response through.** A proxy that answers the capture path with its own `200` loses the batch. See unreadable `2xx` responses in [Update error handling](#update-error-handling).
75
+ - **Pass the capture response through.** Return PostHog's status code, `Retry-After` header, and response body unchanged. `Retry-After` sets the minimum wait before the SDK resends events, up to a cap. A proxy that answers the capture path with its own `200` loses the batch. See unreadable `2xx` responses in [Update error handling](#update-error-handling).
76
76
 
77
77
  5.x.x halved a batch and retried it when it got a `413`. 6.x.x doesn't split batches. A `413` fails the whole batch, and the events are lost.
78
78
 
@@ -496,6 +496,8 @@ Legacy option properties still work, but an option overrides its legacy property
496
496
  | `$cookieless_mode` | `cookieless_mode` |
497
497
  | `$ignore_sent_at` | `disable_skew_correction` |
498
498
 
499
+ An event without person processing doesn't update a person profile. If its distinct ID already belongs to a person, PostHog still links it to that person and, unless PostHog has turned off person processing for your project, bills it as an identified event. See [anonymous vs identified events](https://posthog.com/docs/data/anonymous-vs-identified-events).
500
+
499
501
  ### Send AI events with captureAi
500
502
 
501
503
  Send `$ai_` events with `captureAi()` or `captureAiImmediate()`, not `capture()`. Only these methods use the AI endpoint, and `@posthog/ai` on posthog-node 6.x.x already uses them.
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FeatureFlagValue, JsonType, PostHogCaptureOptions, PostHogCoreStateless, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogFeatureFlagsResponse, PostHogFlagsAndPayloadsResponse, PostHogPersistedProperty, type CaptureLogger, type CaptureLogOptions, Properties } from '@posthog/core';
2
- import type { Metrics, PostHogFeatureFlagDetails, Span, SpanContextManager, StartSpanOptions } from '@posthog/core';
2
+ import type { Metrics, PostHogFeatureFlagDetails, Span, SpanContextManager, StartSpanOptions, PostHogFlagsKnownAbsentPropertyKeys } from '@posthog/core';
3
3
  import { AllFlagsOptions, CaptureExceptionOptions, EventMessage, EventOptions, FeatureFlagEvaluationRuntime, FeatureFlagResult, FlagEvaluationOptions, GroupIdentifyMessage, IdentifyMessage, IPostHog, OverrideFeatureFlagsOptions, PostHogOptions, PreparedEventMessage, SetPersonPropertiesMessage, UnsetPersonPropertiesMessage } from './types';
4
4
  import { FeatureFlagEvaluations, FlagCalledEventParams } from './feature-flag-evaluations';
5
5
  import ErrorTracking from './extensions/error-tracking';
@@ -289,8 +289,7 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
289
289
  */
290
290
  get logger(): CaptureLogger;
291
291
  /**
292
- * Send transactional email from PostHog templates, or transactional and marketing email from inline code, read send
293
- * status, and update topic preferences.
292
+ * Send transactional email from PostHog templates or inline code, read send status, and update topic preferences.
294
293
  *
295
294
  * - **Credentials and scopes.** Needs `secretKey` (`phs_...`). `send` needs `transactional_email:write`, `get` needs `transactional_email:read` or `transactional_email:write`, `setPreferences` needs `messaging_preference:write`, and `hog_flow:write` keys cover all three. Set `enableLocalEvaluation: false` when the key is only for email.
296
295
  * - **Routing and retries.** Requests go to `appHost`, or the PostHog Cloud app host for `host`. Configure `emailRequestTimeoutMs` and `emailRequestMaxRetries` per client.
@@ -302,17 +301,18 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
302
301
  * const client = new PostHog('phc_...', { secretKey: 'phs_...', host: 'https://eu.i.posthog.com' })
303
302
  * const { data, error } = await client.emails.send({
304
303
  * to: 'user@example.com',
305
- * templateId: '0190f6d2-7c1e-7b3a-9f5e-1c2d3e4f5a6b',
306
- * templateData: { name: 'Ada' },
304
+ * templateKey: 'welcome',
305
+ * subject: 'Welcome to Acme',
306
+ * html: '<p>Hi Ada, welcome to Acme.</p>',
307
307
  * distinctId: 'user_123',
308
308
  * idempotencyKey: 'welcome:user_123',
309
309
  * })
310
310
  * if (error) {
311
311
  * console.error(error.code, error.message)
312
+ * } else {
313
+ * const status = await client.emails.get(data.id) // later, for example from a job
312
314
  * }
313
315
  *
314
- * const status = await client.emails.get(data.id) // later, for example from a job
315
- *
316
316
  * // From a preference center: opt out of one topic, keep the rest
317
317
  * await client.emails.setPreferences({ to: 'user@example.com', topics: { newsletter: false } })
318
318
  * ```
@@ -960,7 +960,7 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
960
960
  * an array) like a failed request. Every remote flag read goes through this method, so callers
961
961
  * get the same fallback, `$feature_flag_error` and `error` event as for a failed request instead of a `TypeError`.
962
962
  */
963
- protected getFeatureFlagDetailsStateless(distinctId: string, groups?: Record<string, string | number>, personProperties?: Record<string, string>, groupProperties?: Record<string, Record<string, string>>, disableGeoip?: boolean, flagKeysToEvaluate?: string[]): Promise<PostHogFeatureFlagDetails | undefined>;
963
+ protected getFeatureFlagDetailsStateless(distinctId: string, groups?: Record<string, string | number>, personProperties?: Record<string, string>, groupProperties?: Record<string, Record<string, string>>, disableGeoip?: boolean, flagKeysToEvaluate?: string[], knownAbsentPropertyKeys?: PostHogFlagsKnownAbsentPropertyKeys): Promise<PostHogFeatureFlagDetails | undefined>;
964
964
  /**
965
965
  * Internal method that handles feature flag evaluation with full details.
966
966
  * Used by getFeatureFlag, getFeatureFlagPayload, and getFeatureFlagResult.
@@ -1027,6 +1027,8 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
1027
1027
  groups?: Record<string, string>;
1028
1028
  personProperties?: Properties;
1029
1029
  groupProperties?: Record<string, Properties>;
1030
+ personPropertyKeysKnownAbsent?: string[];
1031
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>;
1030
1032
  onlyEvaluateLocally?: boolean;
1031
1033
  sendFeatureFlagEvents?: boolean;
1032
1034
  disableGeoip?: boolean;
@@ -1074,6 +1076,8 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
1074
1076
  groups?: Record<string, string>;
1075
1077
  personProperties?: Properties;
1076
1078
  groupProperties?: Record<string, Properties>;
1079
+ personPropertyKeysKnownAbsent?: string[];
1080
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>;
1077
1081
  onlyEvaluateLocally?: boolean;
1078
1082
  /** @deprecated THIS OPTION HAS NO EFFECT, kept here for backwards compatibility reasons. */
1079
1083
  sendFeatureFlagEvents?: boolean;
@@ -1179,6 +1183,8 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
1179
1183
  groups?: Record<string, string>;
1180
1184
  personProperties?: Properties;
1181
1185
  groupProperties?: Record<string, Properties>;
1186
+ personPropertyKeysKnownAbsent?: string[];
1187
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>;
1182
1188
  onlyEvaluateLocally?: boolean;
1183
1189
  sendFeatureFlagEvents?: boolean;
1184
1190
  disableGeoip?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,gBAAgB,EAGhB,QAAQ,EAER,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAG/B,wBAAwB,EAGxB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEtB,UAAU,EAOX,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EACV,OAAO,EACP,yBAAyB,EACzB,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,YAAY,EAGZ,4BAA4B,EAE5B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,2BAA2B,EAC3B,cAAc,EACd,oBAAoB,EAEpB,0BAA0B,EAC1B,4BAA4B,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E,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,CAAC,CAcnF;IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,IAAI,WAAW,GAAG,SAAS,CAEpC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACM,QAAQ,CAAC,iBAAiB,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;IAED;;;;;OAKG;IACG,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFzD;IAED,OAAO,CAAC,kBAAkB;YAIZ,2BAA2B;IAqCzC,OAAO,CAAC,0BAA0B;YA+BpB,uBAAuB;IAsFrC,OAAO,CAAC,gCAAgC;IA4BxC,OAAO,CAAC,kCAAkC;IAI1C,OAAO,CAAC,kCAAkC;IAkB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAazE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;YAW7E,oBAAoB;IAiBlC;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;IAK9B,yFAAyF;IACzF,OAAO,CAAC,mBAAmB;IAY3B;;;;;;;;;;;;;;;;;;OAkBG;IACU,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAMnF;IAED;;;;;OAKG;YACW,oBAAoB;IA0IlC,OAAO,CAAC,cAAc;CAgCvB"}
package/dist/client.js CHANGED
@@ -248,6 +248,34 @@ function buildFlagEventProperties(flagValues) {
248
248
  if (activeFlags.length > 0) additionalProperties['$active_feature_flags'] = activeFlags;
249
249
  return additionalProperties;
250
250
  }
251
+ const MAX_KNOWN_ABSENT_PROPERTY_KEYS = 1000;
252
+ const PERSON_METADATA_KEY_PREFIX = '__posthog_person_metadata__';
253
+ function readKnownAbsentPropertyKeys(options) {
254
+ const personPropertyKeysKnownAbsent = options.personPropertyKeysKnownAbsent?.slice();
255
+ const groupPropertyKeysKnownAbsent = options.groupPropertyKeysKnownAbsent ? Object.fromEntries(Object.entries(options.groupPropertyKeysKnownAbsent).filter(([, keys])=>void 0 !== keys).map(([groupType, keys])=>[
256
+ groupType,
257
+ keys.slice()
258
+ ])) : void 0;
259
+ const result = {
260
+ request: {
261
+ personPropertyKeysKnownAbsent,
262
+ groupPropertyKeysKnownAbsent
263
+ }
264
+ };
265
+ if (personPropertyKeysKnownAbsent) {
266
+ if (personPropertyKeysKnownAbsent.length > MAX_KNOWN_ABSENT_PROPERTY_KEYS) throw new Error(`personPropertyKeysKnownAbsent allows at most ${MAX_KNOWN_ABSENT_PROPERTY_KEYS} keys`);
267
+ result.person = new Set(personPropertyKeysKnownAbsent.filter((key)=>!key.startsWith(PERSON_METADATA_KEY_PREFIX)));
268
+ }
269
+ if (groupPropertyKeysKnownAbsent) {
270
+ const groups = Object.create(null);
271
+ for (const [groupType, keys] of Object.entries(groupPropertyKeysKnownAbsent)){
272
+ if (keys.length > MAX_KNOWN_ABSENT_PROPERTY_KEYS) throw new Error(`groupPropertyKeysKnownAbsent allows at most ${MAX_KNOWN_ABSENT_PROPERTY_KEYS} keys per group type`);
273
+ groups[groupType] = new Set(keys);
274
+ }
275
+ result.groups = groups;
276
+ }
277
+ return result;
278
+ }
251
279
  class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
252
280
  get distinctIdHasSentFlagCalls() {
253
281
  return Object.fromEntries(this._distinctIdHasSentFlagCalls);
@@ -893,8 +921,8 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
893
921
  options: distinctIdOrOptions
894
922
  };
895
923
  }
896
- async getFeatureFlagDetailsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate) {
897
- const details = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate);
924
+ async getFeatureFlagDetailsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate, knownAbsentPropertyKeys) {
925
+ const details = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate, knownAbsentPropertyKeys);
898
926
  if (void 0 !== details && !(0, core_namespaceObject.isPlainObject)(details.flags)) {
899
927
  const message = '/flags response has a non-object `flags` field, treating it as a failed request';
900
928
  this._logger.warn(`[FEATURE FLAGS] ${message}`);
@@ -905,6 +933,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
905
933
  }
906
934
  async _getFeatureFlagResult(key, distinctId, options = {}, matchValue) {
907
935
  if (this.disabled) return void this._logger.warn('The client is disabled');
936
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys(options);
908
937
  const sendFeatureFlagEvents = options.sendFeatureFlagEvents ?? true;
909
938
  if (void 0 !== this._flagOverrides && key in this._flagOverrides) {
910
939
  const overrideValue = this._flagOverrides[key];
@@ -922,7 +951,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
922
951
  const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
923
952
  personProperties = adjustedProperties.allPersonProperties;
924
953
  groupProperties = adjustedProperties.allGroupProperties;
925
- const evaluationContext = this.createFeatureFlagEvaluationContext(distinctId, groups, this.personPropertiesForLocalEvaluation(distinctId, personProperties), groupProperties);
954
+ const evaluationContext = this.createFeatureFlagEvaluationContext(distinctId, groups, this.personPropertiesForLocalEvaluation(distinctId, personProperties), groupProperties, knownAbsentPropertyKeys);
926
955
  if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
927
956
  let result;
928
957
  let flagWasLocallyEvaluated = false;
@@ -972,7 +1001,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
972
1001
  if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
973
1002
  const flagsResponse = await this.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, [
974
1003
  key
975
- ]);
1004
+ ], knownAbsentPropertyKeys.request);
976
1005
  if (void 0 === flagsResponse) featureFlagError = external_types_js_namespaceObject.FeatureFlagError.UNKNOWN_ERROR;
977
1006
  else {
978
1007
  this._minimalFlagCalledEvents = true === flagsResponse.minimalFlagCalledEvents;
@@ -1139,10 +1168,11 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1139
1168
  }
1140
1169
  const { groups, disableGeoip, flagKeys } = resolvedOptions || {};
1141
1170
  let { onlyEvaluateLocally, personProperties, groupProperties } = resolvedOptions || {};
1171
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys(resolvedOptions || {});
1142
1172
  const adjustedProperties = this.addLocalPersonAndGroupProperties(resolvedDistinctId, groups, personProperties, groupProperties);
1143
1173
  personProperties = adjustedProperties.allPersonProperties;
1144
1174
  groupProperties = adjustedProperties.allGroupProperties;
1145
- const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties);
1175
+ const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties, knownAbsentPropertyKeys);
1146
1176
  if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
1147
1177
  const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(evaluationContext, flagKeys);
1148
1178
  let featureFlags = {};
@@ -1154,7 +1184,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1154
1184
  fallbackToFlags = localEvaluationResult.fallbackToFlags;
1155
1185
  }
1156
1186
  if (fallbackToFlags && !onlyEvaluateLocally) {
1157
- const remoteEvaluationResult = await super.getFeatureFlagsAndPayloadsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys);
1187
+ const remoteEvaluationResult = await super.getFeatureFlagsAndPayloadsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys, knownAbsentPropertyKeys.request);
1158
1188
  featureFlags = {
1159
1189
  ...featureFlags,
1160
1190
  ...remoteEvaluationResult.flags || {}
@@ -1197,6 +1227,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1197
1227
  }
1198
1228
  const { groups, disableGeoip } = resolvedOptions || {};
1199
1229
  const flagKeys = resolvedOptions?.flagKeys ?? void 0;
1230
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys(resolvedOptions || {});
1200
1231
  if (flagKeys?.length === 0) return new external_feature_flag_evaluations_js_namespaceObject.FeatureFlagEvaluations({
1201
1232
  host: this._getFeatureFlagEvaluationsHost(),
1202
1233
  distinctId: resolvedDistinctId,
@@ -1208,7 +1239,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1208
1239
  const adjustedProperties = this.addLocalPersonAndGroupProperties(resolvedDistinctId, groups, personProperties, groupProperties);
1209
1240
  personProperties = adjustedProperties.allPersonProperties;
1210
1241
  groupProperties = adjustedProperties.allGroupProperties;
1211
- const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties);
1242
+ const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties, knownAbsentPropertyKeys);
1212
1243
  if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
1213
1244
  const requestedFlagKeys = flagKeys ? new Set(flagKeys) : void 0;
1214
1245
  const records = {};
@@ -1240,7 +1271,7 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1240
1271
  const requestedFlagMissingLocally = void 0 !== requestedFlagKeys && Array.from(requestedFlagKeys).some((key)=>this.featureFlagsPoller?.featureFlagsByKey[key] === void 0);
1241
1272
  const fallbackToFlags = localResult ? localResult.fallbackToFlags || requestedFlagMissingLocally : true;
1242
1273
  if (fallbackToFlags && !onlyEvaluateLocally) {
1243
- const details = await this.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys);
1274
+ const details = await this.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys, knownAbsentPropertyKeys.request);
1244
1275
  if (details) {
1245
1276
  this._minimalFlagCalledEvents = true === details.minimalFlagCalledEvents;
1246
1277
  requestId = details.requestId;
@@ -1618,15 +1649,22 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1618
1649
  const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};
1619
1650
  const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};
1620
1651
  const flagKeys = sendFeatureFlagsOptions?.flagKeys;
1652
+ const { personPropertyKeysKnownAbsent, groupPropertyKeysKnownAbsent } = sendFeatureFlagsOptions || {};
1653
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys({
1654
+ personPropertyKeysKnownAbsent,
1655
+ groupPropertyKeysKnownAbsent
1656
+ });
1621
1657
  const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;
1622
1658
  if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};
1623
1659
  else {
1624
1660
  const groupsWithStringValues = {};
1625
- for (const [key, value] of Object.entries(groups || {}))groupsWithStringValues[key] = String(value);
1661
+ for (const [key, value] of Object.entries(groups || {}))if ((0, feature_flags_js_namespaceObject.isUsableGroupKey)(value)) groupsWithStringValues[key] = String(value);
1626
1662
  return await this.getAllFlags(distinctId, {
1627
1663
  groups: groupsWithStringValues,
1628
1664
  personProperties: finalPersonProperties,
1629
1665
  groupProperties: finalGroupProperties,
1666
+ personPropertyKeysKnownAbsent,
1667
+ groupPropertyKeysKnownAbsent,
1630
1668
  disableGeoip,
1631
1669
  onlyEvaluateLocally: true,
1632
1670
  flagKeys
@@ -1634,23 +1672,26 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1634
1672
  }
1635
1673
  if ((this.featureFlagsPoller?.featureFlags?.length || 0) > 0) {
1636
1674
  const groupsWithStringValues = {};
1637
- for (const [key, value] of Object.entries(groups || {}))groupsWithStringValues[key] = String(value);
1675
+ for (const [key, value] of Object.entries(groups || {}))if ((0, feature_flags_js_namespaceObject.isUsableGroupKey)(value)) groupsWithStringValues[key] = String(value);
1638
1676
  return await this.getAllFlags(distinctId, {
1639
1677
  groups: groupsWithStringValues,
1640
1678
  personProperties: finalPersonProperties,
1641
1679
  groupProperties: finalGroupProperties,
1680
+ personPropertyKeysKnownAbsent,
1681
+ groupPropertyKeysKnownAbsent,
1642
1682
  disableGeoip,
1643
1683
  onlyEvaluateLocally: true,
1644
1684
  flagKeys
1645
1685
  });
1646
1686
  }
1647
- return (await super.getFeatureFlagsStateless(distinctId, groups, finalPersonProperties, finalGroupProperties, disableGeoip)).flags;
1687
+ return (await super.getFeatureFlagsStateless(distinctId, groups, finalPersonProperties, finalGroupProperties, disableGeoip, void 0, knownAbsentPropertyKeys.request)).flags;
1648
1688
  }
1649
1689
  addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties) {
1650
1690
  const allPersonProperties = {
1651
1691
  ...personProperties || {}
1652
1692
  };
1653
1693
  const allGroupProperties = {};
1694
+ for (const [groupName, properties] of Object.entries(groupProperties || {}))if (null != properties) allGroupProperties[groupName] = properties;
1654
1695
  if (groups) for (const groupName of Object.keys(groups))allGroupProperties[groupName] = {
1655
1696
  $group_key: groups[groupName],
1656
1697
  ...groupProperties?.[groupName] || {}
@@ -1666,12 +1707,14 @@ class PostHogBackendClient extends core_namespaceObject.PostHogCoreStateless {
1666
1707
  ...personProperties || {}
1667
1708
  };
1668
1709
  }
1669
- createFeatureFlagEvaluationContext(distinctId, groups, personProperties, groupProperties) {
1710
+ createFeatureFlagEvaluationContext(distinctId, groups, personProperties, groupProperties, knownAbsentPropertyKeys) {
1670
1711
  return {
1671
1712
  distinctId,
1672
1713
  groups: groups || {},
1673
1714
  personProperties: personProperties || {},
1674
1715
  groupProperties: groupProperties || {},
1716
+ personPropertyKeysKnownAbsent: knownAbsentPropertyKeys?.person,
1717
+ groupPropertyKeysKnownAbsent: knownAbsentPropertyKeys?.groups,
1675
1718
  evaluationCache: {}
1676
1719
  };
1677
1720
  }
package/dist/client.mjs CHANGED
@@ -4,7 +4,7 @@ import { FeatureFlagError } from "./types.mjs";
4
4
  import { FeatureFlagEvaluations } from "./feature-flag-evaluations.mjs";
5
5
  import { FLAGS_RESPONSE_WITHOUT_TYPED_VALUES_MESSAGE, isServerFailedFlagRecord, isUnreadableFlagRecord, parsedFlagRecordOf, readFlagRecords } from "./flags-response.mjs";
6
6
  import { applyFlagEventCapture, buildConfigVersion2FlagEvents, minimizeConfigVersion2FlagCalledProperties } from "./flag-events.mjs";
7
- import { FeatureFlagsPoller, InconclusiveMatchError, RequiresServerEvaluation } from "./extensions/feature-flags/feature-flags.mjs";
7
+ import { FeatureFlagsPoller, InconclusiveMatchError, RequiresServerEvaluation, isUsableGroupKey } from "./extensions/feature-flags/feature-flags.mjs";
8
8
  import error_tracking from "./extensions/error-tracking/index.mjs";
9
9
  import { getActiveTraceProperties } from "./extensions/error-tracking/trace-context.mjs";
10
10
  import { PostHogMemoryStorage } from "./storage-memory.mjs";
@@ -205,6 +205,34 @@ function buildFlagEventProperties(flagValues) {
205
205
  if (activeFlags.length > 0) additionalProperties['$active_feature_flags'] = activeFlags;
206
206
  return additionalProperties;
207
207
  }
208
+ const MAX_KNOWN_ABSENT_PROPERTY_KEYS = 1000;
209
+ const PERSON_METADATA_KEY_PREFIX = '__posthog_person_metadata__';
210
+ function readKnownAbsentPropertyKeys(options) {
211
+ const personPropertyKeysKnownAbsent = options.personPropertyKeysKnownAbsent?.slice();
212
+ const groupPropertyKeysKnownAbsent = options.groupPropertyKeysKnownAbsent ? Object.fromEntries(Object.entries(options.groupPropertyKeysKnownAbsent).filter(([, keys])=>void 0 !== keys).map(([groupType, keys])=>[
213
+ groupType,
214
+ keys.slice()
215
+ ])) : void 0;
216
+ const result = {
217
+ request: {
218
+ personPropertyKeysKnownAbsent,
219
+ groupPropertyKeysKnownAbsent
220
+ }
221
+ };
222
+ if (personPropertyKeysKnownAbsent) {
223
+ if (personPropertyKeysKnownAbsent.length > MAX_KNOWN_ABSENT_PROPERTY_KEYS) throw new Error(`personPropertyKeysKnownAbsent allows at most ${MAX_KNOWN_ABSENT_PROPERTY_KEYS} keys`);
224
+ result.person = new Set(personPropertyKeysKnownAbsent.filter((key)=>!key.startsWith(PERSON_METADATA_KEY_PREFIX)));
225
+ }
226
+ if (groupPropertyKeysKnownAbsent) {
227
+ const groups = Object.create(null);
228
+ for (const [groupType, keys] of Object.entries(groupPropertyKeysKnownAbsent)){
229
+ if (keys.length > MAX_KNOWN_ABSENT_PROPERTY_KEYS) throw new Error(`groupPropertyKeysKnownAbsent allows at most ${MAX_KNOWN_ABSENT_PROPERTY_KEYS} keys per group type`);
230
+ groups[groupType] = new Set(keys);
231
+ }
232
+ result.groups = groups;
233
+ }
234
+ return result;
235
+ }
208
236
  class PostHogBackendClient extends PostHogCoreStateless {
209
237
  get distinctIdHasSentFlagCalls() {
210
238
  return Object.fromEntries(this._distinctIdHasSentFlagCalls);
@@ -850,8 +878,8 @@ class PostHogBackendClient extends PostHogCoreStateless {
850
878
  options: distinctIdOrOptions
851
879
  };
852
880
  }
853
- async getFeatureFlagDetailsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate) {
854
- const details = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate);
881
+ async getFeatureFlagDetailsStateless(distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip, flagKeysToEvaluate, knownAbsentPropertyKeys) {
882
+ const details = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, flagKeysToEvaluate, knownAbsentPropertyKeys);
855
883
  if (void 0 !== details && !isPlainObject(details.flags)) {
856
884
  const message = '/flags response has a non-object `flags` field, treating it as a failed request';
857
885
  this._logger.warn(`[FEATURE FLAGS] ${message}`);
@@ -862,6 +890,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
862
890
  }
863
891
  async _getFeatureFlagResult(key, distinctId, options = {}, matchValue) {
864
892
  if (this.disabled) return void this._logger.warn('The client is disabled');
893
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys(options);
865
894
  const sendFeatureFlagEvents = options.sendFeatureFlagEvents ?? true;
866
895
  if (void 0 !== this._flagOverrides && key in this._flagOverrides) {
867
896
  const overrideValue = this._flagOverrides[key];
@@ -879,7 +908,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
879
908
  const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
880
909
  personProperties = adjustedProperties.allPersonProperties;
881
910
  groupProperties = adjustedProperties.allGroupProperties;
882
- const evaluationContext = this.createFeatureFlagEvaluationContext(distinctId, groups, this.personPropertiesForLocalEvaluation(distinctId, personProperties), groupProperties);
911
+ const evaluationContext = this.createFeatureFlagEvaluationContext(distinctId, groups, this.personPropertiesForLocalEvaluation(distinctId, personProperties), groupProperties, knownAbsentPropertyKeys);
883
912
  if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
884
913
  let result;
885
914
  let flagWasLocallyEvaluated = false;
@@ -929,7 +958,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
929
958
  if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
930
959
  const flagsResponse = await this.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, [
931
960
  key
932
- ]);
961
+ ], knownAbsentPropertyKeys.request);
933
962
  if (void 0 === flagsResponse) featureFlagError = FeatureFlagError.UNKNOWN_ERROR;
934
963
  else {
935
964
  this._minimalFlagCalledEvents = true === flagsResponse.minimalFlagCalledEvents;
@@ -1096,10 +1125,11 @@ class PostHogBackendClient extends PostHogCoreStateless {
1096
1125
  }
1097
1126
  const { groups, disableGeoip, flagKeys } = resolvedOptions || {};
1098
1127
  let { onlyEvaluateLocally, personProperties, groupProperties } = resolvedOptions || {};
1128
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys(resolvedOptions || {});
1099
1129
  const adjustedProperties = this.addLocalPersonAndGroupProperties(resolvedDistinctId, groups, personProperties, groupProperties);
1100
1130
  personProperties = adjustedProperties.allPersonProperties;
1101
1131
  groupProperties = adjustedProperties.allGroupProperties;
1102
- const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties);
1132
+ const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties, knownAbsentPropertyKeys);
1103
1133
  if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
1104
1134
  const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(evaluationContext, flagKeys);
1105
1135
  let featureFlags = {};
@@ -1111,7 +1141,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
1111
1141
  fallbackToFlags = localEvaluationResult.fallbackToFlags;
1112
1142
  }
1113
1143
  if (fallbackToFlags && !onlyEvaluateLocally) {
1114
- const remoteEvaluationResult = await super.getFeatureFlagsAndPayloadsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys);
1144
+ const remoteEvaluationResult = await super.getFeatureFlagsAndPayloadsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys, knownAbsentPropertyKeys.request);
1115
1145
  featureFlags = {
1116
1146
  ...featureFlags,
1117
1147
  ...remoteEvaluationResult.flags || {}
@@ -1154,6 +1184,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
1154
1184
  }
1155
1185
  const { groups, disableGeoip } = resolvedOptions || {};
1156
1186
  const flagKeys = resolvedOptions?.flagKeys ?? void 0;
1187
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys(resolvedOptions || {});
1157
1188
  if (flagKeys?.length === 0) return new FeatureFlagEvaluations({
1158
1189
  host: this._getFeatureFlagEvaluationsHost(),
1159
1190
  distinctId: resolvedDistinctId,
@@ -1165,7 +1196,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
1165
1196
  const adjustedProperties = this.addLocalPersonAndGroupProperties(resolvedDistinctId, groups, personProperties, groupProperties);
1166
1197
  personProperties = adjustedProperties.allPersonProperties;
1167
1198
  groupProperties = adjustedProperties.allGroupProperties;
1168
- const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties);
1199
+ const evaluationContext = this.createFeatureFlagEvaluationContext(resolvedDistinctId, groups, this.personPropertiesForLocalEvaluation(resolvedDistinctId, personProperties), groupProperties, knownAbsentPropertyKeys);
1169
1200
  if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
1170
1201
  const requestedFlagKeys = flagKeys ? new Set(flagKeys) : void 0;
1171
1202
  const records = {};
@@ -1197,7 +1228,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
1197
1228
  const requestedFlagMissingLocally = void 0 !== requestedFlagKeys && Array.from(requestedFlagKeys).some((key)=>this.featureFlagsPoller?.featureFlagsByKey[key] === void 0);
1198
1229
  const fallbackToFlags = localResult ? localResult.fallbackToFlags || requestedFlagMissingLocally : true;
1199
1230
  if (fallbackToFlags && !onlyEvaluateLocally) {
1200
- const details = await this.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys);
1231
+ const details = await this.getFeatureFlagDetailsStateless(evaluationContext.distinctId, evaluationContext.groups, personProperties, groupProperties, disableGeoip, flagKeys, knownAbsentPropertyKeys.request);
1201
1232
  if (details) {
1202
1233
  this._minimalFlagCalledEvents = true === details.minimalFlagCalledEvents;
1203
1234
  requestId = details.requestId;
@@ -1575,15 +1606,22 @@ class PostHogBackendClient extends PostHogCoreStateless {
1575
1606
  const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};
1576
1607
  const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};
1577
1608
  const flagKeys = sendFeatureFlagsOptions?.flagKeys;
1609
+ const { personPropertyKeysKnownAbsent, groupPropertyKeysKnownAbsent } = sendFeatureFlagsOptions || {};
1610
+ const knownAbsentPropertyKeys = readKnownAbsentPropertyKeys({
1611
+ personPropertyKeysKnownAbsent,
1612
+ groupPropertyKeysKnownAbsent
1613
+ });
1578
1614
  const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;
1579
1615
  if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};
1580
1616
  else {
1581
1617
  const groupsWithStringValues = {};
1582
- for (const [key, value] of Object.entries(groups || {}))groupsWithStringValues[key] = String(value);
1618
+ for (const [key, value] of Object.entries(groups || {}))if (isUsableGroupKey(value)) groupsWithStringValues[key] = String(value);
1583
1619
  return await this.getAllFlags(distinctId, {
1584
1620
  groups: groupsWithStringValues,
1585
1621
  personProperties: finalPersonProperties,
1586
1622
  groupProperties: finalGroupProperties,
1623
+ personPropertyKeysKnownAbsent,
1624
+ groupPropertyKeysKnownAbsent,
1587
1625
  disableGeoip,
1588
1626
  onlyEvaluateLocally: true,
1589
1627
  flagKeys
@@ -1591,23 +1629,26 @@ class PostHogBackendClient extends PostHogCoreStateless {
1591
1629
  }
1592
1630
  if ((this.featureFlagsPoller?.featureFlags?.length || 0) > 0) {
1593
1631
  const groupsWithStringValues = {};
1594
- for (const [key, value] of Object.entries(groups || {}))groupsWithStringValues[key] = String(value);
1632
+ for (const [key, value] of Object.entries(groups || {}))if (isUsableGroupKey(value)) groupsWithStringValues[key] = String(value);
1595
1633
  return await this.getAllFlags(distinctId, {
1596
1634
  groups: groupsWithStringValues,
1597
1635
  personProperties: finalPersonProperties,
1598
1636
  groupProperties: finalGroupProperties,
1637
+ personPropertyKeysKnownAbsent,
1638
+ groupPropertyKeysKnownAbsent,
1599
1639
  disableGeoip,
1600
1640
  onlyEvaluateLocally: true,
1601
1641
  flagKeys
1602
1642
  });
1603
1643
  }
1604
- return (await super.getFeatureFlagsStateless(distinctId, groups, finalPersonProperties, finalGroupProperties, disableGeoip)).flags;
1644
+ return (await super.getFeatureFlagsStateless(distinctId, groups, finalPersonProperties, finalGroupProperties, disableGeoip, void 0, knownAbsentPropertyKeys.request)).flags;
1605
1645
  }
1606
1646
  addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties) {
1607
1647
  const allPersonProperties = {
1608
1648
  ...personProperties || {}
1609
1649
  };
1610
1650
  const allGroupProperties = {};
1651
+ for (const [groupName, properties] of Object.entries(groupProperties || {}))if (null != properties) allGroupProperties[groupName] = properties;
1611
1652
  if (groups) for (const groupName of Object.keys(groups))allGroupProperties[groupName] = {
1612
1653
  $group_key: groups[groupName],
1613
1654
  ...groupProperties?.[groupName] || {}
@@ -1623,12 +1664,14 @@ class PostHogBackendClient extends PostHogCoreStateless {
1623
1664
  ...personProperties || {}
1624
1665
  };
1625
1666
  }
1626
- createFeatureFlagEvaluationContext(distinctId, groups, personProperties, groupProperties) {
1667
+ createFeatureFlagEvaluationContext(distinctId, groups, personProperties, groupProperties, knownAbsentPropertyKeys) {
1627
1668
  return {
1628
1669
  distinctId,
1629
1670
  groups: groups || {},
1630
1671
  personProperties: personProperties || {},
1631
1672
  groupProperties: groupProperties || {},
1673
+ personPropertyKeysKnownAbsent: knownAbsentPropertyKeys?.person,
1674
+ groupPropertyKeysKnownAbsent: knownAbsentPropertyKeys?.groups,
1632
1675
  evaluationCache: {}
1633
1676
  };
1634
1677
  }
@@ -23,9 +23,9 @@ export interface EmailSenderHooks {
23
23
  userAgent?: string;
24
24
  }
25
25
  /**
26
- * Sends one transactional or marketing email per call to the messaging send API on the app host,
27
- * reads the status of a sent email, and sets a recipient's topic preferences. Owns the attempt
28
- * loop, so every attempt of a send carries the same idempotency key.
26
+ * Sends one transactional email per call to the messaging send API on the app host, reads the
27
+ * status of a sent email, and sets a recipient's topic preferences. Owns the attempt loop, so every
28
+ * attempt of a send carries the same idempotency key.
29
29
  */
30
30
  export declare class EmailSender implements Emails {
31
31
  private readonly config;
@@ -1 +1 @@
1
- {"version":3,"file":"emails.d.ts","sourceRoot":"","sources":["../../src/emails/emails.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAI1B,MAAM,eAAe,CAAA;AAYtB,OAAO,KAAK,EAIV,kBAAkB,EAGlB,MAAM,EACN,gBAAgB,EAEhB,gBAAgB,EAChB,iBAAiB,EAGjB,0BAA0B,EAC1B,2BAA2B,EAE5B,MAAM,SAAS,CAAA;AAkEhB,eAAO,MAAM,gCAAgC,QAAS,CAAA;AACtD,eAAO,MAAM,iCAAiC,IAAI,CAAA;AAElD,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBA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