@microsoft/sp-diagnostics 1.23.2 → 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.
Files changed (223) hide show
  1. package/dist/78359e4b-07c2-43c6-8d0b-d060b4d577e8.manifest.json +6 -11
  2. package/dist/index-internal-beta.d.ts +20 -0
  3. package/dist/index-internal-public.d.ts +20 -0
  4. package/dist/index-internal.d.ts +20 -0
  5. package/dist/sp-diagnostics_none_1b5b73722b91f3231f63.js +1 -0
  6. package/dist/tsdoc-metadata.json +1 -1
  7. package/lib-commonjs/Api/Engagement/EngagementLogger.js +91 -96
  8. package/lib-commonjs/Api/Engagement/IEngagementHandler.js +9 -3
  9. package/lib-commonjs/Api/ExecutionQueue.js +73 -86
  10. package/lib-commonjs/Api/ILogData.js +6 -3
  11. package/lib-commonjs/Api/ILogEntry.js +5 -2
  12. package/lib-commonjs/Api/ILogErrorData.js +6 -3
  13. package/lib-commonjs/Api/ILogSource.js +10 -3
  14. package/lib-commonjs/Api/ILogVerboseData.js +6 -3
  15. package/lib-commonjs/Api/Log/LogHandler.js +27 -26
  16. package/lib-commonjs/Api/LogEntry.js +40 -39
  17. package/lib-commonjs/Api/LogFeature.js +14 -10
  18. package/lib-commonjs/Api/LogLevel.js +22 -19
  19. package/lib-commonjs/Api/LogManager/CircularBuffer.js +56 -64
  20. package/lib-commonjs/Api/LogManager/LogManager.js +61 -78
  21. package/lib-commonjs/Api/LogSource.js +37 -35
  22. package/lib-commonjs/Api/LogType.js +20 -15
  23. package/lib-commonjs/Api/Qos/AutoAlertableQosMonitor.js +68 -82
  24. package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +5 -2
  25. package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +5 -2
  26. package/lib-commonjs/Api/Qos/IQos.js +5 -2
  27. package/lib-commonjs/Api/Qos/IQosEndEvent.js +5 -2
  28. package/lib-commonjs/Api/Qos/IQosExtraData.js +15 -3
  29. package/lib-commonjs/Api/Qos/IQosStartEvent.js +9 -3
  30. package/lib-commonjs/Api/Qos/QosLogger.js +54 -60
  31. package/lib-commonjs/Api/Qos/QosMonitor.js +163 -209
  32. package/lib-commonjs/Api/Qos/QosMonitorShareFailureWithCP.js +72 -92
  33. package/lib-commonjs/Api/Qos/QosResultType.js +14 -7
  34. package/lib-commonjs/Api/Trace/DefaultTraceHandler.js +20 -22
  35. package/lib-commonjs/Api/Trace/ITraceHandler.js +9 -3
  36. package/lib-commonjs/Api/Trace/ITraceLogger.js +5 -2
  37. package/lib-commonjs/Api/Trace/LogEvent.js +86 -125
  38. package/lib-commonjs/Api/Trace/TraceLogger.js +149 -161
  39. package/lib-commonjs/Diagnostics.js +57 -72
  40. package/lib-commonjs/DiagnosticsSettingsManager.js +37 -43
  41. package/lib-commonjs/IDiagnosticsSettings.js +5 -2
  42. package/lib-commonjs/common/Killswitches.js +13 -9
  43. package/lib-commonjs/extraData/DisplayApp.js +13 -5
  44. package/lib-commonjs/extraData/IDiagnosticContextInfo.js +5 -2
  45. package/lib-commonjs/extraData/IPageExtraData.js +5 -2
  46. package/lib-commonjs/extraData/PageType.js +15 -8
  47. package/lib-commonjs/extraData/PromotedState.js +18 -13
  48. package/lib-commonjs/extraData/WebTemplateId.js +13 -5
  49. package/lib-commonjs/extraData/setPageExtraData.js +37 -37
  50. package/lib-commonjs/index.js +102 -50
  51. package/{lib → lib-dts}/Api/Engagement/IEngagementHandler.d.ts +2 -0
  52. package/lib-esm/Api/Engagement/EngagementLogger.js +137 -0
  53. package/lib-esm/Api/Engagement/IEngagementHandler.js +9 -0
  54. package/lib-esm/Api/ExecutionQueue.js +114 -0
  55. package/lib-esm/Api/ILogData.js +4 -0
  56. package/lib-esm/Api/ILogEntry.js +3 -0
  57. package/lib-esm/Api/ILogErrorData.js +4 -0
  58. package/lib-esm/Api/ILogSource.js +8 -0
  59. package/lib-esm/Api/ILogVerboseData.js +4 -0
  60. package/lib-esm/Api/Log/LogHandler.js +37 -0
  61. package/lib-esm/Api/LogEntry.js +44 -0
  62. package/lib-esm/Api/LogFeature.js +8 -0
  63. package/lib-esm/Api/LogLevel.js +20 -0
  64. package/lib-esm/Api/LogManager/CircularBuffer.js +83 -0
  65. package/lib-esm/Api/LogManager/LogManager.js +103 -0
  66. package/lib-esm/Api/LogSource.js +32 -0
  67. package/lib-esm/Api/LogType.js +20 -0
  68. package/lib-esm/Api/Qos/AutoAlertableQosMonitor.js +74 -0
  69. package/lib-esm/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +6 -0
  70. package/lib-esm/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +6 -0
  71. package/lib-esm/Api/Qos/IQos.js +6 -0
  72. package/lib-esm/Api/Qos/IQosEndEvent.js +6 -0
  73. package/lib-esm/Api/Qos/IQosExtraData.js +12 -0
  74. package/lib-esm/Api/Qos/IQosStartEvent.js +6 -0
  75. package/lib-esm/Api/Qos/QosLogger.js +64 -0
  76. package/lib-esm/Api/Qos/QosMonitor.js +258 -0
  77. package/lib-esm/Api/Qos/QosMonitorShareFailureWithCP.js +89 -0
  78. package/lib-esm/Api/Qos/QosResultType.js +11 -0
  79. package/lib-esm/Api/Trace/DefaultTraceHandler.js +23 -0
  80. package/lib-esm/Api/Trace/ITraceHandler.js +9 -0
  81. package/lib-esm/Api/Trace/ITraceLogger.js +3 -0
  82. package/lib-esm/Api/Trace/LogEvent.js +104 -0
  83. package/lib-esm/Api/Trace/TraceLogger.js +180 -0
  84. package/lib-esm/Diagnostics.js +67 -0
  85. package/lib-esm/DiagnosticsSettingsManager.js +54 -0
  86. package/lib-esm/IDiagnosticsSettings.js +3 -0
  87. package/{lib → lib-esm}/common/Killswitches.js +3 -4
  88. package/{lib → lib-esm}/extraData/DisplayApp.js +3 -2
  89. package/lib-esm/extraData/IDiagnosticContextInfo.js +7 -0
  90. package/lib-esm/extraData/IPageExtraData.js +3 -0
  91. package/{lib → lib-esm}/extraData/PageType.js +4 -4
  92. package/lib-esm/extraData/PromotedState.js +15 -0
  93. package/{lib → lib-esm}/extraData/WebTemplateId.js +3 -2
  94. package/{lib → lib-esm}/extraData/setPageExtraData.js +14 -20
  95. package/{lib → lib-esm}/index.js +3 -3
  96. package/package.json +33 -6
  97. package/dist/sp-diagnostics_none_414da724f4073ce8bb98.js +0 -1
  98. package/lib/Api/Engagement/EngagementLogger.d.ts.map +0 -1
  99. package/lib/Api/Engagement/EngagementLogger.js +0 -143
  100. package/lib/Api/Engagement/IEngagementHandler.d.ts.map +0 -1
  101. package/lib/Api/Engagement/IEngagementHandler.js +0 -2
  102. package/lib/Api/ExecutionQueue.d.ts.map +0 -1
  103. package/lib/Api/ExecutionQueue.js +0 -131
  104. package/lib/Api/ILogData.d.ts.map +0 -1
  105. package/lib/Api/ILogData.js +0 -3
  106. package/lib/Api/ILogEntry.d.ts.map +0 -1
  107. package/lib/Api/ILogEntry.js +0 -2
  108. package/lib/Api/ILogErrorData.d.ts.map +0 -1
  109. package/lib/Api/ILogErrorData.js +0 -3
  110. package/lib/Api/ILogSource.d.ts.map +0 -1
  111. package/lib/Api/ILogSource.js +0 -3
  112. package/lib/Api/ILogVerboseData.d.ts.map +0 -1
  113. package/lib/Api/ILogVerboseData.js +0 -3
  114. package/lib/Api/Log/LogHandler.d.ts.map +0 -1
  115. package/lib/Api/Log/LogHandler.js +0 -40
  116. package/lib/Api/LogEntry.d.ts.map +0 -1
  117. package/lib/Api/LogEntry.js +0 -51
  118. package/lib/Api/LogFeature.d.ts.map +0 -1
  119. package/lib/Api/LogFeature.js +0 -11
  120. package/lib/Api/LogLevel.d.ts.map +0 -1
  121. package/lib/Api/LogLevel.js +0 -24
  122. package/lib/Api/LogManager/CircularBuffer.d.ts.map +0 -1
  123. package/lib/Api/LogManager/CircularBuffer.js +0 -98
  124. package/lib/Api/LogManager/LogManager.d.ts.map +0 -1
  125. package/lib/Api/LogManager/LogManager.js +0 -121
  126. package/lib/Api/LogSource.d.ts.map +0 -1
  127. package/lib/Api/LogSource.js +0 -40
  128. package/lib/Api/LogType.d.ts.map +0 -1
  129. package/lib/Api/LogType.js +0 -23
  130. package/lib/Api/Qos/AutoAlertableQosMonitor.d.ts.map +0 -1
  131. package/lib/Api/Qos/AutoAlertableQosMonitor.js +0 -93
  132. package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts.map +0 -1
  133. package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +0 -2
  134. package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts.map +0 -1
  135. package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +0 -2
  136. package/lib/Api/Qos/IQos.d.ts.map +0 -1
  137. package/lib/Api/Qos/IQos.js +0 -2
  138. package/lib/Api/Qos/IQosEndEvent.d.ts.map +0 -1
  139. package/lib/Api/Qos/IQosEndEvent.js +0 -2
  140. package/lib/Api/Qos/IQosExtraData.d.ts.map +0 -1
  141. package/lib/Api/Qos/IQosExtraData.js +0 -2
  142. package/lib/Api/Qos/IQosStartEvent.d.ts.map +0 -1
  143. package/lib/Api/Qos/IQosStartEvent.js +0 -2
  144. package/lib/Api/Qos/QosLogger.d.ts.map +0 -1
  145. package/lib/Api/Qos/QosLogger.js +0 -74
  146. package/lib/Api/Qos/QosMonitor.d.ts.map +0 -1
  147. package/lib/Api/Qos/QosMonitor.js +0 -304
  148. package/lib/Api/Qos/QosMonitorShareFailureWithCP.d.ts.map +0 -1
  149. package/lib/Api/Qos/QosMonitorShareFailureWithCP.js +0 -114
  150. package/lib/Api/Qos/QosResultType.d.ts.map +0 -1
  151. package/lib/Api/Qos/QosResultType.js +0 -11
  152. package/lib/Api/Trace/DefaultTraceHandler.d.ts.map +0 -1
  153. package/lib/Api/Trace/DefaultTraceHandler.js +0 -30
  154. package/lib/Api/Trace/ITraceHandler.d.ts.map +0 -1
  155. package/lib/Api/Trace/ITraceHandler.js +0 -2
  156. package/lib/Api/Trace/ITraceLogger.d.ts.map +0 -1
  157. package/lib/Api/Trace/ITraceLogger.js +0 -2
  158. package/lib/Api/Trace/LogEvent.d.ts.map +0 -1
  159. package/lib/Api/Trace/LogEvent.js +0 -147
  160. package/lib/Api/Trace/TraceLogger.d.ts.map +0 -1
  161. package/lib/Api/Trace/TraceLogger.js +0 -196
  162. package/lib/Diagnostics.d.ts.map +0 -1
  163. package/lib/Diagnostics.js +0 -82
  164. package/lib/DiagnosticsSettingsManager.d.ts.map +0 -1
  165. package/lib/DiagnosticsSettingsManager.js +0 -62
  166. package/lib/IDiagnosticsSettings.d.ts.map +0 -1
  167. package/lib/IDiagnosticsSettings.js +0 -2
  168. package/lib/common/Killswitches.d.ts.map +0 -1
  169. package/lib/extraData/DisplayApp.d.ts.map +0 -1
  170. package/lib/extraData/IDiagnosticContextInfo.d.ts.map +0 -1
  171. package/lib/extraData/IDiagnosticContextInfo.js +0 -2
  172. package/lib/extraData/IPageExtraData.d.ts.map +0 -1
  173. package/lib/extraData/IPageExtraData.js +0 -2
  174. package/lib/extraData/PageType.d.ts.map +0 -1
  175. package/lib/extraData/PromotedState.d.ts.map +0 -1
  176. package/lib/extraData/PromotedState.js +0 -17
  177. package/lib/extraData/WebTemplateId.d.ts.map +0 -1
  178. package/lib/extraData/setPageExtraData.d.ts.map +0 -1
  179. package/lib/index.d.ts.map +0 -1
  180. /package/{lib → lib-dts}/Api/Engagement/EngagementLogger.d.ts +0 -0
  181. /package/{lib → lib-dts}/Api/ExecutionQueue.d.ts +0 -0
  182. /package/{lib → lib-dts}/Api/ILogData.d.ts +0 -0
  183. /package/{lib → lib-dts}/Api/ILogEntry.d.ts +0 -0
  184. /package/{lib → lib-dts}/Api/ILogErrorData.d.ts +0 -0
  185. /package/{lib → lib-dts}/Api/ILogSource.d.ts +0 -0
  186. /package/{lib → lib-dts}/Api/ILogVerboseData.d.ts +0 -0
  187. /package/{lib → lib-dts}/Api/Log/LogHandler.d.ts +0 -0
  188. /package/{lib → lib-dts}/Api/LogEntry.d.ts +0 -0
  189. /package/{lib → lib-dts}/Api/LogFeature.d.ts +0 -0
  190. /package/{lib → lib-dts}/Api/LogLevel.d.ts +0 -0
  191. /package/{lib → lib-dts}/Api/LogManager/CircularBuffer.d.ts +0 -0
  192. /package/{lib → lib-dts}/Api/LogManager/LogManager.d.ts +0 -0
  193. /package/{lib → lib-dts}/Api/LogSource.d.ts +0 -0
  194. /package/{lib → lib-dts}/Api/LogType.d.ts +0 -0
  195. /package/{lib → lib-dts}/Api/Qos/AutoAlertableQosMonitor.d.ts +0 -0
  196. /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts +0 -0
  197. /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts +0 -0
  198. /package/{lib → lib-dts}/Api/Qos/IQos.d.ts +0 -0
  199. /package/{lib → lib-dts}/Api/Qos/IQosEndEvent.d.ts +0 -0
  200. /package/{lib → lib-dts}/Api/Qos/IQosExtraData.d.ts +0 -0
  201. /package/{lib → lib-dts}/Api/Qos/IQosStartEvent.d.ts +0 -0
  202. /package/{lib → lib-dts}/Api/Qos/QosLogger.d.ts +0 -0
  203. /package/{lib → lib-dts}/Api/Qos/QosMonitor.d.ts +0 -0
  204. /package/{lib → lib-dts}/Api/Qos/QosMonitorShareFailureWithCP.d.ts +0 -0
  205. /package/{lib → lib-dts}/Api/Qos/QosResultType.d.ts +0 -0
  206. /package/{lib → lib-dts}/Api/Trace/DefaultTraceHandler.d.ts +0 -0
  207. /package/{lib → lib-dts}/Api/Trace/ITraceHandler.d.ts +0 -0
  208. /package/{lib → lib-dts}/Api/Trace/ITraceLogger.d.ts +0 -0
  209. /package/{lib → lib-dts}/Api/Trace/LogEvent.d.ts +0 -0
  210. /package/{lib → lib-dts}/Api/Trace/TraceLogger.d.ts +0 -0
  211. /package/{lib → lib-dts}/Diagnostics.d.ts +0 -0
  212. /package/{lib → lib-dts}/DiagnosticsSettingsManager.d.ts +0 -0
  213. /package/{lib → lib-dts}/IDiagnosticsSettings.d.ts +0 -0
  214. /package/{lib → lib-dts}/common/Killswitches.d.ts +0 -0
  215. /package/{lib → lib-dts}/extraData/DisplayApp.d.ts +0 -0
  216. /package/{lib → lib-dts}/extraData/IDiagnosticContextInfo.d.ts +0 -0
  217. /package/{lib → lib-dts}/extraData/IPageExtraData.d.ts +0 -0
  218. /package/{lib → lib-dts}/extraData/PageType.d.ts +0 -0
  219. /package/{lib → lib-dts}/extraData/PromotedState.d.ts +0 -0
  220. /package/{lib → lib-dts}/extraData/WebTemplateId.d.ts +0 -0
  221. /package/{lib → lib-dts}/extraData/setPageExtraData.d.ts +0 -0
  222. /package/{lib → lib-dts}/index.d.ts +0 -0
  223. /package/{lib → lib-esm}/sp-diagnostics.manifest.json +0 -0
