@harnessio/react-dbops-service-client 0.4.0 → 0.5.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 (25) hide show
  1. package/dist/dbops-service/src/services/hooks/useV1GetCommandStatusMutation.d.ts +2 -0
  2. package/dist/dbops-service/src/services/hooks/useV1GetCommandStatusMutation.js +1 -1
  3. package/dist/dbops-service/src/services/hooks/useV1GetDbOverviewQuery.js +1 -1
  4. package/dist/dbops-service/src/services/hooks/useV1MigrationStateProjDbSchemaMutation.d.ts +38 -0
  5. package/dist/dbops-service/src/services/hooks/useV1MigrationStateProjDbSchemaMutation.js +14 -0
  6. package/dist/dbops-service/src/services/index.d.ts +7 -3
  7. package/dist/dbops-service/src/services/index.js +1 -1
  8. package/dist/dbops-service/src/services/responses/OverviewResponseResponse.d.ts +2 -2
  9. package/dist/dbops-service/src/services/schemas/InstanceDetail.d.ts +7 -0
  10. package/dist/dbops-service/src/services/schemas/MigrationStateChangeSet.d.ts +2 -0
  11. package/dist/dbops-service/src/services/schemas/MigrationStateIn.d.ts +2 -4
  12. package/dist/dbops-service/src/services/schemas/MigrationStateIn.js +0 -3
  13. package/dist/dbops-service/src/services/schemas/MigrationStateInstanceIn.d.ts +10 -0
  14. package/dist/dbops-service/src/services/schemas/MigrationStateInstanceIn.js +1 -0
  15. package/dist/dbops-service/src/services/schemas/MigrationStateOut.d.ts +2 -1
  16. package/dist/dbops-service/src/services/schemas/OrderInstance.d.ts +5 -0
  17. package/dist/dbops-service/src/services/schemas/OrderInstance.js +4 -0
  18. package/dist/dbops-service/src/services/schemas/{OverviewOut.d.ts → OverviewResponseOutput.d.ts} +1 -1
  19. package/dist/dbops-service/src/services/schemas/OverviewResponseOutput.js +4 -0
  20. package/dist/dbops-service/src/services/schemas/SortInstance.d.ts +5 -0
  21. package/dist/dbops-service/src/services/schemas/SortInstance.js +4 -0
  22. package/package.json +1 -1
  23. package/dist/dbops-service/src/services/hooks/useV1MigrationStateProjDbSchemaQuery.d.ts +0 -37
  24. package/dist/dbops-service/src/services/hooks/useV1MigrationStateProjDbSchemaQuery.js +0 -20
  25. /package/dist/dbops-service/src/services/schemas/{OverviewOut.js → InstanceDetail.js} +0 -0
@@ -8,6 +8,8 @@ export interface V1GetCommandStatusMutationPathParams {
8
8
  org: string;
9
9
  project: string;
10
10
  pipeline: string;
11
+ dbschema: string;
12
+ dbinstance: string;
11
13
  }
12
14
  export interface V1GetCommandStatusMutationHeaderParams {
13
15
  'Harness-Account'?: string;
@@ -4,7 +4,7 @@
4
4
  import { useMutation } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function v1GetCommandStatus(props) {
7
- return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/pipeline/${props.pipeline}/deployedState`, method: 'POST' }, props));
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/pipeline/${props.pipeline}/dbschema/${props.dbschema}/instance/${props.dbinstance}/deployedState`, method: 'POST' }, props));
8
8
  }
