Refactor state types

This commit is contained in:
Rudolf Meijering 2021-09-28 15:24:43 +02:00
parent 618d1e5e99
commit 6a5123a1b2
16 changed files with 15 additions and 15 deletions

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import type { TransformRawDocs } from '../types';
import type { TransformRawDocs } from '../state';
import type { SavedObjectsRawDoc } from '../../serialization';
import {
DocumentsTransformFailed,

View file

@ -10,7 +10,7 @@ import { ElasticsearchClient } from '../../elasticsearch';
import { IndexMapping } from '../mappings';
import { Logger } from '../../logging';
import type { SavedObjectsMigrationVersion } from '../types';
import type { TransformRawDocs } from './types';
import type { TransformRawDocs } from './state';
import { MigrationResult } from '../migrations/core';
import { next } from './next';
import { model } from './model';

View file

@ -11,7 +11,7 @@ import { IndexMapping } from '../mappings';
import { SavedObjectsMigrationVersion } from '../../../types';
import { SavedObjectsMigrationConfigType } from '../saved_objects_config';
import type { ISavedObjectTypeRegistry } from '../saved_objects_type_registry';
import { InitState } from './types';
import { InitState } from './state';
import { excludeUnusedTypesQuery } from '../migrations/core';
/**

View file

@ -15,7 +15,7 @@ import * as Option from 'fp-ts/lib/Option';
import { ResponseError } from '@elastic/elasticsearch/lib/errors';
import { elasticsearchClientMock } from '../../elasticsearch/client/mocks';
import { LoggerAdapter } from '../../logging/logger_adapter';
import { AllControlStates, State } from './types';
import { AllControlStates, State } from './state';
import { createInitialState } from './initial_state';
import { ByteSizeValue } from '@kbn/config-schema';

View file

@ -13,7 +13,7 @@ import type { ElasticsearchClient } from '../../elasticsearch';
import { getErrorMessage, getRequestDebugMeta } from '../../elasticsearch';
import { Model, Next, stateActionMachine } from './state_action_machine';
import { cleanup } from './migrations_state_machine_cleanup';
import { ReindexSourceToTempTransform, ReindexSourceToTempIndexBulk, State } from './types';
import { ReindexSourceToTempTransform, ReindexSourceToTempIndexBulk, State } from './state';
import { SavedObjectsRawDoc } from '../serialization';
interface StateTransitionLogMeta extends LogMeta {

View file

@ -8,7 +8,7 @@
import type { ElasticsearchClient } from '../../elasticsearch';
import * as Actions from './actions';
import type { State } from './types';
import type { State } from './state';
export async function cleanup(client: ElasticsearchClient, state?: State) {
if (!state) return;

View file

@ -7,7 +7,7 @@
*/
import { gt, valid } from 'semver';
import { State } from '../types';
import { State } from '../state';
import { IndexMapping } from '../../mappings';
import { FetchIndexResponse } from '../actions';

View file

@ -40,7 +40,7 @@ import type {
ReindexSourceToTempIndexBulk,
CheckUnknownDocumentsState,
CalculateExcludeFiltersState,
} from '../types';
} from '../state';
import { SavedObjectsRawDoc } from '../../serialization';
import { TransformErrorObjects, TransformSavedObjectDocumentError } from '../../migrations/core';
import { AliasAction, RetryableEsClientError } from '../actions';

View file

@ -11,7 +11,7 @@ import * as Option from 'fp-ts/lib/Option';
import { estypes } from '@elastic/elasticsearch';
import { AliasAction, isLeftTypeof } from '../actions';
import { AllActionStates, MigrationLog, State } from '../types';
import { AllActionStates, MigrationLog, State } from '../state';
import type { ResponseType } from '../next';
import { disableUnknownTypeMappingFields } from '../../migrations/core/migration_context';
import {

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import type { MigrationLog } from '../types';
import type { MigrationLog } from '../state';
import {
createInitialProgress,
incrementProcessedProgress,

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import type { MigrationLog, Progress } from '../types';
import type { MigrationLog, Progress } from '../state';
/**
* Returns an initial state of the progress object (everything undefined)

View file

@ -7,7 +7,7 @@
*/
import { resetRetryState, delayRetryState } from './retry_state';
import { State } from '../types';
import { State } from '../state';
const createState = (parts: Record<string, any>) => {
return parts as State;

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { State } from '../types';
import { State } from '../state';
export const delayRetryState = <S extends State>(
state: S,

View file

@ -8,7 +8,7 @@
import { ElasticsearchClient } from '../../elasticsearch';
import { next } from './next';
import { State } from './types';
import { State } from './state';
describe('migrations v2 next', () => {
it.todo('when state.retryDelay > 0 delays execution of the next action');

View file

@ -41,7 +41,7 @@ import type {
OutdatedDocumentsRefresh,
CheckUnknownDocumentsState,
CalculateExcludeFiltersState,
} from './types';
} from './state';
import * as Actions from './actions';
import { ElasticsearchClient } from '../../elasticsearch';