unleash-server
Version:
Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.
258 lines (257 loc) • 14.8 kB
TypeScript
import { FromSchema } from 'json-schema-to-ts';
export declare const playgroundStrategyEvaluation: {
readonly evaluationComplete: "complete";
readonly evaluationIncomplete: "incomplete";
readonly unknownResult: "unknown";
};
export declare const strategyEvaluationResults: {
readonly anyOf: readonly [{
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["evaluationStatus", "enabled"];
readonly properties: {
readonly evaluationStatus: {
readonly type: "string";
readonly description: "Signals that this strategy could not be evaluated. This is most likely because you're using a custom strategy that Unleash doesn't know about.";
readonly enum: readonly ["incomplete"];
};
readonly enabled: {
readonly description: "Whether this strategy resolves to `false` or if it might resolve to `true`. Because Unleash can't evaluate the strategy, it can't say for certain whether it will be `true`, but if you have failing constraints or segments, it _can_ determine that your strategy would be `false`.";
readonly anyOf: readonly [{
readonly type: "boolean";
readonly enum: readonly [false];
}, {
readonly type: "string";
readonly enum: readonly ["unknown"];
}];
};
};
}, {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["evaluationStatus", "enabled"];
readonly properties: {
readonly evaluationStatus: {
readonly description: "Signals that this strategy was evaluated successfully.";
readonly type: "string";
readonly enum: readonly ["complete"];
};
readonly enabled: {
readonly type: "boolean";
readonly description: "Whether this strategy evaluates to true or not.";
};
};
}];
};
export declare const playgroundStrategySchema: {
readonly $id: "#/components/schemas/playgroundStrategySchema";
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["id", "name", "result", "segments", "constraints", "parameters"];
readonly properties: {
readonly name: {
readonly description: "The strategy's name.";
readonly type: "string";
};
readonly id: {
readonly description: "The strategy's id.";
readonly type: "string";
};
readonly result: {
readonly anyOf: readonly [{
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["evaluationStatus", "enabled"];
readonly properties: {
readonly evaluationStatus: {
readonly type: "string";
readonly description: "Signals that this strategy could not be evaluated. This is most likely because you're using a custom strategy that Unleash doesn't know about.";
readonly enum: readonly ["incomplete"];
};
readonly enabled: {
readonly description: "Whether this strategy resolves to `false` or if it might resolve to `true`. Because Unleash can't evaluate the strategy, it can't say for certain whether it will be `true`, but if you have failing constraints or segments, it _can_ determine that your strategy would be `false`.";
readonly anyOf: readonly [{
readonly type: "boolean";
readonly enum: readonly [false];
}, {
readonly type: "string";
readonly enum: readonly ["unknown"];
}];
};
};
}, {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["evaluationStatus", "enabled"];
readonly properties: {
readonly evaluationStatus: {
readonly description: "Signals that this strategy was evaluated successfully.";
readonly type: "string";
readonly enum: readonly ["complete"];
};
readonly enabled: {
readonly type: "boolean";
readonly description: "Whether this strategy evaluates to true or not.";
};
};
}];
readonly description: "The strategy's evaluation result. If the strategy is a custom strategy that Unleash can't evaluate, `evaluationStatus` will be `unknown`. Otherwise, it will be `true` or `false`";
};
readonly segments: {
readonly type: "array";
readonly description: "The strategy's segments and their evaluation results.";
readonly items: {
readonly $ref: "#/components/schemas/playgroundSegmentSchema";
};
};
readonly constraints: {
readonly type: "array";
readonly description: "The strategy's constraints and their evaluation results.";
readonly items: {
readonly $ref: "#/components/schemas/playgroundConstraintSchema";
};
};
readonly parameters: {
readonly description: "The strategy's constraints and their evaluation results.";
readonly example: {
readonly myParam1: "param value";
};
readonly $ref: "#/components/schemas/parametersSchema";
};
};
readonly components: {
readonly schemas: {
readonly playgroundConstraintSchema: {
readonly required: readonly ["contextName", "operator", "result"];
readonly properties: {
readonly result: {
readonly description: "Whether this was evaluated as true or false.";
readonly type: "boolean";
};
readonly contextName: {
readonly description: "The name of the context field that this constraint should apply to.";
readonly example: "appName";
readonly type: "string";
};
readonly operator: {
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/reference/strategy-constraints#strategy-constraint-operators).";
readonly type: "string";
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"];
};
readonly caseInsensitive: {
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
readonly type: "boolean";
readonly default: false;
};
readonly inverted: {
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
readonly type: "boolean";
readonly default: false;
};
readonly values: {
readonly type: "array";
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
readonly items: {
readonly type: "string";
};
};
readonly value: {
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.";
readonly type: "string";
};
};
readonly type: "object";
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)";
readonly components: {};
readonly $id: "#/components/schemas/playgroundConstraintSchema";
readonly additionalProperties: false;
};
readonly playgroundSegmentSchema: {
readonly $id: "#/components/schemas/playgroundSegmentSchema";
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["name", "id", "constraints", "result"];
readonly properties: {
readonly id: {
readonly description: "The segment's id.";
readonly type: "integer";
};
readonly name: {
readonly description: "The name of the segment.";
readonly example: "segment A";
readonly type: "string";
};
readonly result: {
readonly description: "Whether this was evaluated as true or false.";
readonly type: "boolean";
};
readonly constraints: {
readonly type: "array";
readonly description: "The list of constraints in this segment.";
readonly items: {
readonly $ref: "#/components/schemas/playgroundConstraintSchema";
};
};
};
readonly components: {
readonly schemas: {
readonly playgroundConstraintSchema: {
readonly required: readonly ["contextName", "operator", "result"];
readonly properties: {
readonly result: {
readonly description: "Whether this was evaluated as true or false.";
readonly type: "boolean";
};
readonly contextName: {
readonly description: "The name of the context field that this constraint should apply to.";
readonly example: "appName";
readonly type: "string";
};
readonly operator: {
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/reference/strategy-constraints#strategy-constraint-operators).";
readonly type: "string";
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"];
};
readonly caseInsensitive: {
readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
readonly type: "boolean";
readonly default: false;
};
readonly inverted: {
readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
readonly type: "boolean";
readonly default: false;
};
readonly values: {
readonly type: "array";
readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
readonly items: {
readonly type: "string";
};
};
readonly value: {
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.";
readonly type: "string";
};
};
readonly type: "object";
readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)";
readonly components: {};
readonly $id: "#/components/schemas/playgroundConstraintSchema";
readonly additionalProperties: false;
};
};
};
};
readonly parametersSchema: {
readonly $id: "#/components/schemas/parametersSchema";
readonly type: "object";
readonly additionalProperties: {
readonly type: "string";
};
readonly components: {};
};
};
};
};
export declare type PlaygroundStrategySchema = FromSchema<typeof playgroundStrategySchema>;