@adtrackify/at-service-common 4.0.25 → 4.0.28

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 (849) hide show
  1. package/dist/cjs/__tests__/clients/acuity-client.spec.d.ts +1 -1
  2. package/dist/cjs/__tests__/clients/acuity-client.spec.js +43 -43
  3. package/dist/cjs/__tests__/clients/cross-platform-compression.spec.d.ts +1 -1
  4. package/dist/cjs/__tests__/clients/cross-platform-compression.spec.js +354 -354
  5. package/dist/cjs/__tests__/clients/dynamodb-client.spec.d.ts +1 -1
  6. package/dist/cjs/__tests__/clients/dynamodb-client.spec.js +194 -194
  7. package/dist/cjs/__tests__/clients/event-collector-client.spec.d.ts +1 -0
  8. package/dist/cjs/__tests__/clients/event-collector-client.spec.js +228 -0
  9. package/dist/cjs/__tests__/clients/event-collector-client.spec.js.map +1 -0
  10. package/dist/cjs/__tests__/clients/open-exchange-rates-client.spec.d.ts +1 -0
  11. package/dist/cjs/__tests__/clients/open-exchange-rates-client.spec.js +56 -0
  12. package/dist/cjs/__tests__/clients/open-exchange-rates-client.spec.js.map +1 -0
  13. package/dist/cjs/__tests__/clients/sqs-bundled-client.spec.d.ts +1 -1
  14. package/dist/cjs/__tests__/clients/sqs-bundled-client.spec.js +931 -931
  15. package/dist/cjs/__tests__/clients/sqs-bundling-contracts.spec.d.ts +1 -1
  16. package/dist/cjs/__tests__/clients/sqs-bundling-contracts.spec.js +563 -563
  17. package/dist/cjs/__tests__/clients/sqs-client.spec.d.ts +1 -1
  18. package/dist/cjs/__tests__/clients/sqs-client.spec.js +191 -191
  19. package/dist/cjs/__tests__/clients/sqs-unbundle.spec.d.ts +1 -1
  20. package/dist/cjs/__tests__/clients/sqs-unbundle.spec.js +1357 -1357
  21. package/dist/cjs/__tests__/db/contact-enrichments-db-service.spec.d.ts +1 -1
  22. package/dist/cjs/__tests__/db/contact-enrichments-db-service.spec.js +68 -68
  23. package/dist/cjs/__tests__/db/destinations-db-service.spec.d.ts +1 -1
  24. package/dist/cjs/__tests__/db/destinations-db-service.spec.js +125 -125
  25. package/dist/cjs/__tests__/db/products-db-service.spec.d.ts +1 -1
  26. package/dist/cjs/__tests__/db/products-db-service.spec.js +89 -89
  27. package/dist/cjs/__tests__/db/shared-read-db-services.spec.d.ts +1 -1
  28. package/dist/cjs/__tests__/db/shared-read-db-services.spec.js +89 -89
  29. package/dist/cjs/__tests__/db/shopify-app-installs-db-service.spec.d.ts +1 -1
  30. package/dist/cjs/__tests__/db/shopify-app-installs-db-service.spec.js +104 -104
  31. package/dist/cjs/__tests__/db/subscriptions-db-service.spec.d.ts +1 -1
  32. package/dist/cjs/__tests__/db/subscriptions-db-service.spec.js +95 -95
  33. package/dist/cjs/__tests__/db/user-accounts-db-service.spec.d.ts +1 -1
  34. package/dist/cjs/__tests__/db/user-accounts-db-service.spec.js +76 -76
  35. package/dist/cjs/__tests__/helpers/account-users-helper.spec.d.ts +1 -1
  36. package/dist/cjs/__tests__/helpers/account-users-helper.spec.js +220 -220
  37. package/dist/cjs/__tests__/helpers/acuity-helper.spec.d.ts +1 -1
  38. package/dist/cjs/__tests__/helpers/acuity-helper.spec.js +69 -69
  39. package/dist/cjs/__tests__/helpers/api-key-auth-helper.spec.d.ts +1 -1
  40. package/dist/cjs/__tests__/helpers/api-key-auth-helper.spec.js +82 -82
  41. package/dist/cjs/__tests__/helpers/cognito-auth-helper.spec.d.ts +1 -0
  42. package/dist/cjs/__tests__/helpers/cognito-auth-helper.spec.js +47 -0
  43. package/dist/cjs/__tests__/helpers/cognito-auth-helper.spec.js.map +1 -0
  44. package/dist/cjs/__tests__/helpers/public-api-response-helper.spec.d.ts +1 -1
  45. package/dist/cjs/__tests__/helpers/public-api-response-helper.spec.js +60 -60
  46. package/dist/cjs/__tests__/identity-cache/helpers.spec.d.ts +1 -1
  47. package/dist/cjs/__tests__/identity-cache/helpers.spec.js +592 -592
  48. package/dist/cjs/__tests__/identity-cache/identity-cache-db-service.spec.d.ts +1 -1
  49. package/dist/cjs/__tests__/identity-cache/identity-cache-db-service.spec.js +676 -676
  50. package/dist/cjs/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.d.ts +1 -1
  51. package/dist/cjs/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.js +555 -555
  52. package/dist/cjs/__tests__/identity-cache/identity-cache-tier-routing.spec.d.ts +1 -1
  53. package/dist/cjs/__tests__/identity-cache/identity-cache-tier-routing.spec.js +631 -631
  54. package/dist/cjs/__tests__/identity-cache/identity-client.spec.d.ts +1 -1
  55. package/dist/cjs/__tests__/identity-cache/identity-client.spec.js +359 -359
  56. package/dist/cjs/__tests__/identity-cache/identity-gateway-cache-hit.spec.d.ts +1 -1
  57. package/dist/cjs/__tests__/identity-cache/identity-gateway-cache-hit.spec.js +137 -137
  58. package/dist/cjs/__tests__/identity-cache/identity-gateway-cache-miss.spec.d.ts +1 -1
  59. package/dist/cjs/__tests__/identity-cache/identity-gateway-cache-miss.spec.js +152 -152
  60. package/dist/cjs/__tests__/identity-cache/identity-gateway-constructor.spec.d.ts +1 -1
  61. package/dist/cjs/__tests__/identity-cache/identity-gateway-constructor.spec.js +71 -71
  62. package/dist/cjs/__tests__/identity-cache/identity-gateway-edge-cases.spec.d.ts +1 -1
  63. package/dist/cjs/__tests__/identity-cache/identity-gateway-edge-cases.spec.js +88 -88
  64. package/dist/cjs/__tests__/identity-cache/identity-gateway-enqueue-async.spec.d.ts +1 -1
  65. package/dist/cjs/__tests__/identity-cache/identity-gateway-enqueue-async.spec.js +135 -135
  66. package/dist/cjs/__tests__/identity-cache/identity-gateway-stale-cache.spec.d.ts +1 -1
  67. package/dist/cjs/__tests__/identity-cache/identity-gateway-stale-cache.spec.js +223 -223
  68. package/dist/cjs/__tests__/identity-cache/identity-gateway-test-setup.d.ts +28 -28
  69. package/dist/cjs/__tests__/identity-cache/identity-gateway-test-setup.js +89 -89
  70. package/dist/cjs/__tests__/identity-cache/trait-merging-and-staleness.spec.d.ts +1 -1
  71. package/dist/cjs/__tests__/identity-cache/trait-merging-and-staleness.spec.js +1770 -1770
  72. package/dist/cjs/__tests__/identity-cache/volatile-traits-optimization.spec.d.ts +1 -1
  73. package/dist/cjs/__tests__/identity-cache/volatile-traits-optimization.spec.js +818 -818
  74. package/dist/cjs/__tests__/integration/sqs-bundling-roundtrip.spec.d.ts +1 -1
  75. package/dist/cjs/__tests__/integration/sqs-bundling-roundtrip.spec.js +584 -584
  76. package/dist/cjs/__tests__/libs/compress-decompress.spec.d.ts +1 -1
  77. package/dist/cjs/__tests__/libs/compress-decompress.spec.js +16 -16
  78. package/dist/cjs/__tests__/libs/contacts.spec.d.ts +1 -1
  79. package/dist/cjs/__tests__/libs/contacts.spec.js +294 -294
  80. package/dist/cjs/__tests__/libs/currency.spec.d.ts +1 -1
  81. package/dist/cjs/__tests__/libs/currency.spec.js +220 -220
  82. package/dist/cjs/__tests__/libs/dates.spec.d.ts +1 -1
  83. package/dist/cjs/__tests__/libs/dates.spec.js +130 -130
  84. package/dist/cjs/__tests__/libs/domain.spec.d.ts +1 -1
  85. package/dist/cjs/__tests__/libs/domain.spec.js +107 -107
  86. package/dist/cjs/__tests__/libs/numbers.spec.d.ts +1 -1
  87. package/dist/cjs/__tests__/libs/numbers.spec.js +261 -261
  88. package/dist/cjs/__tests__/s3-client/s3-client.spec.d.ts +1 -1
  89. package/dist/cjs/__tests__/s3-client/s3-client.spec.js +33 -33
  90. package/dist/cjs/__tests__/services/acuity-api-service.spec.d.ts +1 -1
  91. package/dist/cjs/__tests__/services/acuity-api-service.spec.js +71 -71
  92. package/dist/cjs/__tests__/services/cost/cost-calculation-types.spec.d.ts +1 -1
  93. package/dist/cjs/__tests__/services/cost/cost-calculation-types.spec.js +23 -23
  94. package/dist/cjs/__tests__/services/cost/cost-calculator-service.spec.d.ts +1 -1
  95. package/dist/cjs/__tests__/services/cost/cost-calculator-service.spec.js +3319 -3319
  96. package/dist/cjs/__tests__/services/cost/cost-currency-service.spec.d.ts +1 -1
  97. package/dist/cjs/__tests__/services/cost/cost-currency-service.spec.js +114 -114
  98. package/dist/cjs/__tests__/services/cost/cost-filter-service.spec.d.ts +1 -1
  99. package/dist/cjs/__tests__/services/cost/cost-filter-service.spec.js +468 -468
  100. package/dist/cjs/__tests__/services/cost/order-cost/order-cost-resolution-service.spec.d.ts +1 -1
  101. package/dist/cjs/__tests__/services/cost/order-cost/order-cost-resolution-service.spec.js +206 -206
  102. package/dist/cjs/__tests__/services/currency-exchange-rate-lookup-service.spec.d.ts +1 -1
  103. package/dist/cjs/__tests__/services/currency-exchange-rate-lookup-service.spec.js +34 -34
  104. package/dist/cjs/__tests__/services/email-verification/contact-email-verification-service.spec.d.ts +1 -1
  105. package/dist/cjs/__tests__/services/email-verification/contact-email-verification-service.spec.js +93 -93
  106. package/dist/cjs/__tests__/services/email-verification/email-verification-service.spec.d.ts +1 -1
  107. package/dist/cjs/__tests__/services/email-verification/email-verification-service.spec.js +57 -57
  108. package/dist/cjs/__tests__/services/events/collect-queue-tracking-service.spec.d.ts +1 -0
  109. package/dist/cjs/__tests__/services/events/collect-queue-tracking-service.spec.js +178 -0
  110. package/dist/cjs/__tests__/services/events/collect-queue-tracking-service.spec.js.map +1 -0
  111. package/dist/cjs/__tests__/services/events/tracking-event-sqs-service.spec.d.ts +1 -0
  112. package/dist/cjs/__tests__/services/events/tracking-event-sqs-service.spec.js +172 -0
  113. package/dist/cjs/__tests__/services/events/tracking-event-sqs-service.spec.js.map +1 -0
  114. package/dist/cjs/__tests__/shopify/shopify-graphql-transformer.spec.d.ts +1 -1
  115. package/dist/cjs/__tests__/shopify/shopify-graphql-transformer.spec.js +35 -35
  116. package/dist/cjs/__tests__/unit/libs/api-router/public-api-router.spec.d.ts +1 -1
  117. package/dist/cjs/__tests__/unit/libs/api-router/public-api-router.spec.js +181 -181
  118. package/dist/cjs/__tests__/unit/libs/api-router/route-matcher.spec.d.ts +1 -1
  119. package/dist/cjs/__tests__/unit/libs/api-router/route-matcher.spec.js +69 -69
  120. package/dist/cjs/__tests__/utils/custom-measure-formula-utils.spec.d.ts +1 -1
  121. package/dist/cjs/__tests__/utils/custom-measure-formula-utils.spec.js +146 -146
  122. package/dist/cjs/clients/generic/cognito-client.d.ts +23 -23
  123. package/dist/cjs/clients/generic/cognito-client.js +209 -209
  124. package/dist/cjs/clients/generic/dynamodb-client.d.ts +20 -20
  125. package/dist/cjs/clients/generic/dynamodb-client.js +235 -235
  126. package/dist/cjs/clients/generic/eventbridge-client.d.ts +14 -14
  127. package/dist/cjs/clients/generic/eventbridge-client.js +51 -51
  128. package/dist/cjs/clients/generic/http-client.d.ts +14 -14
  129. package/dist/cjs/clients/generic/http-client.js +61 -61
  130. package/dist/cjs/clients/generic/index.d.ts +13 -13
  131. package/dist/cjs/clients/generic/index.js +29 -29
  132. package/dist/cjs/clients/generic/lambda-invoke-client.d.ts +10 -10
  133. package/dist/cjs/clients/generic/lambda-invoke-client.js +39 -39
  134. package/dist/cjs/clients/generic/location-client.d.ts +8 -8
  135. package/dist/cjs/clients/generic/location-client.js +31 -31
  136. package/dist/cjs/clients/generic/redis-client.d.ts +33 -33
  137. package/dist/cjs/clients/generic/redis-client.js +191 -191
  138. package/dist/cjs/clients/generic/s3-client.d.ts +23 -23
  139. package/dist/cjs/clients/generic/s3-client.js +216 -216
  140. package/dist/cjs/clients/generic/singlestore-db-client.d.ts +14 -14
  141. package/dist/cjs/clients/generic/singlestore-db-client.js +67 -67
  142. package/dist/cjs/clients/generic/sqs-bundled-client.d.ts +15 -15
  143. package/dist/cjs/clients/generic/sqs-bundled-client.js +311 -311
  144. package/dist/cjs/clients/generic/sqs-bundled-client.types.d.ts +53 -53
  145. package/dist/cjs/clients/generic/sqs-bundled-client.types.js +17 -17
  146. package/dist/cjs/clients/generic/sqs-client.d.ts +53 -53
  147. package/dist/cjs/clients/generic/sqs-client.js +285 -285
  148. package/dist/cjs/clients/generic/sqs-unbundle.d.ts +32 -32
  149. package/dist/cjs/clients/generic/sqs-unbundle.js +144 -144
  150. package/dist/cjs/clients/index.d.ts +3 -3
  151. package/dist/cjs/clients/index.js +19 -19
  152. package/dist/cjs/clients/internal-api/accounts-client.d.ts +91 -91
  153. package/dist/cjs/clients/internal-api/accounts-client.js +129 -129
  154. package/dist/cjs/clients/internal-api/cache-lambda-client.d.ts +26 -26
  155. package/dist/cjs/clients/internal-api/cache-lambda-client.js +89 -89
  156. package/dist/cjs/clients/internal-api/db-management-client.d.ts +18 -18
  157. package/dist/cjs/clients/internal-api/db-management-client.js +36 -36
  158. package/dist/cjs/clients/internal-api/destinations-client.d.ts +34 -34
  159. package/dist/cjs/clients/internal-api/destinations-client.js +79 -79
  160. package/dist/cjs/clients/internal-api/event-collector-client.d.ts +122 -20
  161. package/dist/cjs/clients/internal-api/event-collector-client.js +78 -36
  162. package/dist/cjs/clients/internal-api/event-collector-client.js.map +1 -1
  163. package/dist/cjs/clients/internal-api/identity-client.d.ts +41 -41
  164. package/dist/cjs/clients/internal-api/identity-client.js +137 -137
  165. package/dist/cjs/clients/internal-api/index.d.ts +9 -9
  166. package/dist/cjs/clients/internal-api/index.js +25 -25
  167. package/dist/cjs/clients/internal-api/shopify-app-install-client.d.ts +37 -37
  168. package/dist/cjs/clients/internal-api/shopify-app-install-client.js +81 -81
  169. package/dist/cjs/clients/internal-api/subscriptions-client.d.ts +26 -26
  170. package/dist/cjs/clients/internal-api/subscriptions-client.js +77 -77
  171. package/dist/cjs/clients/internal-api/users-auth-client.d.ts +35 -35
  172. package/dist/cjs/clients/internal-api/users-auth-client.js +110 -110
  173. package/dist/cjs/clients/third-party/acuity-client.d.ts +10 -10
  174. package/dist/cjs/clients/third-party/acuity-client.js +40 -40
  175. package/dist/cjs/clients/third-party/emailable-client.d.ts +7 -7
  176. package/dist/cjs/clients/third-party/emailable-client.js +25 -25
  177. package/dist/cjs/clients/third-party/exchange-rate-api-client.d.ts +17 -17
  178. package/dist/cjs/clients/third-party/exchange-rate-api-client.js +19 -19
  179. package/dist/cjs/clients/third-party/index.d.ts +6 -5
  180. package/dist/cjs/clients/third-party/index.js +22 -21
  181. package/dist/cjs/clients/third-party/index.js.map +1 -1
  182. package/dist/cjs/clients/third-party/loops-client.d.ts +10 -10
  183. package/dist/cjs/clients/third-party/loops-client.js +30 -30
  184. package/dist/cjs/clients/third-party/open-exchange-rates-client.d.ts +8 -0
  185. package/dist/cjs/clients/third-party/open-exchange-rates-client.js +28 -0
  186. package/dist/cjs/clients/third-party/open-exchange-rates-client.js.map +1 -0
  187. package/dist/cjs/clients/third-party/shopify/graphql-order-queries.d.ts +25 -25
  188. package/dist/cjs/clients/third-party/shopify/graphql-order-queries.js +4 -4
  189. package/dist/cjs/clients/third-party/shopify/graphql-product-queries.d.ts +2 -2
  190. package/dist/cjs/clients/third-party/shopify/graphql-product-queries.js +5 -5
  191. package/dist/cjs/clients/third-party/shopify/shopify-graphql-client.d.ts +10 -10
  192. package/dist/cjs/clients/third-party/shopify/shopify-graphql-client.js +161 -161
  193. package/dist/cjs/clients/third-party/shopify-client.d.ts +29 -29
  194. package/dist/cjs/clients/third-party/shopify-client.js +146 -146
  195. package/dist/cjs/constants/index.d.ts +1 -1
  196. package/dist/cjs/constants/index.js +17 -17
  197. package/dist/cjs/constants/sqs.d.ts +20 -20
  198. package/dist/cjs/constants/sqs.js +26 -26
  199. package/dist/cjs/helpers/account-users-helper.d.ts +2 -2
  200. package/dist/cjs/helpers/account-users-helper.js +22 -22
  201. package/dist/cjs/helpers/acuity-helper.d.ts +4 -4
  202. package/dist/cjs/helpers/acuity-helper.js +56 -56
  203. package/dist/cjs/helpers/api-key-auth-helper.d.ts +9 -9
  204. package/dist/cjs/helpers/api-key-auth-helper.js +40 -40
  205. package/dist/cjs/helpers/api-key-authorizer-helper.d.ts +36 -36
  206. package/dist/cjs/helpers/api-key-authorizer-helper.js +87 -87
  207. package/dist/cjs/helpers/cognito-auth-helper.d.ts +5 -0
  208. package/dist/cjs/helpers/cognito-auth-helper.js +15 -0
  209. package/dist/cjs/helpers/cognito-auth-helper.js.map +1 -0
  210. package/dist/cjs/helpers/index.d.ts +11 -10
  211. package/dist/cjs/helpers/index.js +27 -26
  212. package/dist/cjs/helpers/index.js.map +1 -1
  213. package/dist/cjs/helpers/input-validation-helper.d.ts +3 -3
  214. package/dist/cjs/helpers/input-validation-helper.js +22 -22
  215. package/dist/cjs/helpers/logging-helper.d.ts +16 -16
  216. package/dist/cjs/helpers/logging-helper.js +84 -84
  217. package/dist/cjs/helpers/public-api-response-helper.d.ts +21 -21
  218. package/dist/cjs/helpers/public-api-response-helper.js +45 -45
  219. package/dist/cjs/helpers/response-helper.d.ts +18 -18
  220. package/dist/cjs/helpers/response-helper.js +43 -43
  221. package/dist/cjs/helpers/shopify-helper.d.ts +9 -9
  222. package/dist/cjs/helpers/shopify-helper.js +26 -26
  223. package/dist/cjs/helpers/sqs-utils.d.ts +6 -6
  224. package/dist/cjs/helpers/sqs-utils.js +14 -14
  225. package/dist/cjs/index.d.ts +7 -7
  226. package/dist/cjs/index.js +23 -23
  227. package/dist/cjs/libs/api-router/index.d.ts +2 -2
  228. package/dist/cjs/libs/api-router/index.js +18 -18
  229. package/dist/cjs/libs/api-router/public-api-router.d.ts +3 -3
  230. package/dist/cjs/libs/api-router/public-api-router.js +36 -36
  231. package/dist/cjs/libs/api-router/route-matcher.d.ts +21 -21
  232. package/dist/cjs/libs/api-router/route-matcher.js +36 -36
  233. package/dist/cjs/libs/click-id-parser.d.ts +23 -23
  234. package/dist/cjs/libs/click-id-parser.js +49 -49
  235. package/dist/cjs/libs/compression.d.ts +2 -2
  236. package/dist/cjs/libs/compression.js +33 -33
  237. package/dist/cjs/libs/contacts.d.ts +7 -7
  238. package/dist/cjs/libs/contacts.js +152 -152
  239. package/dist/cjs/libs/cookie.d.ts +17 -17
  240. package/dist/cjs/libs/cookie.js +76 -76
  241. package/dist/cjs/libs/crypto.d.ts +4 -4
  242. package/dist/cjs/libs/crypto.js +25 -25
  243. package/dist/cjs/libs/csv.d.ts +2 -2
  244. package/dist/cjs/libs/csv.js +35 -35
  245. package/dist/cjs/libs/currency.d.ts +1 -1
  246. package/dist/cjs/libs/currency.js +29 -29
  247. package/dist/cjs/libs/dates.d.ts +12 -12
  248. package/dist/cjs/libs/dates.js +96 -96
  249. package/dist/cjs/libs/domain.d.ts +2 -2
  250. package/dist/cjs/libs/domain.js +38 -38
  251. package/dist/cjs/libs/emails.d.ts +8 -8
  252. package/dist/cjs/libs/emails.js +154 -154
  253. package/dist/cjs/libs/http-error.d.ts +21 -21
  254. package/dist/cjs/libs/http-error.js +63 -63
  255. package/dist/cjs/libs/http-status-codes.d.ts +58 -58
  256. package/dist/cjs/libs/http-status-codes.js +62 -62
  257. package/dist/cjs/libs/index.d.ts +19 -19
  258. package/dist/cjs/libs/index.js +35 -35
  259. package/dist/cjs/libs/numbers.d.ts +1 -1
  260. package/dist/cjs/libs/numbers.js +15 -15
  261. package/dist/cjs/libs/referrer-parser/index.d.ts +2 -2
  262. package/dist/cjs/libs/referrer-parser/index.js +18 -18
  263. package/dist/cjs/libs/referrer-parser/referrer-data.d.ts +9 -9
  264. package/dist/cjs/libs/referrer-parser/referrer-data.js +3307 -3307
  265. package/dist/cjs/libs/referrer-parser/referrer-parser-util.d.ts +20 -20
  266. package/dist/cjs/libs/referrer-parser/referrer-parser-util.js +131 -131
  267. package/dist/cjs/libs/strings.d.ts +3 -3
  268. package/dist/cjs/libs/strings.js +46 -46
  269. package/dist/cjs/libs/traits.d.ts +6 -6
  270. package/dist/cjs/libs/traits.js +65 -65
  271. package/dist/cjs/libs/url.d.ts +1 -1
  272. package/dist/cjs/libs/url.js +13 -13
  273. package/dist/cjs/services/acuity-api-service.d.ts +9 -9
  274. package/dist/cjs/services/acuity-api-service.js +73 -73
  275. package/dist/cjs/services/cache/generic-cached-object.d.ts +5 -5
  276. package/dist/cjs/services/cache/generic-cached-object.js +2 -2
  277. package/dist/cjs/services/cache/index.d.ts +1 -1
  278. package/dist/cjs/services/cache/index.js +17 -17
  279. package/dist/cjs/services/cache/product-cache-service.d.ts +21 -21
  280. package/dist/cjs/services/cache/product-cache-service.js +76 -76
  281. package/dist/cjs/services/cost/cost-calculation-types.d.ts +69 -69
  282. package/dist/cjs/services/cost/cost-calculation-types.js +19 -19
  283. package/dist/cjs/services/cost/cost-calculator-service.d.ts +24 -24
  284. package/dist/cjs/services/cost/cost-calculator-service.js +456 -456
  285. package/dist/cjs/services/cost/cost-currency-service.d.ts +6 -6
  286. package/dist/cjs/services/cost/cost-currency-service.js +87 -87
  287. package/dist/cjs/services/cost/cost-filter-service.d.ts +10 -10
  288. package/dist/cjs/services/cost/cost-filter-service.js +121 -121
  289. package/dist/cjs/services/cost/index.d.ts +5 -5
  290. package/dist/cjs/services/cost/index.js +21 -21
  291. package/dist/cjs/services/cost/order-cost/index.d.ts +2 -2
  292. package/dist/cjs/services/cost/order-cost/index.js +18 -18
  293. package/dist/cjs/services/cost/order-cost/order-cost-resolution-service.d.ts +23 -23
  294. package/dist/cjs/services/cost/order-cost/order-cost-resolution-service.js +361 -361
  295. package/dist/cjs/services/cost/order-cost/order-cost-resolution-types.d.ts +37 -37
  296. package/dist/cjs/services/cost/order-cost/order-cost-resolution-types.js +2 -2
  297. package/dist/cjs/services/currency-exchange-rate-lookup-service.d.ts +12 -12
  298. package/dist/cjs/services/currency-exchange-rate-lookup-service.js +94 -94
  299. package/dist/cjs/services/db/accounts-db-service.d.ts +9 -9
  300. package/dist/cjs/services/db/accounts-db-service.js +33 -33
  301. package/dist/cjs/services/db/api-keys-db-service.d.ts +10 -10
  302. package/dist/cjs/services/db/api-keys-db-service.js +36 -36
  303. package/dist/cjs/services/db/contact-enrichments-db-service.d.ts +15 -15
  304. package/dist/cjs/services/db/contact-enrichments-db-service.js +94 -94
  305. package/dist/cjs/services/db/currency-exchange-rates-db-service.d.ts +21 -21
  306. package/dist/cjs/services/db/currency-exchange-rates-db-service.js +39 -39
  307. package/dist/cjs/services/db/custom-measures-db-service.d.ts +14 -14
  308. package/dist/cjs/services/db/custom-measures-db-service.js +48 -48
  309. package/dist/cjs/services/db/destinations-db-service.d.ts +13 -13
  310. package/dist/cjs/services/db/destinations-db-service.js +74 -74
  311. package/dist/cjs/services/db/identity-cache-db-service.d.ts +28 -28
  312. package/dist/cjs/services/db/identity-cache-db-service.js +320 -320
  313. package/dist/cjs/services/db/identity-cache-dynamodb-service/constants.d.ts +3 -3
  314. package/dist/cjs/services/db/identity-cache-dynamodb-service/constants.js +6 -6
  315. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.d.ts +20 -20
  316. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.js +362 -362
  317. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-gateway-service.d.ts +23 -23
  318. package/dist/cjs/services/db/identity-cache-dynamodb-service/identity-gateway-service.js +222 -222
  319. package/dist/cjs/services/db/identity-cache-dynamodb-service/index.d.ts +4 -4
  320. package/dist/cjs/services/db/identity-cache-dynamodb-service/index.js +20 -20
  321. package/dist/cjs/services/db/identity-cache-dynamodb-service/key-builders.d.ts +12 -12
  322. package/dist/cjs/services/db/identity-cache-dynamodb-service/key-builders.js +31 -31
  323. package/dist/cjs/services/db/identity-cache-dynamodb-service/types.d.ts +71 -71
  324. package/dist/cjs/services/db/identity-cache-dynamodb-service/types.js +28 -28
  325. package/dist/cjs/services/db/index.d.ts +22 -22
  326. package/dist/cjs/services/db/index.js +38 -38
  327. package/dist/cjs/services/db/log-events-db-service.d.ts +11 -11
  328. package/dist/cjs/services/db/log-events-db-service.js +181 -181
  329. package/dist/cjs/services/db/pixels-db-service.d.ts +8 -8
  330. package/dist/cjs/services/db/pixels-db-service.js +35 -35
  331. package/dist/cjs/services/db/products-db-service-types.d.ts +10 -10
  332. package/dist/cjs/services/db/products-db-service-types.js +2 -2
  333. package/dist/cjs/services/db/products-db-service.d.ts +19 -19
  334. package/dist/cjs/services/db/products-db-service.js +281 -281
  335. package/dist/cjs/services/db/purchasable-contacts-db-service.d.ts +9 -9
  336. package/dist/cjs/services/db/purchasable-contacts-db-service.js +43 -43
  337. package/dist/cjs/services/db/purchased-contacts/index.d.ts +2 -2
  338. package/dist/cjs/services/db/purchased-contacts/index.js +18 -18
  339. package/dist/cjs/services/db/purchased-contacts/purchased-contacts-db-service.d.ts +18 -18
  340. package/dist/cjs/services/db/purchased-contacts/purchased-contacts-db-service.js +152 -152
  341. package/dist/cjs/services/db/purchased-contacts/types.d.ts +11 -11
  342. package/dist/cjs/services/db/purchased-contacts/types.js +2 -2
  343. package/dist/cjs/services/db/shopify-app-installs-db-service.d.ts +10 -10
  344. package/dist/cjs/services/db/shopify-app-installs-db-service.js +52 -52
  345. package/dist/cjs/services/db/shopify-products-cache-db-service.d.ts +16 -16
  346. package/dist/cjs/services/db/shopify-products-cache-db-service.js +73 -73
  347. package/dist/cjs/services/db/subscriptions-db-service.d.ts +11 -11
  348. package/dist/cjs/services/db/subscriptions-db-service.js +38 -38
  349. package/dist/cjs/services/db/tracking-events-db-service.d.ts +21 -21
  350. package/dist/cjs/services/db/tracking-events-db-service.js +188 -188
  351. package/dist/cjs/services/db/user-accounts-db-service.d.ts +7 -7
  352. package/dist/cjs/services/db/user-accounts-db-service.js +17 -17
  353. package/dist/cjs/services/email-verification/contact-email-verification-service.d.ts +7 -7
  354. package/dist/cjs/services/email-verification/contact-email-verification-service.js +101 -101
  355. package/dist/cjs/services/email-verification/email-verification-service.d.ts +19 -19
  356. package/dist/cjs/services/email-verification/email-verification-service.js +131 -131
  357. package/dist/cjs/services/email-verification/index.d.ts +2 -2
  358. package/dist/cjs/services/email-verification/index.js +18 -18
  359. package/dist/cjs/services/eventbridge-integration-service.d.ts +9 -9
  360. package/dist/cjs/services/eventbridge-integration-service.js +28 -28
  361. package/dist/cjs/services/events/build-collect-queue-tracking-event.d.ts +14 -0
  362. package/dist/cjs/services/events/build-collect-queue-tracking-event.js +26 -0
  363. package/dist/cjs/services/events/build-collect-queue-tracking-event.js.map +1 -0
  364. package/dist/cjs/services/events/collect-queue-tracking-service.d.ts +9 -0
  365. package/dist/cjs/services/events/collect-queue-tracking-service.js +23 -0
  366. package/dist/cjs/services/events/collect-queue-tracking-service.js.map +1 -0
  367. package/dist/cjs/services/events/index.d.ts +5 -3
  368. package/dist/cjs/services/events/index.js +21 -19
  369. package/dist/cjs/services/events/index.js.map +1 -1
  370. package/dist/cjs/services/events/log-event-service.d.ts +19 -19
  371. package/dist/cjs/services/events/log-event-service.js +77 -77
  372. package/dist/cjs/services/events/metric-event-service.d.ts +9 -9
  373. package/dist/cjs/services/events/metric-event-service.js +49 -49
  374. package/dist/cjs/services/events/tracking-event-sqs-service.d.ts +8 -8
  375. package/dist/cjs/services/events/tracking-event-sqs-service.js +36 -34
  376. package/dist/cjs/services/events/tracking-event-sqs-service.js.map +1 -1
  377. package/dist/cjs/services/generic-cache-service.d.ts +7 -7
  378. package/dist/cjs/services/generic-cache-service.js +33 -33
  379. package/dist/cjs/services/index.d.ts +11 -11
  380. package/dist/cjs/services/index.js +27 -27
  381. package/dist/cjs/services/ipdata-lookup-service.d.ts +20 -20
  382. package/dist/cjs/services/ipdata-lookup-service.js +112 -112
  383. package/dist/cjs/services/shopify/index.d.ts +2 -2
  384. package/dist/cjs/services/shopify/index.js +18 -18
  385. package/dist/cjs/services/shopify/products/index.d.ts +1 -1
  386. package/dist/cjs/services/shopify/products/index.js +17 -17
  387. package/dist/cjs/services/shopify/products/shopify-products-serviceV2.d.ts +17 -17
  388. package/dist/cjs/services/shopify/products/shopify-products-serviceV2.js +112 -112
  389. package/dist/cjs/services/shopify/shopify-graphql-transformer.d.ts +8 -8
  390. package/dist/cjs/services/shopify/shopify-graphql-transformer.js +141 -141
  391. package/dist/cjs/types/acuity-types.d.ts +74 -74
  392. package/dist/cjs/types/acuity-types.js +2 -2
  393. package/dist/cjs/types/api-response.d.ts +6 -6
  394. package/dist/cjs/types/api-response.js +2 -2
  395. package/dist/cjs/types/index.d.ts +6 -5
  396. package/dist/cjs/types/index.js +35 -34
  397. package/dist/cjs/types/index.js.map +1 -1
  398. package/dist/cjs/types/internal-events/event-detail-types.d.ts +20 -20
  399. package/dist/cjs/types/internal-events/event-detail-types.js +27 -27
  400. package/dist/cjs/types/internal-events/index.d.ts +1 -1
  401. package/dist/cjs/types/internal-events/index.js +17 -17
  402. package/dist/cjs/types/open-exchange-rates-types.d.ts +10 -0
  403. package/dist/cjs/types/open-exchange-rates-types.js +3 -0
  404. package/dist/cjs/types/open-exchange-rates-types.js.map +1 -0
  405. package/dist/cjs/types/public-api-types.d.ts +24 -24
  406. package/dist/cjs/types/public-api-types.js +13 -13
  407. package/dist/cjs/types/shopify-graphql-types/admin.generated.d.ts +123 -123
  408. package/dist/cjs/types/shopify-graphql-types/admin.generated.js +2 -2
  409. package/dist/cjs/types/shopify-graphql-types/admin.types.d.ts +26289 -26289
  410. package/dist/cjs/types/shopify-graphql-types/admin.types.js +5311 -5311
  411. package/dist/cjs/types/shopify-graphql-types/index.d.ts +2 -2
  412. package/dist/cjs/types/shopify-graphql-types/index.js +18 -18
  413. package/dist/cjs/types/shopify-rest-types.d.ts +767 -767
  414. package/dist/cjs/types/shopify-rest-types.js +2 -2
  415. package/dist/cjs/utils/compression.d.ts +36 -36
  416. package/dist/cjs/utils/compression.js +198 -198
  417. package/dist/cjs/utils/custom-measure-formula-utils.d.ts +6 -6
  418. package/dist/cjs/utils/custom-measure-formula-utils.js +209 -209
  419. package/dist/cjs/utils/index.d.ts +4 -4
  420. package/dist/cjs/utils/index.js +20 -20
  421. package/dist/cjs/utils/retry-envelope.d.ts +12 -12
  422. package/dist/cjs/utils/retry-envelope.js +28 -28
  423. package/dist/cjs/utils/size.d.ts +2 -2
  424. package/dist/cjs/utils/size.js +49 -49
  425. package/dist/esm/__tests__/clients/acuity-client.spec.d.ts +1 -1
  426. package/dist/esm/__tests__/clients/acuity-client.spec.js +41 -41
  427. package/dist/esm/__tests__/clients/cross-platform-compression.spec.d.ts +1 -1
  428. package/dist/esm/__tests__/clients/cross-platform-compression.spec.js +329 -329
  429. package/dist/esm/__tests__/clients/dynamodb-client.spec.d.ts +1 -1
  430. package/dist/esm/__tests__/clients/dynamodb-client.spec.js +192 -192
  431. package/dist/esm/__tests__/clients/event-collector-client.spec.d.ts +1 -0
  432. package/dist/esm/__tests__/clients/event-collector-client.spec.js +226 -0
  433. package/dist/esm/__tests__/clients/event-collector-client.spec.js.map +1 -0
  434. package/dist/esm/__tests__/clients/open-exchange-rates-client.spec.d.ts +1 -0
  435. package/dist/esm/__tests__/clients/open-exchange-rates-client.spec.js +54 -0
  436. package/dist/esm/__tests__/clients/open-exchange-rates-client.spec.js.map +1 -0
  437. package/dist/esm/__tests__/clients/sqs-bundled-client.spec.d.ts +1 -1
  438. package/dist/esm/__tests__/clients/sqs-bundled-client.spec.js +906 -906
  439. package/dist/esm/__tests__/clients/sqs-bundling-contracts.spec.d.ts +1 -1
  440. package/dist/esm/__tests__/clients/sqs-bundling-contracts.spec.js +538 -538
  441. package/dist/esm/__tests__/clients/sqs-client.spec.d.ts +1 -1
  442. package/dist/esm/__tests__/clients/sqs-client.spec.js +189 -189
  443. package/dist/esm/__tests__/clients/sqs-unbundle.spec.d.ts +1 -1
  444. package/dist/esm/__tests__/clients/sqs-unbundle.spec.js +1355 -1355
  445. package/dist/esm/__tests__/db/contact-enrichments-db-service.spec.d.ts +1 -1
  446. package/dist/esm/__tests__/db/contact-enrichments-db-service.spec.js +66 -66
  447. package/dist/esm/__tests__/db/destinations-db-service.spec.d.ts +1 -1
  448. package/dist/esm/__tests__/db/destinations-db-service.spec.js +123 -123
  449. package/dist/esm/__tests__/db/products-db-service.spec.d.ts +1 -1
  450. package/dist/esm/__tests__/db/products-db-service.spec.js +87 -87
  451. package/dist/esm/__tests__/db/shared-read-db-services.spec.d.ts +1 -1
  452. package/dist/esm/__tests__/db/shared-read-db-services.spec.js +87 -87
  453. package/dist/esm/__tests__/db/shopify-app-installs-db-service.spec.d.ts +1 -1
  454. package/dist/esm/__tests__/db/shopify-app-installs-db-service.spec.js +102 -102
  455. package/dist/esm/__tests__/db/subscriptions-db-service.spec.d.ts +1 -1
  456. package/dist/esm/__tests__/db/subscriptions-db-service.spec.js +93 -93
  457. package/dist/esm/__tests__/db/user-accounts-db-service.spec.d.ts +1 -1
  458. package/dist/esm/__tests__/db/user-accounts-db-service.spec.js +74 -74
  459. package/dist/esm/__tests__/helpers/account-users-helper.spec.d.ts +1 -1
  460. package/dist/esm/__tests__/helpers/account-users-helper.spec.js +218 -218
  461. package/dist/esm/__tests__/helpers/acuity-helper.spec.d.ts +1 -1
  462. package/dist/esm/__tests__/helpers/acuity-helper.spec.js +67 -67
  463. package/dist/esm/__tests__/helpers/api-key-auth-helper.spec.d.ts +1 -1
  464. package/dist/esm/__tests__/helpers/api-key-auth-helper.spec.js +80 -80
  465. package/dist/esm/__tests__/helpers/cognito-auth-helper.spec.d.ts +1 -0
  466. package/dist/esm/__tests__/helpers/cognito-auth-helper.spec.js +45 -0
  467. package/dist/esm/__tests__/helpers/cognito-auth-helper.spec.js.map +1 -0
  468. package/dist/esm/__tests__/helpers/public-api-response-helper.spec.d.ts +1 -1
  469. package/dist/esm/__tests__/helpers/public-api-response-helper.spec.js +55 -55
  470. package/dist/esm/__tests__/identity-cache/helpers.spec.d.ts +1 -1
  471. package/dist/esm/__tests__/identity-cache/helpers.spec.js +590 -590
  472. package/dist/esm/__tests__/identity-cache/identity-cache-db-service.spec.d.ts +1 -1
  473. package/dist/esm/__tests__/identity-cache/identity-cache-db-service.spec.js +674 -674
  474. package/dist/esm/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.d.ts +1 -1
  475. package/dist/esm/__tests__/identity-cache/identity-cache-dynamodb-db-service.spec.js +553 -553
  476. package/dist/esm/__tests__/identity-cache/identity-cache-tier-routing.spec.d.ts +1 -1
  477. package/dist/esm/__tests__/identity-cache/identity-cache-tier-routing.spec.js +629 -629
  478. package/dist/esm/__tests__/identity-cache/identity-client.spec.d.ts +1 -1
  479. package/dist/esm/__tests__/identity-cache/identity-client.spec.js +357 -357
  480. package/dist/esm/__tests__/identity-cache/identity-gateway-cache-hit.spec.d.ts +1 -1
  481. package/dist/esm/__tests__/identity-cache/identity-gateway-cache-hit.spec.js +135 -135
  482. package/dist/esm/__tests__/identity-cache/identity-gateway-cache-miss.spec.d.ts +1 -1
  483. package/dist/esm/__tests__/identity-cache/identity-gateway-cache-miss.spec.js +150 -150
  484. package/dist/esm/__tests__/identity-cache/identity-gateway-constructor.spec.d.ts +1 -1
  485. package/dist/esm/__tests__/identity-cache/identity-gateway-constructor.spec.js +69 -69
  486. package/dist/esm/__tests__/identity-cache/identity-gateway-edge-cases.spec.d.ts +1 -1
  487. package/dist/esm/__tests__/identity-cache/identity-gateway-edge-cases.spec.js +86 -86
  488. package/dist/esm/__tests__/identity-cache/identity-gateway-enqueue-async.spec.d.ts +1 -1
  489. package/dist/esm/__tests__/identity-cache/identity-gateway-enqueue-async.spec.js +133 -133
  490. package/dist/esm/__tests__/identity-cache/identity-gateway-stale-cache.spec.d.ts +1 -1
  491. package/dist/esm/__tests__/identity-cache/identity-gateway-stale-cache.spec.js +221 -221
  492. package/dist/esm/__tests__/identity-cache/identity-gateway-test-setup.d.ts +28 -28
  493. package/dist/esm/__tests__/identity-cache/identity-gateway-test-setup.js +82 -82
  494. package/dist/esm/__tests__/identity-cache/trait-merging-and-staleness.spec.d.ts +1 -1
  495. package/dist/esm/__tests__/identity-cache/trait-merging-and-staleness.spec.js +1768 -1768
  496. package/dist/esm/__tests__/identity-cache/volatile-traits-optimization.spec.d.ts +1 -1
  497. package/dist/esm/__tests__/identity-cache/volatile-traits-optimization.spec.js +816 -816
  498. package/dist/esm/__tests__/integration/sqs-bundling-roundtrip.spec.d.ts +1 -1
  499. package/dist/esm/__tests__/integration/sqs-bundling-roundtrip.spec.js +582 -582
  500. package/dist/esm/__tests__/libs/compress-decompress.spec.d.ts +1 -1
  501. package/dist/esm/__tests__/libs/compress-decompress.spec.js +14 -14
  502. package/dist/esm/__tests__/libs/contacts.spec.d.ts +1 -1
  503. package/dist/esm/__tests__/libs/contacts.spec.js +292 -292
  504. package/dist/esm/__tests__/libs/currency.spec.d.ts +1 -1
  505. package/dist/esm/__tests__/libs/currency.spec.js +218 -218
  506. package/dist/esm/__tests__/libs/dates.spec.d.ts +1 -1
  507. package/dist/esm/__tests__/libs/dates.spec.js +128 -128
  508. package/dist/esm/__tests__/libs/domain.spec.d.ts +1 -1
  509. package/dist/esm/__tests__/libs/domain.spec.js +105 -105
  510. package/dist/esm/__tests__/libs/numbers.spec.d.ts +1 -1
  511. package/dist/esm/__tests__/libs/numbers.spec.js +259 -259
  512. package/dist/esm/__tests__/s3-client/s3-client.spec.d.ts +1 -1
  513. package/dist/esm/__tests__/s3-client/s3-client.spec.js +31 -31
  514. package/dist/esm/__tests__/services/acuity-api-service.spec.d.ts +1 -1
  515. package/dist/esm/__tests__/services/acuity-api-service.spec.js +69 -69
  516. package/dist/esm/__tests__/services/cost/cost-calculation-types.spec.d.ts +1 -1
  517. package/dist/esm/__tests__/services/cost/cost-calculation-types.spec.js +21 -21
  518. package/dist/esm/__tests__/services/cost/cost-calculator-service.spec.d.ts +1 -1
  519. package/dist/esm/__tests__/services/cost/cost-calculator-service.spec.js +3317 -3317
  520. package/dist/esm/__tests__/services/cost/cost-currency-service.spec.d.ts +1 -1
  521. package/dist/esm/__tests__/services/cost/cost-currency-service.spec.js +112 -112
  522. package/dist/esm/__tests__/services/cost/cost-filter-service.spec.d.ts +1 -1
  523. package/dist/esm/__tests__/services/cost/cost-filter-service.spec.js +466 -466
  524. package/dist/esm/__tests__/services/cost/order-cost/order-cost-resolution-service.spec.d.ts +1 -1
  525. package/dist/esm/__tests__/services/cost/order-cost/order-cost-resolution-service.spec.js +204 -204
  526. package/dist/esm/__tests__/services/currency-exchange-rate-lookup-service.spec.d.ts +1 -1
  527. package/dist/esm/__tests__/services/currency-exchange-rate-lookup-service.spec.js +32 -32
  528. package/dist/esm/__tests__/services/email-verification/contact-email-verification-service.spec.d.ts +1 -1
  529. package/dist/esm/__tests__/services/email-verification/contact-email-verification-service.spec.js +91 -91
  530. package/dist/esm/__tests__/services/email-verification/email-verification-service.spec.d.ts +1 -1
  531. package/dist/esm/__tests__/services/email-verification/email-verification-service.spec.js +55 -55
  532. package/dist/esm/__tests__/services/events/collect-queue-tracking-service.spec.d.ts +1 -0
  533. package/dist/esm/__tests__/services/events/collect-queue-tracking-service.spec.js +176 -0
  534. package/dist/esm/__tests__/services/events/collect-queue-tracking-service.spec.js.map +1 -0
  535. package/dist/esm/__tests__/services/events/tracking-event-sqs-service.spec.d.ts +1 -0
  536. package/dist/esm/__tests__/services/events/tracking-event-sqs-service.spec.js +170 -0
  537. package/dist/esm/__tests__/services/events/tracking-event-sqs-service.spec.js.map +1 -0
  538. package/dist/esm/__tests__/shopify/shopify-graphql-transformer.spec.d.ts +1 -1
  539. package/dist/esm/__tests__/shopify/shopify-graphql-transformer.spec.js +33 -33
  540. package/dist/esm/__tests__/unit/libs/api-router/public-api-router.spec.d.ts +1 -1
  541. package/dist/esm/__tests__/unit/libs/api-router/public-api-router.spec.js +156 -156
  542. package/dist/esm/__tests__/unit/libs/api-router/route-matcher.spec.d.ts +1 -1
  543. package/dist/esm/__tests__/unit/libs/api-router/route-matcher.spec.js +67 -67
  544. package/dist/esm/__tests__/utils/custom-measure-formula-utils.spec.d.ts +1 -1
  545. package/dist/esm/__tests__/utils/custom-measure-formula-utils.spec.js +144 -144
  546. package/dist/esm/clients/generic/cognito-client.d.ts +23 -23
  547. package/dist/esm/clients/generic/cognito-client.js +204 -204
  548. package/dist/esm/clients/generic/dynamodb-client.d.ts +20 -20
  549. package/dist/esm/clients/generic/dynamodb-client.js +231 -231
  550. package/dist/esm/clients/generic/eventbridge-client.d.ts +14 -14
  551. package/dist/esm/clients/generic/eventbridge-client.js +47 -47
  552. package/dist/esm/clients/generic/http-client.d.ts +14 -14
  553. package/dist/esm/clients/generic/http-client.js +53 -53
  554. package/dist/esm/clients/generic/index.d.ts +13 -13
  555. package/dist/esm/clients/generic/index.js +13 -13
  556. package/dist/esm/clients/generic/lambda-invoke-client.d.ts +10 -10
  557. package/dist/esm/clients/generic/lambda-invoke-client.js +35 -35
  558. package/dist/esm/clients/generic/location-client.d.ts +8 -8
  559. package/dist/esm/clients/generic/location-client.js +27 -27
  560. package/dist/esm/clients/generic/redis-client.d.ts +33 -33
  561. package/dist/esm/clients/generic/redis-client.js +184 -184
  562. package/dist/esm/clients/generic/s3-client.d.ts +23 -23
  563. package/dist/esm/clients/generic/s3-client.js +209 -209
  564. package/dist/esm/clients/generic/singlestore-db-client.d.ts +14 -14
  565. package/dist/esm/clients/generic/singlestore-db-client.js +40 -40
  566. package/dist/esm/clients/generic/sqs-bundled-client.d.ts +15 -15
  567. package/dist/esm/clients/generic/sqs-bundled-client.js +307 -307
  568. package/dist/esm/clients/generic/sqs-bundled-client.types.d.ts +53 -53
  569. package/dist/esm/clients/generic/sqs-bundled-client.types.js +14 -14
  570. package/dist/esm/clients/generic/sqs-client.d.ts +53 -53
  571. package/dist/esm/clients/generic/sqs-client.js +281 -281
  572. package/dist/esm/clients/generic/sqs-unbundle.d.ts +32 -32
  573. package/dist/esm/clients/generic/sqs-unbundle.js +137 -137
  574. package/dist/esm/clients/index.d.ts +3 -3
  575. package/dist/esm/clients/index.js +3 -3
  576. package/dist/esm/clients/internal-api/accounts-client.d.ts +91 -91
  577. package/dist/esm/clients/internal-api/accounts-client.js +125 -125
  578. package/dist/esm/clients/internal-api/cache-lambda-client.d.ts +26 -26
  579. package/dist/esm/clients/internal-api/cache-lambda-client.js +85 -85
  580. package/dist/esm/clients/internal-api/db-management-client.d.ts +18 -18
  581. package/dist/esm/clients/internal-api/db-management-client.js +32 -32
  582. package/dist/esm/clients/internal-api/destinations-client.d.ts +34 -34
  583. package/dist/esm/clients/internal-api/destinations-client.js +75 -75
  584. package/dist/esm/clients/internal-api/event-collector-client.d.ts +122 -20
  585. package/dist/esm/clients/internal-api/event-collector-client.js +74 -32
  586. package/dist/esm/clients/internal-api/event-collector-client.js.map +1 -1
  587. package/dist/esm/clients/internal-api/identity-client.d.ts +41 -41
  588. package/dist/esm/clients/internal-api/identity-client.js +133 -133
  589. package/dist/esm/clients/internal-api/index.d.ts +9 -9
  590. package/dist/esm/clients/internal-api/index.js +9 -9
  591. package/dist/esm/clients/internal-api/shopify-app-install-client.d.ts +37 -37
  592. package/dist/esm/clients/internal-api/shopify-app-install-client.js +77 -77
  593. package/dist/esm/clients/internal-api/subscriptions-client.d.ts +26 -26
  594. package/dist/esm/clients/internal-api/subscriptions-client.js +73 -73
  595. package/dist/esm/clients/internal-api/users-auth-client.d.ts +35 -35
  596. package/dist/esm/clients/internal-api/users-auth-client.js +106 -106
  597. package/dist/esm/clients/third-party/acuity-client.d.ts +10 -10
  598. package/dist/esm/clients/third-party/acuity-client.js +36 -36
  599. package/dist/esm/clients/third-party/emailable-client.d.ts +7 -7
  600. package/dist/esm/clients/third-party/emailable-client.js +21 -21
  601. package/dist/esm/clients/third-party/exchange-rate-api-client.d.ts +17 -17
  602. package/dist/esm/clients/third-party/exchange-rate-api-client.js +15 -15
  603. package/dist/esm/clients/third-party/index.d.ts +6 -5
  604. package/dist/esm/clients/third-party/index.js +6 -5
  605. package/dist/esm/clients/third-party/index.js.map +1 -1
  606. package/dist/esm/clients/third-party/loops-client.d.ts +10 -10
  607. package/dist/esm/clients/third-party/loops-client.js +26 -26
  608. package/dist/esm/clients/third-party/open-exchange-rates-client.d.ts +8 -0
  609. package/dist/esm/clients/third-party/open-exchange-rates-client.js +24 -0
  610. package/dist/esm/clients/third-party/open-exchange-rates-client.js.map +1 -0
  611. package/dist/esm/clients/third-party/shopify/graphql-order-queries.d.ts +25 -25
  612. package/dist/esm/clients/third-party/shopify/graphql-order-queries.js +1 -1
  613. package/dist/esm/clients/third-party/shopify/graphql-product-queries.d.ts +2 -2
  614. package/dist/esm/clients/third-party/shopify/graphql-product-queries.js +2 -2
  615. package/dist/esm/clients/third-party/shopify/shopify-graphql-client.d.ts +10 -10
  616. package/dist/esm/clients/third-party/shopify/shopify-graphql-client.js +157 -157
  617. package/dist/esm/clients/third-party/shopify-client.d.ts +29 -29
  618. package/dist/esm/clients/third-party/shopify-client.js +142 -142
  619. package/dist/esm/constants/index.d.ts +1 -1
  620. package/dist/esm/constants/index.js +1 -1
  621. package/dist/esm/constants/sqs.d.ts +20 -20
  622. package/dist/esm/constants/sqs.js +22 -22
  623. package/dist/esm/helpers/account-users-helper.d.ts +2 -2
  624. package/dist/esm/helpers/account-users-helper.js +18 -18
  625. package/dist/esm/helpers/acuity-helper.d.ts +4 -4
  626. package/dist/esm/helpers/acuity-helper.js +51 -51
  627. package/dist/esm/helpers/api-key-auth-helper.d.ts +9 -9
  628. package/dist/esm/helpers/api-key-auth-helper.js +35 -35
  629. package/dist/esm/helpers/api-key-authorizer-helper.d.ts +36 -36
  630. package/dist/esm/helpers/api-key-authorizer-helper.js +83 -83
  631. package/dist/esm/helpers/cognito-auth-helper.d.ts +5 -0
  632. package/dist/esm/helpers/cognito-auth-helper.js +11 -0
  633. package/dist/esm/helpers/cognito-auth-helper.js.map +1 -0
  634. package/dist/esm/helpers/index.d.ts +11 -10
  635. package/dist/esm/helpers/index.js +11 -10
  636. package/dist/esm/helpers/index.js.map +1 -1
  637. package/dist/esm/helpers/input-validation-helper.d.ts +3 -3
  638. package/dist/esm/helpers/input-validation-helper.js +18 -18
  639. package/dist/esm/helpers/logging-helper.d.ts +16 -16
  640. package/dist/esm/helpers/logging-helper.js +56 -56
  641. package/dist/esm/helpers/public-api-response-helper.d.ts +21 -21
  642. package/dist/esm/helpers/public-api-response-helper.js +38 -38
  643. package/dist/esm/helpers/response-helper.d.ts +18 -18
  644. package/dist/esm/helpers/response-helper.js +37 -37
  645. package/dist/esm/helpers/shopify-helper.d.ts +9 -9
  646. package/dist/esm/helpers/shopify-helper.js +21 -21
  647. package/dist/esm/helpers/sqs-utils.d.ts +6 -6
  648. package/dist/esm/helpers/sqs-utils.js +9 -9
  649. package/dist/esm/index.d.ts +7 -7
  650. package/dist/esm/index.js +7 -7
  651. package/dist/esm/libs/api-router/index.d.ts +2 -2
  652. package/dist/esm/libs/api-router/index.js +2 -2
  653. package/dist/esm/libs/api-router/public-api-router.d.ts +3 -3
  654. package/dist/esm/libs/api-router/public-api-router.js +32 -32
  655. package/dist/esm/libs/api-router/route-matcher.d.ts +21 -21
  656. package/dist/esm/libs/api-router/route-matcher.js +30 -30
  657. package/dist/esm/libs/click-id-parser.d.ts +23 -23
  658. package/dist/esm/libs/click-id-parser.js +45 -45
  659. package/dist/esm/libs/compression.d.ts +2 -2
  660. package/dist/esm/libs/compression.js +25 -25
  661. package/dist/esm/libs/contacts.d.ts +7 -7
  662. package/dist/esm/libs/contacts.js +143 -143
  663. package/dist/esm/libs/cookie.d.ts +17 -17
  664. package/dist/esm/libs/cookie.js +70 -70
  665. package/dist/esm/libs/crypto.d.ts +4 -4
  666. package/dist/esm/libs/crypto.js +15 -15
  667. package/dist/esm/libs/csv.d.ts +2 -2
  668. package/dist/esm/libs/csv.js +30 -30
  669. package/dist/esm/libs/currency.d.ts +1 -1
  670. package/dist/esm/libs/currency.js +22 -22
  671. package/dist/esm/libs/dates.d.ts +12 -12
  672. package/dist/esm/libs/dates.js +83 -83
  673. package/dist/esm/libs/domain.d.ts +2 -2
  674. package/dist/esm/libs/domain.js +33 -33
  675. package/dist/esm/libs/emails.d.ts +8 -8
  676. package/dist/esm/libs/emails.js +146 -146
  677. package/dist/esm/libs/http-error.d.ts +21 -21
  678. package/dist/esm/libs/http-error.js +59 -59
  679. package/dist/esm/libs/http-status-codes.d.ts +58 -58
  680. package/dist/esm/libs/http-status-codes.js +59 -59
  681. package/dist/esm/libs/index.d.ts +19 -19
  682. package/dist/esm/libs/index.js +19 -19
  683. package/dist/esm/libs/numbers.d.ts +1 -1
  684. package/dist/esm/libs/numbers.js +11 -11
  685. package/dist/esm/libs/referrer-parser/index.d.ts +2 -2
  686. package/dist/esm/libs/referrer-parser/index.js +2 -2
  687. package/dist/esm/libs/referrer-parser/referrer-data.d.ts +9 -9
  688. package/dist/esm/libs/referrer-parser/referrer-data.js +3304 -3304
  689. package/dist/esm/libs/referrer-parser/referrer-parser-util.d.ts +20 -20
  690. package/dist/esm/libs/referrer-parser/referrer-parser-util.js +124 -124
  691. package/dist/esm/libs/strings.d.ts +3 -3
  692. package/dist/esm/libs/strings.js +40 -40
  693. package/dist/esm/libs/traits.d.ts +6 -6
  694. package/dist/esm/libs/traits.js +54 -54
  695. package/dist/esm/libs/url.d.ts +1 -1
  696. package/dist/esm/libs/url.js +9 -9
  697. package/dist/esm/services/acuity-api-service.d.ts +9 -9
  698. package/dist/esm/services/acuity-api-service.js +69 -69
  699. package/dist/esm/services/cache/generic-cached-object.d.ts +5 -5
  700. package/dist/esm/services/cache/generic-cached-object.js +1 -1
  701. package/dist/esm/services/cache/index.d.ts +1 -1
  702. package/dist/esm/services/cache/index.js +1 -1
  703. package/dist/esm/services/cache/product-cache-service.d.ts +21 -21
  704. package/dist/esm/services/cache/product-cache-service.js +68 -68
  705. package/dist/esm/services/cost/cost-calculation-types.d.ts +69 -69
  706. package/dist/esm/services/cost/cost-calculation-types.js +15 -15
  707. package/dist/esm/services/cost/cost-calculator-service.d.ts +24 -24
  708. package/dist/esm/services/cost/cost-calculator-service.js +450 -450
  709. package/dist/esm/services/cost/cost-currency-service.d.ts +6 -6
  710. package/dist/esm/services/cost/cost-currency-service.js +84 -84
  711. package/dist/esm/services/cost/cost-filter-service.d.ts +10 -10
  712. package/dist/esm/services/cost/cost-filter-service.js +118 -118
  713. package/dist/esm/services/cost/index.d.ts +5 -5
  714. package/dist/esm/services/cost/index.js +5 -5
  715. package/dist/esm/services/cost/order-cost/index.d.ts +2 -2
  716. package/dist/esm/services/cost/order-cost/index.js +2 -2
  717. package/dist/esm/services/cost/order-cost/order-cost-resolution-service.d.ts +23 -23
  718. package/dist/esm/services/cost/order-cost/order-cost-resolution-service.js +355 -355
  719. package/dist/esm/services/cost/order-cost/order-cost-resolution-types.d.ts +37 -37
  720. package/dist/esm/services/cost/order-cost/order-cost-resolution-types.js +1 -1
  721. package/dist/esm/services/currency-exchange-rate-lookup-service.d.ts +12 -12
  722. package/dist/esm/services/currency-exchange-rate-lookup-service.js +90 -90
  723. package/dist/esm/services/db/accounts-db-service.d.ts +9 -9
  724. package/dist/esm/services/db/accounts-db-service.js +29 -29
  725. package/dist/esm/services/db/api-keys-db-service.d.ts +10 -10
  726. package/dist/esm/services/db/api-keys-db-service.js +32 -32
  727. package/dist/esm/services/db/contact-enrichments-db-service.d.ts +15 -15
  728. package/dist/esm/services/db/contact-enrichments-db-service.js +90 -90
  729. package/dist/esm/services/db/currency-exchange-rates-db-service.d.ts +21 -21
  730. package/dist/esm/services/db/currency-exchange-rates-db-service.js +35 -35
  731. package/dist/esm/services/db/custom-measures-db-service.d.ts +14 -14
  732. package/dist/esm/services/db/custom-measures-db-service.js +44 -44
  733. package/dist/esm/services/db/destinations-db-service.d.ts +13 -13
  734. package/dist/esm/services/db/destinations-db-service.js +70 -70
  735. package/dist/esm/services/db/identity-cache-db-service.d.ts +28 -28
  736. package/dist/esm/services/db/identity-cache-db-service.js +313 -313
  737. package/dist/esm/services/db/identity-cache-dynamodb-service/constants.d.ts +3 -3
  738. package/dist/esm/services/db/identity-cache-dynamodb-service/constants.js +3 -3
  739. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.d.ts +20 -20
  740. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-cache-dynamodb-db-service.js +358 -358
  741. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-gateway-service.d.ts +23 -23
  742. package/dist/esm/services/db/identity-cache-dynamodb-service/identity-gateway-service.js +218 -218
  743. package/dist/esm/services/db/identity-cache-dynamodb-service/index.d.ts +4 -4
  744. package/dist/esm/services/db/identity-cache-dynamodb-service/index.js +4 -4
  745. package/dist/esm/services/db/identity-cache-dynamodb-service/key-builders.d.ts +12 -12
  746. package/dist/esm/services/db/identity-cache-dynamodb-service/key-builders.js +23 -23
  747. package/dist/esm/services/db/identity-cache-dynamodb-service/types.d.ts +71 -71
  748. package/dist/esm/services/db/identity-cache-dynamodb-service/types.js +25 -25
  749. package/dist/esm/services/db/index.d.ts +22 -22
  750. package/dist/esm/services/db/index.js +22 -22
  751. package/dist/esm/services/db/log-events-db-service.d.ts +11 -11
  752. package/dist/esm/services/db/log-events-db-service.js +177 -177
  753. package/dist/esm/services/db/pixels-db-service.d.ts +8 -8
  754. package/dist/esm/services/db/pixels-db-service.js +31 -31
  755. package/dist/esm/services/db/products-db-service-types.d.ts +10 -10
  756. package/dist/esm/services/db/products-db-service-types.js +1 -1
  757. package/dist/esm/services/db/products-db-service.d.ts +19 -19
  758. package/dist/esm/services/db/products-db-service.js +277 -277
  759. package/dist/esm/services/db/purchasable-contacts-db-service.d.ts +9 -9
  760. package/dist/esm/services/db/purchasable-contacts-db-service.js +39 -39
  761. package/dist/esm/services/db/purchased-contacts/index.d.ts +2 -2
  762. package/dist/esm/services/db/purchased-contacts/index.js +2 -2
  763. package/dist/esm/services/db/purchased-contacts/purchased-contacts-db-service.d.ts +18 -18
  764. package/dist/esm/services/db/purchased-contacts/purchased-contacts-db-service.js +148 -148
  765. package/dist/esm/services/db/purchased-contacts/types.d.ts +11 -11
  766. package/dist/esm/services/db/purchased-contacts/types.js +1 -1
  767. package/dist/esm/services/db/shopify-app-installs-db-service.d.ts +10 -10
  768. package/dist/esm/services/db/shopify-app-installs-db-service.js +48 -48
  769. package/dist/esm/services/db/shopify-products-cache-db-service.d.ts +16 -16
  770. package/dist/esm/services/db/shopify-products-cache-db-service.js +66 -66
  771. package/dist/esm/services/db/subscriptions-db-service.d.ts +11 -11
  772. package/dist/esm/services/db/subscriptions-db-service.js +34 -34
  773. package/dist/esm/services/db/tracking-events-db-service.d.ts +21 -21
  774. package/dist/esm/services/db/tracking-events-db-service.js +184 -184
  775. package/dist/esm/services/db/user-accounts-db-service.d.ts +7 -7
  776. package/dist/esm/services/db/user-accounts-db-service.js +13 -13
  777. package/dist/esm/services/email-verification/contact-email-verification-service.d.ts +7 -7
  778. package/dist/esm/services/email-verification/contact-email-verification-service.js +97 -97
  779. package/dist/esm/services/email-verification/email-verification-service.d.ts +19 -19
  780. package/dist/esm/services/email-verification/email-verification-service.js +127 -127
  781. package/dist/esm/services/email-verification/index.d.ts +2 -2
  782. package/dist/esm/services/email-verification/index.js +2 -2
  783. package/dist/esm/services/eventbridge-integration-service.d.ts +9 -9
  784. package/dist/esm/services/eventbridge-integration-service.js +24 -24
  785. package/dist/esm/services/events/build-collect-queue-tracking-event.d.ts +14 -0
  786. package/dist/esm/services/events/build-collect-queue-tracking-event.js +22 -0
  787. package/dist/esm/services/events/build-collect-queue-tracking-event.js.map +1 -0
  788. package/dist/esm/services/events/collect-queue-tracking-service.d.ts +9 -0
  789. package/dist/esm/services/events/collect-queue-tracking-service.js +19 -0
  790. package/dist/esm/services/events/collect-queue-tracking-service.js.map +1 -0
  791. package/dist/esm/services/events/index.d.ts +5 -3
  792. package/dist/esm/services/events/index.js +5 -3
  793. package/dist/esm/services/events/index.js.map +1 -1
  794. package/dist/esm/services/events/log-event-service.d.ts +19 -19
  795. package/dist/esm/services/events/log-event-service.js +73 -73
  796. package/dist/esm/services/events/metric-event-service.d.ts +9 -9
  797. package/dist/esm/services/events/metric-event-service.js +45 -45
  798. package/dist/esm/services/events/tracking-event-sqs-service.d.ts +8 -8
  799. package/dist/esm/services/events/tracking-event-sqs-service.js +32 -30
  800. package/dist/esm/services/events/tracking-event-sqs-service.js.map +1 -1
  801. package/dist/esm/services/generic-cache-service.d.ts +7 -7
  802. package/dist/esm/services/generic-cache-service.js +29 -29
  803. package/dist/esm/services/index.d.ts +11 -11
  804. package/dist/esm/services/index.js +11 -11
  805. package/dist/esm/services/ipdata-lookup-service.d.ts +20 -20
  806. package/dist/esm/services/ipdata-lookup-service.js +108 -108
  807. package/dist/esm/services/shopify/index.d.ts +2 -2
  808. package/dist/esm/services/shopify/index.js +2 -2
  809. package/dist/esm/services/shopify/products/index.d.ts +1 -1
  810. package/dist/esm/services/shopify/products/index.js +1 -1
  811. package/dist/esm/services/shopify/products/shopify-products-serviceV2.d.ts +17 -17
  812. package/dist/esm/services/shopify/products/shopify-products-serviceV2.js +108 -108
  813. package/dist/esm/services/shopify/shopify-graphql-transformer.d.ts +8 -8
  814. package/dist/esm/services/shopify/shopify-graphql-transformer.js +138 -138
  815. package/dist/esm/types/acuity-types.d.ts +74 -74
  816. package/dist/esm/types/acuity-types.js +1 -1
  817. package/dist/esm/types/api-response.d.ts +6 -6
  818. package/dist/esm/types/api-response.js +1 -1
  819. package/dist/esm/types/index.d.ts +6 -5
  820. package/dist/esm/types/index.js +6 -5
  821. package/dist/esm/types/index.js.map +1 -1
  822. package/dist/esm/types/internal-events/event-detail-types.d.ts +20 -20
  823. package/dist/esm/types/internal-events/event-detail-types.js +24 -24
  824. package/dist/esm/types/internal-events/index.d.ts +1 -1
  825. package/dist/esm/types/internal-events/index.js +1 -1
  826. package/dist/esm/types/open-exchange-rates-types.d.ts +10 -0
  827. package/dist/esm/types/open-exchange-rates-types.js +2 -0
  828. package/dist/esm/types/open-exchange-rates-types.js.map +1 -0
  829. package/dist/esm/types/public-api-types.d.ts +24 -24
  830. package/dist/esm/types/public-api-types.js +10 -10
  831. package/dist/esm/types/shopify-graphql-types/admin.generated.d.ts +123 -123
  832. package/dist/esm/types/shopify-graphql-types/admin.generated.js +1 -1
  833. package/dist/esm/types/shopify-graphql-types/admin.types.d.ts +26289 -26289
  834. package/dist/esm/types/shopify-graphql-types/admin.types.js +5299 -5299
  835. package/dist/esm/types/shopify-graphql-types/index.d.ts +2 -2
  836. package/dist/esm/types/shopify-graphql-types/index.js +2 -2
  837. package/dist/esm/types/shopify-rest-types.d.ts +767 -767
  838. package/dist/esm/types/shopify-rest-types.js +1 -1
  839. package/dist/esm/utils/compression.d.ts +36 -36
  840. package/dist/esm/utils/compression.js +187 -187
  841. package/dist/esm/utils/custom-measure-formula-utils.d.ts +6 -6
  842. package/dist/esm/utils/custom-measure-formula-utils.js +201 -201
  843. package/dist/esm/utils/index.d.ts +4 -4
  844. package/dist/esm/utils/index.js +4 -4
  845. package/dist/esm/utils/retry-envelope.d.ts +12 -12
  846. package/dist/esm/utils/retry-envelope.js +22 -22
  847. package/dist/esm/utils/size.d.ts +2 -2
  848. package/dist/esm/utils/size.js +44 -44
  849. package/package.json +135 -135
