@contractspec/lib.feature-flags 1.57.0 → 1.59.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.
Files changed (53) hide show
  1. package/dist/browser/contracts/index.js +636 -0
  2. package/dist/browser/docs/feature-flags.docblock.js +71 -0
  3. package/dist/browser/docs/index.js +71 -0
  4. package/dist/browser/entities/index.js +306 -0
  5. package/dist/browser/evaluation/index.js +223 -0
  6. package/dist/browser/events.js +296 -0
  7. package/dist/browser/feature-flags.capability.js +28 -0
  8. package/dist/browser/feature-flags.feature.js +55 -0
  9. package/dist/browser/index.js +1583 -0
  10. package/dist/contracts/index.d.ts +944 -950
  11. package/dist/contracts/index.d.ts.map +1 -1
  12. package/dist/contracts/index.js +635 -906
  13. package/dist/docs/feature-flags.docblock.d.ts +2 -1
  14. package/dist/docs/feature-flags.docblock.d.ts.map +1 -0
  15. package/dist/docs/feature-flags.docblock.js +18 -22
  16. package/dist/docs/index.d.ts +2 -1
  17. package/dist/docs/index.d.ts.map +1 -0
  18. package/dist/docs/index.js +72 -1
  19. package/dist/entities/index.d.ts +159 -164
  20. package/dist/entities/index.d.ts.map +1 -1
  21. package/dist/entities/index.js +297 -315
  22. package/dist/evaluation/index.d.ts +119 -122
  23. package/dist/evaluation/index.d.ts.map +1 -1
  24. package/dist/evaluation/index.js +215 -212
  25. package/dist/events.d.ts +480 -486
  26. package/dist/events.d.ts.map +1 -1
  27. package/dist/events.js +272 -511
  28. package/dist/feature-flags.capability.d.ts +2 -7
  29. package/dist/feature-flags.capability.d.ts.map +1 -1
  30. package/dist/feature-flags.capability.js +29 -25
  31. package/dist/feature-flags.feature.d.ts +1 -6
  32. package/dist/feature-flags.feature.d.ts.map +1 -1
  33. package/dist/feature-flags.feature.js +54 -146
  34. package/dist/index.d.ts +7 -6
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +1584 -8
  37. package/dist/node/contracts/index.js +636 -0
  38. package/dist/node/docs/feature-flags.docblock.js +71 -0
  39. package/dist/node/docs/index.js +71 -0
  40. package/dist/node/entities/index.js +306 -0
  41. package/dist/node/evaluation/index.js +223 -0
  42. package/dist/node/events.js +296 -0
  43. package/dist/node/feature-flags.capability.js +28 -0
  44. package/dist/node/feature-flags.feature.js +55 -0
  45. package/dist/node/index.js +1583 -0
  46. package/package.json +117 -30
  47. package/dist/contracts/index.js.map +0 -1
  48. package/dist/docs/feature-flags.docblock.js.map +0 -1
  49. package/dist/entities/index.js.map +0 -1
  50. package/dist/evaluation/index.js.map +0 -1
  51. package/dist/events.js.map +0 -1
  52. package/dist/feature-flags.capability.js.map +0 -1
  53. package/dist/feature-flags.feature.js.map +0 -1
package/dist/events.d.ts CHANGED
@@ -1,625 +1,619 @@
1
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
3
-
4
- //#region src/events.d.ts
5
1
  /**
6
2
  * Emitted when a feature flag is created.
7
3
  */
