@adtrackify/at-service-common 4.0.9 → 4.0.10

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 (57) hide show
  1. package/dist/cjs/__tests__/identity-cache/helpers.spec.js +4 -4
  2. package/dist/cjs/__tests__/identity-cache/helpers.spec.js.map +1 -1
  3. package/dist/cjs/__tests__/identity-cache/identity-cache-db-service.spec.js +15 -15
  4. package/dist/cjs/__tests__/identity-cache/identity-cache-db-service.spec.js.map +1 -1
  5. package/dist/cjs/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.js +1 -1
  6. package/dist/cjs/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.js.map +1 -1
  7. package/dist/cjs/__tests__/identity-cache/identity-cache-tier-routing.spec.js +4 -4
  8. package/dist/cjs/__tests__/identity-cache/identity-cache-tier-routing.spec.js.map +1 -1
  9. package/dist/cjs/__tests__/identity-cache/trait-merging-and-staleness.spec.js +140 -141
  10. package/dist/cjs/__tests__/identity-cache/trait-merging-and-staleness.spec.js.map +1 -1
  11. package/dist/cjs/__tests__/identity-cache/volatile-traits-optimization.spec.js +79 -79
  12. package/dist/cjs/__tests__/identity-cache/volatile-traits-optimization.spec.js.map +1 -1
  13. package/dist/cjs/helpers/index.d.ts +0 -1
  14. package/dist/cjs/helpers/index.js +0 -1
  15. package/dist/cjs/helpers/index.js.map +1 -1
  16. package/dist/cjs/services/db/identity-cache-db-service.js +4 -4
  17. package/dist/cjs/services/db/identity-cache-db-service.js.map +1 -1
  18. package/dist/cjs/services/db/identity-cache-dynamodb-service/helpers.d.ts +1 -2
  19. package/dist/cjs/services/db/identity-cache-dynamodb-service/helpers.js +5 -6
  20. package/dist/cjs/services/db/identity-cache-dynamodb-service/helpers.js.map +1 -1
  21. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.js +8 -8
  22. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.js.map +1 -1
  23. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-gateway-service.js +6 -5
  24. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-gateway-service.js.map +1 -1
  25. package/dist/cjs/services/db/identity-cache-dynamodb-service/types.d.ts +1 -1
  26. package/dist/esm/__tests__/identity-cache/helpers.spec.js +1 -1
  27. package/dist/esm/__tests__/identity-cache/helpers.spec.js.map +1 -1
  28. package/dist/esm/__tests__/identity-cache/identity-cache-db-service.spec.js +1 -1
  29. package/dist/esm/__tests__/identity-cache/identity-cache-db-service.spec.js.map +1 -1
  30. package/dist/esm/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.js +1 -1
  31. package/dist/esm/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.js.map +1 -1
  32. package/dist/esm/__tests__/identity-cache/identity-cache-tier-routing.spec.js +1 -1
  33. package/dist/esm/__tests__/identity-cache/identity-cache-tier-routing.spec.js.map +1 -1
  34. package/dist/esm/__tests__/identity-cache/trait-merging-and-staleness.spec.js +1 -2
  35. package/dist/esm/__tests__/identity-cache/trait-merging-and-staleness.spec.js.map +1 -1
  36. package/dist/esm/__tests__/identity-cache/volatile-traits-optimization.spec.js +1 -1
  37. package/dist/esm/__tests__/identity-cache/volatile-traits-optimization.spec.js.map +1 -1
  38. package/dist/esm/helpers/index.d.ts +0 -1
  39. package/dist/esm/helpers/index.js +0 -1
  40. package/dist/esm/helpers/index.js.map +1 -1
  41. package/dist/esm/services/db/identity-cache-db-service.js +1 -1
  42. package/dist/esm/services/db/identity-cache-db-service.js.map +1 -1
  43. package/dist/esm/services/db/identity-cache-dynamodb-service/helpers.d.ts +1 -2
  44. package/dist/esm/services/db/identity-cache-dynamodb-service/helpers.js +1 -2
  45. package/dist/esm/services/db/identity-cache-dynamodb-service/helpers.js.map +1 -1
  46. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.js +3 -3
  47. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.js.map +1 -1
  48. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-gateway-service.js +3 -2
  49. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-gateway-service.js.map +1 -1
  50. package/dist/esm/services/db/identity-cache-dynamodb-service/types.d.ts +1 -1
  51. package/package.json +2 -2
  52. package/dist/cjs/helpers/identity-cache-helper.d.ts +0 -39
  53. package/dist/cjs/helpers/identity-cache-helper.js +0 -307
  54. package/dist/cjs/helpers/identity-cache-helper.js.map +0 -1
  55. package/dist/esm/helpers/identity-cache-helper.d.ts +0 -39
  56. package/dist/esm/helpers/identity-cache-helper.js +0 -300
  57. package/dist/esm/helpers/identity-cache-helper.js.map +0 -1
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const at_tracking_event_types_1 = require("@adtrackify/at-tracking-event-types");
4
4
  const at_shared_utils_1 = require("@adtrackify/at-shared-utils");
