unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
90 lines • 4.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.clientFeatureSchema = void 0;
const constraint_schema_1 = require("./constraint-schema");
const parameters_schema_1 = require("./parameters-schema");
const feature_strategy_schema_1 = require("./feature-strategy-schema");
const variant_schema_1 = require("./variant-schema");
const override_schema_1 = require("./override-schema");
const strategy_variant_schema_1 = require("./strategy-variant-schema");
const dependent_feature_schema_1 = require("./dependent-feature-schema");
exports.clientFeatureSchema = {
$id: '#/components/schemas/clientFeatureSchema',
type: 'object',
required: ['name', 'enabled'],
description: 'Feature flag configuration used by SDKs to evaluate state of a flag',
additionalProperties: false,
properties: {
name: {
type: 'string',
description: 'The unique name of a feature flag. Is validated to be URL safe on creation',
example: 'new.payment.flow.stripe',
},
type: {
type: 'string',
description: 'What kind of feature flag is this. Refer to the documentation on [feature flag types](https://docs.getunleash.io/reference/feature-toggles#feature-flag-types) for more information',
example: 'release',
},
description: {
type: 'string',
description: 'A description of the flag',
nullable: true,
example: 'No variants here',
},
enabled: {
type: 'boolean',
description: 'Whether the feature flag is enabled for the current API key or not. This is ANDed with the evaluation results of the strategies list, so if this is false, the evaluation result will always be false',
example: true,
},
stale: {
description: 'If this is true Unleash believes this feature flag has been active longer than Unleash expects a flag of this type to be active',
type: 'boolean',
example: false,
},
impressionData: {
description: 'Set to true if SDKs should trigger [impression events](https://docs.getunleash.io/reference/impression-data) when this flag is evaluated',
type: 'boolean',
nullable: true,
example: false,
},
project: {
description: 'Which project this feature flag belongs to',
type: 'string',
example: 'new.payment.flow',
},
strategies: {
type: 'array',
description: 'Evaluation strategies for this flag. Each entry in this list will be evaluated and ORed together',
items: {
$ref: '#/components/schemas/featureStrategySchema',
},
},
variants: {
type: 'array',
description: '[Variants](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) configured for this flag',
items: {
$ref: '#/components/schemas/variantSchema',
},
nullable: true,
},
dependencies: {
type: 'array',
description: 'Feature dependencies for this flag',
items: {
$ref: '#/components/schemas/dependentFeatureSchema',
},
},
},
components: {
schemas: {
constraintSchema: constraint_schema_1.constraintSchema,
parametersSchema: parameters_schema_1.parametersSchema,
featureStrategySchema: feature_strategy_schema_1.featureStrategySchema,
strategyVariantSchema: strategy_variant_schema_1.strategyVariantSchema,
variantSchema: variant_schema_1.variantSchema,
overrideSchema: override_schema_1.overrideSchema,
dependentFeatureSchema: dependent_feature_schema_1.dependentFeatureSchema,
},
},
};
//# sourceMappingURL=client-feature-schema.js.map