8
- declare const FlagCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
9
- flagId: {
10
- type: _contractspec_lib_schema0.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- key: {
14
- type: _contractspec_lib_schema0.FieldType<string, string>;
15
- isOptional: false;
16
- };
17
- name: {
18
- type: _contractspec_lib_schema0.FieldType<string, string>;
19
- isOptional: false;
20
- };
21
- status: {
22
- type: _contractspec_lib_schema0.FieldType<string, string>;
23
- isOptional: false;
24
- };
25
- orgId: {
26
- type: _contractspec_lib_schema0.FieldType<string, string>;
27
- isOptional: true;
28
- };
29
- createdBy: {
30
- type: _contractspec_lib_schema0.FieldType<string, string>;
31
- isOptional: true;
32
- };
33
- createdAt: {
34
- type: _contractspec_lib_schema0.FieldType<Date, string>;
35
- isOptional: false;
36
- };
37
- }>>;
38
- /**
39
- * Emitted when a feature flag is updated.
40
- */
41
- declare const FlagUpdatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
42
- flagId: {
43
- type: _contractspec_lib_schema0.FieldType<string, string>;
44
- isOptional: false;
45
- };
46
- key: {
47
- type: _contractspec_lib_schema0.FieldType<string, string>;
48
- isOptional: false;
49
- };
50
- changes: {
51
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
52
- isOptional: false;
53
- };
54
- updatedBy: {
55
- type: _contractspec_lib_schema0.FieldType<string, string>;
56
- isOptional: true;
57
- };
58
- updatedAt: {
59
- type: _contractspec_lib_schema0.FieldType<Date, string>;
60
- isOptional: false;
61
- };
62
- }>>;
63
- /**
64
- * Emitted when a feature flag is deleted.
65
- */
66
- declare const FlagDeletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
67
- flagId: {
68
- type: _contractspec_lib_schema0.FieldType<string, string>;
69
- isOptional: false;
70
- };
71
- key: {
72
- type: _contractspec_lib_schema0.FieldType<string, string>;
73
- isOptional: false;
74
- };
75
- deletedBy: {
76
- type: _contractspec_lib_schema0.FieldType<string, string>;
77
- isOptional: true;
78
- };
79
- deletedAt: {
80
- type: _contractspec_lib_schema0.FieldType<Date, string>;
81
- isOptional: false;
82
- };
83
- }>>;
84
- /**
85
- * Emitted when a feature flag status is toggled.
86
- */
87
- declare const FlagToggledEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
88
- flagId: {
89
- type: _contractspec_lib_schema0.FieldType<string, string>;
90
- isOptional: false;
91
- };
92
- key: {
93
- type: _contractspec_lib_schema0.FieldType<string, string>;
94
- isOptional: false;
95
- };
96
- previousStatus: {
97
- type: _contractspec_lib_schema0.FieldType<string, string>;
98
- isOptional: false;
99
- };
100
- newStatus: {
101
- type: _contractspec_lib_schema0.FieldType<string, string>;
102
- isOptional: false;
103
- };
104
- toggledBy: {
105
- type: _contractspec_lib_schema0.FieldType<string, string>;
106
- isOptional: true;
107
- };
108
- toggledAt: {
109
- type: _contractspec_lib_schema0.FieldType<Date, string>;
110
- isOptional: false;
111
- };
112
- }>>;
113
- /**
114
- * Emitted when a targeting rule is created.
115
- */
116
- declare const RuleCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
117
- ruleId: {
118
- type: _contractspec_lib_schema0.FieldType<string, string>;
119
- isOptional: false;
120
- };
121
- flagId: {
122
- type: _contractspec_lib_schema0.FieldType<string, string>;
123
- isOptional: false;
124
- };
125
- flagKey: {
126
- type: _contractspec_lib_schema0.FieldType<string, string>;
127
- isOptional: false;
128
- };
129
- attribute: {
130
- type: _contractspec_lib_schema0.FieldType<string, string>;
131
- isOptional: false;
132
- };
133
- operator: {
134
- type: _contractspec_lib_schema0.FieldType<string, string>;
135
- isOptional: false;
136
- };
137
- createdAt: {
138
- type: _contractspec_lib_schema0.FieldType<Date, string>;
139
- isOptional: false;
140
- };
141
- }>>;
142
- /**
143
- * Emitted when a targeting rule is deleted.
144
- */
145
- declare const RuleDeletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
146
- ruleId: {
147
- type: _contractspec_lib_schema0.FieldType<string, string>;
148
- isOptional: false;
149
- };
150
- flagId: {
151
- type: _contractspec_lib_schema0.FieldType<string, string>;
152
- isOptional: false;
153
- };
154
- flagKey: {
155
- type: _contractspec_lib_schema0.FieldType<string, string>;
156
- isOptional: false;
157
- };
158
- deletedAt: {
159
- type: _contractspec_lib_schema0.FieldType<Date, string>;
160
- isOptional: false;
161
- };
162
- }>>;
163
- /**
164
- * Emitted when an experiment is created.
165
- */
166
- declare const ExperimentCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
167
- experimentId: {
168
- type: _contractspec_lib_schema0.FieldType<string, string>;
169
- isOptional: false;
170
- };
171
- key: {
172
- type: _contractspec_lib_schema0.FieldType<string, string>;
173
- isOptional: false;
174
- };
175
- name: {
176
- type: _contractspec_lib_schema0.FieldType<string, string>;
177
- isOptional: false;
178
- };
179
- flagId: {
180
- type: _contractspec_lib_schema0.FieldType<string, string>;
181
- isOptional: false;
182
- };
183
- variants: {
184
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
185
- isOptional: false;
186
- };
187
- createdBy: {
188
- type: _contractspec_lib_schema0.FieldType<string, string>;
189
- isOptional: true;
190
- };
191
- createdAt: {
192
- type: _contractspec_lib_schema0.FieldType<Date, string>;
193
- isOptional: false;
194
- };
195
- }>>;
196
- /**
197
- * Emitted when an experiment starts.
198
- */
199
- declare const ExperimentStartedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
200
- experimentId: {
201
- type: _contractspec_lib_schema0.FieldType<string, string>;
202
- isOptional: false;
203
- };
204
- key: {
205
- type: _contractspec_lib_schema0.FieldType<string, string>;
206
- isOptional: false;
207
- };
208
- flagId: {
209
- type: _contractspec_lib_schema0.FieldType<string, string>;
210
- isOptional: false;
211
- };
212
- variants: {
213
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
214
- isOptional: false;
215
- };
216
- audiencePercentage: {
217
- type: _contractspec_lib_schema0.FieldType<number, number>;
218
- isOptional: false;
219
- };
220
- startedBy: {
221
- type: _contractspec_lib_schema0.FieldType<string, string>;
222
- isOptional: true;
223
- };
224
- startedAt: {
225
- type: _contractspec_lib_schema0.FieldType<Date, string>;
226
- isOptional: false;
227
- };
228
- }>>;
229
- /**
230
- * Emitted when an experiment stops.
231
- */
232
- declare const ExperimentStoppedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
233
- experimentId: {
234
- type: _contractspec_lib_schema0.FieldType<string, string>;
235
- isOptional: false;
236
- };
237
- key: {
238
- type: _contractspec_lib_schema0.FieldType<string, string>;
239
- isOptional: false;
240
- };
241
- reason: {
242
- type: _contractspec_lib_schema0.FieldType<string, string>;
243
- isOptional: false;
244
- };
245
- winningVariant: {
246
- type: _contractspec_lib_schema0.FieldType<string, string>;
247
- isOptional: true;
248
- };
249
- stoppedBy: {
250
- type: _contractspec_lib_schema0.FieldType<string, string>;
251
- isOptional: true;
252
- };
253
- stoppedAt: {
254
- type: _contractspec_lib_schema0.FieldType<Date, string>;
255
- isOptional: false;
256
- };
257
- }>>;
258
- /**
259
- * Emitted when a flag is evaluated (for analytics).
260
- */
261
- declare const FlagEvaluatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
262
- flagId: {
263
- type: _contractspec_lib_schema0.FieldType<string, string>;
264
- isOptional: false;
265
- };
266
- flagKey: {
267
- type: _contractspec_lib_schema0.FieldType<string, string>;
268
- isOptional: false;
269
- };
270
- subjectType: {
271
- type: _contractspec_lib_schema0.FieldType<string, string>;
272
- isOptional: false;
273
- };
274
- subjectId: {
275
- type: _contractspec_lib_schema0.FieldType<string, string>;
276
- isOptional: false;
277
- };
278
- result: {
279
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
280
- isOptional: false;
281
- };
282
- variant: {
283
- type: _contractspec_lib_schema0.FieldType<string, string>;
284
- isOptional: true;
285
- };
286
- reason: {
287
- type: _contractspec_lib_schema0.FieldType<string, string>;
288
- isOptional: false;
289
- };
290
- evaluatedAt: {
291
- type: _contractspec_lib_schema0.FieldType<Date, string>;
292
- isOptional: false;
293
- };
294
- }>>;
295
- /**
296
- * Emitted when a subject is assigned to an experiment variant.
297
- */
298
- declare const VariantAssignedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
299
- experimentId: {
300
- type: _contractspec_lib_schema0.FieldType<string, string>;
301
- isOptional: false;
302
- };
303
- experimentKey: {
304
- type: _contractspec_lib_schema0.FieldType<string, string>;
305
- isOptional: false;
306
- };
307
- subjectType: {
308
- type: _contractspec_lib_schema0.FieldType<string, string>;
309
- isOptional: false;
310
- };
311
- subjectId: {
312
- type: _contractspec_lib_schema0.FieldType<string, string>;
313
- isOptional: false;
314
- };
315
- variant: {
316
- type: _contractspec_lib_schema0.FieldType<string, string>;
317
- isOptional: false;
318
- };
319
- bucket: {
320
- type: _contractspec_lib_schema0.FieldType<number, number>;
321
- isOptional: false;
322
- };
323
- assignedAt: {
324
- type: _contractspec_lib_schema0.FieldType<Date, string>;
325
- isOptional: false;
326
- };
327
- }>>;
328
- /**
329
- * All feature flag events.
330
- */
331
- declare const FeatureFlagEvents: {
332
- FlagCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
4
+ export declare const FlagCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
333
5
  flagId: {
334
- type: _contractspec_lib_schema0.FieldType<string, string>;
335
- isOptional: false;
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
336
8
  };
337
9
  key: {
338
- type: _contractspec_lib_schema0.FieldType<string, string>;
339
- isOptional: false;
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
340
12
  };
341
13
  name: {
342
- type: _contractspec_lib_schema0.FieldType<string, string>;
343
- isOptional: false;
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: false;
344
16
  };
345
17
  status: {
346
- type: _contractspec_lib_schema0.FieldType<string, string>;
347
- isOptional: false;
18
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
19
+ isOptional: false;
348
20
  };
349
21
  orgId: {
350
- type: _contractspec_lib_schema0.FieldType<string, string>;
351
- isOptional: true;
22
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
23
+ isOptional: true;
352
24
  };
353
25
  createdBy: {
354
- type: _contractspec_lib_schema0.FieldType<string, string>;
355
- isOptional: true;
26
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
27
+ isOptional: true;
356
28
  };
357
29
  createdAt: {
358
- type: _contractspec_lib_schema0.FieldType<Date, string>;
359
- isOptional: false;
30
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
31
+ isOptional: false;
360
32
  };
361
- }>>;
362
- FlagUpdatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
33
+ }>>;
34
+ /**
35
+ * Emitted when a feature flag is updated.
36
+ */
37
+ export declare const FlagUpdatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
363
38
  flagId: {
364
- type: _contractspec_lib_schema0.FieldType<string, string>;
365
- isOptional: false;
39
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
40
+ isOptional: false;
366
41
  };
