Socket
Socket
Sign inDemoInstall

@microsoft/sp-diagnostics

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/sp-diagnostics - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0-plusbeta

dist/sp-diagnostics_none_5429b595822d1886afe6.js

54

CHANGELOG.json

@@ -5,29 +5,45 @@ {

{
"version": "1.11.0",
"tag": "@microsoft/sp-diagnostics_v1.11.0",
"date": "Thu, 16 Jul 2020 04:33:35 GMT",
"version": "1.12.0",
"tag": "@microsoft/sp-diagnostics_v1.12.0",
"date": "Tue, 16 Mar 2021 14:32:35 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@ms/sp-build-internal-web\" from `~0.29.31` to `~0.29.32`"
}
]
}
},
{
"version": "1.10.0",
"tag": "@microsoft/sp-diagnostics_v1.10.0",
"date": "Mon, 06 Jan 2020 18:14:53 GMT",
"comments": {
"none": [
{
"comment": "rename npm run dev-deploy to deploy"
},
{
"comment": "Use isolatedModules: true in ts-jest"
},
{
"comment": "Add engagement flag for create topic page button"
},
{
"comment": "Rename @ms/spfx-heft-plugins to @microsoft/spfx-heft-plugins in preparation for public release."
},
{
"comment": "Convert const enums."
},
{
"comment": "add boost button"
},
{
"comment": "Removing Killswitch in the qosmonitor"
},
{
"comment": "We skip sending the \"end\" event if we're debugging. We should also skip sending the \"start\" event. "
},
{
"comment": "Add ShareToTeamsButton engagement handler component"
},
{
"comment": "change"
},
{
"comment": "Add --clean flag to the heft start script"
},
{
"comment": "update @types/jest to match current jest version"
}
],
"dependency": [
},
{
"comment": "Updating dependency \"@ms/sp-build-internal-web\" from `~0.29.23` to `~0.29.24`"
"comment": "Add extra data to engagement logger in sp-diagnostics"
}

@@ -34,0 +50,0 @@ ]

# Change Log - @microsoft/sp-diagnostics
This log was last generated on Thu, 16 Jul 2020 04:33:35 GMT and should not be manually modified.
This log was last generated on Tue, 16 Mar 2021 14:32:35 GMT and should not be manually modified.
## 1.11.0
Thu, 16 Jul 2020 04:33:35 GMT
## 1.12.0
Tue, 16 Mar 2021 14:32:35 GMT
*Version update only*
## 1.10.0
Mon, 06 Jan 2020 18:14:53 GMT
### Updates
- rename npm run dev-deploy to deploy
- Use isolatedModules: true in ts-jest
- Add engagement flag for create topic page button
- Rename @ms/spfx-heft-plugins to @microsoft/spfx-heft-plugins in preparation for public release.
- Convert const enums.
- add boost button
- Removing Killswitch in the qosmonitor
- We skip sending the "end" event if we're debugging. We should also skip sending the "start" event.
- Add ShareToTeamsButton engagement handler component
- change
- Add --clean flag to the heft start script
- update @types/jest to match current jest version
- Add extra data to engagement logger in sp-diagnostics

@@ -6,26 +6,25 @@ {

"componentType": "Library",
"version": "1.11.0",
"version": "1.12.0",
"loaderConfig": {
"entryModuleId": "sp-diagnostics",
"internalModuleBaseUrls": [
"https://localhost:4321/"
"https://localhost:4321/dist/"
],
"entryModuleId": "sp-diagnostics",
"scriptResources": {
"sp-diagnostics": {
"type": "path",
"path": "dist/sp-diagnostics.js"
"path": "sp-diagnostics_none_5429b595822d1886afe6.js"
},
"@microsoft/sp-lodash-subset": {
"type": "component",
"version": "1.11.0",
"id": "73e1dc6c-8441-42cc-ad47-4bd3659f8a3a"
"id": "73e1dc6c-8441-42cc-ad47-4bd3659f8a3a",
"version": "1.12.0"
},
"@microsoft/sp-core-library": {
"type": "component",
"version": "1.11.0",
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b"
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
"version": "1.12.0"
}
}
},
"isInternal": true
}
}

@@ -27,2 +27,4 @@ /**

/* Excluded from this release type: _IDiagnosticContextInfo */
/* Excluded from this release type: _IDiagnosticsSettings */

@@ -81,2 +83,6 @@

/* Excluded from this release type: _PageType */
/* Excluded from this release type: _PromotedState */
/* Excluded from this release type: _QosLogger */

@@ -83,0 +89,0 @@

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.5.0"
"packageVersion": "7.13.0"
}
]
}
/**
* @copyright Microsoft Corporation.All rights reserved.
* @file EngagementLogger.ts
* EngagementLogger logger
*/
* @copyright Microsoft Corporation.All rights reserved.
* @file EngagementLogger.ts
* EngagementLogger logger
*/
import { IEngagementData, IEngagementHandler } from './IEngagementHandler';

@@ -28,17 +28,17 @@ import ILogEntry from '../ILogEntry';