9
9
  /**
10
10
  * Status of changeset deployment as part of execution with comparison to earlier state.
@@ -4,7 +4,7 @@
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function v1GetDbOverview(props) {
7
- return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/overview`, method: 'GET' }, props));
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/overview`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
10
  * retrieves total dbSchemas, dbInstances and the latest 5 instances deployed
@@ -0,0 +1,38 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { MigrationStateResponseResponse } from '../responses/MigrationStateResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { MigrationStateGetRequestRequestBody } from '../requestBodies/MigrationStateGetRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1MigrationStateProjDbSchemaMutationPathParams {
8
+ org: string;
9
+ project: string;
10
+ dbschema: string;
11
+ }
12
+ export interface V1MigrationStateProjDbSchemaMutationQueryParams {
13
+ /**
14
+ * @format int64
15
+ * @default 0
16
+ */
17
+ page?: number;
18
+ /**
19
+ * @default 10
20
+ */
21
+ limit?: number;
22
+ search_term?: string;
23
+ }
24
+ export interface V1MigrationStateProjDbSchemaMutationHeaderParams {
25
+ 'Harness-Account'?: string;
26
+ }
27
+ export type V1MigrationStateProjDbSchemaRequestBody = MigrationStateGetRequestRequestBody;
28
+ export type V1MigrationStateProjDbSchemaOkResponse = ResponseWithPagination<MigrationStateResponseResponse>;
29
+ export type V1MigrationStateProjDbSchemaErrorResponse = ErrorResponseResponse;
30
+ export interface V1MigrationStateProjDbSchemaProps extends V1MigrationStateProjDbSchemaMutationPathParams, Omit<FetcherOptions<V1MigrationStateProjDbSchemaMutationQueryParams, V1MigrationStateProjDbSchemaRequestBody, V1MigrationStateProjDbSchemaMutationHeaderParams>, 'url'> {
31
+ queryParams: V1MigrationStateProjDbSchemaMutationQueryParams;
32
+ body: V1MigrationStateProjDbSchemaRequestBody;
33
+ }
34
+ export declare function v1MigrationStateProjDbSchema(props: V1MigrationStateProjDbSchemaProps): Promise<V1MigrationStateProjDbSchemaOkResponse>;
35
+ /**
36
+ * Migration state of a schema
37
+ */
38
+ export declare function useV1MigrationStateProjDbSchemaMutation(options?: Omit<UseMutationOptions<V1MigrationStateProjDbSchemaOkResponse, V1MigrationStateProjDbSchemaErrorResponse, V1MigrationStateProjDbSchemaProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1MigrationStateProjDbSchemaOkResponse, import("..").Error, V1MigrationStateProjDbSchemaProps, 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 '../../../../fetcher/index.js';
6
+ export function v1MigrationStateProjDbSchema(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/migrationstate`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Migration state of a schema
11
+ */
12
+ export function useV1MigrationStateProjDbSchemaMutation(options) {
13
+ return useMutation((mutateProps) => v1MigrationStateProjDbSchema(mutateProps), options);
14
+ }
@@ -27,8 +27,8 @@ export type { V1ListProjDbSchemaInstanceErrorResponse, V1ListProjDbSchemaInstanc
27
27
  export { useV1ListProjDbSchemaInstanceQuery, v1ListProjDbSchemaInstance, } from './hooks/useV1ListProjDbSchemaInstanceQuery';
28
28
  export type { V1ListProjDbSchemaErrorResponse, V1ListProjDbSchemaOkResponse, V1ListProjDbSchemaProps, V1ListProjDbSchemaQueryPathParams, V1ListProjDbSchemaQueryQueryParams, } from './hooks/useV1ListProjDbSchemaQuery';
29
29
  export { useV1ListProjDbSchemaQuery, v1ListProjDbSchema } from './hooks/useV1ListProjDbSchemaQuery';
30
- export type { V1MigrationStateProjDbSchemaErrorResponse, V1MigrationStateProjDbSchemaOkResponse, V1MigrationStateProjDbSchemaProps, V1MigrationStateProjDbSchemaQueryPathParams, V1MigrationStateProjDbSchemaQueryQueryParams, } from './hooks/useV1MigrationStateProjDbSchemaQuery';
31
- export { useV1MigrationStateProjDbSchemaQuery, v1MigrationStateProjDbSchema, } from './hooks/useV1MigrationStateProjDbSchemaQuery';
30
+ export type { V1MigrationStateProjDbSchemaErrorResponse, V1MigrationStateProjDbSchemaMutationPathParams, V1MigrationStateProjDbSchemaMutationQueryParams, V1MigrationStateProjDbSchemaOkResponse, V1MigrationStateProjDbSchemaProps, V1MigrationStateProjDbSchemaRequestBody, } from './hooks/useV1MigrationStateProjDbSchemaMutation';
31
+ export { useV1MigrationStateProjDbSchemaMutation, v1MigrationStateProjDbSchema, } from './hooks/useV1MigrationStateProjDbSchemaMutation';
32
32
  export type { V1UpdateProjDbSchemaInstanceErrorResponse, V1UpdateProjDbSchemaInstanceMutationPathParams, V1UpdateProjDbSchemaInstanceOkResponse, V1UpdateProjDbSchemaInstanceProps, V1UpdateProjDbSchemaInstanceRequestBody, } from './hooks/useV1UpdateProjDbSchemaInstanceMutation';
33
33
  export { useV1UpdateProjDbSchemaInstanceMutation, v1UpdateProjDbSchemaInstance, } from './hooks/useV1UpdateProjDbSchemaInstanceMutation';
34
34
  export type { V1UpdateProjDbSchemaErrorResponse, V1UpdateProjDbSchemaMutationPathParams, V1UpdateProjDbSchemaOkResponse, V1UpdateProjDbSchemaProps, V1UpdateProjDbSchemaRequestBody, } from './hooks/useV1UpdateProjDbSchemaMutation';
@@ -64,10 +64,14 @@ export type { DbSchemaIn } from './schemas/DbSchemaIn';
64
64
  export type { DbSchemaOut } from './schemas/DbSchemaOut';
65
65
  export type { DbStepType } from './schemas/DbStepType';
66
66
  export type { Error } from './schemas/Error';
67
+ export type { InstanceDetail } from './schemas/InstanceDetail';
67
68
  export type { MigrationStateChangeSet } from './schemas/MigrationStateChangeSet';
68
69
  export type { MigrationStateIn } from './schemas/MigrationStateIn';
69
70
  export type { MigrationStateInstance } from './schemas/MigrationStateInstance';
71
+ export type { MigrationStateInstanceIn } from './schemas/MigrationStateInstanceIn';
70
72
  export type { MigrationStateOut } from './schemas/MigrationStateOut';
71
73
  export type { NgTag } from './schemas/NgTag';
72
- export type { OverviewOut } from './schemas/OverviewOut';
74
+ export type { OrderInstance } from './schemas/OrderInstance';
75
+ export type { OverviewResponseOutput } from './schemas/OverviewResponseOutput';
73
76
  export type { ParsedLogOut } from './schemas/ParsedLogOut';
77
+ export type { SortInstance } from './schemas/SortInstance';
@@ -12,6 +12,6 @@ export { useV1GetProjDbSchemaQuery, v1GetProjDbSchema } from './hooks/useV1GetPr
12
12
  export { useV1IngestLogsMutation, v1IngestLogs } from './hooks/useV1IngestLogsMutation';
13
13
  export { useV1ListProjDbSchemaInstanceQuery, v1ListProjDbSchemaInstance, } from './hooks/useV1ListProjDbSchemaInstanceQuery';
14
14
  export { useV1ListProjDbSchemaQuery, v1ListProjDbSchema } from './hooks/useV1ListProjDbSchemaQuery';
15
- export { useV1MigrationStateProjDbSchemaQuery, v1MigrationStateProjDbSchema, } from './hooks/useV1MigrationStateProjDbSchemaQuery';
15
+ export { useV1MigrationStateProjDbSchemaMutation, v1MigrationStateProjDbSchema, } from './hooks/useV1MigrationStateProjDbSchemaMutation';
16
16
  export { useV1UpdateProjDbSchemaInstanceMutation, v1UpdateProjDbSchemaInstance, } from './hooks/useV1UpdateProjDbSchemaInstanceMutation';
17
17
  export { useV1UpdateProjDbSchemaMutation, v1UpdateProjDbSchema, } from './hooks/useV1UpdateProjDbSchemaMutation';
@@ -1,6 +1,6 @@
1
- import type { OverviewOut } from '../schemas/OverviewOut';
1
+ import type { OverviewResponseOutput } from '../schemas/OverviewResponseOutput';
2
2
  export interface OverviewResponseResponse {
3
3
  dbInstanceCount: number;
4
4
  dbSchemaCount: number;
5
- recentDeployments?: OverviewOut[];
5
+ recentDeployments?: OverviewResponseOutput[];
6
6
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Name and identifier of instance
3
+ */
4
+ export interface InstanceDetail {
5
+ identifier: string;
6
+ name: string;
7
+ }
@@ -3,10 +3,12 @@ import type { MigrationStateInstance } from '../schemas/MigrationStateInstance';
3
3
  * Deployment info of Change Sets across instances
4
4
  */
5
5
  export interface MigrationStateChangeSet {
6
+ author: string;
6
7
  /**
7
8
  * Identifier of the Change Set
8
9
  */
9
10
  changeSet: string;
11
+ fileName: string;
10
12
  instances: MigrationStateInstance[];
11
13
  /**
12
14
  * If Change Set is successfully deployed to all instances
@@ -1,9 +1,7 @@
1
+ import type { MigrationStateInstanceIn } from '../schemas/MigrationStateInstanceIn';
1
2
  /**
2
3
  * Get migration state request input
3
4
  */
4
5
  export interface MigrationStateIn {
5
- /**
6
- * List of instances for which migration state to be shown
7
- */
8
- instances?: string[];
6
+ instanceFilter?: MigrationStateInstanceIn;
9
7
  }
@@ -1,4 +1 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
1
  export {};
@@ -0,0 +1,10 @@
1
+ import type { OrderInstance } from '../schemas/OrderInstance';
2
+ import type { SortInstance } from '../schemas/SortInstance';
3
+ /**
4
+ * Get migration state request instance input
5
+ */
6
+ export interface MigrationStateInstanceIn {
7
+ instances?: string[];
8
+ order?: OrderInstance;
9
+ sort?: SortInstance;
10
+ }
@@ -1,10 +1,11 @@
1
1
  import type { MigrationStateChangeSet } from '../schemas/MigrationStateChangeSet';
2
+ import type { InstanceDetail } from '../schemas/InstanceDetail';
2
3
  /**
3
4
  * Change Set deployment info for a schema
4
5
  */
5
6
  export interface MigrationStateOut {
6
7
  changeSets?: MigrationStateChangeSet[];
7
- instances?: string[];
8
+ instances?: InstanceDetail[];
8
9
  /**
9
10
  * Identifier of the Schema
10
11
  */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * order of instance entity
3
+ * @default "ASC"
4
+ */
5
+ export type OrderInstance = 'ASC' | 'DESC';
@@ -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 {};
@@ -1,4 +1,4 @@
1
- export interface OverviewOut {
1
+ export interface OverviewResponseOutput {
2
2
  dbInstanceIdentifier: string;
3
3
  dbInstanceName: string;
4
4
  dbSchemaIdentifier: string;
@@ -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
+ /**
2
+ * sort for instance entity
3
+ * @default "identifier"
4
+ */
5
+ export type SortInstance = 'created' | 'identifier' | 'name' | 'updated';
@@ -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-dbops-service-client",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Harness React DB Devops service client - DB Devops APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,37 +0,0 @@
1
- import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { MigrationStateResponseResponse } from '../responses/MigrationStateResponseResponse';
3
- import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
- import type { ResponseWithPagination } from '../helpers';
5
- import { FetcherOptions } from '../../../../fetcher/index.js';
6
- export interface V1MigrationStateProjDbSchemaQueryPathParams {
7
- org: string;
8
- project: string;
9
- dbschema: string;
10
- }
11
- export interface V1MigrationStateProjDbSchemaQueryQueryParams {
12
- /**
13
- * @format int64
14
- * @default 0
15
- */
16
- page?: number;
17
- /**
18
- * @default 10
19
- */
20
- limit?: number;
21
- search_term?: string;
22
- sort?: 'changeSet' | 'updated';
23
- order?: 'ASC' | 'DESC';
24
- }
25
- export interface V1MigrationStateProjDbSchemaQueryHeaderParams {
26
- 'Harness-Account'?: string;
27
- }
28
- export type V1MigrationStateProjDbSchemaOkResponse = ResponseWithPagination<MigrationStateResponseResponse>;
29
- export type V1MigrationStateProjDbSchemaErrorResponse = ErrorResponseResponse;
30
- export interface V1MigrationStateProjDbSchemaProps extends V1MigrationStateProjDbSchemaQueryPathParams, Omit<FetcherOptions<V1MigrationStateProjDbSchemaQueryQueryParams, unknown, V1MigrationStateProjDbSchemaQueryHeaderParams>, 'url'> {
31
- queryParams: V1MigrationStateProjDbSchemaQueryQueryParams;
32
- }
33
- export declare function v1MigrationStateProjDbSchema(props: V1MigrationStateProjDbSchemaProps): Promise<V1MigrationStateProjDbSchemaOkResponse>;
34
- /**
35
- * Migration state of a schema
36
- */
37
- export declare function useV1MigrationStateProjDbSchemaQuery(props: V1MigrationStateProjDbSchemaProps, options?: Omit<UseQueryOptions<V1MigrationStateProjDbSchemaOkResponse, V1MigrationStateProjDbSchemaErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<V1MigrationStateProjDbSchemaOkResponse, import("..").Error>;
@@ -1,20 +0,0 @@
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 v1MigrationStateProjDbSchema(props) {
7
- return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/migrationstate`, method: 'GET' }, props));
8
- }
9
- /**
10
- * Migration state of a schema
11
- */
12
- export function useV1MigrationStateProjDbSchemaQuery(props, options) {
13
- return useQuery([
14
- 'v1-migration-state-proj-db-schema',
15
- props.org,
16
- props.project,
17
- props.dbschema,
18
- props.queryParams,
19
- ], ({ signal }) => v1MigrationStateProjDbSchema(Object.assign(Object.assign({}, props), { signal })), options);
20
- }