367
42
  key: {
368
- type: _contractspec_lib_schema0.FieldType<string, string>;
369
- isOptional: false;
43
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
44
+ isOptional: false;
370
45
  };
371
46
  changes: {
372
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
373
- isOptional: false;
47
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
48
+ isOptional: false;
374
49
  };
375
50
  updatedBy: {
376
- type: _contractspec_lib_schema0.FieldType<string, string>;
377
- isOptional: true;
51
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
52
+ isOptional: true;
378
53
  };
379
54
  updatedAt: {
380
- type: _contractspec_lib_schema0.FieldType<Date, string>;
381
- isOptional: false;
55
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
56
+ isOptional: false;
382
57
  };
383
- }>>;
384
- FlagDeletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
58
+ }>>;
59
+ /**
60
+ * Emitted when a feature flag is deleted.
61
+ */
62
+ export declare const FlagDeletedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
385
63
  flagId: {
386
- type: _contractspec_lib_schema0.FieldType<string, string>;
387
- isOptional: false;
64
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
65
+ isOptional: false;
388
66
  };
389
67
  key: {
390
- type: _contractspec_lib_schema0.FieldType<string, string>;
391
- isOptional: false;
68
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
69
+ isOptional: false;
392
70
  };
393
71
  deletedBy: {
394
- type: _contractspec_lib_schema0.FieldType<string, string>;
395
- isOptional: true;
72
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
73
+ isOptional: true;
396
74
  };
