@grafana/faro-core 1.2.1 → 1.2.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 (139) hide show
  1. package/dist/bundle/faro-core.iife.js +1 -1
  2. package/dist/bundle/types/api/events/index.d.ts +2 -0
  3. package/dist/bundle/types/api/events/initialize.d.ts +8 -0
  4. package/dist/bundle/types/api/events/types.d.ts +15 -0
  5. package/dist/bundle/types/api/exceptions/const.d.ts +1 -0
  6. package/dist/bundle/types/api/exceptions/index.d.ts +3 -0
  7. package/dist/bundle/types/api/exceptions/initialize.d.ts +8 -0
  8. package/dist/bundle/types/api/exceptions/types.d.ts +35 -0
  9. package/dist/bundle/types/api/index.d.ts +9 -0
  10. package/dist/bundle/types/api/initialize.d.ts +7 -0
  11. package/dist/bundle/types/api/logs/index.d.ts +2 -0
  12. package/dist/bundle/types/api/logs/initialize.d.ts +8 -0
  13. package/dist/bundle/types/api/logs/types.d.ts +18 -0
  14. package/dist/bundle/types/api/measurements/index.d.ts +2 -0
  15. package/dist/bundle/types/api/measurements/initialize.d.ts +8 -0
  16. package/dist/bundle/types/api/measurements/types.d.ts +20 -0
  17. package/dist/bundle/types/api/meta/index.d.ts +2 -0
  18. package/dist/bundle/types/api/meta/initialize.d.ts +7 -0
  19. package/dist/bundle/types/api/meta/types.d.ts +10 -0
  20. package/dist/bundle/types/api/traces/index.d.ts +2 -0
  21. package/dist/bundle/types/api/traces/initialize.d.ts +7 -0
  22. package/dist/bundle/types/api/traces/types.d.ts +20 -0
  23. package/dist/bundle/types/api/types.d.ts +8 -0
  24. package/dist/bundle/types/config/const.d.ts +6 -0
  25. package/dist/bundle/types/config/index.d.ts +2 -0
  26. package/dist/bundle/types/config/types.d.ts +34 -0
  27. package/dist/bundle/types/extensions/baseExtension.d.ts +15 -0
  28. package/dist/bundle/types/extensions/index.d.ts +2 -0
  29. package/dist/bundle/types/extensions/types.d.ts +16 -0
  30. package/dist/bundle/types/globalObject/globalObject.d.ts +7 -0
  31. package/dist/bundle/types/globalObject/index.d.ts +2 -0
  32. package/dist/bundle/types/index.d.ts +24 -0
  33. package/dist/bundle/types/initialize.d.ts +3 -0
  34. package/dist/bundle/types/instrumentations/base.d.ts +9 -0
  35. package/dist/bundle/types/instrumentations/index.d.ts +4 -0
  36. package/dist/bundle/types/instrumentations/initialize.d.ts +8 -0
  37. package/dist/bundle/types/instrumentations/registerInitial.d.ts +2 -0
  38. package/dist/bundle/types/instrumentations/types.d.ts +14 -0
  39. package/dist/bundle/types/internalLogger/const.d.ts +11 -0
  40. package/dist/bundle/types/internalLogger/createInternalLogger.d.ts +4 -0
  41. package/dist/bundle/types/internalLogger/index.d.ts +4 -0
  42. package/dist/bundle/types/internalLogger/initialize.d.ts +5 -0
  43. package/dist/bundle/types/internalLogger/types.d.ts +7 -0
  44. package/dist/bundle/types/metas/index.d.ts +3 -0
  45. package/dist/bundle/types/metas/initialize.d.ts +5 -0
  46. package/dist/bundle/types/metas/registerInitial.d.ts +2 -0
  47. package/dist/bundle/types/metas/types.d.ts +71 -0
  48. package/dist/bundle/types/sdk/const.d.ts +1 -0
  49. package/dist/bundle/types/sdk/faroGlobalObject.d.ts +2 -0
  50. package/dist/bundle/types/sdk/index.d.ts +4 -0
  51. package/dist/bundle/types/sdk/internalFaroGlobalObject.d.ts +4 -0
  52. package/dist/bundle/types/sdk/registerFaro.d.ts +10 -0
  53. package/dist/bundle/types/sdk/types.d.ts +18 -0
  54. package/dist/bundle/types/semantic.d.ts +8 -0
  55. package/dist/bundle/types/testUtils/index.d.ts +6 -0
  56. package/dist/bundle/types/testUtils/mockConfig.d.ts +2 -0
  57. package/dist/bundle/types/testUtils/mockInternalLogger.d.ts +2 -0
  58. package/dist/bundle/types/testUtils/mockStacktraceParser.d.ts +2 -0
  59. package/dist/bundle/types/testUtils/mockTransport.d.ts +13 -0
  60. package/dist/bundle/types/testUtils/testPromise.d.ts +7 -0
  61. package/dist/bundle/types/transports/base.d.ts +7 -0
  62. package/dist/bundle/types/transports/batchExecutor.d.ts +16 -0
  63. package/dist/bundle/types/transports/const.d.ts +9 -0
  64. package/dist/bundle/types/transports/index.d.ts +6 -0
  65. package/dist/bundle/types/transports/initialize.d.ts +8 -0
  66. package/dist/bundle/types/transports/registerInitial.d.ts +2 -0
  67. package/dist/bundle/types/transports/types.d.ts +46 -0
  68. package/dist/bundle/types/transports/utils.d.ts +5 -0
  69. package/dist/bundle/types/unpatchedConsole/const.d.ts +2 -0
  70. package/dist/bundle/types/unpatchedConsole/index.d.ts +3 -0
  71. package/dist/bundle/types/unpatchedConsole/initialize.d.ts +4 -0
  72. package/dist/bundle/types/unpatchedConsole/types.d.ts +1 -0
  73. package/dist/bundle/types/utils/baseObject.d.ts +6 -0
  74. package/dist/bundle/types/utils/date.d.ts +1 -0
  75. package/dist/bundle/types/utils/deepEqual.d.ts +1 -0
  76. package/dist/bundle/types/utils/getCurrentTimestamp.d.ts +1 -0
  77. package/dist/bundle/types/utils/index.d.ts +11 -0
  78. package/dist/bundle/types/utils/is.d.ts +31 -0
  79. package/dist/bundle/types/utils/logLevels.d.ts +10 -0
  80. package/dist/bundle/types/utils/noop.d.ts +1 -0
  81. package/dist/bundle/types/utils/promiseBuffer.d.ts +14 -0
  82. package/dist/bundle/types/utils/shortId.d.ts +1 -0
  83. package/dist/bundle/types/version.d.ts +1 -0
  84. package/dist/cjs/config/types.js.map +1 -1
  85. package/dist/cjs/index.js +2 -1
  86. package/dist/cjs/index.js.map +1 -1
  87. package/dist/cjs/metas/index.js.map +1 -1
  88. package/dist/cjs/metas/registerInitial.js +5 -4
  89. package/dist/cjs/metas/registerInitial.js.map +1 -1
  90. package/dist/cjs/metas/types.js.map +1 -1
  91. package/dist/cjs/utils/date.js +8 -0
  92. package/dist/cjs/utils/date.js.map +1 -0
  93. package/dist/cjs/utils/index.js +3 -1
  94. package/dist/cjs/utils/index.js.map +1 -1
  95. package/dist/cjs/version.js +1 -1
  96. package/dist/cjs/version.js.map +1 -1
  97. package/dist/esm/config/types.js.map +1 -1
  98. package/dist/esm/index.js +1 -1
  99. package/dist/esm/index.js.map +1 -1
  100. package/dist/esm/metas/index.js.map +1 -1
  101. package/dist/esm/metas/registerInitial.js +5 -4
  102. package/dist/esm/metas/registerInitial.js.map +1 -1
  103. package/dist/esm/metas/types.js.map +1 -1
  104. package/dist/esm/utils/date.js +4 -0
  105. package/dist/esm/utils/date.js.map +1 -0
  106. package/dist/esm/utils/index.js +1 -0
  107. package/dist/esm/utils/index.js.map +1 -1
  108. package/dist/esm/version.js +1 -1
  109. package/dist/esm/version.js.map +1 -1
  110. package/dist/spec/core/src/config/types.js.map +1 -1
  111. package/dist/spec/core/src/index.js +2 -1
  112. package/dist/spec/core/src/index.js.map +1 -1
  113. package/dist/spec/core/src/metas/index.js.map +1 -1
  114. package/dist/spec/core/src/metas/registerInitial.js +5 -4
  115. package/dist/spec/core/src/metas/registerInitial.js.map +1 -1
  116. package/dist/spec/core/src/metas/types.js.map +1 -1
  117. package/dist/spec/core/src/utils/date.js +8 -0
  118. package/dist/spec/core/src/utils/date.js.map +1 -0
  119. package/dist/spec/core/src/utils/index.js +3 -1
  120. package/dist/spec/core/src/utils/index.js.map +1 -1
  121. package/dist/spec/core/src/version.js +1 -1
  122. package/dist/spec/core/src/version.js.map +1 -1
  123. package/dist/types/config/types.d.ts +6 -0
  124. package/dist/types/core/src/config/types.d.ts +6 -0
  125. package/dist/types/core/src/index.d.ts +1 -1
  126. package/dist/types/core/src/metas/index.d.ts +1 -1
  127. package/dist/types/core/src/metas/types.d.ts +4 -0
  128. package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
  129. package/dist/types/core/src/utils/date.d.ts +1 -0
  130. package/dist/types/core/src/utils/index.d.ts +1 -0
  131. package/dist/types/core/src/version.d.ts +1 -1
  132. package/dist/types/index.d.ts +1 -1
  133. package/dist/types/metas/index.d.ts +1 -1
  134. package/dist/types/metas/types.d.ts +4 -0
  135. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  136. package/dist/types/utils/date.d.ts +1 -0
  137. package/dist/types/utils/index.d.ts +1 -0
  138. package/dist/types/version.d.ts +1 -1
  139. package/package.json +2 -2
