@o3r/logger 15.3.0-prerelease.9 → 15.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/o3r-logger-services-fullstory-logger-client.mjs +66 -91
- package/fesm2022/o3r-logger-services-fullstory-logger-client.mjs.map +1 -1
- package/fesm2022/o3r-logger-services-logrocket-logger-client.mjs +53 -102
- package/fesm2022/o3r-logger-services-logrocket-logger-client.mjs.map +1 -1
- package/fesm2022/o3r-logger-services-smartlook-logger-client.mjs +44 -90
- package/fesm2022/o3r-logger-services-smartlook-logger-client.mjs.map +1 -1
- package/fesm2022/o3r-logger.mjs +136 -220
- package/fesm2022/o3r-logger.mjs.map +1 -1
- package/package.json +4 -4
- package/schematics/ng-add/schema.json +0 -3
- package/types/o3r-logger-services-fullstory-logger-client.d.ts +47 -50
- package/types/o3r-logger-services-fullstory-logger-client.d.ts.map +1 -1
- package/types/o3r-logger-services-logrocket-logger-client.d.ts +54 -57
- package/types/o3r-logger-services-logrocket-logger-client.d.ts.map +1 -1
- package/types/o3r-logger-services-smartlook-logger-client.d.ts +47 -50
- package/types/o3r-logger-services-smartlook-logger-client.d.ts.map +1 -1
- package/types/o3r-logger.d.ts +168 -177
- package/types/o3r-logger.d.ts.map +1 -1
|
@@ -1,92 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
FullStory('restart');
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @inheritdoc
|
|
69
|
-
*/
|
|
70
|
-
createMetaReducer() {
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment -- TODO check later if we can move to arrow function without regression
|
|
72
|
-
const client = this;
|
|
73
|
-
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions -- TODO check later if we can move to arrow function without regression
|
|
74
|
-
return function debug(reducer) {
|
|
75
|
-
return (state, action) => {
|
|
76
|
-
// Filter @ngrx actions
|
|
77
|
-
if (!action.type.startsWith('@ngrx/')) {
|
|
78
|
-
client.event('state', state);
|
|
79
|
-
client.event('action', action);
|
|
80
|
-
}
|
|
81
|
-
return reducer(state, action);
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Generated bundle index. Do not edit.
|
|
89
|
-
*/
|
|
90
|
-
|
|
1
|
+
import { FullStory, init } from "@fullstory/browser";
|
|
2
|
+
var FullStoryClient = class {
|
|
3
|
+
constructor(orgId) {
|
|
4
|
+
init({ orgId });
|
|
5
|
+
}
|
|
6
|
+
identify(uid, vars) {
|
|
7
|
+
if (vars && vars.name) FullStory("setIdentity", {
|
|
8
|
+
uid,
|
|
9
|
+
properties: {
|
|
10
|
+
...vars,
|
|
11
|
+
displayName: vars.name
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
else FullStory("setIdentity", {
|
|
15
|
+
uid,
|
|
16
|
+
properties: vars
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
event(name, properties) {
|
|
20
|
+
FullStory("trackEvent", {
|
|
21
|
+
name,
|
|
22
|
+
properties
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
error(message, ...optionalParams) {
|
|
26
|
+
FullStory("log", {
|
|
27
|
+
level: "error",
|
|
28
|
+
msg: `${message.toString()}\n${optionalParams.toString()}`
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
warn(message, ...optionalParams) {
|
|
32
|
+
FullStory("log", {
|
|
33
|
+
level: "warn",
|
|
34
|
+
msg: `${message.toString()}\n${optionalParams.toString()}`
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
log(message, ...optionalParams) {
|
|
38
|
+
FullStory("log", {
|
|
39
|
+
level: "log",
|
|
40
|
+
msg: `${message.toString()}\n${optionalParams.toString()}`
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
getSessionURL() {
|
|
44
|
+
return FullStory("getSession") || void 0;
|
|
45
|
+
}
|
|
46
|
+
stopRecording() {
|
|
47
|
+
FullStory("shutdown");
|
|
48
|
+
}
|
|
49
|
+
resumeRecording() {
|
|
50
|
+
FullStory("restart");
|
|
51
|
+
}
|
|
52
|
+
createMetaReducer() {
|
|
53
|
+
const client = this;
|
|
54
|
+
return function debug(reducer) {
|
|
55
|
+
return (state, action) => {
|
|
56
|
+
if (!action.type.startsWith("@ngrx/")) {
|
|
57
|
+
client.event("state", state);
|
|
58
|
+
client.event("action", action);
|
|
59
|
+
}
|
|
60
|
+
return reducer(state, action);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
91
65
|
export { FullStoryClient };
|
|
92
|
-
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=o3r-logger-services-fullstory-logger-client.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-logger-services-fullstory-logger-client.mjs","
|
|
1
|
+
{"version":3,"file":"o3r-logger-services-fullstory-logger-client.mjs","names":["fullStory"],"sources":["../../src/services/fullstory-logger-client/fullstory-logger-client.ts"],"sourcesContent":["import {\n FullStory as fullStory,\n init,\n} from '@fullstory/browser';\nimport {\n Action,\n ActionReducer,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n LoggerClient,\n} from '@o3r/logger';\n\n/**\n * FullStory client.\n */\nexport class FullStoryClient implements LoggerClient {\n /**\n * Constructor.\n * @param orgId FullStory organization ID\n */\n constructor(orgId: string) {\n init({ orgId });\n }\n\n /**\n * @inheritdoc\n */\n public identify(uid: string, vars?: { [key: string]: string }): void {\n if (vars && vars.name) {\n fullStory('setIdentity', { uid, properties: { ...vars, displayName: vars.name } });\n } else {\n fullStory('setIdentity', { uid, properties: vars });\n }\n }\n\n /**\n * @inheritdoc\n */\n public event(name: string, properties?: any): void {\n fullStory('trackEvent', { name, properties });\n }\n\n /**\n * @inheritdoc\n */\n public error(message?: any, ...optionalParams: any[]): void {\n fullStory('log', { level: 'error', msg: `${message.toString() as string}\\n${optionalParams.toString()}` });\n }\n\n /**\n * @inheritdoc\n */\n public warn(message?: any, ...optionalParams: any[]): void {\n fullStory('log', { level: 'warn', msg: `${message.toString() as string}\\n${optionalParams.toString()}` });\n }\n\n /**\n * @inheritdoc\n */\n public log(message?: any, ...optionalParams: any[]): void {\n fullStory('log', { level: 'log', msg: `${message.toString() as string}\\n${optionalParams.toString()}` });\n }\n\n /**\n * @inheritdoc\n */\n public getSessionURL(): string | undefined {\n return fullStory('getSession') || undefined;\n }\n\n /**\n * @inheritdoc\n */\n public stopRecording(): void {\n fullStory('shutdown');\n }\n\n /**\n * @inheritdoc\n */\n public resumeRecording(): void {\n fullStory('restart');\n }\n\n /**\n * @inheritdoc\n */\n public createMetaReducer(): MetaReducer<any, Action> {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment -- TODO check later if we can move to arrow function without regression\n const client: FullStoryClient = this;\n // eslint-disable-next-line prefer-arrow/prefer-arrow-functions -- TODO check later if we can move to arrow function without regression\n return function debug(reducer: ActionReducer<any>): ActionReducer<any> {\n return (state, action) => {\n // Filter @ngrx actions\n if (!action.type.startsWith('@ngrx/')) {\n client.event('state', state);\n client.event('action', action);\n }\n\n return reducer(state, action);\n };\n };\n }\n}\n"],"mappings":";AAgBA,IAAa,kBAAb,MAA4B;CAK1B,YAAY,OAAa;EACvB,KAAK,EAAE,MAAK,CAAE;CAChB;CAKO,SAAS,KAAa,MAAgC;EAC3D,IAAI,QAAQ,KAAK,MACf,UAAU,eAAe;GAAE;GAAK,YAAY;IAAE,GAAG;IAAM,aAAa,KAAK;GAAI;EAAE,CAAE;OAEjF,UAAU,eAAe;GAAE;GAAK,YAAY;EAAI,CAAE;CAEtD;CAKO,MAAM,MAAc,YAAgB;EACzC,UAAU,cAAc;GAAE;GAAM;EAAU,CAAE;CAC9C;CAKO,MAAM,SAAe,GAAG,gBAAqB;EAClD,UAAU,OAAO;GAAE,OAAO;GAAS,KAAK,GAAG,QAAQ,SAAQ,EAAY,IAAK,eAAe,SAAQ;EAAI,CAAE;CAC3G;CAKO,KAAK,SAAe,GAAG,gBAAqB;EACjD,UAAU,OAAO;GAAE,OAAO;GAAQ,KAAK,GAAG,QAAQ,SAAQ,EAAY,IAAK,eAAe,SAAQ;EAAI,CAAE;CAC1G;CAKO,IAAI,SAAe,GAAG,gBAAqB;EAChD,UAAU,OAAO;GAAE,OAAO;GAAO,KAAK,GAAG,QAAQ,SAAQ,EAAY,IAAK,eAAe,SAAQ;EAAI,CAAE;CACzG;CAKO,gBAAa;EAClB,OAAOA,UAAU,YAAY,KAAK;CACpC;CAKO,gBAAa;EAClB,UAAU,UAAU;CACtB;CAKO,kBAAe;EACpB,UAAU,SAAS;CACrB;CAKO,oBAAiB;EAEtB,MAAM,SAA0B;EAEhC,OAAO,SAAS,MAAM,SAA2B;GAC/C,QAAQ,OAAO,WAAU;IAEvB,IAAI,CAAC,OAAO,KAAK,WAAW,QAAQ,GAAG;KACrC,OAAO,MAAM,SAAS,KAAK;KAC3B,OAAO,MAAM,UAAU,MAAM;IAC/B;IAEA,OAAO,QAAQ,OAAO,MAAM;GAC9B;EACF;CACF;AACD"}
|
|
@@ -1,103 +1,54 @@
|
|
|
1
|
-
import * as LogRocket from
|
|
2
|
-
import createNgrxMiddleware from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
warn(message, ...optionalParams) {
|
|
53
|
-
LogRocket.warn(message, ...optionalParams);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* @inheritdoc
|
|
57
|
-
*/
|
|
58
|
-
log(message, ...optionalParams) {
|
|
59
|
-
LogRocket.log(message, ...optionalParams);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @inheritdoc
|
|
63
|
-
*/
|
|
64
|
-
getSessionURL() {
|
|
65
|
-
return LogRocket.sessionURL || undefined;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @inheritdoc
|
|
69
|
-
*/
|
|
70
|
-
stopRecording() {
|
|
71
|
-
// eslint-disable-next-line no-console -- we don't want to log this Error on LogRocket as it's when LogRocket is wrongly used
|
|
72
|
-
console.error('Impossible to stop recording with LogRocket');
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @inheritdoc
|
|
76
|
-
*/
|
|
77
|
-
resumeRecording() {
|
|
78
|
-
// eslint-disable-next-line no-console -- we don't want to log this Error on LogRocket as it's when LogRocket is wrongly used
|
|
79
|
-
console.error('Impossible to restart recording with LogRocket.');
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @inheritdoc
|
|
83
|
-
*/
|
|
84
|
-
createMetaReducer() {
|
|
85
|
-
const defaultOptions = {
|
|
86
|
-
actionSanitizer: (action) => {
|
|
87
|
-
// Filter @ngrx actions
|
|
88
|
-
if (action.type.startsWith('@ngrx/')) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return action;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
return createNgrxMiddleware(LogRocket, { ...defaultOptions, ...this.metaReducerOptions });
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Generated bundle index. Do not edit.
|
|
100
|
-
*/
|
|
101
|
-
|
|
1
|
+
import * as LogRocket from "logrocket";
|
|
2
|
+
import createNgrxMiddleware from "logrocket-ngrx";
|
|
3
|
+
var LogRocketClient = class {
|
|
4
|
+
constructor(appId, initOptions, metaReducerOptions) {
|
|
5
|
+
LogRocket.init(appId, {
|
|
6
|
+
network: { requestSanitizer: (request) => {
|
|
7
|
+
if (request.url.toLowerCase().includes("/purchase/orders")) return {
|
|
8
|
+
...request,
|
|
9
|
+
body: ""
|
|
10
|
+
};
|
|
11
|
+
return request;
|
|
12
|
+
} },
|
|
13
|
+
...initOptions
|
|
14
|
+
});
|
|
15
|
+
this.metaReducerOptions = metaReducerOptions;
|
|
16
|
+
}
|
|
17
|
+
identify(uid, vars) {
|
|
18
|
+
LogRocket.identify(uid, vars);
|
|
19
|
+
}
|
|
20
|
+
event(name, properties) {
|
|
21
|
+
const trackEvent = properties ? `${name}: ${properties}` : name;
|
|
22
|
+
LogRocket.track(trackEvent);
|
|
23
|
+
}
|
|
24
|
+
error(message, ...optionalParams) {
|
|
25
|
+
LogRocket.error(message, optionalParams);
|
|
26
|
+
}
|
|
27
|
+
warn(message, ...optionalParams) {
|
|
28
|
+
LogRocket.warn(message, ...optionalParams);
|
|
29
|
+
}
|
|
30
|
+
log(message, ...optionalParams) {
|
|
31
|
+
LogRocket.log(message, ...optionalParams);
|
|
32
|
+
}
|
|
33
|
+
getSessionURL() {
|
|
34
|
+
return LogRocket.sessionURL || void 0;
|
|
35
|
+
}
|
|
36
|
+
stopRecording() {
|
|
37
|
+
console.error("Impossible to stop recording with LogRocket");
|
|
38
|
+
}
|
|
39
|
+
resumeRecording() {
|
|
40
|
+
console.error("Impossible to restart recording with LogRocket.");
|
|
41
|
+
}
|
|
42
|
+
createMetaReducer() {
|
|
43
|
+
return createNgrxMiddleware(LogRocket, {
|
|
44
|
+
actionSanitizer: (action) => {
|
|
45
|
+
if (action.type.startsWith("@ngrx/")) return null;
|
|
46
|
+
return action;
|
|
47
|
+
},
|
|
48
|
+
...this.metaReducerOptions
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
102
52
|
export { LogRocketClient };
|
|
103
|
-
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=o3r-logger-services-logrocket-logger-client.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-logger-services-logrocket-logger-client.mjs","
|
|
1
|
+
{"version":3,"file":"o3r-logger-services-logrocket-logger-client.mjs","names":[],"sources":["../../src/services/logrocket-logger-client/logrocket-logger-client.ts"],"sourcesContent":["import {\n Action,\n MetaReducer,\n} from '@ngrx/store';\nimport * as LogRocket from 'logrocket';\nimport createNgrxMiddleware, {\n Options,\n} from 'logrocket-ngrx';\nimport type {\n LoggerClient,\n} from '@o3r/logger';\n\n/**\n * LogRocket client.\n */\nexport class LogRocketClient implements LoggerClient {\n /**\n * Meta reducer configuration to change what store related items LogRocket records\n */\n private readonly metaReducerOptions?: Options;\n\n /**\n * Constructor.\n * @param appId LogROcket application ID\n * @param initOptions Optional configuration to change what LogRocket records\n * @param metaReducerOptions Optional meta reducer configuration to change what store related items LogRocket records\n */\n constructor(appId: string, initOptions?: any, metaReducerOptions?: Options) {\n const defaultOptions = {\n network: {\n requestSanitizer: (request: Request) => {\n // if the url contains '/purchase/orders'\n if (request.url.toLowerCase().includes('/purchase/orders')) {\n // scrub out the body\n return { ...request, body: '' };\n }\n return request;\n }\n }\n };\n\n LogRocket.init(appId, { ...defaultOptions, ...initOptions });\n this.metaReducerOptions = metaReducerOptions;\n }\n\n /**\n * @inheritdoc\n */\n public identify(uid: string, vars?: { [key: string]: string }): void {\n LogRocket.identify(uid, vars);\n }\n\n /**\n * @inheritdoc\n */\n public event(name: string, properties?: any): void {\n const trackEvent = properties ? `${name}: ${properties as string}` : name;\n LogRocket.track(trackEvent);\n }\n\n /**\n * @inheritdoc\n */\n public error(message?: any, ...optionalParams: any[]): void {\n LogRocket.error(message, optionalParams);\n }\n\n /**\n * @inheritdoc\n */\n public warn(message?: any, ...optionalParams: any[]): void {\n LogRocket.warn(message, ...optionalParams);\n }\n\n /**\n * @inheritdoc\n */\n public log(message?: any, ...optionalParams: any[]): void {\n LogRocket.log(message, ...optionalParams);\n }\n\n /**\n * @inheritdoc\n */\n public getSessionURL(): string | undefined {\n return LogRocket.sessionURL || undefined;\n }\n\n /**\n * @inheritdoc\n */\n public stopRecording(): void {\n // eslint-disable-next-line no-console -- we don't want to log this Error on LogRocket as it's when LogRocket is wrongly used\n console.error('Impossible to stop recording with LogRocket');\n }\n\n /**\n * @inheritdoc\n */\n public resumeRecording(): void {\n // eslint-disable-next-line no-console -- we don't want to log this Error on LogRocket as it's when LogRocket is wrongly used\n console.error('Impossible to restart recording with LogRocket.');\n }\n\n /**\n * @inheritdoc\n */\n public createMetaReducer(): MetaReducer<any, Action> {\n const defaultOptions = {\n actionSanitizer: (action: Action) => {\n // Filter @ngrx actions\n if (action.type.startsWith('@ngrx/')) {\n return null;\n }\n return action;\n }\n };\n return createNgrxMiddleware(LogRocket, { ...defaultOptions, ...this.metaReducerOptions });\n }\n}\n"],"mappings":";;AAeA,IAAa,kBAAb,MAA4B;CAY1B,YAAY,OAAe,aAAmB,oBAA4B;EAcxE,UAAU,KAAK,OAAO;GAZpB,SAAS,EACP,mBAAmB,YAAoB;IAErC,IAAI,QAAQ,IAAI,YAAW,CAAE,CAAC,SAAS,kBAAkB,GAEvD,OAAO;KAAE,GAAG;KAAS,MAAM;IAAE;IAE/B,OAAO;GACT,EACD;GAGwC,GAAG;EAAW,CAAE;EAC3D,KAAK,qBAAqB;CAC5B;CAKO,SAAS,KAAa,MAAgC;EAC3D,UAAU,SAAS,KAAK,IAAI;CAC9B;CAKO,MAAM,MAAc,YAAgB;EACzC,MAAM,aAAa,aAAa,GAAG,KAAI,IAAK,eAAyB;EACrE,UAAU,MAAM,UAAU;CAC5B;CAKO,MAAM,SAAe,GAAG,gBAAqB;EAClD,UAAU,MAAM,SAAS,cAAc;CACzC;CAKO,KAAK,SAAe,GAAG,gBAAqB;EACjD,UAAU,KAAK,SAAS,GAAG,cAAc;CAC3C;CAKO,IAAI,SAAe,GAAG,gBAAqB;EAChD,UAAU,IAAI,SAAS,GAAG,cAAc;CAC1C;CAKO,gBAAa;EAClB,OAAO,UAAU,cAAc;CACjC;CAKO,gBAAa;EAElB,QAAQ,MAAM,6CAA6C;CAC7D;CAKO,kBAAe;EAEpB,QAAQ,MAAM,iDAAiD;CACjE;CAKO,oBAAiB;EAUtB,OAAO,qBAAqB,WAAW;GARrC,kBAAkB,WAAkB;IAElC,IAAI,OAAO,KAAK,WAAW,QAAQ,GACjC,OAAO;IAET,OAAO;GACT;GAE0D,GAAG,KAAK;EAAkB,CAAE;CAC1F;AACD"}
|
|
@@ -1,91 +1,45 @@
|
|
|
1
|
-
import SmartLook from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
log(message, ...optionalParams) {
|
|
44
|
-
// eslint-disable-next-line no-console -- done on purpose
|
|
45
|
-
console.log(message, ...optionalParams);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* @inheritdoc
|
|
49
|
-
*/
|
|
50
|
-
getSessionURL() {
|
|
51
|
-
this.error('Session URL not implemented in SmartLook client');
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* @inheritdoc
|
|
56
|
-
*/
|
|
57
|
-
stopRecording() {
|
|
58
|
-
SmartLook.pause();
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @inheritdoc
|
|
62
|
-
*/
|
|
63
|
-
resumeRecording() {
|
|
64
|
-
SmartLook.resume();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* @inheritdoc
|
|
68
|
-
*/
|
|
69
|
-
createMetaReducer() {
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment -- TODO check later if we can move to arrow function without regression
|
|
71
|
-
const client = this;
|
|
72
|
-
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions -- TODO check later if we can move to arrow function without regression
|
|
73
|
-
return function debug(reducer) {
|
|
74
|
-
return (state, action) => {
|
|
75
|
-
// Filter @ngrx actions
|
|
76
|
-
if (!action.type.startsWith('@ngrx/')) {
|
|
77
|
-
client.log('State', state);
|
|
78
|
-
client.log('Action', action);
|
|
79
|
-
}
|
|
80
|
-
return reducer(state, action);
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Generated bundle index. Do not edit.
|
|
88
|
-
*/
|
|
89
|
-
|
|
1
|
+
import SmartLook from "smartlook-client";
|
|
2
|
+
var SmartLookClient = class {
|
|
3
|
+
constructor(key) {
|
|
4
|
+
SmartLook.init(key);
|
|
5
|
+
}
|
|
6
|
+
identify(uid, vars = {}) {
|
|
7
|
+
SmartLook.identify(uid, vars);
|
|
8
|
+
}
|
|
9
|
+
event(name, properties) {
|
|
10
|
+
SmartLook.track(name, properties);
|
|
11
|
+
}
|
|
12
|
+
error(message, ...optionalParams) {
|
|
13
|
+
console.error(message, ...optionalParams);
|
|
14
|
+
}
|
|
15
|
+
warn(message, ...optionalParams) {
|
|
16
|
+
console.warn(message, ...optionalParams);
|
|
17
|
+
}
|
|
18
|
+
log(message, ...optionalParams) {
|
|
19
|
+
console.log(message, ...optionalParams);
|
|
20
|
+
}
|
|
21
|
+
getSessionURL() {
|
|
22
|
+
this.error("Session URL not implemented in SmartLook client");
|
|
23
|
+
}
|
|
24
|
+
stopRecording() {
|
|
25
|
+
SmartLook.pause();
|
|
26
|
+
}
|
|
27
|
+
resumeRecording() {
|
|
28
|
+
SmartLook.resume();
|
|
29
|
+
}
|
|
30
|
+
createMetaReducer() {
|
|
31
|
+
const client = this;
|
|
32
|
+
return function debug(reducer) {
|
|
33
|
+
return (state, action) => {
|
|
34
|
+
if (!action.type.startsWith("@ngrx/")) {
|
|
35
|
+
client.log("State", state);
|
|
36
|
+
client.log("Action", action);
|
|
37
|
+
}
|
|
38
|
+
return reducer(state, action);
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
90
43
|
export { SmartLookClient };
|
|
91
|
-
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=o3r-logger-services-smartlook-logger-client.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-logger-services-smartlook-logger-client.mjs","
|
|
1
|
+
{"version":3,"file":"o3r-logger-services-smartlook-logger-client.mjs","names":[],"sources":["../../src/services/smartlook-logger-client/smartlook-logger-client.ts"],"sourcesContent":["import {\n Action,\n ActionReducer,\n MetaReducer,\n} from '@ngrx/store';\nimport SmartLook from 'smartlook-client';\nimport type {\n LoggerClient,\n} from '@o3r/logger';\n\n/**\n * SmartLook client.\n */\nexport class SmartLookClient implements LoggerClient {\n /**\n * Constructor.\n * @param key SmartLook key\n */\n constructor(key: string) {\n SmartLook.init(key);\n }\n\n /**\n * @inheritdoc\n */\n public identify(uid: string, vars: { [key: string]: string } = {}): void {\n SmartLook.identify(uid, vars);\n }\n\n /**\n * @inheritdoc\n */\n public event(name: string, properties?: any): void {\n SmartLook.track(name, properties);\n }\n\n /**\n * @inheritdoc\n */\n public error(message?: any, ...optionalParams: any[]): void {\n // eslint-disable-next-line no-console -- done on purpose\n console.error(message, ...optionalParams);\n }\n\n /**\n * @inheritdoc\n */\n public warn(message?: any, ...optionalParams: any[]): void {\n // eslint-disable-next-line no-console -- done on purpose\n console.warn(message, ...optionalParams);\n }\n\n /**\n * @inheritdoc\n */\n public log(message?: any, ...optionalParams: any[]): void {\n // eslint-disable-next-line no-console -- done on purpose\n console.log(message, ...optionalParams);\n }\n\n /**\n * @inheritdoc\n */\n public getSessionURL(): undefined {\n this.error('Session URL not implemented in SmartLook client');\n\n return undefined;\n }\n\n /**\n * @inheritdoc\n */\n public stopRecording(): void {\n SmartLook.pause();\n }\n\n /**\n * @inheritdoc\n */\n public resumeRecording(): void {\n SmartLook.resume();\n }\n\n /**\n * @inheritdoc\n */\n public createMetaReducer(): MetaReducer<any, Action> {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment -- TODO check later if we can move to arrow function without regression\n const client: SmartLookClient = this;\n // eslint-disable-next-line prefer-arrow/prefer-arrow-functions -- TODO check later if we can move to arrow function without regression\n return function debug(reducer: ActionReducer<any>): ActionReducer<any> {\n return (state, action) => {\n // Filter @ngrx actions\n if (!action.type.startsWith('@ngrx/')) {\n client.log('State', state);\n client.log('Action', action);\n }\n\n return reducer(state, action);\n };\n };\n }\n}\n"],"mappings":";AAaA,IAAa,kBAAb,MAA4B;CAK1B,YAAY,KAAW;EACrB,UAAU,KAAK,GAAG;CACpB;CAKO,SAAS,KAAa,OAAkC,CAAA,GAAE;EAC/D,UAAU,SAAS,KAAK,IAAI;CAC9B;CAKO,MAAM,MAAc,YAAgB;EACzC,UAAU,MAAM,MAAM,UAAU;CAClC;CAKO,MAAM,SAAe,GAAG,gBAAqB;EAElD,QAAQ,MAAM,SAAS,GAAG,cAAc;CAC1C;CAKO,KAAK,SAAe,GAAG,gBAAqB;EAEjD,QAAQ,KAAK,SAAS,GAAG,cAAc;CACzC;CAKO,IAAI,SAAe,GAAG,gBAAqB;EAEhD,QAAQ,IAAI,SAAS,GAAG,cAAc;CACxC;CAKO,gBAAa;EAClB,KAAK,MAAM,iDAAiD;CAG9D;CAKO,gBAAa;EAClB,UAAU,MAAK;CACjB;CAKO,kBAAe;EACpB,UAAU,OAAM;CAClB;CAKO,oBAAiB;EAEtB,MAAM,SAA0B;EAEhC,OAAO,SAAS,MAAM,SAA2B;GAC/C,QAAQ,OAAO,WAAU;IAEvB,IAAI,CAAC,OAAO,KAAK,WAAW,QAAQ,GAAG;KACrC,OAAO,IAAI,SAAS,KAAK;KACzB,OAAO,IAAI,UAAU,MAAM;IAC7B;IAEA,OAAO,QAAQ,OAAO,MAAM;GAC9B;EACF;CACF;AACD"}
|