397
75
  deletedAt: {
398
- type: _contractspec_lib_schema0.FieldType<Date, string>;
399
- isOptional: false;
76
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
77
+ isOptional: false;
400
78
  };
401
- }>>;
402
- FlagToggledEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
79
+ }>>;
80
+ /**
81
+ * Emitted when a feature flag status is toggled.
82
+ */
83
+ export declare const FlagToggledEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
403
84
  flagId: {
404
- type: _contractspec_lib_schema0.FieldType<string, string>;
405
- isOptional: false;
85
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
86
+ isOptional: false;
406
87
  };
407
88
  key: {
408
- type: _contractspec_lib_schema0.FieldType<string, string>;
409
- isOptional: false;
89
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
90
+ isOptional: false;
410
91
  };
411
92
  previousStatus: {
412
- type: _contractspec_lib_schema0.FieldType<string, string>;
413
- isOptional: false;
93
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
94
+ isOptional: false;
414
95
  };
415
96
  newStatus: {
416
- type: _contractspec_lib_schema0.FieldType<string, string>;
417
- isOptional: false;
97
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
98
+ isOptional: false;
418
99
  };
419
100
  toggledBy: {
420
- type: _contractspec_lib_schema0.FieldType<string, string>;
421
- isOptional: true;
101
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
102
+ isOptional: true;
422
103
  };