@@ -0,0 +1,71 @@
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
+ attributes?: MetaAttributes;
36
+ }
37
+ export interface MetaPage {
38
+ id?: string;
39
+ url?: string;
40
+ attributes?: MetaAttributes;
41
+ }
42
+ interface NavigatorUABrandVersion {
43
+ brand?: string;
44
+ version?: string;
45
+ }
46
+ export interface MetaBrowser {
47
+ name?: string;
48
+ version?: string;
49
+ os?: string;
50
+ mobile?: boolean;
51
+ userAgent?: string;
52
+ language?: string;
53
+ brands?: NavigatorUABrandVersion[] | string;
54
+ }
55
+ export interface MetaView {
56
+ name: string;
57
+ }
58
+ export interface MetaK6 {
59
+ isK6Browser?: boolean;
60
+ }
61
+ export interface Meta {
62
+ sdk?: MetaSDK;
63
+ app?: MetaApp;
64
+ user?: MetaUser;
65
+ session?: MetaSession;
66
+ page?: MetaPage;
67
+ browser?: MetaBrowser;
68
+ view?: MetaView;
69
+ k6?: MetaK6;
70
+ }
71
+ export {};
@@ -0,0 +1 @@
1
+ export declare const internalGlobalObjectKey = "_faroInternal";
@@ -0,0 +1,2 @@
1
+ import type { Faro } from './types';
2
+ export declare function setFaroOnGlobalObject(faro: Faro): void;
@@ -0,0 +1,4 @@
1
+ export { internalGlobalObjectKey } from './const';
2
+ export { faro, registerFaro } from './registerFaro';
3
+ export { getInternalFromGlobalObject as getInternalFaroFromGlobalObject, isInternalFaroOnGlobalObject as isInternalFaroOnGlobalObject, setInternalFaroOnGlobalObject as setInternalFaroOnGlobalObject, } from './internalFaroGlobalObject';
4
+ export type { Faro } from './types';
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1,10 @@
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
+ import type { Faro } from './types';
9
+ export declare let faro: Faro;
10
+ export declare function registerFaro(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas, transports: Transports, api: API, instrumentations: Instrumentations): Faro;
@@ -0,0 +1,18 @@
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
+ }
@@ -0,0 +1,8 @@
1
+ export declare const Conventions: {
2
+ readonly EventNames: {
3
+ readonly CLICK: "click";
4
+ readonly NAVIGATION: "navigation";
5
+ readonly SESSION_START: "session_start";
6
+ readonly VIEW_CHANGED: "view_changed";
7
+ };
8
+ };
@@ -0,0 +1,6 @@
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';
@@ -0,0 +1,2 @@
1
+ import type { Config } from '../config';
2
+ export declare function mockConfig(overrides?: Partial<Config>): Config;
@@ -0,0 +1,2 @@
1
+ import type { InternalLogger } from '../internalLogger';
2
+ export declare const mockInternalLogger: InternalLogger;
@@ -0,0 +1,2 @@
1
+ import type { StacktraceParser } from '../api';
2
+ export declare const mockStacktraceParser: StacktraceParser;
@@ -0,0 +1,13 @@
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.2.2";
8
+ items: TransportItem[];
9
+ constructor(ignoreURLs?: Patterns);
10
+ send(items: TransportItem[]): void | Promise<void>;
11
+ isBatched(): boolean;
12
+ getIgnoreUrls(): Patterns;
13
+ }
@@ -0,0 +1,7 @@
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>;
@@ -0,0 +1,7 @@
1
+ import { BaseExtension } from '../extensions';
2
+ import type { Transport, TransportItem } from './types';
3
+ export declare abstract class BaseTransport extends BaseExtension implements Transport {
4
+ abstract send(items: TransportItem | TransportItem[]): void | Promise<void>;
5
+ isBatched(): boolean;
6
+ getIgnoreUrls(): Array<string | RegExp>;
7
+ }
@@ -0,0 +1,16 @@
1
+ import type { TransportItem } from '../';
2
+ import type { BatchExecutorOptions, SendFn } from './types';
3
+ export declare class BatchExecutor {
4
+ private readonly itemLimit;
5
+ private readonly sendTimeout;
6
+ private signalBuffer;
7
+ private sendFn;
8
+ private paused;
9
+ private flushInterval;
10
+ constructor(sendFn: SendFn, options?: BatchExecutorOptions);
11
+ addItem(item: TransportItem): void;
12
+ start(): void;
13
+ pause(): void;
14
+ groupItems(items: TransportItem[]): TransportItem[][];
15
+ private flush;
16
+ }
@@ -0,0 +1,9 @@
1
+ import type { BodyKey } from './types';
2
+ export declare enum TransportItemType {
3
+ EXCEPTION = "exception",
4
+ LOG = "log",
5
+ MEASUREMENT = "measurement",
6
+ TRACE = "trace",
7
+ EVENT = "event"
8
+ }
9
+ export declare const transportItemTypeToBodyKey: Record<TransportItemType, BodyKey>;
@@ -0,0 +1,6 @@
1
+ export { initializeTransports } from './initialize';
2
+ export { BaseTransport } from './base';
3
+ export { TransportItemType, transportItemTypeToBodyKey } from './const';
4
+ export { registerInitialTransports } from './registerInitial';
5
+ export type { BatchExecutorOptions, BeforeSendHook, SendFn, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, } from './types';
6
+ export { getTransportBody } from './utils';
@@ -0,0 +1,8 @@
1
+ import type { Config, Patterns } from '../config';
2
+ import type { InternalLogger } from '../internalLogger';
3
+ import type { Metas } from '../metas';
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;
8
+ export declare function initializeTransports(unpatchedConsole: UnpatchedConsole, internalLogger: InternalLogger, config: Config, metas: Metas): Transports;
@@ -0,0 +1,2 @@
1
+ import type { Faro } from '../sdk';
2
+ export declare function registerInitialTransports(faro: Faro): void;
@@ -0,0 +1,46 @@
1
+ import type { APIEvent, EventEvent, ExceptionEvent, LogEvent, MeasurementEvent, TraceEvent } from '../api';
2
+ import type { Patterns } from '../config';
3
+ import type { Extension } from '../extensions';
4
+ import type { Meta } from '../metas';
5
+ import type { TransportItemType } from './const';
6
+ export type TransportItemPayload<P = APIEvent> = P;
7
+ export type SendFn<P = APIEvent> = (items: Array<TransportItem<P>>) => void;
8
+ export type BeforeSendHook<P = APIEvent> = (item: TransportItem<P>) => TransportItem<P> | null;
9
+ export interface TransportItem<P = APIEvent> {
10
+ type: TransportItemType;
11
+ payload: TransportItemPayload<P>;
12
+ meta: Meta;
13
+ }
14
+ export interface Transport extends Extension {
15
+ send(items: TransportItem | TransportItem[]): void | Promise<void>;
16
+ getIgnoreUrls(): Patterns;
17
+ isBatched(): boolean;
18
+ }
19
+ export type BodyKey = 'exceptions' | 'logs' | 'measurements' | 'traces' | 'events';
20
+ export interface TransportBody {
21
+ meta: Meta;
22
+ exceptions?: ExceptionEvent[];
23
+ logs?: LogEvent[];
24
+ measurements?: MeasurementEvent[];
25
+ traces?: TraceEvent;
26
+ events?: EventEvent[];
27
+ }
28
+ export interface Transports {
29
+ add: (...transports: Transport[]) => void;
30
+ addBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
31
+ addIgnoreErrorsPatterns: (...ignoreErrorsPatterns: Array<Patterns | undefined>) => void;
32
+ execute: (transportItem: TransportItem) => void;
33
+ getBeforeSendHooks: () => BeforeSendHook[];
34
+ isPaused: () => boolean;
35
+ remove: (...transports: Transport[]) => void;
36
+ removeBeforeSendHooks: (...hooks: Array<BeforeSendHook | undefined>) => void;
37
+ transports: Transport[];
38
+ pause: () => void;
39
+ unpause: () => void;
40
+ }
41
+ export interface BatchExecutorOptions {
42
+ readonly enabled?: boolean;
43
+ readonly sendTimeout?: number;
44
+ readonly itemLimit?: number;
45
+ readonly paused?: boolean;
46
+ }
@@ -0,0 +1,5 @@
1
+ import type { IResourceSpans } from '@opentelemetry/otlp-transformer';
2
+ import type { TraceEvent } from '..';
3
+ import type { TransportBody, TransportItem } from './types';
4
+ export declare function mergeResourceSpans(traces?: TraceEvent, resourceSpans?: IResourceSpans[]): TraceEvent | undefined;
5
+ export declare function getTransportBody(item: TransportItem[]): TransportBody;
@@ -0,0 +1,2 @@
1
+ import type { UnpatchedConsole } from './types';
2
+ export declare const defaultUnpatchedConsole: UnpatchedConsole;
@@ -0,0 +1,3 @@
1
+ export { defaultUnpatchedConsole } from './const';
2
+ export { initializeUnpatchedConsole, unpatchedConsole } from './initialize';
3
+ export type { UnpatchedConsole } from './types';
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1 @@
1
+ export type UnpatchedConsole = Console;
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1 @@
1
+ export declare function dateNow(): number;
@@ -0,0 +1 @@
1
+ export declare function deepEqual(a: any, b: any): boolean;
@@ -0,0 +1 @@
1
+ export declare function getCurrentTimestamp(): string;
@@ -0,0 +1,11 @@
1
+ export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';
2
+ export { deepEqual } from './deepEqual';
3
+ export { getCurrentTimestamp } from './getCurrentTimestamp';
4
+ 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';
5
+ export type { IsFnHelper } from './is';
6
+ export { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';
7
+ export { noop } from './noop';
8
+ export { createPromiseBuffer } from './promiseBuffer';
9
+ export type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';
10
+ export { genShortID } from './shortId';
11
+ export { dateNow } from './date';
@@ -0,0 +1,31 @@
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>;
@@ -0,0 +1,10 @@
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>>>;
@@ -0,0 +1 @@
1
+ export declare function noop(): void;
@@ -0,0 +1,14 @@
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>;
@@ -0,0 +1 @@
1
+ export declare function genShortID(length?: number): string;
@@ -0,0 +1 @@
1
+ export declare const VERSION = "1.2.2";
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { MetaApp, MetaItem, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nexport interface Config<P = APIEvent> {\n app: MetaApp;\n batching?: BatchExecutorOptions;\n dedupe: boolean;\n globalObjectKey: string;\n instrumentations: Instrumentation[];\n internalLoggerLevel: InternalLoggerLevel;\n isolate: boolean;\n metas: MetaItem[];\n parseStacktrace: StacktraceParser;\n paused: boolean;\n preventGlobalExposure: boolean;\n transports: Transport[];\n unpatchedConsole: UnpatchedConsole;\n\n beforeSend?: BeforeSendHook<P>;\n ignoreErrors?: Patterns;\n session?: MetaSession;\n user?: MetaUser;\n view?: MetaView;\n eventDomain?: string;\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, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { MetaApp, MetaItem, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nexport interface Config<P = APIEvent> {\n app: MetaApp;\n batching?: BatchExecutorOptions;\n dedupe: boolean;\n globalObjectKey: string;\n instrumentations: Instrumentation[];\n internalLoggerLevel: InternalLoggerLevel;\n isolate: boolean;\n metas: MetaItem[];\n parseStacktrace: StacktraceParser;\n paused: boolean;\n preventGlobalExposure: boolean;\n transports: Transport[];\n unpatchedConsole: UnpatchedConsole;\n\n beforeSend?: BeforeSendHook<P>;\n ignoreErrors?: Patterns;\n // TODO: Deprecate?\n session?: MetaSession;\n // TODO: rename to \"sessions\" once feature is ready. Do not use in any prod envs!\n experimentalSessions?: {\n enabled?: boolean;\n persistent?: boolean;\n session?: MetaSession;\n onSessionChange?: (oldSession: MetaSession | null, newSession: MetaSession) => void;\n };\n\n user?: MetaUser;\n view?: MetaView;\n eventDomain?: string;\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  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.genShortID = exports.defaultLogLevel = exports.deepEqual = exports.createPromiseBuffer = exports.allLogLevels = exports.defaultUnpatchedConsole = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.getTransportBody = exports.BaseTransport = exports.Conventions = 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.defaultExceptionType = void 0;
4
- exports.VERSION = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = void 0;
4
+ exports.VERSION = exports.dateNow = exports.noop = exports.LogLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = void 0;
5
5
  var api_1 = require("./api");
6
6
  Object.defineProperty(exports, "defaultExceptionType", { enumerable: true, get: function () { return api_1.defaultExceptionType; } });
7
7
  var extensions_1 = require("./extensions");
@@ -71,6 +71,7 @@ Object.defineProperty(exports, "isTypeof", { enumerable: true, get: function ()
71
71
  Object.defineProperty(exports, "isUndefined", { enumerable: true, get: function () { return utils_1.isUndefined; } });
72
72
  Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return utils_1.LogLevel; } });
73
73
  Object.defineProperty(exports, "noop", { enumerable: true, get: function () { return utils_1.noop; } });
74
+ Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return utils_1.dateNow; } });
74
75
  var version_1 = require("./version");
75
76
  Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
76
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6BAA6C;AAApC,2GAAA,oBAAoB,OAAA;AA4B7B,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,OAAA;AAG5B,mDAAyG;AAAhG,sHAAA,oBAAoB,OAAA;AAAE,4HAAA,0BAA0B,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAmB9E,6BAMe;AALb,2FAAA,IAAI,OAAA;AACJ,sHAAA,+BAA+B,OAAA;AAC/B,8GAAA,uBAAuB,OAAA;AACvB,mHAAA,4BAA4B,OAAA;AAC5B,oHAAA,6BAA6B,OAAA;AAI/B,uCAAyC;AAAhC,uGAAA,WAAW,OAAA;AAEpB,2CAA8G;AAArG,2GAAA,aAAa,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAAE,wHAAA,0BAA0B,OAAA;AAWvF,uDAA6D;AAApD,2HAAA,uBAAuB,OAAA;AAGhC,iCAqCiB;AApCf,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AACnB,kGAAA,SAAS,OAAA;AACT,wGAAA,eAAe,OAAA;AACf,mGAAA,UAAU,OAAA;AACV,4GAAA,mBAAmB,OAAA;AACnB,gGAAA,OAAO,OAAA;AACP,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,kGAAA,SAAS,OAAA;AACT,yGAAA,gBAAgB,OAAA;AAChB,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,qGAAA,YAAY,OAAA;AACZ,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,mGAAA,UAAU,OAAA;AACV,qGAAA,YAAY,OAAA;AACZ,8FAAA,KAAK,OAAA;AACL,8FAAA,KAAK,OAAA;AACL,qGAAA,YAAY,OAAA;AACZ,+FAAA,MAAM,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;AAaN,qCAAoC;AAA3B,kGAAA,OAAO,OAAA","sourcesContent":["export { defaultExceptionType } from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\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} from './metas';\n\nexport {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport { Conventions } 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} 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,6BAA6C;AAApC,2GAAA,oBAAoB,OAAA;AA4B7B,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,OAAA;AAG5B,mDAAyG;AAAhG,sHAAA,oBAAoB,OAAA;AAAE,4HAAA,0BAA0B,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAmB9E,6BAMe;AALb,2FAAA,IAAI,OAAA;AACJ,sHAAA,+BAA+B,OAAA;AAC/B,8GAAA,uBAAuB,OAAA;AACvB,mHAAA,4BAA4B,OAAA;AAC5B,oHAAA,6BAA6B,OAAA;AAI/B,uCAAyC;AAAhC,uGAAA,WAAW,OAAA;AAEpB,2CAA8G;AAArG,2GAAA,aAAa,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAAE,wHAAA,0BAA0B,OAAA;AAWvF,uDAA6D;AAApD,2HAAA,uBAAuB,OAAA;AAGhC,iCAsCiB;AArCf,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AACnB,kGAAA,SAAS,OAAA;AACT,wGAAA,eAAe,OAAA;AACf,mGAAA,UAAU,OAAA;AACV,4GAAA,mBAAmB,OAAA;AACnB,gGAAA,OAAO,OAAA;AACP,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,kGAAA,SAAS,OAAA;AACT,yGAAA,gBAAgB,OAAA;AAChB,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,qGAAA,YAAY,OAAA;AACZ,gGAAA,OAAO,OAAA;AACP,uGAAA,cAAc,OAAA;AACd,mGAAA,UAAU,OAAA;AACV,qGAAA,YAAY,OAAA;AACZ,8FAAA,KAAK,OAAA;AACL,8FAAA,KAAK,OAAA;AACL,qGAAA,YAAY,OAAA;AACZ,+FAAA,MAAM,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;AAaT,qCAAoC;AAA3B,kGAAA,OAAO,OAAA","sourcesContent":["export { defaultExceptionType } from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\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} from './metas';\n\nexport {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport { Conventions } 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} 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metas/index.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AAExB,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA","sourcesContent":["export { initializeMetas } from './initialize';\n\nexport { registerInitialMetas } from './registerInitial';\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} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/metas/index.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AAExB,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA","sourcesContent":["export { initializeMetas } from './initialize';\n\nexport { registerInitialMetas } from './registerInitial';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaK6,\n MetaPage,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n Metas,\n} from './types';\n"]}
@@ -13,7 +13,7 @@ exports.registerInitialMetas = void 0;
13
13
  var version_1 = require("../version");
