Skip to content

Commit

Permalink
chore: generate frontend openapi types (#5988)
Browse files Browse the repository at this point in the history
Update for dashboard types
  • Loading branch information
Tymek committed Jan 22, 2024
1 parent fd91cd1 commit b7483e8
Show file tree
Hide file tree
Showing 23 changed files with 184 additions and 36 deletions.
24 changes: 24 additions & 0 deletions frontend/src/openapi/models/actionSchema.ts
@@ -0,0 +1,24 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ActionSchemaExecutionParams } from './actionSchemaExecutionParams';

/**
* Represents a single action response
*/
export interface ActionSchema {
/** The name of the action to execute */
action: string;
/** The date and time of when the action was created. */
createdAt: string;
/** The id of user that created this action set */
createdByUserId: number;
/** A map of parameters to pass to the action */
executionParams?: ActionSchemaExecutionParams;
/** The id of the action set */
id: number;
/** The order in which the action should be executed */
sortOrder: number;
}
Expand Up @@ -7,4 +7,4 @@
/**
* A map of parameters to pass to the action
*/
export type ActionsSchemaActionsItemParams = { [key: string]: any };
export type ActionSchemaExecutionParams = { [key: string]: any };
12 changes: 9 additions & 3 deletions frontend/src/openapi/models/actionsSchema.ts
Expand Up @@ -3,21 +3,27 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ActionsSchemaActionsItem } from './actionsSchemaActionsItem';
import type { ActionSchema } from './actionSchema';
import type { ActionsSchemaMatch } from './actionsSchemaMatch';

/**
* A response model with an identifiable action set.
*/
export interface ActionsSchema {
/** The list of actions to execute in sequential order when the action set is triggered */
actions: ActionsSchemaActionsItem[];
actions: ActionSchema[];
/** The id of the service account that will execute the action */
actor: number;
actorId: number;
/** The date and time of when the action was created. */
createdAt?: string;
/** The id of user that created this action set */
createdByUserId?: number;
/** The id of the action set */
id: number;
/** Defines a matching rule for the observable event that will trigger the action set */
match: ActionsSchemaMatch;
/** The name of the action set */
name: string;
/** The project of the action set is added to */
project: string;
}
2 changes: 1 addition & 1 deletion frontend/src/openapi/models/actionsSchemaMatch.ts
Expand Up @@ -14,5 +14,5 @@ export type ActionsSchemaMatch = {
/** Match the source of the observable event */
source: string;
/** Match the source id of the observable event */
sourceId: string;
sourceId: number;
};
Expand Up @@ -9,7 +9,7 @@ import type { ChangeRequestScheduleSchemaOneOfFiveStatus } from './changeRequest
* A suspended schedule for a change request.
*/
export type ChangeRequestScheduleSchemaOneOfFive = {
/** Why the scheduled was suspended. */
/** Why the schedule was suspended. */
reason: string;
/** When Unleash would have attempted to apply this change request if the schedule was not suspended. */
scheduledAt: string;
Expand Down
Expand Up @@ -3,13 +3,16 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ActionsSchemaActionsItemParams } from './actionsSchemaActionsItemParams';
import type { CreateActionSchemaExecutionParams } from './createActionSchemaExecutionParams';

export type ActionsSchemaActionsItem = {
/**
* Represents a single action
*/
export interface CreateActionSchema {
/** The name of the action to execute */
action: string;
/** A map of parameters to pass to the action */
params?: ActionsSchemaActionsItemParams;
executionParams?: CreateActionSchemaExecutionParams;
/** The order in which the action should be executed */
sortOrder: number;
};
}
Expand Up @@ -7,4 +7,4 @@
/**
* A map of parameters to pass to the action
*/
export type CreateActionsSchemaActionsItemParams = { [key: string]: any };
export type CreateActionSchemaExecutionParams = { [key: string]: any };
8 changes: 5 additions & 3 deletions frontend/src/openapi/models/createActionsSchema.ts
Expand Up @@ -3,19 +3,21 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { CreateActionsSchemaActionsItem } from './createActionsSchemaActionsItem';
import type { CreateActionSchema } from './createActionSchema';
import type { CreateActionsSchemaMatch } from './createActionsSchemaMatch';

