@croct/sdk 0.17.11 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/activeRecord.cjs +1 -2
  2. package/activeRecord.d.cts +26 -0
  3. package/activeRecord.js +1 -2
  4. package/apiKey.cjs +0 -1
  5. package/apiKey.d.cts +48 -0
  6. package/apiKey.js +0 -1
  7. package/base64Url.cjs +0 -1
  8. package/base64Url.d.cts +4 -0
  9. package/base64Url.js +0 -1
  10. package/cache/cache.cjs +0 -1
  11. package/cache/cache.d.cts +17 -0
  12. package/cache/cache.js +0 -1
  13. package/cache/cookieCache.cjs +0 -1
  14. package/cache/cookieCache.d.cts +22 -0
  15. package/cache/cookieCache.js +0 -1
  16. package/cache/fallbackCache.cjs +0 -1
  17. package/cache/fallbackCache.d.cts +11 -0
  18. package/cache/fallbackCache.js +0 -1
  19. package/cache/inMemoryCache.cjs +0 -1
  20. package/cache/inMemoryCache.d.cts +11 -0
  21. package/cache/inMemoryCache.js +0 -1
  22. package/cache/index.cjs +5 -6
  23. package/cache/index.d.cts +4 -0
  24. package/cache/index.js +4 -5
  25. package/cache/localStorageCache.cjs +0 -1
  26. package/cache/localStorageCache.d.cts +19 -0
  27. package/cache/localStorageCache.js +0 -1
  28. package/channel/channel.cjs +1 -2
  29. package/channel/channel.d.cts +24 -0
  30. package/channel/channel.js +1 -2
  31. package/channel/encodedChannel.cjs +0 -1
  32. package/channel/encodedChannel.d.cts +12 -0
  33. package/channel/encodedChannel.js +0 -1
  34. package/channel/guaranteedChannel.cjs +2 -3
  35. package/channel/guaranteedChannel.d.cts +33 -0
  36. package/channel/guaranteedChannel.js +2 -3
  37. package/channel/httpBeaconChannel.cjs +5 -6
  38. package/channel/httpBeaconChannel.d.cts +26 -0
  39. package/channel/httpBeaconChannel.js +5 -6
  40. package/channel/index.cjs +8 -9
  41. package/channel/index.d.cts +12 -0
  42. package/channel/index.js +7 -8
  43. package/channel/queuedChannel.cjs +2 -3
  44. package/channel/queuedChannel.d.cts +21 -0
  45. package/channel/queuedChannel.js +2 -3
  46. package/channel/retryChannel.cjs +2 -3
  47. package/channel/retryChannel.d.cts +21 -0
  48. package/channel/retryChannel.js +2 -3
  49. package/channel/sandboxChannel.cjs +1 -2
  50. package/channel/sandboxChannel.d.cts +15 -0
  51. package/channel/sandboxChannel.js +1 -2
  52. package/cid/assigner.cjs +0 -1
  53. package/cid/assigner.d.cts +5 -0
  54. package/cid/assigner.js +0 -1
  55. package/cid/cachedAssigner.cjs +1 -2
  56. package/cid/cachedAssigner.d.cts +17 -0
  57. package/cid/cachedAssigner.js +1 -2
  58. package/cid/fixedAssigner.cjs +0 -1
  59. package/cid/fixedAssigner.d.cts +9 -0
  60. package/cid/fixedAssigner.js +0 -1
  61. package/cid/index.cjs +5 -6
  62. package/cid/index.d.cts +6 -0
  63. package/cid/index.js +4 -5
  64. package/cid/remoteAssigner.cjs +3 -4
  65. package/cid/remoteAssigner.d.cts +13 -0
  66. package/cid/remoteAssigner.js +3 -4
  67. package/constants.cjs +1 -2
  68. package/constants.d.cts +6 -0
  69. package/constants.d.ts +2 -2
  70. package/constants.js +1 -2
  71. package/container.cjs +18 -19
  72. package/container.d.cts +95 -0
  73. package/container.js +18 -19
  74. package/contentFetcher.cjs +4 -5
  75. package/contentFetcher.d.cts +69 -0
  76. package/contentFetcher.js +4 -5
  77. package/context.cjs +4 -5
  78. package/context.d.cts +36 -0
  79. package/context.js +4 -5
  80. package/error.cjs +0 -1
  81. package/error.d.cts +4 -0
  82. package/error.js +0 -1
  83. package/evaluator.cjs +5 -6
  84. package/evaluator.d.cts +86 -0
  85. package/evaluator.js +5 -6
  86. package/eventManager.cjs +0 -1
  87. package/eventManager.d.cts +21 -0
  88. package/eventManager.js +0 -1
  89. package/eventSubjectProcessor.cjs +0 -1
  90. package/eventSubjectProcessor.d.cts +22 -0
  91. package/eventSubjectProcessor.js +0 -1
  92. package/facade/contentFetcherFacade.cjs +2 -3
  93. package/facade/contentFetcherFacade.d.cts +36 -0
  94. package/facade/contentFetcherFacade.js +2 -3
  95. package/facade/evaluatorFacade.cjs +2 -3
  96. package/facade/evaluatorFacade.d.cts +41 -0
  97. package/facade/evaluatorFacade.js +2 -3
  98. package/facade/index.cjs +7 -10
  99. package/facade/index.d.cts +29 -0
  100. package/facade/index.js +7 -9
  101. package/facade/sdkFacade.cjs +10 -11
  102. package/facade/sdkFacade.d.cts +86 -0
  103. package/facade/sdkFacade.js +10 -11
  104. package/facade/sessionFacade.cjs +1 -2
  105. package/facade/sessionFacade.d.cts +22 -0
  106. package/facade/sessionFacade.js +1 -2
  107. package/facade/sessionPatch.cjs +1 -2
  108. package/facade/sessionPatch.d.cts +21 -0
  109. package/facade/sessionPatch.js +1 -2
  110. package/facade/trackerFacade.cjs +2 -3
  111. package/facade/trackerFacade.d.cts +25 -0
  112. package/facade/trackerFacade.js +2 -3
  113. package/facade/userFacade.cjs +1 -2
  114. package/facade/userFacade.d.cts +28 -0
  115. package/facade/userFacade.js +1 -2
  116. package/facade/userPatch.cjs +1 -2
  117. package/facade/userPatch.d.cts +21 -0
  118. package/facade/userPatch.js +1 -2
  119. package/help.cjs +0 -1
  120. package/help.d.cts +5 -0
  121. package/help.js +0 -1
  122. package/index.cjs +2 -5
  123. package/index.d.cts +25 -0
  124. package/index.js +2 -4
  125. package/logging/consoleLogger.cjs +0 -1
  126. package/logging/consoleLogger.d.cts +13 -0
  127. package/logging/consoleLogger.js +0 -1
  128. package/logging/filteredLogger.cjs +0 -1
  129. package/logging/filteredLogger.d.cts +22 -0
  130. package/logging/filteredLogger.js +0 -1
  131. package/logging/index.cjs +6 -7
  132. package/logging/index.d.cts +5 -0
  133. package/logging/index.js +5 -6
  134. package/logging/logger.cjs +0 -1
  135. package/logging/logger.d.cts +11 -0
  136. package/logging/logger.js +0 -1
  137. package/logging/namespacedLogger.cjs +0 -1
  138. package/logging/namespacedLogger.d.cts +14 -0
  139. package/logging/namespacedLogger.js +0 -1
  140. package/logging/nullLogger.cjs +0 -1
  141. package/logging/nullLogger.d.cts +10 -0
  142. package/logging/nullLogger.js +0 -1
  143. package/namespacedStorage.cjs +0 -1
  144. package/namespacedStorage.d.cts +16 -0
  145. package/namespacedStorage.js +0 -1
  146. package/package.json +4 -1
  147. package/patch.cjs +0 -1
  148. package/patch.d.cts +46 -0
  149. package/patch.js +0 -1
  150. package/queue/capacityRestrictedQueue.cjs +0 -1
  151. package/queue/capacityRestrictedQueue.d.cts +16 -0
  152. package/queue/capacityRestrictedQueue.js +0 -1
  153. package/queue/inMemoryQueue.cjs +0 -1
  154. package/queue/inMemoryQueue.d.cts +15 -0
  155. package/queue/inMemoryQueue.js +0 -1
  156. package/queue/index.cjs +6 -7
  157. package/queue/index.d.cts +6 -0
  158. package/queue/index.js +5 -6
  159. package/queue/monitoredQueue.cjs +1 -2
  160. package/queue/monitoredQueue.d.cts +28 -0
  161. package/queue/monitoredQueue.js +1 -2
  162. package/queue/persistentQueue.cjs +0 -1
  163. package/queue/persistentQueue.d.cts +18 -0
  164. package/queue/persistentQueue.js +0 -1
  165. package/queue/queue.cjs +0 -1
  166. package/queue/queue.d.cts +11 -0
  167. package/queue/queue.js +0 -1
  168. package/retry/arbitraryPolicy.cjs +0 -1
  169. package/retry/arbitraryPolicy.d.cts +10 -0
  170. package/retry/arbitraryPolicy.js +0 -1
  171. package/retry/backoffPolicy.cjs +0 -1
  172. package/retry/backoffPolicy.d.cts +26 -0
  173. package/retry/backoffPolicy.js +0 -1
  174. package/retry/index.cjs +6 -7
  175. package/retry/index.d.cts +5 -0
  176. package/retry/index.js +5 -6
  177. package/retry/maxAttemptsPolicy.cjs +0 -1
  178. package/retry/maxAttemptsPolicy.d.cts +11 -0
  179. package/retry/maxAttemptsPolicy.js +0 -1
  180. package/retry/neverPolicy.cjs +0 -1
  181. package/retry/neverPolicy.d.cts +8 -0
  182. package/retry/neverPolicy.js +0 -1
  183. package/retry/policy.cjs +0 -1
  184. package/retry/policy.d.cts +6 -0
  185. package/retry/policy.js +0 -1
  186. package/schema/attributeSchema.cjs +1 -2
  187. package/schema/attributeSchema.d.cts +6 -0
  188. package/schema/attributeSchema.js +1 -2
  189. package/schema/contentFetcherSchemas.cjs +1 -2
  190. package/schema/contentFetcherSchemas.d.cts +6 -0
  191. package/schema/contentFetcherSchemas.js +1 -2
  192. package/schema/contentSchemas.cjs +1 -2
  193. package/schema/contentSchemas.d.cts +6 -0
  194. package/schema/contentSchemas.js +1 -2
  195. package/schema/contextSchemas.cjs +1 -2
  196. package/schema/contextSchemas.d.cts +6 -0
  197. package/schema/contextSchemas.js +1 -2
  198. package/schema/ecommerceSchemas.cjs +1 -2
  199. package/schema/ecommerceSchemas.d.cts +10 -0
  200. package/schema/ecommerceSchemas.js +1 -2
  201. package/schema/evaluatorSchemas.cjs +1 -2
  202. package/schema/evaluatorSchemas.d.cts +6 -0
  203. package/schema/evaluatorSchemas.js +1 -2
  204. package/schema/eventSchemas.cjs +4 -5
  205. package/schema/eventSchemas.d.cts +16 -0
  206. package/schema/eventSchemas.js +4 -5
  207. package/schema/index.cjs +22 -23
  208. package/schema/index.d.cts +14 -0
  209. package/schema/index.js +11 -12
  210. package/schema/loggerSchema.cjs +1 -2
  211. package/schema/loggerSchema.d.cts +6 -0
  212. package/schema/loggerSchema.js +1 -2
  213. package/schema/operationSchemas.cjs +2 -3
  214. package/schema/operationSchemas.d.cts +14 -0
  215. package/schema/operationSchemas.js +2 -3
  216. package/schema/sdkFacadeSchemas.cjs +4 -5
  217. package/schema/sdkFacadeSchemas.d.cts +6 -0
  218. package/schema/sdkFacadeSchemas.js +4 -5
  219. package/schema/sdkSchemas.cjs +3 -4
  220. package/schema/sdkSchemas.d.cts +8 -0
  221. package/schema/sdkSchemas.js +3 -4
  222. package/schema/tokenSchema.cjs +1 -2
  223. package/schema/tokenSchema.d.cts +6 -0
  224. package/schema/tokenSchema.js +1 -2
  225. package/schema/userSchema.cjs +2 -3
  226. package/schema/userSchema.d.cts +6 -0
  227. package/schema/userSchema.js +2 -3
  228. package/sdk.cjs +4 -5
  229. package/sdk.d.cts +69 -0
  230. package/sdk.js +4 -5
  231. package/sdkEvents.cjs +0 -1
  232. package/sdkEvents.d.cts +15 -0
  233. package/sdkEvents.js +0 -1
  234. package/sourceLocation.cjs +0 -1
  235. package/sourceLocation.d.cts +14 -0
  236. package/sourceLocation.js +0 -1
  237. package/tab.cjs +1 -2
  238. package/tab.d.cts +40 -0
  239. package/tab.js +1 -2
  240. package/token/cachedTokenStore.cjs +1 -2
  241. package/token/cachedTokenStore.d.cts +13 -0
  242. package/token/cachedTokenStore.js +1 -2
  243. package/token/inMemoryTokenStore.cjs +0 -1
  244. package/token/inMemoryTokenStore.d.cts +11 -0
  245. package/token/inMemoryTokenStore.js +0 -1
  246. package/token/index.cjs +5 -6
  247. package/token/index.d.cts +7 -0
  248. package/token/index.js +4 -5
  249. package/token/replicatedTokenStore.cjs +0 -1
  250. package/token/replicatedTokenStore.d.cts +13 -0
  251. package/token/replicatedTokenStore.js +0 -1
  252. package/token/token.cjs +3 -4
  253. package/token/token.d.cts +70 -0
  254. package/token/token.js +3 -4
  255. package/tracker.cjs +3 -4
  256. package/tracker.d.cts +82 -0
  257. package/tracker.js +3 -4
  258. package/trackingEvents.cjs +0 -1
  259. package/trackingEvents.d.cts +309 -0
  260. package/trackingEvents.js +0 -1
  261. package/transformer.cjs +0 -1
  262. package/transformer.d.cts +6 -0
  263. package/transformer.js +0 -1
  264. package/utilityTypes.cjs +0 -1
  265. package/utilityTypes.d.cts +4 -0
  266. package/utilityTypes.js +0 -1
  267. package/uuid.cjs +0 -1
  268. package/uuid.d.cts +3 -0
  269. package/uuid.js +0 -1
  270. package/validation/arrayType.cjs +2 -3
  271. package/validation/arrayType.d.cts +16 -0
  272. package/validation/arrayType.js +2 -3
  273. package/validation/booleanType.cjs +2 -3
  274. package/validation/booleanType.d.cts +9 -0
  275. package/validation/booleanType.js +2 -3
  276. package/validation/functionType.cjs +2 -3
  277. package/validation/functionType.d.cts +9 -0
  278. package/validation/functionType.js +2 -3
  279. package/validation/index.cjs +14 -15
  280. package/validation/index.d.cts +12 -0
  281. package/validation/index.js +12 -13
  282. package/validation/jsonType.cjs +2 -3
  283. package/validation/jsonType.d.cts +35 -0
  284. package/validation/jsonType.js +2 -3
  285. package/validation/mixedSchema.cjs +0 -1
  286. package/validation/mixedSchema.d.cts +7 -0
  287. package/validation/mixedSchema.js +0 -1
  288. package/validation/nullType.cjs +2 -3
  289. package/validation/nullType.d.cts +9 -0
  290. package/validation/nullType.js +2 -3
  291. package/validation/numberType.cjs +2 -3
  292. package/validation/numberType.d.cts +16 -0
  293. package/validation/numberType.js +2 -3
  294. package/validation/objectType.cjs +3 -4
  295. package/validation/objectType.d.cts +30 -0
  296. package/validation/objectType.js +3 -4
  297. package/validation/schema.cjs +0 -1
  298. package/validation/schema.d.cts +18 -0
  299. package/validation/schema.js +0 -1
  300. package/validation/stringType.cjs +2 -3
  301. package/validation/stringType.d.cts +24 -0
  302. package/validation/stringType.js +2 -3
  303. package/validation/unionType.cjs +2 -3
  304. package/validation/unionType.d.cts +11 -0
  305. package/validation/unionType.js +2 -3
  306. package/validation/violation.cjs +0 -1
  307. package/validation/violation.d.cts +4 -0
  308. package/validation/violation.js +0 -1
  309. package/activeRecord.cjs.map +0 -1
  310. package/activeRecord.js.map +0 -1
  311. package/apiKey.cjs.map +0 -1
  312. package/apiKey.js.map +0 -1
  313. package/base64Url.cjs.map +0 -1
  314. package/base64Url.js.map +0 -1
  315. package/cache/cache.cjs.map +0 -1
  316. package/cache/cache.js.map +0 -1
  317. package/cache/cookieCache.cjs.map +0 -1
  318. package/cache/cookieCache.js.map +0 -1
  319. package/cache/fallbackCache.cjs.map +0 -1
  320. package/cache/fallbackCache.js.map +0 -1
  321. package/cache/inMemoryCache.cjs.map +0 -1
  322. package/cache/inMemoryCache.js.map +0 -1
  323. package/cache/index.cjs.map +0 -1
  324. package/cache/index.js.map +0 -1
  325. package/cache/localStorageCache.cjs.map +0 -1
  326. package/cache/localStorageCache.js.map +0 -1
  327. package/channel/channel.cjs.map +0 -1
  328. package/channel/channel.js.map +0 -1
  329. package/channel/encodedChannel.cjs.map +0 -1
  330. package/channel/encodedChannel.js.map +0 -1
  331. package/channel/guaranteedChannel.cjs.map +0 -1
  332. package/channel/guaranteedChannel.js.map +0 -1
  333. package/channel/httpBeaconChannel.cjs.map +0 -1
  334. package/channel/httpBeaconChannel.js.map +0 -1
  335. package/channel/index.cjs.map +0 -1
  336. package/channel/index.js.map +0 -1
  337. package/channel/queuedChannel.cjs.map +0 -1
  338. package/channel/queuedChannel.js.map +0 -1
  339. package/channel/retryChannel.cjs.map +0 -1
  340. package/channel/retryChannel.js.map +0 -1
  341. package/channel/sandboxChannel.cjs.map +0 -1
  342. package/channel/sandboxChannel.js.map +0 -1
  343. package/cid/assigner.cjs.map +0 -1
  344. package/cid/assigner.js.map +0 -1
  345. package/cid/cachedAssigner.cjs.map +0 -1
  346. package/cid/cachedAssigner.js.map +0 -1
  347. package/cid/fixedAssigner.cjs.map +0 -1
  348. package/cid/fixedAssigner.js.map +0 -1
  349. package/cid/index.cjs.map +0 -1
  350. package/cid/index.js.map +0 -1
  351. package/cid/remoteAssigner.cjs.map +0 -1
  352. package/cid/remoteAssigner.js.map +0 -1
  353. package/constants.cjs.map +0 -1
  354. package/constants.js.map +0 -1
  355. package/container.cjs.map +0 -1
  356. package/container.js.map +0 -1
  357. package/contentFetcher.cjs.map +0 -1
  358. package/contentFetcher.js.map +0 -1
  359. package/context.cjs.map +0 -1
  360. package/context.js.map +0 -1
  361. package/error.cjs.map +0 -1
  362. package/error.js.map +0 -1
  363. package/evaluator.cjs.map +0 -1
  364. package/evaluator.js.map +0 -1
  365. package/eventManager.cjs.map +0 -1
  366. package/eventManager.js.map +0 -1
  367. package/eventSubjectProcessor.cjs.map +0 -1
  368. package/eventSubjectProcessor.js.map +0 -1
  369. package/facade/contentFetcherFacade.cjs.map +0 -1
  370. package/facade/contentFetcherFacade.js.map +0 -1
  371. package/facade/evaluatorFacade.cjs.map +0 -1
  372. package/facade/evaluatorFacade.js.map +0 -1
  373. package/facade/index.cjs.map +0 -1
  374. package/facade/index.js.map +0 -1
  375. package/facade/sdkFacade.cjs.map +0 -1
  376. package/facade/sdkFacade.js.map +0 -1
  377. package/facade/sessionFacade.cjs.map +0 -1
  378. package/facade/sessionFacade.js.map +0 -1
  379. package/facade/sessionPatch.cjs.map +0 -1
  380. package/facade/sessionPatch.js.map +0 -1
  381. package/facade/trackerFacade.cjs.map +0 -1
  382. package/facade/trackerFacade.js.map +0 -1
  383. package/facade/userFacade.cjs.map +0 -1
  384. package/facade/userFacade.js.map +0 -1
  385. package/facade/userPatch.cjs.map +0 -1
  386. package/facade/userPatch.js.map +0 -1
  387. package/help.cjs.map +0 -1
  388. package/help.js.map +0 -1
  389. package/index.cjs.map +0 -1
  390. package/index.js.map +0 -1
  391. package/logging/consoleLogger.cjs.map +0 -1
  392. package/logging/consoleLogger.js.map +0 -1
  393. package/logging/filteredLogger.cjs.map +0 -1
  394. package/logging/filteredLogger.js.map +0 -1
  395. package/logging/index.cjs.map +0 -1
  396. package/logging/index.js.map +0 -1
  397. package/logging/logger.cjs.map +0 -1
  398. package/logging/logger.js.map +0 -1
  399. package/logging/namespacedLogger.cjs.map +0 -1
  400. package/logging/namespacedLogger.js.map +0 -1
  401. package/logging/nullLogger.cjs.map +0 -1
  402. package/logging/nullLogger.js.map +0 -1
  403. package/namespacedStorage.cjs.map +0 -1
  404. package/namespacedStorage.js.map +0 -1
  405. package/patch.cjs.map +0 -1
  406. package/patch.js.map +0 -1
  407. package/queue/capacityRestrictedQueue.cjs.map +0 -1
  408. package/queue/capacityRestrictedQueue.js.map +0 -1
  409. package/queue/inMemoryQueue.cjs.map +0 -1
  410. package/queue/inMemoryQueue.js.map +0 -1
  411. package/queue/index.cjs.map +0 -1
  412. package/queue/index.js.map +0 -1
  413. package/queue/monitoredQueue.cjs.map +0 -1
  414. package/queue/monitoredQueue.js.map +0 -1
  415. package/queue/persistentQueue.cjs.map +0 -1
  416. package/queue/persistentQueue.js.map +0 -1
  417. package/queue/queue.cjs.map +0 -1
  418. package/queue/queue.js.map +0 -1
  419. package/retry/arbitraryPolicy.cjs.map +0 -1
  420. package/retry/arbitraryPolicy.js.map +0 -1
  421. package/retry/backoffPolicy.cjs.map +0 -1
  422. package/retry/backoffPolicy.js.map +0 -1
  423. package/retry/index.cjs.map +0 -1
  424. package/retry/index.js.map +0 -1
  425. package/retry/maxAttemptsPolicy.cjs.map +0 -1
  426. package/retry/maxAttemptsPolicy.js.map +0 -1
  427. package/retry/neverPolicy.cjs.map +0 -1
  428. package/retry/neverPolicy.js.map +0 -1
  429. package/retry/policy.cjs.map +0 -1
  430. package/retry/policy.js.map +0 -1
  431. package/schema/attributeSchema.cjs.map +0 -1
  432. package/schema/attributeSchema.js.map +0 -1
  433. package/schema/contentFetcherSchemas.cjs.map +0 -1
  434. package/schema/contentFetcherSchemas.js.map +0 -1
  435. package/schema/contentSchemas.cjs.map +0 -1
  436. package/schema/contentSchemas.js.map +0 -1
  437. package/schema/contextSchemas.cjs.map +0 -1
  438. package/schema/contextSchemas.js.map +0 -1
  439. package/schema/ecommerceSchemas.cjs.map +0 -1
  440. package/schema/ecommerceSchemas.js.map +0 -1
  441. package/schema/evaluatorSchemas.cjs.map +0 -1
  442. package/schema/evaluatorSchemas.js.map +0 -1
  443. package/schema/eventSchemas.cjs.map +0 -1
  444. package/schema/eventSchemas.js.map +0 -1
  445. package/schema/index.cjs.map +0 -1
  446. package/schema/index.js.map +0 -1
  447. package/schema/loggerSchema.cjs.map +0 -1
  448. package/schema/loggerSchema.js.map +0 -1
  449. package/schema/operationSchemas.cjs.map +0 -1
  450. package/schema/operationSchemas.js.map +0 -1
  451. package/schema/sdkFacadeSchemas.cjs.map +0 -1
  452. package/schema/sdkFacadeSchemas.js.map +0 -1
  453. package/schema/sdkSchemas.cjs.map +0 -1
  454. package/schema/sdkSchemas.js.map +0 -1
  455. package/schema/tokenSchema.cjs.map +0 -1
  456. package/schema/tokenSchema.js.map +0 -1
  457. package/schema/userSchema.cjs.map +0 -1
  458. package/schema/userSchema.js.map +0 -1
  459. package/sdk.cjs.map +0 -1
  460. package/sdk.js.map +0 -1
  461. package/sdkEvents.cjs.map +0 -1
  462. package/sdkEvents.js.map +0 -1
  463. package/sourceLocation.cjs.map +0 -1
  464. package/sourceLocation.js.map +0 -1
  465. package/tab.cjs.map +0 -1
  466. package/tab.js.map +0 -1
  467. package/token/cachedTokenStore.cjs.map +0 -1
  468. package/token/cachedTokenStore.js.map +0 -1
  469. package/token/inMemoryTokenStore.cjs.map +0 -1
  470. package/token/inMemoryTokenStore.js.map +0 -1
  471. package/token/index.cjs.map +0 -1
  472. package/token/index.js.map +0 -1
  473. package/token/replicatedTokenStore.cjs.map +0 -1
  474. package/token/replicatedTokenStore.js.map +0 -1
  475. package/token/token.cjs.map +0 -1
  476. package/token/token.js.map +0 -1
  477. package/tracker.cjs.map +0 -1
  478. package/tracker.js.map +0 -1
  479. package/trackingEvents.cjs.map +0 -1
  480. package/trackingEvents.js.map +0 -1
  481. package/transformer.cjs.map +0 -1
  482. package/transformer.js.map +0 -1
  483. package/utilityTypes.cjs.map +0 -1
  484. package/utilityTypes.js.map +0 -1
  485. package/uuid.cjs.map +0 -1
  486. package/uuid.js.map +0 -1
  487. package/validation/arrayType.cjs.map +0 -1
  488. package/validation/arrayType.js.map +0 -1
  489. package/validation/booleanType.cjs.map +0 -1
  490. package/validation/booleanType.js.map +0 -1
  491. package/validation/functionType.cjs.map +0 -1
  492. package/validation/functionType.js.map +0 -1
  493. package/validation/index.cjs.map +0 -1
  494. package/validation/index.js.map +0 -1
  495. package/validation/jsonType.cjs.map +0 -1
  496. package/validation/jsonType.js.map +0 -1
  497. package/validation/mixedSchema.cjs.map +0 -1
  498. package/validation/mixedSchema.js.map +0 -1
  499. package/validation/nullType.cjs.map +0 -1
  500. package/validation/nullType.js.map +0 -1
  501. package/validation/numberType.cjs.map +0 -1
  502. package/validation/numberType.js.map +0 -1
  503. package/validation/objectType.cjs.map +0 -1
  504. package/validation/objectType.js.map +0 -1
  505. package/validation/schema.cjs.map +0 -1
  506. package/validation/schema.js.map +0 -1
  507. package/validation/stringType.cjs.map +0 -1
  508. package/validation/stringType.js.map +0 -1
  509. package/validation/unionType.cjs.map +0 -1
  510. package/validation/unionType.js.map +0 -1
  511. package/validation/violation.cjs.map +0 -1
  512. package/validation/violation.js.map +0 -1
