@harnessio/react-chaos-manager-client 1.89.1 → 1.90.1

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 (23) hide show
  1. package/dist/chaos-manager/src/services/hooks/useCreateRiskExperimentRecommendationExperimentMutation.d.ts +29 -0
  2. package/dist/chaos-manager/src/services/hooks/useCreateRiskExperimentRecommendationExperimentMutation.js +14 -0
  3. package/dist/chaos-manager/src/services/hooks/useListRiskExperimentRecommendationsQuery.d.ts +35 -0
  4. package/dist/chaos-manager/src/services/hooks/useListRiskExperimentRecommendationsQuery.js +14 -0
  5. package/dist/chaos-manager/src/services/index.d.ts +10 -0
  6. package/dist/chaos-manager/src/services/index.js +2 -0
  7. package/dist/chaos-manager/src/services/schemas/ChaosExperimentChaosExperimentRequest.d.ts +1 -0
  8. package/dist/chaos-manager/src/services/schemas/ExperimentsGetResponse.d.ts +1 -0
  9. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsCreateExperimentResponse.d.ts +7 -0
  10. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsCreateExperimentResponse.js +4 -0
  11. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsListResponse.d.ts +7 -0
  12. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsListResponse.js +1 -0
  13. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsRiskExperimentRecommendation.d.ts +20 -0
  14. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsRiskExperimentRecommendation.js +1 -0
  15. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsRiskExperimentRecommendationSpec.d.ts +34 -0
  16. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsRiskExperimentRecommendationSpec.js +1 -0
  17. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsStatus.d.ts +1 -0
  18. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsStatus.js +4 -0
  19. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsWorkload.d.ts +5 -0
  20. package/dist/chaos-manager/src/services/schemas/RiskexperimentrecommendationsWorkload.js +4 -0
  21. package/dist/chaos-manager/src/services/schemas/ScannedrisksScannedRiskSpec.d.ts +16 -0
  22. package/dist/chaos-manager/src/services/schemas/TypesExperimentCreationResponse.d.ts +1 -0
  23. package/package.json +1 -1