/**
* Engagement logging
*
* @remarks
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
* tagName follows `<Workload>.controlName.actionName` pattern
* For example, `{ name = "AddButton.Click" }`,
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
* `<Workload>` is set in Telemetry settings
* `IEngagementData` interface is mapped to a set of enums for standardization of mapping.
* Add new items to enum in order to register a new item specification.
* SiteType is defined in SiteType enum
* CurrentPage is defined in CurrentPage enum
* Component is defined in Component enum
* Feature is defined in Feature enum.
*/
* Engagement logging
*
* @remarks
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
* tagName follows `<Workload>.controlName.actionName` pattern
* For example, `{ name = "AddButton.Click" }`,
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
* `<Workload>` is set in Telemetry settings
* `IEngagementData` interface is mapped to a set of enums for standardization of mapping.
* Add new items to enum in order to register a new item specification.
* SiteType is defined in SiteType enum
* CurrentPage is defined in CurrentPage enum
* Component is defined in Component enum
* Feature is defined in Feature enum.
*/
static log(engagementData: IEngagementData): void;

@@ -79,3 +79,4 @@ /**

private static _addContextData;
private static _appendExtraData;
}
//# sourceMappingURL=EngagementLogger.d.ts.map
/**
* @copyright Microsoft Corporation.All rights reserved.
* @file EngagementLogger.ts
* EngagementLogger logger
*/
* @copyright Microsoft Corporation.All rights reserved.
* @file EngagementLogger.ts
* EngagementLogger logger
*/
import LogManager from '../LogManager/LogManager';
import DiagnosticsSettingsManager from '../../DiagnosticsSettingsManager';
import { setPageExtraData } from '../../extraData/setPageExtraData';
/**

@@ -22,3 +23,5 @@ * Engagement logging

EngagementLogger._addHandler = function (logger) {
EngagementLogger._handler = function (e) { logger.logData(e); };
EngagementLogger._handler = function (e) {
logger.logData(e);
};
EngagementLogger._logManager.addHandler(EngagementLogger._handler);

@@ -36,17 +39,17 @@ };

/**
* Engagement logging
*
* @remarks
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
* tagName follows `<Workload>.controlName.actionName` pattern
* For example, `{ name = "AddButton.Click" }`,
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
* `<Workload>` is set in Telemetry settings
* `IEngagementData` interface is mapped to a set of enums for standardization of mapping.
* Add new items to enum in order to register a new item specification.
* SiteType is defined in SiteType enum
* CurrentPage is defined in CurrentPage enum
* Component is defined in Component enum
* Feature is defined in Feature enum.
*/
* Engagement logging
*
* @remarks
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
* tagName follows `<Workload>.controlName.actionName` pattern
* For example, `{ name = "AddButton.Click" }`,
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
* `<Workload>` is set in Telemetry settings
* `IEngagementData` interface is mapped to a set of enums for standardization of mapping.
* Add new items to enum in order to register a new item specification.
* SiteType is defined in SiteType enum
* CurrentPage is defined in CurrentPage enum
* Component is defined in Component enum
* Feature is defined in Feature enum.
*/
EngagementLogger.log = function (engagementData) {

@@ -106,2 +109,3 @@ EngagementLogger._logEngagementData(engagementData);

EngagementLogger._addContextData(engagementData);
EngagementLogger._appendExtraData(engagementData);
EngagementLogger._logManager.log(engagementData);

@@ -113,3 +117,3 @@ };

