diff --git a/frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts b/frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts index eda954d196..e62f8c5af0 100644 --- a/frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts +++ b/frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts @@ -33,6 +33,7 @@ export const useExecutiveDashboard = ( userTrends: [], flagTrends: [], projectFlagTrends: [], + impressionsSummary: [], }, refetchExecutiveDashboard, loading: !error && !data, diff --git a/frontend/src/openapi/models/actionEventSchema.ts b/frontend/src/openapi/models/actionEventSchema.ts new file mode 100644 index 0000000000..1bb7ceb795 --- /dev/null +++ b/frontend/src/openapi/models/actionEventSchema.ts @@ -0,0 +1,26 @@ +/** + * Generated by Orval + * 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'; + +/** + * 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. */ + 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; +} diff --git a/frontend/src/openapi/models/actionEventSchemaPayload.ts b/frontend/src/openapi/models/actionEventSchemaPayload.ts new file mode 100644 index 0000000000..09b5c589b6 --- /dev/null +++ b/frontend/src/openapi/models/actionEventSchemaPayload.ts @@ -0,0 +1,10 @@ +/** + * 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 new file mode 100644 index 0000000000..5e704f9c76 --- /dev/null +++ b/frontend/src/openapi/models/actionEventSchemaSource.ts @@ -0,0 +1,16 @@ +/** + * 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/actionEventsSchema.ts b/frontend/src/openapi/models/actionEventsSchema.ts new file mode 100644 index 0000000000..e261a83a6f --- /dev/null +++ b/frontend/src/openapi/models/actionEventsSchema.ts @@ -0,0 +1,14 @@ +/** + * 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/actionStateSchema.ts b/frontend/src/openapi/models/actionStateSchema.ts new file mode 100644 index 0000000000..03a7e68bf1 --- /dev/null +++ b/frontend/src/openapi/models/actionStateSchema.ts @@ -0,0 +1,25 @@ +/** + * 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/actionStateSchemaExecutionParams.ts b/frontend/src/openapi/models/actionStateSchemaExecutionParams.ts new file mode 100644 index 0000000000..8043d0d54d --- /dev/null +++ b/frontend/src/openapi/models/actionStateSchemaExecutionParams.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * A map of parameters to pass to the action + */ +export type ActionStateSchemaExecutionParams = { [key: string]: any }; diff --git a/frontend/src/openapi/models/actionStateSchemaState.ts b/frontend/src/openapi/models/actionStateSchemaState.ts new file mode 100644 index 0000000000..13ff5ca32d --- /dev/null +++ b/frontend/src/openapi/models/actionStateSchemaState.ts @@ -0,0 +1,18 @@ +/** + * 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/executiveSummarySchema.ts b/frontend/src/openapi/models/executiveSummarySchema.ts index 65dcad10bc..73b32728a4 100644 --- a/frontend/src/openapi/models/executiveSummarySchema.ts +++ b/frontend/src/openapi/models/executiveSummarySchema.ts @@ -5,6 +5,7 @@ */ import type { ExecutiveSummarySchemaFlags } from './executiveSummarySchemaFlags'; import type { ExecutiveSummarySchemaFlagTrendsItem } from './executiveSummarySchemaFlagTrendsItem'; +import type { ExecutiveSummarySchemaImpressionsSummaryItem } from './executiveSummarySchemaImpressionsSummaryItem'; import type { ExecutiveSummarySchemaProjectFlagTrendsItem } from './executiveSummarySchemaProjectFlagTrendsItem'; import type { ExecutiveSummarySchemaUsers } from './executiveSummarySchemaUsers'; import type { ExecutiveSummarySchemaUserTrendsItem } from './executiveSummarySchemaUserTrendsItem'; @@ -17,6 +18,8 @@ export interface ExecutiveSummarySchema { flags: ExecutiveSummarySchemaFlags; /** How number of flags changed over time */ flagTrends: ExecutiveSummarySchemaFlagTrendsItem[]; + /** How impression data per project changed over time */ + impressionsSummary: ExecutiveSummarySchemaImpressionsSummaryItem[]; /** How number of flags per project changed over time */ projectFlagTrends: ExecutiveSummarySchemaProjectFlagTrendsItem[]; /** High level user count statistics */ diff --git a/frontend/src/openapi/models/executiveSummarySchemaImpressionsSummaryItem.ts b/frontend/src/openapi/models/executiveSummarySchemaImpressionsSummaryItem.ts new file mode 100644 index 0000000000..23c2aeb03a --- /dev/null +++ b/frontend/src/openapi/models/executiveSummarySchemaImpressionsSummaryItem.ts @@ -0,0 +1,22 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type ExecutiveSummarySchemaImpressionsSummaryItem = { + /** Date the impressions summary were calculated */ + date: string; + /** Project id of the project the impressions summary belong to */ + project: string; + /** Total number of applications the impression data belong to */ + totalApps: number; + /** Total number of environments the impression data belong to */ + totalEnvironments: number; + /** Total number of flags the impression data belong to */ + totalFlags: number; + /** Total number of times all project flags were not exposed across all environments */ + totalNo: number; + /** Total number of times all project flags were exposed across all environments */ + totalYes: number; +}; diff --git a/frontend/src/openapi/models/getProjectApplicationsParams.ts b/frontend/src/openapi/models/getProjectApplicationsParams.ts index a12efff4b8..105791b3c6 100644 --- a/frontend/src/openapi/models/getProjectApplicationsParams.ts +++ b/frontend/src/openapi/models/getProjectApplicationsParams.ts @@ -18,7 +18,7 @@ export type GetProjectApplicationsParams = { */ limit?: string; /** - * The field to sort the results by. By default it is set to "createdAt". + * The field to sort the results by. By default it is set to "appName". */ sortBy?: string; /** diff --git a/frontend/src/openapi/models/getUserPermissions401.ts b/frontend/src/openapi/models/getUserPermissions401.ts new file mode 100644 index 0000000000..4d809ff947 --- /dev/null +++ b/frontend/src/openapi/models/getUserPermissions401.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserPermissions401 = { + /** 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/getUserPermissions403.ts b/frontend/src/openapi/models/getUserPermissions403.ts new file mode 100644 index 0000000000..adb9b15cd9 --- /dev/null +++ b/frontend/src/openapi/models/getUserPermissions403.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserPermissions403 = { + /** 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/getUserPermissions415.ts b/frontend/src/openapi/models/getUserPermissions415.ts new file mode 100644 index 0000000000..2106c09f51 --- /dev/null +++ b/frontend/src/openapi/models/getUserPermissions415.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserPermissions415 = { + /** 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/getUserPermissionsParams.ts b/frontend/src/openapi/models/getUserPermissionsParams.ts new file mode 100644 index 0000000000..8c2afbcf7f --- /dev/null +++ b/frontend/src/openapi/models/getUserPermissionsParams.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserPermissionsParams = { + project?: string; + environment?: string; +}; diff --git a/frontend/src/openapi/models/getUserRoles401.ts b/frontend/src/openapi/models/getUserRoles401.ts new file mode 100644 index 0000000000..6da46d2668 --- /dev/null +++ b/frontend/src/openapi/models/getUserRoles401.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserRoles401 = { + /** 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/getUserRoles403.ts b/frontend/src/openapi/models/getUserRoles403.ts new file mode 100644 index 0000000000..4928ea1af6 --- /dev/null +++ b/frontend/src/openapi/models/getUserRoles403.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserRoles403 = { + /** 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/getUserRolesParams.ts b/frontend/src/openapi/models/getUserRolesParams.ts new file mode 100644 index 0000000000..3d4957cb32 --- /dev/null +++ b/frontend/src/openapi/models/getUserRolesParams.ts @@ -0,0 +1,12 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetUserRolesParams = { + /** + * The id of the project you want to check permissions for + */ + projectId?: string; +}; diff --git a/frontend/src/openapi/models/incomingWebhookEventSchema.ts b/frontend/src/openapi/models/incomingWebhookEventSchema.ts new file mode 100644 index 0000000000..a7674cadf1 --- /dev/null +++ b/frontend/src/openapi/models/incomingWebhookEventSchema.ts @@ -0,0 +1,25 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { IncomingWebhookEventSchemaPayload } from './incomingWebhookEventSchemaPayload'; +import type { IncomingWebhookEventSchemaSource } from './incomingWebhookEventSchemaSource'; + +/** + * An object describing an incoming webhook event. + */ +export interface IncomingWebhookEventSchema { + /** The date and time of when the observable event 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?: IncomingWebhookEventSchemaPayload; + /** The observable event source type. Should be used along with `sourceId` to uniquely identify the resource that created this observable event. */ + source: IncomingWebhookEventSchemaSource; + /** 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 name of the token used to register this incoming webhook event. */ + tokenName?: string | null; +} diff --git a/frontend/src/openapi/models/incomingWebhookEventSchemaPayload.ts b/frontend/src/openapi/models/incomingWebhookEventSchemaPayload.ts new file mode 100644 index 0000000000..eab0799f6b --- /dev/null +++ b/frontend/src/openapi/models/incomingWebhookEventSchemaPayload.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * The payload of the observable event. + */ +export type IncomingWebhookEventSchemaPayload = { [key: string]: any }; diff --git a/frontend/src/openapi/models/incomingWebhookEventSchemaSource.ts b/frontend/src/openapi/models/incomingWebhookEventSchemaSource.ts new file mode 100644 index 0000000000..7f06d7712b --- /dev/null +++ b/frontend/src/openapi/models/incomingWebhookEventSchemaSource.ts @@ -0,0 +1,16 @@ +/** + * 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 IncomingWebhookEventSchemaSource = + (typeof IncomingWebhookEventSchemaSource)[keyof typeof IncomingWebhookEventSchemaSource]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const IncomingWebhookEventSchemaSource = { + 'incoming-webhook': 'incoming-webhook', +} as const; diff --git a/frontend/src/openapi/models/incomingWebhookEventsSchema.ts b/frontend/src/openapi/models/incomingWebhookEventsSchema.ts new file mode 100644 index 0000000000..49825984c5 --- /dev/null +++ b/frontend/src/openapi/models/incomingWebhookEventsSchema.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { IncomingWebhookEventSchema } from './incomingWebhookEventSchema'; + +/** + * A response model with a list of incoming webhook events. + */ +export interface IncomingWebhookEventsSchema { + /** A list of incoming webhook events. */ + incomingWebhookEvents: IncomingWebhookEventSchema[]; +} diff --git a/frontend/src/openapi/models/index.ts b/frontend/src/openapi/models/index.ts index 0244d39115..80df65f30c 100644 --- a/frontend/src/openapi/models/index.ts +++ b/frontend/src/openapi/models/index.ts @@ -7,8 +7,15 @@ export * from './_exportFormat'; export * from './_exportParams'; export * from './accessOverviewSchema'; +export * from './actionEventSchema'; +export * from './actionEventSchemaPayload'; +export * from './actionEventSchemaSource'; +export * from './actionEventsSchema'; export * from './actionSchema'; export * from './actionSchemaExecutionParams'; +export * from './actionStateSchema'; +export * from './actionStateSchemaExecutionParams'; +export * from './actionStateSchemaState'; export * from './actionsListSchema'; export * from './actionsSchema'; export * from './actionsSchemaMatch'; @@ -501,6 +508,7 @@ export * from './eventsSchemaVersion'; export * from './executiveSummarySchema'; export * from './executiveSummarySchemaFlagTrendsItem'; export * from './executiveSummarySchemaFlags'; +export * from './executiveSummarySchemaImpressionsSummaryItem'; export * from './executiveSummarySchemaProjectFlagTrendsItem'; export * from './executiveSummarySchemaUserTrendsItem'; export * from './executiveSummarySchemaUsers'; @@ -690,6 +698,13 @@ export * from './getTagsByType403'; export * from './getUser400'; export * from './getUser401'; export * from './getUser404'; +export * from './getUserPermissions401'; +export * from './getUserPermissions403'; +export * from './getUserPermissions415'; +export * from './getUserPermissionsParams'; +export * from './getUserRoles401'; +export * from './getUserRoles403'; +export * from './getUserRolesParams'; export * from './getUsers401'; export * from './getUsers403'; export * from './getValidTokens400'; @@ -714,6 +729,10 @@ export * from './importTogglesValidateItemSchema'; export * from './importTogglesValidateSchema'; export * from './inactiveUserSchema'; export * from './inactiveUsersSchema'; +export * from './incomingWebhookEventSchema'; +export * from './incomingWebhookEventSchemaPayload'; +export * from './incomingWebhookEventSchemaSource'; +export * from './incomingWebhookEventsSchema'; export * from './incomingWebhookSchema'; export * from './incomingWebhookTokenSchema'; export * from './incomingWebhookTokensSchema'; @@ -919,6 +938,7 @@ export * from './reviveFeatures403'; export * from './roleSchema'; export * from './roleWithPermissionsSchema'; export * from './roleWithVersionSchema'; +export * from './rolesSchema'; export * from './rolesWithVersionSchema'; export * from './samlSettingsSchema'; export * from './samlSettingsSchemaDefaultRootRole'; diff --git a/frontend/src/openapi/models/observableEventsSchema.ts b/frontend/src/openapi/models/observableEventsSchema.ts index 5ae216258d..890502ad2e 100644 --- a/frontend/src/openapi/models/observableEventsSchema.ts +++ b/frontend/src/openapi/models/observableEventsSchema.ts @@ -10,5 +10,5 @@ import type { ObservableEventSchema } from './observableEventSchema'; */ export interface ObservableEventsSchema { /** A list of observable events. */ - observable_events: ObservableEventSchema[]; + observableEvents: ObservableEventSchema[]; } diff --git a/frontend/src/openapi/models/roleSchema.ts b/frontend/src/openapi/models/roleSchema.ts index ba47576795..ad5cf68ed6 100644 --- a/frontend/src/openapi/models/roleSchema.ts +++ b/frontend/src/openapi/models/roleSchema.ts @@ -14,6 +14,8 @@ export interface RoleSchema { id: number; /** The name of the role */ name: string; + /** What project the role belongs to */ + project?: string | null; /** A role can either be a global root role (applies to all projects) or a project role */ type: string; } diff --git a/frontend/src/openapi/models/rolesSchema.ts b/frontend/src/openapi/models/rolesSchema.ts new file mode 100644 index 0000000000..4eb5beb7e4 --- /dev/null +++ b/frontend/src/openapi/models/rolesSchema.ts @@ -0,0 +1,16 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { RoleSchema } from './roleSchema'; + +/** + * A list of roles + */ +export interface RolesSchema { + /** A list of roles */ + roles: RoleSchema[]; + /** The version of the role schema used */ + version: number; +}