@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.
- package/dist/browser/contracts/index.js +636 -0
- package/dist/browser/docs/feature-flags.docblock.js +71 -0
- package/dist/browser/docs/index.js +71 -0
- package/dist/browser/entities/index.js +306 -0
- package/dist/browser/evaluation/index.js +223 -0
- package/dist/browser/events.js +296 -0
- package/dist/browser/feature-flags.capability.js +28 -0
- package/dist/browser/feature-flags.feature.js +55 -0
- package/dist/browser/index.js +1583 -0
- package/dist/contracts/index.d.ts +944 -950
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +635 -906
- package/dist/docs/feature-flags.docblock.d.ts +2 -1
- package/dist/docs/feature-flags.docblock.d.ts.map +1 -0
- package/dist/docs/feature-flags.docblock.js +18 -22
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +72 -1
- package/dist/entities/index.d.ts +159 -164
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +297 -315
- package/dist/evaluation/index.d.ts +119 -122
- package/dist/evaluation/index.d.ts.map +1 -1
- package/dist/evaluation/index.js +215 -212
- package/dist/events.d.ts +480 -486
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +272 -511
- package/dist/feature-flags.capability.d.ts +2 -7
- package/dist/feature-flags.capability.d.ts.map +1 -1
- package/dist/feature-flags.capability.js +29 -25
- package/dist/feature-flags.feature.d.ts +1 -6
- package/dist/feature-flags.feature.d.ts.map +1 -1
- package/dist/feature-flags.feature.js +54 -146
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1584 -8
- package/dist/node/contracts/index.js +636 -0
- package/dist/node/docs/feature-flags.docblock.js +71 -0
- package/dist/node/docs/index.js +71 -0
- package/dist/node/entities/index.js +306 -0
- package/dist/node/evaluation/index.js +223 -0
- package/dist/node/events.js +296 -0
- package/dist/node/feature-flags.capability.js +28 -0
- package/dist/node/feature-flags.feature.js +55 -0
- package/dist/node/index.js +1583 -0
- package/package.json +117 -30
- package/dist/contracts/index.js.map +0 -1
- package/dist/docs/feature-flags.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/evaluation/index.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/feature-flags.capability.js.map +0 -1
- package/dist/feature-flags.feature.js.map +0 -1
package/dist/entities/index.js
CHANGED
|
@@ -1,325 +1,307 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
schema: "lssm_feature_flags",
|
|
15
|
-
description: "Status of a feature flag."
|
|
1
|
+
// @bun
|
|
2
|
+
// src/entities/index.ts
|
|
3
|
+
import {
|
|
4
|
+
defineEntity,
|
|
5
|
+
defineEntityEnum,
|
|
6
|
+
field,
|
|
7
|
+
index
|
|
8
|
+
} from "@contractspec/lib.schema";
|
|
9
|
+
var FlagStatusEnum = defineEntityEnum({
|
|
10
|
+
name: "FlagStatus",
|
|
11
|
+
values: ["OFF", "ON", "GRADUAL"],
|
|
12
|
+
schema: "lssm_feature_flags",
|
|
13
|
+
description: "Status of a feature flag."
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
],
|
|
35
|
-
schema: "lssm_feature_flags",
|
|
36
|
-
description: "Operator for targeting rule conditions."
|
|
15
|
+
var RuleOperatorEnum = defineEntityEnum({
|
|
16
|
+
name: "RuleOperator",
|
|
17
|
+
values: [
|
|
18
|
+
"EQ",
|
|
19
|
+
"NEQ",
|
|
20
|
+
"IN",
|
|
21
|
+
"NIN",
|
|
22
|
+
"CONTAINS",
|
|
23
|
+
"NOT_CONTAINS",
|
|
24
|
+
"GT",
|
|
25
|
+
"GTE",
|
|
26
|
+
"LT",
|
|
27
|
+
"LTE",
|
|
28
|
+
"PERCENTAGE"
|
|
29
|
+
],
|
|
30
|
+
schema: "lssm_feature_flags",
|
|
31
|
+
description: "Operator for targeting rule conditions."
|
|
37
32
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
values: [
|
|
44
|
-
"DRAFT",
|
|
45
|
-
"RUNNING",
|
|
46
|
-
"PAUSED",
|
|
47
|
-
"COMPLETED",
|
|
48
|
-
"CANCELLED"
|
|
49
|
-
],
|
|
50
|
-
schema: "lssm_feature_flags",
|
|
51
|
-
description: "Status of an experiment."
|
|
33
|
+
var ExperimentStatusEnum = defineEntityEnum({
|
|
34
|
+
name: "ExperimentStatus",
|
|
35
|
+
values: ["DRAFT", "RUNNING", "PAUSED", "COMPLETED", "CANCELLED"],
|
|
36
|
+
schema: "lssm_feature_flags",
|
|
37
|
+
description: "Status of an experiment."
|
|
52
38
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
indexes: [index.on(["orgId", "key"]), index.on(["status"])],
|
|
103
|
-
enums: [FlagStatusEnum]
|
|
39
|
+
var FeatureFlagEntity = defineEntity({
|
|
40
|
+
name: "FeatureFlag",
|
|
41
|
+
description: "A feature flag for controlling feature availability.",
|
|
42
|
+
schema: "lssm_feature_flags",
|
|
43
|
+
map: "feature_flag",
|
|
44
|
+
fields: {
|
|
45
|
+
id: field.id({ description: "Unique flag identifier" }),
|
|
46
|
+
key: field.string({
|
|
47
|
+
isUnique: true,
|
|
48
|
+
description: "Flag key (e.g., new_dashboard)"
|
|
49
|
+
}),
|
|
50
|
+
name: field.string({ description: "Human-readable name" }),
|
|
51
|
+
description: field.string({
|
|
52
|
+
isOptional: true,
|
|
53
|
+
description: "Description of the flag"
|
|
54
|
+
}),
|
|
55
|
+
status: field.enum("FlagStatus", {
|
|
56
|
+
default: "OFF",
|
|
57
|
+
description: "Flag status"
|
|
58
|
+
}),
|
|
59
|
+
defaultValue: field.boolean({
|
|
60
|
+
default: false,
|
|
61
|
+
description: "Default value when no rules match"
|
|
62
|
+
}),
|
|
63
|
+
variants: field.json({
|
|
64
|
+
isOptional: true,
|
|
65
|
+
description: "Variant definitions for multivariate flags"
|
|
66
|
+
}),
|
|
67
|
+
orgId: field.string({
|
|
68
|
+
isOptional: true,
|
|
69
|
+
description: "Organization scope (null = global)"
|
|
70
|
+
}),
|
|
71
|
+
tags: field.json({
|
|
72
|
+
isOptional: true,
|
|
73
|
+
description: "Tags for categorization"
|
|
74
|
+
}),
|
|
75
|
+
metadata: field.json({
|
|
76
|
+
isOptional: true,
|
|
77
|
+
description: "Additional metadata"
|
|
78
|
+
}),
|
|
79
|
+
createdAt: field.createdAt(),
|
|
80
|
+
updatedAt: field.updatedAt(),
|
|
81
|
+
targetingRules: field.hasMany("FlagTargetingRule"),
|
|
82
|
+
experiments: field.hasMany("Experiment"),
|
|
83
|
+
evaluations: field.hasMany("FlagEvaluation")
|
|
84
|
+
},
|
|
85
|
+
indexes: [index.on(["orgId", "key"]), index.on(["status"])],
|
|
86
|
+
enums: [FlagStatusEnum]
|
|
104
87
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
88
|
+
var FlagTargetingRuleEntity = defineEntity({
|
|
89
|
+
name: "FlagTargetingRule",
|
|
90
|
+
description: "A targeting rule for conditional flag evaluation.",
|
|
91
|
+
schema: "lssm_feature_flags",
|
|
92
|
+
map: "flag_targeting_rule",
|
|
93
|
+
fields: {
|
|
94
|
+
id: field.id({ description: "Unique rule identifier" }),
|
|
95
|
+
flagId: field.foreignKey({ description: "Parent feature flag" }),
|
|
96
|
+
name: field.string({
|
|
97
|
+
isOptional: true,
|
|
98
|
+
description: "Rule name for debugging"
|
|
99
|
+
}),
|
|
100
|
+
priority: field.int({
|
|
101
|
+
default: 0,
|
|
102
|
+
description: "Rule priority (lower = higher priority)"
|
|
103
|
+
}),
|
|
104
|
+
enabled: field.boolean({
|
|
105
|
+
default: true,
|
|
106
|
+
description: "Whether rule is active"
|
|
107
|
+
}),
|
|
108
|
+
attribute: field.string({
|
|
109
|
+
description: "Target attribute (userId, orgId, plan, segment, etc.)"
|
|
110
|
+
}),
|
|
111
|
+
operator: field.enum("RuleOperator", {
|
|
112
|
+
description: "Comparison operator"
|
|
113
|
+
}),
|
|
114
|
+
value: field.json({ description: "Target value(s)" }),
|
|
115
|
+
rolloutPercentage: field.int({
|
|
116
|
+
isOptional: true,
|
|
117
|
+
description: "Percentage for gradual rollout (0-100)"
|
|
118
|
+
}),
|
|
119
|
+
serveValue: field.boolean({
|
|
120
|
+
isOptional: true,
|
|
121
|
+
description: "Boolean value to serve"
|
|
122
|
+
}),
|
|
123
|
+
serveVariant: field.string({
|
|
124
|
+
isOptional: true,
|
|
125
|
+
description: "Variant key to serve (for multivariate)"
|
|
126
|
+
}),
|
|
127
|
+
createdAt: field.createdAt(),
|
|
128
|
+
updatedAt: field.updatedAt(),
|
|
129
|
+
flag: field.belongsTo("FeatureFlag", ["flagId"], ["id"], {
|
|
130
|
+
onDelete: "Cascade"
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
indexes: [index.on(["flagId", "priority"]), index.on(["attribute"])],
|
|
134
|
+
enums: [RuleOperatorEnum]
|
|
149
135
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
index.on(["status"]),
|
|
226
|
-
index.on(["orgId", "status"]),
|
|
227
|
-
index.on(["flagId"])
|
|
228
|
-
],
|
|
229
|
-
enums: [ExperimentStatusEnum]
|
|
136
|
+
var ExperimentEntity = defineEntity({
|
|
137
|
+
name: "Experiment",
|
|
138
|
+
description: "An A/B test experiment.",
|
|
139
|
+
schema: "lssm_feature_flags",
|
|
140
|
+
map: "experiment",
|
|
141
|
+
fields: {
|
|
142
|
+
id: field.id({ description: "Unique experiment identifier" }),
|
|
143
|
+
key: field.string({ isUnique: true, description: "Experiment key" }),
|
|
144
|
+
name: field.string({ description: "Human-readable name" }),
|
|
145
|
+
description: field.string({
|
|
146
|
+
isOptional: true,
|
|
147
|
+
description: "Experiment description"
|
|
148
|
+
}),
|
|
149
|
+
hypothesis: field.string({
|
|
150
|
+
isOptional: true,
|
|
151
|
+
description: "Experiment hypothesis"
|
|
152
|
+
}),
|
|
153
|
+
flagId: field.foreignKey({ description: "Associated feature flag" }),
|
|
154
|
+
status: field.enum("ExperimentStatus", {
|
|
155
|
+
default: "DRAFT",
|
|
156
|
+
description: "Experiment status"
|
|
157
|
+
}),
|
|
158
|
+
variants: field.json({
|
|
159
|
+
description: "Variant definitions with split ratios"
|
|
160
|
+
}),
|
|
161
|
+
metrics: field.json({ isOptional: true, description: "Metrics to track" }),
|
|
162
|
+
audiencePercentage: field.int({
|
|
163
|
+
default: 100,
|
|
164
|
+
description: "Percentage of audience to include"
|
|
165
|
+
}),
|
|
166
|
+
audienceFilter: field.json({
|
|
167
|
+
isOptional: true,
|
|
168
|
+
description: "Audience filter criteria"
|
|
169
|
+
}),
|
|
170
|
+
scheduledStartAt: field.dateTime({
|
|
171
|
+
isOptional: true,
|
|
172
|
+
description: "Scheduled start time"
|
|
173
|
+
}),
|
|
174
|
+
scheduledEndAt: field.dateTime({
|
|
175
|
+
isOptional: true,
|
|
176
|
+
description: "Scheduled end time"
|
|
177
|
+
}),
|
|
178
|
+
startedAt: field.dateTime({
|
|
179
|
+
isOptional: true,
|
|
180
|
+
description: "Actual start time"
|
|
181
|
+
}),
|
|
182
|
+
endedAt: field.dateTime({
|
|
183
|
+
isOptional: true,
|
|
184
|
+
description: "Actual end time"
|
|
185
|
+
}),
|
|
186
|
+
winningVariant: field.string({
|
|
187
|
+
isOptional: true,
|
|
188
|
+
description: "Declared winning variant"
|
|
189
|
+
}),
|
|
190
|
+
results: field.json({
|
|
191
|
+
isOptional: true,
|
|
192
|
+
description: "Experiment results summary"
|
|
193
|
+
}),
|
|
194
|
+
orgId: field.string({
|
|
195
|
+
isOptional: true,
|
|
196
|
+
description: "Organization scope"
|
|
197
|
+
}),
|
|
198
|
+
createdAt: field.createdAt(),
|
|
199
|
+
updatedAt: field.updatedAt(),
|
|
200
|
+
flag: field.belongsTo("FeatureFlag", ["flagId"], ["id"], {
|
|
201
|
+
onDelete: "Cascade"
|
|
202
|
+
}),
|
|
203
|
+
assignments: field.hasMany("ExperimentAssignment")
|
|
204
|
+
},
|
|
205
|
+
indexes: [
|
|
206
|
+
index.on(["status"]),
|
|
207
|
+
index.on(["orgId", "status"]),
|
|
208
|
+
index.on(["flagId"])
|
|
209
|
+
],
|
|
210
|
+
enums: [ExperimentStatusEnum]
|
|
230
211
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
212
|
+
var ExperimentAssignmentEntity = defineEntity({
|
|
213
|
+
name: "ExperimentAssignment",
|
|
214
|
+
description: "Tracks experiment variant assignments.",
|
|
215
|
+
schema: "lssm_feature_flags",
|
|
216
|
+
map: "experiment_assignment",
|
|
217
|
+
fields: {
|
|
218
|
+
id: field.id({ description: "Unique assignment identifier" }),
|
|
219
|
+
experimentId: field.foreignKey({ description: "Parent experiment" }),
|
|
220
|
+
subjectType: field.string({
|
|
221
|
+
description: "Subject type (user, org, session)"
|
|
222
|
+
}),
|
|
223
|
+
subjectId: field.string({ description: "Subject identifier" }),
|
|
224
|
+
variant: field.string({ description: "Assigned variant key" }),
|
|
225
|
+
bucket: field.int({ description: "Hash bucket (0-99)" }),
|
|
226
|
+
context: field.json({
|
|
227
|
+
isOptional: true,
|
|
228
|
+
description: "Context at assignment time"
|
|
229
|
+
}),
|
|
230
|
+
assignedAt: field.dateTime({ description: "Assignment timestamp" }),
|
|
231
|
+
experiment: field.belongsTo("Experiment", ["experimentId"], ["id"], {
|
|
232
|
+
onDelete: "Cascade"
|
|
233
|
+
})
|
|
234
|
+
},
|
|
235
|
+
indexes: [
|
|
236
|
+
index.unique(["experimentId", "subjectType", "subjectId"], {
|
|
237
|
+
name: "experiment_assignment_unique"
|
|
238
|
+
}),
|
|
239
|
+
index.on(["subjectType", "subjectId"])
|
|
240
|
+
]
|
|
258
241
|
});
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
242
|
+
var FlagEvaluationEntity = defineEntity({
|
|
243
|
+
name: "FlagEvaluation",
|
|
244
|
+
description: "Log of flag evaluations for debugging and analytics.",
|
|
245
|
+
schema: "lssm_feature_flags",
|
|
246
|
+
map: "flag_evaluation",
|
|
247
|
+
fields: {
|
|
248
|
+
id: field.id({ description: "Unique evaluation identifier" }),
|
|
249
|
+
flagId: field.foreignKey({ description: "Evaluated flag" }),
|
|
250
|
+
flagKey: field.string({
|
|
251
|
+
description: "Flag key (denormalized for queries)"
|
|
252
|
+
}),
|
|
253
|
+
subjectType: field.string({
|
|
254
|
+
description: "Subject type (user, org, anonymous)"
|
|
255
|
+
}),
|
|
256
|
+
subjectId: field.string({ description: "Subject identifier" }),
|
|
257
|
+
result: field.boolean({ description: "Evaluation result" }),
|
|
258
|
+
variant: field.string({
|
|
259
|
+
isOptional: true,
|
|
260
|
+
description: "Served variant (for multivariate)"
|
|
261
|
+
}),
|
|
262
|
+
matchedRuleId: field.string({
|
|
263
|
+
isOptional: true,
|
|
264
|
+
description: "Rule that matched (if any)"
|
|
265
|
+
}),
|
|
266
|
+
reason: field.string({
|
|
267
|
+
description: "Evaluation reason (default, rule, experiment, etc.)"
|
|
268
|
+
}),
|
|
269
|
+
context: field.json({
|
|
270
|
+
isOptional: true,
|
|
271
|
+
description: "Evaluation context"
|
|
272
|
+
}),
|
|
273
|
+
evaluatedAt: field.dateTime({ description: "Evaluation timestamp" }),
|
|
274
|
+
flag: field.belongsTo("FeatureFlag", ["flagId"], ["id"], {
|
|
275
|
+
onDelete: "Cascade"
|
|
276
|
+
})
|
|
277
|
+
},
|
|
278
|
+
indexes: [
|
|
279
|
+
index.on(["flagKey", "evaluatedAt"]),
|
|
280
|
+
index.on(["subjectType", "subjectId", "evaluatedAt"]),
|
|
281
|
+
index.on(["flagId", "evaluatedAt"])
|
|
282
|
+
]
|
|
299
283
|
});
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
ExperimentEntity,
|
|
307
|
-
ExperimentAssignmentEntity,
|
|
308
|
-
FlagEvaluationEntity
|
|
284
|
+
var featureFlagEntities = [
|
|
285
|
+
FeatureFlagEntity,
|
|
286
|
+
FlagTargetingRuleEntity,
|
|
287
|
+
ExperimentEntity,
|
|
288
|
+
ExperimentAssignmentEntity,
|
|
289
|
+
FlagEvaluationEntity
|
|
309
290
|
];
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
291
|
+
var featureFlagsSchemaContribution = {
|
|
292
|
+
moduleId: "@contractspec/lib.feature-flags",
|
|
293
|
+
entities: featureFlagEntities,
|
|
294
|
+
enums: [FlagStatusEnum, RuleOperatorEnum, ExperimentStatusEnum]
|
|
295
|
+
};
|
|
296
|
+
export {
|
|
297
|
+
featureFlagsSchemaContribution,
|
|
298
|
+
featureFlagEntities,
|
|
299
|
+
RuleOperatorEnum,
|
|
300
|
+
FlagTargetingRuleEntity,
|
|
301
|
+
FlagStatusEnum,
|
|
302
|
+
FlagEvaluationEntity,
|
|
303
|
+
FeatureFlagEntity,
|
|
304
|
+
ExperimentStatusEnum,
|
|
305
|
+
ExperimentEntity,
|
|
306
|
+
ExperimentAssignmentEntity
|
|
321
307
|
};
|
|
322
|
-
|
|
323
|
-
//#endregion
|
|
324
|
-
export { ExperimentAssignmentEntity, ExperimentEntity, ExperimentStatusEnum, FeatureFlagEntity, FlagEvaluationEntity, FlagStatusEnum, FlagTargetingRuleEntity, RuleOperatorEnum, featureFlagEntities, featureFlagsSchemaContribution };
|
|
325
|
-
//# sourceMappingURL=index.js.map
|