UNPKG

unleash-server

Version:

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

149 lines • 7.54 kB
import type { FromSchema } from 'json-schema-to-ts'; export declare const safeguardSchema: { readonly $id: "#/components/schemas/safeguardSchema"; readonly type: "object"; readonly required: readonly ["id", "action", "triggerCondition", "impactMetric"]; readonly description: "A safeguard configuration for a release plan."; readonly additionalProperties: false; readonly properties: { readonly id: { readonly type: "string"; readonly description: "The unique ULID identifier for this safeguard"; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW1"; }; readonly action: { readonly type: "object"; readonly required: readonly ["type", "id"]; readonly additionalProperties: false; readonly description: "The action to take when the safeguard is triggered."; readonly properties: { readonly type: { readonly type: "string"; readonly description: "The type of action to perform."; readonly example: "pauseReleasePlanProgressions"; }; readonly id: { readonly type: "string"; readonly description: "The ID of the release plan this safeguard applies to."; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW2"; }; }; }; readonly triggerCondition: { readonly $ref: "#/components/schemas/safeguardTriggerConditionSchema"; readonly description: "The condition that triggers the safeguard."; }; readonly impactMetric: { readonly type: "object"; readonly required: readonly ["id", "metricName", "timeRange", "aggregationMode", "labelSelectors"]; readonly additionalProperties: false; readonly properties: { readonly metricName: { readonly type: "string"; readonly description: "The Prometheus metric series to query. It includes both unleash prefix and metric type and display name"; readonly example: "unleash_counter_feature_toggle_usage_total"; }; readonly timeRange: { readonly type: "string"; readonly enum: readonly ["hour", "day", "week", "month"]; readonly description: "The time range for the metric data."; readonly example: "day"; }; readonly aggregationMode: { readonly type: "string"; readonly description: "The aggregation mode for the metric data."; readonly enum: readonly ["rps", "count", "avg", "sum", "p95", "p99", "p50"]; readonly example: "rps"; }; readonly labelSelectors: { readonly type: "object"; readonly additionalProperties: { readonly type: "array"; readonly items: { readonly type: "string"; }; }; readonly description: "The selected labels and their values for filtering the metric data."; readonly example: { readonly environment: readonly ["development"]; readonly project: readonly ["default"]; }; }; readonly id: { readonly type: "string"; readonly description: "The unique identifier for this impact metric"; readonly example: "01JB9GGTGQYEQ9D40R17T3YVW1"; }; }; readonly description: "The metric configuration used to evaluate the safeguard condition."; }; }; readonly components: { readonly schemas: { readonly metricQuerySchema: { readonly $id: "#/components/schemas/metricQuerySchema"; readonly type: "object"; readonly required: readonly ["metricName", "timeRange", "aggregationMode", "labelSelectors"]; readonly description: "Common metric query configuration for selecting and filtering metric data."; readonly additionalProperties: false; readonly properties: { readonly metricName: { readonly type: "string"; readonly description: "The Prometheus metric series to query. It includes both unleash prefix and metric type and display name"; readonly example: "unleash_counter_feature_toggle_usage_total"; }; readonly timeRange: { readonly type: "string"; readonly enum: readonly ["hour", "day", "week", "month"]; readonly description: "The time range for the metric data."; readonly example: "day"; }; readonly aggregationMode: { readonly type: "string"; readonly description: "The aggregation mode for the metric data."; readonly enum: readonly ["rps", "count", "avg", "sum", "p95", "p99", "p50"]; readonly example: "rps"; }; readonly labelSelectors: { readonly type: "object"; readonly additionalProperties: { readonly type: "array"; readonly items: { readonly type: "string"; }; }; readonly description: "The selected labels and their values for filtering the metric data."; readonly example: { readonly environment: readonly ["development"]; readonly project: readonly ["default"]; }; }; }; readonly components: {}; }; readonly safeguardTriggerConditionSchema: { readonly $id: "#/components/schemas/safeguardTriggerConditionSchema"; readonly type: "object"; readonly required: readonly ["operator", "threshold"]; readonly additionalProperties: false; readonly description: "The condition that triggers the safeguard."; readonly properties: { readonly operator: { readonly type: "string"; readonly enum: readonly [">", "<"]; readonly description: "The comparison operator for the threshold check."; readonly example: ">"; }; readonly threshold: { readonly type: "number"; readonly description: "The threshold value to compare against."; readonly example: 100; }; }; readonly components: {}; }; }; }; }; export type SafeguardSchema = FromSchema<typeof safeguardSchema>; //# sourceMappingURL=safeguard-schema.d.ts.map