@plyaz/core 1.2.1 → 1.3.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/README.md +248 -183
- package/dist/domain/example/FrontendExampleDomainService.d.ts.map +1 -1
- package/dist/domain/featureFlags/providers/database.d.ts +6 -1
- package/dist/domain/featureFlags/providers/database.d.ts.map +1 -1
- package/dist/entry-backend.d.ts +3 -1
- package/dist/entry-backend.d.ts.map +1 -1
- package/dist/entry-backend.js +3145 -3325
- package/dist/entry-backend.js.map +1 -1
- package/dist/entry-backend.mjs +2732 -2899
- package/dist/entry-backend.mjs.map +1 -1
- package/dist/entry-frontend.js +1594 -1406
- package/dist/entry-frontend.js.map +1 -1
- package/dist/entry-frontend.mjs +1568 -1379
- package/dist/entry-frontend.mjs.map +1 -1
- package/dist/index.js +3130 -3318
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3133 -3308
- package/dist/index.mjs.map +1 -1
- package/dist/init/CoreInitializer.d.ts +9 -8
- package/dist/init/CoreInitializer.d.ts.map +1 -1
- package/dist/init/ServiceRegistry.d.ts.map +1 -1
- package/dist/init/nestjs/index.js +1511 -1336
- package/dist/init/nestjs/index.js.map +1 -1
- package/dist/init/nestjs/index.mjs +1527 -1352
- package/dist/init/nestjs/index.mjs.map +1 -1
- package/dist/models/example/ExampleRepository.d.ts +45 -3
- package/dist/models/example/ExampleRepository.d.ts.map +1 -1
- package/dist/models/featureFlags/FeatureFlagRepository.d.ts +72 -471
- package/dist/models/featureFlags/FeatureFlagRepository.d.ts.map +1 -1
- package/dist/services/DbService.d.ts +2 -0
- package/dist/services/DbService.d.ts.map +1 -1
- package/dist/services/NotificationService.d.ts +2 -0
- package/dist/services/NotificationService.d.ts.map +1 -1
- package/dist/services/StorageService.d.ts +2 -0
- package/dist/services/StorageService.d.ts.map +1 -1
- package/dist/utils/common/id.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -2,90 +2,57 @@
|
|
|
2
2
|
* Database Repository Implementation
|
|
3
3
|
*
|
|
4
4
|
* Database adapter integration with @plyaz/db for feature flag storage.
|
|
5
|
-
*
|
|
5
|
+
* Extends BaseRepository for consistent CRUD operations and QueryBuilder support.
|
|
6
6
|
*
|
|
7
7
|
* @fileoverview Database repository for feature flags
|
|
8
8
|
*/
|
|
9
|
+
import { BaseRepository } from '@plyaz/db';
|
|
9
10
|
import { type FeatureFlag, type FeatureFlagRule, type FeatureFlagValue, type CreateFlagRequest, type FeatureFlagContext } from '@plyaz/types';
|
|
10
11
|
import type { FeatureFlagKey } from '@domain/types';
|
|
11
|
-
import { type CoreFeatureFlagTableConfig } from '@plyaz/types/core';
|
|
12
|
+
import { type CoreDatabaseFeatureFlagRow, type CoreFeatureFlagTableConfig } from '@plyaz/types/core';
|
|
13
|
+
import type { DatabaseServiceInterface } from '@plyaz/types/db';
|
|
14
|
+
/**
|
|
15
|
+
* Extended row type with index signature for BaseRepository compatibility
|
|
16
|
+
*/
|
|
17
|
+
type FeatureFlagRow = CoreDatabaseFeatureFlagRow & Record<string, unknown>;
|
|
12
18
|
/**
|
|
13
19
|
* Database Repository for Feature Flags
|
|
14
20
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* **EXECUTION ORDER:**
|
|
18
|
-
* 1. FeatureFlagService.onModuleInit()
|
|
19
|
-
* 2. → FeatureFlagConfigFactory.fromOptions()
|
|
20
|
-
* 3. → DbService.initialize()
|
|
21
|
-
* 4. → **THIS REPOSITORY USED** ← YOU ARE HERE
|
|
22
|
-
* 5. → Database queries executed via @plyaz/db
|
|
23
|
-
*
|
|
24
|
-
* **PURPOSE:**
|
|
25
|
-
* - Executes optimized SQL queries using Drizzle ORM
|
|
26
|
-
* - Maps database rows to TypeScript types
|
|
27
|
-
* - Handles CRUD operations for flags, rules, evaluations, and overrides
|
|
28
|
-
* - Provides audit logging and user override functionality
|
|
29
|
-
*
|
|
30
|
-
* **PERFORMANCE FEATURES:**
|
|
31
|
-
* - Uses database indexes for fast queries
|
|
32
|
-
* - Batch operations where possible
|
|
33
|
-
* - Connection pooling via DatabaseConnectionManager
|
|
34
|
-
* - Optimized queries with proper WHERE clauses and ordering
|
|
21
|
+
* Extends BaseRepository for consistent CRUD operations and QueryBuilder support.
|
|
22
|
+
* Manages feature flags, rules, evaluations, and overrides across multiple tables.
|
|
35
23
|
*
|
|
36
24
|
* @template TKey - Feature flag key type (extends string)
|
|
37
25
|
*
|
|
38
|
-
* @example
|
|
26
|
+
* @example
|
|
39
27
|
* ```typescript
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* // Get all flags (called during system initialization)
|
|
43
|
-
* const flags = await repository.getAllFlags();
|
|
44
|
-
*
|
|
45
|
-
* // Get specific flag (called during runtime evaluation)
|
|
46
|
-
* const flag = await repository.getFlag('PREMIUM_FEATURE');
|
|
28
|
+
* // Create repository
|
|
29
|
+
* const repository = FeatureFlagDatabaseRepository.create();
|
|
47
30
|
*
|
|
48
|
-
* //
|
|
49
|
-
* const
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* description: 'New awesome feature'
|
|
54
|
-
* });
|
|
55
|
-
* ```
|
|
31
|
+
* // Use QueryBuilder for complex queries
|
|
32
|
+
* const enabledFlags = await repository.query()
|
|
33
|
+
* .where('is_enabled', 'eq', true)
|
|
34
|
+
* .orderByAsc('key')
|
|
35
|
+
* .getMany();
|
|
56
36
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* -- Optimized queries with indexes:
|
|
60
|
-
* SELECT * FROM feature_flags WHERE key = 'PREMIUM_FEATURE'; -- Uses primary key index
|
|
61
|
-
* SELECT * FROM feature_flag_rules WHERE flag_key = 'PREMIUM_FEATURE' AND is_enabled = true ORDER BY priority DESC; -- Uses composite index
|
|
37
|
+
* // Get all flags with environment filter
|
|
38
|
+
* const prodFlags = await repository.getAllFlags('production');
|
|
62
39
|
* ```
|
|
63
40
|
*/
|
|
64
|
-
export declare class FeatureFlagDatabaseRepository<TKey extends string = FeatureFlagKey> {
|
|
41
|
+
export declare class FeatureFlagDatabaseRepository<TKey extends string = FeatureFlagKey> extends BaseRepository<FeatureFlagRow> {
|
|
65
42
|
private readonly tableConfig;
|
|
43
|
+
private readonly logger;
|
|
66
44
|
/**
|
|
67
45
|
* Creates a new repository with optional custom table names.
|
|
68
46
|
*
|
|
47
|
+
* @param db - Database service interface
|
|
69
48
|
* @param tableConfig - Optional custom table configuration
|
|
70
|
-
*
|
|
71
|
-
* @example Default tables
|
|
72
|
-
* ```typescript
|
|
73
|
-
* const repo = new FeatureFlagDatabaseRepository();
|
|
74
|
-
* // Uses: feature_flags, feature_flag_rules, feature_flag_evaluations, feature_flag_overrides
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @example Custom test tables
|
|
78
|
-
* ```typescript
|
|
79
|
-
* const repo = new FeatureFlagDatabaseRepository({
|
|
80
|
-
* flagsTable: 'test_feature_flags',
|
|
81
|
-
* rulesTable: 'test_feature_flag_rules',
|
|
82
|
-
* evaluationsTable: 'test_feature_flag_evaluations',
|
|
83
|
-
* overridesTable: 'test_feature_flag_overrides',
|
|
84
|
-
* evaluationsSchema: 'audit',
|
|
85
|
-
* });
|
|
86
|
-
* ```
|
|
87
49
|
*/
|
|
88
|
-
constructor(tableConfig?: Partial<CoreFeatureFlagTableConfig>);
|
|
50
|
+
constructor(db: DatabaseServiceInterface, tableConfig?: Partial<CoreFeatureFlagTableConfig>);
|
|
51
|
+
/**
|
|
52
|
+
* Factory method to create repository instance.
|
|
53
|
+
* Uses DbService singleton if initialized.
|
|
54
|
+
*/
|
|
55
|
+
static create<TKey extends string = FeatureFlagKey>(tableConfig?: Partial<CoreFeatureFlagTableConfig>): FeatureFlagDatabaseRepository<TKey>;
|
|
89
56
|
/**
|
|
90
57
|
* Gets the current table configuration.
|
|
91
58
|
*/
|
|
@@ -95,284 +62,69 @@ export declare class FeatureFlagDatabaseRepository<TKey extends string = Feature
|
|
|
95
62
|
*/
|
|
96
63
|
private getEvaluationsTableName;
|
|
97
64
|
/**
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
private getDb;
|
|
101
|
-
/**
|
|
102
|
-
* Retrieves all feature flags from the database with optional environment filtering
|
|
103
|
-
*
|
|
104
|
-
* @description Fetches all feature flags from the database. This method is primarily called
|
|
105
|
-
* during system initialization to load flags into cache, but can also be used for
|
|
106
|
-
* administrative purposes or cache refresh operations.
|
|
107
|
-
*
|
|
108
|
-
* @param {string} [environment] - Optional environment filter (e.g., 'production', 'staging')
|
|
109
|
-
* @returns {Promise<FeatureFlag<TKey>[]>} Array of feature flags matching the criteria
|
|
110
|
-
*
|
|
111
|
-
* @throws {Error} When database query fails critically
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
* ```typescript
|
|
115
|
-
* // Get all flags for system initialization
|
|
116
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
117
|
-
* const allFlags = await repository.getAllFlags();
|
|
118
|
-
* console.log(`Loaded ${allFlags.length} feature flags`);
|
|
119
|
-
*
|
|
120
|
-
* // Get only production flags
|
|
121
|
-
* const prodFlags = await repository.getAllFlags('production');
|
|
122
|
-
* console.log(`Production flags: ${prodFlags.length}`);
|
|
123
|
-
*
|
|
124
|
-
* // Handle empty results
|
|
125
|
-
* const flags = await repository.getAllFlags('nonexistent');
|
|
126
|
-
* if (flags.length === 0) {
|
|
127
|
-
* console.log('No flags found for environment');
|
|
128
|
-
* }
|
|
129
|
-
* ```
|
|
65
|
+
* Retrieves all feature flags with optional environment filtering.
|
|
66
|
+
* Uses QueryBuilder fluent API for the query.
|
|
130
67
|
*
|
|
68
|
+
* @param environment - Optional environment filter
|
|
69
|
+
* @returns Array of feature flags
|
|
131
70
|
*/
|
|
132
71
|
getAllFlags(environment?: string): Promise<FeatureFlag<TKey>[]>;
|
|
133
72
|
/**
|
|
134
|
-
* Retrieves a specific feature flag by its key
|
|
135
|
-
*
|
|
136
|
-
* @description Fetches a single feature flag from the database using its unique key.
|
|
137
|
-
* This method is optimized for runtime flag evaluation and uses the primary key index
|
|
138
|
-
* for O(1) lookup performance.
|
|
139
|
-
*
|
|
140
|
-
* @param {TKey} key - The unique identifier of the feature flag to retrieve
|
|
141
|
-
* @returns {Promise<FeatureFlag<TKey> | null>} The feature flag object or null if not found
|
|
142
|
-
*
|
|
143
|
-
* @throws {Error} When database operation fails
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* ```typescript
|
|
147
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
148
|
-
*
|
|
149
|
-
* // Get a specific flag for evaluation
|
|
150
|
-
* const premiumFlag = await repository.getFlag('PREMIUM_FEATURE');
|
|
151
|
-
* if (premiumFlag) {
|
|
152
|
-
* console.log(`Flag enabled: ${premiumFlag.isEnabled}`);
|
|
153
|
-
* console.log(`Flag value:`, premiumFlag.value);
|
|
154
|
-
* } else {
|
|
155
|
-
* console.log('Flag not found');
|
|
156
|
-
* }
|
|
157
|
-
*
|
|
158
|
-
* // Handle flag evaluation
|
|
159
|
-
* const checkoutFlag = await repository.getFlag('NEW_CHECKOUT');
|
|
160
|
-
* const isNewCheckoutEnabled = checkoutFlag?.isEnabled ?? false;
|
|
161
|
-
* ```
|
|
73
|
+
* Retrieves a specific feature flag by its key.
|
|
74
|
+
* Uses findById with 'key' as the ID column.
|
|
162
75
|
*
|
|
76
|
+
* @param key - The feature flag key
|
|
77
|
+
* @returns The feature flag or null
|
|
163
78
|
*/
|
|
164
79
|
getFlag(key: TKey): Promise<FeatureFlag<TKey> | null>;
|
|
165
80
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* @description Creates a new feature flag record with the provided configuration.
|
|
169
|
-
* This method is typically called through administrative interfaces or during
|
|
170
|
-
* system setup and migration processes.
|
|
81
|
+
* Find flags by enabled status using QueryBuilder.
|
|
171
82
|
*
|
|
172
|
-
* @param
|
|
173
|
-
* @returns
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
*
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
*
|
|
182
|
-
* // Create a simple boolean flag
|
|
183
|
-
* const simpleFlag = await repository.createFlag({
|
|
184
|
-
* key: 'ENABLE_DARK_MODE',
|
|
185
|
-
* value: true,
|
|
186
|
-
* isEnabled: true,
|
|
187
|
-
* environment: 'production',
|
|
188
|
-
* description: 'Enable dark mode theme'
|
|
189
|
-
* });
|
|
190
|
-
*
|
|
191
|
-
* // Create a complex flag with object value
|
|
192
|
-
* const complexFlag = await repository.createFlag({
|
|
193
|
-
* key: 'CHECKOUT_CONFIG',
|
|
194
|
-
* value: {
|
|
195
|
-
* variant: 'blue',
|
|
196
|
-
* showPromo: true,
|
|
197
|
-
* maxItems: 10
|
|
198
|
-
* },
|
|
199
|
-
* isEnabled: false,
|
|
200
|
-
* environment: 'staging',
|
|
201
|
-
* description: 'Checkout page configuration'
|
|
202
|
-
* });
|
|
203
|
-
*
|
|
204
|
-
* console.log(`Created flag: ${simpleFlag.key}`);
|
|
205
|
-
* ```
|
|
83
|
+
* @param isEnabled - Filter by enabled status
|
|
84
|
+
* @returns Array of matching flags
|
|
85
|
+
*/
|
|
86
|
+
findByEnabled(isEnabled: boolean): Promise<FeatureFlag<TKey>[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Count flags by enabled status using QueryBuilder.
|
|
89
|
+
*/
|
|
90
|
+
countByEnabled(isEnabled: boolean): Promise<number>;
|
|
91
|
+
/**
|
|
92
|
+
* Creates a new feature flag.
|
|
206
93
|
*
|
|
94
|
+
* @param data - Flag creation data
|
|
95
|
+
* @returns The created flag
|
|
207
96
|
*/
|
|
208
97
|
createFlag(data: CreateFlagRequest<TKey>): Promise<FeatureFlag<TKey>>;
|
|
209
98
|
/**
|
|
210
|
-
* Updates an existing feature flag
|
|
211
|
-
*
|
|
212
|
-
* @description Updates specific fields of an existing feature flag. Only provided
|
|
213
|
-
* fields will be updated, leaving other fields unchanged. The updated_at timestamp
|
|
214
|
-
* is automatically set to the current time.
|
|
215
|
-
*
|
|
216
|
-
* @param {TKey} key - The unique identifier of the feature flag to update
|
|
217
|
-
* @param {Partial<CreateFlagRequest<TKey>>} data - Partial flag data to update
|
|
218
|
-
* @returns {Promise<FeatureFlag<TKey>>} The updated feature flag object
|
|
219
|
-
*
|
|
220
|
-
* @throws {Error} When flag with the specified key is not found
|
|
221
|
-
* @throws {Error} When database operation fails
|
|
222
|
-
*
|
|
223
|
-
* @example
|
|
224
|
-
* ```typescript
|
|
225
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
226
|
-
*
|
|
227
|
-
* // Enable a flag
|
|
228
|
-
* const enabledFlag = await repository.updateFlag('BETA_FEATURE', {
|
|
229
|
-
* isEnabled: true
|
|
230
|
-
* });
|
|
231
|
-
*
|
|
232
|
-
* // Update flag value and description
|
|
233
|
-
* const updatedFlag = await repository.updateFlag('CHECKOUT_CONFIG', {
|
|
234
|
-
* value: { variant: 'green', showPromo: false },
|
|
235
|
-
* description: 'Updated checkout configuration'
|
|
236
|
-
* });
|
|
237
|
-
*
|
|
238
|
-
* // Change environment
|
|
239
|
-
* const prodFlag = await repository.updateFlag('NEW_FEATURE', {
|
|
240
|
-
* environment: 'production'
|
|
241
|
-
* });
|
|
242
|
-
*
|
|
243
|
-
* console.log(`Updated flag: ${updatedFlag.key}`);
|
|
244
|
-
* ```
|
|
99
|
+
* Updates an existing feature flag.
|
|
245
100
|
*
|
|
101
|
+
* @param key - Flag key to update
|
|
102
|
+
* @param data - Partial update data
|
|
103
|
+
* @returns The updated flag
|
|
246
104
|
*/
|
|
247
105
|
updateFlag(key: TKey, data: Partial<CreateFlagRequest<TKey>>): Promise<FeatureFlag<TKey>>;
|
|
248
106
|
/**
|
|
249
|
-
*
|
|
250
|
-
* @param value Unknown value
|
|
251
|
-
* @returns Inferred type as string
|
|
252
|
-
*/
|
|
253
|
-
private toTypeField;
|
|
254
|
-
/**
|
|
255
|
-
* Deletes a feature flag from the database
|
|
256
|
-
*
|
|
257
|
-
* @description Permanently removes a feature flag from the database. This operation
|
|
258
|
-
* cannot be undone. All associated rules, evaluations, and overrides should be
|
|
259
|
-
* cleaned up separately if needed.
|
|
260
|
-
*
|
|
261
|
-
* @param {TKey} key - The unique identifier of the feature flag to delete
|
|
262
|
-
* @returns {Promise<void>} Promise that resolves when deletion is complete
|
|
263
|
-
*
|
|
264
|
-
* @throws {Error} When flag with the specified key is not found
|
|
265
|
-
* @throws {Error} When database operation fails
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```typescript
|
|
269
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
270
|
-
*
|
|
271
|
-
* // Delete a flag
|
|
272
|
-
* try {
|
|
273
|
-
* await repository.deleteFlag('OLD_FEATURE');
|
|
274
|
-
* console.log('Flag deleted successfully');
|
|
275
|
-
* } catch (error) {
|
|
276
|
-
* console.error('Failed to delete flag:', error.message);
|
|
277
|
-
* }
|
|
278
|
-
*
|
|
279
|
-
* // Verify deletion
|
|
280
|
-
* const deletedFlag = await repository.getFlag('OLD_FEATURE');
|
|
281
|
-
* console.log(deletedFlag === null); // true
|
|
282
|
-
* ```
|
|
107
|
+
* Deletes a feature flag.
|
|
283
108
|
*
|
|
109
|
+
* @param key - Flag key to delete
|
|
284
110
|
*/
|
|
285
111
|
deleteFlag(key: TKey): Promise<void>;
|
|
286
112
|
/**
|
|
287
|
-
* Retrieves
|
|
288
|
-
*
|
|
289
|
-
* @description Fetches all rules configured for a specific feature flag, ordered by
|
|
290
|
-
* priority in descending order. Rules are used for advanced flag evaluation logic
|
|
291
|
-
* based on user context and conditions.
|
|
292
|
-
*
|
|
293
|
-
* @param {TKey} key - The feature flag key to get rules for
|
|
294
|
-
* @returns {Promise<FeatureFlagRule<TKey>[]>} Array of rules for the specified flag
|
|
295
|
-
*
|
|
296
|
-
* @example
|
|
297
|
-
* ```typescript
|
|
298
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
299
|
-
*
|
|
300
|
-
* // Get rules for a flag
|
|
301
|
-
* const rules = await repository.getFlagRules('PREMIUM_FEATURE');
|
|
302
|
-
* console.log(`Found ${rules.length} rules`);
|
|
303
|
-
*
|
|
304
|
-
* // Process rules by priority
|
|
305
|
-
* rules.forEach(rule => {
|
|
306
|
-
* console.log(`Rule: ${rule.name}, Priority: ${rule.priority}`);
|
|
307
|
-
* });
|
|
308
|
-
* ```
|
|
113
|
+
* Retrieves rules for a specific flag using direct db query.
|
|
114
|
+
* Rules are in a separate table, so we use the underlying db service.
|
|
309
115
|
*
|
|
116
|
+
* @param key - Flag key to get rules for
|
|
117
|
+
* @returns Array of rules
|
|
310
118
|
*/
|
|
311
119
|
getFlagRules(key: TKey): Promise<FeatureFlagRule<TKey>[]>;
|
|
312
120
|
/**
|
|
313
|
-
* Retrieves all enabled
|
|
314
|
-
*
|
|
315
|
-
* @description Fetches all enabled rules across all feature flags, sorted by flag key
|
|
316
|
-
* and then by priority. This method is used during system initialization to load
|
|
317
|
-
* all active rules into the evaluation engine.
|
|
318
|
-
*
|
|
319
|
-
* @returns {Promise<FeatureFlagRule<TKey>[]>} Array of all enabled rules
|
|
320
|
-
*
|
|
321
|
-
* @example
|
|
322
|
-
* ```typescript
|
|
323
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
324
|
-
*
|
|
325
|
-
* // Load all rules for evaluation engine
|
|
326
|
-
* const allRules = await repository.getAllRules();
|
|
327
|
-
* console.log(`Loaded ${allRules.length} active rules`);
|
|
328
|
-
*
|
|
329
|
-
* // Group rules by flag
|
|
330
|
-
* const rulesByFlag = allRules.reduce((acc, rule) => {
|
|
331
|
-
* if (!acc[rule.flagKey]) acc[rule.flagKey] = [];
|
|
332
|
-
* acc[rule.flagKey].push(rule);
|
|
333
|
-
* return acc;
|
|
334
|
-
* }, {});
|
|
335
|
-
* ```
|
|
121
|
+
* Retrieves all enabled rules across all flags.
|
|
336
122
|
*
|
|
123
|
+
* @returns Array of all enabled rules
|
|
337
124
|
*/
|
|
338
125
|
getAllRules(): Promise<FeatureFlagRule<TKey>[]>;
|
|
339
126
|
/**
|
|
340
|
-
* Logs a feature flag evaluation for audit
|
|
341
|
-
*
|
|
342
|
-
* @description Records feature flag evaluation events for compliance tracking,
|
|
343
|
-
* debugging, and analytics. This method is called after each flag evaluation
|
|
344
|
-
* when audit logging is enabled.
|
|
345
|
-
*
|
|
346
|
-
* @param {Object} params - The evaluation parameters
|
|
347
|
-
* @param {TKey} params.flagKey - The feature flag key that was evaluated
|
|
348
|
-
* @param {string} [params.userId] - Optional user ID who triggered the evaluation
|
|
349
|
-
* @param {FeatureFlagContext} [params.context] - Optional evaluation context
|
|
350
|
-
* @param {FeatureFlagValue} params.result - The evaluation result
|
|
351
|
-
* @returns {Promise<void>} Promise that resolves when log entry is created
|
|
352
|
-
*
|
|
353
|
-
* @example
|
|
354
|
-
* ```typescript
|
|
355
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
356
|
-
*
|
|
357
|
-
* // Log a user evaluation
|
|
358
|
-
* await repository.logEvaluation({
|
|
359
|
-
* flagKey: 'PREMIUM_FEATURE',
|
|
360
|
-
* userId: 'user123',
|
|
361
|
-
* context: {
|
|
362
|
-
* userRole: 'premium',
|
|
363
|
-
* environment: 'production',
|
|
364
|
-
* requestId: 'req-456'
|
|
365
|
-
* },
|
|
366
|
-
* result: true
|
|
367
|
-
* });
|
|
368
|
-
*
|
|
369
|
-
* // Log anonymous evaluation
|
|
370
|
-
* await repository.logEvaluation({
|
|
371
|
-
* flagKey: 'PUBLIC_FEATURE',
|
|
372
|
-
* result: { variant: 'blue', enabled: true }
|
|
373
|
-
* });
|
|
374
|
-
* ```
|
|
375
|
-
*
|
|
127
|
+
* Logs a feature flag evaluation for audit purposes.
|
|
376
128
|
*/
|
|
377
129
|
logEvaluation(params: {
|
|
378
130
|
flagKey: TKey;
|
|
@@ -381,180 +133,29 @@ export declare class FeatureFlagDatabaseRepository<TKey extends string = Feature
|
|
|
381
133
|
result: FeatureFlagValue;
|
|
382
134
|
}): Promise<void>;
|
|
383
135
|
/**
|
|
384
|
-
* Sets a user-specific override for a feature flag
|
|
385
|
-
*
|
|
386
|
-
* @description Creates a user-specific override that takes precedence over the
|
|
387
|
-
* default flag value and rules. Overrides can have optional expiration times
|
|
388
|
-
* and are useful for testing, gradual rollouts, or user-specific configurations.
|
|
389
|
-
*
|
|
390
|
-
* @param {TKey} flagKey - The feature flag key to override
|
|
391
|
-
* @param {string} userId - The user ID for whom to set the override
|
|
392
|
-
* @param {FeatureFlagValue} value - The override value
|
|
393
|
-
* @param {Date} [expiresAt] - Optional expiration date for the override
|
|
394
|
-
* @returns {Promise<void>} Promise that resolves when override is created
|
|
395
|
-
*
|
|
396
|
-
* @example
|
|
397
|
-
* ```typescript
|
|
398
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
399
|
-
*
|
|
400
|
-
* // Set permanent override
|
|
401
|
-
* await repository.setOverride(
|
|
402
|
-
* 'BETA_FEATURE',
|
|
403
|
-
* 'user123',
|
|
404
|
-
* true
|
|
405
|
-
* );
|
|
406
|
-
*
|
|
407
|
-
* // Set temporary override (expires in 1 hour)
|
|
408
|
-
* const expiresAt = new Date(Date.now() + 60 * 60 * 1000);
|
|
409
|
-
* await repository.setOverride(
|
|
410
|
-
* 'PREMIUM_FEATURE',
|
|
411
|
-
* 'testuser456',
|
|
412
|
-
* { enabled: true, variant: 'premium' },
|
|
413
|
-
* expiresAt
|
|
414
|
-
* );
|
|
415
|
-
* ```
|
|
416
|
-
*
|
|
136
|
+
* Sets a user-specific override for a feature flag.
|
|
417
137
|
*/
|
|
418
138
|
setOverride(flagKey: TKey, userId: string, value: FeatureFlagValue, expiresAt?: Date): Promise<void>;
|
|
419
139
|
/**
|
|
420
|
-
* Retrieves a user-specific override for a feature flag
|
|
421
|
-
*
|
|
422
|
-
* @description Fetches the override value for a specific user and flag combination.
|
|
423
|
-
* Automatically filters out expired overrides. Returns null if no valid override
|
|
424
|
-
* exists for the user.
|
|
425
|
-
*
|
|
426
|
-
* @param {TKey} flagKey - The feature flag key to check for overrides
|
|
427
|
-
* @param {string} userId - The user ID to get the override for
|
|
428
|
-
* @returns {Promise<FeatureFlagValue | null>} The override value or null if none exists
|
|
429
|
-
*
|
|
430
|
-
* @example
|
|
431
|
-
* ```typescript
|
|
432
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
433
|
-
*
|
|
434
|
-
* // Check for user override
|
|
435
|
-
* const override = await repository.getOverride('BETA_FEATURE', 'user123');
|
|
436
|
-
* if (override !== null) {
|
|
437
|
-
* console.log('User has override:', override);
|
|
438
|
-
* } else {
|
|
439
|
-
* console.log('No override found, using default flag value');
|
|
440
|
-
* }
|
|
441
|
-
*
|
|
442
|
-
* // Use in flag evaluation
|
|
443
|
-
* const userOverride = await repository.getOverride('PREMIUM_FEATURE', userId);
|
|
444
|
-
* const flagValue = userOverride ?? defaultFlagValue;
|
|
445
|
-
* ```
|
|
446
|
-
*
|
|
140
|
+
* Retrieves a user-specific override for a feature flag.
|
|
447
141
|
*/
|
|
448
142
|
getOverride(flagKey: TKey, userId: string): Promise<FeatureFlagValue | null>;
|
|
449
143
|
/**
|
|
450
|
-
* Removes user-specific overrides for a feature flag
|
|
451
|
-
*
|
|
452
|
-
* @description Deletes all override records for a specific user and flag combination.
|
|
453
|
-
* This operation cannot be undone and will cause the user to receive the default
|
|
454
|
-
* flag value or rule-based evaluation on subsequent requests.
|
|
455
|
-
*
|
|
456
|
-
* @param {TKey} flagKey - The feature flag key to remove overrides for
|
|
457
|
-
* @param {string} userId - The user ID to remove overrides for
|
|
458
|
-
* @returns {Promise<void>} Promise that resolves when overrides are removed
|
|
459
|
-
*
|
|
460
|
-
* @example
|
|
461
|
-
* ```typescript
|
|
462
|
-
* const repository = new FeatureFlagDatabaseRepository();
|
|
463
|
-
*
|
|
464
|
-
* // Remove user override
|
|
465
|
-
* await repository.removeOverride('BETA_FEATURE', 'user123');
|
|
466
|
-
* console.log('Override removed, user will get default flag value');
|
|
467
|
-
*
|
|
468
|
-
* // Verify removal
|
|
469
|
-
* const override = await repository.getOverride('BETA_FEATURE', 'user123');
|
|
470
|
-
* console.log(override === null); // true
|
|
471
|
-
*
|
|
472
|
-
* // Bulk cleanup - remove overrides for multiple users
|
|
473
|
-
* const userIds = ['user1', 'user2', 'user3'];
|
|
474
|
-
* for (const userId of userIds) {
|
|
475
|
-
* await repository.removeOverride('OLD_FEATURE', userId);
|
|
476
|
-
* }
|
|
477
|
-
* ```
|
|
478
|
-
*
|
|
144
|
+
* Removes user-specific overrides for a feature flag.
|
|
479
145
|
*/
|
|
480
146
|
removeOverride(flagKey: TKey, userId: string): Promise<void>;
|
|
481
147
|
/**
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
* @description Converts raw database row data to a properly typed FeatureFlag object.
|
|
485
|
-
* Handles field name variations between database schema and application types,
|
|
486
|
-
* provides default values for missing fields, and ensures type safety.
|
|
487
|
-
*
|
|
488
|
-
* @private
|
|
489
|
-
* @param {DatabaseFeatureFlagRow} row - Raw database row data
|
|
490
|
-
* @returns {FeatureFlag<TKey>} Typed FeatureFlag object
|
|
491
|
-
*
|
|
492
|
-
* @example
|
|
493
|
-
* ```typescript
|
|
494
|
-
* // Database row input:
|
|
495
|
-
* const dbRow = {
|
|
496
|
-
* key: 'PREMIUM_FEATURE',
|
|
497
|
-
* value: { enabled: true, variant: 'blue' },
|
|
498
|
-
* is_enabled: true,
|
|
499
|
-
* environments: ['production'],
|
|
500
|
-
* description: 'Premium feature toggle',
|
|
501
|
-
* created_at: '2024-01-15T10:30:00Z'
|
|
502
|
-
* };
|
|
503
|
-
*
|
|
504
|
-
* // Mapped output:
|
|
505
|
-
* const flag = this.mapToFeatureFlag(dbRow);
|
|
506
|
-
* // {
|
|
507
|
-
* // key: 'PREMIUM_FEATURE',
|
|
508
|
-
* // type: 'boolean',
|
|
509
|
-
* // name: 'PREMIUM_FEATURE',
|
|
510
|
-
* // value: { enabled: true, variant: 'blue' },
|
|
511
|
-
* // isEnabled: true,
|
|
512
|
-
* // environment: 'production',
|
|
513
|
-
* // description: 'Premium feature toggle',
|
|
514
|
-
* // createdAt: Date('2024-01-15T10:30:00Z'),
|
|
515
|
-
* // updatedAt: Date('2024-01-15T10:30:00Z'),
|
|
516
|
-
* // createdBy: 'system',
|
|
517
|
-
* // updatedBy: 'system'
|
|
518
|
-
* // }
|
|
519
|
-
* ```
|
|
520
|
-
*
|
|
521
|
-
*/
|
|
522
|
-
private mapToFeatureFlag;
|
|
523
|
-
/**
|
|
524
|
-
* Extracts the enabled status from a database row
|
|
525
|
-
*
|
|
526
|
-
* @private
|
|
527
|
-
* @param {DatabaseFeatureFlagRow} row - Database row with enabled field variations
|
|
528
|
-
* @returns {boolean} The enabled status, defaulting to true if not specified
|
|
529
|
-
*/
|
|
530
|
-
private getIsEnabled;
|
|
531
|
-
/**
|
|
532
|
-
* Extracts the creation date from a database row
|
|
533
|
-
*
|
|
534
|
-
* @private
|
|
535
|
-
* @param {DatabaseFeatureFlagRow} row - Database row with creation date field variations
|
|
536
|
-
* @returns {Date} The creation date, defaulting to current date if not specified
|
|
148
|
+
* Infers the type of a value for the type field.
|
|
537
149
|
*/
|
|
538
|
-
private
|
|
150
|
+
private toTypeField;
|
|
539
151
|
/**
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
* @private
|
|
543
|
-
* @param {DatabaseFeatureFlagRow} row - Database row with update date field variations
|
|
544
|
-
* @returns {Date} The update date, defaulting to current date if not specified
|
|
152
|
+
* Maps a database row to a FeatureFlag object.
|
|
545
153
|
*/
|
|
546
|
-
private
|
|
154
|
+
private mapToFeatureFlag;
|
|
547
155
|
/**
|
|
548
|
-
* Maps a database row to a FeatureFlagRule object
|
|
549
|
-
*
|
|
550
|
-
* @description Converts raw database rule row data to a properly typed FeatureFlagRule object.
|
|
551
|
-
* Handles field name variations and ensures type safety for rule evaluation.
|
|
552
|
-
*
|
|
553
|
-
* @private
|
|
554
|
-
* @param {DatabaseFeatureFlagRuleRow} row - Raw database rule row data
|
|
555
|
-
* @returns {FeatureFlagRule<TKey>} Typed FeatureFlagRule object
|
|
556
|
-
*
|
|
156
|
+
* Maps a database row to a FeatureFlagRule object.
|
|
557
157
|
*/
|
|
558
158
|
private mapToFeatureFlagRule;
|
|
559
159
|
}
|
|
160
|
+
export {};
|
|
560
161
|
//# sourceMappingURL=FeatureFlagRepository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureFlagRepository.d.ts","sourceRoot":"","sources":["../../../src/models/featureFlags/FeatureFlagRepository.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"FeatureFlagRepository.d.ts","sourceRoot":"","sources":["../../../src/models/featureFlags/FeatureFlagRepository.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAKL,KAAK,0BAA0B,EAK/B,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE;;GAEG;AACH,KAAK,cAAc,GAAG,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAgB3E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,6BAA6B,CACxC,IAAI,SAAS,MAAM,GAAG,cAAc,CACpC,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAGpB;IAEH;;;;;OAKG;gBACS,E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AAI,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;IAkCrD;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE;QAC1B,OAAO,EAAE,IAAI,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,kBAAkB,CAAC;QAC7B,MAAM,EAAE,gBAAgB,CAAC;KAC1B,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BjB;;OAEG;IACG,WAAW,CACf,OAAO,EAAE,IAAI,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,gBAAgB,EACvB,SAAS,CAAC,EAAE,IAAI,GACf,OAAO,CAAC,IAAI,CAAC;IAoBhB;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAuBlF;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBlE;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB;;OAEG;IAEH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAW7B"}
|
|
@@ -388,4 +388,6 @@ export declare class DbService {
|
|
|
388
388
|
*/
|
|
389
389
|
static createInstance(config: DbServiceConfig): Promise<DbService>;
|
|
390
390
|
}
|
|
391
|
+
/** Type alias for DbService instance (use for type-only imports to avoid bundling) */
|
|
392
|
+
export type DbServiceInstance = DbService;
|
|
391
393
|
//# sourceMappingURL=DbService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DbService.d.ts","sourceRoot":"","sources":["../../src/services/DbService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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promise<NotificationService>;
|
|
150
150
|
}
|
|
151
|
+
/** Type alias for NotificationService instance (use for type-only imports to avoid bundling) */
|
|
152
|
+
export type NotificationServiceInstance = NotificationService;
|
|
151
153
|
//# sourceMappingURL=NotificationService.d.ts.map
|