1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-18 01:18:23 +02:00

chore: update api types in frontend (#9748)

Get backend changes into frontend types
This commit is contained in:
Tymoteusz Czech 2025-04-11 20:00:09 +02:00 committed by GitHub
parent e003c10e94
commit 1b7cf6d97d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 314 additions and 2 deletions

View File

@ -10,8 +10,11 @@
export interface AdminPermissionSchema {
/** The name to display in listings of permissions */
displayName: string;
/** Which environment this permission applies to */
environment?: string;
/**
* Which environment this permission applies to
* @nullable
*/
environment?: string | null;
/** The identifier for this permission */
id: number;
/** The name of this permission */

View File

@ -0,0 +1,13 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { MeteredGroupConsumptionSchema } from './meteredGroupConsumptionSchema';
export interface ConnectionConsumptionSchema {
/** Feature consumption data points */
features: MeteredGroupConsumptionSchema[];
/** Metrics consumption data points */
metrics: MeteredGroupConsumptionSchema[];
}

View File

@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export interface ConsumptionDataPointSchema {
/**
* Time interval in milliseconds [start, end].
* @minItems 2
* @maxItems 2
*/
interval: number[];
/** Number of requests in this interval */
requests: number;
}

View File

@ -15,6 +15,12 @@ export interface CreateEnvironmentSchema {
* @pattern ^[a-zA-Z0-9~_.-]+$
*/
name: string;
/**
* Experimental field. The number of approvals required before a change request can be applied in this environment.
* @minimum 1
* @nullable
*/
requiredApprovals?: number | null;
/** Defines where in the list of environments to place this environment. The list uses an ascending sort, so lower numbers are shown first. You can change this value later. */
sortOrder?: number;
/**

View File

@ -8,6 +8,12 @@
* Data used to create a new [tag](https://docs.getunleash.io/reference/feature-toggles#tags)
*/
export interface CreateTagSchema {
/**
* The hexadecimal color code for the tag type.
* @nullable
* @pattern ^#[0-9A-Fa-f]{6}$
*/
color?: string | null;
/**
* The [type](https://docs.getunleash.io/reference/feature-toggles#tags) of the tag
* @minLength 2

View File

@ -3,8 +3,10 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ConnectionConsumptionSchema } from './connectionConsumptionSchema';
import type { EdgeUpstreamLatencySchema } from './edgeUpstreamLatencySchema';
import type { EdgeProcessMetricsSchema } from './edgeProcessMetricsSchema';
import type { RequestConsumptionSchema } from './requestConsumptionSchema';
import type { EdgeRequestStatsSchema } from './edgeRequestStatsSchema';
import type { EdgeInstanceTrafficSchema } from './edgeInstanceTrafficSchema';
@ -21,6 +23,8 @@ export interface EdgeInstanceDataSchema {
* @minimum 0
*/
connectedStreamingClients: number;
/** Connection consumption data since last report, including features and metrics consumption. Used for long-lived backend SDKs with backend controlled number of instances. */
connectionConsumptionSinceLastReport?: ConnectionConsumptionSchema;
/** Which version (semver) of Edge is the Edge instance running. */
edgeVersion: string;
/** The ID of the Edge process, typically a ULID. Newly generated for each restart of the instance. */
@ -33,6 +37,8 @@ export interface EdgeInstanceDataSchema {
* @nullable
*/
region?: string | null;
/** Request consumption data since last report, grouped by metered group. User for frontend SDKs with unpredictable and potentially large number of user devices running those SDKs. */
requestConsumptionSinceLastReport?: RequestConsumptionSchema;
/** Requests made to edge's endpoints since last report. Meant to be used for billing purposes. */
requestsSinceLastReport?: EdgeRequestStatsSchema;
/** RFC3339 timestamp for when the Edge instance was started. */

View File

@ -32,6 +32,12 @@ export interface EnvironmentSchema {
projectCount?: number | null;
/** `true` if the environment is protected, otherwise `false`. A *protected* environment can not be deleted. */
protected: boolean;
/**
* Experimental field. The number of approvals required before a change request can be applied in this environment.
* @minimum 1
* @nullable
*/
requiredApprovals?: number | null;
/** Priority of the environment in a list of environments, the lower the value, the higher up in the list the environment will appear. Needs to be an integer */
sortOrder: number;
/** The [type of environment](https://docs.getunleash.io/reference/environments#environment-types). */

View File

@ -10,6 +10,8 @@ import type { VariantSchema } from './variantSchema';
* A detailed description of the feature environment
*/
export interface FeatureEnvironmentSchema {
/** Experimental. A list of change request identifiers for actionable change requests that are not Cancelled, Rejected or Approved. */
changeRequestIds?: number[];
/** `true` if the feature is enabled for the environment, otherwise `false`. */
enabled: boolean;
/** The name of the environment */
@ -25,12 +27,18 @@ export interface FeatureEnvironmentSchema {
* @nullable
*/
lastSeenAt?: string | null;
/** Experimental: The name of the currently active release plan milestone */
milestoneName?: string;
/** Experimental: The zero-indexed order of currently active milestone in the list of all release plan milestones */
milestoneOrder?: number;
/** The name of the environment */
name: string;
/** The sort order of the feature environment in the feature environments list */
sortOrder?: number;
/** A list of activation strategies for the feature environment */
strategies?: FeatureStrategySchema[];
/** Experimental: The total number of milestones in the feature environment release plan */
totalMilestones?: number;
/** The type of the environment */
type?: string;
/** The number of defined variants */

View File

@ -10,6 +10,8 @@ import type { VariantSchema } from './variantSchema';
* A detailed description of the feature environment
*/
export interface FeatureSearchEnvironmentSchema {
/** Experimental. A list of change request identifiers for actionable change requests that are not Cancelled, Rejected or Approved. */
changeRequestIds?: number[];
/** `true` if the feature is enabled for the environment, otherwise `false`. */
enabled: boolean;
/** The name of the environment */
@ -25,6 +27,10 @@ export interface FeatureSearchEnvironmentSchema {
* @nullable
*/
lastSeenAt?: string | null;
/** Experimental: The name of the currently active release plan milestone */
milestoneName?: string;
/** Experimental: The zero-indexed order of currently active milestone in the list of all release plan milestones */
milestoneOrder?: number;
/** The name of the environment */
name: string;
/**
@ -36,6 +42,8 @@ export interface FeatureSearchEnvironmentSchema {
sortOrder?: number;
/** A list of activation strategies for the feature environment */
strategies?: FeatureStrategySchema[];
/** Experimental: The total number of milestones in the feature environment release plan */
totalMilestones?: number;
/** The type of the environment */
type: string;
/** The number of defined variants */

View File

@ -367,8 +367,10 @@ export * from './complete403';
export * from './complete404';
export * from './connect401';
export * from './connect403';
export * from './connectionConsumptionSchema';
export * from './constraintSchema';
export * from './constraintSchemaOperator';
export * from './consumptionDataPointSchema';
export * from './contextFieldSchema';
export * from './contextFieldStrategiesSchema';
export * from './contextFieldStrategiesSchemaStrategiesItem';
@ -950,6 +952,7 @@ export * from './meteredConnectionsSchemaApiDataItem';
export * from './meteredConnectionsSchemaApiDataItemDataPointsItem';
export * from './meteredConnectionsSchemaDateRange';
export * from './meteredConnectionsSchemaGrouping';
export * from './meteredGroupConsumptionSchema';
export * from './meteredRequestsSchema';
export * from './meteredRequestsSchemaApiDataItem';
export * from './meteredRequestsSchemaApiDataItemDataPointsItem';
@ -1178,6 +1181,8 @@ export * from './removeTag404';
export * from './removeUserAccess401';
export * from './removeUserAccess403';
export * from './removeUserAccess404';
export * from './requestConsumptionSchema';
export * from './requestConsumptionSchemaItem';
export * from './requestsPerSecondSchema';
export * from './requestsPerSecondSchemaData';
export * from './requestsPerSecondSchemaDataResultItem';
@ -1350,6 +1355,7 @@ export * from './uiConfigSchemaAuthenticationType';
export * from './uiConfigSchemaBilling';
export * from './uiConfigSchemaFlags';
export * from './uiConfigSchemaLinksItem';
export * from './uiConfigSchemaUnleashContext';
export * from './uiObservability401';
export * from './uiObservability403';
export * from './uncomplete401';
@ -1489,6 +1495,13 @@ export * from './updateUser404';
export * from './updateUserSchema';
export * from './updateUserSchemaRootRole';
export * from './upsertSegmentSchema';
export * from './userAccessOverviewSchema';
export * from './userAccessOverviewSchemaOverview';
export * from './userAccessOverviewSchemaOverviewEnvironmentItem';
export * from './userAccessOverviewSchemaOverviewProjectItem';
export * from './userAccessOverviewSchemaOverviewRootItem';
export * from './userAccessOverviewSchemaProjectRolesItem';
export * from './userAccessOverviewSchemaProjectRolesItemPermissionsItem';
export * from './userAccessSchema';
export * from './userSchema';
export * from './userWithProjectRoleSchema';

View File

@ -0,0 +1,13 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ConsumptionDataPointSchema } from './consumptionDataPointSchema';
export interface MeteredGroupConsumptionSchema {
/** Array of consumption data points */
dataPoints: ConsumptionDataPointSchema[];
/** Name of the metered group */
meteredGroup: string;
}

View File

@ -0,0 +1,8 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { RequestConsumptionSchemaItem } from './requestConsumptionSchemaItem';
export type RequestConsumptionSchema = RequestConsumptionSchemaItem[];

View File

@ -0,0 +1,12 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RequestConsumptionSchemaItem = {
/** Name of the metered group */
meteredGroup: string;
/** Total number of requests for this metered group */
requests: number;
};

View File

@ -18,6 +18,10 @@ export type SearchFeaturesParams = {
* The state of the feature active/stale. The state can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF.
*/
state?: string;
/**
* The lifecycle stage of the feature. The stagee can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF.
*/
lifecycle?: string;
/**
* The feature flag type to filter by. The type can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF.
*/

View File

@ -8,6 +8,12 @@
* A tag type.
*/
export interface TagTypeSchema {
/**
* The hexadecimal color code for the tag type.
* @nullable
* @pattern ^#[0-9A-Fa-f]{6}$
*/
color?: string | null;
/** The description of the tag type. */
description?: string;
/**

View File

@ -8,6 +8,7 @@ import type { UiConfigSchemaBilling } from './uiConfigSchemaBilling';
import type { UiConfigSchemaFlags } from './uiConfigSchemaFlags';
import type { UiConfigSchemaLinksItem } from './uiConfigSchemaLinksItem';
import type { ResourceLimitsSchema } from './resourceLimitsSchema';
import type { UiConfigSchemaUnleashContext } from './uiConfigSchemaUnleashContext';
import type { VersionSchema } from './versionSchema';
/**
@ -60,6 +61,8 @@ export interface UiConfigSchema {
* @deprecated
*/
strategySegmentsLimit?: number;
/** The context object used to configure the Unleash instance. */
unleashContext?: UiConfigSchemaUnleashContext;
/** The URL of the Unleash instance. */
unleashUrl: string;
/** The current version of Unleash */

View File

@ -0,0 +1,10 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
/**
* The context object used to configure the Unleash instance.
*/
export type UiConfigSchemaUnleashContext = { [key: string]: unknown };

View File

@ -8,6 +8,12 @@
* Data used to update an [environment](https://docs.getunleash.io/reference/environments).
*/
export interface UpdateEnvironmentSchema {
/**
* Experimental field. The number of approvals required before a change request can be applied in this environment.
* @minimum 1
* @nullable
*/
requiredApprovals?: number | null;
/** Changes the sort order of this environment. */
sortOrder?: number;
/** Updates the type of environment (i.e. development or production). */

View File

@ -8,6 +8,11 @@
* The request body for updating a tag type.
*/
export interface UpdateTagTypeSchema {
/**
* The hexadecimal color code for the tag type.
* @pattern ^#[0-9A-Fa-f]{6}$
*/
color?: string;
/** The description of the tag type. */
description?: string;
/** The icon of the tag type. */

View File

@ -0,0 +1,23 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { UserAccessOverviewSchemaOverview } from './userAccessOverviewSchemaOverview';
import type { UserAccessOverviewSchemaProjectRolesItem } from './userAccessOverviewSchemaProjectRolesItem';
import type { RoleSchema } from './roleSchema';
import type { UserSchema } from './userSchema';
/**
* Describes the access overview (list of permissions and metadata) for a user.
*/
export interface UserAccessOverviewSchema {
/** The access overview (list of permissions) for the user */
overview: UserAccessOverviewSchemaOverview;
/** The list of project roles that this user has in the selected project */
projectRoles: UserAccessOverviewSchemaProjectRolesItem[];
/** The name of the root role that this user has */
rootRole: RoleSchema;
/** The user that this access overview is for */
user: UserSchema;
}

View File

@ -0,0 +1,20 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { UserAccessOverviewSchemaOverviewEnvironmentItem } from './userAccessOverviewSchemaOverviewEnvironmentItem';
import type { UserAccessOverviewSchemaOverviewProjectItem } from './userAccessOverviewSchemaOverviewProjectItem';
import type { UserAccessOverviewSchemaOverviewRootItem } from './userAccessOverviewSchemaOverviewRootItem';
/**
* The access overview (list of permissions) for the user
*/
export type UserAccessOverviewSchemaOverview = {
/** The list of environment permissions */
environment: UserAccessOverviewSchemaOverviewEnvironmentItem[];
/** The list of project permissions */
project: UserAccessOverviewSchemaOverviewProjectItem[];
/** The list of root permissions */
root: UserAccessOverviewSchemaOverviewRootItem[];
};

View File

@ -0,0 +1,23 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type UserAccessOverviewSchemaOverviewEnvironmentItem = {
/** The display name of the permission */
displayName: string;
/**
* The environment that the permission applies to
* @nullable
*/
environment?: string | null;
/** Whether the user has this permission */
hasPermission: boolean;
/** The ID of the permission */
id: number;
/** The name of the permission */
name: string;
/** The type of the permission */
type: string;
};

View File

@ -0,0 +1,23 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type UserAccessOverviewSchemaOverviewProjectItem = {
/** The display name of the permission */
displayName: string;
/**
* The environment that the permission applies to
* @nullable
*/
environment?: string | null;
/** Whether the user has this permission */
hasPermission: boolean;
/** The ID of the permission */
id: number;
/** The name of the permission */
name: string;
/** The type of the permission */
type: string;
};

View File

@ -0,0 +1,23 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type UserAccessOverviewSchemaOverviewRootItem = {
/** The display name of the permission */
displayName: string;
/**
* The environment that the permission applies to
* @nullable
*/
environment?: string | null;
/** Whether the user has this permission */
hasPermission: boolean;
/** The ID of the permission */
id: number;
/** The name of the permission */
name: string;
/** The type of the permission */
type: string;
};

View File

@ -0,0 +1,27 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { UserAccessOverviewSchemaProjectRolesItemPermissionsItem } from './userAccessOverviewSchemaProjectRolesItemPermissionsItem';
export type UserAccessOverviewSchemaProjectRolesItem = {
/** A more detailed description of the role and what use it's intended for */
description?: string;
/**
* The role id
* @minimum 0
*/
id: number;
/** The name of the role */
name: string;
/** The permissions that this role has */
permissions: UserAccessOverviewSchemaProjectRolesItemPermissionsItem[];
/**
* What project the role belongs to
* @nullable
*/
project?: string | null;
/** A role can either be a global root role (applies to all projects) or a project role */
type: string;
};

View File

@ -0,0 +1,21 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type UserAccessOverviewSchemaProjectRolesItemPermissionsItem = {
/** The display name of the permission */
displayName: string;
/**
* The environment that the permission applies to
* @nullable
*/
environment?: string | null;
/** The ID of the permission */
id: number;
/** The name of the permission */
name: string;
/** The type of the permission */
type: string;
};