diff --git a/.github/workflows/ci-global.yaml b/.github/workflows/ci-global.yaml index 2edf11eb..a34d4803 100644 --- a/.github/workflows/ci-global.yaml +++ b/.github/workflows/ci-global.yaml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: save trustify-ui image run: | docker build . -t ghcr.io/trustification/trustify-ui:pr-test -f Dockerfile diff --git a/.gitignore b/.gitignore index 60f34f6e..f4a39080 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ node_modules/ # testing coverage/ +# generated files +client/src/app/client/ + # production dist/ /qa/build diff --git a/client/package.json b/client/package.json index c43d899d..617e0d1d 100644 --- a/client/package.json +++ b/client/package.json @@ -11,7 +11,7 @@ "build:dev": "NODE_ENV=development webpack --config ./config/webpack.dev.ts", "start:dev": "NODE_ENV=development webpack serve --config ./config/webpack.dev.ts", "test": "NODE_ENV=test jest --rootDir=. --config=./config/jest.config.ts", - "openapi:generate-client": "openapi-ts -f ./config/openapi-ts.config.ts", + "generate": "openapi-ts -f ./config/openapi-ts.config.ts", "lint": "eslint .", "tsc": "tsc -p ./tsconfig.json" }, diff --git a/client/src/app/client/index.ts b/client/src/app/client/index.ts deleted file mode 100644 index 1cb041de..00000000 --- a/client/src/app/client/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export * from "./schemas.gen"; -export * from "./services.gen"; -export * from "./types.gen"; diff --git a/client/src/app/client/schemas.gen.ts b/client/src/app/client/schemas.gen.ts deleted file mode 100644 index 17ee787d..00000000 --- a/client/src/app/client/schemas.gen.ts +++ /dev/null @@ -1,2607 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const AdvisoryDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/SourceDocument", - }, - ], - }, - { - type: "object", - required: ["vulnerabilities", "average_severity", "average_score"], - properties: { - average_score: { - type: ["number", "null"], - format: "double", - description: - "Average (arithmetic mean) score of the advisory aggregated from *all* related vulnerability assertions.", - }, - average_severity: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Severity", - description: - "Average (arithmetic mean) severity of the advisory aggregated from *all* related vulnerability assertions.", - }, - ], - }, - vulnerabilities: { - type: "array", - items: { - $ref: "#/components/schemas/AdvisoryVulnerabilitySummary", - }, - description: "Vulnerabilities addressed within this advisory.", - }, - }, - }, - ], -} as const; - -export const AdvisoryHeadSchema = { - type: "object", - required: [ - "uuid", - "identifier", - "document_id", - "issuer", - "published", - "withdrawn", - "title", - "labels", - ], - properties: { - document_id: { - type: "string", - description: - "The identifier of the advisory, as provided by the document.", - }, - identifier: { - type: "string", - description: - "The identifier of the advisory, as assigned by the issuing organization.", - }, - issuer: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/OrganizationSummary", - description: `The issuer of the advisory, if known. If no issuer is able to be -determined, this field will not be included in a response.`, - }, - ], - }, - labels: { - $ref: "#/components/schemas/Labels", - description: - "Informational labels attached by the system or users to this advisory.", - }, - modified: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the advisory was last modified, if any.", - }, - published: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the advisory was published, if any.", - }, - title: { - type: ["string", "null"], - description: - "The title of the advisory as assigned by the issuing organization.", - }, - uuid: { - type: "string", - description: "The opaque UUID of the advisory.", - }, - withdrawn: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the advisory was withdrawn, if any.", - }, - }, -} as const; - -export const AdvisorySummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/SourceDocument", - description: - "Information pertaning to the underlying source document, if any.", - }, - ], - }, - { - type: "object", - required: ["average_severity", "average_score", "vulnerabilities"], - properties: { - average_score: { - type: ["number", "null"], - format: "double", - description: - "Average (arithmetic mean) score of the advisory aggregated from *all* related vulnerability assertions.", - }, - average_severity: { - type: ["string", "null"], - description: - "Average (arithmetic mean) severity of the advisory aggregated from *all* related vulnerability assertions.", - }, - vulnerabilities: { - type: "array", - items: { - $ref: "#/components/schemas/AdvisoryVulnerabilityHead", - }, - description: "Vulnerabilities addressed within this advisory.", - }, - }, - }, - ], -} as const; - -export const AdvisoryVulnerabilityHeadSchema = { - allOf: [ - { - $ref: "#/components/schemas/VulnerabilityHead", - }, - { - type: "object", - required: ["severity", "score"], - properties: { - score: { - type: "number", - format: "double", - description: `The average (arithmetic mean) score this advisory assigns to -the particular vulnerability.`, - }, - severity: { - $ref: "#/components/schemas/Severity", - description: `The English-language word description of the severity of the given -vulnerability, as asserted by the advisory, using the CVSS bucketing -ranges. - -Critical: 9.0–10.0 -High: 7.0–8.9 -Medium: 4.0–6.9 -Low: 0.1–3.9 -None: 0`, - }, - }, - }, - ], -} as const; - -export const AdvisoryVulnerabilitySummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryVulnerabilityHead", - }, - { - type: "object", - required: ["cvss3_scores"], - properties: { - cvss3_scores: { - type: "array", - items: { - type: "string", - }, - description: `All CVSS3 scores from the advisory for the given vulnerability. -May include several, varying by minor version of the CVSS3 vector.`, - }, - }, - }, - ], - description: - "Summary of information from this advisory regarding a single specific vulnerability.", -} as const; - -export const AnalysisStatusSchema = { - type: "object", - required: ["sbom_count", "graph_count"], - properties: { - graph_count: { - type: "integer", - format: "int32", - description: "The number of graphs loaded in memory", - minimum: 0, - }, - sbom_count: { - type: "integer", - format: "int32", - description: "The number of SBOMs found in the database", - minimum: 0, - }, - }, -} as const; - -export const BasePurlDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/BasePurlHead", - }, - { - type: "object", - required: ["versions"], - properties: { - versions: { - type: "array", - items: { - $ref: "#/components/schemas/VersionedPurlSummary", - }, - }, - }, - }, - ], -} as const; - -export const BasePurlHeadSchema = { - type: "object", - required: ["uuid", "purl"], - properties: { - purl: { - $ref: "#/components/schemas/Purl", - description: "The actual base PURL", - }, - uuid: { - type: "string", - format: "uuid", - description: "The ID of the base PURL", - }, - }, -} as const; - -export const BasePurlSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/BasePurlHead", - }, - ], -} as const; - -export const BaseSummarySchema = { - type: "object", - required: [ - "sbom_id", - "node_id", - "purl", - "cpe", - "name", - "version", - "published", - "document_id", - "product_name", - "product_version", - ], - properties: { - cpe: { - type: "array", - items: { - $ref: "#/components/schemas/Cpe", - }, - }, - document_id: { - type: "string", - }, - name: { - type: "string", - }, - node_id: { - type: "string", - }, - product_name: { - type: "string", - }, - product_version: { - type: "string", - }, - published: { - type: "string", - }, - purl: { - type: "array", - items: { - $ref: "#/components/schemas/Purl", - }, - }, - sbom_id: { - type: "string", - }, - version: { - type: "string", - }, - }, -} as const; - -export const BinaryByteSizeSchema = { - type: "string", -} as const; - -export const ClearlyDefinedCurationImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - properties: { - source: { - type: "string", - }, - types: { - type: "array", - items: { - $ref: "#/components/schemas/ClearlyDefinedPackageType", - }, - uniqueItems: true, - }, - }, - }, - ], -} as const; - -export const ClearlyDefinedImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - properties: { - source: { - type: "string", - }, - types: { - type: "array", - items: { - $ref: "#/components/schemas/ClearlyDefinedPackageType", - }, - uniqueItems: true, - }, - }, - }, - ], -} as const; - -export const ClearlyDefinedPackageTypeSchema = { - type: "string", - enum: [ - "composer", - "crate", - "deb", - "gem", - "git", - "go", - "maven", - "npm", - "nuget", - "pod", - "pypi", - ], -} as const; - -export const CommonImporterSchema = { - type: "object", - required: ["period"], - properties: { - description: { - type: ["string", "null"], - description: "A description for users.", - }, - disabled: { - type: "boolean", - description: "A flag to disable the importer, without deleting it.", - }, - labels: { - $ref: "#/components/schemas/Labels", - description: "Labels which will be applied to the ingested documents.", - }, - period: { - type: "string", - description: "The period the importer should be run.", - }, - }, -} as const; - -export const CpeSchema = { - type: "string", - format: "uri", -} as const; - -export const CsafImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - required: ["source"], - properties: { - fetchRetries: { - type: ["integer", "null"], - minimum: 0, - }, - ignoreMissing: { - type: "boolean", - }, - onlyPatterns: { - type: "array", - items: { - type: "string", - }, - }, - source: { - type: "string", - }, - v3Signatures: { - type: "boolean", - }, - }, - }, - ], -} as const; - -export const CveImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - properties: { - source: { - type: "string", - }, - startYear: { - type: ["integer", "null"], - format: "int32", - minimum: 0, - }, - years: { - type: "array", - items: { - type: "integer", - format: "int32", - minimum: 0, - }, - uniqueItems: true, - }, - }, - }, - ], -} as const; - -export const CweImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - properties: { - source: { - type: "string", - }, - }, - }, - ], -} as const; - -export const ExternalReferenceQuerySchema = { - type: "object", - properties: { - cpe: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Cpe", - description: "Find by CPE", - }, - ], - }, - purl: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Purl", - description: "Find by PURL", - }, - ], - }, - }, -} as const; - -export const IdSchema = { - type: "string", - description: "A hash/digest prefixed with its type.", - example: - "sha256:dc60aeb735c16a71b6fc56e84ddb8193e3a6d1ef0b7e958d77e78fc039a5d04e", -} as const; - -export const ImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/ImporterData", - }, - { - type: "object", - required: ["name"], - properties: { - name: { - type: "string", - }, - }, - }, - ], -} as const; - -export const ImporterConfigurationSchema = { - oneOf: [ - { - type: "object", - required: ["sbom"], - properties: { - sbom: { - $ref: "#/components/schemas/SbomImporter", - }, - }, - }, - { - type: "object", - required: ["csaf"], - properties: { - csaf: { - $ref: "#/components/schemas/CsafImporter", - }, - }, - }, - { - type: "object", - required: ["osv"], - properties: { - osv: { - $ref: "#/components/schemas/OsvImporter", - }, - }, - }, - { - type: "object", - required: ["cve"], - properties: { - cve: { - $ref: "#/components/schemas/CveImporter", - }, - }, - }, - { - type: "object", - required: ["clearlyDefined"], - properties: { - clearlyDefined: { - $ref: "#/components/schemas/ClearlyDefinedImporter", - }, - }, - }, - { - type: "object", - required: ["clearlyDefinedCuration"], - properties: { - clearlyDefinedCuration: { - $ref: "#/components/schemas/ClearlyDefinedCurationImporter", - }, - }, - }, - { - type: "object", - required: ["cwe"], - properties: { - cwe: { - $ref: "#/components/schemas/CweImporter", - }, - }, - }, - ], -} as const; - -export const ImporterDataSchema = { - type: "object", - required: ["configuration", "state", "lastChange"], - properties: { - configuration: { - $ref: "#/components/schemas/ImporterConfiguration", - }, - continuation: { - description: "The continuation token of the importer.", - }, - lastChange: { - type: "string", - format: "date-time", - description: "The last state change", - }, - lastError: { - type: ["string", "null"], - description: "The error of the last run (empty if successful)", - }, - lastRun: { - type: ["string", "null"], - format: "date-time", - description: "The last run (successful or not)", - }, - lastSuccess: { - type: ["string", "null"], - format: "date-time", - description: "The last successful run", - }, - progress: { - $ref: "#/components/schemas/Progress", - description: "The current progress.", - }, - state: { - $ref: "#/components/schemas/State", - description: "The current state of the importer", - }, - }, -} as const; - -export const ImporterReportSchema = { - type: "object", - required: ["id", "importer", "creation"], - properties: { - creation: { - type: "string", - format: "date-time", - description: "The time the report was created", - }, - error: { - type: ["string", "null"], - description: "Errors captured by the report", - }, - id: { - type: "string", - description: "The ID of the report", - }, - importer: { - type: "string", - description: "The name of the importer this report belongs to", - }, - report: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Report", - description: "Detailed report information", - }, - ], - }, - }, -} as const; - -export const IngestResultSchema = { - type: "object", - description: "The result of the ingestion process", - required: ["id"], - properties: { - document_id: { - type: ["string", "null"], - description: "The ID declared by the document", - }, - id: { - $ref: "#/components/schemas/Id", - description: "The internal ID of the document", - }, - warnings: { - type: "array", - items: { - type: "string", - }, - description: "Warnings that occurred during the import process", - }, - }, -} as const; - -export const LabelsSchema = { - type: "object", - additionalProperties: { - type: "string", - }, -} as const; - -export const LicenseSummarySchema = { - type: "object", - required: [ - "id", - "license", - "spdx_licenses", - "spdx_license_exceptions", - "purls", - ], - properties: { - id: { - type: "string", - }, - license: { - type: "string", - }, - purls: { - type: "integer", - format: "int64", - minimum: 0, - }, - spdx_license_exceptions: { - type: "array", - items: { - type: "string", - }, - }, - spdx_licenses: { - type: "array", - items: { - type: "string", - }, - }, - }, -} as const; - -export const MessageSchema = { - type: "object", - required: ["severity", "message"], - properties: { - message: { - type: "string", - description: "The message", - }, - severity: { - $ref: "#/components/schemas/Severity", - description: "The severity of the message", - }, - }, -} as const; - -export const OrganizationDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/OrganizationHead", - }, - { - type: "object", - required: ["advisories"], - properties: { - advisories: { - type: "array", - items: { - $ref: "#/components/schemas/AdvisoryHead", - }, - description: "Advisories issued by the organization, if any.", - }, - }, - }, - ], -} as const; - -export const OrganizationHeadSchema = { - type: "object", - description: `An organization who may issue advisories, product SBOMs, or -otherwise be involved in supply-chain evidence.`, - required: ["id", "name", "cpe_key", "website"], - properties: { - cpe_key: { - type: ["string", "null"], - description: "The `CPE` key of the organization, if known.", - }, - id: { - type: "string", - format: "uuid", - description: "The opaque UUID of the organization.", - }, - name: { - type: "string", - description: "The name of the organization.", - }, - website: { - type: ["string", "null"], - description: "The website of the organization, if known.", - }, - }, -} as const; - -export const OrganizationSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/OrganizationHead", - }, - ], -} as const; - -export const OsvImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - required: ["source"], - properties: { - branch: { - type: ["string", "null"], - description: - "An optional branch. Will use the default branch otherwise.", - }, - path: { - type: ["string", "null"], - description: - "An optional path to start searching for documents. Will use the root of the repository otherwise.", - }, - source: { - type: "string", - description: "The URL to the git repository of the OSV data", - }, - startYear: { - type: ["integer", "null"], - format: "int32", - minimum: 0, - }, - years: { - type: "array", - items: { - type: "integer", - format: "int32", - minimum: 0, - }, - uniqueItems: true, - }, - }, - }, - ], -} as const; - -export const PaginatedResults_AdvisorySummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/SourceDocument", - description: - "Information pertaning to the underlying source document, if any.", - }, - ], - }, - { - type: "object", - required: ["average_severity", "average_score", "vulnerabilities"], - properties: { - average_score: { - type: ["number", "null"], - format: "double", - description: - "Average (arithmetic mean) score of the advisory aggregated from *all* related vulnerability assertions.", - }, - average_severity: { - type: ["string", "null"], - description: - "Average (arithmetic mean) severity of the advisory aggregated from *all* related vulnerability assertions.", - }, - vulnerabilities: { - type: "array", - items: { - $ref: "#/components/schemas/AdvisoryVulnerabilityHead", - }, - description: "Vulnerabilities addressed within this advisory.", - }, - }, - }, - ], - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_BasePurlSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - allOf: [ - { - $ref: "#/components/schemas/BasePurlHead", - }, - ], - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_BaseSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - type: "object", - required: [ - "sbom_id", - "node_id", - "purl", - "cpe", - "name", - "version", - "published", - "document_id", - "product_name", - "product_version", - ], - properties: { - cpe: { - type: "array", - items: { - $ref: "#/components/schemas/Cpe", - }, - }, - document_id: { - type: "string", - }, - name: { - type: "string", - }, - node_id: { - type: "string", - }, - product_name: { - type: "string", - }, - product_version: { - type: "string", - }, - published: { - type: "string", - }, - purl: { - type: "array", - items: { - $ref: "#/components/schemas/Purl", - }, - }, - sbom_id: { - type: "string", - }, - version: { - type: "string", - }, - }, - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_ImporterReportSchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - type: "object", - required: ["id", "importer", "creation"], - properties: { - creation: { - type: "string", - format: "date-time", - description: "The time the report was created", - }, - error: { - type: ["string", "null"], - description: "Errors captured by the report", - }, - id: { - type: "string", - description: "The ID of the report", - }, - importer: { - type: "string", - description: "The name of the importer this report belongs to", - }, - report: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Report", - description: "Detailed report information", - }, - ], - }, - }, - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_LicenseSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - type: "object", - required: [ - "id", - "license", - "spdx_licenses", - "spdx_license_exceptions", - "purls", - ], - properties: { - id: { - type: "string", - }, - license: { - type: "string", - }, - purls: { - type: "integer", - format: "int64", - minimum: 0, - }, - spdx_license_exceptions: { - type: "array", - items: { - type: "string", - }, - }, - spdx_licenses: { - type: "array", - items: { - type: "string", - }, - }, - }, - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_ProductSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - allOf: [ - { - $ref: "#/components/schemas/ProductHead", - }, - { - type: "object", - required: ["versions", "vendor"], - properties: { - vendor: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/OrganizationSummary", - }, - ], - }, - versions: { - type: "array", - items: { - $ref: "#/components/schemas/ProductVersionHead", - }, - }, - }, - }, - ], - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_PurlSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - allOf: [ - { - $ref: "#/components/schemas/PurlHead", - }, - { - type: "object", - required: ["base", "version", "qualifiers"], - properties: { - base: { - $ref: "#/components/schemas/BasePurlHead", - }, - qualifiers: { - type: "object", - additionalProperties: { - type: "string", - }, - propertyNames: { - type: "string", - }, - }, - version: { - $ref: "#/components/schemas/VersionedPurlHead", - }, - }, - }, - ], - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_SbomPackageSchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - type: "object", - required: ["id", "name", "purl", "cpe"], - properties: { - cpe: { - type: "array", - items: { - type: "string", - }, - }, - id: { - type: "string", - }, - name: { - type: "string", - }, - purl: { - type: "array", - items: { - $ref: "#/components/schemas/PurlSummary", - }, - }, - version: { - type: ["string", "null"], - }, - }, - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_SbomPackageRelationSchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - type: "object", - required: ["relationship", "package"], - properties: { - package: { - $ref: "#/components/schemas/SbomPackage", - }, - relationship: { - $ref: "#/components/schemas/Relationship", - }, - }, - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_SbomSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - allOf: [ - { - $ref: "#/components/schemas/SbomHead", - }, - { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/SourceDocument", - }, - ], - }, - { - type: "object", - required: ["described_by"], - properties: { - described_by: { - type: "array", - items: { - $ref: "#/components/schemas/SbomPackage", - }, - }, - }, - }, - ], - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_SpdxLicenseSummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - type: "object", - required: ["id", "name"], - properties: { - id: { - type: "string", - }, - name: { - type: "string", - }, - }, - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const PaginatedResults_VulnerabilitySummarySchema = { - type: "object", - required: ["items", "total"], - properties: { - items: { - type: "array", - items: { - allOf: [ - { - $ref: "#/components/schemas/VulnerabilityHead", - }, - { - type: "object", - required: ["average_severity", "average_score", "advisories"], - properties: { - advisories: { - type: "array", - items: { - $ref: "#/components/schemas/VulnerabilityAdvisoryHead", - }, - }, - average_score: { - type: ["number", "null"], - format: "double", - description: - "Average (arithmetic mean) score of the vulnerability aggregated from *all* related advisories.", - }, - average_severity: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Severity", - description: - "Average (arithmetic mean) severity of the vulnerability aggregated from *all* related advisories.", - }, - ], - }, - }, - }, - ], - }, - }, - total: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const ProductDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/ProductHead", - }, - { - type: "object", - required: ["versions", "vendor"], - properties: { - vendor: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/OrganizationSummary", - }, - ], - }, - versions: { - type: "array", - items: { - $ref: "#/components/schemas/ProductVersionDetails", - }, - }, - }, - }, - ], -} as const; - -export const ProductHeadSchema = { - type: "object", - required: ["id", "name"], - properties: { - id: { - type: "string", - }, - name: { - type: "string", - }, - }, -} as const; - -export const ProductSbomHeadSchema = { - type: "object", - required: ["labels", "published"], - properties: { - labels: { - $ref: "#/components/schemas/Labels", - }, - published: { - type: ["string", "null"], - format: "date-time", - }, - }, -} as const; - -export const ProductSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/ProductHead", - }, - { - type: "object", - required: ["versions", "vendor"], - properties: { - vendor: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/OrganizationSummary", - }, - ], - }, - versions: { - type: "array", - items: { - $ref: "#/components/schemas/ProductVersionHead", - }, - }, - }, - }, - ], -} as const; - -export const ProductVersionDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/ProductVersionHead", - }, - { - type: "object", - properties: { - sbom: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/ProductSbomHead", - }, - ], - }, - }, - }, - ], -} as const; - -export const ProductVersionHeadSchema = { - type: "object", - required: ["id", "version"], - properties: { - id: { - type: "string", - }, - sbom_id: { - type: "string", - }, - version: { - type: "string", - }, - }, -} as const; - -export const ProgressSchema = { - allOf: [ - { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/ProgressDetails", - }, - ], - }, - { - type: "object", - properties: { - message: { - type: ["string", "null"], - }, - }, - }, - ], -} as const; - -export const ProgressDetailsSchema = { - type: "object", - required: [ - "current", - "total", - "percent", - "rate", - "estimatedSecondsRemaining", - "estimatedCompletion", - ], - properties: { - current: { - type: "integer", - format: "int32", - description: "The current processed items.", - minimum: 0, - }, - estimatedCompletion: { - type: "string", - format: "date-time", - description: "The estimated time of completion.", - }, - estimatedSecondsRemaining: { - type: "integer", - format: "int64", - description: "The estimated remaining time in seconds.", - minimum: 0, - }, - percent: { - type: "number", - format: "float", - description: "Progress in percent (0..=1)", - }, - rate: { - type: "number", - format: "float", - description: "The average processing rate (per second).", - }, - total: { - type: "integer", - format: "int32", - description: "The total number of items to be processed.", - minimum: 0, - }, - }, -} as const; - -export const PurlSchema = { - type: "string", - format: "uri", -} as const; - -export const PurlAdvisorySchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - type: "object", - required: ["status"], - properties: { - status: { - type: "array", - items: { - $ref: "#/components/schemas/PurlStatus", - }, - }, - }, - }, - ], -} as const; - -export const PurlDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/PurlHead", - }, - { - type: "object", - required: ["version", "base", "advisories", "licenses"], - properties: { - advisories: { - type: "array", - items: { - $ref: "#/components/schemas/PurlAdvisory", - }, - }, - base: { - $ref: "#/components/schemas/BasePurlHead", - }, - licenses: { - type: "array", - items: { - $ref: "#/components/schemas/PurlLicenseSummary", - }, - }, - version: { - $ref: "#/components/schemas/VersionedPurlHead", - }, - }, - }, - ], -} as const; - -export const PurlHeadSchema = { - type: "object", - required: ["uuid", "purl"], - properties: { - purl: { - $ref: "#/components/schemas/Purl", - description: "The actual qualified PURL", - }, - uuid: { - type: "string", - format: "uuid", - description: "The ID of the qualified PURL", - }, - }, -} as const; - -export const PurlLicenseSummarySchema = { - type: "object", - required: ["sbom", "licenses"], - properties: { - licenses: { - type: "array", - items: { - type: "string", - }, - }, - sbom: { - $ref: "#/components/schemas/SbomHead", - }, - }, -} as const; - -export const PurlStatusSchema = { - type: "object", - required: ["vulnerability", "average_severity", "status", "context"], - properties: { - average_severity: { - $ref: "#/components/schemas/Severity", - }, - context: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/StatusContext", - }, - ], - }, - status: { - type: "string", - }, - vulnerability: { - $ref: "#/components/schemas/VulnerabilityHead", - }, - }, -} as const; - -export const PurlSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/PurlHead", - }, - { - type: "object", - required: ["base", "version", "qualifiers"], - properties: { - base: { - $ref: "#/components/schemas/BasePurlHead", - }, - qualifiers: { - type: "object", - additionalProperties: { - type: "string", - }, - propertyNames: { - type: "string", - }, - }, - version: { - $ref: "#/components/schemas/VersionedPurlHead", - }, - }, - }, - ], -} as const; - -export const RelationshipSchema = { - type: "string", - enum: [ - "contains", - "dependency", - "dev_dependency", - "optional_dependency", - "provided_dependency", - "test_dependency", - "runtime_dependency", - "example", - "generates", - "ancestor_of", - "variant", - "build_tool", - "dev_tool", - "describes", - "package", - "undefined", - ], -} as const; - -export const ReportSchema = { - type: "object", - required: ["startDate", "endDate"], - properties: { - endDate: { - type: "string", - format: "date-time", - description: "End of the import run", - }, - messages: { - type: "object", - description: "Messages emitted during processing", - additionalProperties: { - type: "object", - additionalProperties: { - type: "array", - items: { - $ref: "#/components/schemas/Message", - }, - }, - propertyNames: { - type: "string", - }, - }, - propertyNames: { - type: "string", - description: "The phase of processing", - enum: ["retrieval", "validation", "upload"], - }, - }, - numberOfItems: { - type: "integer", - description: "Number of processes items", - minimum: 0, - }, - startDate: { - type: "string", - format: "date-time", - description: "Start of the import run", - }, - }, -} as const; - -export const Revisioned_ImporterSchema = { - type: "object", - description: `A struct wrapping an item with a revision. - -If the revision should not be part of the payload, but e.g. an HTTP header (like \`ETag\`), this -struct can help carrying both pieces.`, - required: ["value", "revision"], - properties: { - revision: { - type: "string", - description: `The revision. - -An opaque string that should have no meaning to the user, only to the backend.`, - }, - value: { - allOf: [ - { - $ref: "#/components/schemas/ImporterData", - }, - { - type: "object", - required: ["name"], - properties: { - name: { - type: "string", - }, - }, - }, - ], - }, - }, -} as const; - -export const SbomAdvisorySchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - type: "object", - required: ["status"], - properties: { - status: { - type: "array", - items: { - $ref: "#/components/schemas/SbomStatus", - }, - }, - }, - }, - ], -} as const; - -export const SbomHeadSchema = { - type: "object", - required: [ - "id", - "labels", - "data_licenses", - "published", - "authors", - "name", - "number_of_packages", - ], - properties: { - authors: { - type: "array", - items: { - type: "string", - }, - }, - data_licenses: { - type: "array", - items: { - type: "string", - }, - }, - document_id: { - type: ["string", "null"], - }, - id: { - type: "string", - }, - labels: { - $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", "null"], - format: "date-time", - }, - }, -} as const; - -export const SbomImporterSchema = { - allOf: [ - { - $ref: "#/components/schemas/CommonImporter", - }, - { - type: "object", - required: ["source"], - properties: { - fetchRetries: { - type: ["integer", "null"], - minimum: 0, - }, - ignoreMissing: { - type: "boolean", - }, - keys: { - type: "array", - items: { - type: "string", - format: "uri", - }, - }, - onlyPatterns: { - type: "array", - items: { - type: "string", - }, - }, - sizeLimit: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/BinaryByteSize", - }, - ], - }, - source: { - type: "string", - }, - v3Signatures: { - type: "boolean", - }, - }, - }, - ], -} as const; - -export const SbomPackageSchema = { - type: "object", - required: ["id", "name", "purl", "cpe"], - properties: { - cpe: { - type: "array", - items: { - type: "string", - }, - }, - id: { - type: "string", - }, - name: { - type: "string", - }, - purl: { - type: "array", - items: { - $ref: "#/components/schemas/PurlSummary", - }, - }, - version: { - type: ["string", "null"], - }, - }, -} as const; - -export const SbomPackageRelationSchema = { - type: "object", - required: ["relationship", "package"], - properties: { - package: { - $ref: "#/components/schemas/SbomPackage", - }, - relationship: { - $ref: "#/components/schemas/Relationship", - }, - }, -} as const; - -export const SbomStatusSchema = { - 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", - }, - }, - }, - ], -} as const; - -export const SbomSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/SbomHead", - }, - { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/SourceDocument", - }, - ], - }, - { - type: "object", - required: ["described_by"], - properties: { - described_by: { - type: "array", - items: { - $ref: "#/components/schemas/SbomPackage", - }, - }, - }, - }, - ], -} as const; - -export const SeveritySchema = { - type: "string", - description: `Qualitative Severity Rating Scale - -Described in CVSS v3.1 Specification: Section 5: - - -> For some purposes it is useful to have a textual representation of the -> numeric Base, Temporal and Environmental scores.`, - enum: ["none", "low", "medium", "high", "critical"], -} as const; - -export const SourceDocumentSchema = { - type: "object", - required: ["sha256", "sha384", "sha512", "size", "ingested"], - properties: { - ingested: { - type: "string", - format: "date-time", - description: "The timestamp the document was ingested", - }, - sha256: { - type: "string", - }, - sha384: { - type: "string", - }, - sha512: { - type: "string", - }, - size: { - type: "integer", - format: "int64", - minimum: 0, - }, - }, -} as const; - -export const SpdxLicenseDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/SpdxLicenseSummary", - }, - { - type: "object", - required: ["text"], - properties: { - text: { - type: "string", - }, - }, - }, - ], -} as const; - -export const SpdxLicenseSummarySchema = { - type: "object", - required: ["id", "name"], - properties: { - id: { - type: "string", - }, - name: { - type: "string", - }, - }, -} as const; - -export const StateSchema = { - type: "string", - enum: ["waiting", "running"], -} as const; - -export const StatusContextSchema = { - oneOf: [ - { - type: "object", - required: ["purl"], - properties: { - purl: { - $ref: "#/components/schemas/Purl", - }, - }, - }, - { - type: "object", - required: ["cpe"], - properties: { - cpe: { - type: "string", - }, - }, - }, - ], -} as const; - -export const TypeCountsSchema = { - type: "object", - required: ["base", "version", "package"], - properties: { - base: { - type: "integer", - format: "int64", - }, - package: { - type: "integer", - format: "int64", - }, - version: { - type: "integer", - format: "int64", - }, - }, -} as const; - -export const TypeHeadSchema = { - type: "object", - required: ["name"], - properties: { - name: { - type: "string", - }, - }, -} as const; - -export const TypeSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/TypeHead", - }, - { - type: "object", - required: ["counts"], - properties: { - counts: { - $ref: "#/components/schemas/TypeCounts", - }, - }, - }, - ], -} as const; - -export const VersionedPurlAdvisorySchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - type: "object", - required: ["status"], - properties: { - status: { - type: "array", - items: { - $ref: "#/components/schemas/VersionedPurlStatus", - }, - }, - }, - }, - ], -} as const; - -export const VersionedPurlDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/VersionedPurlHead", - }, - { - type: "object", - required: ["base", "purls", "advisories"], - properties: { - advisories: { - type: "array", - items: { - $ref: "#/components/schemas/VersionedPurlAdvisory", - }, - }, - base: { - $ref: "#/components/schemas/BasePurlHead", - }, - purls: { - type: "array", - items: { - $ref: "#/components/schemas/PurlHead", - }, - }, - }, - }, - ], -} as const; - -export const VersionedPurlHeadSchema = { - type: "object", - required: ["uuid", "purl", "version"], - properties: { - purl: { - $ref: "#/components/schemas/Purl", - description: "The actual, versioned PURL", - }, - uuid: { - type: "string", - format: "uuid", - description: "The ID of the versioned PURL", - }, - version: { - type: "string", - description: "The version from the PURL", - }, - }, -} as const; - -export const VersionedPurlStatusSchema = { - type: "object", - required: ["vulnerability", "status"], - properties: { - status: { - type: "string", - }, - vulnerability: { - $ref: "#/components/schemas/VulnerabilityHead", - }, - }, -} as const; - -export const VersionedPurlSummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/VersionedPurlHead", - }, - { - type: "object", - required: ["base", "purls"], - properties: { - base: { - $ref: "#/components/schemas/BasePurlHead", - }, - purls: { - type: "array", - items: { - $ref: "#/components/schemas/PurlHead", - }, - }, - }, - }, - ], -} as const; - -export const VulnerabilityAdvisoryHeadSchema = { - allOf: [ - { - $ref: "#/components/schemas/AdvisoryHead", - }, - { - type: "object", - required: ["severity", "score"], - properties: { - score: { - type: ["number", "null"], - format: "double", - }, - severity: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Severity", - }, - ], - }, - }, - }, - ], -} as const; - -export const VulnerabilityAdvisoryStatusSchema = { - type: "object", - required: ["base_purl", "version", "context"], - properties: { - base_purl: { - $ref: "#/components/schemas/BasePurlHead", - }, - context: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/StatusContext", - }, - ], - }, - version: { - type: "string", - }, - }, -} as const; - -export const VulnerabilityAdvisorySummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/VulnerabilityAdvisoryHead", - }, - { - type: "object", - required: ["cvss3_scores", "purls", "sboms", "number_of_vulnerabilities"], - properties: { - cvss3_scores: { - type: "array", - items: { - type: "string", - }, - description: - "CVSS3 scores from this advisory regarding the vulnerability.", - }, - number_of_vulnerabilities: { - type: "integer", - format: "int64", - description: - "The total number of vulnerabilities described by this advisory", - minimum: 0, - }, - purls: { - type: "object", - additionalProperties: { - type: "array", - items: { - $ref: "#/components/schemas/VulnerabilityAdvisoryStatus", - }, - }, - propertyNames: { - type: "string", - }, - }, - sboms: { - type: "array", - items: { - $ref: "#/components/schemas/VulnerabilitySbomStatus", - }, - description: - "SBOMs claimed by this advisory to be addressed by this vulnerability.", - }, - }, - }, - ], -} as const; - -export const VulnerabilityDetailsSchema = { - allOf: [ - { - $ref: "#/components/schemas/VulnerabilityHead", - }, - { - type: "object", - required: ["average_severity", "average_score", "advisories"], - properties: { - advisories: { - type: "array", - items: { - $ref: "#/components/schemas/VulnerabilityAdvisorySummary", - }, - description: "Advisories addressing this vulnerability, if any.", - }, - average_score: { - type: ["number", "null"], - format: "double", - description: - "Average (arithmetic mean) score of the vulnerability aggregated from *all* related advisories.", - }, - average_severity: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Severity", - description: - "Average (arithmetic mean) severity of the vulnerability aggregated from *all* related advisories.", - }, - ], - }, - }, - }, - ], -} as const; - -export const VulnerabilityHeadSchema = { - type: "object", - required: [ - "normative", - "identifier", - "title", - "description", - "reserved", - "published", - "modified", - "withdrawn", - "discovered", - "released", - "cwes", - ], - properties: { - cwes: { - type: "array", - items: { - type: "string", - }, - description: "Associated CWE, if any.", - }, - description: { - type: ["string", "null"], - description: "The description of the vulnerability, if known.", - }, - discovered: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the vulnerability was discovered, if any.", - }, - identifier: { - type: "string", - description: `The globally-unique identifier for the vulnerability. -Traditionally (but not required) refers to the assigned -CVE identifier.`, - }, - modified: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the vulnerability was last modified, if any.", - }, - normative: { - type: "boolean", - }, - published: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the vulnerability was published, if any.", - }, - released: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when software containing the vulnerability first released, if known.", - }, - reserved: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the vulnerability identifier was reserved, if any.", - }, - title: { - type: ["string", "null"], - description: "The title of the vulnerability, if known.", - }, - withdrawn: { - type: ["string", "null"], - format: "date-time", - description: - "The date (in RFC3339 format) of when the vulnerability was last withdrawn, if any.", - }, - }, -} as const; - -export const VulnerabilitySbomStatusSchema = { - allOf: [ - { - $ref: "#/components/schemas/SbomHead", - }, - { - type: "object", - required: ["purl_statuses"], - properties: { - purl_statuses: { - type: "object", - additionalProperties: { - type: "array", - items: { - $ref: "#/components/schemas/PurlSummary", - }, - uniqueItems: true, - }, - propertyNames: { - type: "string", - }, - }, - version: { - type: ["string", "null"], - }, - }, - }, - ], -} as const; - -export const VulnerabilitySummarySchema = { - allOf: [ - { - $ref: "#/components/schemas/VulnerabilityHead", - }, - { - type: "object", - required: ["average_severity", "average_score", "advisories"], - properties: { - advisories: { - type: "array", - items: { - $ref: "#/components/schemas/VulnerabilityAdvisoryHead", - }, - }, - average_score: { - type: ["number", "null"], - format: "double", - description: - "Average (arithmetic mean) score of the vulnerability aggregated from *all* related advisories.", - }, - average_severity: { - oneOf: [ - { - type: "null", - }, - { - $ref: "#/components/schemas/Severity", - description: - "Average (arithmetic mean) severity of the vulnerability aggregated from *all* related advisories.", - }, - ], - }, - }, - }, - ], -} as const; diff --git a/client/src/app/client/services.gen.ts b/client/src/app/client/services.gen.ts deleted file mode 100644 index 8d1181c0..00000000 --- a/client/src/app/client/services.gen.ts +++ /dev/null @@ -1,1129 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { - createClient, - createConfig, - type Options, -} from "@hey-api/client-axios"; -import type { - InfoError, - InfoResponse, - ListAdvisoriesData, - ListAdvisoriesError, - ListAdvisoriesResponse, - UploadAdvisoryData, - UploadAdvisoryError, - UploadAdvisoryResponse, - UpdateAdvisoryLabelsData, - UpdateAdvisoryLabelsError, - UpdateAdvisoryLabelsResponse, - PatchAdvisoryLabelsData, - PatchAdvisoryLabelsError, - PatchAdvisoryLabelsResponse, - GetAdvisoryData, - GetAdvisoryError, - GetAdvisoryResponse, - DeleteAdvisoryData, - DeleteAdvisoryError, - DeleteAdvisoryResponse, - DownloadAdvisoryData, - DownloadAdvisoryError, - DownloadAdvisoryResponse, - SearchComponentData, - SearchComponentError, - SearchComponentResponse, - GetComponentData, - GetComponentError, - GetComponentResponse, - RenderSbomGraphData, - RenderSbomGraphError, - RenderSbomGraphResponse, - StatusError, - StatusResponse, - UploadDatasetData, - UploadDatasetError, - UploadDatasetResponse, - ListImportersError, - ListImportersResponse, - GetImporterData, - GetImporterError, - GetImporterResponse, - UpdateImporterData, - UpdateImporterError, - UpdateImporterResponse, - CreateImporterData, - CreateImporterError, - CreateImporterResponse, - DeleteImporterData, - DeleteImporterError, - DeleteImporterResponse, - PatchImporterData, - PatchImporterError, - PatchImporterResponse, - EnableImporterData, - EnableImporterError, - EnableImporterResponse, - ForceRunImporterData, - ForceRunImporterError, - ForceRunImporterResponse, - ListImporterReportsData, - ListImporterReportsError, - ListImporterReportsResponse, - ListLicensesData, - ListLicensesError, - ListLicensesResponse, - ListSpdxLicensesData, - ListSpdxLicensesError, - ListSpdxLicensesResponse, - GetSpdxLicenseData, - GetSpdxLicenseError, - GetSpdxLicenseResponse, - GetLicensesData, - GetLicensesError, - GetLicensesResponse, - GetLicensePurlsData, - GetLicensePurlsError, - GetLicensePurlsResponse, - ListOrganizationsData, - ListOrganizationsError, - ListOrganizationsResponse, - GetOrganizationData, - GetOrganizationError, - GetOrganizationResponse, - ListProductsData, - ListProductsError, - ListProductsResponse, - GetProductData, - GetProductError, - GetProductResponse, - DeleteProductData, - DeleteProductError, - DeleteProductResponse, - ListPurlData, - ListPurlError, - ListPurlResponse, - ListBasePurlsData, - ListBasePurlsError, - ListBasePurlsResponse, - GetBasePurlData, - GetBasePurlError, - GetBasePurlResponse, - ListPurlTypesError, - ListPurlTypesResponse, - GetPurlTypeData, - GetPurlTypeError, - GetPurlTypeResponse, - GetBasePurlOfTypeData, - GetBasePurlOfTypeError, - GetBasePurlOfTypeResponse, - GetVersionedPurlOfTypeData, - GetVersionedPurlOfTypeError, - GetVersionedPurlOfTypeResponse, - GetVersionedPurlData, - GetVersionedPurlError, - GetVersionedPurlResponse, - GetPurlData, - GetPurlError, - GetPurlResponse, - ListSbomsData, - ListSbomsError, - ListSbomsResponse, - UploadSbomData, - UploadSbomError, - UploadSbomResponse, - ListRelatedSbomsData, - ListRelatedSbomsError, - ListRelatedSbomsResponse, - CountRelatedSbomsData, - CountRelatedSbomsError, - CountRelatedSbomsResponse, - GetSbomData, - GetSbomError, - GetSbomResponse, - DeleteSbomData, - DeleteSbomError, - DeleteSbomResponse, - GetSbomAdvisoriesData, - GetSbomAdvisoriesError, - GetSbomAdvisoriesResponse, - UpdateSbomLabelsData, - UpdateSbomLabelsError, - UpdateSbomLabelsResponse, - PatchSbomLabelsData, - PatchSbomLabelsError, - PatchSbomLabelsResponse, - ListPackagesData, - ListPackagesError, - ListPackagesResponse, - ListRelatedPackagesData, - ListRelatedPackagesError, - ListRelatedPackagesResponse, - DownloadSbomData, - DownloadSbomError, - DownloadSbomResponse, - GetUserPreferencesData, - GetUserPreferencesError, - GetUserPreferencesResponse, - SetUserPreferencesData, - SetUserPreferencesError, - SetUserPreferencesResponse, - DeleteUserPreferencesData, - DeleteUserPreferencesError, - DeleteUserPreferencesResponse, - ListVulnerabilitiesData, - ListVulnerabilitiesError, - ListVulnerabilitiesResponse, - GetVulnerabilityData, - GetVulnerabilityError, - GetVulnerabilityResponse, - DeleteVulnerabilityData, - DeleteVulnerabilityError, - DeleteVulnerabilityResponse, - ListWeaknessesData, - ListWeaknessesError, - ListWeaknessesResponse, - GetWeaknessData, - GetWeaknessError, - GetWeaknessResponse, -} from "./types.gen"; - -export const client = createClient(createConfig()); - -export const info = ( - options?: Options -) => { - return (options?.client ?? client).get( - { - ...options, - url: "/.well-known/trustify", - } - ); -}; - -/** - * List advisories - */ -export const listAdvisories = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListAdvisoriesResponse, - ListAdvisoriesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory", - }); -}; - -/** - * Upload a new advisory - */ -export const uploadAdvisory = ( - options: Options -) => { - return (options?.client ?? client).post< - UploadAdvisoryResponse, - UploadAdvisoryError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory", - }); -}; - -/** - * Replace the labels of an advisory - */ -export const updateAdvisoryLabels = ( - options: Options -) => { - return (options?.client ?? client).put< - UpdateAdvisoryLabelsResponse, - UpdateAdvisoryLabelsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory/{id}/label", - }); -}; - -/** - * Modify existing labels of an advisory - */ -export const patchAdvisoryLabels = ( - options: Options -) => { - return (options?.client ?? client).patch< - PatchAdvisoryLabelsResponse, - PatchAdvisoryLabelsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory/{id}/label", - }); -}; - -/** - * Get an advisory - */ -export const getAdvisory = ( - options: Options -) => { - return (options?.client ?? client).get< - GetAdvisoryResponse, - GetAdvisoryError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory/{key}", - }); -}; - -/** - * Delete an advisory - */ -export const deleteAdvisory = ( - options: Options -) => { - return (options?.client ?? client).delete< - DeleteAdvisoryResponse, - DeleteAdvisoryError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory/{key}", - }); -}; - -/** - * Download an advisory document - */ -export const downloadAdvisory = ( - options: Options -) => { - return (options?.client ?? client).get< - DownloadAdvisoryResponse, - DownloadAdvisoryError, - ThrowOnError - >({ - ...options, - url: "/api/v2/advisory/{key}/download", - }); -}; - -export const searchComponent = ( - options?: Options -) => { - return (options?.client ?? client).get< - SearchComponentResponse, - SearchComponentError, - ThrowOnError - >({ - ...options, - url: "/api/v2/analysis/component", - }); -}; - -export const getComponent = ( - options: Options -) => { - return (options?.client ?? client).get< - GetComponentResponse, - GetComponentError, - ThrowOnError - >({ - ...options, - url: "/api/v2/analysis/component/{key}", - }); -}; - -export const renderSbomGraph = ( - options: Options -) => { - return (options?.client ?? client).get< - RenderSbomGraphResponse, - RenderSbomGraphError, - ThrowOnError - >({ - ...options, - url: "/api/v2/analysis/sbom/{sbom}/render", - }); -}; - -export const status = ( - options?: Options -) => { - return (options?.client ?? client).get< - StatusResponse, - StatusError, - ThrowOnError - >({ - ...options, - url: "/api/v2/analysis/status", - }); -}; - -/** - * Upload a new dataset - */ -export const uploadDataset = ( - options: Options -) => { - return (options?.client ?? client).post< - UploadDatasetResponse, - UploadDatasetError, - ThrowOnError - >({ - ...options, - url: "/api/v2/dataset", - }); -}; - -/** - * List importer configurations - */ -export const listImporters = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListImportersResponse, - ListImportersError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer", - }); -}; - -/** - * Get an importer configuration - */ -export const getImporter = ( - options: Options -) => { - return (options?.client ?? client).get< - GetImporterResponse, - GetImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}", - }); -}; - -/** - * Update an existing importer configuration - */ -export const updateImporter = ( - options: Options -) => { - return (options?.client ?? client).put< - UpdateImporterResponse, - UpdateImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}", - }); -}; - -/** - * Create a new importer configuration - */ -export const createImporter = ( - options: Options -) => { - return (options?.client ?? client).post< - CreateImporterResponse, - CreateImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}", - }); -}; - -/** - * Delete an importer configuration - */ -export const deleteImporter = ( - options: Options -) => { - return (options?.client ?? client).delete< - DeleteImporterResponse, - DeleteImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}", - }); -}; - -/** - * Update an existing importer configuration - */ -export const patchImporter = ( - options: Options -) => { - return (options?.client ?? client).patch< - PatchImporterResponse, - PatchImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}", - }); -}; - -/** - * Update an existing importer configuration - */ -export const enableImporter = ( - options: Options -) => { - return (options?.client ?? client).put< - EnableImporterResponse, - EnableImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}/enabled", - }); -}; - -/** - * Force an importer to run as soon as possible - */ -export const forceRunImporter = ( - options: Options -) => { - return (options?.client ?? client).post< - ForceRunImporterResponse, - ForceRunImporterError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}/force", - }); -}; - -/** - * Get reports for an importer - */ -export const listImporterReports = ( - options: Options -) => { - return (options?.client ?? client).get< - ListImporterReportsResponse, - ListImporterReportsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/importer/{name}/report", - }); -}; - -/** - * List licenses - */ -export const listLicenses = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListLicensesResponse, - ListLicensesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/license", - }); -}; - -/** - * List SPDX licenses - */ -export const listSpdxLicenses = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListSpdxLicensesResponse, - ListSpdxLicensesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/license/spdx/license", - }); -}; - -/** - * Get SPDX license details - */ -export const getSpdxLicense = ( - options: Options -) => { - return (options?.client ?? client).get< - GetSpdxLicenseResponse, - GetSpdxLicenseError, - ThrowOnError - >({ - ...options, - url: "/api/v2/license/spdx/license/{id}", - }); -}; - -/** - * Retrieve license details - */ -export const getLicenses = ( - options: Options -) => { - return (options?.client ?? client).get< - GetLicensesResponse, - GetLicensesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/license/{uuid}", - }); -}; - -/** - * Retrieve pURLs covered by a license - */ -export const getLicensePurls = ( - options: Options -) => { - return (options?.client ?? client).get< - GetLicensePurlsResponse, - GetLicensePurlsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/license/{uuid}/purl", - }); -}; - -/** - * List organizations - */ -export const listOrganizations = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListOrganizationsResponse, - ListOrganizationsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/organization", - }); -}; - -/** - * Retrieve organization details - */ -export const getOrganization = ( - options: Options -) => { - return (options?.client ?? client).get< - GetOrganizationResponse, - GetOrganizationError, - ThrowOnError - >({ - ...options, - url: "/api/v2/organization/{id}", - }); -}; - -export const listProducts = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListProductsResponse, - ListProductsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/product", - }); -}; - -export const getProduct = ( - options: Options -) => { - return (options?.client ?? client).get< - GetProductResponse, - GetProductError, - ThrowOnError - >({ - ...options, - url: "/api/v2/product/{id}", - }); -}; - -export const deleteProduct = ( - options: Options -) => { - return (options?.client ?? client).delete< - DeleteProductResponse, - DeleteProductError, - ThrowOnError - >({ - ...options, - url: "/api/v2/product/{id}", - }); -}; - -/** - * List fully-qualified pURLs - */ -export const listPurl = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListPurlResponse, - ListPurlError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl", - }); -}; - -/** - * List base versionless pURLs - */ -export const listBasePurls = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListBasePurlsResponse, - ListBasePurlsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/base", - }); -}; - -/** - * Retrieve details about a base versionless pURL - */ -export const getBasePurl = ( - options: Options -) => { - return (options?.client ?? client).get< - GetBasePurlResponse, - GetBasePurlError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/base/{key}", - }); -}; - -/** - * List known pURL types - */ -export const listPurlTypes = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListPurlTypesResponse, - ListPurlTypesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/type", - }); -}; - -/** - * Retrieve details about a pURL type - */ -export const getPurlType = ( - options: Options -) => { - return (options?.client ?? client).get< - GetPurlTypeResponse, - GetPurlTypeError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/type/{type}", - }); -}; - -/** - * Retrieve base pURL details of a type - */ -export const getBasePurlOfType = ( - options: Options -) => { - return (options?.client ?? client).get< - GetBasePurlOfTypeResponse, - GetBasePurlOfTypeError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/type/{type}/{namespace_and_name}", - }); -}; - -/** - * Retrieve versioned pURL details of a type - */ -export const getVersionedPurlOfType = ( - options: Options -) => { - return (options?.client ?? client).get< - GetVersionedPurlOfTypeResponse, - GetVersionedPurlOfTypeError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/type/{type}/{namespace_and_name}@{version}", - }); -}; - -/** - * Retrieve details of a versioned, non-qualified pURL - */ -export const getVersionedPurl = ( - options: Options -) => { - return (options?.client ?? client).get< - GetVersionedPurlResponse, - GetVersionedPurlError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/version/{key}", - }); -}; - -/** - * Retrieve details of a fully-qualified pURL - */ -export const getPurl = ( - options: Options -) => { - return (options?.client ?? client).get< - GetPurlResponse, - GetPurlError, - ThrowOnError - >({ - ...options, - url: "/api/v2/purl/{key}", - }); -}; - -export const listSboms = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListSbomsResponse, - ListSbomsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom", - }); -}; - -/** - * Upload a new SBOM - */ -export const uploadSbom = ( - options: Options -) => { - return (options?.client ?? client).post< - UploadSbomResponse, - UploadSbomError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom", - }); -}; - -/** - * Find all SBOMs containing the provided package. - * The package can be provided either via a PURL or using the ID of a package as returned by - * other APIs, but not both. - */ -export const listRelatedSboms = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListRelatedSbomsResponse, - ListRelatedSbomsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/by-package", - }); -}; - -/** - * Count all SBOMs containing the provided packages. - * The packages can be provided either via a PURL or using the ID of a package as returned by - * other APIs, but not both. - */ -export const countRelatedSboms = ( - options: Options -) => { - return (options?.client ?? client).get< - CountRelatedSbomsResponse, - CountRelatedSbomsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/count-by-package", - }); -}; - -export const getSbom = ( - options: Options -) => { - return (options?.client ?? client).get< - GetSbomResponse, - GetSbomError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}", - }); -}; - -export const deleteSbom = ( - options: Options -) => { - return (options?.client ?? client).delete< - DeleteSbomResponse, - DeleteSbomError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}", - }); -}; - -export const getSbomAdvisories = ( - options: Options -) => { - return (options?.client ?? client).get< - GetSbomAdvisoriesResponse, - GetSbomAdvisoriesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}/advisory", - }); -}; - -/** - * Replace the labels of an SBOM - */ -export const updateSbomLabels = ( - options: Options -) => { - return (options?.client ?? client).put< - UpdateSbomLabelsResponse, - UpdateSbomLabelsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}/label", - }); -}; - -/** - * Modify existing labels of an SBOM - */ -export const patchSbomLabels = ( - options: Options -) => { - return (options?.client ?? client).patch< - PatchSbomLabelsResponse, - PatchSbomLabelsError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}/label", - }); -}; - -/** - * Search for packages of an SBOM - */ -export const listPackages = ( - options: Options -) => { - return (options?.client ?? client).get< - ListPackagesResponse, - ListPackagesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}/packages", - }); -}; - -/** - * Search for related packages in an SBOM - */ -export const listRelatedPackages = ( - options: Options -) => { - return (options?.client ?? client).get< - ListRelatedPackagesResponse, - ListRelatedPackagesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{id}/related", - }); -}; - -export const downloadSbom = ( - options: Options -) => { - return (options?.client ?? client).get< - DownloadSbomResponse, - DownloadSbomError, - ThrowOnError - >({ - ...options, - url: "/api/v2/sbom/{key}/download", - }); -}; - -/** - * Get user preferences - */ -export const getUserPreferences = ( - options: Options -) => { - return (options?.client ?? client).get< - GetUserPreferencesResponse, - GetUserPreferencesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/userPreference/{key}", - }); -}; - -/** - * Set user preferences - */ -export const setUserPreferences = ( - options: Options -) => { - return (options?.client ?? client).put< - SetUserPreferencesResponse, - SetUserPreferencesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/userPreference/{key}", - }); -}; - -/** - * Delete user preferences - */ -export const deleteUserPreferences = ( - options: Options -) => { - return (options?.client ?? client).delete< - DeleteUserPreferencesResponse, - DeleteUserPreferencesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/userPreference/{key}", - }); -}; - -/** - * List vulnerabilities - */ -export const listVulnerabilities = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListVulnerabilitiesResponse, - ListVulnerabilitiesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/vulnerability", - }); -}; - -/** - * Retrieve vulnerability details - */ -export const getVulnerability = ( - options: Options -) => { - return (options?.client ?? client).get< - GetVulnerabilityResponse, - GetVulnerabilityError, - ThrowOnError - >({ - ...options, - url: "/api/v2/vulnerability/{id}", - }); -}; - -/** - * Delete vulnerability - */ -export const deleteVulnerability = ( - options: Options -) => { - return (options?.client ?? client).delete< - DeleteVulnerabilityResponse, - DeleteVulnerabilityError, - ThrowOnError - >({ - ...options, - url: "/api/v2/vulnerability/{id}", - }); -}; - -/** - * List weaknesses - */ -export const listWeaknesses = ( - options?: Options -) => { - return (options?.client ?? client).get< - ListWeaknessesResponse, - ListWeaknessesError, - ThrowOnError - >({ - ...options, - url: "/api/v2/weakness", - }); -}; - -/** - * Retrieve weakness details - */ -export const getWeakness = ( - options: Options -) => { - return (options?.client ?? client).get< - GetWeaknessResponse, - GetWeaknessError, - ThrowOnError - >({ - ...options, - url: "/api/v2/weakness/{id}", - }); -}; diff --git a/client/src/app/client/types.gen.ts b/client/src/app/client/types.gen.ts deleted file mode 100644 index 5cf106e0..00000000 --- a/client/src/app/client/types.gen.ts +++ /dev/null @@ -1,2005 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type AdvisoryDetails = AdvisoryHead & - (null | SourceDocument) & { - /** - * Average (arithmetic mean) score of the advisory aggregated from *all* related vulnerability assertions. - */ - average_score: number | null; - average_severity: null | Severity; - /** - * Vulnerabilities addressed within this advisory. - */ - vulnerabilities: Array; - }; - -export type AdvisoryHead = { - /** - * The identifier of the advisory, as provided by the document. - */ - document_id: string; - /** - * The identifier of the advisory, as assigned by the issuing organization. - */ - identifier: string; - issuer: null | OrganizationSummary; - /** - * Informational labels attached by the system or users to this advisory. - */ - labels: Labels; - /** - * The date (in RFC3339 format) of when the advisory was last modified, if any. - */ - modified?: string | null; - /** - * The date (in RFC3339 format) of when the advisory was published, if any. - */ - published: string | null; - /** - * The title of the advisory as assigned by the issuing organization. - */ - title: string | null; - /** - * The opaque UUID of the advisory. - */ - uuid: string; - /** - * The date (in RFC3339 format) of when the advisory was withdrawn, if any. - */ - withdrawn: string | null; -}; - -export type AdvisorySummary = AdvisoryHead & - (null | SourceDocument) & { - /** - * Average (arithmetic mean) score of the advisory aggregated from *all* related vulnerability assertions. - */ - average_score: number | null; - /** - * Average (arithmetic mean) severity of the advisory aggregated from *all* related vulnerability assertions. - */ - average_severity: string | null; - /** - * Vulnerabilities addressed within this advisory. - */ - vulnerabilities: Array; - }; - -export type AdvisoryVulnerabilityHead = VulnerabilityHead & { - /** - * The average (arithmetic mean) score this advisory assigns to - * the particular vulnerability. - */ - score: number; - /** - * The English-language word description of the severity of the given - * vulnerability, as asserted by the advisory, using the CVSS bucketing - * ranges. - * - * Critical: 9.0–10.0 - * High: 7.0–8.9 - * Medium: 4.0–6.9 - * Low: 0.1–3.9 - * None: 0 - */ - severity: Severity; -}; - -/** - * Summary of information from this advisory regarding a single specific vulnerability. - */ -export type AdvisoryVulnerabilitySummary = AdvisoryVulnerabilityHead & { - /** - * All CVSS3 scores from the advisory for the given vulnerability. - * May include several, varying by minor version of the CVSS3 vector. - */ - cvss3_scores: Array; -}; - -export type AnalysisStatus = { - /** - * The number of graphs loaded in memory - */ - graph_count: number; - /** - * The number of SBOMs found in the database - */ - sbom_count: number; -}; - -export type BasePurlDetails = BasePurlHead & { - versions: Array; -}; - -export type BasePurlHead = { - /** - * The actual base PURL - */ - purl: Purl; - /** - * The ID of the base PURL - */ - uuid: string; -}; - -export type BasePurlSummary = BasePurlHead; - -export type BaseSummary = { - cpe: Array; - document_id: string; - name: string; - node_id: string; - product_name: string; - product_version: string; - published: string; - purl: Array; - sbom_id: string; - version: string; -}; - -export type BinaryByteSize = string; - -export type ClearlyDefinedCurationImporter = CommonImporter & { - source?: string; - types?: Array; -}; - -export type ClearlyDefinedImporter = CommonImporter & { - source?: string; - types?: Array; -}; - -export type ClearlyDefinedPackageType = - | "composer" - | "crate" - | "deb" - | "gem" - | "git" - | "go" - | "maven" - | "npm" - | "nuget" - | "pod" - | "pypi"; - -export type CommonImporter = { - /** - * A description for users. - */ - description?: string | null; - /** - * A flag to disable the importer, without deleting it. - */ - disabled?: boolean; - /** - * Labels which will be applied to the ingested documents. - */ - labels?: Labels; - /** - * The period the importer should be run. - */ - period: string; -}; - -export type Cpe = string; - -export type CsafImporter = CommonImporter & { - fetchRetries?: number | null; - ignoreMissing?: boolean; - onlyPatterns?: Array; - source: string; - v3Signatures?: boolean; -}; - -export type CveImporter = CommonImporter & { - source?: string; - startYear?: number | null; - years?: Array; -}; - -export type CweImporter = CommonImporter & { - source?: string; -}; - -export type ExternalReferenceQuery = { - cpe?: null | Cpe; - purl?: null | Purl; -}; - -/** - * A hash/digest prefixed with its type. - */ -export type Id = string; - -export type Importer = ImporterData & { - name: string; -}; - -export type ImporterConfiguration = - | { - sbom: SbomImporter; - } - | { - csaf: CsafImporter; - } - | { - osv: OsvImporter; - } - | { - cve: CveImporter; - } - | { - clearlyDefined: ClearlyDefinedImporter; - } - | { - clearlyDefinedCuration: ClearlyDefinedCurationImporter; - } - | { - cwe: CweImporter; - }; - -export type ImporterData = { - configuration: ImporterConfiguration; - /** - * The continuation token of the importer. - */ - continuation?: unknown; - /** - * The last state change - */ - lastChange: string; - /** - * The error of the last run (empty if successful) - */ - lastError?: string | null; - /** - * The last run (successful or not) - */ - lastRun?: string | null; - /** - * The last successful run - */ - lastSuccess?: string | null; - /** - * The current progress. - */ - progress?: Progress; - /** - * The current state of the importer - */ - state: State; -}; - -export type ImporterReport = { - /** - * The time the report was created - */ - creation: string; - /** - * Errors captured by the report - */ - error?: string | null; - /** - * The ID of the report - */ - id: string; - /** - * The name of the importer this report belongs to - */ - importer: string; - report?: null | Report; -}; - -/** - * The result of the ingestion process - */ -export type IngestResult = { - /** - * The ID declared by the document - */ - document_id?: string | null; - /** - * The internal ID of the document - */ - id: Id; - /** - * Warnings that occurred during the import process - */ - warnings?: Array; -}; - -export type Labels = { - [key: string]: string; -}; - -export type LicenseSummary = { - id: string; - license: string; - purls: number; - spdx_license_exceptions: Array; - spdx_licenses: Array; -}; - -export type Message = { - /** - * The message - */ - message: string; - /** - * The severity of the message - */ - severity: Severity; -}; - -export type OrganizationDetails = OrganizationHead & { - /** - * Advisories issued by the organization, if any. - */ - advisories: Array; -}; - -/** - * An organization who may issue advisories, product SBOMs, or - * otherwise be involved in supply-chain evidence. - */ -export type OrganizationHead = { - /** - * The `CPE` key of the organization, if known. - */ - cpe_key: string | null; - /** - * The opaque UUID of the organization. - */ - id: string; - /** - * The name of the organization. - */ - name: string; - /** - * The website of the organization, if known. - */ - website: string | null; -}; - -export type OrganizationSummary = OrganizationHead; - -export type OsvImporter = CommonImporter & { - /** - * An optional branch. Will use the default branch otherwise. - */ - branch?: string | null; - /** - * An optional path to start searching for documents. Will use the root of the repository otherwise. - */ - path?: string | null; - /** - * The URL to the git repository of the OSV data - */ - source: string; - startYear?: number | null; - years?: Array; -}; - -export type PaginatedResults_AdvisorySummary = { - items: Array< - AdvisoryHead & - (null | SourceDocument) & { - /** - * Average (arithmetic mean) score of the advisory aggregated from *all* related vulnerability assertions. - */ - average_score: number | null; - /** - * Average (arithmetic mean) severity of the advisory aggregated from *all* related vulnerability assertions. - */ - average_severity: string | null; - /** - * Vulnerabilities addressed within this advisory. - */ - vulnerabilities: Array; - } - >; - total: number; -}; - -export type PaginatedResults_BasePurlSummary = { - items: Array; - total: number; -}; - -export type PaginatedResults_BaseSummary = { - items: Array<{ - cpe: Array; - document_id: string; - name: string; - node_id: string; - product_name: string; - product_version: string; - published: string; - purl: Array; - sbom_id: string; - version: string; - }>; - total: number; -}; - -export type PaginatedResults_ImporterReport = { - items: Array<{ - /** - * The time the report was created - */ - creation: string; - /** - * Errors captured by the report - */ - error?: string | null; - /** - * The ID of the report - */ - id: string; - /** - * The name of the importer this report belongs to - */ - importer: string; - report?: null | Report; - }>; - total: number; -}; - -export type PaginatedResults_LicenseSummary = { - items: Array<{ - id: string; - license: string; - purls: number; - spdx_license_exceptions: Array; - spdx_licenses: Array; - }>; - total: number; -}; - -export type PaginatedResults_ProductSummary = { - items: Array< - ProductHead & { - vendor: null | OrganizationSummary; - versions: Array; - } - >; - total: number; -}; - -export type PaginatedResults_PurlSummary = { - items: Array< - PurlHead & { - base: BasePurlHead; - qualifiers: { - [key: string]: string; - }; - version: VersionedPurlHead; - } - >; - total: number; -}; - -export type PaginatedResults_SbomPackage = { - items: Array<{ - cpe: Array; - id: string; - name: string; - purl: Array; - version?: string | null; - }>; - total: number; -}; - -export type PaginatedResults_SbomPackageRelation = { - items: Array<{ - package: SbomPackage; - relationship: Relationship; - }>; - total: number; -}; - -export type PaginatedResults_SbomSummary = { - items: Array< - SbomHead & - (null | SourceDocument) & { - described_by: Array; - } - >; - total: number; -}; - -export type PaginatedResults_SpdxLicenseSummary = { - items: Array<{ - id: string; - name: string; - }>; - total: number; -}; - -export type PaginatedResults_VulnerabilitySummary = { - items: Array< - VulnerabilityHead & { - advisories: Array; - /** - * Average (arithmetic mean) score of the vulnerability aggregated from *all* related advisories. - */ - average_score: number | null; - average_severity: null | Severity; - } - >; - total: number; -}; - -export type ProductDetails = ProductHead & { - vendor: null | OrganizationSummary; - versions: Array; -}; - -export type ProductHead = { - id: string; - name: string; -}; - -export type ProductSbomHead = { - labels: Labels; - published: string | null; -}; - -export type ProductSummary = ProductHead & { - vendor: null | OrganizationSummary; - versions: Array; -}; - -export type ProductVersionDetails = ProductVersionHead & { - sbom?: null | ProductSbomHead; -}; - -export type ProductVersionHead = { - id: string; - sbom_id?: string; - version: string; -}; - -export type Progress = (null | ProgressDetails) & { - message?: string | null; -}; - -export type ProgressDetails = { - /** - * The current processed items. - */ - current: number; - /** - * The estimated time of completion. - */ - estimatedCompletion: string; - /** - * The estimated remaining time in seconds. - */ - estimatedSecondsRemaining: number; - /** - * Progress in percent (0..=1) - */ - percent: number; - /** - * The average processing rate (per second). - */ - rate: number; - /** - * The total number of items to be processed. - */ - total: number; -}; - -export type Purl = string; - -export type PurlAdvisory = AdvisoryHead & { - status: Array; -}; - -export type PurlDetails = PurlHead & { - advisories: Array; - base: BasePurlHead; - licenses: Array; - version: VersionedPurlHead; -}; - -export type PurlHead = { - /** - * The actual qualified PURL - */ - purl: Purl; - /** - * The ID of the qualified PURL - */ - uuid: string; -}; - -export type PurlLicenseSummary = { - licenses: Array; - sbom: SbomHead; -}; - -export type PurlStatus = { - average_severity: Severity; - context: null | StatusContext; - status: string; - vulnerability: VulnerabilityHead; -}; - -export type PurlSummary = PurlHead & { - base: BasePurlHead; - qualifiers: { - [key: string]: string; - }; - version: VersionedPurlHead; -}; - -export type Relationship = - | "contains" - | "dependency" - | "dev_dependency" - | "optional_dependency" - | "provided_dependency" - | "test_dependency" - | "runtime_dependency" - | "example" - | "generates" - | "ancestor_of" - | "variant" - | "build_tool" - | "dev_tool" - | "describes" - | "package" - | "undefined"; - -export type Report = { - /** - * End of the import run - */ - endDate: string; - /** - * Messages emitted during processing - */ - messages?: { - [key: string]: { - [key: string]: Array; - }; - }; - /** - * Number of processes items - */ - numberOfItems?: number; - /** - * Start of the import run - */ - startDate: string; -}; - -/** - * A struct wrapping an item with a revision. - * - * If the revision should not be part of the payload, but e.g. an HTTP header (like `ETag`), this - * struct can help carrying both pieces. - */ -export type Revisioned_Importer = { - /** - * The revision. - * - * An opaque string that should have no meaning to the user, only to the backend. - */ - revision: string; - value: ImporterData & { - name: string; - }; -}; - -export type SbomAdvisory = AdvisoryHead & { - status: Array; -}; - -export type SbomHead = { - authors: Array; - data_licenses: Array; - document_id?: string | null; - id: string; - labels: Labels; - name: string; - /** - * The number of packages this SBOM has - */ - number_of_packages: number; - published: string | null; -}; - -export type SbomImporter = CommonImporter & { - fetchRetries?: number | null; - ignoreMissing?: boolean; - keys?: Array; - onlyPatterns?: Array; - sizeLimit?: null | BinaryByteSize; - source: string; - v3Signatures?: boolean; -}; - -export type SbomPackage = { - cpe: Array; - id: string; - name: string; - purl: Array; - version?: string | null; -}; - -export type SbomPackageRelation = { - package: SbomPackage; - relationship: Relationship; -}; - -export type SbomStatus = VulnerabilityHead & { - average_severity: Severity; - context?: null | StatusContext; - packages: Array; - status: string; -}; - -export type SbomSummary = SbomHead & - (null | SourceDocument) & { - described_by: Array; - }; - -/** - * Qualitative Severity Rating Scale - * - * Described in CVSS v3.1 Specification: Section 5: - * - * - * > For some purposes it is useful to have a textual representation of the - * > numeric Base, Temporal and Environmental scores. - */ -export type Severity = "none" | "low" | "medium" | "high" | "critical"; - -export type SourceDocument = { - /** - * The timestamp the document was ingested - */ - ingested: string; - sha256: string; - sha384: string; - sha512: string; - size: number; -}; - -export type SpdxLicenseDetails = SpdxLicenseSummary & { - text: string; -}; - -export type SpdxLicenseSummary = { - id: string; - name: string; -}; - -export type State = "waiting" | "running"; - -export type StatusContext = - | { - purl: Purl; - } - | { - cpe: string; - }; - -export type TypeCounts = { - base: number; - package: number; - version: number; -}; - -export type TypeHead = { - name: string; -}; - -export type TypeSummary = TypeHead & { - counts: TypeCounts; -}; - -export type VersionedPurlAdvisory = AdvisoryHead & { - status: Array; -}; - -export type VersionedPurlDetails = VersionedPurlHead & { - advisories: Array; - base: BasePurlHead; - purls: Array; -}; - -export type VersionedPurlHead = { - /** - * The actual, versioned PURL - */ - purl: Purl; - /** - * The ID of the versioned PURL - */ - uuid: string; - /** - * The version from the PURL - */ - version: string; -}; - -export type VersionedPurlStatus = { - status: string; - vulnerability: VulnerabilityHead; -}; - -export type VersionedPurlSummary = VersionedPurlHead & { - base: BasePurlHead; - purls: Array; -}; - -export type VulnerabilityAdvisoryHead = AdvisoryHead & { - score: number | null; - severity: null | Severity; -}; - -export type VulnerabilityAdvisoryStatus = { - base_purl: BasePurlHead; - context: null | StatusContext; - version: string; -}; - -export type VulnerabilityAdvisorySummary = VulnerabilityAdvisoryHead & { - /** - * CVSS3 scores from this advisory regarding the vulnerability. - */ - cvss3_scores: Array; - /** - * The total number of vulnerabilities described by this advisory - */ - number_of_vulnerabilities: number; - purls: { - [key: string]: Array; - }; - /** - * SBOMs claimed by this advisory to be addressed by this vulnerability. - */ - sboms: Array; -}; - -export type VulnerabilityDetails = VulnerabilityHead & { - /** - * Advisories addressing this vulnerability, if any. - */ - advisories: Array; - /** - * Average (arithmetic mean) score of the vulnerability aggregated from *all* related advisories. - */ - average_score: number | null; - average_severity: null | Severity; -}; - -export type VulnerabilityHead = { - /** - * Associated CWE, if any. - */ - cwes: Array; - /** - * The description of the vulnerability, if known. - */ - description: string | null; - /** - * The date (in RFC3339 format) of when the vulnerability was discovered, if any. - */ - discovered: string | null; - /** - * The globally-unique identifier for the vulnerability. - * Traditionally (but not required) refers to the assigned - * CVE identifier. - */ - identifier: string; - /** - * The date (in RFC3339 format) of when the vulnerability was last modified, if any. - */ - modified: string | null; - normative: boolean; - /** - * The date (in RFC3339 format) of when the vulnerability was published, if any. - */ - published: string | null; - /** - * The date (in RFC3339 format) of when software containing the vulnerability first released, if known. - */ - released: string | null; - /** - * The date (in RFC3339 format) of when the vulnerability identifier was reserved, if any. - */ - reserved: string | null; - /** - * The title of the vulnerability, if known. - */ - title: string | null; - /** - * The date (in RFC3339 format) of when the vulnerability was last withdrawn, if any. - */ - withdrawn: string | null; -}; - -export type VulnerabilitySbomStatus = SbomHead & { - purl_statuses: { - [key: string]: Array; - }; - version?: string | null; -}; - -export type VulnerabilitySummary = VulnerabilityHead & { - advisories: Array; - /** - * Average (arithmetic mean) score of the vulnerability aggregated from *all* related advisories. - */ - average_score: number | null; - average_severity: null | Severity; -}; - -export type InfoResponse = { - build?: { - [key: string]: unknown; - }; - version: string; -}; - -export type InfoError = unknown; - -export type ListAdvisoriesData = { - query?: { - deprecated?: "Ignore" | "Consider"; - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListAdvisoriesResponse = PaginatedResults_AdvisorySummary; - -export type ListAdvisoriesError = unknown; - -export type UploadAdvisoryData = { - body: Blob | File; - query: { - /** - * Optional issuer if it cannot be determined from advisory contents. - */ - issuer?: string | null; - /** - * Optional labels. - * - * Only use keys with a prefix of `labels.` - */ - labels: Labels; - }; -}; - -export type UploadAdvisoryResponse = unknown; - -export type UploadAdvisoryError = unknown; - -export type UpdateAdvisoryLabelsData = { - body: Labels; - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: Id; - }; -}; - -export type UpdateAdvisoryLabelsResponse = void; - -export type UpdateAdvisoryLabelsError = unknown; - -export type PatchAdvisoryLabelsData = { - body: Labels; - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: Id; - }; -}; - -export type PatchAdvisoryLabelsResponse = void; - -export type PatchAdvisoryLabelsError = unknown; - -export type GetAdvisoryData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - key: string; - }; -}; - -export type GetAdvisoryResponse = AdvisoryDetails; - -export type GetAdvisoryError = unknown; - -export type DeleteAdvisoryData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - key: string; - }; -}; - -export type DeleteAdvisoryResponse = AdvisoryDetails; - -export type DeleteAdvisoryError = unknown; - -export type DownloadAdvisoryData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' - */ - key: string; - }; -}; - -export type DownloadAdvisoryResponse = Blob | File; - -export type DownloadAdvisoryError = unknown; - -export type SearchComponentData = { - query?: { - ancestors?: number; - descendants?: number; - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - relationships?: Array; - sort?: string; - }; -}; - -export type SearchComponentResponse = PaginatedResults_BaseSummary; - -export type SearchComponentError = unknown; - -export type GetComponentData = { - path: { - /** - * provide component name, URL-encoded pURL, or CPE itself - */ - key: string; - q: string; - sort: string; - }; - query?: { - ancestors?: number; - descendants?: number; - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - relationships?: Array; - }; -}; - -export type GetComponentResponse = PaginatedResults_BaseSummary; - -export type GetComponentError = unknown; - -export type RenderSbomGraphData = { - path: { - /** - * ID of the SBOM - */ - sbom: string; - }; -}; - -export type RenderSbomGraphResponse = string; - -export type RenderSbomGraphError = unknown; - -export type StatusResponse = AnalysisStatus; - -export type StatusError = unknown; - -export type UploadDatasetData = { - body: Blob | File; - query: { - /** - * Optional labels. - * - * Only use keys with a prefix of `labels.` - */ - labels: Labels; - }; -}; - -export type UploadDatasetResponse = unknown; - -export type UploadDatasetError = unknown; - -export type ListImportersResponse = Array; - -export type ListImportersError = unknown; - -export type GetImporterData = { - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type GetImporterResponse = Revisioned_Importer; - -export type GetImporterError = unknown; - -export type UpdateImporterData = { - body: ImporterConfiguration; - headers?: { - /** - * The revision to update - */ - "if-match"?: string | null; - }; - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type UpdateImporterResponse = unknown; - -export type UpdateImporterError = unknown; - -export type CreateImporterData = { - body: ImporterConfiguration; - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type CreateImporterResponse = unknown; - -export type CreateImporterError = unknown; - -export type DeleteImporterData = { - headers?: { - /** - * The revision to delete - */ - "if-match"?: string | null; - }; - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type DeleteImporterResponse = unknown; - -export type DeleteImporterError = unknown; - -export type PatchImporterData = { - body: unknown; - headers?: { - /** - * The revision to update - */ - "if-match"?: string | null; - }; - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type PatchImporterResponse = unknown; - -export type PatchImporterError = unknown; - -export type EnableImporterData = { - body: boolean; - headers?: { - /** - * The revision to update - */ - "if-match"?: string | null; - }; - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type EnableImporterResponse = unknown; - -export type EnableImporterError = unknown; - -export type ForceRunImporterData = { - body: boolean; - headers?: { - /** - * The revision to update - */ - "if-match"?: string | null; - }; - path: { - /** - * The name of the importer - */ - name: string; - }; -}; - -export type ForceRunImporterResponse = unknown; - -export type ForceRunImporterError = unknown; - -export type ListImporterReportsData = { - path: { - name: string; - }; -}; - -export type ListImporterReportsResponse = PaginatedResults_ImporterReport; - -export type ListImporterReportsError = unknown; - -export type ListLicensesData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListLicensesResponse = PaginatedResults_LicenseSummary; - -export type ListLicensesError = unknown; - -export type ListSpdxLicensesData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListSpdxLicensesResponse = PaginatedResults_SpdxLicenseSummary; - -export type ListSpdxLicensesError = unknown; - -export type GetSpdxLicenseData = { - path: { - id: string; - }; -}; - -export type GetSpdxLicenseResponse = SpdxLicenseDetails; - -export type GetSpdxLicenseError = unknown; - -export type GetLicensesData = { - path: { - uuid: string; - }; -}; - -export type GetLicensesResponse = LicenseSummary; - -export type GetLicensesError = unknown; - -export type GetLicensePurlsData = { - path: { - uuid: string; - }; - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type GetLicensePurlsResponse = LicenseSummary; - -export type GetLicensePurlsError = unknown; - -export type ListOrganizationsData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListOrganizationsResponse = OrganizationSummary; - -export type ListOrganizationsError = unknown; - -export type GetOrganizationData = { - path: { - /** - * Opaque ID of the organization - */ - id: string; - }; -}; - -export type GetOrganizationResponse = OrganizationDetails; - -export type GetOrganizationError = unknown; - -export type ListProductsData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListProductsResponse = PaginatedResults_ProductSummary; - -export type ListProductsError = unknown; - -export type GetProductData = { - path: { - /** - * Opaque ID of the product - */ - id: string; - }; -}; - -export type GetProductResponse = ProductDetails; - -export type GetProductError = unknown; - -export type DeleteProductData = { - path: { - /** - * Opaque ID of the product - */ - id: string; - }; -}; - -export type DeleteProductResponse = ProductDetails; - -export type DeleteProductError = unknown; - -export type ListPurlData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListPurlResponse = PaginatedResults_PurlSummary; - -export type ListPurlError = unknown; - -export type ListBasePurlsData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListBasePurlsResponse = PaginatedResults_BasePurlSummary; - -export type ListBasePurlsError = unknown; - -export type GetBasePurlData = { - path: { - /** - * opaque identifier for a base PURL, or a URL-encoded pURL itself - */ - key: string; - }; -}; - -export type GetBasePurlResponse = BasePurlDetails; - -export type GetBasePurlError = unknown; - -export type ListPurlTypesResponse = Array; - -export type ListPurlTypesError = unknown; - -export type GetPurlTypeData = { - path: { - /** - * PURL identifier of a type - */ - type: string; - }; - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type GetPurlTypeResponse = PaginatedResults_BasePurlSummary; - -export type GetPurlTypeError = unknown; - -export type GetBasePurlOfTypeData = { - path: { - /** - * name of the package optionally preceded by its namespace - */ - namespace_and_name: string; - /** - * PURL identifier of a type - */ - type: string; - }; -}; - -export type GetBasePurlOfTypeResponse = BasePurlDetails; - -export type GetBasePurlOfTypeError = unknown; - -export type GetVersionedPurlOfTypeData = { - path: { - /** - * name of the package optionally preceded by its namespace - */ - namespace_and_name: string; - /** - * PURL identifier of a type - */ - type: string; - /** - * version of the package - */ - version: string; - }; -}; - -export type GetVersionedPurlOfTypeResponse = VersionedPurlDetails; - -export type GetVersionedPurlOfTypeError = unknown; - -export type GetVersionedPurlData = { - path: { - /** - * opaque ID identifier for a package version, or URL-ecnoded pURL itself - */ - key: string; - }; -}; - -export type GetVersionedPurlResponse = VersionedPurlDetails; - -export type GetVersionedPurlError = unknown; - -export type GetPurlData = { - path: { - /** - * opaque identifier for a fully-qualified PURL, or URL-encoded pURL itself - */ - key: string; - }; - query?: { - deprecated?: "Ignore" | "Consider"; - }; -}; - -export type GetPurlResponse = PurlDetails; - -export type GetPurlError = unknown; - -export type ListSbomsData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListSbomsResponse = PaginatedResults_SbomSummary; - -export type ListSbomsError = unknown; - -export type UploadSbomData = { - body: Array; - query: { - /** - * Optional labels. - * - * Only use keys with a prefix of `labels.` - */ - labels: Labels; - /** - * Source the document came from - */ - location: string; - }; -}; - -export type UploadSbomResponse = IngestResult; - -export type UploadSbomError = unknown; - -export type ListRelatedSbomsData = { - query?: { - /** - * Find by CPE - */ - cpe?: null | Cpe; - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - /** - * Find by PURL - */ - purl?: null | Purl; - q?: string; - sort?: string; - }; -}; - -export type ListRelatedSbomsResponse = PaginatedResults_SbomSummary; - -export type ListRelatedSbomsError = unknown; - -export type CountRelatedSbomsData = { - body: Array; - path: { - /** - * Find by CPE - */ - cpe: null | Cpe; - /** - * Find by PURL - */ - purl: null | Purl; - }; -}; - -export type CountRelatedSbomsResponse = Array; - -export type CountRelatedSbomsError = unknown; - -export type GetSbomData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: string; - }; -}; - -export type GetSbomResponse = SbomSummary; - -export type GetSbomError = unknown; - -export type DeleteSbomData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: string; - }; -}; - -export type DeleteSbomResponse = SbomSummary; - -export type DeleteSbomError = unknown; - -export type GetSbomAdvisoriesData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: string; - }; -}; - -export type GetSbomAdvisoriesResponse = Array; - -export type GetSbomAdvisoriesError = unknown; - -export type UpdateSbomLabelsData = { - body: Labels; - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: Id; - }; -}; - -export type UpdateSbomLabelsResponse = void; - -export type UpdateSbomLabelsError = unknown; - -export type PatchSbomLabelsData = { - body: Labels; - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' or 'urn:uuid:' - */ - id: Id; - }; -}; - -export type PatchSbomLabelsResponse = void; - -export type PatchSbomLabelsError = unknown; - -export type ListPackagesData = { - path: { - /** - * ID of the SBOM to get packages for - */ - id: string; - }; - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListPackagesResponse = PaginatedResults_SbomPackage; - -export type ListPackagesError = unknown; - -export type ListRelatedPackagesData = { - path: { - /** - * ID of SBOM to search packages in - */ - id: string; - }; - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - /** - * The Package to use as reference - */ - reference?: string | null; - /** - * Optional relationship filter - */ - relationship?: null | Relationship; - sort?: string; - /** - * Which side the reference should be on - */ - which?: "left" | "right"; - }; -}; - -export type ListRelatedPackagesResponse = PaginatedResults_SbomPackageRelation; - -export type ListRelatedPackagesError = unknown; - -export type DownloadSbomData = { - path: { - /** - * Digest/hash of the document, prefixed by hash type, such as 'sha256:' - */ - key: string; - }; -}; - -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?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListVulnerabilitiesResponse = PaginatedResults_VulnerabilitySummary; - -export type ListVulnerabilitiesError = unknown; - -export type GetVulnerabilityData = { - path: { - /** - * ID of the vulnerability - */ - id: string; - }; -}; - -export type GetVulnerabilityResponse = VulnerabilityDetails; - -export type GetVulnerabilityError = unknown; - -export type DeleteVulnerabilityData = { - path: { - /** - * ID of the vulnerability - */ - id: string; - }; -}; - -export type DeleteVulnerabilityResponse = VulnerabilityDetails; - -export type DeleteVulnerabilityError = unknown; - -export type ListWeaknessesData = { - query?: { - /** - * The maximum number of entries to return. - * - * Zero means: no limit - */ - limit?: number; - /** - * The first item to return, skipping all that come before it. - * - * NOTE: The order of items is defined by the API being called. - */ - offset?: number; - q?: string; - sort?: string; - }; -}; - -export type ListWeaknessesResponse = PaginatedResults_LicenseSummary; - -export type ListWeaknessesError = unknown; - -export type GetWeaknessData = { - path: { - id: string; - }; -}; - -export type GetWeaknessResponse = LicenseSummary; - -export type GetWeaknessError = unknown; diff --git a/package.json b/package.json index eda5597a..a77bc8ec 100644 --- a/package.json +++ b/package.json @@ -10,16 +10,15 @@ "scripts": { "format:check": "npx prettier --check './**/*.{ts,tsx,js,json}'", "format:fix": "npx prettier --write './**/*.{ts,tsx,js,json}'", - "openapi:generate-client": "npm run openapi:generate-client -w client", - "generate": "npm run openapi:generate-client", + "generate": "npm run generate -ws --if-present", "clean": "rimraf ./dist && npm run clean -ws --if-present", "clean:all": "npm run clean && rimraf ./node_modules ./**/node_modules/", "dist": "rimraf ./dist && copyfiles -e 'node_modules/**' entrypoint.sh '**/package.json' '*/dist/**/*' ./dist", - "build": "npm run build -ws --if-present", + "build": "npm run generate && npm run build -ws --if-present", "start:dev:common": "npm run start:dev -w common", "start:dev:server": "npm run start:dev -w server", "start:dev:client": "npm run start:dev -w client", - "start:dev": "concurrently -n common,client -c 'white.bold.inverse,green.bold.inverse,blue.bold.inverse' 'npm:start:dev:common' 'npm:start:dev:client'", + "start:dev": "npm run generate && concurrently -n common,client -c 'white.bold.inverse,green.bold.inverse,blue.bold.inverse' 'npm:start:dev:common' 'npm:start:dev:client'", "start": "npm run build -w common -w client && npm run start -w server", "test": "npm run test -ws --if-present --", "lint": "npm run lint -ws --if-present --",