@brandtg/flapjack 1.3.0 → 1.5.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/dist/model.d.ts CHANGED
@@ -3,8 +3,8 @@ import type { QueryResult } from "pg";
3
3
  interface Queryable {
4
4
  query: (text: string, params?: any[]) => Promise<QueryResult>;
5
5
  }
6
- type CreateInput = Omit<FeatureFlag, "id" | "created" | "modified">;
7
- type UpdateChanges = Partial<Omit<FeatureFlag, "id" | "created" | "modified">>;
6
+ type CreateInput = Omit<FeatureFlag, "id" | "created" | "modified" | "archived">;
7
+ type UpdateChanges = Partial<Omit<FeatureFlag, "id" | "created" | "modified" | "archived">>;
8
8
  /**
9
9
  * Model for managing feature flags stored in PostgreSQL.
10
10
  *
@@ -43,6 +43,7 @@ export declare class FeatureFlagModel {
43
43
  * @param input.roles - Optional list of roles that have this flag enabled
44
44
  * @param input.groups - Optional list of user groups that have this flag enabled
45
45
  * @param input.users - Optional list of specific user IDs that have this flag enabled
46
+ * @param input.tags - Optional list of tags for organizing the flag (e.g. a release version)
46
47
  * @param input.note - Optional description of the flag's purpose
47
48
  * @param input.expires - Optional expiration date for the feature flag
48
49
  * @returns The created feature flag with generated id, created, and modified timestamps
@@ -73,7 +74,9 @@ export declare class FeatureFlagModel {
73
74
  * }
74
75
  * ```
75
76
  */
76
- getById(id: number): Promise<FeatureFlag | null>;
77
+ getById(id: number, { includeArchived }?: {
78
+ includeArchived?: boolean;
79
+ }): Promise<FeatureFlag | null>;
77
80
  /**
78
81
  * Retrieves a feature flag by its name.
79
82
  *
@@ -88,7 +91,9 @@ export declare class FeatureFlagModel {
88
91
  * }
89
92
  * ```
90
93
  */
91
- getByName(name: string): Promise<FeatureFlag | null>;
94
+ getByName(name: string, { includeArchived }?: {
95
+ includeArchived?: boolean;
96
+ }): Promise<FeatureFlag | null>;
92
97
  /**
93
98
  * Retrieves multiple feature flags by their names.
94
99
  *
@@ -101,7 +106,9 @@ export declare class FeatureFlagModel {
101
106
  * console.log(`Found ${flags.length} flags`);
102
107
  * ```
103
108
  */
104
- getManyByName(names: string[]): Promise<FeatureFlag[]>;
109
+ getManyByName(names: string[], { includeArchived }?: {
110
+ includeArchived?: boolean;
111
+ }): Promise<FeatureFlag[]>;
105
112
  /**
106
113
  * Retrieves multiple feature flags by their IDs.
107
114
  *
@@ -114,7 +121,9 @@ export declare class FeatureFlagModel {
114
121
  * console.log(`Found ${flags.length} flags`);
115
122
  * ```
116
123
  */
117
- getMany(ids: number[]): Promise<FeatureFlag[]>;
124
+ getMany(ids: number[], { includeArchived }?: {
125
+ includeArchived?: boolean;
126
+ }): Promise<FeatureFlag[]>;
118
127
  /**
119
128
  * Retrieves all feature flags, ordered by ID.
120
129
  *
@@ -129,7 +138,24 @@ export declare class FeatureFlagModel {
129
138
  * });
130
139
  * ```
131
140
  */
132
- list(): Promise<FeatureFlag[]>;
141
+ list({ includeArchived, }?: {
142
+ includeArchived?: boolean;
143
+ }): Promise<FeatureFlag[]>;
144
+ /**
145
+ * Retrieves all feature flags that carry the given tag.
146
+ *
147
+ * @param tag - The tag to filter by (exact match against a tag in the flag's tags array)
148
+ * @returns Array of feature flags tagged with the given value
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * // Find every flag associated with a release version
153
+ * const flags = await model.listByTag("release:1.5.0");
154
+ * ```
155
+ */
156
+ listByTag(tag: string, { includeArchived }?: {
157
+ includeArchived?: boolean;
158
+ }): Promise<FeatureFlag[]>;
133
159
  /**
134
160
  * Updates an existing feature flag.
135
161
  *
@@ -156,11 +182,16 @@ export declare class FeatureFlagModel {
156
182
  */
