@workleap/logrocket 1.2.7 → 2.0.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 +11 -0
- package/dist/js/LogRocketInstrumentationClient.d.ts +133 -0
- package/dist/js/LogRocketInstrumentationClient.js +129 -0
- package/dist/js/LogRocketInstrumentationClient.js.map +1 -0
- package/dist/{LogRocketLogger.js → js/LogRocketLogger.js} +1 -1
- package/dist/js/LogRocketLogger.js.map +1 -0
- package/dist/{applyTransformers.js → js/applyTransformers.js} +1 -1
- package/dist/js/applyTransformers.js.map +1 -0
- package/dist/{assertions.js → js/assertions.js} +1 -1
- package/dist/js/assertions.js.map +1 -0
- package/dist/{createRequestSanitizer.js → js/createRequestSanitizer.js} +1 -1
- package/dist/js/createRequestSanitizer.js.map +1 -0
- package/dist/{createResponseSanitizer.js → js/createResponseSanitizer.js} +1 -1
- package/dist/js/createResponseSanitizer.js.map +1 -0
- package/dist/{createUrlSanitizer.js → js/createUrlSanitizer.js} +1 -1
- package/dist/js/createUrlSanitizer.js.map +1 -0
- package/dist/js/index.d.ts +6 -0
- package/dist/js/index.js +22 -0
- package/dist/js/index.js.map +1 -0
- package/dist/js/logRocketTypes.js +7 -0
- package/dist/js/logRocketTypes.js.map +1 -0
- package/dist/{registerLogRocketInstrumentation.d.ts → js/registerLogRocketInstrumentation.d.ts} +27 -7
- package/dist/{registerLogRocketInstrumentation.js → js/registerLogRocketInstrumentation.js} +64 -43
- package/dist/js/registerLogRocketInstrumentation.js.map +1 -0
- package/dist/react/LogRocketInstrumentationContext.d.ts +17 -0
- package/dist/react/LogRocketInstrumentationContext.js +34 -0
- package/dist/react/LogRocketInstrumentationContext.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +12 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +29 -13
- package/src/js/LogRocketInstrumentationClient.ts +187 -0
- package/src/js/index.ts +8 -0
- package/src/{registerLogRocketInstrumentation.ts → js/registerLogRocketInstrumentation.ts} +104 -53
- package/src/react/LogRocketInstrumentationContext.tsx +41 -0
- package/src/react/index.ts +3 -0
- package/dist/HasExecutedGuard.d.ts +0 -6
- package/dist/HasExecutedGuard.js +0 -21
- package/dist/HasExecutedGuard.js.map +0 -1
- package/dist/LogRocketLogger.js.map +0 -1
- package/dist/applyTransformers.js.map +0 -1
- package/dist/assertions.js.map +0 -1
- package/dist/createDefaultUserTraits.d.ts +0 -116
- package/dist/createDefaultUserTraits.js +0 -112
- package/dist/createDefaultUserTraits.js.map +0 -1
- package/dist/createRequestSanitizer.js.map +0 -1
- package/dist/createResponseSanitizer.js.map +0 -1
- package/dist/createUrlSanitizer.js.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -18
- package/dist/index.js.map +0 -1
- package/dist/logRocketTypes.js +0 -7
- package/dist/logRocketTypes.js.map +0 -1
- package/dist/registerLogRocketInstrumentation.js.map +0 -1
- package/src/HasExecutedGuard.ts +0 -19
- package/src/createDefaultUserTraits.ts +0 -160
- package/src/index.ts +0 -6
- /package/dist/{LogRocketLogger.d.ts → js/LogRocketLogger.d.ts} +0 -0
- /package/dist/{applyTransformers.d.ts → js/applyTransformers.d.ts} +0 -0
- /package/dist/{assertions.d.ts → js/assertions.d.ts} +0 -0
- /package/dist/{createRequestSanitizer.d.ts → js/createRequestSanitizer.d.ts} +0 -0
- /package/dist/{createResponseSanitizer.d.ts → js/createResponseSanitizer.d.ts} +0 -0
- /package/dist/{createUrlSanitizer.d.ts → js/createUrlSanitizer.d.ts} +0 -0
- /package/dist/{logRocketTypes.d.ts → js/logRocketTypes.d.ts} +0 -0
- /package/src/{LogRocketLogger.ts → js/LogRocketLogger.ts} +0 -0
- /package/src/{applyTransformers.ts → js/applyTransformers.ts} +0 -0
- /package/src/{assertions.ts → js/assertions.ts} +0 -0
- /package/src/{createRequestSanitizer.ts → js/createRequestSanitizer.ts} +0 -0
- /package/src/{createResponseSanitizer.ts → js/createResponseSanitizer.ts} +0 -0
- /package/src/{createUrlSanitizer.ts → js/createUrlSanitizer.ts} +0 -0
- /package/src/{logRocketTypes.ts → js/logRocketTypes.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @workleap/logrocket
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#86](https://github.com/workleap/wl-telemetry/pull/86) [`6d399dd`](https://github.com/workleap/wl-telemetry/commit/6d399dd6e01448a474ec098c64b185e45d9b6b5e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - New API for telemetry packages and a new @workleap/telemetry umbrella package.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`6d399dd`](https://github.com/workleap/wl-telemetry/commit/6d399dd6e01448a474ec098c64b185e45d9b6b5e)]:
|
|
12
|
+
- @workleap-telemetry/core@1.0.0
|
|
13
|
+
|
|
3
14
|
## 1.2.7
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { TelemetryContext } from "@workleap-telemetry/core";
|
|
2
|
+
export type GetLogRocketSessionUrlListener = (sessionURL: string) => void;
|
|
3
|
+
export declare const DeviceIdTrait = "Device Id";
|
|
4
|
+
export declare const TelemetryIdTrait = "Telemetry Id";
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
7
|
+
*/
|
|
8
|
+
export interface LogRocketWorkleapPlatformIdentification {
|
|
9
|
+
userId: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
organizationName: string;
|
|
12
|
+
isMigratedToWorkleap: boolean;
|
|
13
|
+
isAdmin: boolean;
|
|
14
|
+
isOrganizationCreator?: boolean;
|
|
15
|
+
isExecutive?: {
|
|
16
|
+
wov?: boolean;
|
|
17
|
+
lms?: boolean;
|
|
18
|
+
onb?: boolean;
|
|
19
|
+
sks?: boolean;
|
|
20
|
+
wpm?: boolean;
|
|
21
|
+
pbd?: boolean;
|
|
22
|
+
cmp?: boolean;
|
|
23
|
+
};
|
|
24
|
+
isCollaborator?: {
|
|
25
|
+
wov?: boolean;
|
|
26
|
+
lms?: boolean;
|
|
27
|
+
onb?: boolean;
|
|
28
|
+
sks?: boolean;
|
|
29
|
+
wpm?: boolean;
|
|
30
|
+
pbd?: boolean;
|
|
31
|
+
cmp?: boolean;
|
|
32
|
+
};
|
|
33
|
+
isReportingManager?: boolean;
|
|
34
|
+
isTeamManager?: boolean;
|
|
35
|
+
planCode?: {
|
|
36
|
+
wov?: string;
|
|
37
|
+
lms?: string;
|
|
38
|
+
onb?: string;
|
|
39
|
+
sks?: string;
|
|
40
|
+
wpm?: string;
|
|
41
|
+
pbd?: string;
|
|
42
|
+
cmp?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
47
|
+
*/
|
|
48
|
+
export interface LogRocketWorkleapPlatformUserTraits extends Record<string, unknown> {
|
|
49
|
+
"User Id": string;
|
|
50
|
+
"Organization Id": string;
|
|
51
|
+
"Organization Name": string;
|
|
52
|
+
"Is Migrated To Workleap": boolean;
|
|
53
|
+
"Is Admin": boolean;
|
|
54
|
+
[DeviceIdTrait]: string;
|
|
55
|
+
[TelemetryIdTrait]: string;
|
|
56
|
+
"Is Organization Creator"?: boolean;
|
|
57
|
+
"Is Executive"?: boolean;
|
|
58
|
+
"Is Executive - Officevibe"?: boolean;
|
|
59
|
+
"Is Executive - LMS"?: boolean;
|
|
60
|
+
"Is Executive - Onboarding"?: boolean;
|
|
61
|
+
"Is Executive - Skills"?: boolean;
|
|
62
|
+
"Is Executive - Performance"?: boolean;
|
|
63
|
+
"Is Executive - Pingboard"?: boolean;
|
|
64
|
+
"Is Collaborator"?: boolean;
|
|
65
|
+
"Is Collaborator - Officevibe"?: boolean;
|
|
66
|
+
"Is Collaborator - LMS"?: boolean;
|
|
67
|
+
"Is Collaborator - Onboarding"?: boolean;
|
|
68
|
+
"Is Collaborator - Skills"?: boolean;
|
|
69
|
+
"Is Collaborator - Performance"?: boolean;
|
|
70
|
+
"Is Collaborator - Pingboard"?: boolean;
|
|
71
|
+
"Is Reporting Manager"?: boolean;
|
|
72
|
+
"Is Team Manager"?: boolean;
|
|
73
|
+
"Plan Code - Officevibe"?: string;
|
|
74
|
+
"Plan Code - LMS"?: string;
|
|
75
|
+
"Plan Code - Onboarding"?: string;
|
|
76
|
+
"Plan Code - Skills"?: string;
|
|
77
|
+
"Plan Code - Performance"?: string;
|
|
78
|
+
"Plan Code - Pingboard"?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
82
|
+
*/
|
|
83
|
+
export declare class LogRocketInstrumentationClient {
|
|
84
|
+
#private;
|
|
85
|
+
constructor(telemetryContext?: TelemetryContext);
|
|
86
|
+
/**
|
|
87
|
+
* Register a listener to receive the LogRocket session id when it's available.
|
|
88
|
+
* This method is the equivalent of the LogRocket.getSessionURL function but is
|
|
89
|
+
* particularly useful for third party libraries that doesn't want to take a dependency
|
|
90
|
+
* on `logrocket`.
|
|
91
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
92
|
+
*/
|
|
93
|
+
registerGetSessionUrlListener(listener: GetLogRocketSessionUrlListener): void;
|
|
94
|
+
/**
|
|
95
|
+
* Create the default user traits for a Workleap Platform user.
|
|
96
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
97
|
+
*/
|
|
98
|
+
createWorkleapPlatformDefaultUserTraits(identification: LogRocketWorkleapPlatformIdentification): {
|
|
99
|
+
"Plan Code - Compensation"?: string | undefined;
|
|
100
|
+
"Plan Code - Pingboard"?: string | undefined;
|
|
101
|
+
"Plan Code - Performance"?: string | undefined;
|
|
102
|
+
"Plan Code - Skills"?: string | undefined;
|
|
103
|
+
"Plan Code - Onboarding"?: string | undefined;
|
|
104
|
+
"Plan Code - LMS"?: string | undefined;
|
|
105
|
+
"Plan Code - Officevibe"?: string | undefined;
|
|
106
|
+
"Is Team Manager"?: boolean | undefined;
|
|
107
|
+
"Is Reporting Manager"?: boolean | undefined;
|
|
108
|
+
"Is Collaborator - Compensation"?: boolean | undefined;
|
|
109
|
+
"Is Collaborator - Pingboard"?: boolean | undefined;
|
|
110
|
+
"Is Collaborator - Performance"?: boolean | undefined;
|
|
111
|
+
"Is Collaborator - Skills"?: boolean | undefined;
|
|
112
|
+
"Is Collaborator - Onboarding"?: boolean | undefined;
|
|
113
|
+
"Is Collaborator - LMS"?: boolean | undefined;
|
|
114
|
+
"Is Collaborator - Officevibe"?: boolean | undefined;
|
|
115
|
+
"Is Collaborator"?: true | undefined;
|
|
116
|
+
"Is Executive - Compensation"?: boolean | undefined;
|
|
117
|
+
"Is Executive - Pingboard"?: boolean | undefined;
|
|
118
|
+
"Is Executive - Performance"?: boolean | undefined;
|
|
119
|
+
"Is Executive - Skills"?: boolean | undefined;
|
|
120
|
+
"Is Executive - Onboarding"?: boolean | undefined;
|
|
121
|
+
"Is Executive - LMS"?: boolean | undefined;
|
|
122
|
+
"Is Executive - Officevibe"?: boolean | undefined;
|
|
123
|
+
"Is Executive"?: true | undefined;
|
|
124
|
+
"Is Organization Creator"?: boolean | undefined;
|
|
125
|
+
"User Id": string;
|
|
126
|
+
"Organization Id": string;
|
|
127
|
+
"Organization Name": string;
|
|
128
|
+
"Is Migrated To Workleap": boolean;
|
|
129
|
+
"Is Admin": boolean;
|
|
130
|
+
"Device Id": string;
|
|
131
|
+
"Telemetry Id": string;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import logrocket from "logrocket";
|
|
2
|
+
import { isDefined } from "./assertions.js";
|
|
3
|
+
|
|
4
|
+
;// CONCATENATED MODULE: external "logrocket"
|
|
5
|
+
|
|
6
|
+
;// CONCATENATED MODULE: external "./assertions.js"
|
|
7
|
+
|
|
8
|
+
;// CONCATENATED MODULE: ./src/js/LogRocketInstrumentationClient.ts
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const DeviceIdTrait = "Device Id";
|
|
12
|
+
const TelemetryIdTrait = "Telemetry Id";
|
|
13
|
+
///////////////////////////
|
|
14
|
+
/**
|
|
15
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
16
|
+
*/ class LogRocketInstrumentationClient {
|
|
17
|
+
#telemetryContext;
|
|
18
|
+
constructor(telemetryContext){
|
|
19
|
+
this.#telemetryContext = telemetryContext;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Register a listener to receive the LogRocket session id when it's available.
|
|
23
|
+
* This method is the equivalent of the LogRocket.getSessionURL function but is
|
|
24
|
+
* particularly useful for third party libraries that doesn't want to take a dependency
|
|
25
|
+
* on `logrocket`.
|
|
26
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
27
|
+
*/ registerGetSessionUrlListener(listener) {
|
|
28
|
+
logrocket.getSessionURL(listener);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create the default user traits for a Workleap Platform user.
|
|
32
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
33
|
+
*/ createWorkleapPlatformDefaultUserTraits(identification) {
|
|
34
|
+
const { userId, organizationId, organizationName, isMigratedToWorkleap, isOrganizationCreator, isAdmin, isExecutive, isCollaborator, isReportingManager, isTeamManager, planCode } = identification;
|
|
35
|
+
const isExecutiveInAnyProduct = Boolean(isExecutive?.wov || isExecutive?.lms || isExecutive?.onb || isExecutive?.sks || isExecutive?.wpm || isExecutive?.pbd || isExecutive?.cmp);
|
|
36
|
+
const isCollaboratorInAnyProduct = Boolean(isCollaborator?.wov || isCollaborator?.lms || isCollaborator?.onb || isCollaborator?.sks || isCollaborator?.wpm || isCollaborator?.pbd || isCollaborator?.cmp);
|
|
37
|
+
return {
|
|
38
|
+
"User Id": userId,
|
|
39
|
+
"Organization Id": organizationId,
|
|
40
|
+
"Organization Name": organizationName,
|
|
41
|
+
"Is Migrated To Workleap": isMigratedToWorkleap,
|
|
42
|
+
"Is Admin": isAdmin,
|
|
43
|
+
[DeviceIdTrait]: this.#telemetryContext?.deviceId ?? "N/A",
|
|
44
|
+
[TelemetryIdTrait]: this.#telemetryContext?.telemetryId ?? "N/A",
|
|
45
|
+
...isDefined(isOrganizationCreator) && {
|
|
46
|
+
"Is Organization Creator": isOrganizationCreator
|
|
47
|
+
},
|
|
48
|
+
...isExecutiveInAnyProduct && {
|
|
49
|
+
"Is Executive": true
|
|
50
|
+
},
|
|
51
|
+
...isDefined(isExecutive?.wov) && {
|
|
52
|
+
"Is Executive - Officevibe": isExecutive.wov
|
|
53
|
+
},
|
|
54
|
+
...isDefined(isExecutive?.lms) && {
|
|
55
|
+
"Is Executive - LMS": isExecutive.lms
|
|
56
|
+
},
|
|
57
|
+
...isDefined(isExecutive?.onb) && {
|
|
58
|
+
"Is Executive - Onboarding": isExecutive.onb
|
|
59
|
+
},
|
|
60
|
+
...isDefined(isExecutive?.sks) && {
|
|
61
|
+
"Is Executive - Skills": isExecutive.sks
|
|
62
|
+
},
|
|
63
|
+
...isDefined(isExecutive?.wpm) && {
|
|
64
|
+
"Is Executive - Performance": isExecutive.wpm
|
|
65
|
+
},
|
|
66
|
+
...isDefined(isExecutive?.pbd) && {
|
|
67
|
+
"Is Executive - Pingboard": isExecutive.pbd
|
|
68
|
+
},
|
|
69
|
+
...isDefined(isExecutive?.cmp) && {
|
|
70
|
+
"Is Executive - Compensation": isExecutive.cmp
|
|
71
|
+
},
|
|
72
|
+
...isCollaboratorInAnyProduct && {
|
|
73
|
+
"Is Collaborator": isCollaboratorInAnyProduct
|
|
74
|
+
},
|
|
75
|
+
...isDefined(isCollaborator?.wov) && {
|
|
76
|
+
"Is Collaborator - Officevibe": isCollaborator.wov
|
|
77
|
+
},
|
|
78
|
+
...isDefined(isCollaborator?.lms) && {
|
|
79
|
+
"Is Collaborator - LMS": isCollaborator.lms
|
|
80
|
+
},
|
|
81
|
+
...isDefined(isCollaborator?.onb) && {
|
|
82
|
+
"Is Collaborator - Onboarding": isCollaborator.onb
|
|
83
|
+
},
|
|
84
|
+
...isDefined(isCollaborator?.sks) && {
|
|
85
|
+
"Is Collaborator - Skills": isCollaborator.sks
|
|
86
|
+
},
|
|
87
|
+
...isDefined(isCollaborator?.wpm) && {
|
|
88
|
+
"Is Collaborator - Performance": isCollaborator.wpm
|
|
89
|
+
},
|
|
90
|
+
...isDefined(isCollaborator?.pbd) && {
|
|
91
|
+
"Is Collaborator - Pingboard": isCollaborator.pbd
|
|
92
|
+
},
|
|
93
|
+
...isDefined(isCollaborator?.cmp) && {
|
|
94
|
+
"Is Collaborator - Compensation": isCollaborator.cmp
|
|
95
|
+
},
|
|
96
|
+
...isDefined(isReportingManager) && {
|
|
97
|
+
"Is Reporting Manager": isReportingManager
|
|
98
|
+
},
|
|
99
|
+
...isDefined(isTeamManager) && {
|
|
100
|
+
"Is Team Manager": isTeamManager
|
|
101
|
+
},
|
|
102
|
+
...isDefined(planCode?.wov) && {
|
|
103
|
+
"Plan Code - Officevibe": planCode.wov
|
|
104
|
+
},
|
|
105
|
+
...isDefined(planCode?.lms) && {
|
|
106
|
+
"Plan Code - LMS": planCode.lms
|
|
107
|
+
},
|
|
108
|
+
...isDefined(planCode?.onb) && {
|
|
109
|
+
"Plan Code - Onboarding": planCode.onb
|
|
110
|
+
},
|
|
111
|
+
...isDefined(planCode?.sks) && {
|
|
112
|
+
"Plan Code - Skills": planCode.sks
|
|
113
|
+
},
|
|
114
|
+
...isDefined(planCode?.wpm) && {
|
|
115
|
+
"Plan Code - Performance": planCode.wpm
|
|
116
|
+
},
|
|
117
|
+
...isDefined(planCode?.pbd) && {
|
|
118
|
+
"Plan Code - Pingboard": planCode.pbd
|
|
119
|
+
},
|
|
120
|
+
...isDefined(planCode?.cmp) && {
|
|
121
|
+
"Plan Code - Compensation": planCode.cmp
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { DeviceIdTrait, LogRocketInstrumentationClient, TelemetryIdTrait };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=LogRocketInstrumentationClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/LogRocketInstrumentationClient.js","sources":["webpack://@workleap/logrocket/./src/js/LogRocketInstrumentationClient.ts"],"sourcesContent":["import type { TelemetryContext } from \"@workleap-telemetry/core\";\nimport LogRocket from \"logrocket\";\nimport { isDefined } from \"./assertions.ts\";\n\nexport type GetLogRocketSessionUrlListener = (sessionURL: string) => void;\n\nexport const DeviceIdTrait = \"Device Id\";\nexport const TelemetryIdTrait = \"Telemetry Id\";\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketWorkleapPlatformIdentification {\n userId: string;\n organizationId: string;\n organizationName: string;\n isMigratedToWorkleap: boolean;\n isAdmin: boolean;\n isOrganizationCreator?: boolean;\n isExecutive?: {\n wov?: boolean;\n lms?: boolean;\n onb?: boolean;\n sks?: boolean;\n wpm?: boolean;\n pbd?: boolean;\n cmp?: boolean;\n };\n isCollaborator?: {\n wov?: boolean;\n lms?: boolean;\n onb?: boolean;\n sks?: boolean;\n wpm?: boolean;\n pbd?: boolean;\n cmp?: boolean;\n };\n isReportingManager?: boolean;\n isTeamManager?: boolean;\n planCode?: {\n wov?: string;\n lms?: string;\n onb?: string;\n sks?: string;\n wpm?: string;\n pbd?: string;\n cmp?: string;\n };\n}\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketWorkleapPlatformUserTraits extends Record<string, unknown> {\n \"User Id\": string;\n \"Organization Id\": string;\n \"Organization Name\": string;\n \"Is Migrated To Workleap\": boolean;\n \"Is Admin\": boolean;\n [DeviceIdTrait]: string;\n [TelemetryIdTrait]: string;\n \"Is Organization Creator\"?: boolean;\n \"Is Executive\"?: boolean;\n \"Is Executive - Officevibe\"?: boolean;\n \"Is Executive - LMS\"?: boolean;\n \"Is Executive - Onboarding\"?: boolean;\n \"Is Executive - Skills\"?: boolean;\n \"Is Executive - Performance\"?: boolean;\n \"Is Executive - Pingboard\"?: boolean;\n \"Is Collaborator\"?: boolean;\n \"Is Collaborator - Officevibe\"?: boolean;\n \"Is Collaborator - LMS\"?: boolean;\n \"Is Collaborator - Onboarding\"?: boolean;\n \"Is Collaborator - Skills\"?: boolean;\n \"Is Collaborator - Performance\"?: boolean;\n \"Is Collaborator - Pingboard\"?: boolean;\n \"Is Reporting Manager\"?: boolean;\n \"Is Team Manager\"?: boolean;\n \"Plan Code - Officevibe\"?: string;\n \"Plan Code - LMS\"?: string;\n \"Plan Code - Onboarding\"?: string;\n \"Plan Code - Skills\"?: string;\n \"Plan Code - Performance\"?: string;\n \"Plan Code - Pingboard\"?: string;\n}\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketInstrumentationClient {\n readonly #telemetryContext?: TelemetryContext;\n\n constructor(telemetryContext?: TelemetryContext) {\n this.#telemetryContext = telemetryContext;\n }\n\n /**\n * Register a listener to receive the LogRocket session id when it's available.\n * This method is the equivalent of the LogRocket.getSessionURL function but is\n * particularly useful for third party libraries that doesn't want to take a dependency\n * on `logrocket`.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n registerGetSessionUrlListener(listener: GetLogRocketSessionUrlListener) {\n LogRocket.getSessionURL(listener);\n }\n\n /**\n * Create the default user traits for a Workleap Platform user.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n createWorkleapPlatformDefaultUserTraits(identification: LogRocketWorkleapPlatformIdentification) {\n const {\n userId,\n organizationId,\n organizationName,\n isMigratedToWorkleap,\n isOrganizationCreator,\n isAdmin,\n isExecutive,\n isCollaborator,\n isReportingManager,\n isTeamManager,\n planCode\n } = identification;\n\n const isExecutiveInAnyProduct = Boolean(\n isExecutive?.wov ||\n isExecutive?.lms ||\n isExecutive?.onb ||\n isExecutive?.sks ||\n isExecutive?.wpm ||\n isExecutive?.pbd ||\n isExecutive?.cmp\n );\n\n const isCollaboratorInAnyProduct = Boolean(\n isCollaborator?.wov ||\n isCollaborator?.lms ||\n isCollaborator?.onb ||\n isCollaborator?.sks ||\n isCollaborator?.wpm ||\n isCollaborator?.pbd ||\n isCollaborator?.cmp\n );\n\n return {\n \"User Id\": userId,\n \"Organization Id\": organizationId,\n \"Organization Name\": organizationName,\n \"Is Migrated To Workleap\": isMigratedToWorkleap,\n \"Is Admin\": isAdmin,\n [DeviceIdTrait]: this.#telemetryContext?.deviceId ?? \"N/A\",\n [TelemetryIdTrait]: this.#telemetryContext?.telemetryId ?? \"N/A\",\n ...(isDefined(isOrganizationCreator) && { \"Is Organization Creator\": isOrganizationCreator }),\n ...(isExecutiveInAnyProduct && { \"Is Executive\": true }),\n ...(isDefined(isExecutive?.wov) && { \"Is Executive - Officevibe\": isExecutive.wov }),\n ...(isDefined(isExecutive?.lms) && { \"Is Executive - LMS\": isExecutive.lms }),\n ...(isDefined(isExecutive?.onb) && { \"Is Executive - Onboarding\": isExecutive.onb }),\n ...(isDefined(isExecutive?.sks) && { \"Is Executive - Skills\": isExecutive.sks }),\n ...(isDefined(isExecutive?.wpm) && { \"Is Executive - Performance\": isExecutive.wpm }),\n ...(isDefined(isExecutive?.pbd) && { \"Is Executive - Pingboard\": isExecutive.pbd }),\n ...(isDefined(isExecutive?.cmp) && { \"Is Executive - Compensation\": isExecutive.cmp }),\n ...(isCollaboratorInAnyProduct && { \"Is Collaborator\": isCollaboratorInAnyProduct }),\n ...(isDefined(isCollaborator?.wov) && { \"Is Collaborator - Officevibe\": isCollaborator.wov }),\n ...(isDefined(isCollaborator?.lms) && { \"Is Collaborator - LMS\": isCollaborator.lms }),\n ...(isDefined(isCollaborator?.onb) && { \"Is Collaborator - Onboarding\": isCollaborator.onb }),\n ...(isDefined(isCollaborator?.sks) && { \"Is Collaborator - Skills\": isCollaborator.sks }),\n ...(isDefined(isCollaborator?.wpm) && { \"Is Collaborator - Performance\": isCollaborator.wpm }),\n ...(isDefined(isCollaborator?.pbd) && { \"Is Collaborator - Pingboard\": isCollaborator.pbd }),\n ...(isDefined(isCollaborator?.cmp) && { \"Is Collaborator - Compensation\": isCollaborator.cmp }),\n ...(isDefined(isReportingManager) && { \"Is Reporting Manager\": isReportingManager }),\n ...(isDefined(isTeamManager) && { \"Is Team Manager\": isTeamManager }),\n ...(isDefined(planCode?.wov) && { \"Plan Code - Officevibe\": planCode.wov }),\n ...(isDefined(planCode?.lms) && { \"Plan Code - LMS\": planCode.lms }),\n ...(isDefined(planCode?.onb) && { \"Plan Code - Onboarding\": planCode.onb }),\n ...(isDefined(planCode?.sks) && { \"Plan Code - Skills\": planCode.sks }),\n ...(isDefined(planCode?.wpm) && { \"Plan Code - Performance\": planCode.wpm }),\n ...(isDefined(planCode?.pbd) && { \"Plan Code - Pingboard\": planCode.pbd }),\n ...(isDefined(planCode?.cmp) && { \"Plan Code - Compensation\": planCode.cmp })\n } satisfies LogRocketWorkleapPlatformUserTraits;\n }\n}\n"],"names":["LogRocket","isDefined","DeviceIdTrait","TelemetryIdTrait","LogRocketInstrumentationClient","telemetryContext","listener","identification","userId","organizationId","organizationName","isMigratedToWorkleap","isOrganizationCreator","isAdmin","isExecutive","isCollaborator","isReportingManager","isTeamManager","planCode","isExecutiveInAnyProduct","Boolean","isCollaboratorInAnyProduct"],"mappings":";;;;;;;;AACkC;AACU;AAIrC,MAAME,gBAAgB,YAAY;AAClC,MAAMC,mBAAmB,eAAe;AAiF/C,2BAA2B;AAE3B;;CAEC,GACM,MAAMC;IACA,iBAAiB,CAAoB;IAE9C,YAAYC,gBAAmC,CAAE;QAC7C,IAAI,CAAC,iBAAiB,GAAGA;IAC7B;IAEA;;;;;;KAMC,GACD,8BAA8BC,QAAwC,EAAE;QACpEN,uBAAuB,CAACM;IAC5B;IAEA;;;K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,SAAS,GAAG;YAAC,CAAC;YAC3E,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,yBAAyBA,SAAS,GAAG;YAAC,CAAC;YACzE,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,4BAA4BA,SAAS,GAAG;YAAC,CAAC;QAChF;IACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/LogRocketLogger.js","sources":["webpack://@workleap/logrocket/./src/js/LogRocketLogger.ts"],"sourcesContent":["import { type Logger, type LoggerOptions, type LoggerScope, type LoggerScopeEndOptions, LogLevel, type LogOptions } from \"@workleap/logging\";\nimport LogRocket from \"logrocket\";\n\ninterface Segment {\n type: \"text\" | \"object\" | \"error\" | \"line-change\";\n value: unknown;\n options?: LogOptions;\n}\n\nfunction appendText(currentText: string, newText: string, options: { leadingSpace?: boolean } = {}) {\n const {\n leadingSpace = true\n } = options;\n\n if (currentText.length > 0) {\n return `${currentText}${leadingSpace ? \" \" : \"\"}${newText}`;\n }\n\n return newText;\n}\n\n/**\n * Formats an array of Segment objects into a list of log arguments.\n *\n * - Consecutive \"text\" segments are concatenated into a single string, separated by spaces (unless `leadingSpace` is false).\n * - Non-\"text\" segments (\"object\", \"error\", \"line-change\") are added directly to the output array.\n * - When a non-\"text\" segment is encountered, any buffered text is flushed to the output before adding the segment.\n * - At the end, any remaining buffered text is flushed.\n */\nfunction formatSegments(segments: Segment[]) {\n const logs: unknown[] = [];\n\n let textBuffer = \"\";\n\n const flushText = () => {\n if (textBuffer.length > 0) {\n logs.push(textBuffer);\n\n textBuffer = \"\";\n }\n };\n\n segments.forEach(x => {\n if (x.type === \"text\") {\n textBuffer = appendText(textBuffer, x.value as string, {\n leadingSpace: x.options?.leadingSpace\n });\n } else {\n flushText();\n\n logs.push(x.value);\n }\n });\n\n // If the last segment is text, the text buffer hasn't been flushed.\n flushText();\n\n return logs;\n}\n\ntype LogFunction = (...rest: unknown[]) => void;\ntype PendingLog = () => void;\n\n/**\n * An scope implementation for the LogRocket logger.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketLoggerScope implements LoggerScope {\n readonly #logLevel: LogLevel;\n readonly #label: string;\n\n #segments: Segment[] = [];\n #pendingLogs: PendingLog[] = [];\n #hasEnded: boolean = false;\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n constructor(label: string, logLevel: LogLevel) {\n this.#logLevel = logLevel;\n this.#label = label;\n }\n\n #resetSegments() {\n this.#segments = [];\n }\n\n #log(fct: LogFunction, threshold: LogLevel) {\n if (this.#segments.length > 0) {\n if (this.#logLevel <= threshold) {\n // Required closure to preserved the current log items for when they will be formatted when the scope is ended.\n const segments = this.#segments;\n\n this.#pendingLogs.push(() => {\n const formattedSegments = formatSegments(segments);\n // Since LogRocket session replay UI doesn't have a concept similar to console.group,\n // the logs of a group are indented by 4 spaces under the group label.\n formattedSegments.unshift(\" \");\n\n fct(...formattedSegments);\n });\n }\n\n this.#resetSegments();\n }\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withText(text?: string, options?: Omit<LogOptions, \"style\">) {\n if (text) {\n this.#segments.push({\n type: \"text\",\n value: text,\n options\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withError(error?: Error) {\n if (error) {\n this.#segments.push({\n type: \"error\",\n value: error\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withObject(obj?: unknown) {\n if (obj) {\n this.#segments.push({\n type: \"object\",\n value: obj\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withLineChange() {\n this.#segments.push({\n type: \"line-change\",\n value: \"\\r\\n\"\n });\n\n return this;\n }\n\n /**\n * Write a debug log. The log will be processed only if the logger LogLevel is >= debug.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n debug(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.debug);\n }\n\n /**\n * Write an information log. The log will be processed only if the logger LogLevel is >= information.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n information(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.information);\n }\n\n /**\n * Write a warning log. The log will be processed only if the logger LogLevel is >= warning.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n warning(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.warn, LogLevel.warning);\n }\n\n /**\n * Write an error log. The log will be processed only if the logger LogLevel is >= error.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n error(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.error);\n }\n\n /**\n * Write a critical log. The log will be processed only if the logger LogLevel is >= critical.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n critical(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.critical);\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n end(options: LoggerScopeEndOptions = {}) {\n const {\n dismiss = false\n } = options;\n\n if (!this.#hasEnded) {\n this.#hasEnded = true;\n\n if (!dismiss) {\n if (this.#pendingLogs.length > 0) {\n LogRocket.log(this.#label);\n\n this.#pendingLogs.forEach(x => {\n x();\n });\n\n this.#pendingLogs = [];\n }\n }\n }\n }\n}\n\n/**\n * A logger implementation for LogRocket.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketLogger implements Logger {\n readonly #logLevel: LogLevel;\n #segments: Segment[] = [];\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n constructor(options: LoggerOptions = {}) {\n const {\n logLevel = LogLevel.debug\n } = options;\n\n this.#logLevel = logLevel;\n }\n\n #resetSegments() {\n this.#segments = [];\n }\n\n #log(fct: LogFunction, threshold: LogLevel) {\n if (this.#segments.length > 0) {\n if (this.#logLevel <= threshold) {\n const formattedSegments = formatSegments(this.#segments);\n\n fct(...formattedSegments);\n }\n\n this.#resetSegments();\n }\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n getName() {\n return LogRocketLogger.name;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withText(text?: string, options?: Omit<LogOptions, \"style\">) {\n if (text) {\n this.#segments.push({\n type: \"text\",\n value: text,\n options\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withError(error?: Error) {\n if (error) {\n this.#segments.push({\n type: \"error\",\n value: error\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withObject(obj?: unknown) {\n if (obj) {\n this.#segments.push({\n type: \"object\",\n value: obj\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withLineChange() {\n this.#segments.push({\n type: \"line-change\",\n value: \"\\r\\n\"\n });\n\n return this;\n }\n\n /**\n * Write a debug log. The log will be processed only if the logger LogLevel is >= debug.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n debug(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.debug);\n }\n\n /**\n * Write an information log. The log will be processed only if the logger LogLevel is >= information.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n information(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.information);\n }\n\n /**\n * Write a warning log. The log will be processed only if the logger LogLevel is >= warning.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n warning(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.warn, LogLevel.warning);\n }\n\n /**\n * Write an error log. The log will be processed only if the logger LogLevel is >= error.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n error(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.error);\n }\n\n /**\n * Write a critical log. The log will be processed only if the logger LogLevel is >= critical.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n critical(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.critical);\n }\n\n /**\n * Start a new logging scope. The scope will inherit the LogLevel of the root logger.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n startScope(label: string) {\n return new LogRocketLoggerScope(label, this.#logLevel);\n }\n}\n"],"names":["LogLevel","LogRocket","appendText","currentText","newText","options","leadingSpace","formatSegments","segments","logs","textBuffer","flushText","x","LogRocketLoggerScope","label","logLevel","fct","threshold","formattedSegments","text","error","obj","log","dismiss","LogRocketLogger"],"mappings":";;;;;;;;AAA6I;AAC3G;AAQlC,SAASE,WAAWC,WAAmB,EAAEC,OAAe,EAAEC,UAAsC,CAAC,CAAC;IAC9F,MAAM,EACFC,eAAe,IAAI,EACtB,GAAGD;IAEJ,IAAIF,YAAY,MAAM,GAAG,GAAG;QACxB,OAAO,GAAGA,cAAcG,eAAe,MAAM,KAAKF,SAAS;IAC/D;IAEA,OAAOA;AACX;AAEA;;;;;;;CAOC,GACD,SAASG,eAAeC,QAAmB;IACvC,MAAMC,OAAkB,EAAE;IAE1B,IAAIC,aAAa;IAEjB,MAAMC,YAAY;QACd,IAAID,WAAW,MAAM,GAAG,GAAG;YACvBD,KAAK,IAAI,CAACC;YAEVA,aAAa;QACjB;IACJ;IAEAF,SAAS,OAAO,CAACI,CAAAA;QACb,IAAIA,EAAE,IAAI,KAAK,QAAQ;YACnBF,aAAaR,WAAWQ,YAAYE,EAAE,KAAK,EAAY;gBACnD,cAAcA,EAAE,OAAO,EAAE;YAC7B;QACJ,OAAO;YACHD;YAEAF,KAAK,IAAI,CAACG,EA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iBAAiB;IAChD;IAEA;;;KAGC,GACD,WAAWc,KAAa,EAAE;QACtB,OAAO,IAAID,qBAAqBC,OAAO,IAAI,CAAC,SAAS;IACzD;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
;// CONCATENATED MODULE: ./src/applyTransformers.ts
|
|
2
|
+
;// CONCATENATED MODULE: ./src/js/applyTransformers.ts
|
|
3
3
|
// The function return type is mandatory, otherwise we got an error TS4058.
|
|
4
4
|
function applyTransformers(options, transformers, context) {
|
|
5
5
|
return transformers.reduce((acc, transformer)=>transformer(acc, context), options);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/applyTransformers.js","sources":["webpack://@workleap/logrocket/./src/js/applyTransformers.ts"],"sourcesContent":["import type { RootLogger } from \"@workleap/logging\";\nimport type { LogRocketSdkOptions } from \"./logRocketTypes.ts\";\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketSdkOptionsTransformerContext {\n verbose: boolean;\n logger: RootLogger;\n}\n\n/**\n * Hook to transform the resulting LogRocket SDK options.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport type LogRocketSdkOptionsTransformer = (options: LogRocketSdkOptions, context: LogRocketSdkOptionsTransformerContext) => LogRocketSdkOptions;\n\n// The function return type is mandatory, otherwise we got an error TS4058.\nexport function applyTransformers(options: LogRocketSdkOptions, transformers: LogRocketSdkOptionsTransformer[], context: LogRocketSdkOptionsTransformerContext): LogRocketSdkOptions {\n return transformers.reduce((acc, transformer) => transformer(acc, context), options);\n}\n\n\n"],"names":["applyTransformers","options","transformers","context","acc","transformer"],"mappings":";;AAiBA,2EAA2E;AACpE,SAASA,kBAAkBC,OAA4B,EAAEC,YAA8C,EAAEC,OAA8C;IAC1J,OAAOD,aAAa,MAAM,CAAC,CAACE,KAAKC,cAAgBA,YAAYD,KAAKD,UAAUF;AAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/assertions.js","sources":["webpack://@workleap/logrocket/./src/js/assertions.ts"],"sourcesContent":["export function isDefined(value: unknown) {\n return typeof value !== \"undefined\" && value !== undefined;\n}\n"],"names":["isDefined","value","undefined"],"mappings":";;AAAO,SAASA,UAAUC,KAAc;IACpC,OAAO,OAAOA,UAAU,eAAeA,UAAUC;AACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/createRequestSanitizer.js","sources":["webpack://@workleap/logrocket/./src/js/createRequestSanitizer.ts"],"sourcesContent":["import type { LogRocketRequest } from \"./logRocketTypes.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RequestSanitizerFunction = (req: LogRocketRequest) => any;\n\nexport function createRequestSanitizer(fuzzyRequestSanitizer: RequestSanitizerFunction) {\n return (req: LogRocketRequest) => {\n if (req.headers[\"Authorization\"]) {\n req.headers[\"Authorization\"] = \"**redacted**\";\n }\n\n if (req.body) {\n // Do not return the request body, which could contain sensitive information.\n req.body = \"**redacted**\";\n }\n\n return fuzzyRequestSanitizer(req);\n };\n}\n"],"names":["createRequestSanitizer","fuzzyRequestSanitizer","req"],"mappings":";;AAKO,SAASA,uBAAuBC,qBAA+C;IAClF,OAAO,CAACC;QACJ,IAAIA,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC9BA,IAAI,OAAO,CAAC,gBAAgB,GAAG;QACnC;QAEA,IAAIA,IAAI,IAAI,EAAE;YACV,6EAA6E;YAC7EA,IAAI,IAAI,GAAG;QACf;QAEA,OAAOD,sBAAsBC;IACjC;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/createResponseSanitizer.js","sources":["webpack://@workleap/logrocket/./src/js/createResponseSanitizer.ts"],"sourcesContent":["import type { LogRocketResponse } from \"./logRocketTypes.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ResponseSanitizerFunction = (res: LogRocketResponse) => any;\n\nexport function createResponseSanitizer(fuzzyResponseSanitizer: ResponseSanitizerFunction) {\n return (res: LogRocketResponse) => {\n if (res.body) {\n // Do not return the response body, which could contain sensitive information.\n res.body = \"**redacted**\";\n }\n\n return fuzzyResponseSanitizer(res);\n };\n}\n"],"names":["createResponseSanitizer","fuzzyResponseSanitizer","res"],"mappings":";;AAKO,SAASA,wBAAwBC,sBAAiD;IACrF,OAAO,CAACC;QACJ,IAAIA,IAAI,IAAI,EAAE;YACV,8EAA8E;YAC9EA,IAAI,IAAI,GAAG;QACf;QAEA,OAAOD,uBAAuBC;IAClC;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/createUrlSanitizer.js","sources":["webpack://@workleap/logrocket/./src/js/createUrlSanitizer.ts"],"sourcesContent":["export function createUrlSanitizer(queryParametersToRemove: string[]) {\n return (url: string) => {\n let sanitizedUrl = url;\n\n for (const x of queryParametersToRemove) {\n sanitizedUrl = sanitizedUrl.replace(new RegExp(`${x}=([^&]*)`, \"i\"), `${x}=**redacted**`);\n }\n\n return sanitizedUrl;\n };\n}\n"],"names":["createUrlSanitizer","queryParametersToRemove","url","sanitizedUrl","x","RegExp"],"mappings":";;AAAO,SAASA,mBAAmBC,uBAAiC;IAChE,OAAO,CAACC;QACJ,IAAIC,eAAeD;QAEnB,KAAK,MAAME,KAAKH,wBAAyB;YACrCE,eAAeA,aAAa,OAAO,CAAC,IAAIE,OAAO,GAAGD,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAGA,EAAE,aAAa,CAAC;QAC5F;QAEA,OAAOD;IACX;AACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createTelemetryContext, type CreateTelemetryContextOptions, type TelemetryContext } from "@workleap-telemetry/core";
|
|
2
|
+
export type { LogRocketSdkOptionsTransformer } from "./applyTransformers.ts";
|
|
3
|
+
export { LogRocketInstrumentationClient, type GetLogRocketSessionUrlListener, type LogRocketWorkleapPlatformIdentification, type LogRocketWorkleapPlatformUserTraits } from "./LogRocketInstrumentationClient.ts";
|
|
4
|
+
export { LogRocketLogger, LogRocketLoggerScope } from "./LogRocketLogger.ts";
|
|
5
|
+
export type * from "./logRocketTypes.ts";
|
|
6
|
+
export { registerLogRocketInstrumentation, type RegisterLogRocketInstrumentationOptions } from "./registerLogRocketInstrumentation.ts";
|
package/dist/js/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createTelemetryContext } from "@workleap-telemetry/core";
|
|
2
|
+
import { LogRocketInstrumentationClient } from "./LogRocketInstrumentationClient.js";
|
|
3
|
+
import { LogRocketLogger, LogRocketLoggerScope } from "./LogRocketLogger.js";
|
|
4
|
+
import { registerLogRocketInstrumentation } from "./registerLogRocketInstrumentation.js";
|
|
5
|
+
|
|
6
|
+
;// CONCATENATED MODULE: external "@workleap-telemetry/core"
|
|
7
|
+
|
|
8
|
+
;// CONCATENATED MODULE: external "./LogRocketInstrumentationClient.js"
|
|
9
|
+
|
|
10
|
+
;// CONCATENATED MODULE: external "./LogRocketLogger.js"
|
|
11
|
+
|
|
12
|
+
;// CONCATENATED MODULE: external "./registerLogRocketInstrumentation.js"
|
|
13
|
+
|
|
14
|
+
;// CONCATENATED MODULE: ./src/js/index.ts
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export { LogRocketInstrumentationClient, LogRocketLogger, LogRocketLoggerScope, createTelemetryContext, registerLogRocketInstrumentation };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/index.js","sources":["webpack://@workleap/logrocket/./src/js/index.ts"],"sourcesContent":["export { createTelemetryContext, type CreateTelemetryContextOptions, type TelemetryContext } from \"@workleap-telemetry/core\";\nexport type { LogRocketSdkOptionsTransformer } from \"./applyTransformers.ts\";\nexport { LogRocketInstrumentationClient, type GetLogRocketSessionUrlListener, type LogRocketWorkleapPlatformIdentification, type LogRocketWorkleapPlatformUserTraits } from \"./LogRocketInstrumentationClient.ts\";\nexport { LogRocketLogger, LogRocketLoggerScope } from \"./LogRocketLogger.ts\";\nexport type * from \"./logRocketTypes.ts\";\nexport { registerLogRocketInstrumentation, type RegisterLogRocketInstrumentationOptions } from \"./registerLogRocketInstrumentation.ts\";\n\n\n"],"names":["createTelemetryContext","LogRocketInstrumentationClient","LogRocketLogger","LogRocketLoggerScope","registerLogRocketInstrumentation"],"mappings":";;;;;;;;;;;;;;AAA6H;AAEqF;AACrI;AAE0D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/logRocketTypes.js","sources":["webpack://@workleap/logrocket/./src/js/logRocketTypes.ts"],"sourcesContent":["import type LogRocket from \"logrocket\";\n\n// Typings are not exposed by the library.\nexport type LogRocketSdkOptions = NonNullable<Parameters<(typeof LogRocket)[\"init\"]>[1]>;\n\n// Typings are not exposed by the library, copied from the LogRocket package.\nexport interface LogRocketRequest {\n reqId: string;\n url: string;\n headers: {\n [key: string]: string | null | undefined;\n };\n body?: string;\n method: string;\n referrer?: string;\n mode?: string;\n credentials?: string;\n}\n\n// Typings are not exposed by the library, copied from the LogRocket package.\nexport interface LogRocketResponse {\n reqId: string;\n status?: number;\n headers: {\n [key: string]: string | null | undefined;\n };\n body?: string;\n method: string;\n url?: string;\n}\n"],"names":[],"mappings":";;AAmBA,6EAA6E;AAU5E"}
|
package/dist/{registerLogRocketInstrumentation.d.ts → js/registerLogRocketInstrumentation.d.ts}
RENAMED
|
@@ -1,40 +1,60 @@
|
|
|
1
|
+
import { type TelemetryContext } from "@workleap-telemetry/core";
|
|
1
2
|
import { type RootLogger } from "@workleap/logging";
|
|
2
3
|
import { type LogRocketSdkOptionsTransformer } from "./applyTransformers.ts";
|
|
4
|
+
import { LogRocketInstrumentationClient } from "./LogRocketInstrumentationClient.ts";
|
|
3
5
|
import type { LogRocketSdkOptions } from "./logRocketTypes.ts";
|
|
4
|
-
export declare const IsRegisteredVariableName = "__WLP_LOGROCKET_INSTRUMENTATION_IS_REGISTERED__";
|
|
5
|
-
export declare const RegisterGetSessionUrlFunctionName = "__WLP_LOGROCKET_INSTRUMENTATION_REGISTER_GET_SESSION_URL_LISTENER__";
|
|
6
6
|
/**
|
|
7
7
|
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
8
8
|
*/
|
|
9
9
|
export interface RegisterLogRocketInstrumentationOptions {
|
|
10
10
|
/**
|
|
11
11
|
* A root hostname to track sessions across subdomains. Set this option to capture traffic from all subdomains under one session: https://docs.logrocket.com/reference/roothostname.
|
|
12
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
12
13
|
*/
|
|
13
14
|
rootHostname?: LogRocketSdkOptions["rootHostname"];
|
|
14
15
|
/**
|
|
15
16
|
* Names of additional fields to exclude from session replays. These fields will be removed from network requests, responses using a fuzzy-matching algorithm.
|
|
17
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
16
18
|
*/
|
|
17
19
|
privateFieldNames?: string[];
|
|
18
20
|
/**
|
|
19
21
|
* Names of additional fields to exclude from session replays. These fields will be removed from query parameters using a fuzzy-matching algorithm.
|
|
22
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
20
23
|
*/
|
|
21
24
|
privateQueryParameterNames?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Context including telemetry correlation ids.
|
|
27
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
28
|
+
*/
|
|
29
|
+
telemetryContext?: TelemetryContext;
|
|
30
|
+
/**
|
|
31
|
+
* Hooks to transform the resulting LogRocket SDK options.
|
|
32
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
33
|
+
*/
|
|
34
|
+
transformers?: LogRocketSdkOptionsTransformer[];
|
|
22
35
|
/**
|
|
23
36
|
* Indicates whether or not debug information should be logged to the console.
|
|
37
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
24
38
|
*/
|
|
25
39
|
verbose?: boolean;
|
|
26
40
|
/**
|
|
27
41
|
* The logger instances that will output messages.
|
|
42
|
+
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
28
43
|
*/
|
|
29
44
|
loggers?: RootLogger[];
|
|
30
|
-
/**
|
|
31
|
-
* Hooks to transform the resulting LogRocket SDK options.
|
|
32
|
-
*/
|
|
33
|
-
transformers?: LogRocketSdkOptionsTransformer[];
|
|
34
45
|
}
|
|
35
46
|
export declare function getLogRocketSdkOptions(userOptions: RegisterLogRocketInstrumentationOptions, logger: RootLogger): LogRocketSdkOptions;
|
|
47
|
+
export declare const IsRegisteredVariableName = "__WLP_LOGROCKET_INSTRUMENTATION_IS_REGISTERED__";
|
|
48
|
+
export declare const RegisterGetSessionUrlFunctionName = "__WLP_LOGROCKET_INSTRUMENTATION_REGISTER_GET_SESSION_URL_LISTENER__";
|
|
36
49
|
export declare function __resetRegistrationGuard(): void;
|
|
50
|
+
export declare class LogRocketInstrumentationRegistrator {
|
|
51
|
+
register(appId: string, options?: RegisterLogRocketInstrumentationOptions): LogRocketInstrumentationClient;
|
|
52
|
+
}
|
|
37
53
|
/**
|
|
54
|
+
* Register the LogRocket instrumentation.
|
|
55
|
+
* @param appId LogRocket application id.
|
|
56
|
+
* @param options LogRocket instrumentation options.
|
|
57
|
+
* @returns {LogRocketInstrumentationClient} A LogRocket instrumentation client instance.
|
|
38
58
|
* @see {@link https://workleap.github.io/wl-telemetry}
|
|
39
59
|
*/
|
|
40
|
-
export declare function registerLogRocketInstrumentation(appId: string, options?: RegisterLogRocketInstrumentationOptions):
|
|
60
|
+
export declare function registerLogRocketInstrumentation(appId: string, options?: RegisterLogRocketInstrumentationOptions): LogRocketInstrumentationClient;
|