@featurevisor/core 2.17.0 → 2.19.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/CHANGELOG.md +22 -0
- package/coverage/clover.xml +1692 -1196
- package/coverage/coverage-final.json +29 -22
- package/coverage/lcov-report/builder/allocator.ts.html +26 -26
- package/coverage/lcov-report/builder/buildDatafile.ts.html +2017 -0
- package/coverage/lcov-report/builder/buildScopedConditions.ts.html +35 -35
- package/coverage/lcov-report/builder/buildScopedDatafile.ts.html +213 -45
- package/coverage/lcov-report/builder/buildScopedSegments.ts.html +28 -28
- package/coverage/lcov-report/builder/convertToV1.ts.html +583 -0
- package/coverage/lcov-report/builder/getFeatureRanges.ts.html +268 -0
- package/coverage/lcov-report/builder/hashes.ts.html +412 -0
- package/coverage/lcov-report/builder/index.html +90 -30
- package/coverage/lcov-report/builder/mutateVariables.ts.html +66 -45
- package/coverage/lcov-report/builder/mutator.ts.html +95 -95
- package/coverage/lcov-report/builder/revision.ts.html +1 -1
- package/coverage/lcov-report/builder/traffic.ts.html +60 -57
- package/coverage/lcov-report/config/index.html +1 -1
- package/coverage/lcov-report/config/index.ts.html +2 -2
- package/coverage/lcov-report/config/projectConfig.ts.html +28 -28
- package/coverage/lcov-report/datasource/adapter.ts.html +2 -2
- package/coverage/lcov-report/datasource/datasource.ts.html +4 -4
- package/coverage/lcov-report/datasource/filesystemAdapter.ts.html +34 -34
- package/coverage/lcov-report/datasource/index.html +1 -1
- package/coverage/lcov-report/datasource/index.ts.html +1 -1
- package/coverage/lcov-report/index.html +39 -39
- package/coverage/lcov-report/linter/attributeSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/checkCircularDependency.ts.html +1 -1
- package/coverage/lcov-report/linter/checkPercentageExceedingSlot.ts.html +1 -1
- package/coverage/lcov-report/linter/conditionSchema.ts.html +17 -17
- package/coverage/lcov-report/linter/featureSchema.ts.html +879 -417
- package/coverage/lcov-report/linter/groupSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/index.html +34 -34
- package/coverage/lcov-report/linter/lintProject.ts.html +25 -25
- package/coverage/lcov-report/linter/mutationNotation.ts.html +224 -122
- package/coverage/lcov-report/linter/printError.ts.html +1 -1
- package/coverage/lcov-report/linter/schema.ts.html +175 -85
- package/coverage/lcov-report/linter/segmentSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/testSchema.ts.html +5 -5
- package/coverage/lcov-report/list/index.html +1 -1
- package/coverage/lcov-report/list/matrix.ts.html +1 -1
- package/coverage/lcov-report/parsers/index.html +1 -1
- package/coverage/lcov-report/parsers/index.ts.html +4 -4
- package/coverage/lcov-report/parsers/json.ts.html +2 -2
- package/coverage/lcov-report/parsers/yml.ts.html +6 -6
- package/coverage/lcov-report/tester/cliFormat.ts.html +1 -1
- package/coverage/lcov-report/tester/helpers.ts.html +1 -1
- package/coverage/lcov-report/tester/index.html +1 -1
- package/coverage/lcov-report/utils/extractKeys.ts.html +493 -0
- package/coverage/lcov-report/utils/git.ts.html +3 -3
- package/coverage/lcov-report/utils/index.html +54 -9
- package/coverage/lcov-report/utils/index.ts.html +94 -0
- package/coverage/lcov-report/utils/pretty.ts.html +121 -0
- package/coverage/lcov.info +3206 -2260
- package/json-schema/attribute.json +25 -9
- package/json-schema/feature.json +319 -238
- package/json-schema/segment.json +76 -45
- package/lib/builder/buildDatafile.js +50 -3
- package/lib/builder/buildDatafile.js.map +1 -1
- package/lib/builder/buildDatafile.spec.d.ts +1 -0
- package/lib/builder/buildDatafile.spec.js +233 -0
- package/lib/builder/buildDatafile.spec.js.map +1 -0
- package/lib/builder/buildScopedDatafile.js +37 -1
- package/lib/builder/buildScopedDatafile.js.map +1 -1
- package/lib/builder/buildScopedDatafile.spec.js +289 -0
- package/lib/builder/buildScopedDatafile.spec.js.map +1 -1
- package/lib/builder/mutateVariables.d.ts +1 -1
- package/lib/builder/mutateVariables.js +4 -1
- package/lib/builder/mutateVariables.js.map +1 -1
- package/lib/builder/mutateVariables.spec.js +29 -0
- package/lib/builder/mutateVariables.spec.js.map +1 -1
- package/lib/builder/traffic.js +1 -0
- package/lib/builder/traffic.js.map +1 -1
- package/lib/builder/traffic.spec.js +26 -0
- package/lib/builder/traffic.spec.js.map +1 -1
- package/lib/generate-code/typescript.js +63 -20
- package/lib/generate-code/typescript.js.map +1 -1
- package/lib/linter/featureSchema.d.ts +237 -22
- package/lib/linter/featureSchema.js +175 -84
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/featureSchema.spec.js +268 -0
- package/lib/linter/featureSchema.spec.js.map +1 -1
- package/lib/linter/mutationNotation.js +54 -19
- package/lib/linter/mutationNotation.js.map +1 -1
- package/lib/linter/mutationNotation.spec.js +49 -0
- package/lib/linter/mutationNotation.spec.js.map +1 -1
- package/lib/linter/schema.d.ts +1 -0
- package/lib/linter/schema.js +13 -0
- package/lib/linter/schema.js.map +1 -1
- package/lib/linter/schema.spec.js +51 -0
- package/lib/linter/schema.spec.js.map +1 -1
- package/package.json +5 -5
- package/src/builder/buildDatafile.spec.ts +267 -0
- package/src/builder/buildDatafile.ts +85 -4
- package/src/builder/buildScopedDatafile.spec.ts +330 -0
- package/src/builder/buildScopedDatafile.ts +57 -1
- package/src/builder/mutateVariables.spec.ts +45 -0
- package/src/builder/mutateVariables.ts +7 -0
- package/src/builder/traffic.spec.ts +33 -0
- package/src/builder/traffic.ts +1 -0
- package/src/generate-code/typescript.ts +87 -20
- package/src/linter/featureSchema.spec.ts +315 -0
- package/src/linter/featureSchema.ts +269 -115
- package/src/linter/mutationNotation.spec.ts +62 -0
- package/src/linter/mutationNotation.ts +47 -13
- package/src/linter/schema.spec.ts +72 -0
- package/src/linter/schema.ts +30 -0
|
@@ -6,19 +6,35 @@
|
|
|
6
6
|
"type": "boolean",
|
|
7
7
|
"description": "Indicates whether the attribute is archived or not."
|
|
8
8
|
},
|
|
9
|
-
"
|
|
9
|
+
"type": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "Type of attribute.",
|
|
12
|
+
"enum": ["boolean", "string", "integer", "double", "date", "semver", "object", "array"]
|
|
12
13
|
},
|
|
13
|
-
"
|
|
14
|
+
"description": {
|
|
14
15
|
"type": "string",
|
|
15
|
-
"description": "
|
|
16
|
+
"description": "Human readable description of the attribute for documentation purposes."
|
|
16
17
|
},
|
|
17
|
-
"
|
|
18
|
-
"type": "
|
|
19
|
-
"description": "
|
|
18
|
+
"properties": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Optional property definitions for object attributes.",
|
|
21
|
+
"additionalProperties": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"type": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["boolean", "string", "integer", "double", "date", "semver", "array"]
|
|
27
|
+
},
|
|
28
|
+
"description": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": ["type"],
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
}
|
|
20
35
|
}
|
|
21
36
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
37
|
+
"required": ["description", "type"],
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"description": "JSON Schema for creating Featurevisor attribute, expressed in YAML"
|
|
24
40
|
}
|
package/json-schema/feature.json
CHANGED
|
@@ -1,177 +1,350 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$defs": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
},
|
|
4
|
+
"value": {
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{ "type": "boolean" },
|
|
7
|
+
{ "type": "string" },
|
|
8
|
+
{ "type": "number" },
|
|
9
9
|
{
|
|
10
|
-
"type": "
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": { "$ref": "#/$defs/value" }
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
|
-
"type": "
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": { "$ref": "#/$defs/value" }
|
|
14
16
|
}
|
|
15
17
|
]
|
|
16
18
|
},
|
|
17
|
-
"
|
|
18
|
-
"type": "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"value_or_null": {
|
|
20
|
+
"oneOf": [{ "$ref": "#/$defs/value" }, { "type": "null" }]
|
|
21
|
+
},
|
|
22
|
+
"variation_value": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1
|
|
22
25
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
26
|
+
"group_segment": {
|
|
27
|
+
"oneOf": [
|
|
25
28
|
{
|
|
26
|
-
"type": "string"
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Segment key or *"
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
|
-
"type": "
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"and": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": { "$ref": "#/$defs/group_segment" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": ["and"],
|
|
41
|
+
"additionalProperties": false
|
|
30
42
|
},
|
|
31
43
|
{
|
|
32
|
-
"type": "
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"or": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": { "$ref": "#/$defs/group_segment" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": ["or"],
|
|
52
|
+
"additionalProperties": false
|
|
33
53
|
},
|
|
54
|
+
{
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"not": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": { "$ref": "#/$defs/group_segment" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": ["not"],
|
|
63
|
+
"additionalProperties": false
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"group_segments": {
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{ "$ref": "#/$defs/group_segment" },
|
|
34
70
|
{
|
|
35
71
|
"type": "array",
|
|
36
|
-
"items": {
|
|
37
|
-
|
|
38
|
-
|
|
72
|
+
"items": { "$ref": "#/$defs/group_segment" }
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"bucket_by": {
|
|
77
|
+
"oneOf": [
|
|
78
|
+
{ "type": "string" },
|
|
79
|
+
{
|
|
80
|
+
"type": "array",
|
|
81
|
+
"items": { "type": "string" }
|
|
39
82
|
},
|
|
40
83
|
{
|
|
41
84
|
"type": "object",
|
|
42
85
|
"properties": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
86
|
+
"or": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"items": { "type": "string" }
|
|
45
89
|
}
|
|
46
|
-
}
|
|
90
|
+
},
|
|
91
|
+
"required": ["or"],
|
|
92
|
+
"additionalProperties": false
|
|
47
93
|
}
|
|
48
94
|
]
|
|
49
95
|
},
|
|
50
|
-
"
|
|
96
|
+
"required_dependency": {
|
|
97
|
+
"oneOf": [
|
|
98
|
+
{ "type": "string" },
|
|
99
|
+
{
|
|
100
|
+
"type": "object",
|
|
101
|
+
"properties": {
|
|
102
|
+
"key": { "type": "string" },
|
|
103
|
+
"variation": { "type": "string" }
|
|
104
|
+
},
|
|
105
|
+
"required": ["key"],
|
|
106
|
+
"additionalProperties": false
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"schema_node": {
|
|
51
111
|
"type": "object",
|
|
52
112
|
"properties": {
|
|
53
|
-
"description": {
|
|
113
|
+
"description": { "type": "string" },
|
|
114
|
+
"schema": { "type": "string" },
|
|
115
|
+
"type": {
|
|
54
116
|
"type": "string",
|
|
55
|
-
"
|
|
117
|
+
"enum": ["boolean", "string", "integer", "double", "object", "array"]
|
|
56
118
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
119
|
+
"enum": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": { "$ref": "#/$defs/value" }
|
|
60
122
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
123
|
+
"const": { "$ref": "#/$defs/value" },
|
|
124
|
+
"minimum": { "type": "number" },
|
|
125
|
+
"maximum": { "type": "number" },
|
|
126
|
+
"minLength": { "type": "number" },
|
|
127
|
+
"maxLength": { "type": "number" },
|
|
128
|
+
"pattern": { "type": "string" },
|
|
129
|
+
"items": { "$ref": "#/$defs/schema_node" },
|
|
130
|
+
"minItems": { "type": "number" },
|
|
131
|
+
"maxItems": { "type": "number" },
|
|
132
|
+
"uniqueItems": { "type": "boolean" },
|
|
133
|
+
"required": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": { "type": "string" }
|
|
66
136
|
},
|
|
67
|
-
"
|
|
137
|
+
"properties": {
|
|
138
|
+
"type": "object",
|
|
139
|
+
"additionalProperties": { "$ref": "#/$defs/schema_node" }
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": { "$ref": "#/$defs/schema_node" },
|
|
142
|
+
"oneOf": {
|
|
68
143
|
"type": "array",
|
|
69
|
-
"items": {
|
|
70
|
-
"type": "object",
|
|
71
|
-
"properties": {
|
|
72
|
-
"deprecated": {
|
|
73
|
-
"type": "boolean",
|
|
74
|
-
"description": "Indicates whether the variable is deprecated or not."
|
|
75
|
-
},
|
|
76
|
-
"key": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"description": "Key of the variable."
|
|
79
|
-
},
|
|
80
|
-
"value": {
|
|
81
|
-
"$ref": "#/$defs/variable_value",
|
|
82
|
-
"description": "Value of the variable."
|
|
83
|
-
},
|
|
84
|
-
"overrides": {
|
|
85
|
-
"type": "array",
|
|
86
|
-
"items": {
|
|
87
|
-
"type": "object",
|
|
88
|
-
"properties": {
|
|
89
|
-
"conditions": {
|
|
90
|
-
"$ref": "segment.json#/$defs/multiple_conditions",
|
|
91
|
-
"description": "Embedded conditions for overriding the variable"
|
|
92
|
-
},
|
|
93
|
-
"segments": {
|
|
94
|
-
"$ref": "#/$defs/segments",
|
|
95
|
-
"description": "Embedded conditions for overriding the variable"
|
|
96
|
-
},
|
|
97
|
-
"value": {
|
|
98
|
-
"$ref": "#/$defs/variable_value",
|
|
99
|
-
"description": "Value of the override."
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"required": ["value"]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"description": "Variables for the variation.",
|
|
107
|
-
"required": ["key"]
|
|
108
|
-
}
|
|
144
|
+
"items": { "$ref": "#/$defs/schema_node" }
|
|
109
145
|
}
|
|
110
146
|
},
|
|
111
|
-
"
|
|
112
|
-
"required": ["value"]
|
|
113
|
-
},
|
|
114
|
-
"segments": {
|
|
115
|
-
"anyOf": [
|
|
116
|
-
{ "$ref": "#/$defs/segments_everyone" },
|
|
117
|
-
{ "$ref": "#/$defs/segments_multiple" },
|
|
118
|
-
{ "$ref": "#/$defs/segments_complex" },
|
|
119
|
-
{ "$ref": "#/$defs/segments_single" }
|
|
120
|
-
],
|
|
121
|
-
"description": "Array of segment keys"
|
|
122
|
-
},
|
|
123
|
-
"segments_everyone": {
|
|
124
|
-
"type": "string",
|
|
125
|
-
"description": "Target everyone",
|
|
126
|
-
"enum": ["*"]
|
|
127
|
-
},
|
|
128
|
-
"segments_single": {
|
|
129
|
-
"type": "string",
|
|
130
|
-
"description": "Target a specific segment"
|
|
147
|
+
"additionalProperties": false
|
|
131
148
|
},
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
{ "
|
|
136
|
-
{ "
|
|
137
|
-
|
|
149
|
+
"variable_schema_entry": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"properties": {
|
|
152
|
+
"deprecated": { "type": "boolean" },
|
|
153
|
+
"schema": { "type": "string" },
|
|
154
|
+
"type": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"enum": ["json", "boolean", "string", "integer", "double", "object", "array"]
|
|
157
|
+
},
|
|
158
|
+
"items": { "$ref": "#/$defs/schema_node" },
|
|
159
|
+
"properties": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"additionalProperties": { "$ref": "#/$defs/schema_node" }
|
|
162
|
+
},
|
|
163
|
+
"additionalProperties": { "$ref": "#/$defs/schema_node" },
|
|
164
|
+
"required": {
|
|
165
|
+
"type": "array",
|
|
166
|
+
"items": { "type": "string" }
|
|
167
|
+
},
|
|
168
|
+
"enum": {
|
|
169
|
+
"type": "array",
|
|
170
|
+
"items": { "$ref": "#/$defs/value" }
|
|
171
|
+
},
|
|
172
|
+
"const": { "$ref": "#/$defs/value" },
|
|
173
|
+
"oneOf": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"items": { "$ref": "#/$defs/schema_node" }
|
|
176
|
+
},
|
|
177
|
+
"minimum": { "type": "number" },
|
|
178
|
+
"maximum": { "type": "number" },
|
|
179
|
+
"minLength": { "type": "number" },
|
|
180
|
+
"maxLength": { "type": "number" },
|
|
181
|
+
"pattern": { "type": "string" },
|
|
182
|
+
"minItems": { "type": "number" },
|
|
183
|
+
"maxItems": { "type": "number" },
|
|
184
|
+
"uniqueItems": { "type": "boolean" },
|
|
185
|
+
"description": { "type": "string" },
|
|
186
|
+
"defaultValue": { "$ref": "#/$defs/value" },
|
|
187
|
+
"disabledValue": { "$ref": "#/$defs/value" },
|
|
188
|
+
"useDefaultWhenDisabled": { "type": "boolean" }
|
|
189
|
+
},
|
|
190
|
+
"required": ["defaultValue"],
|
|
191
|
+
"additionalProperties": false
|
|
138
192
|
},
|
|
139
|
-
"
|
|
193
|
+
"variation_override": {
|
|
140
194
|
"type": "object",
|
|
141
195
|
"properties": {
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
|
|
196
|
+
"conditions": {
|
|
197
|
+
"oneOf": [
|
|
198
|
+
{ "$ref": "segment.json#/$defs/multiple_conditions" },
|
|
199
|
+
{ "$ref": "segment.json#/$defs/complex_condition" },
|
|
200
|
+
{ "$ref": "segment.json#/$defs/plain_condition" }
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
"segments": { "$ref": "#/$defs/group_segments" },
|
|
204
|
+
"value": { "$ref": "#/$defs/value" }
|
|
145
205
|
},
|
|
146
|
-
"
|
|
147
|
-
"
|
|
206
|
+
"required": ["value"],
|
|
207
|
+
"additionalProperties": false
|
|
148
208
|
},
|
|
149
|
-
"
|
|
209
|
+
"variation": {
|
|
150
210
|
"type": "object",
|
|
151
211
|
"properties": {
|
|
152
|
-
"
|
|
153
|
-
|
|
212
|
+
"description": { "type": "string" },
|
|
213
|
+
"value": { "$ref": "#/$defs/variation_value" },
|
|
214
|
+
"weight": {
|
|
215
|
+
"type": "number",
|
|
216
|
+
"minimum": 0,
|
|
217
|
+
"maximum": 100
|
|
218
|
+
},
|
|
219
|
+
"variables": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"additionalProperties": { "$ref": "#/$defs/value_or_null" }
|
|
222
|
+
},
|
|
223
|
+
"variableOverrides": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"additionalProperties": {
|
|
226
|
+
"type": "array",
|
|
227
|
+
"items": { "$ref": "#/$defs/variation_override" }
|
|
228
|
+
}
|
|
154
229
|
}
|
|
155
230
|
},
|
|
156
|
-
"
|
|
157
|
-
"
|
|
231
|
+
"required": ["value", "weight"],
|
|
232
|
+
"additionalProperties": false
|
|
158
233
|
},
|
|
159
|
-
"
|
|
234
|
+
"rule": {
|
|
160
235
|
"type": "object",
|
|
161
236
|
"properties": {
|
|
162
|
-
"
|
|
163
|
-
|
|
237
|
+
"key": { "type": "string" },
|
|
238
|
+
"description": { "type": "string" },
|
|
239
|
+
"segments": { "$ref": "#/$defs/group_segments" },
|
|
240
|
+
"percentage": {
|
|
241
|
+
"type": "number",
|
|
242
|
+
"minimum": 0,
|
|
243
|
+
"maximum": 100
|
|
244
|
+
},
|
|
245
|
+
"enabled": { "type": "boolean" },
|
|
246
|
+
"variation": { "$ref": "#/$defs/variation_value" },
|
|
247
|
+
"variables": {
|
|
248
|
+
"type": "object",
|
|
249
|
+
"additionalProperties": { "$ref": "#/$defs/value_or_null" }
|
|
250
|
+
},
|
|
251
|
+
"variationWeights": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"additionalProperties": {
|
|
254
|
+
"type": "number",
|
|
255
|
+
"minimum": 0,
|
|
256
|
+
"maximum": 100
|
|
257
|
+
}
|
|
164
258
|
}
|
|
165
259
|
},
|
|
166
|
-
"
|
|
167
|
-
"
|
|
260
|
+
"required": ["key", "segments", "percentage"],
|
|
261
|
+
"additionalProperties": false
|
|
168
262
|
},
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
263
|
+
"force_item": {
|
|
264
|
+
"oneOf": [
|
|
265
|
+
{
|
|
266
|
+
"type": "object",
|
|
267
|
+
"properties": {
|
|
268
|
+
"segments": { "$ref": "#/$defs/group_segments" },
|
|
269
|
+
"enabled": { "type": "boolean" },
|
|
270
|
+
"variation": { "$ref": "#/$defs/variation_value" },
|
|
271
|
+
"variables": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"additionalProperties": { "$ref": "#/$defs/value_or_null" }
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"required": ["segments"],
|
|
277
|
+
"additionalProperties": false
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "object",
|
|
281
|
+
"properties": {
|
|
282
|
+
"conditions": {
|
|
283
|
+
"oneOf": [
|
|
284
|
+
{ "$ref": "segment.json#/$defs/multiple_conditions" },
|
|
285
|
+
{ "$ref": "segment.json#/$defs/complex_condition" },
|
|
286
|
+
{ "$ref": "segment.json#/$defs/plain_condition" }
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"enabled": { "type": "boolean" },
|
|
290
|
+
"variation": { "$ref": "#/$defs/variation_value" },
|
|
291
|
+
"variables": {
|
|
292
|
+
"type": "object",
|
|
293
|
+
"additionalProperties": { "$ref": "#/$defs/value_or_null" }
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"required": ["conditions"],
|
|
297
|
+
"additionalProperties": false
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"expose_value": {
|
|
302
|
+
"oneOf": [
|
|
303
|
+
{ "type": "boolean" },
|
|
304
|
+
{
|
|
305
|
+
"type": "array",
|
|
306
|
+
"items": { "type": "string" }
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
"rules_container": {
|
|
311
|
+
"oneOf": [
|
|
312
|
+
{
|
|
313
|
+
"type": "array",
|
|
314
|
+
"items": { "$ref": "#/$defs/rule" }
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"type": "object",
|
|
318
|
+
"additionalProperties": {
|
|
319
|
+
"type": "array",
|
|
320
|
+
"items": { "$ref": "#/$defs/rule" }
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"force_container": {
|
|
326
|
+
"oneOf": [
|
|
327
|
+
{
|
|
328
|
+
"type": "array",
|
|
329
|
+
"items": { "$ref": "#/$defs/force_item" }
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"type": "object",
|
|
333
|
+
"additionalProperties": {
|
|
334
|
+
"type": "array",
|
|
335
|
+
"items": { "$ref": "#/$defs/force_item" }
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
},
|
|
340
|
+
"expose_container": {
|
|
341
|
+
"oneOf": [
|
|
342
|
+
{ "$ref": "#/$defs/expose_value" },
|
|
343
|
+
{
|
|
344
|
+
"type": "object",
|
|
345
|
+
"additionalProperties": { "$ref": "#/$defs/expose_value" }
|
|
346
|
+
}
|
|
347
|
+
]
|
|
175
348
|
}
|
|
176
349
|
},
|
|
177
350
|
"type": "object",
|
|
@@ -180,134 +353,42 @@
|
|
|
180
353
|
"type": "boolean",
|
|
181
354
|
"description": "Indicates whether the feature is archived or not."
|
|
182
355
|
},
|
|
356
|
+
"deprecated": {
|
|
357
|
+
"type": "boolean",
|
|
358
|
+
"description": "Indicates whether the feature is deprecated or not."
|
|
359
|
+
},
|
|
183
360
|
"description": {
|
|
184
361
|
"type": "string",
|
|
185
362
|
"description": "Human readable description of the feature for documentation purposes."
|
|
186
363
|
},
|
|
187
364
|
"tags": {
|
|
188
365
|
"type": "array",
|
|
189
|
-
"items": {
|
|
190
|
-
"type": "string"
|
|
191
|
-
},
|
|
366
|
+
"items": { "type": "string" },
|
|
192
367
|
"description": "Array of tags"
|
|
193
368
|
},
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
369
|
+
"required": {
|
|
370
|
+
"type": "array",
|
|
371
|
+
"items": { "$ref": "#/$defs/required_dependency" }
|
|
372
|
+
},
|
|
373
|
+
"bucketBy": {
|
|
374
|
+
"$ref": "#/$defs/bucket_by"
|
|
375
|
+
},
|
|
376
|
+
"disabledVariationValue": {
|
|
377
|
+
"$ref": "#/$defs/variation_value"
|
|
197
378
|
},
|
|
198
379
|
"variablesSchema": {
|
|
199
|
-
"type": "
|
|
200
|
-
"
|
|
201
|
-
"type": "object",
|
|
202
|
-
"properties": {
|
|
203
|
-
"key": {
|
|
204
|
-
"type": "string",
|
|
205
|
-
"description": "Key of the variable."
|
|
206
|
-
},
|
|
207
|
-
"type": {
|
|
208
|
-
"type": "string",
|
|
209
|
-
"description": "Type of this specific variable.",
|
|
210
|
-
"enum": ["string", "boolean", "integer", "double", "json", "array", "object"]
|
|
211
|
-
},
|
|
212
|
-
"defaultValue": {
|
|
213
|
-
"$ref": "#/$defs/variable_value",
|
|
214
|
-
"description": "Default value for this specific variable."
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
"description": "Schema for the feature's variables.",
|
|
218
|
-
"required": ["type"]
|
|
219
|
-
}
|
|
380
|
+
"type": "object",
|
|
381
|
+
"additionalProperties": { "$ref": "#/$defs/variable_schema_entry" }
|
|
220
382
|
},
|
|
221
383
|
"variations": {
|
|
222
384
|
"type": "array",
|
|
223
|
-
"items": {
|
|
224
|
-
"$ref": "#/$defs/variation"
|
|
225
|
-
},
|
|
226
|
-
"description": "Array of variations for the feature."
|
|
385
|
+
"items": { "$ref": "#/$defs/variation" }
|
|
227
386
|
},
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"properties": {
|
|
232
|
-
"exposed": {
|
|
233
|
-
"type": "boolean",
|
|
234
|
-
"description": "Indicates whether the feature is exposed to the environment."
|
|
235
|
-
},
|
|
236
|
-
"rules": {
|
|
237
|
-
"type": "array",
|
|
238
|
-
"items": {
|
|
239
|
-
"type": "object",
|
|
240
|
-
"properties": {
|
|
241
|
-
"key": {
|
|
242
|
-
"type": "string",
|
|
243
|
-
"description": "Unique key of the rule among its siblings."
|
|
244
|
-
},
|
|
245
|
-
"segments": {
|
|
246
|
-
"$ref": "#/$defs/segments",
|
|
247
|
-
"description": "Embedded conditions for the rule"
|
|
248
|
-
},
|
|
249
|
-
"percentage": {
|
|
250
|
-
"type": "number",
|
|
251
|
-
"description": "Percentage of the rule between 0 and 100 (inclusive).",
|
|
252
|
-
"minimum": 0,
|
|
253
|
-
"maximum": 100
|
|
254
|
-
},
|
|
255
|
-
"variation": {
|
|
256
|
-
"$ref": "#/$defs/variation_value",
|
|
257
|
-
"description": "Overriding variation value for this rule"
|
|
258
|
-
},
|
|
259
|
-
"variables": {
|
|
260
|
-
"additionalProperties": {
|
|
261
|
-
"$ref": "#/$defs/variable_value",
|
|
262
|
-
"description": "Overriding variable value for this rule"
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
"description": "Array of rules for the feature.",
|
|
268
|
-
"required": ["key", "percentage", "segments"]
|
|
269
|
-
},
|
|
270
|
-
"force": {
|
|
271
|
-
"type": "array",
|
|
272
|
-
"items": {
|
|
273
|
-
"type": "object",
|
|
274
|
-
"properties": {
|
|
275
|
-
"segments": {
|
|
276
|
-
"$ref": "#/$defs/segments",
|
|
277
|
-
"description": "Embedded segments"
|
|
278
|
-
},
|
|
279
|
-
"conditions": {
|
|
280
|
-
"oneOf": [
|
|
281
|
-
{
|
|
282
|
-
"$ref": "segment.json#/$defs/multiple_conditions"
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
"$ref": "segment.json#/$defs/complex_condition"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"$ref": "segment.json#/$defs/plain_condition"
|
|
289
|
-
}
|
|
290
|
-
]
|
|
291
|
-
},
|
|
292
|
-
"variation": {
|
|
293
|
-
"$ref": "#/$defs/variation_value",
|
|
294
|
-
"description": "Overriding variation value"
|
|
295
|
-
},
|
|
296
|
-
"variables": {
|
|
297
|
-
"additionalProperties": {
|
|
298
|
-
"$ref": "#/$defs/variable_value",
|
|
299
|
-
"description": "Overriding variable value"
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
"description": "Environment specific configuration for the feature.",
|
|
307
|
-
"required": ["rules"]
|
|
308
|
-
}
|
|
309
|
-
}
|
|
387
|
+
"expose": { "$ref": "#/$defs/expose_container" },
|
|
388
|
+
"force": { "$ref": "#/$defs/force_container" },
|
|
389
|
+
"rules": { "$ref": "#/$defs/rules_container" }
|
|
310
390
|
},
|
|
311
|
-
"
|
|
312
|
-
"
|
|
391
|
+
"required": ["description", "tags", "bucketBy", "rules"],
|
|
392
|
+
"additionalProperties": false,
|
|
393
|
+
"description": "JSON Schema for creating Featurevisor feature, expressed in YAML"
|
|
313
394
|
}
|