@grafana/faro-core 1.13.3 → 1.14.1

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 (83) hide show
  1. package/dist/bundle/faro-core.iife.js +1 -1
  2. package/dist/bundle/types/api/meta/types.d.ts +4 -3
  3. package/dist/bundle/types/api/utils.d.ts +2 -0
  4. package/dist/bundle/types/config/types.d.ts +33 -1
  5. package/dist/bundle/types/metas/types.d.ts +36 -1
  6. package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
  7. package/dist/bundle/types/transports/initialize.d.ts +2 -4
  8. package/dist/bundle/types/transports/types.d.ts +0 -1
  9. package/dist/bundle/types/version.d.ts +1 -1
  10. package/dist/cjs/api/exceptions/initialize.js +10 -2
  11. package/dist/cjs/api/exceptions/initialize.js.map +1 -1
  12. package/dist/cjs/api/meta/initialize.js +8 -2
  13. package/dist/cjs/api/meta/initialize.js.map +1 -1
  14. package/dist/cjs/api/meta/types.js.map +1 -1
  15. package/dist/cjs/api/utils.js +11 -0
  16. package/dist/cjs/api/utils.js.map +1 -0
  17. package/dist/cjs/config/types.js.map +1 -1
  18. package/dist/cjs/metas/types.js.map +1 -1
  19. package/dist/cjs/transports/initialize.js +1 -35
  20. package/dist/cjs/transports/initialize.js.map +1 -1
  21. package/dist/cjs/transports/registerInitial.js +0 -1
  22. package/dist/cjs/transports/registerInitial.js.map +1 -1
  23. package/dist/cjs/transports/types.js.map +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/cjs/version.js.map +1 -1
  26. package/dist/esm/api/exceptions/initialize.js +10 -2
  27. package/dist/esm/api/exceptions/initialize.js.map +1 -1
  28. package/dist/esm/api/meta/initialize.js +8 -2
  29. package/dist/esm/api/meta/initialize.js.map +1 -1
  30. package/dist/esm/api/meta/types.js.map +1 -1
  31. package/dist/esm/api/utils.js +7 -0
  32. package/dist/esm/api/utils.js.map +1 -0
  33. package/dist/esm/config/types.js.map +1 -1
  34. package/dist/esm/metas/types.js.map +1 -1
  35. package/dist/esm/transports/initialize.js +0 -28
  36. package/dist/esm/transports/initialize.js.map +1 -1
  37. package/dist/esm/transports/registerInitial.js +0 -1
  38. package/dist/esm/transports/registerInitial.js.map +1 -1
  39. package/dist/esm/transports/types.js.map +1 -1
  40. package/dist/esm/version.js +1 -1
  41. package/dist/esm/version.js.map +1 -1
  42. package/dist/spec/core/src/api/exceptions/initialize.js +10 -2
  43. package/dist/spec/core/src/api/exceptions/initialize.js.map +1 -1
  44. package/dist/spec/core/src/api/exceptions/initialize.test.js +21 -0
  45. package/dist/spec/core/src/api/exceptions/initialize.test.js.map +1 -1
  46. package/dist/spec/core/src/api/meta/initialize.js +8 -2
  47. package/dist/spec/core/src/api/meta/initialize.js.map +1 -1
  48. package/dist/spec/core/src/api/meta/initilialize.test.js +28 -0
  49. package/dist/spec/core/src/api/meta/initilialize.test.js.map +1 -1
  50. package/dist/spec/core/src/api/meta/types.js.map +1 -1
  51. package/dist/spec/core/src/api/utils.js +11 -0
  52. package/dist/spec/core/src/api/utils.js.map +1 -0
  53. package/dist/spec/core/src/api/utils.test.js +20 -0
  54. package/dist/spec/core/src/api/utils.test.js.map +1 -0
  55. package/dist/spec/core/src/config/types.js.map +1 -1
  56. package/dist/spec/core/src/metas/types.js.map +1 -1
  57. package/dist/spec/core/src/transports/initialize.js +1 -35
  58. package/dist/spec/core/src/transports/initialize.js.map +1 -1
  59. package/dist/spec/core/src/transports/registerInitial.js +0 -1
  60. package/dist/spec/core/src/transports/registerInitial.js.map +1 -1
  61. package/dist/spec/core/src/transports/transports.test.js +0 -16
  62. package/dist/spec/core/src/transports/transports.test.js.map +1 -1
  63. package/dist/spec/core/src/transports/types.js.map +1 -1
  64. package/dist/spec/core/src/version.js +1 -1
  65. package/dist/spec/core/src/version.js.map +1 -1
  66. package/dist/types/api/meta/types.d.ts +4 -3
  67. package/dist/types/api/utils.d.ts +2 -0
  68. package/dist/types/config/types.d.ts +33 -1
  69. package/dist/types/core/src/api/meta/types.d.ts +4 -3
  70. package/dist/types/core/src/api/utils.d.ts +2 -0
  71. package/dist/types/core/src/api/utils.test.d.ts +1 -0
  72. package/dist/types/core/src/config/types.d.ts +33 -1
  73. package/dist/types/core/src/metas/types.d.ts +36 -1
  74. package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
  75. package/dist/types/core/src/transports/initialize.d.ts +2 -4
  76. package/dist/types/core/src/transports/types.d.ts +0 -1
  77. package/dist/types/core/src/version.d.ts +1 -1
  78. package/dist/types/metas/types.d.ts +36 -1
  79. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  80. package/dist/types/transports/initialize.d.ts +2 -4
  81. package/dist/types/transports/types.d.ts +0 -1
  82. package/dist/types/version.d.ts +1 -1
  83. package/package.json +2 -2
