@harnessio/react-chaos-manager-client 0.12.0 → 0.13.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.
Files changed (27) hide show
  1. package/dist/chaos-manager/src/services/hooks/useListFaultQuery.d.ts +14 -7
  2. package/dist/chaos-manager/src/services/hooks/useListFaultQuery.js +2 -2
  3. package/dist/chaos-manager/src/services/index.d.ts +4 -11
  4. package/dist/chaos-manager/src/services/schemas/ChaoshubFaultCategoryCount.d.ts +4 -0
  5. package/dist/chaos-manager/src/services/schemas/ChaoshubListFaultsResponse.d.ts +8 -0
  6. package/dist/chaos-manager/src/services/schemas/ChaoshubresourcesChaosHubResource.d.ts +97 -0
  7. package/package.json +1 -1
  8. package/dist/chaos-manager/src/services/schemas/ModelAnnotation.d.ts +0 -8
  9. package/dist/chaos-manager/src/services/schemas/ModelChart.d.ts +0 -10
  10. package/dist/chaos-manager/src/services/schemas/ModelExperiments.d.ts +0 -5
  11. package/dist/chaos-manager/src/services/schemas/ModelFaultList.d.ts +0 -8
  12. package/dist/chaos-manager/src/services/schemas/ModelFaultList.js +0 -4
  13. package/dist/chaos-manager/src/services/schemas/ModelLink.d.ts +0 -4
  14. package/dist/chaos-manager/src/services/schemas/ModelLink.js +0 -4
  15. package/dist/chaos-manager/src/services/schemas/ModelMaintainer.d.ts +0 -10
  16. package/dist/chaos-manager/src/services/schemas/ModelMaintainer.js +0 -4
  17. package/dist/chaos-manager/src/services/schemas/ModelMetadata.d.ts +0 -6
  18. package/dist/chaos-manager/src/services/schemas/ModelMetadata.js +0 -1
  19. package/dist/chaos-manager/src/services/schemas/ModelPackageInformation.d.ts +0 -5
  20. package/dist/chaos-manager/src/services/schemas/ModelPackageInformation.js +0 -1
  21. package/dist/chaos-manager/src/services/schemas/ModelProvider.d.ts +0 -3
  22. package/dist/chaos-manager/src/services/schemas/ModelProvider.js +0 -4
  23. package/dist/chaos-manager/src/services/schemas/ModelSpec.d.ts +0 -19
  24. package/dist/chaos-manager/src/services/schemas/ModelSpec.js +0 -1
  25. /package/dist/chaos-manager/src/services/schemas/{ModelAnnotation.js → ChaoshubFaultCategoryCount.js} +0 -0
  26. /package/dist/chaos-manager/src/services/schemas/{ModelChart.js → ChaoshubListFaultsResponse.js} +0 -0
  27. /package/dist/chaos-manager/src/services/schemas/{ModelExperiments.js → ChaoshubresourcesChaosHubResource.js} +0 -0
@@ -1,20 +1,27 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { ModelChart } from '../schemas/ModelChart';
2
+ import type { ChaoshubListFaultsResponse } from '../schemas/ChaoshubListFaultsResponse';
3
3
  import type { ApiRestError } from '../schemas/ApiRestError';
4
4
  import { FetcherOptions } from '../../../../custom-fetcher/index.js';
5
- export interface ListFaultQueryPathParams {
6
- hubIdentity: string;
7
- }
8
5
  export interface ListFaultQueryQueryParams {
9
6
  accountIdentifier: string;
10
7
  organizationIdentifier: string;
11
8
  projectIdentifier: string;
9
+ hubIdentity?: string;
12
10
  infraType?: string;
13
- onlyNamespaceScoped?: boolean;
11
+ entityType?: string;
12
+ search: string;
13
+ /**
14
+ * @default 0
15
+ */
16
+ page: number;
17
+ /**
18
+ * @default 15
19
+ */
20
+ limit: number;
14
21
  }
15
- export type ListFaultOkResponse = ModelChart[];
22
+ export type ListFaultOkResponse = ChaoshubListFaultsResponse;
16
23
  export type ListFaultErrorResponse = ApiRestError;
