unleash-server 4.14.0 → 4.14.1
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/lib/openapi/index.d.ts +22 -31
- package/dist/lib/openapi/spec/client-feature-schema.d.ts +6 -0
- package/dist/lib/openapi/spec/client-features-schema.d.ts +10 -31
- package/dist/lib/openapi/spec/client-features-schema.js +2 -2
- package/dist/lib/openapi/spec/client-features-schema.js.map +1 -1
- package/dist/lib/openapi/spec/client-features-schema.test.js +335 -316
- package/dist/lib/openapi/spec/client-features-schema.test.js.map +1 -1
- package/dist/lib/openapi/spec/client-variant-schema.d.ts +6 -0
- package/dist/lib/openapi/spec/client-variant-schema.js +6 -0
- package/dist/lib/openapi/spec/client-variant-schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -1293,6 +1293,12 @@ export declare const schemas: {
|
|
|
1293
1293
|
readonly weight: {
|
|
1294
1294
|
readonly type: "number";
|
|
1295
1295
|
};
|
|
1296
|
+
readonly weightType: {
|
|
1297
|
+
readonly type: "string";
|
|
1298
|
+
};
|
|
1299
|
+
readonly stickiness: {
|
|
1300
|
+
readonly type: "string";
|
|
1301
|
+
};
|
|
1296
1302
|
readonly payload: {
|
|
1297
1303
|
readonly type: "object";
|
|
1298
1304
|
readonly required: readonly ["type", "value"];
|
|
@@ -1581,6 +1587,12 @@ export declare const schemas: {
|
|
|
1581
1587
|
readonly weight: {
|
|
1582
1588
|
readonly type: "number";
|
|
1583
1589
|
};
|
|
1590
|
+
readonly weightType: {
|
|
1591
|
+
readonly type: "string";
|
|
1592
|
+
};
|
|
1593
|
+
readonly stickiness: {
|
|
1594
|
+
readonly type: "string";
|
|
1595
|
+
};
|
|
1584
1596
|
readonly payload: {
|
|
1585
1597
|
readonly type: "object";
|
|
1586
1598
|
readonly required: readonly ["type", "value"];
|
|
@@ -1815,11 +1827,11 @@ export declare const schemas: {
|
|
|
1815
1827
|
};
|
|
1816
1828
|
};
|
|
1817
1829
|
};
|
|
1818
|
-
readonly
|
|
1819
|
-
readonly $id: "#/components/schemas/
|
|
1830
|
+
readonly clientVariantSchema: {
|
|
1831
|
+
readonly $id: "#/components/schemas/clientVariantSchema";
|
|
1820
1832
|
readonly type: "object";
|
|
1821
1833
|
readonly additionalProperties: false;
|
|
1822
|
-
readonly required: readonly ["name", "weight"
|
|
1834
|
+
readonly required: readonly ["name", "weight"];
|
|
1823
1835
|
readonly properties: {
|
|
1824
1836
|
readonly name: {
|
|
1825
1837
|
readonly type: "string";
|
|
@@ -1845,35 +1857,8 @@ export declare const schemas: {
|
|
|
1845
1857
|
};
|
|
1846
1858
|
};
|
|
1847
1859
|
};
|
|
1848
|
-
readonly overrides: {
|
|
1849
|
-
readonly type: "array";
|
|
1850
|
-
readonly items: {
|
|
1851
|
-
readonly $ref: "#/components/schemas/overrideSchema";
|
|
1852
|
-
};
|
|
1853
|
-
};
|
|
1854
|
-
};
|
|
1855
|
-
readonly components: {
|
|
1856
|
-
readonly schemas: {
|
|
1857
|
-
readonly overrideSchema: {
|
|
1858
|
-
readonly $id: "#/components/schemas/overrideSchema";
|
|
1859
|
-
readonly type: "object";
|
|
1860
|
-
readonly additionalProperties: false;
|
|
1861
|
-
readonly required: readonly ["contextName", "values"];
|
|
1862
|
-
readonly properties: {
|
|
1863
|
-
readonly contextName: {
|
|
1864
|
-
readonly type: "string";
|
|
1865
|
-
};
|
|
1866
|
-
readonly values: {
|
|
1867
|
-
readonly type: "array";
|
|
1868
|
-
readonly items: {
|
|
1869
|
-
readonly type: "string";
|
|
1870
|
-
};
|
|
1871
|
-
};
|
|
1872
|
-
};
|
|
1873
|
-
readonly components: {};
|
|
1874
|
-
};
|
|
1875
|
-
};
|
|
1876
1860
|
};
|
|
1861
|
+
readonly components: {};
|
|
1877
1862
|
};
|
|
1878
1863
|
};
|
|
1879
1864
|
};
|
|
@@ -1955,6 +1940,12 @@ export declare const schemas: {
|
|
|
1955
1940
|
readonly weight: {
|
|
1956
1941
|
readonly type: "number";
|
|
1957
1942
|
};
|
|
1943
|
+
readonly weightType: {
|
|
1944
|
+
readonly type: "string";
|
|
1945
|
+
};
|
|
1946
|
+
readonly stickiness: {
|
|
1947
|
+
readonly type: "string";
|
|
1948
|
+
};
|
|
1958
1949
|
readonly payload: {
|
|
1959
1950
|
readonly type: "object";
|
|
1960
1951
|
readonly required: readonly ["type", "value"];
|
|
@@ -180,6 +180,12 @@ export declare const clientFeatureSchema: {
|
|
|
180
180
|
readonly weight: {
|
|
181
181
|
readonly type: "number";
|
|
182
182
|
};
|
|
183
|
+
readonly weightType: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
};
|
|
186
|
+
readonly stickiness: {
|
|
187
|
+
readonly type: "string";
|
|
188
|
+
};
|
|
183
189
|
readonly payload: {
|
|
184
190
|
readonly type: "object";
|
|
185
191
|
readonly required: readonly ["type", "value"];
|
|
@@ -237,6 +237,12 @@ export declare const clientFeaturesSchema: {
|
|
|
237
237
|
readonly weight: {
|
|
238
238
|
readonly type: "number";
|
|
239
239
|
};
|
|
240
|
+
readonly weightType: {
|
|
241
|
+
readonly type: "string";
|
|
242
|
+
};
|
|
243
|
+
readonly stickiness: {
|
|
244
|
+
readonly type: "string";
|
|
245
|
+
};
|
|
240
246
|
readonly payload: {
|
|
241
247
|
readonly type: "object";
|
|
242
248
|
readonly required: readonly ["type", "value"];
|
|
@@ -471,11 +477,11 @@ export declare const clientFeaturesSchema: {
|
|
|
471
477
|
};
|
|
472
478
|
};
|
|
473
479
|
};
|
|
474
|
-
readonly
|
|
475
|
-
readonly $id: "#/components/schemas/
|
|
480
|
+
readonly clientVariantSchema: {
|
|
481
|
+
readonly $id: "#/components/schemas/clientVariantSchema";
|
|
476
482
|
readonly type: "object";
|
|
477
483
|
readonly additionalProperties: false;
|
|
478
|
-
readonly required: readonly ["name", "weight"
|
|
484
|
+
readonly required: readonly ["name", "weight"];
|
|
479
485
|
readonly properties: {
|
|
480
486
|
readonly name: {
|
|
481
487
|
readonly type: "string";
|
|
@@ -501,35 +507,8 @@ export declare const clientFeaturesSchema: {
|
|
|
501
507
|
};
|
|
502
508
|
};
|
|
503
509
|
};
|
|
504
|
-
readonly overrides: {
|
|
505
|
-
readonly type: "array";
|
|
506
|
-
readonly items: {
|
|
507
|
-
readonly $ref: "#/components/schemas/overrideSchema";
|
|
508
|
-
};
|
|
509
|
-
};
|
|
510
|
-
};
|
|
511
|
-
readonly components: {
|
|
512
|
-
readonly schemas: {
|
|
513
|
-
readonly overrideSchema: {
|
|
514
|
-
readonly $id: "#/components/schemas/overrideSchema";
|
|
515
|
-
readonly type: "object";
|
|
516
|
-
readonly additionalProperties: false;
|
|
517
|
-
readonly required: readonly ["contextName", "values"];
|
|
518
|
-
readonly properties: {
|
|
519
|
-
readonly contextName: {
|
|
520
|
-
readonly type: "string";
|
|
521
|
-
};
|
|
522
|
-
readonly values: {
|
|
523
|
-
readonly type: "array";
|
|
524
|
-
readonly items: {
|
|
525
|
-
readonly type: "string";
|
|
526
|
-
};
|
|
527
|
-
};
|
|
528
|
-
};
|
|
529
|
-
readonly components: {};
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
510
|
};
|
|
511
|
+
readonly components: {};
|
|
533
512
|
};
|
|
534
513
|
};
|
|
535
514
|
};
|
|
@@ -8,8 +8,8 @@ const environment_schema_1 = require("./environment-schema");
|
|
|
8
8
|
const override_schema_1 = require("./override-schema");
|
|
9
9
|
const parameters_schema_1 = require("./parameters-schema");
|
|
10
10
|
const feature_strategy_schema_1 = require("./feature-strategy-schema");
|
|
11
|
-
const variant_schema_1 = require("./variant-schema");
|
|
12
11
|
const client_feature_schema_1 = require("./client-feature-schema");
|
|
12
|
+
const client_variant_schema_1 = require("./client-variant-schema");
|
|
13
13
|
exports.clientFeaturesSchema = {
|
|
14
14
|
$id: '#/components/schemas/clientFeaturesSchema',
|
|
15
15
|
type: 'object',
|
|
@@ -44,7 +44,7 @@ exports.clientFeaturesSchema = {
|
|
|
44
44
|
overrideSchema: override_schema_1.overrideSchema,
|
|
45
45
|
parametersSchema: parameters_schema_1.parametersSchema,
|
|
46
46
|
featureStrategySchema: feature_strategy_schema_1.featureStrategySchema,
|
|
47
|
-
|
|
47
|
+
clientVariantSchema: client_variant_schema_1.clientVariantSchema,
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-features-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/client-features-schema.ts"],"names":[],"mappings":";;;AACA,iFAA2E;AAC3E,qDAAiD;AACjD,2DAAuD;AACvD,6DAAyD;AACzD,uDAAmD;AACnD,2DAAuD;AACvD,uEAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"client-features-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/client-features-schema.ts"],"names":[],"mappings":";;;AACA,iFAA2E;AAC3E,qDAAiD;AACjD,2DAAuD;AACvD,6DAAyD;AACzD,uDAAmD;AACnD,2DAAuD;AACvD,uEAAkE;AAClE,mEAA8D;AAC9D,mEAA8D;AAEjD,QAAA,oBAAoB,GAAG;IAChC,GAAG,EAAE,2CAA2C;IAChD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IACjC,UAAU,EAAE;QACR,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;SACjB;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,0CAA0C;aACnD;SACJ;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,oCAAoC;aAC7C;SACJ;QACD,KAAK,EAAE;YACH,IAAI,EAAE,gDAAgD;SACzD;KACJ;IACD,UAAU,EAAE;QACR,OAAO,EAAE;YACL,gBAAgB,EAAhB,oCAAgB;YAChB,mBAAmB,EAAnB,2CAAmB;YACnB,iBAAiB,EAAjB,sCAAiB;YACjB,aAAa,EAAb,8BAAa;YACb,yBAAyB,EAAzB,wDAAyB;YACzB,cAAc,EAAd,gCAAc;YACd,gBAAgB,EAAhB,oCAAgB;YAChB,qBAAqB,EAArB,+CAAqB;YACrB,mBAAmB,EAAnB,2CAAmB;SACtB;KACJ;CACK,CAAC"}
|
|
@@ -13,6 +13,14 @@ test('clientFeaturesSchema required fields', () => {
|
|
|
13
13
|
name: 'some-name',
|
|
14
14
|
enabled: false,
|
|
15
15
|
impressionData: false,
|
|
16
|
+
variants: [
|
|
17
|
+
{
|
|
18
|
+
name: 'a',
|
|
19
|
+
weight: 1,
|
|
20
|
+
weightType: 'b',
|
|
21
|
+
stickiness: 'c',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
16
24
|
},
|
|
17
25
|
],
|
|
18
26
|
};
|
|
@@ -20,350 +28,361 @@ test('clientFeaturesSchema required fields', () => {
|
|
|
20
28
|
});
|
|
21
29
|
test('clientFeaturesSchema java-sdk expected response', () => {
|
|
22
30
|
const json = `{
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
"version": 2,
|
|
32
|
+
"segments": [
|
|
25
33
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
"id": 1,
|
|
35
|
+
"name": "some-name",
|
|
36
|
+
"description": null,
|
|
37
|
+
"constraints": [
|
|
38
|
+
{
|
|
39
|
+
"contextName": "some-name",
|
|
40
|
+
"operator": "IN",
|
|
41
|
+
"value": "name",
|
|
42
|
+
"inverted": false,
|
|
43
|
+
"caseInsensitive": true
|
|
44
|
+
}
|
|
45
|
+
]
|
|
38
46
|
}
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
],
|
|
48
|
+
"features": [
|
|
49
|
+
{
|
|
50
|
+
"name": "Test.old",
|
|
51
|
+
"description": "No variants here!",
|
|
52
|
+
"enabled": true,
|
|
53
|
+
"strategies": [
|
|
41
54
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
"name": "default"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"variants": null,
|
|
59
|
+
"createdAt": "2019-01-24T10:38:10.370Z"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "Test.variants",
|
|
63
|
+
"description": null,
|
|
64
|
+
"enabled": true,
|
|
65
|
+
"strategies": [
|
|
53
66
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
1
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
"variants": [
|
|
66
|
-
{
|
|
67
|
-
"name": "variant1",
|
|
68
|
-
"weight": 50
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "variant2",
|
|
72
|
-
"weight": 50
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
"createdAt": "2019-01-24T10:41:45.236Z"
|
|
76
|
-
},
|
|
67
|
+
"name": "default",
|
|
68
|
+
"segments": [
|
|
69
|
+
1
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"variants": [
|
|
77
74
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"strategies": [
|
|
81
|
-
{
|
|
82
|
-
"name": "default"
|
|
83
|
-
}
|
|
84
|
-
]
|
|
75
|
+
"name": "variant1",
|
|
76
|
+
"weight": 50
|
|
85
77
|
},
|
|
86
78
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
"name": "variant2",
|
|
80
|
+
"weight": 50
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"createdAt": "2019-01-24T10:41:45.236Z"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "featureX",
|
|
87
|
+
"enabled": true,
|
|
88
|
+
"strategies": [
|
|
89
|
+
{
|
|
90
|
+
"name": "default"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "featureY",
|
|
96
|
+
"enabled": false,
|
|
97
|
+
"strategies": [
|
|
98
|
+
{
|
|
99
|
+
"name": "baz",
|
|
100
|
+
"parameters": {
|
|
101
|
+
"foo": "bar"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "featureZ",
|
|
108
|
+
"enabled": true,
|
|
109
|
+
"strategies": [
|
|
110
|
+
{
|
|
111
|
+
"name": "default"
|
|
98
112
|
},
|
|
99
113
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"name": "hola",
|
|
108
|
-
"parameters": {
|
|
109
|
-
"name": "val"
|
|
110
|
-
},
|
|
111
|
-
"segments": [1]
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
|
|
114
|
+
"name": "hola",
|
|
115
|
+
"parameters": {
|
|
116
|
+
"name": "val"
|
|
117
|
+
},
|
|
118
|
+
"segments": [
|
|
119
|
+
1
|
|
120
|
+
]
|
|
115
121
|
}
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}`;
|
|
119
126
|
expect((0, validate_1.validateSchema)('#/components/schemas/clientFeaturesSchema', JSON.parse(json))).toBeUndefined();
|
|
120
127
|
});
|
|
121
128
|
test('clientFeaturesSchema unleash-proxy expected response', () => {
|
|
122
129
|
const json = `{
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
"version": 2,
|
|
131
|
+
"segments": [
|
|
125
132
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
"id": 1,
|
|
134
|
+
"name": "some-name",
|
|
135
|
+
"description": null,
|
|
136
|
+
"constraints": [
|
|
137
|
+
{
|
|
138
|
+
"contextName": "some-name",
|
|
139
|
+
"operator": "IN",
|
|
140
|
+
"value": "name",
|
|
141
|
+
"inverted": false,
|
|
142
|
+
"caseInsensitive": true
|
|
143
|
+
}
|
|
144
|
+
]
|
|
138
145
|
}
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
],
|
|
147
|
+
"features": [
|
|
148
|
+
{
|
|
149
|
+
"name": "Test.old",
|
|
150
|
+
"description": "No variants here!",
|
|
151
|
+
"enabled": true,
|
|
152
|
+
"strategies": [
|
|
141
153
|
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
"name": "default"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"variants": null,
|
|
158
|
+
"createdAt": "2019-01-24T10:38:10.370Z"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "Test.variants",
|
|
162
|
+
"description": null,
|
|
163
|
+
"enabled": true,
|
|
164
|
+
"strategies": [
|
|
153
165
|
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
1
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
],
|
|
165
|
-
"variants": [
|
|
166
|
-
{
|
|
167
|
-
"name": "variant1",
|
|
168
|
-
"weight": 50
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "variant2",
|
|
172
|
-
"weight": 50
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
"createdAt": "2019-01-24T10:41:45.236Z"
|
|
176
|
-
},
|
|
166
|
+
"name": "default",
|
|
167
|
+
"segments": [
|
|
168
|
+
1
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"variants": [
|
|
177
173
|
{
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
"strategies": [
|
|
181
|
-
{
|
|
182
|
-
"name": "default"
|
|
183
|
-
}
|
|
184
|
-
]
|
|
174
|
+
"name": "variant1",
|
|
175
|
+
"weight": 50
|
|
185
176
|
},
|
|
186
177
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
178
|
+
"name": "variant2",
|
|
179
|
+
"weight": 50
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"createdAt": "2019-01-24T10:41:45.236Z"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "featureX",
|
|
186
|
+
"enabled": true,
|
|
187
|
+
"strategies": [
|
|
188
|
+
{
|
|
189
|
+
"name": "default"
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "featureY",
|
|
195
|
+
"enabled": false,
|
|
196
|
+
"strategies": [
|
|
197
|
+
{
|
|
198
|
+
"name": "baz",
|
|
199
|
+
"parameters": {
|
|
200
|
+
"foo": "bar"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "featureZ",
|
|
207
|
+
"enabled": true,
|
|
208
|
+
"strategies": [
|
|
209
|
+
{
|
|
210
|
+
"name": "default"
|
|
198
211
|
},
|
|
199
212
|
{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
"
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
"name": "hola",
|
|
208
|
-
"parameters": {
|
|
209
|
-
"name": "val"
|
|
210
|
-
},
|
|
211
|
-
"segments": [1]
|
|
212
|
-
}
|
|
213
|
-
]
|
|
214
|
-
|
|
213
|
+
"name": "hola",
|
|
214
|
+
"parameters": {
|
|
215
|
+
"name": "val"
|
|
216
|
+
},
|
|
217
|
+
"segments": [
|
|
218
|
+
1
|
|
219
|
+
]
|
|
215
220
|
}
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}`;
|
|
219
225
|
expect((0, validate_1.validateSchema)('#/components/schemas/clientFeaturesSchema', JSON.parse(json))).toBeUndefined();
|
|
220
226
|
});
|
|
221
227
|
test('clientFeaturesSchema client specification test 15', () => {
|
|
222
228
|
const json = `{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
229
|
+
"version": 2,
|
|
230
|
+
"features": [
|
|
231
|
+
{
|
|
232
|
+
"name": "F9.globalSegmentOn",
|
|
233
|
+
"description": "With global segment referencing constraint in on state",
|
|
234
|
+
"enabled": true,
|
|
235
|
+
"strategies": [
|
|
236
|
+
{
|
|
237
|
+
"name": "default",
|
|
238
|
+
"parameters": {},
|
|
239
|
+
"segments": [
|
|
240
|
+
1
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "F9.globalSegmentOff",
|
|
247
|
+
"description": "With global segment referencing constraint in off state",
|
|
248
|
+
"enabled": true,
|
|
249
|
+
"strategies": [
|
|
250
|
+
{
|
|
251
|
+
"name": "default",
|
|
252
|
+
"parameters": {},
|
|
253
|
+
"segments": [
|
|
254
|
+
2
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "F9.globalSegmentAndConstraint",
|
|
261
|
+
"description": "With global segment and constraint both on",
|
|
262
|
+
"enabled": true,
|
|
263
|
+
"strategies": [
|
|
264
|
+
{
|
|
265
|
+
"name": "default",
|
|
266
|
+
"parameters": {},
|
|
267
|
+
"constraints": [
|
|
268
|
+
{
|
|
269
|
+
"contextName": "version",
|
|
270
|
+
"operator": "SEMVER_EQ",
|
|
271
|
+
"value": "1.2.2"
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
"segments": [
|
|
275
|
+
1
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "F9.withExtraParams",
|
|
282
|
+
"description": "With global segment that doesn't exist",
|
|
283
|
+
"enabled": true,
|
|
284
|
+
"project": "some-project",
|
|
285
|
+
"strategies": [
|
|
286
|
+
{
|
|
287
|
+
"name": "default",
|
|
288
|
+
"parameters": {},
|
|
289
|
+
"constraints": [
|
|
290
|
+
{
|
|
291
|
+
"contextName": "version",
|
|
292
|
+
"operator": "SEMVER_EQ",
|
|
293
|
+
"value": "1.2.2"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"segments": [
|
|
297
|
+
3
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "F9.withSeveralConstraintsAndSegments",
|
|
304
|
+
"description": "With several segments and constraints",
|
|
305
|
+
"enabled": true,
|
|
306
|
+
"strategies": [
|
|
307
|
+
{
|
|
308
|
+
"name": "default",
|
|
309
|
+
"parameters": {},
|
|
310
|
+
"constraints": [
|
|
311
|
+
{
|
|
312
|
+
"contextName": "customNumber",
|
|
313
|
+
"operator": "NUM_LT",
|
|
314
|
+
"value": "10"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"contextName": "version",
|
|
318
|
+
"operator": "SEMVER_LT",
|
|
319
|
+
"value": "3.2.2"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"segments": [
|
|
323
|
+
1,
|
|
324
|
+
4,
|
|
325
|
+
5
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
"segments": [
|
|
332
|
+
{
|
|
333
|
+
"id": 1,
|
|
334
|
+
"constraints": [
|
|
335
|
+
{
|
|
336
|
+
"contextName": "version",
|
|
337
|
+
"operator": "SEMVER_EQ",
|
|
338
|
+
"value": "1.2.2"
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"id": 2,
|
|
344
|
+
"constraints": [
|
|
345
|
+
{
|
|
346
|
+
"contextName": "version",
|
|
347
|
+
"operator": "SEMVER_EQ",
|
|
348
|
+
"value": "3.1.4"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"id": 3,
|
|
354
|
+
"constraints": [
|
|
355
|
+
{
|
|
356
|
+
"contextName": "version",
|
|
357
|
+
"operator": "SEMVER_EQ",
|
|
358
|
+
"value": "3.1.4"
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"id": 4,
|
|
364
|
+
"constraints": [
|
|
365
|
+
{
|
|
366
|
+
"contextName": "customName",
|
|
367
|
+
"operator": "STR_CONTAINS",
|
|
368
|
+
"values": [
|
|
369
|
+
"Pi"
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"id": 5,
|
|
376
|
+
"constraints": [
|
|
377
|
+
{
|
|
378
|
+
"contextName": "slicesLeft",
|
|
379
|
+
"operator": "NUM_LTE",
|
|
380
|
+
"value": "4"
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}`;
|
|
367
386
|
expect((0, validate_1.validateSchema)('#/components/schemas/clientFeaturesSchema', JSON.parse(json))).toBeUndefined();
|
|
368
387
|
});
|
|
369
388
|
//# sourceMappingURL=client-features-schema.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-features-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/client-features-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,gCAAgC,EAAE,GAAG,EAAE;IACxC,MAAM,CACF,IAAA,yBAAc,EAAC,2CAA2C,EAAE,EAAE,CAAC,CAClE,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;IAC9C,MAAM,IAAI,GAAyB;QAC/B,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,KAAK;gBACd,cAAc,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"client-features-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/client-features-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,gCAAgC,EAAE,GAAG,EAAE;IACxC,MAAM,CACF,IAAA,yBAAc,EAAC,2CAA2C,EAAE,EAAE,CAAC,CAClE,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;IAC9C,MAAM,IAAI,GAAyB;QAC/B,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,KAAK;gBACd,cAAc,EAAE,KAAK;gBACrB,QAAQ,EAAE;oBACN;wBACI,IAAI,EAAE,GAAG;wBACT,MAAM,EAAE,CAAC;wBACT,UAAU,EAAE,GAAG;wBACf,UAAU,EAAE,GAAG;qBAClB;iBACJ;aACJ;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,2CAA2C,EAAE,IAAI,CAAC,CACpE,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;IACzD,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+FX,CAAC;IAEH,MAAM,CACF,IAAA,yBAAc,EACV,2CAA2C,EAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CACnB,CACJ,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE;IAC9D,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+FX,CAAC;IAEH,MAAM,CACF,IAAA,yBAAc,EACV,2CAA2C,EAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CACnB,CACJ,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC3D,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6JX,CAAC;IAEH,MAAM,CACF,IAAA,yBAAc,EACV,2CAA2C,EAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CACnB,CACJ,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC"}
|
|
@@ -11,6 +11,12 @@ export declare const clientVariantSchema: {
|
|
|
11
11
|
readonly weight: {
|
|
12
12
|
readonly type: "number";
|
|
13
13
|
};
|
|
14
|
+
readonly weightType: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
};
|
|
17
|
+
readonly stickiness: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
};
|
|
14
20
|
readonly payload: {
|
|
15
21
|
readonly type: "object";
|
|
16
22
|
readonly required: readonly ["type", "value"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-variant-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/client-variant-schema.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG;IAC/B,GAAG,EAAE,0CAA0C;IAC/C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;SACjB;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;YAC3B,UAAU,EAAE;gBACR,IAAI,EAAE;oBACF,IAAI,EAAE,QAAQ;iBACjB;gBACD,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;iBACjB;aACJ;SACJ;KACJ;IACD,UAAU,EAAE,EAAE;CACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"client-variant-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/client-variant-schema.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG;IAC/B,GAAG,EAAE,0CAA0C;IAC/C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;SACjB;QACD,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;SACjB;QACD,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;SACjB;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;YAC3B,UAAU,EAAE;gBACR,IAAI,EAAE;oBACF,IAAI,EAAE,QAAQ;iBACjB;gBACD,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;iBACjB;aACJ;SACJ;KACJ;IACD,UAAU,EAAE,EAAE;CACR,CAAC"}
|
package/package.json
CHANGED