@harnessio/react-integration-manager-client 0.1.0 → 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.
@@ -1,5 +1,5 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
- import type { OpenapiTriggerSyncResponse } from '../schemas/OpenapiTriggerSyncResponse';
2
+ import type { IntegrationconfigTriggerSyncResponse } from '../schemas/IntegrationconfigTriggerSyncResponse';
3
3
  import type { UsererrorError } from '../schemas/UsererrorError';
4
4
  import type { ResponseWithPagination } from '../helpers';
5
5
  import { FetcherOptions } from '../../../../fetcher/index.js';
@@ -7,12 +7,12 @@ export interface TriggerSyncMutationPathParams {
7
7
  accountIdentifier: string;
8
8
  integrationconfig_identifier: string;
9
9
  }
10
- export type TriggerSyncOkResponse = ResponseWithPagination<OpenapiTriggerSyncResponse>;
10
+ export type TriggerSyncOkResponse = ResponseWithPagination<IntegrationconfigTriggerSyncResponse>;
11
11
  export type TriggerSyncErrorResponse = UsererrorError;
12
12
  export interface TriggerSyncProps extends TriggerSyncMutationPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
13
13
  }
14
14
  export declare function triggerSync(props: TriggerSyncProps): Promise<TriggerSyncOkResponse>;
15
15
  /**
16
- * Manually triggers a full sync for the specified integration. The sync will start from the beginning and process all configured kinds.
16
+ * Manually triggers a full sync for the specified integration. The sync will start from the beginning and process all configured kinds. Returns an acknowledgement with the sync ID that can be used to track the sync operation.
17
17
  */
18
18
  export declare function useTriggerSyncMutation(options?: Omit<UseMutationOptions<TriggerSyncOkResponse, TriggerSyncErrorResponse, TriggerSyncProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<TriggerSyncOkResponse, UsererrorError, TriggerSyncProps, unknown>;
@@ -7,7 +7,7 @@ export function triggerSync(props) {
7
7
  return fetcher(Object.assign({ url: `/api/v1/accounts/${props.accountIdentifier}/integration-configs/${props.integrationconfig_identifier}/sync`, method: 'POST' }, props));
8
8
  }
9
9
  /**
10
- * Manually triggers a full sync for the specified integration. The sync will start from the beginning and process all configured kinds.
10
+ * Manually triggers a full sync for the specified integration. The sync will start from the beginning and process all configured kinds. Returns an acknowledgement with the sync ID that can be used to track the sync operation.
11
11
  */
12
12
  export function useTriggerSyncMutation(options) {
13
13
  return useMutation((mutateProps) => triggerSync(mutateProps), options);
@@ -13,8 +13,8 @@ export type { UpdateIntegrationStatusErrorResponse, UpdateIntegrationStatusMutat
13
13
  export { updateIntegrationStatus, useUpdateIntegrationStatusMutation, } from './hooks/useUpdateIntegrationStatusMutation';
14
14
  export type { EnumIntegrationMode } from './schemas/EnumIntegrationMode';
15
15
  export type { EnumIntegrationType } from './schemas/EnumIntegrationType';
16
+ export type { IntegrationconfigTriggerSyncResponse } from './schemas/IntegrationconfigTriggerSyncResponse';
16
17
  export type { OpenapiCreateIntegrationConfigRequest } from './schemas/OpenapiCreateIntegrationConfigRequest';
17
- export type { OpenapiTriggerSyncResponse } from './schemas/OpenapiTriggerSyncResponse';
18
18
  export type { OpenapiUpdateIntegrationConfigRequest } from './schemas/OpenapiUpdateIntegrationConfigRequest';
19
19
  export type { TypesFieldMapping } from './schemas/TypesFieldMapping';
20
20
  export type { TypesIntegrationConfig } from './schemas/TypesIntegrationConfig';
@@ -0,0 +1,3 @@
1
+ export interface IntegrationconfigTriggerSyncResponse {
2
+ sync_id?: string;
3
+ }
@@ -1,8 +1,9 @@
1
1
  export interface TypesLastSyncInfo {
2
+ completed_at?: number;
2
3
  duration_ms?: number;
3
4
  entities_synced?: number;
4
5
  error?: string;
5
- has_more?: boolean;
6
+ started_at?: number;
6
7
  success?: boolean;
7
- timestamp?: number;
8
+ sync_id?: string;
8
9
  }
@@ -2,6 +2,9 @@ export interface TypesSyncState {
2
2
  cursor?: {
3
3
  [key: string]: any;
4
4
  };
5
+ has_more?: boolean;
5
6
  pending?: boolean;
7
+ started_at?: number;
8
+ sync_id?: string;
6
9
  total_entities?: number;
7
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-integration-manager-client",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Harness React integration manager client - Integration Manager APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,7 +0,0 @@
1
- export interface OpenapiTriggerSyncResponse {
2
- duration_ms?: number;
3
- entities_synced?: number;
4
- error?: string;
5
- has_more?: boolean;
6
- success?: boolean;
7
- }