423
104
  toggledAt: {
424
- type: _contractspec_lib_schema0.FieldType<Date, string>;
425
- isOptional: false;
105
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
106
+ isOptional: false;
426
107
  };
427
- }>>;
428
- RuleCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
108
+ }>>;
109
+ /**
110
+ * Emitted when a targeting rule is created.
111
+ */
112
+ export declare const RuleCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
429
113
  ruleId: {
430
- type: _contractspec_lib_schema0.FieldType<string, string>;
431
- isOptional: false;
114
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
115
+ isOptional: false;
432
116
  };
433
117
  flagId: {
434
- type: _contractspec_lib_schema0.FieldType<string, string>;
435
- isOptional: false;
118
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
119
+ isOptional: false;
436
120
  };
437
121
  flagKey: {
438
- type: _contractspec_lib_schema0.FieldType<string, string>;
439
- isOptional: false;
122
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
123
+ isOptional: false;
440
124
  };
441
125
  attribute: {
442
- type: _contractspec_lib_schema0.FieldType<string, string>;
443
- isOptional: false;
126
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
127
+ isOptional: false;
444
128
  };
445
129
  operator: {
446
- type: _contractspec_lib_schema0.FieldType<string, string>;
447
- isOptional: false;
130
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
131
+ isOptional: false;
448
132
  };
449
133
  createdAt: {
450
- type: _contractspec_lib_schema0.FieldType<Date, string>;
451
- isOptional: false;
134
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
135
+ isOptional: false;
452
136
  };
453
- }>>;
454
- RuleDeletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
137
+ }>>;
138
+ /**
139
+ * Emitted when a targeting rule is deleted.
140
+ */
141
+ export declare const RuleDeletedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
455
142
  ruleId: {
456
- type: _contractspec_lib_schema0.FieldType<string, string>;
457
- isOptional: false;
143
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
144
+ isOptional: false;
458
145
  };
459
146
  flagId: {
460
- type: _contractspec_lib_schema0.FieldType<string, string>;
461
- isOptional: false;
147
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
148
+ isOptional: false;
462
149
  };
463
150
  flagKey: {
464
- type: _contractspec_lib_schema0.FieldType<string, string>;
465
- isOptional: false;
151
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
152
+ isOptional: false;
466
153
  };
467
154
  deletedAt: {
468
- type: _contractspec_lib_schema0.FieldType<Date, string>;
469
- isOptional: false;
155
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
156
+ isOptional: false;
470
157
  };
471
- }>>;
472
- ExperimentCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
158
+ }>>;
159
+ /**
160
+ * Emitted when an experiment is created.
161
+ */
162
+ export declare const ExperimentCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
473
163
  experimentId: {
474
- type: _contractspec_lib_schema0.FieldType<string, string>;
475
- isOptional: false;
164
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
165
+ isOptional: false;
476
166
  };
477
167
  key: {
478
- type: _contractspec_lib_schema0.FieldType<string, string>;
479
- isOptional: false;
168
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
169
+ isOptional: false;
480
170
  };
481
171
  name: {
482
- type: _contractspec_lib_schema0.FieldType<string, string>;
483
- isOptional: false;
172
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
173
+ isOptional: false;
484
174
  };
485
175
  flagId: {
486
- type: _contractspec_lib_schema0.FieldType<string, string>;
487
- isOptional: false;
176
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
177
+ isOptional: false;
488
178
  };
489
179
  variants: {
490
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
491
- isOptional: false;
180
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
181
+ isOptional: false;
492
182
  };
