unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
753 lines • 1.33 MB
TypeScript
import type { FromSchema } from 'json-schema-to-ts';
export declare const exportResultSchema: {
readonly $id: "#/components/schemas/exportResultSchema";
readonly type: "object";
readonly additionalProperties: false;
readonly description: "The result of the export operation, providing you with the feature flag definitions, strategy definitions and the rest of the elements relevant to the features (tags, environments etc.)";
readonly required: readonly ["features", "featureStrategies", "tagTypes"];
readonly properties: {
readonly features: {
readonly type: "array";
readonly description: "All the exported features.";
readonly example: readonly [{
readonly name: "my-feature";
readonly description: "best feature ever";
readonly type: "release";
readonly project: "default";
readonly stale: false;
readonly impressionData: false;
readonly archived: false;
}];
readonly items: {
readonly $ref: "#/components/schemas/featureSchema";
};
};
readonly featureStrategies: {
readonly type: "array";
readonly description: "All strategy instances that are used by the exported features in the `features` list.";
readonly example: readonly [{
readonly name: "flexibleRollout";
readonly id: "924974d7-8003-43ee-87eb-c5f887c06fd1";
readonly featureName: "my-feature";
readonly title: "Rollout 50%";
readonly parameters: {
readonly groupId: "default";
readonly rollout: "50";
readonly stickiness: "random";
};
readonly constraints: readonly [];
readonly disabled: false;
readonly segments: readonly [1];
}];
readonly items: {
readonly $ref: "#/components/schemas/featureStrategySchema";
};
};
readonly featureEnvironments: {
readonly type: "array";
readonly description: "Environment-specific configuration for all the features in the `features` list. Includes data such as whether the feature is enabled in the selected export environment, whether there are any variants assigned, etc.";
readonly example: readonly [{
readonly enabled: true;
readonly featureName: "my-feature";
readonly environment: "development";
readonly variants: readonly [{
readonly name: "a";
readonly weight: 500;
readonly overrides: readonly [];
readonly stickiness: "random";
readonly weightType: "variable";
}, {
readonly name: "b";
readonly weight: 500;
readonly overrides: readonly [];
readonly stickiness: "random";
readonly weightType: "variable";
}];
readonly name: "variant-testing";
}];
readonly items: {
readonly $ref: "#/components/schemas/featureEnvironmentSchema";
};
};
readonly contextFields: {
readonly type: "array";
readonly description: "A list of all the context fields that are in use by any of the strategies in the `featureStrategies` list.";
readonly example: readonly [{
readonly name: "appName";
readonly description: "Allows you to constrain on application name";
readonly stickiness: false;
readonly sortOrder: 2;
readonly legalValues: readonly [];
}];
readonly items: {
readonly $ref: "#/components/schemas/contextFieldSchema";
};
};
readonly featureTags: {
readonly type: "array";
readonly description: "A list of all the tags that have been applied to any of the features in the `features` list.";
readonly example: readonly [{
readonly featureName: "my-feature";
readonly tagType: "simple";
readonly tagValue: "user-facing";
}];
readonly items: {
readonly $ref: "#/components/schemas/featureTagSchema";
};
};
readonly segments: {
readonly type: "array";
readonly description: "A list of all the segments that are used by the strategies in the `featureStrategies` list.";
readonly example: readonly [{
readonly id: 1;
readonly name: "new-segment-name";
}];
readonly items: {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["id", "name"];
readonly properties: {
readonly id: {
readonly type: "number";
};
readonly name: {
readonly type: "string";
};
};
};
};
readonly tagTypes: {
readonly type: "array";
readonly description: "A list of all of the tag types that are used in the `featureTags` list.";
readonly example: readonly [{
readonly name: "simple";
readonly description: "Used to simplify filtering of features";
readonly icon: "#";
}];
readonly items: {
readonly $ref: "#/components/schemas/tagTypeSchema";
};
};
readonly dependencies: {
readonly type: "array";
readonly description: "A list of all the dependencies for features in `features` list.";
readonly items: {
readonly $ref: "#/components/schemas/featureDependenciesSchema";
};
};
readonly links: {
readonly type: "array";
readonly description: "A list of links for features in `features` list.";
readonly items: {
readonly $ref: "#/components/schemas/featureLinksSchema";
};
};
};
readonly components: {
readonly schemas: {
readonly featureSchema: {
readonly $id: "#/components/schemas/featureSchema";
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["name"];
readonly description: "A feature flag definition";
readonly properties: {
readonly name: {
readonly type: "string";
readonly example: "disable-comments";
readonly description: "Unique feature name";
};
readonly type: {
readonly type: "string";
readonly example: "kill-switch";
readonly description: "Type of the flag e.g. experiment, kill-switch, release, operational, permission";
};
readonly description: {
readonly type: "string";
readonly nullable: true;
readonly example: "Controls disabling of the comments section in case of an incident";
readonly description: "Detailed description of the feature";
};
readonly archived: {
readonly type: "boolean";
readonly example: true;
readonly description: "`true` if the feature is archived";
};
readonly project: {
readonly type: "string";
readonly example: "dx-squad";
readonly description: "Name of the project the feature belongs to";
};
readonly enabled: {
readonly type: "boolean";
readonly example: true;
readonly description: "`true` if the feature is enabled, otherwise `false`.";
};
readonly stale: {
readonly type: "boolean";
readonly example: false;
readonly description: "`true` if the feature is stale based on the age and feature type, otherwise `false`.";
};
readonly favorite: {
readonly type: "boolean";
readonly example: true;
readonly description: "`true` if the feature was favorited, otherwise `false`.";
};
readonly impressionData: {
readonly type: "boolean";
readonly example: false;
readonly description: "`true` if the impression data collection is enabled for the feature, otherwise `false`.";
};
readonly createdAt: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly example: "2023-01-28T15:21:39.975Z";
readonly description: "The date the feature was created";
};
readonly createdBy: {
readonly type: "object";
readonly description: "User who created the feature flag";
readonly additionalProperties: false;
readonly required: readonly ["id", "name", "imageUrl"];
readonly properties: {
readonly id: {
readonly description: "The user id";
readonly type: "integer";
readonly example: 123;
};
readonly name: {
readonly description: "Name of the user";
readonly type: "string";
readonly example: "User";
};
readonly imageUrl: {
readonly description: "URL used for the user profile image";
readonly type: "string";
readonly example: "https://example.com/242x200.png";
};
};
};
readonly archivedAt: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly example: "2023-01-29T15:21:39.975Z";
readonly description: "The date the feature was archived";
};
readonly lastSeenAt: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly deprecated: true;
readonly example: "2023-01-28T16:21:39.975Z";
readonly description: "The date when metrics where last collected for the feature. This field was deprecated in v5, use the one in featureEnvironmentSchema";
};
readonly environments: {
readonly type: "array";
readonly items: {
readonly $ref: "#/components/schemas/featureEnvironmentSchema";
};
readonly description: "The list of environments where the feature can be used";
};
readonly variants: {
readonly type: "array";
readonly items: {
readonly $ref: "#/components/schemas/variantSchema";
};
readonly description: "The list of feature variants";
readonly deprecated: true;
};
readonly strategies: {
readonly type: "array";
readonly items: {
readonly type: "object";
};
readonly description: "This was deprecated in v5 and will be removed in a future major version";
readonly deprecated: true;
};
readonly tags: {
readonly type: "array";
readonly items: {
readonly $ref: "#/components/schemas/tagSchema";
};
readonly nullable: true;
readonly description: "The list of feature tags";
};
readonly children: {
readonly type: "array";
readonly description: "The list of child feature names. This is an experimental field and may change.";
readonly items: {
readonly type: "string";
readonly example: "some-feature";
};
};
readonly lifecycle: {
readonly type: "object";
readonly description: "Current lifecycle stage of the feature";
readonly additionalProperties: false;
readonly required: readonly ["stage", "enteredStageAt"];
readonly properties: {
readonly stage: {
readonly description: "The name of the current lifecycle stage";
readonly type: "string";
readonly enum: readonly ["initial", "pre-live", "live", "completed", "archived"];
readonly example: "initial";
};
readonly status: {
readonly type: "string";
readonly nullable: true;
readonly example: "kept";
readonly description: "The name of the detailed status of a given stage. E.g. completed stage can be kept or discarded.";
};
readonly enteredStageAt: {
readonly description: "When the feature entered this stage";
readonly type: "string";
readonly format: "date-time";
readonly example: "2023-01-28T15:21:39.975Z";
};
};
};
readonly dependencies: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["feature"];
readonly properties: {
readonly feature: {
readonly description: "The name of the parent feature";
readonly type: "string";
readonly example: "some-feature";
};
readonly enabled: {
readonly description: "Whether the parent feature is enabled or not";
readonly type: "boolean";
readonly example: true;
};
readonly variants: {
readonly description: "The list of variants the parent feature should resolve to. Only valid when feature is enabled.";
readonly type: "array";
readonly items: {
readonly example: "some-feature-blue-variant";
readonly type: "string";
};
};
};
};
readonly description: "The list of parent dependencies. This is an experimental field and may change.";
};
readonly collaborators: {
readonly type: "object";
readonly required: readonly ["users"];
readonly description: "Information related to users who have made changes to this feature flage.";
readonly properties: {
readonly users: {
readonly description: "Users who have made any changes to this feature flags. The list is sorted in reverse chronological order (most recent changes first)";
readonly type: "array";
readonly items: {
readonly type: "object";
readonly required: readonly ["id", "name", "imageUrl"];
readonly description: "A simple representation of a user.";
readonly properties: {
readonly id: {
readonly description: "The user's id";
readonly type: "integer";
readonly example: 123;
};
readonly name: {
readonly description: "The user's name, username, or email (prioritized in that order). If none of those are present, this property will be set to the string `unknown`";
readonly type: "string";
readonly example: "User";
};
readonly imageUrl: {
readonly description: "The URL to the user's profile image";
readonly type: "string";
readonly example: "https://example.com/242x200.png";
};
};
};
};
};
};
readonly links: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["id", "url"];
readonly properties: {
readonly id: {
readonly type: "string";
readonly example: "01JTJNCJ5XVP2KPJFA03YRBZCA";
readonly description: "The id of the link";
};
readonly url: {
readonly type: "string";
readonly example: "https://github.com/search?q=cleanupReminder&type=code";
readonly description: "The URL the feature is linked to";
};
readonly title: {
readonly type: "string";
readonly example: "Github cleanup";
readonly description: "The description of the link";
readonly nullable: true;
};
readonly feature: {
readonly type: "string";
readonly example: "disable-comments";
readonly description: "The name of the feature this link belongs to";
};
};
};
readonly description: "The list of links. This is an experimental field and may change.";
};
};
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/concepts/activation-strategies#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/concepts/activation-strategies#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 example: "IN";
};
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 example: readonly ["my-app", "my-other-app"];
};
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 example: "my-app";
};
};
readonly components: {};
readonly $id: "#/components/schemas/constraintSchema";
readonly additionalProperties: false;
};
readonly featureEnvironmentSchema: {
readonly $id: "#/components/schemas/featureEnvironmentSchema";
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["name", "enabled"];
readonly description: "A detailed description of the feature environment";
readonly properties: {
readonly name: {
readonly type: "string";
readonly example: "my-dev-env";
readonly description: "The name of the environment";
};
readonly featureName: {
readonly type: "string";
readonly example: "disable-comments";
readonly description: "The name of the feature";
};
readonly environment: {
readonly type: "string";
readonly example: "development";
readonly description: "The name of the environment";
};
readonly type: {
readonly type: "string";
readonly example: "development";
readonly description: "The type of the environment";
};
readonly enabled: {
readonly type: "boolean";
readonly example: true;
readonly description: "`true` if the feature is enabled for the environment, otherwise `false`.";
};
readonly sortOrder: {
readonly type: "number";
readonly example: 3;
readonly description: "The sort order of the feature environment in the feature environments list";
};
readonly variantCount: {
readonly type: "number";
readonly description: "The number of defined variants";
};
readonly strategies: {
readonly type: "array";
readonly items: {
readonly $ref: "#/components/schemas/featureStrategySchema";
};
readonly description: "A list of activation strategies for the feature environment";
};
readonly variants: {
readonly type: "array";
readonly items: {
readonly $ref: "#/components/schemas/variantSchema";
};
readonly description: "A list of variants for the feature environment";
};
readonly changeRequestIds: {
readonly type: "array";
readonly items: {
readonly type: "number";
};
readonly description: "Experimental. A list of change request identifiers for actionable change requests that are not Cancelled, Rejected or Approved.";
};
readonly milestoneName: {
readonly type: "string";
readonly example: "Phase One";
readonly description: "Experimental: The name of the currently active release plan milestone";
};
readonly milestoneOrder: {
readonly type: "number";
readonly example: 0;
readonly description: "Experimental: The zero-indexed order of currently active milestone in the list of all release plan milestones";
};
readonly totalMilestones: {
readonly type: "number";
readonly example: 0;
readonly description: "Experimental: The total number of milestones in the feature environment release plan";
};
readonly lastSeenAt: {
readonly type: "string";
readonly format: "date-time";
readonly nullable: true;
readonly example: "2023-01-28T16:21:39.975Z";
readonly description: "The date when metrics where last collected for the feature environment";
};
readonly hasStrategies: {
readonly type: "boolean";
readonly description: "Whether the feature has any strategies defined.";
};
readonly hasEnabledStrategies: {
readonly type: "boolean";
readonly description: "Whether the feature has any enabled strategies defined.";
};
readonly releasePlans: {
readonly type: "array";
readonly description: "Release plans for this feature environment (only available when milestoneProgression feature flag is enabled)";
readonly items: {
readonly $ref: "#/components/schemas/releasePlanSchema";
};
};
readonly yes: {
readonly type: "integer";
readonly description: "How many times the feature evaluated to true (enabled)";
readonly example: 974;
readonly minimum: 0;
};
readonly no: {
readonly type: "integer";
readonly description: "How many times the feature evaluated to false (disabled)";
readonly example: 50;
readonly minimum: 0;
};
};
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/concepts/activation-strategies#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/concepts/activation-strategies#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 example: "IN";
};
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 example: readonly ["my-app", "my-other-app"];
};
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 example: "my-app";
};
};
readonly components: {};
readonly $id: "#/components/schemas/constraintSchema";
readonly additionalProperties: false;
};
readonly parametersSchema: {
readonly $id: "#/components/schemas/parametersSchema";
readonly type: "object";
readonly description: "A list of parameters for a strategy";
readonly additionalProperties: {
readonly type: "string";
};
readonly components: {};
};
readonly featureStrategySchema: {
readonly $id: "#/components/schemas/featureStrategySchema";
readonly description: "A single activation strategy configuration schema for a feature";
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["name"];
readonly properties: {
readonly id: {
readonly type: "string";
readonly description: "A uuid for the feature strategy";
readonly example: "6b5157cb-343a-41e7-bfa3-7b4ec3044840";
};
readonly name: {
readonly type: "string";
readonly description: "The name or type of strategy";
readonly example: "flexibleRollout";
};
readonly title: {
readonly type: "string";
readonly description: "A descriptive title for the strategy";
readonly example: "Gradual Rollout 25-Prod";
readonly nullable: true;
};
readonly disabled: {
readonly type: "boolean";
readonly description: "A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs";
readonly example: false;
readonly nullable: true;
};
readonly featureName: {
readonly type: "string";
readonly description: "The name or feature the strategy is attached to";
readonly example: "myAwesomeFeature";
};
readonly sortOrder: {
readonly type: "number";
readonly description: "The order of the strategy in the list";
readonly example: 9999;
};
readonly segments: {
readonly type: "array";
readonly description: "A list of segment ids attached to the strategy";
readonly example: readonly [1, 2];
readonly items: {
readonly type: "number";
};
};
readonly constraints: {
readonly type: "array";
readonly description: "A list of the constraints attached to the strategy. See https://docs.getunleash.io/concepts/activation-strategies#constraints";
readonly items: {
readonly $ref: "#/components/schemas/constraintSchema";
};
};
readonly variants: {
readonly type: "array";
readonly description: "Strategy level variants";
readonly items: {
readonly $ref: "#/components/schemas/strategyVariantSchema";
};
};
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/concepts/activation-strategies#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/concepts/activation-strategies#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 example: "IN";
};
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 example: readonly ["my-app", "my-other-app"];
};
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 example: "my-app";
};
};
readonly components: {};
readonly $id: "#/components/schemas/constraintSchema";
readonly additionalProperties: false;
};
readonly parametersSchema: {
readonly $id: "#/components/schemas/parametersSchema";
readonly type: "object";
readonly description: "A list of parameters for a strategy";
readonly additionalProperties: {
readonly type: "string";
};
readonly components: {};
};
readonly strategyVariantSchema: {
readonly $id: "#/components/schemas/strategyVariantSchema";
readonly type: "object";
readonly additionalProperties: false;
readonly description: "This is an experimental property. It may change or be removed as we work on it. Please don't depend on it yet. A strategy variant allows you to attach any data to strategies instead of only returning `true`/`false`. Strategy variants take precedence over feature variants.";
readonly required: readonly ["name", "weight", "weightType", "stickiness"];
readonly properties: {
readonly name: {
readonly type: "string";
readonly description: "The variant name. Must be unique for this feature flag";
readonly example: "blue_group";
};
readonly weight: {
readonly type: "integer";
readonly description: "The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feat