msal
Version:
Microsoft Authentication Library for js
37 lines • 2.4 kB
JavaScript
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var TelemetryConstants_1 = require("./TelemetryConstants");
var TelemetryEvent_1 = tslib_1.__importDefault(require("./TelemetryEvent"));
var TelemetryUtils_1 = require("./TelemetryUtils");
var DefaultEvent = /** @class */ (function (_super) {
tslib_1.__extends(DefaultEvent, _super);
// TODO Platform Type
function DefaultEvent(platform, correlationId, clientId, eventCount) {
var _this = _super.call(this, TelemetryUtils_1.prependEventNamePrefix("default_event"), correlationId, "DefaultEvent") || this;
_this.event[TelemetryUtils_1.prependEventNamePrefix("client_id")] = clientId;
_this.event[TelemetryUtils_1.prependEventNamePrefix("sdk_plaform")] = platform.sdk;
_this.event[TelemetryUtils_1.prependEventNamePrefix("sdk_version")] = platform.sdkVersion;
_this.event[TelemetryUtils_1.prependEventNamePrefix("application_name")] = platform.applicationName;
_this.event[TelemetryUtils_1.prependEventNamePrefix("application_version")] = platform.applicationVersion;
_this.event[TelemetryUtils_1.prependEventNamePrefix("effective_connection_speed")] = platform.networkInformation && platform.networkInformation.connectionSpeed;
_this.event["" + TelemetryConstants_1.TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey] = _this.getEventCount(TelemetryUtils_1.prependEventNamePrefix("ui_event"), eventCount);
_this.event["" + TelemetryConstants_1.TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey] = _this.getEventCount(TelemetryUtils_1.prependEventNamePrefix("http_event"), eventCount);
_this.event["" + TelemetryConstants_1.TELEMETRY_BLOB_EVENT_NAMES.CacheEventCountConstStrKey] = _this.getEventCount(TelemetryUtils_1.prependEventNamePrefix("cache_event"), eventCount);
return _this;
// / Device id?
}
DefaultEvent.prototype.getEventCount = function (eventName, eventCount) {
if (!eventCount[eventName]) {
return 0;
}
return eventCount[eventName];
};
return DefaultEvent;
}(TelemetryEvent_1.default));
exports.default = DefaultEvent;
//# sourceMappingURL=DefaultEvent.js.map
;