@openfeature/core
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -71,2 +71,3 @@ "use strict"; | ||
ProviderEvents: () => ProviderEvents, | ||
ProviderNotReadyError: () => ProviderNotReadyError, | ||
ProviderStatus: () => ProviderStatus, | ||
@@ -202,2 +203,12 @@ SafeLogger: () => SafeLogger, | ||
// src/errors/provider-not-ready-error.ts | ||
var ProviderNotReadyError = class extends OpenFeatureError { | ||
constructor(message) { | ||
super(message); | ||
Object.setPrototypeOf(this, ProviderNotReadyError.prototype); | ||
this.name = "ProviderNotReadyError"; | ||
this.code = "PROVIDER_NOT_READY" /* PROVIDER_NOT_READY */; | ||
} | ||
}; | ||
// src/provider/provider.ts | ||
@@ -204,0 +215,0 @@ var ProviderStatus = /* @__PURE__ */ ((ProviderStatus2) => { |
@@ -158,2 +158,12 @@ var __defProp = Object.defineProperty; | ||
// src/errors/provider-not-ready-error.ts | ||
var ProviderNotReadyError = class extends OpenFeatureError { | ||
constructor(message) { | ||
super(message); | ||
Object.setPrototypeOf(this, ProviderNotReadyError.prototype); | ||
this.name = "ProviderNotReadyError"; | ||
this.code = "PROVIDER_NOT_READY" /* PROVIDER_NOT_READY */; | ||
} | ||
}; | ||
// src/provider/provider.ts | ||
@@ -558,2 +568,3 @@ var ProviderStatus = /* @__PURE__ */ ((ProviderStatus2) => { | ||
ProviderEvents, | ||
ProviderNotReadyError, | ||
ProviderStatus, | ||
@@ -560,0 +571,0 @@ SafeLogger, |
@@ -251,3 +251,3 @@ type FlagValueType = 'boolean' | 'string' | 'number' | 'object'; | ||
private readonly globalLogger?; | ||
protected abstract readonly eventEmitter: NodeJS.EventEmitter; | ||
protected abstract readonly eventEmitter: PlatformEventEmitter; | ||
private readonly _handlers; | ||
@@ -264,2 +264,25 @@ private _eventLogger?; | ||
} | ||
/** | ||
* This is an un-exported type that corresponds to NodeJS.EventEmitter. | ||
* We can't use that type here, because this module is used in both the browser, and the server. | ||
* In the server, node (or whatever server runtime) provides an implementation for this. | ||
* In the browser, we bundle in the popular 'events' package, which is a polyfill of NodeJS.EventEmitter. | ||
*/ | ||
interface PlatformEventEmitter { | ||
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
on(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
once(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
off(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
removeAllListeners(event?: string | symbol): this; | ||
setMaxListeners(n: number): this; | ||
getMaxListeners(): number; | ||
listeners(eventName: string | symbol): Function[]; | ||
rawListeners(eventName: string | symbol): Function[]; | ||
emit(eventName: string | symbol, ...args: any[]): boolean; | ||
listenerCount(eventName: string | symbol, listener?: Function): number; | ||
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
eventNames(): Array<string | symbol>; | ||
} | ||
@@ -449,2 +472,7 @@ interface Metadata { | ||
declare class ProviderNotReadyError extends OpenFeatureError { | ||
code: ErrorCode; | ||
constructor(message?: string); | ||
} | ||
/** | ||
@@ -566,2 +594,2 @@ * Checks whether the parameter is a string. | ||
export { BaseHook, BeforeHookContext, ClientMetadata, CommonEventDetails, CommonProvider, ConfigChangeEvent, DefaultLogger, ErrorCode, ErrorEvent, EvaluationContext, EvaluationContextValue, EvaluationDetails, EvaluationLifeCycle, EventContext, EventDetails, EventHandler, EventMetadata, Eventing, FlagMetadata, FlagNotFoundError, FlagValue, FlagValueType, GeneralError, GenericEventEmitter, HookContext, HookHints, InvalidContextError, JsonArray, JsonObject, JsonValue, LOG_LEVELS, Logger, ManageContext, ManageLogger, Metadata, OpenFeatureCommonAPI, OpenFeatureError, Paradigm, ParseError, PrimitiveValue, ProviderEvents, ProviderMetadata, ProviderStatus, ReadyEvent, ResolutionDetails, ResolutionReason, SafeLogger, StaleEvent, StandardResolutionReasons, TargetingKeyMissingError, TypeMismatchError, isObject, isString, objectOrUndefined, statusMatchesEvent, stringOrUndefined }; | ||
export { BaseHook, BeforeHookContext, ClientMetadata, CommonEventDetails, CommonProvider, ConfigChangeEvent, DefaultLogger, ErrorCode, ErrorEvent, EvaluationContext, EvaluationContextValue, EvaluationDetails, EvaluationLifeCycle, EventContext, EventDetails, EventHandler, EventMetadata, Eventing, FlagMetadata, FlagNotFoundError, FlagValue, FlagValueType, GeneralError, GenericEventEmitter, HookContext, HookHints, InvalidContextError, JsonArray, JsonObject, JsonValue, LOG_LEVELS, Logger, ManageContext, ManageLogger, Metadata, OpenFeatureCommonAPI, OpenFeatureError, Paradigm, ParseError, PrimitiveValue, ProviderEvents, ProviderMetadata, ProviderNotReadyError, ProviderStatus, ReadyEvent, ResolutionDetails, ResolutionReason, SafeLogger, StaleEvent, StandardResolutionReasons, TargetingKeyMissingError, TypeMismatchError, isObject, isString, objectOrUndefined, statusMatchesEvent, stringOrUndefined }; |
{ | ||
"name": "@openfeature/core", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "Shared OpenFeature JS components (server and web)", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
163109
1709