UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.

891 lines (890 loc) • 47.9 kB
import { FromSchema } from 'json-schema-to-ts'; export declare const stateSchema: { readonly $id: "#/components/schemas/stateSchema"; readonly type: "object"; readonly additionalProperties: true; readonly required: readonly ["version"]; readonly properties: { readonly version: { readonly type: "integer"; }; readonly features: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/featureSchema"; }; }; readonly strategies: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/strategySchema"; }; }; readonly tags: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/tagSchema"; }; }; readonly tagTypes: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/tagTypeSchema"; }; }; readonly featureTags: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/featureTagSchema"; }; }; readonly projects: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/projectSchema"; }; }; readonly featureStrategies: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/featureStrategySchema"; }; }; readonly featureEnvironments: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/featureEnvironmentSchema"; }; }; readonly environments: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/environmentSchema"; }; }; readonly segments: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/segmentSchema"; }; }; readonly featureStrategySegments: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/featureStrategySegmentSchema"; }; }; }; readonly components: { readonly schemas: { readonly featureSchema: { readonly $id: "#/components/schemas/featureSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; readonly description: { readonly type: "string"; }; readonly archived: { readonly type: "boolean"; }; readonly project: { readonly type: "string"; }; readonly enabled: { readonly type: "boolean"; }; readonly stale: { readonly type: "boolean"; }; readonly favorite: { readonly type: "boolean"; }; readonly impressionData: { readonly type: "boolean"; }; readonly createdAt: { readonly type: "string"; readonly format: "date-time"; readonly nullable: true; }; readonly archivedAt: { readonly type: "string"; readonly format: "date-time"; readonly nullable: true; }; readonly lastSeenAt: { readonly type: "string"; readonly format: "date-time"; readonly nullable: true; }; readonly environments: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/environmentSchema"; }; }; readonly strategies: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/featureStrategySchema"; }; }; readonly variants: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/variantSchema"; }; }; readonly tags: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/tagSchema"; }; readonly nullable: true; }; }; readonly components: { readonly schemas: { readonly constraintSchema: { readonly type: "object"; readonly required: readonly ["contextName", "operator"]; readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)"; readonly properties: { 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 components: {}; readonly $id: "#/components/schemas/constraintSchema"; readonly additionalProperties: false; }; readonly environmentSchema: { readonly $id: "#/components/schemas/environmentSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name", "type", "enabled"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; readonly enabled: { readonly type: "boolean"; }; readonly protected: { readonly type: "boolean"; }; readonly sortOrder: { readonly type: "number"; }; readonly projectCount: { readonly type: "number"; readonly nullable: true; }; readonly apiTokenCount: { readonly type: "number"; readonly nullable: true; }; readonly enabledToggleCount: { readonly type: "number"; readonly nullable: true; }; }; readonly components: {}; }; readonly overrideSchema: { readonly $id: "#/components/schemas/overrideSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["contextName", "values"]; readonly properties: { readonly contextName: { readonly type: "string"; }; readonly values: { readonly type: "array"; readonly items: { readonly type: "string"; }; }; }; readonly components: {}; }; readonly parametersSchema: { readonly $id: "#/components/schemas/parametersSchema"; readonly type: "object"; readonly additionalProperties: { readonly type: "string"; }; readonly components: {}; }; readonly featureStrategySchema: { readonly $id: "#/components/schemas/featureStrategySchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name"]; readonly properties: { readonly id: { readonly type: "string"; }; readonly name: { readonly type: "string"; }; readonly sortOrder: { readonly type: "number"; }; readonly segments: { readonly type: "array"; readonly items: { readonly type: "number"; }; }; readonly constraints: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; readonly parameters: { readonly $ref: "#/components/schemas/parametersSchema"; }; }; readonly components: { readonly schemas: { readonly constraintSchema: { readonly type: "object"; readonly required: readonly ["contextName", "operator"]; readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)"; readonly properties: { 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 components: {}; readonly $id: "#/components/schemas/constraintSchema"; readonly additionalProperties: false; }; readonly parametersSchema: { readonly $id: "#/components/schemas/parametersSchema"; readonly type: "object"; readonly additionalProperties: { readonly type: "string"; }; readonly components: {}; }; }; }; }; readonly variantSchema: { readonly $id: "#/components/schemas/variantSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name", "weight"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly weight: { readonly type: "number"; }; readonly weightType: { readonly type: "string"; }; readonly stickiness: { readonly type: "string"; }; readonly payload: { readonly type: "object"; readonly required: readonly ["type", "value"]; readonly properties: { readonly type: { readonly type: "string"; }; readonly value: { readonly type: "string"; }; }; }; readonly overrides: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/overrideSchema"; }; }; }; readonly components: { readonly schemas: { readonly overrideSchema: { readonly $id: "#/components/schemas/overrideSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["contextName", "values"]; readonly properties: { readonly contextName: { readonly type: "string"; }; readonly values: { readonly type: "array"; readonly items: { readonly type: "string"; }; }; }; readonly components: {}; }; }; }; }; readonly tagSchema: { readonly $id: "#/components/schemas/tagSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["value", "type"]; readonly properties: { readonly value: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; }; readonly components: {}; }; }; }; }; readonly tagSchema: { readonly $id: "#/components/schemas/tagSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["value", "type"]; readonly properties: { readonly value: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; }; readonly components: {}; }; readonly tagTypeSchema: { readonly $id: "#/components/schemas/tagTypeSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly description: { readonly type: "string"; }; readonly icon: { readonly type: "string"; readonly nullable: true; }; }; readonly components: {}; }; readonly featureTagSchema: { readonly $id: "#/components/schemas/featureTagSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["featureName", "tagValue"]; readonly properties: { readonly featureName: { readonly type: "string"; }; readonly tagType: { readonly type: "string"; }; readonly tagValue: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; readonly value: { readonly type: "string"; }; }; readonly components: {}; }; readonly projectSchema: { readonly $id: "#/components/schemas/projectSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "name"]; readonly properties: { readonly id: { readonly type: "string"; }; readonly name: { readonly type: "string"; }; readonly description: { readonly type: "string"; }; readonly health: { readonly type: "number"; }; readonly featureCount: { readonly type: "number"; }; readonly memberCount: { readonly type: "number"; }; readonly createdAt: { readonly type: "string"; readonly format: "date-time"; }; readonly updatedAt: { readonly type: "string"; readonly format: "date-time"; readonly nullable: true; }; readonly changeRequestsEnabled: { readonly type: "boolean"; }; readonly favorite: { readonly type: "boolean"; }; }; readonly components: {}; }; readonly featureStrategySchema: { readonly $id: "#/components/schemas/featureStrategySchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name"]; readonly properties: { readonly id: { readonly type: "string"; }; readonly name: { readonly type: "string"; }; readonly sortOrder: { readonly type: "number"; }; readonly segments: { readonly type: "array"; readonly items: { readonly type: "number"; }; }; readonly constraints: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; readonly parameters: { readonly $ref: "#/components/schemas/parametersSchema"; }; }; readonly components: { readonly schemas: { readonly constraintSchema: { readonly type: "object"; readonly required: readonly ["contextName", "operator"]; readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)"; readonly properties: { 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 components: {}; readonly $id: "#/components/schemas/constraintSchema"; readonly additionalProperties: false; }; readonly parametersSchema: { readonly $id: "#/components/schemas/parametersSchema"; readonly type: "object"; readonly additionalProperties: { readonly type: "string"; }; readonly components: {}; }; }; }; }; readonly featureEnvironmentSchema: { readonly $id: "#/components/schemas/featureEnvironmentSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name", "enabled"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly environment: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; readonly enabled: { readonly type: "boolean"; }; readonly strategies: { readonly type: "array"; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "featureName", "projectId", "environment", "strategyName", "constraints", "parameters"]; readonly properties: { readonly id: { readonly type: "string"; }; readonly featureName: { readonly type: "string"; }; readonly projectId: { readonly type: "string"; }; readonly environment: { readonly type: "string"; }; readonly strategyName: { readonly type: "string"; }; readonly sortOrder: { readonly type: "number"; }; readonly createdAt: { readonly type: "string"; readonly format: "date-time"; }; readonly constraints: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; readonly parameters: { readonly $ref: "#/components/schemas/parametersSchema"; }; }; }; }; }; readonly components: { readonly schemas: { readonly constraintSchema: { readonly type: "object"; readonly required: readonly ["contextName", "operator"]; readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)"; readonly properties: { 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 components: {}; readonly $id: "#/components/schemas/constraintSchema"; readonly additionalProperties: false; }; readonly parametersSchema: { readonly $id: "#/components/schemas/parametersSchema"; readonly type: "object"; readonly additionalProperties: { readonly type: "string"; }; readonly components: {}; }; }; }; }; readonly environmentSchema: { readonly $id: "#/components/schemas/environmentSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name", "type", "enabled"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; readonly enabled: { readonly type: "boolean"; }; readonly protected: { readonly type: "boolean"; }; readonly sortOrder: { readonly type: "number"; }; readonly projectCount: { readonly type: "number"; readonly nullable: true; }; readonly apiTokenCount: { readonly type: "number"; readonly nullable: true; }; readonly enabledToggleCount: { readonly type: "number"; readonly nullable: true; }; }; readonly components: {}; }; readonly segmentSchema: { readonly $id: "#/components/schemas/segmentSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "constraints"]; readonly properties: { readonly id: { readonly type: "number"; }; readonly name: { readonly type: "string"; }; readonly description: { readonly type: "string"; readonly nullable: true; }; readonly constraints: { readonly type: "array"; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; }; readonly components: { readonly schemas: { readonly constraintSchema: { readonly type: "object"; readonly required: readonly ["contextName", "operator"]; readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/strategy-constraints)"; readonly properties: { 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 components: {}; readonly $id: "#/components/schemas/constraintSchema"; readonly additionalProperties: false; }; }; }; }; readonly featureStrategySegmentSchema: { readonly $id: "#/components/schemas/featureStrategySegmentSchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["segmentId", "featureStrategyId"]; readonly properties: { readonly segmentId: { readonly type: "integer"; }; readonly featureStrategyId: { readonly type: "string"; }; }; readonly components: {}; }; readonly strategySchema: { readonly $id: "#/components/schemas/strategySchema"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["name", "displayName", "description", "editable", "deprecated", "parameters"]; readonly properties: { readonly name: { readonly type: "string"; }; readonly displayName: { readonly type: "string"; readonly nullable: true; }; readonly description: { readonly type: "string"; }; readonly editable: { readonly type: "boolean"; }; readonly deprecated: { readonly type: "boolean"; }; readonly parameters: { readonly type: "array"; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly properties: { readonly name: { readonly type: "string"; }; readonly type: { readonly type: "string"; }; readonly description: { readonly type: "string"; }; readonly required: { readonly type: "boolean"; }; }; }; }; }; readonly components: {}; }; }; }; }; export declare type StateSchema = FromSchema<typeof stateSchema>;