@microsoft/sp-diagnostics 1.23.0 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "78359e4b-07c2-43c6-8d0b-d060b4d577e8",
|
|
4
4
|
"alias": "SPDiagnostics",
|
|
5
5
|
"componentType": "Library",
|
|
6
|
-
"version": "1.23.
|
|
6
|
+
"version": "1.23.1",
|
|
7
7
|
"loaderConfig": {
|
|
8
8
|
"internalModuleBaseUrls": [
|
|
9
9
|
"https://localhost:4321/dist/"
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"sp-diagnostics": {
|
|
14
14
|
"type": "path",
|
|
15
15
|
"path": {
|
|
16
|
-
"path": "sp-
|
|
17
|
-
"integrity": "sha256-
|
|
16
|
+
"path": "sp-diagnostics_none_e7447a590b1864b48fbc.js",
|
|
17
|
+
"integrity": "sha256-hN8K7jrGv20vaXTe/CwBuUTquBC2rza2rb9IbY7o86M="
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"@microsoft/sp-core-library": {
|
|
21
21
|
"type": "component",
|
|
22
22
|
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
|
|
23
|
-
"version": "1.23.
|
|
23
|
+
"version": "1.23.1"
|
|
24
24
|
},
|
|
25
25
|
"@microsoft/sp-lodash-subset": {
|
|
26
26
|
"type": "component",
|
|
27
27
|
"id": "73e1dc6c-8441-42cc-ad47-4bd3659f8a3a",
|
|
28
|
-
"version": "1.23.
|
|
28
|
+
"version": "1.23.1"
|
|
29
29
|
},
|
|
30
30
|
"@msinternal/odsp-core-bundle": {
|
|
31
31
|
"type": "component",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
define("78359e4b-07c2-43c6-8d0b-d060b4d577e8_1.23.0",["@microsoft/sp-core-library","@microsoft/sp-lodash-subset","@msinternal/odsp-core-bundle","tslib"],(e,t,n,a)=>(()=>{"use strict";var i={676(t){t.exports=e},529(e){e.exports=t},277(e){e.exports=n},280(e){e.exports=a}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return i[e](n,n.exports,o),n.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{o.r(s),o.d(s,{_AutoAlertableMonitorType:()=>L,_AutoAlertableQosMonitor:()=>k,_CircularBuffer:()=>i,_Diagnostics:()=>g,_EngagementLogger:()=>S,_ExecutionQueue:()=>C,_LogEntry:()=>_,_LogEvent:()=>c,_LogFeature:()=>f,_LogHandler:()=>D,_LogLevel:()=>d,_LogManager:()=>r,_LogSource:()=>n,_LogType:()=>m,_PageType:()=>y,_PromotedState:()=>v,_QosLogger:()=>O,_QosMonitor:()=>E,_QosMonitorShareFailureWithCP:()=>M,_QosResultType:()=>x,_TraceLogger:()=>u,_logSourceServiceKey:()=>a});var e=o(676),t=function(){function t(t){e.Validate.isNotNullOrUndefined(t,"id"),this._id=t}return t.create=function(e){return new t(e)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return 0===this._id.length},t}();const n=t;var a=e.ServiceKey.createCustom("sp-client-base:LogSource",function(e){return t.create("")});const i=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}(),r=function(){function e(t){this._shouldLogInRealTime=[],this._handlers=[],this._events=new i(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}(),c=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(a)}),t},e.logManager=new r,e}();var d;!function(e){e[e.Verbose=1]="Verbose",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error"}(d||(d={}));const l=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}(),u=function(){function t(){}return t._addHandler=function(e){t._logManager.addHandler(e.log),t._logManager.processAll(e.log),t._verboseLogManager.addHandler(e.verbose),t._verboseLogManager.processAll(e.verbose)},t.logError=function(t,n,a,i){e.Validate.isNotNullOrUndefined(n,"error"),this._log(t,n,a,!0,i)},t.logErrorData=function(t){e.Validate.isNotNullOrUndefined(t.error,"error");var n=t.logEntry?t.logEntry.toString():t.error;this._log(t.source,n,t.eventName,!0,t.resultCode,t.serviceScope)},t.logVerbose=function(t,n,a){e.Validate.isNonemptyString(n,"message"),this._log(t,n,a,!1,void 0)},t.logVerboseData=function(e){var t=e.logEntry?e.logEntry.toString():e.message;this._log(e.source,t,e.eventName,!1,void 0,e.serviceScope)},t.logErrorWithLogEntry=function(t,n,a,i){e.Validate.isNotNullOrUndefined(t,"source"),e.Validate.isNotNullOrUndefined(n,"logEntry"),this._log(t,n.toString(),a,!0,i)},Object.defineProperty(t,"shouldWriteToConsole",{get:function(){return t._shouldWriteToConsole},set:function(e){t._shouldWriteToConsole&&!e?(t._logManager.removeHandler(t._defaultLogger.log),t._verboseLogManager.removeHandler(t._defaultLogger.verbose)):!t._shouldWriteToConsole&&e&&(t._logManager.addHandler(t._defaultLogger.log),t._verboseLogManager.addHandler(t._defaultLogger.verbose)),t._shouldWriteToConsole=e},enumerable:!1,configurable:!0}),t.logVerboseWithLogEntry=function(t,n,a){e.Validate.isNotNullOrUndefined(n,"LogEntry"),this._log(t,n.toString(),a,!1,void 0)},t._log=function(e,n,a,i,r,o){var s,l=this._addEventPrefix(e,a);i?(s=c.log(l,n,d.Error,o),t._logManager.log({data:n,eventName:s.prefix,resultCode:r})):(s=c.log(l,n.toString(),d.Verbose,o),t._verboseLogManager.log({data:n,eventName:s.prefix})),t.shouldWriteToConsole&&this._writeToConsole(s,i,r)},t._addEventPrefix=function(e,t){return t?"".concat(e.id,".").concat(t):e.id},t._writeToConsole=function(e,t,n){var a=e.toString();n&&(a+=". resultCode: ".concat(n)),t?console.error(a):console.log(a)},t._logManager=new r,t._verboseLogManager=new r,t._defaultLogger=new l,t._shouldWriteToConsole=!1,t}(),f=function(){function e(){}return e.None="None",e}();var p;!function(e){e[e.Trace=1]="Trace",e[e.Event=2]="Event",e[e.Error=3]="Error"}(p||(p={}));const m=p,_=function(){function e(e,t,n,a,i){if(void 0===t&&(t=f.None),void 0===n&&(n=m.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}();var h=o(529);const b=function(){function t(){}return t.initialize=function(e){this.settings=(0,h.cloneDeep)(e),this._initialized=!0,this._normalizeContextIds()},t.updateSettings=function(e){this.settings=(0,h.merge)(this.settings,e),this._normalizeContextIds()},t.clearSettings=function(e){var t=this;e.diagnosticSettings&&e.diagnosticSettings.forEach(function(e){delete t.settings[e]}),e.extraDiagnosticInfo&&e.extraDiagnosticInfo.forEach(function(e){t.settings.extraDiagnosticInfo&&t.settings.extraDiagnosticInfo[e]&&delete t.settings.extraDiagnosticInfo[e]})},Object.defineProperty(t,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),t._normalizeId=function(t){var n=e.Guid.tryParse(t);return(null==n?void 0:n.toString())||t},t._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)))},t._initialized=!1,t}(),g=function(){function t(){}return t.initialize=function(n){t._isInitialized||(b.initialize(n),u.shouldWriteToConsole=n.enableConsoleLog,u._addHandler({log:function(t){e.Log.info(t.eventName,"EventName:".concat(t.data.toString(),", ResultCode: ").concat(t.resultCode))},verbose:function(t){e.Log.verbose(t.eventName,t.data.toString())}}),t._isInitialized=!0)},Object.defineProperty(t,"isInitialized",{get:function(){return this._isInitialized},enumerable:!1,configurable:!0}),t.updateSettings=function(e){b.updateSettings(e)},t.getAuthoringSessionClientCountInfo=function(){var e,t;return null===(t=null===(e=b.settings)||void 0===e?void 0:e.extraDiagnosticInfo)||void 0===t?void 0:t.authoringSessionClientCount},t._getExtraDiagnosticInfo=function(){var e;return null===(e=b.settings)||void 0===e?void 0:e.extraDiagnosticInfo},t.clearSettings=function(e){b.clearSettings(e)},t._isInitialized=!1,t}();var v,y;!function(e){e[e.NotPromoted=0]="NotPromoted",e[e.Promoted=2]="Promoted"}(v||(v={})),function(e){e.News="News",e.Article="Article",e.Home="Home",e.Space="Space",e.NewsDigest="NewsDigest"}(y||(y={}));const S=function(){function t(){}return t._addHandler=function(e){t._handler=function(t){e.logData(t)},t._logManager.addHandler(t._handler)},t.startRealTimeProcessing=function(){this._shouldProcessInRealTime||(t._logManager.processAll(t._handler),this._shouldProcessInRealTime=!0)},t.log=function(e){t._logEngagementData(e)},t.logEvent=function(e,n){var a={name:e};n&&0!==n.length&&(a.extraData={action:n}),t._logEngagementData(a)},t.logEventWithLogEntry=function(e){var n={isIntentional:e.isIntentional,name:e.moduleName+"."+e.logFeature,extraData:e.logProperties};t._logEngagementData(n,!0)},t._logEngagementData=function(e,n){if(void 0===n&&(n=!1),!e.name||0===e.name.length)throw new Error("LogEntry is invalid");t._checkValidTagName(e,n),t._addContextData(e),t._appendExtraData(e),t._logManager.log(e)},t._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"))},t._addContextData=function(e){if(b.isInitialized){var t=b.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))}},t._appendExtraData=function(t){if(b.isInitialized){var n=b.settings.contextInfo;n&&(t.extraData||(t.extraData={}),function(t,n){n.pageId=t.pageId,n.isHub=t.isHubSite,t.isHubSite?(n.hubSiteId=t.hubSiteId,n.isAssociatedSite=!1):!t.isHubSite&&t.hubSiteId?n.isAssociatedSite=!0:n.isAssociatedSite=!1,n.displayApp||(e._BrowserUtilities.isTeamsHosted()?(n.displayApp="Teams",t.isEduClass&&(n.isEduClass=!0)):n.displayApp="Sharepoint"),n.userAgent=navigator.userAgent;var a,i=t.webTemplate;n.webTemplate=i,"1"===i?a="TeamSite":"64"===i?a="GroupSite":"68"===i?a="CommunicationSite":"21"===i&&(a="MySite");var r=t.promotedState,o=t.pageType,s=o;o===y.Article&&(s=r===v.NotPromoted||void 0===r?y.Article:y.News),n.siteType=a,n.pageType=s,n.isDebug=!!e._BrowserUtilities.safelyAccessSessionStorage("spfx-debug"),n.hasCopilotLicense=!!t.hasCopilotLicense}(n,t.extraData))}},t._logManager=new r,t}(),D=function(){function e(){}return e.prototype.verbose=function(e,t,n){c.log(e,t,d.Verbose,n)},e.prototype.info=function(e,t,n){c.log(e,t,d.Info,n)},e.prototype.warn=function(e,t,n){c.log(e,t,d.Warning,n)},e.prototype.error=function(e,t,n){c.log(e,t,d.Error,n)},e}();var I=o(277),x={Success:0,Failure:1,ExpectedFailure:2};const C=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}(),O=function(){function e(){this._qosEvents=new Map,this._deferExecutor=new C,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}();var w={id:"QosMonitor"};const E=function(){function t(t,n,a){var i;void 0===n&&(n=!1),void 0===a&&(a=!1);var r=this;this._qosResultTypeValue=((i={})[x.Success]="Success",i[x.Failure]="Failure",i[x.ExpectedFailure]="ExpectedFailure",i),this._ensureAuthoringSessionId=function(){var e,t,n,a,i=null===(t=null===(e=b.settings)||void 0===e?void 0:e.extraDiagnosticInfo)||void 0===t?void 0:t.authoringSessionId;if(i){r._ensureEndExtraData(),r._endExtraData.AuthoringSessionId=i;var o=null===(a=null===(n=b.settings)||void 0===n?void 0:n.extraDiagnosticInfo)||void 0===a?void 0:a.authoringOpSequenceId;o&&(r._endExtraData.AuthoringOpSequenceId=o);var s=g.getAuthoringSessionClientCountInfo();s&&r._endExtraData&&(r._endExtraData.AuthoringSessionClientCount=s)}},e.Validate.isNonemptyString(t,"scenarioName"),this._id=e.Guid.newGuid().toString(),this._isDebugSession()||O.instance.startQosMonitor(this._id,{name:t}),this._scenarioName=t,this._hasEnded=!1,this._copyToCosmos=n,this._copyToInterana=a}return t.startRealTimeProcessing=function(){O.instance.shouldProcessInRealTime||this._shouldProcessInRealTime(!0)},t._shouldProcessInRealTime=function(e){O.instance.shouldProcessInRealTime=e},Object.defineProperty(t.prototype,"name",{get:function(){return this._scenarioName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shortEventName",{get:function(){return"Qos"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultCode",{get:function(){return this._endResultCode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultType",{get:function(){return this._endResult},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extraData",{get:function(){return this._endExtraData},set:function(e){this._endExtraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasEnded",{get:function(){return this._hasEnded},enumerable:!1,configurable:!0}),t.prototype.writeSuccess=function(e){this._writeQosEnd(x.Success,void 0,void 0,e)},t.prototype.writeUnexpectedFailure=function(e,t,n){void 0===e&&(e="DefaultUnexpected"),this._writeQosEnd(x.Failure,e,t,n)},t.prototype.writeExpectedFailure=function(e,t,n){void 0===e&&(e="DefaultExpected"),this._writeQosEnd(x.ExpectedFailure,e,t,n)},t.prototype._writeQosEnd=function(e,t,n,a){if(!this._shouldSkip(e)){this._ensureCorrelationId(e,a),this._endResultCode=t,this._endResult=e;var i=n?(0,I.getErrorMessage)(n):void 0;if(n instanceof I.CustomError){var r=(0,I.getQosEndSchemaFromError)(n);r&&(r.resultType=this._endResult,r.extraData=(0,h.merge)({},this._endExtraData,r.extraData)),O.instance.writeQosEndResult(this._id,r)}else{var o={resultCode:this._endResultCode,resultType:this._endResult,error:i,extraData:this._endExtraData};O.instance.writeQosEndResult(this._id,o)}this._writeToEngagement()}},t.prototype._ensureCorrelationId=function(e,t){var n=this;if(t&&(this._ensureEndExtraData(),Object.keys(t).forEach(function(e){return n._endExtraData[e]=t[e]})),b.isInitialized&&e!==x.Success){var a="CorrelationId",i=this._endExtraData&&(this._endExtraData[a]||this._endExtraData.correlationId)||b.settings.correlationId;i&&(this._endExtraData||(this._endExtraData={}),this._endExtraData[a]=i)}this._logHostType(),this._ensureAuthoringSessionId()},t.prototype._ensureEndExtraData=function(){this._endExtraData||(this._endExtraData={})},t.prototype._logHostType=function(){if(b.isInitialized){var t=e._BrowserUtilities.getTeamsAppType();if(t){this._ensureEndExtraData();var n="appHostType";this._endExtraData[n]||(this._endExtraData[n]=t)}}},t.prototype._isDebugSession=function(){try{return!!e._SPKillSwitch.isActivated("761ccb86-4fa0-4f56-a05b-477bcc09bd9f")&&!!e._BrowserUtilities.safelyAccessSessionStorage("spfx-debug")}catch(e){return!1}},t.prototype._shouldSkip=function(t){if(this._hasEnded&&void 0!==this._endResult){var n=e.Text.format("QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.",this.name,this._qosResultTypeValue[this._endResult],this._qosResultTypeValue[t]);return this._endResult!==t&&u.logError(w,new Error(n)),!0}return this._hasEnded=!0,this._isDebugSession()},t.prototype._writeToEngagement=function(){if(this._copyToInterana&&S.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),S.log(e)}},t}();var A=o(280),L={StaticReliabilityQos95Sev4:"StaticReliabilityQos95Sev4",DynamicReliabilityQosMediumSev4:"DynamicReliabilityQosMediumSev4",DynamicReliabilityExpectedFailureHighSev4:"DynamicReliabilityExpectedFailureHighSev4"},k=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(0,A.__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=L[this._autoAlertableMonitorType],t},t}(E),M=function(t){function n(e,n,a,i){void 0===n&&(n=!1),void 0===i&&(i=!1);var r=t.call(this,e,i,n)||this;return r._extraDataForCustomerPromise=a,r}return(0,A.__extends)(n,t),n.prototype.writeUnexpectedFailure=function(e,n,a){void 0===e&&(e="DefaultUnexpected"),t.prototype.writeUnexpectedFailure.call(this,e,n,a),this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",e,x.Failure,a)},n.prototype.writeExpectedFailure=function(e,n,a,i){void 0===e&&(e="DefaultExpected"),void 0===i&&(i=!1),t.prototype.writeExpectedFailure.call(this,e,n,a),i||this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",e,x.ExpectedFailure,a)},n.prototype._logCustomerPromiseFailure=function(t,n,a,i){void 0===a&&(a=x.Failure),this._extraDataForCustomerPromise&&this._extraDataForCustomerPromise.forEach(function(r){var o,s=r.logFailure,c=r.veto;s({errorCode:r.errorModuleName+((o=g._getExtraDiagnosticInfo())&&o.hasAuthoringStarted?o.authoringSessionClientCount?o.authoringSessionClientCount>1?" with Multiple Users":"":o.isAuthoringUsingDDS?" in Legacy Authoring (DDS)":" in Legacy Authoring (no DDS)":"")+(e._SPKillSwitch.isActivated("c125685f-83e7-44c8-b602-5c21f5b748ae")||window.navigator.onLine?"":" (offline)"),errorScenario:n,errorMessage:t,resultType:a,pageType:null==i?void 0:i.pageType,errorStack:null==i?void 0:i.errorStack,veto:c})})},n}(E)})(),s})());
|
|
1
|
+
define("78359e4b-07c2-43c6-8d0b-d060b4d577e8_1.23.1",["@microsoft/sp-core-library","@microsoft/sp-lodash-subset","@msinternal/odsp-core-bundle","tslib"],(e,t,n,a)=>(()=>{"use strict";var i={676(t){t.exports=e},529(e){e.exports=t},277(e){e.exports=n},280(e){e.exports=a}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return i[e](n,n.exports,o),n.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{o.r(s),o.d(s,{_AutoAlertableMonitorType:()=>L,_AutoAlertableQosMonitor:()=>k,_CircularBuffer:()=>i,_Diagnostics:()=>g,_EngagementLogger:()=>S,_ExecutionQueue:()=>C,_LogEntry:()=>_,_LogEvent:()=>c,_LogFeature:()=>f,_LogHandler:()=>D,_LogLevel:()=>d,_LogManager:()=>r,_LogSource:()=>n,_LogType:()=>m,_PageType:()=>y,_PromotedState:()=>v,_QosLogger:()=>O,_QosMonitor:()=>E,_QosMonitorShareFailureWithCP:()=>M,_QosResultType:()=>x,_TraceLogger:()=>u,_logSourceServiceKey:()=>a});var e=o(676),t=function(){function t(t){e.Validate.isNotNullOrUndefined(t,"id"),this._id=t}return t.create=function(e){return new t(e)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return 0===this._id.length},t}();const n=t;var a=e.ServiceKey.createCustom("sp-client-base:LogSource",function(e){return t.create("")});const i=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}(),r=function(){function e(t){this._shouldLogInRealTime=[],this._handlers=[],this._events=new i(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}(),c=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(a)}),t},e.logManager=new r,e}();var d;!function(e){e[e.Verbose=1]="Verbose",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error"}(d||(d={}));const l=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}(),u=function(){function t(){}return t._addHandler=function(e){t._logManager.addHandler(e.log),t._logManager.processAll(e.log),t._verboseLogManager.addHandler(e.verbose),t._verboseLogManager.processAll(e.verbose)},t.logError=function(t,n,a,i){e.Validate.isNotNullOrUndefined(n,"error"),this._log(t,n,a,!0,i)},t.logErrorData=function(t){e.Validate.isNotNullOrUndefined(t.error,"error");var n=t.logEntry?t.logEntry.toString():t.error;this._log(t.source,n,t.eventName,!0,t.resultCode,t.serviceScope)},t.logVerbose=function(t,n,a){e.Validate.isNonemptyString(n,"message"),this._log(t,n,a,!1,void 0)},t.logVerboseData=function(e){var t=e.logEntry?e.logEntry.toString():e.message;this._log(e.source,t,e.eventName,!1,void 0,e.serviceScope)},t.logErrorWithLogEntry=function(t,n,a,i){e.Validate.isNotNullOrUndefined(t,"source"),e.Validate.isNotNullOrUndefined(n,"logEntry"),this._log(t,n.toString(),a,!0,i)},Object.defineProperty(t,"shouldWriteToConsole",{get:function(){return t._shouldWriteToConsole},set:function(e){t._shouldWriteToConsole&&!e?(t._logManager.removeHandler(t._defaultLogger.log),t._verboseLogManager.removeHandler(t._defaultLogger.verbose)):!t._shouldWriteToConsole&&e&&(t._logManager.addHandler(t._defaultLogger.log),t._verboseLogManager.addHandler(t._defaultLogger.verbose)),t._shouldWriteToConsole=e},enumerable:!1,configurable:!0}),t.logVerboseWithLogEntry=function(t,n,a){e.Validate.isNotNullOrUndefined(n,"LogEntry"),this._log(t,n.toString(),a,!1,void 0)},t._log=function(e,n,a,i,r,o){var s,l=this._addEventPrefix(e,a);i?(s=c.log(l,n,d.Error,o),t._logManager.log({data:n,eventName:s.prefix,resultCode:r})):(s=c.log(l,n.toString(),d.Verbose,o),t._verboseLogManager.log({data:n,eventName:s.prefix})),t.shouldWriteToConsole&&this._writeToConsole(s,i,r)},t._addEventPrefix=function(e,t){return t?"".concat(e.id,".").concat(t):e.id},t._writeToConsole=function(e,t,n){var a=e.toString();n&&(a+=". resultCode: ".concat(n)),t?console.error(a):console.log(a)},t._logManager=new r,t._verboseLogManager=new r,t._defaultLogger=new l,t._shouldWriteToConsole=!1,t}(),f=function(){function e(){}return e.None="None",e}();var p;!function(e){e[e.Trace=1]="Trace",e[e.Event=2]="Event",e[e.Error=3]="Error"}(p||(p={}));const m=p,_=function(){function e(e,t,n,a,i){if(void 0===t&&(t=f.None),void 0===n&&(n=m.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}();var h=o(529);const b=function(){function t(){}return t.initialize=function(e){this.settings=(0,h.cloneDeep)(e),this._initialized=!0,this._normalizeContextIds()},t.updateSettings=function(e){this.settings=(0,h.merge)(this.settings,e),this._normalizeContextIds()},t.clearSettings=function(e){var t=this;e.diagnosticSettings&&e.diagnosticSettings.forEach(function(e){delete t.settings[e]}),e.extraDiagnosticInfo&&e.extraDiagnosticInfo.forEach(function(e){t.settings.extraDiagnosticInfo&&t.settings.extraDiagnosticInfo[e]&&delete t.settings.extraDiagnosticInfo[e]})},Object.defineProperty(t,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),t._normalizeId=function(t){var n=e.Guid.tryParse(t);return(null==n?void 0:n.toString())||t},t._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)))},t._initialized=!1,t}(),g=function(){function t(){}return t.initialize=function(n){t._isInitialized||(b.initialize(n),u.shouldWriteToConsole=n.enableConsoleLog,u._addHandler({log:function(t){e.Log.info(t.eventName,"EventName:".concat(t.data.toString(),", ResultCode: ").concat(t.resultCode))},verbose:function(t){e.Log.verbose(t.eventName,t.data.toString())}}),t._isInitialized=!0)},Object.defineProperty(t,"isInitialized",{get:function(){return this._isInitialized},enumerable:!1,configurable:!0}),t.updateSettings=function(e){b.updateSettings(e)},t.getAuthoringSessionClientCountInfo=function(){var e,t;return null===(t=null===(e=b.settings)||void 0===e?void 0:e.extraDiagnosticInfo)||void 0===t?void 0:t.authoringSessionClientCount},t._getExtraDiagnosticInfo=function(){var e;return null===(e=b.settings)||void 0===e?void 0:e.extraDiagnosticInfo},t.clearSettings=function(e){b.clearSettings(e)},t._isInitialized=!1,t}();var v,y;!function(e){e[e.NotPromoted=0]="NotPromoted",e[e.Promoted=2]="Promoted"}(v||(v={})),function(e){e.News="News",e.Article="Article",e.Home="Home",e.Space="Space",e.NewsDigest="NewsDigest"}(y||(y={}));const S=function(){function t(){}return t._addHandler=function(e){t._handler=function(t){e.logData(t)},t._logManager.addHandler(t._handler)},t.startRealTimeProcessing=function(){this._shouldProcessInRealTime||(t._logManager.processAll(t._handler),this._shouldProcessInRealTime=!0)},t.log=function(e){t._logEngagementData(e)},t.logEvent=function(e,n){var a={name:e};n&&0!==n.length&&(a.extraData={action:n}),t._logEngagementData(a)},t.logEventWithLogEntry=function(e){var n={isIntentional:e.isIntentional,name:e.moduleName+"."+e.logFeature,extraData:e.logProperties};t._logEngagementData(n,!0)},t._logEngagementData=function(e,n){if(void 0===n&&(n=!1),!e.name||0===e.name.length)throw new Error("LogEntry is invalid");t._checkValidTagName(e,n),t._addContextData(e),t._appendExtraData(e),t._logManager.log(e)},t._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"))},t._addContextData=function(e){if(b.isInitialized){var t=b.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))}},t._appendExtraData=function(t){if(b.isInitialized){var n=b.settings.contextInfo;n&&(t.extraData||(t.extraData={}),function(t,n){n.pageId=t.pageId,n.isHub=t.isHubSite,t.isHubSite?(n.hubSiteId=t.hubSiteId,n.isAssociatedSite=!1):!t.isHubSite&&t.hubSiteId?n.isAssociatedSite=!0:n.isAssociatedSite=!1,n.displayApp||(e._BrowserUtilities.isTeamsHosted()?(n.displayApp="Teams",t.isEduClass&&(n.isEduClass=!0)):n.displayApp="Sharepoint"),n.userAgent=navigator.userAgent;var a,i=t.webTemplate;n.webTemplate=i,"1"===i?a="TeamSite":"64"===i?a="GroupSite":"68"===i?a="CommunicationSite":"21"===i&&(a="MySite");var r=t.promotedState,o=t.pageType,s=o;o===y.Article&&(s=r===v.NotPromoted||void 0===r?y.Article:y.News),n.siteType=a,n.pageType=s,n.isDebug=!!e._BrowserUtilities.safelyAccessSessionStorage("spfx-debug"),n.hasCopilotLicense=!!t.hasCopilotLicense}(n,t.extraData))}},t._logManager=new r,t}(),D=function(){function e(){}return e.prototype.verbose=function(e,t,n){c.log(e,t,d.Verbose,n)},e.prototype.info=function(e,t,n){c.log(e,t,d.Info,n)},e.prototype.warn=function(e,t,n){c.log(e,t,d.Warning,n)},e.prototype.error=function(e,t,n){c.log(e,t,d.Error,n)},e}();var I=o(277),x={Success:0,Failure:1,ExpectedFailure:2};const C=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}(),O=function(){function e(){this._qosEvents=new Map,this._deferExecutor=new C,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}();var w={id:"QosMonitor"};const E=function(){function t(t,n,a){var i;void 0===n&&(n=!1),void 0===a&&(a=!1);var r=this;this._qosResultTypeValue=((i={})[x.Success]="Success",i[x.Failure]="Failure",i[x.ExpectedFailure]="ExpectedFailure",i),this._ensureAuthoringSessionId=function(){var e,t,n,a,i=null===(t=null===(e=b.settings)||void 0===e?void 0:e.extraDiagnosticInfo)||void 0===t?void 0:t.authoringSessionId;if(i){r._ensureEndExtraData(),r._endExtraData.AuthoringSessionId=i;var o=null===(a=null===(n=b.settings)||void 0===n?void 0:n.extraDiagnosticInfo)||void 0===a?void 0:a.authoringOpSequenceId;o&&(r._endExtraData.AuthoringOpSequenceId=o);var s=g.getAuthoringSessionClientCountInfo();s&&r._endExtraData&&(r._endExtraData.AuthoringSessionClientCount=s)}},e.Validate.isNonemptyString(t,"scenarioName"),this._id=e.Guid.newGuid().toString(),this._isDebugSession()||O.instance.startQosMonitor(this._id,{name:t}),this._scenarioName=t,this._hasEnded=!1,this._copyToCosmos=n,this._copyToInterana=a}return t.startRealTimeProcessing=function(){O.instance.shouldProcessInRealTime||this._shouldProcessInRealTime(!0)},t._shouldProcessInRealTime=function(e){O.instance.shouldProcessInRealTime=e},Object.defineProperty(t.prototype,"name",{get:function(){return this._scenarioName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shortEventName",{get:function(){return"Qos"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultCode",{get:function(){return this._endResultCode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultType",{get:function(){return this._endResult},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extraData",{get:function(){return this._endExtraData},set:function(e){this._endExtraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasEnded",{get:function(){return this._hasEnded},enumerable:!1,configurable:!0}),t.prototype.writeSuccess=function(e){this._writeQosEnd(x.Success,void 0,void 0,e)},t.prototype.writeUnexpectedFailure=function(e,t,n){void 0===e&&(e="DefaultUnexpected"),this._writeQosEnd(x.Failure,e,t,n)},t.prototype.writeExpectedFailure=function(e,t,n){void 0===e&&(e="DefaultExpected"),this._writeQosEnd(x.ExpectedFailure,e,t,n)},t.prototype._writeQosEnd=function(e,t,n,a){if(!this._shouldSkip(e)){this._ensureCorrelationId(e,a),this._endResultCode=t,this._endResult=e;var i=n?(0,I.getErrorMessage)(n):void 0;if(n instanceof I.CustomError){var r=(0,I.getQosEndSchemaFromError)(n);r&&(r.resultType=this._endResult,r.extraData=(0,h.merge)({},this._endExtraData,r.extraData)),O.instance.writeQosEndResult(this._id,r)}else{var o={resultCode:this._endResultCode,resultType:this._endResult,error:i,extraData:this._endExtraData};O.instance.writeQosEndResult(this._id,o)}this._writeToEngagement()}},t.prototype._ensureCorrelationId=function(e,t){var n=this;if(t&&(this._ensureEndExtraData(),Object.keys(t).forEach(function(e){return n._endExtraData[e]=t[e]})),b.isInitialized&&e!==x.Success){var a="CorrelationId",i=this._endExtraData&&(this._endExtraData[a]||this._endExtraData.correlationId)||b.settings.correlationId;i&&(this._endExtraData||(this._endExtraData={}),this._endExtraData[a]=i)}this._logHostType(),this._ensureAuthoringSessionId()},t.prototype._ensureEndExtraData=function(){this._endExtraData||(this._endExtraData={})},t.prototype._logHostType=function(){if(b.isInitialized){var t=e._BrowserUtilities.getTeamsAppType();if(t){this._ensureEndExtraData();var n="appHostType";this._endExtraData[n]||(this._endExtraData[n]=t)}}},t.prototype._isDebugSession=function(){try{return!!e._SPKillSwitch.isActivated("761ccb86-4fa0-4f56-a05b-477bcc09bd9f")&&!!e._BrowserUtilities.safelyAccessSessionStorage("spfx-debug")}catch(e){return!1}},t.prototype._shouldSkip=function(t){if(this._hasEnded&&void 0!==this._endResult){var n=e.Text.format("QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.",this.name,this._qosResultTypeValue[this._endResult],this._qosResultTypeValue[t]);return this._endResult!==t&&u.logError(w,new Error(n)),!0}return this._hasEnded=!0,this._isDebugSession()},t.prototype._writeToEngagement=function(){if(this._copyToInterana&&S.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),S.log(e)}},t}();var A=o(280),L={StaticReliabilityQos95Sev4:"StaticReliabilityQos95Sev4",DynamicReliabilityQosMediumSev4:"DynamicReliabilityQosMediumSev4",DynamicReliabilityExpectedFailureHighSev4:"DynamicReliabilityExpectedFailureHighSev4"},k=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(0,A.__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=L[this._autoAlertableMonitorType],t},t}(E),M=function(t){function n(e,n,a,i){void 0===n&&(n=!1),void 0===i&&(i=!1);var r=t.call(this,e,i,n)||this;return r._extraDataForCustomerPromise=a,r}return(0,A.__extends)(n,t),n.prototype.writeUnexpectedFailure=function(e,n,a){void 0===e&&(e="DefaultUnexpected"),t.prototype.writeUnexpectedFailure.call(this,e,n,a),this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",e,x.Failure,a)},n.prototype.writeExpectedFailure=function(e,n,a,i){void 0===e&&(e="DefaultExpected"),void 0===i&&(i=!1),t.prototype.writeExpectedFailure.call(this,e,n,a),i||this._logCustomerPromiseFailure((null==n?void 0:n.message)||"DefaultErrorMessage",e,x.ExpectedFailure,a)},n.prototype._logCustomerPromiseFailure=function(t,n,a,i){void 0===a&&(a=x.Failure),this._extraDataForCustomerPromise&&this._extraDataForCustomerPromise.forEach(function(r){var o,s=r.logFailure,c=r.veto;s({errorCode:r.errorModuleName+((o=g._getExtraDiagnosticInfo())&&o.hasAuthoringStarted?o.authoringSessionClientCount?o.authoringSessionClientCount>1?" with Multiple Users":"":o.isAuthoringUsingDDS?" in Legacy Authoring (DDS)":" in Legacy Authoring (no DDS)":"")+(e._SPKillSwitch.isActivated("c125685f-83e7-44c8-b602-5c21f5b748ae")||window.navigator.onLine?"":" (offline)"),errorScenario:n,errorMessage:t,resultType:a,pageType:null==i?void 0:i.pageType,errorStack:null==i?void 0:i.errorStack,veto:c})})},n}(E)})(),s})());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/sp-diagnostics",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.1",
|
|
4
4
|
"description": "Diagnostics tools for the SharePoint Framework",
|
|
5
5
|
"homepage": "http://aka.ms/spfx",
|
|
6
6
|
"license": "https://aka.ms/spfx/license",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"module": "lib/index.js",
|
|
12
12
|
"typings": "dist/index-internal.d.ts",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@microsoft/sp-core-library": "1.23.
|
|
15
|
-
"@microsoft/sp-lodash-subset": "1.23.
|
|
14
|
+
"@microsoft/sp-core-library": "1.23.1",
|
|
15
|
+
"@microsoft/sp-lodash-subset": "1.23.1"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@rushstack/heft": "1.2.17",
|