@microsoft/sp-diagnostics 1.18.0-beta.1 → 1.18.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 +1 -1
- package/dist/index-internal-beta.d.ts +2 -2
- package/dist/index-internal-public.d.ts +2 -2
- package/dist/index-internal.d.ts +2 -2
- package/dist/{sp-diagnostics_none_110fd0a3dde78fb97cdb.js → sp-diagnostics_none_9cf11f5cc818ebac1a6e.js} +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Api/Engagement/DefaultEngagementHandler.js +1 -0
- package/lib-commonjs/Api/Engagement/DefaultEngagementImplementation.js +1 -0
- package/lib-commonjs/Api/Engagement/EngagementLogger.js +0 -5
- package/lib-commonjs/Api/Engagement/IEngagementHandler.js +0 -4
- package/lib-commonjs/Api/ExecutionQueue.js +2 -3
- package/lib-commonjs/Api/ILogEntry.js +0 -5
- package/lib-commonjs/Api/Log/LogHandler.js +8 -7
- package/lib-commonjs/Api/LogEntry.js +1 -0
- package/lib-commonjs/Api/LogFeature.js +0 -6
- package/lib-commonjs/Api/LogLevel.js +0 -3
- package/lib-commonjs/Api/LogManager/CircularBuffer.js +0 -3
- package/lib-commonjs/Api/LogManager/LogManager.js +2 -3
- package/lib-commonjs/Api/Qos/AutoAlertableQosMonitor.js +16 -14
- package/lib-commonjs/Api/Qos/IQosStartEvent.js +0 -3
- package/lib-commonjs/Api/Qos/QosLogger.js +4 -7
- package/lib-commonjs/Api/Qos/QosMonitor.js +26 -28
- package/lib-commonjs/Api/Qos/QosMonitorShareFailureWithCP.js +9 -6
- package/lib-commonjs/Api/Qos/QosResultType.js +1 -4
- package/lib-commonjs/Api/Trace/DefaultTraceHandler.js +2 -4
- package/lib-commonjs/Api/Trace/ITraceLogger.js +0 -5
- package/lib-commonjs/Api/Trace/TraceLogger.js +4 -2
- package/lib-commonjs/Diagnostics.js +0 -3
- package/lib-commonjs/DiagnosticsSettingsManager.js +0 -3
- package/package.json +5 -4
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { ServiceKey } from '@microsoft/sp-core-library';
|
|
9
|
-
import { ServiceScope } from '@microsoft/sp-core-library';
|
|
10
|
-
import { _VetoValues } from '@microsoft/sp-core-library';
|
|
9
|
+
import type { ServiceScope } from '@microsoft/sp-core-library';
|
|
10
|
+
import type { _VetoValues } from '@microsoft/sp-core-library';
|
|
11
11
|
|
|
12
12
|
/* Excluded from this release type: _AutoAlertableMonitorType */
|
|
13
13
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { ServiceKey } from '@microsoft/sp-core-library';
|
|
9
|
-
import { ServiceScope } from '@microsoft/sp-core-library';
|
|
10
|
-
import { _VetoValues } from '@microsoft/sp-core-library';
|
|
9
|
+
import type { ServiceScope } from '@microsoft/sp-core-library';
|
|
10
|
+
import type { _VetoValues } from '@microsoft/sp-core-library';
|
|
11
11
|
|
|
12
12
|
/* Excluded from this release type: _AutoAlertableMonitorType */
|
|
13
13
|
|
package/dist/index-internal.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { ServiceKey } from '@microsoft/sp-core-library';
|
|
9
|
-
import { ServiceScope } from '@microsoft/sp-core-library';
|
|
10
|
-
import { _VetoValues } from '@microsoft/sp-core-library';
|
|
9
|
+
import type { ServiceScope } from '@microsoft/sp-core-library';
|
|
10
|
+
import type { _VetoValues } from '@microsoft/sp-core-library';
|
|
11
11
|
|
|
12
12
|
/* Excluded from this release type: _AutoAlertableMonitorType */
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
define("78359e4b-07c2-43c6-8d0b-d060b4d577e8_1.18.0",["tslib","@microsoft/sp-lodash-subset","@microsoft/sp-core-library"],function(n,a,i){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="mwqp")}({"17wl":function(e,t){e.exports=n},Pk8u:function(e,t){e.exports=a},UWqr:function(e,t){e.exports=i},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"_TraceLogger",function(){return p}),n.d(t,"_LogEntry",function(){return y}),n.d(t,"_LogFeature",function(){return m}),n.d(t,"_LogSource",function(){return o}),n.d(t,"_logSourceServiceKey",function(){return s}),n.d(t,"_LogType",function(){return v}),n.d(t,"_Diagnostics",function(){return I}),n.d(t,"_PromotedState",function(){return _}),n.d(t,"_PageType",function(){return h}),n.d(t,"_LogEvent",function(){return l}),n.d(t,"_LogLevel",function(){return a}),n.d(t,"_CircularBuffer",function(){return c}),n.d(t,"_LogManager",function(){return d}),n.d(t,"_EngagementLogger",function(){return x}),n.d(t,"_LogHandler",function(){return C}),n.d(t,"_QosMonitor",function(){return L}),n.d(t,"_AutoAlertableQosMonitor",function(){return P}),n.d(t,"_AutoAlertableMonitorType",function(){return M}),n.d(t,"_QosMonitorShareFailureWithCP",function(){return T}),n.d(t,"_QosLogger",function(){return A}),n.d(t,"_QosResultType",function(){return O}),n.d(t,"_ExecutionQueue",function(){return E});var a,i=n("UWqr"),r=function(){function e(e){i.Validate.isNotNullOrUndefined(e,"id"),this._id=e}return e.create=function(t){return new e(t)},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._id.length},e}(),o=r,s=i.ServiceKey.createCustom("sp-client-base:LogSource",function(e){return r.create("")}),c=function(){function e(e){if(this._head=-1,this._count=0,this._isIterating=!1,e<=0)throw new Error("Size must be positive");this._size=e,this._buffer=new Array(e)}return Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),e.prototype.push=function(e){this._ensureNotIterating(),this._head++,this._count++,this._head===this._size&&(this._head=0),this._buffer[this._head]=e},e.prototype.forEach=function(e){if(0!==this._count){this._isIterating=!0;try{for(var t=this._tail,n=0;n<this._size&&(e(this._buffer[t]),t!==this._head);n++)t=this._getNext(t)}finally{this._isIterating=!1}}},e.prototype.removeAll=function(){this._ensureNotIterating(),this._head=-1,this._count=0},Object.defineProperty(e.prototype,"_tail",{get:function(){return this._isNotWrapped()?0:this._getNext(this._head)},enumerable:!1,configurable:!0}),e.prototype._isNotWrapped=function(){return this._count===this._head+1},e.prototype._getNext=function(e){var t=e+1;return t===this._size&&(t=0),t},e.prototype._ensureNotIterating=function(){if(this._isIterating)throw new Error("Circular buffer cannot be modified during iteration")},e}(),d=function(){function e(t){this._shouldLogInRealTime=[],this._handlers=[],this._events=new c(e._maxVerboseLog),t&&this.addHandler(t)}return Object.defineProperty(e,"_maxVerboseLog",{get:function(){return 5e3},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.addHandler=function(e){this._containsHandler(e)||(this._handlers.push(e),this._shouldLogInRealTime.push(!1))},e.prototype.log=function(e){Object.freeze(e),this._events.push(e),this._processLogEvent(e)},e.prototype.removeHandler=function(e){var t=this._handlers.indexOf(e);t>-1&&(this._handlers.splice(t,1),this._shouldLogInRealTime.splice(t,1))},e.prototype.reset=function(){this._handlers=[],this._shouldLogInRealTime=[],this._events.removeAll()},e.prototype.processAll=function(e){this._handlers.indexOf(e)>-1&&this._processAllEvents(e)},e.prototype._containsHandler=function(e){for(var t=0,n=this._handlers;t<n.length;t++)if(n[t]===e)return!0;return!1},e.prototype._processAllEvents=function(e){this._events.forEach(function(t){if(t)try{e(t)}catch(e){console.error("failed to handle event:"+e.toString())}}),this._shouldLogInRealTime[this._handlers.indexOf(e)]=!0},e.prototype._processLogEvent=function(e){for(var t=0;t<this._handlers.length;t++)if(this._shouldLogInRealTime[t]&&e)try{this._handlers[t](e)}catch(e){console.error("failed to handle event:"+e.toString())}},e}(),l=function(){function e(e,t,n,a){this._validate(e,t),this._timestamp=(new Date).getTime(),this._scope=this._getScope(a),this._source=e.substr(0,this._maxSourceLength),this._setData(t),this._level=n,this._prefix=this._getPrefix()}return e.log=function(t,n,a,i){var r=new e(t,n,a,i);return e.logManager.log(r),r},e.prototype.toString=function(){var e="[".concat(this._timestamp,"][").concat(this._prefix,"]");return this._message?"".concat(e," ").concat(this._message):this._error?"".concat(e," ").concat(this._error.toString()):e},Object.defineProperty(e.prototype,"timestamp",{get:function(){return this._timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this._level},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prefix",{get:function(){return this._prefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this._scope},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_maxSourceLength",{get:function(){return 30},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_maxMessageLength",{get:function(){return 150},enumerable:!1,configurable:!0}),e.prototype._validate=function(e,t){if(!e)throw new Error("source cannot be undefined or null for Logger");if(!t)throw new Error("data cannot be undefined or null")},e.prototype._setData=function(e){"string"==typeof e?this._message=e.substr(0,this._maxMessageLength):e instanceof Error&&(this._error=e)},e.prototype._getPrefix=function(){var e="".concat(this._source);return this._scope&&!this._scope.isEmpty()&&(e="".concat(this._scope.id.substr(0,this._maxSourceLength),".").concat(e)),"".concat(e)},e.prototype._getScope=function(e){var t;return e&&e.whenFinished(function(){t=e.consume(s)}),t},e.logManager=new d,e}();!function(e){e[e.Verbose=1]="Verbose",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error"}(a||(a={}));var u,f=function(){function e(){}return e.prototype.log=function(e){console.log("Error: ".concat(e.data,", ")+"Event Name: ".concat(e.eventName,", ")+"Result Code: ".concat(e.resultCode))},e.prototype.verbose=function(e){console.log("Error: ".concat(e.data,", Event Name: ").concat(e.eventName))},e}(),p=function(){function e(){}return e._addHandler=function(t){e._logManager.addHandler(t.log),e._logManager.processAll(t.log),e._verboseLogManager.addHandler(t.verbose),e._verboseLogManager.processAll(t.verbose)},e.logError=function(e,t,n,a){i.Validate.isNotNullOrUndefined(t,"error"),this._log(e,t,n,!0,a)},e.logErrorData=function(e){i.Validate.isNotNullOrUndefined(e.error,"error");var t=e.logEntry?e.logEntry.toString():e.error;this._log(e.source,t,e.eventName,!0,e.resultCode,e.serviceScope)},e.logVerbose=function(e,t,n){i.Validate.isNonemptyString(t,"message"),this._log(e,t,n,!1,void 0)},e.logVerboseData=function(e){var t=e.logEntry?e.logEntry.toString():e.message;this._log(e.source,t,e.eventName,!1,void 0,e.serviceScope)},e.logErrorWithLogEntry=function(e,t,n,a){i.Validate.isNotNullOrUndefined(e,"source"),i.Validate.isNotNullOrUndefined(t,"logEntry"),this._log(e,t.toString(),n,!0,a)},Object.defineProperty(e,"shouldWriteToConsole",{get:function(){return e._shouldWriteToConsole},set:function(t){e._shouldWriteToConsole&&!t?(e._logManager.removeHandler(e._defaultLogger.log),e._verboseLogManager.removeHandler(e._defaultLogger.verbose)):!e._shouldWriteToConsole&&t&&(e._logManager.addHandler(e._defaultLogger.log),e._verboseLogManager.addHandler(e._defaultLogger.verbose)),e._shouldWriteToConsole=t},enumerable:!1,configurable:!0}),e.logVerboseWithLogEntry=function(e,t,n){i.Validate.isNotNullOrUndefined(t,"LogEntry"),this._log(e,t.toString(),n,!1,void 0)},e._log=function(t,n,i,r,o,s){var c,d=this._addEventPrefix(t,i);r?(c=l.log(d,n,a.Error,s),e._logManager.log({data:n,eventName:c.prefix,resultCode:o})):(c=l.log(d,n.toString(),a.Verbose,s),e._verboseLogManager.log({data:n,eventName:c.prefix})),e.shouldWriteToConsole&&this._writeToConsole(c,r,o)},e._addEventPrefix=function(e,t){return t?"".concat(e.id,".").concat(t):e.id},e._writeToConsole=function(e,t,n){var a=e.toString();n&&(a+=". resultCode: ".concat(n)),t?console.error(a):console.log(a)},e._logManager=new d,e._verboseLogManager=new d,e._defaultLogger=new f,e._shouldWriteToConsole=!1,e}(),m=function(){function e(){}return e.None="None",e}();!function(e){e[e.Trace=1]="Trace",e[e.Event=2]="Event",e[e.Error=3]="Error"}(u||(u={}));var _,h,b,g,v=u,y=function(){function e(e,t,n,a,i){if(void 0===t&&(t=m.None),void 0===n&&(n=v.Trace),!e)throw new Error("moduleName is invalid");this.moduleName=e,this.logFeature=t,this.logType=n,this.logProperties=a,this.isIntentional=i}return e.prototype.toString=function(){var e=void 0;if(this.logProperties)try{e=JSON.stringify(this.logProperties)}catch(e){console.log("Error happens in toString():"+e)}return"".concat(this.moduleName," | ").concat(this.logFeature," | ").concat(this.logType," | ").concat(e)},e}(),S=n("Pk8u"),D=function(){function e(){}return e.initialize=function(e){this.settings=Object(S.cloneDeep)(e),this._initialized=!0,this._normalizeContextIds()},e.updateSettings=function(e){this.settings=Object(S.merge)(this.settings,e),this._normalizeContextIds()},Object.defineProperty(e,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),e._normalizeId=function(e){var t=i.Guid.tryParse(e);return(null==t?void 0:t.toString())||e},e._normalizeContextIds=function(){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)))},e._initialized=!1,e}(),I=function(){function e(){}return e.initialize=function(t){e._isInitialized||(D.initialize(t),p.shouldWriteToConsole=t.enableConsoleLog,p._addHandler({log:function(e){i.Log.info(e.eventName,"EventName:".concat(e.data.toString(),", ResultCode: ").concat(e.resultCode))},verbose:function(e){i.Log.verbose(e.eventName,e.data.toString())}}),e._isInitialized=!0)},Object.defineProperty(e,"isInitialized",{get:function(){return this._isInitialized},enumerable:!1,configurable:!0}),e.updateSettings=function(e){D.updateSettings(e)},e._isInitialized=!1,e}();!function(e){e[e.NotPromoted=0]="NotPromoted",e[e.Promoted=2]="Promoted"}(_||(_={})),function(e){e.News="News",e.Article="Article",e.Home="Home",e.Space="Space",e.NewsDigest="NewsDigest"}(h||(h={})),function(e){e.Sharepoint="Sharepoint",e.Teams="Teams"}(b||(b={})),function(e){e.TeamSite="1",e.GroupSite="64",e.SitePagePublishing="68"}(g||(g={}));var x=function(){function e(){}return e._addHandler=function(t){e._handler=function(e){t.logData(e)},e._logManager.addHandler(e._handler)},e.startRealTimeProcessing=function(){this._shouldProcessInRealTime||(e._logManager.processAll(e._handler),this._shouldProcessInRealTime=!0)},e.log=function(t){e._logEngagementData(t)},e.logEvent=function(t,n){var a={name:t};n&&0!==n.length&&(a.extraData={action:n}),e._logEngagementData(a)},e.logEventWithLogEntry=function(t){var n={isIntentional:t.isIntentional,name:t.moduleName+"."+t.logFeature,extraData:t.logProperties};e._logEngagementData(n,!0)},e._logEngagementData=function(t,n){if(void 0===n&&(n=!1),!t.name||0===t.name.length)throw new Error("LogEntry is invalid");e._checkValidTagName(t,n),e._addContextData(t),e._appendExtraData(t),e._logManager.log(t)},e._checkValidTagName=function(e,t){if(void 0===t&&(t=!1),!t&&!1===/(\w+)\.(\w+).(\w+)/gi.test(e.name))throw new Error("".concat(e.name," tagName does not follow AppName.ControlName.ActionName pattern"))},e._addContextData=function(e){if(D.isInitialized){var t=D.settings,n=t.listId,a=t.listItemUniqueId,i=t.siteId,r=t.webId;e.siteId=i,e.webId=r,n&&(e.listId=n,a&&(e.docId=a))}},e._appendExtraData=function(e){if(D.isInitialized){var t=D.settings.contextInfo;t&&(e.extraData||(e.extraData={}),function(e,t){t.pageId=e.pageId,t.isHub=e.isHubSite,e.isHubSite?(t.hubSiteId=e.hubSiteId,t.isAssociatedSite=!1):!e.isHubSite&&e.hubSiteId?t.isAssociatedSite=!0:t.isAssociatedSite=!1,!i._SPKillSwitch.isActivated("94d8aaa5-0ee4-48a7-a8f5-e03371f4d285")&&t.displayApp||(i._BrowserUtilities.isTeamsHosted()?(t.displayApp=b.Teams,e.isEduClass&&(t.isEduClass=!0)):t.displayApp=b.Sharepoint),t.userAgent=navigator.userAgent;var n,a=e.webTemplate;t.webTemplate=a,a===g.TeamSite?n="TeamSite":a===g.GroupSite?n="GroupSite":a===g.SitePagePublishing&&(n="CommunicationSite");var r=e.promotedState,o=e.pageType,s=o;o===h.Article&&(s=r===_.NotPromoted||void 0===r?h.Article:h.News),t.siteType=n,t.pageType=s}(t,e.extraData))}},e._logManager=new d,e}(),C=function(){function e(){}return e.prototype.verbose=function(e,t,n){l.log(e,t,a.Verbose,n)},e.prototype.info=function(e,t,n){l.log(e,t,a.Info,n)},e.prototype.warn=function(e,t,n){l.log(e,t,a.Warning,n)},e.prototype.error=function(e,t,n){l.log(e,t,a.Error,n)},e}(),O={Success:0,Failure:1,ExpectedFailure:2},w=function(){function e(){this._shouldExecuteInRealTime=!1,this._handlers={},this._executionEntries=[]}return Object.defineProperty(e.prototype,"shouldExecuteInRealTime",{get:function(){return this._shouldExecuteInRealTime},set:function(e){this._shouldExecuteInRealTime=e,this._shouldExecuteInRealTime&&this.flush()},enumerable:!1,configurable:!0}),e.prototype.addHandler=function(e,t){if(!this._containsHandler(e,t)){this._initializeHandlerArrayForKey(e);var n=this._handlers[e];-1===n.indexOf(t)&&n.push(t)}},e.prototype.addExecutionEntry=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.freeze(t),this._shouldExecuteInRealTime?this._processExecutionEntry(e,t):this._executionEntries.push({key:e,args:t})},e.prototype.removeHandler=function(e,t){var n=this._handlers[e].indexOf(t);n>-1&&this._handlers[e].splice(n,1)},e.prototype.reset=function(){this._handlers={},this._executionEntries=[]},e.prototype.flush=function(){this._processAllExecutionEntries(),this._executionEntries=[]},e.prototype._containsHandler=function(e,t){return null!==this._handlers[e]&&void 0!==this._handlers[e]&&this._handlers[e].indexOf(t)>-1},e.prototype._initializeHandlerArrayForKey=function(e){null!==this._handlers[e]&&void 0!==this._handlers[e]||(this._handlers[e]=[])},e.prototype._processAllExecutionEntries=function(){for(var e=0,t=this._executionEntries;e<t.length;e++){var n=t[e];if(n&&this._handlers[n.key])try{for(var a=0,i=this._handlers[n.key];a<i.length;a++)i[a].apply(this,n.args)}catch(e){console.error("failed to process execution entry:"+e.toString())}}},e.prototype._processExecutionEntry=function(e,t){for(var n=0;n<this._handlers[e].length;n++)try{this._handlers[e][n].apply(this,t)}catch(e){console.error("failed to process execution entry:"+e.toString())}},e}(),E=w,A=function(){function e(){this._qosEvents=new Map,this._deferExecutor=new E,this._shouldProcessInRealTime=!1,this.initializeLogger()}return Object.defineProperty(e,"instance",{get:function(){return this._instance||(this._instance=new e),this._instance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldProcessInRealTime",{get:function(){return this._shouldProcessInRealTime},set:function(e){this._shouldProcessInRealTime=e,this._deferExecutor.shouldExecuteInRealTime=e},enumerable:!1,configurable:!0}),e.prototype.setLogger=function(e){this._qosLogger=e},e.prototype.getQosEvent=function(e){return this._qosEvents.get(e)},e.prototype.startQosMonitor=function(e,t){this._qosEvents.has(e)||this._deferExecutor.addExecutionEntry("start",e,t)},e.prototype.writeQosEndResult=function(e,t){this._deferExecutor.addExecutionEntry("end",e,t)},e.prototype._startMonitor=function(e,t){this._qosLogger&&this._qosEvents.set(e,new this._qosLogger(t))},e.prototype._endMonitor=function(e,t){var n=this._qosEvents.get(e);n&&(n.end(t),this._qosEvents.delete(e))},e.prototype.initializeLogger=function(){var e=this;this._deferExecutor.addHandler("start",function(t,n){e._startMonitor(t,n)}),this._deferExecutor.addHandler("end",function(t,n){e._endMonitor(t,n)})},e}(),L=function(){function e(e,t,n){var a;void 0===t&&(t=!1),void 0===n&&(n=!1),this._qosResultTypeValue=((a={})[O.Success]="Success",a[O.Failure]="Failure",a[O.ExpectedFailure]="ExpectedFailure",a),i.Validate.isNonemptyString(e,"scenarioName"),this._id=i.Guid.newGuid().toString(),this._isDebugSession()||A.instance.startQosMonitor(this._id,{name:e}),this._scenarioName=e,this._hasEnded=!1,this._copyToCosmos=t,this._copyToInterana=n}return e.startRealTimeProcessing=function(){A.instance.shouldProcessInRealTime||this._shouldProcessInRealTime(!0)},e._shouldProcessInRealTime=function(e){A.instance.shouldProcessInRealTime=e},Object.defineProperty(e.prototype,"name",{get:function(){return this._scenarioName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shortEventName",{get:function(){return"Qos"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resultCode",{get:function(){return this._endResultCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resultType",{get:function(){return this._endResult},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._endExtraData},set:function(e){this._endExtraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasEnded",{get:function(){return this._hasEnded},enumerable:!1,configurable:!0}),e.prototype.writeSuccess=function(e){this._writeQosEnd(O.Success,void 0,void 0,e)},e.prototype.writeUnexpectedFailure=function(e,t,n){void 0===e&&(e="DefaultUnexpected"),this._writeQosEnd(O.Failure,e,t,n)},e.prototype.writeExpectedFailure=function(e,t,n){void 0===e&&(e="DefaultExpected"),this._writeQosEnd(O.ExpectedFailure,e,t,n)},e.prototype._writeQosEnd=function(e,t,n,a){if(!this._shouldSkip(e)){this._ensureCorrelationId(e,a),this._endResultCode=t,this._endResult=e;var i={resultCode:this._endResultCode,resultType:this._endResult,error:n?n.message:void 0,extraData:this._endExtraData};A.instance.writeQosEndResult(this._id,i),this._writeToEngagement()}},e.prototype._ensureCorrelationId=function(e,t){var n=this;if(t&&(this._ensureEndExtraData(),Object.keys(t).forEach(function(e){return n._endExtraData[e]=t[e]})),D.isInitialized&&e!==O.Success){var a="CorrelationId",i=this._endExtraData&&(this._endExtraData[a]||this._endExtraData.correlationId)||D.settings.correlationId;i&&(this._endExtraData||(this._endExtraData={}),this._endExtraData[a]=i)}this._logHostType()},e.prototype._ensureEndExtraData=function(){this._endExtraData||(this._endExtraData={})},e.prototype._logHostType=function(){var e;if(D.isInitialized){var t=void 0;if(i._SPKillSwitch.isActivated("337aabd0-f050-467c-9728-dff6b2562cb0")){var n=!i._SPKillSwitch.isActivated("134e389a-67d1-4cf2-8516-d592c1079276")&&i._BrowserUtilities.isMEEBridgeApplicationHosted();if(n||i._BrowserUtilities.isTeamsHosted()){n?t="MEEBridge":i._BrowserUtilities.isViva1PHosted()?t="Viva1p":(null===(e=D.settings.contextInfo)||void 0===e?void 0:e.isEduClass)&&(t="ClassHome");var a=i._BrowserUtilities.isTeamsBrowserHosted()?"TeamsWeb":"TeamsNative";t=t?"".concat(t,"_").concat(a):a}}else t=i._BrowserUtilities.getTeamsAppType();if(t){this._ensureEndExtraData();var r="appHostType";this._endExtraData[r]||(this._endExtraData[r]=t)}}},e.prototype._isDebugSession=function(){return!!sessionStorage.getItem("spfx-debug")},e.prototype._shouldSkip=function(t){if(this._hasEnded&&void 0!==this._endResult){var n=i.Text.format(e.qosMonitorHasEndedErrorString,this.name,this._qosResultTypeValue[this._endResult],this._qosResultTypeValue[t]);return this._endResult!==t&&p.logError(e.logSource,new Error(n)),!0}return this._hasEnded=!0,this._isDebugSession()},e.prototype._writeToEngagement=function(){if(this._copyToInterana&&x.log({name:this.name,isIntentional:!!(this.extraData||{}).isIntentional,extraData:this.extraData||{}}),this._copyToCosmos){var e={name:"Spfx.Qos.ToEngagement",extraData:this.extraData||{}};e.extraData.qosName=this.name,this.resultType&&(e.extraData.qosResultType=this._qosResultTypeValue[this.resultType]),this.resultCode&&(e.extraData.qosResultCode=this.resultCode),x.log(e)}},e.logSource={id:"QosMonitor"},e.qosMonitorHasEndedErrorString="QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.",e}(),k=n("17wl"),M={StaticReliabilityQos95Sev4:"StaticReliabilityQos95Sev4",DynamicReliabilityQosMediumSev4:"DynamicReliabilityQosMediumSev4",DynamicReliabilityExpectedFailureHighSev4:"DynamicReliabilityExpectedFailureHighSev4"},P=function(e){function t(t,n,a){void 0===a&&(a=!1);var i=e.call(this,t,!1,a)||this;return i._autoAlertableMonitorType=n,i}return Object(k.__extends)(t,e),t.prototype.writeSuccess=function(t){e.prototype.writeSuccess.call(this,this.getExtraDataWithAutoAlertableFields(t))},t.prototype.writeUnexpectedFailure=function(t,n,a){void 0===t&&(t="DefaultUnexpected"),e.prototype.writeUnexpectedFailure.call(this,t,n,this.getExtraDataWithAutoAlertableFields(a))},t.prototype.writeExpectedFailure=function(t,n,a){void 0===t&&(t="DefaultExpected"),e.prototype.writeExpectedFailure.call(this,t,n,this.getExtraDataWithAutoAlertableFields(a))},t.prototype.getExtraDataWithAutoAlertableFields=function(e){var t=null!=e?e:{};return t.autoAlertableMonitorType=M[this._autoAlertableMonitorType],t},t}(L),T=function(e){function t(t,n,a){void 0===n&&(n=!1);var i=e.call(this,t,!1,n)||this;return i._extraDataForCustomerPromise=a,i}return Object(k.__extends)(t,e),t.prototype.writeUnexpectedFailure=function(t,n,a){void 0===t&&(t="DefaultUnexpected"),e.prototype.writeUnexpectedFailure.call(this,t,n,a),this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",t,O.Failure,a)},t.prototype.writeExpectedFailure=function(t,n,a){void 0===t&&(t="DefaultExpected"),e.prototype.writeExpectedFailure.call(this,t,n,a),this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",t,O.ExpectedFailure,a)},t.prototype._logCustomerPromiseFailure=function(e,t,n,a){void 0===n&&(n=O.Failure),this._extraDataForCustomerPromise&&this._extraDataForCustomerPromise.forEach(function(i){var r=i.errorModuleName,o=i.logFailure,s=i.veto;o({errorCode:r,errorScenario:t,errorMessage:e,resultType:n,pageType:null==a?void 0:a.pageType,errorStack:null==a?void 0:a.errorStack,veto:s})})},t}(L)}})});
|
|
1
|
+
define("78359e4b-07c2-43c6-8d0b-d060b4d577e8_1.18.0",["tslib","@microsoft/sp-lodash-subset","@microsoft/sp-core-library"],function(n,a,i){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="mwqp")}({"17wl":function(e,t){e.exports=n},Pk8u:function(e,t){e.exports=a},UWqr:function(e,t){e.exports=i},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"_TraceLogger",function(){return p}),n.d(t,"_LogEntry",function(){return y}),n.d(t,"_LogFeature",function(){return m}),n.d(t,"_LogSource",function(){return o}),n.d(t,"_logSourceServiceKey",function(){return s}),n.d(t,"_LogType",function(){return v}),n.d(t,"_Diagnostics",function(){return I}),n.d(t,"_PromotedState",function(){return _}),n.d(t,"_PageType",function(){return h}),n.d(t,"_LogEvent",function(){return l}),n.d(t,"_LogLevel",function(){return a}),n.d(t,"_CircularBuffer",function(){return c}),n.d(t,"_LogManager",function(){return d}),n.d(t,"_EngagementLogger",function(){return x}),n.d(t,"_LogHandler",function(){return C}),n.d(t,"_QosMonitor",function(){return k}),n.d(t,"_AutoAlertableQosMonitor",function(){return T}),n.d(t,"_AutoAlertableMonitorType",function(){return P}),n.d(t,"_QosMonitorShareFailureWithCP",function(){return U}),n.d(t,"_QosLogger",function(){return A}),n.d(t,"_QosResultType",function(){return O}),n.d(t,"_ExecutionQueue",function(){return E});var a,i=n("UWqr"),r=function(){function e(e){i.Validate.isNotNullOrUndefined(e,"id"),this._id=e}return e.create=function(t){return new e(t)},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._id.length},e}(),o=r,s=i.ServiceKey.createCustom("sp-client-base:LogSource",function(e){return r.create("")}),c=function(){function e(e){if(this._head=-1,this._count=0,this._isIterating=!1,e<=0)throw new Error("Size must be positive");this._size=e,this._buffer=new Array(e)}return Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),e.prototype.push=function(e){this._ensureNotIterating(),this._head++,this._count++,this._head===this._size&&(this._head=0),this._buffer[this._head]=e},e.prototype.forEach=function(e){if(0!==this._count){this._isIterating=!0;try{for(var t=this._tail,n=0;n<this._size&&(e(this._buffer[t]),t!==this._head);n++)t=this._getNext(t)}finally{this._isIterating=!1}}},e.prototype.removeAll=function(){this._ensureNotIterating(),this._head=-1,this._count=0},Object.defineProperty(e.prototype,"_tail",{get:function(){return this._isNotWrapped()?0:this._getNext(this._head)},enumerable:!1,configurable:!0}),e.prototype._isNotWrapped=function(){return this._count===this._head+1},e.prototype._getNext=function(e){var t=e+1;return t===this._size&&(t=0),t},e.prototype._ensureNotIterating=function(){if(this._isIterating)throw new Error("Circular buffer cannot be modified during iteration")},e}(),d=function(){function e(t){this._shouldLogInRealTime=[],this._handlers=[],this._events=new c(e._maxVerboseLog),t&&this.addHandler(t)}return Object.defineProperty(e,"_maxVerboseLog",{get:function(){return 5e3},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.addHandler=function(e){this._containsHandler(e)||(this._handlers.push(e),this._shouldLogInRealTime.push(!1))},e.prototype.log=function(e){Object.freeze(e),this._events.push(e),this._processLogEvent(e)},e.prototype.removeHandler=function(e){var t=this._handlers.indexOf(e);t>-1&&(this._handlers.splice(t,1),this._shouldLogInRealTime.splice(t,1))},e.prototype.reset=function(){this._handlers=[],this._shouldLogInRealTime=[],this._events.removeAll()},e.prototype.processAll=function(e){this._handlers.indexOf(e)>-1&&this._processAllEvents(e)},e.prototype._containsHandler=function(e){for(var t=0,n=this._handlers;t<n.length;t++)if(n[t]===e)return!0;return!1},e.prototype._processAllEvents=function(e){this._events.forEach(function(t){if(t)try{e(t)}catch(e){console.error("failed to handle event:"+e.toString())}}),this._shouldLogInRealTime[this._handlers.indexOf(e)]=!0},e.prototype._processLogEvent=function(e){for(var t=0;t<this._handlers.length;t++)if(this._shouldLogInRealTime[t]&&e)try{this._handlers[t](e)}catch(e){console.error("failed to handle event:"+e.toString())}},e}(),l=function(){function e(e,t,n,a){this._validate(e,t),this._timestamp=(new Date).getTime(),this._scope=this._getScope(a),this._source=e.substr(0,this._maxSourceLength),this._setData(t),this._level=n,this._prefix=this._getPrefix()}return e.log=function(t,n,a,i){var r=new e(t,n,a,i);return e.logManager.log(r),r},e.prototype.toString=function(){var e="[".concat(this._timestamp,"][").concat(this._prefix,"]");return this._message?"".concat(e," ").concat(this._message):this._error?"".concat(e," ").concat(this._error.toString()):e},Object.defineProperty(e.prototype,"timestamp",{get:function(){return this._timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this._level},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prefix",{get:function(){return this._prefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this._scope},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_maxSourceLength",{get:function(){return 30},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_maxMessageLength",{get:function(){return 150},enumerable:!1,configurable:!0}),e.prototype._validate=function(e,t){if(!e)throw new Error("source cannot be undefined or null for Logger");if(!t)throw new Error("data cannot be undefined or null")},e.prototype._setData=function(e){"string"==typeof e?this._message=e.substr(0,this._maxMessageLength):e instanceof Error&&(this._error=e)},e.prototype._getPrefix=function(){var e="".concat(this._source);return this._scope&&!this._scope.isEmpty()&&(e="".concat(this._scope.id.substr(0,this._maxSourceLength),".").concat(e)),"".concat(e)},e.prototype._getScope=function(e){var t;return e&&e.whenFinished(function(){t=e.consume(s)}),t},e.logManager=new d,e}();!function(e){e[e.Verbose=1]="Verbose",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error"}(a||(a={}));var u,f=function(){function e(){}return e.prototype.log=function(e){console.log("Error: ".concat(e.data,", ")+"Event Name: ".concat(e.eventName,", ")+"Result Code: ".concat(e.resultCode))},e.prototype.verbose=function(e){console.log("Error: ".concat(e.data,", Event Name: ").concat(e.eventName))},e}(),p=function(){function e(){}return e._addHandler=function(t){e._logManager.addHandler(t.log),e._logManager.processAll(t.log),e._verboseLogManager.addHandler(t.verbose),e._verboseLogManager.processAll(t.verbose)},e.logError=function(e,t,n,a){i.Validate.isNotNullOrUndefined(t,"error"),this._log(e,t,n,!0,a)},e.logErrorData=function(e){i.Validate.isNotNullOrUndefined(e.error,"error");var t=e.logEntry?e.logEntry.toString():e.error;this._log(e.source,t,e.eventName,!0,e.resultCode,e.serviceScope)},e.logVerbose=function(e,t,n){i.Validate.isNonemptyString(t,"message"),this._log(e,t,n,!1,void 0)},e.logVerboseData=function(e){var t=e.logEntry?e.logEntry.toString():e.message;this._log(e.source,t,e.eventName,!1,void 0,e.serviceScope)},e.logErrorWithLogEntry=function(e,t,n,a){i.Validate.isNotNullOrUndefined(e,"source"),i.Validate.isNotNullOrUndefined(t,"logEntry"),this._log(e,t.toString(),n,!0,a)},Object.defineProperty(e,"shouldWriteToConsole",{get:function(){return e._shouldWriteToConsole},set:function(t){e._shouldWriteToConsole&&!t?(e._logManager.removeHandler(e._defaultLogger.log),e._verboseLogManager.removeHandler(e._defaultLogger.verbose)):!e._shouldWriteToConsole&&t&&(e._logManager.addHandler(e._defaultLogger.log),e._verboseLogManager.addHandler(e._defaultLogger.verbose)),e._shouldWriteToConsole=t},enumerable:!1,configurable:!0}),e.logVerboseWithLogEntry=function(e,t,n){i.Validate.isNotNullOrUndefined(t,"LogEntry"),this._log(e,t.toString(),n,!1,void 0)},e._log=function(t,n,i,r,o,s){var c,d=this._addEventPrefix(t,i);r?(c=l.log(d,n,a.Error,s),e._logManager.log({data:n,eventName:c.prefix,resultCode:o})):(c=l.log(d,n.toString(),a.Verbose,s),e._verboseLogManager.log({data:n,eventName:c.prefix})),e.shouldWriteToConsole&&this._writeToConsole(c,r,o)},e._addEventPrefix=function(e,t){return t?"".concat(e.id,".").concat(t):e.id},e._writeToConsole=function(e,t,n){var a=e.toString();n&&(a+=". resultCode: ".concat(n)),t?console.error(a):console.log(a)},e._logManager=new d,e._verboseLogManager=new d,e._defaultLogger=new f,e._shouldWriteToConsole=!1,e}(),m=function(){function e(){}return e.None="None",e}();!function(e){e[e.Trace=1]="Trace",e[e.Event=2]="Event",e[e.Error=3]="Error"}(u||(u={}));var _,h,b,g,v=u,y=function(){function e(e,t,n,a,i){if(void 0===t&&(t=m.None),void 0===n&&(n=v.Trace),!e)throw new Error("moduleName is invalid");this.moduleName=e,this.logFeature=t,this.logType=n,this.logProperties=a,this.isIntentional=i}return e.prototype.toString=function(){var e=void 0;if(this.logProperties)try{e=JSON.stringify(this.logProperties)}catch(e){console.log("Error happens in toString():"+e)}return"".concat(this.moduleName," | ").concat(this.logFeature," | ").concat(this.logType," | ").concat(e)},e}(),S=n("Pk8u"),D=function(){function e(){}return e.initialize=function(e){this.settings=Object(S.cloneDeep)(e),this._initialized=!0,this._normalizeContextIds()},e.updateSettings=function(e){this.settings=Object(S.merge)(this.settings,e),this._normalizeContextIds()},Object.defineProperty(e,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),e._normalizeId=function(e){var t=i.Guid.tryParse(e);return(null==t?void 0:t.toString())||e},e._normalizeContextIds=function(){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)))},e._initialized=!1,e}(),I=function(){function e(){}return e.initialize=function(t){e._isInitialized||(D.initialize(t),p.shouldWriteToConsole=t.enableConsoleLog,p._addHandler({log:function(e){i.Log.info(e.eventName,"EventName:".concat(e.data.toString(),", ResultCode: ").concat(e.resultCode))},verbose:function(e){i.Log.verbose(e.eventName,e.data.toString())}}),e._isInitialized=!0)},Object.defineProperty(e,"isInitialized",{get:function(){return this._isInitialized},enumerable:!1,configurable:!0}),e.updateSettings=function(e){D.updateSettings(e)},e._isInitialized=!1,e}();!function(e){e[e.NotPromoted=0]="NotPromoted",e[e.Promoted=2]="Promoted"}(_||(_={})),function(e){e.News="News",e.Article="Article",e.Home="Home",e.Space="Space",e.NewsDigest="NewsDigest"}(h||(h={})),function(e){e.Sharepoint="Sharepoint",e.Teams="Teams"}(b||(b={})),function(e){e.TeamSite="1",e.GroupSite="64",e.SitePagePublishing="68"}(g||(g={}));var x=function(){function e(){}return e._addHandler=function(t){e._handler=function(e){t.logData(e)},e._logManager.addHandler(e._handler)},e.startRealTimeProcessing=function(){this._shouldProcessInRealTime||(e._logManager.processAll(e._handler),this._shouldProcessInRealTime=!0)},e.log=function(t){e._logEngagementData(t)},e.logEvent=function(t,n){var a={name:t};n&&0!==n.length&&(a.extraData={action:n}),e._logEngagementData(a)},e.logEventWithLogEntry=function(t){var n={isIntentional:t.isIntentional,name:t.moduleName+"."+t.logFeature,extraData:t.logProperties};e._logEngagementData(n,!0)},e._logEngagementData=function(t,n){if(void 0===n&&(n=!1),!t.name||0===t.name.length)throw new Error("LogEntry is invalid");e._checkValidTagName(t,n),e._addContextData(t),e._appendExtraData(t),e._logManager.log(t)},e._checkValidTagName=function(e,t){if(void 0===t&&(t=!1),!t&&!1===/(\w+)\.(\w+).(\w+)/gi.test(e.name))throw new Error("".concat(e.name," tagName does not follow AppName.ControlName.ActionName pattern"))},e._addContextData=function(e){if(D.isInitialized){var t=D.settings,n=t.listId,a=t.listItemUniqueId,i=t.siteId,r=t.webId;e.siteId=i,e.webId=r,n&&(e.listId=n,a&&(e.docId=a))}},e._appendExtraData=function(e){if(D.isInitialized){var t=D.settings.contextInfo;t&&(e.extraData||(e.extraData={}),function(e,t){t.pageId=e.pageId,t.isHub=e.isHubSite,e.isHubSite?(t.hubSiteId=e.hubSiteId,t.isAssociatedSite=!1):!e.isHubSite&&e.hubSiteId?t.isAssociatedSite=!0:t.isAssociatedSite=!1,!i._SPKillSwitch.isActivated("94d8aaa5-0ee4-48a7-a8f5-e03371f4d285")&&t.displayApp||(i._BrowserUtilities.isTeamsHosted()?(t.displayApp=b.Teams,e.isEduClass&&(t.isEduClass=!0)):t.displayApp=b.Sharepoint),t.userAgent=navigator.userAgent;var n,a=e.webTemplate;t.webTemplate=a,a===g.TeamSite?n="TeamSite":a===g.GroupSite?n="GroupSite":a===g.SitePagePublishing&&(n="CommunicationSite");var r=e.promotedState,o=e.pageType,s=o;o===h.Article&&(s=r===_.NotPromoted||void 0===r?h.Article:h.News),t.siteType=n,t.pageType=s}(t,e.extraData))}},e._logManager=new d,e}(),C=function(){function e(){}return e.prototype.verbose=function(e,t,n){l.log(e,t,a.Verbose,n)},e.prototype.info=function(e,t,n){l.log(e,t,a.Info,n)},e.prototype.warn=function(e,t,n){l.log(e,t,a.Warning,n)},e.prototype.error=function(e,t,n){l.log(e,t,a.Error,n)},e}(),O={Success:0,Failure:1,ExpectedFailure:2},w=function(){function e(){this._shouldExecuteInRealTime=!1,this._handlers={},this._executionEntries=[]}return Object.defineProperty(e.prototype,"shouldExecuteInRealTime",{get:function(){return this._shouldExecuteInRealTime},set:function(e){this._shouldExecuteInRealTime=e,this._shouldExecuteInRealTime&&this.flush()},enumerable:!1,configurable:!0}),e.prototype.addHandler=function(e,t){if(!this._containsHandler(e,t)){this._initializeHandlerArrayForKey(e);var n=this._handlers[e];-1===n.indexOf(t)&&n.push(t)}},e.prototype.addExecutionEntry=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.freeze(t),this._shouldExecuteInRealTime?this._processExecutionEntry(e,t):this._executionEntries.push({key:e,args:t})},e.prototype.removeHandler=function(e,t){var n=this._handlers[e].indexOf(t);n>-1&&this._handlers[e].splice(n,1)},e.prototype.reset=function(){this._handlers={},this._executionEntries=[]},e.prototype.flush=function(){this._processAllExecutionEntries(),this._executionEntries=[]},e.prototype._containsHandler=function(e,t){return null!==this._handlers[e]&&void 0!==this._handlers[e]&&this._handlers[e].indexOf(t)>-1},e.prototype._initializeHandlerArrayForKey=function(e){null!==this._handlers[e]&&void 0!==this._handlers[e]||(this._handlers[e]=[])},e.prototype._processAllExecutionEntries=function(){for(var e=0,t=this._executionEntries;e<t.length;e++){var n=t[e];if(n&&this._handlers[n.key])try{for(var a=0,i=this._handlers[n.key];a<i.length;a++)i[a].apply(this,n.args)}catch(e){console.error("failed to process execution entry:"+e.toString())}}},e.prototype._processExecutionEntry=function(e,t){for(var n=0;n<this._handlers[e].length;n++)try{this._handlers[e][n].apply(this,t)}catch(e){console.error("failed to process execution entry:"+e.toString())}},e}(),E=w,A=function(){function e(){this._qosEvents=new Map,this._deferExecutor=new E,this._shouldProcessInRealTime=!1,this._initializeLogger()}return Object.defineProperty(e,"instance",{get:function(){return this._instance||(this._instance=new e),this._instance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldProcessInRealTime",{get:function(){return this._shouldProcessInRealTime},set:function(e){this._shouldProcessInRealTime=e,this._deferExecutor.shouldExecuteInRealTime=e},enumerable:!1,configurable:!0}),e.prototype.setLogger=function(e){this._qosLogger=e},e.prototype.getQosEvent=function(e){return this._qosEvents.get(e)},e.prototype.startQosMonitor=function(e,t){this._qosEvents.has(e)||this._deferExecutor.addExecutionEntry("start",e,t)},e.prototype.writeQosEndResult=function(e,t){this._deferExecutor.addExecutionEntry("end",e,t)},e.prototype._startMonitor=function(e,t){this._qosLogger&&this._qosEvents.set(e,new this._qosLogger(t))},e.prototype._endMonitor=function(e,t){var n=this._qosEvents.get(e);n&&(n.end(t),this._qosEvents.delete(e))},e.prototype._initializeLogger=function(){var e=this;this._deferExecutor.addHandler("start",function(t,n){e._startMonitor(t,n)}),this._deferExecutor.addHandler("end",function(t,n){e._endMonitor(t,n)})},e}(),L={id:"QosMonitor"},k=function(){function e(e,t,n){var a;void 0===t&&(t=!1),void 0===n&&(n=!1),this._qosResultTypeValue=((a={})[O.Success]="Success",a[O.Failure]="Failure",a[O.ExpectedFailure]="ExpectedFailure",a),i.Validate.isNonemptyString(e,"scenarioName"),this._id=i.Guid.newGuid().toString(),this._isDebugSession()||A.instance.startQosMonitor(this._id,{name:e}),this._scenarioName=e,this._hasEnded=!1,this._copyToCosmos=t,this._copyToInterana=n}return e.startRealTimeProcessing=function(){A.instance.shouldProcessInRealTime||this._shouldProcessInRealTime(!0)},e._shouldProcessInRealTime=function(e){A.instance.shouldProcessInRealTime=e},Object.defineProperty(e.prototype,"name",{get:function(){return this._scenarioName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shortEventName",{get:function(){return"Qos"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resultCode",{get:function(){return this._endResultCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resultType",{get:function(){return this._endResult},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._endExtraData},set:function(e){this._endExtraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasEnded",{get:function(){return this._hasEnded},enumerable:!1,configurable:!0}),e.prototype.writeSuccess=function(e){this._writeQosEnd(O.Success,void 0,void 0,e)},e.prototype.writeUnexpectedFailure=function(e,t,n){void 0===e&&(e="DefaultUnexpected"),this._writeQosEnd(O.Failure,e,t,n)},e.prototype.writeExpectedFailure=function(e,t,n){void 0===e&&(e="DefaultExpected"),this._writeQosEnd(O.ExpectedFailure,e,t,n)},e.prototype._writeQosEnd=function(e,t,n,a){if(!this._shouldSkip(e)){this._ensureCorrelationId(e,a),this._endResultCode=t,this._endResult=e;var i={resultCode:this._endResultCode,resultType:this._endResult,error:n?n.message:void 0,extraData:this._endExtraData};A.instance.writeQosEndResult(this._id,i),this._writeToEngagement()}},e.prototype._ensureCorrelationId=function(e,t){var n=this;if(t&&(this._ensureEndExtraData(),Object.keys(t).forEach(function(e){return n._endExtraData[e]=t[e]})),D.isInitialized&&e!==O.Success){var a="CorrelationId",i=this._endExtraData&&(this._endExtraData[a]||this._endExtraData.correlationId)||D.settings.correlationId;i&&(this._endExtraData||(this._endExtraData={}),this._endExtraData[a]=i)}this._logHostType()},e.prototype._ensureEndExtraData=function(){this._endExtraData||(this._endExtraData={})},e.prototype._logHostType=function(){var e;if(D.isInitialized){var t=void 0;if(i._SPKillSwitch.isActivated("337aabd0-f050-467c-9728-dff6b2562cb0")){var n=!i._SPKillSwitch.isActivated("134e389a-67d1-4cf2-8516-d592c1079276")&&i._BrowserUtilities.isMEEBridgeApplicationHosted();if(n||i._BrowserUtilities.isTeamsHosted()){n?t="MEEBridge":i._BrowserUtilities.isViva1PHosted()?t="Viva1p":(null===(e=D.settings.contextInfo)||void 0===e?void 0:e.isEduClass)&&(t="ClassHome");var a=i._BrowserUtilities.isTeamsBrowserHosted()?"TeamsWeb":"TeamsNative";t=t?"".concat(t,"_").concat(a):a}}else t=i._BrowserUtilities.getTeamsAppType();if(t){this._ensureEndExtraData();var r="appHostType";this._endExtraData[r]||(this._endExtraData[r]=t)}}},e.prototype._isDebugSession=function(){return!!i._BrowserUtilities.safelyAccessSessionStorage("spfx-debug")},e.prototype._shouldSkip=function(e){if(this._hasEnded&&void 0!==this._endResult){var t=i.Text.format("QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.",this.name,this._qosResultTypeValue[this._endResult],this._qosResultTypeValue[e]);return this._endResult!==e&&p.logError(L,new Error(t)),!0}return this._hasEnded=!0,this._isDebugSession()},e.prototype._writeToEngagement=function(){if(this._copyToInterana&&x.log({name:this.name,isIntentional:!!(this.extraData||{}).isIntentional,extraData:this.extraData||{}}),this._copyToCosmos){var e={name:"Spfx.Qos.ToEngagement",extraData:this.extraData||{}};e.extraData.qosName=this.name,this.resultType&&(e.extraData.qosResultType=this._qosResultTypeValue[this.resultType]),this.resultCode&&(e.extraData.qosResultCode=this.resultCode),x.log(e)}},e}(),M=n("17wl"),P={StaticReliabilityQos95Sev4:"StaticReliabilityQos95Sev4",DynamicReliabilityQosMediumSev4:"DynamicReliabilityQosMediumSev4",DynamicReliabilityExpectedFailureHighSev4:"DynamicReliabilityExpectedFailureHighSev4"},T=function(e){function t(t,n,a){void 0===a&&(a=!1);var i=e.call(this,t,!1,a)||this;return i._autoAlertableMonitorType=n,i}return Object(M.__extends)(t,e),t.prototype.writeSuccess=function(t){e.prototype.writeSuccess.call(this,this._getExtraDataWithAutoAlertableFields(t))},t.prototype.writeUnexpectedFailure=function(t,n,a){void 0===t&&(t="DefaultUnexpected"),e.prototype.writeUnexpectedFailure.call(this,t,n,this._getExtraDataWithAutoAlertableFields(a))},t.prototype.writeExpectedFailure=function(t,n,a){void 0===t&&(t="DefaultExpected"),e.prototype.writeExpectedFailure.call(this,t,n,this._getExtraDataWithAutoAlertableFields(a))},t.prototype._getExtraDataWithAutoAlertableFields=function(e){var t=null!=e?e:{};return t.autoAlertableMonitorType=P[this._autoAlertableMonitorType],t},t}(k),U=function(e){function t(t,n,a){void 0===n&&(n=!1);var i=e.call(this,t,!1,n)||this;return i._extraDataForCustomerPromise=a,i}return Object(M.__extends)(t,e),t.prototype.writeUnexpectedFailure=function(t,n,a){void 0===t&&(t="DefaultUnexpected"),e.prototype.writeUnexpectedFailure.call(this,t,n,a),this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",t,O.Failure,a)},t.prototype.writeExpectedFailure=function(t,n,a){void 0===t&&(t="DefaultExpected"),e.prototype.writeExpectedFailure.call(this,t,n,a),this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",t,O.ExpectedFailure,a)},t.prototype._logCustomerPromiseFailure=function(e,t,n,a){void 0===n&&(n=O.Failure),this._extraDataForCustomerPromise&&this._extraDataForCustomerPromise.forEach(function(i){var r=i.errorModuleName,o=i.logFailure,s=i.veto;o({errorCode:r,errorScenario:t,errorMessage:e,resultType:n,pageType:null==a?void 0:a.pageType,errorStack:null==a?void 0:a.errorStack,veto:s})})},t}(k)}})});
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -10,6 +10,7 @@ var DefaultEngagementHandler = /** @class */ (function () {
|
|
|
10
10
|
* Default implementation for logData function.
|
|
11
11
|
*/
|
|
12
12
|
DefaultEngagementHandler.prototype.logData = function (data) {
|
|
13
|
+
// eslint-disable-next-line no-console
|
|
13
14
|
console.log("TagName: ".concat(data.name, ", Action Name: ").concat(data.extraData));
|
|
14
15
|
};
|
|
15
16
|
return DefaultEngagementHandler;
|
|
@@ -10,6 +10,7 @@ var DefaultEngagementImplementation = /** @class */ (function () {
|
|
|
10
10
|
* Default implementation for logData function.
|
|
11
11
|
*/
|
|
12
12
|
DefaultEngagementImplementation.prototype.logData = function (data) {
|
|
13
|
+
// eslint-disable-next-line no-console
|
|
13
14
|
console.log(data.name, data.extraData);
|
|
14
15
|
};
|
|
15
16
|
return DefaultEngagementImplementation;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation.All rights reserved.
|
|
4
|
-
* @file EngagementLogger.ts
|
|
5
|
-
* EngagementLogger logger
|
|
6
|
-
*/
|
|
7
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
3
|
var tslib_1 = require("tslib");
|
|
9
4
|
var LogManager_1 = tslib_1.__importDefault(require("../LogManager/LogManager"));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation. All rights reserved.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
/**
|
|
7
4
|
* ExecutionQueue allows multiple handlers to be processed in real time or deferred.
|
|
@@ -115,6 +112,7 @@ var ExecutionQueue = /** @class */ (function () {
|
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
catch (e) {
|
|
115
|
+
// eslint-disable-next-line no-console
|
|
118
116
|
console.error('failed to process execution entry:' + e.toString());
|
|
119
117
|
}
|
|
120
118
|
}
|
|
@@ -126,6 +124,7 @@ var ExecutionQueue = /** @class */ (function () {
|
|
|
126
124
|
this._handlers[key][i].apply(this, args);
|
|
127
125
|
}
|
|
128
126
|
catch (e) {
|
|
127
|
+
// eslint-disable-next-line no-console
|
|
129
128
|
console.error('failed to process execution entry:' + e.toString());
|
|
130
129
|
}
|
|
131
130
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation. All rights reserved.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
var tslib_1 = require("tslib");
|
|
7
4
|
var LogLevel_1 = require("../LogLevel");
|
|
@@ -16,25 +13,29 @@ var LogHandler = /** @class */ (function () {
|
|
|
16
13
|
LogHandler.prototype.verbose = function (source, message, scope) {
|
|
17
14
|
var event = LogEvent_1.default.log(source, message, LogLevel_1.LogLevel.Verbose, scope);
|
|
18
15
|
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
19
|
-
|
|
16
|
+
// eslint-disable-next-line no-console
|
|
17
|
+
console.log(event.toString());
|
|
20
18
|
}
|
|
21
19
|
};
|
|
22
20
|
LogHandler.prototype.info = function (source, message, scope) {
|
|
23
21
|
var event = LogEvent_1.default.log(source, message, LogLevel_1.LogLevel.Info, scope);
|
|
24
22
|
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
25
|
-
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.info(event.toString());
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
27
|
LogHandler.prototype.warn = function (source, message, scope) {
|
|
29
28
|
var event = LogEvent_1.default.log(source, message, LogLevel_1.LogLevel.Warning, scope);
|
|
30
29
|
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
31
|
-
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.warn(event.toString());
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
LogHandler.prototype.error = function (source, error, scope) {
|
|
35
35
|
var event = LogEvent_1.default.log(source, error, LogLevel_1.LogLevel.Error, scope);
|
|
36
36
|
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
37
|
-
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
38
|
+
console.error(event.toString());
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
return LogHandler;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file LogFeature.ts
|
|
4
|
-
* @Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Used for logging so you can filter logs by features.
|
|
6
|
-
*/
|
|
7
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
3
|
/**
|
|
9
4
|
* @internal
|
|
@@ -11,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
6
|
var LogFeature = /** @class */ (function () {
|
|
12
7
|
function LogFeature() {
|
|
13
8
|
}
|
|
14
|
-
/* tslint:disable:variable-name */
|
|
15
9
|
LogFeature.None = 'None';
|
|
16
10
|
return LogFeature;
|
|
17
11
|
}());
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @copyright Microsoft Corporation. All rights reserved.
|
|
6
|
-
*/
|
|
7
4
|
var CircularBuffer_1 = tslib_1.__importDefault(require("./CircularBuffer"));
|
|
8
5
|
/**
|
|
9
6
|
* LogManager allows multiple handlers to process log events.
|
|
@@ -101,6 +98,7 @@ var LogManager = /** @class */ (function () {
|
|
|
101
98
|
handler(event);
|
|
102
99
|
}
|
|
103
100
|
catch (e) {
|
|
101
|
+
// eslint-disable-next-line no-console
|
|
104
102
|
console.error('failed to handle event:' + e.toString());
|
|
105
103
|
}
|
|
106
104
|
}
|
|
@@ -114,6 +112,7 @@ var LogManager = /** @class */ (function () {
|
|
|
114
112
|
this._handlers[i](event);
|
|
115
113
|
}
|
|
116
114
|
catch (e) {
|
|
115
|
+
// eslint-disable-next-line no-console
|
|
117
116
|
console.error('failed to handle event:' + e.toString());
|
|
118
117
|
}
|
|
119
118
|
}
|
|
@@ -9,7 +9,7 @@ var QosMonitor_1 = tslib_1.__importDefault(require("./QosMonitor"));
|
|
|
9
9
|
*
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
//
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/typedef
|
|
13
13
|
exports.AutoAlertableMonitorType = {
|
|
14
14
|
/**
|
|
15
15
|
* If QoS drops below a static threshold of 95 for a period, a sev 4 is fired.
|
|
@@ -53,38 +53,40 @@ var AutoAlertableQosMonitor = /** @class */ (function (_super) {
|
|
|
53
53
|
* QoS monitor ends with success. Also writes AutoAlertableMonitorType to extraData.
|
|
54
54
|
* You will see success tag: SPPages.ScenarioName.Success
|
|
55
55
|
*/
|
|
56
|
-
|
|
57
|
-
) {
|
|
58
|
-
_super.prototype.writeSuccess.call(this, this.
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
AutoAlertableQosMonitor.prototype.writeSuccess = function (extraData) {
|
|
58
|
+
_super.prototype.writeSuccess.call(this, this._getExtraDataWithAutoAlertableFields(extraData));
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
61
|
* QoS monitor ends with failure. Also writes AutoAlertableMonitorType to extraData.
|
|
62
62
|
* You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
|
|
63
63
|
* <failuretag> will be filled with param tagName
|
|
64
64
|
*/
|
|
65
|
-
AutoAlertableQosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
66
|
-
|
|
65
|
+
AutoAlertableQosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
+
extraData) {
|
|
67
68
|
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultUnexpected'; }
|
|
68
|
-
_super.prototype.writeUnexpectedFailure.call(this, tagNameSuffix, ex, this.
|
|
69
|
+
_super.prototype.writeUnexpectedFailure.call(this, tagNameSuffix, ex, this._getExtraDataWithAutoAlertableFields(extraData));
|
|
69
70
|
};
|
|
70
71
|
/*
|
|
71
72
|
* QoS monitor ends with expected failure. Also writes AutoAlertableMonitorType to extraData.
|
|
72
73
|
* You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
|
|
73
74
|
* <failuretag> will be filled with param tagName
|
|
74
75
|
*/
|
|
75
|
-
AutoAlertableQosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
76
|
-
|
|
76
|
+
AutoAlertableQosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
+
extraData) {
|
|
77
79
|
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultExpected'; }
|
|
78
|
-
_super.prototype.writeExpectedFailure.call(this, tagNameSuffix, ex, this.
|
|
80
|
+
_super.prototype.writeExpectedFailure.call(this, tagNameSuffix, ex, this._getExtraDataWithAutoAlertableFields(extraData));
|
|
79
81
|
};
|
|
80
82
|
/**
|
|
81
83
|
* Gets the extraData with additional auto alertable dimensions to indicate this uses the easy
|
|
82
84
|
* alerting monitors.
|
|
83
85
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var returnedExtraData = extraData !== null && extraData !== void 0 ? extraData : {};
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
+
AutoAlertableQosMonitor.prototype._getExtraDataWithAutoAlertableFields = function (extraData) {
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
|
+
var returnedExtraData = extraData !== null && extraData !== void 0 ? extraData : {};
|
|
88
90
|
returnedExtraData.autoAlertableMonitorType = exports.AutoAlertableMonitorType[this._autoAlertableMonitorType];
|
|
89
91
|
return returnedExtraData;
|
|
90
92
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation. All rights reserved.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
var tslib_1 = require("tslib");
|
|
7
4
|
var ExecutionQueue_1 = tslib_1.__importDefault(require("../ExecutionQueue"));
|
|
@@ -14,7 +11,7 @@ var QosLogger = /** @class */ (function () {
|
|
|
14
11
|
this._qosEvents = new Map();
|
|
15
12
|
this._deferExecutor = new ExecutionQueue_1.default();
|
|
16
13
|
this._shouldProcessInRealTime = false;
|
|
17
|
-
this.
|
|
14
|
+
this._initializeLogger();
|
|
18
15
|
}
|
|
19
16
|
Object.defineProperty(QosLogger, "instance", {
|
|
20
17
|
get: function () {
|
|
@@ -53,17 +50,17 @@ var QosLogger = /** @class */ (function () {
|
|
|
53
50
|
};
|
|
54
51
|
QosLogger.prototype._startMonitor = function (key, event) {
|
|
55
52
|
if (this._qosLogger) {
|
|
56
|
-
this._qosEvents.set(key, new this._qosLogger(event));
|
|
53
|
+
this._qosEvents.set(key, new this._qosLogger(event));
|
|
57
54
|
}
|
|
58
55
|
};
|
|
59
56
|
QosLogger.prototype._endMonitor = function (key, event) {
|
|
60
57
|
var qosEvent = this._qosEvents.get(key);
|
|
61
58
|
if (qosEvent) {
|
|
62
|
-
qosEvent.end(event);
|
|
59
|
+
qosEvent.end(event);
|
|
63
60
|
this._qosEvents.delete(key);
|
|
64
61
|
}
|
|
65
62
|
};
|
|
66
|
-
QosLogger.prototype.
|
|
63
|
+
QosLogger.prototype._initializeLogger = function () {
|
|
67
64
|
var _this = this;
|
|
68
65
|
var startHandler = (function (key, e) {
|
|
69
66
|
_this._startMonitor(key, e);
|
|
@@ -10,11 +10,15 @@ var QosLogger_1 = tslib_1.__importDefault(require("./QosLogger"));
|
|
|
10
10
|
var EngagementLogger_1 = tslib_1.__importDefault(require("../Engagement/EngagementLogger"));
|
|
11
11
|
var DiagnosticsSettingsManager_1 = tslib_1.__importDefault(require("../../DiagnosticsSettingsManager"));
|
|
12
12
|
var Killswitches_1 = require("../../common/Killswitches");
|
|
13
|
+
var LOG_SOURCE = {
|
|
14
|
+
id: 'QosMonitor'
|
|
15
|
+
};
|
|
16
|
+
var QOS_MONISTOR_HAS_ENDED_ERROR_STRING = "QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.";
|
|
13
17
|
/**
|
|
14
18
|
* Qos logger
|
|
15
19
|
* This class represents the Qos monitor APIs
|
|
16
20
|
*
|
|
17
|
-
* @
|
|
21
|
+
* @internal
|
|
18
22
|
*/
|
|
19
23
|
var QosMonitor = /** @class */ (function () {
|
|
20
24
|
/**
|
|
@@ -104,7 +108,7 @@ var QosMonitor = /** @class */ (function () {
|
|
|
104
108
|
* QoS monitor ends with success
|
|
105
109
|
* You will see success tag: SPPages.ScenarioName.Success
|
|
106
110
|
*/
|
|
107
|
-
//
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
112
|
QosMonitor.prototype.writeSuccess = function (extraData) {
|
|
109
113
|
this._writeQosEnd(QosResultType_1.QosResultType.Success, undefined, undefined, extraData);
|
|
110
114
|
};
|
|
@@ -113,8 +117,9 @@ var QosMonitor = /** @class */ (function () {
|
|
|
113
117
|
* You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
|
|
114
118
|
* <failuretag> will be filled with param tagName
|
|
115
119
|
*/
|
|
116
|
-
QosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
117
|
-
|
|
120
|
+
QosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
122
|
+
extraData) {
|
|
118
123
|
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultUnexpected'; }
|
|
119
124
|
this._writeQosEnd(QosResultType_1.QosResultType.Failure, tagNameSuffix, ex, extraData);
|
|
120
125
|
};
|
|
@@ -123,13 +128,15 @@ var QosMonitor = /** @class */ (function () {
|
|
|
123
128
|
* You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
|
|
124
129
|
* <failuretag> will be filled with param tagName
|
|
125
130
|
*/
|
|
126
|
-
QosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
127
|
-
|
|
131
|
+
QosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
|
+
extraData) {
|
|
128
134
|
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultExpected'; }
|
|
129
135
|
this._writeQosEnd(QosResultType_1.QosResultType.ExpectedFailure, tagNameSuffix, ex, extraData);
|
|
130
136
|
};
|
|
131
|
-
QosMonitor.prototype._writeQosEnd = function (resultType, tagNameSuffix, ex,
|
|
132
|
-
|
|
137
|
+
QosMonitor.prototype._writeQosEnd = function (resultType, tagNameSuffix, ex,
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
+
extraData) {
|
|
133
140
|
if (this._shouldSkip(resultType)) {
|
|
134
141
|
return;
|
|
135
142
|
}
|
|
@@ -145,8 +152,8 @@ var QosMonitor = /** @class */ (function () {
|
|
|
145
152
|
QosLogger_1.default.instance.writeQosEndResult(this._id, endData);
|
|
146
153
|
this._writeToEngagement();
|
|
147
154
|
};
|
|
148
|
-
|
|
149
|
-
) {
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
QosMonitor.prototype._ensureCorrelationId = function (resultType, extraData) {
|
|
150
157
|
var _this = this;
|
|
151
158
|
if (extraData) {
|
|
152
159
|
this._ensureEndExtraData();
|
|
@@ -217,16 +224,16 @@ var QosMonitor = /** @class */ (function () {
|
|
|
217
224
|
}
|
|
218
225
|
};
|
|
219
226
|
QosMonitor.prototype._isDebugSession = function () {
|
|
220
|
-
return !!
|
|
227
|
+
return !!sp_core_library_1._BrowserUtilities.safelyAccessSessionStorage('spfx-debug');
|
|
221
228
|
};
|
|
222
229
|
QosMonitor.prototype._shouldSkip = function (result) {
|
|
223
230
|
if (this._hasEnded && this._endResult !== undefined) {
|
|
224
|
-
var message = sp_core_library_2.Text.format(
|
|
231
|
+
var message = sp_core_library_2.Text.format(QOS_MONISTOR_HAS_ENDED_ERROR_STRING, this.name, this._qosResultTypeValue[this._endResult], this._qosResultTypeValue[result]);
|
|
225
232
|
if (this._endResult !== result) {
|
|
226
|
-
TraceLogger_1.default.logError(
|
|
233
|
+
TraceLogger_1.default.logError(LOG_SOURCE, new Error(message));
|
|
227
234
|
}
|
|
228
235
|
if (DEBUG) {
|
|
229
|
-
TraceLogger_1.default.logVerbose(
|
|
236
|
+
TraceLogger_1.default.logVerbose(LOG_SOURCE, message, 'skipEnd');
|
|
230
237
|
}
|
|
231
238
|
return true;
|
|
232
239
|
}
|
|
@@ -239,37 +246,28 @@ var QosMonitor = /** @class */ (function () {
|
|
|
239
246
|
if (this._copyToInterana) {
|
|
240
247
|
EngagementLogger_1.default.log({
|
|
241
248
|
name: this.name,
|
|
242
|
-
isIntentional:
|
|
243
|
-
// tslint:disable-next-line:no-string-literal
|
|
244
|
-
!!(this.extraData || {})['isIntentional'],
|
|
249
|
+
isIntentional: !!(this.extraData || {}).isIntentional,
|
|
245
250
|
extraData: this.extraData || {}
|
|
246
251
|
});
|
|
247
252
|
}
|
|
248
253
|
if (this._copyToCosmos) {
|
|
249
254
|
// Engagement name requires certain format. Cannot just use QOS name.
|
|
250
255
|
// Record Qos name in extra data 'qosName'
|
|
251
|
-
//
|
|
256
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
257
|
var engagementData = {
|
|
253
258
|
name: 'Spfx.Qos.ToEngagement',
|
|
254
259
|
extraData: this.extraData || {}
|
|
255
260
|
};
|
|
256
|
-
|
|
257
|
-
engagementData.extraData['qosName'] = this.name;
|
|
261
|
+
engagementData.extraData.qosName = this.name;
|
|
258
262
|
if (this.resultType) {
|
|
259
|
-
|
|
260
|
-
engagementData.extraData['qosResultType'] = this._qosResultTypeValue[this.resultType];
|
|
263
|
+
engagementData.extraData.qosResultType = this._qosResultTypeValue[this.resultType];
|
|
261
264
|
}
|
|
262
265
|
if (this.resultCode) {
|
|
263
|
-
|
|
264
|
-
engagementData.extraData['qosResultCode'] = this.resultCode;
|
|
266
|
+
engagementData.extraData.qosResultCode = this.resultCode;
|
|
265
267
|
}
|
|
266
268
|
EngagementLogger_1.default.log(engagementData);
|
|
267
269
|
}
|
|
268
270
|
};
|
|
269
|
-
QosMonitor.logSource = {
|
|
270
|
-
id: 'QosMonitor'
|
|
271
|
-
};
|
|
272
|
-
QosMonitor.qosMonitorHasEndedErrorString = "QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.";
|
|
273
271
|
return QosMonitor;
|
|
274
272
|
}());
|
|
275
273
|
exports.default = QosMonitor;
|
|
@@ -33,8 +33,9 @@ var QosMonitorShareFailureWithCP = /** @class */ (function (_super) {
|
|
|
33
33
|
* You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
|
|
34
34
|
* <failuretag> will be filled with param tagName
|
|
35
35
|
*/
|
|
36
|
-
QosMonitorShareFailureWithCP.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
37
|
-
|
|
36
|
+
QosMonitorShareFailureWithCP.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
extraData) {
|
|
38
39
|
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultUnexpected'; }
|
|
39
40
|
_super.prototype.writeUnexpectedFailure.call(this, tagNameSuffix, ex, extraData);
|
|
40
41
|
this._logCustomerPromiseFailure((ex === null || ex === void 0 ? void 0 : ex.message) || 'DefaultErrorMessage', tagNameSuffix, QosResultType_1.QosResultType.Failure, extraData);
|
|
@@ -47,8 +48,9 @@ var QosMonitorShareFailureWithCP = /** @class */ (function (_super) {
|
|
|
47
48
|
* You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
|
|
48
49
|
* <failuretag> will be filled with param tagName
|
|
49
50
|
*/
|
|
50
|
-
QosMonitorShareFailureWithCP.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
51
|
-
|
|
51
|
+
QosMonitorShareFailureWithCP.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
extraData) {
|
|
52
54
|
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultExpected'; }
|
|
53
55
|
_super.prototype.writeExpectedFailure.call(this, tagNameSuffix, ex, extraData);
|
|
54
56
|
this._logCustomerPromiseFailure((ex === null || ex === void 0 ? void 0 : ex.message) || 'DefaultErrorMessage', tagNameSuffix, QosResultType_1.QosResultType.ExpectedFailure, extraData);
|
|
@@ -60,8 +62,9 @@ var QosMonitorShareFailureWithCP = /** @class */ (function (_super) {
|
|
|
60
62
|
* @param resultType - ResultTypeEnum used to indicate expected or unexpected failure.
|
|
61
63
|
* @param extraData - Additional information to be logged, which might include pageType and/or errorStack
|
|
62
64
|
*/
|
|
63
|
-
QosMonitorShareFailureWithCP.prototype._logCustomerPromiseFailure = function (errorMessage, errorScenario, resultType,
|
|
64
|
-
|
|
65
|
+
QosMonitorShareFailureWithCP.prototype._logCustomerPromiseFailure = function (errorMessage, errorScenario, resultType,
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
+
extraData) {
|
|
65
68
|
if (resultType === void 0) { resultType = QosResultType_1.QosResultType.Failure; }
|
|
66
69
|
if (this._extraDataForCustomerPromise) {
|
|
67
70
|
this._extraDataForCustomerPromise.forEach(function (extraHandlerInfo) {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation. All rights reserved.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.QosResultType = void 0;
|
|
7
4
|
/**
|
|
8
5
|
* Qos Result Type const object.
|
|
9
6
|
* @internal
|
|
10
7
|
*/
|
|
11
|
-
//
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/typedef
|
|
12
9
|
exports.QosResultType = {
|
|
13
10
|
Success: 0,
|
|
14
11
|
Failure: 1,
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation.All rights reserved.
|
|
4
|
-
* @file DefaultTraceHandler.ts
|
|
5
|
-
*/
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
/**
|
|
8
4
|
* Default implementation for the Trace logger class.
|
|
@@ -15,6 +11,7 @@ var DefaultTraceHandler = /** @class */ (function () {
|
|
|
15
11
|
*/
|
|
16
12
|
DefaultTraceHandler.prototype.log = function (traceLogEvent) {
|
|
17
13
|
if (!DEPRECATED_UNIT_TEST) {
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
18
15
|
console.log("Error: ".concat(traceLogEvent.data, ", ") +
|
|
19
16
|
"Event Name: ".concat(traceLogEvent.eventName, ", ") +
|
|
20
17
|
"Result Code: ".concat(traceLogEvent.resultCode));
|
|
@@ -25,6 +22,7 @@ var DefaultTraceHandler = /** @class */ (function () {
|
|
|
25
22
|
*/
|
|
26
23
|
DefaultTraceHandler.prototype.verbose = function (verboseTraceEvent) {
|
|
27
24
|
if (!DEPRECATED_UNIT_TEST) {
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
28
26
|
console.log("Error: ".concat(verboseTraceEvent.data, ", Event Name: ").concat(verboseTraceEvent.eventName));
|
|
29
27
|
}
|
|
30
28
|
};
|
|
@@ -5,7 +5,7 @@ var sp_core_library_1 = require("@microsoft/sp-core-library");
|
|
|
5
5
|
var LogEvent_1 = tslib_1.__importDefault(require("./LogEvent"));
|
|
6
6
|
var LogLevel_1 = require("../LogLevel");
|
|
7
7
|
var DefaultTraceHandler_1 = tslib_1.__importDefault(require("./DefaultTraceHandler"));
|
|
8
|
-
var LogManager_1 = tslib_1.__importDefault(require("
|
|
8
|
+
var LogManager_1 = tslib_1.__importDefault(require("../LogManager/LogManager"));
|
|
9
9
|
/**
|
|
10
10
|
* This is used to log traces of failed operations and debugging information.
|
|
11
11
|
* @internal
|
|
@@ -83,7 +83,7 @@ var TraceLogger = /** @class */ (function () {
|
|
|
83
83
|
* you logged throughout your scenario execution (or other scenarios).
|
|
84
84
|
* And hopefully that would help you get to the bottom of what exactly went wrong.
|
|
85
85
|
* If no failure happens and your scenario succeeds, verbose logs will be just left in the buffer
|
|
86
|
-
* and most likely
|
|
86
|
+
* and most likely overridden by next scenario that logs something verbose.
|
|
87
87
|
*/
|
|
88
88
|
TraceLogger.logVerboseData = function (data) {
|
|
89
89
|
var message = data.logEntry ? data.logEntry.toString() : data.message;
|
|
@@ -176,9 +176,11 @@ var TraceLogger = /** @class */ (function () {
|
|
|
176
176
|
}
|
|
177
177
|
// Task 191596: only write to console when a condition is satisfied (e.g., a query parameter provided).
|
|
178
178
|
if (isError) {
|
|
179
|
+
// eslint-disable-next-line no-console
|
|
179
180
|
console.error(errorString);
|
|
180
181
|
}
|
|
181
182
|
else {
|
|
183
|
+
// eslint-disable-next-line no-console
|
|
182
184
|
console.log(errorString);
|
|
183
185
|
}
|
|
184
186
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Microsoft Corporation. All rights reserved.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
var sp_core_library_1 = require("@microsoft/sp-core-library");
|
|
7
4
|
var sp_lodash_subset_1 = require("@microsoft/sp-lodash-subset");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/sp-diagnostics",
|
|
3
|
-
"version": "1.18.0-beta.
|
|
3
|
+
"version": "1.18.0-beta.2",
|
|
4
4
|
"description": "Diagnostics tools for the SharePoint Framework",
|
|
5
5
|
"license": "https://aka.ms/spfx/license",
|
|
6
6
|
"homepage": "http://aka.ms/spfx",
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
"module": "lib/index.js",
|
|
9
9
|
"typings": "dist/index-internal.d.ts",
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@rushstack/heft": "0.
|
|
11
|
+
"@rushstack/heft": "0.56.0",
|
|
12
12
|
"tslib": "2.3.1",
|
|
13
|
+
"eslint": "8.7.0",
|
|
13
14
|
"@ms/spfx-internal-web-build-next-rig": "0.1.0"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
|
-
"@microsoft/sp-core-library": "1.18.0-beta.
|
|
17
|
-
"@microsoft/sp-lodash-subset": "1.18.0-beta.
|
|
17
|
+
"@microsoft/sp-core-library": "1.18.0-beta.2",
|
|
18
|
+
"@microsoft/sp-lodash-subset": "1.18.0-beta.2"
|
|
18
19
|
},
|
|
19
20
|
"engines": {
|
|
20
21
|
"node": ">=12.13.0 <13.0.0 || >=14.15.0 <15.0.0 || >=16.13.0 <17.0.0"
|