diff --git a/client/openapi/trustd.yaml b/client/openapi/trustd.yaml index 9a623567..5a565064 100644 --- a/client/openapi/trustd.yaml +++ b/client/openapi/trustd.yaml @@ -1798,6 +1798,97 @@ paths: format: binary '404': description: The document could not be found + /api/v1/userPreference/{key}: + get: + tags: + - userPreferences + summary: Get user preferences + operationId: getUserPreferences + parameters: + - name: key + in: path + description: The key to the user preferences + required: true + schema: + type: string + responses: + '200': + description: User preference stored under this key + headers: + etag: + schema: + type: string + description: Revision ID + content: + application/json: + schema: {} + '404': + description: Unknown user preference key + put: + tags: + - userPreferences + summary: Set user preferences + operationId: setUserPreferences + parameters: + - name: key + in: path + description: The key to the user preferences + required: true + schema: + type: string + - name: if-match + in: header + description: The revision to update + required: false + schema: + type: + - string + - 'null' + requestBody: + content: + application/json: + schema: {} + required: true + responses: + '200': + description: User preference stored under this key + headers: + etag: + schema: + type: string + description: Revision ID + '412': + description: The provided If-Match revision did not match the actual revision + delete: + tags: + - userPreferences + summary: Delete user preferences + operationId: deleteUserPreferences + parameters: + - name: key + in: path + description: The key to the user preferences + required: true + schema: + type: string + - name: if-match + in: header + description: The revision to delete + required: false + schema: + type: + - string + - 'null' + requestBody: + content: + application/json: + schema: {} + required: true + responses: + '201': + description: User preferences are deleted + '412': + description: The provided If-Match revision did not match the actual revision /api/v1/vulnerability: get: tags: diff --git a/client/src/app/client/services.gen.ts b/client/src/app/client/services.gen.ts index 572fce35..2b37eab8 100644 --- a/client/src/app/client/services.gen.ts +++ b/client/src/app/client/services.gen.ts @@ -174,6 +174,15 @@ import type { DownloadSbomData, DownloadSbomError, DownloadSbomResponse, + GetUserPreferencesData, + GetUserPreferencesError, + GetUserPreferencesResponse, + SetUserPreferencesData, + SetUserPreferencesError, + SetUserPreferencesResponse, + DeleteUserPreferencesData, + DeleteUserPreferencesError, + DeleteUserPreferencesResponse, ListVulnerabilitiesData, ListVulnerabilitiesError, ListVulnerabilitiesResponse, @@ -1073,6 +1082,54 @@ export const downloadSbom = ( }); }; +/** + * Get user preferences + */ +export const getUserPreferences = ( + options: Options +) => { + return (options?.client ?? client).get< + GetUserPreferencesResponse, + GetUserPreferencesError, + ThrowOnError + >({ + ...options, + url: "/api/v1/userPreference/{key}", + }); +}; + +/** + * Set user preferences + */ +export const setUserPreferences = ( + options: Options +) => { + return (options?.client ?? client).put< + SetUserPreferencesResponse, + SetUserPreferencesError, + ThrowOnError + >({ + ...options, + url: "/api/v1/userPreference/{key}", + }); +}; + +/** + * Delete user preferences + */ +export const deleteUserPreferences = ( + options: Options +) => { + return (options?.client ?? client).delete< + DeleteUserPreferencesResponse, + DeleteUserPreferencesError, + ThrowOnError + >({ + ...options, + url: "/api/v1/userPreference/{key}", + }); +}; + /** * List vulnerabilities */ diff --git a/client/src/app/client/types.gen.ts b/client/src/app/client/types.gen.ts index 543d96ea..efffbfa0 100644 --- a/client/src/app/client/types.gen.ts +++ b/client/src/app/client/types.gen.ts @@ -1906,6 +1906,59 @@ export type DownloadSbomResponse = Blob | File; export type DownloadSbomError = unknown; +export type GetUserPreferencesData = { + path: { + /** + * The key to the user preferences + */ + key: string; + }; +}; + +export type GetUserPreferencesResponse = unknown; + +export type GetUserPreferencesError = unknown; + +export type SetUserPreferencesData = { + body: unknown; + headers?: { + /** + * The revision to update + */ + "if-match"?: string | null; + }; + path: { + /** + * The key to the user preferences + */ + key: string; + }; +}; + +export type SetUserPreferencesResponse = string; + +export type SetUserPreferencesError = unknown; + +export type DeleteUserPreferencesData = { + body: unknown; + headers?: { + /** + * The revision to delete + */ + "if-match"?: string | null; + }; + path: { + /** + * The key to the user preferences + */ + key: string; + }; +}; + +export type DeleteUserPreferencesResponse = unknown; + +export type DeleteUserPreferencesError = unknown; + export type ListVulnerabilitiesData = { query?: { /**