157
183
  update(id: number, changes: UpdateChanges): Promise<FeatureFlag | null>;
158
184
  /**
159
- * Deletes a feature flag from the database.
185
+ * Permanently deletes a feature flag from the database, including its
186
+ * subject and group-member relationships (via ON DELETE CASCADE).
160
187
  *
161
188
  * @param id - The unique identifier of the feature flag to delete
162
189
  * @returns true if the flag was deleted, false if not found
163
190
  *
191
+ * @remarks
192
+ * This is a hard delete that destroys all metadata. To hide a flag while
193
+ * retaining its history for audit purposes, use {@link archive} instead.
194
+ *
164
195
  * @example
165
196
  * ```typescript
166
197
  * const deleted = await model.delete(flagId);
@@ -170,6 +201,49 @@ export declare class FeatureFlagModel {
170
201
  * ```
171
202
  */
172
203
  delete(id: number): Promise<boolean>;
204
+ /**
205
+ * Archives (hides) a feature flag while keeping the row for historical/audit
206
+ * purposes. Archived flags are excluded from normal reads and evaluation
207
+ * (an archived flag evaluates to inactive), but can still be retrieved by
208
+ * passing `{ includeArchived: true }` to the read methods.
209
+ *
210
+ * @param id - The unique identifier of the feature flag to archive
211
+ * @returns The archived feature flag, or null if it does not exist or is already archived
212
+ *
213
+ * @remarks
214
+ * Archiving is irreversible: there is intentionally no `unarchive` method.
215
+ * The `archived` timestamp is set once and never changed (a second call is a
216
+ * no-op that returns null). The flag's name remains reserved permanently, so
217
+ * a new flag cannot reuse it — create a new flag with a different name.
218
+ *
219
+ * @example
220
+ * ```typescript
221
+ * const archived = await model.archive(flagId);
222
+ * if (archived) {
223
+ * console.log(`Archived at ${archived.archived}`);
224
+ * }
225
+ * ```
226
+ */
227
+ archive(id: number): Promise<FeatureFlag | null>;
228
+ /**
229
+ * Adds an external subject identifier to a feature flag.
230
+ */
231
+ addSubject(featureFlagId: number, subject: string): Promise<boolean>;
232
+ /**
233
+ * Removes an external subject identifier from a feature flag.
234
+ */
235
+ removeSubject(featureFlagId: number, subject: string): Promise<boolean>;
236
+ /**
237
+ * Gets all external subject identifiers associated with a feature flag.
238
+ */
239
+ getSubjects(featureFlagId: number): Promise<string[]>;
240
+ /**
241
+ * Gets all feature flags directly associated with an external subject identifier.
242
+ */
243
+ getFeatureFlagsForSubject(subject: string, { includeArchived }?: {
244
+ includeArchived?: boolean;
245
+ }): Promise<FeatureFlag[]>;
246
+ private getSubjectMatchedFlagIds;
173
247
  /**
174
248
  * Checks if a user belongs to any of the specified groups
175
249
  */