/**
* An action set defines actions that Unleash performs when an observable event is matched.
*/
export interface CreateActionsSchema {
/** The list of actions to execute in sequential order when the action set is triggered */
actions: CreateActionsSchemaActionsItem[];
actions: CreateActionSchema[];
/** The id of the service account that will execute the action */
actor: number;
actorId: number;
/** Defines a matching rule for the observable event that will trigger the action set */
match: CreateActionsSchemaMatch;
/** The name of the action set */
name: string;
/** The project of the action set is added to */
project: string;
}
15 changes: 0 additions & 15 deletions frontend/src/openapi/models/createActionsSchemaActionsItem.ts

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/openapi/models/createActionsSchemaMatch.ts
Expand Up @@ -14,5 +14,5 @@ export type CreateActionsSchemaMatch = {
/** Match the source of the observable event */
source: string;
/** Match the source id of the observable event */
sourceId: string;
sourceId: number;
};
4 changes: 3 additions & 1 deletion frontend/src/openapi/models/eventSchemaType.ts
Expand Up @@ -117,7 +117,6 @@ export const EventSchemaType = {
'change-request-approval-added': 'change-request-approval-added',
'change-request-cancelled': 'change-request-cancelled',
'change-request-sent-to-review': 'change-request-sent-to-review',
'scheduled-change-request-executed': 'scheduled-change-request-executed',
'change-request-schedule-suspended': 'change-request-schedule-suspended',
'change-request-applied': 'change-request-applied',
'change-request-scheduled': 'change-request-scheduled',
Expand Down Expand Up @@ -156,4 +155,7 @@ export const EventSchemaType = {
'incoming-webhook-token-created': 'incoming-webhook-token-created',
'incoming-webhook-token-updated': 'incoming-webhook-token-updated',
'incoming-webhook-token-deleted': 'incoming-webhook-token-deleted',
'actions-created': 'actions-created',
'actions-updated': 'actions-updated',
'actions-deleted': 'actions-deleted',
} as const;
22 changes: 22 additions & 0 deletions frontend/src/openapi/models/executiveSummarySchema.ts
@@ -0,0 +1,22 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ExecutiveSummarySchemaFlagsTrendsItem } from './executiveSummarySchemaFlagsTrendsItem';
import type { ExecutiveSummarySchemaUserStats } from './executiveSummarySchemaUserStats';
import type { ExecutiveSummarySchemaUserTrendsItem } from './executiveSummarySchemaUserTrendsItem';

/**
* Executive summary of Unleash usage
*/
export interface ExecutiveSummarySchema {
/** How number of flags changed over time */
flagsTrends: ExecutiveSummarySchemaFlagsTrendsItem[];
/** The type of single-sign option configured for the Unleash instance */
ssoType?: string;
/** High level user count statistics */
userStats: ExecutiveSummarySchemaUserStats;
/** How number of users changed over time */
userTrends: ExecutiveSummarySchemaUserTrendsItem[];
}
@@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

export type ExecutiveSummarySchemaFlagsTrendsItem = {
/** The number of non-archived flags on a particular day */
active: number;
/** The number of archived flags on a particular day */
archived: number;
/** A UTC date when the stats were captured. Time is the very end of a given day. */
date: string;
/** The number of all flags on a particular day */
total: number;
};
22 changes: 22 additions & 0 deletions frontend/src/openapi/models/executiveSummarySchemaUserStats.ts
@@ -0,0 +1,22 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ExecutiveSummarySchemaUserStatsRoles } from './executiveSummarySchemaUserStatsRoles';

/**
* High level user count statistics
*/
export type ExecutiveSummarySchemaUserStats = {
/** The number of active Unleash users who have logged in in the past 90 days */
active: number;
/** The number of inactive Unleash users who have not logged in in the past 90 days. */
inactive: number;
/** The number of users licensed to use Unleash */
licensed: number;
/** The number of users with a given [root role](https://docs.getunleash.io/reference/rbac#predefined-roles) */
roles: ExecutiveSummarySchemaUserStatsRoles;
/** The number of actual Unleash users */
total: number;
};
@@ -0,0 +1,17 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