@@ -1,20 +1,21 @@
1
1
  import type { MetaOverrides, MetaPage, MetaSession, MetaUser, MetaView } from '../../metas';
2
+ type OverridesAvailableThroughApi = Pick<MetaOverrides, 'serviceName'>;
2
3
  export interface MetaAPI {
3
4
  setUser: (user?: MetaUser | undefined) => void;
4
5
  resetUser: () => void;
5
6
  setSession: (session?: MetaSession | undefined, options?: {
6
- overrides: MetaOverrides;
7
+ overrides: OverridesAvailableThroughApi;
7
8
  }) => void;
8
9
  resetSession: () => void;
9
10
  getSession: () => MetaSession | undefined;
10
11
  setView: (view?: MetaView | undefined, options?: {
11
- overrides: MetaOverrides;
12
+ overrides: OverridesAvailableThroughApi;
12
13
  }) => void;
13
14
  getView: () => MetaView | undefined;
14
15
  /**
15
16
  * If a string is provided, it will be used as the page id.
16
- * @returns
17
17
  */
18
18
  setPage: (page?: MetaPage | string | undefined) => void;
19
19
  getPage: () => MetaPage | undefined;
20
20
  }
21
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { Patterns } from '../config/types';
2
+ export declare function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -138,12 +138,28 @@ export interface Config<P = APIEvent> {
138
138
  * Track web vitals attribution data (default: false)
139
139
  */
140
140
  trackWebVitalsAttribution?: boolean;
141
+ /**
142
+ * Configuration for the web vitals instrumentation
143
+ */
144
+ webVitalsInstrumentation?: {
145
+ /**
146
+ * Report all changes for web vitals (default: false)
147
+ *
148
+ * In most cases, you only want the callback function to be called when the metric is ready to be reported.
149
+ * However, it is possible to report every change (e.g. each larger layout shift as it happens)
150
+ * by setting reportAllChanges to true.
151
+ *
152
+ * This can be useful when debugging, but in general using reportAllChanges is not needed (or recommended)
153
+ * for measuring these metrics in production.
154
+ */
155
+ reportAllChanges?: boolean;
156
+ };
141
157
  /**
142
158
  * Configuration for the console instrumentation
143
159
  */
144
160
  consoleInstrumentation?: {
145
161
  /**
146
- * Configure what console levels should be captured by Faro. By default the follwoing levels
162
+ * Configure what console levels should be captured by Faro. By default the following levels
147
163
  * are disabled: console.debug, console.trace, console.log
148
164
  *
149
165
  * If you want to collect all levels set captureConsoleDisabledLevels: [];
@@ -162,6 +178,9 @@ export interface Config<P = APIEvent> {
162
178
  */
163
179
  errorSerializer?: LogArgsSerializer;
164
180
  };
181
+ /**
182
+ * Configuration for the page tracking
183
+ */
165
184
  pageTracking?: {
166
185
  /**
167
186
  * The page meta for initial page settings
@@ -172,6 +191,19 @@ export interface Config<P = APIEvent> {
172
191
  */
173
192
  generatePageId?: (location: Location) => string;
174
193
  };
194
+ /**
195
+ * Configuration for the location tracking (Grafana cloud only)
196
+ */
197
+ geoLocationTracking?: {
198
+ /**
199
+ * Enable or disable geolocation tracking.
200
+ * Geolocation tracking must be enabled in the Grafana Cloud settings first.
201
+ * It cannot be enabled solely on the client side.
202
+ * This option allows control over tracking on the client side to comply with user
203
+ * privacy requirements.
204
+ */
205
+ enabled?: boolean;
206
+ };
175
207
  }
