@flagshark/core 2.0.0 → 2.1.1

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.
Files changed (68) hide show
  1. package/README.md +2 -0
  2. package/dist/config/schema.d.ts +112 -0
  3. package/dist/config/schema.d.ts.map +1 -1
  4. package/dist/config/schema.js +63 -0
  5. package/dist/config/schema.js.map +1 -1
  6. package/dist/detection/detectors/typescript.d.ts.map +1 -1
  7. package/dist/detection/detectors/typescript.js +41 -0
  8. package/dist/detection/detectors/typescript.js.map +1 -1
  9. package/dist/detection/feature-flag.d.ts +28 -0
  10. package/dist/detection/feature-flag.d.ts.map +1 -1
  11. package/dist/detection/helpers.d.ts +16 -0
  12. package/dist/detection/helpers.d.ts.map +1 -1
  13. package/dist/detection/helpers.js +117 -6
  14. package/dist/detection/helpers.js.map +1 -1
  15. package/dist/detection/import-graph.d.ts +234 -0
  16. package/dist/detection/import-graph.d.ts.map +1 -0
  17. package/dist/detection/import-graph.js +641 -0
  18. package/dist/detection/import-graph.js.map +1 -0
  19. package/dist/detection/interface.d.ts +57 -0
  20. package/dist/detection/interface.d.ts.map +1 -1
  21. package/dist/detection/interface.js.map +1 -1
  22. package/dist/detection/polyglot-analyzer.d.ts +8 -0
  23. package/dist/detection/polyglot-analyzer.d.ts.map +1 -1
  24. package/dist/detection/polyglot-analyzer.js +2 -0
  25. package/dist/detection/polyglot-analyzer.js.map +1 -1
  26. package/dist/detection/tree-sitter/engine.d.ts.map +1 -1
  27. package/dist/detection/tree-sitter/engine.js +62 -15
  28. package/dist/detection/tree-sitter/engine.js.map +1 -1
  29. package/dist/detection/tree-sitter/parser-cache.d.ts +20 -0
  30. package/dist/detection/tree-sitter/parser-cache.d.ts.map +1 -1
  31. package/dist/detection/tree-sitter/parser-cache.js +32 -1
  32. package/dist/detection/tree-sitter/parser-cache.js.map +1 -1
  33. package/dist/output/json.d.ts.map +1 -1
  34. package/dist/output/json.js +28 -0
  35. package/dist/output/json.js.map +1 -1
  36. package/dist/output/markdown.d.ts.map +1 -1
  37. package/dist/output/markdown.js +47 -1
  38. package/dist/output/markdown.js.map +1 -1
  39. package/dist/output/text.d.ts.map +1 -1
  40. package/dist/output/text.js +89 -0
  41. package/dist/output/text.js.map +1 -1
  42. package/dist/providers/cross-reference.d.ts +36 -2
  43. package/dist/providers/cross-reference.d.ts.map +1 -1
  44. package/dist/providers/cross-reference.js +102 -7
  45. package/dist/providers/cross-reference.js.map +1 -1
  46. package/dist/providers/interface.d.ts +116 -2
  47. package/dist/providers/interface.d.ts.map +1 -1
  48. package/dist/providers/launchdarkly/client.d.ts +12 -0
  49. package/dist/providers/launchdarkly/client.d.ts.map +1 -1
  50. package/dist/providers/launchdarkly/client.js +243 -24
  51. package/dist/providers/launchdarkly/client.js.map +1 -1
  52. package/dist/providers/launchdarkly/types.d.ts +318 -0
  53. package/dist/providers/launchdarkly/types.d.ts.map +1 -1
  54. package/dist/providers/launchdarkly/types.js +82 -0
  55. package/dist/providers/launchdarkly/types.js.map +1 -1
  56. package/dist/providers/orchestrate.d.ts +34 -2
  57. package/dist/providers/orchestrate.d.ts.map +1 -1
  58. package/dist/providers/orchestrate.js +59 -7
  59. package/dist/providers/orchestrate.js.map +1 -1
  60. package/dist/scan-repo.d.ts +28 -0
  61. package/dist/scan-repo.d.ts.map +1 -1
  62. package/dist/scan-repo.js +290 -4
  63. package/dist/scan-repo.js.map +1 -1
  64. package/dist/staleness.d.ts +31 -1
  65. package/dist/staleness.d.ts.map +1 -1
  66. package/dist/staleness.js +66 -10
  67. package/dist/staleness.js.map +1 -1
  68. package/package.json +2 -1