/**
* The number of users with a given [root role](https://docs.getunleash.io/reference/rbac#predefined-roles)
*/
export type ExecutiveSummarySchemaUserStatsRoles = {
/** The number of users with the `admin` root role */
admin: number;
/** The number of users with the `editor` root role */
editor: number;
/** The number of users with the `viewer` root role */
viewer: number;
};
@@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

export type ExecutiveSummarySchemaUserTrendsItem = {
/** The number of active Unleash users on a particular day */
active: number;
/** A UTC date when the stats were captured. Time is the very end of a given day. */
date: string;
/** The number of inactive Unleash users on a particular day */
inactive: number;
/** The number of actual Unleash users on a particular day */
total: number;
};
3 changes: 3 additions & 0 deletions frontend/src/openapi/models/incomingWebhookSchema.ts
Expand Up @@ -3,6 +3,7 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { IncomingWebhookTokenSchema } from './incomingWebhookTokenSchema';

/**
* An object describing an incoming webhook.
Expand All @@ -20,6 +21,8 @@ export interface IncomingWebhookSchema {
id: number;
/** The incoming webhook name. Must be URL-safe. */
name: string;
/** The list of tokens associated with the incoming webhook. */
tokens?: IncomingWebhookTokenSchema[];
/** The full URL that should be used to call the incoming webhook. This property is only returned for newly created or updated incoming webhooks. */
url?: string;
}
14 changes: 10 additions & 4 deletions frontend/src/openapi/models/index.ts
Expand Up @@ -7,10 +7,10 @@
export * from './_exportFormat';
export * from './_exportParams';
export * from './accessOverviewSchema';
export * from './actionSchema';
export * from './actionSchemaExecutionParams';
export * from './actionsListSchema';
export * from './actionsSchema';
export * from './actionsSchemaActionsItem';
export * from './actionsSchemaActionsItemParams';
export * from './actionsSchemaMatch';
export * from './actionsSchemaMatchPayload';
export * from './addAccessToProject400';
Expand Down Expand Up @@ -290,9 +290,9 @@ export * from './contextFieldSchema';
export * from './contextFieldStrategiesSchema';
export * from './contextFieldStrategiesSchemaStrategiesItem';
export * from './contextFieldsSchema';
export * from './createActionSchema';
export * from './createActionSchemaExecutionParams';
export * from './createActionsSchema';
export * from './createActionsSchemaActionsItem';
export * from './createActionsSchemaActionsItemParams';
export * from './createActionsSchemaMatch';
export * from './createActionsSchemaMatchPayload';
export * from './createAddon400';
Expand Down Expand Up @@ -494,6 +494,11 @@ export * from './eventSchemaPreData';
export * from './eventSchemaType';
export * from './eventsSchema';
export * from './eventsSchemaVersion';
export * from './executiveSummarySchema';
export * from './executiveSummarySchemaFlagsTrendsItem';
export * from './executiveSummarySchemaUserStats';
export * from './executiveSummarySchemaUserStatsRoles';
export * from './executiveSummarySchemaUserTrendsItem';
export * from './exportFeatures404';
export * from './exportQuerySchema';
export * from './exportQuerySchemaAnyOf';
Expand Down Expand Up @@ -705,6 +710,7 @@ export * from './instanceAdminStatsSchema';
export * from './instanceAdminStatsSchemaActiveUsers';
export * from './instanceAdminStatsSchemaClientAppsItem';
export * from './instanceAdminStatsSchemaClientAppsItemRange';
export * from './instanceAdminStatsSchemaPreviousDayMetricsBucketsCount';
export * from './instanceAdminStatsSchemaProductionChanges';
export * from './invoicesSchema';
export * from './invoicesSchemaItem';
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/openapi/models/instanceAdminStatsSchema.ts
Expand Up @@ -5,6 +5,7 @@
*/
import type { InstanceAdminStatsSchemaActiveUsers } from './instanceAdminStatsSchemaActiveUsers';
import type { InstanceAdminStatsSchemaClientAppsItem } from './instanceAdminStatsSchemaClientAppsItem';
import type { InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount } from './instanceAdminStatsSchemaPreviousDayMetricsBucketsCount';
import type { InstanceAdminStatsSchemaProductionChanges } from './instanceAdminStatsSchemaProductionChanges';

