@featurevisor/core 3.1.0 → 3.2.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 (208) hide show
  1. package/lib/datasource/datasource.d.ts +1 -1
  2. package/lib/datasource/datasource.js +4 -14
  3. package/lib/datasource/datasource.js.map +1 -1
  4. package/lib/datasource/requiredFeatures.d.ts +7 -0
  5. package/lib/datasource/requiredFeatures.js +38 -0
  6. package/lib/datasource/requiredFeatures.js.map +1 -0
  7. package/lib/linter/checkCircularDependency.d.ts +1 -1
  8. package/lib/linter/checkCircularDependency.js +3 -22
  9. package/lib/linter/checkCircularDependency.js.map +1 -1
  10. package/lib/linter/conditionSchema.js +27 -3
  11. package/lib/linter/conditionSchema.js.map +1 -1
  12. package/lib/tester/testFeature.js +17 -16
  13. package/lib/tester/testFeature.js.map +1 -1
  14. package/package.json +10 -7
  15. package/CHANGELOG.md +0 -2246
  16. package/coverage/clover.xml +0 -5456
  17. package/coverage/coverage-final.json +0 -64
  18. package/coverage/lcov-report/base.css +0 -224
  19. package/coverage/lcov-report/block-navigation.js +0 -87
  20. package/coverage/lcov-report/favicon.png +0 -0
  21. package/coverage/lcov-report/index.html +0 -371
  22. package/coverage/lcov-report/prettify.css +0 -1
  23. package/coverage/lcov-report/prettify.js +0 -2
  24. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  25. package/coverage/lcov-report/sorter.js +0 -210
  26. package/coverage/lcov-report/src/assess-distribution/index.html +0 -116
  27. package/coverage/lcov-report/src/assess-distribution/index.ts.html +0 -754
  28. package/coverage/lcov-report/src/benchmark/index.html +0 -116
  29. package/coverage/lcov-report/src/benchmark/index.ts.html +0 -793
  30. package/coverage/lcov-report/src/builder/allocator.ts.html +0 -220
  31. package/coverage/lcov-report/src/builder/applyContextToConditions.ts.html +0 -502
  32. package/coverage/lcov-report/src/builder/applyContextToDatafile.ts.html +0 -772
  33. package/coverage/lcov-report/src/builder/applyContextToSegments.ts.html +0 -580
  34. package/coverage/lcov-report/src/builder/buildDatafile.ts.html +0 -2053
  35. package/coverage/lcov-report/src/builder/buildProject.ts.html +0 -1117
  36. package/coverage/lcov-report/src/builder/buildRuntimeDatafiles.ts.html +0 -256
  37. package/coverage/lcov-report/src/builder/getFeatureRanges.ts.html +0 -268
  38. package/coverage/lcov-report/src/builder/hashes.ts.html +0 -412
  39. package/coverage/lcov-report/src/builder/index.html +0 -311
  40. package/coverage/lcov-report/src/builder/index.ts.html +0 -91
  41. package/coverage/lcov-report/src/builder/mutateVariables.ts.html +0 -421
  42. package/coverage/lcov-report/src/builder/mutator.ts.html +0 -796
  43. package/coverage/lcov-report/src/builder/revision.ts.html +0 -151
  44. package/coverage/lcov-report/src/builder/traffic.ts.html +0 -661
  45. package/coverage/lcov-report/src/cli/cli.ts.html +0 -400
  46. package/coverage/lcov-report/src/cli/index.html +0 -131
  47. package/coverage/lcov-report/src/cli/plugins.ts.html +0 -214
  48. package/coverage/lcov-report/src/config/index.html +0 -131
  49. package/coverage/lcov-report/src/config/index.ts.html +0 -88
  50. package/coverage/lcov-report/src/config/projectConfig.ts.html +0 -925
  51. package/coverage/lcov-report/src/datasource/adapter.ts.html +0 -253
  52. package/coverage/lcov-report/src/datasource/datasource.ts.html +0 -1000
  53. package/coverage/lcov-report/src/datasource/filesystemAdapter.ts.html +0 -1576
  54. package/coverage/lcov-report/src/datasource/index.html +0 -161
  55. package/coverage/lcov-report/src/datasource/index.ts.html +0 -94
  56. package/coverage/lcov-report/src/evaluate/index.html +0 -116
  57. package/coverage/lcov-report/src/evaluate/index.ts.html +0 -814
  58. package/coverage/lcov-report/src/find-duplicate-segments/findDuplicateSegments.ts.html +0 -313
  59. package/coverage/lcov-report/src/find-duplicate-segments/index.html +0 -131
  60. package/coverage/lcov-report/src/find-duplicate-segments/index.ts.html +0 -307
  61. package/coverage/lcov-report/src/find-usage/index.html +0 -116
  62. package/coverage/lcov-report/src/find-usage/index.ts.html +0 -1780
  63. package/coverage/lcov-report/src/generate-code/index.html +0 -131
  64. package/coverage/lcov-report/src/generate-code/index.ts.html +0 -403
  65. package/coverage/lcov-report/src/generate-code/typescript.ts.html +0 -1909
  66. package/coverage/lcov-report/src/index.html +0 -131
  67. package/coverage/lcov-report/src/info/index.html +0 -116
  68. package/coverage/lcov-report/src/info/index.ts.html +0 -472
  69. package/coverage/lcov-report/src/init/index.html +0 -116
  70. package/coverage/lcov-report/src/init/index.ts.html +0 -280
  71. package/coverage/lcov-report/src/linter/attributeSchema.ts.html +0 -1963
  72. package/coverage/lcov-report/src/linter/checkCircularDependency.ts.html +0 -220
  73. package/coverage/lcov-report/src/linter/checkPercentageExceedingSlot.ts.html +0 -268
  74. package/coverage/lcov-report/src/linter/conditionSchema.ts.html +0 -2224
  75. package/coverage/lcov-report/src/linter/featureSchema.ts.html +0 -5851
  76. package/coverage/lcov-report/src/linter/groupSchema.ts.html +0 -226
  77. package/coverage/lcov-report/src/linter/index.html +0 -326
  78. package/coverage/lcov-report/src/linter/index.ts.html +0 -88
  79. package/coverage/lcov-report/src/linter/lintProject.ts.html +0 -2704
  80. package/coverage/lcov-report/src/linter/mutationNotation.ts.html +0 -1411
  81. package/coverage/lcov-report/src/linter/printError.ts.html +0 -289
  82. package/coverage/lcov-report/src/linter/schema.ts.html +0 -1558
  83. package/coverage/lcov-report/src/linter/segmentSchema.ts.html +0 -139
  84. package/coverage/lcov-report/src/linter/targetSchema.ts.html +0 -223
  85. package/coverage/lcov-report/src/linter/testSchema.ts.html +0 -529
  86. package/coverage/lcov-report/src/linter/zodHelpers.ts.html +0 -133
  87. package/coverage/lcov-report/src/list/index.html +0 -131
  88. package/coverage/lcov-report/src/list/index.ts.html +0 -2065
  89. package/coverage/lcov-report/src/list/matrix.ts.html +0 -721
  90. package/coverage/lcov-report/src/promoter/index.html +0 -116
  91. package/coverage/lcov-report/src/promoter/index.ts.html +0 -3883
  92. package/coverage/lcov-report/src/sets.ts.html +0 -313
  93. package/coverage/lcov-report/src/targeting.ts.html +0 -403
  94. package/coverage/lcov-report/src/tester/cliFormat.ts.html +0 -133
  95. package/coverage/lcov-report/src/tester/helpers.ts.html +0 -313
  96. package/coverage/lcov-report/src/tester/index.html +0 -206
  97. package/coverage/lcov-report/src/tester/prettyDuration.ts.html +0 -187
  98. package/coverage/lcov-report/src/tester/printTestResult.ts.html +0 -337
  99. package/coverage/lcov-report/src/tester/testFeature.ts.html +0 -1186
  100. package/coverage/lcov-report/src/tester/testProject.ts.html +0 -1018
  101. package/coverage/lcov-report/src/tester/testSegment.ts.html +0 -316
  102. package/coverage/lcov-report/src/utils/extractKeys.ts.html +0 -493
  103. package/coverage/lcov-report/src/utils/git.ts.html +0 -559
  104. package/coverage/lcov-report/src/utils/index.html +0 -161
  105. package/coverage/lcov-report/src/utils/index.ts.html +0 -94
  106. package/coverage/lcov-report/src/utils/pretty.ts.html +0 -121
  107. package/coverage/lcov.info +0 -11615
  108. package/jest.config.js +0 -22
  109. package/json-schema/README.md +0 -5
  110. package/json-schema/attribute.json +0 -40
  111. package/json-schema/feature.json +0 -394
  112. package/json-schema/segment.json +0 -137
  113. package/src/assess-distribution/index.ts +0 -223
  114. package/src/benchmark/index.ts +0 -236
  115. package/src/builder/allocator.spec.ts +0 -105
  116. package/src/builder/allocator.ts +0 -45
  117. package/src/builder/applyContextToConditions.spec.ts +0 -2677
  118. package/src/builder/applyContextToConditions.ts +0 -139
  119. package/src/builder/applyContextToDatafile.spec.ts +0 -2626
  120. package/src/builder/applyContextToDatafile.ts +0 -229
  121. package/src/builder/applyContextToSegments.spec.ts +0 -1593
  122. package/src/builder/applyContextToSegments.ts +0 -165
  123. package/src/builder/buildDatafile.spec.ts +0 -445
  124. package/src/builder/buildDatafile.ts +0 -656
  125. package/src/builder/buildProject.ts +0 -344
  126. package/src/builder/buildRuntimeDatafiles.ts +0 -57
  127. package/src/builder/getFeatureRanges.ts +0 -61
  128. package/src/builder/hashes.ts +0 -109
  129. package/src/builder/index.ts +0 -2
  130. package/src/builder/mutateVariables.spec.ts +0 -1179
  131. package/src/builder/mutateVariables.ts +0 -112
  132. package/src/builder/mutator.spec.ts +0 -413
  133. package/src/builder/mutator.ts +0 -237
  134. package/src/builder/revision.spec.ts +0 -22
  135. package/src/builder/revision.ts +0 -22
  136. package/src/builder/traffic.spec.ts +0 -946
  137. package/src/builder/traffic.ts +0 -192
  138. package/src/cli/cli.ts +0 -105
  139. package/src/cli/index.ts +0 -2
  140. package/src/cli/plugins.ts +0 -43
  141. package/src/config/index.ts +0 -1
  142. package/src/config/projectConfig.spec.ts +0 -194
  143. package/src/config/projectConfig.ts +0 -280
  144. package/src/datasource/adapter.ts +0 -56
  145. package/src/datasource/datasource.ts +0 -305
  146. package/src/datasource/filesystemAdapter.spec.ts +0 -212
  147. package/src/datasource/filesystemAdapter.ts +0 -497
  148. package/src/datasource/index.ts +0 -3
  149. package/src/dependencies.ts +0 -13
  150. package/src/evaluate/index.ts +0 -243
  151. package/src/find-duplicate-segments/findDuplicateSegments.ts +0 -76
  152. package/src/find-duplicate-segments/index.ts +0 -74
  153. package/src/find-usage/index.ts +0 -565
  154. package/src/generate-code/index.ts +0 -106
  155. package/src/generate-code/typescript.spec.ts +0 -214
  156. package/src/generate-code/typescript.ts +0 -608
  157. package/src/index.ts +0 -20
  158. package/src/info/index.ts +0 -129
  159. package/src/init/index.ts +0 -65
  160. package/src/linter/attributeSchema.spec.ts +0 -342
  161. package/src/linter/attributeSchema.ts +0 -626
  162. package/src/linter/checkCircularDependency.ts +0 -45
  163. package/src/linter/checkPercentageExceedingSlot.ts +0 -61
  164. package/src/linter/conditionSchema.spec.ts +0 -510
  165. package/src/linter/conditionSchema.ts +0 -713
  166. package/src/linter/featureSchema.spec.ts +0 -1985
  167. package/src/linter/featureSchema.ts +0 -1922
  168. package/src/linter/groupSchema.ts +0 -47
  169. package/src/linter/index.ts +0 -1
  170. package/src/linter/lintProject.spec.ts +0 -336
  171. package/src/linter/lintProject.ts +0 -873
  172. package/src/linter/mutationNotation.spec.ts +0 -704
  173. package/src/linter/mutationNotation.ts +0 -442
  174. package/src/linter/printError.ts +0 -68
  175. package/src/linter/schema.spec.ts +0 -690
  176. package/src/linter/schema.ts +0 -491
  177. package/src/linter/segmentSchema.spec.ts +0 -358
  178. package/src/linter/segmentSchema.ts +0 -18
  179. package/src/linter/targetSchema.spec.ts +0 -159
  180. package/src/linter/targetSchema.ts +0 -46
  181. package/src/linter/testSchema.spec.ts +0 -258
  182. package/src/linter/testSchema.ts +0 -148
  183. package/src/linter/zodHelpers.ts +0 -16
  184. package/src/list/index.spec.ts +0 -135
  185. package/src/list/index.ts +0 -660
  186. package/src/list/matrix.spec.ts +0 -49
  187. package/src/list/matrix.ts +0 -212
  188. package/src/promoter/index.spec.ts +0 -617
  189. package/src/promoter/index.ts +0 -1266
  190. package/src/sets.ts +0 -76
  191. package/src/targeting.spec.ts +0 -74
  192. package/src/targeting.ts +0 -106
  193. package/src/tester/cliFormat.ts +0 -16
  194. package/src/tester/helpers.spec.ts +0 -149
  195. package/src/tester/helpers.ts +0 -76
  196. package/src/tester/index.ts +0 -2
  197. package/src/tester/prettyDuration.ts +0 -34
  198. package/src/tester/printTestResult.ts +0 -84
  199. package/src/tester/testFeature.ts +0 -367
  200. package/src/tester/testProject.spec.ts +0 -50
  201. package/src/tester/testProject.ts +0 -311
  202. package/src/tester/testSegment.ts +0 -77
  203. package/src/utils/extractKeys.ts +0 -136
  204. package/src/utils/git.ts +0 -158
  205. package/src/utils/index.ts +0 -3
  206. package/src/utils/pretty.ts +0 -12
  207. package/tsconfig.cjs.json +0 -13
  208. package/tsconfig.typecheck.json +0 -9
