Skip to content

Commit

Permalink
Update OpenAPI generated types for frontend (#6950)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Apr 26, 2024
1 parent 7022ce8 commit 514a18b
Show file tree
Hide file tree
Showing 148 changed files with 1,317 additions and 287 deletions.
15 changes: 12 additions & 3 deletions frontend/src/openapi/models/actionEventSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ export interface ActionEventSchema {
createdAt: string;
/** The id of user that created this action set */
createdByUserId: number;
/** The details of the action event, if any. */
/**
* The details of the action event, if any.
* @nullable
*/
details?: string | null;
/** A map of parameters to pass to the action */
executionParams?: ActionEventSchemaExecutionParams;
/** The id of the action set */
/**
* The id of the action set
* @minimum 1
*/
id: number;
/** The order in which the action should be executed */
/**
* The order in which the action should be executed
* @minimum 1
*/
sortOrder: number;
/** The state of the action. Can be one of `not started`, `started`, `success`, or `failed`. */
state: ActionEventSchemaState;
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/openapi/models/actionSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ export interface ActionSchema {
createdByUserId: number;
/** A map of parameters to pass to the action */
executionParams?: ActionSchemaExecutionParams;
/** The id of the action set */
/**
* The id of the action set
* @minimum 1
*/
id: number;
/** The order in which the action should be executed */
/**
* The order in which the action should be executed
* @minimum 1
*/
sortOrder: number;
}
5 changes: 4 additions & 1 deletion frontend/src/openapi/models/actionSetEventSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export interface ActionSetEventSchema {
actionSetId: number;
/** The date and time of when the action set event was created. In other words, the date and time of when the action set started executing. */
createdAt: string;
/** The action set event's ID. Action set event IDs are incrementing integers. In other words, a more recently created action set event will always have a higher ID than an older one. */
/**
* The action set event's ID. Action set event IDs are incrementing integers. In other words, a more recently created action set event will always have a higher ID than an older one.
* @minimum 1
*/
id: number;
/** The signal that triggered this action set event. */
signal: SignalSchema;
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/openapi/models/actionSetEventSchemaActionSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ import type { ActionSetEventSchemaActionSetMatch } from './actionSetEventSchemaA
export type ActionSetEventSchemaActionSet = {
/** The list of actions executed in sequential order when the action set was triggered, decorated with the individual action states. */
actions: ActionEventSchema[];
/** The id of the service account that will execute the action */
/**
* The id of the service account that will execute the action
* @minimum 1
*/
actorId: number;
/** The date and time of when the action set was created. */
createdAt: string;
/** The ID of the user that created this action set. */
createdByUserId: number;
/** The description of the action set */
/**
* The description of the action set
* @nullable
*/
description?: string | null;
/** Whether this action set is enabled or not */
enabled?: boolean;
/** The ID of the action set. */
/**
* The ID of the action set.
* @minimum 1
*/
id: number;
/** Defines a matching rule for the signal that will trigger the action set */
match: ActionSetEventSchemaActionSetMatch;
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/openapi/models/actionsSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ import type { ActionsSchemaMatch } from './actionsSchemaMatch';
export interface ActionsSchema {
/** The list of actions to execute in sequential order when the action set is triggered. */
actions: ActionSchema[];
/** The id of the service account that will execute the action */
/**
* The id of the service account that will execute the action
* @minimum 1
*/
actorId: number;
/** The date and time of when the action set was created. */
createdAt: string;
/** The ID of the user that created this action set. */
createdByUserId: number;
/** The description of the action set */
/**
* The description of the action set
* @nullable
*/
description?: string | null;
/** Whether this action set is enabled or not */
enabled?: boolean;
/** The ID of the action set. */
/**
* The ID of the action set.
* @minimum 1
*/
id: number;
/** Defines a matching rule for the signal that will trigger the action set */
match: ActionsSchemaMatch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/**
* Parameters for the addon provider. This object has different required and optional properties depending on the provider you choose. Consult the documentation for details.
*/
export type AddonCreateUpdateSchemaParameters = { [key: string]: {} };
export type AddonCreateUpdateSchemaParameters = { [key: string]: unknown };
10 changes: 8 additions & 2 deletions frontend/src/openapi/models/addonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ import type { AddonSchemaParameters } from './addonSchemaParameters';
* An [addon](https://docs.getunleash.io/reference/addons) instance description. Contains data about what kind of provider it uses, whether it's enabled or not, what events it listens for, and more.
*/
export interface AddonSchema {
/** A description of the addon. `null` if no description exists. */
/**
* A description of the addon. `null` if no description exists.
* @nullable
*/
description: string | null;
/** Whether the addon is enabled or not. */
enabled: boolean;
/** The list of environments that this addon listens to events from. An empty list means it listens to events from **all** environments. */
environments?: string[];
/** The event types that trigger this specific addon. */
events: string[];
/** The addon's unique identifier. */
/**
* The addon's unique identifier.
* @minimum 1
*/
id: number;
/** Parameters for the addon provider. This object has different required and optional properties depending on the provider you choose. */
parameters: AddonSchemaParameters;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/openapi/models/addonSchemaParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/**
* Parameters for the addon provider. This object has different required and optional properties depending on the provider you choose.
*/
export type AddonSchemaParameters = { [key: string]: {} };
export type AddonSchemaParameters = { [key: string]: unknown };
5 changes: 4 additions & 1 deletion frontend/src/openapi/models/adminPermissionsSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import type { AdminPermissionsSchemaVersion } from './adminPermissionsSchemaVers
export interface AdminPermissionsSchema {
/** Returns permissions available at all three levels (root|project|environment) */
permissions: AdminPermissionsSchemaPermissions;
/** The api version of this response. A natural increasing number. Only increases if format changes */
/**
* The api version of this response. A natural increasing number. Only increases if format changes
* @minimum 1
*/
version: AdminPermissionsSchemaVersion;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* The api version of this response. A natural increasing number. Only increases if format changes
* @minimum 1
*/
export type AdminPermissionsSchemaVersion =
(typeof AdminPermissionsSchemaVersion)[keyof typeof AdminPermissionsSchemaVersion];
Expand Down
32 changes: 26 additions & 6 deletions frontend/src/openapi/models/adminSegmentSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,38 @@ export interface AdminSegmentSchema {
constraints: ConstraintSchema[];
/** When the segment was created */
createdAt: string;
/** The creator's email or username */
/**
* The creator's email or username
* @nullable
*/
createdBy?: string | null;
/** The description for this segment */
/**
* The description for this segment
* @nullable
*/
description?: string | null;
/** The ID of this segment */
/**
* The ID of this segment
* @minimum 0
*/
id: number;
/** The name of this segment */
name: string;
/** The project the segment belongs to. Only present if the segment is a project-specific segment. */
/**
* The project the segment belongs to. Only present if the segment is a project-specific segment.
* @nullable
*/
project?: string | null;
/** The number of feature flags that use this segment. The number also includes the any flags with pending change requests that would add this segment. */
/**
* The number of feature flags that use this segment. The number also includes the any flags with pending change requests that would add this segment.
* @minimum 0
* @nullable
*/
usedInFeatures?: number | null;
/** The number of projects that use this segment. The number includes any projects with pending change requests that would add this segment. */
/**
* The number of projects that use this segment. The number includes any projects with pending change requests that would add this segment.
* @minimum 0
* @nullable
*/
usedInProjects?: number | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ export interface AdvancedPlaygroundEnvironmentFeatureSchema {
projectId: string;
/** Feature's applicable strategies and cumulative results of the strategies */
strategies: AdvancedPlaygroundEnvironmentFeatureSchemaStrategies;
/** The feature variant you receive based on the provided context or the _disabled
/**
* The feature variant you receive based on the provided context or the _disabled
variant_. If a feature is disabled or doesn't have any
variants, you would get the _disabled variant_.
Otherwise, you'll get one of the feature's defined variants. */
Otherwise, you'll get one of the feature's defined variants.
* @nullable
*/
variant: AdvancedPlaygroundEnvironmentFeatureSchemaVariant;
/** The feature variants. */
variants: VariantSchema[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { AdvancedPlaygroundEnvironmentFeatureSchemaVariantPayload } from '.
variant_. If a feature is disabled or doesn't have any
variants, you would get the _disabled variant_.
Otherwise, you'll get one of the feature's defined variants.
* @nullable
*/
export type AdvancedPlaygroundEnvironmentFeatureSchemaVariant = {
/** Whether the variant is enabled or not. If the feature is disabled or if it doesn't have variants, this property will be `false` */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import type { AdvancedPlaygroundRequestSchemaProjects } from './advancedPlaygrou
*/
export interface AdvancedPlaygroundRequestSchema {
context: SdkContextSchema;
/** The environments to evaluate toggles in. */
/**
* The environments to evaluate toggles in.
* @minItems 1
*/
environments: string[];
/** A list of projects to check for toggles in. */
projects?: AdvancedPlaygroundRequestSchemaProjects;
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/openapi/models/apiTokenSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,30 @@ import type { ApiTokenSchemaType } from './apiTokenSchemaType';
* An overview of an [Unleash API token](https://docs.getunleash.io/reference/api-tokens-and-client-keys).
*/
export interface ApiTokenSchema {
/** Alias is no longer in active use and will often be NULL. It's kept around as a way of allowing old proxy tokens created with the old metadata format to keep working. */
/**
* Alias is no longer in active use and will often be NULL. It's kept around as a way of allowing old proxy tokens created with the old metadata format to keep working.
* @nullable
*/
alias?: string | null;
/** When the token was created. */
createdAt: string;
/** The environment the token has access to. `*` if it has access to all environments. */
environment?: string;
/** The token's expiration date. NULL if the token doesn't have an expiration set. */
/**
* The token's expiration date. NULL if the token doesn't have an expiration set.
* @nullable
*/
expiresAt?: string | null;
/** The project this token belongs to. */
project: string;
/** The list of projects this token has access to. If the token has access to specific projects they will be listed here. If the token has access to all projects it will be represented as `[*]` */
projects: string[];
/** The token used for authentication. */
secret: string;
/** When the token was last seen/used to authenticate with. NULL if the token has not yet been used for authentication. */
/**
* When the token was last seen/used to authenticate with. NULL if the token has not yet been used for authentication.
* @nullable
*/
seenAt?: string | null;
/** A unique name for this particular token */
tokenName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export interface ApplicationOverviewEnvironmentSchema {
instanceCount: number;
/** This list of issues that might be wrong with the application */
issues: ApplicationEnvironmentIssuesSchema;
/** The last time the application environment was seen */
/**
* The last time the application environment was seen
* @nullable
*/
lastSeen: string | null;
/** Name of the application environment */
name: string;
Expand Down
30 changes: 24 additions & 6 deletions frontend/src/openapi/models/bannerSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,37 @@
export interface BannerSchema {
/** The date and time of when the banner was created. */
createdAt: string;
/** The markdown to display on the dialog. If not specified, no dialog will be displayed. */
/**
* The markdown to display on the dialog. If not specified, no dialog will be displayed.
* @nullable
*/
dialog?: string | null;
/** The title to display on the dialog. If not specified, this will be the same as `linkText`. */
/**
* The title to display on the dialog. If not specified, this will be the same as `linkText`.
* @nullable
*/
dialogTitle?: string | null;
/** Whether the banner should be displayed currently. If not specified, defaults to true. */
enabled?: boolean;
/** The icon to display on the banner. Can be one of https://fonts.google.com/icons. If not specified, this will be the default icon for the variant. If "none", no icon will be displayed. */
/**
* The icon to display on the banner. Can be one of https://fonts.google.com/icons. If not specified, this will be the default icon for the variant. If "none", no icon will be displayed.
* @nullable
*/
icon?: string | null;
/** The banner's ID. Banner IDs are incrementing integers. In other words, a more recently created banner will always have a higher ID than an older one. */
/**
* The banner's ID. Banner IDs are incrementing integers. In other words, a more recently created banner will always have a higher ID than an older one.
* @minimum 1
*/
id: number;
/** The link to display on the banner. Can either be an absolute or a relative link (e.g. absolute: "https://example.com" or relative: "/admin/service-accounts"). If "dialog", will display a dialog when clicked. If not specified, no link will be displayed. */
/**
* The link to display on the banner. Can either be an absolute or a relative link (e.g. absolute: "https://example.com" or relative: "/admin/service-accounts"). If "dialog", will display a dialog when clicked. If not specified, no link will be displayed.
* @nullable
*/
link?: string | null;
/** The text to display on the link. If not specified, will be displayed as "More info". */
/**
* The text to display on the link. If not specified, will be displayed as "More info".
* @nullable
*/
linkText?: string | null;
/** The message to display to all users. Supports markdown. */
message: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
* The user who created this change.
*/
export type ChangeRequestChangeSchemaCreatedBy = {
/** The URL where the user's image can be found. */
/**
* The URL where the user's image can be found.
* @nullable
*/
imageUrl?: string | null;
/** The user's username. */
/**
* The user's username.
* @nullable
*/
username?: string | null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
* Information about the user who posted the comment
*/
export type ChangeRequestCommentSchemaCreatedBy = {
/** The URL where the user's image can be found. */
/**
* The URL where the user's image can be found.
* @nullable
*/
imageUrl?: string | null;
/** The user's username. */
/**
* The user's username.
* @nullable
*/
username?: string | null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export interface ChangeRequestEnvironmentConfigSchema {
changeRequestEnabled: boolean;
/** The environment that this configuration applies to. */
environment: string;
/** The number of approvals that are required for a change request to be fully approved and ready to be applied in this environment. */
/**
* The number of approvals that are required for a change request to be fully approved and ready to be applied in this environment.
* @nullable
*/
requiredApprovals: number | null;
/** The [type of the environment](https://docs.getunleash.io/reference/environments#environment-types) listed in `environment`. */
type: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type ChangeRequestScheduleSchemaOneOfThree = {
/**
* The reason the scheduled failed to apply. Deprecated in favor of the `reason` property.
* @deprecated
* @nullable
*/
failureReason?: string | null;
/** The reason the scheduled failed to apply. */
Expand Down

0 comments on commit 514a18b

Please sign in to comment.