@contractspec/lib.feature-flags 3.7.16 → 3.7.18
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 +1 -636
- package/dist/browser/docs/feature-flags.docblock.js +3 -17
- package/dist/browser/docs/index.js +3 -17
- package/dist/browser/entities/index.js +1 -306
- package/dist/browser/evaluation/index.js +1 -223
- package/dist/browser/events.js +1 -296
- package/dist/browser/feature-flags.capability.js +1 -31
- package/dist/browser/feature-flags.feature.js +1 -55
- package/dist/browser/index.js +3 -1529
- package/dist/contracts/index.js +1 -636
- package/dist/docs/feature-flags.docblock.js +3 -17
- package/dist/docs/index.js +3 -17
- package/dist/entities/index.js +1 -306
- package/dist/evaluation/index.js +1 -223
- package/dist/events.js +1 -296
- package/dist/feature-flags.capability.js +1 -31
- package/dist/feature-flags.feature.js +1 -55
- package/dist/index.js +3 -1529
- package/dist/node/contracts/index.js +1 -636
- package/dist/node/docs/feature-flags.docblock.js +3 -17
- package/dist/node/docs/index.js +3 -17
- package/dist/node/entities/index.js +1 -306
- package/dist/node/evaluation/index.js +1 -223
- package/dist/node/events.js +1 -296
- package/dist/node/feature-flags.capability.js +1 -31
- package/dist/node/feature-flags.feature.js +1 -55
- package/dist/node/index.js +3 -1529
- package/package.json +7 -7
package/dist/events.js
CHANGED
|
@@ -1,297 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
5
|
-
var FlagCreatedPayload = defineSchemaModel({
|
|
6
|
-
name: "FlagCreatedEventPayload",
|
|
7
|
-
description: "Payload when a feature flag is created",
|
|
8
|
-
fields: {
|
|
9
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
-
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
14
|
-
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
15
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var FlagUpdatedPayload = defineSchemaModel({
|
|
19
|
-
name: "FlagUpdatedEventPayload",
|
|
20
|
-
description: "Payload when a feature flag is updated",
|
|
21
|
-
fields: {
|
|
22
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
-
changes: { type: ScalarTypeEnum.JSON(), isOptional: false },
|
|
25
|
-
updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
26
|
-
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var FlagDeletedPayload = defineSchemaModel({
|
|
30
|
-
name: "FlagDeletedEventPayload",
|
|
31
|
-
description: "Payload when a feature flag is deleted",
|
|
32
|
-
fields: {
|
|
33
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
34
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
35
|
-
deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
36
|
-
deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
var FlagToggledPayload = defineSchemaModel({
|
|
40
|
-
name: "FlagToggledEventPayload",
|
|
41
|
-
description: "Payload when a feature flag status is toggled",
|
|
42
|
-
fields: {
|
|
43
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
45
|
-
previousStatus: {
|
|
46
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
47
|
-
isOptional: false
|
|
48
|
-
},
|
|
49
|
-
newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
-
toggledBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
51
|
-
toggledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var RuleCreatedPayload = defineSchemaModel({
|
|
55
|
-
name: "RuleCreatedEventPayload",
|
|
56
|
-
description: "Payload when a targeting rule is created",
|
|
57
|
-
fields: {
|
|
58
|
-
ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
59
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
60
|
-
flagKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
61
|
-
attribute: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
62
|
-
operator: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
63
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
var RuleDeletedPayload = defineSchemaModel({
|
|
67
|
-
name: "RuleDeletedEventPayload",
|
|
68
|
-
description: "Payload when a targeting rule is deleted",
|
|
69
|
-
fields: {
|
|
70
|
-
ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
71
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
72
|
-
flagKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
73
|
-
deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
var ExperimentCreatedPayload = defineSchemaModel({
|
|
77
|
-
name: "ExperimentCreatedEventPayload",
|
|
78
|
-
description: "Payload when an experiment is created",
|
|
79
|
-
fields: {
|
|
80
|
-
experimentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
81
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
82
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
83
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
84
|
-
variants: { type: ScalarTypeEnum.JSON(), isOptional: false },
|
|
85
|
-
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
86
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
var ExperimentStartedPayload = defineSchemaModel({
|
|
90
|
-
name: "ExperimentStartedEventPayload",
|
|
91
|
-
description: "Payload when an experiment starts",
|
|
92
|
-
fields: {
|
|
93
|
-
experimentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
94
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
95
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
96
|
-
variants: { type: ScalarTypeEnum.JSON(), isOptional: false },
|
|
97
|
-
audiencePercentage: {
|
|
98
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
99
|
-
isOptional: false
|
|
100
|
-
},
|
|
101
|
-
startedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
102
|
-
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
var ExperimentStoppedPayload = defineSchemaModel({
|
|
106
|
-
name: "ExperimentStoppedEventPayload",
|
|
107
|
-
description: "Payload when an experiment stops",
|
|
108
|
-
fields: {
|
|
109
|
-
experimentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
110
|
-
key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
111
|
-
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
112
|
-
winningVariant: {
|
|
113
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
114
|
-
isOptional: true
|
|
115
|
-
},
|
|
116
|
-
stoppedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
117
|
-
stoppedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
var FlagEvaluatedPayload = defineSchemaModel({
|
|
121
|
-
name: "FlagEvaluatedEventPayload",
|
|
122
|
-
description: "Payload when a flag is evaluated (for analytics)",
|
|
123
|
-
fields: {
|
|
124
|
-
flagId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
125
|
-
flagKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
126
|
-
subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
127
|
-
subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
128
|
-
result: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
129
|
-
variant: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
130
|
-
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
131
|
-
evaluatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
var VariantAssignedPayload = defineSchemaModel({
|
|
135
|
-
name: "VariantAssignedEventPayload",
|
|
136
|
-
description: "Payload when a subject is assigned to an experiment variant",
|
|
137
|
-
fields: {
|
|
138
|
-
experimentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
139
|
-
experimentKey: {
|
|
140
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
141
|
-
isOptional: false
|
|
142
|
-
},
|
|
143
|
-
subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
144
|
-
subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
145
|
-
variant: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
146
|
-
bucket: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
147
|
-
assignedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
var FlagCreatedEvent = defineEvent({
|
|
151
|
-
meta: {
|
|
152
|
-
key: "flag.created",
|
|
153
|
-
version: "1.0.0",
|
|
154
|
-
description: "A feature flag has been created.",
|
|
155
|
-
stability: "stable",
|
|
156
|
-
owners: ["@platform.feature-flags"],
|
|
157
|
-
tags: ["feature-flags", "create"]
|
|
158
|
-
},
|
|
159
|
-
payload: FlagCreatedPayload
|
|
160
|
-
});
|
|
161
|
-
var FlagUpdatedEvent = defineEvent({
|
|
162
|
-
meta: {
|
|
163
|
-
key: "flag.updated",
|
|
164
|
-
version: "1.0.0",
|
|
165
|
-
description: "A feature flag has been updated.",
|
|
166
|
-
stability: "stable",
|
|
167
|
-
owners: ["@platform.feature-flags"],
|
|
168
|
-
tags: ["feature-flags", "update"]
|
|
169
|
-
},
|
|
170
|
-
payload: FlagUpdatedPayload
|
|
171
|
-
});
|
|
172
|
-
var FlagDeletedEvent = defineEvent({
|
|
173
|
-
meta: {
|
|
174
|
-
key: "flag.deleted",
|
|
175
|
-
version: "1.0.0",
|
|
176
|
-
description: "A feature flag has been deleted.",
|
|
177
|
-
stability: "stable",
|
|
178
|
-
owners: ["@platform.feature-flags"],
|
|
179
|
-
tags: ["feature-flags", "delete"]
|
|
180
|
-
},
|
|
181
|
-
payload: FlagDeletedPayload
|
|
182
|
-
});
|
|
183
|
-
var FlagToggledEvent = defineEvent({
|
|
184
|
-
meta: {
|
|
185
|
-
key: "flag.toggled",
|
|
186
|
-
version: "1.0.0",
|
|
187
|
-
description: "A feature flag status has been toggled.",
|
|
188
|
-
stability: "stable",
|
|
189
|
-
owners: ["@platform.feature-flags"],
|
|
190
|
-
tags: ["feature-flags", "toggle"]
|
|
191
|
-
},
|
|
192
|
-
payload: FlagToggledPayload
|
|
193
|
-
});
|
|
194
|
-
var RuleCreatedEvent = defineEvent({
|
|
195
|
-
meta: {
|
|
196
|
-
key: "flag.rule_created",
|
|
197
|
-
version: "1.0.0",
|
|
198
|
-
description: "A targeting rule has been created.",
|
|
199
|
-
stability: "stable",
|
|
200
|
-
owners: ["@platform.feature-flags"],
|
|
201
|
-
tags: ["feature-flags", "rule", "create"]
|
|
202
|
-
},
|
|
203
|
-
payload: RuleCreatedPayload
|
|
204
|
-
});
|
|
205
|
-
var RuleDeletedEvent = defineEvent({
|
|
206
|
-
meta: {
|
|
207
|
-
key: "flag.rule_deleted",
|
|
208
|
-
version: "1.0.0",
|
|
209
|
-
description: "A targeting rule has been deleted.",
|
|
210
|
-
stability: "stable",
|
|
211
|
-
owners: ["@platform.feature-flags"],
|
|
212
|
-
tags: ["feature-flags", "rule", "delete"]
|
|
213
|
-
},
|
|
214
|
-
payload: RuleDeletedPayload
|
|
215
|
-
});
|
|
216
|
-
var ExperimentCreatedEvent = defineEvent({
|
|
217
|
-
meta: {
|
|
218
|
-
key: "experiment.created",
|
|
219
|
-
version: "1.0.0",
|
|
220
|
-
description: "An experiment has been created.",
|
|
221
|
-
stability: "stable",
|
|
222
|
-
owners: ["@platform.feature-flags"],
|
|
223
|
-
tags: ["feature-flags", "experiment", "create"]
|
|
224
|
-
},
|
|
225
|
-
payload: ExperimentCreatedPayload
|
|
226
|
-
});
|
|
227
|
-
var ExperimentStartedEvent = defineEvent({
|
|
228
|
-
meta: {
|
|
229
|
-
key: "experiment.started",
|
|
230
|
-
version: "1.0.0",
|
|
231
|
-
description: "An experiment has started.",
|
|
232
|
-
stability: "stable",
|
|
233
|
-
owners: ["@platform.feature-flags"],
|
|
234
|
-
tags: ["feature-flags", "experiment", "start"]
|
|
235
|
-
},
|
|
236
|
-
payload: ExperimentStartedPayload
|
|
237
|
-
});
|
|
238
|
-
var ExperimentStoppedEvent = defineEvent({
|
|
239
|
-
meta: {
|
|
240
|
-
key: "experiment.stopped",
|
|
241
|
-
version: "1.0.0",
|
|
242
|
-
description: "An experiment has stopped.",
|
|
243
|
-
stability: "stable",
|
|
244
|
-
owners: ["@platform.feature-flags"],
|
|
245
|
-
tags: ["feature-flags", "experiment", "stop"]
|
|
246
|
-
},
|
|
247
|
-
payload: ExperimentStoppedPayload
|
|
248
|
-
});
|
|
249
|
-
var FlagEvaluatedEvent = defineEvent({
|
|
250
|
-
meta: {
|
|
251
|
-
key: "flag.evaluated",
|
|
252
|
-
version: "1.0.0",
|
|
253
|
-
description: "A feature flag has been evaluated.",
|
|
254
|
-
stability: "stable",
|
|
255
|
-
owners: ["@platform.feature-flags"],
|
|
256
|
-
tags: ["feature-flags", "evaluate"]
|
|
257
|
-
},
|
|
258
|
-
payload: FlagEvaluatedPayload
|
|
259
|
-
});
|
|
260
|
-
var VariantAssignedEvent = defineEvent({
|
|
261
|
-
meta: {
|
|
262
|
-
key: "experiment.variant_assigned",
|
|
263
|
-
version: "1.0.0",
|
|
264
|
-
description: "A subject has been assigned to an experiment variant.",
|
|
265
|
-
stability: "stable",
|
|
266
|
-
owners: ["@platform.feature-flags"],
|
|
267
|
-
tags: ["feature-flags", "experiment", "variant"]
|
|
268
|
-
},
|
|
269
|
-
payload: VariantAssignedPayload
|
|
270
|
-
});
|
|
271
|
-
var FeatureFlagEvents = {
|
|
272
|
-
FlagCreatedEvent,
|
|
273
|
-
FlagUpdatedEvent,
|
|
274
|
-
FlagDeletedEvent,
|
|
275
|
-
FlagToggledEvent,
|
|
276
|
-
RuleCreatedEvent,
|
|
277
|
-
RuleDeletedEvent,
|
|
278
|
-
ExperimentCreatedEvent,
|
|
279
|
-
ExperimentStartedEvent,
|
|
280
|
-
ExperimentStoppedEvent,
|
|
281
|
-
FlagEvaluatedEvent,
|
|
282
|
-
VariantAssignedEvent
|
|
283
|
-
};
|
|
284
|
-
export {
|
|
285
|
-
VariantAssignedEvent,
|
|
286
|
-
RuleDeletedEvent,
|
|
287
|
-
RuleCreatedEvent,
|
|
288
|
-
FlagUpdatedEvent,
|
|
289
|
-
FlagToggledEvent,
|
|
290
|
-
FlagEvaluatedEvent,
|
|
291
|
-
FlagDeletedEvent,
|
|
292
|
-
FlagCreatedEvent,
|
|
293
|
-
FeatureFlagEvents,
|
|
294
|
-
ExperimentStoppedEvent,
|
|
295
|
-
ExperimentStartedEvent,
|
|
296
|
-
ExperimentCreatedEvent
|
|
297
|
-
};
|
|
2
|
+
import{defineEvent as k}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as q,ScalarTypeEnum as j}from"@contractspec/lib.schema";var w=q({name:"FlagCreatedEventPayload",description:"Payload when a feature flag is created",fields:{flagId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},name:{type:j.String_unsecure(),isOptional:!1},status:{type:j.String_unsecure(),isOptional:!1},orgId:{type:j.String_unsecure(),isOptional:!0},createdBy:{type:j.String_unsecure(),isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1}}}),z=q({name:"FlagUpdatedEventPayload",description:"Payload when a feature flag is updated",fields:{flagId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},changes:{type:j.JSON(),isOptional:!1},updatedBy:{type:j.String_unsecure(),isOptional:!0},updatedAt:{type:j.DateTime(),isOptional:!1}}}),B=q({name:"FlagDeletedEventPayload",description:"Payload when a feature flag is deleted",fields:{flagId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},deletedBy:{type:j.String_unsecure(),isOptional:!0},deletedAt:{type:j.DateTime(),isOptional:!1}}}),G=q({name:"FlagToggledEventPayload",description:"Payload when a feature flag status is toggled",fields:{flagId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},previousStatus:{type:j.String_unsecure(),isOptional:!1},newStatus:{type:j.String_unsecure(),isOptional:!1},toggledBy:{type:j.String_unsecure(),isOptional:!0},toggledAt:{type:j.DateTime(),isOptional:!1}}}),H=q({name:"RuleCreatedEventPayload",description:"Payload when a targeting rule is created",fields:{ruleId:{type:j.String_unsecure(),isOptional:!1},flagId:{type:j.String_unsecure(),isOptional:!1},flagKey:{type:j.String_unsecure(),isOptional:!1},attribute:{type:j.String_unsecure(),isOptional:!1},operator:{type:j.String_unsecure(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1}}}),I=q({name:"RuleDeletedEventPayload",description:"Payload when a targeting rule is deleted",fields:{ruleId:{type:j.String_unsecure(),isOptional:!1},flagId:{type:j.String_unsecure(),isOptional:!1},flagKey:{type:j.String_unsecure(),isOptional:!1},deletedAt:{type:j.DateTime(),isOptional:!1}}}),J=q({name:"ExperimentCreatedEventPayload",description:"Payload when an experiment is created",fields:{experimentId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},name:{type:j.String_unsecure(),isOptional:!1},flagId:{type:j.String_unsecure(),isOptional:!1},variants:{type:j.JSON(),isOptional:!1},createdBy:{type:j.String_unsecure(),isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1}}}),K=q({name:"ExperimentStartedEventPayload",description:"Payload when an experiment starts",fields:{experimentId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},flagId:{type:j.String_unsecure(),isOptional:!1},variants:{type:j.JSON(),isOptional:!1},audiencePercentage:{type:j.Int_unsecure(),isOptional:!1},startedBy:{type:j.String_unsecure(),isOptional:!0},startedAt:{type:j.DateTime(),isOptional:!1}}}),L=q({name:"ExperimentStoppedEventPayload",description:"Payload when an experiment stops",fields:{experimentId:{type:j.String_unsecure(),isOptional:!1},key:{type:j.String_unsecure(),isOptional:!1},reason:{type:j.String_unsecure(),isOptional:!1},winningVariant:{type:j.String_unsecure(),isOptional:!0},stoppedBy:{type:j.String_unsecure(),isOptional:!0},stoppedAt:{type:j.DateTime(),isOptional:!1}}}),N=q({name:"FlagEvaluatedEventPayload",description:"Payload when a flag is evaluated (for analytics)",fields:{flagId:{type:j.String_unsecure(),isOptional:!1},flagKey:{type:j.String_unsecure(),isOptional:!1},subjectType:{type:j.String_unsecure(),isOptional:!1},subjectId:{type:j.String_unsecure(),isOptional:!1},result:{type:j.Boolean(),isOptional:!1},variant:{type:j.String_unsecure(),isOptional:!0},reason:{type:j.String_unsecure(),isOptional:!1},evaluatedAt:{type:j.DateTime(),isOptional:!1}}}),O=q({name:"VariantAssignedEventPayload",description:"Payload when a subject is assigned to an experiment variant",fields:{experimentId:{type:j.String_unsecure(),isOptional:!1},experimentKey:{type:j.String_unsecure(),isOptional:!1},subjectType:{type:j.String_unsecure(),isOptional:!1},subjectId:{type:j.String_unsecure(),isOptional:!1},variant:{type:j.String_unsecure(),isOptional:!1},bucket:{type:j.Int_unsecure(),isOptional:!1},assignedAt:{type:j.DateTime(),isOptional:!1}}}),Q=k({meta:{key:"flag.created",version:"1.0.0",description:"A feature flag has been created.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","create"]},payload:w}),W=k({meta:{key:"flag.updated",version:"1.0.0",description:"A feature flag has been updated.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","update"]},payload:z}),X=k({meta:{key:"flag.deleted",version:"1.0.0",description:"A feature flag has been deleted.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","delete"]},payload:B}),Y=k({meta:{key:"flag.toggled",version:"1.0.0",description:"A feature flag status has been toggled.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","toggle"]},payload:G}),Z=k({meta:{key:"flag.rule_created",version:"1.0.0",description:"A targeting rule has been created.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","rule","create"]},payload:H}),_=k({meta:{key:"flag.rule_deleted",version:"1.0.0",description:"A targeting rule has been deleted.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","rule","delete"]},payload:I}),$=k({meta:{key:"experiment.created",version:"1.0.0",description:"An experiment has been created.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","experiment","create"]},payload:J}),b=k({meta:{key:"experiment.started",version:"1.0.0",description:"An experiment has started.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","experiment","start"]},payload:K}),A=k({meta:{key:"experiment.stopped",version:"1.0.0",description:"An experiment has stopped.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","experiment","stop"]},payload:L}),U=k({meta:{key:"flag.evaluated",version:"1.0.0",description:"A feature flag has been evaluated.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","evaluate"]},payload:N}),V=k({meta:{key:"experiment.variant_assigned",version:"1.0.0",description:"A subject has been assigned to an experiment variant.",stability:"stable",owners:["@platform.feature-flags"],tags:["feature-flags","experiment","variant"]},payload:O}),x={FlagCreatedEvent:Q,FlagUpdatedEvent:W,FlagDeletedEvent:X,FlagToggledEvent:Y,RuleCreatedEvent:Z,RuleDeletedEvent:_,ExperimentCreatedEvent:$,ExperimentStartedEvent:b,ExperimentStoppedEvent:A,FlagEvaluatedEvent:U,VariantAssignedEvent:V};export{V as VariantAssignedEvent,_ as RuleDeletedEvent,Z as RuleCreatedEvent,W as FlagUpdatedEvent,Y as FlagToggledEvent,U as FlagEvaluatedEvent,X as FlagDeletedEvent,Q as FlagCreatedEvent,x as FeatureFlagEvents,A as ExperimentStoppedEvent,b as ExperimentStartedEvent,$ as ExperimentCreatedEvent};
|
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
defineCapability,
|
|
5
|
-
StabilityEnum
|
|
6
|
-
} from "@contractspec/lib.contracts-spec";
|
|
7
|
-
var FeatureFlagsCapability = defineCapability({
|
|
8
|
-
meta: {
|
|
9
|
-
key: "feature-flag",
|
|
10
|
-
version: "1.0.0",
|
|
11
|
-
kind: "api",
|
|
12
|
-
stability: StabilityEnum.Experimental,
|
|
13
|
-
description: "Feature flag management and evaluation",
|
|
14
|
-
owners: ["@platform.featureflags"],
|
|
15
|
-
tags: ["feature-flags", "configuration"]
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var ExperimentsCapability = defineCapability({
|
|
19
|
-
meta: {
|
|
20
|
-
key: "experiments",
|
|
21
|
-
version: "1.0.0",
|
|
22
|
-
kind: "api",
|
|
23
|
-
stability: StabilityEnum.Experimental,
|
|
24
|
-
description: "A/B testing and experimentation platform",
|
|
25
|
-
owners: ["@platform.featureflags"],
|
|
26
|
-
tags: ["experiments", "ab-testing"]
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
export {
|
|
30
|
-
FeatureFlagsCapability,
|
|
31
|
-
ExperimentsCapability
|
|
32
|
-
};
|
|
2
|
+
import{defineCapability as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({meta:{key:"feature-flag",version:"1.0.0",kind:"api",stability:h.Experimental,description:"Feature flag management and evaluation",owners:["@platform.featureflags"],tags:["feature-flags","configuration"]}}),q=g({meta:{key:"experiments",version:"1.0.0",kind:"api",stability:h.Experimental,description:"A/B testing and experimentation platform",owners:["@platform.featureflags"],tags:["experiments","ab-testing"]}});export{k as FeatureFlagsCapability,q as ExperimentsCapability};
|
|
@@ -1,56 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
var FeatureFlagsFeature = defineFeature({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "feature-flags",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
title: "Feature Flags",
|
|
9
|
-
description: "Feature flag management with targeting rules and A/B experiments",
|
|
10
|
-
domain: "platform",
|
|
11
|
-
owners: ["@platform.feature-flags"],
|
|
12
|
-
tags: ["feature-flags", "experiments", "targeting"],
|
|
13
|
-
stability: "stable"
|
|
14
|
-
},
|
|
15
|
-
operations: [
|
|
16
|
-
{ key: "flag.create", version: "1.0.0" },
|
|
17
|
-
{ key: "flag.update", version: "1.0.0" },
|
|
18
|
-
{ key: "flag.delete", version: "1.0.0" },
|
|
19
|
-
{ key: "flag.toggle", version: "1.0.0" },
|
|
20
|
-
{ key: "flag.get", version: "1.0.0" },
|
|
21
|
-
{ key: "flag.list", version: "1.0.0" },
|
|
22
|
-
{ key: "flag.evaluate", version: "1.0.0" },
|
|
23
|
-
{ key: "flag.rule.create", version: "1.0.0" },
|
|
24
|
-
{ key: "flag.rule.delete", version: "1.0.0" },
|
|
25
|
-
{ key: "experiment.create", version: "1.0.0" },
|
|
26
|
-
{ key: "experiment.start", version: "1.0.0" },
|
|
27
|
-
{ key: "experiment.stop", version: "1.0.0" },
|
|
28
|
-
{ key: "experiment.get", version: "1.0.0" }
|
|
29
|
-
],
|
|
30
|
-
events: [
|
|
31
|
-
{ key: "flag.created", version: "1.0.0" },
|
|
32
|
-
{ key: "flag.updated", version: "1.0.0" },
|
|
33
|
-
{ key: "flag.deleted", version: "1.0.0" },
|
|
34
|
-
{ key: "flag.toggled", version: "1.0.0" },
|
|
35
|
-
{ key: "flag.evaluated", version: "1.0.0" },
|
|
36
|
-
{ key: "flag.rule_created", version: "1.0.0" },
|
|
37
|
-
{ key: "flag.rule_deleted", version: "1.0.0" },
|
|
38
|
-
{ key: "experiment.created", version: "1.0.0" },
|
|
39
|
-
{ key: "experiment.started", version: "1.0.0" },
|
|
40
|
-
{ key: "experiment.stopped", version: "1.0.0" },
|
|
41
|
-
{ key: "experiment.variant_assigned", version: "1.0.0" }
|
|
42
|
-
],
|
|
43
|
-
presentations: [],
|
|
44
|
-
opToPresentation: [],
|
|
45
|
-
presentationsTargets: [],
|
|
46
|
-
capabilities: {
|
|
47
|
-
provides: [
|
|
48
|
-
{ key: "feature-flag", version: "1.0.0" },
|
|
49
|
-
{ key: "experiments", version: "1.0.0" }
|
|
50
|
-
],
|
|
51
|
-
requires: [{ key: "identity", version: "1.0.0" }]
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
export {
|
|
55
|
-
FeatureFlagsFeature
|
|
56
|
-
};
|
|
2
|
+
import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"feature-flags",version:"1.0.0",title:"Feature Flags",description:"Feature flag management with targeting rules and A/B experiments",domain:"platform",owners:["@platform.feature-flags"],tags:["feature-flags","experiments","targeting"],stability:"stable"},operations:[{key:"flag.create",version:"1.0.0"},{key:"flag.update",version:"1.0.0"},{key:"flag.delete",version:"1.0.0"},{key:"flag.toggle",version:"1.0.0"},{key:"flag.get",version:"1.0.0"},{key:"flag.list",version:"1.0.0"},{key:"flag.evaluate",version:"1.0.0"},{key:"flag.rule.create",version:"1.0.0"},{key:"flag.rule.delete",version:"1.0.0"},{key:"experiment.create",version:"1.0.0"},{key:"experiment.start",version:"1.0.0"},{key:"experiment.stop",version:"1.0.0"},{key:"experiment.get",version:"1.0.0"}],events:[{key:"flag.created",version:"1.0.0"},{key:"flag.updated",version:"1.0.0"},{key:"flag.deleted",version:"1.0.0"},{key:"flag.toggled",version:"1.0.0"},{key:"flag.evaluated",version:"1.0.0"},{key:"flag.rule_created",version:"1.0.0"},{key:"flag.rule_deleted",version:"1.0.0"},{key:"experiment.created",version:"1.0.0"},{key:"experiment.started",version:"1.0.0"},{key:"experiment.stopped",version:"1.0.0"},{key:"experiment.variant_assigned",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{provides:[{key:"feature-flag",version:"1.0.0"},{key:"experiments",version:"1.0.0"}],requires:[{key:"identity",version:"1.0.0"}]}});export{j as FeatureFlagsFeature};
|