UNPKG

unleash-server

Version:

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

657 lines (656 loc) • 122 kB
import type { FromSchema } from 'json-schema-to-ts'; export declare const releasePlanSchema: { readonly $id: "#/components/schemas/releasePlanSchema"; readonly additionalProperties: false; readonly description: "Schema representing the creation of a release plan."; readonly type: "object"; readonly required: readonly ["id", "discriminator", "name", "featureName", "environment", "createdByUserId", "createdAt", "milestones", "releasePlanTemplateId"]; readonly properties: { readonly id: { readonly type: "string"; readonly description: "The release plan/template's ID. Release template IDs are ulids."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW2"; readonly nullable: false; }; readonly discriminator: { readonly type: "string"; readonly description: "A field to distinguish between release plans and release templates."; readonly example: "plan"; readonly nullable: false; readonly enum: readonly ["plan"]; }; readonly name: { readonly type: "string"; readonly description: "The name of the release template."; readonly example: "My release plan"; }; readonly description: { readonly type: "string"; readonly description: "A description of the release template."; readonly example: "This is my release plan"; readonly nullable: true; }; readonly featureName: { readonly type: "string"; readonly description: "The name of the feature that uses this release plan."; readonly example: "my-feature"; }; readonly environment: { readonly type: "string"; readonly description: "The environment that this release plan is for."; readonly example: "production"; }; readonly createdByUserId: { readonly type: "number"; readonly description: "Release template: The ID of the user who created this template."; readonly example: 53; readonly nullable: false; }; readonly createdAt: { readonly type: "string"; readonly format: "date-time"; readonly description: "The date and time that the release template was created."; readonly example: "2022-01-01T00:00:00Z"; readonly nullable: false; }; readonly activeMilestoneId: { readonly type: "string"; readonly description: "The ID of the currently active milestone in this release plan."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW1"; readonly nullable: true; }; readonly milestones: { readonly type: "array"; readonly description: "A list of the milestones in this release template."; readonly items: { readonly $ref: "#/components/schemas/releasePlanMilestoneSchema"; }; }; readonly releasePlanTemplateId: { readonly type: "string"; readonly description: "The ID of the release plan template that this release plan is based on."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW2"; readonly nullable: false; }; readonly safeguards: { readonly type: "array"; readonly description: "An array of safeguards configured for this release plan."; readonly items: { readonly $ref: "#/components/schemas/safeguardSchema"; }; }; }; readonly components: { readonly schemas: { readonly releasePlanMilestoneSchema: { readonly $id: "#/components/schemas/releasePlanMilestoneSchema"; readonly additionalProperties: false; readonly description: "Schema representing the creation of a release plan milestone."; readonly type: "object"; readonly required: readonly ["id", "name", "sortOrder", "releasePlanDefinitionId"]; readonly properties: { readonly id: { readonly type: "string"; readonly description: "The milestone's ID. Milestone IDs are ulids."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW1"; readonly nullable: false; }; readonly name: { readonly type: "string"; readonly description: "The name of the milestone."; readonly example: "My milestone"; }; readonly sortOrder: { readonly type: "integer"; readonly description: "The order of the milestone in the release plan."; readonly example: 1; }; readonly releasePlanDefinitionId: { readonly type: "string"; readonly description: "The ID of the release plan/template that this milestone belongs to."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW2"; }; readonly startedAt: { readonly type: "string"; readonly format: "date-time"; readonly description: "The date and time when the milestone was started."; readonly example: "2024-01-01T00:00:00.000Z"; readonly nullable: true; }; readonly transitionCondition: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["intervalMinutes"]; readonly properties: { readonly intervalMinutes: { readonly type: "integer"; readonly minimum: 1; readonly description: "The interval in minutes before transitioning"; readonly example: 30; }; }; readonly description: "The condition configuration for the transition"; readonly nullable: true; }; readonly progressionExecutedAt: { readonly type: "string"; readonly format: "date-time"; readonly description: "The date and time when the milestone progression was executed."; readonly example: "2024-01-01T00:00:00.000Z"; readonly nullable: true; }; readonly pausedAt: { readonly type: "string"; readonly format: "date-time"; readonly description: "The date and time when the milestone was paused."; readonly example: "2024-01-01T00:00:00.000Z"; readonly nullable: true; }; readonly strategies: { readonly type: "array"; readonly description: "A list of strategies that are attached to this milestone."; readonly items: { readonly $ref: "#/components/schemas/releasePlanMilestoneStrategySchema"; }; }; }; readonly components: { readonly schemas: { readonly releasePlanMilestoneStrategySchema: { readonly $id: "#/components/schemas/releasePlanMilestoneStrategySchema"; readonly additionalProperties: false; readonly description: "Schema representing the creation of a release plan milestone strategy."; readonly type: "object"; readonly required: readonly ["id", "milestoneId", "sortOrder", "strategyName"]; readonly properties: { readonly id: { readonly type: "string"; readonly description: "The milestone strategy's ID. Milestone strategy IDs are ulids."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW3"; readonly nullable: false; }; readonly milestoneId: { readonly type: "string"; readonly description: "The ID of the milestone that this strategy belongs to."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW1"; }; readonly sortOrder: { readonly type: "number"; readonly description: "The order of the strategy in the list"; readonly example: 9999; }; readonly title: { readonly type: "string"; readonly nullable: true; readonly description: "A descriptive title for the strategy"; readonly example: "Gradual Rollout 25-Prod"; }; readonly strategyName: { readonly type: "string"; readonly description: "The name of the strategy type"; readonly example: "flexibleRollout"; }; readonly parameters: { readonly description: "An object containing the parameters for the strategy"; readonly example: { readonly groupId: "some_new"; readonly rollout: "25"; readonly stickiness: "sessionId"; }; readonly $ref: "#/components/schemas/parametersSchema"; }; 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 example: readonly [{ readonly values: readonly ["1", "2"]; readonly inverted: false; readonly operator: "IN"; readonly contextName: "appName"; readonly caseInsensitive: false; }]; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; readonly variants: { readonly type: "array"; readonly description: "Strategy level variants"; readonly items: { readonly $ref: "#/components/schemas/createStrategyVariantSchema"; }; }; readonly segments: { readonly type: "array"; readonly description: "Ids of segments to use for this strategy"; readonly example: readonly [1, 2]; readonly items: { readonly type: "number"; }; }; }; readonly components: { readonly schemas: { readonly createFeatureStrategySchema: { readonly $id: "#/components/schemas/createFeatureStrategySchema"; readonly type: "object"; readonly required: readonly ["name"]; readonly description: "Create a strategy configuration in a feature"; readonly properties: { readonly name: { readonly type: "string"; readonly description: "The name of the strategy type"; readonly example: "flexibleRollout"; }; readonly title: { readonly type: "string"; readonly nullable: true; readonly description: "A descriptive title for the strategy"; readonly example: "Gradual Rollout 25-Prod"; }; 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 sortOrder: { readonly type: "number"; readonly description: "The order of the strategy in the list"; readonly example: 9999; }; 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 example: readonly [{ readonly values: readonly ["1", "2"]; readonly inverted: false; readonly operator: "IN"; readonly contextName: "appName"; readonly caseInsensitive: false; }]; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; readonly variants: { readonly type: "array"; readonly description: "Strategy level variants"; readonly items: { readonly $ref: "#/components/schemas/createStrategyVariantSchema"; }; }; readonly parameters: { readonly description: "An object containing the parameters for the strategy"; readonly example: { readonly groupId: "some_new"; readonly rollout: "25"; readonly stickiness: "sessionId"; }; readonly $ref: "#/components/schemas/parametersSchema"; }; readonly segments: { readonly type: "array"; readonly description: "Ids of segments to use for this strategy"; readonly example: readonly [1, 2]; readonly items: { readonly type: "number"; }; }; }; 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 createStrategyVariantSchema: { readonly $id: "#/components/schemas/createStrategyVariantSchema"; readonly type: "object"; 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/feature-flag-variants#variant-weight) for more information"; readonly minimum: 0; readonly maximum: 1000; }; readonly weightType: { readonly description: "Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight)."; readonly type: "string"; readonly example: "fix"; readonly enum: readonly ["variable", "fix"]; }; readonly stickiness: { readonly type: "string"; readonly description: "The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time"; readonly example: "custom.context.field"; }; readonly payload: { readonly type: "object"; readonly required: readonly ["type", "value"]; readonly description: "Extra data configured for this variant"; readonly properties: { readonly type: { readonly description: "The type of the value. Commonly used types are string, number, json and csv."; readonly type: "string"; readonly enum: readonly ["json", "csv", "string", "number"]; }; readonly value: { readonly description: "The actual value of payload"; readonly type: "string"; }; }; readonly example: { readonly type: "json"; readonly value: "{\"color\": \"red\"}"; }; }; }; readonly components: {}; }; }; }; }; 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 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 createStrategyVariantSchema: { readonly $id: "#/components/schemas/createStrategyVariantSchema"; readonly type: "object"; 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/feature-flag-variants#variant-weight) for more information"; readonly minimum: 0; readonly maximum: 1000; }; readonly weightType: { readonly description: "Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight)."; readonly type: "string"; readonly example: "fix"; readonly enum: readonly ["variable", "fix"]; }; readonly stickiness: { readonly type: "string"; readonly description: "The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time"; readonly example: "custom.context.field"; }; readonly payload: { readonly type: "object"; readonly required: readonly ["type", "value"]; readonly description: "Extra data configured for this variant"; readonly properties: { readonly type: { readonly description: "The type of the value. Commonly used types are string, number, json and csv."; readonly type: "string"; readonly enum: readonly ["json", "csv", "string", "number"]; }; readonly value: { readonly description: "The actual value of payload"; readonly type: "string"; }; }; readonly example: { readonly type: "json"; readonly value: "{\"color\": \"red\"}"; }; }; }; readonly components: {}; }; }; }; }; readonly createFeatureStrategySchema: { readonly $id: "#/components/schemas/createFeatureStrategySchema"; readonly type: "object"; readonly required: readonly ["name"]; readonly description: "Create a strategy configuration in a feature"; readonly properties: { readonly name: { readonly type: "string"; readonly description: "The name of the strategy type"; readonly example: "flexibleRollout"; }; readonly title: { readonly type: "string"; readonly nullable: true; readonly description: "A descriptive title for the strategy"; readonly example: "Gradual Rollout 25-Prod"; }; 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 sortOrder: { readonly type: "number"; readonly description: "The order of the strategy in the list"; readonly example: 9999; }; 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 example: readonly [{ readonly values: readonly ["1", "2"]; readonly inverted: false; readonly operator: "IN"; readonly contextName: "appName"; readonly caseInsensitive: false; }]; readonly items: { readonly $ref: "#/components/schemas/constraintSchema"; }; }; readonly variants: { readonly type: "array"; readonly description: "Strategy level variants"; readonly items: { readonly $ref: "#/components/schemas/createStrategyVariantSchema"; }; }; readonly parameters: { readonly description: "An object containing the parameters for the strategy"; readonly example: { readonly groupId: "some_new"; readonly rollout: "25"; readonly stickiness: "sessionId"; }; readonly $ref: "#/components/schemas/parametersSchema"; }; readonly segments: { readonly type: "array"; readonly description: "Ids of segments to use for this strategy"; readonly example: readonly [1, 2]; readonly items: { readonly type: "number"; }; }; }; 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 createStrategyVariantSchema: { readonly $id: "#/components/schemas/createStrategyVariantSchema"; readonly type: "object"; 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/feature-flag-variants#variant-weight) for more information"; readonly minimum: 0; readonly maximum: 1000; }; readonly weightType: {