package/jest.config.js DELETED
@@ -1,22 +0,0 @@
1
- module.exports = {
2
- bail: true,
3
- transform: {
4
- "^.+\\.[tj]sx?$": [
5
- "@swc/jest",
6
- {
7
- jsc: { parser: { syntax: "typescript", tsx: true } },
8
- module: { type: "commonjs" },
9
- },
10
- ],
11
- },
12
- testMatch: ["<rootDir>/src/**/*.spec.ts"],
13
- collectCoverageFrom: ["src/**/*.ts", "!src/**/*.spec.ts"],
14
- coverageThreshold: {
15
- global: {
16
- statements: 58,
17
- branches: 59,
18
- functions: 63,
19
- lines: 59,
20
- },
21
- },
22
- };
@@ -1,5 +0,0 @@
1
- # JSON Schema
2
-
3
- Featurevisor attribute, segment, and feature JSON schemas are defined in this directory.
4
-
5
- They are not directly used anywhere in the codebase, and only kept here for reference.
@@ -1,40 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "archived": {
6
- "type": "boolean",
7
- "description": "Indicates whether the attribute is archived or not."
8
- },
9
- "type": {
10
- "type": "string",
11
- "description": "Type of attribute.",
12
- "enum": ["boolean", "string", "integer", "double", "date", "semver", "object", "array"]
13
- },
14
- "description": {
15
- "type": "string",
16
- "description": "Human readable description of the attribute for documentation purposes."
17
- },
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
- }
35
- }
36
- },
37
- "required": ["description", "type"],
38
- "additionalProperties": false,
39
- "description": "JSON Schema for creating Featurevisor attribute, expressed in YAML"
40
- }
@@ -1,394 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$defs": {
4
- "value": {
5
- "oneOf": [
6
- { "type": "boolean" },
7
- { "type": "string" },
8
- { "type": "number" },
9
- {
10
- "type": "object",
11
- "additionalProperties": { "$ref": "#/$defs/value" }
12
- },
13
- {
14
- "type": "array",
15
- "items": { "$ref": "#/$defs/value" }
16
- }
17
- ]
18
- },
19
- "value_or_null": {
20
- "oneOf": [{ "$ref": "#/$defs/value" }, { "type": "null" }]
21
- },
22
- "variation_value": {
23
- "type": "string",
24
- "minLength": 1
25
- },
26
- "group_segment": {
27
- "oneOf": [
28
- {
29
- "type": "string",
30
- "description": "Segment key or *"
31
- },
32
- {
33
- "type": "object",
34
- "properties": {
35
- "and": {
36
- "type": "array",
37
- "items": { "$ref": "#/$defs/group_segment" }
38
- }
39
- },
40
- "required": ["and"],
41
- "additionalProperties": false
42
- },
43
- {
44
- "type": "object",
45
- "properties": {
46
- "or": {
47
- "type": "array",
48
- "items": { "$ref": "#/$defs/group_segment" }
49
- }
50
- },
51
- "required": ["or"],
52
- "additionalProperties": false
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" },
70
- {
71
- "type": "array",
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" }
82
- },
83
- {
84
- "type": "object",
85
- "properties": {
86
- "or": {
87
- "type": "array",
88
- "items": { "type": "string" }
89
- }
90
- },
91
- "required": ["or"],
92
- "additionalProperties": false
93
- }
94
- ]
95
- },
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": {
111
- "type": "object",
112
- "properties": {
113
- "description": { "type": "string" },
114
- "schema": { "type": "string" },
115
- "type": {
116
- "type": "string",
117
- "enum": ["boolean", "string", "integer", "double", "object", "array"]
118
- },
119
- "enum": {
120
- "type": "array",
121
- "items": { "$ref": "#/$defs/value" }
122
- },
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" }
136
- },
137
- "properties": {
138
- "type": "object",
139
- "additionalProperties": { "$ref": "#/$defs/schema_node" }
140
- },
141
- "additionalProperties": { "$ref": "#/$defs/schema_node" },
142
- "oneOf": {
143
- "type": "array",
144
- "items": { "$ref": "#/$defs/schema_node" }
145
- }
146
- },
147
- "additionalProperties": false
148
- },
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
192
- },
193
- "variation_override": {
194
- "type": "object",
195
- "properties": {
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" }
205
- },
206
- "required": ["value"],
207
- "additionalProperties": false
208
- },
209
- "variation": {
210
- "type": "object",
211
- "properties": {
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
- }
229
- }
230
- },
231
- "required": ["value", "weight"],
232
- "additionalProperties": false
233
- },
234
- "rule": {
235
- "type": "object",
236
- "properties": {
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
- }
258
- }
259
- },
260
- "required": ["key", "segments", "percentage"],
261
- "additionalProperties": false
262
- },
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
- ]
348
- }
349
- },
350
- "type": "object",
351
- "properties": {
352
- "archived": {
353
- "type": "boolean",
354
- "description": "Indicates whether the feature is archived or not."
355
- },
356
- "deprecated": {
357
- "type": "boolean",
358
- "description": "Indicates whether the feature is deprecated or not."
359
- },
360
- "description": {
361
- "type": "string",
362
- "description": "Human readable description of the feature for documentation purposes."
363
- },
364
- "tags": {
365
- "type": "array",
366
- "items": { "type": "string" },
367
- "description": "Array of tags"
368
- },
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"
378
- },
379
- "variablesSchema": {
380
- "type": "object",
381
- "additionalProperties": { "$ref": "#/$defs/variable_schema_entry" }
382
- },
383
- "variations": {
384
- "type": "array",
385
- "items": { "$ref": "#/$defs/variation" }
386
- },
387
- "expose": { "$ref": "#/$defs/expose_container" },
388
- "force": { "$ref": "#/$defs/force_container" },
389
- "rules": { "$ref": "#/$defs/rules_container" }
390
- },
391
- "required": ["description", "tags", "bucketBy", "rules"],
392
- "additionalProperties": false,
393
- "description": "JSON Schema for creating Featurevisor feature, expressed in YAML"
394
- }
@@ -1,137 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$defs": {
4
- "plain_condition": {
5
- "type": "object",
6
- "properties": {
7
- "attribute": {
8
- "type": "string",
9
- "description": "Name of the attribute to be used in the condition."
10
- },
11
- "operator": {
12
- "type": "string",
13
- "description": "Operator to be used in the condition.",
14
- "enum": [
15
- "equals",
16
- "notEquals",
17
- "greaterThan",
18
- "greaterThanOrEquals",
19
- "lessThan",
20
- "lessThanOrEquals",
21
- "contains",
22
- "notContains",
23
- "startsWith",
24
- "endsWith",
25
- "includes",
26
- "notIncludes",
27
- "semverEquals",
28
- "semverNotEquals",
29
- "semverGreaterThan",
30
- "semverGreaterThanOrEquals",
31
- "semverLessThan",
32
- "semverLessThanOrEquals",
33
- "before",
34
- "after",
35
- "in",
36
- "notIn",
37
- "matches",
38
- "notMatches",
39
- "exists",
40
- "notExists"
41
- ]
42
- },
43
- "value": {
44
- "anyOf": [
45
- { "type": "string" },
46
- { "type": "number" },
47
- { "type": "boolean" },
48
- {
49
- "type": "array",
50
- "items": { "type": "string" }
51
- },
52
- { "type": "null" }
53
- ],
54
- "description": "Value for the condition."
55
- },
56
- "regexFlags": {
57
- "type": "string",
58
- "description": "Regex flags for matches/notMatches operators."
59
- }
60
- },
61
- "required": ["attribute", "operator"],
62
- "additionalProperties": false
63
- },
64
- "and_condition": {
65
- "type": "object",
66
- "properties": {
67
- "and": {
68
- "type": "array",
69
- "items": { "$ref": "#/$defs/condition" },
70
- "description": "The list of conditions to be combined with the 'and' operator."
71
- }
72
- },
73
- "required": ["and"],
74
- "additionalProperties": false
75
- },
76
- "or_condition": {
77
- "type": "object",
78
- "properties": {
79
- "or": {
80
- "type": "array",
81
- "items": { "$ref": "#/$defs/condition" },
82
- "description": "The list of conditions to be combined with the 'or' operator."
83
- }
84
- },
85
- "required": ["or"],
86
- "additionalProperties": false
87
- },
88
- "not_condition": {
89
- "type": "object",
90
- "properties": {
91
- "not": {
92
- "type": "array",
93
- "items": { "$ref": "#/$defs/condition" },
94
- "description": "The list of conditions to be combined with the 'not' operator."
95
- }
96
- },
97
- "required": ["not"],
98
- "additionalProperties": false
99
- },
100
- "complex_condition": {
101
- "oneOf": [
102
- { "$ref": "#/$defs/and_condition" },
103
- { "$ref": "#/$defs/or_condition" },
104
- { "$ref": "#/$defs/not_condition" }
105
- ]
106
- },
107
- "condition": {
108
- "oneOf": [{ "$ref": "#/$defs/plain_condition" }, { "$ref": "#/$defs/complex_condition" }]
109
- },
110
- "multiple_conditions": {
111
- "type": "array",
112
- "items": { "$ref": "#/$defs/condition" }
113
- }
114
- },
115
- "type": "object",
116
- "properties": {
117
- "archived": {
118
- "type": "boolean",
119
- "description": "Indicates whether the segment is archived or not."
120
- },
121
- "description": {
122
- "type": "string",
123
- "description": "Human readable description of the segment for documentation purposes."
124
- },
125
- "conditions": {
126
- "oneOf": [
127
- { "const": "*" },
128
- { "$ref": "#/$defs/condition" },
129
- { "$ref": "#/$defs/multiple_conditions" }
130
- ],
131
- "description": "The set of conditions to be evaluated for the segment."
132
- }
133
- },
134
- "required": ["description", "conditions"],
135
- "additionalProperties": false,
136
- "description": "JSON Schema for creating Featurevisor segment, expressed in YAML"
137
- }