@@ -1,117 +1,97 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QosMonitorShareFailureWithCP = void 0;
4
- var tslib_1 = require("tslib");
5
- var QosMonitor_1 = tslib_1.__importDefault(require("./QosMonitor"));
6
- var QosResultType_1 = require("./QosResultType");
7
- var index_1 = require("../../index");
8
- var Killswitches_1 = require("../../common/Killswitches");
9
- /**
10
- * Monitor which handles failures for QosMonitor and also invokes Customer Promise Handlers to record failure
11
- * @internal
12
- */
13
- var QosMonitorShareFailureWithCP = /** @class */ (function (_super) {
14
- tslib_1.__extends(QosMonitorShareFailureWithCP, _super);
15
- /**
16
- * Creates a QoS monitor and also registers the Customer promise handlers to notify in case of failures
17
- * @internal
18
- *
19
- * @param scenarioName - Unique name of the QoS scenario
20
- * @param copyToEngagement - indicate whether this data should be used as Engagement as well.
21
- * @param extraDataForCustomerPromise - Holds extra information about Customer Promise handlers to invoke
22
- * and error information where failures are logged
23
- */
24
- function QosMonitorShareFailureWithCP(scenarioName, copyToEngagement, extraDataForCustomerPromise, copyToCosmos) {
25
- if (copyToEngagement === void 0) { copyToEngagement = false; }
26
- if (copyToCosmos === void 0) { copyToCosmos = false; }
27
- var _this = _super.call(this, scenarioName, /* copyToCosmos */ copyToCosmos, /* copyToInterana */ copyToEngagement) || this;
28
- _this._extraDataForCustomerPromise = extraDataForCustomerPromise;
29
- return _this;
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "QosMonitorShareFailureWithCP", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return QosMonitorShareFailureWithCP;
30
9
  }
10
+ });
11
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
+ const _QosMonitor = /*#__PURE__*/ _interop_require_default._(require("./QosMonitor"));
13
+ const _QosResultType = require("./QosResultType");
14
+ const _Diagnostics = /*#__PURE__*/ _interop_require_default._(require("../../Diagnostics"));
15
+ const _Killswitches = require("../../common/Killswitches");
16
+ class QosMonitorShareFailureWithCP extends _QosMonitor.default {
31
17
  /**
32
- * QoS monitor ends with failure and invokes the Customer Promise handlers
33
- * to log a failure
34
- * @internal
35
- *
36
- * You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
37
- * <failuretag> will be filled with param tagName
38
- */
39
- QosMonitorShareFailureWithCP.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
40
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ * QoS monitor ends with failure and invokes the Customer Promise handlers
19
+ * to log a failure
20
+ * @internal
21
+ *
22
+ * You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
23
+ * <failuretag> will be filled with param tagName
24
+ */ writeUnexpectedFailure(tagNameSuffix = 'DefaultUnexpected', ex, // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
25
  extraData) {
42
- if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultUnexpected'; }
43
- _super.prototype.writeUnexpectedFailure.call(this, tagNameSuffix, ex, extraData);
44
- this._logCustomerPromiseFailure((ex === null || ex === void 0 ? void 0 : ex.message) || 'DefaultErrorMessage', tagNameSuffix, QosResultType_1.QosResultType.Failure, extraData);
45
- };
26
+ super.writeUnexpectedFailure(tagNameSuffix, ex, extraData);
27
+ this._logCustomerPromiseFailure(ex?.message || 'DefaultErrorMessage', tagNameSuffix, _QosResultType.QosResultType.Failure, extraData);
28
+ }
46
29
  /**
47
- * QoS monitor ends with expected failure and invokes the Customer Promise handlers
48
- * to log an expected failure
49
- * @internal
50
- *
51
- * You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
52
- * <failuretag> will be filled with param tagName
53
- */
54
- QosMonitorShareFailureWithCP.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
55
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
- extraData, skipLoggingCustomerPromiseFailure) {
57
- if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultExpected'; }
58
- if (skipLoggingCustomerPromiseFailure === void 0) { skipLoggingCustomerPromiseFailure = false; }
59
- _super.prototype.writeExpectedFailure.call(this, tagNameSuffix, ex, extraData);
30
+ * QoS monitor ends with expected failure and invokes the Customer Promise handlers
31
+ * to log an expected failure
32
+ * @internal
33
+ *
34
+ * You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
35
+ * <failuretag> will be filled with param tagName
36
+ */ writeExpectedFailure(tagNameSuffix = 'DefaultExpected', ex, // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ extraData, skipLoggingCustomerPromiseFailure = false) {
38
+ super.writeExpectedFailure(tagNameSuffix, ex, extraData);
60
39
  if (!skipLoggingCustomerPromiseFailure) {
61
- this._logCustomerPromiseFailure((ex === null || ex === void 0 ? void 0 : ex.message) || 'DefaultErrorMessage', tagNameSuffix, QosResultType_1.QosResultType.ExpectedFailure, extraData);
40
+ this._logCustomerPromiseFailure(ex?.message || 'DefaultErrorMessage', tagNameSuffix, _QosResultType.QosResultType.ExpectedFailure, extraData);
62
41
  }
63
- };
42
+ }
64
43
  /**
65
- * Invokes the registered Customer Promise Handlers by using the passed in serviceKey
66
- * @param errorMessage - Information to indicate which scenario failed.
67
- * @param errorScenario -Additional error details describing the failure from the module.
68
- * @param resultType - ResultTypeEnum used to indicate expected or unexpected failure.
69
- * @param extraData - Additional information to be logged, which might include pageType and/or errorStack
70
- */
71
- QosMonitorShareFailureWithCP.prototype._logCustomerPromiseFailure = function (errorMessage, errorScenario, resultType,
72
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ * Invokes the registered Customer Promise Handlers by using the passed in serviceKey
45
+ * @param errorMessage - Information to indicate which scenario failed.
46
+ * @param errorScenario -Additional error details describing the failure from the module.
47
+ * @param resultType - ResultTypeEnum used to indicate expected or unexpected failure.
48
+ * @param extraData - Additional information to be logged, which might include pageType and/or errorStack
49
+ */ _logCustomerPromiseFailure(errorMessage, errorScenario, resultType = _QosResultType.QosResultType.Failure, // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
50
  extraData) {
74
- if (resultType === void 0) { resultType = QosResultType_1.QosResultType.Failure; }
75
51
  if (this._extraDataForCustomerPromise) {
76
- this._extraDataForCustomerPromise.forEach(function (extraHandlerInfo) {
77
- var logFailure = extraHandlerInfo.logFailure, veto = extraHandlerInfo.veto;
78
- var errorModuleName = extraHandlerInfo.errorModuleName +
79
- getAuthoringSuffix() +
80
- (!(0, Killswitches_1.isAppendSuffixIfBrowserIsOfflineAtLoggingTimeKsActive)() ? getOfflineSuffix() : '');
81
- var errorDetailsForCP = {
52
+ this._extraDataForCustomerPromise.forEach((extraHandlerInfo)=>{
53
+ const { logFailure, veto } = extraHandlerInfo;
54
+ const errorModuleName = extraHandlerInfo.errorModuleName + getAuthoringSuffix() + (!(0, _Killswitches.isAppendSuffixIfBrowserIsOfflineAtLoggingTimeKsActive)() ? getOfflineSuffix() : '');
55
+ const errorDetailsForCP = {
82
56
  errorCode: errorModuleName,
83
- errorScenario: errorScenario,
84
- errorMessage: errorMessage,
85
- resultType: resultType,
86
- pageType: extraData === null || extraData === void 0 ? void 0 : extraData.pageType,
87
- errorStack: extraData === null || extraData === void 0 ? void 0 : extraData.errorStack,
88
- veto: veto
57
+ errorScenario,
58
+ errorMessage,
59
+ resultType,
60
+ pageType: extraData?.pageType,
61
+ errorStack: extraData?.errorStack,
62
+ veto
89
63
  };
90
64
  logFailure(errorDetailsForCP);
91
65
  });
92
66
  }
93
- };
94
- return QosMonitorShareFailureWithCP;
95
- }(QosMonitor_1.default));
96
- exports.QosMonitorShareFailureWithCP = QosMonitorShareFailureWithCP;
67
+ }
68
+ /**
69
+ * Creates a QoS monitor and also registers the Customer promise handlers to notify in case of failures
70
+ * @internal
71
+ *
72
+ * @param scenarioName - Unique name of the QoS scenario
73
+ * @param copyToEngagement - indicate whether this data should be used as Engagement as well.
74
+ * @param extraDataForCustomerPromise - Holds extra information about Customer Promise handlers to invoke
75
+ * and error information where failures are logged
76
+ */ constructor(scenarioName, copyToEngagement = false, extraDataForCustomerPromise, copyToCosmos = false){
77
+ super(scenarioName, /* copyToCosmos */ copyToCosmos, /* copyToInterana */ copyToEngagement);
78
+ this._extraDataForCustomerPromise = extraDataForCustomerPromise;
79
+ }
80
+ }
97
81
  function getAuthoringSuffix() {
98
- var extraDiagnosticInfo = index_1._Diagnostics._getExtraDiagnosticInfo();
82
+ const extraDiagnosticInfo = _Diagnostics.default._getExtraDiagnosticInfo();
99
83
  if (!extraDiagnosticInfo || !extraDiagnosticInfo.hasAuthoringStarted) {
100
84
  return '';
101
- }
102
- else if (!extraDiagnosticInfo.authoringSessionClientCount) {
103
- return extraDiagnosticInfo.isAuthoringUsingDDS
104
- ? " in Legacy Authoring (DDS)"
105
- : ' in Legacy Authoring (no DDS)';
106
- }
107
- else if (extraDiagnosticInfo.authoringSessionClientCount > 1) {
85
+ } else if (!extraDiagnosticInfo.authoringSessionClientCount) {
86
+ return extraDiagnosticInfo.isAuthoringUsingDDS ? ` in Legacy Authoring (DDS)` : ' in Legacy Authoring (no DDS)';
87
+ } else if (extraDiagnosticInfo.authoringSessionClientCount > 1) {
108
88
  return ' with Multiple Users';
109
- }
110
- else {
89
+ } else {
111
90
  return '';
112
91
  }
113
92
  }
