@splitsoftware/openfeature-js-split-provider 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +25 -13
- package/LICENSE +1 -1
- package/README.md +74 -12
- package/es/index.js +1 -0
- package/es/lib/js-split-provider.js +152 -0
- package/lib/index.js +4 -0
- package/lib/lib/js-split-provider.js +156 -0
- package/package.json +37 -29
- package/src/__tests__/mocks/redis-commands.txt +11 -0
- package/src/__tests__/nodeSuites/client.spec.js +181 -139
- package/src/__tests__/nodeSuites/client_redis.spec.js +115 -0
- package/src/__tests__/nodeSuites/provider.spec.js +241 -109
- package/src/__tests__/testUtils/eventSourceMock.js +1 -2
- package/src/__tests__/testUtils/index.js +43 -0
- package/src/lib/js-split-provider.ts +126 -58
- package/types/index.d.ts +1 -0
- package/types/lib/js-split-provider.d.ts +26 -0
- package/src/__tests__/node.spec.js +0 -7
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EvaluationContext, JsonValue, OpenFeatureEventEmitter, Provider, ResolutionDetails, TrackingEventDetails } from '@openfeature/server-sdk';
|
|
2
|
+
import type SplitIO from '@splitsoftware/splitio/types/splitio';
|
|
3
|
+
type SplitProviderOptions = {
|
|
4
|
+
splitClient: SplitIO.IClient | SplitIO.IAsyncClient;
|
|
5
|
+
};
|
|
6
|
+
export declare class OpenFeatureSplitProvider implements Provider {
|
|
7
|
+
metadata: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
private initialized;
|
|
11
|
+
private client;
|
|
12
|
+
readonly events: OpenFeatureEventEmitter;
|
|
13
|
+
private getSplitClient;
|
|
14
|
+
constructor(options: SplitProviderOptions | string | SplitIO.ISDK | SplitIO.IAsyncSDK);
|
|
15
|
+
resolveBooleanEvaluation(flagKey: string, _: boolean, context: EvaluationContext): Promise<ResolutionDetails<boolean>>;
|
|
16
|
+
resolveStringEvaluation(flagKey: string, _: string, context: EvaluationContext): Promise<ResolutionDetails<string>>;
|
|
17
|
+
resolveNumberEvaluation(flagKey: string, _: number, context: EvaluationContext): Promise<ResolutionDetails<number>>;
|
|
18
|
+
resolveObjectEvaluation<U extends JsonValue>(flagKey: string, _: U, context: EvaluationContext): Promise<ResolutionDetails<U>>;
|
|
19
|
+
private evaluateTreatment;
|
|
20
|
+
track(trackingEventName: string, context: EvaluationContext, details: TrackingEventDetails): Promise<void>;
|
|
21
|
+
onClose?(): Promise<void>;
|
|
22
|
+
private transformContext;
|
|
23
|
+
private parseValidNumber;
|
|
24
|
+
private parseValidJsonObject;
|
|
25
|
+
}
|
|
26
|
+
export {};
|