From 9ef2e0fce9f2dd2e51a9ad2ade707b84a0a3f5e7 Mon Sep 17 00:00:00 2001 From: "github-merge-queue[bot]" Date: Fri, 22 Nov 2024 12:35:31 +0000 Subject: [PATCH] update client/openapi/trustd.yaml Signed-off-by: GitHub --- client/openapi/trustd.yaml | 62 ++++++++++----------- client/src/app/client/schemas.gen.ts | 80 +++++++++++++++------------- client/src/app/client/types.gen.ts | 20 ++++--- 3 files changed, 83 insertions(+), 79 deletions(-) diff --git a/client/openapi/trustd.yaml b/client/openapi/trustd.yaml index 027059c1..13a08398 100644 --- a/client/openapi/trustd.yaml +++ b/client/openapi/trustd.yaml @@ -5,7 +5,7 @@ info: license: name: Apache License, Version 2.0 identifier: Apache-2.0 - version: 0.1.0-alpha.23 + version: 0.1.0-alpha.24 paths: /.well-known/trustify: get: @@ -2243,6 +2243,7 @@ components: required: - sbom_id - node_id + - relationship - purl - name - version @@ -2253,6 +2254,8 @@ components: type: string purl: type: string + relationship: + type: string sbom_id: type: string version: @@ -3034,17 +3037,11 @@ components: - type: object required: - described_by - - number_of_packages properties: described_by: type: array items: $ref: '#/components/schemas/SbomPackage' - number_of_packages: - type: integer - format: int64 - description: The number of packages this SBOM has - minimum: 0 total: type: integer format: int64 @@ -3344,6 +3341,7 @@ components: - dev_tool_of - described_by - package_of + - undefined Report: type: object required: @@ -3427,6 +3425,7 @@ components: - published - authors - name + - number_of_packages properties: authors: type: array @@ -3444,6 +3443,11 @@ components: $ref: '#/components/schemas/Labels' name: type: string + number_of_packages: + type: integer + format: int64 + description: The number of packages this SBOM has + minimum: 0 published: type: - string @@ -3515,24 +3519,26 @@ components: relationship: $ref: '#/components/schemas/Relationship' SbomStatus: - type: object - required: - - vulnerability_id - - status - - packages - properties: - context: - oneOf: - - type: 'null' - - $ref: '#/components/schemas/StatusContext' - packages: - type: array - items: - $ref: '#/components/schemas/SbomPackage' - status: - type: string - vulnerability_id: - type: string + allOf: + - $ref: '#/components/schemas/VulnerabilityHead' + - type: object + required: + - average_severity + - status + - packages + properties: + average_severity: + $ref: '#/components/schemas/Severity' + context: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/StatusContext' + packages: + type: array + items: + $ref: '#/components/schemas/SbomPackage' + status: + type: string SbomSummary: allOf: - $ref: '#/components/schemas/SbomHead' @@ -3542,17 +3548,11 @@ components: - type: object required: - described_by - - number_of_packages properties: described_by: type: array items: $ref: '#/components/schemas/SbomPackage' - number_of_packages: - type: integer - format: int64 - description: The number of packages this SBOM has - minimum: 0 Severity: type: string description: |- diff --git a/client/src/app/client/schemas.gen.ts b/client/src/app/client/schemas.gen.ts index 3f53d01f..c34110de 100644 --- a/client/src/app/client/schemas.gen.ts +++ b/client/src/app/client/schemas.gen.ts @@ -276,7 +276,7 @@ export const AnalysisStatusSchema = { export const AncNodeSchema = { type: "object", - required: ["sbom_id", "node_id", "purl", "name", "version"], + required: ["sbom_id", "node_id", "relationship", "purl", "name", "version"], properties: { name: { type: "string", @@ -287,6 +287,9 @@ export const AncNodeSchema = { purl: { type: "string", }, + relationship: { + type: "string", + }, sbom_id: { type: "string", }, @@ -1382,7 +1385,7 @@ export const PaginatedResults_SbomSummarySchema = { }, { type: "object", - required: ["described_by", "number_of_packages"], + required: ["described_by"], properties: { described_by: { type: "array", @@ -1390,12 +1393,6 @@ export const PaginatedResults_SbomSummarySchema = { $ref: "#/components/schemas/SbomPackage", }, }, - number_of_packages: { - type: "integer", - format: "int64", - description: "The number of packages this SBOM has", - minimum: 0, - }, }, }, ], @@ -1843,6 +1840,7 @@ export const RelationshipSchema = { "dev_tool_of", "described_by", "package_of", + "undefined", ], } as const; @@ -1952,6 +1950,7 @@ export const SbomHeadSchema = { "published", "authors", "name", + "number_of_packages", ], properties: { authors: { @@ -1978,6 +1977,12 @@ export const SbomHeadSchema = { name: { type: "string", }, + number_of_packages: { + type: "integer", + format: "int64", + description: "The number of packages this SBOM has", + minimum: 0, + }, published: { type: ["string", "null"], format: "date-time", @@ -2077,32 +2082,39 @@ export const SbomPackageRelationSchema = { } as const; export const SbomStatusSchema = { - type: "object", - required: ["vulnerability_id", "status", "packages"], - properties: { - context: { - oneOf: [ - { - type: "null", + allOf: [ + { + $ref: "#/components/schemas/VulnerabilityHead", + }, + { + type: "object", + required: ["average_severity", "status", "packages"], + properties: { + average_severity: { + $ref: "#/components/schemas/Severity", }, - { - $ref: "#/components/schemas/StatusContext", + context: { + oneOf: [ + { + type: "null", + }, + { + $ref: "#/components/schemas/StatusContext", + }, + ], + }, + packages: { + type: "array", + items: { + $ref: "#/components/schemas/SbomPackage", + }, + }, + status: { + type: "string", }, - ], - }, - packages: { - type: "array", - items: { - $ref: "#/components/schemas/SbomPackage", }, }, - status: { - type: "string", - }, - vulnerability_id: { - type: "string", - }, - }, + ], } as const; export const SbomSummarySchema = { @@ -2122,7 +2134,7 @@ export const SbomSummarySchema = { }, { type: "object", - required: ["described_by", "number_of_packages"], + required: ["described_by"], properties: { described_by: { type: "array", @@ -2130,12 +2142,6 @@ export const SbomSummarySchema = { $ref: "#/components/schemas/SbomPackage", }, }, - number_of_packages: { - type: "integer", - format: "int64", - description: "The number of packages this SBOM has", - minimum: 0, - }, }, }, ], diff --git a/client/src/app/client/types.gen.ts b/client/src/app/client/types.gen.ts index 0eaa7805..3b320af7 100644 --- a/client/src/app/client/types.gen.ts +++ b/client/src/app/client/types.gen.ts @@ -119,6 +119,7 @@ export type AncNode = { name: string; node_id: string; purl: string; + relationship: string; sbom_id: string; version: string; }; @@ -537,10 +538,6 @@ export type PaginatedResults_SbomSummary = { SbomHead & (null | SourceDocument) & { described_by: Array; - /** - * The number of packages this SBOM has - */ - number_of_packages: number; } >; total: number; @@ -687,7 +684,8 @@ export type Relationship = | "build_tool_of" | "dev_tool_of" | "described_by" - | "package_of"; + | "package_of" + | "undefined"; export type Report = { /** @@ -741,6 +739,10 @@ export type SbomHead = { id: string; labels: Labels; name: string; + /** + * The number of packages this SBOM has + */ + number_of_packages: number; published: string | null; }; @@ -767,20 +769,16 @@ export type SbomPackageRelation = { relationship: Relationship; }; -export type SbomStatus = { +export type SbomStatus = VulnerabilityHead & { + average_severity: Severity; context?: null | StatusContext; packages: Array; status: string; - vulnerability_id: string; }; export type SbomSummary = SbomHead & (null | SourceDocument) & { described_by: Array; - /** - * The number of packages this SBOM has - */ - number_of_packages: number; }; /**