@grafana/faro-core 1.14.0 → 1.14.2

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 (233) hide show
  1. package/dist/bundle/faro-core.iife.js +1 -1
  2. package/dist/bundle/types/api/ItemBuffer.d.ts +7 -0
  3. package/dist/bundle/types/api/apiTestHelpers.d.ts +11 -0
  4. package/dist/bundle/types/api/const.d.ts +3 -0
  5. package/dist/bundle/types/api/events/initialize.d.ts +13 -2
  6. package/dist/bundle/types/api/events/types.d.ts +11 -0
  7. package/dist/bundle/types/api/exceptions/initialize.d.ts +13 -2
  8. package/dist/bundle/types/api/exceptions/types.d.ts +2 -0
  9. package/dist/bundle/types/api/index.d.ts +3 -1
  10. package/dist/bundle/types/api/initialize.d.ts +3 -1
  11. package/dist/bundle/types/api/logs/initialize.d.ts +13 -2
  12. package/dist/bundle/types/api/logs/types.d.ts +3 -1
  13. package/dist/bundle/types/api/measurements/initialize.d.ts +13 -1
  14. package/dist/bundle/types/api/measurements/types.d.ts +2 -0
  15. package/dist/bundle/types/api/meta/initialize.d.ts +14 -2
  16. package/dist/bundle/types/api/types.d.ts +37 -0
  17. package/dist/bundle/types/api/userActionLifecycleHandler.d.ts +13 -0
  18. package/dist/bundle/types/api/utils.d.ts +2 -0
  19. package/dist/bundle/types/config/types.d.ts +21 -12
  20. package/dist/bundle/types/index.d.ts +4 -4
  21. package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
  22. package/dist/bundle/types/transports/initialize.d.ts +2 -4
  23. package/dist/bundle/types/transports/types.d.ts +0 -1
  24. package/dist/bundle/types/utils/index.d.ts +2 -0
  25. package/dist/bundle/types/utils/reactive.d.ts +46 -0
  26. package/dist/bundle/types/version.d.ts +1 -1
  27. package/dist/cjs/api/ItemBuffer.js +27 -0
  28. package/dist/cjs/api/ItemBuffer.js.map +1 -0
  29. package/dist/cjs/api/apiTestHelpers.js +36 -0
  30. package/dist/cjs/api/apiTestHelpers.js.map +1 -0
  31. package/dist/cjs/api/const.js +7 -0
  32. package/dist/cjs/api/const.js.map +1 -0
  33. package/dist/cjs/api/events/initialize.js +15 -6
  34. package/dist/cjs/api/events/initialize.js.map +1 -1
  35. package/dist/cjs/api/events/types.js.map +1 -1
  36. package/dist/cjs/api/exceptions/initialize.js +59 -37
  37. package/dist/cjs/api/exceptions/initialize.js.map +1 -1
  38. package/dist/cjs/api/exceptions/types.js.map +1 -1
  39. package/dist/cjs/api/index.js +7 -1
  40. package/dist/cjs/api/index.js.map +1 -1
  41. package/dist/cjs/api/initialize.js +16 -2
  42. package/dist/cjs/api/initialize.js.map +1 -1
  43. package/dist/cjs/api/logs/initialize.js +15 -6
  44. package/dist/cjs/api/logs/initialize.js.map +1 -1
  45. package/dist/cjs/api/logs/types.js.map +1 -1
  46. package/dist/cjs/api/measurements/initialize.js +12 -3
  47. package/dist/cjs/api/measurements/initialize.js.map +1 -1
  48. package/dist/cjs/api/measurements/types.js.map +1 -1
  49. package/dist/cjs/api/meta/initialize.js +2 -1
  50. package/dist/cjs/api/meta/initialize.js.map +1 -1
  51. package/dist/cjs/api/types.js.map +1 -1
  52. package/dist/cjs/api/userActionLifecycleHandler.js +59 -0
  53. package/dist/cjs/api/userActionLifecycleHandler.js.map +1 -0
  54. package/dist/cjs/api/utils.js +11 -0
  55. package/dist/cjs/api/utils.js.map +1 -0
  56. package/dist/cjs/config/types.js.map +1 -1
  57. package/dist/cjs/index.js +8 -2
  58. package/dist/cjs/index.js.map +1 -1
  59. package/dist/cjs/transports/initialize.js +1 -35
  60. package/dist/cjs/transports/initialize.js.map +1 -1
  61. package/dist/cjs/transports/registerInitial.js +0 -1
  62. package/dist/cjs/transports/registerInitial.js.map +1 -1
  63. package/dist/cjs/transports/types.js.map +1 -1
  64. package/dist/cjs/utils/index.js +4 -1
  65. package/dist/cjs/utils/index.js.map +1 -1
  66. package/dist/cjs/utils/reactive.js +104 -0
  67. package/dist/cjs/utils/reactive.js.map +1 -0
  68. package/dist/cjs/version.js +1 -1
  69. package/dist/cjs/version.js.map +1 -1
  70. package/dist/esm/api/ItemBuffer.js +21 -0
  71. package/dist/esm/api/ItemBuffer.js.map +1 -0
  72. package/dist/esm/api/apiTestHelpers.js +33 -0
  73. package/dist/esm/api/apiTestHelpers.js.map +1 -0
  74. package/dist/esm/api/const.js +4 -0
  75. package/dist/esm/api/const.js.map +1 -0
  76. package/dist/esm/api/events/initialize.js +15 -7
  77. package/dist/esm/api/events/initialize.js.map +1 -1
  78. package/dist/esm/api/events/types.js.map +1 -1
  79. package/dist/esm/api/exceptions/initialize.js +56 -35
  80. package/dist/esm/api/exceptions/initialize.js.map +1 -1
  81. package/dist/esm/api/exceptions/types.js.map +1 -1
  82. package/dist/esm/api/index.js +2 -0
  83. package/dist/esm/api/index.js.map +1 -1
  84. package/dist/esm/api/initialize.js +15 -1
  85. package/dist/esm/api/initialize.js.map +1 -1
  86. package/dist/esm/api/logs/initialize.js +12 -4
  87. package/dist/esm/api/logs/initialize.js.map +1 -1
  88. package/dist/esm/api/logs/types.js.map +1 -1
  89. package/dist/esm/api/measurements/initialize.js +12 -4
  90. package/dist/esm/api/measurements/initialize.js.map +1 -1
  91. package/dist/esm/api/measurements/types.js.map +1 -1
  92. package/dist/esm/api/meta/initialize.js +1 -1
  93. package/dist/esm/api/meta/initialize.js.map +1 -1
  94. package/dist/esm/api/types.js.map +1 -1
  95. package/dist/esm/api/userActionLifecycleHandler.js +43 -0
  96. package/dist/esm/api/userActionLifecycleHandler.js.map +1 -0
  97. package/dist/esm/api/utils.js +7 -0
  98. package/dist/esm/api/utils.js.map +1 -0
  99. package/dist/esm/config/types.js.map +1 -1
  100. package/dist/esm/index.js +2 -2
  101. package/dist/esm/index.js.map +1 -1
  102. package/dist/esm/transports/initialize.js +0 -28
  103. package/dist/esm/transports/initialize.js.map +1 -1
  104. package/dist/esm/transports/registerInitial.js +0 -1
  105. package/dist/esm/transports/registerInitial.js.map +1 -1
  106. package/dist/esm/transports/types.js.map +1 -1
  107. package/dist/esm/utils/index.js +1 -0
  108. package/dist/esm/utils/index.js.map +1 -1
  109. package/dist/esm/utils/reactive.js +93 -0
  110. package/dist/esm/utils/reactive.js.map +1 -0
  111. package/dist/esm/version.js +1 -1
  112. package/dist/esm/version.js.map +1 -1
  113. package/dist/spec/core/src/api/ItemBuffer.js +27 -0
  114. package/dist/spec/core/src/api/ItemBuffer.js.map +1 -0
  115. package/dist/spec/core/src/api/apiTestHelpers.js +36 -0
  116. package/dist/spec/core/src/api/apiTestHelpers.js.map +1 -0
  117. package/dist/spec/core/src/api/const.js +7 -0
  118. package/dist/spec/core/src/api/const.js.map +1 -0
  119. package/dist/spec/core/src/api/events/initialize.js +15 -6
  120. package/dist/spec/core/src/api/events/initialize.js.map +1 -1
  121. package/dist/spec/core/src/api/events/initialize.test.js +57 -0
  122. package/dist/spec/core/src/api/events/initialize.test.js.map +1 -1
  123. package/dist/spec/core/src/api/events/types.js.map +1 -1
  124. package/dist/spec/core/src/api/exceptions/initialize.js +59 -37
  125. package/dist/spec/core/src/api/exceptions/initialize.js.map +1 -1
  126. package/dist/spec/core/src/api/exceptions/initialize.test.js +83 -3
  127. package/dist/spec/core/src/api/exceptions/initialize.test.js.map +1 -1
  128. package/dist/spec/core/src/api/exceptions/types.js.map +1 -1
  129. package/dist/spec/core/src/api/index.js +7 -1
  130. package/dist/spec/core/src/api/index.js.map +1 -1
  131. package/dist/spec/core/src/api/initialize.js +16 -2
  132. package/dist/spec/core/src/api/initialize.js.map +1 -1
  133. package/dist/spec/core/src/api/initialize.test.js +73 -0
  134. package/dist/spec/core/src/api/initialize.test.js.map +1 -0
  135. package/dist/spec/core/src/api/itemBuffer.test.js +36 -0
  136. package/dist/spec/core/src/api/itemBuffer.test.js.map +1 -0
  137. package/dist/spec/core/src/api/logs/initialize.js +15 -6
  138. package/dist/spec/core/src/api/logs/initialize.js.map +1 -1
  139. package/dist/spec/core/src/api/logs/initialize.test.js +98 -0
  140. package/dist/spec/core/src/api/logs/initialize.test.js.map +1 -1
  141. package/dist/spec/core/src/api/logs/types.js.map +1 -1
  142. package/dist/spec/core/src/api/measurements/initialize.js +12 -3
  143. package/dist/spec/core/src/api/measurements/initialize.js.map +1 -1
  144. package/dist/spec/core/src/api/measurements/initialize.test.js +105 -0
  145. package/dist/spec/core/src/api/measurements/initialize.test.js.map +1 -1
  146. package/dist/spec/core/src/api/measurements/types.js.map +1 -1
  147. package/dist/spec/core/src/api/meta/initialize.js +2 -1
  148. package/dist/spec/core/src/api/meta/initialize.js.map +1 -1
  149. package/dist/spec/core/src/api/meta/initilialize.test.js +1 -3
  150. package/dist/spec/core/src/api/meta/initilialize.test.js.map +1 -1
  151. package/dist/spec/core/src/api/types.js.map +1 -1
  152. package/dist/spec/core/src/api/userActionLifecycleHandler.js +59 -0
  153. package/dist/spec/core/src/api/userActionLifecycleHandler.js.map +1 -0
  154. package/dist/spec/core/src/api/userActionLifecycleHandler.test.js +152 -0
  155. package/dist/spec/core/src/api/userActionLifecycleHandler.test.js.map +1 -0
  156. package/dist/spec/core/src/api/utils.js +11 -0
  157. package/dist/spec/core/src/api/utils.js.map +1 -0
  158. package/dist/spec/core/src/api/utils.test.js +20 -0
  159. package/dist/spec/core/src/api/utils.test.js.map +1 -0
  160. package/dist/spec/core/src/config/types.js.map +1 -1
  161. package/dist/spec/core/src/index.js +8 -2
  162. package/dist/spec/core/src/index.js.map +1 -1
  163. package/dist/spec/core/src/transports/initialize.js +1 -35
  164. package/dist/spec/core/src/transports/initialize.js.map +1 -1
  165. package/dist/spec/core/src/transports/registerInitial.js +0 -1
  166. package/dist/spec/core/src/transports/registerInitial.js.map +1 -1
  167. package/dist/spec/core/src/transports/transports.test.js +0 -16
  168. package/dist/spec/core/src/transports/transports.test.js.map +1 -1
  169. package/dist/spec/core/src/transports/types.js.map +1 -1
  170. package/dist/spec/core/src/utils/index.js +4 -1
  171. package/dist/spec/core/src/utils/index.js.map +1 -1
  172. package/dist/spec/core/src/utils/reactive.js +104 -0
  173. package/dist/spec/core/src/utils/reactive.js.map +1 -0
  174. package/dist/spec/core/src/utils/reactive.test.js +104 -0
  175. package/dist/spec/core/src/utils/reactive.test.js.map +1 -0
  176. package/dist/spec/core/src/version.js +1 -1
  177. package/dist/spec/core/src/version.js.map +1 -1
  178. package/dist/types/api/ItemBuffer.d.ts +7 -0
  179. package/dist/types/api/apiTestHelpers.d.ts +11 -0
  180. package/dist/types/api/const.d.ts +3 -0
  181. package/dist/types/api/events/initialize.d.ts +13 -2
  182. package/dist/types/api/events/types.d.ts +11 -0
  183. package/dist/types/api/exceptions/initialize.d.ts +13 -2
  184. package/dist/types/api/exceptions/types.d.ts +2 -0
  185. package/dist/types/api/index.d.ts +3 -1
  186. package/dist/types/api/initialize.d.ts +3 -1
  187. package/dist/types/api/logs/initialize.d.ts +13 -2
  188. package/dist/types/api/logs/types.d.ts +3 -1
  189. package/dist/types/api/measurements/initialize.d.ts +13 -1
  190. package/dist/types/api/measurements/types.d.ts +2 -0
  191. package/dist/types/api/meta/initialize.d.ts +14 -2
  192. package/dist/types/api/types.d.ts +37 -0
  193. package/dist/types/api/userActionLifecycleHandler.d.ts +13 -0
  194. package/dist/types/api/utils.d.ts +2 -0
  195. package/dist/types/config/types.d.ts +21 -12
  196. package/dist/types/core/src/api/ItemBuffer.d.ts +7 -0
  197. package/dist/types/core/src/api/apiTestHelpers.d.ts +11 -0
  198. package/dist/types/core/src/api/const.d.ts +3 -0
  199. package/dist/types/core/src/api/events/initialize.d.ts +13 -2
  200. package/dist/types/core/src/api/events/types.d.ts +11 -0
  201. package/dist/types/core/src/api/exceptions/initialize.d.ts +13 -2
  202. package/dist/types/core/src/api/exceptions/types.d.ts +2 -0
  203. package/dist/types/core/src/api/index.d.ts +3 -1
  204. package/dist/types/core/src/api/initialize.d.ts +3 -1
  205. package/dist/types/core/src/api/initialize.test.d.ts +1 -0
  206. package/dist/types/core/src/api/itemBuffer.test.d.ts +1 -0
  207. package/dist/types/core/src/api/logs/initialize.d.ts +13 -2
  208. package/dist/types/core/src/api/logs/types.d.ts +3 -1
  209. package/dist/types/core/src/api/measurements/initialize.d.ts +13 -1
  210. package/dist/types/core/src/api/measurements/types.d.ts +2 -0
  211. package/dist/types/core/src/api/meta/initialize.d.ts +14 -2
  212. package/dist/types/core/src/api/types.d.ts +37 -0
  213. package/dist/types/core/src/api/userActionLifecycleHandler.d.ts +13 -0
  214. package/dist/types/core/src/api/userActionLifecycleHandler.test.d.ts +1 -0
  215. package/dist/types/core/src/api/utils.d.ts +2 -0
  216. package/dist/types/core/src/api/utils.test.d.ts +1 -0
  217. package/dist/types/core/src/config/types.d.ts +21 -12
  218. package/dist/types/core/src/index.d.ts +4 -4
  219. package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
  220. package/dist/types/core/src/transports/initialize.d.ts +2 -4
  221. package/dist/types/core/src/transports/types.d.ts +0 -1
  222. package/dist/types/core/src/utils/index.d.ts +2 -0
  223. package/dist/types/core/src/utils/reactive.d.ts +46 -0
  224. package/dist/types/core/src/utils/reactive.test.d.ts +1 -0
  225. package/dist/types/core/src/version.d.ts +1 -1
  226. package/dist/types/index.d.ts +4 -4
  227. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  228. package/dist/types/transports/initialize.d.ts +2 -4
  229. package/dist/types/transports/types.d.ts +0 -1
  230. package/dist/types/utils/index.d.ts +2 -0
  231. package/dist/types/utils/reactive.d.ts +46 -0
  232. package/dist/types/version.d.ts +1 -1
  233. package/package.json +2 -2