@@ -178,10 +252,12 @@ export declare class FeatureFlagModel {
178
252
  * Evaluates a feature flag for a user based on flag configuration.
179
253
  * This is a stateless helper that performs the actual flag evaluation logic.
180
254
  */
181
- evaluateFlagForUser(flag: FeatureFlag, { user, roles, groups, }: {
255
+ evaluateFlagForUser(flag: FeatureFlag, { user, roles, groups, subjects, subjectMatchedFlagIds, }: {
182
256
  user?: string;
183
257
  roles?: string[];
184
258
  groups?: string[];
259
+ subjects?: string[];
260
+ subjectMatchedFlagIds?: Set<number>;
185
261
  }): Promise<boolean>;
186
262
  /**
187
263
  * Computes the hash value for a user ID using MurmurHash3.
@@ -245,6 +321,16 @@ export declare class FeatureFlagModel {
245
321
  roles?: string[];
246
322
  groups?: string[];
247
323
  }): Promise<boolean>;
324
+ /**
325
+ * Checks if a feature flag is active for a context, including optional external subjects.
326
+ */
327
+ isActiveForContext({ name, user, roles, groups, subjects, }: {
328
+ name: string;
329
+ user?: string;
330
+ roles?: string[];
331
+ groups?: string[];
332
+ subjects?: string[];
333
+ }): Promise<boolean>;
248
334
  /**
249
335
  * Checks if multiple feature flags are active for a user based on configured rules.
250
336
  *
@@ -298,6 +384,16 @@ export declare class FeatureFlagModel {
298
384
  roles?: string[];
299
385
  groups?: string[];
300
386
  }): Promise<Record<string, boolean>>;
387
+ /**
388
+ * Checks if multiple feature flags are active for a context, including optional external subjects.
389
+ */
390
+ areActiveForContext({ names, user, roles, groups, subjects, }: {
391
+ names?: string[];
392
+ user?: string;
393
+ roles?: string[];
394
+ groups?: string[];
395
+ subjects?: string[];
396
+ }): Promise<Record<string, boolean>>;
301
397
  /**
302
398
  * Gets the latest modified timestamp across all feature flags.
303
399
  *
@@ -315,8 +411,8 @@ export declare class FeatureFlagModel {
315
411
  */
316
412
  getLastModified(): Promise<number>;
317
413
  }
318
- type CreateGroupInput = Omit<FeatureFlagGroup, "id" | "created" | "modified">;
319
- type UpdateGroupChanges = Partial<Omit<FeatureFlagGroup, "id" | "created" | "modified">>;
414
+ type CreateGroupInput = Omit<FeatureFlagGroup, "id" | "created" | "modified" | "archived">;
415
+ type UpdateGroupChanges = Partial<Omit<FeatureFlagGroup, "id" | "created" | "modified" | "archived">>;
320
416
  type UpdateAllChanges = Partial<Pick<FeatureFlag, "everyone" | "percent" | "roles" | "groups" | "users">>;
321
417
  /**
322
418
  * Model for managing feature flag groups stored in PostgreSQL.
@@ -377,7 +473,9 @@ export declare class FeatureFlagGroupModel {
377
473
  * }
378
474
  * ```
379
475
  */
380
- getById(id: number): Promise<FeatureFlagGroup | null>;
476
+ getById(id: number, { includeArchived }?: {
477
+ includeArchived?: boolean;
478
+ }): Promise<FeatureFlagGroup | null>;
381
479
  /**
382
480
  * Retrieves a feature flag group by its name.
383
481
  *
@@ -389,7 +487,9 @@ export declare class FeatureFlagGroupModel {
389
487
  * const group = await model.getByName("billing_redesign");
390
488
  * ```
391
489
  */
392
- getByName(name: string): Promise<FeatureFlagGroup | null>;
490
+ getByName(name: string, { includeArchived }?: {
491
+ includeArchived?: boolean;
492
+ }): Promise<FeatureFlagGroup | null>;
393
493
  /**
394
494
  * Lists all feature flag groups.
395
495
  *
@@ -403,7 +503,9 @@ export declare class FeatureFlagGroupModel {
403
503
  * }
404
504
  * ```
405
505
  */
406
- list(): Promise<FeatureFlagGroup[]>;
506
+ list({ includeArchived, }?: {
507
+ includeArchived?: boolean;
508
+ }): Promise<FeatureFlagGroup[]>;
407
509
  /**
408
510
  * Updates a feature flag group.
409
511
  *
@@ -420,17 +522,43 @@ export declare class FeatureFlagGroupModel {
420
522
  */
421
523
  update(id: number, changes: UpdateGroupChanges): Promise<FeatureFlagGroup | null>;
422
524
  /**
423
- * Deletes a feature flag group and all its member relationships.
525
+ * Permanently deletes a feature flag group and all its member and subject
526
+ * relationships (via ON DELETE CASCADE).
424
527
  *
425
528
  * @param id - The group ID to delete
426
529
  * @returns true if deleted, false if not found
427
530
  *
531
+ * @remarks
532
+ * This is a hard delete that destroys all metadata. To hide a group while
533
+ * retaining its history for audit purposes, use {@link archive} instead.
534
+ *
428
535
  * @example
429
536
  * ```typescript
430
537
  * const deleted = await model.delete(1);
431
538
  * ```
432
539
  */
433
540
  delete(id: number): Promise<boolean>;
541
+ /**
542
+ * Archives (hides) a feature flag group while keeping the row for
543
+ * historical/audit purposes. Archived groups are excluded from normal reads
544
+ * and no longer contribute subject-based targeting. Member flags are left
545
+ * untouched and remain active; the membership and subject rows are kept for
546
+ * audit but become inert.
547
+ *
548
+ * @param id - The group ID to archive
549
+ * @returns The archived group, or null if it does not exist or is already archived
550
+ *
551
+ * @remarks
552
+ * Archiving is irreversible: there is intentionally no `unarchive` method.
553
+ * The `archived` timestamp is set once and never changed (a second call is a
554
+ * no-op that returns null). The group's name remains reserved permanently.
555
+ *
556
+ * @example
557
+ * ```typescript
558
+ * const archived = await model.archive(1);
559
+ * ```
560
+ */
561
+ archive(id: number): Promise<FeatureFlagGroup | null>;
434
562
  /**
435
563
  * Adds a feature flag to a group.
436
564
  *
@@ -473,7 +601,9 @@ export declare class FeatureFlagGroupModel {
473
601
  * }
474
602
  * ```
475
603
  */
476
- getFeatureFlags(groupId: number): Promise<FeatureFlag[]>;
604
+ getFeatureFlags(groupId: number, { includeArchived }?: {
605
+ includeArchived?: boolean;
606
+ }): Promise<FeatureFlag[]>;
477
607
  /**
478
608
  * Gets all groups that contain a specific feature flag.
479
609
  *
@@ -485,7 +615,27 @@ export declare class FeatureFlagGroupModel {
485
615
  * const groups = await model.getGroupsForFeatureFlag(5);
486
616
  * ```
487
617
  */
488
- getGroupsForFeatureFlag(featureFlagId: number): Promise<FeatureFlagGroup[]>;
618
+ getGroupsForFeatureFlag(featureFlagId: number, { includeArchived }?: {
619
+ includeArchived?: boolean;
620
+ }): Promise<FeatureFlagGroup[]>;
621
+ /**
622
+ * Adds an external subject identifier to a feature flag group.
623
+ */
624
+ addSubject(groupId: number, subject: string): Promise<boolean>;
625
+ /**
626
+ * Removes an external subject identifier from a feature flag group.
627
+ */
628
+ removeSubject(groupId: number, subject: string): Promise<boolean>;
629
+ /**
630
+ * Gets all external subject identifiers associated with a feature flag group.
631
+ */
632
+ getSubjects(groupId: number): Promise<string[]>;
633
+ /**
634
+ * Gets all groups that are associated with a specific external subject identifier.
635
+ */
636
+ getGroupsForSubject(subject: string, { includeArchived }?: {
637
+ includeArchived?: boolean;
638
+ }): Promise<FeatureFlagGroup[]>;
489
639
  /**
490
640
  * Updates all feature flags in a group with the same changes.
491
641
  *
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAItC,UAAU,SAAS;IACjB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/D;AAkBD,KAAK,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AACpE,KAAK,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC;AA0B/E;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,EAAE,CAAY;IACtB,OAAO,CAAC,aAAa,CAAC,CAA2B;IAEjD;;;;;;;;;;;OAWG;gBACS,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,wBAAwB;IAKnE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAuCtD;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAOtD;;;;;;;;;;;;;O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