114
93
  function getOfflineSuffix() {
115
94
  return window.navigator.onLine ? '' : ' (offline)';
116
95
  }
117
- //# sourceMappingURL=QosMonitorShareFailureWithCP.js.map
96
+
97
+ //# sourceMappingURL=./QosMonitorShareFailureWithCP.js.map
@@ -1,14 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QosResultType = void 0;
4
1
  /**
5
2
  * Qos Result Type const object.
6
3
  * @internal
7
- */
8
- // eslint-disable-next-line @typescript-eslint/typedef
9
- exports.QosResultType = {
4
+ */ // eslint-disable-next-line @typescript-eslint/typedef
5
+ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ Object.defineProperty(exports, "QosResultType", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return QosResultType;
13
+ }
14
+ });
15
+ const QosResultType = {
10
16
  Success: 0,
11
17
  Failure: 1,
12
18
  ExpectedFailure: 2
13
19
  };
14
- //# sourceMappingURL=QosResultType.js.map
20
+
21
+ //# sourceMappingURL=./QosResultType.js.map
@@ -1,32 +1,30 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Default implementation for the Trace logger class.
5
- */
6
- var DefaultTraceHandler = /** @class */ (function () {
7
- function DefaultTraceHandler() {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return DefaultTraceHandler;
8
9
  }
10
+ });
11
+ class DefaultTraceHandler {
9
12
  /**
10
- * Default implementation for log function.
11
- */
12
- DefaultTraceHandler.prototype.log = function (traceLogEvent) {
13
+ * Default implementation for log function.
14
+ */ log(traceLogEvent) {
13
15
  if (!DEPRECATED_UNIT_TEST) {
14
16
  // eslint-disable-next-line no-console
15
- console.log("Error: ".concat(traceLogEvent.data, ", ") +
16
- "Event Name: ".concat(traceLogEvent.eventName, ", ") +
17
- "Result Code: ".concat(traceLogEvent.resultCode));
17
+ console.log(`Error: ${traceLogEvent.data}, ` + `Event Name: ${traceLogEvent.eventName}, ` + `Result Code: ${traceLogEvent.resultCode}`);
18
18
  }
19
- };
19
+ }
20
20
  /**
21
- * Default implementation for verbose function.
22
- */
23
- DefaultTraceHandler.prototype.verbose = function (verboseTraceEvent) {
21
+ * Default implementation for verbose function.
22
+ */ verbose(verboseTraceEvent) {
24
23
  if (!DEPRECATED_UNIT_TEST) {
25
24
  // eslint-disable-next-line no-console
26
- console.log("Error: ".concat(verboseTraceEvent.data, ", Event Name: ").concat(verboseTraceEvent.eventName));
25
+ console.log(`Error: ${verboseTraceEvent.data}, Event Name: ${verboseTraceEvent.eventName}`);
27
26
  }
28
- };
29
- return DefaultTraceHandler;
30
- }());
31
- exports.default = DefaultTraceHandler;
32
- //# sourceMappingURL=DefaultTraceHandler.js.map
27
+ }
28
+ }
29
+
30
+ //# sourceMappingURL=./DefaultTraceHandler.js.map
@@ -1,3 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ITraceHandler.js.map
1
+ /**
2
+ * Trace logger log data interface
3
+ * @internal
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+
9
+ //# sourceMappingURL=./ITraceHandler.js.map
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ITraceLogger.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //# sourceMappingURL=./ITraceLogger.js.map
@@ -1,150 +1,111 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var LogSource_1 = require("../LogSource");
5
- var LogManager_1 = tslib_1.__importDefault(require("../LogManager/LogManager"));
6
- /**
7
- * An object that represents one log event.
8
- * @internal
9
- */
10
- var LogEvent = /** @class */ (function () {
11
- /**
12
- * Do not call this constructor directly. Use LogEvent.log instead.
13
- */
14
- function LogEvent(source, data, level, serviceScope) {
15
- this._validate(source, data);
16
- this._timestamp = new Date().getTime();
17
- this._scope = this._getScope(serviceScope);
18
- this._source = source.substr(0, this._maxSourceLength);
19
- this._setData(data);
20
- this._level = level;
21
- this._prefix = this._getPrefix();
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return LogEvent;
22
9
  }
10
+ });
11
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
+ const _LogSource = require("../LogSource");
13
+ const _LogManager = /*#__PURE__*/ _interop_require_default._(require("../LogManager/LogManager"));
14
+ class LogEvent {
23
15
  /**
24
- * Use this method to log an event.
25
- *
26
- * @param source - source of the log event, e.g. class name of the source file
27
- * @param data - data of the log event
28
- * @param level - level of the log event
29
- * @param serviceScope - scope of the log event, e.g. component/web part
30
- */
31
- LogEvent.log = function (source, data, level, serviceScope) {
32
- var event = new LogEvent(source, data, level, serviceScope);
16
+ * Use this method to log an event.
17
+ *
18
+ * @param source - source of the log event, e.g. class name of the source file
19
+ * @param data - data of the log event
20
+ * @param level - level of the log event
21
+ * @param serviceScope - scope of the log event, e.g. component/web part
22
+ */ static log(source, data, level, serviceScope) {
23
+ const event = new LogEvent(source, data, level, serviceScope);
33
24
  LogEvent.logManager.log(event);
34
25
  return event;
35
- };
36
- LogEvent.prototype.toString = function () {
37
- var timedPrefix = "[".concat(this._timestamp, "][").concat(this._prefix, "]");
26
+ }
27
+ toString() {
28
+ const timedPrefix = `[${this._timestamp}][${this._prefix}]`;
38
29
  if (this._message) {
39
- return "".concat(timedPrefix, " ").concat(this._message);
40
- }
41
- else if (this._error) {
42
- return "".concat(timedPrefix, " ").concat(this._error.toString());
43
- }
44
- else {
30
+ return `${timedPrefix} ${this._message}`;
31
+ } else if (this._error) {
32
+ return `${timedPrefix} ${this._error.toString()}`;
33
+ } else {
45
34
  return timedPrefix;
46
35
  }
47
- };
48
- Object.defineProperty(LogEvent.prototype, "timestamp", {
49
- get: function () {
50
- return this._timestamp;
51
- },
52
- enumerable: false,
53
- configurable: true
54
- });
55
- Object.defineProperty(LogEvent.prototype, "level", {
56
- get: function () {
57
- return this._level;
58
- },
59
- enumerable: false,
60
- configurable: true
61
- });
62
- Object.defineProperty(LogEvent.prototype, "prefix", {
63
- get: function () {
64
- return this._prefix;
65
- },
66
- enumerable: false,
67
- configurable: true
68
- });
69
- Object.defineProperty(LogEvent.prototype, "scope", {
70
- get: function () {
71
- return this._scope;
72
- },
73
- enumerable: false,
74
- configurable: true
75
- });
76
- Object.defineProperty(LogEvent.prototype, "source", {
77
- get: function () {
78
- return this._source;
79
- },
80
- enumerable: false,
81
- configurable: true
82
- });
83
- Object.defineProperty(LogEvent.prototype, "message", {
84
- get: function () {
85
- return this._message;
86
- },
87
- enumerable: false,
88
- configurable: true
89
- });
90
- Object.defineProperty(LogEvent.prototype, "error", {
91
- get: function () {
92
- return this._error;
93
- },
94
- enumerable: false,
95
- configurable: true
96
- });
97
- Object.defineProperty(LogEvent.prototype, "_maxSourceLength", {
98
- get: function () {
99
- return 30;
100
- },
101
- enumerable: false,
102
- configurable: true
103
- });
104
- Object.defineProperty(LogEvent.prototype, "_maxMessageLength", {
105
- get: function () {
106
- return 150;
107
- },
108
- enumerable: false,
109
- configurable: true
110
- });
111
- LogEvent.prototype._validate = function (source, data) {
36
+ }
37
+ get timestamp() {
38
+ return this._timestamp;
39
+ }
40
+ get level() {
41
+ return this._level;
42
+ }
43
+ get prefix() {
44
+ return this._prefix;
45
+ }
46
+ get scope() {
47
+ return this._scope;
48
+ }
49
+ get source() {
50
+ return this._source;
51
+ }
52
+ get message() {
53
+ return this._message;
54
+ }
55
+ get error() {
56
+ return this._error;
57
+ }
58
+ get _maxSourceLength() {
59
+ return 30;
60
+ }
61
+ get _maxMessageLength() {
62
+ return 150;
63
+ }
64
+ _validate(source, data) {
112
65
  if (!source) {
113
66
  throw new Error('source cannot be undefined or null for Logger');
114
67
  }
115
68
  if (!data) {
116
69
  throw new Error('data cannot be undefined or null');
117
70
  }
118
- };
119
- LogEvent.prototype._setData = function (data) {
71
+ }
72
+ _setData(data) {
120
73
  if (typeof data === 'string') {
121
74
  this._message = data.substr(0, this._maxMessageLength);
122
- }
123
- else if (data instanceof Error) {
75
+ } else if (data instanceof Error) {
124
76
  this._error = data;
125
77
  }
126
- };
127
- LogEvent.prototype._getPrefix = function () {
128
- var prefix = "".concat(this._source);
78
+ }
79
+ _getPrefix() {
80
+ let prefix = `${this._source}`;
129
81
  if (this._scope && !this._scope.isEmpty()) {
130
- prefix = "".concat(this._scope.id.substr(0, this._maxSourceLength), ".").concat(prefix);
82
+ prefix = `${this._scope.id.substr(0, this._maxSourceLength)}.${prefix}`;
131
83
  }
132
- return "".concat(prefix);
133
- };
134
- LogEvent.prototype._getScope = function (serviceScope) {
135
- var parentSource;
84
+ return `${prefix}`;
85
+ }
86
+ _getScope(serviceScope) {
87
+ let parentSource;
136
88
  if (serviceScope) {
137
- serviceScope.whenFinished(function () {
138
- parentSource = serviceScope.consume(LogSource_1.logSourceServiceKey);
89
+ serviceScope.whenFinished(()=>{
90
+ parentSource = serviceScope.consume(_LogSource.logSourceServiceKey);
139
91
  });
140
92
  }
141
93
  return parentSource;
142
- };
94
+ }
143
95
  /**
144
- * Allows process log events.
145
- */
146
- LogEvent.logManager = new LogManager_1.default();
147
- return LogEvent;
148
- }());
149
- exports.default = LogEvent;
150
- //# sourceMappingURL=LogEvent.js.map
96
+ * Do not call this constructor directly. Use LogEvent.log instead.
97
+ */ constructor(source, data, level, serviceScope){
98
+ this._validate(source, data);
99
+ this._timestamp = new Date().getTime();
100
+ this._scope = this._getScope(serviceScope);
101
+ this._source = source.substr(0, this._maxSourceLength);
102
+ this._setData(data);
103
+ this._level = level;
104
+ this._prefix = this._getPrefix();
105
+ }
106
+ }
107
+ /**
108
+ * Allows process log events.
109
+ */ LogEvent.logManager = new _LogManager.default();
110
+
111
+ //# sourceMappingURL=./LogEvent.js.map