@@ -2,7 +2,7 @@ import type { APIEvent, LogArgsSerializer, StacktraceParser } from '../api';
2
2
  import type { Instrumentation } from '../instrumentations';
3
3
  import type { InternalLoggerLevel } from '../internalLogger';
4
4
  import type { Meta, MetaApp, MetaItem, MetaPage, MetaSession, MetaUser, MetaView } from '../metas';
5
- import type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';
5
+ import type { BatchExecutorOptions, BeforeSendHook, Transport, TransportItem } from '../transports';
6
6
  import type { UnpatchedConsole } from '../unpatchedConsole';
7
7
  import type { LogLevel } from '../utils';
8
8
  type SamplingContext = {
@@ -192,18 +192,27 @@ export interface Config<P = APIEvent> {
192
192
  generatePageId?: (location: Location) => string;
193
193
  };
194
194
  /**
195
- * Configuration for the location tracking (Grafana cloud only)
195
+ * Enable or disable geolocation tracking.
196
+ * Geolocation tracking must be enabled in the Grafana Cloud settings first.
197
+ * It cannot be enabled solely on the client side.
198
+ * This option allows control over tracking on the client side to comply with user
199
+ * privacy requirements.
196
200
  */
197
- geoLocationTracking?: {
198
- /**
199
- * Enable or disable geolocation tracking.
200
- * Geolocation tracking must be enabled in the Grafana Cloud settings first.
201
- * It cannot be enabled solely on the client side.
202
- * This option allows control over tracking on the client side to comply with user
203
- * privacy requirements.
204
- */
205
- enabled?: boolean;
206
- };
201
+ trackGeolocation?: boolean;
202
+ /**
203
+ * This is a preview feature.
204
+ * We have tested it thoroughly, but it is possible that it might not work as expected in all cases.
205
+ */
206
+ trackUserActionsPreview?: boolean;
207
+ /**
208
+ * Configure your own attribute name for tracking user actions. Default is 'data-faro-user-action-name'
209
+ */
210
+ trackUserActionsDataAttributeName?: string;
211
+ /**
212
+ * Predicate function to exclude items from user actions.
213
+ * If the function returns true, the item will be excluded from user actions.
214
+ */
215
+ trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;
207
216
  }
