[chore] Bundle fp-ts into the shared bundle (#217034)

## Summary

Just had some fun and made fp-ts available in the shared bundle, with
support for partial imports.

Changes in this PR:
* aligned `fp-ts` direct imports to the format: `fp-ts/<module>`
* Mapped the direct imports into the shared bundle re-using the same
`fp-ts` module under the hood
This commit is contained in:
Marco Liberati 2025-04-16 18:01:41 +02:00 committed by GitHub
parent f816e7b84f
commit 0a6bc1b46c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
305 changed files with 494 additions and 482 deletions

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { estypes } from '@elastic/elasticsearch';
import { errors as esErrors } from '@elastic/elasticsearch';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';

View file

@ -9,8 +9,8 @@
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import { withTimeout } from '@kbn/std';
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { SavedObjectTypeExcludeFromUpgradeFilterHook } from '@kbn/core-saved-objects-server';
import type { RetryableEsClientError } from '.';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { errors as EsErrors } from '@elastic/elasticsearch';
import { isRetryableEsClientError } from '@kbn/core-elasticsearch-server-internal';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Either from 'fp-ts/Either';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {
catchRetryableEsClientErrors,

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { flatten } from 'lodash';
import type {
AggregationsMultiBucketAggregateBase,

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { IndexMapping, VirtualVersionMap } from '@kbn/core-saved-objects-base-server-internal';
import { getNewAndUpdatedTypes } from '../core/compare_mappings';

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/function';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { SavedObjectTypeExcludeFromUpgradeFilterHook } from '@kbn/core-saved-objects-server';

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/function';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import { errors as EsErrors } from '@elastic/elasticsearch';
import type {
ElasticsearchClient,

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {
catchRetryableEsClientErrors,

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/function';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import type { estypes } from '@elastic/elasticsearch';
import type {
ElasticsearchClient,

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { Conflicts, QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Either from 'fp-ts/Either';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal';
import {

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { Either } from 'fp-ts/lib/Either';
import { right } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { right } from 'fp-ts/Either';
import type { RetryableEsClientError } from './catch_retryable_es_client_errors';
import type { DocumentsTransformFailed } from '../core/migrate_raw_docs';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {
catchRetryableEsClientErrors,

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import {

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { estypes } from '@elastic/elasticsearch';
import { errors as EsErrors } from '@elastic/elasticsearch';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Option from 'fp-ts/lib/Option';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Option from 'fp-ts/Option';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {
catchRetryableEsClientErrors,

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/function';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { RetryableEsClientError } from './catch_retryable_es_client_errors';
import { DEFAULT_TIMEOUT, type SourceEqualsTarget, type IndexNotFound } from '.';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { errors as EsErrors } from '@elastic/elasticsearch';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { WaitGroup } from '../kibana_migrator_utils';
/** @internal */

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as TaskEither from 'fp-ts/TaskEither';
import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server';
import type { TransformRawDocs } from '../types';
import type { DocumentsTransformFailed, DocumentsTransformSuccess } from '../core/migrate_raw_docs';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { errors as EsErrors } from '@elastic/elasticsearch';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/function';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal';
import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors';

View file

@ -8,8 +8,8 @@
*/
import { omit } from 'lodash';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/function';
import * as TaskEither from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { IndexMapping, VirtualVersionMap } from '@kbn/core-saved-objects-base-server-internal';
import { diffMappings } from '../core/diff_mappings';

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Option from 'fp-ts/lib/Option';
import { flow } from 'fp-ts/lib/function';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Option from 'fp-ts/Option';
import { flow } from 'fp-ts/function';
import { waitForTask } from './wait_for_task';
/** @internal */

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {
catchRetryableEsClientErrors,

View file

@ -7,14 +7,15 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Option from 'fp-ts/lib/Option';
import { flow } from 'fp-ts/lib/function';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Option from 'fp-ts/Option';
import { flow } from 'fp-ts/function';
import {
waitForTask,
WaitForTaskCompletionTimeout,
TaskCompletedWithRetriableError,
} from './wait_for_task';
import { RetryableEsClientError } from './catch_retryable_es_client_errors';
export const waitForPickupUpdatedMappingsTask = flow(

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Option from 'fp-ts/lib/Option';
import { flow } from 'fp-ts/lib/function';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Option from 'fp-ts/Option';
import { flow } from 'fp-ts/function';
import type { RetryableEsClientError } from './catch_retryable_es_client_errors';
import type { IndexNotFound, TargetIndexHadWriteBlock } from '.';
import { waitForTask, type WaitForTaskCompletionTimeout } from './wait_for_task';

View file

@ -8,9 +8,9 @@
*/
import type { estypes } from '@elastic/elasticsearch';
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Option from 'fp-ts/lib/Option';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Option from 'fp-ts/Option';
import { errors as EsErrors } from '@elastic/elasticsearch';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import {

View file

@ -10,8 +10,8 @@
/*
* This file provides logic for migrating raw documents.
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/TaskEither';
import * as Either from 'fp-ts/Either';
import type {
SavedObjectSanitizedDoc,
SavedObjectsRawDoc,

View file

@ -8,7 +8,7 @@
*/
import { errors as EsErrors } from '@elastic/elasticsearch';
import * as Option from 'fp-ts/lib/Option';
import * as Option from 'fp-ts/Option';
import type { Logger } from '@kbn/logging';
import {
getErrorMessage,

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import type { SavedObjectsRawDoc, SavedObjectsRawDocSource } from '@kbn/core-saved-objects-server';
import type { BulkOperationContainer } from '@elastic/elasticsearch/lib/api/types';
import type { IndexTypesMap } from '@kbn/core-saved-objects-base-server-internal';

View file

@ -13,7 +13,7 @@ import type {
QueryDslBoolQuery,
QueryDslQueryContainer,
} from '@elastic/elasticsearch/lib/api/types';
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server';
import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal';
import type { AliasAction, FetchIndexResponse } from '../actions';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Option from 'fp-ts/lib/Option';
import * as Either from 'fp-ts/Either';
import * as Option from 'fp-ts/Option';
import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal';
import { isTypeof } from '../actions';

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { pipe } from 'fp-ts/lib/pipeable';
import * as Option from 'fp-ts/lib/Option';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/pipeable';
import * as Option from 'fp-ts/Option';
import * as TaskEither from 'fp-ts/TaskEither';
import { omit } from 'lodash';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { WaitGroup } from './kibana_migrator_utils';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Option from 'fp-ts/lib/Option';
import * as Option from 'fp-ts/Option';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import type { DocLinks } from '@kbn/doc-links';
import type {

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as TaskEither from 'fp-ts/TaskEither';
import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server';
import type { DocumentsTransformFailed, DocumentsTransformSuccess } from './core';

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as TaskEither from 'fp-ts/lib/TaskEither';
import * as Either from 'fp-ts/Either';
import * as TaskEither from 'fp-ts/TaskEither';
export interface WaitForDelayParams {
delayInSec: number;

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import type { State, AllActionStates } from '../state';
import type { ResponseType } from '../next';
import { delayRetryState, resetRetryState } from '../../model/retry_state';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { extractUnknownDocFailureReason } from '../../../model/extract_errors';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { delayRetryState } from '../../../model/retry_state';
import { isTypeof } from '../../actions';
import type { ModelStage } from '../types';

View file

@ -8,7 +8,7 @@
*/
import { cloneDeep } from 'lodash';
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { delayRetryState } from '../../../model/retry_state';
import { throwBadResponse } from '../../../model/helpers';
import { CLUSTER_SHARD_LIMIT_EXCEEDED_REASON } from '../../../common/constants';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { MigrationLog } from '../../../types';
import { excludeUnusedTypesQuery } from '../../../core';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -8,7 +8,7 @@
*/
import { cloneDeep } from 'lodash';
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import type { MigrationLog } from '../../../types';
import { getAliases } from '../../../model/helpers';
import {

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { FATAL_REASON_REQUEST_ENTITY_TOO_LARGE } from '../../../common/constants';
import { throwBadResponse } from '../../../model/helpers';
import { isTypeof } from '../../actions';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import { createInitialProgress } from '../../../model/progress';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';
import { logProgress, setProgressTotal } from '../../../model/progress';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';
import { incrementProcessedProgress } from '../../../model/progress';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import { setMetaDocMigrationStarted } from '../../utils';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import { isTypeof } from '../../actions';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import { setMetaDocMigrationComplete } from '../../utils';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';

View file

@ -8,7 +8,7 @@
*/
import {} from 'lodash';
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { delayRetryState } from '../../../model/retry_state';
import { throwBadResponse } from '../../../model/helpers';
import { isTypeof } from '../../actions';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Either from 'fp-ts/Either';
import { throwBadResponse } from '../../../model/helpers';
import type { ModelStage } from '../types';
import { setMetaMappingMigrationComplete } from '../../utils';

View file

@ -7,10 +7,10 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import * as Either from 'fp-ts/lib/Either';
import * as Option from 'fp-ts/lib/Option';
import * as Either from 'fp-ts/Either';
import * as Option from 'fp-ts/Option';
import { errors } from '@elastic/elasticsearch';
import type { TaskEither } from 'fp-ts/lib/TaskEither';
import type { TaskEither } from 'fp-ts/TaskEither';
import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server';
import type {
ElasticsearchClient,

View file

@ -63,6 +63,7 @@ RUNTIME_DEPS = [
"@npm//styled-components",
"@npm//tslib",
"@npm//uuid",
"@npm//fp-ts",
"@npm//io-ts",
"@npm//@reduxjs/toolkit",
"@npm//redux",
@ -76,7 +77,6 @@ webpack_cli(
data = RUNTIME_DEPS + SRCS + [
"//:.browserslistrc",
":webpack.config.js",
"@npm//webpack",
"@npm//clean-webpack-plugin",
"@npm//mini-css-extract-plugin",

View file

@ -81,6 +81,7 @@ module.exports = (_, argv) => {
'fflate',
'fastest-levenshtein',
'history',
'fp-ts',
'io-ts',
'jquery',
'lodash',

View file

@ -56,6 +56,15 @@ const externals = {
'@kbn/monaco': '__kbnSharedDeps__.KbnMonaco',
// this is how plugins/consumers from npm load monaco
'monaco-editor/esm/vs/editor/editor.api': '__kbnSharedDeps__.MonacoBarePluginApi',
'fp-ts/Option': '__kbnSharedDeps__.FpTs.option',
'fp-ts/pipeable': '__kbnSharedDeps__.FpTs.pipeable',
'fp-ts/TaskEither': '__kbnSharedDeps__.FpTs.taskEither',
'fp-ts/Either': '__kbnSharedDeps__.FpTs.either',
'fp-ts/function': '__kbnSharedDeps__.FpTs.function',
'fp-ts/Task': '__kbnSharedDeps__.FpTs.task',
'fp-ts/Set': '__kbnSharedDeps__.FpTs.set',
'fp-ts/Ord': '__kbnSharedDeps__.FpTs.ord',
'fp-ts/Array': '__kbnSharedDeps__.FpTs.array',
'io-ts': '__kbnSharedDeps__.IoTs',
'io-ts/lib/Reporter': '__kbnSharedDeps__.IoTsReporter',
'io-ts/lib/PathReporter': '__kbnSharedDeps__.IoTsPathReporter',

View file

@ -30,6 +30,7 @@ export const EmotionReact = require('@emotion/react');
export const Moment = require('moment');
export const MomentTimezone = require('moment-timezone/moment-timezone');
export const FpTs = require('fp-ts');
export const IoTs = require('io-ts');
export const IoTsReporter = require('io-ts/Reporter');
export const IoTsPathReporter = require('io-ts/PathReporter');

View file

@ -267,7 +267,7 @@ const SchemaFileTemplate = `
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
%%IMPORTS%%
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;

View file

@ -10,7 +10,7 @@
// this file was generated, and should not be edited by hand
// ---------------------------------- WARNING ----------------------------------
import * as rt from 'io-ts';
import type { Either } from 'fp-ts/lib/Either';
import type { Either } from 'fp-ts/Either';
import { AlertSchema } from './alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(

View file

@ -11,8 +11,8 @@ import { Client, HttpConnection } from '@elastic/elasticsearch';
import url from 'url';
import { Either, fromNullable, chain, getOrElse, toError } from 'fp-ts/Either';
import { flow, pipe } from 'fp-ts/function';
import * as TE from 'fp-ts/lib/TaskEither';
import * as T from 'fp-ts/lib/Task';
import * as TE from 'fp-ts/TaskEither';
import * as T from 'fp-ts/Task';
import { ToolingLog } from '@kbn/tooling-log';
import { FtrService } from '../ftr_provider_context';
import { print } from './utils';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { either } from 'fp-ts/lib/Either';
import { either } from 'fp-ts/Either';
import * as rt from 'io-ts';
export const arrayToStringRt = new rt.Type<unknown[], string, unknown>(

View file

@ -9,8 +9,8 @@
import * as rt from 'io-ts';
import dateMath from '@kbn/datemath';
import { chain } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
import { chain } from 'fp-ts/Either';
import { pipe } from 'fp-ts/pipeable';
const isValidDatemath = (value: string): boolean => {
const parsedValue = dateMath.parse(value);

View file

@ -7,9 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { fold } from 'fp-ts/lib/Either';
import { identity } from 'fp-ts/lib/function';
import { pipe } from 'fp-ts/lib/pipeable';
import { fold } from 'fp-ts/Either';
import { identity } from 'fp-ts/function';
import { pipe } from 'fp-ts/pipeable';
import { Context, Errors, IntersectionType, Type, UnionType, ValidationError } from 'io-ts';
type ErrorFactory = (message: string) => Error;

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { either } from 'fp-ts/lib/Either';
import { either } from 'fp-ts/Either';
// Checks whether a string is a valid ISO timestamp,
// and returns an epoch timestamp

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { chain } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/function';
import { chain } from 'fp-ts/Either';
import { pipe } from 'fp-ts/function';
import * as t from 'io-ts';
import { isoToEpochRt } from '../iso_to_epoch_rt';

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { either } from 'fp-ts/lib/Either';
import { either } from 'fp-ts/Either';
export const jsonRt = new t.Type<any, string, unknown>(
'JSON',

View file

@ -9,7 +9,7 @@
import * as t from 'io-ts';
import { merge as lodashMerge } from 'lodash';
import { isLeft } from 'fp-ts/lib/Either';
import { isLeft } from 'fp-ts/Either';
type PlainObject = Record<string | number | symbol, any>;

View file

@ -8,8 +8,8 @@
*/
import type { RouteValidationFunction } from '@kbn/core/server';
import { fold } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
import { fold } from 'fp-ts/Either';
import { pipe } from 'fp-ts/pipeable';
import { Context, Errors, IntersectionType, Type, UnionType, ValidationError } from 'io-ts';
type ValdidationResult<Value> = ReturnType<RouteValidationFunction<Value>>;

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { either, isRight } from 'fp-ts/lib/Either';
import { either, isRight } from 'fp-ts/Either';
import { difference, isPlainObject, forEach, isArray, castArray } from 'lodash';
import { MergeType } from '../merge_rt';

View file

@ -9,8 +9,8 @@
import * as rt from 'io-ts';
import moment from 'moment';
import { pipe } from 'fp-ts/lib/pipeable';
import { chain } from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/pipeable';
import { chain } from 'fp-ts/Either';
const NANO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3,9}Z$/;

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { Either } from 'fp-ts/lib/Either';
import { Either } from 'fp-ts/Either';
/**
* Types the DefaultArray<C> as:

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { Either } from 'fp-ts/lib/Either';
import { Either } from 'fp-ts/Either';
/**
* Types the DefaultBooleanFalse as:

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { Either } from 'fp-ts/lib/Either';
import { Either } from 'fp-ts/Either';
/**
* Types the DefaultBooleanTrue as:

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { Either } from 'fp-ts/lib/Either';
import { Either } from 'fp-ts/Either';
/**
* Creates a schema of an array that works in the following way:

View file

@ -8,7 +8,7 @@
*/
import * as t from 'io-ts';
import { Either } from 'fp-ts/lib/Either';
import { Either } from 'fp-ts/Either';
/**
* Types the DefaultEmptyString as:

Some files were not shown because too many files have changed in this diff Show more