@grafana/faro-core 2.3.0 → 2.4.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 (455) hide show
  1. package/dist/bundle/faro-core.iife.js +1 -1
  2. package/dist/bundle/types/extensions/baseExtension.d.ts +1 -1
  3. package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
  4. package/dist/bundle/types/version.d.ts +1 -1
  5. package/dist/cjs/api/ItemBuffer.js +11 -13
  6. package/dist/cjs/api/ItemBuffer.js.map +1 -1
  7. package/dist/cjs/api/events/initialize.js +12 -14
  8. package/dist/cjs/api/events/initialize.js.map +1 -1
  9. package/dist/cjs/api/exceptions/const.js +3 -3
  10. package/dist/cjs/api/exceptions/const.js.map +1 -1
  11. package/dist/cjs/api/exceptions/initialize.js +26 -39
  12. package/dist/cjs/api/exceptions/initialize.js.map +1 -1
  13. package/dist/cjs/api/initialize.js +25 -36
  14. package/dist/cjs/api/initialize.js.map +1 -1
  15. package/dist/cjs/api/logs/const.js +10 -12
  16. package/dist/cjs/api/logs/const.js.map +1 -1
  17. package/dist/cjs/api/logs/initialize.js +14 -16
  18. package/dist/cjs/api/logs/initialize.js.map +1 -1
  19. package/dist/cjs/api/measurements/initialize.js +12 -25
  20. package/dist/cjs/api/measurements/initialize.js.map +1 -1
  21. package/dist/cjs/api/meta/initialize.js +29 -41
  22. package/dist/cjs/api/meta/initialize.js.map +1 -1
  23. package/dist/cjs/api/traces/initialize.js +17 -17
  24. package/dist/cjs/api/traces/initialize.js.map +1 -1
  25. package/dist/cjs/api/userActions/initialize.js +23 -24
  26. package/dist/cjs/api/userActions/initialize.js.map +1 -1
  27. package/dist/cjs/api/userActions/userAction.js +48 -80
  28. package/dist/cjs/api/userActions/userAction.js.map +1 -1
  29. package/dist/cjs/api/utils.js +2 -2
  30. package/dist/cjs/api/utils.js.map +1 -1
  31. package/dist/cjs/extensions/baseExtension.js +17 -47
  32. package/dist/cjs/extensions/baseExtension.js.map +1 -1
  33. package/dist/cjs/initialize.js +14 -14
  34. package/dist/cjs/initialize.js.map +1 -1
  35. package/dist/cjs/instrumentations/base.js +7 -25
  36. package/dist/cjs/instrumentations/base.js.map +1 -1
  37. package/dist/cjs/instrumentations/initialize.js +14 -31
  38. package/dist/cjs/instrumentations/initialize.js.map +1 -1
  39. package/dist/cjs/instrumentations/registerInitial.js +1 -2
  40. package/dist/cjs/instrumentations/registerInitial.js.map +1 -1
  41. package/dist/cjs/internalLogger/const.js +1 -1
  42. package/dist/cjs/internalLogger/const.js.map +1 -1
  43. package/dist/cjs/internalLogger/createInternalLogger.js +13 -40
  44. package/dist/cjs/internalLogger/createInternalLogger.js.map +1 -1
  45. package/dist/cjs/internalLogger/initialize.js +2 -2
  46. package/dist/cjs/internalLogger/initialize.js.map +1 -1
  47. package/dist/cjs/metas/initialize.js +18 -26
  48. package/dist/cjs/metas/initialize.js.map +1 -1
  49. package/dist/cjs/metas/registerInitial.js +7 -28
  50. package/dist/cjs/metas/registerInitial.js.map +1 -1
  51. package/dist/cjs/sdk/faroGlobalObject.js +3 -3
  52. package/dist/cjs/sdk/faroGlobalObject.js.map +1 -1
  53. package/dist/cjs/sdk/internalFaroGlobalObject.js +2 -2
  54. package/dist/cjs/sdk/internalFaroGlobalObject.js.map +1 -1
  55. package/dist/cjs/sdk/registerFaro.js +9 -9
  56. package/dist/cjs/sdk/registerFaro.js.map +1 -1
  57. package/dist/cjs/testUtils/mockConfig.js +6 -18
  58. package/dist/cjs/testUtils/mockConfig.js.map +1 -1
  59. package/dist/cjs/testUtils/mockInternalLogger.js +1 -1
  60. package/dist/cjs/testUtils/mockInternalLogger.js.map +1 -1
  61. package/dist/cjs/testUtils/mockStacktraceParser.js +5 -5
  62. package/dist/cjs/testUtils/mockStacktraceParser.js.map +1 -1
  63. package/dist/cjs/testUtils/mockTransport.js +17 -37
  64. package/dist/cjs/testUtils/mockTransport.js.map +1 -1
  65. package/dist/cjs/testUtils/testPromise.js +3 -3
  66. package/dist/cjs/testUtils/testPromise.js.map +1 -1
  67. package/dist/cjs/transports/base.js +7 -27
  68. package/dist/cjs/transports/base.js.map +1 -1
  69. package/dist/cjs/transports/batchExecutor.js +24 -36
  70. package/dist/cjs/transports/batchExecutor.js.map +1 -1
  71. package/dist/cjs/transports/const.js +7 -8
  72. package/dist/cjs/transports/const.js.map +1 -1
  73. package/dist/cjs/transports/initialize.js +50 -79
  74. package/dist/cjs/transports/initialize.js.map +1 -1
  75. package/dist/cjs/transports/registerInitial.js +1 -2
  76. package/dist/cjs/transports/registerInitial.js.map +1 -1
  77. package/dist/cjs/transports/utils.js +13 -34
  78. package/dist/cjs/transports/utils.js.map +1 -1
  79. package/dist/cjs/unpatchedConsole/const.js +1 -12
  80. package/dist/cjs/unpatchedConsole/const.js.map +1 -1
  81. package/dist/cjs/unpatchedConsole/initialize.js +1 -1
  82. package/dist/cjs/unpatchedConsole/initialize.js.map +1 -1
  83. package/dist/cjs/utils/deepEqual.js +14 -16
  84. package/dist/cjs/utils/deepEqual.js.map +1 -1
  85. package/dist/cjs/utils/is.js +25 -29
  86. package/dist/cjs/utils/is.js.map +1 -1
  87. package/dist/cjs/utils/json.js +6 -9
  88. package/dist/cjs/utils/json.js.map +1 -1
  89. package/dist/cjs/utils/promiseBuffer.js +14 -14
  90. package/dist/cjs/utils/promiseBuffer.js.map +1 -1
  91. package/dist/cjs/utils/reactive.js +43 -50
  92. package/dist/cjs/utils/reactive.js.map +1 -1
  93. package/dist/cjs/utils/shortId.js +3 -4
  94. package/dist/cjs/utils/shortId.js.map +1 -1
  95. package/dist/cjs/utils/sourceMaps.js +2 -2
  96. package/dist/cjs/utils/sourceMaps.js.map +1 -1
  97. package/dist/cjs/version.js +1 -1
  98. package/dist/cjs/version.js.map +1 -1
  99. package/dist/esm/version.js +1 -1
  100. package/dist/esm/version.js.map +1 -1
  101. package/dist/types/extensions/baseExtension.d.ts +1 -1
  102. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  103. package/dist/types/version.d.ts +1 -1
  104. package/package.json +8 -5
  105. package/dist/spec/core/src/api/ItemBuffer.js +0 -27
  106. package/dist/spec/core/src/api/ItemBuffer.js.map +0 -1
  107. package/dist/spec/core/src/api/apiTestHelpers.js +0 -40
  108. package/dist/spec/core/src/api/apiTestHelpers.js.map +0 -1
  109. package/dist/spec/core/src/api/events/index.js +0 -6
  110. package/dist/spec/core/src/api/events/index.js.map +0 -1
  111. package/dist/spec/core/src/api/events/initialize.js +0 -54
  112. package/dist/spec/core/src/api/events/initialize.js.map +0 -1
  113. package/dist/spec/core/src/api/events/initialize.test.js +0 -171
  114. package/dist/spec/core/src/api/events/initialize.test.js.map +0 -1
  115. package/dist/spec/core/src/api/events/types.js +0 -3
  116. package/dist/spec/core/src/api/events/types.js.map +0 -1
  117. package/dist/spec/core/src/api/exceptions/const.js +0 -17
  118. package/dist/spec/core/src/api/exceptions/const.js.map +0 -1
  119. package/dist/spec/core/src/api/exceptions/index.js +0 -9
  120. package/dist/spec/core/src/api/exceptions/index.js.map +0 -1
  121. package/dist/spec/core/src/api/exceptions/initialize.js +0 -104
  122. package/dist/spec/core/src/api/exceptions/initialize.js.map +0 -1
  123. package/dist/spec/core/src/api/exceptions/initialize.test.js +0 -317
  124. package/dist/spec/core/src/api/exceptions/initialize.test.js.map +0 -1
  125. package/dist/spec/core/src/api/exceptions/types.js +0 -3
  126. package/dist/spec/core/src/api/exceptions/types.js.map +0 -1
  127. package/dist/spec/core/src/api/index.js +0 -15
  128. package/dist/spec/core/src/api/index.js.map +0 -1
  129. package/dist/spec/core/src/api/initialize.js +0 -56
  130. package/dist/spec/core/src/api/initialize.js.map +0 -1
  131. package/dist/spec/core/src/api/initialize.test.js +0 -33
  132. package/dist/spec/core/src/api/initialize.test.js.map +0 -1
  133. package/dist/spec/core/src/api/itemBuffer.test.js +0 -36
  134. package/dist/spec/core/src/api/itemBuffer.test.js.map +0 -1
  135. package/dist/spec/core/src/api/logs/const.js +0 -17
  136. package/dist/spec/core/src/api/logs/const.js.map +0 -1
  137. package/dist/spec/core/src/api/logs/index.js +0 -8
  138. package/dist/spec/core/src/api/logs/index.js.map +0 -1
  139. package/dist/spec/core/src/api/logs/initialize.js +0 -58
  140. package/dist/spec/core/src/api/logs/initialize.js.map +0 -1
  141. package/dist/spec/core/src/api/logs/initialize.test.js +0 -185
  142. package/dist/spec/core/src/api/logs/initialize.test.js.map +0 -1
  143. package/dist/spec/core/src/api/logs/types.js +0 -3
  144. package/dist/spec/core/src/api/logs/types.js.map +0 -1
  145. package/dist/spec/core/src/api/measurements/index.js +0 -6
  146. package/dist/spec/core/src/api/measurements/index.js.map +0 -1
  147. package/dist/spec/core/src/api/measurements/initialize.js +0 -60
  148. package/dist/spec/core/src/api/measurements/initialize.js.map +0 -1
  149. package/dist/spec/core/src/api/measurements/initialize.test.js +0 -244
  150. package/dist/spec/core/src/api/measurements/initialize.test.js.map +0 -1
  151. package/dist/spec/core/src/api/measurements/types.js +0 -3
  152. package/dist/spec/core/src/api/measurements/types.js.map +0 -1
  153. package/dist/spec/core/src/api/meta/index.js +0 -6
  154. package/dist/spec/core/src/api/meta/index.js.map +0 -1
  155. package/dist/spec/core/src/api/meta/initialize.js +0 -92
  156. package/dist/spec/core/src/api/meta/initialize.js.map +0 -1
  157. package/dist/spec/core/src/api/meta/initilialize.test.js +0 -135
  158. package/dist/spec/core/src/api/meta/initilialize.test.js.map +0 -1
  159. package/dist/spec/core/src/api/meta/types.js +0 -3
  160. package/dist/spec/core/src/api/meta/types.js.map +0 -1
  161. package/dist/spec/core/src/api/traces/index.js +0 -6
  162. package/dist/spec/core/src/api/traces/index.js.map +0 -1
  163. package/dist/spec/core/src/api/traces/initialize.js +0 -48
  164. package/dist/spec/core/src/api/traces/initialize.js.map +0 -1
  165. package/dist/spec/core/src/api/traces/types.js +0 -3
  166. package/dist/spec/core/src/api/traces/types.js.map +0 -1
  167. package/dist/spec/core/src/api/types.js +0 -3
  168. package/dist/spec/core/src/api/types.js.map +0 -1
  169. package/dist/spec/core/src/api/userActions/const.js +0 -11
  170. package/dist/spec/core/src/api/userActions/const.js.map +0 -1
  171. package/dist/spec/core/src/api/userActions/index.js +0 -11
  172. package/dist/spec/core/src/api/userActions/index.js.map +0 -1
  173. package/dist/spec/core/src/api/userActions/initialize.js +0 -80
  174. package/dist/spec/core/src/api/userActions/initialize.js.map +0 -1
  175. package/dist/spec/core/src/api/userActions/initialize.test.js +0 -83
  176. package/dist/spec/core/src/api/userActions/initialize.test.js.map +0 -1
  177. package/dist/spec/core/src/api/userActions/types.js +0 -11
  178. package/dist/spec/core/src/api/userActions/types.js.map +0 -1
  179. package/dist/spec/core/src/api/userActions/userAction.js +0 -126
  180. package/dist/spec/core/src/api/userActions/userAction.js.map +0 -1
  181. package/dist/spec/core/src/api/userActions/userAction.test.js +0 -85
  182. package/dist/spec/core/src/api/userActions/userAction.test.js.map +0 -1
  183. package/dist/spec/core/src/api/utils.js +0 -10
  184. package/dist/spec/core/src/api/utils.js.map +0 -1
  185. package/dist/spec/core/src/api/utils.test.js +0 -20
  186. package/dist/spec/core/src/api/utils.test.js.map +0 -1
  187. package/dist/spec/core/src/config/const.js +0 -10
  188. package/dist/spec/core/src/config/const.js.map +0 -1
  189. package/dist/spec/core/src/config/index.js +0 -7
  190. package/dist/spec/core/src/config/index.js.map +0 -1
  191. package/dist/spec/core/src/config/types.js +0 -3
  192. package/dist/spec/core/src/config/types.js.map +0 -1
  193. package/dist/spec/core/src/consts.js +0 -5
  194. package/dist/spec/core/src/consts.js.map +0 -1
  195. package/dist/spec/core/src/extensions/baseExtension.js +0 -57
  196. package/dist/spec/core/src/extensions/baseExtension.js.map +0 -1
  197. package/dist/spec/core/src/extensions/index.js +0 -6
  198. package/dist/spec/core/src/extensions/index.js.map +0 -1
  199. package/dist/spec/core/src/extensions/types.js +0 -3
  200. package/dist/spec/core/src/extensions/types.js.map +0 -1
  201. package/dist/spec/core/src/faro.test.js +0 -40
  202. package/dist/spec/core/src/faro.test.js.map +0 -1
  203. package/dist/spec/core/src/globalObject/globalObject.js +0 -12
  204. package/dist/spec/core/src/globalObject/globalObject.js.map +0 -1
  205. package/dist/spec/core/src/globalObject/index.js +0 -6
  206. package/dist/spec/core/src/globalObject/index.js.map +0 -1
  207. package/dist/spec/core/src/index.js +0 -103
  208. package/dist/spec/core/src/index.js.map +0 -1
  209. package/dist/spec/core/src/initialize.js +0 -31
  210. package/dist/spec/core/src/initialize.js.map +0 -1
  211. package/dist/spec/core/src/instrumentations/base.js +0 -31
  212. package/dist/spec/core/src/instrumentations/base.js.map +0 -1
  213. package/dist/spec/core/src/instrumentations/index.js +0 -10
  214. package/dist/spec/core/src/instrumentations/index.js.map +0 -1
  215. package/dist/spec/core/src/instrumentations/initialize.js +0 -70
  216. package/dist/spec/core/src/instrumentations/initialize.js.map +0 -1
  217. package/dist/spec/core/src/instrumentations/registerInitial.js +0 -8
  218. package/dist/spec/core/src/instrumentations/registerInitial.js.map +0 -1
  219. package/dist/spec/core/src/instrumentations/types.js +0 -3
  220. package/dist/spec/core/src/instrumentations/types.js.map +0 -1
  221. package/dist/spec/core/src/internalLogger/const.js +0 -22
  222. package/dist/spec/core/src/internalLogger/const.js.map +0 -1
  223. package/dist/spec/core/src/internalLogger/createInternalLogger.js +0 -64
  224. package/dist/spec/core/src/internalLogger/createInternalLogger.js.map +0 -1
  225. package/dist/spec/core/src/internalLogger/index.js +0 -13
  226. package/dist/spec/core/src/internalLogger/index.js.map +0 -1
  227. package/dist/spec/core/src/internalLogger/initialize.js +0 -12
  228. package/dist/spec/core/src/internalLogger/initialize.js.map +0 -1
  229. package/dist/spec/core/src/internalLogger/types.js +0 -3
  230. package/dist/spec/core/src/internalLogger/types.js.map +0 -1
  231. package/dist/spec/core/src/metas/index.js +0 -8
  232. package/dist/spec/core/src/metas/index.js.map +0 -1
  233. package/dist/spec/core/src/metas/initialize.js +0 -51
  234. package/dist/spec/core/src/metas/initialize.js.map +0 -1
  235. package/dist/spec/core/src/metas/initialize.test.js +0 -20
  236. package/dist/spec/core/src/metas/initialize.test.js.map +0 -1
  237. package/dist/spec/core/src/metas/registerInitial.js +0 -53
  238. package/dist/spec/core/src/metas/registerInitial.js.map +0 -1
  239. package/dist/spec/core/src/metas/types.js +0 -3
  240. package/dist/spec/core/src/metas/types.js.map +0 -1
  241. package/dist/spec/core/src/sdk/const.js +0 -5
  242. package/dist/spec/core/src/sdk/const.js.map +0 -1
  243. package/dist/spec/core/src/sdk/faroGlobalObject.js +0 -22
  244. package/dist/spec/core/src/sdk/faroGlobalObject.js.map +0 -1
  245. package/dist/spec/core/src/sdk/index.js +0 -13
  246. package/dist/spec/core/src/sdk/index.js.map +0 -1
  247. package/dist/spec/core/src/sdk/internalFaroGlobalObject.js +0 -28
  248. package/dist/spec/core/src/sdk/internalFaroGlobalObject.js.map +0 -1
  249. package/dist/spec/core/src/sdk/registerFaro.js +0 -25
  250. package/dist/spec/core/src/sdk/registerFaro.js.map +0 -1
  251. package/dist/spec/core/src/sdk/types.js +0 -3
  252. package/dist/spec/core/src/sdk/types.js.map +0 -1
  253. package/dist/spec/core/src/semantic.js +0 -12
  254. package/dist/spec/core/src/semantic.js.map +0 -1
  255. package/dist/spec/core/src/testUtils/index.js +0 -14
  256. package/dist/spec/core/src/testUtils/index.js.map +0 -1
  257. package/dist/spec/core/src/testUtils/mockConfig.js +0 -27
  258. package/dist/spec/core/src/testUtils/mockConfig.js.map +0 -1
  259. package/dist/spec/core/src/testUtils/mockInternalLogger.js +0 -12
  260. package/dist/spec/core/src/testUtils/mockInternalLogger.js.map +0 -1
  261. package/dist/spec/core/src/testUtils/mockStacktraceParser.js +0 -21
  262. package/dist/spec/core/src/testUtils/mockStacktraceParser.js.map +0 -1
  263. package/dist/spec/core/src/testUtils/mockTransport.js +0 -45
  264. package/dist/spec/core/src/testUtils/mockTransport.js.map +0 -1
  265. package/dist/spec/core/src/testUtils/testPromise.js +0 -14
  266. package/dist/spec/core/src/testUtils/testPromise.js.map +0 -1
  267. package/dist/spec/core/src/transports/base.js +0 -34
  268. package/dist/spec/core/src/transports/base.js.map +0 -1
  269. package/dist/spec/core/src/transports/batchExecutor.js +0 -82
  270. package/dist/spec/core/src/transports/batchExecutor.js.map +0 -1
  271. package/dist/spec/core/src/transports/batchExecutor.test.js +0 -179
  272. package/dist/spec/core/src/transports/batchExecutor.test.js.map +0 -1
  273. package/dist/spec/core/src/transports/const.js +0 -20
  274. package/dist/spec/core/src/transports/const.js.map +0 -1
  275. package/dist/spec/core/src/transports/index.js +0 -15
  276. package/dist/spec/core/src/transports/index.js.map +0 -1
  277. package/dist/spec/core/src/transports/initialize.js +0 -188
  278. package/dist/spec/core/src/transports/initialize.js.map +0 -1
  279. package/dist/spec/core/src/transports/registerInitial.js +0 -9
  280. package/dist/spec/core/src/transports/registerInitial.js.map +0 -1
  281. package/dist/spec/core/src/transports/transports.test.js +0 -258
  282. package/dist/spec/core/src/transports/transports.test.js.map +0 -1
  283. package/dist/spec/core/src/transports/types.js +0 -3
  284. package/dist/spec/core/src/transports/types.js.map +0 -1
  285. package/dist/spec/core/src/transports/utils.js +0 -73
  286. package/dist/spec/core/src/transports/utils.js.map +0 -1
  287. package/dist/spec/core/src/transports/utils.test.js +0 -216
  288. package/dist/spec/core/src/transports/utils.test.js.map +0 -1
  289. package/dist/spec/core/src/unpatchedConsole/const.js +0 -16
  290. package/dist/spec/core/src/unpatchedConsole/const.js.map +0 -1
  291. package/dist/spec/core/src/unpatchedConsole/index.js +0 -9
  292. package/dist/spec/core/src/unpatchedConsole/index.js.map +0 -1
  293. package/dist/spec/core/src/unpatchedConsole/initialize.js +0 -12
  294. package/dist/spec/core/src/unpatchedConsole/initialize.js.map +0 -1
  295. package/dist/spec/core/src/unpatchedConsole/types.js +0 -3
  296. package/dist/spec/core/src/unpatchedConsole/types.js.map +0 -1
  297. package/dist/spec/core/src/utils/baseObject.js +0 -3
  298. package/dist/spec/core/src/utils/baseObject.js.map +0 -1
  299. package/dist/spec/core/src/utils/date.js +0 -15
  300. package/dist/spec/core/src/utils/date.js.map +0 -1
  301. package/dist/spec/core/src/utils/deepEqual.js +0 -61
  302. package/dist/spec/core/src/utils/deepEqual.js.map +0 -1
  303. package/dist/spec/core/src/utils/deepEqual.test.js +0 -103
  304. package/dist/spec/core/src/utils/deepEqual.test.js.map +0 -1
  305. package/dist/spec/core/src/utils/index.js +0 -60
  306. package/dist/spec/core/src/utils/index.js.map +0 -1
  307. package/dist/spec/core/src/utils/is.js +0 -66
  308. package/dist/spec/core/src/utils/is.js.map +0 -1
  309. package/dist/spec/core/src/utils/is.test.js +0 -21
  310. package/dist/spec/core/src/utils/is.test.js.map +0 -1
  311. package/dist/spec/core/src/utils/json.js +0 -32
  312. package/dist/spec/core/src/utils/json.js.map +0 -1
  313. package/dist/spec/core/src/utils/json.test.js +0 -35
  314. package/dist/spec/core/src/utils/json.test.js.map +0 -1
  315. package/dist/spec/core/src/utils/logLevels.js +0 -22
  316. package/dist/spec/core/src/utils/logLevels.js.map +0 -1
  317. package/dist/spec/core/src/utils/noop.js +0 -5
  318. package/dist/spec/core/src/utils/noop.js.map +0 -1
  319. package/dist/spec/core/src/utils/promiseBuffer.js +0 -42
  320. package/dist/spec/core/src/utils/promiseBuffer.js.map +0 -1
  321. package/dist/spec/core/src/utils/promiseBuffer.test.js +0 -146
  322. package/dist/spec/core/src/utils/promiseBuffer.test.js.map +0 -1
  323. package/dist/spec/core/src/utils/reactive.js +0 -90
  324. package/dist/spec/core/src/utils/reactive.js.map +0 -1
  325. package/dist/spec/core/src/utils/reactive.test.js +0 -117
  326. package/dist/spec/core/src/utils/reactive.test.js.map +0 -1
  327. package/dist/spec/core/src/utils/sampling.js +0 -7
  328. package/dist/spec/core/src/utils/sampling.js.map +0 -1
  329. package/dist/spec/core/src/utils/sampling.test.js +0 -17
  330. package/dist/spec/core/src/utils/sampling.test.js.map +0 -1
  331. package/dist/spec/core/src/utils/shortId.js +0 -11
  332. package/dist/spec/core/src/utils/shortId.js.map +0 -1
  333. package/dist/spec/core/src/utils/sourceMaps.js +0 -8
  334. package/dist/spec/core/src/utils/sourceMaps.js.map +0 -1
  335. package/dist/spec/core/src/utils/sourceMaps.test.js +0 -17
  336. package/dist/spec/core/src/utils/sourceMaps.test.js.map +0 -1
  337. package/dist/spec/core/src/version.js +0 -6
  338. package/dist/spec/core/src/version.js.map +0 -1
  339. package/dist/types/core/src/api/ItemBuffer.d.ts +0 -7
  340. package/dist/types/core/src/api/apiTestHelpers.d.ts +0 -13
  341. package/dist/types/core/src/api/events/index.d.ts +0 -2
  342. package/dist/types/core/src/api/events/initialize.d.ts +0 -17
  343. package/dist/types/core/src/api/events/initialize.test.d.ts +0 -1
  344. package/dist/types/core/src/api/events/types.d.ts +0 -29
  345. package/dist/types/core/src/api/exceptions/const.d.ts +0 -2
  346. package/dist/types/core/src/api/exceptions/index.d.ts +0 -3
  347. package/dist/types/core/src/api/exceptions/initialize.d.ts +0 -17
  348. package/dist/types/core/src/api/exceptions/initialize.test.d.ts +0 -1
  349. package/dist/types/core/src/api/exceptions/types.d.ts +0 -61
  350. package/dist/types/core/src/api/index.d.ts +0 -11
  351. package/dist/types/core/src/api/initialize.d.ts +0 -7
  352. package/dist/types/core/src/api/initialize.test.d.ts +0 -1
  353. package/dist/types/core/src/api/itemBuffer.test.d.ts +0 -1
  354. package/dist/types/core/src/api/logs/const.d.ts +0 -2
  355. package/dist/types/core/src/api/logs/index.d.ts +0 -3
  356. package/dist/types/core/src/api/logs/initialize.d.ts +0 -17
  357. package/dist/types/core/src/api/logs/initialize.test.d.ts +0 -1
  358. package/dist/types/core/src/api/logs/types.d.ts +0 -24
  359. package/dist/types/core/src/api/measurements/index.d.ts +0 -2
  360. package/dist/types/core/src/api/measurements/initialize.d.ts +0 -17
  361. package/dist/types/core/src/api/measurements/initialize.test.d.ts +0 -1
  362. package/dist/types/core/src/api/measurements/types.d.ts +0 -25
  363. package/dist/types/core/src/api/meta/index.d.ts +0 -2
  364. package/dist/types/core/src/api/meta/initialize.d.ts +0 -15
  365. package/dist/types/core/src/api/meta/initilialize.test.d.ts +0 -1
  366. package/dist/types/core/src/api/meta/types.d.ts +0 -21
  367. package/dist/types/core/src/api/traces/index.d.ts +0 -2
  368. package/dist/types/core/src/api/traces/initialize.d.ts +0 -7
  369. package/dist/types/core/src/api/traces/types.d.ts +0 -20
  370. package/dist/types/core/src/api/types.d.ts +0 -14
  371. package/dist/types/core/src/api/userActions/const.d.ts +0 -8
  372. package/dist/types/core/src/api/userActions/index.d.ts +0 -4
  373. package/dist/types/core/src/api/userActions/initialize.d.ts +0 -21
  374. package/dist/types/core/src/api/userActions/initialize.test.d.ts +0 -1
  375. package/dist/types/core/src/api/userActions/types.d.ts +0 -55
  376. package/dist/types/core/src/api/userActions/userAction.d.ts +0 -36
  377. package/dist/types/core/src/api/userActions/userAction.test.d.ts +0 -1
  378. package/dist/types/core/src/api/utils.d.ts +0 -2
  379. package/dist/types/core/src/api/utils.test.d.ts +0 -1
  380. package/dist/types/core/src/config/const.d.ts +0 -6
  381. package/dist/types/core/src/config/index.d.ts +0 -2
  382. package/dist/types/core/src/config/types.d.ts +0 -237
  383. package/dist/types/core/src/consts.d.ts +0 -1
  384. package/dist/types/core/src/extensions/baseExtension.d.ts +0 -15
  385. package/dist/types/core/src/extensions/index.d.ts +0 -2
  386. package/dist/types/core/src/extensions/types.d.ts +0 -16
  387. package/dist/types/core/src/faro.test.d.ts +0 -1
  388. package/dist/types/core/src/globalObject/globalObject.d.ts +0 -6
  389. package/dist/types/core/src/globalObject/index.d.ts +0 -2
  390. package/dist/types/core/src/index.d.ts +0 -25
  391. package/dist/types/core/src/initialize.d.ts +0 -3
  392. package/dist/types/core/src/instrumentations/base.d.ts +0 -9
  393. package/dist/types/core/src/instrumentations/index.d.ts +0 -4
  394. package/dist/types/core/src/instrumentations/initialize.d.ts +0 -8
  395. package/dist/types/core/src/instrumentations/registerInitial.d.ts +0 -2
  396. package/dist/types/core/src/instrumentations/types.d.ts +0 -14
  397. package/dist/types/core/src/internalLogger/const.d.ts +0 -11
  398. package/dist/types/core/src/internalLogger/createInternalLogger.d.ts +0 -4
  399. package/dist/types/core/src/internalLogger/index.d.ts +0 -4
  400. package/dist/types/core/src/internalLogger/initialize.d.ts +0 -5
  401. package/dist/types/core/src/internalLogger/types.d.ts +0 -7
  402. package/dist/types/core/src/metas/index.d.ts +0 -3
  403. package/dist/types/core/src/metas/initialize.d.ts +0 -5
  404. package/dist/types/core/src/metas/initialize.test.d.ts +0 -1
  405. package/dist/types/core/src/metas/registerInitial.d.ts +0 -2
  406. package/dist/types/core/src/metas/types.d.ts +0 -118
  407. package/dist/types/core/src/sdk/const.d.ts +0 -1
  408. package/dist/types/core/src/sdk/faroGlobalObject.d.ts +0 -2
  409. package/dist/types/core/src/sdk/index.d.ts +0 -4
  410. package/dist/types/core/src/sdk/internalFaroGlobalObject.d.ts +0 -4
  411. package/dist/types/core/src/sdk/registerFaro.d.ts +0 -10
  412. package/dist/types/core/src/sdk/types.d.ts +0 -18
  413. package/dist/types/core/src/semantic.d.ts +0 -8
  414. package/dist/types/core/src/testUtils/index.d.ts +0 -6
  415. package/dist/types/core/src/testUtils/mockConfig.d.ts +0 -2
  416. package/dist/types/core/src/testUtils/mockInternalLogger.d.ts +0 -2
  417. package/dist/types/core/src/testUtils/mockStacktraceParser.d.ts +0 -2
  418. package/dist/types/core/src/testUtils/mockTransport.d.ts +0 -13
  419. package/dist/types/core/src/testUtils/testPromise.d.ts +0 -7
  420. package/dist/types/core/src/transports/base.d.ts +0 -8
  421. package/dist/types/core/src/transports/batchExecutor.d.ts +0 -16
  422. package/dist/types/core/src/transports/batchExecutor.test.d.ts +0 -1
  423. package/dist/types/core/src/transports/const.d.ts +0 -9
  424. package/dist/types/core/src/transports/index.d.ts +0 -6
  425. package/dist/types/core/src/transports/initialize.d.ts +0 -6
  426. package/dist/types/core/src/transports/registerInitial.d.ts +0 -2
  427. package/dist/types/core/src/transports/transports.test.d.ts +0 -1
  428. package/dist/types/core/src/transports/types.d.ts +0 -45
  429. package/dist/types/core/src/transports/utils.d.ts +0 -5
  430. package/dist/types/core/src/transports/utils.test.d.ts +0 -1
  431. package/dist/types/core/src/unpatchedConsole/const.d.ts +0 -2
  432. package/dist/types/core/src/unpatchedConsole/index.d.ts +0 -3
  433. package/dist/types/core/src/unpatchedConsole/initialize.d.ts +0 -4
  434. package/dist/types/core/src/unpatchedConsole/types.d.ts +0 -1
  435. package/dist/types/core/src/utils/baseObject.d.ts +0 -6
  436. package/dist/types/core/src/utils/date.d.ts +0 -3
  437. package/dist/types/core/src/utils/deepEqual.d.ts +0 -1
  438. package/dist/types/core/src/utils/deepEqual.test.d.ts +0 -1
  439. package/dist/types/core/src/utils/index.d.ts +0 -16
  440. package/dist/types/core/src/utils/is.d.ts +0 -32
  441. package/dist/types/core/src/utils/is.test.d.ts +0 -1
  442. package/dist/types/core/src/utils/json.d.ts +0 -3
  443. package/dist/types/core/src/utils/json.test.d.ts +0 -1
  444. package/dist/types/core/src/utils/logLevels.d.ts +0 -10
  445. package/dist/types/core/src/utils/noop.d.ts +0 -1
  446. package/dist/types/core/src/utils/promiseBuffer.d.ts +0 -14
  447. package/dist/types/core/src/utils/promiseBuffer.test.d.ts +0 -1
  448. package/dist/types/core/src/utils/reactive.d.ts +0 -17
  449. package/dist/types/core/src/utils/reactive.test.d.ts +0 -1
  450. package/dist/types/core/src/utils/sampling.d.ts +0 -1
  451. package/dist/types/core/src/utils/sampling.test.d.ts +0 -1
  452. package/dist/types/core/src/utils/shortId.d.ts +0 -1
  453. package/dist/types/core/src/utils/sourceMaps.d.ts +0 -1
  454. package/dist/types/core/src/utils/sourceMaps.test.d.ts +0 -1
  455. package/dist/types/core/src/version.d.ts +0 -1
