@stacksjs/feature-flags 0.75.519 → 0.75.522
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/dist/drivers/database.d.ts +3 -0
- package/dist/drivers/memory.d.ts +3 -0
- package/dist/index.d.ts +0 -3
- package/dist/manager.d.ts +13 -0
- package/package.json +4 -4
|
@@ -2,10 +2,13 @@ import type { DatabaseFeatureFlagDriverOptions, FeatureDatabaseClient, FeatureDr
|
|
|
2
2
|
export declare function createDatabaseFeatureFlagDriver(database: FeatureDatabaseClient, options?: DatabaseFeatureFlagDriverOptions): DatabaseFeatureFlagDriver;
|
|
3
3
|
export declare class DatabaseFeatureFlagDriver implements FeatureDriver {
|
|
4
4
|
readonly table: string;
|
|
5
|
+
private ready;
|
|
6
|
+
private database;
|
|
5
7
|
constructor(database: FeatureDatabaseClient, options?: DatabaseFeatureFlagDriverOptions);
|
|
6
8
|
get(name: string, scopeKey: string): Promise<FeatureValue | undefined>;
|
|
7
9
|
set(name: string, scopeKey: string, value: FeatureValue): Promise<void>;
|
|
8
10
|
add(name: string, scopeKey: string, value: FeatureValue): Promise<FeatureValue>;
|
|
11
|
+
private update;
|
|
9
12
|
delete(name: string, scopeKey: string): Promise<void>;
|
|
10
13
|
deleteForAllScopes(names?: readonly string[]): Promise<void>;
|
|
11
14
|
clear(): Promise<void>;
|
package/dist/drivers/memory.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export declare interface MemoryFeatureFlagDriverOptions {
|
|
|
4
4
|
cloneValues?: boolean
|
|
5
5
|
}
|
|
6
6
|
export declare class MemoryFeatureFlagDriver implements FeatureDriver {
|
|
7
|
+
private values;
|
|
8
|
+
private cloneValues;
|
|
7
9
|
constructor(options?: MemoryFeatureFlagDriverOptions);
|
|
10
|
+
private clone;
|
|
8
11
|
get(name: string, scopeKey: string): Promise<FeatureValue | undefined>;
|
|
9
12
|
set(name: string, scopeKey: string, value: FeatureValue): Promise<void>;
|
|
10
13
|
add(name: string, scopeKey: string, value: FeatureValue): Promise<FeatureValue>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { FeatureFlagManager } from './manager';
|
|
2
|
-
import type { FeatureDriver } from './types';
|
|
3
|
-
import type { FeatureFlagsConfig } from '@stacksjs/types';
|
|
4
|
-
declare function configuredDriver(config: FeatureFlagsConfig, dialect: string | undefined): Promise<FeatureDriver>;
|
|
5
2
|
/**
|
|
6
3
|
* Global, configuration-aware feature facade.
|
|
7
4
|
*
|
package/dist/manager.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { FeatureDefinition, FeatureDriver, FeatureDriverFactory, FeatureEva
|
|
|
2
2
|
export declare function createFeatureFlags(options?: FeatureFlagManagerOptions): FeatureFlagManager;
|
|
3
3
|
declare type EvaluationListener = (evaluation: FeatureEvaluation) => void | Promise<void>;
|
|
4
4
|
export declare class ScopedFeatureFlags<Scope = FeatureScope> {
|
|
5
|
+
private manager;
|
|
5
6
|
readonly scope: Scope;
|
|
6
7
|
constructor(manager: FeatureFlagManager, scope: Scope);
|
|
7
8
|
value(name: string): Promise<FeatureValue>;
|
|
@@ -16,6 +17,13 @@ export declare class ScopedFeatureFlags<Scope = FeatureScope> {
|
|
|
16
17
|
unless<Inactive, Active = undefined>(name: string, onInactive: (value: FeatureValue) => Inactive | Promise<Inactive>, onActive?: (value: FeatureValue) => Active | Promise<Active>): Promise<Inactive | Active | undefined>;
|
|
17
18
|
}
|
|
18
19
|
export declare class FeatureFlagManager {
|
|
20
|
+
private definitions;
|
|
21
|
+
private pending;
|
|
22
|
+
private listeners;
|
|
23
|
+
private resolveScope;
|
|
24
|
+
private driverSource;
|
|
25
|
+
private driverPromise;
|
|
26
|
+
private missingBehavior;
|
|
19
27
|
constructor(options?: FeatureFlagManagerOptions);
|
|
20
28
|
use(driver: FeatureDriver | FeatureDriverFactory): this;
|
|
21
29
|
missing(behavior: 'false' | 'throw'): this;
|
|
@@ -27,6 +35,7 @@ export declare class FeatureFlagManager {
|
|
|
27
35
|
clearDefinitions(): this;
|
|
28
36
|
for<Scope>(scope: Scope): ScopedFeatureFlags<Scope>;
|
|
29
37
|
value(name: string, scope?: FeatureScope): Promise<FeatureValue>;
|
|
38
|
+
private evaluate;
|
|
30
39
|
values(names: readonly string[], scope?: FeatureScope): Promise<Record<string, FeatureValue>>;
|
|
31
40
|
all(scope?: FeatureScope): Promise<Record<string, FeatureValue>>;
|
|
32
41
|
active(name: string, scope?: FeatureScope): Promise<boolean>;
|
|
@@ -39,4 +48,8 @@ export declare class FeatureFlagManager {
|
|
|
39
48
|
when<Active, Inactive = undefined>(name: string, onActive: (value: FeatureValue) => Active | Promise<Active>, onInactive?: (value: FeatureValue) => Inactive | Promise<Inactive>, scope?: FeatureScope): Promise<Active | Inactive | undefined>;
|
|
40
49
|
unless<Inactive, Active = undefined>(name: string, onInactive: (value: FeatureValue) => Inactive | Promise<Inactive>, onActive?: (value: FeatureValue) => Active | Promise<Active>, scope?: FeatureScope): Promise<Inactive | Active | undefined>;
|
|
41
50
|
onEvaluated(listener: EvaluationListener): () => void;
|
|
51
|
+
private notify;
|
|
52
|
+
private awaitPending;
|
|
53
|
+
private driver;
|
|
42
54
|
}
|
|
55
|
+
export {};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/feature-flags",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.522",
|
|
6
6
|
"description": "Typed, scoped feature flags for Stacks applications.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"prepublishOnly": "bun run build"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@stacksjs/config": "0.75.
|
|
62
|
-
"@stacksjs/database": "0.75.
|
|
61
|
+
"@stacksjs/config": "0.75.522",
|
|
62
|
+
"@stacksjs/database": "0.75.522"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@stacksjs/query-builder": "0.75.
|
|
65
|
+
"@stacksjs/query-builder": "0.75.522",
|
|
66
66
|
"better-dx": "^0.2.24"
|
|
67
67
|
}
|
|
68
68
|
}
|