493
183
  createdBy: {
494
- type: _contractspec_lib_schema0.FieldType<string, string>;
495
- isOptional: true;
184
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
185
+ isOptional: true;
496
186
  };
497
187
  createdAt: {
498
- type: _contractspec_lib_schema0.FieldType<Date, string>;
499
- isOptional: false;
188
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
189
+ isOptional: false;
500
190
  };
501
- }>>;
502
- ExperimentStartedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
191
+ }>>;
192
+ /**
193
+ * Emitted when an experiment starts.
194
+ */
195
+ export declare const ExperimentStartedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
503
196
  experimentId: {
504
- type: _contractspec_lib_schema0.FieldType<string, string>;
505
- isOptional: false;
197
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
198
+ isOptional: false;
506
199
  };
507
200
  key: {
508
- type: _contractspec_lib_schema0.FieldType<string, string>;
509
- isOptional: false;
201
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
202
+ isOptional: false;
510
203
  };
511
204
  flagId: {
512
- type: _contractspec_lib_schema0.FieldType<string, string>;
513
- isOptional: false;
205
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
206
+ isOptional: false;
514
207
  };
515
208
  variants: {
516
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
517
- isOptional: false;
209
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
210
+ isOptional: false;
518
211
  };
519
212
  audiencePercentage: {
520
- type: _contractspec_lib_schema0.FieldType<number, number>;
521
- isOptional: false;
213
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
214
+ isOptional: false;
522
215
  };
523
216
  startedBy: {
524
- type: _contractspec_lib_schema0.FieldType<string, string>;
525
- isOptional: true;
217
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
218
+ isOptional: true;
526
219
  };
527
220
  startedAt: {
528
- type: _contractspec_lib_schema0.FieldType<Date, string>;
529
- isOptional: false;
221
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
222
+ isOptional: false;
530
223
  };
531
- }>>;
532
- ExperimentStoppedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
224
+ }>>;
225
+ /**
226
+ * Emitted when an experiment stops.
227
+ */
228
+ export declare const ExperimentStoppedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
533
229
  experimentId: {
534
- type: _contractspec_lib_schema0.FieldType<string, string>;
535
- isOptional: false;
230
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
231
+ isOptional: false;
536
232
  };
537
233
  key: {
538
- type: _contractspec_lib_schema0.FieldType<string, string>;
539
- isOptional: false;
234
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
235
+ isOptional: false;
540
236
  };
541
237
  reason: {
542
- type: _contractspec_lib_schema0.FieldType<string, string>;
543
- isOptional: false;
238
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
239
+ isOptional: false;
544
240
  };
545
241
  winningVariant: {
546
- type: _contractspec_lib_schema0.FieldType<string, string>;
547
- isOptional: true;
242
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
243
+ isOptional: true;
548
244
  };
549
245
  stoppedBy: {
550
- type: _contractspec_lib_schema0.FieldType<string, string>;
551
- isOptional: true;
246
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
247
+ isOptional: true;
552
248
  };
553
249
  stoppedAt: {
554
- type: _contractspec_lib_schema0.FieldType<Date, string>;
555
- isOptional: false;
250
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
251
+ isOptional: false;
556
252
  };
557
- }>>;
558
- FlagEvaluatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
253
+ }>>;
254
+ /**
255
+ * Emitted when a flag is evaluated (for analytics).
256
+ */
257
+ export declare const FlagEvaluatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
559
258
  flagId: {
560
- type: _contractspec_lib_schema0.FieldType<string, string>;
561
- isOptional: false;
259
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
260
+ isOptional: false;
562
261
  };
563
262
  flagKey: {
564
- type: _contractspec_lib_schema0.FieldType<string, string>;
565
- isOptional: false;
263
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
264
+ isOptional: false;
566
265
  };
567
266
  subjectType: {
568
- type: _contractspec_lib_schema0.FieldType<string, string>;
569
- isOptional: false;
267
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
268
+ isOptional: false;
570
269
  };
571
270
  subjectId: {
572
- type: _contractspec_lib_schema0.FieldType<string, string>;
573
- isOptional: false;
271
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
272
+ isOptional: false;
574
273
  };
575
274
  result: {
576
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
577
- isOptional: false;
275
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
276
+ isOptional: false;
578
277
  };