package/context.cjs CHANGED
@@ -20,10 +20,10 @@ __export(context_exports, {
20
20
  Context: () => Context
21
21
  });
22
22
  module.exports = __toCommonJS(context_exports);
23
- var import_token = require("./token");
24
- var import_tab = require("./tab");
25
- var import_uuid = require("./uuid");
26
- var import_cache = require("./cache");
23
+ var import_token = require('./token/index.cjs');
24
+ var import_tab = require('./tab.cjs');
25
+ var import_uuid = require('./uuid.cjs');
26
+ var import_cache = require('./cache/index.cjs');
27
27
  function tokenEquals(left, right) {
28
28
  return left === right || left !== null && right !== null && left.toString() === right.toString();
29
29
  }
@@ -111,4 +111,3 @@ class Context {
111
111
  0 && (module.exports = {
112
112
  Context
113
113
  });
114
- //# sourceMappingURL=context.cjs.map
package/context.d.cts ADDED
@@ -0,0 +1,36 @@
1
+ import { Token } from './token/token.cjs';
2
+ import { Cache } from './cache/cache.cjs';
3
+ import { UrlSanitizer, Tab } from './tab.cjs';
4
+ import { EventDispatcher } from './eventManager.cjs';
5
+ import { SdkEventMap } from './sdkEvents.cjs';
6
+ import '@croct/json';
7
+ import './apiKey.cjs';
8
+
9
+ type TokenScope = 'isolated' | 'global' | 'contextual';
10
+ type Configuration = {
11
+ tokenScope: TokenScope;
12
+ urlSanitizer?: UrlSanitizer;
13
+ eventDispatcher: ContextEventDispatcher;
14
+ cache: {
15
+ tabId: Cache;
16
+ tabToken: Cache;
17
+ browserToken: Cache;
18
+ };
19
+ };
20
+ type ContextEventDispatcher = EventDispatcher<Pick<SdkEventMap, 'tokenChanged'>>;
21
+ declare class Context {
22
+ private readonly tab;
23
+ private readonly tokenStore;
24
+ private readonly eventDispatcher;
25
+ private lastToken;
26
+ private constructor();
27
+ static load({ cache, tokenScope, eventDispatcher, urlSanitizer }: Configuration): Context;
28
+ getTab(): Tab;
29
+ isAnonymous(): boolean;
30
+ getUser(): string | null;
31
+ getToken(): Token | null;
32
+ setToken(token: Token | null): void;
33
+ private syncToken;
34
+ }
35
+
36
+ export { type Configuration, Context, type TokenScope };
package/context.js CHANGED
@@ -1,7 +1,7 @@
1
- import { CachedTokenStore, ReplicatedTokenStore, InMemoryTokenStore } from "./token";
2
- import { Tab } from "./tab";
3
- import { uuid4 } from "./uuid";
4
- import { ObservableCache } from "./cache";
1
+ import { CachedTokenStore, ReplicatedTokenStore, InMemoryTokenStore } from "./token/index.js";
2
+ import { Tab } from "./tab.js";
3
+ import { uuid4 } from "./uuid.js";
4
+ import { ObservableCache } from "./cache/index.js";
5
5
  function tokenEquals(left, right) {
6
6
  return left === right || left !== null && right !== null && left.toString() === right.toString();
7
7
  }
@@ -88,4 +88,3 @@ class Context {
88
88
  export {
89
89
  Context
90
90
  };
91
- //# sourceMappingURL=context.js.map
package/error.cjs CHANGED
@@ -49,4 +49,3 @@ function formatCause(error) {
49
49
  formatCause,
50
50
  formatMessage
51
51
  });
52
- //# sourceMappingURL=error.cjs.map
package/error.d.cts ADDED
@@ -0,0 +1,4 @@
1
+ declare function formatMessage(error: unknown): string;
2
+ declare function formatCause(error: unknown): string;
3
+
4
+ export { formatCause, formatMessage };
package/error.js CHANGED
@@ -25,4 +25,3 @@ export {
25
25
  formatCause,
26
26
  formatMessage
27
27
  };
28
- //# sourceMappingURL=error.js.map
package/evaluator.cjs CHANGED
@@ -23,11 +23,11 @@ __export(evaluator_exports, {
23
23
  QueryError: () => QueryError
24
24
  });
25
25
  module.exports = __toCommonJS(evaluator_exports);
26
- var import_constants = require("./constants");
27
- var import_error = require("./error");
28
- var import_sourceLocation = require("./sourceLocation");
29
- var import_logging = require("./logging");
30
- var import_help = require("./help");
26
+ var import_constants = require('./constants.cjs');
27
+ var import_error = require('./error.cjs');
28
+ var import_sourceLocation = require('./sourceLocation.cjs');
29
+ var import_logging = require('./logging/index.cjs');
30
+ var import_help = require('./help.cjs');
31
31
  var EvaluationErrorType = /* @__PURE__ */ ((EvaluationErrorType2) => {
32
32
  EvaluationErrorType2["TIMEOUT"] = "https://croct.help/api/evaluation#timeout";
33
33
  EvaluationErrorType2["UNEXPECTED_ERROR"] = "https://croct.help/api/evaluation#unexpected-error";
@@ -216,4 +216,3 @@ let Evaluator = _Evaluator;
216
216
  Evaluator,
217
217
  QueryError
218
218
  });
219
- //# sourceMappingURL=evaluator.cjs.map
@@ -0,0 +1,86 @@
1
+ import { JsonObject, JsonValue } from '@croct/json';
2
+ import { Token } from './token/token.cjs';
3
+ import { Location } from './sourceLocation.cjs';
4
+ import { Logger } from './logging/logger.cjs';
5
+ import { ApiKey } from './apiKey.cjs';
6
+
7
+ type Campaign = {
8
+ name?: string;
9
+ source?: string;
10
+ medium?: string;
11
+ term?: string;
12
+ content?: string;
13
+ };
14
+ type Page = {
15
+ url: string;
16
+ title?: string;
17
+ referrer?: string;
18
+ };
19
+ type EvaluationContext = {
20
+ timeZone?: string;
21
+ campaign?: Campaign;
22
+ page?: Page;
23
+ attributes?: JsonObject;
24
+ };
25
+ type AllowedFetchOptions = Exclude<keyof RequestInit, 'method' | 'body' | 'headers' | 'signal'>;
26
+ type ExtraFetchOptions<T extends keyof RequestInit = AllowedFetchOptions> = Pick<RequestInit, T> & {
27
+ [key in Exclude<keyof RequestInit, T>]?: never;
28
+ } & Record<string, any>;
29
+ type EvaluationOptions = {
30
+ clientId?: string;
31
+ clientIp?: string;
32
+ clientAgent?: string;
33
+ userToken?: Token | string;
34
+ timeout?: number;
35
+ context?: EvaluationContext;
36
+ extra?: ExtraFetchOptions;
37
+ };
38
+ declare enum EvaluationErrorType {
39
+ TIMEOUT = "https://croct.help/api/evaluation#timeout",
40
+ UNEXPECTED_ERROR = "https://croct.help/api/evaluation#unexpected-error",
41
+ INVALID_QUERY = "https://croct.help/api/evaluation#invalid-query",
42
+ TOO_COMPLEX_QUERY = "https://croct.help/api/evaluation#too-complex-query",
43
+ EVALUATION_FAILED = "https://croct.help/api/evaluation#evaluation-failed",
44
+ UNALLOWED_RESULT = "https://croct.help/api/evaluation#unallowed-result",
45
+ UNSERIALIZABLE_RESULT = "https://croct.help/api/evaluation#unserializable-result"
46
+ }
47
+ type ErrorResponse = {
48
+ type: EvaluationErrorType;
49
+ title: string;
50
+ status: number;
51
+ detail?: string;
52
+ };
53
+ declare class EvaluationError<T extends ErrorResponse = ErrorResponse> extends Error {
54
+ readonly response: T;
55
+ constructor(response: T);
56
+ }
57
+ type QueryErrorDetail = {
58
+ cause: string;
59
+ location: Location;
60
+ };
61
+ type QueryErrorResponse = ErrorResponse & {
62
+ errors: QueryErrorDetail[];
63
+ };
64
+ declare class QueryError extends EvaluationError<QueryErrorResponse> {
65
+ constructor(response: QueryErrorResponse);
66
+ }
67
+ type Configuration = {
68
+ appId?: string;
69
+ apiKey?: string | ApiKey;
70
+ baseEndpointUrl?: string;
71
+ logger?: Logger;
72
+ defaultTimeout?: number;
73
+ };
74
+ declare class Evaluator {
75
+ static readonly MAX_QUERY_LENGTH: number;
76
+ private readonly configuration;
77
+ private readonly endpoint;
78
+ private readonly logger;
79
+ constructor(configuration: Configuration);
80
+ evaluate(query: string, options?: EvaluationOptions): Promise<JsonValue>;
81
+ private fetch;
82
+ private logHelp;
83
+ toJSON(): never;
84
+ }
85
+
86
+ export { type Campaign, type Configuration, type ErrorResponse, type EvaluationContext, EvaluationError, EvaluationErrorType, type EvaluationOptions, Evaluator, type Page, QueryError, type QueryErrorResponse };
package/evaluator.js CHANGED
@@ -1,8 +1,8 @@
1
- import { BASE_ENDPOINT_URL, CLIENT_LIBRARY, MAX_QUERY_LENGTH } from "./constants";
2
- import { formatMessage } from "./error";
3
- import { getLength, getLocation } from "./sourceLocation";
4
- import { NullLogger } from "./logging";
5
- import { Help } from "./help";
1
+ import { BASE_ENDPOINT_URL, CLIENT_LIBRARY, MAX_QUERY_LENGTH } from "./constants.js";
2
+ import { formatMessage } from "./error.js";
3
+ import { getLength, getLocation } from "./sourceLocation.js";
4
+ import { NullLogger } from "./logging/index.js";
5
+ import { Help } from "./help.js";
6
6
  var EvaluationErrorType = /* @__PURE__ */ ((EvaluationErrorType2) => {
7
7
  EvaluationErrorType2["TIMEOUT"] = "https://croct.help/api/evaluation#timeout";
8
8
  EvaluationErrorType2["UNEXPECTED_ERROR"] = "https://croct.help/api/evaluation#unexpected-error";
@@ -190,4 +190,3 @@ export {
190
190
  Evaluator,
191
191
  QueryError
192
192
  };
193
- //# sourceMappingURL=evaluator.js.map
package/eventManager.cjs CHANGED
@@ -50,4 +50,3 @@ class SynchronousEventManager {
50
50
  0 && (module.exports = {
51
51
  SynchronousEventManager
52
52
  });
53
- //# sourceMappingURL=eventManager.cjs.map
@@ -0,0 +1,21 @@
1
+ interface EventListener<T> {
2
+ (event: T): void;
3
+ }
4
+ type EventMap = Record<string, Record<string, any>>;
5
+ interface EventDispatcher<TEvents extends EventMap> {
6
+ dispatch<T extends keyof TEvents>(eventName: T, event: TEvents[T]): void;
7
+ }
8
+ interface EventSubscriber<TEvents extends EventMap> {
9
+ addListener<T extends keyof TEvents>(eventName: T, listener: EventListener<TEvents[T]>): void;
10
+ removeListener<T extends keyof TEvents>(eventName: T, listener: EventListener<TEvents[T]>): void;
11
+ }
12
+ interface EventManager<DEvents extends EventMap, SEvents extends EventMap = DEvents> extends EventDispatcher<DEvents>, EventSubscriber<SEvents> {
13
+ }
14
+ declare class SynchronousEventManager<TEvents extends EventMap> implements EventManager<TEvents> {
15
+ private readonly listeners;
16
+ addListener<T extends keyof TEvents>(type: T, listener: EventListener<TEvents[T]>): void;
17
+ removeListener<T extends keyof TEvents>(eventName: T, listener: EventListener<TEvents[T]>): void;
18
+ dispatch<T extends keyof TEvents>(eventName: T, event: TEvents[T]): void;
19
+ }
20
+
21
+ export { type EventDispatcher, type EventListener, type EventManager, type EventMap, type EventSubscriber, SynchronousEventManager };
package/eventManager.js CHANGED
@@ -27,4 +27,3 @@ class SynchronousEventManager {
27
27
  export {
28
28
  SynchronousEventManager
29
29
  };
30
- //# sourceMappingURL=eventManager.js.map
@@ -81,4 +81,3 @@ class EventSubjectProcessor {
81
81
  0 && (module.exports = {
82
82
  EventSubjectProcessor
83
83
  });
84
- //# sourceMappingURL=eventSubjectProcessor.cjs.map
@@ -0,0 +1,22 @@
1
+ import { TrackingEventProcessor, QueuedEventInfo } from './tracker.cjs';
2
+ import { Logger } from './logging/logger.cjs';
3
+ import './tab.cjs';
4
+ import './eventManager.cjs';
5
+ import './channel/channel.cjs';
6
+ import './retry/policy.cjs';
7
+ import './token/token.cjs';
8
+ import '@croct/json';
9
+ import './apiKey.cjs';
10
+ import './trackingEvents.cjs';
11
+ import './patch.cjs';
12
+ import './utilityTypes.cjs';
13
+
14
+ declare class EventSubjectProcessor implements TrackingEventProcessor {
15
+ private currentToken?;
16
+ private logger;
17
+ constructor(logger: Logger);
18
+ process(event: QueuedEventInfo): QueuedEventInfo[];
19
+ private static isIdentificationEvent;
20
+ }
21
+
22
+ export { EventSubjectProcessor };
@@ -58,4 +58,3 @@ class EventSubjectProcessor {
58
58
  export {
59
59
  EventSubjectProcessor
60
60
  };
61
- //# sourceMappingURL=eventSubjectProcessor.js.map
@@ -20,8 +20,8 @@ __export(contentFetcherFacade_exports, {
20
20
  ContentFetcherFacade: () => ContentFetcherFacade
21
21
  });
22
22
  module.exports = __toCommonJS(contentFetcherFacade_exports);
23
- var import_error = require("../error");
24
- var import_schema = require("../schema");
23
+ var import_error = require('../error.cjs');
24
+ var import_schema = require('../schema/index.cjs');
25
25
  function validate(options) {
26
26
  try {
27
27
  import_schema.fetchOptionsSchema.validate(options);
@@ -58,4 +58,3 @@ class ContentFetcherFacade {
58
58
  0 && (module.exports = {
59
59
  ContentFetcherFacade
60
60
  });
61
- //# sourceMappingURL=contentFetcherFacade.cjs.map
@@ -0,0 +1,36 @@
1
+ import { JsonObject } from '@croct/json';
2
+ import { ContentFetcher, FetchResponse } from '../contentFetcher.cjs';
3
+ import { ContextFactory } from './evaluatorFacade.cjs';
4
+ import { TokenProvider } from '../token/token.cjs';
5
+ import { CidAssigner } from '../cid/assigner.cjs';
6
+ import '../evaluator.cjs';
7
+ import '../sourceLocation.cjs';
8
+ import '../logging/logger.cjs';
9
+ import '../apiKey.cjs';
10
+ import '../tab.cjs';
11
+ import '../eventManager.cjs';
12
+
13
+ type FetchOptions = {
14
+ version?: `${number}` | number;
15
+ preferredLocale?: string;
16
+ timeout?: number;
17
+ attributes?: JsonObject;
18
+ };
19
+ type Configuration = {
20
+ contentFetcher: ContentFetcher;
21
+ contextFactory: ContextFactory;
22
+ previewTokenProvider: TokenProvider;
23
+ userTokenProvider: TokenProvider;
24
+ cidAssigner: CidAssigner;
25
+ };
26
+ declare class ContentFetcherFacade {
27
+ private readonly fetcher;
28
+ private readonly contextFactory;
29
+ private readonly previewTokenProvider;
30
+ private readonly userTokenProvider;
31
+ private readonly cidAssigner;
32
+ constructor(configuration: Configuration);
33
+ fetch<P extends JsonObject>(slotId: string, options?: FetchOptions): Promise<FetchResponse<P>>;
34
+ }
35
+
36
+ export { type Configuration, ContentFetcherFacade, type FetchOptions };
@@ -1,5 +1,5 @@
1
- import { formatCause } from "../error";
2
- import { fetchOptionsSchema as optionsSchema } from "../schema";
1
+ import { formatCause } from "../error.js";
2
+ import { fetchOptionsSchema as optionsSchema } from "../schema/index.js";
3
3
  function validate(options) {
4
4
  try {
5
5
  optionsSchema.validate(options);
@@ -35,4 +35,3 @@ class ContentFetcherFacade {
35
35
  export {
36
36
  ContentFetcherFacade
37
37
  };
38
- //# sourceMappingURL=contentFetcherFacade.js.map
@@ -22,8 +22,8 @@ __export(evaluatorFacade_exports, {
22
22
  TabContextFactory: () => TabContextFactory
23
23
  });
24
24
  module.exports = __toCommonJS(evaluatorFacade_exports);
25
- var import_schema = require("../schema");
26
- var import_error = require("../error");
25
+ var import_schema = require('../schema/index.cjs');
26
+ var import_error = require('../error.cjs');
27
27
  function validate(options) {
28
28
  try {
29
29
  import_schema.evaluationOptionsSchema.validate(options);
@@ -91,4 +91,3 @@ class TabContextFactory {
91
91
  MinimalContextFactory,
92
92
  TabContextFactory
93
93
  });
94
- //# sourceMappingURL=evaluatorFacade.cjs.map
@@ -0,0 +1,41 @@
1
+ import { JsonObject, JsonValue } from '@croct/json';
2
+ import { EvaluationContext, Evaluator } from '../evaluator.cjs';
3
+ import { Tab } from '../tab.cjs';
4
+ import { TokenProvider } from '../token/token.cjs';
5
+ import { CidAssigner } from '../cid/assigner.cjs';
6
+ import '../sourceLocation.cjs';
7
+ import '../logging/logger.cjs';
8
+ import '../apiKey.cjs';
9
+ import '../eventManager.cjs';
10
+
11
+ type EvaluationOptions = {
12
+ timeout?: number;
13
+ attributes?: JsonObject;
14
+ };
15
+ interface ContextFactory {
16
+ createContext(attributes?: JsonObject): EvaluationContext;
17
+ }
18
+ type Configuration = {
19
+ evaluator: Evaluator;
20
+ contextFactory: ContextFactory;
21
+ userTokenProvider: TokenProvider;
22
+ cidAssigner: CidAssigner;
23
+ };
24
+ declare class EvaluatorFacade {
25
+ private readonly evaluator;
26
+ private readonly contextFactory;
27
+ private readonly tokenProvider;
28
+ private readonly cidAssigner;
29
+ constructor(configuration: Configuration);
30
+ evaluate(query: string, options?: EvaluationOptions): Promise<JsonValue>;
31
+ }
32
+ declare class MinimalContextFactory implements ContextFactory {
33
+ createContext(attributes?: JsonObject): EvaluationContext;
34
+ }
35
+ declare class TabContextFactory implements ContextFactory {
36
+ private readonly tab;
37
+ constructor(tab: Tab);
38
+ createContext(attributes?: JsonObject): EvaluationContext;
39
+ }
40
+
41
+ export { type Configuration, type ContextFactory, type EvaluationOptions, EvaluatorFacade, MinimalContextFactory, TabContextFactory };
@@ -1,5 +1,5 @@
1
- import { evaluationOptionsSchema as optionsSchema } from "../schema";
2
- import { formatCause } from "../error";
1
+ import { evaluationOptionsSchema as optionsSchema } from "../schema/index.js";
2
+ import { formatCause } from "../error.js";
3
3
  function validate(options) {
4
4
  try {
5
5
  optionsSchema.validate(options);
@@ -66,4 +66,3 @@ export {
66
66
  MinimalContextFactory,
67
67
  TabContextFactory
68
68
  };
69
- //# sourceMappingURL=evaluatorFacade.js.map
package/facade/index.cjs CHANGED
@@ -17,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
  var facade_exports = {};
19
19
  __export(facade_exports, {
20
- ContextFactory: () => import_evaluatorFacade.ContextFactory,
21
20
  EvaluatorFacade: () => import_evaluatorFacade.EvaluatorFacade,
22
21
  MinimalContextFactory: () => import_evaluatorFacade.MinimalContextFactory,
23
22
  SdkFacade: () => import_sdkFacade.SdkFacade,
@@ -29,16 +28,15 @@ __export(facade_exports, {
29
28
  UserPatch: () => import_userPatch.UserPatch
30
29
  });
31
30
  module.exports = __toCommonJS(facade_exports);
32
- var import_evaluatorFacade = require("./evaluatorFacade");
33
- var import_sdkFacade = require("./sdkFacade");
34
- var import_sessionFacade = require("./sessionFacade");
35
- var import_sessionPatch = require("./sessionPatch");
36
- var import_trackerFacade = require("./trackerFacade");
37
- var import_userFacade = require("./userFacade");
38
- var import_userPatch = require("./userPatch");
31
+ var import_evaluatorFacade = require('./evaluatorFacade.cjs');
32
+ var import_sdkFacade = require('./sdkFacade.cjs');
33
+ var import_sessionFacade = require('./sessionFacade.cjs');
34
+ var import_sessionPatch = require('./sessionPatch.cjs');
35
+ var import_trackerFacade = require('./trackerFacade.cjs');
36
+ var import_userFacade = require('./userFacade.cjs');
37
+ var import_userPatch = require('./userPatch.cjs');
39
38
  // Annotate the CommonJS export names for ESM import in node:
40
39
  0 && (module.exports = {
41
- ContextFactory,
42
40
  EvaluatorFacade,
43
41
  MinimalContextFactory,
44
42
  SdkFacade,
@@ -49,4 +47,3 @@ var import_userPatch = require("./userPatch");
49
47
  UserFacade,
50
48
  UserPatch
51
49
  });
52
- //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,29 @@
1
+ export { ContextFactory, EvaluatorFacade, MinimalContextFactory, TabContextFactory } from './evaluatorFacade.cjs';
2
+ export { SdkFacade } from './sdkFacade.cjs';
3
+ export { SessionFacade } from './sessionFacade.cjs';
4
+ export { SessionPatch } from './sessionPatch.cjs';
5
+ export { TrackerFacade } from './trackerFacade.cjs';
6
+ export { UserFacade } from './userFacade.cjs';
7
+ export { UserPatch } from './userPatch.cjs';
8
+ import '@croct/json';
9
+ import '../evaluator.cjs';
10
+ import '../token/token.cjs';
11
+ import '../apiKey.cjs';
12
+ import '../sourceLocation.cjs';
13
+ import '../logging/logger.cjs';
14
+ import '../tab.cjs';
15
+ import '../eventManager.cjs';
16
+ import '../cid/assigner.cjs';
17
+ import '../context.cjs';
18
+ import '../cache/cache.cjs';
19
+ import '../sdkEvents.cjs';
20
+ import './contentFetcherFacade.cjs';
21
+ import '../contentFetcher.cjs';
22
+ import '../cache/cookieCache.cjs';
23
+ import '../trackingEvents.cjs';
24
+ import '../patch.cjs';
25
+ import '../utilityTypes.cjs';
26
+ import '../tracker.cjs';
27
+ import '../channel/channel.cjs';
28
+ import '../retry/policy.cjs';
29
+ import '../activeRecord.cjs';
package/facade/index.js CHANGED
@@ -1,12 +1,11 @@
1
- import { EvaluatorFacade, ContextFactory, MinimalContextFactory, TabContextFactory } from "./evaluatorFacade";
2
- import { SdkFacade } from "./sdkFacade";
3
- import { SessionFacade } from "./sessionFacade";
4
- import { SessionPatch } from "./sessionPatch";
5
- import { TrackerFacade } from "./trackerFacade";
6
- import { UserFacade } from "./userFacade";
7
- import { UserPatch } from "./userPatch";
1
+ import { EvaluatorFacade, MinimalContextFactory, TabContextFactory } from "./evaluatorFacade.js";
2
+ import { SdkFacade } from "./sdkFacade.js";
3
+ import { SessionFacade } from "./sessionFacade.js";
4
+ import { SessionPatch } from "./sessionPatch.js";
5
+ import { TrackerFacade } from "./trackerFacade.js";
6
+ import { UserFacade } from "./userFacade.js";
7
+ import { UserPatch } from "./userPatch.js";
8
8
  export {
9
- ContextFactory,
10
9
  EvaluatorFacade,
11
10
  MinimalContextFactory,
12
11
  SdkFacade,
@@ -17,4 +16,3 @@ export {
17
16
  UserFacade,
18
17
  UserPatch
19
18
  };
20
- //# sourceMappingURL=index.js.map
@@ -20,16 +20,16 @@ __export(sdkFacade_exports, {
20
20
  SdkFacade: () => SdkFacade
21
21
  });
22
22
  module.exports = __toCommonJS(sdkFacade_exports);
23
- var import_evaluatorFacade = require("./evaluatorFacade");
24
- var import_trackerFacade = require("./trackerFacade");
25
- var import_userFacade = require("./userFacade");
26
- var import_token = require("../token");
27
- var import_error = require("../error");
28
- var import_schema = require("../schema");
29
- var import_sdk = require("../sdk");
30
- var import_sessionFacade = require("./sessionFacade");
31
- var import_contentFetcherFacade = require("./contentFetcherFacade");
32
- var import_eventSubjectProcessor = require("../eventSubjectProcessor");
23
+ var import_evaluatorFacade = require('./evaluatorFacade.cjs');
24
+ var import_trackerFacade = require('./trackerFacade.cjs');
25
+ var import_userFacade = require('./userFacade.cjs');
26
+ var import_token = require('../token/index.cjs');
27
+ var import_error = require('../error.cjs');
28
+ var import_schema = require('../schema/index.cjs');
29
+ var import_sdk = require('../sdk.cjs');
30
+ var import_sessionFacade = require('./sessionFacade.cjs');
31
+ var import_contentFetcherFacade = require('./contentFetcherFacade.cjs');
32
+ var import_eventSubjectProcessor = require('../eventSubjectProcessor.cjs');
33
33
  function validateConfiguration(configuration) {
34
34
  try {
35
35
  import_schema.sdkFacadeConfigurationSchema.validate(configuration);
@@ -226,4 +226,3 @@ class SdkFacade {
226
226
  0 && (module.exports = {
227
227
  SdkFacade
228
228
  });
229
- //# sourceMappingURL=sdkFacade.cjs.map
@@ -0,0 +1,86 @@
1
+ import { EvaluatorFacade } from './evaluatorFacade.cjs';
2
+ import { TrackerFacade } from './trackerFacade.cjs';
3
+ import { TokenScope, Context } from '../context.cjs';
4
+ import { UserFacade } from './userFacade.cjs';
5
+ import { TokenStore, Token } from '../token/token.cjs';
6
+ import { SessionFacade } from './sessionFacade.cjs';
7
+ import { Logger } from '../logging/logger.cjs';
8
+ import { SdkEventMap } from '../sdkEvents.cjs';
9
+ import { EventManager } from '../eventManager.cjs';
10
+ import { CidAssigner } from '../cid/assigner.cjs';
11
+ import { UrlSanitizer } from '../tab.cjs';
12
+ import { ContentFetcherFacade } from './contentFetcherFacade.cjs';
13
+ import { CookieCacheConfiguration } from '../cache/cookieCache.cjs';
14
+ import './sessionPatch.cjs';
15
+ import './userPatch.cjs';
16
+ import '@croct/json';
17
+ import '../evaluator.cjs';
18
+ import '../sourceLocation.cjs';
19
+ import '../apiKey.cjs';
20
+ import '../trackingEvents.cjs';
21
+ import '../patch.cjs';
22
+ import '../utilityTypes.cjs';
23
+ import '../tracker.cjs';
24
+ import '../channel/channel.cjs';
25
+ import '../retry/policy.cjs';
26
+ import '../cache/cache.cjs';
27
+ import '../activeRecord.cjs';
28
+ import '../contentFetcher.cjs';
29
+
30
+ type Configuration = {
31
+ appId: string;
32
+ tokenScope?: TokenScope;
33
+ debug?: boolean;
34
+ test?: boolean;
35
+ track?: boolean;
36
+ token?: string | null;
37
+ userId?: string | null;
38
+ clientId?: string;
39
+ eventMetadata?: {
40
+ [key: string]: string;
41
+ };
42
+ logger?: Logger;
43
+ urlSanitizer?: UrlSanitizer;
44
+ baseEndpointUrl?: string;
45
+ disableCidMirroring?: boolean;
46
+ cidAssignerEndpointUrl?: string;
47
+ cookie?: {
48
+ clientId?: CookieCacheConfiguration;
49
+ userToken?: CookieCacheConfiguration;
50
+ previewToken?: CookieCacheConfiguration;
51
+ };
52
+ defaultFetchTimeout?: number;
53
+ defaultPreferredLocale?: string;
54
+ };
55
+ declare class SdkFacade {
56
+ private readonly sdk;
57
+ private trackerFacade?;
58
+ private userFacade?;
59
+ private sessionFacade?;
60
+ private evaluatorFacade?;
61
+ private contentFetcherFacade?;
62
+ private constructor();
63
+ static init(configuration: Configuration): SdkFacade;
64
+ get context(): Context;
65
+ get cidAssigner(): CidAssigner;
66
+ get previewTokenStore(): TokenStore;
67
+ get userTokenStore(): TokenStore;
68
+ get tracker(): TrackerFacade;
69
+ get user(): UserFacade;
70
+ get session(): SessionFacade;
71
+ get evaluator(): EvaluatorFacade;
72
+ get contentFetcher(): ContentFetcherFacade;
73
+ get eventManager(): EventManager<Record<string, Record<string, unknown>>, SdkEventMap>;
74
+ identify(userId: string): void;
75
+ anonymize(): void;
76
+ getToken(): Token | null;
77
+ setToken(token: Token): void;
78
+ unsetToken(): void;
79
+ private trackInternalEvent;
80
+ getLogger(...namespace: string[]): Logger;
81
+ getTabStorage(namespace: string, ...subnamespace: string[]): Storage;
82
+ getBrowserStorage(namespace: string, ...subnamespace: string[]): Storage;
83
+ close(): Promise<void>;
84
+ }
85
+
86
+ export { type Configuration, SdkFacade };