Skip to content

Commit

Permalink
Update the Typescript types from the API
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
  • Loading branch information
abompard committed Nov 8, 2023
1 parent e1aed25 commit 31be677
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 69 deletions.
92 changes: 27 additions & 65 deletions frontend/src/api/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface components {
name: "artifacts-followed";
/** Params */
params: {
[key: string]: string | undefined;
[key: string]: string;
}[];
};
/** Destination */
Expand All @@ -115,7 +115,7 @@ export interface components {
address: string;
};
/** Filters */
FiltersInput: {
Filters: {
/**
* Applications
* @default []
Expand All @@ -134,41 +134,13 @@ export interface components {
*/
my_actions?: boolean;
};
/** Filters */
FiltersOutput: {
/**
* Applications
* @default []
*/
applications: string[];
/**
* Severities
* @default []
*/
severities: string[];
/** Topic */
topic: string | null;
/**
* My Actions
* @default false
*/
my_actions: boolean;
};
/** GenerationRule */
GenerationRuleInput: {
GenerationRule: {
/** Id */
id?: number | null;
/** Destinations */
destinations: components["schemas"]["Destination"][];
filters: components["schemas"]["FiltersInput"];
};
/** GenerationRule */
GenerationRuleOutput: {
/** Id */
id: number | null;
/** Destinations */
destinations: components["schemas"]["Destination"][];
filters: components["schemas"]["FiltersOutput"];
filters: components["schemas"]["Filters"];
};
/** HTTPValidationError */
HTTPValidationError: {
Expand Down Expand Up @@ -200,7 +172,7 @@ export interface components {
| components["schemas"]["NoParamTrackingRule"]
| components["schemas"]["ArtifactsFollowedTrackingRule"];
/** Generation Rules */
generation_rules: components["schemas"]["GenerationRuleInput"][];
generation_rules: components["schemas"]["GenerationRule"][];
};
/** NoParamTrackingRule */
NoParamTrackingRule: {
Expand All @@ -210,10 +182,10 @@ export interface components {
*/
name: "related-events";
/** Params */
params: string | null;
params?: string | null;
};
/** Rule */
RuleInput: {
"Rule-Input": {
/** Name */
name?: string | null;
/**
Expand All @@ -227,48 +199,48 @@ export interface components {
| components["schemas"]["NoParamTrackingRule"]
| components["schemas"]["ArtifactsFollowedTrackingRule"];
/** Generation Rules */
generation_rules: components["schemas"]["GenerationRuleInput"][];
generation_rules: components["schemas"]["GenerationRule"][];
/** Id */
id: number;
user: components["schemas"]["UserInput"];
user: components["schemas"]["User"];
/**
* Generated Last Week
* @default 0
*/
generated_last_week?: number;
};
/** Rule */
RuleOutput: {
"Rule-Output": {
/** Name */
name: string | null;
name?: string | null;
/**
* Disabled
* @default false
*/
disabled: boolean;
disabled?: boolean;
/** Tracking Rule */
tracking_rule:
| components["schemas"]["ListParamTrackingRule"]
| components["schemas"]["NoParamTrackingRule"]
| components["schemas"]["ArtifactsFollowedTrackingRule"];
/** Generation Rules */
generation_rules: components["schemas"]["GenerationRuleOutput"][];
generation_rules: components["schemas"]["GenerationRule"][];
/** Id */
id: number;
user: components["schemas"]["UserOutput"];
user: components["schemas"]["User"];
/**
* Generated Last Week
* @default 0
*/
generated_last_week: number;
generated_last_week?: number;
};
/** RulePatch */
RulePatch: {
/** Disabled */
disabled?: boolean | null;
};
/** User */
UserInput: {
User: {
/** Id */
id?: number | null;
/** Name */
Expand All @@ -279,18 +251,6 @@ export interface components {
*/
is_admin?: boolean;
};
/** User */
UserOutput: {
/** Id */
id: number | null;
/** Name */
name: string;
/**
* Is Admin
* @default false
*/
is_admin: boolean;
};
/** ValidationError */
ValidationError: {
/** Location */
Expand All @@ -308,6 +268,8 @@ export interface components {
pathItems: never;
}

export type $defs = Record<string, never>;

export type external = Record<string, never>;

export interface operations {
Expand All @@ -317,7 +279,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["UserOutput"];
"application/json": components["schemas"]["User"];
};
};
};
Expand Down Expand Up @@ -421,7 +383,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["RuleOutput"][];
"application/json": components["schemas"]["Rule-Output"][];
};
};
/** @description Validation Error */
Expand All @@ -448,7 +410,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["RuleOutput"];
"application/json": components["schemas"]["Rule-Output"];
};
};
/** @description Validation Error */
Expand All @@ -471,7 +433,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["RuleOutput"];
"application/json": components["schemas"]["Rule-Output"];
};
};
/** @description Validation Error */
Expand All @@ -492,14 +454,14 @@ export interface operations {
};
requestBody: {
content: {
"application/json": components["schemas"]["RuleInput"];
"application/json": components["schemas"]["Rule-Input"];
};
};
responses: {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["RuleOutput"];
"application/json": components["schemas"]["Rule-Output"];
};
};
/** @description Validation Error */
Expand Down Expand Up @@ -614,7 +576,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["RuleOutput"][];
"application/json": components["schemas"]["Rule-Output"][];
};
};
/** @description Validation Error */
Expand All @@ -636,7 +598,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["UserOutput"][];
"application/json": components["schemas"]["User"][];
};
};
/** @description Validation Error */
Expand All @@ -663,7 +625,7 @@ export interface operations {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["RuleOutput"];
"application/json": components["schemas"]["Rule-Output"];
};
};
/** @description Validation Error */
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export type Severity =
| typeof ERROR;

export type Destination = components["schemas"]["Destination"];
export type Filters = components["schemas"]["FiltersOutput"];
export type User = components["schemas"]["UserOutput"];
export type Filters = components["schemas"]["Filters"];
export type User = components["schemas"]["User"];
export type Artifact = components["schemas"]["Artifact"];
export type GenerationRule = components["schemas"]["GenerationRuleOutput"];
export type Rule = components["schemas"]["RuleOutput"];
export type GenerationRule = components["schemas"]["GenerationRule"];
export type Rule = components["schemas"]["Rule-Output"];
export type NewRule = components["schemas"]["NewRule"];
export type RulePatch = components["schemas"]["RulePatch"];
export type HTTPValidationError = components["schemas"]["HTTPValidationError"];
Expand Down

0 comments on commit 31be677

Please sign in to comment.