Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openfeature/core

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfeature/core - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

30

dist/cjs/index.js

@@ -258,18 +258,18 @@ "use strict";

// src/provider/provider.ts
var ServerProviderStatus = /* @__PURE__ */ ((ServerProviderStatus3) => {
ServerProviderStatus3["NOT_READY"] = "NOT_READY";
ServerProviderStatus3["READY"] = "READY";
ServerProviderStatus3["ERROR"] = "ERROR";
ServerProviderStatus3["STALE"] = "STALE";
ServerProviderStatus3["FATAL"] = "FATAL";
return ServerProviderStatus3;
var ServerProviderStatus = /* @__PURE__ */ ((ServerProviderStatus2) => {
ServerProviderStatus2["NOT_READY"] = "NOT_READY";
ServerProviderStatus2["READY"] = "READY";
ServerProviderStatus2["ERROR"] = "ERROR";
ServerProviderStatus2["STALE"] = "STALE";
ServerProviderStatus2["FATAL"] = "FATAL";
return ServerProviderStatus2;
})(ServerProviderStatus || {});
var ClientProviderStatus = /* @__PURE__ */ ((ClientProviderStatus3) => {
ClientProviderStatus3["NOT_READY"] = "NOT_READY";
ClientProviderStatus3["READY"] = "READY";
ClientProviderStatus3["ERROR"] = "ERROR";
ClientProviderStatus3["STALE"] = "STALE";
ClientProviderStatus3["FATAL"] = "FATAL";
ClientProviderStatus3["RECONCILING"] = "RECONCILING";
return ClientProviderStatus3;
var ClientProviderStatus = /* @__PURE__ */ ((ClientProviderStatus2) => {
ClientProviderStatus2["NOT_READY"] = "NOT_READY";
ClientProviderStatus2["READY"] = "READY";
ClientProviderStatus2["ERROR"] = "ERROR";
ClientProviderStatus2["STALE"] = "STALE";
ClientProviderStatus2["FATAL"] = "FATAL";
ClientProviderStatus2["RECONCILING"] = "RECONCILING";
return ClientProviderStatus2;
})(ClientProviderStatus || {});

@@ -276,0 +276,0 @@

@@ -207,18 +207,18 @@ var __defProp = Object.defineProperty;

// src/provider/provider.ts
var ServerProviderStatus = /* @__PURE__ */ ((ServerProviderStatus3) => {
ServerProviderStatus3["NOT_READY"] = "NOT_READY";
ServerProviderStatus3["READY"] = "READY";
ServerProviderStatus3["ERROR"] = "ERROR";
ServerProviderStatus3["STALE"] = "STALE";
ServerProviderStatus3["FATAL"] = "FATAL";
return ServerProviderStatus3;
var ServerProviderStatus = /* @__PURE__ */ ((ServerProviderStatus2) => {
ServerProviderStatus2["NOT_READY"] = "NOT_READY";
ServerProviderStatus2["READY"] = "READY";
ServerProviderStatus2["ERROR"] = "ERROR";
ServerProviderStatus2["STALE"] = "STALE";
ServerProviderStatus2["FATAL"] = "FATAL";
return ServerProviderStatus2;
})(ServerProviderStatus || {});
var ClientProviderStatus = /* @__PURE__ */ ((ClientProviderStatus3) => {
ClientProviderStatus3["NOT_READY"] = "NOT_READY";
ClientProviderStatus3["READY"] = "READY";
ClientProviderStatus3["ERROR"] = "ERROR";
ClientProviderStatus3["STALE"] = "STALE";
ClientProviderStatus3["FATAL"] = "FATAL";
ClientProviderStatus3["RECONCILING"] = "RECONCILING";
return ClientProviderStatus3;
var ClientProviderStatus = /* @__PURE__ */ ((ClientProviderStatus2) => {
ClientProviderStatus2["NOT_READY"] = "NOT_READY";
ClientProviderStatus2["READY"] = "READY";
ClientProviderStatus2["ERROR"] = "ERROR";
ClientProviderStatus2["STALE"] = "STALE";
ClientProviderStatus2["FATAL"] = "FATAL";
ClientProviderStatus2["RECONCILING"] = "RECONCILING";
return ClientProviderStatus2;
})(ClientProviderStatus || {});

@@ -225,0 +225,0 @@

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

type FlagValueType = 'boolean' | 'string' | 'number' | 'object';
type Metadata = Record<string, string>;
/**
* Defines where the library is intended to be run.
*/
type Paradigm = 'server' | 'client';
type PrimitiveValue = null | boolean | string | number;

@@ -11,3 +17,35 @@ type JsonObject = {

type JsonValue = PrimitiveValue | JsonObject | JsonArray;
type EvaluationContextValue = PrimitiveValue | Date | {
[key: string]: EvaluationContextValue;
} | EvaluationContextValue[];
/**
* A container for arbitrary contextual data that can be used as a basis for dynamic evaluation
*/
type EvaluationContext = {
/**
* A string uniquely identifying the subject (end-user, or client service) of a flag evaluation.
* Providers may require this field for fractional flag evaluation, rules, or overrides targeting specific users.
* Such providers may behave unpredictably if a targeting key is not specified at flag resolution.
*/
targetingKey?: string;
} & Record<string, EvaluationContextValue>;
interface ManageContext<T> {
/**
* Access the evaluation context set on the receiver.
* @returns {EvaluationContext} Evaluation context
*/
getContext(): EvaluationContext;
/**
* Sets evaluation context that will be used during flag evaluations
* on this receiver.
* @template T The type of the receiver
* @param {EvaluationContext} context Evaluation context
* @returns {T} The receiver (this object)
*/
setContext(context: EvaluationContext): T;
}
type FlagValueType = 'boolean' | 'string' | 'number' | 'object';
/**
* Represents a JSON node value, or Date.

@@ -110,32 +148,2 @@ */

type EvaluationContextValue = PrimitiveValue | Date | {
[key: string]: EvaluationContextValue;
} | EvaluationContextValue[];
/**
* A container for arbitrary contextual data that can be used as a basis for dynamic evaluation
*/
type EvaluationContext = {
/**
* A string uniquely identifying the subject (end-user, or client service) of a flag evaluation.
* Providers may require this field for fractional flag evaluation, rules, or overrides targeting specific users.
* Such providers may behave unpredictably if a targeting key is not specified at flag resolution.
*/
targetingKey?: string;
} & Record<string, EvaluationContextValue>;
interface ManageContext<T> {
/**
* Access the evaluation context set on the receiver.
* @returns {EvaluationContext} Evaluation context
*/
getContext(): EvaluationContext;
/**
* Sets evaluation context that will be used during flag evaluations
* on this receiver.
* @template T The type of the receiver
* @param {EvaluationContext} context Evaluation context
* @returns {T} The receiver (this object)
*/
setContext(context: EvaluationContext): T;
}
interface Logger {

@@ -362,8 +370,14 @@ error(...args: unknown[]): void;

type Metadata = Record<string, string>;
type TrackingEventValue = PrimitiveValue | Date | {
[key: string]: TrackingEventValue;
} | TrackingEventValue[];
/**
* Defines where the library is intended to be run.
* A container for arbitrary data that can relevant to tracking events.
*/
type Paradigm = 'server' | 'client';
type TrackingEventDetails = {
/**
* A numeric value associated with this event.
*/
value?: number;
} & Record<string, TrackingEventValue>;

@@ -466,2 +480,9 @@ /**

initialize?(context?: EvaluationContext): Promise<void>;
/**
* Track a user action or application state, usually representing a business objective or outcome.
* @param trackingEventName
* @param context
* @param trackingEventDetails
*/
track?(trackingEventName: string, context?: EvaluationContext, trackingEventDetails?: TrackingEventDetails): void;
}

@@ -715,2 +736,2 @@

export { ClientProviderEvents as AllProviderEvents, ClientProviderStatus as AllProviderStatus, AnyProviderEvent, BaseHook, BeforeHookContext, ClientMetadata, ClientProviderEvents, ClientProviderStatus, 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, NotChangeEvents, OpenFeatureCommonAPI, OpenFeatureError, Paradigm, ParseError, PrimitiveValue, ProviderEventEmitter, ProviderFatalError, ProviderMetadata, ProviderNotReadyError, ProviderWrapper, ReadyEvent, ReconcilingEvent, ResolutionDetails, ResolutionReason, SafeLogger, ServerProviderEvents, ServerProviderStatus, StaleEvent, StandardResolutionReasons, TargetingKeyMissingError, TypeMismatchError, instantiateErrorByErrorCode, isObject, isString, objectOrUndefined, statusMatchesEvent, stringOrUndefined };
export { ClientProviderEvents as AllProviderEvents, ClientProviderStatus as AllProviderStatus, type AnyProviderEvent, type BaseHook, type BeforeHookContext, type ClientMetadata, ClientProviderEvents, ClientProviderStatus, type CommonEventDetails, type CommonProvider, type ConfigChangeEvent, DefaultLogger, ErrorCode, type ErrorEvent, type EvaluationContext, type EvaluationContextValue, type EvaluationDetails, type EvaluationLifeCycle, type EventContext, type EventDetails, type EventHandler, type EventMetadata, type Eventing, type FlagMetadata, FlagNotFoundError, type FlagValue, type FlagValueType, GeneralError, GenericEventEmitter, type HookContext, type HookHints, InvalidContextError, type JsonArray, type JsonObject, type JsonValue, LOG_LEVELS, type Logger, type ManageContext, type ManageLogger, type Metadata, type NotChangeEvents, OpenFeatureCommonAPI, OpenFeatureError, type Paradigm, ParseError, type PrimitiveValue, type ProviderEventEmitter, ProviderFatalError, type ProviderMetadata, ProviderNotReadyError, ProviderWrapper, type ReadyEvent, type ReconcilingEvent, type ResolutionDetails, type ResolutionReason, SafeLogger, ServerProviderEvents, ServerProviderStatus, type StaleEvent, StandardResolutionReasons, TargetingKeyMissingError, type TrackingEventDetails, type TrackingEventValue, TypeMismatchError, instantiateErrorByErrorCode, isObject, isString, objectOrUndefined, statusMatchesEvent, stringOrUndefined };
{
"name": "@openfeature/core",
"version": "1.4.0",
"version": "1.5.0",
"description": "Shared OpenFeature JS components (server and web)",

@@ -20,2 +20,3 @@ "main": "./dist/cjs/index.js",

"lint": "eslint ./",
"lint:fix": "eslint ./ --fix",
"clean": "shx rm -rf ./dist",

@@ -49,2 +50,2 @@ "type": "tsc --project ./tsconfig.json --declaration --emitDeclarationOnly",

]
}
}

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