@harnessio/react-dbops-service-client 0.2.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 (78) hide show
  1. package/README.md +39 -0
  2. package/dist/dbops-service/src/index.d.ts +6 -0
  3. package/dist/dbops-service/src/index.js +10 -0
  4. package/dist/dbops-service/src/services/helpers.d.ts +14 -0
  5. package/dist/dbops-service/src/services/helpers.js +1 -0
  6. package/dist/dbops-service/src/services/hooks/useCreateV1StepPluginInputsMutation.d.ts +20 -0
  7. package/dist/dbops-service/src/services/hooks/useCreateV1StepPluginInputsMutation.js +14 -0
  8. package/dist/dbops-service/src/services/hooks/useV1CreateProjDbSchemaInstanceMutation.d.ts +25 -0
  9. package/dist/dbops-service/src/services/hooks/useV1CreateProjDbSchemaInstanceMutation.js +14 -0
  10. package/dist/dbops-service/src/services/hooks/useV1CreateProjDbSchemaMutation.d.ts +24 -0
  11. package/dist/dbops-service/src/services/hooks/useV1CreateProjDbSchemaMutation.js +14 -0
  12. package/dist/dbops-service/src/services/hooks/useV1DeleteProjDbSchemaInstanceMutation.d.ts +22 -0
  13. package/dist/dbops-service/src/services/hooks/useV1DeleteProjDbSchemaInstanceMutation.js +14 -0
  14. package/dist/dbops-service/src/services/hooks/useV1DeleteProjDbSchemaMutation.d.ts +21 -0
  15. package/dist/dbops-service/src/services/hooks/useV1DeleteProjDbSchemaMutation.js +14 -0
  16. package/dist/dbops-service/src/services/hooks/useV1GetDbinstanceLogQuery.d.ts +21 -0
  17. package/dist/dbops-service/src/services/hooks/useV1GetDbinstanceLogQuery.js +14 -0
  18. package/dist/dbops-service/src/services/hooks/useV1GetProjDbSchemaInstanceQuery.d.ts +23 -0
  19. package/dist/dbops-service/src/services/hooks/useV1GetProjDbSchemaInstanceQuery.js +14 -0
  20. package/dist/dbops-service/src/services/hooks/useV1GetProjDbSchemaQuery.d.ts +22 -0
  21. package/dist/dbops-service/src/services/hooks/useV1GetProjDbSchemaQuery.js +14 -0
  22. package/dist/dbops-service/src/services/hooks/useV1IngestLogsMutation.d.ts +23 -0
  23. package/dist/dbops-service/src/services/hooks/useV1IngestLogsMutation.js +14 -0
  24. package/dist/dbops-service/src/services/hooks/useV1ListProjDbSchemaInstanceQuery.d.ts +37 -0
  25. package/dist/dbops-service/src/services/hooks/useV1ListProjDbSchemaInstanceQuery.js +20 -0
  26. package/dist/dbops-service/src/services/hooks/useV1ListProjDbSchemaQuery.d.ts +36 -0
  27. package/dist/dbops-service/src/services/hooks/useV1ListProjDbSchemaQuery.js +14 -0
  28. package/dist/dbops-service/src/services/hooks/useV1UpdateProjDbSchemaInstanceMutation.d.ts +26 -0
  29. package/dist/dbops-service/src/services/hooks/useV1UpdateProjDbSchemaInstanceMutation.js +14 -0
  30. package/dist/dbops-service/src/services/hooks/useV1UpdateProjDbSchemaMutation.d.ts +25 -0
  31. package/dist/dbops-service/src/services/hooks/useV1UpdateProjDbSchemaMutation.js +14 -0
  32. package/dist/dbops-service/src/services/index.d.ts +48 -0
  33. package/dist/dbops-service/src/services/index.js +13 -0
  34. package/dist/dbops-service/src/services/requestBodies/DbInstanceCreateRequestRequestBody.d.ts +2 -0
  35. package/dist/dbops-service/src/services/requestBodies/DbInstanceCreateRequestRequestBody.js +1 -0
  36. package/dist/dbops-service/src/services/requestBodies/DbInstanceUpdateRequestRequestBody.d.ts +25 -0
  37. package/dist/dbops-service/src/services/requestBodies/DbInstanceUpdateRequestRequestBody.js +4 -0
  38. package/dist/dbops-service/src/services/requestBodies/DbSchemaCreateRequestRequestBody.d.ts +2 -0
  39. package/dist/dbops-service/src/services/requestBodies/DbSchemaCreateRequestRequestBody.js +1 -0
  40. package/dist/dbops-service/src/services/requestBodies/DbSchemaUpdateRequestRequestBody.d.ts +35 -0
  41. package/dist/dbops-service/src/services/requestBodies/DbSchemaUpdateRequestRequestBody.js +4 -0
  42. package/dist/dbops-service/src/services/requestBodies/LogIngestRequestRequestBody.d.ts +1 -0
  43. package/dist/dbops-service/src/services/requestBodies/LogIngestRequestRequestBody.js +1 -0
  44. package/dist/dbops-service/src/services/requestBodies/PluginStepInputsRequestRequestBody.d.ts +19 -0
  45. package/dist/dbops-service/src/services/requestBodies/PluginStepInputsRequestRequestBody.js +1 -0
  46. package/dist/dbops-service/src/services/responses/DbInstanceListResponseResponse.d.ts +5 -0
  47. package/dist/dbops-service/src/services/responses/DbInstanceListResponseResponse.js +1 -0
  48. package/dist/dbops-service/src/services/responses/DbInstanceResponseResponse.d.ts +2 -0
  49. package/dist/dbops-service/src/services/responses/DbInstanceResponseResponse.js +1 -0
  50. package/dist/dbops-service/src/services/responses/DbSchemaListResponseResponse.d.ts +5 -0
  51. package/dist/dbops-service/src/services/responses/DbSchemaListResponseResponse.js +1 -0
  52. package/dist/dbops-service/src/services/responses/DbSchemaResponseResponse.d.ts +2 -0
  53. package/dist/dbops-service/src/services/responses/DbSchemaResponseResponse.js +1 -0
  54. package/dist/dbops-service/src/services/responses/ErrorResponseResponse.d.ts +2 -0
  55. package/dist/dbops-service/src/services/responses/ErrorResponseResponse.js +1 -0
  56. package/dist/dbops-service/src/services/responses/ParsedLogResponseResponse.d.ts +2 -0
  57. package/dist/dbops-service/src/services/responses/ParsedLogResponseResponse.js +1 -0
  58. package/dist/dbops-service/src/services/responses/PluginInputsResponseResponse.d.ts +6 -0
  59. package/dist/dbops-service/src/services/responses/PluginInputsResponseResponse.js +4 -0
  60. package/dist/dbops-service/src/services/schemas/Changelog.d.ts +16 -0
  61. package/dist/dbops-service/src/services/schemas/Changelog.js +4 -0
  62. package/dist/dbops-service/src/services/schemas/Command.d.ts +4 -0
  63. package/dist/dbops-service/src/services/schemas/Command.js +4 -0
  64. package/dist/dbops-service/src/services/schemas/DbInstanceIn.d.ts +34 -0
  65. package/dist/dbops-service/src/services/schemas/DbInstanceIn.js +4 -0
  66. package/dist/dbops-service/src/services/schemas/DbInstanceOut.d.ts +41 -0
  67. package/dist/dbops-service/src/services/schemas/DbInstanceOut.js +4 -0
  68. package/dist/dbops-service/src/services/schemas/DbSchemaIn.d.ts +27 -0
  69. package/dist/dbops-service/src/services/schemas/DbSchemaIn.js +1 -0
  70. package/dist/dbops-service/src/services/schemas/DbSchemaOut.d.ts +35 -0
  71. package/dist/dbops-service/src/services/schemas/DbSchemaOut.js +1 -0
  72. package/dist/dbops-service/src/services/schemas/Error.d.ts +9 -0
  73. package/dist/dbops-service/src/services/schemas/Error.js +4 -0
  74. package/dist/dbops-service/src/services/schemas/ParsedLogOut.d.ts +4 -0
  75. package/dist/dbops-service/src/services/schemas/ParsedLogOut.js +4 -0
  76. package/dist/fetcher/index.d.ts +17 -0
  77. package/dist/fetcher/index.js +65 -0
  78. package/package.json +31 -0
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # React DBOps Service Client(WIP)
2
+
3
+ **OpenAPI -> OA**
4
+
5
+ **TypeScript -> TS**
6
+
7
+ **OpenAPI + TypeScript -> OATS**
8
+
9
+ This React API client will store a collection of Harness DBOps Service APIs and Interfaces contracts generated from Open API Spec using `OATS CLI` internally.
10
+ APIs are using hooks from `@tanstack/react-query`
11
+
12
+ ## Steps To Generate API Client build as dist folder
13
+
14
+ ```
15
+ yarn build
16
+ ```
17
+
18
+ ## For NextGen UI adoption : HarnessReactAPIClient should be initialized
19
+
20
+ Before using API Client, it must be initilaized with required `ClientCallbacks`.
21
+
22
+ Example:
23
+
24
+ ```
25
+ new DBOpsServiceAPIClient({
26
+ getHeaders: () => {
27
+ return { token: SessionToken.getToken(), 'Harness-Account': accountId }
28
+ }}
29
+ ```
30
+
31
+ ## Versioning
32
+
33
+ ![@harnessio/react-dbops-service-client](https://img.shields.io/npm/v/@harnessio/react-dbops-service-client.svg?style=flat-square)
34
+
35
+ Once development phase is completed, this repo will have changes and versioning driven by API spec only.
36
+
37
+ ## License
38
+
39
+ [MIT](./LICENSE.md). Copyright(c) [Harness Inc](https://harness.io)
@@ -0,0 +1,6 @@
1
+ import { ClientCallbacks } from '../../fetcher';
2
+ export * from './services/index';
3
+ export declare class DBOpsServiceAPIClient {
4
+ updateHeaders: (headers: Record<string, any>) => void;
5
+ constructor(callbacks: ClientCallbacks);
6
+ }
@@ -0,0 +1,10 @@
1
+ import { setupClient, updateClientHeaders } from '../../fetcher';
2
+ export * from './services/index';
3
+ export class DBOpsServiceAPIClient {
4
+ constructor(callbacks) {
5
+ setupClient(callbacks);
6
+ this.updateHeaders = (headers) => {
7
+ updateClientHeaders(headers);
8
+ };
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ export type GetPathParamsType<T> = T extends {
2
+ pathParams: infer R;
3
+ } ? R : never;
4
+ export interface ResponseWithPagination<T> {
5
+ content: T;
6
+ pagination?: {
7
+ total?: number;
8
+ pageSize?: number;
9
+ pageCount?: number;
10
+ pageNumber?: number;
11
+ };
12
+ }
13
+ export type WithOptional<TInput, Tkeys extends keyof TInput> = Omit<TInput, Tkeys> & Partial<Pick<TInput, Tkeys>>;
14
+ export type PickPartial<TInput, Tkeys extends keyof TInput> = Pick<Partial<TInput>, Tkeys>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { PluginInputsResponseResponse } from '../responses/PluginInputsResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { PluginStepInputsRequestRequestBody } from '../requestBodies/PluginStepInputsRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface CreateV1StepPluginInputsMutationHeaderParams {
8
+ 'Harness-Account'?: string;
9
+ }
10
+ export type CreateV1StepPluginInputsRequestBody = PluginStepInputsRequestRequestBody;
11
+ export type CreateV1StepPluginInputsOkResponse = ResponseWithPagination<PluginInputsResponseResponse>;
12
+ export type CreateV1StepPluginInputsErrorResponse = ErrorResponseResponse;
13
+ export interface CreateV1StepPluginInputsProps extends Omit<FetcherOptions<unknown, CreateV1StepPluginInputsRequestBody, CreateV1StepPluginInputsMutationHeaderParams>, 'url'> {
14
+ body: CreateV1StepPluginInputsRequestBody;
15
+ }
16
+ export declare function createV1StepPluginInputs(props: CreateV1StepPluginInputsProps): Promise<CreateV1StepPluginInputsOkResponse>;
17
+ /**
18
+ * Create Plugin Inputs using Step Inputs
19
+ */
20
+ export declare function useCreateV1StepPluginInputsMutation(options?: Omit<UseMutationOptions<CreateV1StepPluginInputsOkResponse, CreateV1StepPluginInputsErrorResponse, CreateV1StepPluginInputsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateV1StepPluginInputsOkResponse, import("..").Error, CreateV1StepPluginInputsProps, 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 createV1StepPluginInputs(props) {
7
+ return fetcher(Object.assign({ url: `/v1/step/plugin-inputs`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Create Plugin Inputs using Step Inputs
11
+ */
12
+ export function useCreateV1StepPluginInputsMutation(options) {
13
+ return useMutation((mutateProps) => createV1StepPluginInputs(mutateProps), options);
14
+ }
@@ -0,0 +1,25 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DbInstanceResponseResponse } from '../responses/DbInstanceResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { DbInstanceCreateRequestRequestBody } from '../requestBodies/DbInstanceCreateRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1CreateProjDbSchemaInstanceMutationPathParams {
8
+ org: string;
9
+ project: string;
10
+ dbschema: string;
11
+ }
12
+ export interface V1CreateProjDbSchemaInstanceMutationHeaderParams {
13
+ 'Harness-Account'?: string;
14
+ }
15
+ export type V1CreateProjDbSchemaInstanceRequestBody = DbInstanceCreateRequestRequestBody;
16
+ export type V1CreateProjDbSchemaInstanceOkResponse = ResponseWithPagination<DbInstanceResponseResponse>;
17
+ export type V1CreateProjDbSchemaInstanceErrorResponse = ErrorResponseResponse;
18
+ export interface V1CreateProjDbSchemaInstanceProps extends V1CreateProjDbSchemaInstanceMutationPathParams, Omit<FetcherOptions<unknown, V1CreateProjDbSchemaInstanceRequestBody, V1CreateProjDbSchemaInstanceMutationHeaderParams>, 'url'> {
19
+ body: V1CreateProjDbSchemaInstanceRequestBody;
20
+ }
21
+ export declare function v1CreateProjDbSchemaInstance(props: V1CreateProjDbSchemaInstanceProps): Promise<V1CreateProjDbSchemaInstanceOkResponse>;
22
+ /**
23
+ * Create a database instance
24
+ */
25
+ export declare function useV1CreateProjDbSchemaInstanceMutation(options?: Omit<UseMutationOptions<V1CreateProjDbSchemaInstanceOkResponse, V1CreateProjDbSchemaInstanceErrorResponse, V1CreateProjDbSchemaInstanceProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1CreateProjDbSchemaInstanceOkResponse, import("..").Error, V1CreateProjDbSchemaInstanceProps, 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 v1CreateProjDbSchemaInstance(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/instance`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Create a database instance
11
+ */
12
+ export function useV1CreateProjDbSchemaInstanceMutation(options) {
13
+ return useMutation((mutateProps) => v1CreateProjDbSchemaInstance(mutateProps), options);
14
+ }
@@ -0,0 +1,24 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DbSchemaResponseResponse } from '../responses/DbSchemaResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { DbSchemaCreateRequestRequestBody } from '../requestBodies/DbSchemaCreateRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1CreateProjDbSchemaMutationPathParams {
8
+ org: string;
9
+ project: string;
10
+ }
11
+ export interface V1CreateProjDbSchemaMutationHeaderParams {
12
+ 'Harness-Account'?: string;
13
+ }
14
+ export type V1CreateProjDbSchemaRequestBody = DbSchemaCreateRequestRequestBody;
15
+ export type V1CreateProjDbSchemaOkResponse = ResponseWithPagination<DbSchemaResponseResponse>;
16
+ export type V1CreateProjDbSchemaErrorResponse = ErrorResponseResponse;
17
+ export interface V1CreateProjDbSchemaProps extends V1CreateProjDbSchemaMutationPathParams, Omit<FetcherOptions<unknown, V1CreateProjDbSchemaRequestBody, V1CreateProjDbSchemaMutationHeaderParams>, 'url'> {
18
+ body: V1CreateProjDbSchemaRequestBody;
19
+ }
20
+ export declare function v1CreateProjDbSchema(props: V1CreateProjDbSchemaProps): Promise<V1CreateProjDbSchemaOkResponse>;
21
+ /**
22
+ * Create a database schema
23
+ */
24
+ export declare function useV1CreateProjDbSchemaMutation(options?: Omit<UseMutationOptions<V1CreateProjDbSchemaOkResponse, V1CreateProjDbSchemaErrorResponse, V1CreateProjDbSchemaProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1CreateProjDbSchemaOkResponse, import("..").Error, V1CreateProjDbSchemaProps, 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 v1CreateProjDbSchema(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Create a database schema
11
+ */
12
+ export function useV1CreateProjDbSchemaMutation(options) {
13
+ return useMutation((mutateProps) => v1CreateProjDbSchema(mutateProps), options);
14
+ }
@@ -0,0 +1,22 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface V1DeleteProjDbSchemaInstanceMutationPathParams {
6
+ org: string;
7
+ project: string;
8
+ dbschema: string;
9
+ dbinstance: string;
10
+ }
11
+ export interface V1DeleteProjDbSchemaInstanceMutationHeaderParams {
12
+ 'Harness-Account'?: string;
13
+ }
14
+ export type V1DeleteProjDbSchemaInstanceOkResponse = ResponseWithPagination<unknown>;
15
+ export type V1DeleteProjDbSchemaInstanceErrorResponse = ErrorResponseResponse;
16
+ export interface V1DeleteProjDbSchemaInstanceProps extends V1DeleteProjDbSchemaInstanceMutationPathParams, Omit<FetcherOptions<unknown, unknown, V1DeleteProjDbSchemaInstanceMutationHeaderParams>, 'url'> {
17
+ }
18
+ export declare function v1DeleteProjDbSchemaInstance(props: V1DeleteProjDbSchemaInstanceProps): Promise<V1DeleteProjDbSchemaInstanceOkResponse>;
19
+ /**
20
+ * Delete a database instance
21
+ */
22
+ export declare function useV1DeleteProjDbSchemaInstanceMutation(options?: Omit<UseMutationOptions<V1DeleteProjDbSchemaInstanceOkResponse, V1DeleteProjDbSchemaInstanceErrorResponse, V1DeleteProjDbSchemaInstanceProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1DeleteProjDbSchemaInstanceOkResponse, import("..").Error, V1DeleteProjDbSchemaInstanceProps, 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 v1DeleteProjDbSchemaInstance(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/instance/${props.dbinstance}`, method: 'DELETE' }, props));
8
+ }
9
+ /**
10
+ * Delete a database instance
11
+ */
12
+ export function useV1DeleteProjDbSchemaInstanceMutation(options) {
13
+ return useMutation((mutateProps) => v1DeleteProjDbSchemaInstance(mutateProps), options);
14
+ }
@@ -0,0 +1,21 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface V1DeleteProjDbSchemaMutationPathParams {
6
+ org: string;
7
+ project: string;
8
+ dbschema: string;
9
+ }
10
+ export interface V1DeleteProjDbSchemaMutationHeaderParams {
11
+ 'Harness-Account'?: string;
12
+ }
13
+ export type V1DeleteProjDbSchemaOkResponse = ResponseWithPagination<unknown>;
14
+ export type V1DeleteProjDbSchemaErrorResponse = ErrorResponseResponse;
15
+ export interface V1DeleteProjDbSchemaProps extends V1DeleteProjDbSchemaMutationPathParams, Omit<FetcherOptions<unknown, unknown, V1DeleteProjDbSchemaMutationHeaderParams>, 'url'> {
16
+ }
17
+ export declare function v1DeleteProjDbSchema(props: V1DeleteProjDbSchemaProps): Promise<V1DeleteProjDbSchemaOkResponse>;
18
+ /**
19
+ * Delete a database schema
20
+ */
21
+ export declare function useV1DeleteProjDbSchemaMutation(options?: Omit<UseMutationOptions<V1DeleteProjDbSchemaOkResponse, V1DeleteProjDbSchemaErrorResponse, V1DeleteProjDbSchemaProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1DeleteProjDbSchemaOkResponse, import("..").Error, V1DeleteProjDbSchemaProps, 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 v1DeleteProjDbSchema(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}`, method: 'DELETE' }, props));
8
+ }
9
+ /**
10
+ * Delete a database schema
11
+ */
12
+ export function useV1DeleteProjDbSchemaMutation(options) {
13
+ return useMutation((mutateProps) => v1DeleteProjDbSchema(mutateProps), options);
14
+ }
@@ -0,0 +1,21 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { ParsedLogResponseResponse } from '../responses/ParsedLogResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface V1GetDbinstanceLogQueryPathParams {
7
+ dbinstance: string;
8
+ log: string;
9
+ }
10
+ export interface V1GetDbinstanceLogQueryHeaderParams {
11
+ 'Harness-Account'?: string;
12
+ }
13
+ export type V1GetDbinstanceLogOkResponse = ResponseWithPagination<ParsedLogResponseResponse>;
14
+ export type V1GetDbinstanceLogErrorResponse = ErrorResponseResponse;
15
+ export interface V1GetDbinstanceLogProps extends V1GetDbinstanceLogQueryPathParams, Omit<FetcherOptions<unknown, unknown, V1GetDbinstanceLogQueryHeaderParams>, 'url'> {
16
+ }
17
+ export declare function v1GetDbinstanceLog(props: V1GetDbinstanceLogProps): Promise<V1GetDbinstanceLogOkResponse>;
18
+ /**
19
+ * Retrieves the specified log event
20
+ */
21
+ export declare function useV1GetDbinstanceLogQuery(props: V1GetDbinstanceLogProps, options?: Omit<UseQueryOptions<V1GetDbinstanceLogOkResponse, V1GetDbinstanceLogErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<V1GetDbinstanceLogOkResponse, import("..").Error>;
@@ -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 '../../../../fetcher/index.js';
6
+ export function v1GetDbinstanceLog(props) {
7
+ return fetcher(Object.assign({ url: `/v1/dbinstance/${props.dbinstance}/logs/${props.log}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves the specified log event
11
+ */
12
+ export function useV1GetDbinstanceLogQuery(props, options) {
13
+ return useQuery(['v1-get-dbinstance-log', props.dbinstance, props.log], ({ signal }) => v1GetDbinstanceLog(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,23 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { DbInstanceResponseResponse } from '../responses/DbInstanceResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface V1GetProjDbSchemaInstanceQueryPathParams {
7
+ org: string;
8
+ project: string;
9
+ dbschema: string;
10
+ dbinstance: string;
11
+ }
12
+ export interface V1GetProjDbSchemaInstanceQueryHeaderParams {
13
+ 'Harness-Account'?: string;
14
+ }
15
+ export type V1GetProjDbSchemaInstanceOkResponse = ResponseWithPagination<DbInstanceResponseResponse>;
16
+ export type V1GetProjDbSchemaInstanceErrorResponse = ErrorResponseResponse;
17
+ export interface V1GetProjDbSchemaInstanceProps extends V1GetProjDbSchemaInstanceQueryPathParams, Omit<FetcherOptions<unknown, unknown, V1GetProjDbSchemaInstanceQueryHeaderParams>, 'url'> {
18
+ }
19
+ export declare function v1GetProjDbSchemaInstance(props: V1GetProjDbSchemaInstanceProps): Promise<V1GetProjDbSchemaInstanceOkResponse>;
20
+ /**
21
+ * Retrieves the specified database instance
22
+ */
23
+ export declare function useV1GetProjDbSchemaInstanceQuery(props: V1GetProjDbSchemaInstanceProps, options?: Omit<UseQueryOptions<V1GetProjDbSchemaInstanceOkResponse, V1GetProjDbSchemaInstanceErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<V1GetProjDbSchemaInstanceOkResponse, import("..").Error>;
@@ -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 '../../../../fetcher/index.js';
6
+ export function v1GetProjDbSchemaInstance(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/instance/${props.dbinstance}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves the specified database instance
11
+ */
12
+ export function useV1GetProjDbSchemaInstanceQuery(props, options) {
13
+ return useQuery(['v1-get-proj-db-schema-instance', props.org, props.project, props.dbschema, props.dbinstance], ({ signal }) => v1GetProjDbSchemaInstance(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,22 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { DbSchemaResponseResponse } from '../responses/DbSchemaResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface V1GetProjDbSchemaQueryPathParams {
7
+ org: string;
8
+ project: string;
9
+ dbschema: string;
10
+ }
11
+ export interface V1GetProjDbSchemaQueryHeaderParams {
12
+ 'Harness-Account'?: string;
13
+ }
14
+ export type V1GetProjDbSchemaOkResponse = ResponseWithPagination<DbSchemaResponseResponse>;
15
+ export type V1GetProjDbSchemaErrorResponse = ErrorResponseResponse;
16
+ export interface V1GetProjDbSchemaProps extends V1GetProjDbSchemaQueryPathParams, Omit<FetcherOptions<unknown, unknown, V1GetProjDbSchemaQueryHeaderParams>, 'url'> {
17
+ }
18
+ export declare function v1GetProjDbSchema(props: V1GetProjDbSchemaProps): Promise<V1GetProjDbSchemaOkResponse>;
19
+ /**
20
+ * Retrieves the specified database schema
21
+ */
22
+ export declare function useV1GetProjDbSchemaQuery(props: V1GetProjDbSchemaProps, options?: Omit<UseQueryOptions<V1GetProjDbSchemaOkResponse, V1GetProjDbSchemaErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<V1GetProjDbSchemaOkResponse, import("..").Error>;
@@ -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 '../../../../fetcher/index.js';
6
+ export function v1GetProjDbSchema(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves the specified database schema
11
+ */
12
+ export function useV1GetProjDbSchemaQuery(props, options) {
13
+ return useQuery(['v1-get-proj-db-schema', props.org, props.project, props.dbschema], ({ signal }) => v1GetProjDbSchema(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,23 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ParsedLogResponseResponse } from '../responses/ParsedLogResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { LogIngestRequestRequestBody } from '../requestBodies/LogIngestRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1IngestLogsMutationPathParams {
8
+ dbinstance: string;
9
+ }
10
+ export interface V1IngestLogsMutationHeaderParams {
11
+ 'Harness-Account'?: string;
12
+ }
13
+ export type V1IngestLogsRequestBody = LogIngestRequestRequestBody;
14
+ export type V1IngestLogsOkResponse = ResponseWithPagination<ParsedLogResponseResponse>;
15
+ export type V1IngestLogsErrorResponse = ErrorResponseResponse;
16
+ export interface V1IngestLogsProps extends V1IngestLogsMutationPathParams, Omit<FetcherOptions<unknown, V1IngestLogsRequestBody, V1IngestLogsMutationHeaderParams>, 'url'> {
17
+ body: V1IngestLogsRequestBody;
18
+ }
19
+ export declare function v1IngestLogs(props: V1IngestLogsProps): Promise<V1IngestLogsOkResponse>;
20
+ /**
21
+ * Ingest database migration logs to update the state of the database
22
+ */
23
+ export declare function useV1IngestLogsMutation(options?: Omit<UseMutationOptions<V1IngestLogsOkResponse, V1IngestLogsErrorResponse, V1IngestLogsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1IngestLogsOkResponse, import("..").Error, V1IngestLogsProps, 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 v1IngestLogs(props) {
7
+ return fetcher(Object.assign({ url: `/v1/dbinstance/${props.dbinstance}/logs`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Ingest database migration logs to update the state of the database
11
+ */
12
+ export function useV1IngestLogsMutation(options) {
13
+ return useMutation((mutateProps) => v1IngestLogs(mutateProps), options);
14
+ }
@@ -0,0 +1,37 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { DbInstanceListResponseResponse } from '../responses/DbInstanceListResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface V1ListProjDbSchemaInstanceQueryPathParams {
7
+ org: string;
8
+ project: string;
9
+ dbschema: string;
10
+ }
11
+ export interface V1ListProjDbSchemaInstanceQueryQueryParams {
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?: 'name' | 'updated';
23
+ order?: 'ASC' | 'DESC';
24
+ }
25
+ export interface V1ListProjDbSchemaInstanceQueryHeaderParams {
26
+ 'Harness-Account'?: string;
27
+ }
28
+ export type V1ListProjDbSchemaInstanceOkResponse = ResponseWithPagination<DbInstanceListResponseResponse>;
29
+ export type V1ListProjDbSchemaInstanceErrorResponse = ErrorResponseResponse;
30
+ export interface V1ListProjDbSchemaInstanceProps extends V1ListProjDbSchemaInstanceQueryPathParams, Omit<FetcherOptions<V1ListProjDbSchemaInstanceQueryQueryParams, unknown, V1ListProjDbSchemaInstanceQueryHeaderParams>, 'url'> {
31
+ queryParams: V1ListProjDbSchemaInstanceQueryQueryParams;
32
+ }
33
+ export declare function v1ListProjDbSchemaInstance(props: V1ListProjDbSchemaInstanceProps): Promise<V1ListProjDbSchemaInstanceOkResponse>;
34
+ /**
35
+ * Retrieves the specified database instances of the database schema
36
+ */
37
+ export declare function useV1ListProjDbSchemaInstanceQuery(props: V1ListProjDbSchemaInstanceProps, options?: Omit<UseQueryOptions<V1ListProjDbSchemaInstanceOkResponse, V1ListProjDbSchemaInstanceErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<V1ListProjDbSchemaInstanceOkResponse, import("..").Error>;
@@ -0,0 +1,20 @@
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 v1ListProjDbSchemaInstance(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/instance`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves the specified database instances of the database schema
11
+ */
12
+ export function useV1ListProjDbSchemaInstanceQuery(props, options) {
13
+ return useQuery([
14
+ 'v1-list-proj-db-schema-instance',
15
+ props.org,
16
+ props.project,
17
+ props.dbschema,
18
+ props.queryParams,
19
+ ], ({ signal }) => v1ListProjDbSchemaInstance(Object.assign(Object.assign({}, props), { signal })), options);
20
+ }
@@ -0,0 +1,36 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { DbSchemaListResponseResponse } from '../responses/DbSchemaListResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface V1ListProjDbSchemaQueryPathParams {
7
+ org: string;
8
+ project: string;
9
+ }
10
+ export interface V1ListProjDbSchemaQueryQueryParams {
11
+ /**
12
+ * @format int64
13
+ * @default 0
14
+ */
15
+ page?: number;
16
+ /**
17
+ * @default 10
18
+ */
19
+ limit?: number;
20
+ search_term?: string;
21
+ sort?: 'name' | 'updated';
22
+ order?: 'ASC' | 'DESC';
23
+ }
24
+ export interface V1ListProjDbSchemaQueryHeaderParams {
25
+ 'Harness-Account'?: string;
26
+ }
27
+ export type V1ListProjDbSchemaOkResponse = ResponseWithPagination<DbSchemaListResponseResponse>;
28
+ export type V1ListProjDbSchemaErrorResponse = ErrorResponseResponse;
29
+ export interface V1ListProjDbSchemaProps extends V1ListProjDbSchemaQueryPathParams, Omit<FetcherOptions<V1ListProjDbSchemaQueryQueryParams, unknown, V1ListProjDbSchemaQueryHeaderParams>, 'url'> {
30
+ queryParams: V1ListProjDbSchemaQueryQueryParams;
31
+ }
32
+ export declare function v1ListProjDbSchema(props: V1ListProjDbSchemaProps): Promise<V1ListProjDbSchemaOkResponse>;
33
+ /**
34
+ * List database Schemas
35
+ */
36
+ export declare function useV1ListProjDbSchemaQuery(props: V1ListProjDbSchemaProps, options?: Omit<UseQueryOptions<V1ListProjDbSchemaOkResponse, V1ListProjDbSchemaErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<V1ListProjDbSchemaOkResponse, import("..").Error>;
@@ -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 '../../../../fetcher/index.js';
6
+ export function v1ListProjDbSchema(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * List database Schemas
11
+ */
12
+ export function useV1ListProjDbSchemaQuery(props, options) {
13
+ return useQuery(['v1-list-proj-db-schema', props.org, props.project, props.queryParams], ({ signal }) => v1ListProjDbSchema(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,26 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DbInstanceResponseResponse } from '../responses/DbInstanceResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { DbInstanceUpdateRequestRequestBody } from '../requestBodies/DbInstanceUpdateRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1UpdateProjDbSchemaInstanceMutationPathParams {
8
+ org: string;
9
+ project: string;
10
+ dbschema: string;
11
+ dbinstance: string;
12
+ }
13
+ export interface V1UpdateProjDbSchemaInstanceMutationHeaderParams {
14
+ 'Harness-Account'?: string;
15
+ }
16
+ export type V1UpdateProjDbSchemaInstanceRequestBody = DbInstanceUpdateRequestRequestBody;
17
+ export type V1UpdateProjDbSchemaInstanceOkResponse = ResponseWithPagination<DbInstanceResponseResponse>;
18
+ export type V1UpdateProjDbSchemaInstanceErrorResponse = ErrorResponseResponse;
19
+ export interface V1UpdateProjDbSchemaInstanceProps extends V1UpdateProjDbSchemaInstanceMutationPathParams, Omit<FetcherOptions<unknown, V1UpdateProjDbSchemaInstanceRequestBody, V1UpdateProjDbSchemaInstanceMutationHeaderParams>, 'url'> {
20
+ body: V1UpdateProjDbSchemaInstanceRequestBody;
21
+ }
22
+ export declare function v1UpdateProjDbSchemaInstance(props: V1UpdateProjDbSchemaInstanceProps): Promise<V1UpdateProjDbSchemaInstanceOkResponse>;
23
+ /**
24
+ * Update a database instance
25
+ */
26
+ export declare function useV1UpdateProjDbSchemaInstanceMutation(options?: Omit<UseMutationOptions<V1UpdateProjDbSchemaInstanceOkResponse, V1UpdateProjDbSchemaInstanceErrorResponse, V1UpdateProjDbSchemaInstanceProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1UpdateProjDbSchemaInstanceOkResponse, import("..").Error, V1UpdateProjDbSchemaInstanceProps, 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 v1UpdateProjDbSchemaInstance(props) {
7
+ return fetcher(Object.assign({ url: `/v1/orgs/${props.org}/projects/${props.project}/dbschema/${props.dbschema}/instance/${props.dbinstance}`, method: 'PUT' }, props));
8
+ }
9
+ /**
10
+ * Update a database instance
11
+ */
12
+ export function useV1UpdateProjDbSchemaInstanceMutation(options) {
13
+ return useMutation((mutateProps) => v1UpdateProjDbSchemaInstance(mutateProps), options);
14
+ }
@@ -0,0 +1,25 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DbSchemaResponseResponse } from '../responses/DbSchemaResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { DbSchemaUpdateRequestRequestBody } from '../requestBodies/DbSchemaUpdateRequestRequestBody';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface V1UpdateProjDbSchemaMutationPathParams {
8
+ org: string;
9
+ project: string;
10
+ dbschema: string;
11
+ }
12
+ export interface V1UpdateProjDbSchemaMutationHeaderParams {
13
+ 'Harness-Account'?: string;
14
+ }
15
+ export type V1UpdateProjDbSchemaRequestBody = DbSchemaUpdateRequestRequestBody;
16
+ export type V1UpdateProjDbSchemaOkResponse = ResponseWithPagination<DbSchemaResponseResponse>;
17
+ export type V1UpdateProjDbSchemaErrorResponse = ErrorResponseResponse;
18
+ export interface V1UpdateProjDbSchemaProps extends V1UpdateProjDbSchemaMutationPathParams, Omit<FetcherOptions<unknown, V1UpdateProjDbSchemaRequestBody, V1UpdateProjDbSchemaMutationHeaderParams>, 'url'> {
19
+ body: V1UpdateProjDbSchemaRequestBody;
20
+ }
21
+ export declare function v1UpdateProjDbSchema(props: V1UpdateProjDbSchemaProps): Promise<V1UpdateProjDbSchemaOkResponse>;
22
+ /**
23
+ * Update a database schema
24
+ */
25
+ export declare function useV1UpdateProjDbSchemaMutation(options?: Omit<UseMutationOptions<V1UpdateProjDbSchemaOkResponse, V1UpdateProjDbSchemaErrorResponse, V1UpdateProjDbSchemaProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<V1UpdateProjDbSchemaOkResponse, import("..").Error, V1UpdateProjDbSchemaProps, unknown>;