@microsoft/sp-diagnostics 1.18.0 → 1.18.1-rc.0
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 +7 -4
- package/dist/{sp-diagnostics_none_9cf11f5cc818ebac1a6e.js → sp-diagnostics_none_1e37c02b96d3971ec96b.js} +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Api/Qos/QosMonitor.js +16 -0
- package/lib-commonjs/common/Killswitches.js +5 -6
- package/lib-commonjs/extraData/setPageExtraData.js +4 -1
- package/package.json +5 -5
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "78359e4b-07c2-43c6-8d0b-d060b4d577e8",
|
|
4
4
|
"alias": "SPDiagnostics",
|
|
5
5
|
"componentType": "Library",
|
|
6
|
-
"version": "1.18.
|
|
6
|
+
"version": "1.18.1",
|
|
7
7
|
"loaderConfig": {
|
|
8
8
|
"internalModuleBaseUrls": [
|
|
9
9
|
"https://localhost:4321/dist/"
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"scriptResources": {
|
|
13
13
|
"sp-diagnostics": {
|
|
14
14
|
"type": "path",
|
|
15
|
-
"path":
|
|
15
|
+
"path": {
|
|
16
|
+
"path": "sp-diagnostics_none_1e37c02b96d3971ec96b.js",
|
|
17
|
+
"integrity": "sha256-Ju0G0W20dDnFF13n/Wae5X3/YPM2tkr9/wjM2QcVc6k="
|
|
18
|
+
}
|
|
16
19
|
},
|
|
17
20
|
"tslib": {
|
|
18
21
|
"type": "component",
|
|
@@ -22,12 +25,12 @@
|
|
|
22
25
|
"@microsoft/sp-lodash-subset": {
|
|
23
26
|
"type": "component",
|
|
24
27
|
"id": "73e1dc6c-8441-42cc-ad47-4bd3659f8a3a",
|
|
25
|
-
"version": "1.18.
|
|
28
|
+
"version": "1.18.1"
|
|
26
29
|
},
|
|
27
30
|
"@microsoft/sp-core-library": {
|
|
28
31
|
"type": "component",
|
|
29
32
|
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
|
|
30
|
-
"version": "1.18.
|
|
33
|
+
"version": "1.18.1"
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
}
|
|
@@ -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 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)}})});
|
|
1
|
+
define("78359e4b-07c2-43c6-8d0b-d060b4d577e8_1.18.1",["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,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,i._SPKillSwitch.isActivated("76672562-f587-4362-a7ad-a1b397102c9a")||(t.isDebug=!!i._BrowserUtilities.safelyAccessSessionStorage("spfx-debug"))}(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);var r=this;this._qosResultTypeValue=((a={})[O.Success]="Success",a[O.Failure]="Failure",a[O.ExpectedFailure]="ExpectedFailure",a),this._ensureAuthoringSessionId=function(){var e,t,n,a,i=null===(t=null===(e=D.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=D.settings)||void 0===n?void 0:n.extraDiagnosticInfo)||void 0===a?void 0:a.authoringOpSequenceId;o&&(r._endExtraData.AuthoringOpSequenceId=o)}},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(),this._ensureAuthoringSessionId()},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
|
@@ -14,6 +14,8 @@ var LOG_SOURCE = {
|
|
|
14
14
|
id: 'QosMonitor'
|
|
15
15
|
};
|
|
16
16
|
var QOS_MONISTOR_HAS_ENDED_ERROR_STRING = "QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.";
|
|
17
|
+
var AUTHORING_SESSION_ID_KEY = 'AuthoringSessionId';
|
|
18
|
+
var AUTHORING_OP_SEQUENCE_ID_KEY = 'AuthoringOpSequenceId';
|
|
17
19
|
/**
|
|
18
20
|
* Qos logger
|
|
19
21
|
* This class represents the Qos monitor APIs
|
|
@@ -32,11 +34,24 @@ var QosMonitor = /** @class */ (function () {
|
|
|
32
34
|
var _a;
|
|
33
35
|
if (copyToCosmos === void 0) { copyToCosmos = false; }
|
|
34
36
|
if (copyToInterana === void 0) { copyToInterana = false; }
|
|
37
|
+
var _this = this;
|
|
35
38
|
this._qosResultTypeValue = (_a = {},
|
|
36
39
|
_a[QosResultType_1.QosResultType.Success] = 'Success',
|
|
37
40
|
_a[QosResultType_1.QosResultType.Failure] = 'Failure',
|
|
38
41
|
_a[QosResultType_1.QosResultType.ExpectedFailure] = 'ExpectedFailure',
|
|
39
42
|
_a);
|
|
43
|
+
this._ensureAuthoringSessionId = function () {
|
|
44
|
+
var _a, _b, _c, _d;
|
|
45
|
+
var authoringSessionId = (_b = (_a = DiagnosticsSettingsManager_1.default.settings) === null || _a === void 0 ? void 0 : _a.extraDiagnosticInfo) === null || _b === void 0 ? void 0 : _b.authoringSessionId;
|
|
46
|
+
if (authoringSessionId) {
|
|
47
|
+
_this._ensureEndExtraData();
|
|
48
|
+
_this._endExtraData[AUTHORING_SESSION_ID_KEY] = authoringSessionId;
|
|
49
|
+
var authoringOpSequenceId = (_d = (_c = DiagnosticsSettingsManager_1.default.settings) === null || _c === void 0 ? void 0 : _c.extraDiagnosticInfo) === null || _d === void 0 ? void 0 : _d.authoringOpSequenceId;
|
|
50
|
+
if (authoringOpSequenceId) {
|
|
51
|
+
_this._endExtraData[AUTHORING_OP_SEQUENCE_ID_KEY] = authoringOpSequenceId;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
40
55
|
sp_core_library_2.Validate.isNonemptyString(scenarioName, 'scenarioName');
|
|
41
56
|
this._id = sp_core_library_2.Guid.newGuid().toString();
|
|
42
57
|
if (!this._isDebugSession()) {
|
|
@@ -174,6 +189,7 @@ var QosMonitor = /** @class */ (function () {
|
|
|
174
189
|
}
|
|
175
190
|
}
|
|
176
191
|
this._logHostType();
|
|
192
|
+
this._ensureAuthoringSessionId();
|
|
177
193
|
};
|
|
178
194
|
QosMonitor.prototype._ensureEndExtraData = function () {
|
|
179
195
|
if (!this._endExtraData) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isAddingDebugFlagToEngagementExtraDataKSActive = exports.isLogTeamsAppTypeKSActivated = exports.isLogVivaConnectionMobileAsAppHostTypeKSActivated = void 0;
|
|
4
4
|
var sp_core_library_1 = require("@microsoft/sp-core-library");
|
|
5
5
|
function isLogVivaConnectionMobileAsAppHostTypeKSActivated() {
|
|
6
6
|
return sp_core_library_1._SPKillSwitch.isActivated('134e389a-67d1-4cf2-8516-d592c1079276'
|
|
@@ -14,11 +14,10 @@ function isLogTeamsAppTypeKSActivated() {
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
exports.isLogTeamsAppTypeKSActivated = isLogTeamsAppTypeKSActivated;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/* '2022-08-23', 'antonla - Do NOT override displayApp if already set' */
|
|
17
|
+
function isAddingDebugFlagToEngagementExtraDataKSActive() {
|
|
18
|
+
return sp_core_library_1._SPKillSwitch.isActivated('76672562-f587-4362-a7ad-a1b397102c9a'
|
|
19
|
+
/* '08/23/2023', 'Log isDebug in EngagementLogger extra data' */
|
|
21
20
|
);
|
|
22
21
|
}
|
|
23
|
-
exports.
|
|
22
|
+
exports.isAddingDebugFlagToEngagementExtraDataKSActive = isAddingDebugFlagToEngagementExtraDataKSActive;
|
|
24
23
|
//# sourceMappingURL=Killswitches.js.map
|
|
@@ -21,7 +21,7 @@ function setPageExtraData(contextInfo, extraData) {
|
|
|
21
21
|
else {
|
|
22
22
|
extraData.isAssociatedSite = false;
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
24
|
+
if (!extraData.displayApp) {
|
|
25
25
|
if (sp_core_library_1._BrowserUtilities.isTeamsHosted()) {
|
|
26
26
|
extraData.displayApp = DisplayApp_1.DisplayApp.Teams;
|
|
27
27
|
if (contextInfo.isEduClass) {
|
|
@@ -58,6 +58,9 @@ function setPageExtraData(contextInfo, extraData) {
|
|
|
58
58
|
}
|
|
59
59
|
extraData.siteType = siteType;
|
|
60
60
|
extraData.pageType = pageType;
|
|
61
|
+
if (!(0, Killswitches_1.isAddingDebugFlagToEngagementExtraDataKSActive)()) {
|
|
62
|
+
extraData.isDebug = !!sp_core_library_1._BrowserUtilities.safelyAccessSessionStorage('spfx-debug');
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
exports.setPageExtraData = setPageExtraData;
|
|
63
66
|
//# sourceMappingURL=setPageExtraData.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/sp-diagnostics",
|
|
3
|
-
"version": "1.18.0",
|
|
3
|
+
"version": "1.18.1-rc.0",
|
|
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,17 +8,17 @@
|
|
|
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.62.1",
|
|
12
12
|
"tslib": "2.3.1",
|
|
13
13
|
"eslint": "8.7.0",
|
|
14
14
|
"@ms/spfx-internal-web-build-rig": "0.1.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@microsoft/sp-core-library": "1.18.0",
|
|
18
|
-
"@microsoft/sp-lodash-subset": "1.18.0"
|
|
17
|
+
"@microsoft/sp-core-library": "1.18.1-rc.0",
|
|
18
|
+
"@microsoft/sp-lodash-subset": "1.18.1-rc.0"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=18.17.1 <19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "heft test --clean",
|