@harnessio/react-sto-core-client 0.3.2 → 0.3.4

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.
Files changed (59) hide show
  1. package/dist/sto-core/src/services/hooks/useExemptionsCreateExemptionMutation.d.ts +42 -0
  2. package/dist/sto-core/src/services/hooks/useExemptionsCreateExemptionMutation.js +14 -0
  3. package/dist/sto-core/src/services/hooks/useExemptionsFindExemptionByIdQuery.d.ts +55 -0
  4. package/dist/sto-core/src/services/hooks/useExemptionsFindExemptionByIdQuery.js +14 -0
  5. package/dist/sto-core/src/services/hooks/useExemptionsListExemptionsQuery.d.ts +53 -0
  6. package/dist/sto-core/src/services/hooks/useExemptionsListExemptionsQuery.js +14 -0
  7. package/dist/sto-core/src/services/hooks/useFrontendExpiringExemptionsQuery.d.ts +46 -0
  8. package/dist/sto-core/src/services/hooks/useFrontendExpiringExemptionsQuery.js +14 -0
  9. package/dist/sto-core/src/services/hooks/useFrontendGlobalExemptionsQuery.d.ts +61 -0
  10. package/dist/sto-core/src/services/hooks/useFrontendGlobalExemptionsQuery.js +14 -0
  11. package/dist/sto-core/src/services/hooks/useFrontendSecurityReviewQuery.d.ts +56 -0
  12. package/dist/sto-core/src/services/hooks/useFrontendSecurityReviewQuery.js +14 -0
  13. package/dist/sto-core/src/services/hooks/useIssuesIssuesAugmentRemediationMutation.d.ts +49 -0
  14. package/dist/sto-core/src/services/hooks/useIssuesIssuesAugmentRemediationMutation.js +14 -0
  15. package/dist/sto-core/src/services/hooks/useTargetsFindTargetByIdQuery.d.ts +46 -0
  16. package/dist/sto-core/src/services/hooks/useTargetsFindTargetByIdQuery.js +14 -0
  17. package/dist/sto-core/src/services/index.d.ts +35 -2
  18. package/dist/sto-core/src/services/index.js +8 -1
  19. package/dist/sto-core/src/services/schemas/AugmentRemediationMetadata.d.ts +10 -0
  20. package/dist/sto-core/src/services/schemas/AugmentRemediationMetadata.js +1 -0
  21. package/dist/sto-core/src/services/schemas/AugmentRemediationResult.d.ts +19 -0
  22. package/dist/sto-core/src/services/schemas/AugmentRemediationResult.js +1 -0
  23. package/dist/sto-core/src/services/schemas/AugmentRemediationWarning.d.ts +13 -0
  24. package/dist/sto-core/src/services/schemas/AugmentRemediationWarning.js +4 -0
  25. package/dist/sto-core/src/services/schemas/CreateExemptionRequestBody.d.ts +68 -0
  26. package/dist/sto-core/src/services/schemas/CreateExemptionRequestBody.js +1 -0
  27. package/dist/sto-core/src/services/schemas/Exemption.d.ts +149 -0
  28. package/dist/sto-core/src/services/schemas/Exemption.js +1 -0
  29. package/dist/sto-core/src/services/schemas/ExemptionsCreateExemptionResponseBody.d.ts +2 -0
  30. package/dist/sto-core/src/services/schemas/ExemptionsCreateExemptionResponseBody.js +1 -0
  31. package/dist/sto-core/src/services/schemas/ExemptionsListExemptionsResponseBody.d.ts +12 -0
  32. package/dist/sto-core/src/services/schemas/ExemptionsListExemptionsResponseBody.js +1 -0
  33. package/dist/sto-core/src/services/schemas/FrontendExemption.d.ts +132 -0
  34. package/dist/sto-core/src/services/schemas/FrontendExemption.js +1 -0
  35. package/dist/sto-core/src/services/schemas/FrontendExemptionCounts.d.ts +33 -0
  36. package/dist/sto-core/src/services/schemas/FrontendExemptionCounts.js +4 -0
  37. package/dist/sto-core/src/services/schemas/FrontendExpiringExemptionsResponseBody.d.ts +2 -0
  38. package/dist/sto-core/src/services/schemas/FrontendExpiringExemptionsResponseBody.js +1 -0
  39. package/dist/sto-core/src/services/schemas/FrontendSecurityReviewResponseBody.d.ts +2 -0
  40. package/dist/sto-core/src/services/schemas/FrontendSecurityReviewResponseBody.js +1 -0
  41. package/dist/sto-core/src/services/schemas/IdResult.d.ts +10 -0
  42. package/dist/sto-core/src/services/schemas/IdResult.js +4 -0
  43. package/dist/sto-core/src/services/schemas/IssueSummaries.d.ts +12 -0
  44. package/dist/sto-core/src/services/schemas/IssueSummaries.js +1 -0
  45. package/dist/sto-core/src/services/schemas/IssueSummary.d.ts +94 -0
  46. package/dist/sto-core/src/services/schemas/IssueSummary.js +4 -0
  47. package/dist/sto-core/src/services/schemas/IssuesAugmentRemediationRequestBody.d.ts +28 -0
  48. package/dist/sto-core/src/services/schemas/IssuesAugmentRemediationRequestBody.js +4 -0
  49. package/dist/sto-core/src/services/schemas/IssuesIssuesAugmentRemediationResponseBody.d.ts +2 -0
  50. package/dist/sto-core/src/services/schemas/IssuesIssuesAugmentRemediationResponseBody.js +1 -0
  51. package/dist/sto-core/src/services/schemas/PendingChanges.d.ts +11 -0
  52. package/dist/sto-core/src/services/schemas/PendingChanges.js +4 -0
  53. package/dist/sto-core/src/services/schemas/SecurityReviewResult.d.ts +16 -0
  54. package/dist/sto-core/src/services/schemas/SecurityReviewResult.js +1 -0
  55. package/dist/sto-core/src/services/schemas/Target.d.ts +62 -0
  56. package/dist/sto-core/src/services/schemas/Target.js +4 -0
  57. package/package.json +1 -1
  58. package/dist/sto-core/src/services/hooks/useTargetsDeleteTargetMutation.d.ts +0 -38
  59. package/dist/sto-core/src/services/hooks/useTargetsDeleteTargetMutation.js +0 -14
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @example {"connectorId":"Voluptatem optio sint ipsa et facere et.","occurrenceId":12345,"referenceId":"CWE-123","scanId":"abcdefghijkl1234567890","userSnippet":"func example() int {\n return 0\n}"}
3
+ */
4
+ export interface IssuesAugmentRemediationRequestBody {
5
+ /**
6
+ * @example "Impedit debitis quam dolores."
7
+ */
8
+ connectorId?: string;
9
+ /**
10
+ * @format int64
11
+ * @example 12345
12
+ */
13
+ occurrenceId: number;
14
+ /**
15
+ * @example "CWE-123"
16
+ */
17
+ referenceId?: string;
18
+ /**
19
+ * The Scan ID to use as context for the Security Issue to augment
20
+ * @example "abcdefghijkl1234567890"
21
+ */
22
+ scanId: string;
23
+ /**
24
+ * The user-supplied code snippet
25
+ * @example "func example() int {\n return 0\n}"
26
+ */
27
+ userSnippet?: string;
28
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AugmentRemediationResult } from '../schemas/AugmentRemediationResult';
2
+ export type IssuesIssuesAugmentRemediationResponseBody = AugmentRemediationResult;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @example {"durationDays":7}
3
+ */
4
+ export interface PendingChanges {
5
+ /**
6
+ * The number of days an issue should be exempted for
7
+ * @format int64
8
+ * @example 7
9
+ */
10
+ durationDays?: number;
11
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { FrontendExemptionCounts } from '../schemas/FrontendExemptionCounts';
2
+ import type { FrontendExemption } from '../schemas/FrontendExemption';
3
+ import type { Pagination } from '../schemas/Pagination';
4
+ /**
5
+ * Data needed by the Security Review page
6
+ * @example {"counts":{"Approved":150,"Expired":150,"Pending":150,"Rejected":150},"exemptions":[{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"},{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"},{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"}],"pagination":{"link":"","page":4,"pageSize":20,"totalItems":230,"totalPages":12}}
7
+ */
8
+ export interface SecurityReviewResult {
9
+ counts: FrontendExemptionCounts;
10
+ /**
11
+ * Security Review data
12
+ * @example [{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"},{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"},{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"},{"approverId":"user111111111111111111","canApproveFor":["ACCOUNT","ORG","PROJECT","PIPELINE"],"canCancel":true,"canCreate":true,"canReApprove":true,"canReject":true,"created":1651578240,"expiration":1651578240,"id":"abcdef1234567890ghijkl","isDeleted":true,"issueSummary":{"currentStatus":"Rejected","exemptionCoverage":"Partially Exempted","exemptionId":"abcdef1234567890ghijkl","exemptionStatusAtScan":"Rejected","id":"abcdef1234567890ghijkl","key":"json-schema@0.2.3","numNewOccurrences":2120508977338000000,"numOccurrences":3991226380867742000,"numRemediatedOccurrences":8224674406052809000,"override":{"originalSeverity":"medium","reason":"snyk"},"scanId":"scan111111111111111111","severity":8.5,"severityCode":"High","status":"Remediated","targetVariantName":"nodegoat:master","title":"json-schema@0.2.3 is vulnerable to Prototype Pollution","type":"SAST"},"lastModified":1651578240,"link":"Upstream bug","numOccurrences":10,"orgId":"STO","pendingChanges":{"durationDays":7},"pipelineId":"pipeline_1","projectId":"STO","reason":"Upstream bug","requesterId":"user111111111111111111","scope":"PROJECT","status":"Approved","targetId":"target2222222222222222","totalOccurrences":10,"type":"Other"}]
13
+ */
14
+ exemptions: FrontendExemption[];
15
+ pagination: Pagination;
16
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @example {"baselineRegEx":"release_.*","baselineVariantId":"abcdef1234567890ghijkl","created":1651578240,"directory":"app/src","id":"abcdef1234567890ghijkl","lastModified":1651578240,"name":"NodeGoat","orgId":"example_org","projectId":"example_project","type":"repository","url":"https://github.com/example/repo"}
3
+ */
4
+ export interface Target {
5
+ /**
6
+ * RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
7
+ * @example "release_.*"
8
+ */
9
+ baselineRegEx?: string;
10
+ /**
11
+ * ID of baseline Target Variant for Issue comparison
12
+ * @example "abcdef1234567890ghijkl"
13
+ */
14
+ baselineVariantId?: string;
15
+ /**
16
+ * Unix timestamp at which the resource was created
17
+ * @format int64
18
+ * @example 1651578240
19
+ */
20
+ created: number;
21
+ /**
22
+ * Directory within the Test Target to be scanned
23
+ * @example "app/src"
24
+ */
25
+ directory?: string;
26
+ /**
27
+ * Resource identifier
28
+ * @example "abcdef1234567890ghijkl"
29
+ */
30
+ id: string;
31
+ /**
32
+ * Unix timestamp at which the resource was most recently modified
33
+ * @format int64
34
+ * @example 1651578240
35
+ */
36
+ lastModified: number;
37
+ /**
38
+ * Name of the Test Target
39
+ * @example "NodeGoat"
40
+ */
41
+ name: string;
42
+ /**
43
+ * Harness Organization ID
44
+ * @example "example_org"
45
+ */
46
+ orgId: string;
47
+ /**
48
+ * Harness Project ID
49
+ * @example "example_project"
50
+ */
51
+ projectId: string;
52
+ /**
53
+ * Test Target's type
54
+ * @example "repository"
55
+ */
56
+ type: 'configuration' | 'container' | 'instance' | 'repository';
57
+ /**
58
+ * URL used to access the Test Target
59
+ * @example "https://github.com/example/repo"
60
+ */
61
+ url?: string;
62
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-sto-core-client",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Harness STO service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,38 +0,0 @@
1
- import { UseMutationOptions } from '@tanstack/react-query';
2
- import type { NotFound } from '../schemas/NotFound';
3
- import type { ResponseWithPagination } from '../helpers';
4
- import { FetcherOptions } from '../../../../fetcher/index.js';
5
- export interface TargetsDeleteTargetMutationPathParams {
6
- /**
7
- * The ID of the Test Target to delete
8
- * @example "abcdef1234567890ghijkl"
9
- */
10
- id: string;
11
- }
12
- export interface TargetsDeleteTargetMutationQueryParams {
13
- /**
14
- * Harness Account ID
15
- * @example "abcdef1234567890ghijkl"
16
- */
17
- accountId: string;
18
- /**
19
- * Harness Organization ID
20
- * @example "example_org"
21
- */
22
- orgId: string;
23
- /**
24
- * Harness Project ID
25
- * @example "example_project"
26
- */
27
- projectId: string;
28
- }
29
- export type TargetsDeleteTargetOkResponse = ResponseWithPagination<unknown>;
30
- export type TargetsDeleteTargetErrorResponse = NotFound;
31
- export interface TargetsDeleteTargetProps extends TargetsDeleteTargetMutationPathParams, Omit<FetcherOptions<TargetsDeleteTargetMutationQueryParams, unknown>, 'url'> {
32
- queryParams: TargetsDeleteTargetMutationQueryParams;
33
- }
34
- export declare function targetsDeleteTarget(props: TargetsDeleteTargetProps): Promise<TargetsDeleteTargetOkResponse>;
35
- /**
36
- * Delete an existing Test Target
37
- */
38
- export declare function useTargetsDeleteTargetMutation(options?: Omit<UseMutationOptions<TargetsDeleteTargetOkResponse, TargetsDeleteTargetErrorResponse, TargetsDeleteTargetProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<TargetsDeleteTargetOkResponse, NotFound, TargetsDeleteTargetProps, unknown>;
@@ -1,14 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- import { useMutation } from '@tanstack/react-query';
5
- import { fetcher } from '../../../../fetcher/index.js';
6
- export function targetsDeleteTarget(props) {
7
- return fetcher(Object.assign({ url: `/api/v2/targets/${props.id}`, method: 'DELETE' }, props));
8
- }
9
- /**
10
- * Delete an existing Test Target
11
- */
12
- export function useTargetsDeleteTargetMutation(options) {
13
- return useMutation((mutateProps) => targetsDeleteTarget(mutateProps), options);
14
- }