@locker/instrumentation
Advanced tools
Comparing version 0.14.2 to 0.14.3
@@ -1,2 +0,2 @@ | ||
/** | ||
/*! | ||
* Copyright (C) 2021 salesforce.com, inc. | ||
@@ -8,2 +8,4 @@ */ | ||
var shared = require('@locker/shared'); | ||
/*! ***************************************************************************** | ||
@@ -38,2 +40,8 @@ Copyright (c) Microsoft Corporation. | ||
var _startCallback, _stopCallback; | ||
let ticketSequence = 0; | ||
function getTicket() { | ||
const ticket = Date.now() + 1e-9 * ticketSequence; | ||
ticketSequence = (ticketSequence + 1) % 1000000000; | ||
return `${ticket}`; | ||
} | ||
// Locker Activity class | ||
@@ -52,2 +60,3 @@ class Activity { | ||
__classPrivateFieldSet(this, _stopCallback, stopCallback); | ||
this.activityId = `${shared.toString(sandboxKey)}-${getTicket()}`; | ||
this.nameOrDescription = nameOrDescription; | ||
@@ -61,3 +70,3 @@ this.sandboxKey = sandboxKey; | ||
if (typeof __classPrivateFieldGet(this, _startCallback) === 'function') { | ||
__classPrivateFieldGet(this, _startCallback).call(this, this.sandboxKey, this.nameOrDescription); | ||
__classPrivateFieldGet(this, _startCallback).call(this, this.activityId, this.sandboxKey, this.nameOrDescription); | ||
} | ||
@@ -71,3 +80,3 @@ return this; | ||
if (typeof __classPrivateFieldGet(this, _stopCallback) === 'function') { | ||
__classPrivateFieldGet(this, _stopCallback).call(this, this.sandboxKey, this.nameOrDescription); | ||
__classPrivateFieldGet(this, _stopCallback).call(this, this.activityId); | ||
} | ||
@@ -92,2 +101,2 @@ return this; | ||
exports.defaultInstrumentation = defaultInstrumentation; | ||
/** version: 0.14.2 */ | ||
/*! version: 0.14.3 */ |
@@ -1,4 +0,6 @@ | ||
/** | ||
/*! | ||
* Copyright (C) 2021 salesforce.com, inc. | ||
*/ | ||
import { toString } from '@locker/shared'; | ||
/*! ***************************************************************************** | ||
@@ -33,2 +35,8 @@ Copyright (c) Microsoft Corporation. | ||
var _startCallback, _stopCallback; | ||
let ticketSequence = 0; | ||
function getTicket() { | ||
const ticket = Date.now() + 1e-9 * ticketSequence; | ||
ticketSequence = (ticketSequence + 1) % 1000000000; | ||
return `${ticket}`; | ||
} | ||
// Locker Activity class | ||
@@ -47,2 +55,3 @@ class Activity { | ||
__classPrivateFieldSet(this, _stopCallback, stopCallback); | ||
this.activityId = `${toString(sandboxKey)}-${getTicket()}`; | ||
this.nameOrDescription = nameOrDescription; | ||
@@ -56,3 +65,3 @@ this.sandboxKey = sandboxKey; | ||
if (typeof __classPrivateFieldGet(this, _startCallback) === 'function') { | ||
__classPrivateFieldGet(this, _startCallback).call(this, this.sandboxKey, this.nameOrDescription); | ||
__classPrivateFieldGet(this, _startCallback).call(this, this.activityId, this.sandboxKey, this.nameOrDescription); | ||
} | ||
@@ -66,3 +75,3 @@ return this; | ||
if (typeof __classPrivateFieldGet(this, _stopCallback) === 'function') { | ||
__classPrivateFieldGet(this, _stopCallback).call(this, this.sandboxKey, this.nameOrDescription); | ||
__classPrivateFieldGet(this, _stopCallback).call(this, this.activityId); | ||
} | ||
@@ -85,2 +94,2 @@ return this; | ||
export { Activity, Instrumentation, defaultInstrumentation }; | ||
/** version: 0.14.2 */ | ||
/*! version: 0.14.3 */ |
{ | ||
"name": "@locker/instrumentation", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"license": "Salesforce Developer Agreement", | ||
@@ -18,3 +18,3 @@ "author": "Salesforce UI Security Team", | ||
"dependencies": { | ||
"@locker/shared": "0.14.2" | ||
"@locker/shared": "0.14.3" | ||
}, | ||
@@ -25,3 +25,3 @@ "files": [ | ||
], | ||
"gitHead": "b283257c4ad4fa4169dfd474b4c112096323ae46" | ||
"gitHead": "d7dd7f95caa14be3c519d654b4ba645b07f14f0f" | ||
} |
import { LockerActivity, LockerInstrumentation } from './types'; | ||
export declare class Activity implements LockerActivity { | ||
#private; | ||
activityId: string; | ||
nameOrDescription: string; | ||
@@ -5,0 +6,0 @@ sandboxKey: string; |
Sorry, the diff of this file is not supported yet
16044
199
+ Added@locker/shared@0.14.3(transitive)
- Removed@locker/shared@0.14.2(transitive)
Updated@locker/shared@0.14.3