@microsoft/sp-diagnostics 1.23.1 → 1.24.0-beta.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.
- package/dist/78359e4b-07c2-43c6-8d0b-d060b4d577e8.manifest.json +6 -11
- package/dist/index-internal-beta.d.ts +20 -0
- package/dist/index-internal-public.d.ts +20 -0
- package/dist/index-internal.d.ts +20 -0
- package/dist/sp-diagnostics_none_1b5b73722b91f3231f63.js +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Api/Engagement/EngagementLogger.js +91 -96
- package/lib-commonjs/Api/Engagement/IEngagementHandler.js +9 -3
- package/lib-commonjs/Api/ExecutionQueue.js +73 -86
- package/lib-commonjs/Api/ILogData.js +6 -3
- package/lib-commonjs/Api/ILogEntry.js +5 -2
- package/lib-commonjs/Api/ILogErrorData.js +6 -3
- package/lib-commonjs/Api/ILogSource.js +10 -3
- package/lib-commonjs/Api/ILogVerboseData.js +6 -3
- package/lib-commonjs/Api/Log/LogHandler.js +27 -26
- package/lib-commonjs/Api/LogEntry.js +40 -39
- package/lib-commonjs/Api/LogFeature.js +14 -10
- package/lib-commonjs/Api/LogLevel.js +22 -19
- package/lib-commonjs/Api/LogManager/CircularBuffer.js +56 -64
- package/lib-commonjs/Api/LogManager/LogManager.js +61 -78
- package/lib-commonjs/Api/LogSource.js +37 -35
- package/lib-commonjs/Api/LogType.js +20 -15
- package/lib-commonjs/Api/Qos/AutoAlertableQosMonitor.js +68 -82
- package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +5 -2
- package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +5 -2
- package/lib-commonjs/Api/Qos/IQos.js +5 -2
- package/lib-commonjs/Api/Qos/IQosEndEvent.js +5 -2
- package/lib-commonjs/Api/Qos/IQosExtraData.js +15 -3
- package/lib-commonjs/Api/Qos/IQosStartEvent.js +9 -3
- package/lib-commonjs/Api/Qos/QosLogger.js +54 -60
- package/lib-commonjs/Api/Qos/QosMonitor.js +163 -209
- package/lib-commonjs/Api/Qos/QosMonitorShareFailureWithCP.js +72 -92
- package/lib-commonjs/Api/Qos/QosResultType.js +14 -7
- package/lib-commonjs/Api/Trace/DefaultTraceHandler.js +20 -22
- package/lib-commonjs/Api/Trace/ITraceHandler.js +9 -3
- package/lib-commonjs/Api/Trace/ITraceLogger.js +5 -2
- package/lib-commonjs/Api/Trace/LogEvent.js +86 -125
- package/lib-commonjs/Api/Trace/TraceLogger.js +149 -161
- package/lib-commonjs/Diagnostics.js +57 -72
- package/lib-commonjs/DiagnosticsSettingsManager.js +37 -43
- package/lib-commonjs/IDiagnosticsSettings.js +5 -2
- package/lib-commonjs/common/Killswitches.js +13 -9
- package/lib-commonjs/extraData/DisplayApp.js +13 -5
- package/lib-commonjs/extraData/IDiagnosticContextInfo.js +5 -2
- package/lib-commonjs/extraData/IPageExtraData.js +5 -2
- package/lib-commonjs/extraData/PageType.js +15 -8
- package/lib-commonjs/extraData/PromotedState.js +18 -13
- package/lib-commonjs/extraData/WebTemplateId.js +13 -5
- package/lib-commonjs/extraData/setPageExtraData.js +37 -37
- package/lib-commonjs/index.js +102 -50
- package/{lib → lib-dts}/Api/Engagement/IEngagementHandler.d.ts +2 -0
- package/lib-esm/Api/Engagement/EngagementLogger.js +137 -0
- package/lib-esm/Api/Engagement/IEngagementHandler.js +9 -0
- package/lib-esm/Api/ExecutionQueue.js +114 -0
- package/lib-esm/Api/ILogData.js +4 -0
- package/lib-esm/Api/ILogEntry.js +3 -0
- package/lib-esm/Api/ILogErrorData.js +4 -0
- package/lib-esm/Api/ILogSource.js +8 -0
- package/lib-esm/Api/ILogVerboseData.js +4 -0
- package/lib-esm/Api/Log/LogHandler.js +37 -0
- package/lib-esm/Api/LogEntry.js +44 -0
- package/lib-esm/Api/LogFeature.js +8 -0
- package/lib-esm/Api/LogLevel.js +20 -0
- package/lib-esm/Api/LogManager/CircularBuffer.js +83 -0
- package/lib-esm/Api/LogManager/LogManager.js +103 -0
- package/lib-esm/Api/LogSource.js +32 -0
- package/lib-esm/Api/LogType.js +20 -0
- package/lib-esm/Api/Qos/AutoAlertableQosMonitor.js +74 -0
- package/lib-esm/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +6 -0
- package/lib-esm/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +6 -0
- package/lib-esm/Api/Qos/IQos.js +6 -0
- package/lib-esm/Api/Qos/IQosEndEvent.js +6 -0
- package/lib-esm/Api/Qos/IQosExtraData.js +12 -0
- package/lib-esm/Api/Qos/IQosStartEvent.js +6 -0
- package/lib-esm/Api/Qos/QosLogger.js +64 -0
- package/lib-esm/Api/Qos/QosMonitor.js +258 -0
- package/lib-esm/Api/Qos/QosMonitorShareFailureWithCP.js +89 -0
- package/lib-esm/Api/Qos/QosResultType.js +11 -0
- package/lib-esm/Api/Trace/DefaultTraceHandler.js +23 -0
- package/lib-esm/Api/Trace/ITraceHandler.js +9 -0
- package/lib-esm/Api/Trace/ITraceLogger.js +3 -0
- package/lib-esm/Api/Trace/LogEvent.js +104 -0
- package/lib-esm/Api/Trace/TraceLogger.js +180 -0
- package/lib-esm/Diagnostics.js +67 -0
- package/lib-esm/DiagnosticsSettingsManager.js +54 -0
- package/lib-esm/IDiagnosticsSettings.js +3 -0
- package/{lib → lib-esm}/common/Killswitches.js +3 -4
- package/{lib → lib-esm}/extraData/DisplayApp.js +3 -2
- package/lib-esm/extraData/IDiagnosticContextInfo.js +7 -0
- package/lib-esm/extraData/IPageExtraData.js +3 -0
- package/{lib → lib-esm}/extraData/PageType.js +4 -4
- package/lib-esm/extraData/PromotedState.js +15 -0
- package/{lib → lib-esm}/extraData/WebTemplateId.js +3 -2
- package/{lib → lib-esm}/extraData/setPageExtraData.js +14 -20
- package/{lib → lib-esm}/index.js +3 -3
- package/package.json +33 -6
- package/dist/sp-diagnostics_none_e7447a590b1864b48fbc.js +0 -1
- package/lib/Api/Engagement/EngagementLogger.d.ts.map +0 -1
- package/lib/Api/Engagement/EngagementLogger.js +0 -143
- package/lib/Api/Engagement/IEngagementHandler.d.ts.map +0 -1
- package/lib/Api/Engagement/IEngagementHandler.js +0 -2
- package/lib/Api/ExecutionQueue.d.ts.map +0 -1
- package/lib/Api/ExecutionQueue.js +0 -131
- package/lib/Api/ILogData.d.ts.map +0 -1
- package/lib/Api/ILogData.js +0 -3
- package/lib/Api/ILogEntry.d.ts.map +0 -1
- package/lib/Api/ILogEntry.js +0 -2
- package/lib/Api/ILogErrorData.d.ts.map +0 -1
- package/lib/Api/ILogErrorData.js +0 -3
- package/lib/Api/ILogSource.d.ts.map +0 -1
- package/lib/Api/ILogSource.js +0 -3
- package/lib/Api/ILogVerboseData.d.ts.map +0 -1
- package/lib/Api/ILogVerboseData.js +0 -3
- package/lib/Api/Log/LogHandler.d.ts.map +0 -1
- package/lib/Api/Log/LogHandler.js +0 -40
- package/lib/Api/LogEntry.d.ts.map +0 -1
- package/lib/Api/LogEntry.js +0 -51
- package/lib/Api/LogFeature.d.ts.map +0 -1
- package/lib/Api/LogFeature.js +0 -11
- package/lib/Api/LogLevel.d.ts.map +0 -1
- package/lib/Api/LogLevel.js +0 -24
- package/lib/Api/LogManager/CircularBuffer.d.ts.map +0 -1
- package/lib/Api/LogManager/CircularBuffer.js +0 -98
- package/lib/Api/LogManager/LogManager.d.ts.map +0 -1
- package/lib/Api/LogManager/LogManager.js +0 -121
- package/lib/Api/LogSource.d.ts.map +0 -1
- package/lib/Api/LogSource.js +0 -40
- package/lib/Api/LogType.d.ts.map +0 -1
- package/lib/Api/LogType.js +0 -23
- package/lib/Api/Qos/AutoAlertableQosMonitor.d.ts.map +0 -1
- package/lib/Api/Qos/AutoAlertableQosMonitor.js +0 -93
- package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts.map +0 -1
- package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +0 -2
- package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts.map +0 -1
- package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +0 -2
- package/lib/Api/Qos/IQos.d.ts.map +0 -1
- package/lib/Api/Qos/IQos.js +0 -2
- package/lib/Api/Qos/IQosEndEvent.d.ts.map +0 -1
- package/lib/Api/Qos/IQosEndEvent.js +0 -2
- package/lib/Api/Qos/IQosExtraData.d.ts.map +0 -1
- package/lib/Api/Qos/IQosExtraData.js +0 -2
- package/lib/Api/Qos/IQosStartEvent.d.ts.map +0 -1
- package/lib/Api/Qos/IQosStartEvent.js +0 -2
- package/lib/Api/Qos/QosLogger.d.ts.map +0 -1
- package/lib/Api/Qos/QosLogger.js +0 -74
- package/lib/Api/Qos/QosMonitor.d.ts.map +0 -1
- package/lib/Api/Qos/QosMonitor.js +0 -304
- package/lib/Api/Qos/QosMonitorShareFailureWithCP.d.ts.map +0 -1
- package/lib/Api/Qos/QosMonitorShareFailureWithCP.js +0 -114
- package/lib/Api/Qos/QosResultType.d.ts.map +0 -1
- package/lib/Api/Qos/QosResultType.js +0 -11
- package/lib/Api/Trace/DefaultTraceHandler.d.ts.map +0 -1
- package/lib/Api/Trace/DefaultTraceHandler.js +0 -30
- package/lib/Api/Trace/ITraceHandler.d.ts.map +0 -1
- package/lib/Api/Trace/ITraceHandler.js +0 -2
- package/lib/Api/Trace/ITraceLogger.d.ts.map +0 -1
- package/lib/Api/Trace/ITraceLogger.js +0 -2
- package/lib/Api/Trace/LogEvent.d.ts.map +0 -1
- package/lib/Api/Trace/LogEvent.js +0 -147
- package/lib/Api/Trace/TraceLogger.d.ts.map +0 -1
- package/lib/Api/Trace/TraceLogger.js +0 -196
- package/lib/Diagnostics.d.ts.map +0 -1
- package/lib/Diagnostics.js +0 -82
- package/lib/DiagnosticsSettingsManager.d.ts.map +0 -1
- package/lib/DiagnosticsSettingsManager.js +0 -62
- package/lib/IDiagnosticsSettings.d.ts.map +0 -1
- package/lib/IDiagnosticsSettings.js +0 -2
- package/lib/common/Killswitches.d.ts.map +0 -1
- package/lib/extraData/DisplayApp.d.ts.map +0 -1
- package/lib/extraData/IDiagnosticContextInfo.d.ts.map +0 -1
- package/lib/extraData/IDiagnosticContextInfo.js +0 -2
- package/lib/extraData/IPageExtraData.d.ts.map +0 -1
- package/lib/extraData/IPageExtraData.js +0 -2
- package/lib/extraData/PageType.d.ts.map +0 -1
- package/lib/extraData/PromotedState.d.ts.map +0 -1
- package/lib/extraData/PromotedState.js +0 -17
- package/lib/extraData/WebTemplateId.d.ts.map +0 -1
- package/lib/extraData/setPageExtraData.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- /package/{lib → lib-dts}/Api/Engagement/EngagementLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ExecutionQueue.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogEntry.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogErrorData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogSource.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogVerboseData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Log/LogHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogEntry.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogFeature.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogLevel.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogManager/CircularBuffer.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogManager/LogManager.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogSource.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogType.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/AutoAlertableQosMonitor.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQos.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosEndEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosStartEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosMonitor.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosMonitorShareFailureWithCP.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosResultType.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/DefaultTraceHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/ITraceHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/ITraceLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/LogEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/TraceLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Diagnostics.d.ts +0 -0
- /package/{lib → lib-dts}/DiagnosticsSettingsManager.d.ts +0 -0
- /package/{lib → lib-dts}/IDiagnosticsSettings.d.ts +0 -0
- /package/{lib → lib-dts}/common/Killswitches.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/DisplayApp.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/IDiagnosticContextInfo.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/IPageExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/PageType.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/PromotedState.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/WebTemplateId.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/setPageExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-esm}/sp-diagnostics.manifest.json +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "78359e4b-07c2-43c6-8d0b-d060b4d577e8",
|
|
4
4
|
"alias": "SPDiagnostics",
|
|
5
5
|
"componentType": "Library",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.24.0",
|
|
7
7
|
"loaderConfig": {
|
|
8
8
|
"internalModuleBaseUrls": [
|
|
9
9
|
"https://localhost:4321/dist/"
|
|
@@ -13,29 +13,24 @@
|
|
|
13
13
|
"sp-diagnostics": {
|
|
14
14
|
"type": "path",
|
|
15
15
|
"path": {
|
|
16
|
-
"path": "sp-
|
|
17
|
-
"integrity": "sha256-
|
|
16
|
+
"path": "sp-diagnostics_none_1b5b73722b91f3231f63.js",
|
|
17
|
+
"integrity": "sha256-l1uPPjqYLEKJ4FhvttvFH2ML4/7aoIFOgal3Ix8ZvrE="
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"@microsoft/sp-core-library": {
|
|
21
21
|
"type": "component",
|
|
22
22
|
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
|
|
23
|
-
"version": "1.
|
|
23
|
+
"version": "1.24.0"
|
|
24
24
|
},
|
|
25
25
|
"@microsoft/sp-lodash-subset": {
|
|
26
26
|
"type": "component",
|
|
27
27
|
"id": "73e1dc6c-8441-42cc-ad47-4bd3659f8a3a",
|
|
28
|
-
"version": "1.
|
|
28
|
+
"version": "1.24.0"
|
|
29
29
|
},
|
|
30
30
|
"@msinternal/odsp-core-bundle": {
|
|
31
31
|
"type": "component",
|
|
32
32
|
"id": "2e09fb9b-13bb-48f2-859f-97d6fff71176",
|
|
33
|
-
"version": "1.5.
|
|
34
|
-
},
|
|
35
|
-
"tslib": {
|
|
36
|
-
"type": "component",
|
|
37
|
-
"id": "01c4df03-e775-48cb-aa14-171ee5199a15",
|
|
38
|
-
"version": "2.3.1"
|
|
33
|
+
"version": "1.5.166"
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
36
|
}
|
|
@@ -157,6 +157,26 @@ declare interface IQosEndSchema {
|
|
|
157
157
|
/* Excluded from this release type: _LogType */
|
|
158
158
|
|
|
159
159
|
declare const ObjectTypes: {
|
|
160
|
+
readonly word: 1;
|
|
161
|
+
readonly excel: 1;
|
|
162
|
+
readonly powerpoint: 1;
|
|
163
|
+
readonly pdf: 1;
|
|
164
|
+
readonly markdown: 1;
|
|
165
|
+
readonly html: 1;
|
|
166
|
+
readonly json: 1;
|
|
167
|
+
readonly csv: 1;
|
|
168
|
+
readonly text: 1;
|
|
169
|
+
readonly code: 1;
|
|
170
|
+
readonly listData: 1;
|
|
171
|
+
readonly itemAction: 1;
|
|
172
|
+
readonly sharing: 1;
|
|
173
|
+
readonly prefetch: 1;
|
|
174
|
+
readonly auth: 1;
|
|
175
|
+
readonly search: 1;
|
|
176
|
+
readonly media: 1;
|
|
177
|
+
readonly metadata: 1;
|
|
178
|
+
readonly embedded: 1;
|
|
179
|
+
readonly other: 1;
|
|
160
180
|
readonly NPSRating1: 1;
|
|
161
181
|
readonly NPSRating2: 1;
|
|
162
182
|
readonly NPSRating3: 1;
|
|
@@ -157,6 +157,26 @@ declare interface IQosEndSchema {
|
|
|
157
157
|
/* Excluded from this release type: _LogType */
|
|
158
158
|
|
|
159
159
|
declare const ObjectTypes: {
|
|
160
|
+
readonly word: 1;
|
|
161
|
+
readonly excel: 1;
|
|
162
|
+
readonly powerpoint: 1;
|
|
163
|
+
readonly pdf: 1;
|
|
164
|
+
readonly markdown: 1;
|
|
165
|
+
readonly html: 1;
|
|
166
|
+
readonly json: 1;
|
|
167
|
+
readonly csv: 1;
|
|
168
|
+
readonly text: 1;
|
|
169
|
+
readonly code: 1;
|
|
170
|
+
readonly listData: 1;
|
|
171
|
+
readonly itemAction: 1;
|
|
172
|
+
readonly sharing: 1;
|
|
173
|
+
readonly prefetch: 1;
|
|
174
|
+
readonly auth: 1;
|
|
175
|
+
readonly search: 1;
|
|
176
|
+
readonly media: 1;
|
|
177
|
+
readonly metadata: 1;
|
|
178
|
+
readonly embedded: 1;
|
|
179
|
+
readonly other: 1;
|
|
160
180
|
readonly NPSRating1: 1;
|
|
161
181
|
readonly NPSRating2: 1;
|
|
162
182
|
readonly NPSRating3: 1;
|
package/dist/index-internal.d.ts
CHANGED
|
@@ -157,6 +157,26 @@ declare interface IQosEndSchema {
|
|
|
157
157
|
/* Excluded from this release type: _LogType */
|
|
158
158
|
|
|
159
159
|
declare const ObjectTypes: {
|
|
160
|
+
readonly word: 1;
|
|
161
|
+
readonly excel: 1;
|
|
162
|
+
readonly powerpoint: 1;
|
|
163
|
+
readonly pdf: 1;
|
|
164
|
+
readonly markdown: 1;
|
|
165
|
+
readonly html: 1;
|
|
166
|
+
readonly json: 1;
|
|
167
|
+
readonly csv: 1;
|
|
168
|
+
readonly text: 1;
|
|
169
|
+
readonly code: 1;
|
|
170
|
+
readonly listData: 1;
|
|
171
|
+
readonly itemAction: 1;
|
|
172
|
+
readonly sharing: 1;
|
|
173
|
+
readonly prefetch: 1;
|
|
174
|
+
readonly auth: 1;
|
|
175
|
+
readonly search: 1;
|
|
176
|
+
readonly media: 1;
|
|
177
|
+
readonly metadata: 1;
|
|
178
|
+
readonly embedded: 1;
|
|
179
|
+
readonly other: 1;
|
|
160
180
|
readonly NPSRating1: 1;
|
|
161
181
|
readonly NPSRating2: 1;
|
|
162
182
|
readonly NPSRating3: 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
define("78359e4b-07c2-43c6-8d0b-d060b4d577e8_1.24.0",["@microsoft/sp-core-library","@microsoft/sp-lodash-subset","@msinternal/odsp-core-bundle"],(a,b,c)=>(()=>{"use strict";var d={676(b){b.exports=a},529(a){a.exports=b},277(a){a.exports=c}},e={};function f(a){var b=e[a];if(void 0!==b)return b.exports;var c=e[a]={exports:{}};return d[a](c,c.exports,f),c.exports}f.d=(a,b)=>{for(var c in b)f.o(b,c)&&!f.o(a,c)&&Object.defineProperty(a,c,{enumerable:!0,get:b[c]})},f.o=(a,b)=>Object.prototype.hasOwnProperty.call(a,b),f.r=a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var g={};return(()=>{f.r(g),f.d(g,{_AutoAlertableMonitorType:()=>F,_AutoAlertableQosMonitor:()=>G,_CircularBuffer:()=>n,_Diagnostics:()=>w,_EngagementLogger:()=>x,_ExecutionQueue:()=>B,_LogEntry:()=>t,_LogEvent:()=>p,_LogFeature:()=>r,_LogHandler:()=>y,_LogLevel:()=>e,_LogManager:()=>o,_LogSource:()=>l,_LogType:()=>s,_PageType:()=>j,_PromotedState:()=>i,_QosLogger:()=>C,_QosMonitor:()=>E,_QosMonitorShareFailureWithCP:()=>H,_QosResultType:()=>A,_TraceLogger:()=>q,_logSourceServiceKey:()=>m});var a,b,c,d,e,h,i,j,k=f(676);class l{static create(a){return new l(a)}get id(){return this._id}isEmpty(){return 0===this._id.length}constructor(a){k.Validate.isNotNullOrUndefined(a,"id"),this._id=a}}let m=k.ServiceKey.createCustom("sp-client-base:LogSource",a=>l.create(""));class n{get count(){return this._count}push(a){this._ensureNotIterating(),this._head++,this._count++,this._head===this._size&&(this._head=0),this._buffer[this._head]=a}forEach(a){if(0!==this._count){this._isIterating=!0;try{let b=this._tail;for(let c=0;c<this._size&&(a(this._buffer[b]),b!==this._head);c++)b=this._getNext(b)}finally{this._isIterating=!1}}}removeAll(){this._ensureNotIterating(),this._head=-1,this._count=0}get _tail(){return this._isNotWrapped()?0:this._getNext(this._head)}_isNotWrapped(){return this._count===this._head+1}_getNext(a){let b=a+1;return b===this._size&&(b=0),b}_ensureNotIterating(){if(this._isIterating)throw Error("Circular buffer cannot be modified during iteration")}constructor(a){if(this._head=-1,this._count=0,this._isIterating=!1,a<=0)throw Error("Size must be positive");this._size=a,this._buffer=Array(a)}}class o{static get _maxVerboseLog(){return 5e3}get events(){return this._events}addHandler(a){this._containsHandler(a)||(this._handlers.push(a),this._shouldLogInRealTime.push(!1))}log(a){Object.freeze(a),this._events.push(a),this._processLogEvent(a)}removeHandler(a){let b=this._handlers.indexOf(a);b>-1&&(this._handlers.splice(b,1),this._shouldLogInRealTime.splice(b,1))}reset(){this._handlers=[],this._shouldLogInRealTime=[],this._events.removeAll()}processAll(a){this._handlers.indexOf(a)>-1&&this._processAllEvents(a)}_containsHandler(a){for(let b of this._handlers)if(b===a)return!0;return!1}_processAllEvents(a){this._events.forEach(b=>{if(b)try{a(b)}catch(a){console.error("failed to handle event:"+a.toString())}}),this._shouldLogInRealTime[this._handlers.indexOf(a)]=!0}_processLogEvent(a){for(let b=0;b<this._handlers.length;b++)if(this._shouldLogInRealTime[b]&&a)try{this._handlers[b](a)}catch(a){console.error("failed to handle event:"+a.toString())}}constructor(a){this._shouldLogInRealTime=[],this._handlers=[],this._events=new n(o._maxVerboseLog),a&&this.addHandler(a)}}class p{static log(a,b,c,d){let e=new p(a,b,c,d);return p.logManager.log(e),e}toString(){let a=`[${this._timestamp}][${this._prefix}]`;return this._message?`${a} ${this._message}`:this._error?`${a} ${this._error.toString()}`:a}get timestamp(){return this._timestamp}get level(){return this._level}get prefix(){return this._prefix}get scope(){return this._scope}get source(){return this._source}get message(){return this._message}get error(){return this._error}get _maxSourceLength(){return 30}get _maxMessageLength(){return 150}_validate(a,b){if(!a)throw Error("source cannot be undefined or null for Logger");if(!b)throw Error("data cannot be undefined or null")}_setData(a){"string"==typeof a?this._message=a.substr(0,this._maxMessageLength):a instanceof Error&&(this._error=a)}_getPrefix(){let a=`${this._source}`;return this._scope&&!this._scope.isEmpty()&&(a=`${this._scope.id.substr(0,this._maxSourceLength)}.${a}`),`${a}`}_getScope(a){let b;return a&&a.whenFinished(()=>{b=a.consume(m)}),b}constructor(a,b,c,d){this._validate(a,b),this._timestamp=new Date().getTime(),this._scope=this._getScope(d),this._source=a.substr(0,this._maxSourceLength),this._setData(b),this._level=c,this._prefix=this._getPrefix()}}p.logManager=new o,(a=e||(e={}))[a.Verbose=1]="Verbose",a[a.Info=2]="Info",a[a.Warning=3]="Warning",a[a.Error=4]="Error";class q{static _addHandler(a){q._logManager.addHandler(a.log),q._logManager.processAll(a.log),q._verboseLogManager.addHandler(a.verbose),q._verboseLogManager.processAll(a.verbose)}static logError(a,b,c,d){k.Validate.isNotNullOrUndefined(b,"error"),this._log(a,b,c,!0,d)}static logErrorData(a){k.Validate.isNotNullOrUndefined(a.error,"error");let b=a.logEntry?a.logEntry.toString():a.error;this._log(a.source,b,a.eventName,!0,a.resultCode,a.serviceScope)}static logVerbose(a,b,c){k.Validate.isNonemptyString(b,"message"),this._log(a,b,c,!1,void 0)}static logVerboseData(a){let b=a.logEntry?a.logEntry.toString():a.message;this._log(a.source,b,a.eventName,!1,void 0,a.serviceScope)}static logErrorWithLogEntry(a,b,c,d){k.Validate.isNotNullOrUndefined(a,"source"),k.Validate.isNotNullOrUndefined(b,"logEntry"),this._log(a,b.toString(),c,!0,d)}static get shouldWriteToConsole(){return q._shouldWriteToConsole}static set shouldWriteToConsole(a){q._shouldWriteToConsole&&!a?(q._logManager.removeHandler(q._defaultLogger.log),q._verboseLogManager.removeHandler(q._defaultLogger.verbose)):!q._shouldWriteToConsole&&a&&(q._logManager.addHandler(q._defaultLogger.log),q._verboseLogManager.addHandler(q._defaultLogger.verbose)),q._shouldWriteToConsole=a}static logVerboseWithLogEntry(a,b,c){k.Validate.isNotNullOrUndefined(b,"LogEntry"),this._log(a,b.toString(),c,!1,void 0)}static _log(a,b,c,d,f,g){let h,i=this._addEventPrefix(a,c);d?(h=p.log(i,b,e.Error,g),q._logManager.log({data:b,eventName:h.prefix,resultCode:f})):(h=p.log(i,b.toString(),e.Verbose,g),q._verboseLogManager.log({data:b,eventName:h.prefix})),q.shouldWriteToConsole&&this._writeToConsole(h,d,f)}static _addEventPrefix(a,b){return b?`${a.id}.${b}`:a.id}static _writeToConsole(a,b,c){let d=a.toString();c&&(d+=`. resultCode: ${c}`),b?console.error(d):console.log(d)}}q._logManager=new o,q._verboseLogManager=new o,q._defaultLogger=new class{log(a){console.log(`Error: ${a.data}, Event Name: ${a.eventName}, Result Code: ${a.resultCode}`)}verbose(a){console.log(`Error: ${a.data}, Event Name: ${a.eventName}`)}},q._shouldWriteToConsole=!1;class r{}r.None="None",(b=h||(h={}))[b.Trace=1]="Trace",b[b.Event=2]="Event",b[b.Error=3]="Error";let s=h,t=class{toString(){let a;if(this.logProperties)try{a=JSON.stringify(this.logProperties)}catch(a){console.log("Error happens in toString():"+a)}return`${this.moduleName} | ${this.logFeature} | ${this.logType} | ${a}`}constructor(a,b=r.None,c=s.Trace,d,e){if(a)this.moduleName=a,this.logFeature=b,this.logType=c,this.logProperties=d,this.isIntentional=e;else throw Error("moduleName is invalid")}};var u=f(529);class v{static initialize(a){this.settings=(0,u.cloneDeep)(a),this._initialized=!0,this._normalizeContextIds()}static updateSettings(a){this.settings=(0,u.merge)(this.settings,a),this._normalizeContextIds()}static clearSettings(a){a.diagnosticSettings&&a.diagnosticSettings.forEach(a=>{delete this.settings[a]}),a.extraDiagnosticInfo&&a.extraDiagnosticInfo.forEach(a=>{this.settings.extraDiagnosticInfo&&this.settings.extraDiagnosticInfo[a]&&delete this.settings.extraDiagnosticInfo[a]})}static get isInitialized(){return this._initialized}static _normalizeId(a){let b=k.Guid.tryParse(a);return b?.toString()||a}static _normalizeContextIds(){this.settings.siteId=this._normalizeId(this.settings.siteId),this.settings.webId=this._normalizeId(this.settings.webId),this.settings.correlationId=this._normalizeId(this.settings.correlationId),this.settings.listId&&(this.settings.listId=this._normalizeId(this.settings.listId),this.settings.listItemUniqueId&&(this.settings.listItemUniqueId=this._normalizeId(this.settings.listItemUniqueId)))}}v._initialized=!1;class w{static initialize(a){w._isInitialized||(v.initialize(a),q.shouldWriteToConsole=a.enableConsoleLog,q._addHandler({log:a=>{k.Log.info(a.eventName,`EventName:${a.data.toString()}, ResultCode: ${a.resultCode}`)},verbose:a=>{k.Log.verbose(a.eventName,a.data.toString())}}),w._isInitialized=!0)}static get isInitialized(){return this._isInitialized}static updateSettings(a){v.updateSettings(a)}static getAuthoringSessionClientCountInfo(){return v.settings?.extraDiagnosticInfo?.authoringSessionClientCount}static _getExtraDiagnosticInfo(){return v.settings?.extraDiagnosticInfo}static clearSettings(a){v.clearSettings(a)}}w._isInitialized=!1,(c=i||(i={}))[c.NotPromoted=0]="NotPromoted",c[c.Promoted=2]="Promoted",(d=j||(j={})).News="News",d.Article="Article",d.Home="Home",d.Space="Space",d.NewsDigest="NewsDigest";class x{static _addHandler(a){x._handler=b=>{a.logData(b)},x._logManager.addHandler(x._handler)}static startRealTimeProcessing(){this._shouldProcessInRealTime||(x._logManager.processAll(x._handler),this._shouldProcessInRealTime=!0)}static log(a){x._logEngagementData(a)}static logEvent(a,b){let c={name:a};b&&0!==b.length&&(c.extraData={action:b}),x._logEngagementData(c)}static logEventWithLogEntry(a){let b={isIntentional:a.isIntentional,name:a.moduleName+"."+a.logFeature,extraData:a.logProperties};x._logEngagementData(b,!0)}static _logEngagementData(a,b=!1){if(!a.name||0===a.name.length)throw Error("LogEntry is invalid");x._checkValidTagName(a,b),x._addContextData(a),x._appendExtraData(a),x._logManager.log(a)}static _checkValidTagName(a,b=!1){if(!b&&!1===/(\w+)\.(\w+).(\w+)/gi.test(a.name))throw Error(`${a.name} tagName does not follow AppName.ControlName.ActionName pattern`)}static _addContextData(a){if(v.isInitialized){let{listId:b,listItemUniqueId:c,siteId:d,webId:e}=v.settings;a.siteId=d,a.webId=e,b&&(a.listId=b,c&&(a.docId=c))}}static _appendExtraData(a){if(v.isInitialized){let{settings:{contextInfo:c}}=v;if(c){var b;let d,e,f,g,h;a.extraData||(a.extraData={}),(b=a.extraData).pageId=c.pageId,b.isHub=c.isHubSite,c.isHubSite?(b.hubSiteId=c.hubSiteId,b.isAssociatedSite=!1):!c.isHubSite&&c.hubSiteId?b.isAssociatedSite=!0:b.isAssociatedSite=!1,!b.displayApp&&(k._BrowserUtilities.isTeamsHosted()?(b.displayApp="Teams",c.isEduClass&&(b.isEduClass=!0)):b.displayApp="Sharepoint"),b.userAgent=navigator.userAgent,b.webTemplate=e=c.webTemplate,"1"===e?d="TeamSite":"64"===e?d="GroupSite":"68"===e?d="CommunicationSite":"21"===e&&(d="MySite"),f=c.promotedState,h=g=c.pageType,g===j.Article&&(h=f===i.NotPromoted||void 0===f?j.Article:j.News),b.siteType=d,b.pageType=h,b.isDebug=!!k._BrowserUtilities.safelyAccessSessionStorage("spfx-debug"),b.hasCopilotLicense=!!c.hasCopilotLicense}}}}x._logManager=new o;class y{verbose(a,b,c){p.log(a,b,e.Verbose,c)}info(a,b,c){p.log(a,b,e.Info,c)}warn(a,b,c){p.log(a,b,e.Warning,c)}error(a,b,c){p.log(a,b,e.Error,c)}}var z=f(277);let A={Success:0,Failure:1,ExpectedFailure:2};class B{get shouldExecuteInRealTime(){return this._shouldExecuteInRealTime}set shouldExecuteInRealTime(a){this._shouldExecuteInRealTime=a,this._shouldExecuteInRealTime&&this.flush()}addHandler(a,b){if(this._containsHandler(a,b))return;this._initializeHandlerArrayForKey(a);let c=this._handlers[a];-1===c.indexOf(b)&&c.push(b)}addExecutionEntry(a,...b){Object.freeze(b),this._shouldExecuteInRealTime?this._processExecutionEntry(a,b):this._executionEntries.push({key:a,args:b})}removeHandler(a,b){let c=this._handlers[a].indexOf(b);c>-1&&this._handlers[a].splice(c,1)}reset(){this._handlers={},this._executionEntries=[]}flush(){this._processAllExecutionEntries(),this._executionEntries=[]}_containsHandler(a,b){return null!==this._handlers[a]&&void 0!==this._handlers[a]&&this._handlers[a].indexOf(b)>-1}_initializeHandlerArrayForKey(a){(null===this._handlers[a]||void 0===this._handlers[a])&&(this._handlers[a]=[])}_processAllExecutionEntries(){for(let a of this._executionEntries)if(a&&this._handlers[a.key])try{for(let b of this._handlers[a.key])b.apply(this,a.args)}catch(a){console.error("failed to process execution entry:"+a.toString())}}_processExecutionEntry(a,b){for(let c=0;c<this._handlers[a].length;c++)try{this._handlers[a][c].apply(this,b)}catch(a){console.error("failed to process execution entry:"+a.toString())}}constructor(){this._shouldExecuteInRealTime=!1,this._handlers={},this._executionEntries=[]}}class C{static get instance(){return this._instance||(this._instance=new C),this._instance}get shouldProcessInRealTime(){return this._shouldProcessInRealTime}set shouldProcessInRealTime(a){this._shouldProcessInRealTime=a,this._deferExecutor.shouldExecuteInRealTime=a}setLogger(a){this._qosLogger=a}getQosEvent(a){return this._qosEvents.get(a)}startQosMonitor(a,b){this._qosEvents.has(a)||this._deferExecutor.addExecutionEntry("start",a,b)}writeQosEndResult(a,b){this._deferExecutor.addExecutionEntry("end",a,b)}_startMonitor(a,b){this._qosLogger&&this._qosEvents.set(a,new this._qosLogger(b))}_endMonitor(a,b){let c=this._qosEvents.get(a);c&&(c.end(b),this._qosEvents.delete(a))}_initializeLogger(){let a=(a,b)=>{this._startMonitor(a,b)},b=(a,b)=>{this._endMonitor(a,b)};this._deferExecutor.addHandler("start",a),this._deferExecutor.addHandler("end",b)}constructor(){this._qosEvents=new Map,this._deferExecutor=new B,this._shouldProcessInRealTime=!1,this._initializeLogger()}}let D={id:"QosMonitor"};class E{static startRealTimeProcessing(){C.instance.shouldProcessInRealTime||this._shouldProcessInRealTime(!0)}static _shouldProcessInRealTime(a){C.instance.shouldProcessInRealTime=a}get name(){return this._scenarioName}get shortEventName(){return"Qos"}get resultCode(){return this._endResultCode}get resultType(){return this._endResult}get extraData(){return this._endExtraData}set extraData(a){this._endExtraData=a}get hasEnded(){return this._hasEnded}writeSuccess(a){this._writeQosEnd(A.Success,void 0,void 0,a)}writeUnexpectedFailure(a="DefaultUnexpected",b,c){this._writeQosEnd(A.Failure,a,b,c)}writeExpectedFailure(a="DefaultExpected",b,c){this._writeQosEnd(A.ExpectedFailure,a,b,c)}_writeQosEnd(a,b,c,d){if(this._shouldSkip(a))return;this._ensureCorrelationId(a,d),this._endResultCode=b,this._endResult=a;let e=c?(0,z.getErrorMessage)(c):void 0;if(c instanceof z.CustomError){let a=(0,z.getQosEndSchemaFromError)(c);a&&(a.resultType=this._endResult,a.extraData=(0,u.merge)({},this._endExtraData,a.extraData)),C.instance.writeQosEndResult(this._id,a)}else{let a={resultCode:this._endResultCode,resultType:this._endResult,error:e,extraData:this._endExtraData};C.instance.writeQosEndResult(this._id,a)}this._writeToEngagement()}_ensureCorrelationId(a,b){if(b&&(this._ensureEndExtraData(),Object.keys(b).forEach(a=>this._endExtraData[a]=b[a])),v.isInitialized&&a!==A.Success){let a="CorrelationId",b=this._endExtraData&&(this._endExtraData[a]||this._endExtraData.correlationId)||v.settings.correlationId;b&&(this._endExtraData||(this._endExtraData={}),this._endExtraData[a]=b)}this._logHostType(),this._ensureAuthoringSessionId()}_ensureEndExtraData(){this._endExtraData||(this._endExtraData={})}_logHostType(){if(v.isInitialized){let a=k._BrowserUtilities.getTeamsAppType();if(a){this._ensureEndExtraData();let b="appHostType";this._endExtraData[b]||(this._endExtraData[b]=a)}}}_isDebugSession(){try{if(!k._SPKillSwitch.isActivated("761ccb86-4fa0-4f56-a05b-477bcc09bd9f"))return!1;return!!k._BrowserUtilities.safelyAccessSessionStorage("spfx-debug")}catch{return!1}}_shouldSkip(a){if(!this._hasEnded||void 0===this._endResult)return this._hasEnded=!0,this._isDebugSession();{let b=k.Text.format("QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.",this.name,this._qosResultTypeValue[this._endResult],this._qosResultTypeValue[a]);return this._endResult!==a&&q.logError(D,Error(b)),!0}}_writeToEngagement(){if(this._copyToInterana&&x.log({name:this.name,isIntentional:!!(this.extraData||{}).isIntentional,extraData:this.extraData||{}}),this._copyToCosmos){let a={name:"Spfx.Qos.ToEngagement",extraData:this.extraData||{}};a.extraData.qosName=this.name,this.resultType&&(a.extraData.qosResultType=this._qosResultTypeValue[this.resultType]),this.resultCode&&(a.extraData.qosResultCode=this.resultCode),x.log(a)}}constructor(a,b=!1,c=!1){this._qosResultTypeValue={[A.Success]:"Success",[A.Failure]:"Failure",[A.ExpectedFailure]:"ExpectedFailure"},this._ensureAuthoringSessionId=()=>{let a=v.settings?.extraDiagnosticInfo?.authoringSessionId;if(a){this._ensureEndExtraData(),this._endExtraData.AuthoringSessionId=a;let b=v.settings?.extraDiagnosticInfo?.authoringOpSequenceId;b&&(this._endExtraData.AuthoringOpSequenceId=b);let c=w.getAuthoringSessionClientCountInfo();c&&this._endExtraData&&(this._endExtraData.AuthoringSessionClientCount=c)}},k.Validate.isNonemptyString(a,"scenarioName"),this._id=k.Guid.newGuid().toString(),this._isDebugSession()||C.instance.startQosMonitor(this._id,{name:a}),this._scenarioName=a,this._hasEnded=!1,this._copyToCosmos=b,this._copyToInterana=c}}let F={StaticReliabilityQos95Sev4:"StaticReliabilityQos95Sev4",DynamicReliabilityQosMediumSev4:"DynamicReliabilityQosMediumSev4",DynamicReliabilityExpectedFailureHighSev4:"DynamicReliabilityExpectedFailureHighSev4"};class G extends E{writeSuccess(a){super.writeSuccess(this._getExtraDataWithAutoAlertableFields(a))}writeUnexpectedFailure(a="DefaultUnexpected",b,c){super.writeUnexpectedFailure(a,b,this._getExtraDataWithAutoAlertableFields(c))}writeExpectedFailure(a="DefaultExpected",b,c){super.writeExpectedFailure(a,b,this._getExtraDataWithAutoAlertableFields(c))}_getExtraDataWithAutoAlertableFields(a){let b=a??{};return b.autoAlertableMonitorType=F[this._autoAlertableMonitorType],b}constructor(a,b,c=!1){super(a,!1,c),this._autoAlertableMonitorType=b}}class H extends E{writeUnexpectedFailure(a="DefaultUnexpected",b,c){super.writeUnexpectedFailure(a,b,c),this._logCustomerPromiseFailure(b?.message||"DefaultErrorMessage",a,A.Failure,c)}writeExpectedFailure(a="DefaultExpected",b,c,d=!1){super.writeExpectedFailure(a,b,c),d||this._logCustomerPromiseFailure(b?.message||"DefaultErrorMessage",a,A.ExpectedFailure,c)}_logCustomerPromiseFailure(a,b,c=A.Failure,d){this._extraDataForCustomerPromise&&this._extraDataForCustomerPromise.forEach(e=>{let f,{logFailure:g,veto:h}=e,i={errorCode:e.errorModuleName+((f=w._getExtraDiagnosticInfo())&&f.hasAuthoringStarted?f.authoringSessionClientCount?f.authoringSessionClientCount>1?" with Multiple Users":"":f.isAuthoringUsingDDS?" in Legacy Authoring (DDS)":" in Legacy Authoring (no DDS)":"")+(k._SPKillSwitch.isActivated("c125685f-83e7-44c8-b602-5c21f5b748ae")||window.navigator.onLine?"":" (offline)"),errorScenario:b,errorMessage:a,resultType:c,pageType:d?.pageType,errorStack:d?.errorStack,veto:h};g(i)})}constructor(a,b=!1,c,d=!1){super(a,d,b),this._extraDataForCustomerPromise=c}}})(),g})());
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -1,102 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* use *.Click for all the actions triggered by mouse, keyboard, or touch.
|
|
10
|
-
* if you want to add more data or the action is not click but keydown.
|
|
11
|
-
* Use extraData to log the type of action or use extraData to log details wrapped in LogEntry
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
var EngagementLogger = /** @class */ (function () {
|
|
15
|
-
function EngagementLogger() {
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return EngagementLogger;
|
|
16
9
|
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _LogManager = /*#__PURE__*/ _interop_require_default._(require("../LogManager/LogManager"));
|
|
13
|
+
const _DiagnosticsSettingsManager = /*#__PURE__*/ _interop_require_default._(require("../../DiagnosticsSettingsManager"));
|
|
14
|
+
const _setPageExtraData = require("../../extraData/setPageExtraData");
|
|
15
|
+
class EngagementLogger {
|
|
17
16
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
EngagementLogger._handler = function (e) {
|
|
17
|
+
* Init function for the passed logger object
|
|
18
|
+
*/ static _addHandler(logger) {
|
|
19
|
+
EngagementLogger._handler = (e)=>{
|
|
22
20
|
logger.logData(e);
|
|
23
21
|
};
|
|
24
22
|
EngagementLogger._logManager.addHandler(EngagementLogger._handler);
|
|
25
|
-
}
|
|
23
|
+
}
|
|
26
24
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
EngagementLogger.startRealTimeProcessing = function () {
|
|
25
|
+
* Starts processing logs in real time
|
|
26
|
+
*/ static startRealTimeProcessing() {
|
|
30
27
|
if (!this._shouldProcessInRealTime) {
|
|
31
28
|
EngagementLogger._logManager.processAll(EngagementLogger._handler);
|
|
32
29
|
this._shouldProcessInRealTime = true;
|
|
33
30
|
}
|
|
34
|
-
}
|
|
31
|
+
}
|
|
35
32
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
EngagementLogger.log = function (engagementData) {
|
|
33
|
+
* Engagement logging
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
|
|
37
|
+
* tagName follows `<Workload>.controlName.actionName` pattern
|
|
38
|
+
* For example, `{ name = "AddButton.Click" }`,
|
|
39
|
+
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
|
|
40
|
+
* `<Workload>` is set in Telemetry settings
|
|
41
|
+
* `IEngagementData` interface is mapped to a set of enums for standardization of mapping.
|
|
42
|
+
* Add new items to enum in order to register a new item specification.
|
|
43
|
+
* SiteType is defined in SiteType enum
|
|
44
|
+
* CurrentPage is defined in CurrentPage enum
|
|
45
|
+
* Component is defined in Component enum
|
|
46
|
+
* Feature is defined in Feature enum.
|
|
47
|
+
*/ static log(engagementData) {
|
|
52
48
|
EngagementLogger._logEngagementData(engagementData);
|
|
53
|
-
}
|
|
49
|
+
}
|
|
54
50
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
* Engagement logging
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
|
|
55
|
+
* tagName follows `<Workload>.controlName.actionName` pattern
|
|
56
|
+
* For example, `tagName = "AddButton.Click"`,
|
|
57
|
+
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
|
|
58
|
+
* `<Workload>` is set in Telemetry settings
|
|
59
|
+
* Use extraData to log the type of action.
|
|
60
|
+
* For example, `actionName = "Keydown"` and `tagName = "ModernPublish.AddButton.Click"`
|
|
61
|
+
* this logs `"<Workload>.AddButton.Click"` with the extraData that it was selected using the Keydown
|
|
62
|
+
*/ static logEvent(tagName, actionName) {
|
|
63
|
+
const logData = {
|
|
64
|
+
name: tagName
|
|
65
|
+
};
|
|
69
66
|
if (actionName && actionName.length !== 0) {
|
|
70
|
-
logData.extraData = {
|
|
67
|
+
logData.extraData = {
|
|
68
|
+
action: actionName
|
|
69
|
+
};
|
|
71
70
|
}
|
|
72
71
|
EngagementLogger._logEngagementData(logData);
|
|
73
|
-
}
|
|
72
|
+
}
|
|
74
73
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var logData = {
|
|
74
|
+
* Engagement logging with LogEntry
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Here is an example:
|
|
78
|
+
* ```
|
|
79
|
+
* {"EngagementName":"SPPage.NavigationAction.SPPageQuickLaunchUpdate"`,
|
|
80
|
+
* "Properties":"{\"message\":\"[NavigationAction] | SPPageQuickLaunchUpdate | 2 | null\"}",
|
|
81
|
+
* "Duration":0,"LogType":0,
|
|
82
|
+
* "ClientTime":1459357627444,"Source":"ClientV2Engagement"}
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* NavigationAction is moduleName in LogEntry, SPPageQuickLaunchUpdate is log feature name
|
|
86
|
+
* In this example, SPPage is workload name which is set in Telemetry settings.
|
|
87
|
+
* Do NOT add PII data!
|
|
88
|
+
*/ static logEventWithLogEntry(logEntry) {
|
|
89
|
+
const logData = {
|
|
92
90
|
isIntentional: logEntry.isIntentional,
|
|
93
91
|
name: logEntry.moduleName + '.' + logEntry.logFeature,
|
|
94
92
|
extraData: logEntry.logProperties
|
|
95
93
|
};
|
|
96
94
|
EngagementLogger._logEngagementData(logData, true);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (isLogEntry === void 0) { isLogEntry = false; }
|
|
95
|
+
}
|
|
96
|
+
static _logEngagementData(engagementData, isLogEntry = false) {
|
|
100
97
|
if (!engagementData.name || engagementData.name.length === 0) {
|
|
101
98
|
throw new Error('LogEntry is invalid');
|
|
102
99
|
}
|
|
@@ -104,20 +101,19 @@ var EngagementLogger = /** @class */ (function () {
|
|
|
104
101
|
EngagementLogger._addContextData(engagementData);
|
|
105
102
|
EngagementLogger._appendExtraData(engagementData);
|
|
106
103
|
EngagementLogger._logManager.log(engagementData);
|
|
107
|
-
}
|
|
104
|
+
}
|
|
108
105
|
// tagName should follow AppName.ControlName.ActionName pattern
|
|
109
|
-
|
|
110
|
-
if (isLogEntry === void 0) { isLogEntry = false; }
|
|
106
|
+
static _checkValidTagName(engagementData, isLogEntry = false) {
|
|
111
107
|
if (!isLogEntry) {
|
|
112
|
-
|
|
108
|
+
const tagNameRegex = /(\w+)\.(\w+).(\w+)/gi;
|
|
113
109
|
if (tagNameRegex.test(engagementData.name) === false) {
|
|
114
|
-
throw new Error(
|
|
110
|
+
throw new Error(`${engagementData.name} tagName does not follow AppName.ControlName.ActionName pattern`);
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
113
|
+
}
|
|
114
|
+
static _addContextData(data) {
|
|
115
|
+
if (_DiagnosticsSettingsManager.default.isInitialized) {
|
|
116
|
+
const { listId, listItemUniqueId, siteId, webId } = _DiagnosticsSettingsManager.default.settings;
|
|
121
117
|
data.siteId = siteId;
|
|
122
118
|
data.webId = webId;
|
|
123
119
|
if (listId) {
|
|
@@ -127,20 +123,19 @@ var EngagementLogger = /** @class */ (function () {
|
|
|
127
123
|
}
|
|
128
124
|
}
|
|
129
125
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (
|
|
133
|
-
|
|
126
|
+
}
|
|
127
|
+
static _appendExtraData(data) {
|
|
128
|
+
if (_DiagnosticsSettingsManager.default.isInitialized) {
|
|
129
|
+
const { settings: { contextInfo } } = _DiagnosticsSettingsManager.default;
|
|
134
130
|
if (contextInfo) {
|
|
135
131
|
if (!data.extraData) {
|
|
136
132
|
data.extraData = {};
|
|
137
133
|
}
|
|
138
|
-
(0,
|
|
134
|
+
(0, _setPageExtraData.setPageExtraData)(contextInfo, data.extraData);
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
//# sourceMappingURL=EngagementLogger.js.map
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
EngagementLogger._logManager = new _LogManager.default();
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=./EngagementLogger.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Engagement logger log data interface
|
|
3
|
+
* @internal
|
|
4
|
+
*/ "use strict";
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=./IEngagementHandler.js.map
|
|
@@ -1,133 +1,120 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._shouldExecuteInRealTime = false;
|
|
10
|
-
this._handlers = {};
|
|
11
|
-
this._executionEntries = [];
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return ExecutionQueue;
|
|
12
9
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* Determines if the added execution entries should be processed in real time.
|
|
16
|
-
* If this is set to true, a stack with entries will not be saved.
|
|
17
|
-
*
|
|
18
|
-
* When set to true, all entries on stack will be processed and future entries
|
|
19
|
-
* will be executed in real time.
|
|
20
|
-
* When set to false, future entries will be saved in the execution stack for
|
|
21
|
-
* later processing.
|
|
22
|
-
*/
|
|
23
|
-
get: function () {
|
|
24
|
-
return this._shouldExecuteInRealTime;
|
|
25
|
-
},
|
|
26
|
-
set: function (executeInRealTime) {
|
|
27
|
-
this._shouldExecuteInRealTime = executeInRealTime;
|
|
28
|
-
if (this._shouldExecuteInRealTime) {
|
|
29
|
-
this.flush();
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true
|
|
34
|
-
});
|
|
10
|
+
});
|
|
11
|
+
class ExecutionQueue {
|
|
35
12
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
* Determines if the added execution entries should be processed in real time.
|
|
14
|
+
* If this is set to true, a stack with entries will not be saved.
|
|
15
|
+
*
|
|
16
|
+
* When set to true, all entries on stack will be processed and future entries
|
|
17
|
+
* will be executed in real time.
|
|
18
|
+
* When set to false, future entries will be saved in the execution stack for
|
|
19
|
+
* later processing.
|
|
20
|
+
*/ get shouldExecuteInRealTime() {
|
|
21
|
+
return this._shouldExecuteInRealTime;
|
|
22
|
+
}
|
|
23
|
+
set shouldExecuteInRealTime(executeInRealTime) {
|
|
24
|
+
this._shouldExecuteInRealTime = executeInRealTime;
|
|
25
|
+
if (this._shouldExecuteInRealTime) {
|
|
26
|
+
this.flush();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Registers an external handler to collection for delayed asynchronous processing.
|
|
31
|
+
* Handlers are registered once. If handler is already registered, it does nothing.
|
|
32
|
+
*/ addHandler(key, handler) {
|
|
40
33
|
if (this._containsHandler(key, handler)) {
|
|
41
34
|
return;
|
|
42
35
|
}
|
|
43
36
|
this._initializeHandlerArrayForKey(key);
|
|
44
|
-
|
|
37
|
+
const handlers = this._handlers[key];
|
|
45
38
|
if (handlers.indexOf(handler) === -1) {
|
|
46
39
|
handlers.push(handler);
|
|
47
40
|
}
|
|
48
|
-
}
|
|
41
|
+
}
|
|
49
42
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
ExecutionQueue.prototype.addExecutionEntry = function (key) {
|
|
53
|
-
var args = [];
|
|
54
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
55
|
-
args[_i - 1] = arguments[_i];
|
|
56
|
-
}
|
|
43
|
+
* Execution Entry registration for delayed asynchronous processing.
|
|
44
|
+
*/ addExecutionEntry(key, ...args) {
|
|
57
45
|
Object.freeze(args);
|
|
58
46
|
if (this._shouldExecuteInRealTime) {
|
|
59
47
|
this._processExecutionEntry(key, args);
|
|
48
|
+
} else {
|
|
49
|
+
this._executionEntries.push({
|
|
50
|
+
key: key,
|
|
51
|
+
args: args
|
|
52
|
+
});
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
this._executionEntries.push({ key: key, args: args });
|
|
63
|
-
}
|
|
64
|
-
};
|
|
54
|
+
}
|
|
65
55
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var index = this._handlers[key].indexOf(handler);
|
|
56
|
+
* Removes an external executionEntry handler from collection for asynchronous event logging.
|
|
57
|
+
* Logger is registered once.
|
|
58
|
+
*/ removeHandler(key, handler) {
|
|
59
|
+
const index = this._handlers[key].indexOf(handler);
|
|
71
60
|
if (index > -1) {
|
|
72
61
|
this._handlers[key].splice(index, 1);
|
|
73
62
|
}
|
|
74
|
-
}
|
|
63
|
+
}
|
|
75
64
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
ExecutionQueue.prototype.reset = function () {
|
|
65
|
+
* Reset function clears executionEntry handler collection for asynchronous event logging.
|
|
66
|
+
* All recorded execution entries and handlers are purged.
|
|
67
|
+
*/ reset() {
|
|
80
68
|
this._handlers = {};
|
|
81
69
|
this._executionEntries = [];
|
|
82
|
-
}
|
|
70
|
+
}
|
|
83
71
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
ExecutionQueue.prototype.flush = function () {
|
|
72
|
+
* Flushes all the buffered execution entries.
|
|
73
|
+
* All recorded execution entries are purged.
|
|
74
|
+
*/ flush() {
|
|
88
75
|
this._processAllExecutionEntries();
|
|
89
76
|
this._executionEntries = [];
|
|
90
|
-
}
|
|
91
|
-
|
|
77
|
+
}
|
|
78
|
+
_containsHandler(key, handler) {
|
|
92
79
|
if (this._handlers[key] !== null && this._handlers[key] !== undefined) {
|
|
93
80
|
return this._handlers[key].indexOf(handler) > -1;
|
|
94
81
|
}
|
|
95
82
|
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
83
|
+
}
|
|
84
|
+
_initializeHandlerArrayForKey(key) {
|
|
98
85
|
if (this._handlers[key] === null || this._handlers[key] === undefined) {
|
|
99
86
|
this._handlers[key] = [];
|
|
100
87
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
for (
|
|
104
|
-
var entry = _a[_i];
|
|
88
|
+
}
|
|
89
|
+
_processAllExecutionEntries() {
|
|
90
|
+
for (const entry of this._executionEntries){
|
|
105
91
|
if (entry && this._handlers[entry.key]) {
|
|
106
92
|
try {
|
|
107
|
-
for (
|
|
108
|
-
var handler = _c[_b];
|
|
93
|
+
for (const handler of this._handlers[entry.key]){
|
|
109
94
|
handler.apply(this, entry.args);
|
|
110
95
|
}
|
|
111
|
-
}
|
|
112
|
-
catch (e) {
|
|
96
|
+
} catch (e) {
|
|
113
97
|
// eslint-disable-next-line no-console
|
|
114
98
|
console.error('failed to process execution entry:' + e.toString());
|
|
115
99
|
}
|
|
116
100
|
}
|
|
117
101
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
for
|
|
102
|
+
}
|
|
103
|
+
_processExecutionEntry(key, args) {
|
|
104
|
+
for(let i = 0; i < this._handlers[key].length; i++){
|
|
121
105
|
try {
|
|
122
106
|
this._handlers[key][i].apply(this, args);
|
|
123
|
-
}
|
|
124
|
-
catch (e) {
|
|
107
|
+
} catch (e) {
|
|
125
108
|
// eslint-disable-next-line no-console
|
|
126
109
|
console.error('failed to process execution entry:' + e.toString());
|
|
127
110
|
}
|
|
128
111
|
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
112
|
+
}
|
|
113
|
+
constructor(){
|
|
114
|
+
this._shouldExecuteInRealTime = false;
|
|
115
|
+
this._handlers = {};
|
|
116
|
+
this._executionEntries = [];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=./ExecutionQueue.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright (c) Microsoft. All rights reserved.
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=./ILogData.js.map
|