@@ -1,123 +1,91 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
2
  Object.defineProperty(exports, "__esModule", { value: true });
29
- var transports_1 = require("../../transports");
30
- var utils_1 = require("../../utils");
31
- var ItemBuffer_1 = require("../ItemBuffer");
32
- var const_1 = require("./const");
33
- var types_1 = require("./types");
34
- var UserAction = /** @class */ (function (_super) {
35
- __extends(UserAction, _super);
36
- function UserAction(_a) {
37
- var name = _a.name, parentId = _a.parentId, trigger = _a.trigger, transports = _a.transports, attributes = _a.attributes, trackUserActionsExcludeItem = _a.trackUserActionsExcludeItem, _b = _a.importance, importance = _b === void 0 ? const_1.UserActionImportance.Normal : _b, pushEvent = _a.pushEvent;
38
- var _this = _super.call(this) || this;
39
- _this.name = name;
40
- _this.attributes = attributes;
41
- _this.id = (0, utils_1.genShortID)();
42
- _this.trigger = trigger;
43
- _this.parentId = parentId !== null && parentId !== void 0 ? parentId : _this.id;
44
- _this.trackUserActionsExcludeItem = trackUserActionsExcludeItem;
45
- _this.importance = importance;
46
- _this._pushEvent = pushEvent;
47
- _this._itemBuffer = new ItemBuffer_1.ItemBuffer();
48
- _this._transports = transports;
49
- _this._state = types_1.UserActionState.Started;
50
- _this._start();
51
- return _this;
3
+ const transports_1 = require("../../transports");
4
+ const utils_1 = require("../../utils");
5
+ const ItemBuffer_1 = require("../ItemBuffer");
6
+ const const_1 = require("./const");
7
+ const types_1 = require("./types");
8
+ class UserAction extends utils_1.Observable {
9
+ constructor({ name, parentId, trigger, transports, attributes, trackUserActionsExcludeItem, importance = const_1.UserActionImportance.Normal, pushEvent, }) {
10
+ super();
11
+ this.name = name;
12
+ this.attributes = attributes;
13
+ this.id = (0, utils_1.genShortID)();
14
+ this.trigger = trigger;
15
+ this.parentId = parentId !== null && parentId !== void 0 ? parentId : this.id;
16
+ this.trackUserActionsExcludeItem = trackUserActionsExcludeItem;
17
+ this.importance = importance;
18
+ this._pushEvent = pushEvent;
19
+ this._itemBuffer = new ItemBuffer_1.ItemBuffer();
20
+ this._transports = transports;
21
+ this._state = types_1.UserActionState.Started;
22
+ this._start();
52
23
  }
53
- UserAction.prototype.addItem = function (item) {
24
+ addItem(item) {
54
25
  if (this._state === types_1.UserActionState.Started) {
55
26
  this._itemBuffer.addItem(item);
56
27
  return true;
57
28
  }
58
29
  return false;
59
- };
60
- UserAction.prototype._start = function () {
30
+ }
31
+ _start() {
61
32
  this._state = types_1.UserActionState.Started;
62
33
  if (this._state === types_1.UserActionState.Started) {
63
34
  this.startTime = (0, utils_1.dateNow)();
64
35
  }
65
- };
66
- UserAction.prototype.halt = function () {
36
+ }
37
+ halt() {
67
38
  if (this._state !== types_1.UserActionState.Started) {
68
39
  return;
69
40
  }
70
41
  this._state = types_1.UserActionState.Halted;
71
42
  this.notify(this._state);
72
- };
73
- UserAction.prototype.cancel = function () {
74
- var _this = this;
43
+ }
44
+ cancel() {
75
45
  if (this._state === types_1.UserActionState.Started) {
76
46
  // Empty the buffer
77
- this._itemBuffer.flushBuffer(function (item) {
78
- _this._transports.execute(item);
47
+ this._itemBuffer.flushBuffer((item) => {
48
+ this._transports.execute(item);
79
49
  });
80
50
  }
81
51
  this._state = types_1.UserActionState.Cancelled;
82
52
  this.notify(this._state);
83
- };
84
- UserAction.prototype.end = function () {
85
- var _this = this;
53
+ }
54
+ end() {
86
55
  if (this._state === types_1.UserActionState.Cancelled) {
87
56
  return;
88
57
  }
89
- var endTime = (0, utils_1.dateNow)();
90
- var duration = endTime - this.startTime;
58
+ const endTime = (0, utils_1.dateNow)();
59
+ const duration = endTime - this.startTime;
91
60
  this._state = types_1.UserActionState.Ended;
92
- this._itemBuffer.flushBuffer(function (item) {
93
- if (isExcludeFromUserAction(item, _this.trackUserActionsExcludeItem)) {
94
- _this._transports.execute(item);
61
+ this._itemBuffer.flushBuffer((item) => {
62
+ if (isExcludeFromUserAction(item, this.trackUserActionsExcludeItem)) {
63
+ this._transports.execute(item);
95
64
  return;
96
65
  }
97
- var userActionItem = __assign(__assign({}, item), { payload: __assign(__assign({}, item.payload), { action: {
98
- parentId: _this.id,
99
- name: _this.name,
66
+ const userActionItem = Object.assign(Object.assign({}, item), { payload: Object.assign(Object.assign({}, item.payload), { action: {
67
+ parentId: this.id,
68
+ name: this.name,
100
69
  } }) });
101
- _this._transports.execute(userActionItem);
70
+ this._transports.execute(userActionItem);
102
71
  });
103
72
  this._state = types_1.UserActionState.Ended;
104
73
  this.notify(this._state);
105
- this._pushEvent(const_1.userActionEventName, __assign({ userActionName: this.name, userActionStartTime: this.startTime.toString(), userActionEndTime: endTime.toString(), userActionDuration: duration.toString(), userActionTrigger: this.trigger, userActionImportance: this.importance }, (0, utils_1.stringifyObjectValues)(this.attributes)), undefined, {
74
+ this._pushEvent(const_1.userActionEventName, Object.assign({ userActionName: this.name, userActionStartTime: this.startTime.toString(), userActionEndTime: endTime.toString(), userActionDuration: duration.toString(), userActionTrigger: this.trigger, userActionImportance: this.importance }, (0, utils_1.stringifyObjectValues)(this.attributes)), undefined, {
106
75
  timestampOverwriteMs: this.startTime,
107
- customPayloadTransformer: function (payload) {
76
+ customPayloadTransformer: (payload) => {
108
77
  payload.action = {
109
- id: _this.id,
110
- name: _this.name,
78
+ id: this.id,
79
+ name: this.name,
111
80
  };
112
81
  return payload;
113
82
  },
114
83
  });
115
- };
116
- UserAction.prototype.getState = function () {
84
+ }
85
+ getState() {
117
86
  return this._state;
118
- };
119
- return UserAction;
120
- }(utils_1.Observable));
87
+ }
88
+ }
121
89
  exports.default = UserAction;
122
90
  function isExcludeFromUserAction(item, trackUserActionsExcludeItem) {
123
91
  return ((trackUserActionsExcludeItem === null || trackUserActionsExcludeItem === void 0 ? void 0 : trackUserActionsExcludeItem(item)) ||
@@ -1 +1 @@
1
- {"version":3,"file":"userAction.js","sourceRoot":"","sources":["../../../../src/api/userActions/userAction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0F;AAC1F,qCAAqF;AAErF,4CAA2C;AAI3C,iCAAmG;AACnG,iCAAgH;AAEhH;IACU,8BAAU;IAiBlB,oBAAY,EAkBX;YAjBC,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,2BAA2B,iCAAA,EAC3B,kBAAwC,EAAxC,UAAU,mBAAG,4BAAoB,CAAC,MAAM,KAAA,EACxC,SAAS,eAAA;QAWT,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;QACvB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,KAAI,CAAC,EAAE,CAAC;QACpC,KAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;QAC/D,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,KAAI,CAAC,WAAW,GAAG,IAAI,uBAAU,EAAiB,CAAC;QACnD,KAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,KAAI,CAAC,MAAM,GAAG,uBAAe,CAAC,OAAO,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,OAAO;gBAChC,OAAO,CAAC,MAAM,GAAG;oBACf,EAAE,EAAE,KAAI,CAAC,EAAE;oBACX,IAAI,EAAE,KAAI,CAAC,IAAI;iBAChB,CAAC;gBAEF,OAAO,OAAO,CAAC;YACjB,CAAC;SACF,CACF,CAAC;IACJ,CAAC;IAED,6BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACH,iBAAC;AAAD,CAAC,AApJD,CACU,kBAAU,GAmJnB;;AAED,SAAS,uBAAuB,CAC9B,IAA6B,EAC7B,2BAAqF;IAErF,OAAO,CACL,CAAA,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAG,IAAI,CAAC;QACnC,CAAC,IAAI,CAAC,IAAI,KAAK,8BAAiB,CAAC,WAAW,IAAK,IAAI,CAAC,OAA4B,CAAC,IAAI,KAAK,YAAY,CAAC,CAC1G,CAAC;AACJ,CAAC","sourcesContent":["import { type TransportItem, TransportItemType, type Transports } from '../../transports';\nimport { dateNow, genShortID, Observable, stringifyObjectValues } from '../../utils';\nimport type { EventsAPI } from '../events/types';\nimport { ItemBuffer } from '../ItemBuffer';\nimport { type MeasurementEvent } from '../measurements/types';\nimport { type APIEvent } from '../types';\n\nimport { userActionEventName, UserActionImportance, type UserActionImportanceType } from './const';\nimport { type UserActionInternalInterface, UserActionState, type UserActionTransportItemBuffer } from './types';\n\nexport default class UserAction\n extends Observable\n implements UserActionInternalInterface, UserActionTransportItemBuffer\n{\n name: string;\n id: string;\n attributes?: Record<string, string>;\n parentId: string;\n trigger: string;\n importance: UserActionImportanceType;\n startTime?: number;\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n\n private _state: UserActionState;\n private _itemBuffer: ItemBuffer<TransportItem>;\n private _transports: Transports;\n private _pushEvent: EventsAPI['pushEvent'];\n\n constructor({\n name,\n parentId,\n trigger,\n transports,\n attributes,\n trackUserActionsExcludeItem,\n importance = UserActionImportance.Normal,\n pushEvent,\n }: {\n name: string;\n transports: Transports;\n parentId?: string;\n trigger: string;\n attributes?: Record<string, string>;\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n importance?: UserActionImportanceType;\n pushEvent: EventsAPI['pushEvent'];\n }) {\n super();\n this.name = name;\n this.attributes = attributes;\n this.id = genShortID();\n this.trigger = trigger;\n this.parentId = parentId ?? this.id;\n this.trackUserActionsExcludeItem = trackUserActionsExcludeItem;\n this.importance = importance;\n this._pushEvent = pushEvent;\n\n this._itemBuffer = new ItemBuffer<TransportItem>();\n this._transports = transports;\n this._state = UserActionState.Started;\n this._start();\n }\n\n addItem(item: TransportItem): boolean {\n if (this._state === UserActionState.Started) {\n this._itemBuffer.addItem(item);\n return true;\n }\n return false;\n }\n\n private _start(): void {\n this._state = UserActionState.Started;\n if (this._state === UserActionState.Started) {\n this.startTime = dateNow();\n }\n }\n\n halt() {\n if (this._state !== UserActionState.Started) {\n return;\n }\n this._state = UserActionState.Halted;\n this.notify(this._state);\n }\n\n cancel() {\n if (this._state === UserActionState.Started) {\n // Empty the buffer\n this._itemBuffer.flushBuffer((item) => {\n this._transports.execute(item);\n });\n }\n\n this._state = UserActionState.Cancelled;\n this.notify(this._state);\n }\n\n end() {\n if (this._state === UserActionState.Cancelled) {\n return;\n }\n\n const endTime = dateNow();\n const duration = endTime - this.startTime!;\n this._state = UserActionState.Ended;\n this._itemBuffer.flushBuffer((item) => {\n if (isExcludeFromUserAction(item, this.trackUserActionsExcludeItem)) {\n this._transports.execute(item);\n return;\n }\n\n const userActionItem = {\n ...item,\n payload: {\n ...item.payload,\n action: {\n parentId: this.id,\n name: this.name,\n },\n },\n } as TransportItem;\n\n this._transports.execute(userActionItem);\n });\n\n this._state = UserActionState.Ended;\n this.notify(this._state);\n\n this._pushEvent(\n userActionEventName,\n {\n userActionName: this.name,\n userActionStartTime: this.startTime!.toString(),\n userActionEndTime: endTime.toString(),\n userActionDuration: duration.toString(),\n userActionTrigger: this.trigger!,\n userActionImportance: this.importance,\n ...stringifyObjectValues(this.attributes),\n },\n undefined,\n {\n timestampOverwriteMs: this.startTime,\n customPayloadTransformer: (payload) => {\n payload.action = {\n id: this.id,\n name: this.name,\n };\n\n return payload;\n },\n }\n );\n }\n\n getState(): UserActionState {\n return this._state;\n }\n}\n\nfunction isExcludeFromUserAction(\n item: TransportItem<APIEvent>,\n trackUserActionsExcludeItem: ((item: TransportItem<APIEvent>) => boolean) | undefined\n) {\n return (\n trackUserActionsExcludeItem?.(item) ||\n (item.type === TransportItemType.MEASUREMENT && (item.payload as MeasurementEvent).type === 'web-vitals')\n );\n}\n"]}
1
+ {"version":3,"file":"userAction.js","sourceRoot":"","sources":["../../../../src/api/userActions/userAction.ts"],"names":[],"mappings":";;AAAA,iDAA0F;AAC1F,uCAAqF;AAErF,8CAA2C;AAI3C,mCAAmG;AACnG,mCAAgH;AAEhH,MAAqB,UACnB,SAAQ,kBAAU;IAiBlB,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,UAAU,GAAG,4BAAoB,CAAC,MAAM,EACxC,SAAS,GAUV;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,IAAA,kBAAU,GAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAU,EAAiB,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,UAAU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AwB,EAAE,CAAC,OAAO,EAAE,EAAE;gBACpC,OAAO,CAAC,MAAM,GAAG;oBACf,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,IAAI,EAAE,IAAI,CAAC,IAAI;iBAChB,CAAC;gBAEF,OAAO,OAAO,CAAC;YACjB,CAAC;SACF,CACF,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AApJD,6BAoJC;AAED,SAAS,uBAAuB,CAC9B,IAA6B,EAC7B,2BAAqF;IAErF,OAAO,CACL,CAAA,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAG,IAAI,CAAC;QACnC,CAAC,IAAI,CAAC,IAAI,KAAK,8BAAiB,CAAC,WAAW,IAAK,IAAI,CAAC,OAA4B,CAAC,IAAI,KAAK,YAAY,CAAC,CAC1G,CAAC;AACJ,CAAC","sourcesContent":["import { type TransportItem, TransportItemType, type Transports } from '../../transports';\nimport { dateNow, genShortID, Observable, stringifyObjectValues } from '../../utils';\nimport type { EventsAPI } from '../events/types';\nimport { ItemBuffer } from '../ItemBuffer';\nimport { type MeasurementEvent } from '../measurements/types';\nimport { type APIEvent } from '../types';\n\nimport { userActionEventName, UserActionImportance, type UserActionImportanceType } from './const';\nimport { type UserActionInternalInterface, UserActionState, type UserActionTransportItemBuffer } from './types';\n\nexport default class UserAction\n extends Observable\n implements UserActionInternalInterface, UserActionTransportItemBuffer\n{\n name: string;\n id: string;\n attributes?: Record<string, string>;\n parentId: string;\n trigger: string;\n importance: UserActionImportanceType;\n startTime?: number;\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n\n private _state: UserActionState;\n private _itemBuffer: ItemBuffer<TransportItem>;\n private _transports: Transports;\n private _pushEvent: EventsAPI['pushEvent'];\n\n constructor({\n name,\n parentId,\n trigger,\n transports,\n attributes,\n trackUserActionsExcludeItem,\n importance = UserActionImportance.Normal,\n pushEvent,\n }: {\n name: string;\n transports: Transports;\n parentId?: string;\n trigger: string;\n attributes?: Record<string, string>;\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n importance?: UserActionImportanceType;\n pushEvent: EventsAPI['pushEvent'];\n }) {\n super();\n this.name = name;\n this.attributes = attributes;\n this.id = genShortID();\n this.trigger = trigger;\n this.parentId = parentId ?? this.id;\n this.trackUserActionsExcludeItem = trackUserActionsExcludeItem;\n this.importance = importance;\n this._pushEvent = pushEvent;\n\n this._itemBuffer = new ItemBuffer<TransportItem>();\n this._transports = transports;\n this._state = UserActionState.Started;\n this._start();\n }\n\n addItem(item: TransportItem): boolean {\n if (this._state === UserActionState.Started) {\n this._itemBuffer.addItem(item);\n return true;\n }\n return false;\n }\n\n private _start(): void {\n this._state = UserActionState.Started;\n if (this._state === UserActionState.Started) {\n this.startTime = dateNow();\n }\n }\n\n halt() {\n if (this._state !== UserActionState.Started) {\n return;\n }\n this._state = UserActionState.Halted;\n this.notify(this._state);\n }\n\n cancel() {\n if (this._state === UserActionState.Started) {\n // Empty the buffer\n this._itemBuffer.flushBuffer((item) => {\n this._transports.execute(item);\n });\n }\n\n this._state = UserActionState.Cancelled;\n this.notify(this._state);\n }\n\n end() {\n if (this._state === UserActionState.Cancelled) {\n return;\n }\n\n const endTime = dateNow();\n const duration = endTime - this.startTime!;\n this._state = UserActionState.Ended;\n this._itemBuffer.flushBuffer((item) => {\n if (isExcludeFromUserAction(item, this.trackUserActionsExcludeItem)) {\n this._transports.execute(item);\n return;\n }\n\n const userActionItem = {\n ...item,\n payload: {\n ...item.payload,\n action: {\n parentId: this.id,\n name: this.name,\n },\n },\n } as TransportItem;\n\n this._transports.execute(userActionItem);\n });\n\n this._state = UserActionState.Ended;\n this.notify(this._state);\n\n this._pushEvent(\n userActionEventName,\n {\n userActionName: this.name,\n userActionStartTime: this.startTime!.toString(),\n userActionEndTime: endTime.toString(),\n userActionDuration: duration.toString(),\n userActionTrigger: this.trigger!,\n userActionImportance: this.importance,\n ...stringifyObjectValues(this.attributes),\n },\n undefined,\n {\n timestampOverwriteMs: this.startTime,\n customPayloadTransformer: (payload) => {\n payload.action = {\n id: this.id,\n name: this.name,\n };\n\n return payload;\n },\n }\n );\n }\n\n getState(): UserActionState {\n return this._state;\n }\n}\n\nfunction isExcludeFromUserAction(\n item: TransportItem<APIEvent>,\n trackUserActionsExcludeItem: ((item: TransportItem<APIEvent>) => boolean) | undefined\n) {\n return (\n trackUserActionsExcludeItem?.(item) ||\n (item.type === TransportItemType.MEASUREMENT && (item.payload as MeasurementEvent).type === 'web-vitals')\n );\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shouldIgnoreEvent = shouldIgnoreEvent;
4
- var is_1 = require("../utils/is");
4
+ const is_1 = require("../utils/is");
5
5
  function shouldIgnoreEvent(patterns, msg) {
6
- return patterns.some(function (pattern) {
6
+ return patterns.some((pattern) => {
7
7
  return (0, is_1.isString)(pattern) ? msg.includes(pattern) : !!msg.match(pattern);
8
8
  });
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/api/utils.ts"],"names":[],"mappings":";;AAGA,8CAIC;AAND,kCAAuC;AAEvC,SAAgB,iBAAiB,CAAC,QAAkB,EAAE,GAAW;IAC/D,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAC,OAAO;QAC3B,OAAO,IAAA,aAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Patterns } from '../config/types';\nimport { isString } from '../utils/is';\n\nexport function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean {\n return patterns.some((pattern) => {\n return isString(pattern) ? msg.includes(pattern) : !!msg.match(pattern);\n });\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/api/utils.ts"],"names":[],"mappings":";;AAGA,8CAIC;AAND,oCAAuC;AAEvC,SAAgB,iBAAiB,CAAC,QAAkB,EAAE,GAAW;IAC/D,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/B,OAAO,IAAA,aAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Patterns } from '../config/types';\nimport { isString } from '../utils/is';\n\nexport function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean {\n return patterns.some((pattern) => {\n return isString(pattern) ? msg.includes(pattern) : !!msg.match(pattern);\n });\n}\n"]}
@@ -1,57 +1,27 @@
1
1
  "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.BaseExtension = void 0;
13
- var internalLogger_1 = require("../internalLogger");
14
- var unpatchedConsole_1 = require("../unpatchedConsole");
15
- var BaseExtension = /** @class */ (function () {
16
- function BaseExtension() {
4
+ const internalLogger_1 = require("../internalLogger");
5
+ const unpatchedConsole_1 = require("../unpatchedConsole");
6
+ class BaseExtension {
7
+ constructor() {
17
8
  this.unpatchedConsole = unpatchedConsole_1.defaultUnpatchedConsole;
18
9
  this.internalLogger = internalLogger_1.defaultInternalLogger;
19
10
  this.config = {};
20
11
  this.metas = {};
21
12
  }
22
- BaseExtension.prototype.logDebug = function () {
23
- var _a;
24
- var args = [];
25
- for (var _i = 0; _i < arguments.length; _i++) {
26
- args[_i] = arguments[_i];
27
- }
28
- (_a = this.internalLogger).debug.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
29
- };
30
- BaseExtension.prototype.logInfo = function () {
31
- var _a;
32
- var args = [];
33
- for (var _i = 0; _i < arguments.length; _i++) {
34
- args[_i] = arguments[_i];
35
- }
36
- (_a = this.internalLogger).info.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
37
- };
38
- BaseExtension.prototype.logWarn = function () {
39
- var _a;
40
- var args = [];
41
- for (var _i = 0; _i < arguments.length; _i++) {
42
- args[_i] = arguments[_i];
43
- }
44
- (_a = this.internalLogger).warn.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
45
- };
46
- BaseExtension.prototype.logError = function () {
47
- var _a;
48
- var args = [];
49
- for (var _i = 0; _i < arguments.length; _i++) {
50
- args[_i] = arguments[_i];
51
- }
52
- (_a = this.internalLogger).error.apply(_a, __spreadArray(["".concat(this.name, "\n")], args, false));
53
- };
54
- return BaseExtension;
55
- }());
13
+ logDebug(...args) {
14
+ this.internalLogger.debug(`${this.name}\n`, ...args);
15
+ }
16
+ logInfo(...args) {
17
+ this.internalLogger.info(`${this.name}\n`, ...args);
18
+ }
19
+ logWarn(...args) {
20
+ this.internalLogger.warn(`${this.name}\n`, ...args);
21
+ }
22
+ logError(...args) {
23
+ this.internalLogger.error(`${this.name}\n`, ...args);
24
+ }
25
+ }
56
26
  exports.BaseExtension = BaseExtension;
57
27
  //# sourceMappingURL=baseExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseExtension.js","sourceRoot":"","sources":["../../../src/extensions/baseExtension.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oDAA0D;AAE1D,wDAA8D;AAI9D;IAAA;QAIE,qBAAgB,GAAG,0CAAuB,CAAC;QAC3C,mBAAc,GAAG,sCAAqB,CAAC;QACvC,WAAM,GAAG,EAAY,CAAC;QACtB,UAAK,GAAG,EAAW,CAAC;IAiBtB,CAAC;IAfC,gCAAQ,GAAR;;QAAS,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACzB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,KAAK,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACvD,CAAC;IAED,+BAAO,GAAP;;QAAQ,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACxB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,IAAI,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACtD,CAAC;IAED,+BAAO,GAAP;;QAAQ,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACxB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,IAAI,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACtD,CAAC;IAED,gCAAQ,GAAR;;QAAS,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACzB,CAAA,KAAA,IAAI,CAAC,cAAc,CAAA,CAAC,KAAK,0BAAC,UAAG,IAAI,CAAC,IAAI,OAAI,GAAK,IAAI,UAAE;IACvD,CAAC;IACH,oBAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBqB,sCAAa","sourcesContent":["import type { Config } from '../config';\nimport { defaultInternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport { defaultUnpatchedConsole } from '../unpatchedConsole';\n\nimport type { Extension } from './types';\n\nexport abstract class BaseExtension implements Extension {\n abstract readonly name: string;\n abstract readonly version: string;\n\n unpatchedConsole = defaultUnpatchedConsole;\n internalLogger = defaultInternalLogger;\n config = {} as Config;\n metas = {} as Metas;\n\n logDebug(...args: unknown[]): void {\n this.internalLogger.debug(`${this.name}\\n`, ...args);\n }\n\n logInfo(...args: unknown[]): void {\n this.internalLogger.info(`${this.name}\\n`, ...args);\n }\n\n logWarn(...args: unknown[]): void {\n this.internalLogger.warn(`${this.name}\\n`, ...args);\n }\n\n logError(...args: unknown[]): void {\n this.internalLogger.error(`${this.name}\\n`, ...args);\n }\n}\n"]}
1
+ {"version":3,"file":"baseExtension.js","sourceRoot":"","sources":["../../../src/extensions/baseExtension.ts"],"names":[],"mappings":";;;AACA,sDAA0D;AAE1D,0DAA8D;AAI9D,MAAsB,aAAa;IAAnC;QAIE,qBAAgB,GAAG,0CAAuB,CAAC;QAC3C,mBAAc,GAAG,sCAAqB,CAAC;QACvC,WAAM,GAAG,EAAY,CAAC;QACtB,UAAK,GAAG,EAAW,CAAC;IAiBtB,CAAC;IAfC,QAAQ,CAAC,GAAG,IAAe;QACzB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CAAC,GAAG,IAAe;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,GAAG,IAAe;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ,CAAC,GAAG,IAAe;QACzB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACvD,CAAC;CACF;AAxBD,sCAwBC","sourcesContent":["import type { Config } from '../config';\nimport { defaultInternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport { defaultUnpatchedConsole } from '../unpatchedConsole';\n\nimport type { Extension } from './types';\n\nexport abstract class BaseExtension implements Extension {\n abstract readonly name: string;\n abstract readonly version: string;\n\n unpatchedConsole = defaultUnpatchedConsole;\n internalLogger = defaultInternalLogger;\n config = {} as Config;\n metas = {} as Metas;\n\n logDebug(...args: unknown[]): void {\n this.internalLogger.debug(`${this.name}\\n`, ...args);\n }\n\n logInfo(...args: unknown[]): void {\n this.internalLogger.info(`${this.name}\\n`, ...args);\n }\n\n logWarn(...args: unknown[]): void {\n this.internalLogger.warn(`${this.name}\\n`, ...args);\n }\n\n logError(...args: unknown[]): void {\n this.internalLogger.error(`${this.name}\\n`, ...args);\n }\n}\n"]}
@@ -1,27 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initializeFaro = initializeFaro;
4
- var api_1 = require("./api");
5
- var instrumentations_1 = require("./instrumentations");
6
- var internalLogger_1 = require("./internalLogger");
7
- var metas_1 = require("./metas");
8
- var sdk_1 = require("./sdk");
9
- var transports_1 = require("./transports");
10
- var unpatchedConsole_1 = require("./unpatchedConsole");
4
+ const api_1 = require("./api");
5
+ const instrumentations_1 = require("./instrumentations");
6
+ const internalLogger_1 = require("./internalLogger");
7
+ const metas_1 = require("./metas");
8
+ const sdk_1 = require("./sdk");
9
+ const transports_1 = require("./transports");
10
+ const unpatchedConsole_1 = require("./unpatchedConsole");
11
11
  function initializeFaro(config) {
12
- var unpatchedConsole = (0, unpatchedConsole_1.initializeUnpatchedConsole)(config);
13
- var internalLogger = (0, internalLogger_1.initializeInternalLogger)(unpatchedConsole, config);
12
+ const unpatchedConsole = (0, unpatchedConsole_1.initializeUnpatchedConsole)(config);
13
+ const internalLogger = (0, internalLogger_1.initializeInternalLogger)(unpatchedConsole, config);
14
14
  if ((0, sdk_1.isInternalFaroOnGlobalObject)() && !config.isolate) {
15
15
  internalLogger.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');
16
16
  return undefined;
17
17
  }
18
18
  internalLogger.debug('Initializing');
19
19
  // Initializing the APIs
20
- var metas = (0, metas_1.initializeMetas)(unpatchedConsole, internalLogger, config);
21
- var transports = (0, transports_1.initializeTransports)(unpatchedConsole, internalLogger, config, metas);
22
- var api = (0, api_1.initializeAPI)(unpatchedConsole, internalLogger, config, metas, transports);
23
- var instrumentations = (0, instrumentations_1.initializeInstrumentations)(unpatchedConsole, internalLogger, config, metas, transports, api);
24
- var faro = (0, sdk_1.registerFaro)(unpatchedConsole, internalLogger, config, metas, transports, api, instrumentations);
20
+ const metas = (0, metas_1.initializeMetas)(unpatchedConsole, internalLogger, config);
21
+ const transports = (0, transports_1.initializeTransports)(unpatchedConsole, internalLogger, config, metas);
22
+ const api = (0, api_1.initializeAPI)(unpatchedConsole, internalLogger, config, metas, transports);
23
+ const instrumentations = (0, instrumentations_1.initializeInstrumentations)(unpatchedConsole, internalLogger, config, metas, transports, api);
24
+ const faro = (0, sdk_1.registerFaro)(unpatchedConsole, internalLogger, config, metas, transports, api, instrumentations);
25
25
  // make sure Faro is initialized before registering default metas, instrumentations, transports etc.
26
26
  (0, metas_1.registerInitialMetas)(faro);
27
27
  (0, transports_1.registerInitialTransports)(faro);
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../src/initialize.ts"],"names":[],"mappings":";;AAUA,wCA2BC;AArCD,6BAAsC;AAEtC,uDAAiG;AACjG,mDAA4D;AAC5D,iCAAgE;AAChE,6BAAmE;AAEnE,2CAA+E;AAC/E,uDAAgE;AAEhE,SAAgB,cAAc,CAAC,MAAc;IAC3C,IAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,MAAM,CAAC,CAAC;IAC5D,IAAM,cAAc,GAAG,IAAA,yCAAwB,EAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAE1E,IAAI,IAAA,kCAA4B,GAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtD,cAAc,CAAC,KAAK,CAClB,oIAAoI,CACrI,CAAC;QAEF,OAAO,SAAU,CAAC;IACpB,CAAC;IAED,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAErC,wBAAwB;IACxB,IAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;IACxE,IAAM,UAAU,GAAG,IAAA,iCAAoB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACzF,IAAM,GAAG,GAAG,IAAA,mBAAa,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACvF,IAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtH,IAAM,IAAI,GAAG,IAAA,kBAAY,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAE9G,oGAAoG;IACpG,IAAA,4BAAoB,EAAC,IAAI,CAAC,CAAC;IAC3B,IAAA,sCAAyB,EAAC,IAAI,CAAC,CAAC;IAChC,IAAA,kDAA+B,EAAC,IAAI,CAAC,CAAC;IAEtC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { initializeAPI } from './api';\nimport type { Config } from './config';\nimport { initializeInstrumentations, registerInitialInstrumentations } from './instrumentations';\nimport { initializeInternalLogger } from './internalLogger';\nimport { initializeMetas, registerInitialMetas } from './metas';\nimport { isInternalFaroOnGlobalObject, registerFaro } from './sdk';\nimport type { Faro } from './sdk';\nimport { initializeTransports, registerInitialTransports } from './transports';\nimport { initializeUnpatchedConsole } from './unpatchedConsole';\n\nexport function initializeFaro(config: Config): Faro {\n const unpatchedConsole = initializeUnpatchedConsole(config);\n const internalLogger = initializeInternalLogger(unpatchedConsole, config);\n\n if (isInternalFaroOnGlobalObject() && !config.isolate) {\n internalLogger.error(\n 'Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the \"isolate\" property'\n );\n\n return undefined!;\n }\n\n internalLogger.debug('Initializing');\n\n // Initializing the APIs\n const metas = initializeMetas(unpatchedConsole, internalLogger, config);\n const transports = initializeTransports(unpatchedConsole, internalLogger, config, metas);\n const api = initializeAPI(unpatchedConsole, internalLogger, config, metas, transports);\n const instrumentations = initializeInstrumentations(unpatchedConsole, internalLogger, config, metas, transports, api);\n const faro = registerFaro(unpatchedConsole, internalLogger, config, metas, transports, api, instrumentations);\n\n // make sure Faro is initialized before registering default metas, instrumentations, transports etc.\n registerInitialMetas(faro);\n registerInitialTransports(faro);\n registerInitialInstrumentations(faro);\n\n return faro;\n}\n"]}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../src/initialize.ts"],"names":[],"mappings":";;AAUA,wCA2BC;AArCD,+BAAsC;AAEtC,yDAAiG;AACjG,qDAA4D;AAC5D,mCAAgE;AAChE,+BAAmE;AAEnE,6CAA+E;AAC/E,yDAAgE;AAEhE,SAAgB,cAAc,CAAC,MAAc;IAC3C,MAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,MAAM,CAAC,CAAC;IAC5D,MAAM,cAAc,GAAG,IAAA,yCAAwB,EAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAE1E,IAAI,IAAA,kCAA4B,GAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtD,cAAc,CAAC,KAAK,CAClB,oIAAoI,CACrI,CAAC;QAEF,OAAO,SAAU,CAAC;IACpB,CAAC;IAED,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAErC,wBAAwB;IACxB,MAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;IACxE,MAAM,UAAU,GAAG,IAAA,iCAAoB,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACzF,MAAM,GAAG,GAAG,IAAA,mBAAa,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACvF,MAAM,gBAAgB,GAAG,IAAA,6CAA0B,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtH,MAAM,IAAI,GAAG,IAAA,kBAAY,EAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAE9G,oGAAoG;IACpG,IAAA,4BAAoB,EAAC,IAAI,CAAC,CAAC;IAC3B,IAAA,sCAAyB,EAAC,IAAI,CAAC,CAAC;IAChC,IAAA,kDAA+B,EAAC,IAAI,CAAC,CAAC;IAEtC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { initializeAPI } from './api';\nimport type { Config } from './config';\nimport { initializeInstrumentations, registerInitialInstrumentations } from './instrumentations';\nimport { initializeInternalLogger } from './internalLogger';\nimport { initializeMetas, registerInitialMetas } from './metas';\nimport { isInternalFaroOnGlobalObject, registerFaro } from './sdk';\nimport type { Faro } from './sdk';\nimport { initializeTransports, registerInitialTransports } from './transports';\nimport { initializeUnpatchedConsole } from './unpatchedConsole';\n\nexport function initializeFaro(config: Config): Faro {\n const unpatchedConsole = initializeUnpatchedConsole(config);\n const internalLogger = initializeInternalLogger(unpatchedConsole, config);\n\n if (isInternalFaroOnGlobalObject() && !config.isolate) {\n internalLogger.error(\n 'Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the \"isolate\" property'\n );\n\n return undefined!;\n }\n\n internalLogger.debug('Initializing');\n\n // Initializing the APIs\n const metas = initializeMetas(unpatchedConsole, internalLogger, config);\n const transports = initializeTransports(unpatchedConsole, internalLogger, config, metas);\n const api = initializeAPI(unpatchedConsole, internalLogger, config, metas, transports);\n const instrumentations = initializeInstrumentations(unpatchedConsole, internalLogger, config, metas, transports, api);\n const faro = registerFaro(unpatchedConsole, internalLogger, config, metas, transports, api, instrumentations);\n\n // make sure Faro is initialized before registering default metas, instrumentations, transports etc.\n registerInitialMetas(faro);\n registerInitialTransports(faro);\n registerInitialInstrumentations(faro);\n\n return faro;\n}\n"]}
@@ -1,31 +1,13 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.BaseInstrumentation = void 0;
19
- var extensions_1 = require("../extensions");
20
- var BaseInstrumentation = /** @class */ (function (_super) {
21
- __extends(BaseInstrumentation, _super);
22
- function BaseInstrumentation() {
23
- var _this = _super !== null && _super.apply(this, arguments) || this;
24
- _this.api = {};
25
- _this.transports = {};
26
- return _this;
4
+ const extensions_1 = require("../extensions");
5
+ class BaseInstrumentation extends extensions_1.BaseExtension {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.api = {};
9
+ this.transports = {};
27
10
  }
28
- return BaseInstrumentation;
29
- }(extensions_1.BaseExtension));
11
+ }
30
12
  exports.BaseInstrumentation = BaseInstrumentation;
31
13
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/instrumentations/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAA8C;AAK9C;IAAkD,uCAAa;IAA/D;;QACE,SAAG,GAAQ,EAAS,CAAC;QACrB,gBAAU,GAAe,EAAgB,CAAC;;IAG5C,CAAC;IAAD,0BAAC;AAAD,CAAC,AALD,CAAkD,0BAAa,GAK9D;AALqB,kDAAmB","sourcesContent":["import type { API } from '../api';\nimport { BaseExtension } from '../extensions';\nimport type { Transports } from '../transports';\n\nimport type { Instrumentation } from './types';\n\nexport abstract class BaseInstrumentation extends BaseExtension implements Instrumentation {\n api: API = {} as API;\n transports: Transports = {} as Transports;\n\n abstract initialize(): void;\n}\n"]}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/instrumentations/base.ts"],"names":[],"mappings":";;;AACA,8CAA8C;AAK9C,MAAsB,mBAAoB,SAAQ,0BAAa;IAA/D;;QACE,QAAG,GAAQ,EAAS,CAAC;QACrB,eAAU,GAAe,EAAgB,CAAC;IAG5C,CAAC;CAAA;AALD,kDAKC","sourcesContent":["import type { API } from '../api';\nimport { BaseExtension } from '../extensions';\nimport type { Transports } from '../transports';\n\nimport type { Instrumentation } from './types';\n\nexport abstract class BaseInstrumentation extends BaseExtension implements Instrumentation {\n api: API = {} as API;\n transports: Transports = {} as Transports;\n\n abstract initialize(): void;\n}\n"]}
@@ -1,29 +1,16 @@
1
1
  "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.initializeInstrumentations = initializeInstrumentations;
13
4
  function initializeInstrumentations(unpatchedConsole, internalLogger, config, metas, transports, api) {
14
5
  internalLogger.debug('Initializing instrumentations');
15
- var instrumentations = [];
16
- var add = function () {
17
- var newInstrumentations = [];
18
- for (var _i = 0; _i < arguments.length; _i++) {
19
- newInstrumentations[_i] = arguments[_i];
20
- }
6
+ const instrumentations = [];
7
+ const add = (...newInstrumentations) => {
21
8
  internalLogger.debug('Adding instrumentations');
22
- newInstrumentations.forEach(function (newInstrumentation) {
23
- internalLogger.debug("Adding \"".concat(newInstrumentation.name, "\" instrumentation"));
24
- var exists = instrumentations.some(function (existingInstrumentation) { return existingInstrumentation.name === newInstrumentation.name; });
9
+ newInstrumentations.forEach((newInstrumentation) => {
10
+ internalLogger.debug(`Adding "${newInstrumentation.name}" instrumentation`);
11
+ const exists = instrumentations.some((existingInstrumentation) => existingInstrumentation.name === newInstrumentation.name);
25
12
  if (exists) {
26
- internalLogger.warn("Instrumentation ".concat(newInstrumentation.name, " is already added"));
13
+ internalLogger.warn(`Instrumentation ${newInstrumentation.name} is already added`);
27
14
  return;
28
15
  }
29
16
  newInstrumentation.unpatchedConsole = unpatchedConsole;
@@ -36,23 +23,19 @@ function initializeInstrumentations(unpatchedConsole, internalLogger, config, me
36
23
  newInstrumentation.initialize();
37
24
  });
38
25
  };
39
- var remove = function () {
40
- var instrumentationsToRemove = [];
41
- for (var _i = 0; _i < arguments.length; _i++) {
42
- instrumentationsToRemove[_i] = arguments[_i];
43
- }
26
+ const remove = (...instrumentationsToRemove) => {
44
27
  internalLogger.debug('Removing instrumentations');
45
- instrumentationsToRemove.forEach(function (instrumentationToRemove) {
28
+ instrumentationsToRemove.forEach((instrumentationToRemove) => {
46
29
  var _a, _b;
47
- internalLogger.debug("Removing \"".concat(instrumentationToRemove.name, "\" instrumentation"));
48
- var existingInstrumentationIndex = instrumentations.reduce(function (acc, existingInstrumentation, existingTransportIndex) {
30
+ internalLogger.debug(`Removing "${instrumentationToRemove.name}" instrumentation`);
31
+ const existingInstrumentationIndex = instrumentations.reduce((acc, existingInstrumentation, existingTransportIndex) => {
49
32
  if (acc === null && existingInstrumentation.name === instrumentationToRemove.name) {
50
33
  return existingTransportIndex;
51
34
  }
52
35
  return null;
53
36
  }, null);
54
37
  if (existingInstrumentationIndex === null) {
55
- internalLogger.warn("Instrumentation \"".concat(instrumentationToRemove.name, "\" is not added"));
38
+ internalLogger.warn(`Instrumentation "${instrumentationToRemove.name}" is not added`);
56
39
  return;
57
40
  }
58
41
  (_b = (_a = instrumentations[existingInstrumentationIndex]).destroy) === null || _b === void 0 ? void 0 : _b.call(_a);
@@ -60,11 +43,11 @@ function initializeInstrumentations(unpatchedConsole, internalLogger, config, me
60
43
  });
61
44
  };
62
45
  return {
63
- add: add,
46
+ add,
64
47
  get instrumentations() {
65
- return __spreadArray([], instrumentations, true);
48
+ return [...instrumentations];
66
49
  },
67
- remove: remove,
50
+ remove,
68
51
  };
69
52
  }
70
53
  //# sourceMappingURL=initialize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/instrumentations/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;AASA,gEA6EC;AA7ED,SAAgB,0BAA0B,CACxC,gBAAkC,EAClC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,GAAQ;IAER,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,IAAM,gBAAgB,GAAsB,EAAE,CAAC;IAE/C,IAAM,GAAG,GAA4B;QAAC,6BAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,wCAAsB;;QAC1D,cAAc,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEhD,mBAAmB,CAAC,OAAO,CAAC,UAAC,kBAAkB;YAC7C,cAAc,CAAC,KAAK,CAAC,mBAAW,kBAAkB,CAAC,IAAI,uBAAmB,CAAC,CAAC;YAE5E,IAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAClC,UAAC,uBAAuB,IAAK,OAAA,uBAAuB,CAAC,IAAI,KAAK,kBAAkB,CAAC,IAAI,EAAxD,CAAwD,CACtF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AAC,CAAC;gBAEtF,OAAO;YACT,CAAC;YAED,MAAA,MAAA,gBAAgB,CAAC,4BAA4B,CAAE,EAAC,OAAO,kDAAI,CAAC;YAE5D,gBAAgB,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,KAAA;QACH,IAAI,gBAAgB;YAClB,yBAAW,gBAAgB,QAAE;QAC/B,CAAC;QACD,MAAM,QAAA;KACP,CAAC;AACJ,CAAC","sourcesContent":["import type { API } from '../api';\nimport type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport type { Transports } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nimport type { Instrumentation, Instrumentations } from './types';\n\nexport function initializeInstrumentations(\n unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\n api: API\n): Instrumentations {\n internalLogger.debug('Initializing instrumentations');\n\n const instrumentations: Instrumentation[] = [];\n\n const add: Instrumentations['add'] = (...newInstrumentations) => {\n internalLogger.debug('Adding instrumentations');\n\n newInstrumentations.forEach((newInstrumentation) => {\n internalLogger.debug(`Adding \"${newInstrumentation.name}\" instrumentation`);\n\n const exists = instrumentations.some(\n (existingInstrumentation) => existingInstrumentation.name === newInstrumentation.name\n );\n\n if (exists) {\n internalLogger.warn(`Instrumentation ${newInstrumentation.name} is already added`);\n\n return;\n }\n\n newInstrumentation.unpatchedConsole = unpatchedConsole;\n newInstrumentation.internalLogger = internalLogger;\n newInstrumentation.config = config;\n newInstrumentation.metas = metas;\n newInstrumentation.transports = transports;\n newInstrumentation.api = api;\n\n instrumentations.push(newInstrumentation);\n\n newInstrumentation.initialize();\n });\n };\n\n const remove: Instrumentations['remove'] = (...instrumentationsToRemove) => {\n internalLogger.debug('Removing instrumentations');\n\n instrumentationsToRemove.forEach((instrumentationToRemove) => {\n internalLogger.debug(`Removing \"${instrumentationToRemove.name}\" instrumentation`);\n\n const existingInstrumentationIndex = instrumentations.reduce<number | null>(\n (acc, existingInstrumentation, existingTransportIndex) => {\n if (acc === null && existingInstrumentation.name === instrumentationToRemove.name) {\n return existingTransportIndex;\n }\n\n return null;\n },\n null\n );\n\n if (existingInstrumentationIndex === null) {\n internalLogger.warn(`Instrumentation \"${instrumentationToRemove.name}\" is not added`);\n\n return;\n }\n\n instrumentations[existingInstrumentationIndex]!.destroy?.();\n\n instrumentations.splice(existingInstrumentationIndex, 1);\n });\n };\n\n return {\n add,\n get instrumentations() {\n return [...instrumentations];\n },\n remove,\n };\n}\n"]}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/instrumentations/initialize.ts"],"names":[],"mappings":";;AASA,gEA6EC;AA7ED,SAAgB,0BAA0B,CACxC,gBAAkC,EAClC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,GAAQ;IAER,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,MAAM,gBAAgB,GAAsB,EAAE,CAAC;IAE/C,MAAM,GAAG,GAA4B,CAAC,GAAG,mBAAmB,EAAE,EAAE;QAC9D,cAAc,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEhD,mBAAmB,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,EAAE;YACjD,cAAc,CAAC,KAAK,CAAC,WAAW,kBAAkB,CAAC,IAAI,mBAAmB,CAAC,CAAC;YAE5E,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAClC,CAAC,uBAAuB,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,KAAK,kBAAkB,CAAC,IAAI,CACtF,CAAC;YAEF,IAAI,MAAM,EAAE,CAAC;gBACX,cAAc,CAAC,IAAI,CAAC,mBAAmB,kBAAkB,CAAC,IAAI,mBAAmB,CAAC,CAAC;gBAEnF,OAAO;YACT,CAAC;YAED,kBAAkB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QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG;QACH,IAAI,gBAAgB;YAClB,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM;KACP,CAAC;AACJ,CAAC","sourcesContent":["import type { API } from '../api';\nimport type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport type { Transports } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nimport type { Instrumentation, Instrumentations } from './types';\n\nexport function initializeInstrumentations(\n unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\n api: API\n): Instrumentations {\n internalLogger.debug('Initializing instrumentations');\n\n const instrumentations: Instrumentation[] = [];\n\n const add: Instrumentations['add'] = (...newInstrumentations) => {\n internalLogger.debug('Adding instrumentations');\n\n newInstrumentations.forEach((newInstrumentation) => {\n internalLogger.debug(`Adding \"${newInstrumentation.name}\" instrumentation`);\n\n const exists = instrumentations.some(\n (existingInstrumentation) => existingInstrumentation.name === newInstrumentation.name\n );\n\n if (exists) {\n internalLogger.warn(`Instrumentation ${newInstrumentation.name} is already added`);\n\n return;\n }\n\n newInstrumentation.unpatchedConsole = unpatchedConsole;\n newInstrumentation.internalLogger = internalLogger;\n newInstrumentation.config = config;\n newInstrumentation.metas = metas;\n newInstrumentation.transports = transports;\n newInstrumentation.api = api;\n\n instrumentations.push(newInstrumentation);\n\n newInstrumentation.initialize();\n });\n };\n\n const remove: Instrumentations['remove'] = (...instrumentationsToRemove) => {\n internalLogger.debug('Removing instrumentations');\n\n instrumentationsToRemove.forEach((instrumentationToRemove) => {\n internalLogger.debug(`Removing \"${instrumentationToRemove.name}\" instrumentation`);\n\n const existingInstrumentationIndex = instrumentations.reduce<number | null>(\n (acc, existingInstrumentation, existingTransportIndex) => {\n if (acc === null && existingInstrumentation.name === instrumentationToRemove.name) {\n return existingTransportIndex;\n }\n\n return null;\n },\n null\n );\n\n if (existingInstrumentationIndex === null) {\n internalLogger.warn(`Instrumentation \"${instrumentationToRemove.name}\" is not added`);\n\n return;\n }\n\n instrumentations[existingInstrumentationIndex]!.destroy?.();\n\n instrumentations.splice(existingInstrumentationIndex, 1);\n });\n };\n\n return {\n add,\n get instrumentations() {\n return [...instrumentations];\n },\n remove,\n };\n}\n"]}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerInitialInstrumentations = registerInitialInstrumentations;
4
4
  function registerInitialInstrumentations(faro) {
5
- var _a;
6
- (_a = faro.instrumentations).add.apply(_a, faro.config.instrumentations);
5
+ faro.instrumentations.add(...faro.config.instrumentations);
7
6
  }
8
7
  //# sourceMappingURL=registerInitial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/instrumentations/registerInitial.ts"],"names":[],"mappings":";;AAEA,0EAEC;AAFD,SAAgB,+BAA+B,CAAC,IAAU;;IACxD,CAAA,KAAA,IAAI,CAAC,gBAAgB,CAAA,CAAC,GAAG,WAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE;AAC7D,CAAC","sourcesContent":["import type { Faro } from '../sdk';\n\nexport function registerInitialInstrumentations(faro: Faro): void {\n faro.instrumentations.add(...faro.config.instrumentations);\n}\n"]}
1
+ {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/instrumentations/registerInitial.ts"],"names":[],"mappings":";;AAEA,0EAEC;AAFD,SAAgB,+BAA+B,CAAC,IAAU;IACxD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import type { Faro } from '../sdk';\n\nexport function registerInitialInstrumentations(faro: Faro): void {\n faro.instrumentations.add(...faro.config.instrumentations);\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultInternalLoggerLevel = exports.defaultInternalLogger = exports.defaultInternalLoggerPrefix = exports.InternalLoggerLevel = void 0;
4
- var utils_1 = require("../utils");
4
+ const utils_1 = require("../utils");
5
5
  var InternalLoggerLevel;
6
6
  (function (InternalLoggerLevel) {
7
7
  InternalLoggerLevel[InternalLoggerLevel["OFF"] = 0] = "OFF";
@@ -1 +1 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/internalLogger/const.ts"],"names":[],"mappings":";;;AAAA,kCAAgC;AAIhC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,2DAAO,CAAA;IACP,+DAAS,CAAA;IACT,6DAAQ,CAAA;IACR,6DAAQ,CAAA;IACR,mEAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAEY,QAAA,2BAA2B,GAAG,MAAM,CAAC;AAErC,QAAA,qBAAqB,GAAmB;IACnD,KAAK,EAAE,YAAI;IACX,KAAK,EAAE,YAAI;IACX,IAAI,EAAE,YAAI;IACV,MAAM,EAAE,mCAA2B;IACnC,IAAI,EAAE,YAAI;CACF,CAAC;AAEE,QAAA,0BAA0B,GAAG,mBAAmB,CAAC,KAAK,CAAC","sourcesContent":["import { noop } from '../utils';\n\nimport type { InternalLogger } from './types';\n\nexport enum InternalLoggerLevel {\n OFF = 0,\n ERROR = 1,\n WARN = 2,\n INFO = 3,\n VERBOSE = 4,\n}\n\nexport const defaultInternalLoggerPrefix = 'Faro';\n\nexport const defaultInternalLogger: InternalLogger = {\n debug: noop,\n error: noop,\n info: noop,\n prefix: defaultInternalLoggerPrefix,\n warn: noop,\n} as const;\n\nexport const defaultInternalLoggerLevel = InternalLoggerLevel.ERROR;\n"]}
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/internalLogger/const.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAIhC,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,2DAAO,CAAA;IACP,+DAAS,CAAA;IACT,6DAAQ,CAAA;IACR,6DAAQ,CAAA;IACR,mEAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAEY,QAAA,2BAA2B,GAAG,MAAM,CAAC;AAErC,QAAA,qBAAqB,GAAmB;IACnD,KAAK,EAAE,YAAI;IACX,KAAK,EAAE,YAAI;IACX,IAAI,EAAE,YAAI;IACV,MAAM,EAAE,mCAA2B;IACnC,IAAI,EAAE,YAAI;CACF,CAAC;AAEE,QAAA,0BAA0B,GAAG,mBAAmB,CAAC,KAAK,CAAC","sourcesContent":["import { noop } from '../utils';\n\nimport type { InternalLogger } from './types';\n\nexport enum InternalLoggerLevel {\n OFF = 0,\n ERROR = 1,\n WARN = 2,\n INFO = 3,\n VERBOSE = 4,\n}\n\nexport const defaultInternalLoggerPrefix = 'Faro';\n\nexport const defaultInternalLogger: InternalLogger = {\n debug: noop,\n error: noop,\n info: noop,\n prefix: defaultInternalLoggerPrefix,\n warn: noop,\n} as const;\n\nexport const defaultInternalLoggerLevel = InternalLoggerLevel.ERROR;\n"]}