@harnessio/react-dbops-service-client 0.6.0 → 0.8.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.
@@ -0,0 +1,38 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DeployedStateOutput } from '../schemas/DeployedStateOutput';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { DeployedStateInput } from '../schemas/DeployedStateInput';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1GetDeployedStateMutationPathParams {
8
+ org: string;
9
+ project: string;
10
+ dbschema: string;
11
+ dbinstance: string;
12
+ }
13
+ export interface V1GetDeployedStateMutationQueryParams {
14
+ /**
15
+ * @format int64
16
+ * @default 0
17
+ */
18
+ page?: number;
19
+ /**
20
+ * @default 10
21
+ */
22
+ limit?: number;
23
+ }
24
+ export interface V1GetDeployedStateMutationHeaderParams {
25
+ 'Harness-Account'?: string;
26
+ }
27
+ export type V1GetDeployedStateRequestBody = DeployedStateInput;
28
+ export type V1GetDeployedStateOkResponse = ResponseWithPagination<DeployedStateOutput[]>;
29
+ export type V1GetDeployedStateErrorResponse = ErrorResponseResponse;
30
+ export interface V1GetDeployedStateProps extends V1GetDeployedStateMutationPathParams, Omit<FetcherOptions<V1GetDeployedStateMutationQueryParams, V1GetDeployedStateRequestBody, V1GetDeployedStateMutationHeaderParams>, 'url'> {
31
+ queryParams: V1GetDeployedStateMutationQueryParams;
32
+ body: V1GetDeployedStateRequestBody;
33
+ }
34
+ export declare function v1GetDeployedState(props: V1GetDeployedStateProps): Promise<V1GetDeployedStateOkResponse>;
35
+ /**
36
+ * Status of changeset deployment as part of execution with comparison to earlier state.
37
+ */
38
+ export declare function useV1GetDeployedStateMutation(options?: Omit<UseMutationOptions<V1GetDeployedStateOkResponse, V1GetDeployedStateErrorResponse, V1GetDeployedStateProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1GetDeployedStateOkResponse, import("..").Error, V1GetDeployedStateProps, 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 v1GetDeployedState(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/instance/${props.dbinstance}/deployedState`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Status of changeset deployment as part of execution with comparison to earlier state.
11
+ */
12
+ export function useV1GetDeployedStateMutation(options) {
13
+ return useMutation((mutateProps) => v1GetDeployedState(mutateProps), options);
14
+ }
@@ -20,7 +20,13 @@ export interface V1ListProjDbSchemaInstanceMutationQueryParams {
20
20
  */
21
21
  limit?: number;
22
22
  search_term?: string;
23
+ /**
24
+ * @default "created"
25
+ */
23
26
  sort?: 'created' | 'name' | 'updated';
27
+ /**
28
+ * @default "DESC"
29
+ */
24
30
  order?: 'ASC' | 'DESC';
25
31
  }
26
32
  export interface V1ListProjDbSchemaInstanceMutationHeaderParams {
@@ -18,7 +18,13 @@ export interface V1ListProjDbSchemaQueryQueryParams {
18
18
  */
19
19
  limit?: number;
20
20
  search_term?: string;
21
+ /**
22
+ * @default "created"
23
+ */
21
24
  sort?: 'created' | 'name' | 'updated';
25
+ /**
26
+ * @default "DESC"
27
+ */
22
28
  order?: 'ASC' | 'DESC';
23
29
  }
24
30
  export interface V1ListProjDbSchemaQueryHeaderParams {
@@ -15,6 +15,8 @@ export type { V1GetDbOverviewErrorResponse, V1GetDbOverviewOkResponse, V1GetDbOv
15
15
  export { useV1GetDbOverviewQuery, v1GetDbOverview } from './hooks/useV1GetDbOverviewQuery';
16
16
  export type { V1GetDbinstanceLogErrorResponse, V1GetDbinstanceLogOkResponse, V1GetDbinstanceLogProps, V1GetDbinstanceLogQueryPathParams, } from './hooks/useV1GetDbinstanceLogQuery';
17
17
  export { useV1GetDbinstanceLogQuery, v1GetDbinstanceLog } from './hooks/useV1GetDbinstanceLogQuery';
18
+ export type { V1GetDeployedStateErrorResponse, V1GetDeployedStateMutationPathParams, V1GetDeployedStateMutationQueryParams, V1GetDeployedStateOkResponse, V1GetDeployedStateProps, V1GetDeployedStateRequestBody, } from './hooks/useV1GetDeployedStateMutation';
19
+ export { useV1GetDeployedStateMutation, v1GetDeployedState, } from './hooks/useV1GetDeployedStateMutation';
18
20
  export type { V1GetProjDbSchemaInstanceErrorResponse, V1GetProjDbSchemaInstanceOkResponse, V1GetProjDbSchemaInstanceProps, V1GetProjDbSchemaInstanceQueryPathParams, } from './hooks/useV1GetProjDbSchemaInstanceQuery';
19
21
  export { useV1GetProjDbSchemaInstanceQuery, v1GetProjDbSchemaInstance, } from './hooks/useV1GetProjDbSchemaInstanceQuery';
20
22
  export type { V1GetProjDbSchemaErrorResponse, V1GetProjDbSchemaOkResponse, V1GetProjDbSchemaProps, V1GetProjDbSchemaQueryPathParams, } from './hooks/useV1GetProjDbSchemaQuery';
@@ -58,7 +60,11 @@ export type { DbInstanceIn } from './schemas/DbInstanceIn';
58
60
  export type { DbInstanceOut } from './schemas/DbInstanceOut';
59
61
  export type { DbSchemaIn } from './schemas/DbSchemaIn';
60
62
  export type { DbSchemaOut } from './schemas/DbSchemaOut';
63
+ export type { DbStepType } from './schemas/DbStepType';
64
+ export type { DeployedStateInput } from './schemas/DeployedStateInput';
65
+ export type { DeployedStateOutput } from './schemas/DeployedStateOutput';
61
66
  export type { Error } from './schemas/Error';
67
+ export type { ExecutionMetadata } from './schemas/ExecutionMetadata';
62
68
  export type { InstanceDetail } from './schemas/InstanceDetail';
63
69
  export type { MigrationStateChangeSet } from './schemas/MigrationStateChangeSet';
64
70
  export type { MigrationStateIn } from './schemas/MigrationStateIn';
@@ -6,6 +6,7 @@ export { useV1DeleteProjDbSchemaInstanceMutation, v1DeleteProjDbSchemaInstance,
6
6
  export { useV1DeleteProjDbSchemaMutation, v1DeleteProjDbSchema, } from './hooks/useV1DeleteProjDbSchemaMutation';
7
7
  export { useV1GetDbOverviewQuery, v1GetDbOverview } from './hooks/useV1GetDbOverviewQuery';
8
8
  export { useV1GetDbinstanceLogQuery, v1GetDbinstanceLog } from './hooks/useV1GetDbinstanceLogQuery';
9
+ export { useV1GetDeployedStateMutation, v1GetDeployedState, } from './hooks/useV1GetDeployedStateMutation';
9
10
  export { useV1GetProjDbSchemaInstanceQuery, v1GetProjDbSchemaInstance, } from './hooks/useV1GetProjDbSchemaInstanceQuery';
10
11
  export { useV1GetProjDbSchemaQuery, v1GetProjDbSchema } from './hooks/useV1GetProjDbSchemaQuery';
11
12
  export { useV1IngestLogsMutation, v1IngestLogs } from './hooks/useV1IngestLogsMutation';
@@ -15,17 +15,22 @@ export interface ConsumePluginRespRequestRequestBody {
15
15
  * Organization identifier
16
16
  */
17
17
  org: string;
18
+ parentStepType?: string;
18
19
  /**
19
20
  * Identifier of the pipeline
20
21
  */
21
- pipeline?: string;
22
+ pipeline: string;
22
23
  /**
23
24
  * ExecutionId of the pipeline executed
24
25
  */
25
- planExecutionId?: string;
26
+ planExecutionId: string;
26
27
  /**
27
28
  * Project identifier
28
29
  */
29
30
  project: string;
31
+ /**
32
+ * ExecutionId of the stage executed
33
+ */
34
+ stageExecutionId: string;
30
35
  status: CommandExecutionStatus;
31
36
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Type of the plugin command to run
3
3
  */
4
- export type Command = 'History' | 'Rollback' | 'Tag' | 'Update' | 'UpdateSQL' | 'Validate';
4
+ export type Command = 'Clone' | 'History' | 'Rollback' | 'Tag' | 'Update' | 'UpdateSQL' | 'Validate';
@@ -27,6 +27,10 @@ export interface DbInstanceOut {
27
27
  * Most recent tag applied to the database
28
28
  */
29
29
  lastAppliedTag?: string;
30
+ /**
31
+ * Tag on last deployed changeSet
32
+ */
33
+ lastDeployedChangeSetTag: string;
30
34
  /**
31
35
  * name of the database instance
32
36
  */
@@ -0,0 +1 @@
1
+ export type DbStepType = 'DBSchemaApply';
@@ -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,19 @@
1
+ import type { DbStepType } from '../schemas/DbStepType';
2
+ /**
3
+ * Input for getting execution deployed states
4
+ */
5
+ export interface DeployedStateInput {
6
+ /**
7
+ * identifier of the pipeline
8
+ */
9
+ pipeline: string;
10
+ planExecutionId: string;
11
+ stageExecutionId: string;
12
+ /**
13
+ * start time of step execution
14
+ * @format int64
15
+ * @default 0
16
+ */
17
+ startTime?: number;
18
+ stepType: DbStepType;
19
+ }
@@ -0,0 +1,23 @@
1
+ import type { Command } from '../schemas/Command';
2
+ import type { ExecutionMetadata } from '../schemas/ExecutionMetadata';
3
+ import type { CommandExecutionStatus } from '../schemas/CommandExecutionStatus';
4
+ /**
5
+ * The status of changeset deployment
6
+ */
7
+ export interface DeployedStateOutput {
8
+ author: string;
9
+ changeSetId: string;
10
+ command: Command;
11
+ /**
12
+ * @format int64
13
+ */
14
+ deployedAt?: number;
15
+ /**
16
+ * if changeset run as part of current step execution
17
+ */
18
+ deployedInCurrentExecution: boolean;
19
+ fileName: string;
20
+ metadata: ExecutionMetadata;
21
+ status: CommandExecutionStatus;
22
+ tag?: string;
23
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Properties related to pipeline execution
3
+ */
4
+ export interface ExecutionMetadata {
5
+ pipeline: string;
6
+ planExecutionId: string;
7
+ stageExecutionId: string;
8
+ }
@@ -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.6.0",
3
+ "version": "0.8.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",