@@ -3,6 +3,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
3
3
  items: z.ZodArray<z.ZodObject<{
4
4
  key: z.ZodString;
5
5
  archived: z.ZodBoolean;
6
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7
+ creationDate: z.ZodOptional<z.ZodNumber>;
8
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
9
+ maintainerId: z.ZodOptional<z.ZodString>;
6
10
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7
11
  lastModified: z.ZodOptional<z.ZodNumber>;
8
12
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -13,6 +17,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
13
17
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14
18
  key: z.ZodString;
15
19
  archived: z.ZodBoolean;
20
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
21
+ creationDate: z.ZodOptional<z.ZodNumber>;
22
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
23
+ maintainerId: z.ZodOptional<z.ZodString>;
16
24
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
17
25
  lastModified: z.ZodOptional<z.ZodNumber>;
18
26
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -23,6 +31,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
23
31
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
24
32
  key: z.ZodString;
25
33
  archived: z.ZodBoolean;
34
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
35
+ creationDate: z.ZodOptional<z.ZodNumber>;
36
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
37
+ maintainerId: z.ZodOptional<z.ZodString>;
26
38
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
27
39
  lastModified: z.ZodOptional<z.ZodNumber>;
28
40
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -53,6 +65,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
53
65
  items: z.ZodArray<z.ZodObject<{
54
66
  key: z.ZodString;
55
67
  archived: z.ZodBoolean;
68
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
69
+ creationDate: z.ZodOptional<z.ZodNumber>;
70
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
71
+ maintainerId: z.ZodOptional<z.ZodString>;
56
72
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
57
73
  lastModified: z.ZodOptional<z.ZodNumber>;
58
74
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -63,6 +79,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
63
79
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
64
80
  key: z.ZodString;
65
81
  archived: z.ZodBoolean;
82
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
83
+ creationDate: z.ZodOptional<z.ZodNumber>;
84
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
85
+ maintainerId: z.ZodOptional<z.ZodString>;
66
86
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
67
87
  lastModified: z.ZodOptional<z.ZodNumber>;
68
88
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -73,6 +93,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
73
93
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
74
94
  key: z.ZodString;
75
95
  archived: z.ZodBoolean;
96
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
97
+ creationDate: z.ZodOptional<z.ZodNumber>;
98
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
99
+ maintainerId: z.ZodOptional<z.ZodString>;
76
100
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
77
101
  lastModified: z.ZodOptional<z.ZodNumber>;
78
102
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -103,6 +127,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
103
127
  items: z.ZodArray<z.ZodObject<{
104
128
  key: z.ZodString;
105
129
  archived: z.ZodBoolean;
130
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
131
+ creationDate: z.ZodOptional<z.ZodNumber>;
132
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
133
+ maintainerId: z.ZodOptional<z.ZodString>;
106
134
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
107
135
  lastModified: z.ZodOptional<z.ZodNumber>;
108
136
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -113,6 +141,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
113
141
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
114
142
  key: z.ZodString;
115
143
  archived: z.ZodBoolean;
144
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
145
+ creationDate: z.ZodOptional<z.ZodNumber>;
146
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
147
+ maintainerId: z.ZodOptional<z.ZodString>;
116
148
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
117
149
  lastModified: z.ZodOptional<z.ZodNumber>;
118
150
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -123,6 +155,10 @@ export declare const FlagsResponseSchema: z.ZodObject<{
123
155
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
124
156
  key: z.ZodString;
125
157
  archived: z.ZodBoolean;
158
+ temporary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
159
+ creationDate: z.ZodOptional<z.ZodNumber>;
160
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
161
+ maintainerId: z.ZodOptional<z.ZodString>;
126
162
  environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
127
163
  lastModified: z.ZodOptional<z.ZodNumber>;
128
164
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -151,4 +187,286 @@ export declare const FlagsResponseSchema: z.ZodObject<{
151
187
  }>>;
152
188
  }, z.ZodTypeAny, "passthrough">>;
153
189
  export type FlagsResponse = z.infer<typeof FlagsResponseSchema>;
190
+ export declare const FlagStatusesResponseSchema: z.ZodObject<{
191
+ items: z.ZodArray<z.ZodObject<{
192
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
193
+ lastRequested: z.ZodNullable<z.ZodString>;
194
+ _links: z.ZodOptional<z.ZodObject<{
195
+ parent: z.ZodOptional<z.ZodObject<{
196
+ href: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ href: string;
199
+ }, {
200
+ href: string;
201
+ }>>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ parent?: {
204
+ href: string;
205
+ } | undefined;
206
+ }, {
207
+ parent?: {
208
+ href: string;
209
+ } | undefined;
210
+ }>>;
211
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
212
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
213
+ lastRequested: z.ZodNullable<z.ZodString>;
214
+ _links: z.ZodOptional<z.ZodObject<{
215
+ parent: z.ZodOptional<z.ZodObject<{
216
+ href: z.ZodString;
217
+ }, "strip", z.ZodTypeAny, {
218
+ href: string;
219
+ }, {
220
+ href: string;
221
+ }>>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ parent?: {
224
+ href: string;
225
+ } | undefined;
226
+ }, {
227
+ parent?: {
228
+ href: string;
229
+ } | undefined;
230
+ }>>;
231
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
232
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
233
+ lastRequested: z.ZodNullable<z.ZodString>;
234
+ _links: z.ZodOptional<z.ZodObject<{
235
+ parent: z.ZodOptional<z.ZodObject<{
236
+ href: z.ZodString;
237
+ }, "strip", z.ZodTypeAny, {
238
+ href: string;
239
+ }, {
240
+ href: string;
241
+ }>>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ parent?: {
244
+ href: string;
245
+ } | undefined;
246
+ }, {
247
+ parent?: {
248
+ href: string;
249
+ } | undefined;
250
+ }>>;
251
+ }, z.ZodTypeAny, "passthrough">>, "many">;
252
+ _links: z.ZodOptional<z.ZodUnknown>;
253
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
254
+ items: z.ZodArray<z.ZodObject<{
255
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
256
+ lastRequested: z.ZodNullable<z.ZodString>;
257
+ _links: z.ZodOptional<z.ZodObject<{
258
+ parent: z.ZodOptional<z.ZodObject<{
259
+ href: z.ZodString;
260
+ }, "strip", z.ZodTypeAny, {
261
+ href: string;
262
+ }, {
263
+ href: string;
264
+ }>>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ parent?: {
267
+ href: string;
268
+ } | undefined;
269
+ }, {
270
+ parent?: {
271
+ href: string;
272
+ } | undefined;
273
+ }>>;
274
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
275
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
276
+ lastRequested: z.ZodNullable<z.ZodString>;
277
+ _links: z.ZodOptional<z.ZodObject<{
278
+ parent: z.ZodOptional<z.ZodObject<{
279
+ href: z.ZodString;
280
+ }, "strip", z.ZodTypeAny, {
281
+ href: string;
282
+ }, {
283
+ href: string;
284
+ }>>;
285
+ }, "strip", z.ZodTypeAny, {
286
+ parent?: {
287
+ href: string;
288
+ } | undefined;
289
+ }, {
290
+ parent?: {
291
+ href: string;
292
+ } | undefined;
293
+ }>>;
294
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
295
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
296
+ lastRequested: z.ZodNullable<z.ZodString>;
297
+ _links: z.ZodOptional<z.ZodObject<{
298
+ parent: z.ZodOptional<z.ZodObject<{
299
+ href: z.ZodString;
300
+ }, "strip", z.ZodTypeAny, {
301
+ href: string;
302
+ }, {
303
+ href: string;
304
+ }>>;
305
+ }, "strip", z.ZodTypeAny, {
306
+ parent?: {
307
+ href: string;
308
+ } | undefined;
309
+ }, {
310
+ parent?: {
311
+ href: string;
312
+ } | undefined;
313
+ }>>;
314
+ }, z.ZodTypeAny, "passthrough">>, "many">;
315
+ _links: z.ZodOptional<z.ZodUnknown>;
316
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
317
+ items: z.ZodArray<z.ZodObject<{
318
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
319
+ lastRequested: z.ZodNullable<z.ZodString>;
320
+ _links: z.ZodOptional<z.ZodObject<{
321
+ parent: z.ZodOptional<z.ZodObject<{
322
+ href: z.ZodString;
323
+ }, "strip", z.ZodTypeAny, {
324
+ href: string;
325
+ }, {
326
+ href: string;
327
+ }>>;
328
+ }, "strip", z.ZodTypeAny, {
329
+ parent?: {
330
+ href: string;
331
+ } | undefined;
332
+ }, {
333
+ parent?: {
334
+ href: string;
335
+ } | undefined;
336
+ }>>;
337
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
338
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
339
+ lastRequested: z.ZodNullable<z.ZodString>;
340
+ _links: z.ZodOptional<z.ZodObject<{
341
+ parent: z.ZodOptional<z.ZodObject<{
342
+ href: z.ZodString;
343
+ }, "strip", z.ZodTypeAny, {
344
+ href: string;
345
+ }, {
346
+ href: string;
347
+ }>>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ parent?: {
350
+ href: string;
351
+ } | undefined;
352
+ }, {
353
+ parent?: {
354
+ href: string;
355
+ } | undefined;
356
+ }>>;
357
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
358
+ name: z.ZodEnum<["new", "active", "inactive", "launched"]>;
359
+ lastRequested: z.ZodNullable<z.ZodString>;
360
+ _links: z.ZodOptional<z.ZodObject<{
361
+ parent: z.ZodOptional<z.ZodObject<{
362
+ href: z.ZodString;
363
+ }, "strip", z.ZodTypeAny, {
364
+ href: string;
365
+ }, {
366
+ href: string;
367
+ }>>;
368
+ }, "strip", z.ZodTypeAny, {
369
+ parent?: {
370
+ href: string;
371
+ } | undefined;
372
+ }, {
373
+ parent?: {
374
+ href: string;
375
+ } | undefined;
376
+ }>>;
377
+ }, z.ZodTypeAny, "passthrough">>, "many">;
378
+ _links: z.ZodOptional<z.ZodUnknown>;
379
+ }, z.ZodTypeAny, "passthrough">>;
380
+ export type FlagStatusesResponse = z.infer<typeof FlagStatusesResponseSchema>;
381
+ export declare const EvaluationsResponseSchema: z.ZodObject<{
382
+ series: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
383
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
384
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
385
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
386
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
387
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
388
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
389
+ metadata: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
390
+ _links: z.ZodOptional<z.ZodUnknown>;
391
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
392
+ series: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
393
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
394
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
395
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
396
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
397
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
398
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
399
+ metadata: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
400
+ _links: z.ZodOptional<z.ZodUnknown>;
401
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
402
+ series: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
403
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
404
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
405
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
406
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
407
+ time: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
408
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
409
+ metadata: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
410
+ _links: z.ZodOptional<z.ZodUnknown>;
411
+ }, z.ZodTypeAny, "passthrough">>;
412
+ export type EvaluationsResponse = z.infer<typeof EvaluationsResponseSchema>;
413
+ export declare const MembersResponseSchema: z.ZodObject<{
414
+ items: z.ZodArray<z.ZodObject<{
415
+ _id: z.ZodString;
416
+ email: z.ZodString;
417
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
418
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
419
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
420
+ _id: z.ZodString;
421
+ email: z.ZodString;
422
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
423
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
424
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
425
+ _id: z.ZodString;
426
+ email: z.ZodString;
427
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
428
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
429
+ }, z.ZodTypeAny, "passthrough">>, "many">;
430
+ totalCount: z.ZodOptional<z.ZodNumber>;
431
+ _links: z.ZodOptional<z.ZodUnknown>;
432
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
433
+ items: z.ZodArray<z.ZodObject<{
434
+ _id: z.ZodString;
435
+ email: z.ZodString;
436
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
437
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
438
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
439
+ _id: z.ZodString;
440
+ email: z.ZodString;
441
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
442
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
443
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
444
+ _id: z.ZodString;
445
+ email: z.ZodString;
446
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
447
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
448
+ }, z.ZodTypeAny, "passthrough">>, "many">;
449
+ totalCount: z.ZodOptional<z.ZodNumber>;
450
+ _links: z.ZodOptional<z.ZodUnknown>;
451
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
452
+ items: z.ZodArray<z.ZodObject<{
453
+ _id: z.ZodString;
454
+ email: z.ZodString;
455
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
456
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
457
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
458
+ _id: z.ZodString;
459
+ email: z.ZodString;
460
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
461
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
462
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
463
+ _id: z.ZodString;
464
+ email: z.ZodString;
465
+ firstName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
466
+ lastName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
467
+ }, z.ZodTypeAny, "passthrough">>, "many">;
468
+ totalCount: z.ZodOptional<z.ZodNumber>;
469
+ _links: z.ZodOptional<z.ZodUnknown>;
470
+ }, z.ZodTypeAny, "passthrough">>;
471
+ export type MembersResponse = z.infer<typeof MembersResponseSchema>;
154
472
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/launch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AAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMtB,CAAA;AAEhB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAW3E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAIlB,CAAA;AAEhB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -5,6 +5,27 @@ const EnvironmentSchema = z.object({
5
5
  const FlagItemSchema = z.object({
6
6
  key: z.string(),
7
7
  archived: z.boolean(),
8
+ // `temporary` is LD's user-set flag-lifecycle marker:
9
+ // true → ephemeral feature toggle, expected to be removed someday
10
+ // false → permanent flag (kill switch, operational config, long-lived
11
+ // experiment that should never be cleaned up)
12
+ // We invert to `permanent` in the PlatformFlag mapping. Defaulted to
13
+ // true because LD's flag-creation UI defaults to "temporary"; existing
14
+ // flags that predate the field send true implicitly.
15
+ temporary: z.boolean().optional().default(true),
16
+ // Epoch milliseconds when the flag was first created in LD. Lets us
17
+ // compute platform-side age independently of code age; a flag that's
18
+ // 18 months old in LD AND still in code is a stronger stale signal
19
+ // than either alone. Field has been on LD's API since v2 was
20
+ // introduced, so it should be present on every flag.
21
+ creationDate: z.number().optional(),
22
+ // Free-form labels users apply in the LD UI (e.g. 'kill-switch',
23
+ // 'experiment', 'auth'). Surfaced in FlagShark output so a reviewer
24
+ // sees the LD-side classification next to the flag name.
25
+ tags: z.array(z.string()).optional().default([]),
26
+ // Opaque LD member ID of whoever owns the flag. Resolved to a human
27
+ // name+email via a separate /api/v2/members lookup.
28
+ maintainerId: z.string().optional(),
8
29
  environments: z.record(z.string(), EnvironmentSchema).optional(),
9
30
  }).passthrough();
10
31
  export const FlagsResponseSchema = z.object({
@@ -14,4 +35,65 @@ export const FlagsResponseSchema = z.object({
14
35
  next: z.object({ href: z.string() }).optional(),
15
36
  }).optional(),
16
37
  }).passthrough();
38
+ // ── Flag statuses (P2: LD's per-env staleness verdict) ──────────────────────
39
+ // LD's status values for a flag in a given environment:
40
+ // - 'new': created in the last 7 days; no evaluation events yet
41
+ // - 'active': serving evaluations as expected
42
+ // - 'inactive': no evaluation events in 7+ days (and not 'new')
43
+ // - 'launched': has been serving a single variation for the past 7 days,
44
+ // i.e. effectively rolled out
45
+ const FlagStatusItemSchema = z.object({
46
+ name: z.enum(['new', 'active', 'inactive', 'launched']),
47
+ // ISO timestamp string of the last evaluation event; null when none.
48
+ lastRequested: z.string().nullable(),
49
+ _links: z
50
+ .object({
51
+ // The parent link carries the flag key:
52
+ // /api/v2/flags/{project}/{flag-key}
53
+ parent: z.object({ href: z.string() }).optional(),
54
+ })
55
+ .optional(),
56
+ }).passthrough();
57
+ export const FlagStatusesResponseSchema = z.object({
58
+ items: z.array(FlagStatusItemSchema),
59
+ _links: z.unknown().optional(),
60
+ }).passthrough();
61
+ // ── Evaluations (real runtime evaluation counts per flag per env) ──────────
62
+ //
63
+ // Endpoint: GET /api/v2/usage/evaluations/{project}/{env}/{flagKey}
64
+ // Returns a time-series. Each series point has a `time` (epoch ms) and one
65
+ // numeric field per variation, KEYED BY VARIATION INDEX AS A STRING
66
+ // (e.g. "0": 1234, "1": 567). The number of keys depends on the flag's
67
+ // variation count (boolean = 2; multivariate = N).
68
+ //
69
+ // We don't care about the per-variation split for the staleness signal —
70
+ // we only need the TOTAL across all variations. The schema below
71
+ // passthrough()s the variation keys and we sum them at the call site.
72
+ const EvaluationSeriesPointSchema = z
73
+ .object({
74
+ // ISO 8601 timestamp string per LD docs; we parse but don't typecheck
75
+ // the format because LD has shipped it as both string and numeric in
76
+ // the past — passthrough() keeps us tolerant.
77
+ time: z.union([z.string(), z.number()]).optional(),
78
+ })
79
+ .passthrough();
80
+ export const EvaluationsResponseSchema = z
81
+ .object({
82
+ series: z.array(EvaluationSeriesPointSchema).optional().default([]),
83
+ metadata: z.array(z.unknown()).optional(),
84
+ _links: z.unknown().optional(),
85
+ })
86
+ .passthrough();
87
+ // ── Members (P3: maintainer name resolution) ────────────────────────────────
88
+ const MemberItemSchema = z.object({
89
+ _id: z.string(),
90
+ email: z.string(),
91
+ firstName: z.string().optional().default(''),
92
+ lastName: z.string().optional().default(''),
93
+ }).passthrough();
94
+ export const MembersResponseSchema = z.object({
95
+ items: z.array(MemberItemSchema),
96
+ totalCount: z.number().optional(),
97
+ _links: z.unknown().optional(),
98
+ }).passthrough();
17
99
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/providers/launchdarkly/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC,WAAW,EAAE,CAAA;AAEhB,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC,QAAQ,EAAE;CACjE,CAAC,CAAC,WAAW,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;KAChD,C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,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC,WAAW,EAAE,CAAA"}
@@ -10,15 +10,47 @@ export interface OrchestratePlatformsOptions {
10
10
  /** When true, skip cache for this run. */
11
11
  noCache?: boolean;
12
12
  signal?: AbortSignal;
13
+ /**
14
+ * Staleness threshold in days. Passed through to cross-reference so it
15
+ * can emit `platform-too-old` for flags whose platform-side creationDate
16
+ * exceeds the threshold. When omitted, the platform-too-old signal is
17
+ * never emitted.
18
+ */
19
+ thresholdDays?: number;
13
20
  /**
14
21
  * @internal — test seam. When set, used instead of platform.listFlags().
15
22
  * Allows tests to bypass network without monkey-patching globalThis.fetch.
16
23
  */
17
24
  listFlagsOverride?: (signal?: AbortSignal) => Promise<PlatformFlag[]>;
18
25
  }
26
+ /**
27
+ * Returned alongside platform signals: the names of flags excluded from
28
+ * staleness checks because a platform marked them permanent, indexed by
29
+ * the platform's displayName. Output formatters surface this directly
30
+ * so users see WHY a permanent flag isn't in the stale table.
31
+ */
32
+ export interface OrchestrateResult {
33
+ signals: Map<string, PlatformSignal[]>;
34
+ permanentByPlatform: Record<string, string[]>;
35
+ /**
36
+ * Per-flag platform-side metadata (tags, maintainer, status). Keyed
37
+ * by detected flag name. Populated only for flags that matched a
38
+ * platform integration AND the platform exposed the data. When
39
+ * multiple platforms report different metadata for the same flag,
40
+ * the LAST platform processed wins — the typical case is one
41
+ * platform per project anyway.
42
+ */
43
+ metadataByFlag: Map<string, {
44
+ tags?: string[];
45
+ maintainer?: string;
46
+ status?: 'new' | 'active' | 'inactive' | 'launched';
47
+ }>;
48
+ }
19
49
  /**
20
50
  * Runs each configured platform integration. Logs warnings on individual
21
- * platform failures and continues. Returns merged signals keyed by flag name.
51
+ * platform failures and continues. Returns merged signals keyed by flag name
52
+ * plus a per-platform record of flags marked permanent (suppressed from
53
+ * staleness; surfaced separately so users see what was excluded and why).
22
54
  */
23
- export declare function orchestratePlatforms(opts: OrchestratePlatformsOptions): Promise<Map<string, PlatformSignal[]>>;
55
+ export declare function orchestratePlatforms(opts: OrchestratePlatformsOptions): Promise<OrchestrateResult>;
24
56
  //# sourceMappingURL=orchestrate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../src/providers/orchestrate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,2BAA2B;IAC1C,iFAAiF;IACjF,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IACpD,4CAA4C;IAC5C,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAA;IACzC,MAAM,EAAE,UAAU,CAAA;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;CACtE;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,CAsCxC"}
1
+ {"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../src/providers/orchestrate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,2BAA2B;IAC1C,iFAAiF;IACjF,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IACpD,4CAA4C;IAC5C,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAA;IACzC,MAAM,EAAE,UAAU,CAAA;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;CACtE;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAA;IACtC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC7C;;;;;;;OAOG;IACH,cAAc,EAAE,GAAG,CACjB,MAAM,EACN;QAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAA;KAAE,CAC9F,CAAA;CACF;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,iBAAiB,CAAC,CA8F5B"}
@@ -3,12 +3,17 @@ import { crossReference, mergePlatformSignals } from './cross-reference.js';
3
3
  import { computeCacheKey, loadPlatformFlagsCached } from './cache.js';
4
4
  /**
5
5
  * Runs each configured platform integration. Logs warnings on individual
6
- * platform failures and continues. Returns merged signals keyed by flag name.
6
+ * platform failures and continues. Returns merged signals keyed by flag name
7
+ * plus a per-platform record of flags marked permanent (suppressed from
8
+ * staleness; surfaced separately so users see what was excluded and why).
7
9
  */
8
10
  export async function orchestratePlatforms(opts) {
9
11
  const out = new Map();
10
- if (!opts.platformsConfig)
11
- return out;
12
+ const permanentByPlatform = {};
13
+ const metadataByFlag = new Map();
14
+ if (!opts.platformsConfig) {
15
+ return { signals: out, permanentByPlatform, metadataByFlag };
16
+ }
12
17
  for (const [name, rawConfig] of Object.entries(opts.platformsConfig)) {
13
18
  const def = findPlatform(name);
14
19
  if (!def) {
@@ -21,7 +26,13 @@ export async function orchestratePlatforms(opts) {
21
26
  continue;
22
27
  }
23
28
  const tokenEnv = rawConfig.token_env ?? def.defaultTokenEnv;
24
- const token = process.env[tokenEnv];
29
+ // Trim whitespace before passing to the auth header. A common foot-gun:
30
+ // tokens copied from a UI or sourced via `.env`/`export` end up with a
31
+ // trailing newline or leading space, which fetch propagates verbatim
32
+ // into `Authorization:` and the platform rejects as 401. Trim once
33
+ // here so every platform's createClient sees a clean string.
34
+ const rawToken = process.env[tokenEnv];
35
+ const token = rawToken?.trim() ?? '';
25
36
  if (!token) {
26
37
  opts.logger.warn(`${def.displayName}: missing ${tokenEnv}; skipping platform integration`);
27
38
  continue;
@@ -32,13 +43,54 @@ export async function orchestratePlatforms(opts) {
32
43
  const flags = opts.listFlagsOverride
33
44
  ? await opts.listFlagsOverride(opts.signal)
34
45
  : await loadPlatformFlagsCached(client, cacheKey, { noCache: opts.noCache, signal: opts.signal });
35
- const signals = crossReference(opts.detectedFlags, flags, def.displayName);
46
+ const signals = crossReference(opts.detectedFlags, flags, def.displayName, {
47
+ thresholdDays: opts.thresholdDays,
48
+ });
36
49
  mergePlatformSignals(out, signals);
50
+ // Track which flags this platform marked permanent so output
51
+ // formatters can show 'N flag(s) excluded as permanent in
52
+ // <Platform>: a, b, c'. Read the signals MAP we just merged in
53
+ // (not `signals` directly — same content, but consistent source).
54
+ const platformPermanent = [];
55
+ for (const [flagName, sigList] of signals) {
56
+ if (sigList.some((s) => s.type === 'platform-permanent')) {
57
+ platformPermanent.push(flagName);
58
+ }
59
+ }
60
+ if (platformPermanent.length > 0) {
61
+ permanentByPlatform[def.displayName] = platformPermanent.sort();
62
+ }
63
+ // Surface platform-side metadata (tags, maintainer, activity
64
+ // status) for every detected flag that matched this platform.
65
+ // Output formatters consume this to enrich the per-row display
66
+ // without re-querying the platform.
67
+ for (const flag of flags) {
68
+ if (!opts.detectedFlags.has(flag.key))
69
+ continue;
70
+ const hasMetadata = (flag.tags && flag.tags.length > 0) || flag.maintainer || flag.status;
71
+ if (!hasMetadata)
72
+ continue;
73
+ metadataByFlag.set(flag.key, {
74
+ tags: flag.tags && flag.tags.length > 0 ? flag.tags : undefined,
75
+ maintainer: flag.maintainer,
76
+ status: flag.status,
77
+ });
78
+ }
37
79
  }
38
80
  catch (err) {
39
- opts.logger.warn(`${def.displayName}: ${err.message}. Continuing with code-only signals.`);
81
+ // 401/403 are by far the most common failure mode here and the cause
82
+ // is almost always confusable token shapes (SDK key vs. API access
83
+ // token, project-scoped token pointed at the wrong project, project
84
+ // KEY vs. project NAME in the YAML). Surface a hint inline so users
85
+ // don't have to guess.
86
+ const message = err.message;
87
+ const isAuthError = /\b(401|403|Unauthorized|Forbidden)\b/i.test(message);
88
+ const hint = isAuthError
89
+ ? ` (check token type — API access tokens, not SDK keys, and the project key matches a project the token can read)`
90
+ : '';
91
+ opts.logger.warn(`${def.displayName}: ${message}${hint}. Continuing with code-only signals.`);
40
92
  }
41
93
  }
42
- return out;
94
+ return { signals: out, permanentByPlatform, metadataByFlag };
43
95
  }
44
96
  //# sourceMappingURL=orchestrate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrate.js","sourceRoot":"","sources":["../../src/providers/orchestrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AA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