@harnessio/react-hhi-armory-service-client 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -2
- package/dist/fetcher/index.d.ts +17 -0
- package/dist/fetcher/index.js +65 -0
- package/dist/hhi-armory-service/src/index.d.ts +6 -0
- package/dist/hhi-armory-service/src/index.js +10 -0
- package/dist/hhi-armory-service/src/services/helpers.d.ts +14 -0
- package/dist/hhi-armory-service/src/services/helpers.js +1 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetComparisonQuery.d.ts +43 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetComparisonQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetContainerQuery.d.ts +25 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetContainerQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetOverviewQuery.d.ts +25 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetOverviewQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetProvenanceQuery.d.ts +25 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerGetProvenanceQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListContainersQuery.d.ts +46 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListContainersQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListTagPackagesQuery.d.ts +54 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListTagPackagesQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListTagVulnerabilitiesQuery.d.ts +57 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListTagVulnerabilitiesQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListTagsQuery.d.ts +50 -0
- package/dist/hhi-armory-service/src/services/hooks/useContainerListTagsQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/hooks/useHardeningGetArtifactsSummaryQuery.d.ts +29 -0
- package/dist/hhi-armory-service/src/services/hooks/useHardeningGetArtifactsSummaryQuery.js +16 -0
- package/dist/hhi-armory-service/src/services/hooks/useHardeningListArtifactsQuery.d.ts +51 -0
- package/dist/hhi-armory-service/src/services/hooks/useHardeningListArtifactsQuery.js +15 -0
- package/dist/hhi-armory-service/src/services/hooks/useMigrationCreateMigrationMutation.d.ts +33 -0
- package/dist/hhi-armory-service/src/services/hooks/useMigrationCreateMigrationMutation.js +16 -0
- package/dist/hhi-armory-service/src/services/hooks/useMigrationGetMigrationQuery.d.ts +33 -0
- package/dist/hhi-armory-service/src/services/hooks/useMigrationGetMigrationQuery.js +15 -0
- package/dist/hhi-armory-service/src/services/hooks/useMigrationListMigrationsQuery.d.ts +41 -0
- package/dist/hhi-armory-service/src/services/hooks/useMigrationListMigrationsQuery.js +14 -0
- package/dist/hhi-armory-service/src/services/index.d.ts +89 -0
- package/dist/hhi-armory-service/src/services/index.js +13 -0
- package/dist/hhi-armory-service/src/services/responses/BadRequestResponse.d.ts +2 -0
- package/dist/hhi-armory-service/src/services/responses/BadRequestResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/responses/ConflictResponse.d.ts +2 -0
- package/dist/hhi-armory-service/src/services/responses/ConflictResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/responses/InternalServerErrorResponse.d.ts +2 -0
- package/dist/hhi-armory-service/src/services/responses/InternalServerErrorResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/responses/NotFoundResponse.d.ts +2 -0
- package/dist/hhi-armory-service/src/services/responses/NotFoundResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/responses/UnauthorizedResponse.d.ts +2 -0
- package/dist/hhi-armory-service/src/services/responses/UnauthorizedResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ArchInfo.d.ts +18 -0
- package/dist/hhi-armory-service/src/services/schemas/ArchInfo.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/BadRequest.d.ts +15 -0
- package/dist/hhi-armory-service/src/services/schemas/BadRequest.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ChangeSummary.d.ts +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ChangeSummary.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/CheckStatus.d.ts +4 -0
- package/dist/hhi-armory-service/src/services/schemas/CheckStatus.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ComparisonData.d.ts +26 -0
- package/dist/hhi-armory-service/src/services/schemas/ComparisonData.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ComparisonMetrics.d.ts +10 -0
- package/dist/hhi-armory-service/src/services/schemas/ComparisonMetrics.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/Conflict.d.ts +7 -0
- package/dist/hhi-armory-service/src/services/schemas/Conflict.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ContainerSummary.d.ts +63 -0
- package/dist/hhi-armory-service/src/services/schemas/ContainerSummary.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/CreateMigrationRequest.d.ts +32 -0
- package/dist/hhi-armory-service/src/services/schemas/CreateMigrationRequest.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/CveDiff.d.ts +8 -0
- package/dist/hhi-armory-service/src/services/schemas/CveDiff.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/CveDiffRow.d.ts +11 -0
- package/dist/hhi-armory-service/src/services/schemas/CveDiffRow.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/CveEvent.d.ts +26 -0
- package/dist/hhi-armory-service/src/services/schemas/CveEvent.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/CveSeverityCounts.d.ts +22 -0
- package/dist/hhi-armory-service/src/services/schemas/CveSeverityCounts.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/DailyCve.d.ts +39 -0
- package/dist/hhi-armory-service/src/services/schemas/DailyCve.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/DownloadStats.d.ts +10 -0
- package/dist/hhi-armory-service/src/services/schemas/DownloadStats.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/HardeningArtifactItem.d.ts +35 -0
- package/dist/hhi-armory-service/src/services/schemas/HardeningArtifactItem.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/HardeningArtifactsListResponse.d.ts +6 -0
- package/dist/hhi-armory-service/src/services/schemas/HardeningArtifactsListResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/HardeningArtifactsSummaryResponse.d.ts +18 -0
- package/dist/hhi-armory-service/src/services/schemas/HardeningArtifactsSummaryResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ImageRefPair.d.ts +3 -0
- package/dist/hhi-armory-service/src/services/schemas/ImageRefPair.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ImageTag.d.ts +24 -0
- package/dist/hhi-armory-service/src/services/schemas/ImageTag.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ImageUsedEntry.d.ts +8 -0
- package/dist/hhi-armory-service/src/services/schemas/ImageUsedEntry.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/InternalServerError.d.ts +15 -0
- package/dist/hhi-armory-service/src/services/schemas/InternalServerError.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ListContainersResponseBody.d.ts +12 -0
- package/dist/hhi-armory-service/src/services/schemas/ListContainersResponseBody.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ListTagPackagesResponseBody.d.ts +14 -0
- package/dist/hhi-armory-service/src/services/schemas/ListTagPackagesResponseBody.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ListTagVulnerabilitiesResponseBody.d.ts +14 -0
- package/dist/hhi-armory-service/src/services/schemas/ListTagVulnerabilitiesResponseBody.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ListTagsResponseBody.d.ts +16 -0
- package/dist/hhi-armory-service/src/services/schemas/ListTagsResponseBody.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/MarkdownDoc.d.ts +21 -0
- package/dist/hhi-armory-service/src/services/schemas/MarkdownDoc.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/MetricSet.d.ts +25 -0
- package/dist/hhi-armory-service/src/services/schemas/MetricSet.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationChecks.d.ts +7 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationChecks.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationDetail.d.ts +19 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationDetail.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationFailure.d.ts +3 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationFailure.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationListResponse.d.ts +6 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationListResponse.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationScmConfig.d.ts +12 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationScmConfig.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationSnippet.d.ts +6 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationSnippet.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationSummary.d.ts +36 -0
- package/dist/hhi-armory-service/src/services/schemas/MigrationSummary.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/NameSlug.d.ts +13 -0
- package/dist/hhi-armory-service/src/services/schemas/NameSlug.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/NetNewCveDay.d.ts +24 -0
- package/dist/hhi-armory-service/src/services/schemas/NetNewCveDay.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/NotFound.d.ts +15 -0
- package/dist/hhi-armory-service/src/services/schemas/NotFound.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/NotImplemented.d.ts +15 -0
- package/dist/hhi-armory-service/src/services/schemas/NotImplemented.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/PackageInfo.d.ts +30 -0
- package/dist/hhi-armory-service/src/services/schemas/PackageInfo.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/Pagination.d.ts +23 -0
- package/dist/hhi-armory-service/src/services/schemas/Pagination.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/PinnedImage.d.ts +4 -0
- package/dist/hhi-armory-service/src/services/schemas/PinnedImage.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/PrReference.d.ts +21 -0
- package/dist/hhi-armory-service/src/services/schemas/PrReference.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/ReductionSet.d.ts +25 -0
- package/dist/hhi-armory-service/src/services/schemas/ReductionSet.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeEnvironment.d.ts +6 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeEnvironment.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTest.d.ts +8 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTest.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTestCheck.d.ts +10 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTestCheck.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTestResult.d.ts +4 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTestResult.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTestsBlock.d.ts +6 -0
- package/dist/hhi-armory-service/src/services/schemas/RuntimeTestsBlock.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/ServiceUnavailable.d.ts +15 -0
- package/dist/hhi-armory-service/src/services/schemas/ServiceUnavailable.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/SeverityTimeline.d.ts +14 -0
- package/dist/hhi-armory-service/src/services/schemas/SeverityTimeline.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/SupplyChainInfo.d.ts +11 -0
- package/dist/hhi-armory-service/src/services/schemas/SupplyChainInfo.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/TagMetadata.d.ts +32 -0
- package/dist/hhi-armory-service/src/services/schemas/TagMetadata.js +1 -0
- package/dist/hhi-armory-service/src/services/schemas/TagSize.d.ts +16 -0
- package/dist/hhi-armory-service/src/services/schemas/TagSize.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/Unauthorized.d.ts +15 -0
- package/dist/hhi-armory-service/src/services/schemas/Unauthorized.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/Vulnerabilities.d.ts +31 -0
- package/dist/hhi-armory-service/src/services/schemas/Vulnerabilities.js +4 -0
- package/dist/hhi-armory-service/src/services/schemas/VulnerabilityRow.d.ts +48 -0
- package/dist/hhi-armory-service/src/services/schemas/VulnerabilityRow.js +4 -0
- package/package.json +32 -4
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React HHI Armory Service Client (WIP)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**OpenAPI → OA · TypeScript → TS · OpenAPI + TypeScript → OATS**
|
|
4
|
+
|
|
5
|
+
HHI Armory (Hardening Agent) APIs and types generated from OpenAPI using `OATS CLI`. Hooks use `@tanstack/react-query`.
|
|
6
|
+
|
|
7
|
+
Contract: [Hardening agent API contracts](https://harness.atlassian.net/wiki/spaces/HSA/pages/24484675971/Hardening+agent+API+contracts)
|
|
8
|
+
|
|
9
|
+
## Hooks
|
|
10
|
+
|
|
11
|
+
| Screen | HTTP | Hook |
|
|
12
|
+
|--------|------|------|
|
|
13
|
+
| Artifacts list — summary cards | `GET …/hardening/artifacts/summary` | `useHardeningGetArtifactsSummaryQuery` |
|
|
14
|
+
| Artifacts list — table | `GET …/hardening/artifacts` | `useHardeningListArtifactsQuery` |
|
|
15
|
+
| Harden Artifact panel | `POST …/migrations` (202) | `useMigrationCreateMigrationMutation` |
|
|
16
|
+
| Executions list | `GET …/migrations` | `useMigrationListMigrationsQuery` |
|
|
17
|
+
| View PR drawer | `GET …/migrations/{id}` | `useMigrationGetMigrationQuery` |
|
|
18
|
+
|
|
19
|
+
Container catalog hooks match `@harnessio/react-hsa-service-client` (`GET /api/v1/containers…`):
|
|
20
|
+
|
|
21
|
+
`useContainerListContainersQuery`, `useContainerGetContainerQuery`, `useContainerGetOverviewQuery`, `useContainerGetProvenanceQuery`, `useContainerListTagsQuery`, `useContainerGetComparisonQuery`, `useContainerListTagPackagesQuery`, `useContainerListTagVulnerabilitiesQuery`.
|
|
22
|
+
|
|
23
|
+
`GET …/migrations/{id}/execution` is not generated (deferred in Confluence v4).
|
|
24
|
+
|
|
25
|
+
When **hhi-armory** publishes an updated spec, replace `openapi.yaml`, update `allowedOperationIds` in `oats.config.ts`, and run `yarn build`.
|
|
26
|
+
|
|
27
|
+
## Build
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
yarn build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Platform UI adoption
|
|
34
|
+
|
|
35
|
+
Initialize `HhiArmoryServiceAPIClient` before using hooks:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import {
|
|
39
|
+
useHardeningListArtifactsQuery,
|
|
40
|
+
HhiArmoryServiceAPIClient,
|
|
41
|
+
} from '@harnessio/react-hhi-armory-service-client';
|
|
42
|
+
|
|
43
|
+
new HhiArmoryServiceAPIClient({
|
|
44
|
+
urlInterceptor: (url) => `${window.apiUrl}/gateway/hhi${url}`,
|
|
45
|
+
getRequestHeaders: () => ({
|
|
46
|
+
token: SessionToken.getToken(),
|
|
47
|
+
'Harness-Account': accountId,
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Local verification
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cp .env.example .env
|
|
56
|
+
npm run verify-local
|
|
57
|
+
npm run verify-apis
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Versioning
|
|
61
|
+
|
|
62
|
+

|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IStringifyOptions } from 'qs';
|
|
2
|
+
export interface FetcherOptions<TQueryParams = never, TBody = never, THeaderParams = HeadersInit> extends Omit<RequestInit, 'body' | 'headers'> {
|
|
3
|
+
url: string;
|
|
4
|
+
queryParams?: TQueryParams extends never ? undefined : TQueryParams;
|
|
5
|
+
body?: TBody extends never ? undefined : TBody;
|
|
6
|
+
stringifyQueryParamsOptions?: IStringifyOptions;
|
|
7
|
+
headers?: THeaderParams;
|
|
8
|
+
}
|
|
9
|
+
export interface ClientCallbacks {
|
|
10
|
+
responseInterceptor?: (response: Response) => Response;
|
|
11
|
+
requestInterceptor?: (request: Request) => Request;
|
|
12
|
+
urlInterceptor?: (url: string) => string;
|
|
13
|
+
getRequestHeaders?: () => Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export declare function setupClient(callbacks: ClientCallbacks): void;
|
|
16
|
+
export declare const updateClientHeaders: (headers: Record<string, any>) => void;
|
|
17
|
+
export declare function fetcher<TResponse = unknown, TQueryParams = never, TBody = never, THeaderParams = HeadersInit>(options: FetcherOptions<TQueryParams, TBody, THeaderParams>): Promise<TResponse>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
|
+
import { stringify } from 'qs';
|
|
3
|
+
const JSON_CONTENT_TYPES = ['application/json'];
|
|
4
|
+
let APIClientInitialized = false;
|
|
5
|
+
let fetcherCallbacks;
|
|
6
|
+
let customHeaders = {
|
|
7
|
+
'Content-Type': JSON_CONTENT_TYPES[0],
|
|
8
|
+
};
|
|
9
|
+
export function setupClient(callbacks) {
|
|
10
|
+
fetcherCallbacks = callbacks;
|
|
11
|
+
customHeaders = Object.assign(Object.assign({}, customHeaders), ((fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.getRequestHeaders) ? fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.getRequestHeaders() : {}));
|
|
12
|
+
APIClientInitialized = true;
|
|
13
|
+
}
|
|
14
|
+
export const updateClientHeaders = (headers) => {
|
|
15
|
+
customHeaders = Object.assign(Object.assign({}, customHeaders), headers);
|
|
16
|
+
};
|
|
17
|
+
export function fetcher(options) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
// If not initialized throw error even without making request
|
|
21
|
+
if (!APIClientInitialized) {
|
|
22
|
+
throw { reason: 'HarnessReactAPIClient has not been initialized' };
|
|
23
|
+
}
|
|
24
|
+
const { stringifyQueryParamsOptions, headers, body, url, queryParams = { account: customHeaders['Harness-Account'] } } = options, rest = __rest(options, ["stringifyQueryParamsOptions", "headers", "body", "url", "queryParams"]);
|
|
25
|
+
const token = customHeaders.token;
|
|
26
|
+
let finalUrl = url;
|
|
27
|
+
if (queryParams) {
|
|
28
|
+
finalUrl += stringify(queryParams, Object.assign(Object.assign({}, stringifyQueryParamsOptions), { addQueryPrefix: true }));
|
|
29
|
+
}
|
|
30
|
+
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) {
|
|
31
|
+
finalUrl = (_a = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) === null || _a === void 0 ? void 0 : _a.call(fetcherCallbacks, finalUrl);
|
|
32
|
+
}
|
|
33
|
+
let request = new Request(finalUrl, Object.assign({ headers: Object.assign(Object.assign(Object.assign({}, (token ? { Authorization: `Bearer ${token}` } : {})), headers), customHeaders), body: body ? JSON.stringify(body) : undefined }, rest));
|
|
34
|
+
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.requestInterceptor) {
|
|
35
|
+
request = fetcherCallbacks.requestInterceptor(request.clone());
|
|
36
|
+
}
|
|
37
|
+
let response = yield fetch(request);
|
|
38
|
+
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) {
|
|
39
|
+
response = (_b = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) === null || _b === void 0 ? void 0 : _b.call(fetcherCallbacks, response.clone());
|
|
40
|
+
}
|
|
41
|
+
const contentType = response.headers.get('Content-Type');
|
|
42
|
+
let total, pageSize, pageNumber, pageCount, pagination;
|
|
43
|
+
try {
|
|
44
|
+
total = response.headers.get('x-total-elements');
|
|
45
|
+
pageSize = response.headers.get('x-page-size');
|
|
46
|
+
pageNumber = response.headers.get('x-page-number');
|
|
47
|
+
pagination = total || pageSize || pageNumber;
|
|
48
|
+
if (pagination) {
|
|
49
|
+
total = Number(total);
|
|
50
|
+
pageSize = Number(pageSize);
|
|
51
|
+
pageCount = Math.ceil(total / pageSize);
|
|
52
|
+
pageNumber = Number(pageNumber);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
throw new Error('HarnessReactAPIClient: An error occurred while parsing pagination headers. ' + e);
|
|
57
|
+
}
|
|
58
|
+
const asJson = contentType && JSON_CONTENT_TYPES.some((h) => contentType.startsWith(h));
|
|
59
|
+
const data = yield (asJson ? response.json() : response.text());
|
|
60
|
+
if (response.ok) {
|
|
61
|
+
return Object.assign({ content: data }, (pagination ? { pagination: { total, pageCount, pageSize, pageNumber } } : {}));
|
|
62
|
+
}
|
|
63
|
+
throw data;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { setupClient, updateClientHeaders } from '../../fetcher';
|
|
2
|
+
export * from './services/index';
|
|
3
|
+
export class HhiArmoryServiceAPIClient {
|
|
4
|
+
constructor(callbacks) {
|
|
5
|
+
setupClient(callbacks);
|
|
6
|
+
this.updateHeaders = (headers) => {
|
|
7
|
+
updateClientHeaders(headers);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type GetPathParamsType<T> = T extends {
|
|
2
|
+
pathParams: infer R;
|
|
3
|
+
} ? R : never;
|
|
4
|
+
export interface ResponseWithPagination<T> {
|
|
5
|
+
content: T;
|
|
6
|
+
pagination?: {
|
|
7
|
+
total?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
pageCount?: number;
|
|
10
|
+
pageNumber?: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export type WithOptional<TInput, Tkeys extends keyof TInput> = Omit<TInput, Tkeys> & Partial<Pick<TInput, Tkeys>>;
|
|
14
|
+
export type PickPartial<TInput, Tkeys extends keyof TInput> = Pick<Partial<TInput>, Tkeys>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ComparisonData } from '../schemas/ComparisonData';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerGetComparisonQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "Unde quo."
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
/**
|
|
17
|
+
* @example "Sit architecto."
|
|
18
|
+
*/
|
|
19
|
+
tagSlug: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ContainerGetComparisonQueryQueryParams {
|
|
22
|
+
/**
|
|
23
|
+
* Alternative image slug.
|
|
24
|
+
* @example "Autem minima consequuntur qui."
|
|
25
|
+
*/
|
|
26
|
+
alternative?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @default "last-month"
|
|
29
|
+
* @example "last-month"
|
|
30
|
+
*/
|
|
31
|
+
period?: 'last-180-days' | 'last-30-days' | 'last-90-days' | 'last-month';
|
|
32
|
+
criticalHighOnly?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export type ContainerGetComparisonOkResponse = ResponseWithPagination<ComparisonData>;
|
|
35
|
+
export type ContainerGetComparisonErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
36
|
+
export interface ContainerGetComparisonProps extends ContainerGetComparisonQueryPathParams, Omit<FetcherOptions<ContainerGetComparisonQueryQueryParams, unknown>, 'url'> {
|
|
37
|
+
queryParams: ContainerGetComparisonQueryQueryParams;
|
|
38
|
+
}
|
|
39
|
+
export declare function containerGetComparison(props: ContainerGetComparisonProps): Promise<ContainerGetComparisonOkResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Compare a Harness tag with an alternative image.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useContainerGetComparisonQuery(props: ContainerGetComparisonProps, options?: Omit<UseQueryOptions<ContainerGetComparisonOkResponse, ContainerGetComparisonErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerGetComparisonOkResponse, ContainerGetComparisonErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerGetComparison(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers/${props.slug}/tags/${props.tagSlug}/comparison`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Compare a Harness tag with an alternative image.
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerGetComparisonQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#GetComparison', props.slug, props.tagSlug, props.queryParams], ({ signal }) => containerGetComparison(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ContainerSummary } from '../schemas/ContainerSummary';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerGetContainerQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "adoptium-jdk"
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
}
|
|
17
|
+
export type ContainerGetContainerOkResponse = ResponseWithPagination<ContainerSummary>;
|
|
18
|
+
export type ContainerGetContainerErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
19
|
+
export interface ContainerGetContainerProps extends ContainerGetContainerQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
20
|
+
}
|
|
21
|
+
export declare function containerGetContainer(props: ContainerGetContainerProps): Promise<ContainerGetContainerOkResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get one container's detail.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useContainerGetContainerQuery(props: ContainerGetContainerProps, options?: Omit<UseQueryOptions<ContainerGetContainerOkResponse, ContainerGetContainerErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerGetContainerOkResponse, ContainerGetContainerErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerGetContainer(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers/${props.slug}`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get one container's detail.
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerGetContainerQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#GetContainer', props.slug], ({ signal }) => containerGetContainer(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { MarkdownDoc } from '../schemas/MarkdownDoc';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerGetOverviewQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "python"
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
}
|
|
17
|
+
export type ContainerGetOverviewOkResponse = ResponseWithPagination<MarkdownDoc>;
|
|
18
|
+
export type ContainerGetOverviewErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
19
|
+
export interface ContainerGetOverviewProps extends ContainerGetOverviewQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
20
|
+
}
|
|
21
|
+
export declare function containerGetOverview(props: ContainerGetOverviewProps): Promise<ContainerGetOverviewOkResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the container's Overview document (markdown).
|
|
24
|
+
*/
|
|
25
|
+
export declare function useContainerGetOverviewQuery(props: ContainerGetOverviewProps, options?: Omit<UseQueryOptions<ContainerGetOverviewOkResponse, ContainerGetOverviewErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerGetOverviewOkResponse, ContainerGetOverviewErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerGetOverview(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers/${props.slug}/overview`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get the container's Overview document (markdown).
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerGetOverviewQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#GetOverview', props.slug], ({ signal }) => containerGetOverview(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { MarkdownDoc } from '../schemas/MarkdownDoc';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerGetProvenanceQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "python"
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
}
|
|
17
|
+
export type ContainerGetProvenanceOkResponse = ResponseWithPagination<MarkdownDoc>;
|
|
18
|
+
export type ContainerGetProvenanceErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
19
|
+
export interface ContainerGetProvenanceProps extends ContainerGetProvenanceQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
20
|
+
}
|
|
21
|
+
export declare function containerGetProvenance(props: ContainerGetProvenanceProps): Promise<ContainerGetProvenanceOkResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the container's Provenance document (markdown).
|
|
24
|
+
*/
|
|
25
|
+
export declare function useContainerGetProvenanceQuery(props: ContainerGetProvenanceProps, options?: Omit<UseQueryOptions<ContainerGetProvenanceOkResponse, ContainerGetProvenanceErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerGetProvenanceOkResponse, ContainerGetProvenanceErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerGetProvenance(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers/${props.slug}/provenance`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get the container's Provenance document (markdown).
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerGetProvenanceQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#GetProvenance', props.slug], ({ signal }) => containerGetProvenance(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListContainersResponseBody } from '../schemas/ListContainersResponseBody';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerListContainersQueryQueryParams {
|
|
12
|
+
/**
|
|
13
|
+
* Free-text search over name/description/usage.
|
|
14
|
+
* @example "Sint et numquam minima dolorem."
|
|
15
|
+
*/
|
|
16
|
+
search?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Comma-separated tag filter (e.g. Java,Base).
|
|
19
|
+
* @example "Delectus beatae a."
|
|
20
|
+
*/
|
|
21
|
+
tags?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Page number (0-indexed).
|
|
24
|
+
* @format int64
|
|
25
|
+
* @default 0
|
|
26
|
+
* @example 1370767254768258000
|
|
27
|
+
*/
|
|
28
|
+
page?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Items per page.
|
|
31
|
+
* @format int64
|
|
32
|
+
* @default 15
|
|
33
|
+
* @example 35
|
|
34
|
+
*/
|
|
35
|
+
pageSize?: number;
|
|
36
|
+
}
|
|
37
|
+
export type ContainerListContainersOkResponse = ResponseWithPagination<ListContainersResponseBody>;
|
|
38
|
+
export type ContainerListContainersErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
39
|
+
export interface ContainerListContainersProps extends Omit<FetcherOptions<ContainerListContainersQueryQueryParams, unknown>, 'url'> {
|
|
40
|
+
queryParams: ContainerListContainersQueryQueryParams;
|
|
41
|
+
}
|
|
42
|
+
export declare function containerListContainers(props: ContainerListContainersProps): Promise<ContainerListContainersOkResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* List containers for the catalog grid.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useContainerListContainersQuery(props: ContainerListContainersProps, options?: Omit<UseQueryOptions<ContainerListContainersOkResponse, ContainerListContainersErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerListContainersOkResponse, ContainerListContainersErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerListContainers(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List containers for the catalog grid.
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerListContainersQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#ListContainers', props.queryParams], ({ signal }) => containerListContainers(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListTagPackagesResponseBody } from '../schemas/ListTagPackagesResponseBody';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerListTagPackagesQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "Error aut ea debitis eum in."
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
/**
|
|
17
|
+
* @example "Minus sint in qui aut."
|
|
18
|
+
*/
|
|
19
|
+
tagSlug: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ContainerListTagPackagesQueryQueryParams {
|
|
22
|
+
/**
|
|
23
|
+
* Architecture filter (e.g. x86-64).
|
|
24
|
+
* @example "Nisi est reprehenderit hic consequatur."
|
|
25
|
+
*/
|
|
26
|
+
arch?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @example "Aut sed."
|
|
29
|
+
*/
|
|
30
|
+
search?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @format int64
|
|
33
|
+
* @default 0
|
|
34
|
+
* @example 3935745170125200400
|
|
35
|
+
*/
|
|
36
|
+
page?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Items per page.
|
|
39
|
+
* @format int64
|
|
40
|
+
* @default 15
|
|
41
|
+
* @example 14
|
|
42
|
+
*/
|
|
43
|
+
pageSize?: number;
|
|
44
|
+
}
|
|
45
|
+
export type ContainerListTagPackagesOkResponse = ResponseWithPagination<ListTagPackagesResponseBody>;
|
|
46
|
+
export type ContainerListTagPackagesErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
47
|
+
export interface ContainerListTagPackagesProps extends ContainerListTagPackagesQueryPathParams, Omit<FetcherOptions<ContainerListTagPackagesQueryQueryParams, unknown>, 'url'> {
|
|
48
|
+
queryParams: ContainerListTagPackagesQueryQueryParams;
|
|
49
|
+
}
|
|
50
|
+
export declare function containerListTagPackages(props: ContainerListTagPackagesProps): Promise<ContainerListTagPackagesOkResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* List packages (SBOM) for a tag.
|
|
53
|
+
*/
|
|
54
|
+
export declare function useContainerListTagPackagesQuery(props: ContainerListTagPackagesProps, options?: Omit<UseQueryOptions<ContainerListTagPackagesOkResponse, ContainerListTagPackagesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerListTagPackagesOkResponse, ContainerListTagPackagesErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerListTagPackages(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers/${props.slug}/tags/${props.tagSlug}/packages`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List packages (SBOM) for a tag.
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerListTagPackagesQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#ListTagPackages', props.slug, props.tagSlug, props.queryParams], ({ signal }) => containerListTagPackages(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
package/dist/hhi-armory-service/src/services/hooks/useContainerListTagVulnerabilitiesQuery.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListTagVulnerabilitiesResponseBody } from '../schemas/ListTagVulnerabilitiesResponseBody';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerListTagVulnerabilitiesQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "Et tempore."
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
/**
|
|
17
|
+
* @example "Voluptas iure et reiciendis."
|
|
18
|
+
*/
|
|
19
|
+
tagSlug: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ContainerListTagVulnerabilitiesQueryQueryParams {
|
|
22
|
+
/**
|
|
23
|
+
* @example "Veritatis omnis reiciendis iusto."
|
|
24
|
+
*/
|
|
25
|
+
arch?: string;
|
|
26
|
+
/**
|
|
27
|
+
* @example "Unspecified"
|
|
28
|
+
*/
|
|
29
|
+
severity?: 'All' | 'Critical' | 'High' | 'Low' | 'Medium' | 'Unspecified';
|
|
30
|
+
/**
|
|
31
|
+
* @example "Vel deleniti enim commodi."
|
|
32
|
+
*/
|
|
33
|
+
search?: string;
|
|
34
|
+
/**
|
|
35
|
+
* @format int64
|
|
36
|
+
* @default 0
|
|
37
|
+
* @example 7330974117726427000
|
|
38
|
+
*/
|
|
39
|
+
page?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Items per page.
|
|
42
|
+
* @format int64
|
|
43
|
+
* @default 15
|
|
44
|
+
* @example 66
|
|
45
|
+
*/
|
|
46
|
+
pageSize?: number;
|
|
47
|
+
}
|
|
48
|
+
export type ContainerListTagVulnerabilitiesOkResponse = ResponseWithPagination<ListTagVulnerabilitiesResponseBody>;
|
|
49
|
+
export type ContainerListTagVulnerabilitiesErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
50
|
+
export interface ContainerListTagVulnerabilitiesProps extends ContainerListTagVulnerabilitiesQueryPathParams, Omit<FetcherOptions<ContainerListTagVulnerabilitiesQueryQueryParams, unknown>, 'url'> {
|
|
51
|
+
queryParams: ContainerListTagVulnerabilitiesQueryQueryParams;
|
|
52
|
+
}
|
|
53
|
+
export declare function containerListTagVulnerabilities(props: ContainerListTagVulnerabilitiesProps): Promise<ContainerListTagVulnerabilitiesOkResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* List vulnerabilities for a tag.
|
|
56
|
+
*/
|
|
57
|
+
export declare function useContainerListTagVulnerabilitiesQuery(props: ContainerListTagVulnerabilitiesProps, options?: Omit<UseQueryOptions<ContainerListTagVulnerabilitiesOkResponse, ContainerListTagVulnerabilitiesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerListTagVulnerabilitiesOkResponse, ContainerListTagVulnerabilitiesErrorResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
+
// Please do not modify this code directly.
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
+
export function containerListTagVulnerabilities(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/api/v1/containers/${props.slug}/tags/${props.tagSlug}/vulnerabilities`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List vulnerabilities for a tag.
|
|
11
|
+
*/
|
|
12
|
+
export function useContainerListTagVulnerabilitiesQuery(props, options) {
|
|
13
|
+
return useQuery(['Container#ListTagVulnerabilities', props.slug, props.tagSlug, props.queryParams], ({ signal }) => containerListTagVulnerabilities(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { ListTagsResponseBody } from '../schemas/ListTagsResponseBody';
|
|
3
|
+
import type { BadRequest } from '../schemas/BadRequest';
|
|
4
|
+
import type { Unauthorized } from '../schemas/Unauthorized';
|
|
5
|
+
import type { NotFound } from '../schemas/NotFound';
|
|
6
|
+
import type { InternalServerError } from '../schemas/InternalServerError';
|
|
7
|
+
import type { NotImplemented } from '../schemas/NotImplemented';
|
|
8
|
+
import type { ServiceUnavailable } from '../schemas/ServiceUnavailable';
|
|
9
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
10
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
11
|
+
export interface ContainerListTagsQueryPathParams {
|
|
12
|
+
/**
|
|
13
|
+
* @example "adoptium-jdk"
|
|
14
|
+
*/
|
|
15
|
+
slug: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ContainerListTagsQueryQueryParams {
|
|
18
|
+
/**
|
|
19
|
+
* @default "all"
|
|
20
|
+
* @example "dev"
|
|
21
|
+
*/
|
|
22
|
+
variant?: 'all' | 'dev' | 'production';
|
|
23
|
+
/**
|
|
24
|
+
* @example "Non provident voluptate."
|
|
25
|
+
*/
|
|
26
|
+
search?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @format int64
|
|
29
|
+
* @default 0
|
|
30
|
+
* @example 8871467111198086000
|
|
31
|
+
*/
|
|
32
|
+
page?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Items per page.
|
|
35
|
+
* @format int64
|
|
36
|
+
* @default 15
|
|
37
|
+
* @example 45
|
|
38
|
+
*/
|
|
39
|
+
pageSize?: number;
|
|
40
|
+
}
|
|
41
|
+
export type ContainerListTagsOkResponse = ResponseWithPagination<ListTagsResponseBody>;
|
|
42
|
+
export type ContainerListTagsErrorResponse = BadRequest | Unauthorized | NotFound | InternalServerError | NotImplemented | ServiceUnavailable;
|
|
43
|
+
export interface ContainerListTagsProps extends ContainerListTagsQueryPathParams, Omit<FetcherOptions<ContainerListTagsQueryQueryParams, unknown>, 'url'> {
|
|
44
|
+
queryParams: ContainerListTagsQueryQueryParams;
|
|
45
|
+
}
|
|
46
|
+
export declare function containerListTags(props: ContainerListTagsProps): Promise<ContainerListTagsOkResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* List a container's tags (versions).
|
|
49
|
+
*/
|
|
50
|
+
export declare function useContainerListTagsQuery(props: ContainerListTagsProps, options?: Omit<UseQueryOptions<ContainerListTagsOkResponse, ContainerListTagsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ContainerListTagsOkResponse, ContainerListTagsErrorResponse>;
|