mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-24 01:18:01 +02:00
chore: update orval models (#4062)
Updates orval model based on the current enterprise changes. Mostly doc/comment changes, but does introduce the new strategySchemaLinks model.
This commit is contained in:
parent
e769cdd2ac
commit
8cd89bb5a7
@ -36,6 +36,9 @@ test('should render advanced playground table', async () => {
|
||||
},
|
||||
constraints: [],
|
||||
segments: [],
|
||||
links: {
|
||||
edit: '/projects/ChangeReqs/features/Infinite/strategies/edit?environmenId=development&strategyId=45971fe0-1122-40a7-a68c-3a1430c44062',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'default',
|
||||
@ -49,6 +52,9 @@ test('should render advanced playground table', async () => {
|
||||
},
|
||||
constraints: [],
|
||||
segments: [],
|
||||
links: {
|
||||
edit: '/projects/ChangeReqs/features/Infinite/strategies/edit?environmenId=development&strategyId=bf5e35b6-edc1-4e54-8f7e-a6cc8d4f352a',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -5,12 +5,25 @@
|
||||
*/
|
||||
import type { ClientApplicationSchemaStarted } from './clientApplicationSchemaStarted';
|
||||
|
||||
/**
|
||||
* A client application is an instance of one of our SDKs
|
||||
*/
|
||||
export interface ClientApplicationSchema {
|
||||
/** An identifier for the app that uses the sdk, should be static across SDK restarts */
|
||||
appName: string;
|
||||
/** A unique identifier identifying the instance of the application running the SDK. Often changes based on execution environment. For instance: two pods in Kubernetes will have two different instanceIds */
|
||||
instanceId?: string;
|
||||
/** An SDK version identifier. Usually formatted as "unleash-client-<language>:<version>" */
|
||||
sdkVersion?: string;
|
||||
/**
|
||||
* The SDK's configured 'environment' property. Deprecated. This property does **not** control which Unleash environment the SDK gets toggles for. To control Unleash environments, use the SDKs API key.
|
||||
* @deprecated
|
||||
*/
|
||||
environment?: string;
|
||||
/** How often (in seconds) does the client refresh its toggles */
|
||||
interval: number;
|
||||
/** Either an RFC-3339 timestamp or a unix timestamp in seconds */
|
||||
started: ClientApplicationSchemaStarted;
|
||||
/** Which strategies the SDKs runtime knows about */
|
||||
strategies: string[];
|
||||
}
|
||||
|
@ -4,4 +4,7 @@
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* Either an RFC-3339 timestamp or a unix timestamp in seconds
|
||||
*/
|
||||
export type ClientApplicationSchemaStarted = string | number;
|
||||
|
@ -6,18 +6,26 @@
|
||||
import type { FeatureStrategySchema } from './featureStrategySchema';
|
||||
import type { VariantSchema } from './variantSchema';
|
||||
|
||||
/**
|
||||
* Feature toggle configuration used by SDKs to evaluate state of a toggle
|
||||
*/
|
||||
export interface ClientFeatureSchema {
|
||||
/** The unique name of a feature toggle. Is validated to be URL safe on creation */
|
||||
name: string;
|
||||
/** What kind of feature flag is this. Refer to the documentation on [feature toggle types](https://docs.getunleash.io/reference/feature-toggle-types) for more information */
|
||||
type?: string;
|
||||
/** A description of the toggle */
|
||||
description?: string | null;
|
||||
createdAt?: string | null;
|
||||
lastSeenAt?: string | null;
|
||||
/** 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 */
|
||||
enabled: boolean;
|
||||
/** If this is true Unleash believes this feature toggle has been active longer than Unleash expects a toggle of this type to be active */
|
||||
stale?: boolean;
|
||||
/** Set to true if SDKs should trigger [impression events](https://docs.getunleash.io/reference/impression-data) when this toggle is evaluated */
|
||||
impressionData?: boolean | null;
|
||||
/** Which project this feature toggle belongs to */
|
||||
project?: string;
|
||||
/** @deprecated */
|
||||
/** Evaluation strategies for this toggle. Each entry in this list will be evaluated and ORed together */
|
||||
strategies?: FeatureStrategySchema[];
|
||||
/** @deprecated */
|
||||
/** [Variants](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) configured for this toggle */
|
||||
variants?: VariantSchema[] | null;
|
||||
}
|
||||
|
@ -4,10 +4,24 @@
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* Query parameters active for a client features request
|
||||
*/
|
||||
export interface ClientFeaturesQuerySchema {
|
||||
/** Features tagged with one of these tags are included */
|
||||
tag?: string[][];
|
||||
/**
|
||||
* Features that are part of these projects are included in this response. (DEPRECATED) - Handled by API tokens
|
||||
* @deprecated
|
||||
*/
|
||||
project?: string[];
|
||||
/** Features are filtered to only include features whose name starts with this prefix */
|
||||
namePrefix?: string;
|
||||
/**
|
||||
* Strategies for the feature toggle configured for this environment are included. (DEPRECATED) - Handled by API tokens
|
||||
* @deprecated
|
||||
*/
|
||||
environment?: string;
|
||||
/** Set to true if requesting client does not support Unleash-Client-Specification 4.2.2 or newer. Modern SDKs will have this set to false, since they will be able to merge constraints and segments themselves */
|
||||
inlineSegmentConstraints?: boolean;
|
||||
}
|
||||
|
@ -7,9 +7,16 @@ import type { ClientFeatureSchema } from './clientFeatureSchema';
|
||||
import type { SegmentSchema } from './segmentSchema';
|
||||
import type { ClientFeaturesQuerySchema } from './clientFeaturesQuerySchema';
|
||||
|
||||
/**
|
||||
* Configuration data for server-side SDKs for evaluating feature flags.
|
||||
*/
|
||||
export interface ClientFeaturesSchema {
|
||||
/** A version number for the format used in the response. Most Unleash instances now return version 2, which includes segments as a separate array */
|
||||
version: number;
|
||||
/** A list of feature toggles with their configuration */
|
||||
features: ClientFeatureSchema[];
|
||||
/** A list of [Segments](https://docs.getunleash.io/reference/segments) configured for this Unleash instance */
|
||||
segments?: SegmentSchema[];
|
||||
/** A summary of filters and parameters sent to the endpoint. Used by the server to build the features and segments response */
|
||||
query?: ClientFeaturesQuerySchema;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ export type ClientMetricsSchemaBucketToggles = {
|
||||
yes?: number;
|
||||
/** How many times the toggle evaluated to false */
|
||||
no?: number;
|
||||
/** How many times each variant was returned */
|
||||
/** An object describing how many times each variant was returned. Variant names are used as properties, and the number of times they were exposed is the corresponding value (i.e. `{ [variantName]: number }`). */
|
||||
variants?: ClientMetricsSchemaBucketTogglesVariants;
|
||||
};
|
||||
};
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* How many times each variant was returned
|
||||
* An object describing how many times each variant was returned. Variant names are used as properties, and the number of times they were exposed is the corresponding value (i.e. `{ [variantName]: number }`).
|
||||
*/
|
||||
export type ClientMetricsSchemaBucketTogglesVariants = {
|
||||
[key: string]: number;
|
||||
|
@ -7,7 +7,7 @@ import type { ConstraintSchema } from './constraintSchema';
|
||||
import type { ParametersSchema } from './parametersSchema';
|
||||
|
||||
/**
|
||||
* A singles activation strategy configuration schema for a feature
|
||||
* A single activation strategy configuration schema for a feature
|
||||
*/
|
||||
export interface FeatureStrategySchema {
|
||||
/** A uuid for the feature strategy */
|
||||
|
@ -327,6 +327,7 @@ export * from './playgroundRequestSchemaProjects';
|
||||
export * from './playgroundResponseSchema';
|
||||
export * from './playgroundSegmentSchema';
|
||||
export * from './playgroundStrategySchema';
|
||||
export * from './playgroundStrategySchemaLinks';
|
||||
export * from './playgroundStrategySchemaResult';
|
||||
export * from './playgroundStrategySchemaResultAnyOf';
|
||||
export * from './playgroundStrategySchemaResultAnyOfEnabled';
|
||||
|
@ -4,7 +4,12 @@
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* An override for deciding which variant should be assigned to a user based on the context name
|
||||
*/
|
||||
export interface OverrideSchema {
|
||||
/** The name of the context field used to determine overrides */
|
||||
contextName: string;
|
||||
/** Which values that should be overriden */
|
||||
values: string[];
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import type { PlaygroundStrategySchemaResult } from './playgroundStrategySchemaR
|
||||
import type { PlaygroundSegmentSchema } from './playgroundSegmentSchema';
|
||||
import type { PlaygroundConstraintSchema } from './playgroundConstraintSchema';
|
||||
import type { ParametersSchema } from './parametersSchema';
|
||||
import type { PlaygroundStrategySchemaLinks } from './playgroundStrategySchemaLinks';
|
||||
|
||||
export interface PlaygroundStrategySchema {
|
||||
/** The strategy's name. */
|
||||
@ -25,4 +26,6 @@ export interface PlaygroundStrategySchema {
|
||||
constraints: PlaygroundConstraintSchema[];
|
||||
/** The strategy's constraints and their evaluation results. */
|
||||
parameters: ParametersSchema;
|
||||
/** A set of links to actions you can perform on this strategy */
|
||||
links: PlaygroundStrategySchemaLinks;
|
||||
}
|
||||
|
12
frontend/src/openapi/models/playgroundStrategySchemaLinks.ts
Normal file
12
frontend/src/openapi/models/playgroundStrategySchemaLinks.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by Orval
|
||||
* Do not edit manually.
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* A set of links to actions you can perform on this strategy
|
||||
*/
|
||||
export type PlaygroundStrategySchemaLinks = {
|
||||
edit: string;
|
||||
};
|
@ -6,11 +6,20 @@
|
||||
import type { VariantSchemaPayload } from './variantSchemaPayload';
|
||||
import type { OverrideSchema } from './overrideSchema';
|
||||
|
||||
/**
|
||||
* A variant allows for further separation of users into segments. See [our excellent documentation](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) for a more detailed description
|
||||
*/
|
||||
export interface VariantSchema {
|
||||
/** The variants name. Is unique for this feature toggle */
|
||||
name: string;
|
||||
/** The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight) for more information */
|
||||
weight: number;
|
||||
/** 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 */
|
||||
weightType?: string;
|
||||
/** [Stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time */
|
||||
stickiness?: string;
|
||||
/** Extra data configured for this variant */
|
||||
payload?: VariantSchemaPayload;
|
||||
/** Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence. */
|
||||
overrides?: OverrideSchema[];
|
||||
}
|
||||
|
@ -4,6 +4,9 @@
|
||||
* See `gen:api` script in package.json
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extra data configured for this variant
|
||||
*/
|
||||
export type VariantSchemaPayload = {
|
||||
type: string;
|
||||
value: string;
|
||||
|
Loading…
Reference in New Issue
Block a user