5
- const identity_cache_helper_1 = require("../../helpers/identity-cache-helper");
6
5
  describe('Identity Trait Merging Tests', () => {
7
6
  afterEach(() => {
8
7
  jest.resetModules();
@@ -163,7 +162,7 @@ describe('Identity Trait Merging Tests', () => {
163
162
  };
164
163
  const mergedTraits = (0, at_shared_utils_1.mergeIdentityTraits)(incomingIdentity.traits, cachedIdentity.traits);
165
164
  const mergedIdentity = { ...incomingIdentity, traits: mergedTraits };
166
- const staleTracker = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
165
+ const staleTracker = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
167
166
  expect(staleTracker.isCacheStale).toBe(false);
168
167
  expect(mergedIdentity.traits?.emails).toEqual(['shared@email.com', 'cached@email.com']);
169
168
  });
@@ -184,7 +183,7 @@ describe('Identity Trait Merging Tests', () => {
184
183
  };
185
184
  const mergedTraits = (0, at_shared_utils_1.mergeIdentityTraits)(incomingIdentity.traits, cachedIdentity.traits);
186
185
  const mergedIdentity = { ...incomingIdentity, traits: mergedTraits };
187
- const staleTracker = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
186
+ const staleTracker = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
188
187
  expect(staleTracker.isCacheStale).toBe(true);
189
188
  expect(staleTracker.isEmailsStale).toBe(true);
190
189
  });
@@ -204,7 +203,7 @@ describe('Identity Cache Staleness Tests', () => {
204
203
  identityId: 'new-id',
205
204
  traits: { emails: ['test@email.com'] },
206
205
  };
207
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
206
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
208
207
  expect(result.isCacheStale).toBe(true);
209
208
  expect(result.isIdentityIdStale).toBe(true);
210
209
  });
@@ -217,7 +216,7 @@ describe('Identity Cache Staleness Tests', () => {
217
216
  identityId: 'test-id',
218
217
  traits: { emails: ['old@email.com', 'new@email.com'] },
219
218
  };
220
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
219
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
221
220
  expect(result.isCacheStale).toBe(true);
222
221
  expect(result.isEmailsStale).toBe(true);
223
222
  });
@@ -230,7 +229,7 @@ describe('Identity Cache Staleness Tests', () => {
230
229
  identityId: 'test-id',
231
230
  traits: { userIds: ['user1', 'user2'] },
232
231
  };
233
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
232
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
234
233
  expect(result.isCacheStale).toBe(true);
235
234
  expect(result.isUserIdsStale).toBe(true);
236
235
  });
@@ -243,7 +242,7 @@ describe('Identity Cache Staleness Tests', () => {
243
242
  identityId: 'test-id',
244
243
  traits: { phones: ['+1234567890', '+9876543210'] },
245
244
  };
246
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
245
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
247
246
  expect(result.isCacheStale).toBe(true);
248
247
  expect(result.isPhonesStale).toBe(true);
249
248
  });
@@ -269,11 +268,11 @@ describe('Identity Cache Staleness Tests', () => {
269
268
  ],
270
269
  },
271
270
  };
272
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
271
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
273
272
  expect(result.isCacheStale).toBe(true);
274
273
  expect(result.isAddressesStale).toBe(true);
275
274
  expect(result.isNonIpAddressesStale).toBe(true);
276
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
275
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
277
276
  });
