From dc214d376a6c0558b3efce7956923266fef012f2 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Thu, 22 Feb 2024 12:50:17 +0100 Subject: [PATCH] chore: generate orval types (#6310) --- .../src/openapi/models/actionEventSchema.ts | 31 ++++++++++--------- ...ts => actionEventSchemaExecutionParams.ts} | 2 +- .../models/actionEventSchemaPayload.ts | 10 ------ .../openapi/models/actionEventSchemaSource.ts | 16 ---------- .../openapi/models/actionEventSchemaState.ts | 19 ++++++++++++ .../src/openapi/models/actionEventsSchema.ts | 14 --------- .../openapi/models/actionSetEventSchema.ts | 28 +++++++++++++++++ .../models/actionSetEventSchemaActionSet.ts | 31 +++++++++++++++++++ .../actionSetEventSchemaActionSetMatch.ts | 18 +++++++++++ ...tionSetEventSchemaActionSetMatchPayload.ts | 10 ++++++ .../models/actionSetEventSchemaState.ts | 18 +++++++++++ .../openapi/models/actionSetEventsSchema.ts | 14 +++++++++ .../src/openapi/models/actionStateSchema.ts | 25 --------------- .../openapi/models/actionStateSchemaState.ts | 18 ----------- .../applicationOverviewEnvironmentSchema.ts | 19 ++++++++++++ .../models/applicationOverviewSchema.ts | 18 +++++++++++ .../src/openapi/models/applicationsSchema.ts | 4 ++- .../models/getApplicationOverview404.ts | 14 +++++++++ .../openapi/models/getApplicationsParams.ts | 28 +++++++++++++++++ frontend/src/openapi/models/index.ts | 18 +++++++---- .../openapi/models/observableEventSchema.ts | 2 +- 21 files changed, 251 insertions(+), 106 deletions(-) rename frontend/src/openapi/models/{actionStateSchemaExecutionParams.ts => actionEventSchemaExecutionParams.ts} (70%) delete mode 100644 frontend/src/openapi/models/actionEventSchemaPayload.ts delete mode 100644 frontend/src/openapi/models/actionEventSchemaSource.ts create mode 100644 frontend/src/openapi/models/actionEventSchemaState.ts delete mode 100644 frontend/src/openapi/models/actionEventsSchema.ts create mode 100644 frontend/src/openapi/models/actionSetEventSchema.ts create mode 100644 frontend/src/openapi/models/actionSetEventSchemaActionSet.ts create mode 100644 frontend/src/openapi/models/actionSetEventSchemaActionSetMatch.ts create mode 100644 frontend/src/openapi/models/actionSetEventSchemaActionSetMatchPayload.ts create mode 100644 frontend/src/openapi/models/actionSetEventSchemaState.ts create mode 100644 frontend/src/openapi/models/actionSetEventsSchema.ts delete mode 100644 frontend/src/openapi/models/actionStateSchema.ts delete mode 100644 frontend/src/openapi/models/actionStateSchemaState.ts create mode 100644 frontend/src/openapi/models/applicationOverviewEnvironmentSchema.ts create mode 100644 frontend/src/openapi/models/applicationOverviewSchema.ts create mode 100644 frontend/src/openapi/models/getApplicationOverview404.ts create mode 100644 frontend/src/openapi/models/getApplicationsParams.ts diff --git a/frontend/src/openapi/models/actionEventSchema.ts b/frontend/src/openapi/models/actionEventSchema.ts index 1bb7ceb795..d15f05bbb3 100644 --- a/frontend/src/openapi/models/actionEventSchema.ts +++ b/frontend/src/openapi/models/actionEventSchema.ts @@ -3,24 +3,27 @@ * Do not edit manually. * See `gen:api` script in package.json */ -import type { ActionStateSchema } from './actionStateSchema'; -import type { ActionEventSchemaPayload } from './actionEventSchemaPayload'; -import type { ActionEventSchemaSource } from './actionEventSchemaSource'; +import type { ActionEventSchemaExecutionParams } from './actionEventSchemaExecutionParams'; +import type { ActionEventSchemaState } from './actionEventSchemaState'; /** * An object describing an action event. */ export interface ActionEventSchema { - /** The individual action events. */ - actions: ActionStateSchema[]; - /** The date and time of when the observable event was created. */ + /** The name of the action to execute */ + action: string; + /** The date and time of when the action was created. */ createdAt: string; - /** The observable event's ID. Observable event IDs are incrementing integers. In other words, a more recently created observable event will always have a higher ID than an older one. */ - id?: number; - /** The payload of the observable event. */ - payload?: ActionEventSchemaPayload; - /** The observable event source type. Should be used along with `sourceId` to uniquely identify the resource that created this observable event. */ - source: ActionEventSchemaSource; - /** The ID of the source that created this observable event. Should be used along with `source` to uniquely identify the resource that created this observable event. */ - sourceId: number; + /** The id of user that created this action set */ + createdByUserId: number; + /** The details of the action event, if any. */ + details?: string | null; + /** A map of parameters to pass to the action */ + executionParams?: ActionEventSchemaExecutionParams; + /** The id of the action set */ + id: number; + /** The order in which the action should be executed */ + sortOrder: number; + /** The state of the action. Can be one of `not started`, `started`, `success`, or `failed`. */ + state: ActionEventSchemaState; } diff --git a/frontend/src/openapi/models/actionStateSchemaExecutionParams.ts b/frontend/src/openapi/models/actionEventSchemaExecutionParams.ts similarity index 70% rename from frontend/src/openapi/models/actionStateSchemaExecutionParams.ts rename to frontend/src/openapi/models/actionEventSchemaExecutionParams.ts index 8043d0d54d..a73de2da79 100644 --- a/frontend/src/openapi/models/actionStateSchemaExecutionParams.ts +++ b/frontend/src/openapi/models/actionEventSchemaExecutionParams.ts @@ -7,4 +7,4 @@ /** * A map of parameters to pass to the action */ -export type ActionStateSchemaExecutionParams = { [key: string]: any }; +export type ActionEventSchemaExecutionParams = { [key: string]: any }; diff --git a/frontend/src/openapi/models/actionEventSchemaPayload.ts b/frontend/src/openapi/models/actionEventSchemaPayload.ts deleted file mode 100644 index 09b5c589b6..0000000000 --- a/frontend/src/openapi/models/actionEventSchemaPayload.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Generated by Orval - * Do not edit manually. - * See `gen:api` script in package.json - */ - -/** - * The payload of the observable event. - */ -export type ActionEventSchemaPayload = { [key: string]: any }; diff --git a/frontend/src/openapi/models/actionEventSchemaSource.ts b/frontend/src/openapi/models/actionEventSchemaSource.ts deleted file mode 100644 index 5e704f9c76..0000000000 --- a/frontend/src/openapi/models/actionEventSchemaSource.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Generated by Orval - * Do not edit manually. - * See `gen:api` script in package.json - */ - -/** - * The observable event source type. Should be used along with `sourceId` to uniquely identify the resource that created this observable event. - */ -export type ActionEventSchemaSource = - (typeof ActionEventSchemaSource)[keyof typeof ActionEventSchemaSource]; - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const ActionEventSchemaSource = { - 'incoming-webhook': 'incoming-webhook', -} as const; diff --git a/frontend/src/openapi/models/actionEventSchemaState.ts b/frontend/src/openapi/models/actionEventSchemaState.ts new file mode 100644 index 0000000000..0fecbb44b4 --- /dev/null +++ b/frontend/src/openapi/models/actionEventSchemaState.ts @@ -0,0 +1,19 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * The state of the action. Can be one of `not started`, `started`, `success`, or `failed`. + */ +export type ActionEventSchemaState = + (typeof ActionEventSchemaState)[keyof typeof ActionEventSchemaState]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const ActionEventSchemaState = { + not_started: 'not started', + started: 'started', + success: 'success', + failed: 'failed', +} as const; diff --git a/frontend/src/openapi/models/actionEventsSchema.ts b/frontend/src/openapi/models/actionEventsSchema.ts deleted file mode 100644 index e261a83a6f..0000000000 --- a/frontend/src/openapi/models/actionEventsSchema.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Generated by Orval - * Do not edit manually. - * See `gen:api` script in package.json - */ -import type { ActionEventSchema } from './actionEventSchema'; - -/** - * A response model with a list of action events. - */ -export interface ActionEventsSchema { - /** A list of action events. */ - actionEvents: ActionEventSchema[]; -} diff --git a/frontend/src/openapi/models/actionSetEventSchema.ts b/frontend/src/openapi/models/actionSetEventSchema.ts new file mode 100644 index 0000000000..a8ddda45e8 --- /dev/null +++ b/frontend/src/openapi/models/actionSetEventSchema.ts @@ -0,0 +1,28 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { ActionSetEventSchemaActionSet } from './actionSetEventSchemaActionSet'; +import type { ObservableEventSchema } from './observableEventSchema'; +import type { ActionSetEventSchemaState } from './actionSetEventSchemaState'; + +/** + * An object describing an action event. + */ +export interface ActionSetEventSchema { + /** The action set this action set event belongs to, where the individual actions are decorated with the respective action states. */ + actionSet: ActionSetEventSchemaActionSet; + /** The ID of the action set that the action set event belongs to. */ + 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. */ + id: number; + /** The observable event that triggered this action set event. */ + observableEvent: ObservableEventSchema; + /** The ID of the observable event that triggered this action set event. */ + observableEventId: number; + /** The state of the action set event. Can be one of `started`, `success`, or `failed`. */ + state: ActionSetEventSchemaState; +} diff --git a/frontend/src/openapi/models/actionSetEventSchemaActionSet.ts b/frontend/src/openapi/models/actionSetEventSchemaActionSet.ts new file mode 100644 index 0000000000..3f8a0d3ec1 --- /dev/null +++ b/frontend/src/openapi/models/actionSetEventSchemaActionSet.ts @@ -0,0 +1,31 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { ActionEventSchema } from './actionEventSchema'; +import type { ActionSetEventSchemaActionSetMatch } from './actionSetEventSchemaActionSetMatch'; + +/** + * The action set this action set event belongs to, where the individual actions are decorated with the respective action states. + */ +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 */ + 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; + /** Whether this action set is enabled or not */ + enabled?: boolean; + /** The ID of the action set. */ + id: number; + /** Defines a matching rule for the observable event that will trigger the action set */ + match: ActionSetEventSchemaActionSetMatch; + /** The name of the action set */ + name: string; + /** The project that this action set belongs to. */ + project: string; +}; diff --git a/frontend/src/openapi/models/actionSetEventSchemaActionSetMatch.ts b/frontend/src/openapi/models/actionSetEventSchemaActionSetMatch.ts new file mode 100644 index 0000000000..db70296083 --- /dev/null +++ b/frontend/src/openapi/models/actionSetEventSchemaActionSetMatch.ts @@ -0,0 +1,18 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { ActionSetEventSchemaActionSetMatchPayload } from './actionSetEventSchemaActionSetMatchPayload'; + +/** + * Defines a matching rule for the observable event that will trigger the action set + */ +export type ActionSetEventSchemaActionSetMatch = { + /** Match the payload of the observable event */ + payload: ActionSetEventSchemaActionSetMatchPayload; + /** Match the source of the observable event */ + source: string; + /** Match the source id of the observable event */ + sourceId: number; +}; diff --git a/frontend/src/openapi/models/actionSetEventSchemaActionSetMatchPayload.ts b/frontend/src/openapi/models/actionSetEventSchemaActionSetMatchPayload.ts new file mode 100644 index 0000000000..c3b056d1b8 --- /dev/null +++ b/frontend/src/openapi/models/actionSetEventSchemaActionSetMatchPayload.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * Match the payload of the observable event + */ +export type ActionSetEventSchemaActionSetMatchPayload = { [key: string]: any }; diff --git a/frontend/src/openapi/models/actionSetEventSchemaState.ts b/frontend/src/openapi/models/actionSetEventSchemaState.ts new file mode 100644 index 0000000000..f2d338420b --- /dev/null +++ b/frontend/src/openapi/models/actionSetEventSchemaState.ts @@ -0,0 +1,18 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * The state of the action set event. Can be one of `started`, `success`, or `failed`. + */ +export type ActionSetEventSchemaState = + (typeof ActionSetEventSchemaState)[keyof typeof ActionSetEventSchemaState]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const ActionSetEventSchemaState = { + started: 'started', + success: 'success', + failed: 'failed', +} as const; diff --git a/frontend/src/openapi/models/actionSetEventsSchema.ts b/frontend/src/openapi/models/actionSetEventsSchema.ts new file mode 100644 index 0000000000..c442333bc9 --- /dev/null +++ b/frontend/src/openapi/models/actionSetEventsSchema.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { ActionSetEventSchema } from './actionSetEventSchema'; + +/** + * A response model with a list of action set events. + */ +export interface ActionSetEventsSchema { + /** A list of action set events. */ + actionSetEvents: ActionSetEventSchema[]; +} diff --git a/frontend/src/openapi/models/actionStateSchema.ts b/frontend/src/openapi/models/actionStateSchema.ts deleted file mode 100644 index 03a7e68bf1..0000000000 --- a/frontend/src/openapi/models/actionStateSchema.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Generated by Orval - * Do not edit manually. - * See `gen:api` script in package.json - */ -import type { ActionStateSchemaExecutionParams } from './actionStateSchemaExecutionParams'; -import type { ActionStateSchemaState } from './actionStateSchemaState'; - -/** - * An object describing an action state. - */ -export interface ActionStateSchema { - /** The name of the action to execute */ - action: string; - /** The date and time of the action state update. */ - createdAt: string; - /** The details of the action state. Only present if the action state is `failed`. */ - details?: string | null; - /** A map of parameters to pass to the action */ - executionParams: ActionStateSchemaExecutionParams; - /** The order in which the action should be executed */ - sortOrder: number; - /** The state of the action. Can be one of `started`, `finished`, or `failed`. */ - state: ActionStateSchemaState; -} diff --git a/frontend/src/openapi/models/actionStateSchemaState.ts b/frontend/src/openapi/models/actionStateSchemaState.ts deleted file mode 100644 index 13ff5ca32d..0000000000 --- a/frontend/src/openapi/models/actionStateSchemaState.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Generated by Orval - * Do not edit manually. - * See `gen:api` script in package.json - */ - -/** - * The state of the action. Can be one of `started`, `finished`, or `failed`. - */ -export type ActionStateSchemaState = - (typeof ActionStateSchemaState)[keyof typeof ActionStateSchemaState]; - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const ActionStateSchemaState = { - started: 'started', - finished: 'finished', - failed: 'failed', -} as const; diff --git a/frontend/src/openapi/models/applicationOverviewEnvironmentSchema.ts b/frontend/src/openapi/models/applicationOverviewEnvironmentSchema.ts new file mode 100644 index 0000000000..bf9128eca8 --- /dev/null +++ b/frontend/src/openapi/models/applicationOverviewEnvironmentSchema.ts @@ -0,0 +1,19 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * Data about an application environment + */ +export interface ApplicationOverviewEnvironmentSchema { + /** The number of instances of the application environment */ + instanceCount: number; + /** The last time the application environment was seen */ + lastSeen: string; + /** Name of the application environment */ + name: string; + /** SDKs used in the application environment */ + sdks: string[]; +} diff --git a/frontend/src/openapi/models/applicationOverviewSchema.ts b/frontend/src/openapi/models/applicationOverviewSchema.ts new file mode 100644 index 0000000000..b592c398fa --- /dev/null +++ b/frontend/src/openapi/models/applicationOverviewSchema.ts @@ -0,0 +1,18 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { ApplicationOverviewEnvironmentSchema } from './applicationOverviewEnvironmentSchema'; + +/** + * Data about an application that's connected to Unleash via an SDK. + */ +export interface ApplicationOverviewSchema { + /** The list of environments the application has been using. */ + environments: ApplicationOverviewEnvironmentSchema[]; + /** The number of features the application has been using. */ + featureCount: number; + /** The list of projects the application has been using. */ + projects: string[]; +} diff --git a/frontend/src/openapi/models/applicationsSchema.ts b/frontend/src/openapi/models/applicationsSchema.ts index 9a0a72dd90..60c1b9792b 100644 --- a/frontend/src/openapi/models/applicationsSchema.ts +++ b/frontend/src/openapi/models/applicationsSchema.ts @@ -10,5 +10,7 @@ import type { ApplicationSchema } from './applicationSchema'; */ export interface ApplicationsSchema { /** The list of applications that have connected to this Unleash instance. */ - applications?: ApplicationSchema[]; + applications: ApplicationSchema[]; + /** The total number of project applications. */ + total: number; } diff --git a/frontend/src/openapi/models/getApplicationOverview404.ts b/frontend/src/openapi/models/getApplicationOverview404.ts new file mode 100644 index 0000000000..20f7277a7d --- /dev/null +++ b/frontend/src/openapi/models/getApplicationOverview404.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetApplicationOverview404 = { + /** The ID of the error instance */ + id?: string; + /** A description of what went wrong. */ + message?: string; + /** The name of the error kind */ + name?: string; +}; diff --git a/frontend/src/openapi/models/getApplicationsParams.ts b/frontend/src/openapi/models/getApplicationsParams.ts new file mode 100644 index 0000000000..6404c10c99 --- /dev/null +++ b/frontend/src/openapi/models/getApplicationsParams.ts @@ -0,0 +1,28 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetApplicationsParams = { + /** + * The search query for the application name + */ + query?: string; + /** + * The number of applications to skip when returning a page. By default it is set to 0. + */ + offset?: string; + /** + * The number of applications to return in a page. By default it is set to 1000. + */ + limit?: string; + /** + * The field to sort the results by. By default it is set to "appName". + */ + sortBy?: string; + /** + * The sort order for the sortBy. By default it is det to "asc". + */ + sortOrder?: string; +}; diff --git a/frontend/src/openapi/models/index.ts b/frontend/src/openapi/models/index.ts index 80df65f30c..b207cece07 100644 --- a/frontend/src/openapi/models/index.ts +++ b/frontend/src/openapi/models/index.ts @@ -8,14 +8,16 @@ export * from './_exportFormat'; export * from './_exportParams'; export * from './accessOverviewSchema'; export * from './actionEventSchema'; -export * from './actionEventSchemaPayload'; -export * from './actionEventSchemaSource'; -export * from './actionEventsSchema'; +export * from './actionEventSchemaExecutionParams'; +export * from './actionEventSchemaState'; export * from './actionSchema'; export * from './actionSchemaExecutionParams'; -export * from './actionStateSchema'; -export * from './actionStateSchemaExecutionParams'; -export * from './actionStateSchemaState'; +export * from './actionSetEventSchema'; +export * from './actionSetEventSchemaActionSet'; +export * from './actionSetEventSchemaActionSetMatch'; +export * from './actionSetEventSchemaActionSetMatchPayload'; +export * from './actionSetEventSchemaState'; +export * from './actionSetEventsSchema'; export * from './actionsListSchema'; export * from './actionsSchema'; export * from './actionsSchemaMatch'; @@ -88,6 +90,8 @@ export * from './advancedPlaygroundResponseSchema'; export * from './apiTokenSchema'; export * from './apiTokenSchemaType'; export * from './apiTokensSchema'; +export * from './applicationOverviewEnvironmentSchema'; +export * from './applicationOverviewSchema'; export * from './applicationSchema'; export * from './applicationUsageSchema'; export * from './applicationsSchema'; @@ -567,6 +571,8 @@ export * from './getAllToggles403'; export * from './getApiTokensByName401'; export * from './getApiTokensByName403'; export * from './getApplication404'; +export * from './getApplicationOverview404'; +export * from './getApplicationsParams'; export * from './getArchivedFeatures401'; export * from './getArchivedFeatures403'; export * from './getArchivedFeaturesByProjectId401'; diff --git a/frontend/src/openapi/models/observableEventSchema.ts b/frontend/src/openapi/models/observableEventSchema.ts index eb56ba7fa2..c730780c68 100644 --- a/frontend/src/openapi/models/observableEventSchema.ts +++ b/frontend/src/openapi/models/observableEventSchema.ts @@ -13,7 +13,7 @@ export interface ObservableEventSchema { /** The date and time of when the observable event was created. */ createdAt: string; /** The ID of the incoming webhook token that created this observable event. Only present if the observable event was created by an incoming webhook. */ - createdByIncomingWebhookTokenId?: number; + createdByIncomingWebhookTokenId?: number | null; /** The observable event's ID. Observable event IDs are incrementing integers. In other words, a more recently created observable event will always have a higher ID than an older one. */ id: number; /** The payload of the observable event. */