unleash-server 4.14.2 → 4.14.4
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/db/event-store.d.ts +2 -3
- package/dist/lib/db/event-store.js +26 -36
- package/dist/lib/db/event-store.js.map +1 -1
- package/dist/lib/db/event-store.test.js +1 -1
- package/dist/lib/db/event-store.test.js.map +1 -1
- package/dist/lib/db/feature-strategy-store.js +3 -3
- package/dist/lib/db/feature-strategy-store.js.map +1 -1
- package/dist/lib/db/feature-toggle-client-store.d.ts +1 -1
- package/dist/lib/db/feature-toggle-client-store.js +6 -6
- package/dist/lib/db/feature-toggle-client-store.js.map +1 -1
- package/dist/lib/db/group-store.d.ts +0 -1
- package/dist/lib/db/group-store.js +1 -14
- package/dist/lib/db/group-store.js.map +1 -1
- package/dist/lib/db/user-store.js +8 -1
- package/dist/lib/db/user-store.js.map +1 -1
- package/dist/lib/openapi/index.d.ts +2388 -952
- package/dist/lib/openapi/index.js +8 -4
- package/dist/lib/openapi/index.js.map +1 -1
- package/dist/lib/openapi/spec/client-feature-schema.d.ts +72 -7
- package/dist/lib/openapi/spec/client-feature-schema.js +5 -3
- package/dist/lib/openapi/spec/client-feature-schema.js.map +1 -1
- package/dist/lib/openapi/spec/client-features-schema.d.ts +138 -16
- 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 +10 -0
- package/dist/lib/openapi/spec/client-features-schema.test.js.map +1 -1
- package/dist/lib/openapi/spec/constraint-schema.d.ts +51 -2
- package/dist/lib/openapi/spec/constraint-schema.js +17 -4
- package/dist/lib/openapi/spec/constraint-schema.js.map +1 -1
- package/dist/lib/openapi/spec/context-field-schema.test.js +5 -1
- package/dist/lib/openapi/spec/context-field-schema.test.js.map +1 -1
- package/dist/lib/openapi/spec/create-feature-strategy-schema.d.ts +12 -2
- package/dist/lib/openapi/spec/feature-environment-schema.d.ts +12 -2
- package/dist/lib/openapi/spec/feature-events-schema.d.ts +1 -1
- package/dist/lib/openapi/spec/feature-events-schema.js +1 -1
- package/dist/lib/openapi/spec/feature-events-schema.js.map +1 -1
- package/dist/lib/openapi/spec/feature-schema.d.ts +25 -5
- package/dist/lib/openapi/spec/feature-schema.test.js +13 -1
- package/dist/lib/openapi/spec/feature-schema.test.js.map +1 -1
- package/dist/lib/openapi/spec/feature-strategy-schema.d.ts +12 -2
- package/dist/lib/openapi/spec/feature-variants-schema.d.ts +1 -1
- package/dist/lib/openapi/spec/features-schema.d.ts +50 -10
- package/dist/lib/openapi/spec/group-schema.d.ts +1 -4
- package/dist/lib/openapi/spec/group-user-model-schema.d.ts +1 -4
- package/dist/lib/openapi/spec/group-user-model-schema.js +1 -4
- package/dist/lib/openapi/spec/group-user-model-schema.js.map +1 -1
- package/dist/lib/openapi/spec/groups-schema.d.ts +2 -8
- package/dist/lib/openapi/spec/groups-schema.test.js +0 -1
- package/dist/lib/openapi/spec/groups-schema.test.js.map +1 -1
- package/dist/lib/openapi/spec/health-overview-schema.d.ts +50 -10
- package/dist/lib/openapi/spec/health-report-schema.d.ts +50 -10
- package/dist/lib/openapi/spec/playground-constraint-schema.d.ts +47 -0
- package/dist/lib/openapi/spec/playground-constraint-schema.js +18 -0
- package/dist/lib/openapi/spec/playground-constraint-schema.js.map +1 -0
- package/dist/lib/openapi/spec/playground-feature-schema.d.ts +388 -2
- package/dist/lib/openapi/spec/playground-feature-schema.js +95 -9
- package/dist/lib/openapi/spec/playground-feature-schema.js.map +1 -1
- package/dist/lib/openapi/spec/playground-feature-schema.test.js +64 -3
- package/dist/lib/openapi/spec/playground-feature-schema.test.js.map +1 -1
- package/dist/lib/openapi/spec/playground-request-schema.d.ts +2 -0
- package/dist/lib/openapi/spec/playground-request-schema.js +6 -1
- package/dist/lib/openapi/spec/playground-request-schema.js.map +1 -1
- package/dist/lib/openapi/spec/playground-response-schema.d.ts +774 -3
- package/dist/lib/openapi/spec/playground-response-schema.js +15 -1
- package/dist/lib/openapi/spec/playground-response-schema.js.map +1 -1
- package/dist/lib/openapi/spec/playground-segment-schema.d.ts +79 -0
- package/dist/lib/openapi/spec/playground-segment-schema.js +36 -0
- package/dist/lib/openapi/spec/playground-segment-schema.js.map +1 -0
- package/dist/lib/openapi/spec/playground-strategy-schema.d.ts +257 -0
- package/dist/lib/openapi/spec/playground-strategy-schema.js +102 -0
- package/dist/lib/openapi/spec/playground-strategy-schema.js.map +1 -0
- package/dist/lib/openapi/spec/{bootstrap-ui-schema.test.d.ts → project-schema.test.d.ts} +0 -0
- package/dist/lib/openapi/spec/project-schema.test.js +17 -0
- package/dist/lib/openapi/spec/project-schema.test.js.map +1 -0
- package/dist/lib/openapi/spec/search-events-schema.d.ts +37 -0
- package/dist/lib/openapi/spec/search-events-schema.js +47 -0
- package/dist/lib/openapi/spec/search-events-schema.js.map +1 -0
- package/dist/lib/openapi/spec/segment-schema.d.ts +12 -2
- package/dist/lib/openapi/spec/state-schema.d.ts +61 -11
- package/dist/lib/{routes/admin-api/bootstrap-ui.test.d.ts → openapi/spec/tag-types-schema.test.d.ts} +0 -0
- package/dist/lib/openapi/spec/tag-types-schema.test.js +23 -0
- package/dist/lib/openapi/spec/tag-types-schema.test.js.map +1 -0
- package/dist/lib/openapi/spec/ui-config-schema.d.ts +3 -0
- package/dist/lib/openapi/spec/ui-config-schema.js +3 -0
- package/dist/lib/openapi/spec/ui-config-schema.js.map +1 -1
- package/dist/lib/openapi/spec/update-feature-schema.d.ts +12 -2
- package/dist/lib/openapi/spec/update-feature-strategy-schema.d.ts +12 -2
- package/dist/{test/e2e/api/admin/bootstrap.test.d.ts → lib/openapi/spec/user-schema.test.d.ts} +0 -0
- package/dist/lib/openapi/spec/user-schema.test.js +17 -0
- package/dist/lib/openapi/spec/user-schema.test.js.map +1 -0
- package/dist/lib/openapi/spec/users-groups-base-schema.d.ts +2 -8
- package/dist/lib/openapi/spec/variant-schema.d.ts +1 -1
- package/dist/lib/openapi/spec/variant-schema.js +1 -1
- package/dist/lib/openapi/spec/variant-schema.js.map +1 -1
- package/dist/lib/openapi/spec/variants-schema.d.ts +1 -1
- package/dist/lib/openapi/util/standard-responses.d.ts +6 -0
- package/dist/lib/openapi/util/standard-responses.js +10 -2
- package/dist/lib/openapi/util/standard-responses.js.map +1 -1
- package/dist/lib/routes/admin-api/config.d.ts +2 -1
- package/dist/lib/routes/admin-api/config.js +3 -1
- package/dist/lib/routes/admin-api/config.js.map +1 -1
- package/dist/lib/routes/admin-api/event.d.ts +3 -1
- package/dist/lib/routes/admin-api/event.js +30 -7
- package/dist/lib/routes/admin-api/event.js.map +1 -1
- package/dist/lib/routes/admin-api/index.js +0 -2
- package/dist/lib/routes/admin-api/index.js.map +1 -1
- package/dist/lib/routes/admin-api/playground.js.map +1 -1
- package/dist/lib/services/event-service.d.ts +2 -2
- package/dist/lib/services/event-service.js +2 -5
- package/dist/lib/services/event-service.js.map +1 -1
- package/dist/lib/services/feature-toggle-service.d.ts +1 -1
- package/dist/lib/services/feature-toggle-service.js +2 -2
- package/dist/lib/services/feature-toggle-service.js.map +1 -1
- package/dist/lib/services/group-service.d.ts +1 -1
- package/dist/lib/services/group-service.js +1 -5
- package/dist/lib/services/group-service.js.map +1 -1
- package/dist/lib/services/index.js +1 -0
- package/dist/lib/services/index.js.map +1 -1
- package/dist/lib/services/openapi-service.js +1 -1
- package/dist/lib/services/openapi-service.js.map +1 -1
- package/dist/lib/services/playground-service.d.ts +2 -1
- package/dist/lib/services/playground-service.js +30 -11
- package/dist/lib/services/playground-service.js.map +1 -1
- package/dist/lib/types/group.d.ts +1 -2
- package/dist/lib/types/group.js.map +1 -1
- package/dist/lib/types/stores/event-store.d.ts +2 -3
- package/dist/lib/types/stores/feature-toggle-client-store.d.ts +1 -1
- package/dist/lib/types/stores/group-store.d.ts +0 -1
- package/dist/lib/util/feature-evaluator/client.d.ts +25 -0
- package/dist/lib/util/feature-evaluator/client.js +135 -0
- package/dist/lib/util/feature-evaluator/client.js.map +1 -0
- package/dist/lib/util/feature-evaluator/constraint.d.ts +28 -0
- package/dist/lib/util/feature-evaluator/constraint.js +129 -0
- package/dist/lib/util/feature-evaluator/constraint.js.map +1 -0
- package/dist/lib/util/feature-evaluator/context.d.ts +13 -0
- package/dist/lib/util/feature-evaluator/context.js +3 -0
- package/dist/lib/util/feature-evaluator/context.js.map +1 -0
- package/dist/lib/util/feature-evaluator/feature-evaluator.d.ts +36 -0
- package/dist/lib/util/feature-evaluator/feature-evaluator.js +55 -0
- package/dist/lib/util/feature-evaluator/feature-evaluator.js.map +1 -0
- package/dist/lib/util/feature-evaluator/feature.d.ts +19 -0
- package/dist/lib/util/feature-evaluator/feature.js +3 -0
- package/dist/lib/util/feature-evaluator/feature.js.map +1 -0
- package/dist/lib/util/feature-evaluator/helpers.d.ts +6 -0
- package/dist/lib/util/feature-evaluator/helpers.js +32 -0
- package/dist/lib/util/feature-evaluator/helpers.js.map +1 -0
- package/dist/lib/util/feature-evaluator/index.d.ts +8 -0
- package/dist/lib/util/feature-evaluator/index.js +14 -0
- package/dist/lib/util/feature-evaluator/index.js.map +1 -0
- package/dist/lib/util/feature-evaluator/repository/bootstrap-provider.d.ts +16 -0
- package/dist/lib/util/feature-evaluator/repository/bootstrap-provider.js +25 -0
- package/dist/lib/util/feature-evaluator/repository/bootstrap-provider.js.map +1 -0
- package/dist/lib/util/feature-evaluator/repository/index.d.ts +35 -0
- package/dist/lib/util/feature-evaluator/repository/index.js +63 -0
- package/dist/lib/util/feature-evaluator/repository/index.js.map +1 -0
- package/dist/lib/util/feature-evaluator/repository/storage-provider-in-mem.d.ts +6 -0
- package/dist/lib/util/feature-evaluator/repository/storage-provider-in-mem.js +16 -0
- package/dist/lib/util/feature-evaluator/repository/storage-provider-in-mem.js.map +1 -0
- package/dist/lib/util/feature-evaluator/repository/storage-provider.d.ts +14 -0
- package/dist/lib/util/feature-evaluator/repository/storage-provider.js +50 -0
- package/dist/lib/util/feature-evaluator/repository/storage-provider.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/application-hostname-strategy.d.ts +8 -0
- package/dist/lib/util/feature-evaluator/strategy/application-hostname-strategy.js +23 -0
- package/dist/lib/util/feature-evaluator/strategy/application-hostname-strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/default-strategy.d.ts +5 -0
- package/dist/lib/util/feature-evaluator/strategy/default-strategy.js +13 -0
- package/dist/lib/util/feature-evaluator/strategy/default-strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/flexible-rollout-strategy.d.ts +12 -0
- package/dist/lib/util/feature-evaluator/strategy/flexible-rollout-strategy.js +49 -0
- package/dist/lib/util/feature-evaluator/strategy/flexible-rollout-strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-random.d.ts +9 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-random.js +19 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-random.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-session-id.d.ts +9 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-session-id.js +24 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-session-id.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-user-id.d.ts +9 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-user-id.js +24 -0
- package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-user-id.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/index.d.ts +4 -0
- package/dist/lib/util/feature-evaluator/strategy/index.js +29 -0
- package/dist/lib/util/feature-evaluator/strategy/index.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/remote-address-strategy.d.ts +8 -0
- package/dist/lib/util/feature-evaluator/strategy/remote-address-strategy.js +35 -0
- package/dist/lib/util/feature-evaluator/strategy/remote-address-strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/strategy.d.ts +41 -0
- package/dist/lib/util/feature-evaluator/strategy/strategy.js +75 -0
- package/dist/lib/util/feature-evaluator/strategy/strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/unknown-strategy.d.ts +9 -0
- package/dist/lib/util/feature-evaluator/strategy/unknown-strategy.js +29 -0
- package/dist/lib/util/feature-evaluator/strategy/unknown-strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/user-with-id-strategy.d.ts +8 -0
- package/dist/lib/util/feature-evaluator/strategy/user-with-id-strategy.js +16 -0
- package/dist/lib/util/feature-evaluator/strategy/user-with-id-strategy.js.map +1 -0
- package/dist/lib/util/feature-evaluator/strategy/util.d.ts +1 -0
- package/dist/lib/util/feature-evaluator/strategy/util.js +31 -0
- package/dist/lib/util/feature-evaluator/strategy/util.js.map +1 -0
- package/dist/lib/util/feature-evaluator/variant.d.ts +28 -0
- package/dist/lib/util/feature-evaluator/variant.js +73 -0
- package/dist/lib/util/feature-evaluator/variant.js.map +1 -0
- package/dist/lib/util/offline-unleash-client.d.ts +13 -2
- package/dist/lib/util/offline-unleash-client.js +12 -13
- package/dist/lib/util/offline-unleash-client.js.map +1 -1
- package/dist/lib/util/offline-unleash-client.test.d.ts +3 -1
- package/dist/lib/util/offline-unleash-client.test.js +349 -139
- package/dist/lib/util/offline-unleash-client.test.js.map +1 -1
- package/dist/migrations/20220808084524-add-group-permissions.d.ts +2 -0
- package/dist/migrations/20220808084524-add-group-permissions.js +12 -0
- package/dist/migrations/20220808084524-add-group-permissions.js.map +1 -0
- package/dist/migrations/20220808110415-add-projects-foreign-key.d.ts +2 -0
- package/dist/migrations/20220808110415-add-projects-foreign-key.js +14 -0
- package/dist/migrations/20220808110415-add-projects-foreign-key.js.map +1 -0
- package/dist/test/arbitraries.test.d.ts +12 -2
- package/dist/test/arbitraries.test.js +67 -9
- package/dist/test/arbitraries.test.js.map +1 -1
- package/dist/test/e2e/api/admin/config.e2e.test.js +2 -1
- package/dist/test/e2e/api/admin/config.e2e.test.js.map +1 -1
- package/dist/test/e2e/api/admin/event.e2e.test.js +57 -0
- package/dist/test/e2e/api/admin/event.e2e.test.js.map +1 -1
- package/dist/test/e2e/api/admin/feature.e2e.test.js +8 -7
- package/dist/test/e2e/api/admin/feature.e2e.test.js.map +1 -1
- package/dist/test/e2e/api/admin/playground.e2e.test.js +22 -0
- package/dist/test/e2e/api/admin/playground.e2e.test.js.map +1 -1
- package/dist/test/e2e/services/access-service.e2e.test.js +38 -20
- package/dist/test/e2e/services/access-service.e2e.test.js.map +1 -1
- package/dist/test/e2e/services/playground-service.test.d.ts +5 -1
- package/dist/test/e2e/services/playground-service.test.js +725 -37
- package/dist/test/e2e/services/playground-service.test.js.map +1 -1
- package/dist/test/e2e/services/project-service.e2e.test.js +12 -4
- package/dist/test/e2e/services/project-service.e2e.test.js.map +1 -1
- package/dist/test/e2e/services/setting-service.test.js +9 -3
- package/dist/test/e2e/services/setting-service.test.js.map +1 -1
- package/dist/test/e2e/stores/event-store.e2e.test.js +6 -2
- package/dist/test/e2e/stores/event-store.e2e.test.js.map +1 -1
- package/dist/test/fixtures/fake-event-store.d.ts +1 -3
- package/dist/test/fixtures/fake-event-store.js +2 -8
- package/dist/test/fixtures/fake-event-store.js.map +1 -1
- package/dist/test/fixtures/fake-group-store.d.ts +0 -1
- package/dist/test/fixtures/fake-group-store.js +0 -3
- package/dist/test/fixtures/fake-group-store.js.map +1 -1
- package/package.json +15 -13
- package/dist/lib/openapi/spec/bootstrap-ui-schema.d.ts +0 -491
- package/dist/lib/openapi/spec/bootstrap-ui-schema.js +0 -94
- package/dist/lib/openapi/spec/bootstrap-ui-schema.js.map +0 -1
- package/dist/lib/openapi/spec/bootstrap-ui-schema.test.js +0 -145
- package/dist/lib/openapi/spec/bootstrap-ui-schema.test.js.map +0 -1
- package/dist/lib/openapi/spec/client-variant-schema.d.ts +0 -35
- package/dist/lib/openapi/spec/client-variant-schema.js +0 -37
- package/dist/lib/openapi/spec/client-variant-schema.js.map +0 -1
- package/dist/lib/routes/admin-api/bootstrap-ui.d.ts +0 -25
- package/dist/lib/routes/admin-api/bootstrap-ui.js +0 -82
- package/dist/lib/routes/admin-api/bootstrap-ui.js.map +0 -1
- package/dist/lib/routes/admin-api/bootstrap-ui.test.js +0 -60
- package/dist/lib/routes/admin-api/bootstrap-ui.test.js.map +0 -1
- package/dist/test/e2e/api/admin/bootstrap.test.js +0 -43
- package/dist/test/e2e/api/admin/bootstrap.test.js.map +0 -1
|
@@ -26,35 +26,45 @@ export declare const clientFeaturesSchema: {
|
|
|
26
26
|
readonly components: {
|
|
27
27
|
readonly schemas: {
|
|
28
28
|
readonly constraintSchema: {
|
|
29
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
30
29
|
readonly type: "object";
|
|
31
|
-
readonly additionalProperties: false;
|
|
32
30
|
readonly required: readonly ["contextName", "operator"];
|
|
31
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
33
32
|
readonly properties: {
|
|
34
33
|
readonly contextName: {
|
|
34
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
35
|
+
readonly example: "appName";
|
|
35
36
|
readonly type: "string";
|
|
36
37
|
};
|
|
37
38
|
readonly operator: {
|
|
39
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
38
40
|
readonly type: "string";
|
|
39
41
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
40
42
|
};
|
|
41
43
|
readonly caseInsensitive: {
|
|
44
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
42
45
|
readonly type: "boolean";
|
|
46
|
+
readonly default: false;
|
|
43
47
|
};
|
|
44
48
|
readonly inverted: {
|
|
49
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
45
50
|
readonly type: "boolean";
|
|
51
|
+
readonly default: false;
|
|
46
52
|
};
|
|
47
53
|
readonly values: {
|
|
48
54
|
readonly type: "array";
|
|
55
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
49
56
|
readonly items: {
|
|
50
57
|
readonly type: "string";
|
|
51
58
|
};
|
|
52
59
|
};
|
|
53
60
|
readonly value: {
|
|
61
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
54
62
|
readonly type: "string";
|
|
55
63
|
};
|
|
56
64
|
};
|
|
57
65
|
readonly components: {};
|
|
66
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
67
|
+
readonly additionalProperties: false;
|
|
58
68
|
};
|
|
59
69
|
readonly clientFeatureSchema: {
|
|
60
70
|
readonly $id: "#/components/schemas/clientFeatureSchema";
|
|
@@ -104,7 +114,7 @@ export declare const clientFeaturesSchema: {
|
|
|
104
114
|
readonly variants: {
|
|
105
115
|
readonly type: "array";
|
|
106
116
|
readonly items: {
|
|
107
|
-
readonly $ref: "#/components/schemas/
|
|
117
|
+
readonly $ref: "#/components/schemas/variantSchema";
|
|
108
118
|
};
|
|
109
119
|
readonly nullable: true;
|
|
110
120
|
};
|
|
@@ -112,35 +122,45 @@ export declare const clientFeaturesSchema: {
|
|
|
112
122
|
readonly components: {
|
|
113
123
|
readonly schemas: {
|
|
114
124
|
readonly constraintSchema: {
|
|
115
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
116
125
|
readonly type: "object";
|
|
117
|
-
readonly additionalProperties: false;
|
|
118
126
|
readonly required: readonly ["contextName", "operator"];
|
|
127
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
119
128
|
readonly properties: {
|
|
120
129
|
readonly contextName: {
|
|
130
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
131
|
+
readonly example: "appName";
|
|
121
132
|
readonly type: "string";
|
|
122
133
|
};
|
|
123
134
|
readonly operator: {
|
|
135
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
124
136
|
readonly type: "string";
|
|
125
137
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
126
138
|
};
|
|
127
139
|
readonly caseInsensitive: {
|
|
140
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
128
141
|
readonly type: "boolean";
|
|
142
|
+
readonly default: false;
|
|
129
143
|
};
|
|
130
144
|
readonly inverted: {
|
|
145
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
131
146
|
readonly type: "boolean";
|
|
147
|
+
readonly default: false;
|
|
132
148
|
};
|
|
133
149
|
readonly values: {
|
|
134
150
|
readonly type: "array";
|
|
151
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
135
152
|
readonly items: {
|
|
136
153
|
readonly type: "string";
|
|
137
154
|
};
|
|
138
155
|
};
|
|
139
156
|
readonly value: {
|
|
157
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
140
158
|
readonly type: "string";
|
|
141
159
|
};
|
|
142
160
|
};
|
|
143
161
|
readonly components: {};
|
|
162
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
163
|
+
readonly additionalProperties: false;
|
|
144
164
|
};
|
|
145
165
|
readonly parametersSchema: {
|
|
146
166
|
readonly $id: "#/components/schemas/parametersSchema";
|
|
@@ -184,35 +204,45 @@ export declare const clientFeaturesSchema: {
|
|
|
184
204
|
readonly components: {
|
|
185
205
|
readonly schemas: {
|
|
186
206
|
readonly constraintSchema: {
|
|
187
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
188
207
|
readonly type: "object";
|
|
189
|
-
readonly additionalProperties: false;
|
|
190
208
|
readonly required: readonly ["contextName", "operator"];
|
|
209
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
191
210
|
readonly properties: {
|
|
192
211
|
readonly contextName: {
|
|
212
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
213
|
+
readonly example: "appName";
|
|
193
214
|
readonly type: "string";
|
|
194
215
|
};
|
|
195
216
|
readonly operator: {
|
|
217
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
196
218
|
readonly type: "string";
|
|
197
219
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
198
220
|
};
|
|
199
221
|
readonly caseInsensitive: {
|
|
222
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
200
223
|
readonly type: "boolean";
|
|
224
|
+
readonly default: false;
|
|
201
225
|
};
|
|
202
226
|
readonly inverted: {
|
|
227
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
203
228
|
readonly type: "boolean";
|
|
229
|
+
readonly default: false;
|
|
204
230
|
};
|
|
205
231
|
readonly values: {
|
|
206
232
|
readonly type: "array";
|
|
233
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
207
234
|
readonly items: {
|
|
208
235
|
readonly type: "string";
|
|
209
236
|
};
|
|
210
237
|
};
|
|
211
238
|
readonly value: {
|
|
239
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
212
240
|
readonly type: "string";
|
|
213
241
|
};
|
|
214
242
|
};
|
|
215
243
|
readonly components: {};
|
|
244
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
245
|
+
readonly additionalProperties: false;
|
|
216
246
|
};
|
|
217
247
|
readonly parametersSchema: {
|
|
218
248
|
readonly $id: "#/components/schemas/parametersSchema";
|
|
@@ -225,8 +255,8 @@ export declare const clientFeaturesSchema: {
|
|
|
225
255
|
};
|
|
226
256
|
};
|
|
227
257
|
};
|
|
228
|
-
readonly
|
|
229
|
-
readonly $id: "#/components/schemas/
|
|
258
|
+
readonly variantSchema: {
|
|
259
|
+
readonly $id: "#/components/schemas/variantSchema";
|
|
230
260
|
readonly type: "object";
|
|
231
261
|
readonly additionalProperties: false;
|
|
232
262
|
readonly required: readonly ["name", "weight"];
|
|
@@ -255,6 +285,51 @@ export declare const clientFeaturesSchema: {
|
|
|
255
285
|
};
|
|
256
286
|
};
|
|
257
287
|
};
|
|
288
|
+
readonly overrides: {
|
|
289
|
+
readonly type: "array";
|
|
290
|
+
readonly items: {
|
|
291
|
+
readonly $ref: "#/components/schemas/overrideSchema";
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
readonly components: {
|
|
296
|
+
readonly schemas: {
|
|
297
|
+
readonly overrideSchema: {
|
|
298
|
+
readonly $id: "#/components/schemas/overrideSchema";
|
|
299
|
+
readonly type: "object";
|
|
300
|
+
readonly additionalProperties: false;
|
|
301
|
+
readonly required: readonly ["contextName", "values"];
|
|
302
|
+
readonly properties: {
|
|
303
|
+
readonly contextName: {
|
|
304
|
+
readonly type: "string";
|
|
305
|
+
};
|
|
306
|
+
readonly values: {
|
|
307
|
+
readonly type: "array";
|
|
308
|
+
readonly items: {
|
|
309
|
+
readonly type: "string";
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
readonly components: {};
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
readonly overrideSchema: {
|
|
319
|
+
readonly $id: "#/components/schemas/overrideSchema";
|
|
320
|
+
readonly type: "object";
|
|
321
|
+
readonly additionalProperties: false;
|
|
322
|
+
readonly required: readonly ["contextName", "values"];
|
|
323
|
+
readonly properties: {
|
|
324
|
+
readonly contextName: {
|
|
325
|
+
readonly type: "string";
|
|
326
|
+
};
|
|
327
|
+
readonly values: {
|
|
328
|
+
readonly type: "array";
|
|
329
|
+
readonly items: {
|
|
330
|
+
readonly type: "string";
|
|
331
|
+
};
|
|
332
|
+
};
|
|
258
333
|
};
|
|
259
334
|
readonly components: {};
|
|
260
335
|
};
|
|
@@ -311,35 +386,45 @@ export declare const clientFeaturesSchema: {
|
|
|
311
386
|
readonly components: {
|
|
312
387
|
readonly schemas: {
|
|
313
388
|
readonly constraintSchema: {
|
|
314
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
315
389
|
readonly type: "object";
|
|
316
|
-
readonly additionalProperties: false;
|
|
317
390
|
readonly required: readonly ["contextName", "operator"];
|
|
391
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
318
392
|
readonly properties: {
|
|
319
393
|
readonly contextName: {
|
|
394
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
395
|
+
readonly example: "appName";
|
|
320
396
|
readonly type: "string";
|
|
321
397
|
};
|
|
322
398
|
readonly operator: {
|
|
399
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
323
400
|
readonly type: "string";
|
|
324
401
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
325
402
|
};
|
|
326
403
|
readonly caseInsensitive: {
|
|
404
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
327
405
|
readonly type: "boolean";
|
|
406
|
+
readonly default: false;
|
|
328
407
|
};
|
|
329
408
|
readonly inverted: {
|
|
409
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
330
410
|
readonly type: "boolean";
|
|
411
|
+
readonly default: false;
|
|
331
412
|
};
|
|
332
413
|
readonly values: {
|
|
333
414
|
readonly type: "array";
|
|
415
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
334
416
|
readonly items: {
|
|
335
417
|
readonly type: "string";
|
|
336
418
|
};
|
|
337
419
|
};
|
|
338
420
|
readonly value: {
|
|
421
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
339
422
|
readonly type: "string";
|
|
340
423
|
};
|
|
341
424
|
};
|
|
342
425
|
readonly components: {};
|
|
426
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
427
|
+
readonly additionalProperties: false;
|
|
343
428
|
};
|
|
344
429
|
};
|
|
345
430
|
};
|
|
@@ -436,35 +521,45 @@ export declare const clientFeaturesSchema: {
|
|
|
436
521
|
readonly components: {
|
|
437
522
|
readonly schemas: {
|
|
438
523
|
readonly constraintSchema: {
|
|
439
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
440
524
|
readonly type: "object";
|
|
441
|
-
readonly additionalProperties: false;
|
|
442
525
|
readonly required: readonly ["contextName", "operator"];
|
|
526
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
443
527
|
readonly properties: {
|
|
444
528
|
readonly contextName: {
|
|
529
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
530
|
+
readonly example: "appName";
|
|
445
531
|
readonly type: "string";
|
|
446
532
|
};
|
|
447
533
|
readonly operator: {
|
|
534
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
448
535
|
readonly type: "string";
|
|
449
536
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
450
537
|
};
|
|
451
538
|
readonly caseInsensitive: {
|
|
539
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
452
540
|
readonly type: "boolean";
|
|
541
|
+
readonly default: false;
|
|
453
542
|
};
|
|
454
543
|
readonly inverted: {
|
|
544
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
455
545
|
readonly type: "boolean";
|
|
546
|
+
readonly default: false;
|
|
456
547
|
};
|
|
457
548
|
readonly values: {
|
|
458
549
|
readonly type: "array";
|
|
550
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
459
551
|
readonly items: {
|
|
460
552
|
readonly type: "string";
|
|
461
553
|
};
|
|
462
554
|
};
|
|
463
555
|
readonly value: {
|
|
556
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
464
557
|
readonly type: "string";
|
|
465
558
|
};
|
|
466
559
|
};
|
|
467
560
|
readonly components: {};
|
|
561
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
562
|
+
readonly additionalProperties: false;
|
|
468
563
|
};
|
|
469
564
|
readonly parametersSchema: {
|
|
470
565
|
readonly $id: "#/components/schemas/parametersSchema";
|
|
@@ -477,8 +572,8 @@ export declare const clientFeaturesSchema: {
|
|
|
477
572
|
};
|
|
478
573
|
};
|
|
479
574
|
};
|
|
480
|
-
readonly
|
|
481
|
-
readonly $id: "#/components/schemas/
|
|
575
|
+
readonly variantSchema: {
|
|
576
|
+
readonly $id: "#/components/schemas/variantSchema";
|
|
482
577
|
readonly type: "object";
|
|
483
578
|
readonly additionalProperties: false;
|
|
484
579
|
readonly required: readonly ["name", "weight"];
|
|
@@ -507,8 +602,35 @@ export declare const clientFeaturesSchema: {
|
|
|
507
602
|
};
|
|
508
603
|
};
|
|
509
604
|
};
|
|
605
|
+
readonly overrides: {
|
|
606
|
+
readonly type: "array";
|
|
607
|
+
readonly items: {
|
|
608
|
+
readonly $ref: "#/components/schemas/overrideSchema";
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
readonly components: {
|
|
613
|
+
readonly schemas: {
|
|
614
|
+
readonly overrideSchema: {
|
|
615
|
+
readonly $id: "#/components/schemas/overrideSchema";
|
|
616
|
+
readonly type: "object";
|
|
617
|
+
readonly additionalProperties: false;
|
|
618
|
+
readonly required: readonly ["contextName", "values"];
|
|
619
|
+
readonly properties: {
|
|
620
|
+
readonly contextName: {
|
|
621
|
+
readonly type: "string";
|
|
622
|
+
};
|
|
623
|
+
readonly values: {
|
|
624
|
+
readonly type: "array";
|
|
625
|
+
readonly items: {
|
|
626
|
+
readonly type: "string";
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
readonly components: {};
|
|
631
|
+
};
|
|
632
|
+
};
|
|
510
633
|
};
|
|
511
|
-
readonly components: {};
|
|
512
634
|
};
|
|
513
635
|
};
|
|
514
636
|
};
|
|
@@ -9,7 +9,7 @@ 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
11
|
const client_feature_schema_1 = require("./client-feature-schema");
|
|
12
|
-
const
|
|
12
|
+
const variant_schema_1 = require("./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
|
+
variantSchema: variant_schema_1.variantSchema,
|
|
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,mEAA8D;AAC9D,
|
|
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,qDAAiD;AAEpC,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,aAAa,EAAb,8BAAa;SAChB;KACJ;CACK,CAAC"}
|
|
@@ -19,6 +19,16 @@ test('clientFeaturesSchema required fields', () => {
|
|
|
19
19
|
weight: 1,
|
|
20
20
|
weightType: 'b',
|
|
21
21
|
stickiness: 'c',
|
|
22
|
+
payload: {
|
|
23
|
+
type: 'a',
|
|
24
|
+
value: 'b',
|
|
25
|
+
},
|
|
26
|
+
overrides: [
|
|
27
|
+
{
|
|
28
|
+
contextName: 'a',
|
|
29
|
+
values: ['b'],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
22
32
|
},
|
|
23
33
|
],
|
|
24
34
|
},
|
|
@@ -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;gBACrB,QAAQ,EAAE;oBACN;wBACI,IAAI,EAAE,GAAG;wBACT,MAAM,EAAE,CAAC;wBACT,UAAU,EAAE,GAAG;wBACf,UAAU,EAAE,GAAG;
|
|
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;wBACf,OAAO,EAAE;4BACL,IAAI,EAAE,GAAG;4BACT,KAAK,EAAE,GAAG;yBACb;wBACD,SAAS,EAAE;4BACP;gCACI,WAAW,EAAE,GAAG;gCAChB,MAAM,EAAE,CAAC,GAAG,CAAC;6BAChB;yBACJ;qBACJ;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"}
|
|
@@ -1,33 +1,82 @@
|
|
|
1
1
|
import { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
export declare const constraintSchemaBase: {
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly required: readonly ["contextName", "operator"];
|
|
5
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly contextName: {
|
|
8
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
9
|
+
readonly example: "appName";
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
};
|
|
12
|
+
readonly operator: {
|
|
13
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
16
|
+
};
|
|
17
|
+
readonly caseInsensitive: {
|
|
18
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
19
|
+
readonly type: "boolean";
|
|
20
|
+
readonly default: false;
|
|
21
|
+
};
|
|
22
|
+
readonly inverted: {
|
|
23
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
24
|
+
readonly type: "boolean";
|
|
25
|
+
readonly default: false;
|
|
26
|
+
};
|
|
27
|
+
readonly values: {
|
|
28
|
+
readonly type: "array";
|
|
29
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
30
|
+
readonly items: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly value: {
|
|
35
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly components: {};
|
|
40
|
+
};
|
|
2
41
|
export declare const constraintSchema: {
|
|
3
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
4
42
|
readonly type: "object";
|
|
5
|
-
readonly additionalProperties: false;
|
|
6
43
|
readonly required: readonly ["contextName", "operator"];
|
|
44
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
7
45
|
readonly properties: {
|
|
8
46
|
readonly contextName: {
|
|
47
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
48
|
+
readonly example: "appName";
|
|
9
49
|
readonly type: "string";
|
|
10
50
|
};
|
|
11
51
|
readonly operator: {
|
|
52
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
12
53
|
readonly type: "string";
|
|
13
54
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
14
55
|
};
|
|
15
56
|
readonly caseInsensitive: {
|
|
57
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
16
58
|
readonly type: "boolean";
|
|
59
|
+
readonly default: false;
|
|
17
60
|
};
|
|
18
61
|
readonly inverted: {
|
|
62
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
19
63
|
readonly type: "boolean";
|
|
64
|
+
readonly default: false;
|
|
20
65
|
};
|
|
21
66
|
readonly values: {
|
|
22
67
|
readonly type: "array";
|
|
68
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
23
69
|
readonly items: {
|
|
24
70
|
readonly type: "string";
|
|
25
71
|
};
|
|
26
72
|
};
|
|
27
73
|
readonly value: {
|
|
74
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
28
75
|
readonly type: "string";
|
|
29
76
|
};
|
|
30
77
|
};
|
|
31
78
|
readonly components: {};
|
|
79
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
80
|
+
readonly additionalProperties: false;
|
|
32
81
|
};
|
|
33
82
|
export declare type ConstraintSchema = FromSchema<typeof constraintSchema>;
|
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constraintSchema = void 0;
|
|
3
|
+
exports.constraintSchema = exports.constraintSchemaBase = void 0;
|
|
4
4
|
const constants_1 = require("../../util/constants");
|
|
5
|
-
exports.
|
|
6
|
-
$id: '#/components/schemas/constraintSchema',
|
|
5
|
+
exports.constraintSchemaBase = {
|
|
7
6
|
type: 'object',
|
|
8
|
-
additionalProperties: false,
|
|
9
7
|
required: ['contextName', 'operator'],
|
|
8
|
+
description: 'A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)',
|
|
10
9
|
properties: {
|
|
11
10
|
contextName: {
|
|
11
|
+
description: 'The name of the context field that this constraint should apply to.',
|
|
12
|
+
example: 'appName',
|
|
12
13
|
type: 'string',
|
|
13
14
|
},
|
|
14
15
|
operator: {
|
|
16
|
+
description: 'The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).',
|
|
15
17
|
type: 'string',
|
|
16
18
|
enum: constants_1.ALL_OPERATORS,
|
|
17
19
|
},
|
|
18
20
|
caseInsensitive: {
|
|
21
|
+
description: 'Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).',
|
|
19
22
|
type: 'boolean',
|
|
23
|
+
default: false,
|
|
20
24
|
},
|
|
21
25
|
inverted: {
|
|
26
|
+
description: 'Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.',
|
|
22
27
|
type: 'boolean',
|
|
28
|
+
default: false,
|
|
23
29
|
},
|
|
24
30
|
values: {
|
|
25
31
|
type: 'array',
|
|
32
|
+
description: 'The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.',
|
|
26
33
|
items: {
|
|
27
34
|
type: 'string',
|
|
28
35
|
},
|
|
29
36
|
},
|
|
30
37
|
value: {
|
|
38
|
+
description: 'The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.',
|
|
31
39
|
type: 'string',
|
|
32
40
|
},
|
|
33
41
|
},
|
|
34
42
|
components: {},
|
|
35
43
|
};
|
|
44
|
+
exports.constraintSchema = {
|
|
45
|
+
$id: '#/components/schemas/constraintSchema',
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
...exports.constraintSchemaBase,
|
|
48
|
+
};
|
|
36
49
|
//# sourceMappingURL=constraint-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constraint-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/constraint-schema.ts"],"names":[],"mappings":";;;AACA,oDAAqD;AAExC,QAAA,
|
|
1
|
+
{"version":3,"file":"constraint-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/constraint-schema.ts"],"names":[],"mappings":";;;AACA,oDAAqD;AAExC,QAAA,oBAAoB,GAAG;IAChC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC;IACrC,WAAW,EACP,mKAAmK;IACvK,UAAU,EAAE;QACR,WAAW,EAAE;YACT,WAAW,EACP,qEAAqE;YACzE,OAAO,EAAE,SAAS;YAClB,IAAI,EAAE,QAAQ;SACjB;QACD,QAAQ,EAAE;YACN,WAAW,EACP,2PAA2P;YAC/P,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,yBAAa;SACtB;QACD,eAAe,EAAE;YACb,WAAW,EACP,mGAAmG;YACvG,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACjB;QACD,QAAQ,EAAE;YACN,WAAW,EACP,yHAAyH;YAC7H,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,WAAW,EACP,oJAAoJ;YACxJ,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,KAAK,EAAE;YACH,WAAW,EACP,uJAAuJ;YAC3J,IAAI,EAAE,QAAQ;SACjB;KACJ;IACD,UAAU,EAAE,EAAE;CACR,CAAC;AAEE,QAAA,gBAAgB,GAAG;IAC5B,GAAG,EAAE,uCAAuC;IAC5C,oBAAoB,EAAE,KAAK;IAC3B,GAAG,4BAAoB;CACjB,CAAC"}
|
|
@@ -8,7 +8,11 @@ test('contextFieldSchema', () => {
|
|
|
8
8
|
stickiness: false,
|
|
9
9
|
sortOrder: 0,
|
|
10
10
|
createdAt: '2022-01-01T00:00:00.000Z',
|
|
11
|
-
legalValues: [
|
|
11
|
+
legalValues: [
|
|
12
|
+
{ value: 'a' },
|
|
13
|
+
{ value: 'b', description: '' },
|
|
14
|
+
{ value: 'c', description: 'd' },
|
|
15
|
+
],
|
|
12
16
|
};
|
|
13
17
|
expect((0, validate_1.validateSchema)('#/components/schemas/contextFieldSchema', data)).toBeUndefined();
|
|
14
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-field-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/context-field-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAC5B,MAAM,IAAI,GAAuB;QAC7B,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"context-field-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/context-field-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAC5B,MAAM,IAAI,GAAuB;QAC7B,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE;YACT,EAAE,KAAK,EAAE,GAAG,EAAE;YACd,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE;YAC/B,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE;SACnC;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,yCAAyC,EAAE,IAAI,CAAC,CAClE,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE;IAClC,MAAM,CACF,IAAA,yBAAc,EAAC,yCAAyC,EAAE,EAAE,CAAC,CAChE,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC"}
|
|
@@ -23,35 +23,45 @@ export declare const createFeatureStrategySchema: {
|
|
|
23
23
|
readonly components: {
|
|
24
24
|
readonly schemas: {
|
|
25
25
|
readonly constraintSchema: {
|
|
26
|
-
readonly $id: "#/components/schemas/constraintSchema";
|
|
27
26
|
readonly type: "object";
|
|
28
|
-
readonly additionalProperties: false;
|
|
29
27
|
readonly required: readonly ["contextName", "operator"];
|
|
28
|
+
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
|
|
30
29
|
readonly properties: {
|
|
31
30
|
readonly contextName: {
|
|
31
|
+
readonly description: "The name of the context field that this constraint should apply to.";
|
|
32
|
+
readonly example: "appName";
|
|
32
33
|
readonly type: "string";
|
|
33
34
|
};
|
|
34
35
|
readonly operator: {
|
|
36
|
+
readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
|
|
35
37
|
readonly type: "string";
|
|
36
38
|
readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
|
|
37
39
|
};
|
|
38
40
|
readonly caseInsensitive: {
|
|
41
|
+
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
|
|
39
42
|
readonly type: "boolean";
|
|
43
|
+
readonly default: false;
|
|
40
44
|
};
|
|
41
45
|
readonly inverted: {
|
|
46
|
+
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
|
|
42
47
|
readonly type: "boolean";
|
|
48
|
+
readonly default: false;
|
|
43
49
|
};
|
|
44
50
|
readonly values: {
|
|
45
51
|
readonly type: "array";
|
|
52
|
+
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
|
|
46
53
|
readonly items: {
|
|
47
54
|
readonly type: "string";
|
|
48
55
|
};
|
|
49
56
|
};
|
|
50
57
|
readonly value: {
|
|
58
|
+
readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
|
|
51
59
|
readonly type: "string";
|
|
52
60
|
};
|
|
53
61
|
};
|
|
54
62
|
readonly components: {};
|
|
63
|
+
readonly $id: "#/components/schemas/constraintSchema";
|
|
64
|
+
readonly additionalProperties: false;
|
|
55
65
|
};
|
|
56
66
|
readonly parametersSchema: {
|
|
57
67
|
readonly $id: "#/components/schemas/parametersSchema";
|