278
277
  it('should detect IP address changes but NOT mark cache stale (volatile trait)', () => {
279
278
  const cachedIdentity = {
@@ -284,10 +283,10 @@ describe('Identity Cache Staleness Tests', () => {
284
283
  identityId: 'test-id',
285
284
  traits: { ipAddress: '10.0.0.1' },
286
285
  };
287
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
286
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
288
287
  expect(result.isCacheStale).toBe(false);
289
288
  expect(result.isIpAddressStale).toBe(true);
290
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
289
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
291
290
  });
292
291
  it('should detect user agent changes but NOT mark cache stale (volatile trait)', () => {
293
292
  const cachedIdentity = {
@@ -298,10 +297,10 @@ describe('Identity Cache Staleness Tests', () => {
298
297
  identityId: 'test-id',
299
298
  traits: { userAgent: 'Mozilla/5.0 (new browser)' },
300
299
  };
301
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
300
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
302
301
  expect(result.isCacheStale).toBe(false);
303
302
  expect(result.isUserAgentStale).toBe(true);
304
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
303
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
305
304
  });
306
305
  it('should not be stale when no new information is provided', () => {
307
306
  const cachedIdentity = {
@@ -319,7 +318,7 @@ describe('Identity Cache Staleness Tests', () => {
319
318
  userIds: ['user1'],
320
319
  },
321
320
  };
322
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
321
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
323
322
  expect(result.isCacheStale).toBe(false);
324
323
  });
325
324
  it('should handle empty traits gracefully', () => {
@@ -331,7 +330,7 @@ describe('Identity Cache Staleness Tests', () => {
331
330
  identityId: 'test-id',
332
331
  traits: {},
333
332
  };
334
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
333
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
335
334
  expect(result.isCacheStale).toBe(false);
336
335
  });
337
336
  it('should handle undefined traits gracefully', () => {
@@ -341,7 +340,7 @@ describe('Identity Cache Staleness Tests', () => {
341
340
  const incomingIdentity = {
342
341
  identityId: 'test-id',
343
342
  };
344
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
343
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
345
344
  expect(result.isCacheStale).toBe(false);
346
345
  });
347
346
  it('should detect multiple stale conditions (identity traits take priority over volatile)', () => {
@@ -361,12 +360,12 @@ describe('Identity Cache Staleness Tests', () => {
361
360
  ipAddress: '10.0.0.1',
362
361
  },
363
362
  };
364
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
363
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
365
364
  expect(result.isCacheStale).toBe(true);
366
365
  expect(result.isEmailsStale).toBe(true);
367
366
  expect(result.isUserIdsStale).toBe(true);
368
367
  expect(result.isIpAddressStale).toBe(true);
369
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
368
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
370
369
  });
371
370
  });
372
371
  describe('isClickInfosStale function', () => {
@@ -377,7 +376,7 @@ describe('Identity Cache Staleness Tests', () => {
377
376
  const incomingClick = {
378
377
  fbc: 'fb.1.123.new_fbclid',
379
378
  };
380
- const result = (0, identity_cache_helper_1.isClickInfosStale)(cachedClick, incomingClick);
379
+ const result = (0, at_shared_utils_1.isClickInfosStale)(cachedClick, incomingClick);
381
380
  expect(result).toBe(true);
382
381
  });
383
382
  it('should detect new click IDs', () => {
@@ -387,7 +386,7 @@ describe('Identity Cache Staleness Tests', () => {
387
386
  const incomingClick = {
388
387
  gclid: 'new_gclid',
389
388
  };
390
- const result = (0, identity_cache_helper_1.isClickInfosStale)(cachedClick, incomingClick);
389
+ const result = (0, at_shared_utils_1.isClickInfosStale)(cachedClick, incomingClick);
391
390
  expect(result).toBe(true);
392
391
  });
393
392
  it('should ignore collection timestamps', () => {
@@ -399,7 +398,7 @@ describe('Identity Cache Staleness Tests', () => {
399
398
  fbp: 'fb.2.123.456',
400
399
  fbpCollectedAt: '2024-01-01T00:00:00.000Z',
401
400
  };
402
- const result = (0, identity_cache_helper_1.isClickInfosStale)(cachedClick, incomingClick);
401
+ const result = (0, at_shared_utils_1.isClickInfosStale)(cachedClick, incomingClick);
403
402
  expect(result).toBe(false);
404
403
  });
405
404
  it('should ignore googleClientInfos', () => {
@@ -409,11 +408,11 @@ describe('Identity Cache Staleness Tests', () => {
409
408
  const incomingClick = {
410
409
  googleClientInfos: [{ id: 'new', clickId: 'new_click' }],
411
410
  };
412
- const result = (0, identity_cache_helper_1.isClickInfosStale)(cachedClick, incomingClick);
411
+ const result = (0, at_shared_utils_1.isClickInfosStale)(cachedClick, incomingClick);
413
412
  expect(result).toBe(false);
414
413
  });
415
414
  it('should handle empty click info', () => {
416
- const result = (0, identity_cache_helper_1.isClickInfosStale)({}, {});
415
+ const result = (0, at_shared_utils_1.isClickInfosStale)({}, {});
417
416
  expect(result).toBe(false);
418
417
  });
419
418
  it('should detect when incoming has new click info but cached is empty', () => {
@@ -421,7 +420,7 @@ describe('Identity Cache Staleness Tests', () => {
421
420
  const incomingClick = {
422
421
  fbp: 'fb.2.123.456',
423
422
  };
424
- const result = (0, identity_cache_helper_1.isClickInfosStale)(cachedClick, incomingClick);
423
+ const result = (0, at_shared_utils_1.isClickInfosStale)(cachedClick, incomingClick);
425
424
  expect(result).toBe(true);
426
425
  });
427
426
  });
@@ -433,7 +432,7 @@ describe('Identity Cache Staleness Tests', () => {
433
432
  const incomingClick = {
434
433
  fbc: 'also_malformed',
435
434
  };
436
- const result = (0, identity_cache_helper_1.isClickInfosStale)(cachedClick, incomingClick);
435
+ const result = (0, at_shared_utils_1.isClickInfosStale)(cachedClick, incomingClick);
437
436
  expect(result).toBe(true);
438
437
  });
439
438
  it('should handle null/undefined arrays in traits', () => {
@@ -451,7 +450,7 @@ describe('Identity Cache Staleness Tests', () => {
451
450
  userIds: ['user1'],
452
451
  },
453
452
  };
454
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
453
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
455
454
  expect(result.isCacheStale).toBe(true);
456
455
  expect(result.isEmailsStale).toBe(true);
457
456
  expect(result.isUserIdsStale).toBe(true);
@@ -469,12 +468,12 @@ describe('Identity Cache Staleness Tests', () => {
469
468
  emails: ['valid@email.com', null, undefined, 'new@email.com'],
470
469
  },
471
470
  };
472
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
471
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
473
472
  expect(result.isCacheStale).toBe(true);
474
473
  expect(result.isEmailsStale).toBe(true);
475
474
  });
476
475
  it('should handle error conditions gracefully', () => {
477
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(null, undefined);
476
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(null, undefined);
478
477
  expect(result.isCacheStale).toBe(false);
479
478
  });
480
479
  });
@@ -528,7 +527,7 @@ describe('Identity Cache Staleness Tests', () => {
528
527
  };
529
528
  const mergedTraits = (0, at_shared_utils_1.mergeIdentityTraits)(cachedIdentity.traits, incomingIdentity.traits);
530
529
  const mergedIdentity = { ...incomingIdentity, traits: mergedTraits };
531
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
530
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
532
531
  expect(result.isCacheStale).toBe(true);
533
532
  expect(result.isEmailsStale).toBe(true);
534
533
  expect(result.isPhonesStale).toBe(true);
@@ -561,7 +560,7 @@ describe('Identity Cache Staleness Tests', () => {
561
560
  };
562
561
  const mergedTraits = (0, at_shared_utils_1.mergeIdentityTraits)(cachedIdentity.traits, incomingIdentity.traits);
563
562
  const mergedIdentity = { ...incomingIdentity, traits: mergedTraits };
564
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
563
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
565
564
  expect(mergedTraits?.click?.gclid).toEqual('original_gclid');
566
565
  expect(result.isCacheStale).toBe(false);
567
566
  });
@@ -585,7 +584,7 @@ describe('Identity Cache Staleness Tests', () => {
585
584
  };
586
585
  const mergedTraits = (0, at_shared_utils_1.mergeIdentityTraits)(cachedIdentity.traits, incomingIdentity.traits);
587
586
  const mergedIdentity = { ...incomingIdentity, traits: mergedTraits };
588
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
587
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, mergedIdentity);
589
588
  expect(result.isCacheStale).toBe(false);
590
589
  expect(mergedIdentity.traits?.emails).toEqual(['user@domain.com', 'secondary@domain.com']);
591
590
  expect(mergedIdentity.traits?.userIds).toEqual(['user1', 'user2']);
@@ -613,8 +612,8 @@ describe('Three-Tier Staleness Model Tests', () => {
613
612
  ipAddress: '10.0.0.1',
614
613
  },
615
614
  };
616
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
617
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
615
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
616
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
618
617
  expect(result.isCacheStale).toBe(false);
619
618
  expect(result.isIpAddressStale).toBe(true);
620
619
  });
@@ -633,8 +632,8 @@ describe('Three-Tier Staleness Model Tests', () => {
633
632
  userAgent: 'Mozilla/5.0 (new)',
634
633
  },
635
634
  };
636
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
637
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
635
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
636
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
638
637
  expect(result.isCacheStale).toBe(false);
639
638
  expect(result.isUserAgentStale).toBe(true);
640
639
  });
@@ -657,8 +656,8 @@ describe('Three-Tier Staleness Model Tests', () => {
657
656
  ],
658
657
  },
659
658
  };
660
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
661
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
659
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
660
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
662
661
  expect(result.isCacheStale).toBe(false);
663
662
  expect(result.isIpAddressesStale).toBe(true);
664
663
  expect(result.isNonIpAddressesStale).toBe(false);
@@ -686,8 +685,8 @@ describe('Three-Tier Staleness Model Tests', () => {
686
685
  ],
687
686
  },
688
687
  };
689
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
690
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
688
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
689
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
691
690
  expect(result.isCacheStale).toBe(false);
692
691
  expect(result.isIpAddressStale).toBe(true);
693
692
  expect(result.isUserAgentStale).toBe(true);
@@ -712,8 +711,8 @@ describe('Three-Tier Staleness Model Tests', () => {
712
711
  ],
713
712
  },
714
713
  };
715
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
716
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
714
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
715
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
717
716
  expect(result.isCacheStale).toBe(true);
718
717
  expect(result.isNonIpAddressesStale).toBe(true);
719
718
  });
@@ -737,8 +736,8 @@ describe('Three-Tier Staleness Model Tests', () => {
737
736
  ],
738
737
  },
739
738
  };
740
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
741
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
739
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
740
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
742
741
  expect(result.isCacheStale).toBe(true);
743
742
  expect(result.isNonIpAddressesStale).toBe(true);
744
743
  });
