@grafana/faro-core 1.14.1 → 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 (198) 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/config/types.d.ts +21 -12
  19. package/dist/bundle/types/index.d.ts +4 -4
  20. package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
  21. package/dist/bundle/types/utils/index.d.ts +2 -0
  22. package/dist/bundle/types/utils/reactive.d.ts +46 -0
  23. package/dist/bundle/types/version.d.ts +1 -1
  24. package/dist/cjs/api/ItemBuffer.js +27 -0
  25. package/dist/cjs/api/ItemBuffer.js.map +1 -0
  26. package/dist/cjs/api/apiTestHelpers.js +36 -0
  27. package/dist/cjs/api/apiTestHelpers.js.map +1 -0
  28. package/dist/cjs/api/const.js +7 -0
  29. package/dist/cjs/api/const.js.map +1 -0
  30. package/dist/cjs/api/events/initialize.js +15 -6
  31. package/dist/cjs/api/events/initialize.js.map +1 -1
  32. package/dist/cjs/api/events/types.js.map +1 -1
  33. package/dist/cjs/api/exceptions/initialize.js +51 -37
  34. package/dist/cjs/api/exceptions/initialize.js.map +1 -1
  35. package/dist/cjs/api/exceptions/types.js.map +1 -1
  36. package/dist/cjs/api/index.js +7 -1
  37. package/dist/cjs/api/index.js.map +1 -1
  38. package/dist/cjs/api/initialize.js +16 -2
  39. package/dist/cjs/api/initialize.js.map +1 -1
  40. package/dist/cjs/api/logs/initialize.js +15 -6
  41. package/dist/cjs/api/logs/initialize.js.map +1 -1
  42. package/dist/cjs/api/logs/types.js.map +1 -1
  43. package/dist/cjs/api/measurements/initialize.js +12 -3
  44. package/dist/cjs/api/measurements/initialize.js.map +1 -1
  45. package/dist/cjs/api/measurements/types.js.map +1 -1
  46. package/dist/cjs/api/meta/initialize.js +2 -1
  47. package/dist/cjs/api/meta/initialize.js.map +1 -1
  48. package/dist/cjs/api/types.js.map +1 -1
  49. package/dist/cjs/api/userActionLifecycleHandler.js +59 -0
  50. package/dist/cjs/api/userActionLifecycleHandler.js.map +1 -0
  51. package/dist/cjs/config/types.js.map +1 -1
  52. package/dist/cjs/index.js +8 -2
  53. package/dist/cjs/index.js.map +1 -1
  54. package/dist/cjs/utils/index.js +4 -1
  55. package/dist/cjs/utils/index.js.map +1 -1
  56. package/dist/cjs/utils/reactive.js +104 -0
  57. package/dist/cjs/utils/reactive.js.map +1 -0
  58. package/dist/cjs/version.js +1 -1
  59. package/dist/cjs/version.js.map +1 -1
  60. package/dist/esm/api/ItemBuffer.js +21 -0
  61. package/dist/esm/api/ItemBuffer.js.map +1 -0
  62. package/dist/esm/api/apiTestHelpers.js +33 -0
  63. package/dist/esm/api/apiTestHelpers.js.map +1 -0
  64. package/dist/esm/api/const.js +4 -0
  65. package/dist/esm/api/const.js.map +1 -0
  66. package/dist/esm/api/events/initialize.js +15 -7
  67. package/dist/esm/api/events/initialize.js.map +1 -1
  68. package/dist/esm/api/events/types.js.map +1 -1
  69. package/dist/esm/api/exceptions/initialize.js +47 -34
  70. package/dist/esm/api/exceptions/initialize.js.map +1 -1
  71. package/dist/esm/api/exceptions/types.js.map +1 -1
  72. package/dist/esm/api/index.js +2 -0
  73. package/dist/esm/api/index.js.map +1 -1
  74. package/dist/esm/api/initialize.js +15 -1
  75. package/dist/esm/api/initialize.js.map +1 -1
  76. package/dist/esm/api/logs/initialize.js +12 -4
  77. package/dist/esm/api/logs/initialize.js.map +1 -1
  78. package/dist/esm/api/logs/types.js.map +1 -1
  79. package/dist/esm/api/measurements/initialize.js +12 -4
  80. package/dist/esm/api/measurements/initialize.js.map +1 -1
  81. package/dist/esm/api/measurements/types.js.map +1 -1
  82. package/dist/esm/api/meta/initialize.js +1 -1
  83. package/dist/esm/api/meta/initialize.js.map +1 -1
  84. package/dist/esm/api/types.js.map +1 -1
  85. package/dist/esm/api/userActionLifecycleHandler.js +43 -0
  86. package/dist/esm/api/userActionLifecycleHandler.js.map +1 -0
  87. package/dist/esm/config/types.js.map +1 -1
  88. package/dist/esm/index.js +2 -2
  89. package/dist/esm/index.js.map +1 -1
  90. package/dist/esm/utils/index.js +1 -0
  91. package/dist/esm/utils/index.js.map +1 -1
  92. package/dist/esm/utils/reactive.js +93 -0
  93. package/dist/esm/utils/reactive.js.map +1 -0
  94. package/dist/esm/version.js +1 -1
  95. package/dist/esm/version.js.map +1 -1
  96. package/dist/spec/core/src/api/ItemBuffer.js +27 -0
  97. package/dist/spec/core/src/api/ItemBuffer.js.map +1 -0
  98. package/dist/spec/core/src/api/apiTestHelpers.js +36 -0
  99. package/dist/spec/core/src/api/apiTestHelpers.js.map +1 -0
  100. package/dist/spec/core/src/api/const.js +7 -0
  101. package/dist/spec/core/src/api/const.js.map +1 -0
  102. package/dist/spec/core/src/api/events/initialize.js +15 -6
  103. package/dist/spec/core/src/api/events/initialize.js.map +1 -1
  104. package/dist/spec/core/src/api/events/initialize.test.js +57 -0
  105. package/dist/spec/core/src/api/events/initialize.test.js.map +1 -1
  106. package/dist/spec/core/src/api/events/types.js.map +1 -1
  107. package/dist/spec/core/src/api/exceptions/initialize.js +51 -37
  108. package/dist/spec/core/src/api/exceptions/initialize.js.map +1 -1
  109. package/dist/spec/core/src/api/exceptions/initialize.test.js +62 -3
  110. package/dist/spec/core/src/api/exceptions/initialize.test.js.map +1 -1
  111. package/dist/spec/core/src/api/exceptions/types.js.map +1 -1
  112. package/dist/spec/core/src/api/index.js +7 -1
  113. package/dist/spec/core/src/api/index.js.map +1 -1
  114. package/dist/spec/core/src/api/initialize.js +16 -2
  115. package/dist/spec/core/src/api/initialize.js.map +1 -1
  116. package/dist/spec/core/src/api/initialize.test.js +73 -0
  117. package/dist/spec/core/src/api/initialize.test.js.map +1 -0
  118. package/dist/spec/core/src/api/itemBuffer.test.js +36 -0
  119. package/dist/spec/core/src/api/itemBuffer.test.js.map +1 -0
  120. package/dist/spec/core/src/api/logs/initialize.js +15 -6
  121. package/dist/spec/core/src/api/logs/initialize.js.map +1 -1
  122. package/dist/spec/core/src/api/logs/initialize.test.js +98 -0
  123. package/dist/spec/core/src/api/logs/initialize.test.js.map +1 -1
  124. package/dist/spec/core/src/api/logs/types.js.map +1 -1
  125. package/dist/spec/core/src/api/measurements/initialize.js +12 -3
  126. package/dist/spec/core/src/api/measurements/initialize.js.map +1 -1
  127. package/dist/spec/core/src/api/measurements/initialize.test.js +105 -0
  128. package/dist/spec/core/src/api/measurements/initialize.test.js.map +1 -1
  129. package/dist/spec/core/src/api/measurements/types.js.map +1 -1
  130. package/dist/spec/core/src/api/meta/initialize.js +2 -1
  131. package/dist/spec/core/src/api/meta/initialize.js.map +1 -1
  132. package/dist/spec/core/src/api/meta/initilialize.test.js +1 -3
  133. package/dist/spec/core/src/api/meta/initilialize.test.js.map +1 -1
  134. package/dist/spec/core/src/api/types.js.map +1 -1
  135. package/dist/spec/core/src/api/userActionLifecycleHandler.js +59 -0
  136. package/dist/spec/core/src/api/userActionLifecycleHandler.js.map +1 -0
  137. package/dist/spec/core/src/api/userActionLifecycleHandler.test.js +152 -0
  138. package/dist/spec/core/src/api/userActionLifecycleHandler.test.js.map +1 -0
  139. package/dist/spec/core/src/config/types.js.map +1 -1
  140. package/dist/spec/core/src/index.js +8 -2
  141. package/dist/spec/core/src/index.js.map +1 -1
  142. package/dist/spec/core/src/utils/index.js +4 -1
  143. package/dist/spec/core/src/utils/index.js.map +1 -1
  144. package/dist/spec/core/src/utils/reactive.js +104 -0
  145. package/dist/spec/core/src/utils/reactive.js.map +1 -0
  146. package/dist/spec/core/src/utils/reactive.test.js +104 -0
  147. package/dist/spec/core/src/utils/reactive.test.js.map +1 -0
  148. package/dist/spec/core/src/version.js +1 -1
  149. package/dist/spec/core/src/version.js.map +1 -1
  150. package/dist/types/api/ItemBuffer.d.ts +7 -0
  151. package/dist/types/api/apiTestHelpers.d.ts +11 -0
  152. package/dist/types/api/const.d.ts +3 -0
  153. package/dist/types/api/events/initialize.d.ts +13 -2
  154. package/dist/types/api/events/types.d.ts +11 -0
  155. package/dist/types/api/exceptions/initialize.d.ts +13 -2
  156. package/dist/types/api/exceptions/types.d.ts +2 -0
  157. package/dist/types/api/index.d.ts +3 -1
  158. package/dist/types/api/initialize.d.ts +3 -1
  159. package/dist/types/api/logs/initialize.d.ts +13 -2
  160. package/dist/types/api/logs/types.d.ts +3 -1
  161. package/dist/types/api/measurements/initialize.d.ts +13 -1
  162. package/dist/types/api/measurements/types.d.ts +2 -0
  163. package/dist/types/api/meta/initialize.d.ts +14 -2
  164. package/dist/types/api/types.d.ts +37 -0
  165. package/dist/types/api/userActionLifecycleHandler.d.ts +13 -0
  166. package/dist/types/config/types.d.ts +21 -12
  167. package/dist/types/core/src/api/ItemBuffer.d.ts +7 -0
  168. package/dist/types/core/src/api/apiTestHelpers.d.ts +11 -0
  169. package/dist/types/core/src/api/const.d.ts +3 -0
  170. package/dist/types/core/src/api/events/initialize.d.ts +13 -2
  171. package/dist/types/core/src/api/events/types.d.ts +11 -0
  172. package/dist/types/core/src/api/exceptions/initialize.d.ts +13 -2
  173. package/dist/types/core/src/api/exceptions/types.d.ts +2 -0
  174. package/dist/types/core/src/api/index.d.ts +3 -1
  175. package/dist/types/core/src/api/initialize.d.ts +3 -1
  176. package/dist/types/core/src/api/initialize.test.d.ts +1 -0
  177. package/dist/types/core/src/api/itemBuffer.test.d.ts +1 -0
  178. package/dist/types/core/src/api/logs/initialize.d.ts +13 -2
  179. package/dist/types/core/src/api/logs/types.d.ts +3 -1
  180. package/dist/types/core/src/api/measurements/initialize.d.ts +13 -1
  181. package/dist/types/core/src/api/measurements/types.d.ts +2 -0
  182. package/dist/types/core/src/api/meta/initialize.d.ts +14 -2
  183. package/dist/types/core/src/api/types.d.ts +37 -0
  184. package/dist/types/core/src/api/userActionLifecycleHandler.d.ts +13 -0
  185. package/dist/types/core/src/api/userActionLifecycleHandler.test.d.ts +1 -0
  186. package/dist/types/core/src/config/types.d.ts +21 -12
  187. package/dist/types/core/src/index.d.ts +4 -4
  188. package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
  189. package/dist/types/core/src/utils/index.d.ts +2 -0
  190. package/dist/types/core/src/utils/reactive.d.ts +46 -0
  191. package/dist/types/core/src/utils/reactive.test.d.ts +1 -0
  192. package/dist/types/core/src/version.d.ts +1 -1
  193. package/dist/types/index.d.ts +4 -4
  194. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  195. package/dist/types/utils/index.d.ts +2 -0
  196. package/dist/types/utils/reactive.d.ts +46 -0
  197. package/dist/types/version.d.ts +1 -1
  198. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userActionLifecycleHandler.test.js","sourceRoot":"","sources":["../../../../../src/api/userActionLifecycleHandler.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wBAUY;AACZ,8CAA+C;AAE/C,mDAAkD;AAClD,iCAAwH;AACxH,2EAAgF;AAEhF,QAAQ,CAAC,4BAA4B,EAAE;IACrC,EAAE,CAAC,mFAAmF,EAAE;QACt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,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n type APIEvent,\n ApiMessageBusMessages,\n type Config,\n dateNow,\n EventEvent,\n type Meta,\n TransportItem,\n TransportItemType,\n UserActionStartMessage,\n} from '..';\nimport { Observable } from '../utils/reactive';\n\nimport { mockTransports } from './apiTestHelpers';\nimport { USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE } from './const';\nimport { createUserActionLifecycleHandler } from './userActionLifecycleHandler';\n\ndescribe('userActionLifecycleHandler', () => {\n it('assigns the user-action-start message to the message variable when it receives it', () => {\n const apiMessageBus = new Observable<ApiMessageBusMessages>();\n\n const { getMessage } = createUserActionLifecycleHandler({\n apiMessageBus,\n transports: mockTransports,\n config: {} as Config,\n });\n\n const message: UserActionStartMessage = {\n type: USER_ACTION_START_MESSAGE_TYPE,\n name: '',\n startTime: 0,\n parentId: '',\n };\n\n apiMessageBus.notify(message);\n\n expect(getMessage()).toEqual(message);\n });\n\n it('When it receives a user-action-cancel message, it resets the cached message flushes the buffer and sends the items to the transports', () => {\n const apiMessageBus = new Observable<ApiMessageBusMessages>();\n\n const mockExecute = jest.fn();\n const { actionBuffer, getMessage } = createUserActionLifecycleHandler({\n apiMessageBus,\n transports: {\n ...mockTransports,\n execute: mockExecute,\n },\n config: {} as Config,\n });\n\n const message: UserActionStartMessage = {\n type: USER_ACTION_START_MESSAGE_TYPE,\n name: '',\n startTime: 0,\n parentId: '',\n };\n\n apiMessageBus.notify(message);\n\n const item = { type: TransportItemType.EVENT, payload: {}, meta: {} as Meta };\n actionBuffer.addItem(item);\n\n const cancelMessage: ApiMessageBusMessages = {\n type: USER_ACTION_CANCEL_MESSAGE_TYPE,\n name: 'pointerdown',\n };\n\n apiMessageBus.notify(cancelMessage);\n\n expect(getMessage()).toBeUndefined();\n expect(mockExecute).toHaveBeenCalledTimes(1);\n expect(mockExecute).toHaveBeenCalledWith(item);\n expect(actionBuffer.size()).toEqual(0);\n });\n\n it('When it receives a user-action-end message, it sends the items to the transports with the action parentId and name', () => {\n const apiMessageBus = new Observable<ApiMessageBusMessages>();\n\n const mockExecute = jest.fn();\n const { actionBuffer } = createUserActionLifecycleHandler({\n apiMessageBus,\n transports: {\n ...mockTransports,\n execute: mockExecute,\n },\n config: {} as Config,\n });\n\n const message: UserActionStartMessage = {\n type: USER_ACTION_START_MESSAGE_TYPE,\n name: 'pointerdown',\n startTime: 0,\n parentId: '123',\n };\n\n apiMessageBus.notify(message);\n\n const item = { type: TransportItemType.EVENT, payload: {}, meta: {} as Meta };\n actionBuffer.addItem(item);\n\n const endMessage: ApiMessageBusMessages = {\n type: USER_ACTION_END_MESSAGE_TYPE,\n id: '123',\n name: 'pointerdown',\n startTime: 100,\n endTime: 120,\n duration: 20,\n eventType: 'keydown',\n };\n\n apiMessageBus.notify(endMessage);\n\n expect(mockExecute).toHaveBeenCalledTimes(1);\n expect(mockExecute).toHaveBeenCalledWith({\n ...item,\n payload: {\n ...item.payload,\n action: {\n parentId: '123',\n name: 'pointerdown',\n },\n },\n });\n });\n\n it('excludes items defined by the isExcludeFromUserAction function from the user actions', () => {\n const apiMessageBus = new Observable<ApiMessageBusMessages>();\n\n const mockExecute = jest.fn();\n const { actionBuffer, getMessage } = createUserActionLifecycleHandler({\n apiMessageBus,\n transports: {\n ...mockTransports,\n execute: mockExecute,\n },\n config: {\n trackUserActionsExcludeItem(item) {\n return item.type === TransportItemType.EVENT && (item.payload as EventEvent).name === 'i-am-excluded';\n },\n } as Config,\n });\n\n const message: UserActionStartMessage = {\n type: USER_ACTION_START_MESSAGE_TYPE,\n name: 'pointerdown',\n startTime: 0,\n parentId: '123',\n };\n\n apiMessageBus.notify(message);\n\n const itemEvent = { type: TransportItemType.EVENT, payload: {}, meta: {} as Meta };\n actionBuffer.addItem(itemEvent);\n\n const itemMeasurement: TransportItem<APIEvent> = {\n type: TransportItemType.MEASUREMENT,\n payload: { type: 'web-vitals', values: {}, timestamp: dateNow().toString() },\n meta: {} as Meta,\n };\n actionBuffer.addItem(itemMeasurement);\n\n const itemEventExcluded: TransportItem<EventEvent> = {\n type: TransportItemType.EVENT,\n payload: {\n timestamp: dateNow().toString(),\n name: 'i-am-excluded',\n },\n meta: {} as Meta,\n };\n actionBuffer.addItem(itemEventExcluded);\n\n const endMessage: ApiMessageBusMessages = {\n type: USER_ACTION_END_MESSAGE_TYPE,\n id: '123',\n name: 'pointerdown',\n startTime: 100,\n endTime: 120,\n duration: 20,\n eventType: 'keydown',\n };\n\n apiMessageBus.notify(endMessage);\n\n expect(mockExecute).toHaveBeenCalledTimes(3);\n expect(mockExecute).toHaveBeenNthCalledWith(1, {\n ...itemEvent,\n payload: {\n ...itemEvent.payload,\n action: {\n parentId: '123',\n name: 'pointerdown',\n },\n },\n });\n expect(mockExecute).toHaveBeenNthCalledWith(2, itemMeasurement);\n expect(mockExecute).toHaveBeenNthCalledWith(3, itemEventExcluded);\n expect(getMessage()).toBeUndefined();\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, LogArgsSerializer, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { Meta, MetaApp, MetaItem, MetaPage, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport type { LogLevel } from '../utils';\n\ntype SamplingContext = {\n metas: Meta;\n};\n\nexport interface Config<P = APIEvent> {\n /**\n * Application metadata\n */\n app: MetaApp;\n\n /**\n * Set max number and max interval for signals to be batched before sending\n */\n batching?: BatchExecutorOptions;\n\n /**\n * A flag for toggling deduplication for signals\n */\n dedupe: boolean;\n\n /**\n * The key (name) to use for the global Faro object (default: 'faro')\n */\n globalObjectKey: string;\n\n /**\n * The (custom) instrumentations to use with Faro\n */\n instrumentations: Instrumentation[];\n\n /**\n * The level of information printed to console for internal messages (default: LogLevel.ERROR)\n */\n internalLoggerLevel: InternalLoggerLevel;\n\n /**\n * Isolate Faro instance from other Faro instances on the same page. (default: false)\n */\n isolate: boolean;\n\n /**\n * Custom function to serialize log arguments\n */\n logArgsSerializer?: LogArgsSerializer;\n\n /**\n * Add custom Metas during Faro initialization\n */\n metas: MetaItem[];\n\n /**\n * Custom function used to parse stack traces\n */\n parseStacktrace: StacktraceParser;\n\n /**\n * Pause sending data (default: false)\n */\n paused: boolean;\n\n /**\n * Prevent Faro from exposing itself to the global object (default: false)\n */\n preventGlobalExposure: boolean;\n\n /**\n * The transports to use for sending beacons\n */\n transports: Transport[];\n\n /**\n * Some instrumentations might override the default console methods but Faro instance provides a\n * way to access the unmodified console methods.\n *\n * faro.unpatchedConsole.log('This is a log');\n * faro.unpatchedConsole.warn('This is a warning');\n */\n unpatchedConsole: UnpatchedConsole;\n\n /**\n * Function which invoked before pushing event to transport. Can be used to modify or filter events\n */\n beforeSend?: BeforeSendHook<P>;\n\n /**\n * Error message patterns for errors that should be ignored\n */\n ignoreErrors?: Patterns;\n\n /**\n * Path patterns for Endpoints that should be ignored form being tracked\n */\n ignoreUrls?: Patterns;\n\n /**\n * Configuration for the built in session tracker\n */\n sessionTracking?: {\n /**\n * Enable session tracking (default: true)\n */\n enabled?: boolean;\n /**\n * Wether to use sticky sessions (default: false)\n */\n persistent?: boolean;\n /**\n * Session metadata object to be used when initializing session tracking\n */\n session?: MetaSession;\n /**\n * How long is a sticky session valid for recurring users (default: 15 minutes)\n */\n maxSessionPersistenceTime?: number;\n /**\n * Called each time a session changes. This can be when a new session is created or when an existing session is updated.\n * @param oldSession\n * @param newSession\n */\n onSessionChange?: (oldSession: MetaSession | null, newSession: MetaSession) => void;\n /**\n * Then sampling rate for the session based sampler (default: 1). If a session is not part of a sample, no signals for this session are tracked.\n */\n samplingRate?: number;\n /**\n * Custom sampler function if custom sampling logic is needed.\n * @param context\n */\n sampler?: (context: SamplingContext) => number;\n /**\n * Custom function to generate session id. If available Faro uses this function instead of the internal one.\n */\n generateSessionId?: () => string;\n };\n\n /**\n * Meta object for user data\n */\n user?: MetaUser;\n\n /**\n * Meta object for view data\n */\n view?: MetaView;\n\n eventDomain?: string;\n\n /**\n * Only resource timings for fetch and xhr requests are tracked by default. Set this to true to track all resources (default: false).\n */\n trackResources?: boolean;\n\n /**\n * Track web vitals attribution data (default: false)\n */\n trackWebVitalsAttribution?: boolean;\n\n /**\n * Configuration for the web vitals instrumentation\n */\n webVitalsInstrumentation?: {\n /**\n * Report all changes for web vitals (default: false)\n *\n * In most cases, you only want the callback function to be called when the metric is ready to be reported.\n * However, it is possible to report every change (e.g. each larger layout shift as it happens)\n * by setting reportAllChanges to true.\n *\n * This can be useful when debugging, but in general using reportAllChanges is not needed (or recommended)\n * for measuring these metrics in production.\n */\n reportAllChanges?: boolean;\n };\n\n /**\n * Configuration for the console instrumentation\n */\n consoleInstrumentation?: {\n /**\n * Configure what console levels should be captured by Faro. By default the following levels\n * are disabled: console.debug, console.trace, console.log\n *\n * If you want to collect all levels set captureConsoleDisabledLevels: [];\n * If you want to disable only some levels set captureConsoleDisabledLevels: [LogLevel.DEBUG, LogLevel.TRACE];\n */\n disabledLevels?: LogLevel[];\n /*\n * By default, Faro sends an error for console.error calls. If you want to send a log instead, set this to true.\n */\n consoleErrorAsLog?: boolean;\n\n /**\n * If true, use the default Faro error serializer for console.error calls. If false, simply call toString() on the error arguments.\n * If enabled, payloads containing serialized errors may become very large. If left disabled, some error details may be lost.\n * (default: false)\n */\n serializeErrors?: boolean;\n\n /**\n * Custom function to serialize Error arguments\n */\n errorSerializer?: LogArgsSerializer;\n };\n\n /**\n * Configuration for the page tracking\n */\n pageTracking?: {\n /**\n * The page meta for initial page settings\n */\n page?: MetaPage;\n\n /**\n * Allows to provide a template for the page id\n */\n generatePageId?: (location: Location) => string;\n };\n\n /**\n * Configuration for the location tracking (Grafana cloud only)\n */\n geoLocationTracking?: {\n /**\n * Enable or disable geolocation tracking.\n * Geolocation tracking must be enabled in the Grafana Cloud settings first.\n * It cannot be enabled solely on the client side.\n * This option allows control over tracking on the client side to comply with user\n * privacy requirements.\n */\n enabled?: boolean;\n };\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, LogArgsSerializer, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { Meta, MetaApp, MetaItem, MetaPage, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport, TransportItem } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport type { LogLevel } from '../utils';\n\ntype SamplingContext = {\n metas: Meta;\n};\n\nexport interface Config<P = APIEvent> {\n /**\n * Application metadata\n */\n app: MetaApp;\n\n /**\n * Set max number and max interval for signals to be batched before sending\n */\n batching?: BatchExecutorOptions;\n\n /**\n * A flag for toggling deduplication for signals\n */\n dedupe: boolean;\n\n /**\n * The key (name) to use for the global Faro object (default: 'faro')\n */\n globalObjectKey: string;\n\n /**\n * The (custom) instrumentations to use with Faro\n */\n instrumentations: Instrumentation[];\n\n /**\n * The level of information printed to console for internal messages (default: LogLevel.ERROR)\n */\n internalLoggerLevel: InternalLoggerLevel;\n\n /**\n * Isolate Faro instance from other Faro instances on the same page. (default: false)\n */\n isolate: boolean;\n\n /**\n * Custom function to serialize log arguments\n */\n logArgsSerializer?: LogArgsSerializer;\n\n /**\n * Add custom Metas during Faro initialization\n */\n metas: MetaItem[];\n\n /**\n * Custom function used to parse stack traces\n */\n parseStacktrace: StacktraceParser;\n\n /**\n * Pause sending data (default: false)\n */\n paused: boolean;\n\n /**\n * Prevent Faro from exposing itself to the global object (default: false)\n */\n preventGlobalExposure: boolean;\n\n /**\n * The transports to use for sending beacons\n */\n transports: Transport[];\n\n /**\n * Some instrumentations might override the default console methods but Faro instance provides a\n * way to access the unmodified console methods.\n *\n * faro.unpatchedConsole.log('This is a log');\n * faro.unpatchedConsole.warn('This is a warning');\n */\n unpatchedConsole: UnpatchedConsole;\n\n /**\n * Function which invoked before pushing event to transport. Can be used to modify or filter events\n */\n beforeSend?: BeforeSendHook<P>;\n\n /**\n * Error message patterns for errors that should be ignored\n */\n ignoreErrors?: Patterns;\n\n /**\n * Path patterns for Endpoints that should be ignored form being tracked\n */\n ignoreUrls?: Patterns;\n\n /**\n * Configuration for the built in session tracker\n */\n sessionTracking?: {\n /**\n * Enable session tracking (default: true)\n */\n enabled?: boolean;\n /**\n * Wether to use sticky sessions (default: false)\n */\n persistent?: boolean;\n /**\n * Session metadata object to be used when initializing session tracking\n */\n session?: MetaSession;\n /**\n * How long is a sticky session valid for recurring users (default: 15 minutes)\n */\n maxSessionPersistenceTime?: number;\n /**\n * Called each time a session changes. This can be when a new session is created or when an existing session is updated.\n * @param oldSession\n * @param newSession\n */\n onSessionChange?: (oldSession: MetaSession | null, newSession: MetaSession) => void;\n /**\n * Then sampling rate for the session based sampler (default: 1). If a session is not part of a sample, no signals for this session are tracked.\n */\n samplingRate?: number;\n /**\n * Custom sampler function if custom sampling logic is needed.\n * @param context\n */\n sampler?: (context: SamplingContext) => number;\n /**\n * Custom function to generate session id. If available Faro uses this function instead of the internal one.\n */\n generateSessionId?: () => string;\n };\n\n /**\n * Meta object for user data\n */\n user?: MetaUser;\n\n /**\n * Meta object for view data\n */\n view?: MetaView;\n\n eventDomain?: string;\n\n /**\n * Only resource timings for fetch and xhr requests are tracked by default. Set this to true to track all resources (default: false).\n */\n trackResources?: boolean;\n\n /**\n * Track web vitals attribution data (default: false)\n */\n trackWebVitalsAttribution?: boolean;\n\n /**\n * Configuration for the web vitals instrumentation\n */\n webVitalsInstrumentation?: {\n /**\n * Report all changes for web vitals (default: false)\n *\n * In most cases, you only want the callback function to be called when the metric is ready to be reported.\n * However, it is possible to report every change (e.g. each larger layout shift as it happens)\n * by setting reportAllChanges to true.\n *\n * This can be useful when debugging, but in general using reportAllChanges is not needed (or recommended)\n * for measuring these metrics in production.\n */\n reportAllChanges?: boolean;\n };\n\n /**\n * Configuration for the console instrumentation\n */\n consoleInstrumentation?: {\n /**\n * Configure what console levels should be captured by Faro. By default the following levels\n * are disabled: console.debug, console.trace, console.log\n *\n * If you want to collect all levels set captureConsoleDisabledLevels: [];\n * If you want to disable only some levels set captureConsoleDisabledLevels: [LogLevel.DEBUG, LogLevel.TRACE];\n */\n disabledLevels?: LogLevel[];\n /*\n * By default, Faro sends an error for console.error calls. If you want to send a log instead, set this to true.\n */\n consoleErrorAsLog?: boolean;\n\n /**\n * If true, use the default Faro error serializer for console.error calls. If false, simply call toString() on the error arguments.\n * If enabled, payloads containing serialized errors may become very large. If left disabled, some error details may be lost.\n * (default: false)\n */\n serializeErrors?: boolean;\n\n /**\n * Custom function to serialize Error arguments\n */\n errorSerializer?: LogArgsSerializer;\n };\n\n /**\n * Configuration for the page tracking\n */\n pageTracking?: {\n /**\n * The page meta for initial page settings\n */\n page?: MetaPage;\n\n /**\n * Allows to provide a template for the page id\n */\n generatePageId?: (location: Location) => string;\n };\n\n /**\n * Enable or disable geolocation tracking.\n * Geolocation tracking must be enabled in the Grafana Cloud settings first.\n * It cannot be enabled solely on the client side.\n * This option allows control over tracking on the client side to comply with user\n * privacy requirements.\n */\n trackGeolocation?: boolean;\n\n /**\n * This is a preview feature.\n * We have tested it thoroughly, but it is possible that it might not work as expected in all cases.\n */\n // TODO: remove preview postfix when feature is ga\n trackUserActionsPreview?: boolean;\n\n /**\n * Configure your own attribute name for tracking user actions. Default is 'data-faro-user-action-name'\n */\n trackUserActionsDataAttributeName?: string;\n\n /**\n * Predicate function to exclude items from user actions.\n * If the function returns true, the item will be excluded from user actions.\n */\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
@@ -14,12 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.deepEqual = exports.createPromiseBuffer = exports.allLogLevels = exports.defaultUnpatchedConsole = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.getTransportBody = exports.BaseTransport = exports.setInternalFaroOnGlobalObject = exports.isInternalFaroOnGlobalObject = exports.internalGlobalObjectKey = exports.getInternalFaroFromGlobalObject = exports.faro = exports.InternalLoggerLevel = exports.defaultInternalLoggerLevel = exports.createInternalLogger = exports.BaseInstrumentation = exports.defaultGlobalObjectKey = exports.defaultBatchingConfig = exports.initializeFaro = exports.globalObject = exports.BaseExtension = exports.defaultErrorArgsSerializer = exports.defaultLogArgsSerializer = exports.defaultExceptionType = void 0;
18
- exports.unknownString = exports.VERSION = exports.stringifyObjectValues = exports.stringifyExternalJson = exports.getCircularDependencyReplacer = exports.isEmpty = exports.dateNow = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = void 0;
17
+ exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.deepEqual = exports.createPromiseBuffer = exports.allLogLevels = exports.defaultUnpatchedConsole = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.getTransportBody = exports.BaseTransport = exports.setInternalFaroOnGlobalObject = exports.isInternalFaroOnGlobalObject = exports.internalGlobalObjectKey = exports.getInternalFaroFromGlobalObject = exports.faro = exports.InternalLoggerLevel = exports.defaultInternalLoggerLevel = exports.createInternalLogger = exports.BaseInstrumentation = exports.defaultGlobalObjectKey = exports.defaultBatchingConfig = exports.initializeFaro = exports.globalObject = exports.BaseExtension = exports.USER_ACTION_START_MESSAGE_TYPE = exports.USER_ACTION_END_MESSAGE_TYPE = exports.USER_ACTION_CANCEL_MESSAGE_TYPE = exports.apiMessageBus = exports.defaultErrorArgsSerializer = exports.defaultLogArgsSerializer = exports.defaultExceptionType = void 0;
18
+ exports.unknownString = exports.VERSION = exports.merge = exports.Observable = exports.stringifyObjectValues = exports.stringifyExternalJson = exports.getCircularDependencyReplacer = exports.isEmpty = exports.dateNow = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = void 0;
19
19
  var api_1 = require("./api");
20
20
  Object.defineProperty(exports, "defaultExceptionType", { enumerable: true, get: function () { return api_1.defaultExceptionType; } });
21
21
  Object.defineProperty(exports, "defaultLogArgsSerializer", { enumerable: true, get: function () { return api_1.defaultLogArgsSerializer; } });
22
22
  Object.defineProperty(exports, "defaultErrorArgsSerializer", { enumerable: true, get: function () { return api_1.defaultErrorArgsSerializer; } });
23
+ Object.defineProperty(exports, "apiMessageBus", { enumerable: true, get: function () { return api_1.apiMessageBus; } });
24
+ Object.defineProperty(exports, "USER_ACTION_CANCEL_MESSAGE_TYPE", { enumerable: true, get: function () { return api_1.USER_ACTION_CANCEL_MESSAGE_TYPE; } });
25
+ Object.defineProperty(exports, "USER_ACTION_END_MESSAGE_TYPE", { enumerable: true, get: function () { return api_1.USER_ACTION_END_MESSAGE_TYPE; } });
26
+ Object.defineProperty(exports, "USER_ACTION_START_MESSAGE_TYPE", { enumerable: true, get: function () { return api_1.USER_ACTION_START_MESSAGE_TYPE; } });
23
27
  var extensions_1 = require("./extensions");
24
28
  Object.defineProperty(exports, "BaseExtension", { enumerable: true, get: function () { return extensions_1.BaseExtension; } });
25
29
  var globalObject_1 = require("./globalObject");
@@ -91,6 +95,8 @@ Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () {
91
95
  Object.defineProperty(exports, "getCircularDependencyReplacer", { enumerable: true, get: function () { return utils_1.getCircularDependencyReplacer; } });
92
96
  Object.defineProperty(exports, "stringifyExternalJson", { enumerable: true, get: function () { return utils_1.stringifyExternalJson; } });
93
97
  Object.defineProperty(exports, "stringifyObjectValues", { enumerable: true, get: function () { return utils_1.stringifyObjectValues; } });
98
+ Object.defineProperty(exports, "Observable", { enumerable: true, get: function () { return utils_1.Observable; } });
99
+ Object.defineProperty(exports, "merge", { enumerable: true, get: function () { return utils_1.merge; } });
94
100
  var version_1 = require("./version");
95
101
  Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
96
102
  var consts_1 = require("./consts");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6BAAmG;AAA1F,2GAAA,oBAAoB,OAAA;AAAE,+GAAA,wBAAwB,OAAA;AAAE,iHAAA,0BAA0B,OAAA;AA8BnF,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAGtB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,2CAA8C;AAArC,4GAAA,cAAc,OAAA;AAEvB,mCAAyE;AAAhE,+GAAA,qBAAqB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AAGtD,uDAAyD;AAAhD,uHAAA,mBAAmB,OA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V,mGAAA,UAAU,OAAA;AACV,iGAAA,QAAQ,OAAA;AACR,oGAAA,WAAW,OAAA;AACX,iGAAA,QAAQ,OAAA;AACR,6FAAA,IAAI,OAAA;AACJ,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,sHAAA,6BAA6B,OAAA;AAC7B,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AAavB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAEhB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA","sourcesContent":["export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer } from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogArgsSerializer,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\n PushEventOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n} from './api';\n\nexport { BaseExtension } from './extensions';\nexport type { Extension } from './extensions';\n\nexport { globalObject } from './globalObject';\nexport type { GlobalObject } from './globalObject';\n\nexport { initializeFaro } from './initialize';\n\nexport { defaultBatchingConfig, defaultGlobalObjectKey } from './config';\nexport type { Config, Patterns } from './config';\n\nexport { BaseInstrumentation } from './instrumentations';\nexport type { Instrumentation, Instrumentations } from './instrumentations';\n\nexport { createInternalLogger, defaultInternalLoggerLevel, InternalLoggerLevel } from './internalLogger';\nexport type { InternalLogger } from './internalLogger';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n MetaOverrides,\n} from './metas';\n\nexport {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport * from './semantic';\n\nexport { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';\nexport type {\n BeforeSendHook,\n SendFn,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n} from './transports';\n\nexport { defaultUnpatchedConsole } from './unpatchedConsole';\nexport type { UnpatchedConsole } from './unpatchedConsole';\n\nexport {\n allLogLevels,\n createPromiseBuffer,\n deepEqual,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n LogLevel,\n noop,\n dateNow,\n isEmpty,\n getCircularDependencyReplacer,\n stringifyExternalJson,\n stringifyObjectValues,\n} from './utils';\nexport type {\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BufferItem,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n} from './utils';\n\nexport { VERSION } from './version';\n\nexport { unknownString } from './consts';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6BAQe;AAPb,2GAAA,oBAAoB,OAAA;AACpB,+GAAA,wBAAwB,OAAA;AACxB,iHAAA,0BAA0B,OAAA;AAC1B,oGAAA,aAAa,OAAA;AACb,sHAAA,+BAA+B,OAAA;AAC/B,mHAAA,4BAA4B,OAAA;AAC5B,qHAAA,8BAA8B,OAAA;AAoChC,2CAA6C;AAApC,2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AM,OAAA;AACN,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,oGAAA,WAAW,OAAA;AACX,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,yGAAA,gBAAgB,OAAA;AAChB,mGAAA,UAAU,OAAA;AACV,mGAAA,UAAU,OAAA;AACV,iGAAA,QAAQ,OAAA;AACR,oGAAA,WAAW,OAAA;AACX,iGAAA,QAAQ,OAAA;AACR,6FAAA,IAAI,OAAA;AACJ,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,sHAAA,6BAA6B,OAAA;AAC7B,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,mGAAA,UAAU,OAAA;AACV,8FAAA,KAAK,OAAA;AAcP,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAEhB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA","sourcesContent":["export {\n defaultExceptionType,\n defaultLogArgsSerializer,\n defaultErrorArgsSerializer,\n apiMessageBus,\n USER_ACTION_CANCEL_MESSAGE_TYPE,\n USER_ACTION_END_MESSAGE_TYPE,\n USER_ACTION_START_MESSAGE_TYPE,\n} from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogArgsSerializer,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\n PushEventOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n ApiMessageBusMessages,\n UserActionStartMessage,\n UserActionEndMessage,\n UserActionCancelMessage,\n UserAction,\n} from './api';\n\nexport { BaseExtension } from './extensions';\nexport type { Extension } from './extensions';\n\nexport { globalObject } from './globalObject';\nexport type { GlobalObject } from './globalObject';\n\nexport { initializeFaro } from './initialize';\n\nexport { defaultBatchingConfig, defaultGlobalObjectKey } from './config';\nexport type { Config, Patterns } from './config';\n\nexport { BaseInstrumentation } from './instrumentations';\nexport type { Instrumentation, Instrumentations } from './instrumentations';\n\nexport { createInternalLogger, defaultInternalLoggerLevel, InternalLoggerLevel } from './internalLogger';\nexport type { InternalLogger } from './internalLogger';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n MetaOverrides,\n} from './metas';\n\nexport {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport * from './semantic';\n\nexport { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';\nexport type {\n BeforeSendHook,\n SendFn,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n} from './transports';\n\nexport { defaultUnpatchedConsole } from './unpatchedConsole';\nexport type { UnpatchedConsole } from './unpatchedConsole';\n\nexport {\n allLogLevels,\n createPromiseBuffer,\n deepEqual,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n LogLevel,\n noop,\n dateNow,\n isEmpty,\n getCircularDependencyReplacer,\n stringifyExternalJson,\n stringifyObjectValues,\n Observable,\n merge,\n} from './utils';\nexport type {\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BufferItem,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n Subscription,\n} from './utils';\n\nexport { VERSION } from './version';\n\nexport { unknownString } from './consts';\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringifyObjectValues = exports.stringifyExternalJson = exports.getCircularDependencyReplacer = exports.dateNow = exports.getBundleId = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isEmpty = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
3
+ exports.merge = exports.Observable = exports.stringifyObjectValues = exports.stringifyExternalJson = exports.getCircularDependencyReplacer = exports.dateNow = exports.getBundleId = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isEmpty = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
4
4
  var deepEqual_1 = require("./deepEqual");
5
5
  Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return deepEqual_1.deepEqual; } });
6
6
  var date_1 = require("./date");
@@ -53,4 +53,7 @@ var json_1 = require("./json");
53
53
  Object.defineProperty(exports, "getCircularDependencyReplacer", { enumerable: true, get: function () { return json_1.getCircularDependencyReplacer; } });
54
54
  Object.defineProperty(exports, "stringifyExternalJson", { enumerable: true, get: function () { return json_1.stringifyExternalJson; } });
55
55
  Object.defineProperty(exports, "stringifyObjectValues", { enumerable: true, get: function () { return json_1.stringifyObjectValues; } });
56
+ var reactive_1 = require("./reactive");
57
+ Object.defineProperty(exports, "Observable", { enumerable: true, get: function () { return reactive_1.Observable; } });
58
+ Object.defineProperty(exports, "merge", { enumerable: true, get: function () { return reactive_1.merge; } });
56
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAE5B,2BA8Bc;AA7BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,6FAAA,OAAO,OAAA;AAIT,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,2CAA2C;AAAlC,yGAAA,WAAW,OAAA;AAEpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA;AAEhB,+BAAqG;AAA5F,qHAAA,6BAA6B,OAAA;AAAE,6GAAA,qBAAqB,OAAA;AAAE,6GAAA,qBAAqB,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './date';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n\nexport { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAE5B,2BA8Bc;AA7BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,6FAAA,OAAO,OAAA;AAIT,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,2CAA2C;AAAlC,yGAAA,WAAW,OAAA;AAEpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA;AAEhB,+BAAqG;AAA5F,qHAAA,6BAA6B,OAAA;AAAE,6GAAA,qBAAqB,OAAA;AAAE,6GAAA,qBAAqB,OAAA;AAEpF,uCAA+C;AAAtC,sGAAA,UAAU,OAAA;AAAE,iGAAA,KAAK,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './date';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n\nexport { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';\n\nexport { Observable, merge } from './reactive';\nexport type { Subscription } from './reactive';\n"]}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.merge = exports.Observable = void 0;
4
+ var Observable = /** @class */ (function () {
5
+ function Observable() {
6
+ this.subscribers = [];
7
+ }
8
+ /**
9
+ * Subscribes a callback function to the observable.
10
+ * @param callback - The function to call when the observable emits a value.
11
+ * @returns A subscription object with an unsubscribe method to cancel the subscription.
12
+ */
13
+ Observable.prototype.subscribe = function (callback) {
14
+ var _this = this;
15
+ this.subscribers.push(callback);
16
+ return {
17
+ unsubscribe: function () { return _this.unsubscribe(callback); },
18
+ };
19
+ };
20
+ /**
21
+ * Notifies all subscribers with the given data.
22
+ * @param data - The data to emit to all subscribers.
23
+ */
24
+ Observable.prototype.notify = function (data) {
25
+ this.subscribers.forEach(function (callback) { return callback(data); });
26
+ };
27
+ /**
28
+ * Subscribes a callback function to the observable and automatically unsubscribes after the first emission.
29
+ * @param callback - The function to call when the observable emits a value.
30
+ * @returns A subscription object with an unsubscribe method to cancel the subscription.
31
+ */
32
+ Observable.prototype.first = function (callback) {
33
+ var subscription = this.subscribe(function (data) {
34
+ callback(data);
35
+ subscription.unsubscribe();
36
+ });
37
+ return subscription;
38
+ };
39
+ /**
40
+ * Emits values from the source observable until the provided predicate function returns false.
41
+ * @param predicate - A function that evaluates each value emitted by the source observable.
42
+ * @returns A new observable that emits values from the source observable while the predicate returns true.
43
+ */
44
+ Observable.prototype.takeWhile = function (predicate) {
45
+ var result = new Observable();
46
+ var subscription = this.subscribe(function (value) {
47
+ if (predicate(value)) {
48
+ result.notify(value);
49
+ }
50
+ else {
51
+ subscription.unsubscribe();
52
+ }
53
+ });
54
+ return result;
55
+ };
56
+ /**
57
+ * Unsubscribes all subscribers by clearing the subscribers array.
58
+ *
59
+ * @remarks
60
+ * This method sets the `subscribers` array to an empty array, effectively removing all current subscribers.
61
+ */
62
+ Observable.prototype.unsubscribeAll = function () {
63
+ this.subscribers = [];
64
+ };
65
+ Observable.prototype.unsubscribe = function (callback) {
66
+ this.subscribers = this.subscribers.filter(function (sub) { return sub !== callback; });
67
+ };
68
+ return Observable;
69
+ }());
70
+ exports.Observable = Observable;
71
+ /**
72
+ * Merges multiple observables into a single observable.
73
+ *
74
+ * @template T - The type of the values emitted by the observables.
75
+ * @param {...Observable[]} observables - The observables to merge.
76
+ * @returns {Observable} A new observable that emits values from all input observables.
77
+ */
78
+ function merge() {
79
+ var observables = [];
80
+ for (var _i = 0; _i < arguments.length; _i++) {
81
+ observables[_i] = arguments[_i];
82
+ }
83
+ var mainObservable = new Observable();
84
+ var subscriptions = [];
85
+ observables.forEach(function (observable) {
86
+ var subscription = observable.subscribe(function (value) {
87
+ mainObservable.notify(value);
88
+ });
89
+ subscriptions.push(subscription);
90
+ });
91
+ return {
92
+ subscribe: mainObservable.subscribe.bind(mainObservable),
93
+ takeWhile: mainObservable.takeWhile.bind(mainObservable),
94
+ first: mainObservable.first.bind(mainObservable),
95
+ notify: mainObservable.notify.bind(mainObservable),
96
+ unsubscribeAll: function () {
97
+ observables.forEach(function (observable) {
98
+ observable.unsubscribeAll();
99
+ });
100
+ },
101
+ };
102
+ }
103
+ exports.merge = merge;
104
+ //# sourceMappingURL=reactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactive.js","sourceRoot":"","sources":["../../../../../src/utils/reactive.ts"],"names":[],"mappings":";;;AAIA;IAGE;QACE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,8BAAS,GAAT,UAAU,QAA2B;QAArC,iBAMC;QALC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEhC,OAAO;YACL,WAAW,EAAE,cAAM,OAAA,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAA1B,CAA0B;SAC9C,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,2BAAM,GAAN,UAAO,IAAO;QACZ,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,QAAQ,IAAK,OAAA,QAAQ,CAAC,IAAI,CAAC,EAAd,CAAc,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACH,0BAAK,GAAL,UAAM,QAA2B;QAC/B,IAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,UAAC,IAAI;YACvC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,OAAO,YAAY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xD,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC;QACxD,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;QAChD,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QAClD,cAAc,EAAE;YACd,WAAW,CAAC,OAAO,CAAC,UAAC,UAAU;gBAC7B,UAAU,CAAC,cAAc,EAAE,CAAC;YAC9B,CAAC,CAAC,CAAC;QACL,CAAC;KACe,CAAC;AACrB,CAAC;AAtBD,sBAsBC","sourcesContent":["export interface Subscription {\n unsubscribe: () => void;\n}\n\nexport class Observable<T = any> {\n private subscribers: Array<(data: T) => void>;\n\n constructor() {\n this.subscribers = [];\n }\n\n /**\n * Subscribes a callback function to the observable.\n * @param callback - The function to call when the observable emits a value.\n * @returns A subscription object with an unsubscribe method to cancel the subscription.\n */\n subscribe(callback: (data: T) => void): Subscription {\n this.subscribers.push(callback);\n\n return {\n unsubscribe: () => this.unsubscribe(callback),\n };\n }\n\n /**\n * Notifies all subscribers with the given data.\n * @param data - The data to emit to all subscribers.\n */\n notify(data: T): void {\n this.subscribers.forEach((callback) => callback(data));\n }\n\n /**\n * Subscribes a callback function to the observable and automatically unsubscribes after the first emission.\n * @param callback - The function to call when the observable emits a value.\n * @returns A subscription object with an unsubscribe method to cancel the subscription.\n */\n first(callback: (data: T) => void): Subscription {\n const subscription = this.subscribe((data) => {\n callback(data);\n subscription.unsubscribe();\n });\n\n return subscription;\n }\n\n /**\n * Emits values from the source observable until the provided predicate function returns false.\n * @param predicate - A function that evaluates each value emitted by the source observable.\n * @returns A new observable that emits values from the source observable while the predicate returns true.\n */\n takeWhile(predicate: (value: T) => boolean): Observable<T> {\n const result = new Observable<T>();\n const subscription = this.subscribe((value: T) => {\n if (predicate(value)) {\n result.notify(value);\n } else {\n subscription.unsubscribe();\n }\n });\n\n return result;\n }\n\n /**\n * Unsubscribes all subscribers by clearing the subscribers array.\n *\n * @remarks\n * This method sets the `subscribers` array to an empty array, effectively removing all current subscribers.\n */\n unsubscribeAll(): void {\n this.subscribers = [];\n }\n\n private unsubscribe(callback: (data: any) => void): void {\n this.subscribers = this.subscribers.filter((sub) => sub !== callback);\n }\n}\n\n/**\n * Merges multiple observables into a single observable.\n *\n * @template T - The type of the values emitted by the observables.\n * @param {...Observable[]} observables - The observables to merge.\n * @returns {Observable} A new observable that emits values from all input observables.\n */\nexport function merge<T>(...observables: Array<Observable<T>>): Observable<T> {\n const mainObservable = new Observable<T>();\n const subscriptions: Subscription[] = [];\n\n observables.forEach((observable) => {\n const subscription = observable.subscribe((value: T) => {\n mainObservable.notify(value);\n });\n subscriptions.push(subscription);\n });\n\n return {\n subscribe: mainObservable.subscribe.bind(mainObservable),\n takeWhile: mainObservable.takeWhile.bind(mainObservable),\n first: mainObservable.first.bind(mainObservable),\n notify: mainObservable.notify.bind(mainObservable),\n unsubscribeAll: () => {\n observables.forEach((observable) => {\n observable.unsubscribeAll();\n });\n },\n } as Observable<T>;\n}\n"]}
@@ -0,0 +1,104 @@
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('Unsubscribes all subscriptions from the observable when unsubscribeAll is called', function () {
27
+ var observable = new __1.Observable();
28
+ var callback = jest.fn();
29
+ observable.subscribe(callback);
30
+ observable.subscribe(callback);
31
+ observable.subscribe(callback);
32
+ observable.notify(1);
33
+ observable.unsubscribeAll();
34
+ observable.subscribe(callback);
35
+ observable.subscribe(callback);
36
+ observable.subscribe(callback);
37
+ expect(callback).toHaveBeenCalledTimes(3);
38
+ expect(callback).toHaveBeenCalledWith(1);
39
+ });
40
+ it('takes emitted values until the predicate returns false', function () {
41
+ var observable = new __1.Observable();
42
+ var callback = jest.fn();
43
+ observable.takeWhile(function (value) { return value <= 2; }).subscribe(callback);
44
+ observable.notify(1);
45
+ observable.notify(2);
46
+ observable.notify(3);
47
+ expect(callback).toHaveBeenCalledTimes(2);
48
+ expect(callback).toHaveBeenNthCalledWith(1, 1);
49
+ expect(callback).toHaveBeenNthCalledWith(2, 2);
50
+ });
51
+ it('subscribes to the first emitted value and unsubscribes after', function () {
52
+ var observable = new __1.Observable();
53
+ var callback = jest.fn();
54
+ observable.first(callback);
55
+ observable.notify(1);
56
+ observable.notify(2);
57
+ expect(callback).toHaveBeenCalledTimes(1);
58
+ expect(callback).toHaveBeenCalledWith(1);
59
+ });
60
+ it('unsubscribes a callback from the list of subscribers', function () {
61
+ var observable = new __1.Observable();
62
+ var callback = jest.fn();
63
+ var sub = observable.subscribe(callback);
64
+ observable.notify(1);
65
+ sub.unsubscribe();
66
+ observable.notify(2);
67
+ expect(callback).toHaveBeenCalledTimes(1);
68
+ expect(callback).toHaveBeenCalledWith(1);
69
+ });
70
+ });
71
+ describe('Merge', function () {
72
+ it('Merges multiple observables into a single observable using the merge() function', function () {
73
+ var observable1 = new __1.Observable();
74
+ var observable2 = new __1.Observable();
75
+ var callback = jest.fn();
76
+ (0, __1.merge)(observable1, observable2).subscribe(callback);
77
+ observable1.notify(1);
78
+ observable2.notify('A');
79
+ observable1.notify(2);
80
+ observable2.notify('B');
81
+ expect(callback).toHaveBeenCalledTimes(4);
82
+ expect(callback).toHaveBeenNthCalledWith(1, 1);
83
+ expect(callback).toHaveBeenNthCalledWith(2, 'A');
84
+ expect(callback).toHaveBeenNthCalledWith(3, 2);
85
+ expect(callback).toHaveBeenNthCalledWith(4, 'B');
86
+ });
87
+ it('Unsubscribes from all observables when merge.unsubscribeAll isCalled', function () {
88
+ var observable1 = new __1.Observable();
89
+ var observable2 = new __1.Observable();
90
+ var callback = jest.fn();
91
+ var mergeObserver = (0, __1.merge)(observable1, observable2);
92
+ mergeObserver.subscribe(callback);
93
+ observable1.notify(1);
94
+ observable2.notify(2);
95
+ mergeObserver.unsubscribeAll();
96
+ observable1.notify(3);
97
+ observable2.notify(4);
98
+ expect(callback).toHaveBeenCalledTimes(2);
99
+ expect(callback).toHaveBeenNthCalledWith(1, 1);
100
+ expect(callback).toHaveBeenNthCalledWith(2, 2);
101
+ });
102
+ });
103
+ });
104
+ //# sourceMappingURL=reactive.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactive.test.js","sourceRoot":"","sources":["../../../../../src/utils/reactive.test.ts"],"names":[],"mappings":";;AAAA,wBAAuC;AAEvC,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,Q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AAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sEAAsE,EAAE;YACzE,IAAM,WAAW,GAAG,IAAI,cAAU,EAAU,CAAC;YAC7C,IAAM,WAAW,GAAG,IAAI,cAAU,EAAU,CAAC;YAC7C,IAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;YAE3B,IAAM,aAAa,GAAG,IAAA,SAAK,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACtD,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAElC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAEtB,aAAa,CAAC,cAAc,EAAE,CAAC;YAC/B,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAEtB,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;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { merge, 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('Unsubscribes all subscriptions from the observable when unsubscribeAll is called', () => {\n const observable = new Observable<number>();\n const callback = jest.fn();\n\n observable.subscribe(callback);\n observable.subscribe(callback);\n observable.subscribe(callback);\n\n observable.notify(1);\n observable.unsubscribeAll();\n\n observable.subscribe(callback);\n observable.subscribe(callback);\n observable.subscribe(callback);\n\n expect(callback).toHaveBeenCalledTimes(3);\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(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 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\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 mergeObserver = merge(observable1, observable2);\n mergeObserver.subscribe(callback);\n\n observable1.notify(1);\n observable2.notify(2);\n\n mergeObserver.unsubscribeAll();\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});\n"]}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // auto-generated by bin/genVersion.ts
5
- exports.VERSION = '1.14.1';
5
+ exports.VERSION = '1.14.2';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.14.1';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.14.2';\n"]}
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,11 @@
1
+ import type { Transports } from '../transports';
2
+ import type { TracesAPI } from './traces/types';
3
+ export declare const mockMetas: {
4
+ add: jest.Mock<any, any, any>;
5
+ remove: jest.Mock<any, any, any>;
6
+ addListener: jest.Mock<any, any, any>;
7
+ removeListener: jest.Mock<any, any, any>;
8
+ value: {};
9
+ };
10
+ export declare const mockTransports: Transports;
11
+ export declare const mockTracesApi: TracesAPI;
@@ -0,0 +1,3 @@
1
+ export declare const USER_ACTION_START_MESSAGE_TYPE = "user-action-start";
2
+ export declare const USER_ACTION_END_MESSAGE_TYPE = "user-action-end";
3
+ export declare const USER_ACTION_CANCEL_MESSAGE_TYPE = "user-action-cancel";
@@ -1,8 +1,19 @@
1
1
  import type { Config } from '../../config';
2
2
  import type { InternalLogger } from '../../internalLogger';
3
3
  import type { Metas } from '../../metas';
4
- import { Transports } from '../../transports';
4
+ import type { TransportItem, Transports } from '../../transports';
5
5
  import type { UnpatchedConsole } from '../../unpatchedConsole';
6
+ import type { ItemBuffer } from '../ItemBuffer';
6
7
  import type { TracesAPI } from '../traces';
8
+ import type { ApiMessageBusMessages } from '../types';
7
9
  import type { EventsAPI } from './types';
8
- export declare function initializeEventsAPI(_unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas, transports: Transports, tracesApi: TracesAPI): EventsAPI;
10
+ export declare function initializeEventsAPI({ internalLogger, config, metas, transports, tracesApi, actionBuffer, getMessage, }: {
11
+ unpatchedConsole: UnpatchedConsole;
12
+ internalLogger: InternalLogger;
13
+ config: Config;
14
+ metas: Metas;
15
+ transports: Transports;
16
+ tracesApi: TracesAPI;
17
+ actionBuffer: ItemBuffer<TransportItem>;
18
+ getMessage: () => ApiMessageBusMessages | undefined;
19
+ }): EventsAPI;
@@ -1,5 +1,6 @@
1
1
  import type { SpanContext } from '@opentelemetry/api';
2
2
  import type { TraceContext } from '../traces';
3
+ import type { UserAction } from '../types';
3
4
  export type EventAttributes = Record<string, string>;
4
5
  export interface EventEvent {
5
6
  name: string;
@@ -7,11 +8,21 @@ export interface EventEvent {
7
8
  domain?: string;
8
9
  attributes?: EventAttributes;
9
10
  trace?: TraceContext;
11
+ action?: UserAction;
10
12
  }
11
13
  export interface PushEventOptions {
12
14
  skipDedupe?: boolean;
13
15
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
14
16
  timestampOverwriteMs?: number;
17
+ /**
18
+ * Allows manual transformation of the payload before adding it to the internal buffer.
19
+ *
20
+ * @param payload - The event payload to be transformed.
21
+ * @returns The transformed event payload.
22
+ *
23
+ * @remarks This should be used sparingly and only in special cases where custom payload processing cannot be deferred to the before-send hook.
24
+ */
25
+ customPayloadTransformer?: (payload: EventEvent) => EventEvent;
15
26
  }
16
27
  export interface EventsAPI {
17
28
  pushEvent: (name: string, attributes?: EventAttributes, domain?: string, options?: PushEventOptions) => void;
@@ -1,8 +1,19 @@
1
1
  import type { Config } from '../../config';
2
2
  import type { InternalLogger } from '../../internalLogger';
3
3
  import type { Metas } from '../../metas';
4
- import type { Transports } from '../../transports';
4
+ import type { TransportItem, Transports } from '../../transports';
5
5
  import type { UnpatchedConsole } from '../../unpatchedConsole';
6
+ import type { ItemBuffer } from '../ItemBuffer';
6
7
  import type { TracesAPI } from '../traces';
8
+ import type { ApiMessageBusMessages } from '../types';
7
9
  import type { ExceptionsAPI } from './types';
8
- export declare function initializeExceptionsAPI(_unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas, transports: Transports, tracesApi: TracesAPI): ExceptionsAPI;
10
+ export declare function initializeExceptionsAPI({ internalLogger, config, metas, transports, tracesApi, actionBuffer, getMessage, }: {
11
+ unpatchedConsole: UnpatchedConsole;
12
+ internalLogger: InternalLogger;
13
+ config: Config;
14
+ metas: Metas;
15
+ transports: Transports;
16
+ tracesApi: TracesAPI;
17
+ actionBuffer: ItemBuffer<TransportItem>;
18
+ getMessage: () => ApiMessageBusMessages | undefined;
19
+ }): ExceptionsAPI;
@@ -1,5 +1,6 @@
1
1
  import type { SpanContext } from '@opentelemetry/api';
2
2
  import type { TraceContext } from '../traces';
3
+ import type { UserAction } from '../types';
3
4
  export type StacktraceParser = (err: ExtendedError) => Stacktrace;
4
5
  export interface ExceptionStackFrame {
5
6
  filename: string;
@@ -23,6 +24,7 @@ export interface ExceptionEvent {
23
24
  stacktrace?: Stacktrace;
24
25
  trace?: TraceContext;
25
26
  context?: ExceptionContext;
27
+ action?: UserAction;
26
28
  }
27
29
  export interface PushErrorOptions {
28
30
  skipDedupe?: boolean;
@@ -1,5 +1,5 @@
1
1
  export { initializeAPI } from './initialize';
2
- export type { API, APIEvent } from './types';
2
+ export type { API, APIEvent, ApiMessageBusMessages, UserActionCancelMessage, UserActionEndMessage, UserActionStartMessage, UserAction, } from './types';
3
3
  export type { EventAttributes, EventEvent, EventsAPI, PushEventOptions } from './events';
4
4
  export { defaultExceptionType, defaultErrorArgsSerializer } from './exceptions';
5
5
  export type { ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, PushErrorOptions, Stacktrace, StacktraceParser, } from './exceptions';
@@ -8,3 +8,5 @@ export type { LogContext, LogEvent, LogArgsSerializer, LogsAPI, PushLogOptions }
8
8
  export type { MeasurementEvent, MeasurementsAPI, PushMeasurementOptions } from './measurements';
9
9
  export type { MetaAPI } from './meta';
10
10
  export type { OTELApi, TraceContext, TraceEvent, TracesAPI } from './traces';
11
+ export { apiMessageBus } from './initialize';
12
+ export { USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE } from './const';
@@ -3,5 +3,7 @@ import type { InternalLogger } from '../internalLogger';
3
3
  import type { Metas } from '../metas';
4
4
  import type { Transports } from '../transports';
5
5
  import type { UnpatchedConsole } from '../unpatchedConsole';
6
- import type { API } from './types';
6
+ import { Observable } from '../utils';
7
+ import type { API, ApiMessageBusMessages } from './types';
8
+ export declare const apiMessageBus: Observable<ApiMessageBusMessages>;
7
9
  export declare function initializeAPI(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas, transports: Transports): API;
@@ -1,8 +1,19 @@
1
1
  import type { Config } from '../../config';
2
2
  import type { InternalLogger } from '../../internalLogger';
3
3
  import type { Metas } from '../../metas';
4
- import type { Transports } from '../../transports';
4
+ import { TransportItem, Transports } from '../../transports';
5
5
  import type { UnpatchedConsole } from '../../unpatchedConsole';
6
+ import type { ItemBuffer } from '../ItemBuffer';
6
7
  import type { TracesAPI } from '../traces';
8
+ import type { ApiMessageBusMessages } from '../types';
7
9
  import type { LogsAPI } from './types';
8
- export declare function initializeLogsAPI(_unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas, transports: Transports, tracesApi: TracesAPI): LogsAPI;
10
+ export declare function initializeLogsAPI({ internalLogger, config, metas, transports, tracesApi, actionBuffer, getMessage, }: {
11
+ unpatchedConsole: UnpatchedConsole;
12
+ internalLogger: InternalLogger;
13
+ config: Config;
14
+ metas: Metas;
15
+ transports: Transports;
16
+ tracesApi: TracesAPI;
17
+ actionBuffer: ItemBuffer<TransportItem>;
18
+ getMessage: () => ApiMessageBusMessages | undefined;
19
+ }): LogsAPI;
@@ -1,13 +1,15 @@
1
1
  import type { SpanContext } from '@opentelemetry/api';
2
2
  import type { LogLevel } from '../../utils';
3
3
  import type { TraceContext } from '../traces';
4
+ import type { UserAction } from '../types';
4
5
  export type LogContext = Record<string, string>;
5
6
  export interface LogEvent {
6
- context: LogContext;
7
+ context: LogContext | undefined;
7
8
  level: LogLevel;
8
9
  message: string;
9
10
  timestamp: string;
10
11
  trace?: TraceContext;
12
+ action?: UserAction;
11
13
  }
12
14
  export interface PushLogOptions {
13
15
  context?: LogContext;