@featurevisor/types 0.1.0 → 0.3.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 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
+ # [0.3.0](https://github.com/fahad19/featurevisor/compare/v0.2.0...v0.3.0) (2023-03-17)
7
+
8
+
9
+ ### Features
10
+
11
+ * support objects as variables ([#18](https://github.com/fahad19/featurevisor/issues/18)) ([c1b6160](https://github.com/fahad19/featurevisor/commit/c1b61609d299bbf2e46c644c4f09336cdd94e128))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.2.0](https://github.com/fahad19/featurevisor/compare/v0.1.0...v0.2.0) (2023-03-16)
18
+
19
+
20
+ ### Features
21
+
22
+ * NOT operator ([#16](https://github.com/fahad19/featurevisor/issues/16)) ([9c7b239](https://github.com/fahad19/featurevisor/commit/9c7b23944a37c327308f441f4afd2731aaf97889))
23
+
24
+
25
+
26
+
27
+
6
28
  # [0.1.0](https://github.com/fahad19/featurevisor/compare/v0.0.4...v0.1.0) (2023-03-05)
7
29
 
8
30
  **Note:** Version bump only for package @featurevisor/types
package/lib/index.d.ts CHANGED
@@ -22,8 +22,11 @@ export interface AndCondition {
22
22
  export interface OrCondition {
23
23
  or: Condition[];
24
24
  }
25
- export type AndOrCondition = AndCondition | OrCondition;
26
- export type Condition = PlainCondition | AndOrCondition;
25
+ export interface NotCondition {
26
+ not: Condition[];
27
+ }
28
+ export type AndOrNotCondition = AndCondition | OrCondition | NotCondition;
29
+ export type Condition = PlainCondition | AndOrNotCondition;
27
30
  export type SegmentKey = string;
28
31
  export interface Segment {
29
32
  archived?: boolean;
@@ -37,13 +40,19 @@ export interface AndGroupSegment {
37
40
  export interface OrGroupSegment {
38
41
  or: GroupSegment[];
39
42
  }
40
- export type AndOrGroupSegment = AndGroupSegment | OrGroupSegment;
41
- export type GroupSegment = PlainGroupSegment | AndOrGroupSegment;
43
+ export interface NotGroupSegment {
44
+ not: GroupSegment[];
45
+ }
46
+ export type AndOrNotGroupSegment = AndGroupSegment | OrGroupSegment | NotGroupSegment;
47
+ export type GroupSegment = PlainGroupSegment | AndOrNotGroupSegment;
42
48
  export type VariationType = "boolean" | "string" | "integer" | "double";
43
49
  export type VariationValue = boolean | string | number | null | undefined;
44
50
  export type VariableKey = string;
45
- export type VariableType = "boolean" | "string" | "integer" | "double" | "array";
46
- export type VariableValue = boolean | string | number | string[] | null | undefined;
51
+ export type VariableType = "boolean" | "string" | "integer" | "double" | "array" | "object";
52
+ export interface VariableObjectValue {
53
+ [key: string]: VariableValue;
54
+ }
55
+ export type VariableValue = boolean | string | number | string[] | VariableObjectValue | null | undefined;
47
56
  export interface VariableOverrideSegments {
48
57
  segments: GroupSegment | GroupSegment[];
49
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featurevisor/types",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Common Typescript types for Featurevisor",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -41,5 +41,5 @@
41
41
  "url": "https://github.com/fahad19/featurevisor/issues"
42
42
  },
43
43
  "license": "MIT",
44
- "gitHead": "e184134717a604dcc170d1c6ff1456a0eb3de56f"
44
+ "gitHead": "fae6cbf61f8b2f7e89b4faf660f63b37676bab29"
45
45
  }
package/src/index.ts CHANGED
@@ -49,9 +49,13 @@ export interface OrCondition {
49
49
  or: Condition[];
50
50
  }
51
51
 
52
- export type AndOrCondition = AndCondition | OrCondition;
52
+ export interface NotCondition {
53
+ not: Condition[];
54
+ }
55
+
56
+ export type AndOrNotCondition = AndCondition | OrCondition | NotCondition;
53
57
 
54
- export type Condition = PlainCondition | AndOrCondition;
58
+ export type Condition = PlainCondition | AndOrNotCondition;
55
59
 
56
60
  export type SegmentKey = string;
57
61
 
@@ -71,17 +75,31 @@ export interface OrGroupSegment {
71
75
  or: GroupSegment[];
72
76
  }
73
77
 
74
- export type AndOrGroupSegment = AndGroupSegment | OrGroupSegment;
78
+ export interface NotGroupSegment {
79
+ not: GroupSegment[];
80
+ }
81
+
82
+ export type AndOrNotGroupSegment = AndGroupSegment | OrGroupSegment | NotGroupSegment;
75
83
 
76
84
  // group of segment keys with and/or conditions, or just string
77
- export type GroupSegment = PlainGroupSegment | AndOrGroupSegment;
85
+ export type GroupSegment = PlainGroupSegment | AndOrNotGroupSegment;
78
86
 
79
87
  export type VariationType = "boolean" | "string" | "integer" | "double";
80
88
  export type VariationValue = boolean | string | number | null | undefined;
81
89
 
82
90
  export type VariableKey = string;
83
- export type VariableType = "boolean" | "string" | "integer" | "double" | "array";
84
- export type VariableValue = boolean | string | number | string[] | null | undefined;
91
+ export type VariableType = "boolean" | "string" | "integer" | "double" | "array" | "object";
92
+ export interface VariableObjectValue {
93
+ [key: string]: VariableValue;
94
+ }
95
+ export type VariableValue =
96
+ | boolean
97
+ | string
98
+ | number
99
+ | string[]
100
+ | VariableObjectValue
101
+ | null
102
+ | undefined;
85
103
 
86
104
  export interface VariableOverrideSegments {
87
105
  segments: GroupSegment | GroupSegment[];