@@ -0,0 +1,29 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { RiskexperimentrecommendationsCreateExperimentResponse } from '../schemas/RiskexperimentrecommendationsCreateExperimentResponse';
3
+ import type { SharedError } from '../schemas/SharedError';
4
+ import { FetcherOptions } from '../../../../custom-fetcher/index.js';
5
+ export interface CreateRiskExperimentRecommendationExperimentMutationPathParams {
6
+ identity: string;
7
+ }
8
+ export interface CreateRiskExperimentRecommendationExperimentMutationQueryParams {
9
+ accountIdentifier: string;
10
+ correlationID?: string;
11
+ organizationIdentifier?: string;
12
+ parentUniqueId?: string;
13
+ projectIdentifier?: string;
14
+ }
15
+ export type CreateRiskExperimentRecommendationExperimentOkResponse = RiskexperimentrecommendationsCreateExperimentResponse;
16
+ export type CreateRiskExperimentRecommendationExperimentErrorResponse = SharedError;
17
+ export interface CreateRiskExperimentRecommendationExperimentProps extends CreateRiskExperimentRecommendationExperimentMutationPathParams, Omit<FetcherOptions<CreateRiskExperimentRecommendationExperimentMutationQueryParams, unknown>, 'url'> {
18
+ queryParams: CreateRiskExperimentRecommendationExperimentMutationQueryParams;
19
+ }
20
+ export interface CreateRiskExperimentRecommendationExperimentResponseContainer {
21
+ body: CreateRiskExperimentRecommendationExperimentOkResponse;
22
+ headers: Headers;
23
+ }
24
+ export declare function createRiskExperimentRecommendationExperiment(props: CreateRiskExperimentRecommendationExperimentProps): Promise<CreateRiskExperimentRecommendationExperimentResponseContainer>;
25
+ export type CreateRiskExperimentRecommendationExperimentMutationProps<T extends keyof CreateRiskExperimentRecommendationExperimentProps> = Omit<CreateRiskExperimentRecommendationExperimentProps, T> & Partial<Pick<CreateRiskExperimentRecommendationExperimentProps, T>>;
26
+ /**
27
+ * creates a chaos experiment from the recommendation's faults, infrastructure, and target workload. It attaches the probes of the chaos service onboarded for the workload, or the default workload probe when there are none
28
+ */
29
+ export declare function useCreateRiskExperimentRecommendationExperimentMutation<T extends keyof CreateRiskExperimentRecommendationExperimentProps>(props: Pick<Partial<CreateRiskExperimentRecommendationExperimentProps>, T>, options?: Omit<UseMutationOptions<CreateRiskExperimentRecommendationExperimentResponseContainer, CreateRiskExperimentRecommendationExperimentErrorResponse, CreateRiskExperimentRecommendationExperimentMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateRiskExperimentRecommendationExperimentResponseContainer, SharedError, CreateRiskExperimentRecommendationExperimentMutationProps<T>, unknown>;
@@ -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 { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../custom-fetcher/index.js';
6
+ export function createRiskExperimentRecommendationExperiment(props) {
7
+ return fetcher(Object.assign({ url: `/v3/risk-experiment-recommendations/${props.identity}/experiment`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * creates a chaos experiment from the recommendation's faults, infrastructure, and target workload. It attaches the probes of the chaos service onboarded for the workload, or the default workload probe when there are none
11
+ */
12
+ export function useCreateRiskExperimentRecommendationExperimentMutation(props, options) {
13
+ return useMutation((mutateProps) => createRiskExperimentRecommendationExperiment(Object.assign(Object.assign({}, props), mutateProps)), options);
14
+ }
@@ -0,0 +1,35 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { RiskexperimentrecommendationsListResponse } from '../schemas/RiskexperimentrecommendationsListResponse';
3
+ import type { SharedError } from '../schemas/SharedError';
4
+ import { FetcherOptions } from '../../../../custom-fetcher/index.js';
5
+ export interface ListRiskExperimentRecommendationsQueryQueryParams {
6
+ accountIdentifier: string;
7
+ correlationID?: string;
8
+ /**
9
+ * @default 15
10
+ */
11
+ limit?: number;
12
+ organizationIdentifier?: string;
13
+ /**
14
+ * @default 0
15
+ */
16
+ page?: number;
17
+ parentUniqueId?: string;
18
+ projectIdentifier?: string;
19
+ scannedRiskIdentity?: string;
20
+ search?: string;
21
+ }
22
+ export type ListRiskExperimentRecommendationsOkResponse = RiskexperimentrecommendationsListResponse;
23
+ export type ListRiskExperimentRecommendationsErrorResponse = SharedError;
24
+ export interface ListRiskExperimentRecommendationsProps extends Omit<FetcherOptions<ListRiskExperimentRecommendationsQueryQueryParams, unknown>, 'url'> {
25
+ queryParams: ListRiskExperimentRecommendationsQueryQueryParams;
26
+ }
27
+ export interface ListRiskExperimentRecommendationsResponseContainer {
28
+ body: ListRiskExperimentRecommendationsOkResponse;
29
+ headers: Headers;
30
+ }
31
+ export declare function listRiskExperimentRecommendations(props: ListRiskExperimentRecommendationsProps): Promise<ListRiskExperimentRecommendationsResponseContainer>;
32
+ /**
33
+ * returns the live risk experiment recommendations. Missing recommendations are created by the background reconciler. When scannedRiskIdentity is set, only that risk's recommendation is returned.
34
+ */
35
+ export declare function useListRiskExperimentRecommendationsQuery(props: ListRiskExperimentRecommendationsProps, options?: Omit<UseQueryOptions<ListRiskExperimentRecommendationsResponseContainer, ListRiskExperimentRecommendationsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ListRiskExperimentRecommendationsResponseContainer, SharedError>;
@@ -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 '../../../../custom-fetcher/index.js';
6
+ export function listRiskExperimentRecommendations(props) {
7
+ return fetcher(Object.assign({ url: `/v3/risk-experiment-recommendations`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * returns the live risk experiment recommendations. Missing recommendations are created by the background reconciler. When scannedRiskIdentity is set, only that risk's recommendation is returned.
11
+ */
12
+ export function useListRiskExperimentRecommendationsQuery(props, options) {
13
+ return useQuery(['listRiskExperimentRecommendations', props.queryParams], ({ signal }) => listRiskExperimentRecommendations(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -60,6 +60,8 @@ export type { CreateProbeTemplateErrorResponse, CreateProbeTemplateMutationProps
60
60
  export { createProbeTemplate, useCreateProbeTemplateMutation, } from './hooks/useCreateProbeTemplateMutation';
61
61
  export type { CreateRecommendationErrorResponse, CreateRecommendationMutationProps, CreateRecommendationMutationQueryParams, CreateRecommendationOkResponse, CreateRecommendationProps, } from './hooks/useCreateRecommendationMutation';
62
62
  export { createRecommendation, useCreateRecommendationMutation, } from './hooks/useCreateRecommendationMutation';
63
+ export type { CreateRiskExperimentRecommendationExperimentErrorResponse, CreateRiskExperimentRecommendationExperimentMutationPathParams, CreateRiskExperimentRecommendationExperimentMutationProps, CreateRiskExperimentRecommendationExperimentMutationQueryParams, CreateRiskExperimentRecommendationExperimentOkResponse, CreateRiskExperimentRecommendationExperimentProps, } from './hooks/useCreateRiskExperimentRecommendationExperimentMutation';
64
+ export { createRiskExperimentRecommendationExperiment, useCreateRiskExperimentRecommendationExperimentMutation, } from './hooks/useCreateRiskExperimentRecommendationExperimentMutation';
63
65
  export type { CreateRiskErrorResponse, CreateRiskMutationProps, CreateRiskMutationQueryParams, CreateRiskOkResponse, CreateRiskProps, CreateRiskRequestBody, } from './hooks/useCreateRiskMutation';
64
66
  export { createRisk, useCreateRiskMutation } from './hooks/useCreateRiskMutation';
65
67
  export type { CreateRiskScanErrorResponse, CreateRiskScanMutationProps, CreateRiskScanMutationQueryParams, CreateRiskScanOkResponse, CreateRiskScanProps, CreateRiskScanRequestBody, } from './hooks/useCreateRiskScanMutation';
@@ -424,6 +426,8 @@ export type { ListProbesErrorResponse, ListProbesOkResponse, ListProbesProps, Li
424
426
  export { listProbes, useListProbesQuery } from './hooks/useListProbesQuery';
425
427
  export type { ListRecommendationsErrorResponse, ListRecommendationsOkResponse, ListRecommendationsProps, ListRecommendationsQueryQueryParams, ListRecommendationsRequestBody, } from './hooks/useListRecommendationsQuery';
426
428
  export { listRecommendations, useListRecommendationsQuery, } from './hooks/useListRecommendationsQuery';
429
+ export type { ListRiskExperimentRecommendationsErrorResponse, ListRiskExperimentRecommendationsOkResponse, ListRiskExperimentRecommendationsProps, ListRiskExperimentRecommendationsQueryQueryParams, } from './hooks/useListRiskExperimentRecommendationsQuery';
430
+ export { listRiskExperimentRecommendations, useListRiskExperimentRecommendationsQuery, } from './hooks/useListRiskExperimentRecommendationsQuery';
427
431
  export type { ListRiskRulesErrorResponse, ListRiskRulesOkResponse, ListRiskRulesProps, ListRiskRulesQueryQueryParams, } from './hooks/useListRiskRulesQuery';
428
432
  export { listRiskRules, useListRiskRulesQuery } from './hooks/useListRiskRulesQuery';
429
433
  export type { ListRiskScansErrorResponse, ListRiskScansOkResponse, ListRiskScansProps, ListRiskScansQueryQueryParams, } from './hooks/useListRiskScansQuery';
@@ -1328,6 +1332,12 @@ export type { RiskSeverity } from './schemas/RiskSeverity';
1328
1332
  export type { RiskTargetService } from './schemas/RiskTargetService';
1329
1333
  export type { RiskTargetServiceType } from './schemas/RiskTargetServiceType';
1330
1334
  export type { RiskValidationType } from './schemas/RiskValidationType';
1335
+ export type { RiskexperimentrecommendationsCreateExperimentResponse } from './schemas/RiskexperimentrecommendationsCreateExperimentResponse';
1336
+ export type { RiskexperimentrecommendationsListResponse } from './schemas/RiskexperimentrecommendationsListResponse';
1337
+ export type { RiskexperimentrecommendationsRiskExperimentRecommendation } from './schemas/RiskexperimentrecommendationsRiskExperimentRecommendation';
1338
+ export type { RiskexperimentrecommendationsRiskExperimentRecommendationSpec } from './schemas/RiskexperimentrecommendationsRiskExperimentRecommendationSpec';
1339
+ export type { RiskexperimentrecommendationsStatus } from './schemas/RiskexperimentrecommendationsStatus';
1340
+ export type { RiskexperimentrecommendationsWorkload } from './schemas/RiskexperimentrecommendationsWorkload';
1331
1341
  export type { RiskoccurrencesProbeExecutionSource } from './schemas/RiskoccurrencesProbeExecutionSource';
1332
1342
  export type { RiskrulesListResponse } from './schemas/RiskrulesListResponse';
1333
1343
  export type { RiskrulesRiskRuleResponse } from './schemas/RiskrulesRiskRuleResponse';
@@ -29,6 +29,7 @@ export { createInputSetV3, useCreateInputSetV3Mutation } from './hooks/useCreate
29
29
  export { createProbe, useCreateProbeMutation } from './hooks/useCreateProbeMutation';
30
30
  export { createProbeTemplate, useCreateProbeTemplateMutation, } from './hooks/useCreateProbeTemplateMutation';
31
31
  export { createRecommendation, useCreateRecommendationMutation, } from './hooks/useCreateRecommendationMutation';
32
+ export { createRiskExperimentRecommendationExperiment, useCreateRiskExperimentRecommendationExperimentMutation, } from './hooks/useCreateRiskExperimentRecommendationExperimentMutation';
32
33
  export { createRisk, useCreateRiskMutation } from './hooks/useCreateRiskMutation';
33
34
  export { createRiskScan, useCreateRiskScanMutation } from './hooks/useCreateRiskScanMutation';
34
35
  export { createRule, useCreateRuleMutation } from './hooks/useCreateRuleMutation';
@@ -211,6 +212,7 @@ export { listProbeTemplate, useListProbeTemplateQuery } from './hooks/useListPro
211
212
  export { listProbeTemplateReferencedBy, useListProbeTemplateReferencedByQuery, } from './hooks/useListProbeTemplateReferencedByQuery';
212
213
  export { listProbes, useListProbesQuery } from './hooks/useListProbesQuery';
213
214
  export { listRecommendations, useListRecommendationsQuery, } from './hooks/useListRecommendationsQuery';
215
+ export { listRiskExperimentRecommendations, useListRiskExperimentRecommendationsQuery, } from './hooks/useListRiskExperimentRecommendationsQuery';
214
216
  export { listRiskRules, useListRiskRulesQuery } from './hooks/useListRiskRulesQuery';
215
217
  export { listRiskScans, useListRiskScansQuery } from './hooks/useListRiskScansQuery';
216
218
  export { listRisks, useListRisksQuery } from './hooks/useListRisksQuery';
@@ -8,6 +8,7 @@ import type { ChaosExperimentSingleClickOnboardMetadata } from '../schemas/Chaos
8
8
  import type { ChaosExperimentRunTemplateDetails } from '../schemas/ChaosExperimentRunTemplateDetails';
9
9
  export interface ChaosExperimentChaosExperimentRequest {
10
10
  accountID: string;
11
+ aiSummary?: string;
11
12
  createdAt?: number;
12
13
  createdBy?: string;
13
14
  cronSyntax?: string;
@@ -6,6 +6,7 @@ import type { ExperimentsRecentRunDetails } from '../schemas/ExperimentsRecentRu
6
6
  import type { ChaosExperimentRecommendation } from '../schemas/ChaosExperimentRecommendation';
7
7
  import type { ChaosExperimentRunTemplateDetails } from '../schemas/ChaosExperimentRunTemplateDetails';
8
8
  export interface ExperimentsGetResponse {
9
+ aiSummary?: string;
9
10
  createdAt?: number;
10
11
  createdBy?: HcesdkUserDetails;
11
12
  cronSyntax?: string;
@@ -0,0 +1,7 @@
1
+ export interface RiskexperimentrecommendationsCreateExperimentResponse {
2
+ correlationID?: string;
3
+ experimentId?: string;
4
+ experimentName?: string;
5
+ recommendationIdentity?: string;
6
+ scannedRiskIdentity?: string;
7
+ }
@@ -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,7 @@
1
+ import type { RiskexperimentrecommendationsRiskExperimentRecommendation } from '../schemas/RiskexperimentrecommendationsRiskExperimentRecommendation';
2
+ import type { SharedPaginationResponse } from '../schemas/SharedPaginationResponse';
3
+ export interface RiskexperimentrecommendationsListResponse {
4
+ correlationID?: string;
5
+ data?: RiskexperimentrecommendationsRiskExperimentRecommendation[];
6
+ pagination?: SharedPaginationResponse;
7
+ }
@@ -0,0 +1,20 @@
1
+ import type { RiskexperimentrecommendationsRiskExperimentRecommendationSpec } from '../schemas/RiskexperimentrecommendationsRiskExperimentRecommendationSpec';
2
+ export interface RiskexperimentrecommendationsRiskExperimentRecommendation {
3
+ accountID: string;
4
+ createdAt?: number;
5
+ createdBy?: string;
6
+ identity?: string;
7
+ isRemoved: boolean;
8
+ orgID?: string;
9
+ parentUniqueId?: string;
10
+ projectID?: string;
11
+ /**
12
+ * ScannedRiskIdentity is top-level so the one-live-recommendation-per-risk
13
+ * unique index can cover it.
14
+ */
15
+ scannedRiskIdentity?: string;
16
+ spec?: RiskexperimentrecommendationsRiskExperimentRecommendationSpec;
17
+ uniqueId?: string;
18
+ updatedAt?: number;
19
+ updatedBy?: string;
20
+ }
@@ -0,0 +1,34 @@
1
+ import type { RiskScanType } from '../schemas/RiskScanType';
2
+ import type { RiskSeverity } from '../schemas/RiskSeverity';
3
+ import type { RiskexperimentrecommendationsStatus } from '../schemas/RiskexperimentrecommendationsStatus';
4
+ import type { RiskexperimentrecommendationsWorkload } from '../schemas/RiskexperimentrecommendationsWorkload';
5
+ export interface RiskexperimentrecommendationsRiskExperimentRecommendationSpec {
6
+ agentIdentity?: string;
7
+ /**
8
+ * ChaosServiceIdentity is the chaos service onboarded from the discovered
9
+ * service, when the scanned risk recorded one. Its probes are attached to
10
+ * the experiment.
11
+ */
12
+ chaosServiceIdentity?: string;
13
+ discoveredServiceId?: string;
14
+ environmentIdentity?: string;
15
+ experimentId?: string;
16
+ experimentName?: string;
17
+ /**
18
+ * FaultNames is the snapshot parsed from the latest occurrence's
19
+ * resilienceTestingRec when the recommendation was created.
20
+ */
21
+ faultNames?: string[];
22
+ /**
23
+ * InfraID is the chaos infrastructure ID in "<envRef>/<infraID>" form.
24
+ */
25
+ infraId?: string;
26
+ infraNamespace?: string;
27
+ occurrenceId?: string;
28
+ riskName?: string;
29
+ riskRuleId?: string;
30
+ scanType?: RiskScanType;
31
+ severity?: RiskSeverity;
32
+ status?: RiskexperimentrecommendationsStatus;
33
+ workload?: RiskexperimentrecommendationsWorkload;
34
+ }
@@ -0,0 +1 @@
1
+ export type RiskexperimentrecommendationsStatus = 'Pending';
@@ -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,5 @@
1
+ export interface RiskexperimentrecommendationsWorkload {
2
+ kind?: string;
3
+ name?: string;
4
+ namespace?: string;
5
+ }
@@ -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 {};
@@ -6,11 +6,27 @@ import type { RiskTargetService } from '../schemas/RiskTargetService';
6
6
  import type { ScannedrisksValidationType } from '../schemas/ScannedrisksValidationType';
7
7
  export interface ScannedrisksScannedRiskSpec {
8
8
  category?: RiskCategory;
9
+ /**
10
+ * ExperimentRef is the ID of the chaos experiment created from this risk's
11
+ * recommendation. Kept after the recommendation is removed.
12
+ */
13
+ experimentRef?: string;
9
14
  fingerprint?: string;
10
15
  firstDetected?: number;
11
16
  impact?: string;
12
17
  lastDetected?: number;
13
18
  occurrenceCount?: number;
19
+ /**
20
+ * RecommendationCheckedAt is when the background reconciler last considered
21
+ * this risk. Set even when no recommendation is created, so a miss is not
22
+ * retried until the cooldown elapses.
23
+ */
24
+ recommendationCheckedAt?: number;
25
+ /**
26
+ * RecommendationRef is the identity of the live risk experiment
27
+ * recommendation for this risk. Cleared when the risk is Resolved or Ignored.
28
+ */
29
+ recommendationRef?: string;
14
30
  riskRuleId?: string;
15
31
  riskRuleName?: string;
16
32
  severity?: RiskSeverity;
@@ -3,4 +3,5 @@ import type { TypesExperimentCreationRequest } from '../schemas/TypesExperimentC
3
3
  export interface TypesExperimentCreationResponse {
4
4
  auditAction?: ExperimentSaveChaosExperimentResponse;
5
5
  data?: TypesExperimentCreationRequest;
6
+ generateAISummary?: boolean;
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-chaos-manager-client",
3
- "version": "1.89.1",
3
+ "version": "1.90.1",
4
4
  "description": "Harness React Chaos Manager Service Client - APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",