@featurevisor/types 2.6.7 → 2.10.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/package.json +2 -2
- package/src/feature.d.ts +10 -16
- package/src/index.d.ts +1 -0
- package/src/property.d.ts +55 -0
- package/src/test.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.10.0](https://github.com/featurevisor/featurevisor/compare/v2.9.0...v2.10.0) (2026-02-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* typed arrays and objects as variables ([#388](https://github.com/featurevisor/featurevisor/issues/388)) ([5909f42](https://github.com/featurevisor/featurevisor/commit/5909f42b93c55a71d3f43fd7a2a58287ac82af7f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.7.0](https://github.com/featurevisor/featurevisor/compare/v2.6.7...v2.7.0) (2026-02-05)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* test by tags ([#383](https://github.com/featurevisor/featurevisor/issues/383)) ([54ddbca](https://github.com/featurevisor/featurevisor/commit/54ddbcaa271fea09008a1064ee58bdb2dbb8fcb9))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.6.7](https://github.com/featurevisor/featurevisor/compare/v2.6.6...v2.6.7) (2026-02-05)
|
|
7
29
|
|
|
8
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featurevisor/types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Common Typescript types for Featurevisor",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "https://github.com/featurevisor/featurevisor/issues"
|
|
48
48
|
},
|
|
49
49
|
"license": "MIT",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "0cbe15fb45fd08ebd70125f1604ae7fe7e20756a"
|
|
51
51
|
}
|
package/src/feature.d.ts
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import type { BucketBy } from "./bucket";
|
|
2
2
|
import type { Condition } from "./condition";
|
|
3
3
|
import type { GroupSegment } from "./segment";
|
|
4
|
+
import type { PropertyType, Value, PropertySchema } from "./property";
|
|
4
5
|
|
|
5
6
|
export type VariationValue = string;
|
|
6
7
|
|
|
7
8
|
export type VariableKey = string;
|
|
8
|
-
export type VariableType =
|
|
9
|
-
| "boolean"
|
|
10
|
-
| "string"
|
|
11
|
-
| "integer"
|
|
12
|
-
| "double"
|
|
13
|
-
| "array"
|
|
14
|
-
| "object"
|
|
15
|
-
| "json";
|
|
16
|
-
export interface VariableObjectValue {
|
|
17
|
-
[key: string]: VariableValue;
|
|
18
|
-
}
|
|
9
|
+
export type VariableType = PropertyType | "json";
|
|
19
10
|
export type VariableValue =
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
| number
|
|
23
|
-
| string[]
|
|
24
|
-
| VariableObjectValue
|
|
11
|
+
| Value
|
|
12
|
+
// @TODO: consider removing below items
|
|
25
13
|
| null
|
|
26
14
|
| undefined;
|
|
27
15
|
|
|
@@ -75,7 +63,13 @@ export interface VariableSchema {
|
|
|
75
63
|
deprecated?: boolean;
|
|
76
64
|
key?: VariableKey; // @NOTE: remove
|
|
77
65
|
type: VariableType;
|
|
66
|
+
|
|
67
|
+
properties?: PropertySchema; // if type is object
|
|
68
|
+
required?: PropertySchema["required"]; // if type is object
|
|
69
|
+
items?: PropertySchema["items"]; // if type is array
|
|
70
|
+
|
|
78
71
|
defaultValue: VariableValue;
|
|
72
|
+
// nullable?: boolean; // @TODO: consider in future
|
|
79
73
|
description?: string; // only available in YAML files
|
|
80
74
|
useDefaultWhenDisabled?: boolean;
|
|
81
75
|
disabledValue?: VariableValue;
|
package/src/index.d.ts
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type Schema = PropertySchema;
|
|
2
|
+
|
|
3
|
+
export type ObjectValue = { [key: string]: Value };
|
|
4
|
+
export type Value =
|
|
5
|
+
| boolean
|
|
6
|
+
| string
|
|
7
|
+
| number // covers integer and double
|
|
8
|
+
// | Date // @TODO: support in future
|
|
9
|
+
| ObjectValue
|
|
10
|
+
| Value[];
|
|
11
|
+
|
|
12
|
+
export type PropertyType =
|
|
13
|
+
| "boolean"
|
|
14
|
+
| "string"
|
|
15
|
+
| "integer"
|
|
16
|
+
| "double"
|
|
17
|
+
| "object"
|
|
18
|
+
// | "date" // @TODO: support in future
|
|
19
|
+
// | "semver" // @TODO: consider in future
|
|
20
|
+
// | "url" // @TODO: consider in future
|
|
21
|
+
| "array";
|
|
22
|
+
|
|
23
|
+
// adapted JSON Schema for Featurevisor
|
|
24
|
+
export interface PropertySchema {
|
|
25
|
+
// Basic metadata
|
|
26
|
+
description?: string;
|
|
27
|
+
|
|
28
|
+
// General validation keywords
|
|
29
|
+
type?: PropertyType;
|
|
30
|
+
// enum?: Value[];
|
|
31
|
+
// const?: Value;
|
|
32
|
+
|
|
33
|
+
// Numeric validation keywords
|
|
34
|
+
// maximum?: number;
|
|
35
|
+
// minimum?: number;
|
|
36
|
+
|
|
37
|
+
// String validation keywords
|
|
38
|
+
// maxLength?: number;
|
|
39
|
+
// minLength?: number;
|
|
40
|
+
// pattern?: string;
|
|
41
|
+
|
|
42
|
+
// Array validation keywords
|
|
43
|
+
items?: PropertySchema; // @TODO: allow array of items in future | PropertySchema[];
|
|
44
|
+
// maxItems?: number;
|
|
45
|
+
// minItems?: number;
|
|
46
|
+
// uniqueItems?: boolean;
|
|
47
|
+
|
|
48
|
+
// Object validation keywords
|
|
49
|
+
required?: string[];
|
|
50
|
+
properties?: { [key: string]: PropertySchema };
|
|
51
|
+
|
|
52
|
+
// Annotations
|
|
53
|
+
// default?: Value;
|
|
54
|
+
// examples?: Value[];
|
|
55
|
+
}
|
package/src/test.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export interface FeatureAssertion {
|
|
|
45
45
|
description?: string;
|
|
46
46
|
environment: EnvironmentKey;
|
|
47
47
|
scope?: string;
|
|
48
|
-
|
|
48
|
+
tag?: string;
|
|
49
49
|
at?: Weight; // bucket weight: 0 to 100
|
|
50
50
|
|
|
51
51
|
sticky?: StickyFeatures;
|