579
278
  variant: {
580
- type: _contractspec_lib_schema0.FieldType<string, string>;
581
- isOptional: true;
279
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
280
+ isOptional: true;
582
281
  };
583
282
  reason: {
584
- type: _contractspec_lib_schema0.FieldType<string, string>;
585
- isOptional: false;
283
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
284
+ isOptional: false;
586
285
  };
587
286
  evaluatedAt: {
588
- type: _contractspec_lib_schema0.FieldType<Date, string>;
589
- isOptional: false;
287
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
288
+ isOptional: false;
590
289
  };
591
- }>>;
592
- VariantAssignedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
290
+ }>>;
291
+ /**
292
+ * Emitted when a subject is assigned to an experiment variant.
293
+ */
294
+ export declare const VariantAssignedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
593
295
  experimentId: {
594
- type: _contractspec_lib_schema0.FieldType<string, string>;
595
- isOptional: false;
296
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
297
+ isOptional: false;
596
298
  };
597
299
  experimentKey: {
598
- type: _contractspec_lib_schema0.FieldType<string, string>;
599
- isOptional: false;
300
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
301
+ isOptional: false;
600
302
  };
601
303
  subjectType: {
602
- type: _contractspec_lib_schema0.FieldType<string, string>;
603
- isOptional: false;
304
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
305
+ isOptional: false;
604
306
  };
605
307
  subjectId: {
606
- type: _contractspec_lib_schema0.FieldType<string, string>;
607
- isOptional: false;
308
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
309
+ isOptional: false;
608
310
  };
609
311
  variant: {
610
- type: _contractspec_lib_schema0.FieldType<string, string>;
611
- isOptional: false;
312
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
313
+ isOptional: false;
612
314
  };
613
315
  bucket: {
614
- type: _contractspec_lib_schema0.FieldType<number, number>;
615
- isOptional: false;
316
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
317
+ isOptional: false;
616
318
  };
617
319
  assignedAt: {
618
- type: _contractspec_lib_schema0.FieldType<Date, string>;
619
- isOptional: false;
320
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
321
+ isOptional: false;
620
322
  };