@@ -761,8 +760,8 @@ describe('Three-Tier Staleness Model Tests', () => {
761
760
  ],
762
761
  },
763
762
  };
764
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
765
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
763
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
764
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
766
765
  expect(result.isCacheStale).toBe(true);
767
766
  expect(result.isIpAddressStale).toBe(true);
768
767
  expect(result.isNonIpAddressesStale).toBe(true);
@@ -782,8 +781,8 @@ describe('Three-Tier Staleness Model Tests', () => {
782
781
  emails: ['old@email.com', 'new@email.com'],
783
782
  },
784
783
  };
785
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
786
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
784
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
785
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
787
786
  expect(result.isCacheStale).toBe(true);
788
787
  expect(result.isEmailsStale).toBe(true);
789
788
  });
@@ -796,8 +795,8 @@ describe('Three-Tier Staleness Model Tests', () => {
796
795
  identityId: 'new-id',
797
796
  traits: { emails: ['test@email.com'] },
798
797
  };
799
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
800
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
798
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
799
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
801
800
  expect(result.isCacheStale).toBe(true);
802
801
  expect(result.isIdentityIdStale).toBe(true);
803
802
  });
@@ -810,8 +809,8 @@ describe('Three-Tier Staleness Model Tests', () => {
810
809
  identityId: 'test-id',
811
810
  traits: { phones: ['+1234567890', '+9876543210'] },
812
811
  };
813
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
814
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
812
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
813
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
815
814
  expect(result.isCacheStale).toBe(true);
816
815
  expect(result.isPhonesStale).toBe(true);
817
816
  });