17
- export interface ListFaultProps extends ListFaultQueryPathParams, Omit<FetcherOptions<ListFaultQueryQueryParams, unknown>, 'url'> {
24
+ export interface ListFaultProps extends Omit<FetcherOptions<ListFaultQueryQueryParams, unknown>, 'url'> {
18
25
  queryParams: ListFaultQueryQueryParams;
19
26
  }
20
27
  export interface ListFaultResponseContainer {
@@ -4,11 +4,11 @@
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../custom-fetcher/index.js';
6
6
  export function listFault(props) {
7
- return fetcher(Object.assign({ url: `/rest/hub/${props.hubIdentity}/faults`, method: 'GET' }, props));
7
+ return fetcher(Object.assign({ url: `/rest/hubs/faults`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
10
  * Lists faults in a chaos hub based on given filters
11
11
  */
12
12
  export function useListFaultQuery(props, options) {
13
- return useQuery(['listFault', props.hubIdentity, props.queryParams], ({ signal }) => listFault(Object.assign(Object.assign({}, props), { signal })), options);
13
+ return useQuery(['listFault', props.queryParams], ({ signal }) => listFault(Object.assign(Object.assign({}, props), { signal })), options);
14
14
  }
@@ -142,7 +142,7 @@ export type { ListChaosV2ExperimentErrorResponse, ListChaosV2ExperimentOkRespons
142
142
  export { listChaosV2Experiment, useListChaosV2ExperimentQuery, } from './hooks/useListChaosV2ExperimentQuery';
143
143
  export type { ListExperimentsWithActiveInfrasMinimalNotificationErrorResponse, ListExperimentsWithActiveInfrasMinimalNotificationOkResponse, ListExperimentsWithActiveInfrasMinimalNotificationProps, ListExperimentsWithActiveInfrasMinimalNotificationQueryQueryParams, } from './hooks/useListExperimentsWithActiveInfrasMinimalNotificationQuery';
144
144
  export { listExperimentsWithActiveInfrasMinimalNotification, useListExperimentsWithActiveInfrasMinimalNotificationQuery, } from './hooks/useListExperimentsWithActiveInfrasMinimalNotificationQuery';
145
- export type { ListFaultErrorResponse, ListFaultOkResponse, ListFaultProps, ListFaultQueryPathParams, ListFaultQueryQueryParams, } from './hooks/useListFaultQuery';
145
+ export type { ListFaultErrorResponse, ListFaultOkResponse, ListFaultProps, ListFaultQueryQueryParams, } from './hooks/useListFaultQuery';
146
146
  export { listFault, useListFaultQuery } from './hooks/useListFaultQuery';
147
147
  export type { ListFaultTemplateErrorResponse, ListFaultTemplateOkResponse, ListFaultTemplateProps, ListFaultTemplateQueryQueryParams, } from './hooks/useListFaultTemplateQuery';
148
148
  export { listFaultTemplate, useListFaultTemplateQuery } from './hooks/useListFaultTemplateQuery';
@@ -299,6 +299,9 @@ export type { ChaosfaulttemplateGetActionTemplateResponse } from './schemas/Chao
299
299
  export type { ChaosfaulttemplateGetFaultTemplateResponse } from './schemas/ChaosfaulttemplateGetFaultTemplateResponse';
300
300
  export type { ChaosfaulttemplateListActionTemplateResponse } from './schemas/ChaosfaulttemplateListActionTemplateResponse';
301
301
  export type { ChaosfaulttemplateListFaultTemplateResponse } from './schemas/ChaosfaulttemplateListFaultTemplateResponse';
302
+ export type { ChaoshubFaultCategoryCount } from './schemas/ChaoshubFaultCategoryCount';
303
+ export type { ChaoshubListFaultsResponse } from './schemas/ChaoshubListFaultsResponse';
304
+ export type { ChaoshubresourcesChaosHubResource } from './schemas/ChaoshubresourcesChaosHubResource';
302
305
  export type { Chaoshubv2ChaosHubResponse } from './schemas/Chaoshubv2ChaosHubResponse';
303
306
  export type { Chaoshubv2CreateHubRequest } from './schemas/Chaoshubv2CreateHubRequest';
304
307
  export type { Chaoshubv2GetHubResponse } from './schemas/Chaoshubv2GetHubResponse';
@@ -424,26 +427,17 @@ export type { K8sIoApimachineryPkgApisMetaV1ConditionStatus } from './schemas/K8
424
427
  export type { K8sinfraGetInfraTokenResponse } from './schemas/K8sinfraGetInfraTokenResponse';
425
428
  export type { K8sinfraUpdateEmissaryUrlRequest } from './schemas/K8sinfraUpdateEmissaryUrlRequest';
426
429
  export type { K8sinfraUpdateEmissaryUrlResponse } from './schemas/K8sinfraUpdateEmissaryUrlResponse';
427
- export type { ModelAnnotation } from './schemas/ModelAnnotation';
428
- export type { ModelChart } from './schemas/ModelChart';
429
430
  export type { ModelClusterType } from './schemas/ModelClusterType';
430
431
  export type { ModelConditionDetails } from './schemas/ModelConditionDetails';
431
432
  export type { ModelEventMetadata } from './schemas/ModelEventMetadata';
432
- export type { ModelExperiments } from './schemas/ModelExperiments';
433
- export type { ModelFaultList } from './schemas/ModelFaultList';
434
433
  export type { ModelInfraScope } from './schemas/ModelInfraScope';
435
434
  export type { ModelInfrastructure } from './schemas/ModelInfrastructure';
436
435
  export type { ModelInfrastructureType } from './schemas/ModelInfrastructureType';
437
436
  export type { ModelInstallationType } from './schemas/ModelInstallationType';
438
437
  export type { ModelKubernetesInfra } from './schemas/ModelKubernetesInfra';
439
- export type { ModelLink } from './schemas/ModelLink';
440
438
  export type { ModelListInfraRequest } from './schemas/ModelListInfraRequest';
441
439
  export type { ModelListInfraResponse } from './schemas/ModelListInfraResponse';
442
- export type { ModelMaintainer } from './schemas/ModelMaintainer';
443
- export type { ModelMetadata } from './schemas/ModelMetadata';
444
- export type { ModelPackageInformation } from './schemas/ModelPackageInformation';
445
440
  export type { ModelProbeMap } from './schemas/ModelProbeMap';
446
- export type { ModelProvider } from './schemas/ModelProvider';
447
441
  export type { ModelReRunChaosWorkflowResponse } from './schemas/ModelReRunChaosWorkflowResponse';
448
442
  export type { ModelRecentWorkflowRun } from './schemas/ModelRecentWorkflowRun';
449
443
  export type { ModelRecurrence } from './schemas/ModelRecurrence';
@@ -453,7 +447,6 @@ export type { ModelRuleDetails } from './schemas/ModelRuleDetails';
453
447
  export type { ModelSecurityGovernance } from './schemas/ModelSecurityGovernance';
454
448
  export type { ModelSecurityGovernanceNodeData } from './schemas/ModelSecurityGovernanceNodeData';
455
449
  export type { ModelSecurityGovernancePhase } from './schemas/ModelSecurityGovernancePhase';
456
- export type { ModelSpec } from './schemas/ModelSpec';
457
450
  export type { ModelTimeWindow } from './schemas/ModelTimeWindow';
458
451
  export type { ModelUpdateStatus } from './schemas/ModelUpdateStatus';
459
452
  export type { ModelUpgrade } from './schemas/ModelUpgrade';
@@ -0,0 +1,4 @@
1
+ export interface ChaoshubFaultCategoryCount {
2
+ category?: string;
3
+ count?: number;
4
+ }
@@ -0,0 +1,8 @@
1
+ import type { ChaoshubFaultCategoryCount } from '../schemas/ChaoshubFaultCategoryCount';
2
+ import type { ChaoshubresourcesChaosHubResource } from '../schemas/ChaoshubresourcesChaosHubResource';
3
+ import type { GithubComHarnessHceSaasGraphqlServerApiPagination } from '../schemas/GithubComHarnessHceSaasGraphqlServerApiPagination';
4
+ export interface ChaoshubListFaultsResponse {
5
+ categoryCount?: ChaoshubFaultCategoryCount[];
6
+ faults?: ChaoshubresourcesChaosHubResource[];
7
+ pagination?: GithubComHarnessHceSaasGraphqlServerApiPagination;
8
+ }
@@ -0,0 +1,97 @@
1
+ export interface ChaoshubresourcesChaosHubResource {
2
+ accountID: string;
3
+ /**
4
+ * Category of the fault (Kubernetes, KubernetesV2, Linux, Windows, PCF etc)
5
+ */
6
+ category?: string;
7
+ /**
8
+ * ChaosType
9
+ */
10
+ chaosType?: string;
11
+ /**
12
+ * chartserviceversion yml in encoded form (chartserviceversion.yaml)
13
+ */
14
+ chartServiceVersion?: string;
15
+ createdAt?: number;
16
+ createdBy?: string;
17
+ /**
18
+ * Description of the resource
19
+ */
20
+ description?: string;
21
+ /**
22
+ * Display name of the resource
23
+ */
24
+ displayName?: string;
25
+ /**
26
+ * ChaosEngine yml in encoded form (engine.yaml)
27
+ */
28
+ engine?: string;
29
+ /**
30
+ * experiment yml in encoded form (experiment.yaml)
31
+ */
32
+ experiment?: string;
33
+ /**
34
+ * experiment-v2 yml in encoded form (experiment-v2.yaml)
35
+ */
36
+ experimentV2?: string;
37
+ /**
38
+ * Fault yml in encoded form (fault.yml)
39
+ */
40
+ fault?: string;
41
+ /**
42
+ * ID of the chaos hub
43
+ */
44
+ hubID?: string;
45
+ /**
46
+ * Mongo ID (primary key)
47
+ */
48
+ id?: string;
49
+ /**
50
+ * TODO: identity changes move to chaosHub
51
+ * Unique identifier (human-readable) immutable
52
+ * Initially it will be same as name
53
+ * Should be unique at hub level
54
+ */
55
+ identity?: string;
56
+ /**
57
+ * Infras represents supported infrastructures
58
+ */
59
+ infras?: string[];
60
+ /**
61
+ * IsDefaultHub represents if it is a default hub
62
+ */
63
+ isDefaultHub?: boolean;
64
+ isRemoved: boolean;
65
+ /**
66
+ * K8sFault yml in encoded form (k8s-fault.yaml)
67
+ */
68
+ k8SFault?: string;
69
+ /**
70
+ * Keyword of the resource (kubernetes, VMWare etc)
71
+ */
72
+ keywords?: string[];
73
+ /**
74
+ * Kind of the resource
75
+ */
76
+ kind?: string;
77
+ /**
78
+ * name of the resource
79
+ */
80
+ name?: string;
81
+ orgID?: string;
82
+ /**
83
+ * Plan
84
+ */
85
+ plan?: string[];
86
+ /**
87
+ * Platforms supported (GKE, Minikube, EKS, AKS etc)
88
+ */
89
+ platforms?: string[];
90
+ projectID?: string;
91
+ /**
92
+ * Type: fault or experiment or probes
93
+ */
94
+ resourceType?: string;
95
+ updatedAt?: number;
96
+ updatedBy?: string;
97
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-chaos-manager-client",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Harness React Chaos Manager Service Client - APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,8 +0,0 @@
1
- export interface ModelAnnotation {
2
- categories?: string;
3
- chartDescription?: string;
4
- createdAt?: string;
5
- repository?: string;
6
- support?: string;
7
- vendor?: string;
8
- }
@@ -1,10 +0,0 @@
1
- import type { ModelMetadata } from '../schemas/ModelMetadata';
2
- import type { ModelPackageInformation } from '../schemas/ModelPackageInformation';
3
- import type { ModelSpec } from '../schemas/ModelSpec';
4
- export interface ModelChart {
5
- apiVersion?: string;
6
- kind?: string;
7
- metadata?: ModelMetadata;
8
- packageInfo?: ModelPackageInformation;
9
- spec?: ModelSpec;
10
- }
@@ -1,5 +0,0 @@
1
- export interface ModelExperiments {
2
- CSV?: string;
3
- desc?: string;
4
- name?: string;
5
- }
@@ -1,8 +0,0 @@
1
- export interface ModelFaultList {
2
- chaosType?: string;
3
- description?: string;
4
- displayName?: string;
5
- name?: string;
6
- plan?: string[];
7
- supportedVersion?: string[];
8
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,4 +0,0 @@
1
- export interface ModelLink {
2
- name?: string;
3
- url?: string;
4
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,10 +0,0 @@
1
- export interface ModelMaintainer {
2
- /**
3
- * Email of the maintainer
4
- */
5
- email?: string;
6
- /**
7
- * Name of the maintainer
8
- */
9
- name?: string;
10
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,6 +0,0 @@
1
- import type { ModelAnnotation } from '../schemas/ModelAnnotation';
2
- export interface ModelMetadata {
3
- annotations?: ModelAnnotation;
4
- name?: string;
5
- version?: string;
6
- }
@@ -1,5 +0,0 @@
1
- import type { ModelExperiments } from '../schemas/ModelExperiments';
2
- export interface ModelPackageInformation {
3
- experiments?: ModelExperiments[];
4
- packageName?: string;
5
- }
@@ -1,3 +0,0 @@
1
- export interface ModelProvider {
2
- name?: string;
3
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};
@@ -1,19 +0,0 @@
1
- import type { ModelFaultList } from '../schemas/ModelFaultList';
2
- import type { ModelLink } from '../schemas/ModelLink';
3
- import type { ModelMaintainer } from '../schemas/ModelMaintainer';
4
- import type { ModelProvider } from '../schemas/ModelProvider';
5
- export interface ModelSpec {
6
- categoryDescription?: string;
7
- chaosExpCRDLink?: string;
8
- chaosType?: string;
9
- displayName?: string;
10
- experiments?: string[];
11
- faults?: ModelFaultList[];
12
- keywords?: string[];
13
- links?: ModelLink[];
14
- maintainers?: ModelMaintainer[];
15
- maturity?: string;
16
- minKubeVersion?: string;
17
- platforms?: string[];
18
- provider?: ModelProvider;
19
- }
@@ -1 +0,0 @@
1
- export {};