621
- }>>;
323
+ }>>;
324
+ /**
325
+ * All feature flag events.
326
+ */
327
+ export declare const FeatureFlagEvents: {
328
+ FlagCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
329
+ flagId: {
330
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
331
+ isOptional: false;
332
+ };
333
+ key: {
334
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
335
+ isOptional: false;
336
+ };
337
+ name: {
338
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
339
+ isOptional: false;
340
+ };
341
+ status: {
342
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
343
+ isOptional: false;
344
+ };
345
+ orgId: {
346
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
347
+ isOptional: true;
348
+ };
349
+ createdBy: {
350
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
351
+ isOptional: true;
352
+ };
353
+ createdAt: {
354
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
355
+ isOptional: false;
356
+ };
357
+ }>>;
358
+ FlagUpdatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
359
+ flagId: {
360
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
361
+ isOptional: false;
362
+ };
363
+ key: {
364
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
365
+ isOptional: false;
366
+ };
367
+ changes: {
368
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
369
+ isOptional: false;
370
+ };
371
+ updatedBy: {
372
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
373
+ isOptional: true;
374
+ };
375
+ updatedAt: {
376
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
377
+ isOptional: false;
378
+ };
379
+ }>>;
380
+ FlagDeletedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
381
+ flagId: {
382
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
383
+ isOptional: false;
384
+ };
385
+ key: {
386
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
387
+ isOptional: false;
388
+ };
389
+ deletedBy: {
390
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
391
+ isOptional: true;
392
+ };
393
+ deletedAt: {
394
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
395
+ isOptional: false;
396
+ };
397
+ }>>;
398
+ FlagToggledEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
399
+ flagId: {
400
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
401
+ isOptional: false;
402
+ };
403
+ key: {
404
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
405
+ isOptional: false;
406
+ };
407
+ previousStatus: {
408
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
409
+ isOptional: false;
410
+ };
411
+ newStatus: {
412
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
413
+ isOptional: false;
414
+ };
415
+ toggledBy: {
416
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
417
+ isOptional: true;
418
+ };
419
+ toggledAt: {
420
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
421
+ isOptional: false;
422
+ };
423
+ }>>;
424
+ RuleCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
425
+ ruleId: {
426
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
427
+ isOptional: false;
428
+ };
429
+ flagId: {
430
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
431
+ isOptional: false;
432
+ };
433
+ flagKey: {
434
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
435
+ isOptional: false;
436
+ };
437
+ attribute: {
438
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
439
+ isOptional: false;
440
+ };
441
+ operator: {
442
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
443
+ isOptional: false;
444
+ };
445
+ createdAt: {
446
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
447
+ isOptional: false;
448
+ };
449
+ }>>;
450
+ RuleDeletedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
451
+ ruleId: {
452
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
453
+ isOptional: false;
454
+ };
455
+ flagId: {
456
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
457
+ isOptional: false;
458
+ };
459
+ flagKey: {
460
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
461
+ isOptional: false;
462
+ };
463
+ deletedAt: {
464
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
465
+ isOptional: false;
466
+ };
467
+ }>>;
468
+ ExperimentCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
469
+ experimentId: {
470
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
471
+ isOptional: false;
472
+ };
473
+ key: {
474
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
475
+ isOptional: false;
476
+ };
477
+ name: {
478
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
479
+ isOptional: false;
480
+ };
481
+ flagId: {
482
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
483
+ isOptional: false;
484
+ };
485
+ variants: {
486
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
487
+ isOptional: false;
488
+ };
489
+ createdBy: {
490
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
491
+ isOptional: true;
492
+ };
493
+ createdAt: {
494
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
495
+ isOptional: false;
496
+ };
497
+ }>>;
498
+ ExperimentStartedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
499
+ experimentId: {
500
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
501
+ isOptional: false;
502
+ };
503
+ key: {
504
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
505
+ isOptional: false;
506
+ };
507
+ flagId: {
508
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
509
+ isOptional: false;
510
+ };
511
+ variants: {
512
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
513
+ isOptional: false;
514
+ };
515
+ audiencePercentage: {
516
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
517
+ isOptional: false;
518
+ };
519
+ startedBy: {
520
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
521
+ isOptional: true;
522
+ };
523
+ startedAt: {
524
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
525
+ isOptional: false;
526
+ };
527
+ }>>;
528
+ ExperimentStoppedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
529
+ experimentId: {
530
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
531
+ isOptional: false;
532
+ };
533
+ key: {
534
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
535
+ isOptional: false;
536
+ };
537
+ reason: {
538
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
539
+ isOptional: false;
540
+ };
541
+ winningVariant: {
542
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
543
+ isOptional: true;
544
+ };
545
+ stoppedBy: {
546
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
547
+ isOptional: true;
548
+ };
549
+ stoppedAt: {
550
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
551
+ isOptional: false;
552
+ };
553
+ }>>;
554
+ FlagEvaluatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
555
+ flagId: {
556
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
557
+ isOptional: false;
558
+ };
559
+ flagKey: {
560
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
561
+ isOptional: false;
562
+ };
563
+ subjectType: {
564
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
565
+ isOptional: false;
566
+ };
567
+ subjectId: {
568
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
569
+ isOptional: false;
570
+ };
571
+ result: {
572
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
573
+ isOptional: false;
574
+ };
575
+ variant: {
576
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
577
+ isOptional: true;
578
+ };
579
+ reason: {
580
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
581
+ isOptional: false;
582
+ };
583
+ evaluatedAt: {
584
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
585
+ isOptional: false;
586
+ };
587
+ }>>;
588
+ VariantAssignedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
589
+ experimentId: {
590
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
591
+ isOptional: false;
592
+ };
593
+ experimentKey: {
594
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
595
+ isOptional: false;
596
+ };
597
+ subjectType: {
598
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
599
+ isOptional: false;
600
+ };
601
+ subjectId: {
602
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
603
+ isOptional: false;
604
+ };
605
+ variant: {
606
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
607
+ isOptional: false;
608
+ };
609
+ bucket: {
610
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
611
+ isOptional: false;
612
+ };
613
+ assignedAt: {
614
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
615
+ isOptional: false;
616
+ };
617
+ }>>;
622
618
  };
623
- //#endregion
624
- export { ExperimentCreatedEvent, ExperimentStartedEvent, ExperimentStoppedEvent, FeatureFlagEvents, FlagCreatedEvent, FlagDeletedEvent, FlagEvaluatedEvent, FlagToggledEvent, FlagUpdatedEvent, RuleCreatedEvent, RuleDeletedEvent, VariantAssignedEvent };
625
619
  //# sourceMappingURL=events.d.ts.map