@@ -828,8 +827,8 @@ describe('Three-Tier Staleness Model Tests', () => {
828
827
  click: { gclid: 'new_gclid' },
829
828
  },
830
829
  };
831
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
832
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
830
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
831
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
833
832
  expect(result.isCacheStale).toBe(true);
834
833
  expect(result.isClickInfosStale).toBe(true);
835
834
  });
@@ -850,8 +849,8 @@ describe('Three-Tier Staleness Model Tests', () => {
850
849
  ],
851
850
  },
852
851
  };
853
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
854
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
852
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
853
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
855
854
  expect(result.isCacheStale).toBe(true);
856
855
  expect(result.isEmailsStale).toBe(true);
857
856
  expect(result.isNonIpAddressesStale).toBe(true);
@@ -871,8 +870,8 @@ describe('Three-Tier Staleness Model Tests', () => {
871
870
  ipAddress: '10.0.0.1',
872
871
  },
873
872
  };
874
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
875
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
873
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
874
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
876
875
  expect(result.isCacheStale).toBe(true);
877
876
  expect(result.isEmailsStale).toBe(true);
878
877
  expect(result.isIpAddressStale).toBe(true);
@@ -896,8 +895,8 @@ describe('Three-Tier Staleness Model Tests', () => {
896
895
  ipAddress: '192.168.1.1',
897
896
  },
898
897
  };
899
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
900
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
898
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
899
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
901
900
  expect(result.isCacheStale).toBe(false);
902
901
  });
903
902
  it('should return NONE tier when incoming is subset of cached', () => {
@@ -914,8 +913,8 @@ describe('Three-Tier Staleness Model Tests', () => {
914
913
  emails: ['a@email.com'],
915
914
  },
916
915
  };
917
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
918
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
916
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
917
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
919
918
  expect(result.isCacheStale).toBe(false);
920
919
  });
921
920
  });
@@ -937,10 +936,10 @@ describe('Three-Tier Staleness Model Tests', () => {
937
936
  ],
938
937
  },
939
938
  };
940
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
939
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
941
940
  expect(result.isIpAddressesStale).toBe(true);
942
941
  expect(result.isNonIpAddressesStale).toBe(false);
943
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
942
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
944
943
  });
945
944
  it('should correctly identify INPUT-sourced addresses', () => {
946
945
  const cachedIdentity = {
@@ -960,10 +959,10 @@ describe('Three-Tier Staleness Model Tests', () => {
960
959
  ],
961
960
  },
962
961
  };
963
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
962
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
964
963
  expect(result.isIpAddressesStale).toBe(false);
965
964
  expect(result.isNonIpAddressesStale).toBe(true);
966
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
965
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
967
966
  });
968
967
  it('should handle mixed address sources correctly', () => {
969
968
  const cachedIdentity = {
@@ -985,10 +984,10 @@ describe('Three-Tier Staleness Model Tests', () => {
985
984
  ],
986
985
  },
987
986
  };
988
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
987
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
989
988
  expect(result.isIpAddressesStale).toBe(true);
990
989
  expect(result.isNonIpAddressesStale).toBe(true);
991
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
990
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
992
991
  expect(result.isCacheStale).toBe(true);
993
992
  });
994
993
  it('should handle addresses without source field (default to IP based on PII)', () => {
@@ -1006,10 +1005,10 @@ describe('Three-Tier Staleness Model Tests', () => {
1006
1005
  ],
1007
1006
  },
1008
1007
  };
1009
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1008
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1010
1009
  expect(result.isIpAddressesStale).toBe(true);
1011
1010
  expect(result.isNonIpAddressesStale).toBe(false);
1012
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1011
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1013
1012
  expect(result.isCacheStale).toBe(false);
1014
1013
  });
1015
1014
  it('should treat addresses without source but with PII as non-IP', () => {
@@ -1027,10 +1026,10 @@ describe('Three-Tier Staleness Model Tests', () => {
1027
1026
  ],
1028
1027
  },
1029
1028
  };
1030
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1029
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1031
1030
  expect(result.isNonIpAddressesStale).toBe(true);
1032
1031
  expect(result.isIpAddressesStale).toBe(false);
1033
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1032
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1034
1033
  expect(result.isCacheStale).toBe(true);
1035
1034
  });
1036
1035
  });
