@flareapp/js 2.1.0 → 2.2.0
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.
- package/CHANGELOG.md +12 -0
- package/README.md +5 -0
- package/dist/index.cjs +115 -556
- package/dist/index.d.cts +6 -123
- package/dist/index.d.mts +6 -123
- package/dist/index.mjs +68 -525
- package/package.json +3 -2
- package/tsconfig.json +5 -0
- package/vitest.config.ts +17 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,126 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type AttributeValue = string | number | boolean | null | AttributeValue[] | {
|
|
4
|
-
[key: string]: AttributeValue;
|
|
5
|
-
};
|
|
6
|
-
type Attributes = Record<string, AttributeValue>;
|
|
7
|
-
type Config = {
|
|
8
|
-
key: string | null;
|
|
9
|
-
version: string;
|
|
10
|
-
sourcemapVersionId: string;
|
|
11
|
-
stage: string;
|
|
12
|
-
maxGlowsPerReport: number;
|
|
13
|
-
reportBrowserExtensionErrors: boolean;
|
|
14
|
-
ingestUrl: string;
|
|
15
|
-
debug: boolean;
|
|
16
|
-
urlDenylist: RegExp;
|
|
17
|
-
replaceDefaultUrlDenylist: boolean;
|
|
18
|
-
sampleRate: number;
|
|
19
|
-
beforeEvaluate: (error: Error) => Error | false | null | Promise<Error | false | null>;
|
|
20
|
-
beforeSubmit: (report: Report) => Report | false | null | Promise<Report | false | null>;
|
|
21
|
-
};
|
|
22
|
-
type StackFrame = {
|
|
23
|
-
file: string;
|
|
24
|
-
lineNumber: number;
|
|
25
|
-
columnNumber?: number;
|
|
26
|
-
method?: string;
|
|
27
|
-
class?: string;
|
|
28
|
-
codeSnippet?: {
|
|
29
|
-
[line: number]: string;
|
|
30
|
-
};
|
|
31
|
-
isApplicationFrame?: boolean;
|
|
32
|
-
arguments?: unknown[];
|
|
33
|
-
};
|
|
34
|
-
type SpanEvent = {
|
|
35
|
-
type: string;
|
|
36
|
-
startTimeUnixNano: number;
|
|
37
|
-
endTimeUnixNano: number | null;
|
|
38
|
-
attributes: Attributes;
|
|
39
|
-
};
|
|
40
|
-
type OverriddenGrouping = 'exception_class' | 'exception_message' | 'exception_message_and_class' | 'full_stacktrace_and_exception_class_and_code';
|
|
41
|
-
type Report = {
|
|
42
|
-
exceptionClass?: string | null;
|
|
43
|
-
message?: string | null;
|
|
44
|
-
code?: string;
|
|
45
|
-
seenAtUnixNano: number;
|
|
46
|
-
isLog?: boolean;
|
|
47
|
-
level?: MessageLevel;
|
|
48
|
-
sourcemapVersionId?: string;
|
|
49
|
-
trackingUuid?: string;
|
|
50
|
-
handled?: boolean;
|
|
51
|
-
openFrameIndex?: number;
|
|
52
|
-
applicationPath?: string;
|
|
53
|
-
overriddenGrouping?: OverriddenGrouping | null;
|
|
54
|
-
stacktrace: StackFrame[];
|
|
55
|
-
events: SpanEvent[];
|
|
56
|
-
attributes: Attributes;
|
|
57
|
-
};
|
|
58
|
-
type Glow = {
|
|
59
|
-
time: number;
|
|
60
|
-
microtime: number;
|
|
61
|
-
name: string;
|
|
62
|
-
messageLevel: MessageLevel;
|
|
63
|
-
metaData: Record<string, unknown> | Record<string, unknown>[];
|
|
64
|
-
};
|
|
65
|
-
type EntryPointHandler = {
|
|
66
|
-
identifier?: string;
|
|
67
|
-
name?: string;
|
|
68
|
-
type?: string;
|
|
69
|
-
};
|
|
70
|
-
type SdkInfo = {
|
|
71
|
-
name: string;
|
|
72
|
-
version: string;
|
|
73
|
-
};
|
|
74
|
-
type Framework = {
|
|
75
|
-
name: string;
|
|
76
|
-
version?: string;
|
|
77
|
-
};
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/api/Api.d.ts
|
|
80
|
-
declare class Api {
|
|
81
|
-
report(report: Report, url: string, key: string | null, reportBrowserExtensionErrors: boolean, debug?: boolean): Promise<void>;
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
//#region src/Flare.d.ts
|
|
85
|
-
declare class Flare {
|
|
86
|
-
api: Api;
|
|
87
|
-
private _config;
|
|
88
|
-
private _glows;
|
|
89
|
-
private pendingAttributes;
|
|
90
|
-
private entryPoint;
|
|
91
|
-
private sdkInfo;
|
|
92
|
-
private framework;
|
|
93
|
-
constructor(api?: Api);
|
|
94
|
-
get config(): Readonly<Config>;
|
|
95
|
-
get glows(): readonly Glow[];
|
|
96
|
-
light(key?: string, debug?: boolean): Flare;
|
|
97
|
-
configure(config: Partial<Config>): Flare;
|
|
98
|
-
test(): Promise<void>;
|
|
99
|
-
glow(name: string, level?: MessageLevel, data?: Record<string, unknown> | Record<string, unknown>[]): Flare;
|
|
100
|
-
clearGlows(): Flare;
|
|
101
|
-
addContext(name: string, value: AttributeValue): Flare;
|
|
102
|
-
addContextGroup(groupName: string, value: Record<string, AttributeValue>): Flare;
|
|
103
|
-
setEntryPoint(handler: EntryPointHandler): Flare;
|
|
104
|
-
setSdkInfo(info: SdkInfo): Flare;
|
|
105
|
-
setFramework(framework: Framework): Flare;
|
|
106
|
-
report(error: Error, attributes?: Attributes): Promise<void>;
|
|
107
|
-
reportSilently(error: Error, attributes?: Attributes): void;
|
|
108
|
-
reportUnhandledRejection(message: string, attributes?: Attributes): Promise<void>;
|
|
109
|
-
reportMessage(message: string, level?: MessageLevel, attributes?: Attributes): Promise<void>;
|
|
110
|
-
createReportFromError(error: Error, attributes?: Attributes, seenAtUnixNano?: number): Promise<Report | false>;
|
|
111
|
-
private buildReport;
|
|
112
|
-
sendReport(report: Report): Promise<void>;
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/util/convertToError.d.ts
|
|
116
|
-
declare function convertToError(error: unknown): Error;
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/util/redactUrl.d.ts
|
|
119
|
-
declare const DEFAULT_URL_DENYLIST: RegExp;
|
|
120
|
-
declare function resolveDenylist(custom?: RegExp, replaceDefault?: boolean, defaultDenylist?: RegExp): RegExp;
|
|
121
|
-
declare function redactFullPath(fullPath: string, denylist?: RegExp): string;
|
|
122
|
-
//#endregion
|
|
1
|
+
import { Api, AttributeValue, Attributes, Config, ContextCollector, ContextCollector as ContextCollector$1, DEFAULT_URL_DENYLIST, EntryPointHandler, FileReader, FileReader as FileReader$1, Flare as Flare$1, Framework, GlobalScopeProvider, Glow, MessageLevel, NullFileReader, OverriddenGrouping, Report, Scope, ScopeProvider, ScopeProvider as ScopeProvider$1, SdkInfo, SpanEvent, StackFrame, convertToError, redactUrlQuery, redactUrlQuery as redactFullPath, resolveDenylist } from "@flareapp/core";
|
|
2
|
+
|
|
123
3
|
//#region src/index.d.ts
|
|
4
|
+
declare class Flare extends Flare$1 {
|
|
5
|
+
constructor(api?: Api, contextCollector?: ContextCollector$1, fileReader?: FileReader$1, scopeProvider?: ScopeProvider$1);
|
|
6
|
+
}
|
|
124
7
|
declare const flare: Flare;
|
|
125
8
|
//#endregion
|
|
126
|
-
export { type AttributeValue, type Attributes, type Config, DEFAULT_URL_DENYLIST, type EntryPointHandler, Flare, type Framework, type Glow, type MessageLevel, type OverriddenGrouping, type Report, type SdkInfo, type SpanEvent, type StackFrame, convertToError, flare, redactFullPath, resolveDenylist };
|
|
9
|
+
export { type AttributeValue, type Attributes, type Config, type ContextCollector, DEFAULT_URL_DENYLIST, type EntryPointHandler, type FileReader, Flare, type Framework, GlobalScopeProvider, type Glow, type MessageLevel, NullFileReader, type OverriddenGrouping, type Report, Scope, type ScopeProvider, type SdkInfo, type SpanEvent, type StackFrame, convertToError, flare, redactFullPath, redactUrlQuery, resolveDenylist };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,126 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type AttributeValue = string | number | boolean | null | AttributeValue[] | {
|
|
4
|
-
[key: string]: AttributeValue;
|
|
5
|
-
};
|
|
6
|
-
type Attributes = Record<string, AttributeValue>;
|
|
7
|
-
type Config = {
|
|
8
|
-
key: string | null;
|
|
9
|
-
version: string;
|
|
10
|
-
sourcemapVersionId: string;
|
|
11
|
-
stage: string;
|
|
12
|
-
maxGlowsPerReport: number;
|
|
13
|
-
reportBrowserExtensionErrors: boolean;
|
|
14
|
-
ingestUrl: string;
|
|
15
|
-
debug: boolean;
|
|
16
|
-
urlDenylist: RegExp;
|
|
17
|
-
replaceDefaultUrlDenylist: boolean;
|
|
18
|
-
sampleRate: number;
|
|
19
|
-
beforeEvaluate: (error: Error) => Error | false | null | Promise<Error | false | null>;
|
|
20
|
-
beforeSubmit: (report: Report) => Report | false | null | Promise<Report | false | null>;
|
|
21
|
-
};
|
|
22
|
-
type StackFrame = {
|
|
23
|
-
file: string;
|
|
24
|
-
lineNumber: number;
|
|
25
|
-
columnNumber?: number;
|
|
26
|
-
method?: string;
|
|
27
|
-
class?: string;
|
|
28
|
-
codeSnippet?: {
|
|
29
|
-
[line: number]: string;
|
|
30
|
-
};
|
|
31
|
-
isApplicationFrame?: boolean;
|
|
32
|
-
arguments?: unknown[];
|
|
33
|
-
};
|
|
34
|
-
type SpanEvent = {
|
|
35
|
-
type: string;
|
|
36
|
-
startTimeUnixNano: number;
|
|
37
|
-
endTimeUnixNano: number | null;
|
|
38
|
-
attributes: Attributes;
|
|
39
|
-
};
|
|
40
|
-
type OverriddenGrouping = 'exception_class' | 'exception_message' | 'exception_message_and_class' | 'full_stacktrace_and_exception_class_and_code';
|
|
41
|
-
type Report = {
|
|
42
|
-
exceptionClass?: string | null;
|
|
43
|
-
message?: string | null;
|
|
44
|
-
code?: string;
|
|
45
|
-
seenAtUnixNano: number;
|
|
46
|
-
isLog?: boolean;
|
|
47
|
-
level?: MessageLevel;
|
|
48
|
-
sourcemapVersionId?: string;
|
|
49
|
-
trackingUuid?: string;
|
|
50
|
-
handled?: boolean;
|
|
51
|
-
openFrameIndex?: number;
|
|
52
|
-
applicationPath?: string;
|
|
53
|
-
overriddenGrouping?: OverriddenGrouping | null;
|
|
54
|
-
stacktrace: StackFrame[];
|
|
55
|
-
events: SpanEvent[];
|
|
56
|
-
attributes: Attributes;
|
|
57
|
-
};
|
|
58
|
-
type Glow = {
|
|
59
|
-
time: number;
|
|
60
|
-
microtime: number;
|
|
61
|
-
name: string;
|
|
62
|
-
messageLevel: MessageLevel;
|
|
63
|
-
metaData: Record<string, unknown> | Record<string, unknown>[];
|
|
64
|
-
};
|
|
65
|
-
type EntryPointHandler = {
|
|
66
|
-
identifier?: string;
|
|
67
|
-
name?: string;
|
|
68
|
-
type?: string;
|
|
69
|
-
};
|
|
70
|
-
type SdkInfo = {
|
|
71
|
-
name: string;
|
|
72
|
-
version: string;
|
|
73
|
-
};
|
|
74
|
-
type Framework = {
|
|
75
|
-
name: string;
|
|
76
|
-
version?: string;
|
|
77
|
-
};
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/api/Api.d.ts
|
|
80
|
-
declare class Api {
|
|
81
|
-
report(report: Report, url: string, key: string | null, reportBrowserExtensionErrors: boolean, debug?: boolean): Promise<void>;
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
//#region src/Flare.d.ts
|
|
85
|
-
declare class Flare {
|
|
86
|
-
api: Api;
|
|
87
|
-
private _config;
|
|
88
|
-
private _glows;
|
|
89
|
-
private pendingAttributes;
|
|
90
|
-
private entryPoint;
|
|
91
|
-
private sdkInfo;
|
|
92
|
-
private framework;
|
|
93
|
-
constructor(api?: Api);
|
|
94
|
-
get config(): Readonly<Config>;
|
|
95
|
-
get glows(): readonly Glow[];
|
|
96
|
-
light(key?: string, debug?: boolean): Flare;
|
|
97
|
-
configure(config: Partial<Config>): Flare;
|
|
98
|
-
test(): Promise<void>;
|
|
99
|
-
glow(name: string, level?: MessageLevel, data?: Record<string, unknown> | Record<string, unknown>[]): Flare;
|
|
100
|
-
clearGlows(): Flare;
|
|
101
|
-
addContext(name: string, value: AttributeValue): Flare;
|
|
102
|
-
addContextGroup(groupName: string, value: Record<string, AttributeValue>): Flare;
|
|
103
|
-
setEntryPoint(handler: EntryPointHandler): Flare;
|
|
104
|
-
setSdkInfo(info: SdkInfo): Flare;
|
|
105
|
-
setFramework(framework: Framework): Flare;
|
|
106
|
-
report(error: Error, attributes?: Attributes): Promise<void>;
|
|
107
|
-
reportSilently(error: Error, attributes?: Attributes): void;
|
|
108
|
-
reportUnhandledRejection(message: string, attributes?: Attributes): Promise<void>;
|
|
109
|
-
reportMessage(message: string, level?: MessageLevel, attributes?: Attributes): Promise<void>;
|
|
110
|
-
createReportFromError(error: Error, attributes?: Attributes, seenAtUnixNano?: number): Promise<Report | false>;
|
|
111
|
-
private buildReport;
|
|
112
|
-
sendReport(report: Report): Promise<void>;
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/util/convertToError.d.ts
|
|
116
|
-
declare function convertToError(error: unknown): Error;
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/util/redactUrl.d.ts
|
|
119
|
-
declare const DEFAULT_URL_DENYLIST: RegExp;
|
|
120
|
-
declare function resolveDenylist(custom?: RegExp, replaceDefault?: boolean, defaultDenylist?: RegExp): RegExp;
|
|
121
|
-
declare function redactFullPath(fullPath: string, denylist?: RegExp): string;
|
|
122
|
-
//#endregion
|
|
1
|
+
import { Api, AttributeValue, Attributes, Config, ContextCollector, ContextCollector as ContextCollector$1, DEFAULT_URL_DENYLIST, EntryPointHandler, FileReader, FileReader as FileReader$1, Flare as Flare$1, Framework, GlobalScopeProvider, Glow, MessageLevel, NullFileReader, OverriddenGrouping, Report, Scope, ScopeProvider, ScopeProvider as ScopeProvider$1, SdkInfo, SpanEvent, StackFrame, convertToError, redactUrlQuery, redactUrlQuery as redactFullPath, resolveDenylist } from "@flareapp/core";
|
|
2
|
+
|
|
123
3
|
//#region src/index.d.ts
|
|
4
|
+
declare class Flare extends Flare$1 {
|
|
5
|
+
constructor(api?: Api, contextCollector?: ContextCollector$1, fileReader?: FileReader$1, scopeProvider?: ScopeProvider$1);
|
|
6
|
+
}
|
|
124
7
|
declare const flare: Flare;
|
|
125
8
|
//#endregion
|
|
126
|
-
export { type AttributeValue, type Attributes, type Config, DEFAULT_URL_DENYLIST, type EntryPointHandler, Flare, type Framework, type Glow, type MessageLevel, type OverriddenGrouping, type Report, type SdkInfo, type SpanEvent, type StackFrame, convertToError, flare, redactFullPath, resolveDenylist };
|
|
9
|
+
export { type AttributeValue, type Attributes, type Config, type ContextCollector, DEFAULT_URL_DENYLIST, type EntryPointHandler, type FileReader, Flare, type Framework, GlobalScopeProvider, type Glow, type MessageLevel, NullFileReader, type OverriddenGrouping, type Report, Scope, type ScopeProvider, type SdkInfo, type SpanEvent, type StackFrame, convertToError, flare, redactFullPath, redactUrlQuery, resolveDenylist };
|