@@ -1,817 +1,817 @@
1
- import { ADDRESS_INFO_SOURCE } from '@adtrackify/at-tracking-event-types';
2
- import { isIdentityCacheStale, IDENTITY_CACHE_STALENESS_TIER } from '@adtrackify/at-shared-utils';
3
- describe('Volatile Traits Optimization - Tier Classification', () => {
4
- afterEach(() => {
5
- jest.resetModules();
6
- });
7
- describe('TIER: NONE — Cache is fresh', () => {
8
- it('should return NONE when cached and incoming are identical', () => {
9
- const identity = {
10
- identityId: 'test-id',
11
- traits: {
12
- emails: ['test@email.com'],
13
- phones: ['+1234567890'],
14
- ipAddress: '192.168.1.1',
15
- userAgent: 'Mozilla/5.0',
16
- addresses: [{ city: 'New York', s: ADDRESS_INFO_SOURCE.INPUT }],
17
- },
18
- };
19
- const result = isIdentityCacheStale(identity, identity);
20
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
21
- expect(result.isCacheStale).toBe(false);
22
- expect(result.isIpAddressStale).toBe(false);
23
- expect(result.isUserAgentStale).toBe(false);
24
- expect(result.isEmailsStale).toBe(false);
25
- expect(result.isAddressesStale).toBe(false);
26
- });
27
- it('should return NONE when incoming is subset of cached', () => {
28
- const cachedIdentity = {
29
- identityId: 'test-id',
30
- traits: {
31
- emails: ['a@email.com', 'b@email.com'],
32
- phones: ['+1234567890', '+9876543210'],
33
- userIds: ['user1', 'user2'],
34
- },
35
- };
36
- const incomingIdentity = {
37
- identityId: 'test-id',
38
- traits: {
39
- emails: ['a@email.com'],
40
- phones: ['+1234567890'],
41
- },
42
- };
43
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
44
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
45
- expect(result.isCacheStale).toBe(false);
46
- });
47
- });
48
- describe('TIER: VOLATILE_ONLY — Only session traits changed', () => {
49
- it('should return VOLATILE_ONLY when only ipAddress is stale', () => {
50
- const cachedIdentity = {
51
- identityId: 'test-id',
52
- traits: {
53
- emails: ['test@email.com'],
54
- ipAddress: '192.168.1.1',
55
- },
56
- };
57
- const incomingIdentity = {
58
- identityId: 'test-id',
59
- traits: {
60
- emails: ['test@email.com'],
61
- ipAddress: '10.0.0.1',
62
- },
63
- };
64
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
65
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
66
- expect(result.isCacheStale).toBe(false);
67
- expect(result.isIpAddressStale).toBe(true);
68
- expect(result.isUserAgentStale).toBe(false);
69
- });
70
- it('should return VOLATILE_ONLY when only userAgent is stale', () => {
71
- const cachedIdentity = {
72
- identityId: 'test-id',
73
- traits: {
74
- emails: ['test@email.com'],
75
- userAgent: 'Mozilla/5.0 (Windows NT 10.0)',
76
- },
77
- };
78
- const incomingIdentity = {
79
- identityId: 'test-id',
80
- traits: {
81
- emails: ['test@email.com'],
82
- userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X)',
83
- },
84
- };
85
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
86
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
87
- expect(result.isCacheStale).toBe(false);
88
- expect(result.isUserAgentStale).toBe(true);
89
- expect(result.isIpAddressStale).toBe(false);
90
- });
91
- it('should return VOLATILE_ONLY when only IP-sourced addresses are stale', () => {
92
- const cachedIdentity = {
93
- identityId: 'test-id',
94
- traits: {
95
- emails: ['test@email.com'],
96
- addresses: [{ city: 'New York', country: 'USA', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
97
- },
98
- };
99
- const incomingIdentity = {
100
- identityId: 'test-id',
101
- traits: {
102
- emails: ['test@email.com'],
103
- addresses: [{ city: 'Los Angeles', country: 'USA', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
104
- },
105
- };
106
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
107
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
108
- expect(result.isCacheStale).toBe(false);
109
- expect(result.isIpAddressesStale).toBe(true);
110
- expect(result.isNonIpAddressesStale).toBe(false);
111
- });
112
- it('should return VOLATILE_ONLY when ipAddress AND userAgent are both stale', () => {
113
- const cachedIdentity = {
114
- identityId: 'test-id',
115
- traits: {
116
- emails: ['test@email.com'],
117
- ipAddress: '192.168.1.1',
118
- userAgent: 'Mozilla/5.0 (Windows)',
119
- },
120
- };
121
- const incomingIdentity = {
122
- identityId: 'test-id',
123
- traits: {
124
- emails: ['test@email.com'],
125
- ipAddress: '10.0.0.1',
126
- userAgent: 'Mozilla/5.0 (Mac)',
127
- },
128
- };
129
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
130
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
131
- expect(result.isCacheStale).toBe(false);
132
- expect(result.isIpAddressStale).toBe(true);
133
- expect(result.isUserAgentStale).toBe(true);
134
- });
135
- it('should return VOLATILE_ONLY when ipAddress AND IP-sourced address are both stale', () => {
136
- const cachedIdentity = {
137
- identityId: 'test-id',
138
- traits: {
139
- emails: ['test@email.com'],
140
- ipAddress: '192.168.1.1',
141
- addresses: [{ city: 'Chicago', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
142
- },
143
- };
144
- const incomingIdentity = {
145
- identityId: 'test-id',
146
- traits: {
147
- emails: ['test@email.com'],
148
- ipAddress: '10.0.0.1',
149
- addresses: [{ city: 'Denver', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
150
- },
151
- };
152
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
153
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
154
- expect(result.isCacheStale).toBe(false);
155
- expect(result.isIpAddressStale).toBe(true);
156
- expect(result.isIpAddressesStale).toBe(true);
157
- });
158
- it('should return VOLATILE_ONLY when all volatile traits are stale but no identity traits', () => {
159
- const cachedIdentity = {
160
- identityId: 'test-id',
161
- traits: {
162
- emails: ['test@email.com'],
163
- ipAddress: '192.168.1.1',
164
- userAgent: 'Mozilla/5.0 (Windows)',
165
- addresses: [{ city: 'Seattle', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
166
- },
167
- };
168
- const incomingIdentity = {
169
- identityId: 'test-id',
170
- traits: {
171
- emails: ['test@email.com'],
172
- ipAddress: '172.16.0.1',
173
- userAgent: 'Chrome/120.0',
174
- addresses: [{ city: 'Portland', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
175
- },
176
- };
177
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
178
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
179
- expect(result.isCacheStale).toBe(false);
180
- expect(result.isIpAddressStale).toBe(true);
181
- expect(result.isUserAgentStale).toBe(true);
182
- expect(result.isIpAddressesStale).toBe(true);
183
- });
184
- });
185
- describe('TIER: ADDRESS_UPDATE — Non-IP address changed', () => {
186
- it('should return ADDRESS_UPDATE when only non-IP address is new', () => {
187
- const cachedIdentity = {
188
- identityId: 'test-id',
189
- traits: {
190
- emails: ['test@email.com'],
191
- addresses: [],
192
- },
193
- };
194
- const incomingIdentity = {
195
- identityId: 'test-id',
196
- traits: {
197
- emails: ['test@email.com'],
198
- addresses: [{ city: 'Boston', province: 'MA', s: ADDRESS_INFO_SOURCE.INPUT }],
199
- },
200
- };
201
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
202
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
203
- expect(result.isCacheStale).toBe(true);
204
- expect(result.isNonIpAddressesStale).toBe(true);
205
- expect(result.isIpAddressesStale).toBe(false);
206
- });
207
- it('should return ADDRESS_UPDATE when non-IP address AND volatile traits are both stale', () => {
208
- const cachedIdentity = {
209
- identityId: 'test-id',
210
- traits: {
211
- emails: ['test@email.com'],
212
- ipAddress: '192.168.1.1',
213
- userAgent: 'Mozilla/5.0',
214
- addresses: [],
215
- },
216
- };
217
- const incomingIdentity = {
218
- identityId: 'test-id',
219
- traits: {
220
- emails: ['test@email.com'],
221
- ipAddress: '10.0.0.1',
222
- userAgent: 'Chrome/120.0',
223
- addresses: [{ city: 'Austin', firstName: 'John', s: ADDRESS_INFO_SOURCE.INPUT }],
224
- },
225
- };
226
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
227
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
228
- expect(result.isCacheStale).toBe(true);
229
- expect(result.isNonIpAddressesStale).toBe(true);
230
- expect(result.isIpAddressStale).toBe(true);
231
- expect(result.isUserAgentStale).toBe(true);
232
- });
233
- it('should return ADDRESS_UPDATE when new input address added to existing addresses', () => {
234
- const cachedIdentity = {
235
- identityId: 'test-id',
236
- traits: {
237
- emails: ['test@email.com'],
238
- addresses: [{ city: 'Miami', s: ADDRESS_INFO_SOURCE.INPUT }],
239
- },
240
- };
241
- const incomingIdentity = {
242
- identityId: 'test-id',
243
- traits: {
244
- emails: ['test@email.com'],
245
- addresses: [
246
- { city: 'Miami', s: ADDRESS_INFO_SOURCE.INPUT },
247
- { city: 'Tampa', s: ADDRESS_INFO_SOURCE.INPUT },
248
- ],
249
- },
250
- };
251
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
252
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
253
- expect(result.isCacheStale).toBe(true);
254
- expect(result.isNonIpAddressesStale).toBe(true);
255
- });
256
- it('should return ADDRESS_UPDATE when address with PII (no source field) is added', () => {
257
- const cachedIdentity = {
258
- identityId: 'test-id',
259
- traits: {
260
- emails: ['test@email.com'],
261
- addresses: [],
262
- },
263
- };
264
- const incomingIdentity = {
265
- identityId: 'test-id',
266
- traits: {
267
- emails: ['test@email.com'],
268
- addresses: [{ city: 'Dallas', firstName: 'Jane', lastName: 'Doe' }],
269
- },
270
- };
271
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
272
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
273
- expect(result.isCacheStale).toBe(true);
274
- expect(result.isNonIpAddressesStale).toBe(true);
275
- });
276
- });
277
- describe('TIER: IDENTITY_STALE — Identity-defining traits changed', () => {
278
- it('should return IDENTITY_STALE when emails are stale', () => {
279
- const cachedIdentity = {
280
- identityId: 'test-id',
281
- traits: { emails: ['old@email.com'] },
282
- };
283
- const incomingIdentity = {
284
- identityId: 'test-id',
285
- traits: { emails: ['old@email.com', 'new@email.com'] },
286
- };
287
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
288
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
289
- expect(result.isCacheStale).toBe(true);
290
- expect(result.isEmailsStale).toBe(true);
291
- });
292
- it('should return IDENTITY_STALE when phones are stale', () => {
293
- const cachedIdentity = {
294
- identityId: 'test-id',
295
- traits: { phones: ['+1234567890'] },
296
- };
297
- const incomingIdentity = {
298
- identityId: 'test-id',
299
- traits: { phones: ['+1234567890', '+9876543210'] },
300
- };
301
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
302
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
303
- expect(result.isCacheStale).toBe(true);
304
- expect(result.isPhonesStale).toBe(true);
305
- });
306
- it('should return IDENTITY_STALE when userIds are stale', () => {
307
- const cachedIdentity = {
308
- identityId: 'test-id',
309
- traits: { userIds: ['user1'] },
310
- };
311
- const incomingIdentity = {
312
- identityId: 'test-id',
313
- traits: { userIds: ['user1', 'user2'] },
314
- };
315
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
316
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
317
- expect(result.isCacheStale).toBe(true);
318
- expect(result.isUserIdsStale).toBe(true);
319
- });
320
- it('should return IDENTITY_STALE when clickInfos are stale', () => {
321
- const cachedIdentity = {
322
- identityId: 'test-id',
323
- traits: { click: { gclid: 'old_gclid' } },
324
- };
325
- const incomingIdentity = {
326
- identityId: 'test-id',
327
- traits: { click: { gclid: 'new_gclid' } },
328
- };
329
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
330
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
331
- expect(result.isCacheStale).toBe(true);
332
- expect(result.isClickInfosStale).toBe(true);
333
- });
334
- it('should return IDENTITY_STALE when identityId is stale', () => {
335
- const cachedIdentity = {
336
- identityId: 'old-id',
337
- traits: { emails: ['test@email.com'] },
338
- };
339
- const incomingIdentity = {
340
- identityId: 'new-id',
341
- traits: { emails: ['test@email.com'] },
342
- };
343
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
344
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
345
- expect(result.isCacheStale).toBe(true);
346
- expect(result.isIdentityIdStale).toBe(true);
347
- });
348
- it('should return IDENTITY_STALE when emails stale AND volatile traits stale (highest tier wins)', () => {
349
- const cachedIdentity = {
350
- identityId: 'test-id',
351
- traits: {
352
- emails: ['old@email.com'],
353
- ipAddress: '192.168.1.1',
354
- userAgent: 'Mozilla/5.0',
355
- },
356
- };
357
- const incomingIdentity = {
358
- identityId: 'test-id',
359
- traits: {
360
- emails: ['old@email.com', 'new@email.com'],
361
- ipAddress: '10.0.0.1',
362
- userAgent: 'Chrome/120.0',
363
- },
364
- };
365
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
366
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
367
- expect(result.isCacheStale).toBe(true);
368
- expect(result.isEmailsStale).toBe(true);
369
- expect(result.isIpAddressStale).toBe(true);
370
- expect(result.isUserAgentStale).toBe(true);
371
- });
372
- it('should return IDENTITY_STALE when emails stale AND non-IP address stale (highest tier wins)', () => {
373
- const cachedIdentity = {
374
- identityId: 'test-id',
375
- traits: {
376
- emails: ['old@email.com'],
377
- addresses: [],
378
- },
379
- };
380
- const incomingIdentity = {
381
- identityId: 'test-id',
382
- traits: {
383
- emails: ['old@email.com', 'new@email.com'],
384
- addresses: [{ city: 'Phoenix', s: ADDRESS_INFO_SOURCE.INPUT }],
385
- },
386
- };
387
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
388
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
389
- expect(result.isCacheStale).toBe(true);
390
- expect(result.isEmailsStale).toBe(true);
391
- expect(result.isNonIpAddressesStale).toBe(true);
392
- });
393
- });
394
- });
395
- describe('Volatile Traits Optimization - Address Source Filtering', () => {
396
- afterEach(() => {
397
- jest.resetModules();
398
- });
399
- describe('isAddressIpSourced inference', () => {
400
- it('should treat address with s: IP_ADDRESS as IP-sourced', () => {
401
- const cachedIdentity = {
402
- identityId: 'test-id',
403
- traits: { addresses: [] },
404
- };
405
- const incomingIdentity = {
406
- identityId: 'test-id',
407
- traits: {
408
- addresses: [{ city: 'Atlanta', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
409
- },
410
- };
411
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
412
- expect(result.isIpAddressesStale).toBe(true);
413
- expect(result.isNonIpAddressesStale).toBe(false);
414
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
415
- });
416
- it('should treat address with s: INPUT as non-IP-sourced', () => {
417
- const cachedIdentity = {
418
- identityId: 'test-id',
419
- traits: { addresses: [] },
420
- };
421
- const incomingIdentity = {
422
- identityId: 'test-id',
423
- traits: {
424
- addresses: [{ city: 'Houston', s: ADDRESS_INFO_SOURCE.INPUT }],
425
- },
426
- };
427
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
428
- expect(result.isNonIpAddressesStale).toBe(true);
429
- expect(result.isIpAddressesStale).toBe(false);
430
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
431
- });
432
- it('should treat address without s but with firstName/lastName as non-IP (inferred input)', () => {
433
- const cachedIdentity = {
434
- identityId: 'test-id',
435
- traits: { addresses: [] },
436
- };
437
- const incomingIdentity = {
438
- identityId: 'test-id',
439
- traits: {
440
- addresses: [{ city: 'San Diego', firstName: 'Alice', lastName: 'Smith' }],
441
- },
442
- };
443
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
444
- expect(result.isNonIpAddressesStale).toBe(true);
445
- expect(result.isIpAddressesStale).toBe(false);
446
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
447
- });
448
- it('should treat address without s but with email as non-IP (inferred input)', () => {
449
- const cachedIdentity = {
450
- identityId: 'test-id',
451
- traits: { addresses: [] },
452
- };
453
- const incomingIdentity = {
454
- identityId: 'test-id',
455
- traits: {
456
- addresses: [{ city: 'Sacramento', email: 'addr@email.com' }],
457
- },
458
- };
459
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
460
- expect(result.isNonIpAddressesStale).toBe(true);
461
- expect(result.isIpAddressesStale).toBe(false);
462
- });
463
- it('should treat address without s but with phone as non-IP (inferred input)', () => {
464
- const cachedIdentity = {
465
- identityId: 'test-id',
466
- traits: { addresses: [] },
467
- };
468
- const incomingIdentity = {
469
- identityId: 'test-id',
470
- traits: {
471
- addresses: [{ city: 'San Jose', phone: '+15551234567' }],
472
- },
473
- };
474
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
475
- expect(result.isNonIpAddressesStale).toBe(true);
476
- expect(result.isIpAddressesStale).toBe(false);
477
- });
478
- it('should treat address without s and without PII as IP-sourced (inferred IP)', () => {
479
- const cachedIdentity = {
480
- identityId: 'test-id',
481
- traits: { addresses: [] },
482
- };
483
- const incomingIdentity = {
484
- identityId: 'test-id',
485
- traits: {
486
- addresses: [{ city: 'Oakland', country: 'USA', countryCode: 'US' }],
487
- },
488
- };
489
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
490
- expect(result.isIpAddressesStale).toBe(true);
491
- expect(result.isNonIpAddressesStale).toBe(false);
492
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
493
- });
494
- });
495
- describe('filterAddressesBySource behavior', () => {
496
- it('should correctly separate IP and non-IP addresses when mixed', () => {
497
- const cachedIdentity = {
498
- identityId: 'test-id',
499
- traits: {
500
- addresses: [
501
- { city: 'IP City 1', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
502
- { city: 'Input City 1', s: ADDRESS_INFO_SOURCE.INPUT },
503
- ],
504
- },
505
- };
506
- const incomingIdentity = {
507
- identityId: 'test-id',
508
- traits: {
509
- addresses: [
510
- { city: 'New IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
511
- { city: 'Input City 1', s: ADDRESS_INFO_SOURCE.INPUT },
512
- { city: 'New Input City', s: ADDRESS_INFO_SOURCE.INPUT },
513
- ],
514
- },
515
- };
516
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
517
- expect(result.isIpAddressesStale).toBe(true);
518
- expect(result.isNonIpAddressesStale).toBe(true);
519
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
520
- });
521
- });
522
- describe('hasNewNonIpAddress detection', () => {
523
- it('should detect new input address as stale', () => {
524
- const cachedIdentity = {
525
- identityId: 'test-id',
526
- traits: {
527
- addresses: [{ city: 'Old City', s: ADDRESS_INFO_SOURCE.INPUT }],
528
- },
529
- };
530
- const incomingIdentity = {
531
- identityId: 'test-id',
532
- traits: {
533
- addresses: [
534
- { city: 'Old City', s: ADDRESS_INFO_SOURCE.INPUT },
535
- { city: 'New City', s: ADDRESS_INFO_SOURCE.INPUT },
536
- ],
537
- },
538
- };
539
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
540
- expect(result.isNonIpAddressesStale).toBe(true);
541
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
542
- });
543
- it('should NOT mark non-IP stale when only IP address is new', () => {
544
- const cachedIdentity = {
545
- identityId: 'test-id',
546
- traits: {
547
- addresses: [
548
- { city: 'IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
549
- { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
550
- ],
551
- },
552
- };
553
- const incomingIdentity = {
554
- identityId: 'test-id',
555
- traits: {
556
- addresses: [
557
- { city: 'New IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
558
- { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
559
- ],
560
- },
561
- };
562
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
563
- expect(result.isIpAddressesStale).toBe(true);
564
- expect(result.isNonIpAddressesStale).toBe(false);
565
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
566
- });
567
- });
568
- describe('hasNewIpAddress detection', () => {
569
- it('should detect new IP address for tracking purposes', () => {
570
- const cachedIdentity = {
571
- identityId: 'test-id',
572
- traits: {
573
- addresses: [{ city: 'Old IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
574
- },
575
- };
576
- const incomingIdentity = {
577
- identityId: 'test-id',
578
- traits: {
579
- addresses: [{ city: 'New IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
580
- },
581
- };
582
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
583
- expect(result.isIpAddressesStale).toBe(true);
584
- expect(result.isAddressesStale).toBe(true);
585
- });
586
- });
587
- describe('Empty addresses edge cases', () => {
588
- it('should return ADDRESS_UPDATE when cached empty and incoming has non-IP address', () => {
589
- const cachedIdentity = {
590
- identityId: 'test-id',
591
- traits: { addresses: [] },
592
- };
593
- const incomingIdentity = {
594
- identityId: 'test-id',
595
- traits: {
596
- addresses: [{ city: 'Memphis', s: ADDRESS_INFO_SOURCE.INPUT }],
597
- },
598
- };
599
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
600
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
601
- expect(result.isCacheStale).toBe(true);
602
- expect(result.isNonIpAddressesStale).toBe(true);
603
- });
604
- it('should return VOLATILE_ONLY when cached empty and incoming has only IP address', () => {
605
- const cachedIdentity = {
606
- identityId: 'test-id',
607
- traits: { addresses: [] },
608
- };
609
- const incomingIdentity = {
610
- identityId: 'test-id',
611
- traits: {
612
- addresses: [{ city: 'Detroit', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
613
- },
614
- };
615
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
616
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
617
- expect(result.isCacheStale).toBe(false);
618
- expect(result.isIpAddressesStale).toBe(true);
619
- expect(result.isNonIpAddressesStale).toBe(false);
620
- });
621
- it('should return NONE when both cached and incoming have empty addresses', () => {
622
- const cachedIdentity = {
623
- identityId: 'test-id',
624
- traits: { addresses: [] },
625
- };
626
- const incomingIdentity = {
627
- identityId: 'test-id',
628
- traits: { addresses: [] },
629
- };
630
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
631
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
632
- expect(result.isAddressesStale).toBe(false);
633
- });
634
- });
635
- describe('All addresses have s field explicitly set', () => {
636
- it('should correctly identify source when all addresses have explicit s field', () => {
637
- const cachedIdentity = {
638
- identityId: 'test-id',
639
- traits: {
640
- addresses: [
641
- { city: 'IP1', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
642
- { city: 'IN1', s: ADDRESS_INFO_SOURCE.INPUT },
643
- ],
644
- },
645
- };
646
- const incomingIdentity = {
647
- identityId: 'test-id',
648
- traits: {
649
- addresses: [
650
- { city: 'IP1', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
651
- { city: 'IN1', s: ADDRESS_INFO_SOURCE.INPUT },
652
- { city: 'IP2', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
653
- { city: 'IN2', s: ADDRESS_INFO_SOURCE.INPUT },
654
- ],
655
- },
656
- };
657
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
658
- expect(result.isIpAddressesStale).toBe(true);
659
- expect(result.isNonIpAddressesStale).toBe(true);
660
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
661
- });
662
- });
663
- describe('Mixed addresses: some IP, some input — only input changes', () => {
664
- it('should return ADDRESS_UPDATE when only input address changes', () => {
665
- const cachedIdentity = {
666
- identityId: 'test-id',
667
- traits: {
668
- addresses: [
669
- { city: 'IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
670
- { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
671
- ],
672
- },
673
- };
674
- const incomingIdentity = {
675
- identityId: 'test-id',
676
- traits: {
677
- addresses: [
678
- { city: 'IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
679
- { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
680
- { city: 'New Input City', s: ADDRESS_INFO_SOURCE.INPUT },
681
- ],
682
- },
683
- };
684
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
685
- expect(result.isIpAddressesStale).toBe(false);
686
- expect(result.isNonIpAddressesStale).toBe(true);
687
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
688
- });
689
- });
690
- });
691
- describe('Volatile Traits Optimization - checkScalarTraitChanged behavior', () => {
692
- afterEach(() => {
693
- jest.resetModules();
694
- });
695
- it('should NOT mark stale when incoming is empty/undefined but cached has value', () => {
696
- const cachedIdentity = {
697
- identityId: 'test-id',
698
- traits: {
699
- ipAddress: '192.168.1.1',
700
- userAgent: 'Mozilla/5.0',
701
- },
702
- };
703
- const incomingIdentity = {
704
- identityId: 'test-id',
705
- traits: {},
706
- };
707
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
708
- expect(result.isIpAddressStale).toBe(false);
709
- expect(result.isUserAgentStale).toBe(false);
710
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
711
- });
712
- it('should mark stale when cached is undefined but incoming has value', () => {
713
- const cachedIdentity = {
714
- identityId: 'test-id',
715
- traits: {},
716
- };
717
- const incomingIdentity = {
718
- identityId: 'test-id',
719
- traits: {
720
- ipAddress: '192.168.1.1',
721
- userAgent: 'Mozilla/5.0',
722
- },
723
- };
724
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
725
- expect(result.isIpAddressStale).toBe(true);
726
- expect(result.isUserAgentStale).toBe(true);
727
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
728
- });
729
- it('should mark stale when both have values but they differ', () => {
730
- const cachedIdentity = {
731
- identityId: 'test-id',
732
- traits: { ipAddress: '192.168.1.1' },
733
- };
734
- const incomingIdentity = {
735
- identityId: 'test-id',
736
- traits: { ipAddress: '10.0.0.1' },
737
- };
738
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
739
- expect(result.isIpAddressStale).toBe(true);
740
- });
741
- });
742
- describe('Volatile Traits Optimization - Error Handling', () => {
743
- afterEach(() => {
744
- jest.resetModules();
745
- });
746
- it('should return NONE when both identities have same identityId but malformed traits', () => {
747
- const result = isIdentityCacheStale({ identityId: 'test', traits: 'not-an-object' }, { identityId: 'test', traits: 123 });
748
- expect(result.isCacheStale).toBe(false);
749
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
750
- });
751
- it('should return IDENTITY_STALE when cached identity is null but incoming has identityId', () => {
752
- const result = isIdentityCacheStale(null, { identityId: 'test', traits: {} });
753
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
754
- expect(result.isCacheStale).toBe(true);
755
- expect(result.isIdentityIdStale).toBe(true);
756
- });
757
- it('should return IDENTITY_STALE when cached identity is undefined but incoming has identityId', () => {
758
- const result = isIdentityCacheStale(undefined, { identityId: 'test', traits: {} });
759
- expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
760
- expect(result.isCacheStale).toBe(true);
761
- expect(result.isIdentityIdStale).toBe(true);
762
- });
763
- });
764
- describe('Volatile Traits Optimization - Backward Compatibility', () => {
765
- afterEach(() => {
766
- jest.resetModules();
767
- });
768
- it('should maintain isAddressesStale=true when either IP or non-IP addresses are stale', () => {
769
- const cachedIdentity = {
770
- identityId: 'test-id',
771
- traits: {
772
- addresses: [{ city: 'OldCity', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
773
- },
774
- };
775
- const incomingIdentity = {
776
- identityId: 'test-id',
777
- traits: {
778
- addresses: [{ city: 'NewCity', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
779
- },
780
- };
781
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
782
- expect(result.isAddressesStale).toBe(true);
783
- expect(result.isIpAddressesStale).toBe(true);
784
- expect(result.isNonIpAddressesStale).toBe(false);
785
- });
786
- it('should include all stale trait tracker fields', () => {
787
- const cachedIdentity = {
788
- identityId: 'test-id',
789
- traits: {},
790
- };
791
- const incomingIdentity = {
792
- identityId: 'test-id',
793
- traits: {},
794
- };
795
- const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
796
- expect(result).toHaveProperty('cachedTraits');
797
- expect(result).toHaveProperty('incomingTraits');
798
- expect(result).toHaveProperty('isIdentityIdStale');
799
- expect(result).toHaveProperty('isUserIdsStale');
800
- expect(result).toHaveProperty('isIdsStale');
801
- expect(result).toHaveProperty('isEmailsStale');
802
- expect(result).toHaveProperty('isPhonesStale');
803
- expect(result).toHaveProperty('isShopifyYIdsStale');
804
- expect(result).toHaveProperty('isGendersStale');
805
- expect(result).toHaveProperty('isDobsStale');
806
- expect(result).toHaveProperty('isAddressesStale');
807
- expect(result).toHaveProperty('isIpAddressesStale');
808
- expect(result).toHaveProperty('isNonIpAddressesStale');
809
- expect(result).toHaveProperty('isClickInfosStale');
810
- expect(result).toHaveProperty('isIpAddressStale');
811
- expect(result).toHaveProperty('isUserAgentStale');
812
- expect(result).toHaveProperty('isThirdPartyContactsStale');
813
- expect(result).toHaveProperty('isCacheStale');
814
- expect(result).toHaveProperty('staleTier');
815
- });
816
- });
1
+ import { ADDRESS_INFO_SOURCE } from '@adtrackify/at-tracking-event-types';
2
+ import { isIdentityCacheStale, IDENTITY_CACHE_STALENESS_TIER } from '@adtrackify/at-shared-utils';
3
+ describe('Volatile Traits Optimization - Tier Classification', () => {
4
+ afterEach(() => {
5
+ jest.resetModules();
6
+ });
7
+ describe('TIER: NONE — Cache is fresh', () => {
8
+ it('should return NONE when cached and incoming are identical', () => {
9
+ const identity = {
10
+ identityId: 'test-id',
11
+ traits: {
12
+ emails: ['test@email.com'],
13
+ phones: ['+1234567890'],
14
+ ipAddress: '192.168.1.1',
15
+ userAgent: 'Mozilla/5.0',
16
+ addresses: [{ city: 'New York', s: ADDRESS_INFO_SOURCE.INPUT }],
17
+ },
18
+ };
19
+ const result = isIdentityCacheStale(identity, identity);
20
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
21
+ expect(result.isCacheStale).toBe(false);
22
+ expect(result.isIpAddressStale).toBe(false);
23
+ expect(result.isUserAgentStale).toBe(false);
24
+ expect(result.isEmailsStale).toBe(false);
25
+ expect(result.isAddressesStale).toBe(false);
26
+ });
27
+ it('should return NONE when incoming is subset of cached', () => {
28
+ const cachedIdentity = {
29
+ identityId: 'test-id',
30
+ traits: {
31
+ emails: ['a@email.com', 'b@email.com'],
32
+ phones: ['+1234567890', '+9876543210'],
33
+ userIds: ['user1', 'user2'],
34
+ },
35
+ };
36
+ const incomingIdentity = {
37
+ identityId: 'test-id',
38
+ traits: {
39
+ emails: ['a@email.com'],
40
+ phones: ['+1234567890'],
41
+ },
42
+ };
43
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
44
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
45
+ expect(result.isCacheStale).toBe(false);
46
+ });
47
+ });
48
+ describe('TIER: VOLATILE_ONLY — Only session traits changed', () => {
49
+ it('should return VOLATILE_ONLY when only ipAddress is stale', () => {
50
+ const cachedIdentity = {
51
+ identityId: 'test-id',
52
+ traits: {
53
+ emails: ['test@email.com'],
54
+ ipAddress: '192.168.1.1',
55
+ },
56
+ };
57
+ const incomingIdentity = {
58
+ identityId: 'test-id',
59
+ traits: {
60
+ emails: ['test@email.com'],
61
+ ipAddress: '10.0.0.1',
62
+ },
63
+ };
64
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
65
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
66
+ expect(result.isCacheStale).toBe(false);
67
+ expect(result.isIpAddressStale).toBe(true);
68
+ expect(result.isUserAgentStale).toBe(false);
69
+ });
70
+ it('should return VOLATILE_ONLY when only userAgent is stale', () => {
71
+ const cachedIdentity = {
72
+ identityId: 'test-id',
73
+ traits: {
74
+ emails: ['test@email.com'],
75
+ userAgent: 'Mozilla/5.0 (Windows NT 10.0)',
76
+ },
77
+ };
78
+ const incomingIdentity = {
79
+ identityId: 'test-id',
80
+ traits: {
81
+ emails: ['test@email.com'],
82
+ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X)',
83
+ },
84
+ };
85
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
86
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
87
+ expect(result.isCacheStale).toBe(false);
88
+ expect(result.isUserAgentStale).toBe(true);
89
+ expect(result.isIpAddressStale).toBe(false);
90
+ });
91
+ it('should return VOLATILE_ONLY when only IP-sourced addresses are stale', () => {
92
+ const cachedIdentity = {
93
+ identityId: 'test-id',
94
+ traits: {
95
+ emails: ['test@email.com'],
96
+ addresses: [{ city: 'New York', country: 'USA', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
97
+ },
98
+ };
99
+ const incomingIdentity = {
100
+ identityId: 'test-id',
101
+ traits: {
102
+ emails: ['test@email.com'],
103
+ addresses: [{ city: 'Los Angeles', country: 'USA', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
104
+ },
105
+ };
106
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
107
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
108
+ expect(result.isCacheStale).toBe(false);
109
+ expect(result.isIpAddressesStale).toBe(true);
110
+ expect(result.isNonIpAddressesStale).toBe(false);
111
+ });
112
+ it('should return VOLATILE_ONLY when ipAddress AND userAgent are both stale', () => {
113
+ const cachedIdentity = {
114
+ identityId: 'test-id',
115
+ traits: {
116
+ emails: ['test@email.com'],
117
+ ipAddress: '192.168.1.1',
118
+ userAgent: 'Mozilla/5.0 (Windows)',
119
+ },
120
+ };
121
+ const incomingIdentity = {
122
+ identityId: 'test-id',
123
+ traits: {
124
+ emails: ['test@email.com'],
125
+ ipAddress: '10.0.0.1',
126
+ userAgent: 'Mozilla/5.0 (Mac)',
127
+ },
128
+ };
129
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
130
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
131
+ expect(result.isCacheStale).toBe(false);
132
+ expect(result.isIpAddressStale).toBe(true);
133
+ expect(result.isUserAgentStale).toBe(true);
134
+ });
135
+ it('should return VOLATILE_ONLY when ipAddress AND IP-sourced address are both stale', () => {
136
+ const cachedIdentity = {
137
+ identityId: 'test-id',
138
+ traits: {
139
+ emails: ['test@email.com'],
140
+ ipAddress: '192.168.1.1',
141
+ addresses: [{ city: 'Chicago', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
142
+ },
143
+ };
144
+ const incomingIdentity = {
145
+ identityId: 'test-id',
146
+ traits: {
147
+ emails: ['test@email.com'],
148
+ ipAddress: '10.0.0.1',
149
+ addresses: [{ city: 'Denver', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
150
+ },
151
+ };
152
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
153
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
154
+ expect(result.isCacheStale).toBe(false);
155
+ expect(result.isIpAddressStale).toBe(true);
156
+ expect(result.isIpAddressesStale).toBe(true);
157
+ });
158
+ it('should return VOLATILE_ONLY when all volatile traits are stale but no identity traits', () => {
159
+ const cachedIdentity = {
160
+ identityId: 'test-id',
161
+ traits: {
162
+ emails: ['test@email.com'],
163
+ ipAddress: '192.168.1.1',
164
+ userAgent: 'Mozilla/5.0 (Windows)',
165
+ addresses: [{ city: 'Seattle', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
166
+ },
167
+ };
168
+ const incomingIdentity = {
169
+ identityId: 'test-id',
170
+ traits: {
171
+ emails: ['test@email.com'],
172
+ ipAddress: '172.16.0.1',
173
+ userAgent: 'Chrome/120.0',
174
+ addresses: [{ city: 'Portland', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
175
+ },
176
+ };
177
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
178
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
179
+ expect(result.isCacheStale).toBe(false);
180
+ expect(result.isIpAddressStale).toBe(true);
181
+ expect(result.isUserAgentStale).toBe(true);
182
+ expect(result.isIpAddressesStale).toBe(true);
183
+ });
184
+ });
185
+ describe('TIER: ADDRESS_UPDATE — Non-IP address changed', () => {
186
+ it('should return ADDRESS_UPDATE when only non-IP address is new', () => {
187
+ const cachedIdentity = {
188
+ identityId: 'test-id',
189
+ traits: {
190
+ emails: ['test@email.com'],
191
+ addresses: [],
192
+ },
193
+ };
194
+ const incomingIdentity = {
195
+ identityId: 'test-id',
196
+ traits: {
197
+ emails: ['test@email.com'],
198
+ addresses: [{ city: 'Boston', province: 'MA', s: ADDRESS_INFO_SOURCE.INPUT }],
199
+ },
200
+ };
201
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
202
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
203
+ expect(result.isCacheStale).toBe(true);
204
+ expect(result.isNonIpAddressesStale).toBe(true);
205
+ expect(result.isIpAddressesStale).toBe(false);
206
+ });
207
+ it('should return ADDRESS_UPDATE when non-IP address AND volatile traits are both stale', () => {
208
+ const cachedIdentity = {
209
+ identityId: 'test-id',
210
+ traits: {
211
+ emails: ['test@email.com'],
212
+ ipAddress: '192.168.1.1',
213
+ userAgent: 'Mozilla/5.0',
214
+ addresses: [],
215
+ },
216
+ };
217
+ const incomingIdentity = {
218
+ identityId: 'test-id',
219
+ traits: {
220
+ emails: ['test@email.com'],
221
+ ipAddress: '10.0.0.1',
222
+ userAgent: 'Chrome/120.0',
223
+ addresses: [{ city: 'Austin', firstName: 'John', s: ADDRESS_INFO_SOURCE.INPUT }],
224
+ },
225
+ };
226
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
227
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
228
+ expect(result.isCacheStale).toBe(true);
229
+ expect(result.isNonIpAddressesStale).toBe(true);
230
+ expect(result.isIpAddressStale).toBe(true);
231
+ expect(result.isUserAgentStale).toBe(true);
232
+ });
233
+ it('should return ADDRESS_UPDATE when new input address added to existing addresses', () => {
234
+ const cachedIdentity = {
235
+ identityId: 'test-id',
236
+ traits: {
237
+ emails: ['test@email.com'],
238
+ addresses: [{ city: 'Miami', s: ADDRESS_INFO_SOURCE.INPUT }],
239
+ },
240
+ };
241
+ const incomingIdentity = {
242
+ identityId: 'test-id',
243
+ traits: {
244
+ emails: ['test@email.com'],
245
+ addresses: [
246
+ { city: 'Miami', s: ADDRESS_INFO_SOURCE.INPUT },
247
+ { city: 'Tampa', s: ADDRESS_INFO_SOURCE.INPUT },
248
+ ],
249
+ },
250
+ };
251
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
252
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
253
+ expect(result.isCacheStale).toBe(true);
254
+ expect(result.isNonIpAddressesStale).toBe(true);
255
+ });
256
+ it('should return ADDRESS_UPDATE when address with PII (no source field) is added', () => {
257
+ const cachedIdentity = {
258
+ identityId: 'test-id',
259
+ traits: {
260
+ emails: ['test@email.com'],
261
+ addresses: [],
262
+ },
263
+ };
264
+ const incomingIdentity = {
265
+ identityId: 'test-id',
266
+ traits: {
267
+ emails: ['test@email.com'],
268
+ addresses: [{ city: 'Dallas', firstName: 'Jane', lastName: 'Doe' }],
269
+ },
270
+ };
271
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
272
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
273
+ expect(result.isCacheStale).toBe(true);
274
+ expect(result.isNonIpAddressesStale).toBe(true);
275
+ });
276
+ });
277
+ describe('TIER: IDENTITY_STALE — Identity-defining traits changed', () => {
278
+ it('should return IDENTITY_STALE when emails are stale', () => {
279
+ const cachedIdentity = {
280
+ identityId: 'test-id',
281
+ traits: { emails: ['old@email.com'] },
282
+ };
283
+ const incomingIdentity = {
284
+ identityId: 'test-id',
285
+ traits: { emails: ['old@email.com', 'new@email.com'] },
286
+ };
287
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
288
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
289
+ expect(result.isCacheStale).toBe(true);
290
+ expect(result.isEmailsStale).toBe(true);
291
+ });
292
+ it('should return IDENTITY_STALE when phones are stale', () => {
293
+ const cachedIdentity = {
294
+ identityId: 'test-id',
295
+ traits: { phones: ['+1234567890'] },
296
+ };
297
+ const incomingIdentity = {
298
+ identityId: 'test-id',
299
+ traits: { phones: ['+1234567890', '+9876543210'] },
300
+ };
301
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
302
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
303
+ expect(result.isCacheStale).toBe(true);
304
+ expect(result.isPhonesStale).toBe(true);
305
+ });
306
+ it('should return IDENTITY_STALE when userIds are stale', () => {
307
+ const cachedIdentity = {
308
+ identityId: 'test-id',
309
+ traits: { userIds: ['user1'] },
310
+ };
311
+ const incomingIdentity = {
312
+ identityId: 'test-id',
313
+ traits: { userIds: ['user1', 'user2'] },
314
+ };
315
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
316
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
317
+ expect(result.isCacheStale).toBe(true);
318
+ expect(result.isUserIdsStale).toBe(true);
319
+ });
320
+ it('should return IDENTITY_STALE when clickInfos are stale', () => {
321
+ const cachedIdentity = {
322
+ identityId: 'test-id',
323
+ traits: { click: { gclid: 'old_gclid' } },
324
+ };
325
+ const incomingIdentity = {
326
+ identityId: 'test-id',
327
+ traits: { click: { gclid: 'new_gclid' } },
328
+ };
329
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
330
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
331
+ expect(result.isCacheStale).toBe(true);
332
+ expect(result.isClickInfosStale).toBe(true);
333
+ });
334
+ it('should return IDENTITY_STALE when identityId is stale', () => {
335
+ const cachedIdentity = {
336
+ identityId: 'old-id',
337
+ traits: { emails: ['test@email.com'] },
338
+ };
339
+ const incomingIdentity = {
340
+ identityId: 'new-id',
341
+ traits: { emails: ['test@email.com'] },
342
+ };
343
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
344
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
345
+ expect(result.isCacheStale).toBe(true);
346
+ expect(result.isIdentityIdStale).toBe(true);
347
+ });
348
+ it('should return IDENTITY_STALE when emails stale AND volatile traits stale (highest tier wins)', () => {
349
+ const cachedIdentity = {
350
+ identityId: 'test-id',
351
+ traits: {
352
+ emails: ['old@email.com'],
353
+ ipAddress: '192.168.1.1',
354
+ userAgent: 'Mozilla/5.0',
355
+ },
356
+ };
357
+ const incomingIdentity = {
358
+ identityId: 'test-id',
359
+ traits: {
360
+ emails: ['old@email.com', 'new@email.com'],
361
+ ipAddress: '10.0.0.1',
362
+ userAgent: 'Chrome/120.0',
363
+ },
364
+ };
365
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
366
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
367
+ expect(result.isCacheStale).toBe(true);
368
+ expect(result.isEmailsStale).toBe(true);
369
+ expect(result.isIpAddressStale).toBe(true);
370
+ expect(result.isUserAgentStale).toBe(true);
371
+ });
372
+ it('should return IDENTITY_STALE when emails stale AND non-IP address stale (highest tier wins)', () => {
373
+ const cachedIdentity = {
374
+ identityId: 'test-id',
375
+ traits: {
376
+ emails: ['old@email.com'],
377
+ addresses: [],
378
+ },
379
+ };
380
+ const incomingIdentity = {
381
+ identityId: 'test-id',
382
+ traits: {
383
+ emails: ['old@email.com', 'new@email.com'],
384
+ addresses: [{ city: 'Phoenix', s: ADDRESS_INFO_SOURCE.INPUT }],
385
+ },
386
+ };
387
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
388
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
389
+ expect(result.isCacheStale).toBe(true);
390
+ expect(result.isEmailsStale).toBe(true);
391
+ expect(result.isNonIpAddressesStale).toBe(true);
392
+ });
393
+ });
394
+ });
395
+ describe('Volatile Traits Optimization - Address Source Filtering', () => {
396
+ afterEach(() => {
397
+ jest.resetModules();
398
+ });
399
+ describe('isAddressIpSourced inference', () => {
400
+ it('should treat address with s: IP_ADDRESS as IP-sourced', () => {
401
+ const cachedIdentity = {
402
+ identityId: 'test-id',
403
+ traits: { addresses: [] },
404
+ };
405
+ const incomingIdentity = {
406
+ identityId: 'test-id',
407
+ traits: {
408
+ addresses: [{ city: 'Atlanta', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
409
+ },
410
+ };
411
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
412
+ expect(result.isIpAddressesStale).toBe(true);
413
+ expect(result.isNonIpAddressesStale).toBe(false);
414
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
415
+ });
416
+ it('should treat address with s: INPUT as non-IP-sourced', () => {
417
+ const cachedIdentity = {
418
+ identityId: 'test-id',
419
+ traits: { addresses: [] },
420
+ };
421
+ const incomingIdentity = {
422
+ identityId: 'test-id',
423
+ traits: {
424
+ addresses: [{ city: 'Houston', s: ADDRESS_INFO_SOURCE.INPUT }],
425
+ },
426
+ };
427
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
428
+ expect(result.isNonIpAddressesStale).toBe(true);
429
+ expect(result.isIpAddressesStale).toBe(false);
430
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
431
+ });
432
+ it('should treat address without s but with firstName/lastName as non-IP (inferred input)', () => {
433
+ const cachedIdentity = {
434
+ identityId: 'test-id',
435
+ traits: { addresses: [] },
436
+ };
437
+ const incomingIdentity = {
438
+ identityId: 'test-id',
439
+ traits: {
440
+ addresses: [{ city: 'San Diego', firstName: 'Alice', lastName: 'Smith' }],
441
+ },
442
+ };
443
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
444
+ expect(result.isNonIpAddressesStale).toBe(true);
445
+ expect(result.isIpAddressesStale).toBe(false);
446
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
447
+ });
448
+ it('should treat address without s but with email as non-IP (inferred input)', () => {
449
+ const cachedIdentity = {
450
+ identityId: 'test-id',
451
+ traits: { addresses: [] },
452
+ };
453
+ const incomingIdentity = {
454
+ identityId: 'test-id',
455
+ traits: {
456
+ addresses: [{ city: 'Sacramento', email: 'addr@email.com' }],
457
+ },
458
+ };
459
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
460
+ expect(result.isNonIpAddressesStale).toBe(true);
461
+ expect(result.isIpAddressesStale).toBe(false);
462
+ });
463
+ it('should treat address without s but with phone as non-IP (inferred input)', () => {
464
+ const cachedIdentity = {
465
+ identityId: 'test-id',
466
+ traits: { addresses: [] },
467
+ };
468
+ const incomingIdentity = {
469
+ identityId: 'test-id',
470
+ traits: {
471
+ addresses: [{ city: 'San Jose', phone: '+15551234567' }],
472
+ },
473
+ };
474
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
475
+ expect(result.isNonIpAddressesStale).toBe(true);
476
+ expect(result.isIpAddressesStale).toBe(false);
477
+ });
478
+ it('should treat address without s and without PII as IP-sourced (inferred IP)', () => {
479
+ const cachedIdentity = {
480
+ identityId: 'test-id',
481
+ traits: { addresses: [] },
482
+ };
483
+ const incomingIdentity = {
484
+ identityId: 'test-id',
485
+ traits: {
486
+ addresses: [{ city: 'Oakland', country: 'USA', countryCode: 'US' }],
487
+ },
488
+ };
489
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
490
+ expect(result.isIpAddressesStale).toBe(true);
491
+ expect(result.isNonIpAddressesStale).toBe(false);
492
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
493
+ });
494
+ });
495
+ describe('filterAddressesBySource behavior', () => {
496
+ it('should correctly separate IP and non-IP addresses when mixed', () => {
497
+ const cachedIdentity = {
498
+ identityId: 'test-id',
499
+ traits: {
500
+ addresses: [
501
+ { city: 'IP City 1', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
502
+ { city: 'Input City 1', s: ADDRESS_INFO_SOURCE.INPUT },
503
+ ],
504
+ },
505
+ };
506
+ const incomingIdentity = {
507
+ identityId: 'test-id',
508
+ traits: {
509
+ addresses: [
510
+ { city: 'New IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
511
+ { city: 'Input City 1', s: ADDRESS_INFO_SOURCE.INPUT },
512
+ { city: 'New Input City', s: ADDRESS_INFO_SOURCE.INPUT },
513
+ ],
514
+ },
515
+ };
516
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
517
+ expect(result.isIpAddressesStale).toBe(true);
518
+ expect(result.isNonIpAddressesStale).toBe(true);
519
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
520
+ });
521
+ });
522
+ describe('hasNewNonIpAddress detection', () => {
523
+ it('should detect new input address as stale', () => {
524
+ const cachedIdentity = {
525
+ identityId: 'test-id',
526
+ traits: {
527
+ addresses: [{ city: 'Old City', s: ADDRESS_INFO_SOURCE.INPUT }],
528
+ },
529
+ };
530
+ const incomingIdentity = {
531
+ identityId: 'test-id',
532
+ traits: {
533
+ addresses: [
534
+ { city: 'Old City', s: ADDRESS_INFO_SOURCE.INPUT },
535
+ { city: 'New City', s: ADDRESS_INFO_SOURCE.INPUT },
536
+ ],
537
+ },
538
+ };
539
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
540
+ expect(result.isNonIpAddressesStale).toBe(true);
541
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
542
+ });
543
+ it('should NOT mark non-IP stale when only IP address is new', () => {
544
+ const cachedIdentity = {
545
+ identityId: 'test-id',
546
+ traits: {
547
+ addresses: [
548
+ { city: 'IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
549
+ { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
550
+ ],
551
+ },
552
+ };
553
+ const incomingIdentity = {
554
+ identityId: 'test-id',
555
+ traits: {
556
+ addresses: [
557
+ { city: 'New IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
558
+ { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
559
+ ],
560
+ },
561
+ };
562
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
563
+ expect(result.isIpAddressesStale).toBe(true);
564
+ expect(result.isNonIpAddressesStale).toBe(false);
565
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
566
+ });
567
+ });
568
+ describe('hasNewIpAddress detection', () => {
569
+ it('should detect new IP address for tracking purposes', () => {
570
+ const cachedIdentity = {
571
+ identityId: 'test-id',
572
+ traits: {
573
+ addresses: [{ city: 'Old IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
574
+ },
575
+ };
576
+ const incomingIdentity = {
577
+ identityId: 'test-id',
578
+ traits: {
579
+ addresses: [{ city: 'New IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
580
+ },
581
+ };
582
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
583
+ expect(result.isIpAddressesStale).toBe(true);
584
+ expect(result.isAddressesStale).toBe(true);
585
+ });
586
+ });
587
+ describe('Empty addresses edge cases', () => {
588
+ it('should return ADDRESS_UPDATE when cached empty and incoming has non-IP address', () => {
589
+ const cachedIdentity = {
590
+ identityId: 'test-id',
591
+ traits: { addresses: [] },
592
+ };
593
+ const incomingIdentity = {
594
+ identityId: 'test-id',
595
+ traits: {
596
+ addresses: [{ city: 'Memphis', s: ADDRESS_INFO_SOURCE.INPUT }],
597
+ },
598
+ };
599
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
600
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
601
+ expect(result.isCacheStale).toBe(true);
602
+ expect(result.isNonIpAddressesStale).toBe(true);
603
+ });
604
+ it('should return VOLATILE_ONLY when cached empty and incoming has only IP address', () => {
605
+ const cachedIdentity = {
606
+ identityId: 'test-id',
607
+ traits: { addresses: [] },
608
+ };
609
+ const incomingIdentity = {
610
+ identityId: 'test-id',
611
+ traits: {
612
+ addresses: [{ city: 'Detroit', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
613
+ },
614
+ };
615
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
616
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
617
+ expect(result.isCacheStale).toBe(false);
618
+ expect(result.isIpAddressesStale).toBe(true);
619
+ expect(result.isNonIpAddressesStale).toBe(false);
620
+ });
621
+ it('should return NONE when both cached and incoming have empty addresses', () => {
622
+ const cachedIdentity = {
623
+ identityId: 'test-id',
624
+ traits: { addresses: [] },
625
+ };
626
+ const incomingIdentity = {
627
+ identityId: 'test-id',
628
+ traits: { addresses: [] },
629
+ };
630
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
631
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
632
+ expect(result.isAddressesStale).toBe(false);
633
+ });
634
+ });
635
+ describe('All addresses have s field explicitly set', () => {
636
+ it('should correctly identify source when all addresses have explicit s field', () => {
637
+ const cachedIdentity = {
638
+ identityId: 'test-id',
639
+ traits: {
640
+ addresses: [
641
+ { city: 'IP1', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
642
+ { city: 'IN1', s: ADDRESS_INFO_SOURCE.INPUT },
643
+ ],
644
+ },
645
+ };
646
+ const incomingIdentity = {
647
+ identityId: 'test-id',
648
+ traits: {
649
+ addresses: [
650
+ { city: 'IP1', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
651
+ { city: 'IN1', s: ADDRESS_INFO_SOURCE.INPUT },
652
+ { city: 'IP2', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
653
+ { city: 'IN2', s: ADDRESS_INFO_SOURCE.INPUT },
654
+ ],
655
+ },
656
+ };
657
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
658
+ expect(result.isIpAddressesStale).toBe(true);
659
+ expect(result.isNonIpAddressesStale).toBe(true);
660
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
661
+ });
662
+ });
663
+ describe('Mixed addresses: some IP, some input — only input changes', () => {
664
+ it('should return ADDRESS_UPDATE when only input address changes', () => {
665
+ const cachedIdentity = {
666
+ identityId: 'test-id',
667
+ traits: {
668
+ addresses: [
669
+ { city: 'IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
670
+ { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
671
+ ],
672
+ },
673
+ };
674
+ const incomingIdentity = {
675
+ identityId: 'test-id',
676
+ traits: {
677
+ addresses: [
678
+ { city: 'IP City', s: ADDRESS_INFO_SOURCE.IP_ADDRESS },
679
+ { city: 'Input City', s: ADDRESS_INFO_SOURCE.INPUT },
680
+ { city: 'New Input City', s: ADDRESS_INFO_SOURCE.INPUT },
681
+ ],
682
+ },
683
+ };
684
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
685
+ expect(result.isIpAddressesStale).toBe(false);
686
+ expect(result.isNonIpAddressesStale).toBe(true);
687
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.ADDRESS_UPDATE);
688
+ });
689
+ });
690
+ });
691
+ describe('Volatile Traits Optimization - checkScalarTraitChanged behavior', () => {
692
+ afterEach(() => {
693
+ jest.resetModules();
694
+ });
695
+ it('should NOT mark stale when incoming is empty/undefined but cached has value', () => {
696
+ const cachedIdentity = {
697
+ identityId: 'test-id',
698
+ traits: {
699
+ ipAddress: '192.168.1.1',
700
+ userAgent: 'Mozilla/5.0',
701
+ },
702
+ };
703
+ const incomingIdentity = {
704
+ identityId: 'test-id',
705
+ traits: {},
706
+ };
707
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
708
+ expect(result.isIpAddressStale).toBe(false);
709
+ expect(result.isUserAgentStale).toBe(false);
710
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
711
+ });
712
+ it('should mark stale when cached is undefined but incoming has value', () => {
713
+ const cachedIdentity = {
714
+ identityId: 'test-id',
715
+ traits: {},
716
+ };
717
+ const incomingIdentity = {
718
+ identityId: 'test-id',
719
+ traits: {
720
+ ipAddress: '192.168.1.1',
721
+ userAgent: 'Mozilla/5.0',
722
+ },
723
+ };
724
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
725
+ expect(result.isIpAddressStale).toBe(true);
726
+ expect(result.isUserAgentStale).toBe(true);
727
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.VOLATILE_ONLY);
728
+ });
729
+ it('should mark stale when both have values but they differ', () => {
730
+ const cachedIdentity = {
731
+ identityId: 'test-id',
732
+ traits: { ipAddress: '192.168.1.1' },
733
+ };
734
+ const incomingIdentity = {
735
+ identityId: 'test-id',
736
+ traits: { ipAddress: '10.0.0.1' },
737
+ };
738
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
739
+ expect(result.isIpAddressStale).toBe(true);
740
+ });
741
+ });
742
+ describe('Volatile Traits Optimization - Error Handling', () => {
743
+ afterEach(() => {
744
+ jest.resetModules();
745
+ });
746
+ it('should return NONE when both identities have same identityId but malformed traits', () => {
747
+ const result = isIdentityCacheStale({ identityId: 'test', traits: 'not-an-object' }, { identityId: 'test', traits: 123 });
748
+ expect(result.isCacheStale).toBe(false);
749
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.NONE);
750
+ });
751
+ it('should return IDENTITY_STALE when cached identity is null but incoming has identityId', () => {
752
+ const result = isIdentityCacheStale(null, { identityId: 'test', traits: {} });
753
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
754
+ expect(result.isCacheStale).toBe(true);
755
+ expect(result.isIdentityIdStale).toBe(true);
756
+ });
757
+ it('should return IDENTITY_STALE when cached identity is undefined but incoming has identityId', () => {
758
+ const result = isIdentityCacheStale(undefined, { identityId: 'test', traits: {} });
759
+ expect(result.staleTier).toBe(IDENTITY_CACHE_STALENESS_TIER.IDENTITY_STALE);
760
+ expect(result.isCacheStale).toBe(true);
761
+ expect(result.isIdentityIdStale).toBe(true);
762
+ });
763
+ });
764
+ describe('Volatile Traits Optimization - Backward Compatibility', () => {
765
+ afterEach(() => {
766
+ jest.resetModules();
767
+ });
768
+ it('should maintain isAddressesStale=true when either IP or non-IP addresses are stale', () => {
769
+ const cachedIdentity = {
770
+ identityId: 'test-id',
771
+ traits: {
772
+ addresses: [{ city: 'OldCity', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
773
+ },
774
+ };
775
+ const incomingIdentity = {
776
+ identityId: 'test-id',
777
+ traits: {
778
+ addresses: [{ city: 'NewCity', s: ADDRESS_INFO_SOURCE.IP_ADDRESS }],
779
+ },
780
+ };
781
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
782
+ expect(result.isAddressesStale).toBe(true);
783
+ expect(result.isIpAddressesStale).toBe(true);
784
+ expect(result.isNonIpAddressesStale).toBe(false);
785
+ });
786
+ it('should include all stale trait tracker fields', () => {
787
+ const cachedIdentity = {
788
+ identityId: 'test-id',
789
+ traits: {},
790
+ };
791
+ const incomingIdentity = {
792
+ identityId: 'test-id',
793
+ traits: {},
794
+ };
795
+ const result = isIdentityCacheStale(cachedIdentity, incomingIdentity);
796
+ expect(result).toHaveProperty('cachedTraits');
797
+ expect(result).toHaveProperty('incomingTraits');
798
+ expect(result).toHaveProperty('isIdentityIdStale');
799
+ expect(result).toHaveProperty('isUserIdsStale');
800
+ expect(result).toHaveProperty('isIdsStale');
801
+ expect(result).toHaveProperty('isEmailsStale');
802
+ expect(result).toHaveProperty('isPhonesStale');
803
+ expect(result).toHaveProperty('isShopifyYIdsStale');
804
+ expect(result).toHaveProperty('isGendersStale');
805
+ expect(result).toHaveProperty('isDobsStale');
806
+ expect(result).toHaveProperty('isAddressesStale');
807
+ expect(result).toHaveProperty('isIpAddressesStale');
808
+ expect(result).toHaveProperty('isNonIpAddressesStale');
809
+ expect(result).toHaveProperty('isClickInfosStale');
810
+ expect(result).toHaveProperty('isIpAddressStale');
811
+ expect(result).toHaveProperty('isUserAgentStale');
812
+ expect(result).toHaveProperty('isThirdPartyContactsStale');
813
+ expect(result).toHaveProperty('isCacheStale');
814
+ expect(result).toHaveProperty('staleTier');
815
+ });
816
+ });
817
817
  //# sourceMappingURL=volatile-traits-optimization.spec.js.map