14
14
  function registerInitialMetas(faro) {
15
15
  var _a;
16
- var _b;
16
+ var _b, _c, _d;
17
17
  var initial = {
18
18
  sdk: {
19
19
  name: '@grafana/faro-core',
@@ -24,8 +24,9 @@ function registerInitialMetas(faro) {
24
24
  }),
25
25
  },
26
26
  };
27
- if (faro.config.session) {
28
- faro.api.setSession(faro.config.session);
27
+ var session = (_c = (_b = faro.config.experimentalSessions) === null || _b === void 0 ? void 0 : _b.session) !== null && _c !== void 0 ? _c : faro.config.session;
28
+ if (session) {
29
+ faro.api.setSession(session);
29
30
  }
30
31
  if (faro.config.app) {
31
32
  initial.app = faro.config.app;
@@ -36,7 +37,7 @@ function registerInitialMetas(faro) {
36
37
  if (faro.config.view) {
37
38
  initial.view = faro.config.view;
38
39
  }
39
- (_a = faro.metas).add.apply(_a, __spreadArray([initial], ((_b = faro.config.metas) !== null && _b !== void 0 ? _b : []), false));
40
+ (_a = faro.metas).add.apply(_a, __spreadArray([initial], ((_d = faro.config.metas) !== null && _d !== void 0 ? _d : []), false));
40
41
  }
41
42
  exports.registerInitialMetas = registerInitialMetas;
42
43
  //# sourceMappingURL=registerInitial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;;IAC7C,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,iBAAO;YAChB,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAC,EAAiB;oBAAf,IAAI,UAAA,EAAE,OAAO,aAAA;gBAAO,OAAA,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,SAAA,EAAE,CAAC;YAAnB,CAAmB,CAAC;SAC3F;KACF,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;KAC1C;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;KAC/B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,CAAA,KAAA,IAAI,CAAC,KAAK,CAAA,CAAC,GAAG,0BAAC,OAAO,GAAK,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;AACxD,CAAC;AA1BD,oDA0BC","sourcesContent":["import type { Faro } from '../sdk';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n name: '@grafana/faro-core',\n version: VERSION,\n integrations: faro.config.instrumentations.map(({ name, version }) => ({ name, version })),\n },\n };\n\n if (faro.config.session) {\n faro.api.setSession(faro.config.session);\n }\n\n if (faro.config.app) {\n initial.app = faro.config.app;\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
1
+ {"version":3,"file":"registerInitial.js","sourceRoot":"","sources":["../../../src/metas/registerInitial.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sCAAqC;AAIrC,SAAgB,oBAAoB,CAAC,IAAU;;;IAC7C,IAAM,OAAO,GAAS;QACpB,GAAG,EAAE;YACH,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,iBAAO;YAChB,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAC,EAAiB;oBAAf,IAAI,UAAA,EAAE,OAAO,aAAA;gBAAO,OAAA,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,SAAA,EAAE,CAAC;YAAnB,CAAmB,CAAC;SAC3F;KACF,CAAC;IAEF,IAAM,OAAO,GAAG,MAAA,MAAA,IAAI,CAAC,MAAM,CAAC,oBAAoB,0CAAE,OAAO,mCAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IACjF,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;QACnB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;KAC/B;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KACjC;IAED,CAAA,KAAA,IAAI,CAAC,KAAK,CAAA,CAAC,GAAG,0BAAC,OAAO,GAAK,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,UAAE;AACxD,CAAC;AA3BD,oDA2BC","sourcesContent":["import type { Faro } from '../sdk';\nimport { VERSION } from '../version';\n\nimport type { Meta } from './types';\n\nexport function registerInitialMetas(faro: Faro): void {\n const initial: Meta = {\n sdk: {\n name: '@grafana/faro-core',\n version: VERSION,\n integrations: faro.config.instrumentations.map(({ name, version }) => ({ name, version })),\n },\n };\n\n const session = faro.config.experimentalSessions?.session ?? faro.config.session;\n if (session) {\n faro.api.setSession(session);\n }\n\n if (faro.config.app) {\n initial.app = faro.config.app;\n }\n\n if (faro.config.user) {\n initial.user = faro.config.user;\n }\n\n if (faro.config.view) {\n initial.view = faro.config.view;\n }\n\n faro.metas.add(initial, ...(faro.config.metas ?? []));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/metas/types.ts"],"names":[],"mappings":"","sourcesContent":["export type MetaGetter<P = Partial<Meta>> = () => P;\n\nexport type MetaItem<P = Partial<Meta>> = P | MetaGetter<P>;\n\nexport type MetasListener = (value: Meta) => void;\n\nexport interface Metas {\n add: (...getters: MetaItem[]) => void;\n remove: (...getters: MetaItem[]) => void;\n addListener: (listener: MetasListener) => void;\n removeListener: (listener: MetasListener) => void;\n value: Meta;\n}\n\nexport type MetaAttributes = Record<string, string>;\n\nexport interface MetaSDKIntegration {\n name?: string;\n version?: string;\n}\n\nexport interface MetaSDK {\n name?: string;\n version?: string;\n integrations?: MetaSDKIntegration[];\n}\n\nexport interface MetaApp {\n name?: string;\n release?: string;\n version?: string;\n environment?: string;\n}\n\nexport interface MetaUser {\n email?: string;\n id?: string;\n username?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaSession {\n id?: string;\n attributes?: MetaAttributes;\n}\n\nexport interface MetaPage {\n id?: string;\n url?: string;\n attributes?: MetaAttributes;\n}\n\ninterface NavigatorUABrandVersion {\n brand?: string;\n version?: string;\n}\n\nexport interface MetaBrowser {\n name?: string;\n version?: string;\n os?: string;\n mobile?: boolean;\n userAgent?: string;\n language?: string;\n brands?: NavigatorUABrandVersion[] | string;\n}\n\nexport interface MetaView {\n name: string;\n}\n\nexport interface MetaK6 {\n isK6Browser?: boolean;\n}\n\nexport interface Meta {\n sdk?: MetaSDK;\n app?: MetaApp;\n user?: MetaUser;\n session?: MetaSession;\n page?: MetaPage;\n browser?: MetaBrowser;\n view?: MetaView;\n k6?: MetaK6;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dateNow = void 0;
4
+ function dateNow() {
5
+ return Date.now();
6
+ }
7
+ exports.dateNow = dateNow;
8
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src/utils/date.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO;IACrB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC;AAFD,0BAEC","sourcesContent":["export function dateNow(): number {\n return Date.now();\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = 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.dateNow = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = 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 getCurrentTimestamp_1 = require("./getCurrentTimestamp");
@@ -44,4 +44,6 @@ var promiseBuffer_1 = require("./promiseBuffer");
44
44
  Object.defineProperty(exports, "createPromiseBuffer", { enumerable: true, get: function () { return promiseBuffer_1.createPromiseBuffer; } });
45
45
  var shortId_1 = require("./shortId");
46
46
  Object.defineProperty(exports, "genShortID", { enumerable: true, get: function () { return shortId_1.genShortID; } });
47
+ var date_1 = require("./date");
48
+ Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return date_1.dateNow; } });
47
49
  //# 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,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,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;AAIb,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","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\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} 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,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;AAIb,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,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\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} 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 { dateNow } from './date';\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.2.1';
5
+ exports.VERSION = '1.2.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,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.2.1';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.2.2';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { MetaApp, MetaItem, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nexport interface Config<P = APIEvent> {\n app: MetaApp;\n batching?: BatchExecutorOptions;\n dedupe: boolean;\n globalObjectKey: string;\n instrumentations: Instrumentation[];\n internalLoggerLevel: InternalLoggerLevel;\n isolate: boolean;\n metas: MetaItem[];\n parseStacktrace: StacktraceParser;\n paused: boolean;\n preventGlobalExposure: boolean;\n transports: Transport[];\n unpatchedConsole: UnpatchedConsole;\n\n beforeSend?: BeforeSendHook<P>;\n ignoreErrors?: Patterns;\n session?: MetaSession;\n user?: MetaUser;\n view?: MetaView;\n eventDomain?: string;\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, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { MetaApp, MetaItem, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\n\nexport interface Config<P = APIEvent> {\n app: MetaApp;\n batching?: BatchExecutorOptions;\n dedupe: boolean;\n globalObjectKey: string;\n instrumentations: Instrumentation[];\n internalLoggerLevel: InternalLoggerLevel;\n isolate: boolean;\n metas: MetaItem[];\n parseStacktrace: StacktraceParser;\n paused: boolean;\n preventGlobalExposure: boolean;\n transports: Transport[];\n unpatchedConsole: UnpatchedConsole;\n\n beforeSend?: BeforeSendHook<P>;\n ignoreErrors?: Patterns;\n // TODO: Deprecate?\n session?: MetaSession;\n // TODO: rename to \"sessions\" once feature is ready. Do not use in any prod envs!\n experimentalSessions?: {\n enabled?: boolean;\n persistent?: boolean;\n session?: MetaSession;\n onSessionChange?: (oldSession: MetaSession | null, newSession: MetaSession) => void;\n };\n\n user?: MetaUser;\n view?: MetaView;\n eventDomain?: string;\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
package/dist/esm/index.js CHANGED
@@ -9,6 +9,6 @@ export { faro, getInternalFaroFromGlobalObject, internalGlobalObjectKey, isInter
9
9
  export { Conventions } from './semantic';
10
10
  export { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';
11
11
  export { defaultUnpatchedConsole } from './unpatchedConsole';
12
- export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, } from './utils';
12
+ export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, } from './utils';
13
13
  export { VERSION } from './version';
14
14
  //# sourceMappingURL=index.js.map