if (!isLogEntry) {
var tagNameRegex = /(\w+)\.(\w+).(\w+)/ig;
var tagNameRegex = /(\w+)\.(\w+).(\w+)/gi;
if (tagNameRegex.test(engagementData.name) === false) {

@@ -133,2 +137,10 @@ throw new Error(engagementData.name + " tagName does not follow AppName.ControlName.ActionName pattern");

};
EngagementLogger._appendExtraData = function (data) {
if (DiagnosticsSettingsManager.isInitialized) {
var contextInfo = DiagnosticsSettingsManager.settings.contextInfo;
if (contextInfo) {
setPageExtraData(contextInfo, data.extraData);
}
}
};
EngagementLogger._logManager = new LogManager();

@@ -135,0 +147,0 @@ return EngagementLogger;

@@ -45,3 +45,3 @@ /**

* will automatically publish engagement specific data to Interana
*/
*/
isIntentional?: boolean;

@@ -71,8 +71,3 @@ /**

*/
export declare const enum SiteType {
Group = "GroupSite",
Team = "TeamSite",
CommSite = "CommunicationSite",
PublishingSite = "PublishingSite"
}
export declare type SiteType = 'GroupSite' | 'TeamSite' | 'CommunicationSite' | 'PublishingSite';
/**

@@ -82,12 +77,3 @@ * CurrentPage Classification for the currentPage field in Engagement Event stream.

*/
export declare const enum CurrentPage {
HomePage = "HomePage",
NewsArticlePage = "NewsArticlePage",
ArticlePage = "ArticlePage",
ModernPage = "ModernPage",
ClassicPage = "ClassicPage",
NewsPage = "NewsPage",
NewsDigestPage = "NewsDigestPage",
Space = "Space"
}
export declare type CurrentPage = 'HomePage' | 'NewsArticlePage' | 'ArticlePage' | 'ModernPage' | 'ClassicPage' | 'NewsPage' | 'NewsDigestPage' | 'Space';
/**

@@ -97,67 +83,3 @@ * Component list for the component field in Engagement Event stream.

*/
export declare const enum Component {
View = "View",
Button = "Button",
CommentDeleteCancelAction = "CommentDeleteCancelAction",
CommentDeleteConfirmAction = "CommentDeleteConfirmAction",
CommentDeleteOpenAction = "CommentDeleteOpenAction",
CommentReplyAction = "CommentReplyAction",
CommentReplyPostButton = "CommentReplyPostButton",
CommentShowMoreButton = "CommentShowMoreButton",
CommentsDisable = "CommentsDisable",
CommentsEnable = "CommentsEnable",
LoadMoreCommentReplies = "LoadMoreCommentReplies",
LoadMoreComments = "LoadMoreComments",
DiscardButton = "DiscardButton",
DiscardOKButton = "DiscardOKButton",
EditButton = "EditButton",
NewApp = "NewApp",
NewButton = "NewButton",
NewDocLib = "NewDocLib",
NewList = "NewList",
NewPlan = "NewPlan",
NewsAdd = "NewsAdd",
NewsSeeAll = "NewsSeeAll",
NewsArticleTitle = "NewsArticleTitle",
NewsSiteTitle = "NewsSiteTitle",
NewsImageArea = "NewsImageArea",
NewsItemPinned = "NewsItemPinned",
NewsPinnedItemRemoved = "NewsPinnedItemRemoved",
NewsPinnedItemSorted = "NewsPinnedItemSorted",
NewsSocialAction = "NewsSocialAction",
SelectNewsToPin = "SelectNewsToPin",
CreateNewsLinkFromHome = "CreateNewsLinkFromHome",
CreateNewsPostFromHome = "CreateNewsPostFromHome",
CreateNewsPostFromArticle = "CreateNewsPostFromArticle",
NewsDraft = "NewsDraft",
PostPublishAddToNav = "PostPublishAddToNav",
PostPublishCopyAddress = "PostPublishCopyAddress",
PostPublishEmail = "PostPublishEmail",
PostPublishPostAsNews = "PostPublishPostAsNews",
PromoteButton = "PromoteButton",
PublishButton = "PublishButton",
SaveButton = "SaveButton",
CreateNewsDigest = "CreateNewsDigest",
ContinueNewsDigest = "ContinueNewsDigest",
SendNewsDigest = "SendNewsDigest",
CancelNewsDigest = "CancelNewsDigest",
ShareButton = "ShareButton",
StartWithPageCopy = "StartWithPageCopy",
StartWithNewsPostCopy = "StartWithNewsPostCopy",
StartWithTemplate = "StartWithTemplate",
ScrollBar = "ScrollBar",
Header = "Header",
Component = "Component",
Extension = "Extension",
PageSettingsButton = "PageSettingsButton",
SaveAsTemplateButton = "SaveAsTemplateButton",
SubmitButtonClick = "SubmitButtonClick",
ReviewApprovalsButtonClick = "ReviewApprovalsButtonClick",
SubmitDone = "SubmitDone",
ApproveDone = "ApproveDone",
RejectDone = "RejectDone",
CheckedOutButton = "CheckedOutButton",
BaseWPSelectedLayout = "BaseWPSelectedLayout",
NewsRollup = "NewsRollup"
}
export declare type Component = 'View' | 'Button' | 'CommentDeleteCancelAction' | 'CommentDeleteConfirmAction' | 'CommentDeleteOpenAction' | 'CommentReplyAction' | 'CommentReplyPostButton' | 'CommentShowMoreButton' | 'CommentsDisable' | 'CommentsEnable' | 'LoadMoreCommentReplies' | 'LoadMoreComments' | 'DiscardButton' | 'DiscardOKButton' | 'EditButton' | 'NewApp' | 'NewButton' | 'NewDocLib' | 'NewList' | 'NewPlan' | 'NewsAdd' | 'NewsSeeAll' | 'NewsArticleTitle' | 'NewsSiteTitle' | 'NewsImageArea' | 'NewsItemPinned' | 'NewsPinnedItemRemoved' | 'NewsPinnedItemSorted' | 'NewsSocialAction' | 'SelectNewsToPin' | 'CreateNewsLinkFromHome' | 'CreateTopicPageFromHome' | 'CreateNewsPostFromHome' | 'CreateNewsPostFromArticle' | 'NewsDraft' | 'PostPublishAddToNav' | 'PostPublishCopyAddress' | 'PostPublishEmail' | 'PostShareToTeams' | 'PostPublishPostAsNews' | 'PromoteButton' | 'PublishButton' | 'SaveButton' | 'CreateNewsDigest' | 'ContinueNewsDigest' | 'SendNewsDigest' | 'CancelNewsDigest' | 'ShareButton' | 'ShareToTeamsButton' | 'StartWithPageCopy' | 'StartWithNewsPostCopy' | 'StartWithTemplate' | 'ScrollBar' | 'Header' | 'Component' | 'Extension' | 'PageSettingsButton' | 'SaveAsTemplateButton' | 'SubmitButtonClick' | 'ReviewApprovalsButtonClick' | 'SubmitDone' | 'ApproveDone' | 'RejectDone' | 'CheckedOutButton' | 'BaseWPSelectedLayout' | 'NewsRollup' | 'SaveAsDraftByInactivity' | 'DiscardByInactivity' | 'BoostButton';
/**

@@ -167,19 +89,3 @@ * UsageType list for the usageType field in Engagement Event stream.

*/
export declare const enum UsageType {
Click = "Click",
Scroll = "Scroll",
ScrollUp = "ScrollUp",
ScrollDown = "ScrollDown",
Hover = "Hover",
Load = "Load",
PageLoad = "PageLoad",
Render = "Render",
Drag = "Drag",
Drop = "Drop",
Tap = "Tap",
KeyDown = "KeyDown",
KeyPress = "KeyPress",
RightClick = "RightClick",
Swipe = "Swipe"
}
export declare type UsageType = 'Click' | 'Scroll' | 'ScrollUp' | 'ScrollDown' | 'Hover' | 'Load' | 'PageLoad' | 'Render' | 'Drag' | 'Drop' | 'Tap' | 'KeyDown' | 'KeyPress' | 'RightClick' | 'Swipe';
/**

@@ -189,12 +95,3 @@ * Feature list for the feature field in Engagement Event stream.

*/
export declare const enum Feature {
News = "News",
NewsDigest = "NewsDigest",
WebPart = "WebPart",
ScrollBar = "ScrollBar",
Header = "Header",
Canvas = "Canvas",
LeftNav = "Leftnav",
TopNav = "TopNav"
}
export declare type Feature = 'News' | 'NewsDigest' | 'WebPart' | 'ScrollBar' | 'Header' | 'Canvas' | 'Leftnav' | 'TopNav';
//# sourceMappingURL=IEngagementHandler.d.ts.map

@@ -6,3 +6,3 @@ /**

key: string;
args: Array<any>;
args: unknown[];
}

@@ -21,26 +21,27 @@ /**

*/
get shouldExecuteInRealTime(): boolean;
/**
* Sets the behavior for this execution stack.
* When set to true, all entries on stack will be processed and future entries
* will be executed in real time.
* When set to false, future entries will be saved in the execution stack for
* later processing.
*/
shouldExecuteInRealTime: boolean;
* Sets the behavior for this execution stack.
* When set to true, all entries on stack will be processed and future entries
* will be executed in real time.
* When set to false, future entries will be saved in the execution stack for
* later processing.
*/
set shouldExecuteInRealTime(executeInRealTime: boolean);
/**
* Registers an external handler to collection for delayed asyncronous processing.
* Registers an external handler to collection for delayed asynchronous processing.
* Handlers are registered once. If handler is already registered, it does nothing.
*/
addHandler(key: string, handler: (args: Array<any>) => void): void;
addHandler(key: string, handler: (...args: unknown[]) => void): void;
/**
* Execution Entry registration for delayed asyncronous processing.
* Execution Entry registration for delayed asynchronous processing.
*/
addExecutionEntry(key: string, ...args: any[]): void;
addExecutionEntry(key: string, ...args: unknown[]): void;
/**
* Removes an external executionEntry handler from collection for asyncronous event logging.
* Removes an external executionEntry handler from collection for asynchronous event logging.
* Logger is registered once.
*/
removeHandler(key: string, handler: (args: Array<any>) => void): void;
removeHandler(key: string, handler: (...args: unknown[]) => void): void;
/**
* Reset function clears executionEntry handler collection for asyncronous event logging.
* Reset function clears executionEntry handler collection for asynchronous event logging.
* All recorded execution entries and handlers are purged.

@@ -47,0 +48,0 @@ */

@@ -11,3 +11,3 @@ /**

this._shouldExecuteInRealTime = false;
this._handlers = {}; // tslint:disable-line:typedef
this._handlers = {};
this._executionEntries = [];

@@ -36,7 +36,7 @@ }

},
enumerable: true,
enumerable: false,
configurable: true
});
/**
* Registers an external handler to collection for delayed asyncronous processing.
* Registers an external handler to collection for delayed asynchronous processing.
* Handlers are registered once. If handler is already registered, it does nothing.

@@ -49,3 +49,3 @@ */

this._initializeHandlerArrayForKey(key);
var handlers = this._handlers[key]; // tslint:disable-line:no-any
var handlers = this._handlers[key];
if (handlers.indexOf(handler) === -1) {

@@ -56,3 +56,3 @@ handlers.push(handler);

/**
* Execution Entry registration for delayed asyncronous processing.
* Execution Entry registration for delayed asynchronous processing.
*/

@@ -73,3 +73,3 @@ ExecutionQueue.prototype.addExecutionEntry = function (key) {

/**
* Removes an external executionEntry handler from collection for asyncronous event logging.
* Removes an external executionEntry handler from collection for asynchronous event logging.
* Logger is registered once.

@@ -84,3 +84,3 @@ */

/**
* Reset function clears executionEntry handler collection for asyncronous event logging.
* Reset function clears executionEntry handler collection for asynchronous event logging.
* All recorded execution entries and handlers are purged.

@@ -112,9 +112,10 @@ */

ExecutionQueue.prototype._processAllExecutionEntries = function () {
var _this = this;
this._executionEntries.forEach(function (entry) {
if (entry && _this._handlers[entry.key]) {
for (var _i = 0, _a = this._executionEntries; _i < _a.length; _i++) {
var entry = _a[_i];
if (entry && this._handlers[entry.key]) {
try {
_this._handlers[entry.key].forEach(function (handler) {
handler.apply(_this, entry.args);
});
for (var _b = 0, _c = this._handlers[entry.key]; _b < _c.length; _b++) {
var handler = _c[_b];
handler.apply(this, entry.args);
}
}

@@ -125,3 +126,3 @@ catch (e) {

}
});
}
};

@@ -128,0 +129,0 @@ ExecutionQueue.prototype._processExecutionEntry = function (key, args) {

/**
* @Copyright (c) Microsoft Corporation. All rights reserved.
* @file ILogEntry.ts
* ILogEntry interface
*/
* @Copyright (c) Microsoft Corporation. All rights reserved.
* @file ILogEntry.ts
* ILogEntry interface
*/
import LogType from './LogType';

@@ -7,0 +7,0 @@ /**

/**
* @Copyright (c) Microsoft Corporation. All rights reserved.
* @file ILogEntry.ts
* ILogEntry interface
*/
* @Copyright (c) Microsoft Corporation. All rights reserved.
* @file ILogEntry.ts
* ILogEntry interface
*/
//# sourceMappingURL=ILogEntry.js.map
/**
* @file LogFeature.ts
* @Copyright (c) Microsoft Corporation. All rights reserved.
* Used for logging so you can filter logs by features.
*/
* @file LogFeature.ts
* @Copyright (c) Microsoft Corporation. All rights reserved.
* Used for logging so you can filter logs by features.
*/
/**

@@ -7,0 +7,0 @@ * @internal

/**
* @file LogFeature.ts
* @Copyright (c) Microsoft Corporation. All rights reserved.
* Used for logging so you can filter logs by features.
*/
* @file LogFeature.ts
* @Copyright (c) Microsoft Corporation. All rights reserved.
* Used for logging so you can filter logs by features.
*/
/**

@@ -7,0 +7,0 @@ * @internal

@@ -23,3 +23,3 @@ /**

constructor(size: number);
readonly count: number;
get count(): number;
push(item: DataType): void;

@@ -31,3 +31,3 @@ forEach(handle: (value: DataType) => void): void;

*/
private readonly _tail;
private get _tail();
private _isNotWrapped;

@@ -34,0 +34,0 @@ /**

@@ -28,3 +28,3 @@ /**

},
enumerable: true,
enumerable: false,
configurable: true

@@ -77,7 +77,7 @@ });

},
enumerable: true,
enumerable: false,
configurable: true
});
CircularBuffer.prototype._isNotWrapped = function () {
return this._count === (this._head + 1);
return this._count === this._head + 1;
};

@@ -84,0 +84,0 @@ /**

@@ -13,3 +13,3 @@ /**

export default class LogManager<TLog> {
private static readonly _maxVerboseLog;
private static get _maxVerboseLog();
private _shouldLogInRealTime;

@@ -23,3 +23,3 @@ private _handlers;

*/
readonly events: CircularBuffer<TLog>;
get events(): CircularBuffer<TLog>;
/**

@@ -26,0 +26,0 @@ * Registers an external logger to logger collection for asynchronous event logging.

@@ -25,3 +25,3 @@ /**

},
enumerable: true,
enumerable: false,
configurable: true

@@ -37,3 +37,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -40,0 +40,0 @@ });

@@ -15,3 +15,3 @@ import ILogSource from './ILogSource';

static create(id: string): LogSource;
readonly id: string;
get id(): string;
/**

@@ -18,0 +18,0 @@ * @returns if the LogSource is empty.

@@ -24,3 +24,3 @@ // Copyright (c) Microsoft. All rights reserved.

},
enumerable: true,
enumerable: false,
configurable: true

@@ -27,0 +27,0 @@ });

@@ -17,5 +17,6 @@ /**

private _qosLogger;
static readonly instance: QosLogger;
static get instance(): QosLogger;
constructor();
shouldProcessInRealTime: boolean;
get shouldProcessInRealTime(): boolean;
set shouldProcessInRealTime(processInRealTime: boolean);
setLogger(qosLogger: IQos): void;

@@ -22,0 +23,0 @@ getQosEvent(key: string): IQos;

@@ -23,3 +23,3 @@ /**

},
enumerable: true,
enumerable: false,
configurable: true

@@ -35,3 +35,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -64,7 +64,12 @@ });

};
/* tslint:disable-next-line:no-any typedef */
QosLogger.prototype.initializeLogger = function () {
var _this = this;
var startHandler = function (key, e) { _this._startMonitor(key, e); }; /* tslint:disable-line:max-line-length typedef */
var endHandler = function (key, e) { _this._endMonitor(key, e); }; /* tslint:disable-line:max-line-length typedef */
// tslint:disable-next-line:typedef
var startHandler = function (key, e) {
_this._startMonitor(key, e);
};
// tslint:disable-next-line:typedef
var endHandler = function (key, e) {
_this._endMonitor(key, e);
};
this._deferExecutor.addHandler('start', startHandler);

@@ -71,0 +76,0 @@ this._deferExecutor.addHandler('end', endHandler);

@@ -11,3 +11,2 @@ import { QosResultType } from './QosResultType';

private static readonly qosMonitorHasEndedErrorString;
private static _isExtraDataSetterEnabledKSId;
private _id;

@@ -28,14 +27,15 @@ private _hasEnded;

/**
* Creates a QoS monitor (initializes it and logs the start event)
* @param scenarioName - Unique name of the QoS scenario
* You will see start tag: SPPages.ScenarioName.Start
* @param copyToEngagement - indicate whether this data should be used as Engagement as well.
*/
* Creates a QoS monitor (initializes it and logs the start event)
* @param scenarioName - Unique name of the QoS scenario
* You will see start tag: SPPages.ScenarioName.Start
* @param copyToEngagement - indicate whether this data should be used as Engagement as well.
*/
constructor(scenarioName: string, copyToEngagement?: boolean);
readonly name: string;
readonly shortEventName: string;
readonly resultCode: string;
readonly resultType: QosResultType;
extraData: any;
readonly hasEnded: boolean;
get name(): string;
get shortEventName(): string;
get resultCode(): string;
get resultType(): QosResultType;
get extraData(): Object;
set extraData(value: Object);
get hasEnded(): boolean;
/**

@@ -60,2 +60,3 @@ * QoS monitor ends with success

private _writeQosEnd;
private _ensureCorrelationId;
private _isDebugSession;

@@ -62,0 +63,0 @@ private _shouldSkip;

// Copyright (c) Microsoft. All rights reserved.
import { _SPKillSwitch, Guid, Text, Validate } from '@microsoft/sp-core-library';
import { Guid, Text, Validate } from '@microsoft/sp-core-library';
import TraceLogger from '../Trace/TraceLogger';
import { QosResultType } from './QosResultType';
import QosLogger from './QosLogger';

@@ -15,7 +16,7 @@ import EngagementLogger from '../Engagement/EngagementLogger';

/**
* Creates a QoS monitor (initializes it and logs the start event)
* @param scenarioName - Unique name of the QoS scenario
* You will see start tag: SPPages.ScenarioName.Start
* @param copyToEngagement - indicate whether this data should be used as Engagement as well.
*/
* Creates a QoS monitor (initializes it and logs the start event)
* @param scenarioName - Unique name of the QoS scenario
* You will see start tag: SPPages.ScenarioName.Start
* @param copyToEngagement - indicate whether this data should be used as Engagement as well.
*/
function QosMonitor(scenarioName, copyToEngagement) {

@@ -25,10 +26,9 @@ var _a;

this._qosResultTypeValue = (_a = {},
_a[0 /* Success */] = 'Success',
_a[1 /* Failure */] = 'Failure',
_a[2 /* ExpectedFailure */] = 'ExpectedFailure',
_a[QosResultType.Success] = 'Success',
_a[QosResultType.Failure] = 'Failure',
_a[QosResultType.ExpectedFailure] = 'ExpectedFailure',
_a);
Validate.isNonemptyString(scenarioName, 'scenarioName');
this._id = Guid.newGuid().toString();
if (!this._isDebugSession() ||
_SPKillSwitch.isActivated(Guid.parse('2f038457-f3a3-40d4-8eb1-c9b4495f2419'), '10/15/2019', 'WEX_SkipNonShipQoSUploadStartEvents')) {
if (!this._isDebugSession()) {
QosLogger.instance.startQosMonitor(this._id, { name: scenarioName });

@@ -56,3 +56,3 @@ }

},
enumerable: true,
enumerable: false,
configurable: true

@@ -64,3 +64,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -72,3 +72,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -78,6 +78,5 @@ });

get: function () {
/* tslint:disable-next-line:no-any */
return this._endResult;
},
enumerable: true,
enumerable: false,
configurable: true

@@ -92,3 +91,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -100,3 +99,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -108,4 +107,5 @@ });

*/
// tslint:disable-next-line:no-any
QosMonitor.prototype.writeSuccess = function (extraData) {
this._writeQosEnd(0 /* Success */, undefined, undefined, extraData);
this._writeQosEnd(QosResultType.Success, undefined, undefined, extraData);
};

@@ -117,5 +117,6 @@ /**

*/
QosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex, extraData) {
QosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex, extraData // tslint:disable-line:no-any
) {
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultUnexpected'; }
this._writeQosEnd(1 /* Failure */, tagNameSuffix, ex, extraData);
this._writeQosEnd(QosResultType.Failure, tagNameSuffix, ex, extraData);
};

@@ -127,33 +128,45 @@ /*

*/
QosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex, extraData) {
QosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex, extraData // tslint:disable-line:no-any
) {
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultExpected'; }
this._writeQosEnd(2 /* ExpectedFailure */, tagNameSuffix, ex, extraData);
this._writeQosEnd(QosResultType.ExpectedFailure, tagNameSuffix, ex, extraData);
};
QosMonitor.prototype._writeQosEnd = function (resultType, tagNameSuffix, ex, extraData) {
if (!this._shouldSkip(resultType)) {
var enableExtraDataSetter = !_SPKillSwitch.isActivated(QosMonitor._isExtraDataSetterEnabledKSId, '9/11/2019', 'WPLoadExtraData');
/* tslint:disable-next-line:no-any */
var existingExtraData = enableExtraDataSetter ? this.extraData : undefined;
if (DiagnosticsSettingsManager.isInitialized &&
resultType !== 0 /* Success */) {
var correlationId = DiagnosticsSettingsManager.settings.correlationId;
if (!extraData) {
extraData = existingExtraData || {};
QosMonitor.prototype._writeQosEnd = function (resultType, tagNameSuffix, ex, extraData // tslint:disable-line:no-any
) {
if (this._shouldSkip(resultType)) {
return;
}
this._ensureCorrelationId(resultType, extraData);
this._endResultCode = tagNameSuffix;
this._endResult = resultType;
var endData = {
resultCode: this._endResultCode,
resultType: this._endResult,
error: ex ? ex.message : undefined,
extraData: this._endExtraData
};
QosLogger.instance.writeQosEndResult(this._id, endData);
this._writeToEngagement();
};
QosMonitor.prototype._ensureCorrelationId = function (resultType, extraData // tslint:disable-line:no-any
) {
var _this = this;
if (extraData) {
if (!this._endExtraData) {
this._endExtraData = {};
}
// Instead of slower ...[spread], copy over the incoming values manually
Object.keys(extraData).forEach(function (k) { return (_this._endExtraData[k] = extraData[k]); });
}
if (DiagnosticsSettingsManager.isInitialized && resultType !== QosResultType.Success) {
var capitalKey = 'CorrelationId';
var lowerKey = 'correlationId';
var correlationId = (this._endExtraData && (this._endExtraData[capitalKey] || this._endExtraData[lowerKey])) ||
DiagnosticsSettingsManager.settings.correlationId;
if (correlationId) {
if (!this._endExtraData) {
this._endExtraData = {};
}
// Reuse the existing CorrelationId column for extraData
extraData.CorrelationId = extraData.correlationId ||
extraData.CorrelationId ||
correlationId;
this._endExtraData[capitalKey] = correlationId;
}
this._endResultCode = tagNameSuffix;
this._endExtraData = extraData || existingExtraData;
this._endResult = resultType;
var endData = {
resultCode: this._endResultCode,
resultType: this._endResult,
error: ex ? ex.message : undefined,
extraData: this._endExtraData
};
QosLogger.instance.writeQosEndResult(this._id, endData);
this._writeToEngagement();
}

@@ -165,3 +178,3 @@ };

QosMonitor.prototype._shouldSkip = function (result) {
if (this._hasEnded && (this._endResult !== undefined)) {
if (this._hasEnded && this._endResult !== undefined) {
var message = Text.format(QosMonitor.qosMonitorHasEndedErrorString, this.name, this._qosResultTypeValue[this._endResult], this._qosResultTypeValue[result]);

@@ -209,4 +222,3 @@ if (this._endResult !== result) {

};
QosMonitor.qosMonitorHasEndedErrorString = 'QoS monitor \'{0}\' has ended with \'{1}\' already. Ignoring \'{2}\' tag.';
QosMonitor._isExtraDataSetterEnabledKSId = Guid.parse('6d18e32c-abd5-40c1-8ce1-3fb551418901');
QosMonitor.qosMonitorHasEndedErrorString = "QoS monitor '{0}' has ended with '{1}' already. Ignoring '{2}' tag.";
return QosMonitor;

@@ -213,0 +225,0 @@ }());

@@ -5,10 +5,15 @@ /**

/**
* Qos Result Type enum.
* Qos Result Type const object.
* @internal
*/
export declare const enum QosResultType {
Success = 0,
Failure = 1,
ExpectedFailure = 2
}
export declare const QosResultType: {
readonly Success: 0;
readonly Failure: 1;
readonly ExpectedFailure: 2;
};
/**
* Qos Result Type type.
* @internal
*/
export declare type QosResultType = typeof QosResultType[keyof typeof QosResultType];
//# sourceMappingURL=QosResultType.d.ts.map
/**
* @copyright Microsoft Corporation. All rights reserved.
*/
/**
* Qos Result Type const object.
* @internal
*/
// tslint:disable-next-line:typedef variable-name
export var QosResultType = {
Success: 0,
Failure: 1,
ExpectedFailure: 2
};
//# sourceMappingURL=QosResultType.js.map
/**
* @copyright Microsoft Corporation.All rights reserved.
* @file ITraceLogger.ts
* ITraceLogger interface
*/
* @copyright Microsoft Corporation.All rights reserved.
* @file ITraceLogger.ts
* ITraceLogger interface
*/
import ILogEntry from '../ILogEntry';

@@ -7,0 +7,0 @@ import ILogSource from '../ILogSource';

/**
* @copyright Microsoft Corporation.All rights reserved.
* @file ITraceLogger.ts
* ITraceLogger interface
*/
* @copyright Microsoft Corporation.All rights reserved.
* @file ITraceLogger.ts
* ITraceLogger interface
*/
//# sourceMappingURL=ITraceLogger.js.map

@@ -38,11 +38,11 @@ /**

toString(): string;
readonly timestamp: number;
readonly level: LogLevel;
readonly prefix: string;
readonly scope: LogSource;
readonly source: string;
readonly message: string;
readonly error: Error;
private readonly _maxSourceLength;
private readonly _maxMessageLength;
get timestamp(): number;
get level(): LogLevel;
get prefix(): string;
get scope(): LogSource;
get source(): string;
get message(): string;
get error(): Error;
private get _maxSourceLength();
private get _maxMessageLength();
private _validate;

@@ -49,0 +49,0 @@ private _setData;

@@ -49,3 +49,3 @@ import { logSourceServiceKey } from '../LogSource';

},
enumerable: true,
enumerable: false,
configurable: true

@@ -57,3 +57,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -65,3 +65,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -73,3 +73,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -81,3 +81,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -89,3 +89,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -97,3 +97,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -105,3 +105,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -113,3 +113,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -116,0 +116,0 @@ });

@@ -65,3 +65,3 @@ import ILogEntry from '../ILogEntry';

* and most likely overriden by next scenario that logs something verbose.
**/
**/
static logVerbose(source: ILogSource, message: string, eventName?: string): void;

@@ -92,7 +92,8 @@ /**

*/
static get shouldWriteToConsole(): boolean;
/**
* Toggles console output functionality.
* Property can be chaged by remote caller.
*/
static shouldWriteToConsole: boolean;
* Toggles console output functionality.
* Property can be chaged by remote caller.
*/
static set shouldWriteToConsole(shouldWrite: boolean);
static logVerboseWithLogEntry(source: ILogSource, logEntry: ILogEntry, eventName?: string): void;

@@ -99,0 +100,0 @@ private static _log;

@@ -68,3 +68,3 @@ import { Validate } from '@microsoft/sp-core-library';

* and most likely overriden by next scenario that logs something verbose.
**/
**/
TraceLogger.logVerbose = function (source, message, eventName) {

@@ -106,3 +106,5 @@ Validate.isNonemptyString(message, 'message');

*/
get: function () { return TraceLogger._shouldWriteToConsole; },
get: function () {
return TraceLogger._shouldWriteToConsole;
},
/**

@@ -123,12 +125,12 @@ * Toggles console output functionality.

},
enumerable: true,
enumerable: false,
configurable: true
});
/*
* Trace logging with `LogEntry`
* The same with above other than wrapped log into `logEntry`
* Trace message should be packed into `logProperties`
* `LogType` should be `LogType.Trace` and LogProperties should have something like `{errors:errorMessage}`
* Do NOT add PII data!
**/
* Trace logging with `LogEntry`
* The same with above other than wrapped log into `logEntry`
* Trace message should be packed into `logProperties`
* `LogType` should be `LogType.Trace` and LogProperties should have something like `{errors:errorMessage}`
* Do NOT add PII data!
**/
TraceLogger.logVerboseWithLogEntry = function (source, logEntry, eventName) {

@@ -154,5 +156,5 @@ Validate.isNotNullOrUndefined(logEntry, 'LogEntry');

/*
* EventName is:
* sourceId.eventName or sourceId if eventName is not provided.
*/
* EventName is:
* sourceId.eventName or sourceId if eventName is not provided.
*/
TraceLogger._addEventPrefix = function (source, eventName) {

@@ -167,5 +169,5 @@ if (!eventName) {

/*
* The log message in console is:
* `[eventName]: data`.
*/
* The log message in console is:
* `[eventName]: data`.
*/
TraceLogger._writeToConsole = function (logEvent, isError, resultCode) {

@@ -172,0 +174,0 @@ // @todo (SPPPLAT VSO#250083): This date should be a part of the logEvent.

@@ -22,3 +22,3 @@ /**

*/
static readonly isInitialized: boolean;
static get isInitialized(): boolean;
/**

@@ -25,0 +25,0 @@ * Used to refresh the telemetry settings when they change from the application

@@ -43,3 +43,3 @@ /**

},
enumerable: true,
enumerable: false,
configurable: true

@@ -46,0 +46,0 @@ });

@@ -16,3 +16,3 @@ /**

static updateSettings(settings: Partial<IDiagnosticsSettings>): void;
static readonly isInitialized: boolean;
static get isInitialized(): boolean;
private static _normalizeId;

@@ -19,0 +19,0 @@ private static _normalizeContextIds;

@@ -28,3 +28,3 @@ /**

},
enumerable: true,
enumerable: false,
configurable: true

@@ -31,0 +31,0 @@ });

@@ -0,1 +1,2 @@

import { IDiagnosticContextInfo } from './extraData/IDiagnosticContextInfo';
/**

@@ -36,4 +37,8 @@ * Diagnostics configuration

correlationId?: string;
/**
* Page context info
*/
contextInfo?: IDiagnosticContextInfo;
}
export default IDiagnosticsSettings;
//# sourceMappingURL=IDiagnosticsSettings.d.ts.map

@@ -21,2 +21,5 @@ /**

export { IDiagnosticsSettings as _IDiagnosticsSettings } from './IDiagnosticsSettings';
export { IDiagnosticContextInfo as _IDiagnosticContextInfo } from './extraData/IDiagnosticContextInfo';
export { PromotedState as _PromotedState } from './extraData/PromotedState';
export { PageType as _PageType } from './extraData/PageType';
export { default as _LogEvent } from './Api/Trace/LogEvent';

@@ -23,0 +26,0 @@ export { LogLevel as _LogLevel } from './Api/LogLevel';

@@ -13,2 +13,4 @@ /**

export { default as _Diagnostics } from './Diagnostics';
export { PromotedState as _PromotedState } from './extraData/PromotedState';
export { PageType as _PageType } from './extraData/PageType';
export { default as _LogEvent } from './Api/Trace/LogEvent';

@@ -22,3 +24,4 @@ export { LogLevel as _LogLevel } from './Api/LogLevel';

export { default as _QosLogger } from './Api/Qos/QosLogger';
export { QosResultType as _QosResultType } from './Api/Qos/QosResultType';
export { default as _ExecutionQueue } from './Api/ExecutionQueue';
//# sourceMappingURL=index.js.map
{
"name": "@microsoft/sp-diagnostics",
"version": "1.11.0",
"description": "Diagnostics tools for the SharePoint Framework",
"license": "SEE LICENSE IN \"EULA\" FOLDER",
"main": "lib/index.js",
"typings": "dist/index-internal.d.ts",
"devDependencies": {
"gulp": "~3.9.1",
"ts-jest": "~22.4.3",
"jest": "~22.4.3",
"tslib": "~1.10.0",
"@types/jest": "22.2.3",
"@types/webpack-env": "1.13.1",
"@ms/sp-build-compiler-3.3": "1.9.0-dev.4",
"@ms/sp-build-internal-web": "~0.29.32"
},
"dependencies": {
"@microsoft/sp-core-library": "1.11.0",
"@microsoft/sp-lodash-subset": "1.11.0"
},
"scripts": {
"build": "gulp test --clean"
},
"quickbuild": {
"additionalInputs": [
"../../common/reviews/api/sp-diagnostics.api.md"
]
}
"name": "@microsoft/sp-diagnostics",
"version": "1.12.0-plusbeta",
"description": "Diagnostics tools for the SharePoint Framework",
"license": "SEE LICENSE IN \"EULA\" FOLDER",
"main": "lib-commonjs/index.js",
"typings": "dist/index-internal.d.ts",
"devDependencies": {
"tslib": "~1.10.0",
"@ms/sp-build-compiler-3.7": "1.11.0-dev.27",
"@ms/spfx-internal-web-build-rig": "0.1.0",
"@rushstack/heft": "0.24.1"
},
"dependencies": {
"@microsoft/sp-core-library": "1.12.0-plusbeta",
"@microsoft/sp-lodash-subset": "1.12.0-plusbeta"
},
"scripts": {
"build": "heft test --clean",
"clean": "heft clean",
"deploy": "heft dev-deploy",
"start": "heft start --clean",
"test": "heft test --no-build"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc