@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,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPromiseBuffer = createPromiseBuffer;
4
- function createPromiseBuffer(options) {
5
- var size = options.size, concurrency = options.concurrency;
6
- var buffer = []; // pending, not-yet-started tasks
7
- var inProgress = 0; // counter for tasks currently in progress
8
- var work = function () {
9
- // if there's space for a task and buffer is not empty,
10
- // take one task from buffer and run it
11
- if (inProgress < concurrency && buffer.length) {
12
- var _a = buffer.shift(), producer = _a.producer, resolve_1 = _a.resolve, reject_1 = _a.reject;
13
- inProgress++;
14
- producer().then(function (result) {
15
- inProgress--;
16
- work();
17
- resolve_1(result);
18
- }, function (reason) {
19
- inProgress--;
20
- work();
21
- reject_1(reason);
22
- });
23
- }
24
- };
25
- var add = function (promiseProducer) {
26
- if (buffer.length + inProgress >= size) {
27
- throw new Error('Task buffer full');
28
- }
29
- return new Promise(function (resolve, reject) {
30
- buffer.push({
31
- producer: promiseProducer,
32
- resolve: resolve,
33
- reject: reject,
34
- });
35
- work();
36
- });
37
- };
38
- return {
39
- add: add,
40
- };
41
- }
42
- //# sourceMappingURL=promiseBuffer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promiseBuffer.js","sourceRoot":"","sources":["../../../../../src/utils/promiseBuffer.ts"],"names":[],"mappings":";;AAmBA,kDAmDC;AAnDD,SAAgB,mBAAmB,CAAI,OAA6B;IAC1D,IAAA,IAAI,GAAkB,OAAO,KAAzB,EAAE,WAAW,GAAK,OAAO,YAAZ,CAAa;IAEtC,IAAM,MAAM,GAAyB,EAAE,CAAC,CAAC,iCAAiC;IAC1E,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC,0CAA0C;IAE9D,IAAM,IAAI,GAAG;QACX,uDAAuD;QACvD,uCAAuC;QACvC,IAAI,UAAU,GAAG,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YACxC,IAAA,KAAgC,MAAM,CAAC,KAAK,EAAG,EAA7C,QAAQ,cAAA,EAAE,SAAO,aAAA,EAAE,QAAM,YAAoB,CAAC;YAEtD,UAAU,EAAE,CAAC;YAEb,QAAQ,EAAE,CAAC,IAAI,CACb,UAAC,MAAM;gBACL,UAAU,EAAE,CAAC;gBAEb,IAAI,EAAE,CAAC;gBAEP,SAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,EACD,UAAC,MAAM;gBACL,UAAU,EAAE,CAAC;gBAEb,IAAI,EAAE,CAAC;gBAEP,QAAM,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,GAAG,GAA4B,UAAC,eAAe;QACnD,IAAI,MAAM,CAAC,MAAM,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;YACpC,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,eAAe;gBACzB,OAAO,SAAA;gBACP,MAAM,QAAA;aACP,CAAC,CAAC;YACH,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,KAAA;KACJ,CAAC;AACJ,CAAC","sourcesContent":["export interface PromiseBufferOptions {\n // total number of concurrent tasks\n concurrency: number;\n // total number of uncompleted tasks to accept\n size: number;\n}\n\nexport type PromiseProducer<T> = () => PromiseLike<T>;\n\nexport interface PromiseBuffer<T> {\n add(promiseProducer: PromiseProducer<T>): PromiseLike<T>;\n}\n\nexport interface BufferItem<T> {\n producer: PromiseProducer<T>;\n resolve: (value: T) => void;\n reject: (reason?: any) => void;\n}\n\nexport function createPromiseBuffer<T>(options: PromiseBufferOptions): PromiseBuffer<T> {\n const { size, concurrency } = options;\n\n const buffer: Array<BufferItem<T>> = []; // pending, not-yet-started tasks\n let inProgress = 0; // counter for tasks currently in progress\n\n const work = () => {\n // if there's space for a task and buffer is not empty,\n // take one task from buffer and run it\n if (inProgress < concurrency && buffer.length) {\n const { producer, resolve, reject } = buffer.shift()!;\n\n inProgress++;\n\n producer().then(\n (result) => {\n inProgress--;\n\n work();\n\n resolve(result);\n },\n (reason) => {\n inProgress--;\n\n work();\n\n reject(reason);\n }\n );\n }\n };\n\n const add: PromiseBuffer<T>['add'] = (promiseProducer) => {\n if (buffer.length + inProgress >= size) {\n throw new Error('Task buffer full');\n }\n\n return new Promise<T>((resolve, reject) => {\n buffer.push({\n producer: promiseProducer,\n resolve,\n reject,\n });\n work();\n });\n };\n\n return {\n add,\n };\n}\n"]}
@@ -1,146 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var testUtils_1 = require("../testUtils");
40
- var promiseBuffer_1 = require("./promiseBuffer");
41
- function defer(fn) {
42
- return __awaiter(this, void 0, void 0, function () {
43
- return __generator(this, function (_a) {
44
- return [2 /*return*/, new Promise(function (resolve) {
45
- setTimeout(function () {
46
- fn();
47
- resolve();
48
- }, 0);
49
- })];
50
- });
51
- });
52
- }
53
- describe('PromiseBuffer', function () {
54
- it('add() new promise that resolves when task is completed', function () { return __awaiter(void 0, void 0, void 0, function () {
55
- var buf, _a;
56
- return __generator(this, function (_b) {
57
- switch (_b.label) {
58
- case 0:
59
- buf = (0, promiseBuffer_1.createPromiseBuffer)({ size: 2, concurrency: 2 });
60
- _a = expect;
61
- return [4 /*yield*/, buf.add(function () { return Promise.resolve('hi'); })];
62
- case 1:
63
- _a.apply(void 0, [_b.sent()]).toEqual('hi');
64
- return [2 /*return*/];
65
- }
66
- });
67
- }); });
68
- it('executes tasks concurrently, limited to concurrency setting', function () { return __awaiter(void 0, void 0, void 0, function () {
69
- var promises, buf, addTask;
70
- var _a, _b, _c, _d;
71
- return __generator(this, function (_e) {
72
- switch (_e.label) {
73
- case 0:
74
- promises = [];
75
- buf = (0, promiseBuffer_1.createPromiseBuffer)({
76
- size: 10,
77
- concurrency: 2,
78
- });
79
- addTask = function (id) {
80
- return buf.add(function () {
81
- var prom = (0, testUtils_1.createTestPromise)(id);
82
- promises.push(prom);
83
- return prom.promise;
84
- });
85
- };
86
- addTask(1);
87
- addTask(2);
88
- addTask(3);
89
- // 1 & 2 have started to execute. 3d is not started
90
- expect(promises).toHaveLength(2);
91
- expect((_a = promises[0]) === null || _a === void 0 ? void 0 : _a.id).toEqual(1);
92
- expect((_b = promises[1]) === null || _b === void 0 ? void 0 : _b.id).toEqual(2);
93
- // resolve first two
94
- (_c = promises[0]) === null || _c === void 0 ? void 0 : _c.resolve();
95
- (_d = promises[1]) === null || _d === void 0 ? void 0 : _d.resolve();
96
- return [4 /*yield*/, defer(function () {
97
- var _a, _b;
98
- // 3 has started to be executed
99
- expect(promises).toHaveLength(3);
100
- expect((_a = promises[2]) === null || _a === void 0 ? void 0 : _a.id).toEqual(3);
101
- (_b = promises[2]) === null || _b === void 0 ? void 0 : _b.resolve();
102
- })];
103
- case 1:
104
- _e.sent();
105
- return [2 /*return*/];
106
- }
107
- });
108
- }); });
109
- it('rejects tasks that exceed buffer size', function () { return __awaiter(void 0, void 0, void 0, function () {
110
- var promises, buf, addTask;
111
- var _a;
112
- return __generator(this, function (_b) {
113
- switch (_b.label) {
114
- case 0:
115
- promises = [];
116
- buf = (0, promiseBuffer_1.createPromiseBuffer)({
117
- size: 3,
118
- concurrency: 2,
119
- });
120
- addTask = function (id) {
121
- return buf.add(function () {
122
- var prom = (0, testUtils_1.createTestPromise)(id);
123
- promises.push(prom);
124
- return prom.promise;
125
- });
126
- };
127
- // adding 3 tasks works, 2 of them begin executing
128
- addTask(1);
129
- addTask(2);
130
- addTask(3);
131
- expect(promises).toHaveLength(2);
132
- // adding 4th task fails
133
- expect(function () { return addTask(4); }).toThrow('Task buffer full');
134
- // finishing a task allows new tasks to be added again
135
- (_a = promises[0]) === null || _a === void 0 ? void 0 : _a.resolve();
136
- return [4 /*yield*/, defer(function () {
137
- addTask(4);
138
- })];
139
- case 1:
140
- _b.sent();
141
- return [2 /*return*/];
142
- }
143
- });
144
- }); });
145
- });
146
- //# sourceMappingURL=promiseBuffer.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promiseBuffer.test.js","sourceRoot":"","sources":["../../../../../src/utils/promiseBuffer.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA8D;AAE9D,iDAAsD;AAEtD,SAAe,KAAK,CAAC,EAAc;;;YACjC,sBAAO,IAAI,OAAO,CAAO,UAAC,OAAO;oBAC/B,UAAU,CAAC;wBACT,EAAE,EAAE,CAAC;wBACL,OAAO,EAAE,CAAC;oBACZ,CAAC,EAAE,CAAC,CAAC,CAAC;gBACR,CAAC,CAAC,EAAC;;;CACJ;AAED,QAAQ,CAAC,eAAe,EAAE;IACxB,EAAE,CAAC,wDAAwD,EAAE;;;;;oBACrD,GAAG,GAAG,IAAA,mCAAmB,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC7D,KAAA,MAAM,CAAA;oBAAC,qBAAM,GAAG,CAAC,GAAG,CAAC,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAArB,CAAqB,CAAC,EAAA;;oBAAjD,kBAAO,SAA0C,EAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;;;;SAClE,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE;;;;;;oBAC1D,QAAQ,GAA6B,EAAE,CAAC;oBACxC,GAAG,GAAG,IAAA,mCAAmB,EAAC;wBAC9B,IAAI,EAAE,EAAE;wBACR,WAAW,EAAE,CAAC;qBACf,CAAC,CAAC;oBAEG,OAAO,GAAG,UAAC,EAAU;wBACzB,OAAO,GAAG,CAAC,GAAG,CAAC;4BACb,IAAM,IAAI,GAAG,IAAA,6BAAiB,EAAO,EAAE,CAAC,CAAC;4BACzC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;4BACpB,OA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AAI,GAAG,IAAA,6BAAiB,EAAO,EAAE,CAAC,CAAC;4BACzC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;4BACpB,OAAO,IAAI,CAAC,OAAO,CAAC;wBACtB,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC;oBAEF,kDAAkD;oBAClD,OAAO,CAAC,CAAC,CAAC,CAAC;oBACX,OAAO,CAAC,CAAC,CAAC,CAAC;oBACX,OAAO,CAAC,CAAC,CAAC,CAAC;oBACX,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACjC,wBAAwB;oBACxB,MAAM,CAAC,cAAM,OAAA,OAAO,CAAC,CAAC,CAAC,EAAV,CAAU,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;oBAErD,sDAAsD;oBACtD,MAAA,QAAQ,CAAC,CAAC,CAAC,0CAAE,OAAO,EAAE,CAAC;oBAEvB,qBAAM,KAAK,CAAC;4BACV,OAAO,CAAC,CAAC,CAAC,CAAC;wBACb,CAAC,CAAC,EAAA;;oBAFF,SAEE,CAAC;;;;SACJ,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { createTestPromise, TestPromise } from '../testUtils';\n\nimport { createPromiseBuffer } from './promiseBuffer';\n\nasync function defer(fn: () => void) {\n return new Promise<void>((resolve) => {\n setTimeout(() => {\n fn();\n resolve();\n }, 0);\n });\n}\n\ndescribe('PromiseBuffer', () => {\n it('add() new promise that resolves when task is completed', async () => {\n const buf = createPromiseBuffer({ size: 2, concurrency: 2 });\n expect(await buf.add(() => Promise.resolve('hi'))).toEqual('hi');\n });\n\n it('executes tasks concurrently, limited to concurrency setting', async () => {\n const promises: Array<TestPromise<void>> = [];\n const buf = createPromiseBuffer({\n size: 10,\n concurrency: 2,\n });\n\n const addTask = (id: number) => {\n return buf.add(() => {\n const prom = createTestPromise<void>(id);\n promises.push(prom);\n return prom.promise;\n });\n };\n\n addTask(1);\n addTask(2);\n addTask(3);\n\n // 1 & 2 have started to execute. 3d is not started\n expect(promises).toHaveLength(2);\n expect(promises[0]?.id).toEqual(1);\n expect(promises[1]?.id).toEqual(2);\n\n // resolve first two\n promises[0]?.resolve();\n promises[1]?.resolve();\n\n await defer(() => {\n // 3 has started to be executed\n expect(promises).toHaveLength(3);\n expect(promises[2]?.id).toEqual(3);\n promises[2]?.resolve();\n });\n });\n\n it('rejects tasks that exceed buffer size', async () => {\n const promises: Array<TestPromise<void>> = [];\n const buf = createPromiseBuffer({\n size: 3,\n concurrency: 2,\n });\n\n const addTask = (id: number) => {\n return buf.add(() => {\n const prom = createTestPromise<void>(id);\n promises.push(prom);\n return prom.promise;\n });\n };\n\n // adding 3 tasks works, 2 of them begin executing\n addTask(1);\n addTask(2);\n addTask(3);\n expect(promises).toHaveLength(2);\n // adding 4th task fails\n expect(() => addTask(4)).toThrow('Task buffer full');\n\n // finishing a task allows new tasks to be added again\n promises[0]?.resolve();\n\n await defer(() => {\n addTask(4);\n });\n });\n});\n"]}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Observable = void 0;
4
- var Observable = /** @class */ (function () {
5
- function Observable() {
6
- this.subscribers = [];
7
- }
8
- Observable.prototype.subscribe = function (subscriber) {
9
- var _this = this;
10
- this.subscribers.push(subscriber);
11
- return {
12
- unsubscribe: function () { return _this.unsubscribe(subscriber); },
13
- };
14
- };
15
- Observable.prototype.unsubscribe = function (subscriber) {
16
- this.subscribers = this.subscribers.filter(function (sub) { return sub !== subscriber; });
17
- };
18
- Observable.prototype.notify = function (value) {
19
- this.subscribers.forEach(function (subscriber) { return subscriber(value); });
20
- };
21
- Observable.prototype.first = function () {
22
- var result = new Observable();
23
- var internalSubscriber = function (data) {
24
- result.notify(data);
25
- subscription.unsubscribe();
26
- };
27
- var subscription = this.subscribe(internalSubscriber);
28
- var resultUnsubscribeFn = result.unsubscribe.bind(result);
29
- return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);
30
- };
31
- Observable.prototype.takeWhile = function (predicate) {
32
- var result = new Observable();
33
- var internalSubscriber = function (value) {
34
- if (predicate(value)) {
35
- result.notify(value);
36
- }
37
- else {
38
- result.unsubscribe(internalSubscriber);
39
- }
40
- };
41
- this.subscribe(internalSubscriber);
42
- var resultUnsubscribeFn = result.unsubscribe.bind(result);
43
- return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);
44
- };
45
- Observable.prototype.filter = function (predicate) {
46
- var result = new Observable();
47
- var internalSubscriber = function (value) {
48
- if (predicate(value)) {
49
- result.notify(value);
50
- }
51
- };
52
- this.subscribe(internalSubscriber);
53
- var resultUnsubscribeFn = result.unsubscribe.bind(result);
54
- return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);
55
- };
56
- Observable.prototype.merge = function () {
57
- var observables = [];
58
- for (var _i = 0; _i < arguments.length; _i++) {
59
- observables[_i] = arguments[_i];
60
- }
61
- var mergerObservable = new Observable();
62
- var subscriptions = [];
63
- observables.forEach(function (observable) {
64
- var subscription = observable.subscribe(function (value) {
65
- mergerObservable.notify(value);
66
- });
67
- subscriptions.push(subscription);
68
- });
69
- var originalUnsubscribeAll = mergerObservable.unsubscribeAll.bind(mergerObservable);
70
- mergerObservable.unsubscribe = function () {
71
- subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
72
- originalUnsubscribeAll();
73
- };
74
- return mergerObservable;
75
- };
76
- Observable.prototype.withUnsubscribeOverride = function (observable, resultUnsubscribeFn, internalSubscriber) {
77
- var _this = this;
78
- observable.unsubscribe = function (subscriber) {
79
- resultUnsubscribeFn(subscriber);
80
- _this.unsubscribe(internalSubscriber);
81
- };
82
- return observable;
83
- };
84
- Observable.prototype.unsubscribeAll = function () {
85
- this.subscribers = [];
86
- };
87
- return Observable;
88
- }());
89
- exports.Observable = Observable;
90
- //# sourceMappingURL=reactive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactive.js","source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AAC,KAAK,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;YAEH,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,IAAM,sBAAsB,GAAG,gBAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEtF,gBAAgB,CAAC,WAAW,GAAG;YAC7B,aAAa,CAAC,OAAO,CAAC,UAAC,YAAY,IAAK,OAAA,YAAY,CAAC,WAAW,EAAE,EAA1B,CAA0B,CAAC,CAAC;YACpE,sBAAsB,EAAE,CAAC;QAC3B,CAAC,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAEO,4CAAuB,GAA/B,UACE,UAAyB,EACzB,mBAAwD,EACxD,kBAAiC;QAHnC,iBAWC;QANC,UAAU,CAAC,WAAW,GAAG,UAAC,UAAyB;YACjD,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAChC,KAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC;IAEO,mCAAc,GAAtB;QACE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IACH,iBAAC;AAAD,CAAC,AAhGD,IAgGC;AAhGY,gCAAU","sourcesContent":["export type Subscription = {\n unsubscribe: () => void;\n};\n\ntype Subscriber<T> = (value: T) => void;\n\nexport class Observable<T = any> {\n private subscribers: Array<Subscriber<T>> = [];\n\n subscribe(subscriber: Subscriber<T>): Subscription {\n this.subscribers.push(subscriber);\n return {\n unsubscribe: () => this.unsubscribe(subscriber),\n };\n }\n\n unsubscribe(subscriber: Subscriber<T>): void {\n this.subscribers = this.subscribers.filter((sub) => sub !== subscriber);\n }\n\n notify(value: T): void {\n this.subscribers.forEach((subscriber) => subscriber(value));\n }\n\n first(): Observable<T> {\n const result = new Observable<T>();\n\n const internalSubscriber = (data: T): void => {\n result.notify(data);\n subscription.unsubscribe();\n };\n const subscription = this.subscribe(internalSubscriber);\n const resultUnsubscribeFn = result.unsubscribe.bind(result);\n return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);\n }\n\n takeWhile(predicate: (value: T) => boolean): Observable<T> {\n const result = new Observable<T>();\n const internalSubscriber = (value: T): void => {\n if (predicate(value)) {\n result.notify(value);\n } else {\n result.unsubscribe(internalSubscriber);\n }\n };\n this.subscribe(internalSubscriber);\n const resultUnsubscribeFn = result.unsubscribe.bind(result);\n return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);\n }\n\n filter(predicate: (value: T) => boolean): Observable<T> {\n const result = new Observable<T>();\n\n const internalSubscriber = (value: T): void => {\n if (predicate(value)) {\n result.notify(value);\n }\n };\n this.subscribe(internalSubscriber);\n\n const resultUnsubscribeFn = result.unsubscribe.bind(result);\n return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);\n }\n\n merge(...observables: Array<Observable<T>>): Observable<T> {\n const mergerObservable = new Observable<T>();\n const subscriptions: Subscription[] = [];\n\n observables.forEach((observable) => {\n const subscription = observable.subscribe((value: T) => {\n mergerObservable.notify(value);\n });\n\n subscriptions.push(subscription);\n });\n\n const originalUnsubscribeAll = mergerObservable.unsubscribeAll.bind(mergerObservable);\n\n mergerObservable.unsubscribe = () => {\n subscriptions.forEach((subscription) => subscription.unsubscribe());\n originalUnsubscribeAll();\n };\n\n return mergerObservable;\n }\n\n private withUnsubscribeOverride(\n observable: Observable<T>,\n resultUnsubscribeFn: (subscriber: Subscriber<T>) => void,\n internalSubscriber: Subscriber<T>\n ) {\n observable.unsubscribe = (subscriber: Subscriber<T>) => {\n resultUnsubscribeFn(subscriber);\n this.unsubscribe(internalSubscriber);\n };\n\n return observable;\n }\n\n private unsubscribeAll(): void {\n this.subscribers = [];\n }\n}\n"]}
@@ -1,117 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var __1 = require("..");
4
- describe('Reactive', function () {
5
- describe('Observable', function () {
6
- it('Creates an observable, subscribe to it, and emit values', function () {
7
- var observable = new __1.Observable();
8
- var callback = jest.fn();
9
- observable.subscribe(callback);
10
- observable.notify(1);
11
- observable.notify(2);
12
- expect(callback).toHaveBeenCalledTimes(2);
13
- expect(callback).toHaveBeenNthCalledWith(1, 1);
14
- expect(callback).toHaveBeenNthCalledWith(2, 2);
15
- });
16
- it('Unsubscribes from an observable', function () {
17
- var observable = new __1.Observable();
18
- var callback = jest.fn();
19
- var subscription = observable.subscribe(callback);
20
- observable.notify(1);
21
- subscription.unsubscribe();
22
- observable.notify(2);
23
- expect(callback).toHaveBeenCalledTimes(1);
24
- expect(callback).toHaveBeenCalledWith(1);
25
- });
26
- it('takes emitted values until the predicate returns false', function () {
27
- var observable = new __1.Observable();
28
- var callback = jest.fn();
29
- observable.takeWhile(function (value) { return value <= 2; }).subscribe(callback);
30
- observable.notify(1);
31
- observable.notify(2);
32
- observable.notify(3);
33
- expect(callback).toHaveBeenCalledTimes(2);
34
- expect(callback).toHaveBeenNthCalledWith(1, 1);
35
- expect(callback).toHaveBeenNthCalledWith(2, 2);
36
- });
37
- it('subscribes to the first emitted value and unsubscribes after', function () {
38
- var observable = new __1.Observable();
39
- var callback = jest.fn();
40
- observable.first().subscribe(callback);
41
- observable.notify(1);
42
- observable.notify(2);
43
- expect(callback).toHaveBeenCalledTimes(1);
44
- expect(callback).toHaveBeenCalledWith(1);
45
- });
46
- it('unsubscribes a callback from the list of subscribers', function () {
47
- var observable = new __1.Observable();
48
- var callback = jest.fn();
49
- var sub = observable.subscribe(callback);
50
- observable.notify(1);
51
- sub.unsubscribe();
52
- observable.notify(2);
53
- expect(callback).toHaveBeenCalledTimes(1);
54
- expect(callback).toHaveBeenCalledWith(1);
55
- });
56
- });
57
- describe('Merge', function () {
58
- it('Merges multiple observables into a single observable using the merge() function', function () {
59
- var observable1 = new __1.Observable();
60
- var observable2 = new __1.Observable();
61
- var callback = jest.fn();
62
- var mergeObserverSub = new __1.Observable().merge(observable1, observable2).subscribe(callback);
63
- observable1.notify(1);
64
- observable2.notify('A');
65
- observable1.notify(2);
66
- observable2.notify('B');
67
- expect(callback).toHaveBeenCalledTimes(4);
68
- expect(callback).toHaveBeenNthCalledWith(1, 1);
69
- expect(callback).toHaveBeenNthCalledWith(2, 'A');
70
- expect(callback).toHaveBeenNthCalledWith(3, 2);
71
- expect(callback).toHaveBeenNthCalledWith(4, 'B');
72
- mergeObserverSub.unsubscribe();
73
- observable1.notify(3);
74
- observable2.notify('C');
75
- expect(callback).toHaveBeenCalledTimes(4);
76
- expect(callback).not.toHaveBeenNthCalledWith(5, 3);
77
- expect(callback).not.toHaveBeenNthCalledWith(6, 'C');
78
- });
79
- it('Unsubscribes from all observables when merge.unsubscribeAll isCalled', function () {
80
- var observable1 = new __1.Observable();
81
- var observable2 = new __1.Observable();
82
- var callback = jest.fn();
83
- var mergeObserverSub = new __1.Observable().merge(observable1, observable2);
84
- mergeObserverSub.subscribe(callback);
85
- observable1.notify(1);
86
- observable2.notify(2);
87
- mergeObserverSub.unsubscribe(callback);
88
- observable1.notify(3);
89
- observable2.notify(4);
90
- expect(callback).toHaveBeenCalledTimes(2);
91
- expect(callback).toHaveBeenNthCalledWith(1, 1);
92
- expect(callback).toHaveBeenNthCalledWith(2, 2);
93
- });
94
- it('Unsubscribes from all chained observables when unsubscribe is called on the final operator in the chain', function () {
95
- var observable = new __1.Observable().takeWhile(function (value) { return value < 3; }).filter(function (value) { return !(0, __1.isString)(value); });
96
- var callback = jest.fn();
97
- var chainedSubscription = observable.subscribe(callback);
98
- observable.notify(1);
99
- observable.notify(2);
100
- chainedSubscription.unsubscribe();
101
- observable.notify(3);
102
- observable.notify(4);
103
- observable.notify(5);
104
- expect(callback).toHaveBeenCalledTimes(2);
105
- expect(callback).toHaveBeenCalledWith(2);
106
- // If we would have a left over (pending) subscription, it would be called more times
107
- callback.mockClear();
108
- chainedSubscription = observable.subscribe(callback);
109
- observable.notify(1);
110
- observable.notify(2);
111
- chainedSubscription.unsubscribe();
112
- expect(callback).toHaveBeenCalledTimes(2);
113
- expect(callback).toHaveBeenCalledWith(2);
114
- });
115
- });
116
- });
117
- //# sourceMappingURL=reactive.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactive.test.js","sourceRoot":"","sources":["../../../../../src/utils/reactive.test.ts"],"names":[],"mappings":";;AAAA,wBAA0C;AAE1C,QAAQ,CAAC,UAAU,EAAE;IACnB,QAAQ,CAAC,YAAY,EAAE;QACrB,EAAE,CAAC,yDAAyD,EAAE;YAC5D,IAAM,UAAU,GAAG,IAAI,cAAU,EAAU,CAAC;YAC5C,IAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;YAE3B,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC/B,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAErB,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,QAAQ,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iCAAiC,EAAE;YACpC,IAAM,UAAU,GAAG,IAAI,cAAU,EAAU,CAAC;YAC5C,IAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;YAE3B,IAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YACpD,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAErB,YAAY,CAAC,WAAW,EAAE,CAAC;YAC3B,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAErB,MAAM,CAAC,QAAQ,CAAC,CAA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AU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrB,mBAAmB,CAAC,WAAW,EAAE,CAAC;YAElC,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { isString, Observable } from '..';\n\ndescribe('Reactive', () => {\n describe('Observable', () => {\n it('Creates an observable, subscribe to it, and emit values', () => {\n const observable = new Observable<number>();\n const callback = jest.fn();\n\n observable.subscribe(callback);\n observable.notify(1);\n observable.notify(2);\n\n expect(callback).toHaveBeenCalledTimes(2);\n expect(callback).toHaveBeenNthCalledWith(1, 1);\n expect(callback).toHaveBeenNthCalledWith(2, 2);\n });\n\n it('Unsubscribes from an observable', () => {\n const observable = new Observable<number>();\n const callback = jest.fn();\n\n const subscription = observable.subscribe(callback);\n observable.notify(1);\n\n subscription.unsubscribe();\n observable.notify(2);\n\n expect(callback).toHaveBeenCalledTimes(1);\n expect(callback).toHaveBeenCalledWith(1);\n });\n\n it('takes emitted values until the predicate returns false', () => {\n const observable = new Observable<number>();\n const callback = jest.fn();\n\n observable.takeWhile((value) => value <= 2).subscribe(callback);\n observable.notify(1);\n observable.notify(2);\n observable.notify(3);\n\n expect(callback).toHaveBeenCalledTimes(2);\n expect(callback).toHaveBeenNthCalledWith(1, 1);\n expect(callback).toHaveBeenNthCalledWith(2, 2);\n });\n\n it('subscribes to the first emitted value and unsubscribes after', () => {\n const observable = new Observable<number>();\n const callback = jest.fn();\n\n observable.first().subscribe(callback);\n observable.notify(1);\n observable.notify(2);\n\n expect(callback).toHaveBeenCalledTimes(1);\n expect(callback).toHaveBeenCalledWith(1);\n });\n\n it('unsubscribes a callback from the list of subscribers', () => {\n const observable = new Observable<number>();\n const callback = jest.fn();\n\n const sub = observable.subscribe(callback);\n observable.notify(1);\n sub.unsubscribe();\n observable.notify(2);\n\n expect(callback).toHaveBeenCalledTimes(1);\n expect(callback).toHaveBeenCalledWith(1);\n });\n });\n\n describe('Merge', () => {\n it('Merges multiple observables into a single observable using the merge() function', () => {\n const observable1 = new Observable<number | string>();\n const observable2 = new Observable<number | string>();\n const callback = jest.fn();\n\n const mergeObserverSub = new Observable<number | string>().merge(observable1, observable2).subscribe(callback);\n\n observable1.notify(1);\n observable2.notify('A');\n observable1.notify(2);\n observable2.notify('B');\n\n expect(callback).toHaveBeenCalledTimes(4);\n expect(callback).toHaveBeenNthCalledWith(1, 1);\n expect(callback).toHaveBeenNthCalledWith(2, 'A');\n expect(callback).toHaveBeenNthCalledWith(3, 2);\n expect(callback).toHaveBeenNthCalledWith(4, 'B');\n\n mergeObserverSub.unsubscribe();\n observable1.notify(3);\n observable2.notify('C');\n expect(callback).toHaveBeenCalledTimes(4);\n expect(callback).not.toHaveBeenNthCalledWith(5, 3);\n expect(callback).not.toHaveBeenNthCalledWith(6, 'C');\n });\n\n it('Unsubscribes from all observables when merge.unsubscribeAll isCalled', () => {\n const observable1 = new Observable<number>();\n const observable2 = new Observable<number>();\n const callback = jest.fn();\n\n const mergeObserverSub = new Observable<number>().merge(observable1, observable2);\n mergeObserverSub.subscribe(callback);\n\n observable1.notify(1);\n observable2.notify(2);\n\n mergeObserverSub.unsubscribe(callback);\n observable1.notify(3);\n observable2.notify(4);\n\n expect(callback).toHaveBeenCalledTimes(2);\n expect(callback).toHaveBeenNthCalledWith(1, 1);\n expect(callback).toHaveBeenNthCalledWith(2, 2);\n });\n\n it('Unsubscribes from all chained observables when unsubscribe is called on the final operator in the chain', () => {\n const observable = new Observable<number>().takeWhile((value) => value < 3).filter((value) => !isString(value));\n const callback = jest.fn();\n\n let chainedSubscription = observable.subscribe(callback);\n\n observable.notify(1);\n observable.notify(2);\n chainedSubscription.unsubscribe();\n observable.notify(3);\n observable.notify(4);\n observable.notify(5);\n\n expect(callback).toHaveBeenCalledTimes(2);\n expect(callback).toHaveBeenCalledWith(2);\n\n // If we would have a left over (pending) subscription, it would be called more times\n callback.mockClear();\n chainedSubscription = observable.subscribe(callback);\n observable.notify(1);\n observable.notify(2);\n chainedSubscription.unsubscribe();\n\n expect(callback).toHaveBeenCalledTimes(2);\n expect(callback).toHaveBeenCalledWith(2);\n });\n });\n});\n"]}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clampSamplingRate = clampSamplingRate;
4
- function clampSamplingRate(samplingRate) {
5
- return Math.min(1, Math.max(0, samplingRate));
6
- }
7
- //# sourceMappingURL=sampling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sampling.js","sourceRoot":"","sources":["../../../../../src/utils/sampling.ts"],"names":[],"mappings":";;AAAA,8CAEC;AAFD,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;AAChD,CAAC","sourcesContent":["export function clampSamplingRate(samplingRate: number): number {\n return Math.min(1, Math.max(0, samplingRate));\n}\n"]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var sampling_1 = require("./sampling");
4
- describe('clampSamplingRate', function () {
5
- it('returns rates in the valid range unchanged', function () {
6
- expect((0, sampling_1.clampSamplingRate)(0)).toBe(0);
7
- expect((0, sampling_1.clampSamplingRate)(0.42)).toBe(0.42);
8
- expect((0, sampling_1.clampSamplingRate)(1)).toBe(1);
9
- });
10
- it('clamps rates below 0 to 0', function () {
11
- expect((0, sampling_1.clampSamplingRate)(-1)).toBe(0);
12
- });
13
- it('clamps rates above 1 to 1', function () {
14
- expect((0, sampling_1.clampSamplingRate)(2)).toBe(1);
15
- });
16
- });
17
- //# sourceMappingURL=sampling.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sampling.test.js","sourceRoot":"","sources":["../../../../../src/utils/sampling.test.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,EAAE,CAAC,4CAA4C,EAAE;QAC/C,MAAM,CAAC,IAAA,4BAAiB,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAA,4BAAiB,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE;QAC9B,MAAM,CAAC,IAAA,4BAAiB,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE;QAC9B,MAAM,CAAC,IAAA,4BAAiB,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { clampSamplingRate } from './sampling';\n\ndescribe('clampSamplingRate', () => {\n it('returns rates in the valid range unchanged', () => {\n expect(clampSamplingRate(0)).toBe(0);\n expect(clampSamplingRate(0.42)).toBe(0.42);\n expect(clampSamplingRate(1)).toBe(1);\n });\n\n it('clamps rates below 0 to 0', () => {\n expect(clampSamplingRate(-1)).toBe(0);\n });\n\n it('clamps rates above 1 to 1', () => {\n expect(clampSamplingRate(2)).toBe(1);\n });\n});\n"]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genShortID = genShortID;
4
- var alphabet = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789';
5
- function genShortID(length) {
6
- if (length === void 0) { length = 10; }
7
- return Array.from(Array(length))
8
- .map(function () { return alphabet[Math.floor(Math.random() * alphabet.length)]; })
9
- .join('');
10
- }
11
- //# sourceMappingURL=shortId.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shortId.js","sourceRoot":"","sources":["../../../../../src/utils/shortId.ts"],"names":[],"mappings":";;AAEA,gCAIC;AAND,IAAM,QAAQ,GAAG,6DAA6D,CAAC;AAE/E,SAAgB,UAAU,CAAC,MAAW;IAAX,uBAAA,EAAA,WAAW;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,cAAM,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAE,EAAtD,CAAsD,CAAC;SACjE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC","sourcesContent":["const alphabet = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789';\n\nexport function genShortID(length = 10): string {\n return Array.from(Array(length))\n .map(() => alphabet[Math.floor(Math.random() * alphabet.length)]!)\n .join('');\n}\n"]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBundleId = getBundleId;
4
- var globalObject_1 = require("../globalObject");
5
- function getBundleId(appName) {
6
- return globalObject_1.globalObject === null || globalObject_1.globalObject === void 0 ? void 0 : globalObject_1.globalObject["__faroBundleId_".concat(appName)];
7
- }
8
- //# sourceMappingURL=sourceMaps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sourceMaps.js","sourceRoot":"","sources":["../../../../../src/utils/sourceMaps.ts"],"names":[],"mappings":";;AAEA,kCAEC;AAJD,gDAA+C;AAE/C,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAQ,2BAAoB,aAApB,2BAAY,uBAAZ,2BAAY,CAAW,yBAAkB,OAAO,CAAE,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import { globalObject } from '../globalObject';\n\nexport function getBundleId(appName: string): string | undefined {\n return (globalObject as any)?.[`__faroBundleId_${appName}`];\n}\n"]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var sourceMaps_1 = require("./sourceMaps");
4
- describe('sourceMapUpload utils', function () {
5
- beforeAll(function () {
6
- delete global.__faroBundleId_foo;
7
- });
8
- afterAll(function () {
9
- delete global.__faroBundleId_foo;
10
- });
11
- it('can get the bundle ID from the global object', function () {
12
- expect((0, sourceMaps_1.getBundleId)('foo')).toBeUndefined();
13
- global.__faroBundleId_foo = 'bar';
14
- expect((0, sourceMaps_1.getBundleId)('foo')).toEqual('bar');
15
- });
16
- });
17
- //# sourceMappingURL=sourceMaps.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sourceMaps.test.js","sourceRoot":"","sources":["../../../../../src/utils/sourceMaps.test.ts"],"names":[],"mappings":";;AAAA,2CAA2C;AAE3C,QAAQ,CAAC,uBAAuB,EAAE;IAChC,SAAS,CAAC;QACR,OAAQ,MAAc,CAAC,kBAAkB,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,OAAQ,MAAc,CAAC,kBAAkB,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE;QACjD,MAAM,CAAC,IAAA,wBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAE1C,MAAc,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAC3C,MAAM,CAAC,IAAA,wBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { getBundleId } from './sourceMaps';\n\ndescribe('sourceMapUpload utils', () => {\n beforeAll(() => {\n delete (global as any).__faroBundleId_foo;\n });\n\n afterAll(() => {\n delete (global as any).__faroBundleId_foo;\n });\n\n it('can get the bundle ID from the global object', () => {\n expect(getBundleId('foo')).toBeUndefined();\n\n (global as any).__faroBundleId_foo = 'bar';\n expect(getBundleId('foo')).toEqual('bar');\n });\n});\n"]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VERSION = void 0;
4
- // auto-generated by bin/genVersion.ts
5
- exports.VERSION = '2.3.0';
6
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '2.3.0';\n"]}
@@ -1,7 +0,0 @@
1
- export declare class ItemBuffer<T> {
2
- private buffer;
3
- constructor();
4
- addItem(item: T): void;
5
- flushBuffer(cb?: (item: T) => void): void;
6
- size(): number;
7
- }
@@ -1,13 +0,0 @@
1
- import type { Transports } from '../transports';
2
- import type { TracesAPI } from './traces/types';
3
- import type { UserActionsAPI } from './userActions/types';
4
- export declare const mockMetas: {
5
- add: jest.Mock<any, any, any>;
6
- remove: jest.Mock<any, any, any>;
7
- addListener: jest.Mock<any, any, any>;
8
- removeListener: jest.Mock<any, any, any>;
9
- value: {};
10
- };
11
- export declare const mockTransports: Transports;
12
- export declare const mockTracesApi: TracesAPI;
13
- export declare const mockUserActionsApi: UserActionsAPI;
@@ -1,2 +0,0 @@
1
- export type { EventAttributes, EventEvent, EventsAPI, PushEventOptions } from './types';
2
- export { initializeEventsAPI } from './initialize';
@@ -1,17 +0,0 @@
1
- import type { Config } from '../../config';
2
- import type { InternalLogger } from '../../internalLogger';
3
- import type { Metas } from '../../metas';
4
- import type { Transports } from '../../transports';
5
- import type { UnpatchedConsole } from '../../unpatchedConsole';
6
- import type { TracesAPI } from '../traces';
7
- import type { UserActionsAPI } from '../userActions';
8
- import type { EventsAPI } from './types';
9
- export declare function initializeEventsAPI({ internalLogger, config, metas, transports, tracesApi, userActionsApi, }: {
10
- unpatchedConsole: UnpatchedConsole;
11
- internalLogger: InternalLogger;
12
- config: Config;
13
- metas: Metas;
14
- transports: Transports;
15
- tracesApi: TracesAPI;
16
- userActionsApi: UserActionsAPI;
17
- }): EventsAPI;
@@ -1 +0,0 @@
1
- export {};