208
217
  export type Patterns = Array<string | RegExp>;
209
218
  export {};
@@ -1,5 +1,5 @@
1
- export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer } from './api';
2
- export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, } from './api';
1
+ export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer, apiMessageBus, USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE, } from './api';
2
+ export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, ApiMessageBusMessages, UserActionStartMessage, UserActionEndMessage, UserActionCancelMessage, UserAction, } from './api';
3
3
  export { BaseExtension } from './extensions';
4
4
  export type { Extension } from './extensions';
5
5
  export { globalObject } from './globalObject';
@@ -19,7 +19,7 @@ export { BaseTransport, getTransportBody, TransportItemType, transportItemTypeTo
19
19
  export type { BeforeSendHook, SendFn, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, } from './transports';
20
20
  export { defaultUnpatchedConsole } from './unpatchedConsole';
21
21
  export type { UnpatchedConsole } from './unpatchedConsole';
22
- export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, isEmpty, getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues, } from './utils';
23
- export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer, } from './utils';
22
+ export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, isEmpty, getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues, Observable, merge, } from './utils';
23
+ export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer, Subscription, } from './utils';
24
24
  export { VERSION } from './version';
25
25
  export { unknownString } from './consts';
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.14.0";
7
+ readonly version = "1.14.2";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -1,8 +1,6 @@
1
- import type { Config, Patterns } from '../config';
1
+ import type { Config } from '../config';
2
2
  import type { InternalLogger } from '../internalLogger';
3
3
  import type { Metas } from '../metas';
4
4
  import type { UnpatchedConsole } from '../unpatchedConsole';
5
- import type { BeforeSendHook, Transports } from './types';
6
- export declare function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean;
7
- export declare function createBeforeSendHookFromIgnorePatterns(patterns: Patterns): BeforeSendHook;
5
+ import type { Transports } from './types';
8
6
  export declare function initializeTransports(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas): Transports;
@@ -28,7 +28,6 @@ export interface TransportBody {
28
28
  export interface Transports {
29
29
  add: (...transports: Transport[]) => void;
30
30
  addBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
31
- addIgnoreErrorsPatterns: (...ignoreErrorsPatterns: Array<Patterns | undefined>) => void;
32
31
  execute: (transportItem: TransportItem) => void;
33
32
  getBeforeSendHooks: () => BeforeSendHook[];
34
33
  isPaused: () => boolean;
@@ -11,3 +11,5 @@ export { genShortID } from './shortId';
11
11
  export { getBundleId } from './sourceMaps';
12
12
  export { dateNow } from './date';
13
13
  export { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';
14
+ export { Observable, merge } from './reactive';
15
+ export type { Subscription } from './reactive';
@@ -0,0 +1,46 @@
1
+ export interface Subscription {
2
+ unsubscribe: () => void;
3
+ }
4
+ export declare class Observable<T = any> {
5
+ private subscribers;
6
+ constructor();
7
+ /**
8
+ * Subscribes a callback function to the observable.
9
+ * @param callback - The function to call when the observable emits a value.
10
+ * @returns A subscription object with an unsubscribe method to cancel the subscription.
11
+ */
12
+ subscribe(callback: (data: T) => void): Subscription;
13
+ /**
14
+ * Notifies all subscribers with the given data.
15
+ * @param data - The data to emit to all subscribers.
16
+ */
17
+ notify(data: T): void;
18
+ /**
19
+ * Subscribes a callback function to the observable and automatically unsubscribes after the first emission.
20
+ * @param callback - The function to call when the observable emits a value.
21
+ * @returns A subscription object with an unsubscribe method to cancel the subscription.
22
+ */
23
+ first(callback: (data: T) => void): Subscription;
24
+ /**
25
+ * Emits values from the source observable until the provided predicate function returns false.
26
+ * @param predicate - A function that evaluates each value emitted by the source observable.
27
+ * @returns A new observable that emits values from the source observable while the predicate returns true.
28
+ */
29
+ takeWhile(predicate: (value: T) => boolean): Observable<T>;
30
+ /**
31
+ * Unsubscribes all subscribers by clearing the subscribers array.
32
+ *
33
+ * @remarks
34
+ * This method sets the `subscribers` array to an empty array, effectively removing all current subscribers.
35
+ */
36
+ unsubscribeAll(): void;
37
+ private unsubscribe;
38
+ }
39
+ /**
40
+ * Merges multiple observables into a single observable.
41
+ *
42
+ * @template T - The type of the values emitted by the observables.
43
+ * @param {...Observable[]} observables - The observables to merge.
44
+ * @returns {Observable} A new observable that emits values from all input observables.
45
+ */
46
+ export declare function merge<T>(...observables: Array<Observable<T>>): Observable<T>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- export declare const VERSION = "1.14.0";
1
+ export declare const VERSION = "1.14.2";
@@ -1,5 +1,5 @@
1
- export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer } from './api';
2
- export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, } from './api';
1
+ export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer, apiMessageBus, USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE, } from './api';
2
+ export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, ApiMessageBusMessages, UserActionStartMessage, UserActionEndMessage, UserActionCancelMessage, UserAction, } from './api';
3
3
  export { BaseExtension } from './extensions';
4
4
  export type { Extension } from './extensions';
5
5
  export { globalObject } from './globalObject';
@@ -19,7 +19,7 @@ export { BaseTransport, getTransportBody, TransportItemType, transportItemTypeTo
19
19
  export type { BeforeSendHook, SendFn, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, } from './transports';
20
20
  export { defaultUnpatchedConsole } from './unpatchedConsole';
21
21
  export type { UnpatchedConsole } from './unpatchedConsole';
22
- export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, isEmpty, getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues, } from './utils';
23
- export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer, } from './utils';
22
+ export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, isEmpty, getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues, Observable, merge, } from './utils';
23
+ export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer, Subscription, } from './utils';
24
24
  export { VERSION } from './version';
25
25
  export { unknownString } from './consts';
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.14.0";
7
+ readonly version = "1.14.2";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -1,8 +1,6 @@
1
- import type { Config, Patterns } from '../config';
1
+ import type { Config } from '../config';
2
2
  import type { InternalLogger } from '../internalLogger';
3
3
  import type { Metas } from '../metas';
4
4
  import type { UnpatchedConsole } from '../unpatchedConsole';
5
- import type { BeforeSendHook, Transports } from './types';
6
- export declare function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean;
7
- export declare function createBeforeSendHookFromIgnorePatterns(patterns: Patterns): BeforeSendHook;
5
+ import type { Transports } from './types';
8
6
  export declare function initializeTransports(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas): Transports;
@@ -28,7 +28,6 @@ export interface TransportBody {
28
28
  export interface Transports {
29
29
  add: (...transports: Transport[]) => void;
30
30
  addBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
31
- addIgnoreErrorsPatterns: (...ignoreErrorsPatterns: Array<Patterns | undefined>) => void;
32
31
  execute: (transportItem: TransportItem) => void;
33
32
  getBeforeSendHooks: () => BeforeSendHook[];
34
33
  isPaused: () => boolean;
@@ -11,3 +11,5 @@ export { genShortID } from './shortId';
11
11
  export { getBundleId } from './sourceMaps';
12
12
  export { dateNow } from './date';
13
13
  export { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';
14
+ export { Observable, merge } from './reactive';
15
+ export type { Subscription } from './reactive';
@@ -0,0 +1,46 @@
1
+ export interface Subscription {
2
+ unsubscribe: () => void;
3
+ }
4
+ export declare class Observable<T = any> {
5
+ private subscribers;
6
+ constructor();
7
+ /**
8
+ * Subscribes a callback function to the observable.
9
+ * @param callback - The function to call when the observable emits a value.
10
+ * @returns A subscription object with an unsubscribe method to cancel the subscription.
11
+ */
12
+ subscribe(callback: (data: T) => void): Subscription;
13
+ /**
14
+ * Notifies all subscribers with the given data.
15
+ * @param data - The data to emit to all subscribers.
16
+ */
17
+ notify(data: T): void;
18
+ /**
19
+ * Subscribes a callback function to the observable and automatically unsubscribes after the first emission.
20
+ * @param callback - The function to call when the observable emits a value.
21
+ * @returns A subscription object with an unsubscribe method to cancel the subscription.
22
+ */
23
+ first(callback: (data: T) => void): Subscription;
24
+ /**
25
+ * Emits values from the source observable until the provided predicate function returns false.
26
+ * @param predicate - A function that evaluates each value emitted by the source observable.
27
+ * @returns A new observable that emits values from the source observable while the predicate returns true.
28
+ */
29
+ takeWhile(predicate: (value: T) => boolean): Observable<T>;
30
+ /**
31
+ * Unsubscribes all subscribers by clearing the subscribers array.
32
+ *
33
+ * @remarks
34
+ * This method sets the `subscribers` array to an empty array, effectively removing all current subscribers.
35
+ */
36
+ unsubscribeAll(): void;
37
+ private unsubscribe;
38
+ }
39
+ /**
40
+ * Merges multiple observables into a single observable.
41
+ *
42
+ * @template T - The type of the values emitted by the observables.
43
+ * @param {...Observable[]} observables - The observables to merge.
44
+ * @returns {Observable} A new observable that emits values from all input observables.
45
+ */
46
+ export declare function merge<T>(...observables: Array<Observable<T>>): Observable<T>;
@@ -1 +1 @@
1
- export declare const VERSION = "1.14.0";
1
+ export declare const VERSION = "1.14.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-core",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Core package of Faro.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "27e390456e4449ca286a70b9d74022b0e960074e"
66
+ "gitHead": "b115e12fe1242e502d57ef5f8439a326a80dd6b7"
67
67
  }