@mozilla/glean
Advanced tools
Comparing version 0.10.0 to 0.10.1
export const GLEAN_SCHEMA_VERSION = 1; | ||
export const GLEAN_VERSION = "0.10.0"; | ||
export const GLEAN_VERSION = "0.10.1"; | ||
export const PING_INFO_STORAGE = "glean_ping_info"; | ||
@@ -4,0 +4,0 @@ export const CLIENT_INFO_STORAGE = "glean_client_info"; |
@@ -0,3 +1,5 @@ | ||
import Dispatcher from "./dispatcher"; | ||
export class Context { | ||
constructor() { | ||
this._initialized = false; | ||
} | ||
@@ -10,3 +12,13 @@ static get instance() { | ||
} | ||
static async testUninitialize() { | ||
if (Context.instance._dispatcher) { | ||
await Context.instance._dispatcher.testUninitialize(); | ||
} | ||
Context.instance._dispatcher = null; | ||
Context.initialized = false; | ||
} | ||
static get dispatcher() { | ||
if (!Context.instance._dispatcher) { | ||
Context.instance._dispatcher = new Dispatcher(); | ||
} | ||
return Context.instance._dispatcher; | ||
@@ -13,0 +25,0 @@ } |
@@ -12,3 +12,2 @@ import { CLIENT_INFO_STORAGE, KNOWN_CLIENT_ID } from "./constants.js"; | ||
import { DatetimeMetric } from "./metrics/types/datetime_metric.js"; | ||
import Dispatcher from "./dispatcher.js"; | ||
import CorePings from "./internal_pings.js"; | ||
@@ -24,6 +23,4 @@ import { registerPluginToEvent, testResetEvents } from "./events/utils.js"; | ||
} | ||
Context.dispatcher = new Dispatcher(); | ||
this._coreMetrics = new CoreMetrics(); | ||
this._corePings = new CorePings(); | ||
Context.initialized = false; | ||
} | ||
@@ -211,7 +208,4 @@ static get instance() { | ||
static async testUninitialize() { | ||
Context.initialized = false; | ||
await Context.testUninitialize(); | ||
testResetEvents(); | ||
if (Context.dispatcher) { | ||
await Context.dispatcher.testUninitialize(); | ||
} | ||
if (Glean.pingUploader) { | ||
@@ -218,0 +212,0 @@ await Glean.pingUploader.clearPendingPingsQueue(); |
export declare const GLEAN_SCHEMA_VERSION = 1; | ||
export declare const GLEAN_VERSION = "0.10.0"; | ||
export declare const GLEAN_VERSION = "0.10.1"; | ||
export declare const PING_INFO_STORAGE = "glean_ping_info"; | ||
@@ -4,0 +4,0 @@ export declare const CLIENT_INFO_STORAGE = "glean_client_info"; |
import type { DebugOptions } from "./debug_options"; | ||
import type Dispatcher from "./dispatcher"; | ||
import Dispatcher from "./dispatcher"; | ||
import type MetricsDatabase from "./metrics/database"; | ||
@@ -30,2 +30,8 @@ import type EventsDatabase from "./metrics/events_database"; | ||
static get instance(): Context; | ||
/** | ||
* **Test-only API** | ||
* | ||
* Resets the Context to an uninitialized state. | ||
*/ | ||
static testUninitialize(): Promise<void>; | ||
static get dispatcher(): Dispatcher; | ||
@@ -32,0 +38,0 @@ static set dispatcher(dispatcher: Dispatcher); |
{ | ||
"name": "@mozilla/glean", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "An implementation of the Glean SDK, a modern cross-platform telemetry client, for Javascript environments.", | ||
@@ -89,3 +89,3 @@ "type": "module", | ||
"sinon": "^10.0.0", | ||
"ts-loader": "^8.0.17", | ||
"ts-loader": "^9.0.1", | ||
"ts-node": "^9.1.1", | ||
@@ -92,0 +92,0 @@ "typescript": "^4.1.5", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175764
4776