@@ -1052,7 +1051,7 @@ describe('Three-Tier Staleness Model Tests', () => {
1052
1051
  ],
1053
1052
  },
1054
1053
  };
1055
- const result = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1054
+ const result = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1056
1055
  expect(result.isAddressesStale).toBe(true);
1057
1056
  expect(result.isCacheStale).toBe(false);
1058
1057
  });
@@ -1068,8 +1067,8 @@ describe('extractStaleTraitNames function', () => {
1068
1067
  identityId: 'test-id',
1069
1068
  traits: { emails: ['test@email.com'] },
1070
1069
  };
1071
- const tracker = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1072
- const staleTraits = (0, identity_cache_helper_1.extractStaleTraitNames)(tracker);
1070
+ const tracker = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1071
+ const staleTraits = (0, at_shared_utils_1.extractStaleTraitNames)(tracker);
1073
1072
  expect(staleTraits).toEqual([]);
1074
1073
  });
1075
1074
  it('should return identity-defining trait names when stale', () => {
@@ -1081,8 +1080,8 @@ describe('extractStaleTraitNames function', () => {
1081
1080
  identityId: 'test-id',
1082
1081
  traits: { emails: ['old@email.com', 'new@email.com'] },
1083
1082
  };
1084
- const tracker = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1085
- const staleTraits = (0, identity_cache_helper_1.extractStaleTraitNames)(tracker);
1083
+ const tracker = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1084
+ const staleTraits = (0, at_shared_utils_1.extractStaleTraitNames)(tracker);
1086
1085
  expect(staleTraits).toContain('emails');
1087
1086
  });
1088
1087
  it('should return multiple stale trait names', () => {
@@ -1100,8 +1099,8 @@ describe('extractStaleTraitNames function', () => {
1100
1099
  phones: ['+1234567890', '+9876543210'],
1101
1100
  },
1102
1101
  };
1103
- const tracker = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1104
- const staleTraits = (0, identity_cache_helper_1.extractStaleTraitNames)(tracker);
1102
+ const tracker = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1103
+ const staleTraits = (0, at_shared_utils_1.extractStaleTraitNames)(tracker);
1105
1104
  expect(staleTraits).toContain('emails');
1106
1105
  expect(staleTraits).toContain('phones');
1107
1106
  });
@@ -1120,8 +1119,8 @@ describe('extractStaleTraitNames function', () => {
1120
1119
  userAgent: 'new-agent',
1121
1120
  },
1122
1121
  };
1123
- const tracker = (0, identity_cache_helper_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1124
- const staleTraits = (0, identity_cache_helper_1.extractStaleTraitNames)(tracker);
1122
+ const tracker = (0, at_shared_utils_1.isIdentityCacheStale)(cachedIdentity, incomingIdentity);
1123
+ const staleTraits = (0, at_shared_utils_1.extractStaleTraitNames)(tracker);
1125
1124
  expect(staleTraits).toContain('ipAddress');
1126
1125
  expect(staleTraits).toContain('userAgent');
1127
1126
  });
@@ -1140,8 +1139,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1140
1139
  phones: ['+1234567890'],
1141
1140
  },
1142
1141
  };
1143
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1144
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1142
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1143
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1145
1144
  expect(result.isCacheStale).toBe(false);
1146
1145
  expect(result.staleTraits).toEqual([]);
1147
1146
  expect(result.mergedIdentity.traits?.emails).toEqual(['shared@email.com', 'other@email.com']);
@@ -1162,8 +1161,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1162
1161
  phones: ['+1234567890'],
1163
1162
  },
1164
1163
  };
1165
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1166
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1164
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1165
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1167
1166
  expect(result.isCacheStale).toBe(false);
1168
1167
  expect(result.staleTraits).toEqual([]);
1169
1168
  });
@@ -1182,8 +1181,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1182
1181
  click: { gclid: 'same_gclid', fbp: 'fb.1.123.456' },
1183
1182
  },
1184
1183
  };
1185
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1186
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1184
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1185
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1187
1186
  expect(result.isCacheStale).toBe(false);
1188
1187
  });
1189
1188
  });
@@ -1202,8 +1201,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1202
1201
  emails: ['test@email.com'],
1203
1202
  },
1204
1203
  };
1205
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1206
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1204
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1205
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1207
1206
  expect(result.isCacheStale).toBe(false);
1208
1207
  expect(result.staleTraits).toContain('ipAddress');
1209
1208
  });
@@ -1221,8 +1220,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1221
1220
  emails: ['test@email.com'],
1222
1221
  },
1223
1222
  };
1224
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1225
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1223
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1224
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1226
1225
  expect(result.isCacheStale).toBe(false);
1227
1226
  expect(result.staleTraits).toContain('userAgent');
1228
1227
  });
@@ -1241,8 +1240,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1241
1240
  addresses: [],
1242
1241
  },
1243
1242
  };
1244
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1245
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1243
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1244
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1246
1245
  expect(result.isCacheStale).toBe(false);
1247
1246
  });
1248
1247
  });
@@ -1262,8 +1261,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1262
1261
  addresses: [],
1263
1262
  },
1264
1263
  };
1265
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1266
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1264
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1265
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1267
1266
  expect(result.isCacheStale).toBe(true);
1268
1267
  expect(result.staleTraits).toContain('addresses');
1269
1268
  });
@@ -1284,8 +1283,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1284
1283
  addresses: [],
1285
1284
  },
1286
1285
  };
1287
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1288
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1286
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1287
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1289
1288
  expect(result.isCacheStale).toBe(true);
1290
1289
  });
1291
1290
  });
@@ -1299,8 +1298,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1299
1298
  identityId: 'test-id',
1300
1299
  traits: { emails: ['old@email.com'] },
1301
1300
  };
1302
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1303
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1301
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1302
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1304
1303
  expect(result.isCacheStale).toBe(true);
1305
1304
  expect(result.staleTraits).toContain('emails');
1306
1305
  });
@@ -1313,8 +1312,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1313
1312
  identityId: 'test-id',
1314
1313
  traits: { phones: ['+1234567890'] },
1315
1314
  };
1316
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1317
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1315
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1316
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1318
1317
  expect(result.isCacheStale).toBe(true);
1319
1318
  expect(result.staleTraits).toContain('phones');
1320
1319
  });
@@ -1327,8 +1326,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1327
1326
  identityId: 'old-id',
1328
1327
  traits: { emails: ['test@email.com'] },
1329
1328
  };
1330
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1331
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1329
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1330
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1332
1331
  expect(result.isCacheStale).toBe(true);
1333
1332
  expect(result.staleTraits).toContain('identityId');
1334
1333
  });
@@ -1341,8 +1340,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1341
1340
  identityId: 'test-id',
1342
1341
  traits: {},
1343
1342
  };
1344
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1345
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1343
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1344
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1346
1345
  expect(result.isCacheStale).toBe(true);
1347
1346
  expect(result.staleTraits).toContain('clickInfos');
1348
1347
  });
@@ -1361,8 +1360,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1361
1360
  addresses: [],
1362
1361
  },
1363
1362
  };
1364
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1365
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1363
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1364
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1366
1365
  expect(result.isCacheStale).toBe(true);
1367
1366
  expect(result.staleTraits).toContain('emails');
1368
1367
  expect(result.staleTraits).toContain('addresses');
@@ -1378,7 +1377,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1378
1377
  identityId: 'cached-id',
1379
1378
  traits: { phones: ['+1234567890'] },
1380
1379
  };
1381
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1380
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1382
1381
  expect(result.mergedIdentity.identityId).toBe('incoming-id');
1383
1382
  });
1384
1383
  it('should merge traits from both incoming and cached', () => {
@@ -1396,7 +1395,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1396
1395
  phones: ['+1234567890'],
1397
1396
  },
1398
1397
  };
1399
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1398
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1400
1399
  expect(result.mergedIdentity.traits?.emails).toContain('incoming@email.com');
1401
1400
  expect(result.mergedIdentity.traits?.emails).toContain('cached@email.com');
1402
1401
  expect(result.mergedIdentity.traits?.userIds).toEqual(['user1']);
@@ -1418,7 +1417,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1418
1417
  emails: ['old@email.com'],
1419
1418
  },
1420
1419
  };
1421
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1420
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1422
1421
  expect(result.staleTracker).toBeDefined();
1423
1422
  expect(result.staleTracker.isEmailsStale).toBe(true);
1424
1423
  expect(result.staleTracker.isIpAddressStale).toBe(true);
@@ -1439,8 +1438,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1439
1438
  userIds: ['user1'],
1440
1439
  },
1441
1440
  };
1442
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1443
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1441
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1442
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1444
1443
  expect(result.isCacheStale).toBe(false);
1445
1444
  expect(result.staleTraits).toEqual([]);
1446
1445
  expect(result.mergedIdentity.traits?.emails).toEqual(['cached@email.com']);
@@ -1459,8 +1458,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1459
1458
  identityId: 'test-id',
1460
1459
  traits: {},
1461
1460
  };
1462
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1463
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1461
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1462
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1464
1463
  expect(result.isCacheStale).toBe(true);
1465
1464
  expect(result.staleTraits).toContain('emails');
1466
1465
  expect(result.staleTraits).toContain('phones');
@@ -1476,8 +1475,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1476
1475
  identityId: 'test-id',
1477
1476
  traits: {},
1478
1477
  };
1479
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1480
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1478
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1479
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1481
1480
  expect(result.isCacheStale).toBe(false);
1482
1481
  expect(result.staleTraits).toEqual([]);
1483
1482
  });
@@ -1493,8 +1492,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1493
1492
  emails: ['cached@email.com'],
1494
1493
  },
1495
1494
  };
1496
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1497
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1495
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1496
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1498
1497
  expect(result.isCacheStale).toBe(false);
1499
1498
  });
1500
1499
  it('should handle undefined traits on cached identity', () => {
@@ -1507,8 +1506,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1507
1506
  const cachedIdentity = {
1508
1507
  identityId: 'test-id',
1509
1508
  };
1510
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1511
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1509
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1510
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1512
1511
  expect(result.isCacheStale).toBe(true);
1513
1512
  expect(result.staleTraits).toContain('emails');
1514
1513
  });
@@ -1519,8 +1518,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1519
1518
  const cachedIdentity = {
1520
1519
  identityId: 'test-id',
1521
1520
  };
1522
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1523
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1521
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1522
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1524
1523
  expect(result.isCacheStale).toBe(false);
1525
1524
  expect(result.staleTraits).toEqual([]);
1526
1525
  });
@@ -1537,8 +1536,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1537
1536
  emails: ['valid@email.com'],
1538
1537
  },
1539
1538
  };
1540
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1541
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1539
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1540
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1542
1541
  expect(result.isCacheStale).toBe(true);
1543
1542
  });
1544
1543
  });
@@ -1557,8 +1556,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1557
1556
  identityId: 'test-id',
1558
1557
  traits: {},
1559
1558
  };
1560
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1561
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1559
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1560
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1562
1561
  expect(result.isCacheStale).toBe(true);
1563
1562
  expect(result.staleTraits).toContain('clickInfos');
1564
1563
  });
@@ -1580,7 +1579,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1580
1579
  },
1581
1580
  },
1582
1581
  };
1583
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1582
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1584
1583
  expect(result.mergedIdentity.traits?.click?.gclid).toBe('cached_gclid');
1585
1584
  expect(result.mergedIdentity.traits?.click?.fbp).toBe('fb.1.cached.456');
1586
1585
  });
@@ -1603,8 +1602,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1603
1602
  },
1604
1603
  },
1605
1604
  };
1606
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1607
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1605
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1606
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1608
1607
  expect(result.isCacheStale).toBe(false);
1609
1608
  });
1610
1609
  it('should detect staleness when fbc changes (incoming has new fbc, cached has none)', () => {
@@ -1622,8 +1621,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1622
1621
  click: {},
1623
1622
  },
1624
1623
  };
1625
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1626
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1624
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1625
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1627
1626
  expect(result.isCacheStale).toBe(true);
1628
1627
  expect(result.staleTraits).toContain('clickInfos');
1629
1628
  });
@@ -1638,8 +1637,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1638
1637
  identityId: 'test-id',
1639
1638
  traits: { emails: ['test@email.com', 'other@email.com'] },
1640
1639
  };
1641
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1642
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1640
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1641
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.NONE);
1643
1642
  expect(result.staleTraits).toEqual([]);
1644
1643
  });
1645
1644
  it('should return volatile trait names for VOLATILE_ONLY tier', () => {
@@ -1657,8 +1656,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1657
1656
  emails: ['test@email.com'],
1658
1657
  },
1659
1658
  };
1660
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1661
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1659
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1660
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
1662
1661
  expect(result.staleTraits).toContain('ipAddress');
1663
1662
  expect(result.staleTraits).toContain('userAgent');
1664
1663
  expect(result.staleTraits).not.toContain('emails');
@@ -1678,8 +1677,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1678
1677
  addresses: [],
1679
1678
  },
1680
1679
  };
1681
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1682
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1680
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1681
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
1683
1682
  expect(result.staleTraits).toContain('addresses');
1684
1683
  });
1685
1684
  it('should return all stale identity trait names for IDENTITY_STALE tier', () => {
@@ -1699,8 +1698,8 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1699
1698
  userIds: ['user1'],
1700
1699
  },
1701
1700
  };
1702
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1703
- expect(result.staleTier).toBe(identity_cache_helper_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1701
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1702
+ expect(result.staleTier).toBe(at_shared_utils_1.IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
1704
1703
  expect(result.staleTraits).toContain('emails');
1705
1704
  expect(result.staleTraits).toContain('phones');
1706
1705
  expect(result.staleTraits).toContain('userIds');
@@ -1723,7 +1722,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1723
1722
  userIds: ['cacheduser'],
1724
1723
  },
1725
1724
  };
1726
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1725
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1727
1726
  expect(result.mergedIdentity.traits?.emails).toContain('incoming@email.com');
1728
1727
  expect(result.mergedIdentity.traits?.emails).toContain('cached@email.com');
1729
1728
  expect(result.mergedIdentity.traits?.emails).toContain('shared@email.com');
@@ -1740,7 +1739,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1740
1739
  identityId: 'cached-id-456',
1741
1740
  traits: { phones: ['+1234567890'] },
1742
1741
  };
1743
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1742
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1744
1743
  expect(result.mergedIdentity.identityId).toBe('incoming-id-123');
1745
1744
  });
1746
1745
  it('should merge addresses from both identities', () => {
@@ -1760,7 +1759,7 @@ describe('mergeAndComputeIdentityStaleness function', () => {
1760
1759
  ],
1761
1760
  },
1762
1761
  };
1763
- const result = (0, identity_cache_helper_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1762
+ const result = (0, at_shared_utils_1.mergeAndComputeIdentityStaleness)(incomingIdentity, cachedIdentity);
1764
1763
  expect(result.mergedIdentity.traits?.addresses).toHaveLength(2);
1765
1764
  expect(result.mergedIdentity.traits?.addresses).toEqual(expect.arrayContaining([
1766
1765
  expect.objectContaining({ city: 'IncomingCity' }),