@openobserve/browser-core 0.2.12-beta.7 → 0.3.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 (685) hide show
  1. package/cjs/boot/displayAlreadyInitializedError.d.ts +2 -0
  2. package/cjs/boot/displayAlreadyInitializedError.js +10 -0
  3. package/cjs/boot/displayAlreadyInitializedError.js.map +1 -0
  4. package/cjs/boot/init.d.ts +14 -0
  5. package/cjs/boot/init.js +39 -0
  6. package/cjs/boot/init.js.map +1 -0
  7. package/cjs/browser/addEventListener.d.ts +87 -0
  8. package/cjs/browser/addEventListener.js +55 -0
  9. package/cjs/browser/addEventListener.js.map +1 -0
  10. package/cjs/browser/browser.types.d.ts +51 -0
  11. package/cjs/browser/browser.types.js +6 -0
  12. package/cjs/browser/browser.types.js.map +1 -0
  13. package/cjs/browser/cookie.d.ts +28 -0
  14. package/cjs/browser/cookie.js +114 -0
  15. package/cjs/browser/cookie.js.map +1 -0
  16. package/cjs/browser/fetchObservable.d.ts +38 -0
  17. package/cjs/browser/fetchObservable.js +103 -0
  18. package/cjs/browser/fetchObservable.js.map +1 -0
  19. package/cjs/browser/pageMayExitObservable.d.ts +14 -0
  20. package/cjs/browser/pageMayExitObservable.js +45 -0
  21. package/cjs/browser/pageMayExitObservable.js.map +1 -0
  22. package/cjs/browser/runOnReadyState.d.ts +5 -0
  23. package/cjs/browser/runOnReadyState.js +20 -0
  24. package/cjs/browser/runOnReadyState.js.map +1 -0
  25. package/cjs/browser/xhrObservable.d.ts +24 -0
  26. package/cjs/browser/xhrObservable.js +86 -0
  27. package/cjs/browser/xhrObservable.js.map +1 -0
  28. package/cjs/domain/allowedTrackingOrigins.d.ts +4 -0
  29. package/cjs/domain/allowedTrackingOrigins.js +25 -0
  30. package/cjs/domain/allowedTrackingOrigins.js.map +1 -0
  31. package/cjs/domain/bufferedData.d.ts +14 -0
  32. package/cjs/domain/bufferedData.js +22 -0
  33. package/cjs/domain/bufferedData.js.map +1 -0
  34. package/cjs/domain/configuration/configuration.d.ts +312 -0
  35. package/cjs/domain/configuration/configuration.js +138 -0
  36. package/cjs/domain/configuration/configuration.js.map +1 -0
  37. package/cjs/domain/configuration/endpointBuilder.d.ts +12 -0
  38. package/cjs/domain/configuration/endpointBuilder.js +81 -0
  39. package/cjs/domain/configuration/endpointBuilder.js.map +1 -0
  40. package/cjs/domain/configuration/index.d.ts +5 -0
  41. package/cjs/domain/configuration/index.js +16 -0
  42. package/cjs/domain/configuration/index.js.map +1 -0
  43. package/cjs/domain/configuration/transportConfiguration.d.ts +20 -0
  44. package/cjs/domain/configuration/transportConfiguration.js +54 -0
  45. package/cjs/domain/configuration/transportConfiguration.js.map +1 -0
  46. package/cjs/domain/connectivity/connectivity.d.ts +14 -0
  47. package/cjs/domain/connectivity/connectivity.js +14 -0
  48. package/cjs/domain/connectivity/connectivity.js.map +1 -0
  49. package/cjs/domain/connectivity/index.d.ts +1 -0
  50. package/cjs/domain/connectivity/index.js +18 -0
  51. package/cjs/domain/connectivity/index.js.map +1 -0
  52. package/cjs/domain/console/consoleObservable.d.ts +21 -0
  53. package/cjs/domain/console/consoleObservable.js +84 -0
  54. package/cjs/domain/console/consoleObservable.js.map +1 -0
  55. package/cjs/domain/context/contextConstants.d.ts +21 -0
  56. package/cjs/domain/context/contextConstants.js +18 -0
  57. package/cjs/domain/context/contextConstants.js.map +1 -0
  58. package/cjs/domain/context/contextManager.d.ts +19 -0
  59. package/cjs/domain/context/contextManager.js +60 -0
  60. package/cjs/domain/context/contextManager.js.map +1 -0
  61. package/cjs/domain/context/contextUtils.d.ts +5 -0
  62. package/cjs/domain/context/contextUtils.js +16 -0
  63. package/cjs/domain/context/contextUtils.js.map +1 -0
  64. package/cjs/domain/context/defineContextMethod.d.ts +6 -0
  65. package/cjs/domain/context/defineContextMethod.js +21 -0
  66. package/cjs/domain/context/defineContextMethod.js.map +1 -0
  67. package/cjs/domain/context/storeContextManager.d.ts +6 -0
  68. package/cjs/domain/context/storeContextManager.js +40 -0
  69. package/cjs/domain/context/storeContextManager.js.map +1 -0
  70. package/cjs/domain/contexts/accountContext.d.ts +26 -0
  71. package/cjs/domain/contexts/accountContext.js +33 -0
  72. package/cjs/domain/contexts/accountContext.js.map +1 -0
  73. package/cjs/domain/contexts/globalContext.d.ts +18 -0
  74. package/cjs/domain/contexts/globalContext.js +21 -0
  75. package/cjs/domain/contexts/globalContext.js.map +1 -0
  76. package/cjs/domain/contexts/rumInternalContext.type.d.ts +14 -0
  77. package/cjs/domain/contexts/rumInternalContext.type.js +3 -0
  78. package/cjs/domain/contexts/rumInternalContext.type.js.map +1 -0
  79. package/cjs/domain/contexts/userContext.d.ts +29 -0
  80. package/cjs/domain/contexts/userContext.js +45 -0
  81. package/cjs/domain/contexts/userContext.js.map +1 -0
  82. package/cjs/domain/deflate/deflate.types.d.ts +40 -0
  83. package/cjs/domain/deflate/deflate.types.js +3 -0
  84. package/cjs/domain/deflate/deflate.types.js.map +1 -0
  85. package/cjs/domain/deflate/index.d.ts +1 -0
  86. package/cjs/domain/deflate/index.js +18 -0
  87. package/cjs/domain/deflate/index.js.map +1 -0
  88. package/cjs/domain/error/error.d.ts +23 -0
  89. package/cjs/domain/error/error.js +74 -0
  90. package/cjs/domain/error/error.js.map +1 -0
  91. package/cjs/domain/error/error.types.d.ts +47 -0
  92. package/cjs/domain/error/error.types.js +13 -0
  93. package/cjs/domain/error/error.types.js.map +1 -0
  94. package/cjs/domain/error/trackRuntimeError.d.ts +11 -0
  95. package/cjs/domain/error/trackRuntimeError.js +48 -0
  96. package/cjs/domain/error/trackRuntimeError.js.map +1 -0
  97. package/cjs/domain/eventRateLimiter/createEventRateLimiter.d.ts +5 -0
  98. package/cjs/domain/eventRateLimiter/createEventRateLimiter.js +41 -0
  99. package/cjs/domain/eventRateLimiter/createEventRateLimiter.js.map +1 -0
  100. package/cjs/domain/extension/extensionUtils.d.ts +10 -0
  101. package/cjs/domain/extension/extensionUtils.js +30 -0
  102. package/cjs/domain/extension/extensionUtils.js.map +1 -0
  103. package/cjs/domain/intakeSites.d.ts +8 -0
  104. package/cjs/domain/intakeSites.js +11 -0
  105. package/cjs/domain/intakeSites.js.map +1 -0
  106. package/cjs/domain/report/browser.types.d.ts +34 -0
  107. package/cjs/domain/report/browser.types.js +3 -0
  108. package/cjs/domain/report/browser.types.js.map +1 -0
  109. package/cjs/domain/report/reportObservable.d.ts +14 -0
  110. package/cjs/domain/report/reportObservable.js +99 -0
  111. package/cjs/domain/report/reportObservable.js.map +1 -0
  112. package/cjs/domain/resourceUtils.d.ts +18 -0
  113. package/cjs/domain/resourceUtils.js +20 -0
  114. package/cjs/domain/resourceUtils.js.map +1 -0
  115. package/cjs/domain/session/oldCookiesMigration.d.ts +11 -0
  116. package/cjs/domain/session/oldCookiesMigration.js +40 -0
  117. package/cjs/domain/session/oldCookiesMigration.js.map +1 -0
  118. package/cjs/domain/session/sessionConstants.d.ts +15 -0
  119. package/cjs/domain/session/sessionConstants.js +16 -0
  120. package/cjs/domain/session/sessionConstants.js.map +1 -0
  121. package/cjs/domain/session/sessionManager.d.ts +28 -0
  122. package/cjs/domain/session/sessionManager.js +201 -0
  123. package/cjs/domain/session/sessionManager.js.map +1 -0
  124. package/cjs/domain/session/sessionState.d.ts +16 -0
  125. package/cjs/domain/session/sessionState.js +70 -0
  126. package/cjs/domain/session/sessionState.js.map +1 -0
  127. package/cjs/domain/session/sessionStateValidation.d.ts +3 -0
  128. package/cjs/domain/session/sessionStateValidation.js +11 -0
  129. package/cjs/domain/session/sessionStateValidation.js.map +1 -0
  130. package/cjs/domain/session/sessionStore.d.ts +38 -0
  131. package/cjs/domain/session/sessionStore.js +185 -0
  132. package/cjs/domain/session/sessionStore.js.map +1 -0
  133. package/cjs/domain/session/sessionStoreOperations.d.ts +12 -0
  134. package/cjs/domain/session/sessionStoreOperations.js +119 -0
  135. package/cjs/domain/session/sessionStoreOperations.js.map +1 -0
  136. package/cjs/domain/session/storeStrategies/sessionInCookie.d.ts +12 -0
  137. package/cjs/domain/session/storeStrategies/sessionInCookie.js +104 -0
  138. package/cjs/domain/session/storeStrategies/sessionInCookie.js.map +1 -0
  139. package/cjs/domain/session/storeStrategies/sessionInLocalStorage.d.ts +6 -0
  140. package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js +42 -0
  141. package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js.map +1 -0
  142. package/cjs/domain/session/storeStrategies/sessionStoreStrategy.d.ts +16 -0
  143. package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js +5 -0
  144. package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js.map +1 -0
  145. package/cjs/domain/synthetics/syntheticsWorkerValues.d.ts +12 -0
  146. package/cjs/domain/synthetics/syntheticsWorkerValues.js +31 -0
  147. package/cjs/domain/synthetics/syntheticsWorkerValues.js.map +1 -0
  148. package/cjs/domain/tags.d.ts +6 -0
  149. package/cjs/domain/tags.js +67 -0
  150. package/cjs/domain/tags.js.map +1 -0
  151. package/cjs/domain/telemetry/index.d.ts +4 -0
  152. package/cjs/domain/telemetry/index.js +28 -0
  153. package/cjs/domain/telemetry/index.js.map +1 -0
  154. package/cjs/domain/telemetry/rawTelemetryEvent.types.d.ts +18 -0
  155. package/cjs/domain/telemetry/rawTelemetryEvent.types.js +9 -0
  156. package/cjs/domain/telemetry/rawTelemetryEvent.types.js.map +1 -0
  157. package/cjs/domain/telemetry/telemetry.d.ts +56 -0
  158. package/cjs/domain/telemetry/telemetry.js +241 -0
  159. package/cjs/domain/telemetry/telemetry.js.map +1 -0
  160. package/cjs/domain/telemetry/telemetryEvent.types.d.ts +866 -0
  161. package/cjs/domain/telemetry/telemetryEvent.types.js +7 -0
  162. package/cjs/domain/telemetry/telemetryEvent.types.js.map +1 -0
  163. package/cjs/domain/trackingConsent.d.ts +13 -0
  164. package/cjs/domain/trackingConsent.js +28 -0
  165. package/cjs/domain/trackingConsent.js.map +1 -0
  166. package/cjs/index.d.ts +100 -0
  167. package/cjs/index.js +194 -0
  168. package/cjs/index.js.map +1 -0
  169. package/cjs/tools/abstractHooks.d.ts +24 -0
  170. package/cjs/tools/abstractHooks.js +41 -0
  171. package/cjs/tools/abstractHooks.js.map +1 -0
  172. package/cjs/tools/abstractLifeCycle.d.ts +23 -0
  173. package/cjs/tools/abstractLifeCycle.js +28 -0
  174. package/cjs/tools/abstractLifeCycle.js.map +1 -0
  175. package/cjs/tools/boundedBuffer.d.ts +16 -0
  176. package/cjs/tools/boundedBuffer.js +32 -0
  177. package/cjs/tools/boundedBuffer.js.map +1 -0
  178. package/cjs/tools/catchUserErrors.d.ts +1 -0
  179. package/cjs/tools/catchUserErrors.js +15 -0
  180. package/cjs/tools/catchUserErrors.js.map +1 -0
  181. package/cjs/tools/display.d.ts +38 -0
  182. package/cjs/tools/display.js +44 -0
  183. package/cjs/tools/display.js.map +1 -0
  184. package/cjs/tools/encoder.d.ts +54 -0
  185. package/cjs/tools/encoder.js +40 -0
  186. package/cjs/tools/encoder.js.map +1 -0
  187. package/cjs/tools/experimentalFeatures.d.ts +21 -0
  188. package/cjs/tools/experimentalFeatures.js +50 -0
  189. package/cjs/tools/experimentalFeatures.js.map +1 -0
  190. package/cjs/tools/getZoneJsOriginalValue.d.ts +19 -0
  191. package/cjs/tools/getZoneJsOriginalValue.js +29 -0
  192. package/cjs/tools/getZoneJsOriginalValue.js.map +1 -0
  193. package/cjs/tools/globalObject.d.ts +19 -0
  194. package/cjs/tools/globalObject.js +44 -0
  195. package/cjs/tools/globalObject.js.map +1 -0
  196. package/cjs/tools/instrumentMethod.d.ts +75 -0
  197. package/cjs/tools/instrumentMethod.js +118 -0
  198. package/cjs/tools/instrumentMethod.js.map +1 -0
  199. package/cjs/tools/matchOption.d.ts +8 -0
  200. package/cjs/tools/matchOption.js +35 -0
  201. package/cjs/tools/matchOption.js.map +1 -0
  202. package/cjs/tools/mergeInto.d.ts +25 -0
  203. package/cjs/tools/mergeInto.js +98 -0
  204. package/cjs/tools/mergeInto.js.map +1 -0
  205. package/cjs/tools/monitor.d.ts +9 -0
  206. package/cjs/tools/monitor.js +62 -0
  207. package/cjs/tools/monitor.js.map +1 -0
  208. package/cjs/tools/observable.d.ts +30 -0
  209. package/cjs/tools/observable.js +89 -0
  210. package/cjs/tools/observable.js.map +1 -0
  211. package/cjs/tools/queueMicrotask.d.ts +1 -0
  212. package/cjs/tools/queueMicrotask.js +17 -0
  213. package/cjs/tools/queueMicrotask.js.map +1 -0
  214. package/cjs/tools/readBytesFromStream.d.ts +10 -0
  215. package/cjs/tools/readBytesFromStream.js +28 -0
  216. package/cjs/tools/readBytesFromStream.js.map +1 -0
  217. package/cjs/tools/requestIdleCallback.d.ts +12 -0
  218. package/cjs/tools/requestIdleCallback.js +35 -0
  219. package/cjs/tools/requestIdleCallback.js.map +1 -0
  220. package/cjs/tools/sendToExtension.d.ts +3 -0
  221. package/cjs/tools/sendToExtension.js +11 -0
  222. package/cjs/tools/sendToExtension.js.map +1 -0
  223. package/cjs/tools/serialisation/context.d.ts +9 -0
  224. package/cjs/tools/serialisation/context.js +3 -0
  225. package/cjs/tools/serialisation/context.js.map +1 -0
  226. package/cjs/tools/serialisation/jsonStringify.d.ts +13 -0
  227. package/cjs/tools/serialisation/jsonStringify.js +48 -0
  228. package/cjs/tools/serialisation/jsonStringify.js.map +1 -0
  229. package/cjs/tools/serialisation/sanitize.d.ts +18 -0
  230. package/cjs/tools/serialisation/sanitize.js +188 -0
  231. package/cjs/tools/serialisation/sanitize.js.map +1 -0
  232. package/cjs/tools/stackTrace/computeStackTrace.d.ts +25 -0
  233. package/cjs/tools/stackTrace/computeStackTrace.js +187 -0
  234. package/cjs/tools/stackTrace/computeStackTrace.js.map +1 -0
  235. package/cjs/tools/stackTrace/handlingStack.d.ts +10 -0
  236. package/cjs/tools/stackTrace/handlingStack.js +46 -0
  237. package/cjs/tools/stackTrace/handlingStack.js.map +1 -0
  238. package/cjs/tools/taskQueue.d.ts +15 -0
  239. package/cjs/tools/taskQueue.js +54 -0
  240. package/cjs/tools/taskQueue.js.map +1 -0
  241. package/cjs/tools/timer.d.ts +5 -0
  242. package/cjs/tools/timer.js +22 -0
  243. package/cjs/tools/timer.js.map +1 -0
  244. package/cjs/tools/utils/arrayUtils.d.ts +3 -0
  245. package/cjs/tools/utils/arrayUtils.js +20 -0
  246. package/cjs/tools/utils/arrayUtils.js.map +1 -0
  247. package/cjs/tools/utils/browserDetection.d.ts +8 -0
  248. package/cjs/tools/utils/browserDetection.js +33 -0
  249. package/cjs/tools/utils/browserDetection.js.map +1 -0
  250. package/cjs/tools/utils/byteUtils.d.ts +8 -0
  251. package/cjs/tools/utils/byteUtils.js +34 -0
  252. package/cjs/tools/utils/byteUtils.js.map +1 -0
  253. package/cjs/tools/utils/functionUtils.d.ts +8 -0
  254. package/cjs/tools/utils/functionUtils.js +43 -0
  255. package/cjs/tools/utils/functionUtils.js.map +1 -0
  256. package/cjs/tools/utils/numberUtils.d.ts +9 -0
  257. package/cjs/tools/utils/numberUtils.js +24 -0
  258. package/cjs/tools/utils/numberUtils.js.map +1 -0
  259. package/cjs/tools/utils/objectUtils.d.ts +10 -0
  260. package/cjs/tools/utils/objectUtils.js +23 -0
  261. package/cjs/tools/utils/objectUtils.js.map +1 -0
  262. package/cjs/tools/utils/polyfills.d.ts +7 -0
  263. package/cjs/tools/utils/polyfills.js +23 -0
  264. package/cjs/tools/utils/polyfills.js.map +1 -0
  265. package/cjs/tools/utils/responseUtils.d.ts +2 -0
  266. package/cjs/tools/utils/responseUtils.js +17 -0
  267. package/cjs/tools/utils/responseUtils.js.map +1 -0
  268. package/cjs/tools/utils/stringUtils.d.ts +23 -0
  269. package/cjs/tools/utils/stringUtils.js +91 -0
  270. package/cjs/tools/utils/stringUtils.js.map +1 -0
  271. package/cjs/tools/utils/timeUtils.d.ts +53 -0
  272. package/cjs/tools/utils/timeUtils.js +101 -0
  273. package/cjs/tools/utils/timeUtils.js.map +1 -0
  274. package/cjs/tools/utils/timezone.d.ts +1 -0
  275. package/cjs/tools/utils/timezone.js +13 -0
  276. package/cjs/tools/utils/timezone.js.map +1 -0
  277. package/cjs/tools/utils/typeUtils.d.ts +4 -0
  278. package/cjs/tools/utils/typeUtils.js +16 -0
  279. package/cjs/tools/utils/typeUtils.js.map +1 -0
  280. package/cjs/tools/utils/urlPolyfill.d.ts +5 -0
  281. package/cjs/tools/utils/urlPolyfill.js +59 -0
  282. package/cjs/tools/utils/urlPolyfill.js.map +1 -0
  283. package/cjs/tools/valueHistory.d.ts +27 -0
  284. package/cjs/tools/valueHistory.js +104 -0
  285. package/cjs/tools/valueHistory.js.map +1 -0
  286. package/cjs/transport/batch.d.ts +16 -0
  287. package/cjs/transport/batch.js +110 -0
  288. package/cjs/transport/batch.js.map +1 -0
  289. package/cjs/transport/eventBridge.d.ts +21 -0
  290. package/cjs/transport/eventBridge.js +46 -0
  291. package/cjs/transport/eventBridge.js.map +1 -0
  292. package/cjs/transport/flushController.d.ts +65 -0
  293. package/cjs/transport/flushController.js +123 -0
  294. package/cjs/transport/flushController.js.map +1 -0
  295. package/cjs/transport/httpRequest.d.ts +56 -0
  296. package/cjs/transport/httpRequest.js +95 -0
  297. package/cjs/transport/httpRequest.js.map +1 -0
  298. package/cjs/transport/index.d.ts +7 -0
  299. package/cjs/transport/index.js +15 -0
  300. package/cjs/transport/index.js.map +1 -0
  301. package/cjs/transport/sendWithRetryStrategy.d.ts +41 -0
  302. package/cjs/transport/sendWithRetryStrategy.js +163 -0
  303. package/cjs/transport/sendWithRetryStrategy.js.map +1 -0
  304. package/esm/boot/displayAlreadyInitializedError.d.ts +2 -0
  305. package/esm/boot/displayAlreadyInitializedError.js +7 -0
  306. package/esm/boot/displayAlreadyInitializedError.js.map +1 -0
  307. package/esm/boot/init.d.ts +14 -0
  308. package/esm/boot/init.js +35 -0
  309. package/esm/boot/init.js.map +1 -0
  310. package/esm/browser/addEventListener.d.ts +87 -0
  311. package/esm/browser/addEventListener.js +51 -0
  312. package/esm/browser/addEventListener.js.map +1 -0
  313. package/esm/browser/browser.types.d.ts +51 -0
  314. package/esm/browser/browser.types.js +5 -0
  315. package/esm/browser/browser.types.js.map +1 -0
  316. package/esm/browser/cookie.d.ts +28 -0
  317. package/esm/browser/cookie.js +103 -0
  318. package/esm/browser/cookie.js.map +1 -0
  319. package/esm/browser/fetchObservable.d.ts +38 -0
  320. package/esm/browser/fetchObservable.js +99 -0
  321. package/esm/browser/fetchObservable.js.map +1 -0
  322. package/esm/browser/pageMayExitObservable.d.ts +14 -0
  323. package/esm/browser/pageMayExitObservable.js +40 -0
  324. package/esm/browser/pageMayExitObservable.js.map +1 -0
  325. package/esm/browser/runOnReadyState.d.ts +5 -0
  326. package/esm/browser/runOnReadyState.js +16 -0
  327. package/esm/browser/runOnReadyState.js.map +1 -0
  328. package/esm/browser/xhrObservable.d.ts +24 -0
  329. package/esm/browser/xhrObservable.js +83 -0
  330. package/esm/browser/xhrObservable.js.map +1 -0
  331. package/esm/domain/allowedTrackingOrigins.d.ts +4 -0
  332. package/esm/domain/allowedTrackingOrigins.js +21 -0
  333. package/esm/domain/allowedTrackingOrigins.js.map +1 -0
  334. package/esm/domain/bufferedData.d.ts +14 -0
  335. package/esm/domain/bufferedData.js +19 -0
  336. package/esm/domain/bufferedData.js.map +1 -0
  337. package/esm/domain/configuration/configuration.d.ts +312 -0
  338. package/esm/domain/configuration/configuration.js +132 -0
  339. package/esm/domain/configuration/configuration.js.map +1 -0
  340. package/esm/domain/configuration/endpointBuilder.d.ts +12 -0
  341. package/esm/domain/configuration/endpointBuilder.js +77 -0
  342. package/esm/domain/configuration/endpointBuilder.js.map +1 -0
  343. package/esm/domain/configuration/index.d.ts +5 -0
  344. package/esm/domain/configuration/index.js +4 -0
  345. package/esm/domain/configuration/index.js.map +1 -0
  346. package/esm/domain/configuration/transportConfiguration.d.ts +20 -0
  347. package/esm/domain/configuration/transportConfiguration.js +50 -0
  348. package/esm/domain/configuration/transportConfiguration.js.map +1 -0
  349. package/esm/domain/connectivity/connectivity.d.ts +14 -0
  350. package/esm/domain/connectivity/connectivity.js +11 -0
  351. package/esm/domain/connectivity/connectivity.js.map +1 -0
  352. package/esm/domain/connectivity/index.d.ts +1 -0
  353. package/esm/domain/connectivity/index.js +2 -0
  354. package/esm/domain/connectivity/index.js.map +1 -0
  355. package/esm/domain/console/consoleObservable.d.ts +21 -0
  356. package/esm/domain/console/consoleObservable.js +80 -0
  357. package/esm/domain/console/consoleObservable.js.map +1 -0
  358. package/esm/domain/context/contextConstants.d.ts +21 -0
  359. package/esm/domain/context/contextConstants.js +15 -0
  360. package/esm/domain/context/contextConstants.js.map +1 -0
  361. package/esm/domain/context/contextManager.d.ts +19 -0
  362. package/esm/domain/context/contextManager.js +57 -0
  363. package/esm/domain/context/contextManager.js.map +1 -0
  364. package/esm/domain/context/contextUtils.d.ts +5 -0
  365. package/esm/domain/context/contextUtils.js +13 -0
  366. package/esm/domain/context/contextUtils.js.map +1 -0
  367. package/esm/domain/context/defineContextMethod.d.ts +6 -0
  368. package/esm/domain/context/defineContextMethod.js +17 -0
  369. package/esm/domain/context/defineContextMethod.js.map +1 -0
  370. package/esm/domain/context/storeContextManager.d.ts +6 -0
  371. package/esm/domain/context/storeContextManager.js +35 -0
  372. package/esm/domain/context/storeContextManager.js.map +1 -0
  373. package/esm/domain/contexts/accountContext.d.ts +26 -0
  374. package/esm/domain/contexts/accountContext.js +29 -0
  375. package/esm/domain/contexts/accountContext.js.map +1 -0
  376. package/esm/domain/contexts/globalContext.d.ts +18 -0
  377. package/esm/domain/contexts/globalContext.js +17 -0
  378. package/esm/domain/contexts/globalContext.js.map +1 -0
  379. package/esm/domain/contexts/rumInternalContext.type.d.ts +14 -0
  380. package/esm/domain/contexts/rumInternalContext.type.js +2 -0
  381. package/esm/domain/contexts/rumInternalContext.type.js.map +1 -0
  382. package/esm/domain/contexts/userContext.d.ts +29 -0
  383. package/esm/domain/contexts/userContext.js +41 -0
  384. package/esm/domain/contexts/userContext.js.map +1 -0
  385. package/esm/domain/deflate/deflate.types.d.ts +40 -0
  386. package/esm/domain/deflate/deflate.types.js +2 -0
  387. package/esm/domain/deflate/deflate.types.js.map +1 -0
  388. package/esm/domain/deflate/index.d.ts +1 -0
  389. package/esm/domain/deflate/index.js +2 -0
  390. package/esm/domain/deflate/index.js.map +1 -0
  391. package/esm/domain/error/error.d.ts +23 -0
  392. package/esm/domain/error/error.js +65 -0
  393. package/esm/domain/error/error.js.map +1 -0
  394. package/esm/domain/error/error.types.d.ts +47 -0
  395. package/esm/domain/error/error.types.js +10 -0
  396. package/esm/domain/error/error.types.js.map +1 -0
  397. package/esm/domain/error/trackRuntimeError.d.ts +11 -0
  398. package/esm/domain/error/trackRuntimeError.js +43 -0
  399. package/esm/domain/error/trackRuntimeError.js.map +1 -0
  400. package/esm/domain/eventRateLimiter/createEventRateLimiter.d.ts +5 -0
  401. package/esm/domain/eventRateLimiter/createEventRateLimiter.js +38 -0
  402. package/esm/domain/eventRateLimiter/createEventRateLimiter.js.map +1 -0
  403. package/esm/domain/extension/extensionUtils.d.ts +10 -0
  404. package/esm/domain/extension/extensionUtils.js +25 -0
  405. package/esm/domain/extension/extensionUtils.js.map +1 -0
  406. package/esm/domain/intakeSites.d.ts +8 -0
  407. package/esm/domain/intakeSites.js +8 -0
  408. package/esm/domain/intakeSites.js.map +1 -0
  409. package/esm/domain/report/browser.types.d.ts +34 -0
  410. package/esm/domain/report/browser.types.js +2 -0
  411. package/esm/domain/report/browser.types.js.map +1 -0
  412. package/esm/domain/report/reportObservable.d.ts +14 -0
  413. package/esm/domain/report/reportObservable.js +95 -0
  414. package/esm/domain/report/reportObservable.js.map +1 -0
  415. package/esm/domain/resourceUtils.d.ts +18 -0
  416. package/esm/domain/resourceUtils.js +17 -0
  417. package/esm/domain/resourceUtils.js.map +1 -0
  418. package/esm/domain/session/oldCookiesMigration.d.ts +11 -0
  419. package/esm/domain/session/oldCookiesMigration.js +36 -0
  420. package/esm/domain/session/oldCookiesMigration.js.map +1 -0
  421. package/esm/domain/session/sessionConstants.d.ts +15 -0
  422. package/esm/domain/session/sessionConstants.js +13 -0
  423. package/esm/domain/session/sessionConstants.js.map +1 -0
  424. package/esm/domain/session/sessionManager.d.ts +28 -0
  425. package/esm/domain/session/sessionManager.js +196 -0
  426. package/esm/domain/session/sessionManager.js.map +1 -0
  427. package/esm/domain/session/sessionState.d.ts +16 -0
  428. package/esm/domain/session/sessionState.js +60 -0
  429. package/esm/domain/session/sessionState.js.map +1 -0
  430. package/esm/domain/session/sessionStateValidation.d.ts +3 -0
  431. package/esm/domain/session/sessionStateValidation.js +7 -0
  432. package/esm/domain/session/sessionStateValidation.js.map +1 -0
  433. package/esm/domain/session/sessionStore.d.ts +38 -0
  434. package/esm/domain/session/sessionStore.js +179 -0
  435. package/esm/domain/session/sessionStore.js.map +1 -0
  436. package/esm/domain/session/sessionStoreOperations.d.ts +12 -0
  437. package/esm/domain/session/sessionStoreOperations.js +114 -0
  438. package/esm/domain/session/sessionStoreOperations.js.map +1 -0
  439. package/esm/domain/session/storeStrategies/sessionInCookie.d.ts +12 -0
  440. package/esm/domain/session/storeStrategies/sessionInCookie.js +98 -0
  441. package/esm/domain/session/storeStrategies/sessionInCookie.js.map +1 -0
  442. package/esm/domain/session/storeStrategies/sessionInLocalStorage.d.ts +6 -0
  443. package/esm/domain/session/storeStrategies/sessionInLocalStorage.js +37 -0
  444. package/esm/domain/session/storeStrategies/sessionInLocalStorage.js.map +1 -0
  445. package/esm/domain/session/storeStrategies/sessionStoreStrategy.d.ts +16 -0
  446. package/esm/domain/session/storeStrategies/sessionStoreStrategy.js +2 -0
  447. package/esm/domain/session/storeStrategies/sessionStoreStrategy.js.map +1 -0
  448. package/esm/domain/synthetics/syntheticsWorkerValues.d.ts +12 -0
  449. package/esm/domain/synthetics/syntheticsWorkerValues.js +24 -0
  450. package/esm/domain/synthetics/syntheticsWorkerValues.js.map +1 -0
  451. package/esm/domain/tags.d.ts +6 -0
  452. package/esm/domain/tags.js +60 -0
  453. package/esm/domain/tags.js.map +1 -0
  454. package/esm/domain/telemetry/index.d.ts +4 -0
  455. package/esm/domain/telemetry/index.js +3 -0
  456. package/esm/domain/telemetry/index.js.map +1 -0
  457. package/esm/domain/telemetry/rawTelemetryEvent.types.d.ts +18 -0
  458. package/esm/domain/telemetry/rawTelemetryEvent.types.js +6 -0
  459. package/esm/domain/telemetry/rawTelemetryEvent.types.js.map +1 -0
  460. package/esm/domain/telemetry/telemetry.d.ts +56 -0
  461. package/esm/domain/telemetry/telemetry.js +228 -0
  462. package/esm/domain/telemetry/telemetry.js.map +1 -0
  463. package/esm/domain/telemetry/telemetryEvent.types.d.ts +866 -0
  464. package/esm/domain/telemetry/telemetryEvent.types.js +6 -0
  465. package/esm/domain/telemetry/telemetryEvent.types.js.map +1 -0
  466. package/esm/domain/trackingConsent.d.ts +13 -0
  467. package/esm/domain/trackingConsent.js +24 -0
  468. package/esm/domain/trackingConsent.js.map +1 -0
  469. package/esm/index.d.ts +100 -0
  470. package/esm/index.js +76 -0
  471. package/esm/index.js.map +1 -0
  472. package/esm/tools/abstractHooks.d.ts +24 -0
  473. package/esm/tools/abstractHooks.js +37 -0
  474. package/esm/tools/abstractHooks.js.map +1 -0
  475. package/esm/tools/abstractLifeCycle.d.ts +23 -0
  476. package/esm/tools/abstractLifeCycle.js +24 -0
  477. package/esm/tools/abstractLifeCycle.js.map +1 -0
  478. package/esm/tools/boundedBuffer.d.ts +16 -0
  479. package/esm/tools/boundedBuffer.js +29 -0
  480. package/esm/tools/boundedBuffer.js.map +1 -0
  481. package/esm/tools/catchUserErrors.d.ts +1 -0
  482. package/esm/tools/catchUserErrors.js +12 -0
  483. package/esm/tools/catchUserErrors.js.map +1 -0
  484. package/esm/tools/display.d.ts +38 -0
  485. package/esm/tools/display.js +41 -0
  486. package/esm/tools/display.js.map +1 -0
  487. package/esm/tools/encoder.d.ts +54 -0
  488. package/esm/tools/encoder.js +37 -0
  489. package/esm/tools/encoder.js.map +1 -0
  490. package/esm/tools/experimentalFeatures.d.ts +21 -0
  491. package/esm/tools/experimentalFeatures.js +42 -0
  492. package/esm/tools/experimentalFeatures.js.map +1 -0
  493. package/esm/tools/getZoneJsOriginalValue.d.ts +19 -0
  494. package/esm/tools/getZoneJsOriginalValue.js +26 -0
  495. package/esm/tools/getZoneJsOriginalValue.js.map +1 -0
  496. package/esm/tools/globalObject.d.ts +19 -0
  497. package/esm/tools/globalObject.js +40 -0
  498. package/esm/tools/globalObject.js.map +1 -0
  499. package/esm/tools/instrumentMethod.d.ts +75 -0
  500. package/esm/tools/instrumentMethod.js +114 -0
  501. package/esm/tools/instrumentMethod.js.map +1 -0
  502. package/esm/tools/matchOption.d.ts +8 -0
  503. package/esm/tools/matchOption.js +31 -0
  504. package/esm/tools/matchOption.js.map +1 -0
  505. package/esm/tools/mergeInto.d.ts +25 -0
  506. package/esm/tools/mergeInto.js +93 -0
  507. package/esm/tools/mergeInto.js.map +1 -0
  508. package/esm/tools/monitor.d.ts +9 -0
  509. package/esm/tools/monitor.js +52 -0
  510. package/esm/tools/monitor.js.map +1 -0
  511. package/esm/tools/observable.d.ts +30 -0
  512. package/esm/tools/observable.js +83 -0
  513. package/esm/tools/observable.js.map +1 -0
  514. package/esm/tools/queueMicrotask.d.ts +1 -0
  515. package/esm/tools/queueMicrotask.js +14 -0
  516. package/esm/tools/queueMicrotask.js.map +1 -0
  517. package/esm/tools/readBytesFromStream.d.ts +10 -0
  518. package/esm/tools/readBytesFromStream.js +25 -0
  519. package/esm/tools/readBytesFromStream.js.map +1 -0
  520. package/esm/tools/requestIdleCallback.d.ts +12 -0
  521. package/esm/tools/requestIdleCallback.js +30 -0
  522. package/esm/tools/requestIdleCallback.js.map +1 -0
  523. package/esm/tools/sendToExtension.d.ts +3 -0
  524. package/esm/tools/sendToExtension.js +8 -0
  525. package/esm/tools/sendToExtension.js.map +1 -0
  526. package/esm/tools/serialisation/context.d.ts +9 -0
  527. package/esm/tools/serialisation/context.js +2 -0
  528. package/esm/tools/serialisation/context.js.map +1 -0
  529. package/esm/tools/serialisation/jsonStringify.d.ts +13 -0
  530. package/esm/tools/serialisation/jsonStringify.js +44 -0
  531. package/esm/tools/serialisation/jsonStringify.js.map +1 -0
  532. package/esm/tools/serialisation/sanitize.d.ts +18 -0
  533. package/esm/tools/serialisation/sanitize.js +185 -0
  534. package/esm/tools/serialisation/sanitize.js.map +1 -0
  535. package/esm/tools/stackTrace/computeStackTrace.d.ts +25 -0
  536. package/esm/tools/stackTrace/computeStackTrace.js +183 -0
  537. package/esm/tools/stackTrace/computeStackTrace.js.map +1 -0
  538. package/esm/tools/stackTrace/handlingStack.d.ts +10 -0
  539. package/esm/tools/stackTrace/handlingStack.js +41 -0
  540. package/esm/tools/stackTrace/handlingStack.js.map +1 -0
  541. package/esm/tools/taskQueue.d.ts +15 -0
  542. package/esm/tools/taskQueue.js +50 -0
  543. package/esm/tools/taskQueue.js.map +1 -0
  544. package/esm/tools/timer.d.ts +5 -0
  545. package/esm/tools/timer.js +16 -0
  546. package/esm/tools/timer.js.map +1 -0
  547. package/esm/tools/utils/arrayUtils.d.ts +3 -0
  548. package/esm/tools/utils/arrayUtils.js +15 -0
  549. package/esm/tools/utils/arrayUtils.js.map +1 -0
  550. package/esm/tools/utils/browserDetection.d.ts +8 -0
  551. package/esm/tools/utils/browserDetection.js +28 -0
  552. package/esm/tools/utils/browserDetection.js.map +1 -0
  553. package/esm/tools/utils/byteUtils.d.ts +8 -0
  554. package/esm/tools/utils/byteUtils.js +29 -0
  555. package/esm/tools/utils/byteUtils.js.map +1 -0
  556. package/esm/tools/utils/functionUtils.d.ts +8 -0
  557. package/esm/tools/utils/functionUtils.js +39 -0
  558. package/esm/tools/utils/functionUtils.js.map +1 -0
  559. package/esm/tools/utils/numberUtils.d.ts +9 -0
  560. package/esm/tools/utils/numberUtils.js +18 -0
  561. package/esm/tools/utils/numberUtils.js.map +1 -0
  562. package/esm/tools/utils/objectUtils.d.ts +10 -0
  563. package/esm/tools/utils/objectUtils.js +17 -0
  564. package/esm/tools/utils/objectUtils.js.map +1 -0
  565. package/esm/tools/utils/polyfills.d.ts +7 -0
  566. package/esm/tools/utils/polyfills.js +18 -0
  567. package/esm/tools/utils/polyfills.js.map +1 -0
  568. package/esm/tools/utils/responseUtils.d.ts +2 -0
  569. package/esm/tools/utils/responseUtils.js +13 -0
  570. package/esm/tools/utils/responseUtils.js.map +1 -0
  571. package/esm/tools/utils/stringUtils.d.ts +23 -0
  572. package/esm/tools/utils/stringUtils.js +84 -0
  573. package/esm/tools/utils/stringUtils.js.map +1 -0
  574. package/esm/tools/utils/timeUtils.d.ts +53 -0
  575. package/esm/tools/utils/timeUtils.js +84 -0
  576. package/esm/tools/utils/timeUtils.js.map +1 -0
  577. package/esm/tools/utils/timezone.d.ts +1 -0
  578. package/esm/tools/utils/timezone.js +10 -0
  579. package/esm/tools/utils/timezone.js.map +1 -0
  580. package/esm/tools/utils/typeUtils.d.ts +4 -0
  581. package/esm/tools/utils/typeUtils.js +13 -0
  582. package/esm/tools/utils/typeUtils.js.map +1 -0
  583. package/esm/tools/utils/urlPolyfill.d.ts +5 -0
  584. package/esm/tools/utils/urlPolyfill.js +52 -0
  585. package/esm/tools/utils/urlPolyfill.js.map +1 -0
  586. package/esm/tools/valueHistory.d.ts +27 -0
  587. package/esm/tools/valueHistory.js +100 -0
  588. package/esm/tools/valueHistory.js.map +1 -0
  589. package/esm/transport/batch.d.ts +16 -0
  590. package/esm/transport/batch.js +106 -0
  591. package/esm/transport/batch.js.map +1 -0
  592. package/esm/transport/eventBridge.d.ts +21 -0
  593. package/esm/transport/eventBridge.js +41 -0
  594. package/esm/transport/eventBridge.js.map +1 -0
  595. package/esm/transport/flushController.d.ts +65 -0
  596. package/esm/transport/flushController.js +119 -0
  597. package/esm/transport/flushController.js.map +1 -0
  598. package/esm/transport/httpRequest.d.ts +56 -0
  599. package/esm/transport/httpRequest.js +89 -0
  600. package/esm/transport/httpRequest.js.map +1 -0
  601. package/esm/transport/index.d.ts +7 -0
  602. package/esm/transport/index.js +5 -0
  603. package/esm/transport/index.js.map +1 -0
  604. package/esm/transport/sendWithRetryStrategy.d.ts +41 -0
  605. package/esm/transport/sendWithRetryStrategy.js +158 -0
  606. package/esm/transport/sendWithRetryStrategy.js.map +1 -0
  607. package/package.json +2 -2
  608. package/src/boot/displayAlreadyInitializedError.spec.ts +18 -0
  609. package/src/boot/displayAlreadyInitializedError.ts +1 -1
  610. package/src/boot/init.spec.ts +50 -0
  611. package/src/boot/init.ts +1 -1
  612. package/src/browser/addEventListener.spec.ts +141 -0
  613. package/src/browser/addEventListener.ts +2 -2
  614. package/src/browser/cookie.spec.ts +53 -0
  615. package/src/browser/fetchObservable.spec.ts +334 -0
  616. package/src/browser/pageMayExitObservable.spec.ts +56 -0
  617. package/src/browser/xhrObservable.spec.ts +405 -0
  618. package/src/domain/allowedTrackingOrigins.spec.ts +210 -0
  619. package/src/domain/bufferedData.spec.ts +34 -0
  620. package/src/domain/configuration/configuration.spec.ts +236 -0
  621. package/src/domain/configuration/configuration.ts +6 -5
  622. package/src/domain/configuration/endpointBuilder.spec.ts +173 -0
  623. package/src/domain/configuration/endpointBuilder.ts +18 -12
  624. package/src/domain/configuration/transportConfiguration.spec.ts +130 -0
  625. package/src/domain/connectivity/connectivity.spec.ts +50 -0
  626. package/src/domain/console/consoleObservable.spec.ts +151 -0
  627. package/src/domain/context/contextManager.spec.ts +152 -0
  628. package/src/domain/context/contextUtils.spec.ts +26 -0
  629. package/src/domain/context/storeContextManager.spec.ts +103 -0
  630. package/src/domain/context/storeContextManager.ts +1 -1
  631. package/src/domain/contexts/accountContext.spec.ts +99 -0
  632. package/src/domain/contexts/globalContext.spec.ts +88 -0
  633. package/src/domain/contexts/userContext.spec.ts +156 -0
  634. package/src/domain/error/error.spec.ts +294 -0
  635. package/src/domain/error/trackRuntimeError.spec.ts +343 -0
  636. package/src/domain/eventRateLimiter/createEventRateLimiter.spec.ts +119 -0
  637. package/src/domain/extension/extensionUtils.spec.ts +47 -0
  638. package/src/domain/report/reportObservable.spec.ts +71 -0
  639. package/src/domain/session/oldCookiesMigration.spec.ts +76 -0
  640. package/src/domain/session/sessionManager.spec.ts +684 -0
  641. package/src/domain/session/sessionState.spec.ts +88 -0
  642. package/src/domain/session/sessionStore.spec.ts +647 -0
  643. package/src/domain/session/sessionStoreOperations.spec.ts +234 -0
  644. package/src/domain/session/storeStrategies/sessionInCookie.spec.ts +228 -0
  645. package/src/domain/session/storeStrategies/sessionInLocalStorage.spec.ts +75 -0
  646. package/src/domain/synthetics/syntheticsWorkerValues.spec.ts +82 -0
  647. package/src/domain/tags.spec.ts +74 -0
  648. package/src/domain/telemetry/telemetry.spec.ts +494 -0
  649. package/src/domain/trackingConsent.spec.ts +44 -0
  650. package/src/tools/abstractHooks.spec.ts +76 -0
  651. package/src/tools/abstractLifeCycle.spec.ts +46 -0
  652. package/src/tools/boundedBuffer.spec.ts +40 -0
  653. package/src/tools/catchUserErrors.spec.ts +20 -0
  654. package/src/tools/encoder.spec.ts +112 -0
  655. package/src/tools/experimentalFeatures.spec.ts +60 -0
  656. package/src/tools/getZoneJsOriginalValue.spec.ts +36 -0
  657. package/src/tools/instrumentMethod.spec.ts +381 -0
  658. package/src/tools/matchOption.spec.ts +41 -0
  659. package/src/tools/mergeInto.spec.ts +198 -0
  660. package/src/tools/monitor.spec.ts +172 -0
  661. package/src/tools/observable.spec.ts +259 -0
  662. package/src/tools/queueMicrotask.spec.ts +24 -0
  663. package/src/tools/readBytesFromStream.spec.ts +62 -0
  664. package/src/tools/requestIdleCallback.spec.ts +65 -0
  665. package/src/tools/serialisation/jsonStringify.spec.ts +76 -0
  666. package/src/tools/serialisation/sanitize.spec.ts +284 -0
  667. package/src/tools/stackTrace/capturedExceptions.specHelper.ts +316 -0
  668. package/src/tools/stackTrace/computeStackTrace.spec.ts +1007 -0
  669. package/src/tools/stackTrace/handlingStack.spec.ts +20 -0
  670. package/src/tools/taskQueue.spec.ts +60 -0
  671. package/src/tools/timer.spec.ts +76 -0
  672. package/src/tools/utils/browserDetection.spec.ts +120 -0
  673. package/src/tools/utils/byteUtils.spec.ts +29 -0
  674. package/src/tools/utils/functionUtils.spec.ts +229 -0
  675. package/src/tools/utils/numberUtils.spec.ts +27 -0
  676. package/src/tools/utils/stringUtils.spec.ts +74 -0
  677. package/src/tools/utils/typeUtils.spec.ts +25 -0
  678. package/src/tools/utils/urlPolyfill.spec.ts +55 -0
  679. package/src/tools/valueHistory.spec.ts +180 -0
  680. package/src/transport/batch.spec.ts +261 -0
  681. package/src/transport/eventBridge.spec.ts +90 -0
  682. package/src/transport/flushController.spec.ts +267 -0
  683. package/src/transport/httpRequest.spec.ts +400 -0
  684. package/src/transport/httpRequest.ts +3 -3
  685. package/src/transport/sendWithRetryStrategy.spec.ts +393 -0
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createContextManager = createContextManager;
4
+ const mergeInto_1 = require("../../tools/mergeInto");
5
+ const sanitize_1 = require("../../tools/serialisation/sanitize");
6
+ const observable_1 = require("../../tools/observable");
7
+ const display_1 = require("../../tools/display");
8
+ const contextUtils_1 = require("./contextUtils");
9
+ function ensureProperties(context, propertiesConfig, name) {
10
+ const newContext = { ...context };
11
+ for (const [key, { required, type }] of Object.entries(propertiesConfig)) {
12
+ /**
13
+ * Ensure specified properties are strings as defined here:
14
+ * https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#user-related-attributes
15
+ */
16
+ if (type === 'string' && !isDefined(newContext[key])) {
17
+ /* eslint-disable @typescript-eslint/no-base-to-string */
18
+ newContext[key] = String(newContext[key]);
19
+ }
20
+ if (required && isDefined(newContext[key])) {
21
+ display_1.display.warn(`The property ${key} of ${name} is required; context will not be sent to the intake.`);
22
+ }
23
+ }
24
+ return newContext;
25
+ }
26
+ function isDefined(value) {
27
+ return value === undefined || value === null || value === '';
28
+ }
29
+ function createContextManager(name = '', { propertiesConfig = {}, } = {}) {
30
+ let context = {};
31
+ const changeObservable = new observable_1.Observable();
32
+ const contextManager = {
33
+ getContext: () => (0, mergeInto_1.deepClone)(context),
34
+ setContext: (newContext) => {
35
+ if ((0, contextUtils_1.checkContext)(newContext)) {
36
+ context = (0, sanitize_1.sanitize)(ensureProperties(newContext, propertiesConfig, name));
37
+ }
38
+ else {
39
+ contextManager.clearContext();
40
+ }
41
+ changeObservable.notify();
42
+ },
43
+ setContextProperty: (key, property) => {
44
+ context = (0, sanitize_1.sanitize)(ensureProperties({ ...context, [key]: property }, propertiesConfig, name));
45
+ changeObservable.notify();
46
+ },
47
+ removeContextProperty: (key) => {
48
+ delete context[key];
49
+ ensureProperties(context, propertiesConfig, name);
50
+ changeObservable.notify();
51
+ },
52
+ clearContext: () => {
53
+ context = {};
54
+ changeObservable.notify();
55
+ },
56
+ changeObservable,
57
+ };
58
+ return contextManager;
59
+ }
60
+ //# sourceMappingURL=contextManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextManager.js","sourceRoot":"","sources":["../../../src/domain/context/contextManager.ts"],"names":[],"mappings":";;AA0CA,oDA0CC;AApFD,qDAAiD;AACjD,iEAA6D;AAE7D,uDAAmD;AACnD,iDAA6C;AAC7C,iDAA6C;AAW7C,SAAS,gBAAgB,CAAC,OAAgB,EAAE,gBAAkC,EAAE,IAAY;IAC1F,MAAM,UAAU,GAAG,EAAE,GAAG,OAAO,EAAE,CAAA;IAEjC,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzE;;;WAGG;QAEH,IAAI,IAAI,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACrD,yDAAyD;YACzD,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3C,CAAC;QAED,IAAI,QAAQ,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC3C,iBAAO,CAAC,IAAI,CAAC,gBAAgB,GAAG,OAAO,IAAI,uDAAuD,CAAC,CAAA;QACrG,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAA;AAC9D,CAAC;AAED,SAAgB,oBAAoB,CAClC,OAAe,EAAE,EACjB,EACE,gBAAgB,GAAG,EAAE,MAGnB,EAAE;IAEN,IAAI,OAAO,GAAY,EAAE,CAAA;IACzB,MAAM,gBAAgB,GAAG,IAAI,uBAAU,EAAQ,CAAA;IAE/C,MAAM,cAAc,GAAG;QACrB,UAAU,EAAE,GAAG,EAAE,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC;QAEpC,UAAU,EAAE,CAAC,UAAmB,EAAE,EAAE;YAClC,IAAI,IAAA,2BAAY,EAAC,UAAU,CAAC,EAAE,CAAC;gBAC7B,OAAO,GAAG,IAAA,mBAAQ,EAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAA;YAC1E,CAAC;iBAAM,CAAC;gBACN,cAAc,CAAC,YAAY,EAAE,CAAA;YAC/B,CAAC;YACD,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,kBAAkB,EAAE,CAAC,GAAW,EAAE,QAAa,EAAE,EAAE;YACjD,OAAO,GAAG,IAAA,mBAAQ,EAAC,gBAAgB,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAA;YAC7F,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,qBAAqB,EAAE,CAAC,GAAW,EAAE,EAAE;YACrC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;YACnB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAA;YACjD,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO,GAAG,EAAE,CAAA;YACZ,gBAAgB,CAAC,MAAM,EAAE,CAAA;QAC3B,CAAC;QAED,gBAAgB;KACjB,CAAA;IACD,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Context } from '../../tools/serialisation/context';
2
+ /**
3
+ * Simple check to ensure an object is a valid context
4
+ */
5
+ export declare function checkContext(maybeContext: unknown): maybeContext is Context;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkContext = checkContext;
4
+ const display_1 = require("../../tools/display");
5
+ const typeUtils_1 = require("../../tools/utils/typeUtils");
6
+ /**
7
+ * Simple check to ensure an object is a valid context
8
+ */
9
+ function checkContext(maybeContext) {
10
+ const isValid = (0, typeUtils_1.getType)(maybeContext) === 'object';
11
+ if (!isValid) {
12
+ display_1.display.error('Unsupported context:', maybeContext);
13
+ }
14
+ return isValid;
15
+ }
16
+ //# sourceMappingURL=contextUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextUtils.js","sourceRoot":"","sources":["../../../src/domain/context/contextUtils.ts"],"names":[],"mappings":";;AAOA,oCAMC;AAZD,iDAA6C;AAC7C,2DAAqD;AAErD;;GAEG;AACH,SAAgB,YAAY,CAAC,YAAqB;IAChD,MAAM,OAAO,GAAG,IAAA,mBAAO,EAAC,YAAY,CAAC,KAAK,QAAQ,CAAA;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,iBAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { RawTelemetryUsageFeature } from '../telemetry';
2
+ import type { BoundedBuffer } from '../../tools/boundedBuffer';
3
+ import type { ContextManager } from './contextManager';
4
+ import type { ContextManagerMethod, CustomerContextKey } from './contextConstants';
5
+ export declare function defineContextMethod<MethodName extends ContextManagerMethod, Key extends CustomerContextKey>(getStrategy: () => Record<Key, ContextManager>, contextName: Key, methodName: MethodName, usage?: RawTelemetryUsageFeature): ContextManager[MethodName];
6
+ export declare function bufferContextCalls<Key extends string, StartResult extends Record<Key, ContextManager>>(preStartContextManager: ContextManager, name: Key, bufferApiCalls: BoundedBuffer<StartResult>): void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineContextMethod = defineContextMethod;
4
+ exports.bufferContextCalls = bufferContextCalls;
5
+ const telemetry_1 = require("../telemetry");
6
+ const monitor_1 = require("../../tools/monitor");
7
+ function defineContextMethod(getStrategy, contextName, methodName, usage) {
8
+ return (0, monitor_1.monitor)((...args) => {
9
+ if (usage) {
10
+ (0, telemetry_1.addTelemetryUsage)({ feature: usage });
11
+ }
12
+ return getStrategy()[contextName][methodName](...args);
13
+ });
14
+ }
15
+ function bufferContextCalls(preStartContextManager, name, bufferApiCalls) {
16
+ preStartContextManager.changeObservable.subscribe(() => {
17
+ const context = preStartContextManager.getContext();
18
+ bufferApiCalls.add((startResult) => startResult[name].setContext(context));
19
+ });
20
+ }
21
+ //# sourceMappingURL=defineContextMethod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineContextMethod.js","sourceRoot":"","sources":["../../../src/domain/context/defineContextMethod.ts"],"names":[],"mappings":";;AAOA,kDAYC;AAED,gDASC;AA7BD,4CAAgD;AAChD,iDAA6C;AAK7C,SAAgB,mBAAmB,CACjC,WAA8C,EAC9C,WAAgB,EAChB,UAAsB,EACtB,KAAgC;IAEhC,OAAO,IAAA,iBAAO,EAAC,CAAC,GAAG,IAAW,EAAE,EAAE;QAChC,IAAI,KAAK,EAAE,CAAC;YACV,IAAA,6BAAiB,EAAC,EAAE,OAAO,EAAE,KAAK,EAAuB,CAAC,CAAA;QAC5D,CAAC;QACD,OAAQ,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC,UAAU,CAAqC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC7F,CAAC,CAA+B,CAAA;AAClC,CAAC;AAED,SAAgB,kBAAkB,CAChC,sBAAsC,EACtC,IAAS,EACT,cAA0C;IAE1C,sBAAsB,CAAC,gBAAgB,CAAC,SAAS,CAAC,GAAG,EAAE;QACrD,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,EAAE,CAAA;QACnD,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Configuration } from '../configuration';
2
+ import type { ContextManager } from './contextManager';
3
+ import type { CustomerDataType } from './contextConstants';
4
+ export declare function storeContextManager(configuration: Configuration, contextManager: ContextManager, productKey: string, customerDataType: CustomerDataType): void;
5
+ export declare function buildStorageKey(productKey: string, customerDataType: CustomerDataType): string;
6
+ export declare function removeStorageListeners(): void;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.storeContextManager = storeContextManager;
4
+ exports.buildStorageKey = buildStorageKey;
5
+ exports.removeStorageListeners = removeStorageListeners;
6
+ const addEventListener_1 = require("../../browser/addEventListener");
7
+ const mergeInto_1 = require("../../tools/mergeInto");
8
+ const objectUtils_1 = require("../../tools/utils/objectUtils");
9
+ const CONTEXT_STORE_KEY_PREFIX = '_oo_c';
10
+ const storageListeners = [];
11
+ function storeContextManager(configuration, contextManager, productKey, customerDataType) {
12
+ const storageKey = buildStorageKey(productKey, customerDataType);
13
+ storageListeners.push((0, addEventListener_1.addEventListener)(configuration, window, "storage" /* DOM_EVENT.STORAGE */, ({ key }) => {
14
+ if (storageKey === key) {
15
+ synchronizeWithStorage();
16
+ }
17
+ }));
18
+ contextManager.changeObservable.subscribe(dumpToStorage);
19
+ const contextFromStorage = (0, mergeInto_1.combine)(getFromStorage(), contextManager.getContext());
20
+ if (!(0, objectUtils_1.isEmptyObject)(contextFromStorage)) {
21
+ contextManager.setContext(contextFromStorage);
22
+ }
23
+ function synchronizeWithStorage() {
24
+ contextManager.setContext(getFromStorage());
25
+ }
26
+ function dumpToStorage() {
27
+ localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));
28
+ }
29
+ function getFromStorage() {
30
+ const rawContext = localStorage.getItem(storageKey);
31
+ return rawContext ? JSON.parse(rawContext) : {};
32
+ }
33
+ }
34
+ function buildStorageKey(productKey, customerDataType) {
35
+ return `${CONTEXT_STORE_KEY_PREFIX}_${productKey}_${customerDataType}`;
36
+ }
37
+ function removeStorageListeners() {
38
+ storageListeners.map((listener) => listener.stop());
39
+ }
40
+ //# sourceMappingURL=storeContextManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeContextManager.js","sourceRoot":"","sources":["../../../src/domain/context/storeContextManager.ts"],"names":[],"mappings":";;AAYA,kDAkCC;AAED,0CAEC;AAED,wDAEC;AAtDD,qEAA4E;AAG5E,qDAA+C;AAC/C,+DAA6D;AAI7D,MAAM,wBAAwB,GAAG,OAAO,CAAA;AAExC,MAAM,gBAAgB,GAAgC,EAAE,CAAA;AAExD,SAAgB,mBAAmB,CACjC,aAA4B,EAC5B,cAA8B,EAC9B,UAAkB,EAClB,gBAAkC;IAElC,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA;IAEhE,gBAAgB,CAAC,IAAI,CACnB,IAAA,mCAAgB,EAAC,aAAa,EAAE,MAAM,qCAAqB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;QACrE,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;YACvB,sBAAsB,EAAE,CAAA;QAC1B,CAAC;IACH,CAAC,CAAC,CACH,CAAA;IACD,cAAc,CAAC,gBAAgB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAExD,MAAM,kBAAkB,GAAG,IAAA,mBAAO,EAAC,cAAc,EAAE,EAAE,cAAc,CAAC,UAAU,EAAE,CAAC,CAAA;IACjF,IAAI,CAAC,IAAA,2BAAa,EAAC,kBAAkB,CAAC,EAAE,CAAC;QACvC,cAAc,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAA;IAC/C,CAAC;IAED,SAAS,sBAAsB;QAC7B,cAAc,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,SAAS,aAAa;QACpB,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;IAC/E,CAAC;IAED,SAAS,cAAc;QACrB,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACnD,OAAO,UAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAa,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9D,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,UAAkB,EAAE,gBAAkC;IACpF,OAAO,GAAG,wBAAwB,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAAA;AACxE,CAAC;AAED,SAAgB,sBAAsB;IACpC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;AACrD,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { Configuration } from '../configuration';
2
+ import type { AbstractHooks } from '../../tools/abstractHooks';
3
+ /**
4
+ * Account information for the browser SDK.
5
+ */
6
+ export interface Account {
7
+ id: string;
8
+ name?: string | undefined;
9
+ [key: string]: unknown;
10
+ }
11
+ export declare function startAccountContext(hooks: AbstractHooks, configuration: Configuration, productKey: string): {
12
+ getContext: () => import("../..").Context;
13
+ setContext: (newContext: unknown) => void;
14
+ setContextProperty: (key: string, property: any) => void;
15
+ removeContextProperty: (key: string) => void;
16
+ clearContext: () => void;
17
+ changeObservable: import("../..").Observable<void>;
18
+ };
19
+ export declare function buildAccountContextManager(): {
20
+ getContext: () => import("../..").Context;
21
+ setContext: (newContext: unknown) => void;
22
+ setContextProperty: (key: string, property: any) => void;
23
+ removeContextProperty: (key: string) => void;
24
+ clearContext: () => void;
25
+ changeObservable: import("../..").Observable<void>;
26
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startAccountContext = startAccountContext;
4
+ exports.buildAccountContextManager = buildAccountContextManager;
5
+ const storeContextManager_1 = require("../context/storeContextManager");
6
+ const abstractHooks_1 = require("../../tools/abstractHooks");
7
+ const objectUtils_1 = require("../../tools/utils/objectUtils");
8
+ const contextManager_1 = require("../context/contextManager");
9
+ function startAccountContext(hooks, configuration, productKey) {
10
+ const accountContextManager = buildAccountContextManager();
11
+ if (configuration.storeContextsAcrossPages) {
12
+ (0, storeContextManager_1.storeContextManager)(configuration, accountContextManager, productKey, 4 /* CustomerDataType.Account */);
13
+ }
14
+ hooks.register(0 /* HookNames.Assemble */, () => {
15
+ const account = accountContextManager.getContext();
16
+ if ((0, objectUtils_1.isEmptyObject)(account) || !account.id) {
17
+ return abstractHooks_1.SKIPPED;
18
+ }
19
+ return {
20
+ account,
21
+ };
22
+ });
23
+ return accountContextManager;
24
+ }
25
+ function buildAccountContextManager() {
26
+ return (0, contextManager_1.createContextManager)('account', {
27
+ propertiesConfig: {
28
+ id: { type: 'string', required: true },
29
+ name: { type: 'string' },
30
+ },
31
+ });
32
+ }
33
+ //# sourceMappingURL=accountContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountContext.js","sourceRoot":"","sources":["../../../src/domain/contexts/accountContext.ts"],"names":[],"mappings":";;AAiBA,kDAoBC;AAED,gEAOC;AA5CD,wEAAoE;AACpE,6DAA8D;AAE9D,+DAA6D;AAC7D,8DAAgE;AAWhE,SAAgB,mBAAmB,CAAC,KAAoB,EAAE,aAA4B,EAAE,UAAkB;IACxG,MAAM,qBAAqB,GAAG,0BAA0B,EAAE,CAAA;IAE1D,IAAI,aAAa,CAAC,wBAAwB,EAAE,CAAC;QAC3C,IAAA,yCAAmB,EAAC,aAAa,EAAE,qBAAqB,EAAE,UAAU,mCAA2B,CAAA;IACjG,CAAC;IAED,KAAK,CAAC,QAAQ,6BAAqB,GAAG,EAAE;QACtC,MAAM,OAAO,GAAG,qBAAqB,CAAC,UAAU,EAAa,CAAA;QAE7D,IAAI,IAAA,2BAAa,EAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YAC1C,OAAO,uBAAO,CAAA;QAChB,CAAC;QAED,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,qBAAqB,CAAA;AAC9B,CAAC;AAED,SAAgB,0BAA0B;IACxC,OAAO,IAAA,qCAAoB,EAAC,SAAS,EAAE;QACrC,gBAAgB,EAAE;YAChB,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACtC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACzB;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AbstractHooks } from '../../tools/abstractHooks';
2
+ import type { Configuration } from '../configuration';
3
+ export declare function startGlobalContext(hooks: AbstractHooks, configuration: Configuration, productKey: string, useContextNamespace: boolean): {
4
+ getContext: () => import("../..").Context;
5
+ setContext: (newContext: unknown) => void;
6
+ setContextProperty: (key: string, property: any) => void;
7
+ removeContextProperty: (key: string) => void;
8
+ clearContext: () => void;
9
+ changeObservable: import("../..").Observable<void>;
10
+ };
11
+ export declare function buildGlobalContextManager(): {
12
+ getContext: () => import("../..").Context;
13
+ setContext: (newContext: unknown) => void;
14
+ setContextProperty: (key: string, property: any) => void;
15
+ removeContextProperty: (key: string) => void;
16
+ clearContext: () => void;
17
+ changeObservable: import("../..").Observable<void>;
18
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startGlobalContext = startGlobalContext;
4
+ exports.buildGlobalContextManager = buildGlobalContextManager;
5
+ const storeContextManager_1 = require("../context/storeContextManager");
6
+ const contextManager_1 = require("../context/contextManager");
7
+ function startGlobalContext(hooks, configuration, productKey, useContextNamespace) {
8
+ const globalContextManager = buildGlobalContextManager();
9
+ if (configuration.storeContextsAcrossPages) {
10
+ (0, storeContextManager_1.storeContextManager)(configuration, globalContextManager, productKey, 2 /* CustomerDataType.GlobalContext */);
11
+ }
12
+ hooks.register(0 /* HookNames.Assemble */, () => {
13
+ const context = globalContextManager.getContext();
14
+ return useContextNamespace ? { context } : context;
15
+ });
16
+ return globalContextManager;
17
+ }
18
+ function buildGlobalContextManager() {
19
+ return (0, contextManager_1.createContextManager)('global context');
20
+ }
21
+ //# sourceMappingURL=globalContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalContext.js","sourceRoot":"","sources":["../../../src/domain/contexts/globalContext.ts"],"names":[],"mappings":";;AAOA,gDAkBC;AAED,8DAEC;AA3BD,wEAAoE;AAEpE,8DAAgE;AAGhE,SAAgB,kBAAkB,CAChC,KAAoB,EACpB,aAA4B,EAC5B,UAAkB,EAClB,mBAA4B;IAE5B,MAAM,oBAAoB,GAAG,yBAAyB,EAAE,CAAA;IAExD,IAAI,aAAa,CAAC,wBAAwB,EAAE,CAAC;QAC3C,IAAA,yCAAmB,EAAC,aAAa,EAAE,oBAAoB,EAAE,UAAU,yCAAiC,CAAA;IACtG,CAAC;IAED,KAAK,CAAC,QAAQ,6BAAqB,GAAG,EAAE;QACtC,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,CAAA;QACjD,OAAO,mBAAmB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAA;IACpD,CAAC,CAAC,CAAA;IAEF,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,SAAgB,yBAAyB;IACvC,OAAO,IAAA,qCAAoB,EAAC,gBAAgB,CAAC,CAAA;AAC/C,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Context } from '../../tools/serialisation/context';
2
+ export interface RumInternalContext extends Context {
3
+ application_id: string;
4
+ session_id: string | undefined;
5
+ view?: {
6
+ id: string;
7
+ url: string;
8
+ referrer: string;
9
+ name?: string;
10
+ };
11
+ user_action?: {
12
+ id: string | string[];
13
+ };
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rumInternalContext.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rumInternalContext.type.js","sourceRoot":"","sources":["../../../src/domain/contexts/rumInternalContext.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import type { AbstractHooks } from '../../tools/abstractHooks';
2
+ import type { Configuration } from '../configuration';
3
+ import type { RelativeTime } from '../../tools/utils/timeUtils';
4
+ export interface User {
5
+ id?: string | undefined;
6
+ email?: string | undefined;
7
+ name?: string | undefined;
8
+ [key: string]: unknown;
9
+ }
10
+ export declare function startUserContext(hooks: AbstractHooks, configuration: Configuration, sessionManager: {
11
+ findTrackedSession: (startTime?: RelativeTime) => {
12
+ anonymousId?: string;
13
+ } | undefined;
14
+ }, productKey: string): {
15
+ getContext: () => import("../..").Context;
16
+ setContext: (newContext: unknown) => void;
17
+ setContextProperty: (key: string, property: any) => void;
18
+ removeContextProperty: (key: string) => void;
19
+ clearContext: () => void;
20
+ changeObservable: import("../..").Observable<void>;
21
+ };
22
+ export declare function buildUserContextManager(): {
23
+ getContext: () => import("../..").Context;
24
+ setContext: (newContext: unknown) => void;
25
+ setContextProperty: (key: string, property: any) => void;
26
+ removeContextProperty: (key: string) => void;
27
+ clearContext: () => void;
28
+ changeObservable: import("../..").Observable<void>;
29
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startUserContext = startUserContext;
4
+ exports.buildUserContextManager = buildUserContextManager;
5
+ const storeContextManager_1 = require("../context/storeContextManager");
6
+ const abstractHooks_1 = require("../../tools/abstractHooks");
7
+ const contextManager_1 = require("../context/contextManager");
8
+ const objectUtils_1 = require("../../tools/utils/objectUtils");
9
+ function startUserContext(hooks, configuration, sessionManager, productKey) {
10
+ const userContextManager = buildUserContextManager();
11
+ if (configuration.storeContextsAcrossPages) {
12
+ (0, storeContextManager_1.storeContextManager)(configuration, userContextManager, productKey, 1 /* CustomerDataType.User */);
13
+ }
14
+ hooks.register(0 /* HookNames.Assemble */, ({ eventType, startTime }) => {
15
+ const user = userContextManager.getContext();
16
+ const session = sessionManager.findTrackedSession(startTime);
17
+ if (session && session.anonymousId && !user.anonymous_id && !!configuration.trackAnonymousUser) {
18
+ user.anonymous_id = session.anonymousId;
19
+ }
20
+ if ((0, objectUtils_1.isEmptyObject)(user)) {
21
+ return abstractHooks_1.SKIPPED;
22
+ }
23
+ return {
24
+ type: eventType,
25
+ usr: user,
26
+ };
27
+ });
28
+ hooks.register(1 /* HookNames.AssembleTelemetry */, ({ startTime }) => {
29
+ var _a;
30
+ return ({
31
+ anonymous_id: (_a = sessionManager.findTrackedSession(startTime)) === null || _a === void 0 ? void 0 : _a.anonymousId,
32
+ });
33
+ });
34
+ return userContextManager;
35
+ }
36
+ function buildUserContextManager() {
37
+ return (0, contextManager_1.createContextManager)('user', {
38
+ propertiesConfig: {
39
+ id: { type: 'string' },
40
+ name: { type: 'string' },
41
+ email: { type: 'string' },
42
+ },
43
+ });
44
+ }
45
+ //# sourceMappingURL=userContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userContext.js","sourceRoot":"","sources":["../../../src/domain/contexts/userContext.ts"],"names":[],"mappings":";;AAgBA,4CAqCC;AAED,0DAQC;AA7DD,wEAAoE;AACpE,6DAA8D;AAC9D,8DAAgE;AAEhE,+DAA6D;AAU7D,SAAgB,gBAAgB,CAC9B,KAAoB,EACpB,aAA4B,EAC5B,cAEC,EACD,UAAkB;IAElB,MAAM,kBAAkB,GAAG,uBAAuB,EAAE,CAAA;IAEpD,IAAI,aAAa,CAAC,wBAAwB,EAAE,CAAC;QAC3C,IAAA,yCAAmB,EAAC,aAAa,EAAE,kBAAkB,EAAE,UAAU,gCAAwB,CAAA;IAC3F,CAAC;IAED,KAAK,CAAC,QAAQ,6BAAqB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;QAC9D,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,EAAE,CAAA;QAC5C,MAAM,OAAO,GAAG,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAE5D,IAAI,OAAO,IAAI,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC;YAC/F,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAA;QACzC,CAAC;QAED,IAAI,IAAA,2BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,uBAAO,CAAA;QAChB,CAAC;QAED,OAAO;YACL,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,IAAI;SACV,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,KAAK,CAAC,QAAQ,sCAA8B,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;;QAAC,OAAA,CAAC;YAC9D,YAAY,EAAE,MAAA,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,0CAAE,WAAW;SACxE,CAAC,CAAA;KAAA,CAAC,CAAA;IAEH,OAAO,kBAAkB,CAAA;AAC3B,CAAC;AAED,SAAgB,uBAAuB;IACrC,OAAO,IAAA,qCAAoB,EAAC,MAAM,EAAE;QAClC,gBAAgB,EAAE;YAChB,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC1B;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { Encoder } from '../../tools/encoder';
2
+ import type { Uint8ArrayBuffer } from '../../tools/utils/byteUtils';
3
+ export type DeflateWorkerAction = {
4
+ action: 'init';
5
+ } | {
6
+ action: 'write';
7
+ id: number;
8
+ streamId: number;
9
+ data: string;
10
+ } | {
11
+ action: 'reset';
12
+ streamId: number;
13
+ };
14
+ export type DeflateWorkerResponse = {
15
+ type: 'initialized';
16
+ version: string;
17
+ } | {
18
+ type: 'wrote';
19
+ id: number;
20
+ streamId: number;
21
+ result: Uint8ArrayBuffer;
22
+ trailer: Uint8ArrayBuffer;
23
+ additionalBytesCount: number;
24
+ } | {
25
+ type: 'errored';
26
+ streamId?: number;
27
+ error: Error | string;
28
+ };
29
+ export interface DeflateWorker extends Worker {
30
+ postMessage(message: DeflateWorkerAction): void;
31
+ }
32
+ export type DeflateEncoder = Encoder<Uint8ArrayBuffer> & {
33
+ stop: () => void;
34
+ };
35
+ export declare const enum DeflateEncoderStreamId {
36
+ REPLAY = 1,
37
+ RUM = 2,
38
+ TELEMETRY = 4,
39
+ PROFILING = 6
40
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=deflate.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deflate.types.js","sourceRoot":"","sources":["../../../src/domain/deflate/deflate.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './deflate.types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./deflate.types"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/deflate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B"}
@@ -0,0 +1,23 @@
1
+ import type { ClocksState } from '../../tools/utils/timeUtils';
2
+ import type { Context } from '../../tools/serialisation/context';
3
+ import type { StackTrace } from '../../tools/stackTrace/computeStackTrace';
4
+ import type { ErrorSource, ErrorHandling, RawError, RawErrorCause, ErrorWithCause, NonErrorPrefix } from './error.types';
5
+ export declare const NO_ERROR_STACK_PRESENT_MESSAGE = "No stack, consider using an instance of Error";
6
+ interface RawErrorParams {
7
+ stackTrace?: StackTrace;
8
+ originalError: unknown;
9
+ handlingStack?: string;
10
+ componentStack?: string;
11
+ startClocks: ClocksState;
12
+ nonErrorPrefix: NonErrorPrefix;
13
+ useFallbackStack?: boolean;
14
+ source: ErrorSource;
15
+ handling: ErrorHandling;
16
+ }
17
+ export declare function computeRawError({ stackTrace, originalError, handlingStack, componentStack, startClocks, nonErrorPrefix, useFallbackStack, source, handling, }: RawErrorParams): RawError;
18
+ export declare function tryToGetFingerprint(originalError: unknown): string | undefined;
19
+ export declare function tryToGetErrorContext(originalError: unknown): Context | undefined;
20
+ export declare function getFileFromStackTraceString(stack: string): string | undefined;
21
+ export declare function isError(error: unknown): error is Error;
22
+ export declare function flattenErrorCauses(error: ErrorWithCause, parentSource: ErrorSource): RawErrorCause[] | undefined;
23
+ export {};
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NO_ERROR_STACK_PRESENT_MESSAGE = void 0;
4
+ exports.computeRawError = computeRawError;
5
+ exports.tryToGetFingerprint = tryToGetFingerprint;
6
+ exports.tryToGetErrorContext = tryToGetErrorContext;
7
+ exports.getFileFromStackTraceString = getFileFromStackTraceString;
8
+ exports.isError = isError;
9
+ exports.flattenErrorCauses = flattenErrorCauses;
10
+ const sanitize_1 = require("../../tools/serialisation/sanitize");
11
+ const jsonStringify_1 = require("../../tools/serialisation/jsonStringify");
12
+ const computeStackTrace_1 = require("../../tools/stackTrace/computeStackTrace");
13
+ const handlingStack_1 = require("../../tools/stackTrace/handlingStack");
14
+ exports.NO_ERROR_STACK_PRESENT_MESSAGE = 'No stack, consider using an instance of Error';
15
+ function computeRawError({ stackTrace, originalError, handlingStack, componentStack, startClocks, nonErrorPrefix, useFallbackStack = true, source, handling, }) {
16
+ const isErrorInstance = isError(originalError);
17
+ if (!stackTrace && isErrorInstance) {
18
+ stackTrace = (0, computeStackTrace_1.computeStackTrace)(originalError);
19
+ }
20
+ return {
21
+ startClocks,
22
+ source,
23
+ handling,
24
+ handlingStack,
25
+ componentStack,
26
+ originalError,
27
+ type: stackTrace ? stackTrace.name : undefined,
28
+ message: computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError),
29
+ stack: stackTrace ? (0, handlingStack_1.toStackTraceString)(stackTrace) : useFallbackStack ? exports.NO_ERROR_STACK_PRESENT_MESSAGE : undefined,
30
+ causes: isErrorInstance ? flattenErrorCauses(originalError, source) : undefined,
31
+ fingerprint: tryToGetFingerprint(originalError),
32
+ context: tryToGetErrorContext(originalError),
33
+ };
34
+ }
35
+ function computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError) {
36
+ // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)
37
+ // TODO rework tracekit integration to avoid scattering error building logic
38
+ return (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.message) && (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name)
39
+ ? stackTrace.message
40
+ : !isErrorInstance
41
+ ? `${nonErrorPrefix} ${(0, jsonStringify_1.jsonStringify)((0, sanitize_1.sanitize)(originalError))}`
42
+ : 'Empty message';
43
+ }
44
+ function tryToGetFingerprint(originalError) {
45
+ return isError(originalError) && 'oo_fingerprint' in originalError ? String(originalError.oo_fingerprint) : undefined;
46
+ }
47
+ function tryToGetErrorContext(originalError) {
48
+ if (originalError !== null && typeof originalError === 'object' && 'dd_context' in originalError) {
49
+ return originalError.dd_context;
50
+ }
51
+ }
52
+ function getFileFromStackTraceString(stack) {
53
+ var _a;
54
+ return (_a = /@ (.+)/.exec(stack)) === null || _a === void 0 ? void 0 : _a[1];
55
+ }
56
+ function isError(error) {
57
+ return error instanceof Error || Object.prototype.toString.call(error) === '[object Error]';
58
+ }
59
+ function flattenErrorCauses(error, parentSource) {
60
+ let currentError = error;
61
+ const causes = [];
62
+ while (isError(currentError === null || currentError === void 0 ? void 0 : currentError.cause) && causes.length < 10) {
63
+ const stackTrace = (0, computeStackTrace_1.computeStackTrace)(currentError.cause);
64
+ causes.push({
65
+ message: currentError.cause.message,
66
+ source: parentSource,
67
+ type: stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name,
68
+ stack: stackTrace && (0, handlingStack_1.toStackTraceString)(stackTrace),
69
+ });
70
+ currentError = currentError.cause;
71
+ }
72
+ return causes.length ? causes : undefined;
73
+ }
74
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/domain/error/error.ts"],"names":[],"mappings":";;;AAuBA,0CA8BC;AAiBD,kDAEC;AAED,oDAIC;AAED,kEAEC;AAED,0BAEC;AAED,gDAcC;AAtGD,iEAA6D;AAG7D,2EAAuE;AAEvE,gFAA4E;AAC5E,wEAAyE;AAG5D,QAAA,8BAA8B,GAAG,+CAA+C,CAAA;AAc7F,SAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,GAAG,IAAI,EACvB,MAAM,EACN,QAAQ,GACO;IACf,MAAM,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC9C,IAAI,CAAC,UAAU,IAAI,eAAe,EAAE,CAAC;QACnC,UAAU,GAAG,IAAA,qCAAiB,EAAC,aAAa,CAAC,CAAA;IAC/C,CAAC;IAED,OAAO;QACL,WAAW;QACX,MAAM;QACN,QAAQ;QACR,aAAa;QACb,cAAc;QACd,aAAa;QACb,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC9C,OAAO,EAAE,cAAc,CAAC,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,CAAC;QACnF,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,IAAA,kCAAkB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,sCAA8B,CAAC,CAAC,CAAC,SAAS;QAClH,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,kBAAkB,CAAC,aAA+B,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QACjG,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC;QAC/C,OAAO,EAAE,oBAAoB,CAAC,aAAa,CAAC;KAC7C,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CACrB,UAAkC,EAClC,eAAwB,EACxB,cAA8B,EAC9B,aAAsB;IAEtB,kHAAkH;IAClH,4EAA4E;IAC5E,OAAO,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,MAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAA;QAC5C,CAAC,CAAC,UAAU,CAAC,OAAO;QACpB,CAAC,CAAC,CAAC,eAAe;YAChB,CAAC,CAAC,GAAG,cAAc,IAAI,IAAA,6BAAa,EAAC,IAAA,mBAAQ,EAAC,aAAa,CAAC,CAAE,EAAE;YAChE,CAAC,CAAC,eAAe,CAAA;AACvB,CAAC;AAED,SAAgB,mBAAmB,CAAC,aAAsB;IACxD,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,gBAAgB,IAAI,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACvH,CAAC;AAED,SAAgB,oBAAoB,CAAC,aAAsB;IACzD,IAAI,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,YAAY,IAAI,aAAa,EAAE,CAAC;QACjG,OAAO,aAAa,CAAC,UAAqB,CAAA;IAC5C,CAAC;AACH,CAAC;AAED,SAAgB,2BAA2B,CAAC,KAAa;;IACvD,OAAO,MAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,0CAAG,CAAC,CAAC,CAAA;AAClC,CAAC;AAED,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,gBAAgB,CAAA;AAC7F,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAqB,EAAE,YAAyB;IACjF,IAAI,YAAY,GAAG,KAAK,CAAA;IACxB,MAAM,MAAM,GAAoB,EAAE,CAAA;IAClC,OAAO,OAAO,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC1D,MAAM,UAAU,GAAG,IAAA,qCAAiB,EAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QACxD,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,OAAO;YACnC,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI;YACtB,KAAK,EAAE,UAAU,IAAI,IAAA,kCAAkB,EAAC,UAAU,CAAC;SACpD,CAAC,CAAA;QACF,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;IACnC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { Context } from '../../tools/serialisation/context';
2
+ import type { ClocksState } from '../../tools/utils/timeUtils';
3
+ export interface ErrorWithCause extends Omit<Error, 'cause'> {
4
+ cause?: unknown;
5
+ }
6
+ export interface RawErrorCause {
7
+ message: string;
8
+ source: ErrorSource;
9
+ type?: string;
10
+ stack?: string;
11
+ }
12
+ export interface Csp {
13
+ disposition: 'enforce' | 'report';
14
+ }
15
+ export interface RawError {
16
+ startClocks: ClocksState;
17
+ message: string;
18
+ type?: string;
19
+ stack?: string;
20
+ source: ErrorSource;
21
+ originalError?: unknown;
22
+ handling?: ErrorHandling;
23
+ handlingStack?: string;
24
+ componentStack?: string;
25
+ causes?: RawErrorCause[];
26
+ fingerprint?: string;
27
+ csp?: Csp;
28
+ context?: Context;
29
+ }
30
+ export declare const ErrorSource: {
31
+ readonly AGENT: "agent";
32
+ readonly CONSOLE: "console";
33
+ readonly CUSTOM: "custom";
34
+ readonly LOGGER: "logger";
35
+ readonly NETWORK: "network";
36
+ readonly SOURCE: "source";
37
+ readonly REPORT: "report";
38
+ };
39
+ export declare const enum NonErrorPrefix {
40
+ UNCAUGHT = "Uncaught",
41
+ PROVIDED = "Provided"
42
+ }
43
+ export declare const enum ErrorHandling {
44
+ HANDLED = "handled",
45
+ UNHANDLED = "unhandled"
46
+ }
47
+ export type ErrorSource = (typeof ErrorSource)[keyof typeof ErrorSource];