/**
Expand All @@ -31,6 +32,8 @@ export interface InstanceAdminStatsSchema {
instanceId: string;
/** Whether or not OIDC authentication is enabled for this instance */
OIDCenabled?: boolean;
/** The number client metrics buckets records recorded in the previous day. # features * # apps * # envs * # hours with metrics */
previousDayMetricsBucketsCount?: InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount;
/** The number of changes to the production environment in the last 30, 60 and 90 days */
productionChanges?: InstanceAdminStatsSchemaProductionChanges;
/** The number of projects defined in this instance. */
Expand Down
@@ -0,0 +1,15 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

/**
* The number client metrics buckets records recorded in the previous day. # features * # apps * # envs * # hours with metrics
*/
export type InstanceAdminStatsSchemaPreviousDayMetricsBucketsCount = {
/** The number of enabled/disabled metrics buckets recorded in the previous day */
enabledCount?: number;
/** The number of variant metrics buckets recorded in the previous day */
variantCount?: number;
};
2 changes: 2 additions & 0 deletions frontend/src/openapi/models/oidcSettingsSchema.ts
Expand Up @@ -20,6 +20,8 @@ export interface OidcSettingsSchema {
clientId: string;
/** [Default role](https://docs.getunleash.io/reference/rbac#standard-roles) granted to users auto-created from email. Only relevant if autoCreate is `true` */
defaultRootRole?: OidcSettingsSchemaDefaultRootRole;
/** Assign this root role to auto created users. Should be a role ID and takes precedence over `defaultRootRole`. */
defaultRootRoleId?: number;
/** The [.well-known OpenID discover URL](https://swagger.io/docs/specification/authentication/openid-connect-discovery/) */
discoverUrl?: string;
/** Comma separated list of email domains that are automatically approved for an account in the server. Only relevant if autoCreate is `true` */
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/openapi/models/samlSettingsSchema.ts
Expand Up @@ -15,6 +15,8 @@ export interface SamlSettingsSchema {
certificate: string;
/** Assign this root role to auto created users */
defaultRootRole?: SamlSettingsSchemaDefaultRootRole;
/** Assign this root role to auto created users. Should be a role ID and takes precedence over `defaultRootRole`. */
defaultRootRoleId?: number;
/** A comma separated list of email domains that Unleash will auto create user accounts for. */
emailDomains?: string;
/** Is SAML authentication enabled */
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/openapi/models/searchEventsSchemaType.ts
Expand Up @@ -117,7 +117,6 @@ export const SearchEventsSchemaType = {
'change-request-approval-added': 'change-request-approval-added',
'change-request-cancelled': 'change-request-cancelled',
'change-request-sent-to-review': 'change-request-sent-to-review',
'scheduled-change-request-executed': 'scheduled-change-request-executed',
'change-request-schedule-suspended': 'change-request-schedule-suspended',
'change-request-applied': 'change-request-applied',
'change-request-scheduled': 'change-request-scheduled',
Expand Down Expand Up @@ -156,4 +155,7 @@ export const SearchEventsSchemaType = {
'incoming-webhook-token-created': 'incoming-webhook-token-created',
'incoming-webhook-token-updated': 'incoming-webhook-token-updated',
'incoming-webhook-token-deleted': 'incoming-webhook-token-deleted',
'actions-created': 'actions-created',
'actions-updated': 'actions-updated',
'actions-deleted': 'actions-deleted',
} as const;

0 comments on commit b7483e8

Please sign in to comment.