mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Refactor state types
This commit is contained in:
parent
618d1e5e99
commit
6a5123a1b2
16 changed files with 15 additions and 15 deletions
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
/**
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { MigrationLog } from '../types';
|
||||
import type { MigrationLog } from '../state';
|
||||
import {
|
||||
createInitialProgress,
|
||||
incrementProcessedProgress,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -41,7 +41,7 @@ import type {
|
|||
OutdatedDocumentsRefresh,
|
||||
CheckUnknownDocumentsState,
|
||||
CalculateExcludeFiltersState,
|
||||
} from './types';
|
||||
} from './state';
|
||||
import * as Actions from './actions';
|
||||
import { ElasticsearchClient } from '../../elasticsearch';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue