@grafana/faro-core 1.0.0-beta3 → 1.0.0-beta4

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 (211) hide show
  1. package/README.md +9 -8
  2. package/dist/bundle/faro-core.iife.js +1 -0
  3. package/dist/cjs/utils/deepEqual.js +58 -5
  4. package/dist/cjs/utils/deepEqual.js.map +1 -1
  5. package/dist/cjs/version.js +2 -2
  6. package/dist/cjs/version.js.map +1 -1
  7. package/dist/esm/utils/deepEqual.js +55 -2
  8. package/dist/esm/utils/deepEqual.js.map +1 -1
  9. package/dist/esm/version.js +2 -2
  10. package/dist/esm/version.js.map +1 -1
  11. package/dist/{cjs → types}/api/events/index.d.ts +0 -0
  12. package/dist/{cjs → types}/api/events/initialize.d.ts +0 -0
  13. package/dist/{cjs → types}/api/events/types.d.ts +0 -0
  14. package/dist/{cjs → types}/api/exceptions/const.d.ts +0 -0
  15. package/dist/{cjs → types}/api/exceptions/index.d.ts +0 -0
  16. package/dist/{cjs → types}/api/exceptions/initialize.d.ts +0 -0
  17. package/dist/{cjs → types}/api/exceptions/types.d.ts +0 -0
  18. package/dist/{cjs → types}/api/index.d.ts +0 -0
  19. package/dist/{cjs → types}/api/initialize.d.ts +0 -0
  20. package/dist/{cjs → types}/api/logs/index.d.ts +0 -0
  21. package/dist/{cjs → types}/api/logs/initialize.d.ts +0 -0
  22. package/dist/{cjs → types}/api/logs/types.d.ts +0 -0
  23. package/dist/{cjs → types}/api/measurements/index.d.ts +0 -0
  24. package/dist/{cjs → types}/api/measurements/initialize.d.ts +0 -0
  25. package/dist/{cjs → types}/api/measurements/types.d.ts +0 -0
  26. package/dist/{cjs → types}/api/meta/index.d.ts +0 -0
  27. package/dist/{cjs → types}/api/meta/initialize.d.ts +0 -0
  28. package/dist/{cjs → types}/api/meta/types.d.ts +0 -0
  29. package/dist/{cjs → types}/api/traces/index.d.ts +0 -0
  30. package/dist/{cjs → types}/api/traces/initialize.d.ts +0 -0
  31. package/dist/{cjs → types}/api/traces/types.d.ts +0 -0
  32. package/dist/{cjs → types}/api/types.d.ts +0 -0
  33. package/dist/{cjs → types}/config/const.d.ts +0 -0
  34. package/dist/{cjs → types}/config/index.d.ts +0 -0
  35. package/dist/{cjs → types}/config/types.d.ts +0 -0
  36. package/dist/{cjs → types}/globalObject/globalObject.d.ts +0 -0
  37. package/dist/{cjs → types}/globalObject/index.d.ts +0 -0
  38. package/dist/{cjs → types}/index.d.ts +0 -0
  39. package/dist/{cjs → types}/initialize.d.ts +0 -0
  40. package/dist/{cjs → types}/instrumentations/base.d.ts +0 -0
  41. package/dist/{cjs → types}/instrumentations/index.d.ts +0 -0
  42. package/dist/{cjs → types}/instrumentations/initialize.d.ts +0 -0
  43. package/dist/{cjs → types}/instrumentations/types.d.ts +0 -0
  44. package/dist/{cjs → types}/internalLogger/const.d.ts +0 -0
  45. package/dist/{cjs → types}/internalLogger/createInternalLogger.d.ts +0 -0
  46. package/dist/{cjs → types}/internalLogger/index.d.ts +0 -0
  47. package/dist/{cjs → types}/internalLogger/initialize.d.ts +0 -0
  48. package/dist/{cjs → types}/internalLogger/types.d.ts +0 -0
  49. package/dist/{cjs → types}/metas/index.d.ts +0 -0
  50. package/dist/{cjs → types}/metas/initialize.d.ts +0 -0
  51. package/dist/{cjs → types}/metas/types.d.ts +0 -0
  52. package/dist/{cjs → types}/sdk/const.d.ts +0 -0
  53. package/dist/{cjs → types}/sdk/faroGlobalObject.d.ts +0 -0
  54. package/dist/{cjs → types}/sdk/index.d.ts +0 -0
  55. package/dist/{cjs → types}/sdk/internalFaroGlobalObject.d.ts +0 -0
  56. package/dist/{cjs → types}/sdk/register.d.ts +0 -0
  57. package/dist/{cjs → types}/sdk/types.d.ts +0 -0
  58. package/dist/{cjs → types}/semantic.d.ts +0 -0
  59. package/dist/{cjs → types}/testUtils/index.d.ts +0 -0
  60. package/dist/{cjs → types}/testUtils/mockConfig.d.ts +0 -0
  61. package/dist/{cjs → types}/testUtils/mockInternalLogger.d.ts +0 -0
  62. package/dist/{cjs → types}/testUtils/mockStacktraceParser.d.ts +0 -0
  63. package/dist/{cjs → types}/testUtils/mockTransport.d.ts +1 -1
  64. package/dist/{cjs → types}/testUtils/testPromise.d.ts +0 -0
  65. package/dist/{cjs → types}/transports/base.d.ts +0 -0
  66. package/dist/{cjs → types}/transports/const.d.ts +0 -0
  67. package/dist/{cjs → types}/transports/index.d.ts +0 -0
  68. package/dist/{cjs → types}/transports/initialize.d.ts +0 -0
  69. package/dist/{cjs → types}/transports/types.d.ts +0 -0
  70. package/dist/{cjs → types}/transports/utils.d.ts +0 -0
  71. package/dist/{cjs → types}/unpatchedConsole/const.d.ts +0 -0
  72. package/dist/{cjs → types}/unpatchedConsole/index.d.ts +0 -0
  73. package/dist/{cjs → types}/unpatchedConsole/initialize.d.ts +0 -0
  74. package/dist/{cjs → types}/unpatchedConsole/types.d.ts +0 -0
  75. package/dist/{cjs → types}/utils/baseObject.d.ts +0 -0
  76. package/dist/types/utils/deepEqual.d.ts +1 -0
  77. package/dist/{cjs → types}/utils/extensions.d.ts +0 -0
  78. package/dist/{cjs → types}/utils/getCurrentTimestamp.d.ts +0 -0
  79. package/dist/{cjs → types}/utils/index.d.ts +0 -0
  80. package/dist/{cjs → types}/utils/is.d.ts +0 -0
  81. package/dist/{cjs → types}/utils/logLevels.d.ts +0 -0
  82. package/dist/{cjs → types}/utils/noop.d.ts +0 -0
  83. package/dist/{cjs → types}/utils/promiseBuffer.d.ts +0 -0
  84. package/dist/{cjs → types}/utils/shortId.d.ts +0 -0
  85. package/dist/types/version.d.ts +1 -0
  86. package/package.json +20 -14
  87. package/dist/cjs/api/events/initialize.test.d.ts +0 -1
  88. package/dist/cjs/api/events/initialize.test.js +0 -92
  89. package/dist/cjs/api/events/initialize.test.js.map +0 -1
  90. package/dist/cjs/api/exceptions/initialize.test.d.ts +0 -1
  91. package/dist/cjs/api/exceptions/initialize.test.js +0 -138
  92. package/dist/cjs/api/exceptions/initialize.test.js.map +0 -1
  93. package/dist/cjs/api/logs/initialize.test.d.ts +0 -1
  94. package/dist/cjs/api/logs/initialize.test.js +0 -88
  95. package/dist/cjs/api/logs/initialize.test.js.map +0 -1
  96. package/dist/cjs/api/measurements/initialize.test.d.ts +0 -1
  97. package/dist/cjs/api/measurements/initialize.test.js +0 -123
  98. package/dist/cjs/api/measurements/initialize.test.js.map +0 -1
  99. package/dist/cjs/faro.test.d.ts +0 -1
  100. package/dist/cjs/faro.test.js +0 -42
  101. package/dist/cjs/faro.test.js.map +0 -1
  102. package/dist/cjs/metas/initialize.test.d.ts +0 -1
  103. package/dist/cjs/metas/initialize.test.js +0 -21
  104. package/dist/cjs/metas/initialize.test.js.map +0 -1
  105. package/dist/cjs/transports/transports.test.d.ts +0 -1
  106. package/dist/cjs/transports/transports.test.js +0 -141
  107. package/dist/cjs/transports/transports.test.js.map +0 -1
  108. package/dist/cjs/utils/deepEqual.d.ts +0 -2
  109. package/dist/cjs/utils/promiseBuffer.test.d.ts +0 -1
  110. package/dist/cjs/utils/promiseBuffer.test.js +0 -146
  111. package/dist/cjs/utils/promiseBuffer.test.js.map +0 -1
  112. package/dist/cjs/version.d.ts +0 -1
  113. package/dist/esm/api/events/index.d.ts +0 -2
  114. package/dist/esm/api/events/initialize.d.ts +0 -7
  115. package/dist/esm/api/events/initialize.test.d.ts +0 -1
  116. package/dist/esm/api/events/initialize.test.js +0 -87
  117. package/dist/esm/api/events/initialize.test.js.map +0 -1
  118. package/dist/esm/api/events/types.d.ts +0 -15
  119. package/dist/esm/api/exceptions/const.d.ts +0 -1
  120. package/dist/esm/api/exceptions/index.d.ts +0 -3
  121. package/dist/esm/api/exceptions/initialize.d.ts +0 -7
  122. package/dist/esm/api/exceptions/initialize.test.d.ts +0 -1
  123. package/dist/esm/api/exceptions/initialize.test.js +0 -133
  124. package/dist/esm/api/exceptions/initialize.test.js.map +0 -1
  125. package/dist/esm/api/exceptions/types.d.ts +0 -32
  126. package/dist/esm/api/index.d.ts +0 -9
  127. package/dist/esm/api/initialize.d.ts +0 -6
  128. package/dist/esm/api/logs/index.d.ts +0 -2
  129. package/dist/esm/api/logs/initialize.d.ts +0 -7
  130. package/dist/esm/api/logs/initialize.test.d.ts +0 -1
  131. package/dist/esm/api/logs/initialize.test.js +0 -83
  132. package/dist/esm/api/logs/initialize.test.js.map +0 -1
  133. package/dist/esm/api/logs/types.d.ts +0 -18
  134. package/dist/esm/api/measurements/index.d.ts +0 -2
  135. package/dist/esm/api/measurements/initialize.d.ts +0 -7
  136. package/dist/esm/api/measurements/initialize.test.d.ts +0 -1
  137. package/dist/esm/api/measurements/initialize.test.js +0 -107
  138. package/dist/esm/api/measurements/initialize.test.js.map +0 -1
  139. package/dist/esm/api/measurements/types.d.ts +0 -16
  140. package/dist/esm/api/meta/index.d.ts +0 -2
  141. package/dist/esm/api/meta/initialize.d.ts +0 -6
  142. package/dist/esm/api/meta/types.d.ts +0 -8
  143. package/dist/esm/api/traces/index.d.ts +0 -2
  144. package/dist/esm/api/traces/initialize.d.ts +0 -6
  145. package/dist/esm/api/traces/types.d.ts +0 -20
  146. package/dist/esm/api/types.d.ts +0 -8
  147. package/dist/esm/config/const.d.ts +0 -1
  148. package/dist/esm/config/index.d.ts +0 -2
  149. package/dist/esm/config/types.d.ts +0 -26
  150. package/dist/esm/faro.test.d.ts +0 -1
  151. package/dist/esm/faro.test.js +0 -40
  152. package/dist/esm/faro.test.js.map +0 -1
  153. package/dist/esm/globalObject/globalObject.d.ts +0 -7
  154. package/dist/esm/globalObject/index.d.ts +0 -2
  155. package/dist/esm/index.d.ts +0 -22
  156. package/dist/esm/initialize.d.ts +0 -3
  157. package/dist/esm/instrumentations/base.d.ts +0 -5
  158. package/dist/esm/instrumentations/index.d.ts +0 -3
  159. package/dist/esm/instrumentations/initialize.d.ts +0 -4
  160. package/dist/esm/instrumentations/types.d.ts +0 -10
  161. package/dist/esm/internalLogger/const.d.ts +0 -11
  162. package/dist/esm/internalLogger/createInternalLogger.d.ts +0 -4
  163. package/dist/esm/internalLogger/index.d.ts +0 -4
  164. package/dist/esm/internalLogger/initialize.d.ts +0 -5
  165. package/dist/esm/internalLogger/types.d.ts +0 -7
  166. package/dist/esm/metas/index.d.ts +0 -2
  167. package/dist/esm/metas/initialize.d.ts +0 -4
  168. package/dist/esm/metas/initialize.test.d.ts +0 -1
  169. package/dist/esm/metas/initialize.test.js +0 -19
  170. package/dist/esm/metas/initialize.test.js.map +0 -1
  171. package/dist/esm/metas/types.d.ts +0 -56
  172. package/dist/esm/sdk/const.d.ts +0 -1
  173. package/dist/esm/sdk/faroGlobalObject.d.ts +0 -2
  174. package/dist/esm/sdk/index.d.ts +0 -4
  175. package/dist/esm/sdk/internalFaroGlobalObject.d.ts +0 -4
  176. package/dist/esm/sdk/register.d.ts +0 -4
  177. package/dist/esm/sdk/types.d.ts +0 -18
  178. package/dist/esm/semantic.d.ts +0 -7
  179. package/dist/esm/testUtils/index.d.ts +0 -6
  180. package/dist/esm/testUtils/mockConfig.d.ts +0 -2
  181. package/dist/esm/testUtils/mockInternalLogger.d.ts +0 -2
  182. package/dist/esm/testUtils/mockStacktraceParser.d.ts +0 -2
  183. package/dist/esm/testUtils/mockTransport.d.ts +0 -12
  184. package/dist/esm/testUtils/testPromise.d.ts +0 -7
  185. package/dist/esm/transports/base.d.ts +0 -6
  186. package/dist/esm/transports/const.d.ts +0 -8
  187. package/dist/esm/transports/index.d.ts +0 -5
  188. package/dist/esm/transports/initialize.d.ts +0 -6
  189. package/dist/esm/transports/transports.test.d.ts +0 -1
  190. package/dist/esm/transports/transports.test.js +0 -110
  191. package/dist/esm/transports/transports.test.js.map +0 -1
  192. package/dist/esm/transports/types.d.ts +0 -37
  193. package/dist/esm/transports/utils.d.ts +0 -2
  194. package/dist/esm/unpatchedConsole/const.d.ts +0 -2
  195. package/dist/esm/unpatchedConsole/index.d.ts +0 -3
  196. package/dist/esm/unpatchedConsole/initialize.d.ts +0 -4
  197. package/dist/esm/unpatchedConsole/types.d.ts +0 -1
  198. package/dist/esm/utils/baseObject.d.ts +0 -6
  199. package/dist/esm/utils/deepEqual.d.ts +0 -2
  200. package/dist/esm/utils/extensions.d.ts +0 -19
  201. package/dist/esm/utils/getCurrentTimestamp.d.ts +0 -1
  202. package/dist/esm/utils/index.d.ts +0 -12
  203. package/dist/esm/utils/is.d.ts +0 -31
  204. package/dist/esm/utils/logLevels.d.ts +0 -10
  205. package/dist/esm/utils/noop.d.ts +0 -1
  206. package/dist/esm/utils/promiseBuffer.d.ts +0 -14
  207. package/dist/esm/utils/promiseBuffer.test.d.ts +0 -1
  208. package/dist/esm/utils/promiseBuffer.test.js +0 -87
  209. package/dist/esm/utils/promiseBuffer.test.js.map +0 -1
  210. package/dist/esm/utils/shortId.d.ts +0 -1
  211. package/dist/esm/version.d.ts +0 -1
@@ -1,4 +0,0 @@
1
- export { defaultInternalLoggerLevel, InternalLoggerLevel } from './const';
2
- export { createInternalLogger } from './createInternalLogger';
3
- export { initializeInternalLogger, internalLogger } from './initialize';
4
- export type { InternalLogger } from './types';
@@ -1,5 +0,0 @@
1
- import type { Config } from '../config';
2
- import type { UnpatchedConsole } from '../unpatchedConsole';
3
- import type { InternalLogger } from './types';
4
- export declare let internalLogger: InternalLogger;
5
- export declare function initializeInternalLogger(unpatchedConsole: UnpatchedConsole, config: Config): InternalLogger;
@@ -1,7 +0,0 @@
1
- export interface InternalLogger {
2
- debug: Console['debug'];
3
- error: Console['error'];
4
- info: Console['info'];
5
- readonly prefix: string;
6
- warn: Console['warn'];
7
- }
@@ -1,2 +0,0 @@
1
- export { initializeMetas } from './initialize';
2
- export type { Meta, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, } from './types';
@@ -1,4 +0,0 @@
1
- import type { Config } from '../config';
2
- import type { InternalLogger } from '../internalLogger';
3
- import type { Metas } from './types';
4
- export declare function initializeMetas(internalLogger: InternalLogger, config: Config): Metas;
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- import { mockConfig, mockInternalLogger } from '../testUtils';
2
- import { initializeMetas } from './initialize';
3
- describe('metas', () => {
4
- it('can set listeners and they will be notified on meta changes', () => {
5
- const config = mockConfig();
6
- const metas = initializeMetas(mockInternalLogger, config);
7
- const listener = jest.fn(() => { });
8
- metas.addListener(listener);
9
- metas.add({ user: { id: 'foo' } });
10
- expect(listener).toHaveBeenCalledTimes(1);
11
- expect(listener).toHaveBeenLastCalledWith(metas.value);
12
- metas.add({ session: { id: '1' } });
13
- expect(listener).toHaveBeenCalledTimes(2);
14
- metas.removeListener(listener);
15
- metas.add({ session: { id: '2' } });
16
- expect(listener).toHaveBeenCalledTimes(2);
17
- });
18
- });
19
- //# sourceMappingURL=initialize.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"initialize.test.js","sourceRoot":"","sources":["../../../src/metas/initialize.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,eAAe,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACnC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE5B,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,QAAQ,CAAC,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEvD,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC1C,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE/B,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { mockConfig, mockInternalLogger } from '../testUtils';\nimport { initializeMetas } from './initialize';\n\ndescribe('metas', () => {\n it('can set listeners and they will be notified on meta changes', () => {\n const config = mockConfig();\n const metas = initializeMetas(mockInternalLogger, config);\n const listener = jest.fn(() => {});\n metas.addListener(listener);\n\n metas.add({ user: { id: 'foo' } });\n expect(listener).toHaveBeenCalledTimes(1);\n expect(listener).toHaveBeenLastCalledWith(metas.value);\n\n metas.add({ session: { id: '1' } });\n expect(listener).toHaveBeenCalledTimes(2);\n metas.removeListener(listener);\n\n metas.add({ session: { id: '2' } });\n expect(listener).toHaveBeenCalledTimes(2);\n });\n});\n\nexport {};\n"]}
@@ -1,56 +0,0 @@
1
- export type MetaGetter<P = Partial<Meta>> = () => P;
2
- export type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;
3
- export type MetasListener = (value: Meta) => void;
4
- export interface Metas {
5
- add: (...getters: MetaItem[]) => void;
6
- remove: (...getters: MetaItem[]) => void;
7
- addListener: (listener: MetasListener) => void;
8
- removeListener: (listener: MetasListener) => void;
9
- value: Meta;
10
- }
11
- export type MetaAttributes = Record<string, string>;
12
- export interface MetaSDKIntegration {
13
- name?: string;
14
- version?: string;
15
- }
16
- export interface MetaSDK {
17
- name?: string;
18
- version?: string;
19
- integrations?: MetaSDKIntegration[];
20
- }
21
- export interface MetaApp {
22
- name?: string;
23
- release?: string;
24
- version?: string;
25
- environment?: string;
26
- }
27
- export interface MetaUser {
28
- email?: string;
29
- id?: string;
30
- username?: string;
31
- attributes?: MetaAttributes;
32
- }
33
- export interface MetaSession {
34
- id?: string;
35
- started?: string;
36
- attributes?: MetaAttributes;
37
- }
38
- export interface MetaPage {
39
- id?: string;
40
- url?: string;
41
- attributes?: MetaAttributes;
42
- }
43
- export interface MetaBrowser {
44
- name?: string;
45
- version?: string;
46
- os?: string;
47
- mobile?: boolean;
48
- }
49
- export interface Meta {
50
- sdk?: MetaSDK;
51
- app?: MetaApp;
52
- user?: MetaUser;
53
- session?: MetaSession;
54
- page?: MetaPage;
55
- browser?: MetaBrowser;
56
- }
@@ -1 +0,0 @@
1
- export declare const internalGlobalObjectKey = "_faroInternal";
@@ -1,2 +0,0 @@
1
- import type { Faro } from './types';
2
- export declare function setFaroOnGlobalObject(faro: Faro): void;
@@ -1,4 +0,0 @@
1
- export { internalGlobalObjectKey } from './const';
2
- export { faro, registerFaro } from './register';
3
- export { getInternalFromGlobalObject as getInternalFaroFromGlobalObject, isInternalFaroOnGlobalObject as isInternalFaroOnGlobalObject, setInternalFaroOnGlobalObject as setInternalFaroOnGlobalObject, } from './internalFaroGlobalObject';
4
- export type { Faro } from './types';
@@ -1,4 +0,0 @@
1
- import type { Faro } from './types';
2
- export declare function getInternalFromGlobalObject(): Faro | undefined;
3
- export declare function setInternalFaroOnGlobalObject(faro: Faro): void;
4
- export declare function isInternalFaroOnGlobalObject(): boolean;
@@ -1,4 +0,0 @@
1
- import type { InternalLogger } from '../internalLogger';
2
- import type { Faro } from './types';
3
- export declare let faro: Faro;
4
- export declare function registerFaro(internalLogger: InternalLogger, newFaro: Faro): Faro;
@@ -1,18 +0,0 @@
1
- import type { API } from '../api';
2
- import type { Config } from '../config';
3
- import type { Instrumentations } from '../instrumentations';
4
- import type { InternalLogger } from '../internalLogger';
5
- import type { Metas } from '../metas';
6
- import type { Transports } from '../transports';
7
- import type { UnpatchedConsole } from '../unpatchedConsole';
8
- export interface Faro {
9
- api: API;
10
- config: Config;
11
- instrumentations: Instrumentations;
12
- internalLogger: InternalLogger;
13
- metas: Metas;
14
- pause: Transports['pause'];
15
- transports: Transports;
16
- unpatchedConsole: UnpatchedConsole;
17
- unpause: Transports['unpause'];
18
- }
@@ -1,7 +0,0 @@
1
- export declare const Conventions: {
2
- readonly EventNames: {
3
- readonly CLICK: "click";
4
- readonly NAVIGATION: "navigation";
5
- readonly SESSION_START: "session_start";
6
- };
7
- };
@@ -1,6 +0,0 @@
1
- export { mockConfig } from './mockConfig';
2
- export { mockInternalLogger } from './mockInternalLogger';
3
- export { mockStacktraceParser } from './mockStacktraceParser';
4
- export { MockTransport } from './mockTransport';
5
- export { createTestPromise } from './testPromise';
6
- export type { TestPromise } from './testPromise';
@@ -1,2 +0,0 @@
1
- import type { Config } from '../config';
2
- export declare function mockConfig(overrides?: Partial<Config>): Config;
@@ -1,2 +0,0 @@
1
- import type { InternalLogger } from '../internalLogger';
2
- export declare const mockInternalLogger: InternalLogger;
@@ -1,2 +0,0 @@
1
- import type { StacktraceParser } from '../api';
2
- export declare const mockStacktraceParser: StacktraceParser;
@@ -1,12 +0,0 @@
1
- import type { Patterns } from '../config';
2
- import { BaseTransport } from '../transports';
3
- import type { Transport, TransportItem } from '../transports';
4
- export declare class MockTransport extends BaseTransport implements Transport {
5
- private ignoreURLs;
6
- readonly name = "@grafana/transport-mock";
7
- readonly version = "1.0.0-beta3";
8
- items: TransportItem[];
9
- constructor(ignoreURLs?: Patterns);
10
- send(item: TransportItem): void | Promise<void>;
11
- getIgnoreUrls(): Patterns;
12
- }
@@ -1,7 +0,0 @@
1
- export interface TestPromise<T> {
2
- promise: Promise<T>;
3
- reject: (reason: any) => void;
4
- resolve: (value: T | PromiseLike<T>) => void;
5
- id?: number;
6
- }
7
- export declare function createTestPromise<T>(id?: number): TestPromise<T>;
@@ -1,6 +0,0 @@
1
- import { BaseExtension } from '../utils';
2
- import type { Transport, TransportItem } from './types';
3
- export declare abstract class BaseTransport extends BaseExtension implements Transport {
4
- abstract send(item: TransportItem): void | Promise<void>;
5
- getIgnoreUrls(): Array<string | RegExp>;
6
- }
@@ -1,8 +0,0 @@
1
- export declare enum TransportItemType {
2
- EXCEPTION = "exception",
3
- LOG = "log",
4
- MEASUREMENT = "measurement",
5
- TRACE = "trace",
6
- EVENT = "event"
7
- }
8
- export declare const transportItemTypeToBodyKey: Record<TransportItemType, string>;
@@ -1,5 +0,0 @@
1
- export { initializeTransports } from './initialize';
2
- export { BaseTransport } from './base';
3
- export { TransportItemType, transportItemTypeToBodyKey } from './const';
4
- export type { BeforeSendHook, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, } from './types';
5
- export { getTransportBody } from './utils';
@@ -1,6 +0,0 @@
1
- import type { Config, Patterns } from '../config';
2
- import type { InternalLogger } from '../internalLogger';
3
- import type { BeforeSendHook, Transports } from './types';
4
- export declare function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean;
5
- export declare function createBeforeSendHookFromIgnorePatterns(patterns: Patterns): BeforeSendHook;
6
- export declare function initializeTransports(internalLogger: InternalLogger, config: Config): Transports;
@@ -1 +0,0 @@
1
- export {};
@@ -1,110 +0,0 @@
1
- import { mockInternalLogger } from '../testUtils';
2
- import { getCurrentTimestamp } from '../utils';
3
- import { VERSION } from '../version';
4
- import { BaseTransport } from './base';
5
- import { TransportItemType } from './const';
6
- import { initializeTransports } from './initialize';
7
- class MockTransport extends BaseTransport {
8
- constructor() {
9
- super(...arguments);
10
- this.name = '@grafana/transport-mock';
11
- this.version = VERSION;
12
- this.sentItems = [];
13
- }
14
- send(item) {
15
- this.sentItems.push(item);
16
- }
17
- }
18
- describe('transports', () => {
19
- describe('config.ignoreErrors', () => {
20
- it('will filter out errors by string or regex', () => {
21
- var _a;
22
- const transport = new MockTransport();
23
- const config = {
24
- transports: [transport],
25
- ignoreErrors: ['Error: ResizeObserver', /FetchError[:\s\w\/]*pwc/],
26
- };
27
- const transports = initializeTransports(mockInternalLogger, config);
28
- transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));
29
- transports.execute(makeExceptionTransportItem('TypeError', '_.viz is undefined'));
30
- transports.execute(makeExceptionTransportItem('FetchError', '404 \n Instantiating https://pwc.grafana.net/public/react-router-dom'));
31
- transports.execute(makeExceptionTransportItem('FetchError', '404 \n Instantiating https://pwc.grafana.net/public/@emotion/css'));
32
- expect(transport.sentItems).toHaveLength(1);
33
- expect(((_a = transport.sentItems[0]) === null || _a === void 0 ? void 0 : _a.payload).type).toEqual('TypeError');
34
- });
35
- });
36
- describe('config.beforeSend', () => {
37
- it('will not send events that are rejected by beforeSend hook', () => {
38
- var _a;
39
- const transport = new MockTransport();
40
- const hookedItems = [];
41
- const config = {
42
- transports: [transport],
43
- beforeSend: (item) => {
44
- hookedItems.push(item);
45
- if (item.type === TransportItemType.EXCEPTION && item.payload.type === 'TypeError') {
46
- return null;
47
- }
48
- return item;
49
- },
50
- };
51
- const transports = initializeTransports(mockInternalLogger, config);
52
- transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));
53
- transports.execute(makeExceptionTransportItem('TypeError', '_.viz is undefined'));
54
- expect(transport.sentItems).toHaveLength(1);
55
- expect(hookedItems).toHaveLength(2);
56
- expect(((_a = transport.sentItems[0]) === null || _a === void 0 ? void 0 : _a.payload).type).toEqual('Error');
57
- });
58
- it('events can be modified by beforeSend hook', () => {
59
- var _a;
60
- const transport = new MockTransport();
61
- const config = {
62
- transports: [transport],
63
- beforeSend: (item) => {
64
- if (item.type === TransportItemType.EXCEPTION) {
65
- return Object.assign(Object.assign({}, item), { payload: Object.assign(Object.assign({}, item.payload), { type: 'NewType' }) });
66
- }
67
- return item;
68
- },
69
- };
70
- const transports = initializeTransports(mockInternalLogger, config);
71
- transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));
72
- expect(transport.sentItems).toHaveLength(1);
73
- expect(((_a = transport.sentItems[0]) === null || _a === void 0 ? void 0 : _a.payload).type).toEqual('NewType');
74
- });
75
- });
76
- describe('multiple transports of the same type', () => {
77
- const transport1 = new MockTransport();
78
- const transport2 = new MockTransport();
79
- const config = {
80
- transports: [transport1, transport2],
81
- };
82
- const transports = initializeTransports(mockInternalLogger, config);
83
- it('will all be added and receive events', () => {
84
- transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));
85
- expect(transport1.sentItems).toHaveLength(1);
86
- expect(transport2.sentItems).toHaveLength(1);
87
- });
88
- it('one of them can be removed by instance', () => {
89
- transports.remove(transport1);
90
- transports.execute(makeExceptionTransportItem('Error', 'Kaboom'));
91
- expect(transport1.sentItems).toHaveLength(1);
92
- expect(transport2.sentItems).toHaveLength(2);
93
- });
94
- });
95
- });
96
- function makeExceptionTransportItem(type, value) {
97
- return {
98
- type: TransportItemType.EXCEPTION,
99
- payload: {
100
- type,
101
- value,
102
- timestamp: getCurrentTimestamp(),
103
- stacktrace: {
104
- frames: [],
105
- },
106
- },
107
- meta: {},
108
- };
109
- }
110
- //# sourceMappingURL=transports.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transports.test.js","sourceRoot":"","sources":["../../../src/transports/transports.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,aAAc,SAAQ,aAAa;IAAzC;;QACW,SAAI,GAAG,yBAAy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AAwC,EAAE,GAAG,EAAE;YAChD,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC9B,UAAU,CAAC,OAAO,CAAC,0BAA0B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YAClE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC7C,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,0BAA0B,CAAC,IAAY,EAAE,KAAa;IAC7D,OAAO;QACL,IAAI,EAAE,iBAAiB,CAAC,SAAS;QACjC,OAAO,EAAE;YACP,IAAI;YACJ,KAAK;YACL,SAAS,EAAE,mBAAmB,EAAE;YAChC,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE;aACX;SACF;QACD,IAAI,EAAE,EAAE;KACT,CAAC;AACJ,CAAC","sourcesContent":["import type { ExceptionEvent } from '../api';\nimport type { Config } from '../config';\nimport { mockInternalLogger } from '../testUtils';\nimport { getCurrentTimestamp } from '../utils';\nimport { VERSION } from '../version';\nimport { BaseTransport } from './base';\nimport { TransportItemType } from './const';\nimport { initializeTransports } from './initialize';\nimport type { Transport, TransportItem } from './types';\n\nclass MockTransport extends BaseTransport implements Transport {\n readonly name = '@grafana/transport-mock';\n readonly version = VERSION;\n\n sentItems: TransportItem[] = [];\n\n send(item: TransportItem): void | Promise<void> {\n this.sentItems.push(item);\n }\n}\n\ndescribe('transports', () => {\n describe('config.ignoreErrors', () => {\n it('will filter out errors by string or regex', () => {\n const transport = new MockTransport();\n const config = {\n transports: [transport],\n ignoreErrors: ['Error: ResizeObserver', /FetchError[:\\s\\w\\/]*pwc/],\n } as any as Config;\n\n const transports = initializeTransports(mockInternalLogger, config);\n\n transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));\n transports.execute(makeExceptionTransportItem('TypeError', '_.viz is undefined'));\n transports.execute(\n makeExceptionTransportItem(\n 'FetchError',\n '404 \\n Instantiating https://pwc.grafana.net/public/react-router-dom'\n )\n );\n transports.execute(\n makeExceptionTransportItem('FetchError', '404 \\n Instantiating https://pwc.grafana.net/public/@emotion/css')\n );\n expect(transport.sentItems).toHaveLength(1);\n expect((transport.sentItems[0]?.payload as ErrorEvent).type).toEqual('TypeError');\n });\n });\n\n describe('config.beforeSend', () => {\n it('will not send events that are rejected by beforeSend hook', () => {\n const transport = new MockTransport();\n const hookedItems: TransportItem[] = [];\n const config = {\n transports: [transport],\n beforeSend: (item: TransportItem) => {\n hookedItems.push(item);\n if (item.type === TransportItemType.EXCEPTION && (item.payload as ErrorEvent).type === 'TypeError') {\n return null;\n }\n return item;\n },\n } as any as Config;\n\n const transports = initializeTransports(mockInternalLogger, config);\n transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));\n transports.execute(makeExceptionTransportItem('TypeError', '_.viz is undefined'));\n expect(transport.sentItems).toHaveLength(1);\n expect(hookedItems).toHaveLength(2);\n expect((transport.sentItems[0]?.payload as ErrorEvent).type).toEqual('Error');\n });\n\n it('events can be modified by beforeSend hook', () => {\n const transport = new MockTransport();\n const config = {\n transports: [transport],\n beforeSend: (item: TransportItem) => {\n if (item.type === TransportItemType.EXCEPTION) {\n return {\n ...item,\n payload: {\n ...item.payload,\n type: 'NewType',\n },\n };\n }\n return item;\n },\n } as any as Config;\n\n const transports = initializeTransports(mockInternalLogger, config);\n transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));\n expect(transport.sentItems).toHaveLength(1);\n expect((transport.sentItems[0]?.payload as ErrorEvent).type).toEqual('NewType');\n });\n });\n\n describe('multiple transports of the same type', () => {\n const transport1 = new MockTransport();\n const transport2 = new MockTransport();\n\n const config = {\n transports: [transport1, transport2],\n } as any as Config;\n const transports = initializeTransports(mockInternalLogger, config);\n\n it('will all be added and receive events', () => {\n transports.execute(makeExceptionTransportItem('Error', 'ResizeObserver loop limit exceeded'));\n expect(transport1.sentItems).toHaveLength(1);\n expect(transport2.sentItems).toHaveLength(1);\n });\n\n it('one of them can be removed by instance', () => {\n transports.remove(transport1);\n transports.execute(makeExceptionTransportItem('Error', 'Kaboom'));\n expect(transport1.sentItems).toHaveLength(1);\n expect(transport2.sentItems).toHaveLength(2);\n });\n });\n});\n\nfunction makeExceptionTransportItem(type: string, value: string): TransportItem<ExceptionEvent> {\n return {\n type: TransportItemType.EXCEPTION,\n payload: {\n type,\n value,\n timestamp: getCurrentTimestamp(),\n stacktrace: {\n frames: [],\n },\n },\n meta: {},\n };\n}\n\nexport {};\n"]}
@@ -1,37 +0,0 @@
1
- import type { APIEvent, EventEvent, ExceptionEvent, LogEvent, MeasurementEvent, TraceEvent } from '../api';
2
- import type { Patterns } from '../config';
3
- import type { Meta } from '../metas';
4
- import type { Extension } from '../utils';
5
- import type { TransportItemType } from './const';
6
- export type TransportItemPayload<P = APIEvent> = P;
7
- export type BeforeSendHook<P = APIEvent> = (item: TransportItem<P>) => TransportItem<P> | null;
8
- export interface TransportItem<P = APIEvent> {
9
- type: TransportItemType;
10
- payload: TransportItemPayload<P>;
11
- meta: Meta;
12
- }
13
- export interface Transport extends Extension {
14
- send(item: TransportItem): void | Promise<void>;
15
- getIgnoreUrls(): Patterns;
16
- }
17
- export interface TransportBody {
18
- meta: Meta;
19
- exceptions?: ExceptionEvent[];
20
- logs?: LogEvent[];
21
- measurements?: MeasurementEvent[];
22
- traces?: TraceEvent;
23
- events?: EventEvent[];
24
- }
25
- export interface Transports {
26
- add: (...transports: Transport[]) => void;
27
- addBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
28
- addIgnoreErrorsPatterns: (...ignoreErrorsPatterns: Array<Patterns | undefined>) => void;
29
- execute: (transportItem: TransportItem) => void;
30
- getBeforeSendHooks: () => BeforeSendHook[];
31
- isPaused: () => boolean;
32
- remove: (...transports: Transport[]) => void;
33
- removeBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
34
- transports: Transport[];
35
- pause: () => void;
36
- unpause: () => void;
37
- }
@@ -1,2 +0,0 @@
1
- import type { TransportBody, TransportItem } from './types';
2
- export declare function getTransportBody(item: TransportItem): TransportBody;
@@ -1,2 +0,0 @@
1
- import type { UnpatchedConsole } from './types';
2
- export declare const defaultUnpatchedConsole: UnpatchedConsole;
@@ -1,3 +0,0 @@
1
- export { defaultUnpatchedConsole } from './const';
2
- export { initializeUnpatchedConsole, unpatchedConsole } from './initialize';
3
- export type { UnpatchedConsole } from './types';
@@ -1,4 +0,0 @@
1
- import type { Config } from '../config';
2
- import type { UnpatchedConsole } from './types';
3
- export declare let unpatchedConsole: UnpatchedConsole;
4
- export declare function initializeUnpatchedConsole(config: Config): UnpatchedConsole;
@@ -1 +0,0 @@
1
- export type UnpatchedConsole = Console;
@@ -1,6 +0,0 @@
1
- export type BaseObjectKey = string | number;
2
- export type BaseObjectPrimitiveValue = string | number | boolean | null | undefined;
3
- export type BaseObjectValue = BaseObjectPrimitiveValue | BaseObject | BaseObjectPrimitiveValue[];
4
- export interface BaseObject {
5
- [key: BaseObjectKey]: BaseObjectValue;
6
- }
@@ -1,2 +0,0 @@
1
- import deepEqual from 'fast-deep-equal';
2
- export { deepEqual };
@@ -1,19 +0,0 @@
1
- import type { Faro } from '../sdk';
2
- export interface Extension {
3
- readonly name: string;
4
- readonly version: string;
5
- get faro(): Faro;
6
- logDebug(...args: unknown[]): void;
7
- logInfo(...args: unknown[]): void;
8
- logWarn(...args: unknown[]): void;
9
- logError(...args: unknown[]): void;
10
- }
11
- export declare abstract class BaseExtension implements Extension {
12
- abstract readonly name: string;
13
- abstract readonly version: string;
14
- get faro(): Faro;
15
- logDebug(...args: unknown[]): void;
16
- logInfo(...args: unknown[]): void;
17
- logWarn(...args: unknown[]): void;
18
- logError(...args: unknown[]): void;
19
- }
@@ -1 +0,0 @@
1
- export declare function getCurrentTimestamp(): string;
@@ -1,12 +0,0 @@
1
- export { BaseExtension } from './extensions';
2
- export type { Extension } from './extensions';
3
- export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';
4
- export { deepEqual } from './deepEqual';
5
- export { getCurrentTimestamp } from './getCurrentTimestamp';
6
- export { 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, } from './is';
7
- export type { IsFnHelper } from './is';
8
- export { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';
9
- export { noop } from './noop';
10
- export { createPromiseBuffer } from './promiseBuffer';
11
- export type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';
12
- export { genShortID } from './shortId';
@@ -1,31 +0,0 @@
1
- export type IsFnHelper<T = unknown> = (value: unknown) => value is T;
2
- export declare function isTypeof<T = unknown>(value: unknown, type: string): value is T;
3
- export declare function isToString<T = unknown>(value: unknown, type: string): value is T;
4
- export declare function isInstanceOf<T extends Function = any>(value: unknown, reference: T): value is T;
5
- export declare const isUndefined: IsFnHelper<undefined>;
6
- export declare const isNull: IsFnHelper<null>;
7
- export declare const isString: IsFnHelper<string>;
8
- export declare const isNumber: IsFnHelper<number | bigint>;
9
- export declare const isInt: IsFnHelper<number>;
10
- export declare const isBoolean: IsFnHelper<boolean>;
11
- export declare const isSymbol: IsFnHelper<Symbol>;
12
- export declare const isObject: IsFnHelper<object>;
13
- export declare const isFunction: IsFnHelper<Function>;
14
- export declare const isArray: IsFnHelper<unknown[]>;
15
- export declare const isRegExp: IsFnHelper<string>;
16
- export declare const isThenable: IsFnHelper<{
17
- then: Function;
18
- }>;
19
- export declare const isPrimitive: IsFnHelper<string | number | bigint | boolean | symbol>;
20
- export declare const isEventDefined: boolean;
21
- export declare const isEvent: IsFnHelper<Event>;
22
- export declare const isErrorDefined: boolean;
23
- export declare const isError: IsFnHelper<Error>;
24
- export declare const isErrorEvent: IsFnHelper<ErrorEvent>;
25
- export declare const isDomError: IsFnHelper<DOMException>;
26
- export declare const isDomException: IsFnHelper<DOMException>;
27
- export declare const isElementDefined: boolean;
28
- export declare const isElement: IsFnHelper<Element>;
29
- export declare const isMapDefined: boolean;
30
- export declare const isMap: IsFnHelper<Map<any, any>>;
31
- export declare const isSyntheticEvent: IsFnHelper<Event>;
@@ -1,10 +0,0 @@
1
- export declare enum LogLevel {
2
- TRACE = "trace",
3
- DEBUG = "debug",
4
- INFO = "info",
5
- LOG = "log",
6
- WARN = "warn",
7
- ERROR = "error"
8
- }
9
- export declare const defaultLogLevel = LogLevel.LOG;
10
- export declare const allLogLevels: Readonly<Array<Readonly<LogLevel>>>;
@@ -1 +0,0 @@
1
- export declare function noop(): void;
@@ -1,14 +0,0 @@
1
- export interface PromiseBufferOptions {
2
- concurrency: number;
3
- size: number;
4
- }
5
- export type PromiseProducer<T> = () => PromiseLike<T>;
6
- export interface PromiseBuffer<T> {
7
- add(promiseProducer: PromiseProducer<T>): PromiseLike<T>;
8
- }
9
- export interface BufferItem<T> {
10
- producer: PromiseProducer<T>;
11
- resolve: (value: T) => void;
12
- reject: (reason?: any) => void;
13
- }
14
- export declare function createPromiseBuffer<T>(options: PromiseBufferOptions): PromiseBuffer<T>;
@@ -1 +0,0 @@
1
- export {};