176
208
  export type Patterns = Array<string | RegExp>;
177
209
  export {};
@@ -27,9 +27,33 @@ export interface MetaApp {
27
27
  bundleId?: string;
28
28
  }
29
29
  export interface MetaUser {
30
+ /**
31
+ * User email address.
32
+ */
30
33
  email?: string;
34
+ /**
35
+ * Unique identifier
36
+ */
31
37
  id?: string;
38
+ /**
39
+ * Short name or login/username of the user.
40
+ */
32
41
  username?: string;
42
+ /**
43
+ * User’s full name
44
+ */
45
+ fullName?: string;
46
+ /**
47
+ * comma separated list of user roles. "admin",editor" etc.
48
+ */
49
+ roles?: string;
50
+ /**
51
+ * Unique user hash to correlate information for a user in anonymized form.
52
+ */
53
+ hash?: string;
54
+ /**
55
+ * arbitrary user attributes, must be of type string.
56
+ */
33
57
  attributes?: MetaAttributes;
34
58
  }
35
59
  export interface MetaSession {
@@ -75,9 +99,20 @@ export interface Meta {
75
99
  k6?: MetaK6;
76
100
  }
77
101
  /**
78
- * Overrides are instructions that allow the receiver to override certain properties.
102
+ * MetaOverrides are instructions that allow the receiver to override certain properties (Grafana Cloud only).
79
103
  */
80
104
  export type MetaOverrides = {
105
+ /**
106
+ * New service name (Grafana Cloud only)
107
+ */
81
108
  serviceName?: string;
109
+ /**
110
+ * Enable or disable geolocation tracking (Grafana Cloud only).
111
+ * Geolocation tracking must be enabled in the Grafana Cloud settings first.
112
+ * It cannot be enabled solely on the client side.
113
+ * This option allows control over tracking on the client side to comply with user
114
+ * privacy requirements.
115
+ */
116
+ geoLocationTrackingEnabled?: boolean;
82
117
  };
83
118
  export {};
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.13.3";
7
+ readonly version = "1.14.1";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -1,8 +1,6 @@
1
- import type { Config, Patterns } from '../config';
1
+ import type { Config } from '../config';
2
2
  import type { InternalLogger } from '../internalLogger';
3
3
  import type { Metas } from '../metas';
4
4
  import type { UnpatchedConsole } from '../unpatchedConsole';
5
- import type { BeforeSendHook, Transports } from './types';
6
- export declare function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean;
7
- export declare function createBeforeSendHookFromIgnorePatterns(patterns: Patterns): BeforeSendHook;
5
+ import type { Transports } from './types';
8
6
  export declare function initializeTransports(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas): Transports;
@@ -28,7 +28,6 @@ export interface TransportBody {
28
28
  export interface Transports {
29
29
  add: (...transports: Transport[]) => void;
30
30
  addBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
31
- addIgnoreErrorsPatterns: (...ignoreErrorsPatterns: Array<Patterns | undefined>) => void;
32
31
  execute: (transportItem: TransportItem) => void;
33
32
  getBeforeSendHooks: () => BeforeSendHook[];
34
33
  isPaused: () => boolean;
@@ -1 +1 @@
1
- export declare const VERSION = "1.13.3";
1
+ export declare const VERSION = "1.14.1";
@@ -27,9 +27,33 @@ export interface MetaApp {
27
27
  bundleId?: string;
28
28
  }
29
29
  export interface MetaUser {
30
+ /**
31
+ * User email address.
32
+ */
30
33
  email?: string;
34
+ /**
35
+ * Unique identifier
36
+ */
31
37
  id?: string;
38
+ /**
39
+ * Short name or login/username of the user.
40
+ */
32
41
  username?: string;
42
+ /**
43
+ * User’s full name
44
+ */
45
+ fullName?: string;
46
+ /**
47
+ * comma separated list of user roles. "admin",editor" etc.
48
+ */
49
+ roles?: string;
50
+ /**
51
+ * Unique user hash to correlate information for a user in anonymized form.
52
+ */
53
+ hash?: string;
54
+ /**
55
+ * arbitrary user attributes, must be of type string.
56
+ */
33
57
  attributes?: MetaAttributes;
34
58
  }
35
59
  export interface MetaSession {
@@ -75,9 +99,20 @@ export interface Meta {
75
99
  k6?: MetaK6;
76
100
  }
77
101
  /**
78
- * Overrides are instructions that allow the receiver to override certain properties.
102
+ * MetaOverrides are instructions that allow the receiver to override certain properties (Grafana Cloud only).
79
103
  */
80
104
  export type MetaOverrides = {
105
+ /**
106
+ * New service name (Grafana Cloud only)
107
+ */
81
108
  serviceName?: string;
109
+ /**
110
+ * Enable or disable geolocation tracking (Grafana Cloud only).
111
+ * Geolocation tracking must be enabled in the Grafana Cloud settings first.
112
+ * It cannot be enabled solely on the client side.
113
+ * This option allows control over tracking on the client side to comply with user
114
+ * privacy requirements.
115
+ */
116
+ geoLocationTrackingEnabled?: boolean;
82
117
  };
83
118
  export {};
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.13.3";
7
+ readonly version = "1.14.1";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -1,8 +1,6 @@
1
- import type { Config, Patterns } from '../config';
1
+ import type { Config } from '../config';
2
2
  import type { InternalLogger } from '../internalLogger';
3
3
  import type { Metas } from '../metas';
4
4
  import type { UnpatchedConsole } from '../unpatchedConsole';
5
- import type { BeforeSendHook, Transports } from './types';
6
- export declare function shouldIgnoreEvent(patterns: Patterns, msg: string): boolean;
7
- export declare function createBeforeSendHookFromIgnorePatterns(patterns: Patterns): BeforeSendHook;
5
+ import type { Transports } from './types';
8
6
  export declare function initializeTransports(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas): Transports;
@@ -28,7 +28,6 @@ export interface TransportBody {
28
28
  export interface Transports {
29
29
  add: (...transports: Transport[]) => void;
30
30
  addBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
31
- addIgnoreErrorsPatterns: (...ignoreErrorsPatterns: Array<Patterns | undefined>) => void;
32
31
  execute: (transportItem: TransportItem) => void;
33
32
  getBeforeSendHooks: () => BeforeSendHook[];
34
33
  isPaused: () => boolean;
@@ -1 +1 @@
1
- export declare const VERSION = "1.13.3";
1
+ export declare const VERSION = "1.14.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-core",
3
- "version": "1.13.3",
3
+ "version": "1.14.1",
4
4
  "description": "Core package of Faro.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "4b4b38438abc72a7992bac93c7f23ac1793a9285"
66
+ "gitHead": "b44d0c2a52419786a497fbf3f47b781d27cc0982"
67
67
  }