diff --git a/package.json b/package.json index 914499d7e0ff3..a0147bbf00a75 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,8 @@ "**/@langchain/core": "^0.3.78", "**/@langchain/google-common": "^0.2.18", "**/@types/node": "22.15.3", - "**/@typescript-eslint/utils": "8.16.0", + "**/@types/prop-types": "15.7.5", + "**/@typescript-eslint/utils": "8.46.3", "**/chokidar": "^3.5.3", "**/d3-scale/**/d3-color": "npm:@elastic/kibana-d3-color@2.0.1", "**/globule/minimatch": "^3.1.2", @@ -91,10 +92,10 @@ "**/langchain": "^0.3.35", "**/remark-parse/trim": "1.0.1", "**/sharp": "0.34.4", - "**/typescript": "5.4.5", + "**/typescript": "5.9.3", "**/util": "^0.12.5", "**/yauzl": "^3.2.0", - "**/zod": "^3.25.76", + "**/zod": "3.25.76", "@aws-sdk/client-bedrock-agent-runtime": "^3.879.0", "@aws-sdk/client-bedrock-runtime": "^3.879.0", "@aws-sdk/client-kendra": "3.879.0", @@ -1877,9 +1878,9 @@ "@types/yargs": "^15.0.0", "@types/yauzl": "^2.10.3", "@types/yazl": "^3.3.0", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", - "@typescript-eslint/typescript-estree": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.46.3", + "@typescript-eslint/parser": "^8.46.3", + "@typescript-eslint/typescript-estree": "^8.46.3", "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "@yarnpkg/lockfile": "^1.1.0", "aggregate-error": "^3.1.0", @@ -2049,7 +2050,7 @@ "tree-kill": "^1.2.2", "ts-morph": "^15.1.0", "tsd": "^0.33.0", - "typescript": "5.4.5", + "typescript": "5.9.3", "val-loader": "^6.0.0", "vinyl-fs": "^4.0.0", "watchpack": "^1.6.0", diff --git a/src/core/packages/overlays/browser-internal/src/banners/user_banner_service.test.ts b/src/core/packages/overlays/browser-internal/src/banners/user_banner_service.test.ts index 3b7f33dddf4a4..1d87300210dd6 100644 --- a/src/core/packages/overlays/browser-internal/src/banners/user_banner_service.test.ts +++ b/src/core/packages/overlays/browser-internal/src/banners/user_banner_service.test.ts @@ -42,6 +42,7 @@ describe('OverlayBannersService', () => { i18n: i18nServiceMock.createStartContract(), theme: themeServiceMock.createStartContract(), uiSettings, + // @ts-expect-error upgrade typescript v5.9.3 userProfile, }); }; diff --git a/src/core/packages/saved-objects/api-server-internal/src/test_helpers/repository.test.common.ts b/src/core/packages/saved-objects/api-server-internal/src/test_helpers/repository.test.common.ts index 5bf60d5eb8e0a..db66adddfe9c1 100644 --- a/src/core/packages/saved-objects/api-server-internal/src/test_helpers/repository.test.common.ts +++ b/src/core/packages/saved-objects/api-server-internal/src/test_helpers/repository.test.common.ts @@ -570,6 +570,7 @@ export const expectBulkGetResult = ( ) => ({ type, id, + // @ts-expect-error upgrade typescript v5.9.3 namespaces: doc._source!.namespaces ?? [doc._source!.namespace] ?? ['default'], ...(doc._source!.originId && { originId: doc._source!.originId }), ...(doc._source!.updated_at && { updated_at: doc._source!.updated_at }), diff --git a/src/core/server/integration_tests/elasticsearch/user_agent.test.ts b/src/core/server/integration_tests/elasticsearch/user_agent.test.ts index 677dec82d8b10..3e40d9dc03232 100644 --- a/src/core/server/integration_tests/elasticsearch/user_agent.test.ts +++ b/src/core/server/integration_tests/elasticsearch/user_agent.test.ts @@ -37,6 +37,7 @@ describe('ES Client - custom user-agent', () => { afterAll(async () => { try { + // @ts-expect-error upgrade typescript v5.9.3 await kibanaServer?.shutdown(); } catch (e) { // trap diff --git a/src/platform/packages/private/kbn-import-resolver/src/import_resolver.ts b/src/platform/packages/private/kbn-import-resolver/src/import_resolver.ts index c4a7c8cc64a74..3ad34bbdf82f6 100644 --- a/src/platform/packages/private/kbn-import-resolver/src/import_resolver.ts +++ b/src/platform/packages/private/kbn-import-resolver/src/import_resolver.ts @@ -159,6 +159,14 @@ export class ImportResolver { return Path.resolve(REPO_ROOT, `node_modules/@typescript-eslint/parser/dist/index.js`); } + // zod migration from v3 to v4 + if (req.startsWith('zod/v4')) { + return Path.resolve(REPO_ROOT, `node_modules/zod/v4/index.cjs`); + } + if (req.startsWith('zod') || req.startsWith('zod/v3')) { + return Path.resolve(REPO_ROOT, `node_modules/zod/v3/index.cjs`); + } + // turn root-relative paths into relative paths if ( req.startsWith('src/') || diff --git a/src/platform/packages/private/kbn-telemetry-tools/src/schema_ftr_validations/schema_to_config_schema.test.ts b/src/platform/packages/private/kbn-telemetry-tools/src/schema_ftr_validations/schema_to_config_schema.test.ts index cc4fb36bd2fa8..bfdd5ad557665 100644 --- a/src/platform/packages/private/kbn-telemetry-tools/src/schema_ftr_validations/schema_to_config_schema.test.ts +++ b/src/platform/packages/private/kbn-telemetry-tools/src/schema_ftr_validations/schema_to_config_schema.test.ts @@ -155,7 +155,6 @@ describe(`assertTelemetryPayload`, () => { { root: { properties: { - // @ts-expect-error: TS doesn't allow pass_through with properties, but it may occur during the tests in runtime, so we want to validate this test case. im_only_passing_through_data: { type: 'pass_through', properties: {} }, }, }, diff --git a/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/apis/search_alerts/search_alerts.ts b/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/apis/search_alerts/search_alerts.ts index dc819dfbd58ec..2465e44d6b1d9 100644 --- a/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/apis/search_alerts/search_alerts.ts +++ b/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/apis/search_alerts/search_alerts.ts @@ -145,6 +145,7 @@ export const searchAlerts = ({ total, querySnapshot: { request: response?.inspect?.dsl ?? [], + // @ts-expect-error upgrade typescript v5.9.3 response: [JSON.stringify(rawResponse)] ?? [], }, error: alertsError, diff --git a/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/hooks/use_fetch_alerts_fields_query.test.tsx b/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/hooks/use_fetch_alerts_fields_query.test.tsx index 068fd85be5a14..9e8fc09cff3b7 100644 --- a/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/hooks/use_fetch_alerts_fields_query.test.tsx +++ b/src/platform/packages/shared/kbn-alerts-ui-shared/src/common/hooks/use_fetch_alerts_fields_query.test.tsx @@ -71,7 +71,7 @@ describe('useFetchAlertsFieldsQuery', () => { initialProps: { ruleTypeIds: ['apm'], enabled: false, - }, + } as { ruleTypeIds: string[]; enabled?: boolean }, } ); diff --git a/src/platform/packages/shared/kbn-babel-register/transforms/index.js b/src/platform/packages/shared/kbn-babel-register/transforms/index.js index 6ccd224209d7d..a212554081012 100644 --- a/src/platform/packages/shared/kbn-babel-register/transforms/index.js +++ b/src/platform/packages/shared/kbn-babel-register/transforms/index.js @@ -12,6 +12,9 @@ const { dotTextTransform } = require('./dot_text'); const { babelTransform } = require('./babel'); module.exports = { + /** + * @type {Record} + */ TRANSFORMS: { '.peggy': peggyTransform, '.text': dotTextTransform, diff --git a/src/platform/packages/shared/kbn-coloring/src/shared_components/coloring/color_ranges/color_ranges.tsx b/src/platform/packages/shared/kbn-coloring/src/shared_components/coloring/color_ranges/color_ranges.tsx index 8577b8cfa2007..e46104a5a8fcc 100644 --- a/src/platform/packages/shared/kbn-coloring/src/shared_components/coloring/color_ranges/color_ranges.tsx +++ b/src/platform/packages/shared/kbn-coloring/src/shared_components/coloring/color_ranges/color_ranges.tsx @@ -55,6 +55,7 @@ export function ColorRanges({ gutterSize="s" > {colorRanges.map((colorRange, index) => ( + // @ts-expect-error upgrade typescript v5.9.3 { const value = record.flattened[field]; - return Array.isArray(value) ? value[0] : value; + return Array.isArray(value) ? value[0] : (value as TRecord['flattened'][TField]); }; diff --git a/src/platform/packages/shared/kbn-es-mappings/src/type.test.ts b/src/platform/packages/shared/kbn-es-mappings/src/type.test.ts index a173985543353..0e0eb0b51417b 100644 --- a/src/platform/packages/shared/kbn-es-mappings/src/type.test.ts +++ b/src/platform/packages/shared/kbn-es-mappings/src/type.test.ts @@ -117,7 +117,9 @@ describe('Type checking with TypeScript compiler', () => { ], }, Object { - "errorMessage": "Type 'Error & \\"The following keys are missing from the document fields: createdAt\\"' is not assignable to type 'MissingKeysError<\\"definedButNotInDocOne\\" | \\"definedButNotInDocTwo\\">'.", + "errorMessage": "Type 'Error & \\"The following keys are missing from the document fields: createdAt\\"' is not assignable to type 'MissingKeysError<\\"definedButNotInDocOne\\" | \\"definedButNotInDocTwo\\">'. + Type 'Error & \\"The following keys are missing from the document fields: createdAt\\"' is not assignable to type 'Error & \\"The following keys are missing from the document fields: definedButNotInDocTwo\\"'. + Type 'Error & \\"The following keys are missing from the document fields: createdAt\\"' is not assignable to type '\\"The following keys are missing from the document fields: definedButNotInDocTwo\\"'.", "lineNumber": 113, "tsErrorLine": Array [ "Type Error Explanation: createdAt is in the definition, this checks that an error is not thrown for defined keys", @@ -125,7 +127,9 @@ describe('Type checking with TypeScript compiler', () => { ], }, Object { - "errorMessage": "Type 'Error & \\"The following keys are missing from the document fields: Unknown Key\\"' is not assignable to type 'MissingKeysError<\\"definedButNotInDocOne\\" | \\"definedButNotInDocTwo\\">'.", + "errorMessage": "Type 'Error & \\"The following keys are missing from the document fields: Unknown Key\\"' is not assignable to type 'MissingKeysError<\\"definedButNotInDocOne\\" | \\"definedButNotInDocTwo\\">'. + Type 'Error & \\"The following keys are missing from the document fields: Unknown Key\\"' is not assignable to type 'Error & \\"The following keys are missing from the document fields: definedButNotInDocTwo\\"'. + Type 'Error & \\"The following keys are missing from the document fields: Unknown Key\\"' is not assignable to type '\\"The following keys are missing from the document fields: definedButNotInDocTwo\\"'.", "lineNumber": 115, "tsErrorLine": Array [ "Type Error Explanation: Unknown Key is not in the definition, this checks that an error is thrown for the unknown key", diff --git a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/resources_helpers.ts b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/resources_helpers.ts index 5ec1717b31ee0..eebe1f26f3db7 100644 --- a/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/resources_helpers.ts +++ b/src/platform/packages/shared/kbn-esql-validation-autocomplete/src/shared/resources_helpers.ts @@ -61,6 +61,7 @@ export class QueryColumns { // Remove oldest entry if cache is full while (QueryColumns.cache.size >= QueryColumns.MAX_CACHE_SIZE) { const oldestKey = QueryColumns.cache.keys().next().value; + // @ts-expect-error upgrade typescript v5.9.3 QueryColumns.cache.delete(oldestKey); } diff --git a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/config_builder.ts b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/config_builder.ts index e335076064aee..b3ce382f8df2a 100644 --- a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/config_builder.ts +++ b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/config_builder.ts @@ -204,6 +204,7 @@ export class LensConfigBuilder { throw new Error(`No API converter found for chart type: ${visType} as ${type}`); } const converter = this.apiConvertersByChart[type as keyof typeof this.apiConvertersByChart]; + // @ts-expect-error upgrade typescript v5.9.3 return { ...converter.fromLensStateToAPI(config), ...filtersAndQueryToApiFormat(config), diff --git a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/schema/index.ts b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/schema/index.ts index 087e645b313d7..99b7737b1c882 100644 --- a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/schema/index.ts +++ b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/schema/index.ts @@ -7,11 +7,15 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import type { TypeOf } from '@kbn/config-schema'; +import type { Type } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; +import type { MetricState } from './charts/metric'; import { metricStateSchema } from './charts/metric'; +import type { LegacyMetricState } from './charts/legacy_metric'; import { legacyMetricStateSchema } from './charts/legacy_metric'; +import type { GaugeState } from './charts/gauge'; import { gaugeStateSchema } from './charts/gauge'; +import type { TagcloudState } from './charts/tagcloud'; import { tagcloudStateSchema } from './charts/tagcloud'; import type { LensApiAllMetricOrFormulaOperations, @@ -20,7 +24,15 @@ import type { import type { LensApiBucketOperations } from './bucket_ops'; import { xyStateSchema } from './charts/xy'; -export const lensApiStateSchema = schema.oneOf([ +/** + * We need to break the type inference here to avoid exceeding the ts compiler serialization limit. + * + * This requires: + * - Casting the schema as any + * - Defining the `LensApiState` type from the schema types + * - Exporting this value as `Type` + */ +export const _lensApiStateSchema: any = schema.oneOf([ metricStateSchema, legacyMetricStateSchema, xyStateSchema, @@ -28,7 +40,9 @@ export const lensApiStateSchema = schema.oneOf([ tagcloudStateSchema, ]); -export type LensApiState = TypeOf; +export type LensApiState = MetricState | LegacyMetricState | GaugeState | TagcloudState; + +export const lensApiStateSchema: Type = _lensApiStateSchema; export type { MetricState, metricStateSchemaNoESQL } from './charts/metric'; export type { LegacyMetricState, legacyMetricStateSchemaNoESQL } from './charts/legacy_metric'; diff --git a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/tests/xy/xy.test.ts b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/tests/xy/xy.test.ts index 042082928a666..0c5aa86499396 100644 --- a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/tests/xy/xy.test.ts +++ b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/tests/xy/xy.test.ts @@ -123,6 +123,7 @@ describe('XY', () => { it.each(universalTypes)('should work for for a minimal %s', (type) => { validateAPIConverter( { + // @ts-expect-error upgrade typescript v5.9.3 type: 'xy', title: `${type} Chart`, layers: [ @@ -142,6 +143,7 @@ describe('XY', () => { it.each(anyType)('should work for ES|QL mode for a minimal %s chart with breakdown', (type) => { validateAPIConverter( { + // @ts-expect-error upgrade typescript v5.9.3 type: 'xy', title: `${type} Chart`, layers: [ @@ -169,6 +171,7 @@ describe('XY', () => { (type1, type2) => { validateAPIConverter( { + // @ts-expect-error upgrade typescript v5.9.3 type: 'xy', title: `Mixed Chart`, layers: [ diff --git a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/charts/xy.ts b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/charts/xy.ts index 7f6e044e6b23b..8df1be9c0e631 100644 --- a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/charts/xy.ts +++ b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/charts/xy.ts @@ -28,6 +28,7 @@ type XYLensWithoutQueryAndFilters = Omit & { state: XYLensState export function fromAPItoLensState(config: XYState): XYLensWithoutQueryAndFilters { // convert layers and produce references from them const { layers, usedDataviews } = buildDatasourceStates( + // @ts-expect-error upgrade typescript v5.9.3 config, buildFormBasedXYLayer, getValueColumns diff --git a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/utils.ts b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/utils.ts index fffa404a6e2f9..aec618d0dbc93 100644 --- a/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/utils.ts +++ b/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/utils.ts @@ -365,7 +365,9 @@ export const buildDatasourceStates = ( > = {}; // a few charts types support multiple layers const configLayers = 'layers' in config ? config.layers : [config]; + // @ts-expect-error upgrade typescript v5.9.3 for (let i = 0; i < configLayers.length; i++) { + // @ts-expect-error upgrade typescript v5.9.3 const layer = configLayers[i]; const layerId = `${layer.type ?? 'layer'}_${i}`; const dataset = 'dataset' in layer ? layer.dataset : mainDataset; diff --git a/src/platform/packages/shared/kbn-management/settings/utilities/setting/normalize_settings.ts b/src/platform/packages/shared/kbn-management/settings/utilities/setting/normalize_settings.ts index d3d65f2bd71c1..e565727b38e92 100644 --- a/src/platform/packages/shared/kbn-management/settings/utilities/setting/normalize_settings.ts +++ b/src/platform/packages/shared/kbn-management/settings/utilities/setting/normalize_settings.ts @@ -85,7 +85,7 @@ const deriveValue = (type: SettingType, value: unknown): Value => { case 'boolean': return Boolean(value); case 'array': - return Array.isArray(value) ? value : [value]; + return (Array.isArray(value) ? value : [value]) as Value; default: return value as string; } diff --git a/src/platform/packages/shared/kbn-object-utils/src/calculate_object_diff.ts b/src/platform/packages/shared/kbn-object-utils/src/calculate_object_diff.ts index 1e32b2dacf8d4..9d4bc9afaa644 100644 --- a/src/platform/packages/shared/kbn-object-utils/src/calculate_object_diff.ts +++ b/src/platform/packages/shared/kbn-object-utils/src/calculate_object_diff.ts @@ -75,7 +75,9 @@ export function calculateObjectDiff( removedMap[key] = []; updatedMap[key] = []; diffRecursive( + // @ts-expect-error upgrade typescript v5.9.3 base[key] as Obj, + // @ts-expect-error upgrade typescript v5.9.3 compare[key] as Obj, addedMap[key] as Obj, removedMap[key] as Obj, diff --git a/src/platform/packages/shared/kbn-test/src/jest/resolver.js b/src/platform/packages/shared/kbn-test/src/jest/resolver.js index 7324b31aba019..42acf38d2fe39 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/resolver.js +++ b/src/platform/packages/shared/kbn-test/src/jest/resolver.js @@ -85,7 +85,7 @@ module.exports = (request, options) => { } if (request.startsWith('zod/v4/')) { - return resolve.sync(`${request}/index.cjs`, { + return resolve.sync(`zod/v4/index.cjs`, { basedir: options.basedir, extensions: options.extensions, }); diff --git a/src/platform/packages/shared/kbn-unified-histogram/__mocks__/data_view.ts b/src/platform/packages/shared/kbn-unified-histogram/__mocks__/data_view.ts index 14fb0cd7a3d5a..74a5c6a54de8c 100644 --- a/src/platform/packages/shared/kbn-unified-histogram/__mocks__/data_view.ts +++ b/src/platform/packages/shared/kbn-unified-histogram/__mocks__/data_view.ts @@ -110,7 +110,7 @@ export const buildDataViewMock = ({ toMinimalSpec: () => ({}), } as unknown as DataView; - dataView.isTimeBased = () => !!timeFieldName; + dataView.isTimeBased = (() => !!timeFieldName) as DataView['isTimeBased']; return dataView; }; diff --git a/src/platform/packages/shared/kbn-workflows-ui/src/components/workflow_selector/workflow_selector.tsx b/src/platform/packages/shared/kbn-workflows-ui/src/components/workflow_selector/workflow_selector.tsx index 163d8eec0d9ef..a4e5c1ec045bc 100644 --- a/src/platform/packages/shared/kbn-workflows-ui/src/components/workflow_selector/workflow_selector.tsx +++ b/src/platform/packages/shared/kbn-workflows-ui/src/components/workflow_selector/workflow_selector.tsx @@ -136,6 +136,7 @@ const WorkflowSelector: React.FC = ({ }; const content = ( + // @ts-expect-error upgrade typescript v5.9.3 <> <> {getPrependContent(option)} diff --git a/src/platform/packages/shared/presentation/presentation_containers/interfaces/presentation_container.ts b/src/platform/packages/shared/presentation/presentation_containers/interfaces/presentation_container.ts index 2898b4c69a2a2..6a75bbdade12b 100644 --- a/src/platform/packages/shared/presentation/presentation_containers/interfaces/presentation_container.ts +++ b/src/platform/packages/shared/presentation/presentation_containers/interfaces/presentation_container.ts @@ -131,6 +131,7 @@ export const combineCompatibleChildrenApis = > = []; for (const child of Object.values(children)) { if (isCompatible(child) && isObservable(child[observableKey])) + // @ts-expect-error upgrade typescript v5.9.3 compatibleChildren.push(child[observableKey] as BehaviorSubject); } diff --git a/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.test.tsx b/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.test.tsx index 533e3930bfa1f..92682533cbf51 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.test.tsx +++ b/src/platform/packages/shared/response-ops/alerts-table/reducers/bulk_actions_reducer.test.tsx @@ -166,6 +166,7 @@ describe('AlertsDataGrid bulk actions', () => { return ( + {/* @ts-expect-error upgrade typescript v5.9.3 */} diff --git a/src/platform/packages/shared/response-ops/rule_form/src/rule_actions/rule_actions_settings.tsx b/src/platform/packages/shared/response-ops/rule_form/src/rule_actions/rule_actions_settings.tsx index c92db738cd56e..fce76c75409ef 100644 --- a/src/platform/packages/shared/response-ops/rule_form/src/rule_actions/rule_actions_settings.tsx +++ b/src/platform/packages/shared/response-ops/rule_form/src/rule_actions/rule_actions_settings.tsx @@ -172,6 +172,7 @@ export const RuleActionsSettings = (props: RuleActionsSettingsProps) => { ? getDurationUnitValue(action.frequency?.throttle) : 'h'; + // @ts-expect-error upgrade typescript v5.9.3 const [minimumActionThrottle = -1, minimumActionThrottleUnit] = [ intervalNumber, intervalUnit, diff --git a/src/platform/packages/shared/shared-ux/file/mocks/tsconfig.json b/src/platform/packages/shared/shared-ux/file/mocks/tsconfig.json index a22283d32cd44..b5f5e96abb68d 100644 --- a/src/platform/packages/shared/shared-ux/file/mocks/tsconfig.json +++ b/src/platform/packages/shared/shared-ux/file/mocks/tsconfig.json @@ -2,7 +2,6 @@ "extends": "@kbn/tsconfig-base/tsconfig.json", "compilerOptions": { "outDir": "target/types", - "types": [ ] }, "include": [ "**/*.ts", diff --git a/src/platform/plugins/private/kibana_overview/public/components/add_data/add_data.tsx b/src/platform/plugins/private/kibana_overview/public/components/add_data/add_data.tsx index 2ec4c210c92d5..7dc725585cec4 100644 --- a/src/platform/plugins/private/kibana_overview/public/components/add_data/add_data.tsx +++ b/src/platform/plugins/private/kibana_overview/public/components/add_data/add_data.tsx @@ -77,6 +77,7 @@ export const AddData: FC = ({ addBasePath, features }) => { AddData.propTypes = { addBasePath: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 features: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.string.isRequired, diff --git a/src/platform/plugins/private/kibana_overview/public/components/manage_data/manage_data.tsx b/src/platform/plugins/private/kibana_overview/public/components/manage_data/manage_data.tsx index e6d717e3ba58e..084e232d75464 100644 --- a/src/platform/plugins/private/kibana_overview/public/components/manage_data/manage_data.tsx +++ b/src/platform/plugins/private/kibana_overview/public/components/manage_data/manage_data.tsx @@ -87,6 +87,7 @@ export const ManageData: FC = ({ addBasePath, features }) => { }; ManageData.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 features: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.string.isRequired, diff --git a/src/platform/plugins/private/vis_default_editor/public/components/controls/time_interval.tsx b/src/platform/plugins/private/vis_default_editor/public/components/controls/time_interval.tsx index b6760e6f98c5b..c52aa7538479c 100644 --- a/src/platform/plugins/private/vis_default_editor/public/components/controls/time_interval.tsx +++ b/src/platform/plugins/private/vis_default_editor/public/components/controls/time_interval.tsx @@ -140,6 +140,7 @@ function TimeIntervalParamEditor({ ) : null; const helpText = ( + // @ts-expect-error upgrade typescript v5.9.3 <> {scaledHelpText} {get(editorConfig, 'interval.help') || selectOptionHelpText} diff --git a/src/platform/plugins/private/vis_types/vega/public/vega_request_handler.ts b/src/platform/plugins/private/vis_types/vega/public/vega_request_handler.ts index afd6aa8489b4b..7823f98907932 100644 --- a/src/platform/plugins/private/vis_types/vega/public/vega_request_handler.ts +++ b/src/platform/plugins/private/vis_types/vega/public/vega_request_handler.ts @@ -77,6 +77,7 @@ export function createVegaRequestHandler( let dataView: DataView; const firstFilterIndex = filters[0]?.meta.index; if (firstFilterIndex) { + // @ts-expect-error upgrade typescript v5.9.3 dataView = await dataViews.get(firstFilterIndex).catch(() => undefined); } diff --git a/src/platform/plugins/shared/charts/public/static/components/endzones.tsx b/src/platform/plugins/shared/charts/public/static/components/endzones.tsx index 605be25123f9d..e8a0af53ef94b 100644 --- a/src/platform/plugins/shared/charts/public/static/components/endzones.tsx +++ b/src/platform/plugins/shared/charts/public/static/components/endzones.tsx @@ -194,5 +194,6 @@ export const renderEndzoneTooltip = ); } + // @ts-expect-error upgrade typescript v5.9.3 return renderValue ? formattedValue : null; }; diff --git a/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.test.ts b/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.test.ts index 44f0c26b83e89..3ff5c16e211df 100644 --- a/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.test.ts +++ b/src/platform/plugins/shared/data/public/now_provider/lib/get_force_now_from_url.test.ts @@ -10,6 +10,7 @@ import { getForceNowFromUrl } from './get_force_now_from_url'; const originalLocation = window.location; afterAll(() => { + // @ts-ignore window.location = originalLocation; }); diff --git a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.tsx b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.tsx index 2ca5f5388fd71..8a0d496dc6167 100644 --- a/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.tsx +++ b/src/platform/plugins/shared/data/public/utils/table_inspector_view/components/data_table.tsx @@ -59,7 +59,7 @@ class DataTableFormatClass extends Component< DataTableFormatProps & EuiTablePersistInjectedProps, DataTableFormatState > { - static propTypes = { + static propTypes: Record> = { data: PropTypes.object.isRequired, uiSettings: PropTypes.object.isRequired, fieldFormats: PropTypes.object.isRequired, diff --git a/src/platform/plugins/shared/data_view_management/public/components/field_editor/field_editor.tsx b/src/platform/plugins/shared/data_view_management/public/components/field_editor/field_editor.tsx index b204e9dccaa9e..cfdf5b3491402 100644 --- a/src/platform/plugins/shared/data_view_management/public/components/field_editor/field_editor.tsx +++ b/src/platform/plugins/shared/data_view_management/public/components/field_editor/field_editor.tsx @@ -831,7 +831,6 @@ export class FieldEditor extends PureComponent { - if (oldField) { - indexPattern.fields.update(oldField); - } else { - indexPattern.fields.remove(field); - } + indexPattern.fields.remove(field); }); }; diff --git a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_all.test.ts b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_all.test.ts index 9301102dd7cad..254c1f2df561d 100644 --- a/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_all.test.ts +++ b/src/platform/plugins/shared/discover/public/application/main/data_fetching/fetch_all.test.ts @@ -29,6 +29,7 @@ import { dataViewMock, esHitsMockWithSort } from '@kbn/discover-utils/src/__mock import { searchResponseIncompleteWarningLocalCluster } from '@kbn/search-response-warnings/src/__mocks__/search_response_warnings'; import { getDiscoverStateMock } from '../../../__mocks__/discover_state.mock'; import { internalStateActions, selectTabRuntimeState } from '../state_management/redux'; +import type { DataView } from '@kbn/data-views-plugin/common'; jest.mock('./fetch_documents', () => ({ fetchDocuments: jest.fn().mockResolvedValue([]), @@ -134,7 +135,7 @@ describe('test fetchAll', () => { { _id: '1', _index: 'logs' }, { _id: '2', _index: 'logs' }, ]; - searchSource.getField('index')!.isTimeBased = () => false; + searchSource.getField('index')!.isTimeBased = (() => false) as DataView['isTimeBased']; const documents = hits.map((hit) => buildDataTableRecord(hit, dataViewMock)); mockFetchDocuments.mockResolvedValue({ records: documents }); @@ -158,7 +159,7 @@ describe('test fetchAll', () => { test('should use charts query to fetch total hit count when chart is visible', async () => { const collect = subjectCollector(subjects.totalHits$); - searchSource.getField('index')!.isTimeBased = () => true; + searchSource.getField('index')!.isTimeBased = (() => true) as DataView['isTimeBased']; subjects.totalHits$.next({ fetchStatus: FetchStatus.LOADING, }); @@ -180,7 +181,7 @@ describe('test fetchAll', () => { test('should only fail totalHits$ query not main$ for error from that query', async () => { const collectTotalHits = subjectCollector(subjects.totalHits$); const collectMain = subjectCollector(subjects.main$); - searchSource.getField('index')!.isTimeBased = () => false; + searchSource.getField('index')!.isTimeBased = (() => false) as DataView['isTimeBased']; const hits = [{ _id: '1', _index: 'logs' }]; const documents = hits.map((hit) => buildDataTableRecord(hit, dataViewMock)); mockFetchDocuments.mockResolvedValue({ records: documents }); @@ -214,7 +215,7 @@ describe('test fetchAll', () => { test('should not set COMPLETE if an ERROR has been set on main$', async () => { const collectMain = subjectCollector(subjects.main$); - searchSource.getField('index')!.isTimeBased = () => false; + searchSource.getField('index')!.isTimeBased = (() => false) as DataView['isTimeBased']; mockFetchDocuments.mockRejectedValue({ msg: 'This query failed' }); subjects.totalHits$.next({ fetchStatus: FetchStatus.LOADING, diff --git a/src/platform/plugins/shared/discover/public/application/main/state_management/discover_app_state.test.ts b/src/platform/plugins/shared/discover/public/application/main/state_management/discover_app_state.test.ts index a351e389e3d06..3c507feefe40e 100644 --- a/src/platform/plugins/shared/discover/public/application/main/state_management/discover_app_state.test.ts +++ b/src/platform/plugins/shared/discover/public/application/main/state_management/discover_app_state.test.ts @@ -10,7 +10,6 @@ import { createSearchSourceMock } from '@kbn/data-plugin/public/mocks'; import type { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; import { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; -import type { History } from 'history'; import { discoverServiceMock } from '../../../__mocks__/services'; import { isEqualState } from './utils/state_comparators'; import { VIEW_MODE } from '@kbn/saved-search-plugin/common'; @@ -28,7 +27,6 @@ import { createTabsStorageManager, type TabsStorageManager } from './tabs_storag import { DiscoverSearchSessionManager } from './discover_search_session'; import { getDiscoverStateContainer } from './discover_state'; -let history: History; let stateStorage: IKbnUrlStateStorage; let internalState: InternalStateStore; let tabsStorageManager: TabsStorageManager; @@ -40,7 +38,6 @@ describe('Test discover app state', () => { const toasts = discoverServiceMock.core.notifications.toasts; stateStorage = createKbnUrlStateStorage({ useHash: storeInSessionStorage, - history, ...toasts, }); tabsStorageManager = createTabsStorageManager({ diff --git a/src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_document_profile/document_profile/profile.ts b/src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_document_profile/document_profile/profile.ts index 37fa7653da74a..4d0def337d945 100644 --- a/src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_document_profile/document_profile/profile.ts +++ b/src/platform/plugins/shared/discover/public/context_awareness/profile_providers/observability/traces_document_profile/document_profile/profile.ts @@ -75,5 +75,5 @@ const getFieldValues = ( field: TField & keyof TRecord['flattened'] ): TRecord['flattened'][TField][] => { const value = record.flattened[field]; - return Array.isArray(value) ? value : [value]; + return (Array.isArray(value) ? value : [value]) as TRecord['flattened'][TField][]; }; diff --git a/src/platform/plugins/shared/expressions/common/execution/execution.ts b/src/platform/plugins/shared/expressions/common/execution/execution.ts index 1466a0e191732..67bcc37986ab5 100644 --- a/src/platform/plugins/shared/expressions/common/execution/execution.ts +++ b/src/platform/plugins/shared/expressions/common/execution/execution.ts @@ -526,6 +526,7 @@ export class Execution< if (completionFlag && hash) { const sideEffectResult = this.#getSideEffectFn(fn, args); while (this.functionCache.size >= maxCacheSize) { + // @ts-expect-error upgrade typescript v5.9.3 this.functionCache.delete(this.functionCache.keys().next().value); } this.functionCache.set(hash, { diff --git a/src/platform/plugins/shared/expressions/common/executor/executor.test.ts b/src/platform/plugins/shared/expressions/common/executor/executor.test.ts index cffb496f4e834..cbd070e2595f8 100644 --- a/src/platform/plugins/shared/expressions/common/executor/executor.test.ts +++ b/src/platform/plugins/shared/expressions/common/executor/executor.test.ts @@ -336,6 +336,7 @@ describe('Executor', () => { await executor.run('theme size default=12', null, { allowCache: true }).toPromise(); expect(functionCache.size).toEqual(1); const entry = functionCache.keys().next().value; + // @ts-expect-error upgrade typescript v5.9.3 functionCache.set(entry, fakeCacheEntry); const result = await executor .run('theme size default=12', null, { allowCache: true }) @@ -348,6 +349,7 @@ describe('Executor', () => { await executor.run('theme size default=12', null, { allowCache: true }).toPromise(); expect(functionCache.size).toEqual(1); const entry = functionCache.keys().next().value; + // @ts-expect-error upgrade typescript v5.9.3 functionCache.set(entry, fakeCacheEntry); const result = await executor .run('theme size default=12', null, { allowCache: false }) diff --git a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.test.ts b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.test.ts index 0211acdd2cd72..2a88f3f4fffd3 100644 --- a/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.test.ts +++ b/src/platform/plugins/shared/expressions/public/react_expression_renderer/use_expression_renderer.test.ts @@ -40,6 +40,7 @@ describe('useExpressionRenderer', () => { } as unknown as typeof expressionLoader; expressionLoaderSpy.mockImplementation(() => expressionLoader); + // @ts-expect-error upgrade typescript v5.9.3 hook = renderHook( (params: ExpressionRendererParams) => useExpressionRenderer(nodeRef, params), { initialProps: { expression: 'something' } } diff --git a/src/platform/plugins/shared/navigation/public/top_nav_menu/top_nav_menu.test.tsx b/src/platform/plugins/shared/navigation/public/top_nav_menu/top_nav_menu.test.tsx index e0667a2251059..9c0912a4797b8 100644 --- a/src/platform/plugins/shared/navigation/public/top_nav_menu/top_nav_menu.test.tsx +++ b/src/platform/plugins/shared/navigation/public/top_nav_menu/top_nav_menu.test.tsx @@ -134,12 +134,14 @@ describe('TopNavMenu', () => { const refresh = () => { new Promise(async (resolve, reject) => { try { + // @ts-expect-error upgrade typescript v5.9.3 if (dom) { act(() => { dom.update(); }); } + // @ts-expect-error upgrade typescript v5.9.3 setImmediate(() => resolve(dom)); // flushes any pending promises } catch (error) { reject(error); diff --git a/src/platform/plugins/shared/saved_objects_finder/public/finder/saved_object_finder.tsx b/src/platform/plugins/shared/saved_objects_finder/public/finder/saved_object_finder.tsx index 3a4b3968477fd..57814ddb50a9e 100644 --- a/src/platform/plugins/shared/saved_objects_finder/public/finder/saved_object_finder.tsx +++ b/src/platform/plugins/shared/saved_objects_finder/public/finder/saved_object_finder.tsx @@ -107,7 +107,7 @@ class SavedObjectFinderUiClass extends React.Component< SavedObjectFinderProps & EuiTablePersistInjectedProps, SavedObjectFinderState > { - public static propTypes = { + public static propTypes: Record> = { onChoose: PropTypes.func, noItemsMessage: PropTypes.node, savedObjectMetaData: PropTypes.array.isRequired, diff --git a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.ts b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.ts index 12df992655101..734f77d6cf795 100644 --- a/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.ts +++ b/src/platform/plugins/shared/ui_actions/public/service/ui_actions_execution_service.ts @@ -40,6 +40,7 @@ export class UiActionsExecutionService { }, alwaysShowPopup?: boolean ): Promise { + // @ts-expect-error upgrade typescript v5.9.3 const shouldBatch = !(await action.shouldAutoExecute?.({ ...context, trigger })) ?? false; const task: ExecuteActionTask = { action, diff --git a/src/platform/plugins/shared/unified_search/public/dataview_picker/mocks/dataview.ts b/src/platform/plugins/shared/unified_search/public/dataview_picker/mocks/dataview.ts index 9a3953924b542..850e21fe7a613 100644 --- a/src/platform/plugins/shared/unified_search/public/dataview_picker/mocks/dataview.ts +++ b/src/platform/plugins/shared/unified_search/public/dataview_picker/mocks/dataview.ts @@ -119,6 +119,7 @@ export const buildDataViewMock = ({ }, } as unknown as DataView; + // @ts-expect-error upgrade typescript v5.9.3 dataView.isTimeBased = () => !!timeFieldName; return dataView; diff --git a/src/platform/plugins/shared/vis_types/timeseries/public/application/components/annotation_row.tsx b/src/platform/plugins/shared/vis_types/timeseries/public/application/components/annotation_row.tsx index e49f3f4d9d36d..43cf90198a42e 100644 --- a/src/platform/plugins/shared/vis_types/timeseries/public/application/components/annotation_row.tsx +++ b/src/platform/plugins/shared/vis_types/timeseries/public/application/components/annotation_row.tsx @@ -261,6 +261,7 @@ export const AnnotationRow = ({ /> } > + {/* @ts-expect-error upgrade typescript v5.9.3 */} diff --git a/src/platform/plugins/shared/vis_types/timeseries/server/lib/vis_data/request_processors/annotations/query.test.ts b/src/platform/plugins/shared/vis_types/timeseries/server/lib/vis_data/request_processors/annotations/query.test.ts index f52552ebdea8d..d39a8218df461 100644 --- a/src/platform/plugins/shared/vis_types/timeseries/server/lib/vis_data/request_processors/annotations/query.test.ts +++ b/src/platform/plugins/shared/vis_types/timeseries/server/lib/vis_data/request_processors/annotations/query.test.ts @@ -59,6 +59,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, @@ -82,6 +83,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, @@ -129,6 +131,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, @@ -196,6 +199,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, @@ -250,6 +254,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, @@ -351,6 +356,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, @@ -389,6 +395,7 @@ describe('query', () => { req, panel, annotation, + // @ts-expect-error upgrade typescript v5.9.3 esQueryConfig, annotationIndex, capabilities, diff --git a/src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/autocomplete/context/parse_line_for_completion.ts b/src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/autocomplete/context/parse_line_for_completion.ts index 80e09d6626375..c6d151d90df6f 100644 --- a/src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/autocomplete/context/parse_line_for_completion.ts +++ b/src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/autocomplete/context/parse_line_for_completion.ts @@ -84,6 +84,7 @@ export function parseLineForCompletion(lineUpToCursor: string): LineParseResult matchType: 'timezone', fullKey: timezonePrefix, match: timezoneFieldMatch, + // @ts-expect-error upgrade typescript v5.9.3 valueStartIndex: timezoneFieldMatch.groups?.prefix.length + 1 ?? 0, }; } diff --git a/tsconfig.base.json b/tsconfig.base.json index b65f210eec38f..7257895f02d0f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2465,7 +2465,9 @@ "typings/@opentelemetry/semantic-conventions/incubating" ], "@typescript-eslint/parser": ["typings/@typescript-eslint/parser"], - "@a2a-js/sdk/server": ["typings/@a2a-js-sdk/server"] + "@a2a-js/sdk/server": ["typings/@a2a-js-sdk/server"], + "zod": ["typings/zod/v3"], + "zod/v4": ["typings/zod/v4"] }, // Support .tsx files and transform JSX into calls to React.createElement "jsx": "react", diff --git a/typings/zod/v3.d.ts b/typings/zod/v3.d.ts new file mode 100644 index 0000000000000..4a124c75f87af --- /dev/null +++ b/typings/zod/v3.d.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +declare module 'zod' { + export * from 'zod/v3'; +} diff --git a/typings/zod/v4.d.ts b/typings/zod/v4.d.ts new file mode 100644 index 0000000000000..0e8cd7511e265 --- /dev/null +++ b/typings/zod/v4.d.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +declare module 'zod/v4' { + export * from 'zod/v4/index.d.cts'; +} diff --git a/x-pack/examples/alerting_example/public/components/rule_conditions.tsx b/x-pack/examples/alerting_example/public/components/rule_conditions.tsx index 700c19d7970d0..0a0b71348c4be 100644 --- a/x-pack/examples/alerting_example/public/components/rule_conditions.tsx +++ b/x-pack/examples/alerting_example/public/components/rule_conditions.tsx @@ -91,7 +91,6 @@ export const RuleConditions = ({ > {React.isValidElement(children) ? ( React.cloneElement(React.Children.only(children), { - // @ts-expect-error upgrade typescript v4.9.5 actionGroup, ...otherProps, }) diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx index 8da444a483144..02b8546f90e9c 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx @@ -332,6 +332,7 @@ export function ConversationList({ onClickConversation(event)} /> diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversation.test.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversation.test.tsx index 3c6c88ad8eacd..532a6435d1019 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversation.test.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversation.test.tsx @@ -109,6 +109,7 @@ describe('useConversation', () => { describe('without initial messages and a conversation id', () => { beforeEach(() => { + // @ts-expect-error upgrade typescript v5.9.3 hookResult = renderHook(useConversation, { initialProps: { chatService: mockChatService, @@ -134,6 +135,7 @@ describe('useConversation', () => { describe('with initial messages', () => { beforeEach(() => { + // @ts-expect-error upgrade typescript v5.9.3 hookResult = renderHook(useConversation, { initialProps: { chatService: mockChatService, @@ -184,6 +186,7 @@ describe('useConversation', () => { ], }); + // @ts-expect-error upgrade typescript v5.9.3 hookResult = renderHook(useConversation, { initialProps: { chatService: mockChatService, @@ -232,6 +235,7 @@ describe('useConversation', () => { beforeEach(async () => { mockService.callApi.mockRejectedValueOnce(new Error('failed to load')); + // @ts-expect-error upgrade typescript v5.9.3 hookResult = renderHook(useConversation, { initialProps: { chatService: mockChatService, @@ -303,6 +307,7 @@ describe('useConversation', () => { onConversationUpdate = jest.fn(); + // @ts-expect-error upgrade typescript v5.9.3 hookResult = renderHook(useConversation, { initialProps: { chatService: mockChatService, @@ -442,6 +447,7 @@ describe('useConversation', () => { }); await act(async () => { + // @ts-expect-error upgrade typescript v5.9.3 hookResult = renderHook(useConversation, { initialProps: { chatService: mockChatService, diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx index fcdc2660930ff..4770f0780d127 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx @@ -104,6 +104,7 @@ describe('AssistantOverlay', () => { expect(reportAssistantInvoked).toHaveBeenCalledWith({ invokedBy: 'url' }); // Restore original location + // @ts-expect-error upgrade typescript v5.9.3 window.location = originalLocation; }); }); diff --git a/x-pack/platform/packages/shared/kbn-key-value-metadata-table/src/utils/get_flattened_key_value_pairs.ts b/x-pack/platform/packages/shared/kbn-key-value-metadata-table/src/utils/get_flattened_key_value_pairs.ts index 90d51d100b4da..e8a2e7fc2bf3f 100644 --- a/x-pack/platform/packages/shared/kbn-key-value-metadata-table/src/utils/get_flattened_key_value_pairs.ts +++ b/x-pack/platform/packages/shared/kbn-key-value-metadata-table/src/utils/get_flattened_key_value_pairs.ts @@ -26,12 +26,9 @@ export const getFlattenedKeyValuePairs = ( const childKey = isArrayWithSingleValue ? '' : key; const currentKey = compact([parentKey, childKey]).join('.'); // item[key] can be a primitive (string, number, boolean, null, undefined) or Object or Array - // @ts-expect-error upgrade typescript v5.1.6 if (isObject(item[key])) { - // @ts-expect-error upgrade typescript v5.1.6 return acc.concat(getFlattenedKeyValuePairs(item[key], currentKey)); } else { - // @ts-expect-error upgrade typescript v5.1.6 acc.push({ key: currentKey, value: item[key] }); return acc; } diff --git a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx index 772e39ca87f2b..cfa68b3b33cad 100644 --- a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx +++ b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx @@ -29,6 +29,7 @@ export const SimpleTemplate: FunctionComponent = ({ onValueChange, argVal SimpleTemplate.propTypes = { onValueChange: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 argValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx index 3502e740dee97..b86fdccf107d7 100644 --- a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx +++ b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx @@ -45,10 +45,12 @@ export const DateFormatArgInput: FunctionComponent = ({ ); DateFormatArgInput.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 dateFormats: PropTypes.arrayOf( PropTypes.shape({ value: PropTypes.string, text: PropTypes.string }) ).isRequired, onValueChange: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 argValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]).isRequired, argId: PropTypes.string.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx index 8cef01df084f2..97164e6bd452d 100644 --- a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx +++ b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx @@ -45,10 +45,12 @@ export const NumberFormatArgInput: FunctionComponent = ({ ); NumberFormatArgInput.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 numberFormats: PropTypes.arrayOf( PropTypes.shape({ value: PropTypes.string, text: PropTypes.string }) ).isRequired, onValueChange: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 argValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]).isRequired, argId: PropTypes.string.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx index dc771b33fe408..4bc74ca171845 100644 --- a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx +++ b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/palette/palette.tsx @@ -98,6 +98,7 @@ PaletteArgInput.propTypes = { argId: PropTypes.string, onValueChange: PropTypes.func.isRequired, argValue: PropTypes.any.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 renderError: PropTypes.func, }; diff --git a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/extended_template.tsx b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/extended_template.tsx index 19db50b20006a..08d3bf3a79e2f 100644 --- a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/extended_template.tsx +++ b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/extended_template.tsx @@ -144,6 +144,7 @@ export const ExtendedTemplate: FunctionComponent = ({ onValueChange, argV ExtendedTemplate.propTypes = { onValueChange: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 argValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/simple_template.tsx b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/simple_template.tsx index 2d21eeb2e741b..1922ff8fe1e8f 100644 --- a/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/simple_template.tsx +++ b/x-pack/platform/plugins/private/canvas/canvas_plugin_src/uis/arguments/partition_labels/simple_template.tsx @@ -50,6 +50,7 @@ export const SimpleTemplate: FunctionComponent = ({ onValueChange, argVal SimpleTemplate.propTypes = { onValueChange: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 argValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/arg_form/arg_simple_form.tsx b/x-pack/platform/plugins/private/canvas/public/components/arg_form/arg_simple_form.tsx index acd8dc767917b..be2ba4c1a9644 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/arg_form/arg_simple_form.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/arg_form/arg_simple_form.tsx @@ -67,6 +67,7 @@ export const ArgSimpleForm: React.FunctionComponent = ({ }; ArgSimpleForm.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 children: PropTypes.node, required: PropTypes.bool, valueMissing: PropTypes.bool, diff --git a/x-pack/platform/plugins/private/canvas/public/components/asset_manager/asset_manager.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/asset_manager/asset_manager.component.tsx index 2e035b29c2c56..95bf5a463710b 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/asset_manager/asset_manager.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/asset_manager/asset_manager.component.tsx @@ -175,6 +175,7 @@ export const AssetManager: FC = (props) => { }; AssetManager.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 assets: PropTypes.arrayOf(PropTypes.object).isRequired, onClose: PropTypes.func.isRequired, onAddAsset: PropTypes.func.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/color_dot/color_dot.tsx b/x-pack/platform/plugins/private/canvas/public/components/color_dot/color_dot.tsx index 45d8886109b54..52be44f76add8 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/color_dot/color_dot.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/color_dot/color_dot.tsx @@ -35,6 +35,7 @@ export const ColorDot: FC = ({ value, children }) => { }; ColorDot.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 children: PropTypes.node, value: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/color_picker_popover/color_picker_popover.tsx b/x-pack/platform/plugins/private/canvas/public/components/color_picker_popover/color_picker_popover.tsx index 126c908de721a..d1f4c028308dd 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/color_picker_popover/color_picker_popover.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/color_picker_popover/color_picker_popover.tsx @@ -47,5 +47,6 @@ export const ColorPickerPopover: FC = (props: Props) => { ColorPickerPopover.propTypes = { ...ColorPicker.propTypes, + // @ts-expect-error upgrade typescript v5.9.3 anchorPosition: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/confirm_modal/confirm_modal.tsx b/x-pack/platform/plugins/private/canvas/public/components/confirm_modal/confirm_modal.tsx index 06c1bc84a7e2f..58fcf9a9ba120 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/confirm_modal/confirm_modal.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/confirm_modal/confirm_modal.tsx @@ -62,6 +62,7 @@ export const ConfirmModal: FunctionComponent = (props) => { }; ConfirmModal.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 isOpen: PropTypes.bool, title: PropTypes.string, message: PropTypes.string.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/datatable/datatable.tsx b/x-pack/platform/plugins/private/canvas/public/components/datatable/datatable.tsx index 391d55590e178..2af20672fd6ba 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/datatable/datatable.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/datatable/datatable.tsx @@ -119,6 +119,7 @@ export const Datatable: FC = ({ ); Datatable.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 datatable: PropTypes.object.isRequired, paginate: PropTypes.bool, perPage: PropTypes.number, diff --git a/x-pack/platform/plugins/private/canvas/public/components/download/download.tsx b/x-pack/platform/plugins/private/canvas/public/components/download/download.tsx index 84b5ef69484b2..07d736888150f 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/download/download.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/download/download.tsx @@ -30,6 +30,7 @@ export class Download extends React.PureComponent { const asset = parseDataUrl(content, true); if (asset && asset.data) { + // @ts-expect-error upgrade typescript v5.9.3 const assetBlob = new Blob([toByteArray(asset.data)], { type: asset.mimetype }); const ext = asset.extension ? `.${asset.extension}` : ''; fileSaver.saveAs(assetBlob, `canvas-${fileName}${ext}`); diff --git a/x-pack/platform/plugins/private/canvas/public/components/enhance/error_boundary.tsx b/x-pack/platform/plugins/private/canvas/public/components/enhance/error_boundary.tsx index 2acaafae0f7d5..107af264c0c6e 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/enhance/error_boundary.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/enhance/error_boundary.tsx @@ -30,6 +30,7 @@ const ErrorBoundaryComponent: FC = (props) => { ErrorBoundaryComponent.propTypes = { children: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 error: PropTypes.object, errorInfo: PropTypes.object, resetErrorState: PropTypes.func.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/export_app/export_app.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/export_app/export_app.component.tsx index 096648fdea310..ec9e1d9fa5cc3 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/export_app/export_app.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/export_app/export_app.component.tsx @@ -56,6 +56,7 @@ export const ExportApp: FC = ({ workpad, selectedPageIndex, initializeWor }; ExportApp.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 workpad: PropTypes.shape({ id: PropTypes.string.isRequired, pages: PropTypes.array.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/expression/expression.tsx b/x-pack/platform/plugins/private/canvas/public/components/expression/expression.tsx index 45674c82991e8..f2b3c587c56fe 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/expression/expression.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/expression/expression.tsx @@ -211,10 +211,15 @@ export const Expression: FC = ({ }; Expression.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 functionDefinitions: PropTypes.array, + // @ts-expect-error upgrade typescript v5.9.3 formState: PropTypes.object, + // @ts-expect-error upgrade typescript v5.9.3 updateValue: PropTypes.func, + // @ts-expect-error upgrade typescript v5.9.3 setExpression: PropTypes.func, + // @ts-expect-error upgrade typescript v5.9.3 done: PropTypes.func, error: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/font_picker/font_picker.tsx b/x-pack/platform/plugins/private/canvas/public/components/font_picker/font_picker.tsx index 35ee166f95464..fd906c5bdbe9f 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/font_picker/font_picker.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/font_picker/font_picker.tsx @@ -54,6 +54,7 @@ FontPicker.propTypes = { /** Function to execute when a Font is selected. */ onSelect: PropTypes.func, /** Initial value of the Font Picker. */ + // @ts-expect-error upgrade typescript v5.9.3 value: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/function_form/function_unknown.tsx b/x-pack/platform/plugins/private/canvas/public/components/function_form/function_unknown.tsx index 9678fb65f407a..76d347ff37df7 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/function_form/function_unknown.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/function_form/function_unknown.tsx @@ -32,5 +32,6 @@ export const FunctionUnknown: FunctionComponent = ({ argType }) => ( ); FunctionUnknown.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 argType: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/item_grid/item_grid.tsx b/x-pack/platform/plugins/private/canvas/public/components/item_grid/item_grid.tsx index 2e5fe2570311e..e9b84e3c37f9a 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/item_grid/item_grid.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/item_grid/item_grid.tsx @@ -67,7 +67,9 @@ export const ItemGrid: ItemGridType = function ItemGridFunc({ }; ItemGrid.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 items: PropTypes.array, + // @ts-expect-error upgrade typescript v5.9.3 itemsPerRow: PropTypes.number, children: PropTypes.func.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/alignment_guide.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/alignment_guide.tsx index 289ab2c4cec1f..5ec609fcbb185 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/alignment_guide.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/alignment_guide.tsx @@ -34,6 +34,7 @@ export const AlignmentGuide: FC = ({ transformMatrix, width, height }) => AlignmentGuide.propTypes = { height: PropTypes.number.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, width: PropTypes.number.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_connection.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_connection.tsx index b21c0584fbdd3..daec310078122 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_connection.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_connection.tsx @@ -33,6 +33,7 @@ export const BorderConnection: FC = ({ transformMatrix, width, height }) BorderConnection.propTypes = { height: PropTypes.number.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, width: PropTypes.number.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_resize_handle.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_resize_handle.tsx index aa3fce20d2a0c..e5b780b9efd01 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_resize_handle.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/border_resize_handle.tsx @@ -26,6 +26,7 @@ export const BorderResizeHandle: FC = ({ transformMatrix, zoomScale = 1 } ); BorderResizeHandle.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, zoomScale: PropTypes.number, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/dragbox_annotation.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/dragbox_annotation.tsx index 5a3b0032ee309..c5f018f2a6b88 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/dragbox_annotation.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/dragbox_annotation.tsx @@ -31,6 +31,7 @@ export const DragBoxAnnotation: FC = ({ transformMatrix, width, height }) ); DragBoxAnnotation.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, width: PropTypes.number.isRequired, height: PropTypes.number.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/hover_annotation.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/hover_annotation.tsx index f053f24bcf162..3a07ab274921c 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/hover_annotation.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/hover_annotation.tsx @@ -32,6 +32,7 @@ export const HoverAnnotation: FC = ({ transformMatrix, width, height }) = HoverAnnotation.propTypes = { height: PropTypes.number.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, width: PropTypes.number.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/rotation_handle.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/rotation_handle.tsx index 38d1ae40f6258..f0c5118a4b6e8 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/rotation_handle.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/rotation_handle.tsx @@ -31,6 +31,7 @@ export const RotationHandle: FC = ({ transformMatrix, zoomScale = 1 }) => ); RotationHandle.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, zoomScale: PropTypes.number, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/tooltip_annotation.tsx b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/tooltip_annotation.tsx index 7c5d714a20608..c5c09e8f22a22 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/tooltip_annotation.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/layout_annotations/tooltip_annotation.tsx @@ -28,6 +28,7 @@ export const TooltipAnnotation: FC = ({ transformMatrix, text }) => { }; TooltipAnnotation.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, text: PropTypes.string.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/paginate/index.tsx b/x-pack/platform/plugins/private/canvas/public/components/paginate/index.tsx index c4bcc02be0f1d..16549675d69a7 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/paginate/index.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/paginate/index.tsx @@ -80,6 +80,7 @@ export const Paginate: React.FunctionComponent = ({ Paginate.propTypes = { rows: PropTypes.array.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 perPage: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), startPage: PropTypes.number, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx b/x-pack/platform/plugins/private/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx index 9a4e89f6840ed..22cb987ba0f70 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/palette_picker/palette_picker/palette_picker.tsx @@ -34,7 +34,9 @@ export const PalettePicker: FC = (props) => { PalettePicker.propTypes = { id: PropTypes.string, + // @ts-expect-error upgrade typescript v5.9.3 palette: PropTypes.object, onChange: PropTypes.func, + // @ts-expect-error upgrade typescript v5.9.3 clearable: PropTypes.bool, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/positionable/positionable.tsx b/x-pack/platform/plugins/private/canvas/public/components/positionable/positionable.tsx index 751be2a70e668..6ff4b2673ea23 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/positionable/positionable.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/positionable/positionable.tsx @@ -43,7 +43,9 @@ export const Positionable: FC = ({ children, transformMatrix, width, heig }; Positionable.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 children: PropTypes.element.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 transformMatrix: PropTypes.arrayOf(PropTypes.number).isRequired, width: PropTypes.number.isRequired, height: PropTypes.number.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/shape_picker/shape_picker.tsx b/x-pack/platform/plugins/private/canvas/public/components/shape_picker/shape_picker.tsx index 56b329a5e01dc..74eb7a39154ad 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/shape_picker/shape_picker.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/shape_picker/shape_picker.tsx @@ -31,5 +31,6 @@ export const ShapePicker: FC = ({ shapes, onChange = () => {} }) => ( ShapePicker.propTypes = { onChange: PropTypes.func, + // @ts-expect-error upgrade typescript v5.9.3 shapes: PropTypes.object.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx b/x-pack/platform/plugins/private/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx index 0c37e70c3a06f..635db201a56e4 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx @@ -40,6 +40,8 @@ export const ShapePickerPopover: FC = ({ shapes, onChange, value, ariaLab ShapePickerPopover.propTypes = { ariaLabel: PropTypes.string, onChange: PropTypes.func, + // @ts-expect-error upgrade typescript v5.9.3 shapes: PropTypes.object.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 value: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/sidebar/element_settings/element_settings.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/sidebar/element_settings/element_settings.component.tsx index 112b463be377e..f2962d4d8fcf4 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/sidebar/element_settings/element_settings.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/sidebar/element_settings/element_settings.component.tsx @@ -128,5 +128,6 @@ export const ElementSettings: FunctionComponent = ({ element }) => { }; ElementSettings.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 element: PropTypes.object, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/tag/tag.tsx b/x-pack/platform/plugins/private/canvas/public/components/tag/tag.tsx index f30019ef27442..20ed69af1b433 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/tag/tag.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/tag/tag.tsx @@ -50,5 +50,6 @@ export const Tag: FunctionComponent = ({ Tag.propTypes = { name: PropTypes.string.isRequired, color: PropTypes.string, + // @ts-expect-error upgrade typescript v5.9.3 type: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/text_style_picker/text_style_picker.tsx b/x-pack/platform/plugins/private/canvas/public/components/text_style_picker/text_style_picker.tsx index 977490567c563..2252ba0dd5045 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/text_style_picker/text_style_picker.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/text_style_picker/text_style_picker.tsx @@ -227,6 +227,7 @@ export const TextStylePicker: FC = ({ }; TextStylePicker.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 family: PropTypes.string, size: PropTypes.number, align: PropTypes.oneOf(['left', 'center', 'right']), diff --git a/x-pack/platform/plugins/private/canvas/public/components/toolbar/toolbar.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/toolbar/toolbar.component.tsx index 7faec7b7a6c49..fe35ff7379e25 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/toolbar/toolbar.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/toolbar/toolbar.component.tsx @@ -152,6 +152,7 @@ export const Toolbar: FC = ({ Toolbar.propTypes = { isWriteable: PropTypes.bool.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 selectedElement: PropTypes.object, selectedPageNumber: PropTypes.number.isRequired, totalPages: PropTypes.number.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/tooltip_icon/tooltip_icon.tsx b/x-pack/platform/plugins/private/canvas/public/components/tooltip_icon/tooltip_icon.tsx index 230b9d360c82f..254c2ceb2e56b 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/tooltip_icon/tooltip_icon.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/tooltip_icon/tooltip_icon.tsx @@ -35,5 +35,6 @@ export const TooltipIcon: FC = ({ icon = IconType.info, ...rest }) => { }; TooltipIcon.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 icon: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/workpad_config/workpad_config.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/workpad_config/workpad_config.component.tsx index 0a28c37b2e9e9..c84ccb1f89bad 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/workpad_config/workpad_config.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/workpad_config/workpad_config.component.tsx @@ -223,9 +223,11 @@ export const WorkpadConfig: FC = (props) => { }; WorkpadConfig.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 size: PropTypes.object.isRequired, name: PropTypes.string.isRequired, css: PropTypes.string, + // @ts-expect-error upgrade typescript v5.9.3 variables: PropTypes.array, setSize: PropTypes.func.isRequired, setName: PropTypes.func.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/workpad_header/edit_menu/edit_menu.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/workpad_header/edit_menu/edit_menu.component.tsx index 8942f8c345264..9b5c9d97d0a51 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/workpad_header/edit_menu/edit_menu.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/workpad_header/edit_menu/edit_menu.component.tsx @@ -531,6 +531,7 @@ EditMenu.propTypes = { distributeHorizontally: PropTypes.func.isRequired, distributeVertically: PropTypes.func.isRequired, createCustomElement: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 selectedNodes: PropTypes.arrayOf(PropTypes.object).isRequired, groupIsSelected: PropTypes.bool.isRequired, groupNodes: PropTypes.func.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/components/workpad_header/element_menu/element_menu.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/workpad_header/element_menu/element_menu.component.tsx index a1ec30706f63b..270dcc6851ec8 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/workpad_header/element_menu/element_menu.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/workpad_header/element_menu/element_menu.component.tsx @@ -226,6 +226,7 @@ export const ElementMenu: FunctionComponent = ({ elements, addElement }) }; ElementMenu.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 elements: PropTypes.object, addElement: PropTypes.func.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/workpad_header/workpad_header.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/workpad_header/workpad_header.component.tsx index dc6a96023f506..1dc8fb1d68711 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/workpad_header/workpad_header.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/workpad_header/workpad_header.component.tsx @@ -226,6 +226,7 @@ export const WorkpadHeader: FC = ({ + {/* @ts-expect-error upgrade typescript v5.9.3 */} @@ -240,11 +241,14 @@ export const WorkpadHeader: FC = ({ }; WorkpadHeader.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 isWriteable: PropTypes.bool, commit: PropTypes.func.isRequired, onSetWriteable: PropTypes.func, + // @ts-expect-error upgrade typescript v5.9.3 canUserWrite: PropTypes.bool, renderEmbedPanel: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 elements: PropTypes.object.isRequired, addElement: PropTypes.func.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/components/workpad_shortcuts/index.tsx b/x-pack/platform/plugins/private/canvas/public/components/workpad_shortcuts/index.tsx index 1cfe79c43ad1c..cffd7974461e6 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/workpad_shortcuts/index.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/workpad_shortcuts/index.tsx @@ -28,6 +28,7 @@ export const WorkpadShortcuts = compose = ({ }; AppearanceForm.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 padding: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + // @ts-expect-error upgrade typescript v5.9.3 opacity: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + // @ts-expect-error upgrade typescript v5.9.3 overflow: PropTypes.oneOf(['hidden', 'visible']), onChange: PropTypes.func.isRequired, }; diff --git a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/border_form.tsx b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/border_form.tsx index 852321c5ebfd3..768f6db1025a1 100644 --- a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/border_form.tsx +++ b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/border_form.tsx @@ -128,7 +128,9 @@ export const BorderForm: FunctionComponent = ({ }; BorderForm.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 value: PropTypes.string, + // @ts-expect-error upgrade typescript v5.9.3 radius: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), onChange: PropTypes.func.isRequired, colors: PropTypes.array.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/extended_template.tsx b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/extended_template.tsx index a80b660f0d720..5043bdc7438ac 100644 --- a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/extended_template.tsx +++ b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/extended_template.tsx @@ -67,6 +67,7 @@ ExtendedTemplate.displayName = 'ContainerStyleArgExtendedInput'; ExtendedTemplate.propTypes = { getArgValue: PropTypes.func.isRequired, setArgValue: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 workpad: PropTypes.shape({ colors: PropTypes.array.isRequired, }).isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/simple_template.tsx b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/simple_template.tsx index 374391a072cff..f99823e49251a 100644 --- a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/simple_template.tsx +++ b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/container_style/simple_template.tsx @@ -42,6 +42,7 @@ SimpleTemplate.displayName = 'ContainerStyleArgSimpleInput'; SimpleTemplate.propTypes = { getArgValue: PropTypes.func.isRequired, setArgValue: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 workpad: PropTypes.shape({ colors: PropTypes.array.isRequired, }), diff --git a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/extended_template.tsx b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/extended_template.tsx index 3a374721dfb08..8627dc5179d1b 100644 --- a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/extended_template.tsx +++ b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/extended_template.tsx @@ -145,6 +145,7 @@ ExtendedTemplate.displayName = 'SeriesStyleArgAdvancedInput'; ExtendedTemplate.propTypes = { onValueChange: PropTypes.func.isRequired, argValue: PropTypes.any.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 typeInstance: PropTypes.object, resolved: PropTypes.shape({ labels: PropTypes.array.isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/index.ts b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/index.ts index 2d649443529e6..0ae5bb379b5f0 100644 --- a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/index.ts +++ b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/index.ts @@ -51,6 +51,7 @@ const EnhancedExtendedTemplate = compose( EnhancedExtendedTemplate.propTypes = { argValue: PropTypes.any.isRequired, setLabel: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 label: PropTypes.string, }; diff --git a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/simple_template.tsx b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/simple_template.tsx index 42d9c807916c9..1e5d72b792c69 100644 --- a/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/simple_template.tsx +++ b/x-pack/platform/plugins/private/canvas/public/expression_types/arg_types/series_style/simple_template.tsx @@ -117,6 +117,7 @@ SimpleTemplate.propTypes = { labels: PropTypes.array.isRequired, }).isRequired, onValueChange: PropTypes.func.isRequired, + // @ts-expect-error upgrade typescript v5.9.3 workpad: PropTypes.shape({ colors: PropTypes.array.isRequired, }).isRequired, diff --git a/x-pack/platform/plugins/private/canvas/public/lib/resolve_dataurl.ts b/x-pack/platform/plugins/private/canvas/public/lib/resolve_dataurl.ts index 52bd7e3916c5f..5f6bbbebaab3b 100644 --- a/x-pack/platform/plugins/private/canvas/public/lib/resolve_dataurl.ts +++ b/x-pack/platform/plugins/private/canvas/public/lib/resolve_dataurl.ts @@ -16,6 +16,7 @@ import { missingImage } from './missing_asset'; */ export const resolveFromArgs = (args: any, defaultDataurl: string | null = null): string => { const dataurl = get(args, 'dataurl.0', null); + // @ts-expect-error upgrade typescript v5.9.3 return isValidUrl(dataurl) ? dataurl : defaultDataurl; }; diff --git a/x-pack/platform/plugins/private/canvas/public/lib/template_from_react_component.tsx b/x-pack/platform/plugins/private/canvas/public/lib/template_from_react_component.tsx index 395b824864a62..c23a31a764411 100644 --- a/x-pack/platform/plugins/private/canvas/public/lib/template_from_react_component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/lib/template_from_react_component.tsx @@ -48,6 +48,7 @@ export const templateFromReactComponent = (Component: ComponentType) => { const ForwardRefWrappedComponent = forwardRef(WrappedComponent); ForwardRefWrappedComponent.propTypes = { + // @ts-expect-error upgrade typescript v5.9.3 renderError: PropTypes.func, }; diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js index 0c3f6deab2a04..73721c4be7c1f 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js @@ -10,6 +10,10 @@ import { AutoFollowPatternAdd } from '../../../app/sections/auto_follow_pattern_ import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { return renderWithRouter(AutoFollowPatternAdd, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js index 3bec28714610c..eaaa95c2c0078 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js @@ -11,6 +11,10 @@ import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; import { AUTO_FOLLOW_PATTERN_EDIT_NAME } from './constants'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { return renderWithRouter(AutoFollowPatternEdit, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js index 2b269af8be4c2..0f3e46a6f9549 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js @@ -12,6 +12,10 @@ import { AutoFollowPatternList } from '../../../app/sections/home/auto_follow_pa import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { const result = renderWithRouter(AutoFollowPatternList, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js index d2266ff4be13a..90f936cf9dc6b 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js @@ -10,6 +10,10 @@ import { FollowerIndexAdd } from '../../../app/sections/follower_index_add'; import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { return renderWithRouter(FollowerIndexAdd, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js index 2870f40c99b1e..6e4e749286e2f 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js @@ -11,6 +11,10 @@ import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; import { FOLLOWER_INDEX_EDIT_NAME } from './constants'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { return renderWithRouter(FollowerIndexEdit, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js index 512e61569a2b3..c3855787b3b7a 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js @@ -12,6 +12,10 @@ import { FollowerIndicesList } from '../../../app/sections/home/follower_indices import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { const result = renderWithRouter(FollowerIndicesList, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js index a469722be0b9c..2338668cf11b9 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js @@ -10,6 +10,10 @@ import { CrossClusterReplicationHome } from '../../../app/sections/home'; import { createCrossClusterReplicationStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; +/** + * @param {object} [props] + * @returns {ReturnType} + */ export const setup = (props = {}) => { return renderWithRouter(CrossClusterReplicationHome, { store: createCrossClusterReplicationStore(), diff --git a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/render.js b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/render.js index 880b0b6e41474..2642e86237e65 100644 --- a/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/render.js +++ b/x-pack/platform/plugins/private/cross_cluster_replication/public/__jest__/client_integration/helpers/render.js @@ -23,6 +23,9 @@ import { MemoryRouter, Routes, Route } from '@kbn/shared-ux-router'; * routePath: '/follower_indices/edit/:id', * }); */ +/** + * @returns {import('@testing-library/react').RenderResult & { user: import('@testing-library/user-event').UserEvent }} + */ export const renderWithRouter = ( Component, { store, onRouter, initialEntries = ['/'], routePath = '/', defaultProps = {}, ...props } = {} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts index 2b93f7a56eb92..74d5a450069ea 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts @@ -280,9 +280,12 @@ export function useFieldStatsSearchStrategy( if ( Array.isArray(f) && f.length === 1 && + // @ts-expect-error upgrade typescript v5.9.3 Array.isArray(f[0].fields) && + // @ts-expect-error upgrade typescript v5.9.3 f[0].fields.length > 0 ) { + // @ts-expect-error upgrade typescript v5.9.3 statsMap.set(f[0].fields[0], f[0]); } }); diff --git a/x-pack/platform/plugins/private/file_upload/server/analyze_file.tsx b/x-pack/platform/plugins/private/file_upload/server/analyze_file.tsx index 84474c6164c17..ff02bc1bc5225 100644 --- a/x-pack/platform/plugins/private/file_upload/server/analyze_file.tsx +++ b/x-pack/platform/plugins/private/file_upload/server/analyze_file.tsx @@ -54,8 +54,8 @@ export async function analyzeFile( const pipeline = cloneDeep(results.ingest_pipeline); updatePipelineTimezone(pipeline); const reader = getReader(results); - const arrayBuffer = new Uint8Array(Buffer.from(data)); - const docs = reader.read(arrayBuffer).slice(0, PREVIEW_DOC_LIMIT); + const buffer = Buffer.from(data); + const docs = reader.read(buffer.buffer).slice(0, PREVIEW_DOC_LIMIT); if (results.format === FILE_FORMATS.NDJSON) { previewDocs = { docs: docs.map((doc: any) => ({ diff --git a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.container.js b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.container.js index 95ecce30d27cf..d851cb897e6e3 100644 --- a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.container.js +++ b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.container.js @@ -11,6 +11,7 @@ import { removeClusters } from '../../../../store/actions'; import { RemoveClusterButtonProvider as RemoveClusterButtonProviderComponent } from './remove_cluster_button_provider'; +/** @type {import('react-redux').MapDispatchToProps} */ const mapDispatchToProps = (dispatch) => { return { removeClusters: (names) => { @@ -19,6 +20,9 @@ const mapDispatchToProps = (dispatch) => { }; }; +/** + * @type {import('react-redux').ConnectedComponent} + */ export const RemoveClusterButtonProvider = connect( undefined, mapDispatchToProps diff --git a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.container.js b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.container.js index ced867e4ec648..d8ca663303ea0 100644 --- a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.container.js +++ b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.container.js @@ -17,6 +17,7 @@ import { import { closeDetailPanel } from '../../../store/actions'; +/** @type {import('react-redux').MapStateToProps} */ const mapStateToProps = (state) => { return { isOpen: isDetailPanelOpen(state), @@ -26,6 +27,7 @@ const mapStateToProps = (state) => { }; }; +/** @type {import('react-redux').MapDispatchToProps} */ const mapDispatchToProps = (dispatch) => { return { closeDetailPanel: () => { @@ -34,4 +36,7 @@ const mapDispatchToProps = (dispatch) => { }; }; +/** + * @type {import('react-redux').ConnectedComponent} + */ export const DetailPanel = connect(mapStateToProps, mapDispatchToProps)(DetailPanelView); diff --git a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.container.js b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.container.js index 19a92d0e651fe..88c4c3e37e3d7 100644 --- a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.container.js +++ b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.container.js @@ -25,6 +25,7 @@ import { import { RemoteClusterList as RemoteClusterListView } from './remote_cluster_list'; +/** @type {import('react-redux').MapStateToProps} */ const mapStateToProps = (state) => { return { clusters: getClustersList(state), @@ -36,6 +37,7 @@ const mapStateToProps = (state) => { }; }; +/** @type {import('react-redux').MapDispatchToProps} */ const mapDispatchToProps = (dispatch) => { return { loadClusters: () => { @@ -53,6 +55,9 @@ const mapDispatchToProps = (dispatch) => { }; }; +/** + * @type {import('react-redux').ConnectedComponent} + */ export const RemoteClusterList = connect( mapStateToProps, mapDispatchToProps diff --git a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.container.js b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.container.js index b02daa5892c1e..0aa77ceec4dd4 100644 --- a/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.container.js +++ b/x-pack/platform/plugins/private/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.container.js @@ -11,6 +11,7 @@ import { openDetailPanel } from '../../../store/actions'; import { RemoteClusterTable as RemoteClusterTableComponent } from './remote_cluster_table'; +/** @type {import('react-redux').MapDispatchToProps} */ const mapDispatchToProps = (dispatch) => { return { openDetailPanel: (clusterName) => { @@ -19,6 +20,9 @@ const mapDispatchToProps = (dispatch) => { }; }; +/** + * @type {import('react-redux').ConnectedComponent} + */ export const RemoteClusterTable = connect( undefined, mapDispatchToProps diff --git a/x-pack/platform/plugins/private/watcher/public/application/sections/watch_edit_page/watch_edit_page.tsx b/x-pack/platform/plugins/private/watcher/public/application/sections/watch_edit_page/watch_edit_page.tsx index 55acba5d4b74b..689e8dc8e3b12 100644 --- a/x-pack/platform/plugins/private/watcher/public/application/sections/watch_edit_page/watch_edit_page.tsx +++ b/x-pack/platform/plugins/private/watcher/public/application/sections/watch_edit_page/watch_edit_page.tsx @@ -137,6 +137,7 @@ export const WatchEditPage = ({ if (has(watchTypes, type) && isFunction(watchTypes[type])) { const WatchType = watchTypes[type]; + // @ts-expect-error upgrade typescript v5.9.3 dispatch({ command: 'setWatch', payload: new WatchType() }); } else { dispatch({ command: 'setError', payload: { message: 'Invalid watch type' } }); diff --git a/x-pack/platform/plugins/shared/cases/public/components/app/use_available_owners.ts b/x-pack/platform/plugins/shared/cases/public/components/app/use_available_owners.ts index ecaaafe965dd7..8e1bceaec115d 100644 --- a/x-pack/platform/plugins/shared/cases/public/components/app/use_available_owners.ts +++ b/x-pack/platform/plugins/shared/cases/public/components/app/use_available_owners.ts @@ -28,8 +28,9 @@ export const useAvailableCasesOwners = ( return availableOwners; } for (const cap of capabilities) { - const hasCapability = - !!kibanaCapability[`${cap}_cases`] || !!kibanaCapability[`cases_${cap}`]; + const capCases = `${cap}_cases` as keyof typeof kibanaCapability; + const casesCap = `cases_${cap}` as keyof typeof kibanaCapability; + const hasCapability = !!kibanaCapability[capCases] || !!kibanaCapability[casesCap]; if (!hasCapability) { return availableOwners; } diff --git a/x-pack/platform/plugins/shared/cases/public/components/empty_value/empty_value.test.tsx b/x-pack/platform/plugins/shared/cases/public/components/empty_value/empty_value.test.tsx index 049a8e0d56635..824f03dfd1f86 100644 --- a/x-pack/platform/plugins/shared/cases/public/components/empty_value/empty_value.test.tsx +++ b/x-pack/platform/plugins/shared/cases/public/components/empty_value/empty_value.test.tsx @@ -11,7 +11,6 @@ import { ThemeProvider } from '@emotion/react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { - defaultToEmptyTag, getEmptyString, getEmptyStringTag, getEmptyCellValue, @@ -72,38 +71,6 @@ describe('EmptyValue', () => { }); }); - describe('#defaultToEmptyTag', () => { - test('should default to an empty value when a value is null', () => { - const wrapper = mount( - -

{defaultToEmptyTag(null)}

-
- ); - expect(wrapper.text()).toBe(getEmptyValue()); - }); - - test('should default to an empty value when a value is undefined', () => { - const wrapper = mount( - -

{defaultToEmptyTag(undefined)}

-
- ); - expect(wrapper.text()).toBe(getEmptyValue()); - }); - - test('should return a deep path value', () => { - const test = { - a: { - b: { - c: 1, - }, - }, - }; - const wrapper = mount(

{defaultToEmptyTag(test.a.b.c)}

); - expect(wrapper.text()).toBe('1'); - }); - }); - describe('#getOrEmptyTag', () => { test('should default empty value when a deep rooted value is null', () => { const test = { diff --git a/x-pack/platform/plugins/shared/cases/public/components/empty_value/index.tsx b/x-pack/platform/plugins/shared/cases/public/components/empty_value/index.tsx index 8773174558de3..697dea7401c0d 100644 --- a/x-pack/platform/plugins/shared/cases/public/components/empty_value/index.tsx +++ b/x-pack/platform/plugins/shared/cases/public/components/empty_value/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { get, isString } from 'lodash/fp'; +import { get } from 'lodash/fp'; import React from 'react'; import type { UseEuiTheme } from '@elastic/eui'; @@ -19,16 +19,6 @@ export const getEmptyString = () => `(${i18n.EMPTY_STRING})`; export const getEmptyCellValue = () => {getEmptyValue()}; export const getEmptyStringTag = () => {getEmptyString()}; -export const defaultToEmptyTag = (item: T): JSX.Element => { - if (item == null) { - return getEmptyCellValue(); - } else if (isString(item) && item === '') { - return getEmptyStringTag(); - } else { - return <>{item}; - } -}; - export const getOrEmptyTag = (path: string, item: unknown): JSX.Element => { const text = get(path, item); return getOrEmptyTagFromValue(text); diff --git a/x-pack/platform/plugins/shared/dataset_quality/public/hooks/use_integration_actions.ts b/x-pack/platform/plugins/shared/dataset_quality/public/hooks/use_integration_actions.ts index 49fe65e79b040..0f69356253510 100644 --- a/x-pack/platform/plugins/shared/dataset_quality/public/hooks/use_integration_actions.ts +++ b/x-pack/platform/plugins/shared/dataset_quality/public/hooks/use_integration_actions.ts @@ -82,9 +82,9 @@ export const useIntegrationActions = () => { (dashboard: Dashboard) => wrapLinkPropsForTelemetry( getRouterLinkProps({ - href: dashboardLocator?.getRedirectUrl({ dashboardId: dashboard?.id } || ''), + href: dashboardLocator?.getRedirectUrl({ dashboardId: dashboard?.id ?? '' }), onClick: () => { - return dashboardLocator?.navigate({ dashboardId: dashboard?.id } || ''); + return dashboardLocator?.navigate({ dashboardId: dashboard?.id ?? '' }); }, }), navigationTargets.Dashboard, diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx index 8822117f56d67..260d2cf2608ab 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx @@ -84,6 +84,7 @@ export const DataStreamRowActions = memo<{ datastream: DataStream }>(({ datastre items: [ { icon: 'dashboardApp', + // @ts-expect-error upgrade typescript v5.9.3 href: dashboardLocator?.getRedirectUrl({ dashboardId: dashboards[0]?.id } || ''), name: actionNameSingular, }, @@ -110,6 +111,7 @@ export const DataStreamRowActions = memo<{ datastream: DataStream }>(({ datastre items: dashboards.map((dashboard) => { return { icon: 'dashboardApp', + // @ts-expect-error upgrade typescript v5.9.3 href: dashboardLocator?.getRedirectUrl({ dashboardId: dashboard?.id } || ''), name: dashboard.title, }; diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx index 3a17ad05929ae..f6e4b47065fcd 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx @@ -329,15 +329,18 @@ export function useOutputForm(onSucess: () => void, output?: Output, defaultOutp const diskQueuePathInput = useInput( output?.shipper?.disk_queue_path ?? '', undefined, + // @ts-expect-error upgrade typescript v5.9.3 !diskQueueEnabledInput.value ?? false ); const diskQueueMaxSizeInput = useNumberInput( output?.shipper?.disk_queue_max_size ?? DEFAULT_QUEUE_MAX_SIZE, undefined, + // @ts-expect-error upgrade typescript v5.9.3 !diskQueueEnabledInput.value ?? false ); const diskQueueEncryptionEnabled = useSwitchInput( output?.shipper?.disk_queue_encryption_enabled ?? false, + // @ts-expect-error upgrade typescript v5.9.3 !diskQueueEnabledInput.value ?? false ); const loadBalanceEnabledInput = useSwitchInput(output?.shipper?.disk_queue_enabled ?? false); @@ -352,7 +355,9 @@ export function useOutputForm(onSucess: () => void, output?: Output, defaultOutp }); const compressionLevelInput = useSelectInput( options, + // @ts-expect-error upgrade typescript v5.9.3 `${output?.shipper?.compression_level}` ?? options[0].value, + // @ts-expect-error upgrade typescript v5.9.3 !diskQueueCompressionEnabled.value ?? false ); diff --git a/x-pack/platform/plugins/shared/fleet/server/integration_tests/fleet_setup.test.ts b/x-pack/platform/plugins/shared/fleet/server/integration_tests/fleet_setup.test.ts index b5c300f9fa59a..7d72177942660 100644 --- a/x-pack/platform/plugins/shared/fleet/server/integration_tests/fleet_setup.test.ts +++ b/x-pack/platform/plugins/shared/fleet/server/integration_tests/fleet_setup.test.ts @@ -108,6 +108,7 @@ describe.skip('Fleet setup preconfiguration with multiple instances Kibana', () } roots = []; + // @ts-expect-error upgrade typescript v5.9.3 if (esServer) { await esServer.stop(); } diff --git a/x-pack/platform/plugins/shared/fleet/server/routes/epm/file_handler.ts b/x-pack/platform/plugins/shared/fleet/server/routes/epm/file_handler.ts index 53b42951d38d0..00ec0faccd857 100644 --- a/x-pack/platform/plugins/shared/fleet/server/routes/epm/file_handler.ts +++ b/x-pack/platform/plugins/shared/fleet/server/routes/epm/file_handler.ts @@ -83,6 +83,7 @@ export const getFileHandler: FleetRequestHandler< }); } + // @ts-expect-error upgrade typescript v5.9.3 buffer = sanitize(contentType, buffer); return response.custom({ diff --git a/x-pack/platform/plugins/shared/fleet/server/services/epm/streams.ts b/x-pack/platform/plugins/shared/fleet/server/services/epm/streams.ts index 402cfa2553f4c..ff90b72fdd423 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/epm/streams.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/epm/streams.ts @@ -18,8 +18,11 @@ export function streamToString(stream: NodeJS.ReadableStream | Buffer): Promise< return new Promise((resolve, reject) => { const body: string[] = []; + // @ts-expect-error upgrade typescript v5.9.3 stream.on('data', (chunk: string) => body.push(chunk)); + // @ts-expect-error upgrade typescript v5.9.3 stream.on('end', () => resolve(body.join(''))); + // @ts-expect-error upgrade typescript v5.9.3 stream.on('error', reject); }); } diff --git a/x-pack/platform/plugins/shared/fleet/server/services/fleet_server/index.ts b/x-pack/platform/plugins/shared/fleet/server/services/fleet_server/index.ts index 034db5fdb0c1d..6c0caf76aac72 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/fleet_server/index.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/fleet_server/index.ts @@ -36,6 +36,7 @@ export const getFleetServerPolicies = async ( // Extract associated fleet server agent policy IDs const fleetServerAgentPolicyIds = fleetServerPackagePolicies.items.flatMap((p) => { + // @ts-expect-error upgrade typescript v5.9.3 return p.policy_ids?.map((id) => ({ id, spaceId: p.spaceIds?.[0] ?? DEFAULT_SPACE_ID } ?? [])); }); diff --git a/x-pack/platform/plugins/shared/fleet/server/services/preconfiguration/fleet_proxies.ts b/x-pack/platform/plugins/shared/fleet/server/services/preconfiguration/fleet_proxies.ts index 436a4fe31d7ac..10d2fc4be48a1 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/preconfiguration/fleet_proxies.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/preconfiguration/fleet_proxies.ts @@ -43,10 +43,15 @@ function hasChanged(existingProxy: FleetProxy, preconfiguredFleetProxy: FleetPro preconfiguredFleetProxy.proxy_headers ?? null ) || existingProxy.certificate_authorities) ?? + // @ts-expect-error upgrade typescript v5.9.3 null !== preconfiguredFleetProxy.certificate_authorities ?? + // @ts-expect-error upgrade typescript v5.9.3 (null || existingProxy.certificate) ?? + // @ts-expect-error upgrade typescript v5.9.3 null !== preconfiguredFleetProxy.certificate ?? + // @ts-expect-error upgrade typescript v5.9.3 (null || existingProxy.certificate_key) ?? + // @ts-expect-error upgrade typescript v5.9.3 null !== preconfiguredFleetProxy.certificate_key ?? null ); diff --git a/x-pack/platform/plugins/shared/fleet/server/services/spaces/agent_policy.ts b/x-pack/platform/plugins/shared/fleet/server/services/spaces/agent_policy.ts index caa1806383d1c..40776f0a69981 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/spaces/agent_policy.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/spaces/agent_policy.ts @@ -81,9 +81,11 @@ export async function updateAgentPolicySpaces({ ); } const spacesToAdd = newSpaceIds.filter( + // @ts-expect-error upgrade typescript v5.9.3 (spaceId) => !existingPolicy?.space_ids?.includes(spaceId) ?? true ); const spacesToRemove = + // @ts-expect-error upgrade typescript v5.9.3 existingPolicy?.space_ids?.filter((spaceId) => !newSpaceIds.includes(spaceId) ?? true) ?? []; // Privileges check diff --git a/x-pack/platform/plugins/shared/fleet/server/services/spaces/helpers.ts b/x-pack/platform/plugins/shared/fleet/server/services/spaces/helpers.ts index c2c7fa908c678..34203b2143764 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/spaces/helpers.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/spaces/helpers.ts @@ -27,6 +27,7 @@ export async function isSpaceAwarenessEnabled(): Promise { const settings = await getSettingsOrUndefined(appContextService.getInternalUserSOClient()); + // @ts-expect-error upgrade typescript v5.9.3 const res = settings?.use_space_awareness_migration_status === 'success' ?? false; setIsSpaceAwarenessEnabledCache(res); diff --git a/x-pack/platform/plugins/shared/global_search/server/services/search_service.test.ts b/x-pack/platform/plugins/shared/global_search/server/services/search_service.test.ts index 80971ffc60e41..324e47178b629 100644 --- a/x-pack/platform/plugins/shared/global_search/server/services/search_service.test.ts +++ b/x-pack/platform/plugins/shared/global_search/server/services/search_service.test.ts @@ -109,6 +109,7 @@ describe('SearchService', () => { find( { term: 'foobar', types: ['dashboard', 'map'], tags: ['tag-id'] }, { preference: 'pref' }, + // @ts-expect-error upgrade typescript v5.9.3 request ); @@ -134,6 +135,7 @@ describe('SearchService', () => { registerResultProvider(createProvider('A', { source: providerResults })); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, {}, request); expectObservable(results).toBe('a-b-|', { @@ -168,6 +170,7 @@ describe('SearchService', () => { ); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, {}, request); expectObservable(results).toBe('ab-cd-|', { @@ -207,6 +210,7 @@ describe('SearchService', () => { ); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, {}, request); expectObservable(results).toBe('ab--c-|', { @@ -233,6 +237,7 @@ describe('SearchService', () => { const aborted$ = hot('----a--|', { a: undefined }); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, { aborted$ }, request); expectObservable(results).toBe('--a-|', { @@ -256,6 +261,7 @@ describe('SearchService', () => { registerResultProvider(createProvider('A', { source: providerResults })); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, {}, request); expectObservable(results).toBe('a 24ms b 74ms |', { @@ -291,6 +297,7 @@ describe('SearchService', () => { ); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, {}, request); expectObservable(results).toBe('ab-(c|)', { @@ -325,6 +332,7 @@ describe('SearchService', () => { registerResultProvider(provider); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const batch = await firstValueFrom(find({ term: 'foobar' }, {}, request)); expect(batch.results).toHaveLength(2); @@ -354,6 +362,7 @@ describe('SearchService', () => { registerResultProvider(createProvider('A', { source: providerResults })); const { find } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const results = find({ term: 'foobar' }, {}, request); expectObservable(results).toBe( @@ -379,6 +388,7 @@ describe('SearchService', () => { const { getSearchableTypes } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const types = await getSearchableTypes(request); expect(types).toEqual(['type-a', 'type-b']); @@ -395,6 +405,7 @@ describe('SearchService', () => { const { getSearchableTypes } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const types = await getSearchableTypes(request); expect(types).toEqual(['type-a', 'type-b']); @@ -414,6 +425,7 @@ describe('SearchService', () => { const { getSearchableTypes } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const types = await getSearchableTypes(request); expect(types.sort()).toEqual(['type-a', 'type-b', 'type-c', 'type-d']); @@ -433,6 +445,7 @@ describe('SearchService', () => { const { getSearchableTypes } = service.start({ core: coreStart, licenseChecker }); + // @ts-expect-error upgrade typescript v5.9.3 const types = await getSearchableTypes(request); expect(types.sort()).toEqual(['dupe', 'type-a', 'type-b']); diff --git a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/field_select.tsx b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/field_select.tsx index f771362b46d1a..8e043fee3365d 100644 --- a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/field_select.tsx +++ b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/field_select.tsx @@ -82,6 +82,7 @@ export function FieldSelect({ } function fieldNamesToOptions(items: string[]): FieldOption[] { + // @ts-expect-error upgrade typescript v5.9.3 return items .filter((field) => currentIndexPattern.getFieldByName(field)?.displayName) .map((field) => { diff --git a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx index 6aa9e226d624b..b52d7ee693c01 100644 --- a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx +++ b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/dimension_panel/reference_editor.tsx @@ -278,7 +278,7 @@ export const ReferenceEditor = (props: ReferenceEditorProps) => { const field = column && 'sourceField' in column && possibleFieldNames?.has(column.sourceField) ? currentIndexPattern.getFieldByName(column.sourceField) - : possibleFieldNames?.size === 1 + : possibleFieldNames?.size === 1 // @ts-expect-error upgrade typescript v5.9.3 ? currentIndexPattern.getFieldByName(possibleFieldNames.values().next().value) : undefined; diff --git a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/definitions/terms/index.tsx b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/definitions/terms/index.tsx index 00880e4b21837..323e0fd872829 100644 --- a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/definitions/terms/index.tsx +++ b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/definitions/terms/index.tsx @@ -503,6 +503,7 @@ export const termsOperation: OperationDefinition< layer, columnId, indexPattern, + // @ts-expect-error upgrade typescript v5.9.3 op: newFieldOp, field: mainField, visualizationGroups: dimensionGroups, diff --git a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/layer_helpers.ts b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/layer_helpers.ts index 6a5208234c2e1..8a2e2d018bed5 100644 --- a/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/layer_helpers.ts +++ b/x-pack/platform/plugins/shared/lens/public/datasources/form_based/operations/layer_helpers.ts @@ -353,6 +353,7 @@ export function insertNewColumn({ const baseOptions = { indexPattern, + // @ts-expect-error upgrade typescript v5.9.3 previousColumn: { ...incompleteParams, ...initialParams, ...layer.columns[columnId] }, }; diff --git a/x-pack/platform/plugins/shared/maps/common/elasticsearch_util/es_agg_utils.ts b/x-pack/platform/plugins/shared/maps/common/elasticsearch_util/es_agg_utils.ts index 7756a76159bc5..d28de69fec94b 100644 --- a/x-pack/platform/plugins/shared/maps/common/elasticsearch_util/es_agg_utils.ts +++ b/x-pack/platform/plugins/shared/maps/common/elasticsearch_util/es_agg_utils.ts @@ -52,12 +52,14 @@ export function extractPropertiesFromBucket( if (_.has(bucket[key], 'value')) { properties[key] = bucket[key].value; } else if (_.has(bucket[key], 'buckets')) { + // @ts-expect-error upgrade typescript v5.9.3 if (bucket[key].buckets.length === 0) { // No top term continue; } properties[key] = _.get(bucket[key], 'buckets[0].key'); + // @ts-expect-error upgrade typescript v5.9.3 const topBucketCount = bucket[key].buckets[0].doc_count; const totalCount = bucket.doc_count; if (totalCount && topBucketCount) { @@ -70,6 +72,7 @@ export function extractPropertiesFromBucket( key.startsWith(AGG_TYPE.PERCENTILE) || key.startsWith(JOIN_FIELD_NAME_PREFIX + AGG_TYPE.PERCENTILE) ) { + // @ts-expect-error upgrade typescript v5.9.3 const values = bucket[key].values; for (const k in values) { if (Object.hasOwn(values, k)) { diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/field_select.tsx b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/field_select.tsx index ff2fa2d73a3fc..5ad707159e5d0 100644 --- a/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/field_select.tsx +++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/vector/components/field_select.tsx @@ -53,6 +53,7 @@ function groupFieldsByOrigin(fields: StyleField[]) { if (fieldsByOriginMap.size === 1) { // do not show origin group if all fields are from same origin const onlyOriginKey = fieldsByOriginMap.keys().next().value; + // @ts-expect-error upgrade typescript v5.9.3 const fieldsList = fieldsByOriginMap.get(onlyOriginKey)!; return fieldsListToOptions(fieldsList); } diff --git a/x-pack/platform/plugins/shared/maps/public/connected_components/mb_map/transform_request.test.ts b/x-pack/platform/plugins/shared/maps/public/connected_components/mb_map/transform_request.test.ts index c1b2003c782ba..3de7bffda44a8 100644 --- a/x-pack/platform/plugins/shared/maps/public/connected_components/mb_map/transform_request.test.ts +++ b/x-pack/platform/plugins/shared/maps/public/connected_components/mb_map/transform_request.test.ts @@ -14,6 +14,7 @@ describe('transformRequest', () => { location = global.window.location; // @ts-expect-error we need to set our own location value delete global.window.location; + // @ts-expect-error upgrade typescript v5.9.3 global.window.location = { origin: 'https://transform.test.local', } as unknown as Location; diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/import_export_jobs/export_jobs_flyout/jobs_export_service.ts b/x-pack/platform/plugins/shared/ml/public/application/components/import_export_jobs/export_jobs_flyout/jobs_export_service.ts index bdc77872c7261..fc1e4299731cb 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/import_export_jobs/export_jobs_flyout/jobs_export_service.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/import_export_jobs/export_jobs_flyout/jobs_export_service.ts @@ -127,8 +127,8 @@ export class JobsExportService { const jobId = j.job_id; return { jobId, - calendarIds: [...new Set(calendarsPerJob[jobId])] ?? [], - filterIds: [...new Set(filtersPerJob[jobId])] ?? [], + calendarIds: [...new Set(calendarsPerJob[jobId] ?? [])], + filterIds: [...new Set(filtersPerJob[jobId] ?? [])], }; }); } diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts index 95ede4edcc9eb..f886685479e25 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts @@ -47,6 +47,7 @@ export const getColorSpec = ( return { condition: { selection: USER_SELECTION, + // @ts-expect-error upgrade typescript v5.9.3 field: getEscapedVegaFieldName('is_outlier' ?? '00FF00'), type: LEGEND_TYPES.NOMINAL, scale: { diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/components/job_details_flyout/job_details_context_manager.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/components/job_details_flyout/job_details_context_manager.tsx index 6e599bfcfc2d6..fb739a8d3da85 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/components/job_details_flyout/job_details_context_manager.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/components/job_details_flyout/job_details_context_manager.tsx @@ -17,7 +17,7 @@ export const JobInfoFlyoutsManager = () => { useContext(JobInfoFlyoutsContext); const [globalState] = useUrlState('_g'); const end = useMemo( - () => moment(globalState?.time?.to).unix() * 1000 ?? 0, + () => moment(globalState?.time?.to ?? 0).unix() * 1000, [globalState?.time?.to] ); diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/model_actions.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/model_actions.tsx index b5e2c3c0e4e73..70c93135eed23 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/model_actions.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/model_actions.tsx @@ -203,6 +203,7 @@ export function useModelActions({ await navigateToPath(path, false); }, }, + // @ts-expect-error type icon or button is correct { name: i18n.translate('xpack.ml.inference.modelsList.startModelDeploymentActionLabel', { defaultMessage: 'Start deployment', @@ -215,7 +216,6 @@ export function useModelActions({ ), 'data-test-subj': 'mlModelsTableRowStartDeploymentAction', icon: 'play', - // @ts-ignore type: isMobileLayout ? 'icon' : 'button', isPrimary: true, color: 'success', @@ -367,6 +367,7 @@ export function useModelActions({ return canStartStopTrainedModels; }, }, + // @ts-expect-error type icon or button is correct { name: i18n.translate('xpack.ml.inference.modelsList.testModelActionLabel', { defaultMessage: 'Test', @@ -376,7 +377,6 @@ export function useModelActions({ }), 'data-test-subj': 'mlModelsTableRowTestAction', icon: 'inputOutput', - // @ts-ignore type: isMobileLayout ? 'icon' : 'button', isPrimary: true, available: (item) => isTestable(item, true), @@ -426,6 +426,7 @@ export function useModelActions({ await navigateToPath(path, false); }, }, + // @ts-expect-error type icon or button is correct { name: (model) => { return isModelDownloadItem(model) && model.state === MODEL_STATE.DOWNLOADING ? ( @@ -472,7 +473,6 @@ export function useModelActions({ }, 'data-test-subj': 'mlModelsTableRowDeleteAction', icon: 'trash', - // @ts-ignore type: isMobileLayout ? 'icon' : 'button', color: 'danger', isPrimary: false, diff --git a/x-pack/platform/plugins/shared/rule_registry/server/routes/get_alert_fields/get_alert_fields_by_rule_type_ids.test.ts b/x-pack/platform/plugins/shared/rule_registry/server/routes/get_alert_fields/get_alert_fields_by_rule_type_ids.test.ts index 5574aa03af2bb..81f500f642c7f 100644 --- a/x-pack/platform/plugins/shared/rule_registry/server/routes/get_alert_fields/get_alert_fields_by_rule_type_ids.test.ts +++ b/x-pack/platform/plugins/shared/rule_registry/server/routes/get_alert_fields/get_alert_fields_by_rule_type_ids.test.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { IndexPatternsFetcher } from '@kbn/data-views-plugin/server'; - import { BASE_RAC_ALERTS_API_PATH } from '../../../common/constants'; import { requestContextMock } from '../__mocks__/request_context'; import { requestMock, serverMock } from '../__mocks__/server'; @@ -15,11 +13,9 @@ import { getAlertFieldsByRuleTypeIds } from './get_alert_fields_by_rule_type_ids describe('getAlertFieldsByRuleTypeIds', () => { let server: ReturnType; const { context } = requestContextMock.createTools(); - let getFieldsForWildcardMock: jest.Mock; beforeEach(async () => { server = serverMock.create(); - IndexPatternsFetcher.prototype.getFieldsForWildcard = getFieldsForWildcardMock; getAlertFieldsByRuleTypeIds(server.router); }); diff --git a/x-pack/platform/plugins/shared/saved_objects_tagging/public/management/actions/index.test.ts b/x-pack/platform/plugins/shared/saved_objects_tagging/public/management/actions/index.test.ts index 7b439e69c1d0b..b4ac207cb08cf 100644 --- a/x-pack/platform/plugins/shared/saved_objects_tagging/public/management/actions/index.test.ts +++ b/x-pack/platform/plugins/shared/saved_objects_tagging/public/management/actions/index.test.ts @@ -43,6 +43,7 @@ describe('getTableActions', () => { setLoading, assignableTypes, capabilities: createTagCapabilities(caps), + // @ts-expect-error upgrade typescript v5.9.3 fetchTags, canceled$: new Observable(), }); diff --git a/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker.ts index d5f2fe10148e6..d3e1db03e1e57 100644 --- a/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker.ts +++ b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker.ts @@ -189,6 +189,7 @@ async function execute({ data: { layout, logo, title, content } }: GeneratePdfRe }, }, }; + // @ts-expect-error upgrade typescript v5.9.3 port.postMessage(successResponse, [buffer.buffer /* Transfer buffer instead of copying */]); } catch (error) { const errorResponse: GeneratePdfResponse = { diff --git a/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts index 95261626e15fa..1e43d9228b0b7 100644 --- a/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts +++ b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts @@ -75,7 +75,9 @@ describe('class Screenshots', () => { new Screenshots( browserDriverFactory, mockLogger, + // @ts-expect-error upgrade typescript v5.9.3 mockPackageInfo, + // @ts-expect-error upgrade typescript v5.9.3 mockHttpSetup, mockConfig, mockCloudSetup diff --git a/x-pack/platform/plugins/shared/security/public/authentication/login/components/login_form/login_form.test.tsx b/x-pack/platform/plugins/shared/security/public/authentication/login/components/login_form/login_form.test.tsx index b7d006e3dc08f..365b88873eb8e 100644 --- a/x-pack/platform/plugins/shared/security/public/authentication/login/components/login_form/login_form.test.tsx +++ b/x-pack/platform/plugins/shared/security/public/authentication/login/components/login_form/login_form.test.tsx @@ -421,6 +421,7 @@ describe('LoginForm', () => { const coreStartMock = coreMock.createStart({ basePath: '/some-base-path' }); + // @ts-expect-error upgrade typescript v5.9.3 window.location = { ...window.location, href: currentURL, origin: 'https://some-host.com' }; const wrapper = renderWithI18n( @@ -490,6 +491,7 @@ describe('LoginForm', () => { '/some-base-path/app/kibana#/home?_g=()' )}`; + // @ts-expect-error upgrade typescript v5.9.3 window.location = { ...window.location, href: currentURL, diff --git a/x-pack/platform/plugins/shared/security/public/management/roles/edit_role/privileges/es/remote_cluster_privileges_form.tsx b/x-pack/platform/plugins/shared/security/public/management/roles/edit_role/privileges/es/remote_cluster_privileges_form.tsx index 6e29866c99b89..bc8b70bd7d054 100644 --- a/x-pack/platform/plugins/shared/security/public/management/roles/edit_role/privileges/es/remote_cluster_privileges_form.tsx +++ b/x-pack/platform/plugins/shared/security/public/management/roles/edit_role/privileges/es/remote_cluster_privileges_form.tsx @@ -55,6 +55,7 @@ export const RemoteClusterPrivilegesForm: React.FunctionComponent = ({ }) => { const onCreateClusterOption = useCallback( (option: string) => { + // @ts-expect-error upgrade typescript v5.9.3 const nextClusters = ([...remoteClusterPrivilege.clusters] ?? []).concat([option]); onChange({ @@ -117,6 +118,7 @@ export const RemoteClusterPrivilegesForm: React.FunctionComponent = ({ > { if (!searchType) { - // @ts-expect-error Reset rule params regardless of their type - setRuleProperty('params', {}); + setRuleProperty('params', {} as EsQueryRuleParams); return; } setRuleParams('searchType', searchType); @@ -94,6 +93,7 @@ export const EsQueryRuleTypeExpression: React.FunctionComponent< ); return ( + // @ts-expect-error upgrade typescript v5.9.3 <> {expressionError} diff --git a/x-pack/platform/plugins/shared/stack_connectors/public/connector_types_from_spec/register_from_spec.ts b/x-pack/platform/plugins/shared/stack_connectors/public/connector_types_from_spec/register_from_spec.ts index 76a5eb5367f18..6b666365149c5 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/public/connector_types_from_spec/register_from_spec.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/public/connector_types_from_spec/register_from_spec.ts @@ -58,6 +58,7 @@ const createConnectorTypeFromSpec = ( spec.metadata.supportedFeatureIds.length === 1 && spec.metadata.supportedFeatureIds[0] === WorkflowsConnectorFeatureId ) { + // @ts-expect-error upgrade typescript v5.9.3 return !ref.uiSettings?.get('workflows:ui:enabled') ?? false; } return false; diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/api.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/api.test.ts index 51a36ba0212f1..61844b5cd180d 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/api.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/api.test.ts @@ -5,13 +5,13 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; +import { loggerMock } from '@kbn/logging-mocks'; import { externalServiceMock, apiParams } from './mock'; import { api } from './api'; import type { ExternalService } from './types'; -let mockedLogger: jest.Mocked; describe('api', () => { + const mockedLogger = loggerMock.create(); let externalService: jest.Mocked; beforeEach(() => { diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/jira/api.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/jira/api.test.ts index f03f3be4e02de..03945dc9ce39e 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/jira/api.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/jira/api.test.ts @@ -5,11 +5,12 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; +import { loggerMock } from '@kbn/logging-mocks'; + import { externalServiceMock, apiParams } from './mocks'; import type { ExternalService } from './types'; import { api } from './api'; -let mockedLogger: jest.Mocked; +const mockedLogger = loggerMock.create(); describe('api', () => { let externalService: jest.Mocked; diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/servicenow/api.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/servicenow/api.test.ts index f00f2561bf60e..038ffc7eabf6b 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/servicenow/api.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/servicenow/api.test.ts @@ -4,14 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { loggerMock } from '@kbn/logging-mocks'; -import type { Logger } from '@kbn/core/server'; import { externalServiceMock, apiParams, serviceNowCommonFields, serviceNowChoices } from './mocks'; import type { ExternalService } from './types'; import { api } from './api'; -let mockedLogger: jest.Mocked; describe('api', () => { + const mockedLogger = loggerMock.create(); let externalService: jest.Mocked; beforeEach(() => { diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/openai/openai.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/openai/openai.ts index 55158236a9316..877b10966758d 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/openai/openai.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/openai/openai.ts @@ -321,6 +321,7 @@ export class OpenAIConnector extends SubActionConnector { connectorUsageCollector ); + // @ts-expect-error upgrade typescript v5.9.3 return stream ? pipeStreamingResponse(response) : response.data; } catch (error) { // special error handling for PKI errors diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_itom/api.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_itom/api.test.ts index e1863282eeacc..df5ff07cfc43a 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_itom/api.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_itom/api.test.ts @@ -5,11 +5,11 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; +import { loggerMock } from '@kbn/logging-mocks'; import { externalServiceITOMMock, itomEventParams } from '../lib/servicenow/mocks'; import type { ExternalServiceITOM } from '../lib/servicenow/types'; import { api, prepareParams } from './api'; -let mockedLogger: jest.Mocked; +const mockedLogger = loggerMock.create(); describe('api_itom', () => { let externalService: jest.Mocked; diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_sir/api.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_sir/api.test.ts index 4a0f1b9aad700..ef6735cc68f12 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_sir/api.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/servicenow_sir/api.test.ts @@ -5,12 +5,12 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; +import { loggerMock } from '@kbn/logging-mocks'; import { externalServiceSIRMock, sirParams } from '../lib/servicenow/mocks'; import type { ExternalServiceSIR } from '../lib/servicenow/types'; import { ObservableTypes } from '../lib/servicenow/types'; import { api, combineObservables, formatObservables, prepareParams } from './api'; -let mockedLogger: jest.Mocked; +const mockedLogger = loggerMock.create(); describe('api_sir', () => { let externalService: jest.Mocked; diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/swimlane/api.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/swimlane/api.test.ts index 7fc5849d7636e..b1ecc66984189 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/swimlane/api.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/swimlane/api.test.ts @@ -13,9 +13,9 @@ import { recordResponseCreate, recordResponseUpdate, } from './mocks'; -import type { Logger } from '@kbn/logging'; +import { loggerMock } from '@kbn/logging-mocks'; -let mockedLogger: jest.Mocked; +const mockedLogger = loggerMock.create(); describe('api', () => { let externalService: jest.Mocked; diff --git a/x-pack/platform/plugins/shared/streams/server/lib/content/archive.ts b/x-pack/platform/plugins/shared/streams/server/lib/content/archive.ts index 436af4097da2f..9939b58516a71 100644 --- a/x-pack/platform/plugins/shared/streams/server/lib/content/archive.ts +++ b/x-pack/platform/plugins/shared/streams/server/lib/content/archive.ts @@ -47,7 +47,9 @@ export async function parseArchive(archive: Readable): Promise { }); const rootDir = getRootDir(zip.getEntries()); + // @ts-expect-error upgrade typescript v5.9.3 const manifest = await extractManifest(rootDir, zip); + // @ts-expect-error upgrade typescript v5.9.3 const entries = await extractEntries(rootDir, zip); return { ...manifest, entries }; diff --git a/x-pack/platform/plugins/shared/streams_app/public/components/data_management/content/export_flyout.tsx b/x-pack/platform/plugins/shared/streams_app/public/components/data_management/content/export_flyout.tsx index e913ddc63b10e..339e8a8edcf7b 100644 --- a/x-pack/platform/plugins/shared/streams_app/public/components/data_management/content/export_flyout.tsx +++ b/x-pack/platform/plugins/shared/streams_app/public/components/data_management/content/export_flyout.tsx @@ -84,6 +84,7 @@ export function ExportContentPackFlyout({ const contentPack = await previewContent({ http, definition, + // @ts-expect-error upgrade typescript v5.9.3 file: new File([contentPackRaw], `${definition.stream.name}-1.0.0.zip`, { type: 'application/zip', }), @@ -176,6 +177,7 @@ export function ExportContentPackFlyout({ ); saveAs( + // @ts-expect-error upgrade typescript v5.9.3 new Blob([contentPack], { type: 'application/zip' }), `${manifest.name}-${manifest.version}.zip` ); diff --git a/x-pack/platform/plugins/shared/streams_app/public/components/data_management/schema_editor/schema_editor_table.tsx b/x-pack/platform/plugins/shared/streams_app/public/components/data_management/schema_editor/schema_editor_table.tsx index d5921b7d9f532..bea55698bfa18 100644 --- a/x-pack/platform/plugins/shared/streams_app/public/components/data_management/schema_editor/schema_editor_table.tsx +++ b/x-pack/platform/plugins/shared/streams_app/public/components/data_management/schema_editor/schema_editor_table.tsx @@ -194,6 +194,7 @@ const createCellRenderer = return EMPTY_CONTENT; } + // @ts-expect-error upgrade typescript v5.9.3 return <>{field[columnId as keyof SchemaField] || EMPTY_CONTENT}; }; diff --git a/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.ts b/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.ts index 88f72503d0af1..18c2b08043238 100644 --- a/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.ts +++ b/x-pack/platform/plugins/shared/task_manager/server/monitoring/workload_statistics.ts @@ -265,7 +265,8 @@ export function createWorkloadAggregator({ const value = bucket as TaskTypeWithStatusBucket; const taskDef = taskDefinitions.get(value.key as string); if (taskDef) { - const cost = value.doc_count * taskDef?.cost ?? TaskCost.Normal; + const cost = + value.doc_count * taskDef?.cost ? value.doc_count * taskDef?.cost : TaskCost.Normal; totalCost += cost; return Object.assign(acc, { @@ -540,7 +541,7 @@ function getTotalCost(taskTypeBuckets: TaskTypeBucket[], definitions: TaskTypeDi for (const bucket of taskTypeBuckets) { const taskDef = definitions.get(bucket.key as string); if (taskDef) { - cost += bucket.doc_count * taskDef?.cost ?? TaskCost.Normal; + cost += bucket.doc_count * taskDef?.cost ? bucket.doc_count * taskDef?.cost : TaskCost.Normal; } else { // task type is not registered with dictionary, do not add to cost } diff --git a/x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/common/components/event_log/event_log_list_cell_renderer.test.tsx b/x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/common/components/event_log/event_log_list_cell_renderer.test.tsx index 588806251c0e1..ca922268c7481 100644 --- a/x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/common/components/event_log/event_log_list_cell_renderer.test.tsx +++ b/x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/common/components/event_log/event_log_list_cell_renderer.test.tsx @@ -71,7 +71,7 @@ describe('EventLogListCellRenderer', () => { }); afterAll(() => { - window.location = originalLocation; + window.location = originalLocation as string & Location; }); beforeEach(() => { diff --git a/x-pack/platform/test/api_integration/apis/ml/modules/setup_module.ts b/x-pack/platform/test/api_integration/apis/ml/modules/setup_module.ts index b306c7d94472c..6dd1db34fba0f 100644 --- a/x-pack/platform/test/api_integration/apis/ml/modules/setup_module.ts +++ b/x-pack/platform/test/api_integration/apis/ml/modules/setup_module.ts @@ -785,9 +785,9 @@ export default ({ getService }: FtrProviderContext) => { // saved objects const rspKibana: object = rspBody.kibana; - let actualSearches = []; - let actualVisualizations = []; - let actualDashboards = []; + let actualSearches: any[] = []; + let actualVisualizations: any[] = []; + let actualDashboards: any[] = []; if (isEmpty(rspKibana) === false) { actualSearches = sortBy(rspBody.kibana.search, 'id'); diff --git a/x-pack/platform/test/reporting_api_integration/reporting_and_security/telemetry.ts b/x-pack/platform/test/reporting_api_integration/reporting_and_security/telemetry.ts index d7e5799e65d54..3c3b331226638 100644 --- a/x-pack/platform/test/reporting_api_integration/reporting_and_security/telemetry.ts +++ b/x-pack/platform/test/reporting_api_integration/reporting_and_security/telemetry.ts @@ -97,7 +97,7 @@ export default function ({ getService }: FtrProviderContext) { ), ]); - scheduledReportIds = results.map((report) => { + scheduledReportIds = results.map((report: any) => { expect(report.status).to.eql(200); return report.body.job.id; }); diff --git a/x-pack/solutions/observability/packages/kbn-evals-suite-obs-ai-assistant/src/clients/chat/obs_ai_assistant_client.ts b/x-pack/solutions/observability/packages/kbn-evals-suite-obs-ai-assistant/src/clients/chat/obs_ai_assistant_client.ts index a7e5a861d63e2..e8749bedd60de 100644 --- a/x-pack/solutions/observability/packages/kbn-evals-suite-obs-ai-assistant/src/clients/chat/obs_ai_assistant_client.ts +++ b/x-pack/solutions/observability/packages/kbn-evals-suite-obs-ai-assistant/src/clients/chat/obs_ai_assistant_client.ts @@ -168,6 +168,7 @@ export class ObservabilityAIAssistantEvaluationChatClient implements ChatClient const decoder = new TextDecoder(); + // @ts-expect-error upgrade typescript v5.9.3 const iterator: NodeJS.AsyncIterator = { async next() { const { done, value } = await reader.read(); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx index 8cf26a7a17ae7..ab9af3be6c7df 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/storage_explorer/services_table/index_stats_per_service.tsx @@ -74,6 +74,7 @@ export function IndexStatsPerService({ indicesStats, status }: Props) { }), render: (_, { dataStream }) => ( + // @ts-expect-error upgrade typescript v5.9.3 { const max = new Date('Wed Jan 29 2020 07:12:00 GMT+0100').valueOf(); afterAll(() => { + // @ts-expect-error upgrade typescript v5.9.3 moment.tz.setDefault(originalTimezone ? originalTimezone.name : ''); }); describe('getTimeTicksTZ', () => { diff --git a/x-pack/solutions/observability/plugins/infra/public/components/asset_details/hooks/use_loading_state.test.ts b/x-pack/solutions/observability/plugins/infra/public/components/asset_details/hooks/use_loading_state.test.ts index 17d62a48caeb1..2d09b27a0d327 100644 --- a/x-pack/solutions/observability/plugins/infra/public/components/asset_details/hooks/use_loading_state.test.ts +++ b/x-pack/solutions/observability/plugins/infra/public/components/asset_details/hooks/use_loading_state.test.ts @@ -88,6 +88,7 @@ describe('useLoadingState', () => { beforeEach(() => { subscription = new Subscription(); jest.useFakeTimers(); + // @ts-expect-error upgrade typescript v5.9.3 waitUntilNextSessionCompletesMock$.mockReturnValue(of(SearchSessionState.None)); mockRequestTimeContext(); mockUseKibana(); diff --git a/x-pack/solutions/observability/plugins/infra/public/hooks/use_kibana_index_patterns.mock.tsx b/x-pack/solutions/observability/plugins/infra/public/hooks/use_kibana_index_patterns.mock.tsx index cbbeeac06d052..ef86255dd60d8 100644 --- a/x-pack/solutions/observability/plugins/infra/public/hooks/use_kibana_index_patterns.mock.tsx +++ b/x-pack/solutions/observability/plugins/infra/public/hooks/use_kibana_index_patterns.mock.tsx @@ -88,6 +88,7 @@ export const createIndexPatternMock = ({ title, type, getTimeField: () => indexPatternFields.find(({ name }) => name === timeFieldName), + // @ts-expect-error upgrade typescript v5.9.3 isTimeBased: () => timeFieldName != null, getFieldByName: (fieldName) => indexPatternFields.find(({ name }) => name === fieldName), getComputedFields: () => ({ diff --git a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/section.tsx b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/section.tsx index 3b1745ca201ce..4b6b2fbd290de 100644 --- a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/section.tsx +++ b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/section.tsx @@ -61,7 +61,6 @@ export const Section: FunctionComponent> = const childrenWithProps = Children.map(children, (child) => isValidElement(child) ? cloneElement(child, { - // @ts-expect-error upgrade typescript v4.9.5 metrics, onChangeRangeTime, isLiveStreaming, diff --git a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/sub_section.tsx b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/sub_section.tsx index 2930eb58801ef..7e9fa5c7ec80d 100644 --- a/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/sub_section.tsx +++ b/x-pack/solutions/observability/plugins/infra/public/pages/metrics/metric_detail/components/sub_section.tsx @@ -34,7 +34,6 @@ export const SubSection: FunctionComponent { if (isValidElement(child)) { return cloneElement(child, { - // @ts-expect-error upgrade typescript v4.9.5 metric, id, onChangeRangeTime, diff --git a/x-pack/solutions/observability/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts b/x-pack/solutions/observability/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts index 1a272e7792680..7a5636f31fc0c 100644 --- a/x-pack/solutions/observability/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts +++ b/x-pack/solutions/observability/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts @@ -150,7 +150,9 @@ export const getData = async ({ previous[bucket.key.node] = { value: bucket?.[metricId]?.value ?? null, + // @ts-expect-error upgrade typescript v5.9.3 warn: bucket?.shouldWarn.value > 0 ?? false, + // @ts-expect-error upgrade typescript v5.9.3 trigger: bucket?.shouldTrigger.value > 0 ?? false, container: containerList, ...additionalContextSource, diff --git a/x-pack/solutions/observability/plugins/observability/server/lib/rules/register_rule_types.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/register_rule_types.ts index 6d494d3dbcf91..fecd80e96d7a8 100644 --- a/x-pack/solutions/observability/plugins/observability/server/lib/rules/register_rule_types.ts +++ b/x-pack/solutions/observability/plugins/observability/server/lib/rules/register_rule_types.ts @@ -18,5 +18,6 @@ export function registerRuleTypes( logger: Logger, locators: CustomThresholdLocators ) { + // @ts-expect-error upgrade typescript v5.9.3 alertingPlugin.registerType(thresholdRuleType(basePath, config, logger, locators)); } diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts index df69ebe552c80..05ca536a1d383 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts @@ -94,6 +94,7 @@ export function registerQueryFunction(params: FunctionRegistrationParameters) { the get_dataset functions first if you need index or field names. This tool takes no input.`, }, + // @ts-expect-error upgrade typescript v5.9.3 async ({ messages, connectorId, simulateFunctionCalling }) => { const esqlFunctions = functions .getFunctions() @@ -134,16 +135,16 @@ export function registerQueryFunction(params: FunctionRegistrationParameters) { system: ` 1. **CHECK YOUR TOOLS FIRST.** Your capabilities are strictly limited to the tools listed in the AvailableTools section below. - 2. **DISREGARD PAST TOOLS.** - * Under NO circumstances should you use any tool that is not explicitly defined in the AvailableTools section for THIS turn. - * Tools used or mentioned in previous parts of the conversation are NOT available unless they are listed below. + 2. **DISREGARD PAST TOOLS.** + * Under NO circumstances should you use any tool that is not explicitly defined in the AvailableTools section for THIS turn. + * Tools used or mentioned in previous parts of the conversation are NOT available unless they are listed below. * Calling unavailable tools will result in a **critical error and task failure**. 3. **Critical ES|QL syntax rules:** * When using \`DATE_FORMAT\`, any literal text in the format string **MUST** be in single quotes. Example: \`DATE_FORMAT("d 'of' MMMM yyyy", @timestamp)\`. * When grouping with \`STATS\`, use the field name directly. Example: \`STATS count = COUNT(*) BY destination.domain\` - * These are the only known and available tools for use: + * These are the only known and available tools for use: \`\`\`json ${JSON.stringify(availableToolDefinitions, null, 4)} \'\'\' diff --git a/x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.ts index efd6c6cab94c9..bc994c3a8bd3f 100644 --- a/x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.ts +++ b/x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.ts @@ -15,13 +15,11 @@ export function usePermissions() { const { data: globalDiagnosis, isLoading } = useFetchSloGlobalDiagnosis(); - const hasRequiredReadCapabilities = !!capabilities[sloFeatureId].read ?? false; - const hasRequiredWriteCapabilities = !!capabilities[sloFeatureId].write ?? false; + const hasRequiredReadCapabilities = !!capabilities[sloFeatureId].read; + const hasRequiredWriteCapabilities = !!capabilities[sloFeatureId].write; - const hasRequiredReadPrivileges = - !!globalDiagnosis?.userPrivileges.read.has_all_requested ?? false; - const hasRequiredWritePrivileges = - !!globalDiagnosis?.userPrivileges.write.has_all_requested ?? false; + const hasRequiredReadPrivileges = !!globalDiagnosis?.userPrivileges.read.has_all_requested; + const hasRequiredWritePrivileges = !!globalDiagnosis?.userPrivileges.write.has_all_requested; return { isLoading, diff --git a/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts index 3bebd19f03242..4524c8fa1a8ba 100644 --- a/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts +++ b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts @@ -170,6 +170,8 @@ describe('BurnRateRuleExecutor', () => { esClientMock = elasticsearchServiceMock.createElasticsearchClient(); soClientMock = savedObjectsClientMock.create(); loggerMock = loggingSystemMock.createLogger(); + searchSourceClientMock = jest.fn() as any; + uiSettingsClientMock = jest.fn() as any; servicesMock = { savedObjectsClient: soClientMock, scopedClusterClient: { diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts index e39a670ad533f..6d9cb3bce8681 100644 --- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts @@ -34,7 +34,7 @@ export const useGetIlmPolicies = () => { let totalSize = policyIndices?.reduce((acc, curr) => { - return acc + Number(curr?.['store.size']) ?? 0; + return acc + Number(curr?.['store.size'] ?? 0); }, 0) ?? 0; const phases = policy?.policy.phases ?? {}; @@ -44,7 +44,7 @@ export const useGetIlmPolicies = () => { if (name === 'synthetics') { totalSize = sizeData?.data?.reduce((acc, curr) => { - return acc + Number(curr?.['store.size']) ?? 0; + return acc + Number(curr?.['store.size'] ?? 0); }, 0) ?? 0; } diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts index 934cc24e48d62..ad778532ee672 100644 --- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts @@ -33,6 +33,10 @@ export const useStepDetailsBreadcrumbs = (extraCrumbs?: Array<{ text: string; hr }`, }, - { text: `${currentStep?.synthetics.step?.index}. ${currentStep?.synthetics.step?.name}` ?? '' }, + { + text: `${currentStep?.synthetics.step?.index ?? ''}. ${ + currentStep?.synthetics.step?.name ?? '' + }`, + }, ]); }; diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts index 187515141a6e4..0d012799c61c2 100644 --- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts @@ -275,9 +275,10 @@ function mergeCheckGroups(prev: CheckGroupResult, curr: Partial { return ( - acc + cur?.journeyDoc?._id ?? - '' + cur?.summaryDoc?._id ?? - '' + (cur?.steps ?? []).reduce((stepAcc, { _id }) => stepAcc + _id, '') + acc + + (cur?.journeyDoc?._id ?? '') + + (cur?.summaryDoc?._id ?? '') + + (cur?.steps ?? []).reduce((stepAcc, { _id }) => stepAcc + _id, '') ); }, ''); } diff --git a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts index 6330ab08660de..75f1808243cdf 100644 --- a/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts @@ -94,9 +94,7 @@ export const manualTestRunsReducer = createReducer(initialState, (builder) => { const { name, message } = fetchError; const [, errorMonitor] = - Object.entries(state).find( - ([key]) => fetchError.request.url.indexOf(key) > -1 ?? false - ) ?? []; + Object.entries(state).find(([key]) => fetchError.request.url.indexOf(key) > -1) ?? []; if (errorMonitor) { state[errorMonitor.configId] = { diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx index 3fef4757e4d66..44f55be4cf4d7 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx @@ -34,10 +34,10 @@ describe('useMonitorBreadcrumbs', () => { uiSettings: { ...uiSettingsServiceMock.createSetupContract(), get(key: string, defaultOverride?: any): any { - return `MMM D, YYYY @ HH:mm:ss.SSS` || defaultOverride; + return `MMM D, YYYY @ HH:mm:ss.SSS`; }, get$(key: string, defaultOverride?: any): any { - return of(`MMM D, YYYY @ HH:mm:ss.SSS`) || of(defaultOverride); + return of(`MMM D, YYYY @ HH:mm:ss.SSS`); }, }, }; @@ -103,10 +103,10 @@ describe('useMonitorBreadcrumbs', () => { uiSettings: { ...uiSettingsServiceMock.createSetupContract(), get(key: string, defaultOverride?: any): any { - return `MMM D, YYYY @ HH:mm:ss.SSS` || defaultOverride; + return `MMM D, YYYY @ HH:mm:ss.SSS`; }, get$(key: string, defaultOverride?: any): any { - return of(`MMM D, YYYY @ HH:mm:ss.SSS`) || of(defaultOverride); + return of(`MMM D, YYYY @ HH:mm:ss.SSS`); }, }, }; diff --git a/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts index 5d48799db0fa4..392ae5500c5f1 100644 --- a/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts +++ b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts @@ -14,6 +14,11 @@ describe('journey screenshot blocks route', () => { let libs: UMServerLibs; const data: any = []; beforeEach(() => { + libs = { + requests: { + getJourneyScreenshotBlocks: jest.fn().mockReturnValue([]), + }, + } as unknown as UMServerLibs; handlerContext = { uptimeEsClient: { search: jest.fn().mockResolvedValue({ diff --git a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/alerting/burn_rate/consumers_and_privileges.ts b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/alerting/burn_rate/consumers_and_privileges.ts index d409b6d74ce21..1114e09fd55f3 100644 --- a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/alerting/burn_rate/consumers_and_privileges.ts +++ b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/alerting/burn_rate/consumers_and_privileges.ts @@ -36,7 +36,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { let dataForgeIndices: string[]; let actionId: string; let ruleId: string; - let dependencyRuleId: string; + let dependencyRuleId: string | undefined; let editorRoleAuthc: RoleCredentials; let adminRoleAuthc: RoleCredentials; let currentRoleAuthc: RoleCredentials; diff --git a/x-pack/solutions/observability/test/serverless/functional/test_suites/rules/rules_list.ts b/x-pack/solutions/observability/test/serverless/functional/test_suites/rules/rules_list.ts index cfceb637cbe8b..d40d3dc686b51 100644 --- a/x-pack/solutions/observability/test/serverless/functional/test_suites/rules/rules_list.ts +++ b/x-pack/solutions/observability/test/serverless/functional/test_suites/rules/rules_list.ts @@ -714,7 +714,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { const statusItem = await testSubjects.find(testSubj); return statusItem ? JSON.parse((await statusItem.getAttribute('aria-checked')) || 'null') - : null; + : false; }; await retry.try(async () => { diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/common/types/graph/v1.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/common/types/graph/v1.ts index 8c47e1e29437b..947fb40a3307c 100644 --- a/x-pack/solutions/security/packages/kbn-cloud-security-posture/common/types/graph/v1.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/common/types/graph/v1.ts @@ -37,6 +37,7 @@ export type NodeColor = typeof nodeColorSchema.type; export type NodeShape = TypeOf; export enum ApiMessageCode { + // @ts-expect-error upgrade typescript v5.9.3 ReachedNodesLimit = REACHED_NODES_LIMIT, } diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx index c42692d293ba2..58f135bb891eb 100644 --- a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx @@ -124,7 +124,7 @@ const getCloudFormationConfig = ( return { isSupported, - accordionTitleLink: {'Steps to Generate AWS Account Credentials'} || '', + accordionTitleLink: {'Steps to Generate AWS Account Credentials'}, templateUrl: automationCredentialTemplate || '', }; }; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx index b7a8e1562a59e..16e6b2040f810 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx @@ -22,6 +22,7 @@ const EntryValueWrap = ({ children }: { children: React.ReactNode }) => ( {children} ); +// @ts-ignore const getEntryValue = (type: string, value: string | string[], showValueListModal: ElementType) => { const ShowValueListModal = showValueListModal; if (type === 'match_any' && Array.isArray(value)) { @@ -37,6 +38,7 @@ const getEntryValue = (type: string, value: string | string[], showValueListModa ); } + // @ts-expect-error upgrade typescript v5.9.3 return {value} ?? ''; }; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/helpers.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/helpers.ts index 7e530457abeb7..24fd97ecf8cd6 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/helpers.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/helpers.ts @@ -183,7 +183,7 @@ export const getStructuredToolForIndexEntry = ({ // Generate filters for inputSchema fields const filter = indexEntry.inputSchema?.reduce( - // @ts-expect-error Possible to override types with dynamic input schema? + // @ts-expect-error upgrade typescript v5.9.3 (prev, i) => [...prev, { term: { [`${i.fieldName}`]: input?.[i.fieldName] } }], [] as Array<{ term: { [key: string]: string } }> ) ?? []; diff --git a/x-pack/solutions/security/plugins/lists/server/routes/internal/create_exception_filter_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/internal/create_exception_filter_route.ts index 432f865651a10..b4f1ae6999261 100644 --- a/x-pack/solutions/security/plugins/lists/server/routes/internal/create_exception_filter_route.ts +++ b/x-pack/solutions/security/plugins/lists/server/routes/internal/create_exception_filter_route.ts @@ -93,6 +93,7 @@ export const getExceptionFilterRoute = (router: ListsPluginRouter): void => { startedAt: new Date(), }); + // @ts-expect-error upgrade typescript v5.9.3 return response.ok({ body: { filter } ?? {} }); } catch (err) { const error = transformError(err); diff --git a/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.test.ts index da23267b5e62a..3c743167dbe00 100644 --- a/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.test.ts +++ b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.test.ts @@ -140,6 +140,7 @@ describe('exception_list_client', () => { extensionPointCallback.mockImplementation(async (args) => { const { data: { entries, ...rest }, + // @ts-expect-error upgrade typescript v5.9.3 } = args as { data: ExtensionPointCallbackDataArgument }; expect(entries).toBeTruthy(); // Test entries to exist since we exclude it. diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/index.tsx index db0f51e2f0e8a..a924e7b7f8133 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/index.tsx @@ -6,6 +6,7 @@ */ import { get, isString } from 'lodash/fp'; +import type { ReactNode } from 'react'; import React from 'react'; import styled from 'styled-components'; @@ -23,7 +24,7 @@ export const getEmptyString = () => `(${i18n.EMPTY_STRING})`; export const getEmptyTagValue = () => {getEmptyValue()}; export const getEmptyStringTag = () => {getEmptyString()}; -export const defaultToEmptyTag = (item: T): JSX.Element => { +export const defaultToEmptyTag = (item: T): JSX.Element => { if (item == null) { return getEmptyTagValue(); } else if (isString(item) && item === '') { diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.tsx index 7fe6f5661d0a6..eb4cdf489009e 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.tsx @@ -23,7 +23,6 @@ import { } from '@elastic/eui'; import styled from '@emotion/styled'; import { FormattedMessage } from '@kbn/i18n-react'; -import { defaultToEmptyTag } from '../empty_value'; export interface ReputationLinkSetting { name: string; url_template: string; @@ -137,12 +136,15 @@ ReputationLinksOverflow.displayName = 'ReputationLinksOverflow'; export const MoreReputationLinksContainer = React.memo( ({ moreMaxHeight, overflowIndexStart, render, rowItems }) => { + const defaultRender = (rowItem: ReputationLinkSetting) => ( + {rowItem.name} + ); const moreItems = useMemo( () => rowItems.slice(overflowIndexStart).map((rowItem, index) => { return ( - {(render && render(rowItem)) ?? defaultToEmptyTag(rowItem)} + {(render && render(rowItem)) ?? defaultRender(rowItem)} ); }), diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx index dbc2a3e212237..90c9360d1129f 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx @@ -112,6 +112,7 @@ export const ExceptionItemCardConditions = memo( ); } + // @ts-expect-error upgrade typescript v5.9.3 return {value} ?? ''; }; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx index bef51b3f4b665..8bf883b02f60a 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx @@ -206,10 +206,12 @@ export const RulesTableContextProvider = ({ children }: RulesTableContextProvide const [filterOptions, setFilterOptions] = useState({ filter: savedFilter?.searchTerm ?? DEFAULT_FILTER_OPTIONS.filter, tags: savedFilter?.tags ?? DEFAULT_FILTER_OPTIONS.tags, - showCustomRules: - savedFilter?.source === RuleSource.Custom ?? DEFAULT_FILTER_OPTIONS.showCustomRules, - showElasticRules: - savedFilter?.source === RuleSource.Prebuilt ?? DEFAULT_FILTER_OPTIONS.showElasticRules, + showCustomRules: savedFilter?.source + ? savedFilter.source === RuleSource.Custom + : DEFAULT_FILTER_OPTIONS.showCustomRules, + showElasticRules: savedFilter?.source + ? savedFilter.source === RuleSource.Prebuilt + : DEFAULT_FILTER_OPTIONS.showElasticRules, enabled: savedFilter?.enabled, ruleExecutionStatus: savedFilter?.ruleExecutionStatus ?? DEFAULT_FILTER_OPTIONS.ruleExecutionStatus, diff --git a/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx index b799410e3a5e7..a0cd5bda44b7a 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx @@ -5,12 +5,12 @@ * 2.0. */ -import { waitFor, act, renderHook } from '@testing-library/react'; +import { act, renderHook, waitFor } from '@testing-library/react'; import type { ReturnQueryAlerts } from './use_query'; import { useQueryAlerts } from './use_query'; import { ALERTS_QUERY_NAMES } from './constants'; import * as api from './api'; -import { mockAlertsQuery, alertsMock } from './mock'; +import { alertsMock, mockAlertsQuery } from './mock'; jest.mock('./api'); jest.mock('../../../../common/lib/apm/use_track_http_request'); @@ -46,7 +46,11 @@ describe('useQueryAlerts', () => { loading: false, data: alertsMock, response: JSON.stringify(alertsMock, null, 2), - request: JSON.stringify({ index: [indexName] ?? [''], body: mockAlertsQuery }, null, 2), + request: JSON.stringify( + { index: indexName ? [indexName] : [''], body: mockAlertsQuery }, + null, + 2 + ), setQuery: result.current.setQuery, refetch: result.current.refetch, }) diff --git a/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx index eb147cbe2b376..03a19f6cdff76 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx @@ -6,9 +6,8 @@ */ import { isEmpty } from 'lodash'; +import type { Dispatch, SetStateAction } from 'react'; import { useMemo, useEffect, useState } from 'react'; -import type { SetStateAction } from 'react'; -import type React from 'react'; import type { fetchQueryUnifiedAlerts, fetchQueryRuleRegistryAlerts } from './api'; import { fetchQueryAlerts } from './api'; import type { AlertSearchResponse, QueryAlerts } from './types'; @@ -20,7 +19,7 @@ type Func = () => Promise; export interface ReturnQueryAlerts { loading: boolean; data: AlertSearchResponse | null; - setQuery: React.Dispatch>; + setQuery: Dispatch>; response: string; request: string; refetch: Func | null; @@ -112,7 +111,11 @@ export const useQueryAlerts = ({ setAlerts({ data: alertResponse, response: JSON.stringify(alertResponse, null, 2), - request: JSON.stringify({ index: [indexName] ?? [''], body: query }, null, 2), + request: JSON.stringify( + { index: indexName ? [indexName] : [''], body: query }, + null, + 2 + ), setQuery, refetch: fetchData, }); diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_status_header_action.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_status_header_action.test.tsx index cebfc2872a162..02a500f240f23 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_status_header_action.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_status_header_action.test.tsx @@ -20,6 +20,7 @@ jest.mock('../../../hooks/use_entity_store'); jest.mock('../helpers'); const mockUseEnableEntityStoreMutation = useEnableEntityStoreMutation as jest.Mock; +// @ts-expect-error upgrade typescript v5.9.3 const mockIsEngineLoading = isEngineLoading as jest.Mock; const defaultComponent: EngineComponentStatus = { diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/privileged_access_detection/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/privileged_access_detection/index.tsx index 637dbb9c553c6..54a2412a71df6 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/privileged_access_detection/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/privileged_access_detection/index.tsx @@ -61,6 +61,7 @@ export const PrivilegedAccessDetectionsPanel: React.FC<{ spaceId: string }> = ({ padInstallationStatus?.ml_module_setup_status === 'complete'; return ( + // @ts-expect-error upgrade typescript v5.9.3 <> {padInstallationStatusError && ( ( { defaultMessage: '{action} all cards', values: { + // @ts-expect-error upgrade typescript v5.9.3 action: 'unfold' ? 'Expand' : 'Collapse', }, } diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx index d0b5380fca574..e9e0bc4f0fd7a 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx @@ -46,6 +46,7 @@ export const FormattedError = memo( if (isHttpFetchError(error)) { content = ( + // @ts-expect-error upgrade typescript v5.9.3 <>
{`${error.response?.status}: ${error.response?.statusText}`}
{error.body && } diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_selector/policy_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_selector/policy_selector.tsx index de1b0d717d52d..0b01b520d188e 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_selector/policy_selector.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_selector/policy_selector.tsx @@ -250,6 +250,7 @@ export const PolicySelector = memo( } = useFetchPolicyData( { kuery: searchKuery, + // @ts-expect-error upgrade typescript v5.9.3 sortOrder, sortField, perPage, @@ -327,6 +328,7 @@ export const PolicySelector = memo( appPath={urlPath} target="_blank" data-test-subj={getTestId(`policy-${policy.id}-policyLink`)} + // @ts-expect-error upgrade typescript v5.9.3 onClick={(event) => { event.stopPropagation(); }} diff --git a/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx index 5d2252300aea5..baa519adfe2eb 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx @@ -65,7 +65,7 @@ export const AIConnectorCard: OnboardingCardComponent = return false; } const connector = checkCompleteMetadata.connectors.find((c) => c.id === storedConnectorId); - return connector?.actionTypeId === '.inference' ?? false; + return connector?.actionTypeId === '.inference'; }, [checkCompleteMetadata, storedConnectorId]); if (!checkCompleteMetadata) { diff --git a/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts index 5c0af6acd8306..79081c70ef185 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import type { Observable } from 'rxjs'; import { filter } from 'rxjs'; import { useEffect, useState } from 'react'; @@ -124,34 +125,37 @@ export const useTiDataSources = ({ const datasets = result?.rawResponse?.aggregations?.dataset?.buckets ?? []; const getChildAggregationValue = (aggregation?: Bucket) => aggregation?.buckets?.[0]?.key; - const integrationMap = datasets.reduce((acc: Record, dataset) => { - const datasetName = getChildAggregationValue(dataset?.name); - if (datasetName) { - return { - ...acc, - [dataset.key]: { - dataset: dataset?.key, - name: datasetName, - dashboardId: getChildAggregationValue(dataset?.dashboard), - count: dataset?.doc_count, - }, - }; - } else { - const otherTiDatasetKey = OTHER_TI_DATASET_KEY; - const otherDatasetCount = acc[otherTiDatasetKey]?.count ?? 0; - return { - ...acc, - [otherTiDatasetKey]: { - dataset: otherTiDatasetKey, - name: OTHER_DATA_SOURCE_TITLE, - count: otherDatasetCount + (dataset?.doc_count ?? 0), - }, - }; - } - }, {}); + const integrationMap: Record = datasets.reduce( + (acc: Record, dataset) => { + const datasetName = getChildAggregationValue(dataset?.name); + if (datasetName) { + return { + ...acc, + [dataset.key]: { + dataset: dataset?.key, + name: datasetName, + dashboardId: getChildAggregationValue(dataset?.dashboard), + count: dataset?.doc_count, + }, + }; + } else { + const otherTiDatasetKey = OTHER_TI_DATASET_KEY; + const otherDatasetCount = acc[otherTiDatasetKey]?.count ?? 0; + return { + ...acc, + [otherTiDatasetKey]: { + dataset: otherTiDatasetKey, + name: OTHER_DATA_SOURCE_TITLE, + count: otherDatasetCount + (dataset?.doc_count ?? 0), + }, + }; + } + }, + {} + ); if (Array.isArray(allTiDataSources)) { - allTiDataSources.forEach((integration) => { + allTiDataSources.forEach((integration: TiDataSources) => { if (!integrationMap[integration.dataset]) { integrationMap[integration.dataset] = { ...integration, diff --git a/x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/value_report_exporter.tsx b/x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/value_report_exporter.tsx index 82c016b0800b7..93227fc0be1de 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/value_report_exporter.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/value_report_exporter.tsx @@ -113,6 +113,7 @@ const ValueReportExporterComponent: React.FC = ({ children }) => { }); const pdfBytes = await pdfDoc.save(); + // @ts-expect-error upgrade typescript v5.9.3 const pdfBlob = new Blob([pdfBytes], { type: 'application/pdf' }); const url = URL.createObjectURL(pdfBlob); diff --git a/x-pack/solutions/security/plugins/security_solution/public/reports/hooks/use_value_metrics.tsx b/x-pack/solutions/security/plugins/security_solution/public/reports/hooks/use_value_metrics.tsx index d22683bb57ae5..faf4cf8f71b49 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/reports/hooks/use_value_metrics.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/reports/hooks/use_value_metrics.tsx @@ -114,6 +114,7 @@ export const useValueMetrics = ({ analystHourlyRate, attackDiscoveryCount: data?.total ?? 0, totalAlerts: alertCount, + // @ts-expect-error upgrade typescript v5.9.3 escalatedAlertsCount: alertCount - filteredAlertsCount ?? 0, minutesPerAlert, }), @@ -125,6 +126,7 @@ export const useValueMetrics = ({ analystHourlyRate, attackDiscoveryCount: compareAdData?.total ?? 0, totalAlerts: alertCountCompare, + // @ts-expect-error upgrade typescript v5.9.3 escalatedAlertsCount: alertCountCompare - filteredAlertsCountCompare ?? 0, minutesPerAlert, }), diff --git a/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts index f1f74c86dc0d5..d37d89b6246b8 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts @@ -9,8 +9,8 @@ import { orderByTime } from '../process_event'; import type { IndexedProcessTree } from '../../types'; import type { ResolverNode } from '../../../../common/endpoint/types'; import { - levelOrder as baseLevelOrder, calculateGenerationsAndDescendants, + levelOrder as baseLevelOrder, } from '../../lib/tree_sequencers'; import * as nodeModel from '../../../../common/endpoint/models/node'; @@ -158,14 +158,14 @@ export function root(tree: IndexedProcessTree) { return null; } // any node will do - let current: ResolverNode = tree.idToNode.values().next().value; + let current: ResolverNode | undefined = tree.idToNode.values().next().value; // iteratively swap current w/ its parent - while (parent(tree, current) !== undefined) { + while (current && parent(tree, current) !== undefined) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion current = parent(tree, current)!; } - return current; + return current ?? null; } /** diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.test.ts index 15d4b7a9114e3..68b467b862f5a 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.test.ts @@ -55,6 +55,7 @@ describe('when calling the Action state route handler', () => { () => superUser ); + // @ts-expect-error upgrade typescript v5.9.3 const ctx = createRouteHandlerContext(mockScopedEsClient, mockSavedObjectClient); ctx.securitySolution.getEndpointAuthz.mockResolvedValue( diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts index 0cf13c62a278b..f315a59160ec2 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts @@ -32,7 +32,7 @@ describe('DetectionRulesClient.createPrebuiltRule', () => { let detectionRulesClient: IDetectionRulesClient; const mlAuthz = (buildMlAuthz as jest.Mock)(); - let actionsClient: jest.Mocked; + const actionsClient: jest.Mocked = {} as unknown as jest.Mocked; beforeEach(() => { rulesClient = rulesClientMock.create(); diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts index e3bb2af8f1ac5..daf225253cf54 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts @@ -22,7 +22,7 @@ describe('DetectionRulesClient.deleteRule', () => { let detectionRulesClient: IDetectionRulesClient; const mlAuthz = (buildMlAuthz as jest.Mock)(); - let actionsClient: jest.Mocked; + const actionsClient: jest.Mocked = {} as unknown as jest.Mocked; beforeEach(() => { rulesClient = rulesClientMock.create(); diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts index 9d29b104bac44..d67515a56fdb6 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts @@ -31,7 +31,7 @@ describe('DetectionRulesClient.importRule', () => { let detectionRulesClient: IDetectionRulesClient; const mlAuthz = (buildMlAuthz as jest.Mock)(); - let actionsClient: jest.Mocked; + const actionsClient: jest.Mocked = {} as unknown as jest.Mocked; const allowMissingConnectorSecrets = true; const ruleToImport = { diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts index d05432b0c523f..fedfec6707fdf 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts @@ -51,7 +51,9 @@ describe('ml_executor', () => { mlMock = mlPluginServerMock.createSetupContract(); mlMock.jobServiceProvider.mockReturnValue({ jobsSummary: jobsSummaryMock, + // @ts-expect-error upgrade typescript v5.9.3 forceStartDatafeeds: forceStartDatafeedsMock, + // @ts-expect-error upgrade typescript v5.9.3 stopDatafeeds: stopDatafeedsMock, }); ruleServices = createPersistenceExecutorOptionsMock(); diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts index 6e4f3d84da1ff..d20d06f97b733 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts @@ -83,7 +83,7 @@ const getTimelinesFromObjects = async ( return acc; }, []); - return [...myResponse, ...errors] ?? []; + return [...myResponse, ...errors]; }; export const getExportTimelineByObjectIds = async ({ diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts index f8e99f2831ae3..a165262ee72a3 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts @@ -9,27 +9,27 @@ import { getOr } from 'lodash/fp'; import { type SavedObjectsClientContract, - type SavedObjectsFindOptions, SavedObjectsErrorHelpers, + type SavedObjectsFindOptions, } from '@kbn/core/server'; import type { AuthenticatedUser } from '@kbn/security-plugin/server'; import { UNAUTHENTICATED_USER } from '../../../../../common/constants'; import type { - Note, BareNote, - PinnedEvent, - GetTimelinesResponse, ExportTimelineNotFoundError, - PageInfoTimeline, FavoriteTimelineResponse, - SortTimeline, - TimelineResponse, - TimelineType, - TimelineStatus, + GetTimelinesResponse, + Note, + PageInfoTimeline, + PinnedEvent, ResolvedTimeline, SavedTimeline, SavedTimelineWithSavedObjectId, + SortTimeline, + TimelineResponse, + TimelineStatus, + TimelineType, } from '../../../../../common/api/timeline'; import { TimelineStatusEnum, TimelineTypeEnum } from '../../../../../common/api/timeline'; import type { SavedObjectTimelineWithoutExternalRefs } from '../../../../../common/types/timeline/saved_object'; @@ -188,11 +188,8 @@ export const getExistingPrepackagedTimelines = async ( ): Promise => { const queryPageInfo = countsOnly && pageInfo == null - ? { - perPage: 1, - page: 1, - } - : { perPage: pageInfo?.pageSize, page: pageInfo?.pageIndex } ?? {}; + ? { perPage: 1, page: 1 } + : { perPage: pageInfo?.pageSize, page: pageInfo?.pageIndex }; const elasticTemplateTimelineOptions = { type: timelineSavedObjectType, ...queryPageInfo, diff --git a/x-pack/solutions/security/test/security_solution_api_integration/tsconfig.json b/x-pack/solutions/security/test/security_solution_api_integration/tsconfig.json index 38713628f913f..07479e2b2b128 100644 --- a/x-pack/solutions/security/test/security_solution_api_integration/tsconfig.json +++ b/x-pack/solutions/security/test/security_solution_api_integration/tsconfig.json @@ -2,7 +2,13 @@ "extends": "@kbn/tsconfig-base/tsconfig.json", "compilerOptions": { "outDir": "target/types", - "types": ["node", "jest", "@kbn/ambient-ftr-types"] + "types": [ + "node", + "cheerio", + "@emotion/react/types/css-prop", + "@kbn/ambient-ui-types", + "@kbn/ambient-ftr-types" + ], }, "include": [ "**/*", diff --git a/x-pack/solutions/workplaceai/plugins/workplace_ai_app/public/application/hooks/use_mcp_server_url.test.ts b/x-pack/solutions/workplaceai/plugins/workplace_ai_app/public/application/hooks/use_mcp_server_url.test.ts index 7fb896b8b1c13..5003eae804341 100644 --- a/x-pack/solutions/workplaceai/plugins/workplace_ai_app/public/application/hooks/use_mcp_server_url.test.ts +++ b/x-pack/solutions/workplaceai/plugins/workplace_ai_app/public/application/hooks/use_mcp_server_url.test.ts @@ -95,6 +95,7 @@ describe('useMcpServerUrl', () => { 'https://localhost:5601/s/default/api/agent_builder/mcp' ); + // @ts-expect-error upgrade typescript v5.9.3 window.location = originalLocation; }); @@ -125,6 +126,7 @@ describe('useMcpServerUrl', () => { 'https://example.com/custom-base-path/api/agent_builder/mcp' ); + // @ts-expect-error upgrade typescript v5.9.3 window.location = originalLocation; }); diff --git a/yarn.lock b/yarn.lock index 5121d9a13432d..a6ac57fa46443 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3254,7 +3254,7 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz#585624dc829cfb6e7c0aa6c3ca7d7e6daa87e34f" integrity sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ== -"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.7.0": version "4.7.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a" integrity sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw== @@ -14318,12 +14318,7 @@ resolved "https://registry.yarnpkg.com/@types/proj4/-/proj4-2.5.2.tgz#e3afa4e09e5cf08d8bc74e1b3de3b2111324ee33" integrity sha512-/Nmfn9p08yaYw6xo5f2b0L+2oHk2kZeOkp5v+4VCeNfq+ETlLQbmHmC97/pjDIEZy8jxwz7pdPpwNzDHM5cuJw== -"@types/prop-types@*": - version "15.7.1" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" - integrity sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg== - -"@types/prop-types@^15.7.5": +"@types/prop-types@*", "@types/prop-types@15.7.5", "@types/prop-types@^15.7.5": version "15.7.5" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== @@ -14876,69 +14871,62 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^8.16.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.36.0.tgz#880ce277f8a30ccf539ec027acac157088f131ae" - integrity sha512-lZNihHUVB6ZZiPBNgOQGSxUASI7UJWhT8nHyUGCnaQ28XFCw98IfrMCG3rUl1uwUWoAvodJQby2KTs79UTcrAg== +"@typescript-eslint/eslint-plugin@^8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.3.tgz#6f7aeaf9f5c611425db9b8f983e8d3fe5deece3c" + integrity sha512-sbaQ27XBUopBkRiuY/P9sWGOWUW4rl8fDoHIUmLpZd8uldsTyB4/Zg6bWTegPoTLnKj9Hqgn3QD6cjPNB32Odw== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.36.0" - "@typescript-eslint/type-utils" "8.36.0" - "@typescript-eslint/utils" "8.36.0" - "@typescript-eslint/visitor-keys" "8.36.0" + "@typescript-eslint/scope-manager" "8.46.3" + "@typescript-eslint/type-utils" "8.46.3" + "@typescript-eslint/utils" "8.46.3" + "@typescript-eslint/visitor-keys" "8.46.3" graphemer "^1.4.0" ignore "^7.0.0" natural-compare "^1.4.0" ts-api-utils "^2.1.0" -"@typescript-eslint/parser@^8.16.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.36.0.tgz#003007fe2030013936b6634b9cf52c457d36ed42" - integrity sha512-FuYgkHwZLuPbZjQHzJXrtXreJdFMKl16BFYyRrLxDhWr6Qr7Kbcu2s1Yhu8tsiMXw1S0W1pjfFfYEt+R604s+Q== +"@typescript-eslint/parser@^8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.46.3.tgz#3badfb62d2e2dc733d02a038073e3f65f2cb833d" + integrity sha512-6m1I5RmHBGTnUGS113G04DMu3CpSdxCAU/UvtjNWL4Nuf3MW9tQhiJqRlHzChIkhy6kZSAQmc+I1bcGjE3yNKg== dependencies: - "@typescript-eslint/scope-manager" "8.36.0" - "@typescript-eslint/types" "8.36.0" - "@typescript-eslint/typescript-estree" "8.36.0" - "@typescript-eslint/visitor-keys" "8.36.0" + "@typescript-eslint/scope-manager" "8.46.3" + "@typescript-eslint/types" "8.46.3" + "@typescript-eslint/typescript-estree" "8.46.3" + "@typescript-eslint/visitor-keys" "8.46.3" debug "^4.3.4" -"@typescript-eslint/project-service@8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.36.0.tgz#0c4acdcbe56476a43cdabaac1f08819424a379fd" - integrity sha512-JAhQFIABkWccQYeLMrHadu/fhpzmSQ1F1KXkpzqiVxA/iYI6UnRt2trqXHt1sYEcw1mxLnB9rKMsOxXPxowN/g== +"@typescript-eslint/project-service@8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.46.3.tgz#4555c685407ea829081218fa033d7b032607aaef" + integrity sha512-Fz8yFXsp2wDFeUElO88S9n4w1I4CWDTXDqDr9gYvZgUpwXQqmZBr9+NTTql5R3J7+hrJZPdpiWaB9VNhAKYLuQ== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.36.0" - "@typescript-eslint/types" "^8.36.0" + "@typescript-eslint/tsconfig-utils" "^8.46.3" + "@typescript-eslint/types" "^8.46.3" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.16.0": - version "8.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz#ebc9a3b399a69a6052f3d88174456dd399ef5905" - integrity sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg== - dependencies: - "@typescript-eslint/types" "8.16.0" - "@typescript-eslint/visitor-keys" "8.16.0" - -"@typescript-eslint/scope-manager@8.36.0", "@typescript-eslint/scope-manager@^8.15.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.36.0.tgz#23e4196ed07d7ea3737a584fbebc9a79c3835168" - integrity sha512-wCnapIKnDkN62fYtTGv2+RY8FlnBYA3tNm0fm91kc2BjPhV2vIjwwozJ7LToaLAyb1ca8BxrS7vT+Pvvf7RvqA== +"@typescript-eslint/scope-manager@8.46.3", "@typescript-eslint/scope-manager@^8.15.0": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.46.3.tgz#2e330f566e135ccac13477b98dd88d8f176e4dff" + integrity sha512-FCi7Y1zgrmxp3DfWfr+3m9ansUUFoy8dkEdeQSgA9gbm8DaHYvZCdkFRQrtKiedFf3Ha6VmoqoAaP68+i+22kg== dependencies: - "@typescript-eslint/types" "8.36.0" - "@typescript-eslint/visitor-keys" "8.36.0" + "@typescript-eslint/types" "8.46.3" + "@typescript-eslint/visitor-keys" "8.46.3" -"@typescript-eslint/tsconfig-utils@8.36.0", "@typescript-eslint/tsconfig-utils@^8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.36.0.tgz#63ef8a20ae9b5754c6ceacbe87b2fe1aab12ba13" - integrity sha512-Nhh3TIEgN18mNbdXpd5Q8mSCBnrZQeY9V7Ca3dqYvNDStNIGRmJA6dmrIPMJ0kow3C7gcQbpsG2rPzy1Ks/AnA== +"@typescript-eslint/tsconfig-utils@8.46.3", "@typescript-eslint/tsconfig-utils@^8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.3.tgz#cad33398c762c97fe56a8defda00c16505abefa3" + integrity sha512-GLupljMniHNIROP0zE7nCcybptolcH8QZfXOpCfhQDAdwJ/ZTlcaBOYebSOZotpti/3HrHSw7D3PZm75gYFsOA== -"@typescript-eslint/type-utils@8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.36.0.tgz#16b092c2cbbb5549f6a4df1382a481586850502f" - integrity sha512-5aaGYG8cVDd6cxfk/ynpYzxBRZJk7w/ymto6uiyUFtdCozQIsQWh7M28/6r57Fwkbweng8qAzoMCPwSJfWlmsg== +"@typescript-eslint/type-utils@8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.46.3.tgz#71188df833d7697ecff256cd1d3889a20552d78c" + integrity sha512-ZPCADbr+qfz3aiTTYNNkCbUt+cjNwI/5McyANNrFBpVxPt7GqpEYz5ZfdwuFyGUnJ9FdDXbGODUu6iRCI6XRXw== dependencies: - "@typescript-eslint/typescript-estree" "8.36.0" - "@typescript-eslint/utils" "8.36.0" + "@typescript-eslint/types" "8.46.3" + "@typescript-eslint/typescript-estree" "8.46.3" + "@typescript-eslint/utils" "8.46.3" debug "^4.3.4" ts-api-utils "^2.1.0" @@ -14947,39 +14935,20 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== -"@typescript-eslint/types@8.16.0": - version "8.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.16.0.tgz#49c92ae1b57942458ab83d9ec7ccab3005e64737" - integrity sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ== - -"@typescript-eslint/types@8.36.0", "@typescript-eslint/types@^8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.36.0.tgz#d3d184adc2899e2912c13b17c1590486ef37c7ac" - integrity sha512-xGms6l5cTJKQPZOKM75Dl9yBfNdGeLRsIyufewnxT4vZTrjC0ImQT4fj8QmtJK84F58uSh5HVBSANwcfiXxABQ== +"@typescript-eslint/types@8.46.3", "@typescript-eslint/types@^8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.46.3.tgz#da05ea40e91359b4275dbb3a489f2f7907a02245" + integrity sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA== -"@typescript-eslint/typescript-estree@8.16.0": - version "8.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz#9d741e56e5b13469b5190e763432ce5551a9300c" - integrity sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw== +"@typescript-eslint/typescript-estree@8.46.3", "@typescript-eslint/typescript-estree@^8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.3.tgz#c12406afba707f9779ce0c0151a08c33b3a96d41" + integrity sha512-f/NvtRjOm80BtNM5OQtlaBdM5BRFUv7gf381j9wygDNL+qOYSNOgtQ/DCndiYi80iIOv76QqaTmp4fa9hwI0OA== dependencies: - "@typescript-eslint/types" "8.16.0" - "@typescript-eslint/visitor-keys" "8.16.0" - debug "^4.3.4" - fast-glob "^3.3.2" - is-glob "^4.0.3" - minimatch "^9.0.4" - semver "^7.6.0" - ts-api-utils "^1.3.0" - -"@typescript-eslint/typescript-estree@8.36.0", "@typescript-eslint/typescript-estree@^8.16.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.36.0.tgz#344857fa79f71715369554a3cbb6b4ff8695a7bc" - integrity sha512-JaS8bDVrfVJX4av0jLpe4ye0BpAaUW7+tnS4Y4ETa3q7NoZgzYbN9zDQTJ8kPb5fQ4n0hliAt9tA4Pfs2zA2Hg== - dependencies: - "@typescript-eslint/project-service" "8.36.0" - "@typescript-eslint/tsconfig-utils" "8.36.0" - "@typescript-eslint/types" "8.36.0" - "@typescript-eslint/visitor-keys" "8.36.0" + "@typescript-eslint/project-service" "8.46.3" + "@typescript-eslint/tsconfig-utils" "8.46.3" + "@typescript-eslint/types" "8.46.3" + "@typescript-eslint/visitor-keys" "8.46.3" debug "^4.3.4" fast-glob "^3.3.2" is-glob "^4.0.3" @@ -15000,15 +14969,15 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@8.16.0", "@typescript-eslint/utils@8.36.0", "@typescript-eslint/utils@^5.10.0", "@typescript-eslint/utils@^6.18.1", "@typescript-eslint/utils@^8.15.0": - version "8.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.16.0.tgz#c71264c437157feaa97842809836254a6fc833c3" - integrity sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA== +"@typescript-eslint/utils@8.46.3", "@typescript-eslint/utils@^5.10.0", "@typescript-eslint/utils@^6.18.1", "@typescript-eslint/utils@^8.15.0": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.46.3.tgz#b6c7994b7c1ee2fe338ab32f7b3d4424856a73ce" + integrity sha512-VXw7qmdkucEx9WkmR3ld/u6VhRyKeiF1uxWwCy/iuNfokjJ7VhsgLSOTjsol8BunSw190zABzpwdNsze2Kpo4g== dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.16.0" - "@typescript-eslint/types" "8.16.0" - "@typescript-eslint/typescript-estree" "8.16.0" + "@eslint-community/eslint-utils" "^4.7.0" + "@typescript-eslint/scope-manager" "8.46.3" + "@typescript-eslint/types" "8.46.3" + "@typescript-eslint/typescript-estree" "8.46.3" "@typescript-eslint/visitor-keys@5.62.0": version "5.62.0" @@ -15018,20 +14987,12 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@8.16.0": - version "8.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz#d5086afc060b01ff7a4ecab8d49d13d5a7b07705" - integrity sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ== +"@typescript-eslint/visitor-keys@8.46.3": + version "8.46.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.3.tgz#6811b15053501981059c58e1c01b39242bd5c0f6" + integrity sha512-uk574k8IU0rOF/AjniX8qbLSGURJVUCeM5e4MIMKBFFi8weeiLrG1fyQejyLXQpRZbU/1BuQasleV/RfHC3hHg== dependencies: - "@typescript-eslint/types" "8.16.0" - eslint-visitor-keys "^4.2.0" - -"@typescript-eslint/visitor-keys@8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.36.0.tgz#7dc6ba4dd037979eb3a3bdd2093aa3604bb73674" - integrity sha512-vZrhV2lRPWDuGoxcmrzRZyxAggPL+qp3WzUrlZD+slFueDiYHxeBa34dUXPuC0RmGKzl4lS5kFJYvKCq9cnNDA== - dependencies: - "@typescript-eslint/types" "8.36.0" + "@typescript-eslint/types" "8.46.3" eslint-visitor-keys "^4.2.1" "@ungap/structured-clone@^1.2.0": @@ -20518,7 +20479,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint-visitor-keys@^4.2.0, eslint-visitor-keys@^4.2.1: +eslint-visitor-keys@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== @@ -32875,11 +32836,6 @@ ts-algebra@^2.0.0: resolved "https://registry.yarnpkg.com/ts-algebra/-/ts-algebra-2.0.0.tgz#4e3e0953878f26518fce7f6bb115064a65388b7a" integrity sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw== -ts-api-utils@^1.3.0: - version "1.4.3" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064" - integrity sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw== - ts-api-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91" @@ -33197,10 +33153,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@5, typescript@5.4.5, typescript@^3.3.3333, typescript@^5.0.4: - version "5.4.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" - integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== +typescript@5, typescript@5.9.3, typescript@^3.3.3333, typescript@^5.0.4: + version "5.9.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f" + integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw== typewise-core@^1.2, typewise-core@^1.2.0: version "1.2.0" @@ -35146,7 +35102,7 @@ zod-to-json-schema@^3.22.3, zod-to-json-schema@^3.24.1, zod-to-json-schema@^3.24 resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.24.6.tgz#5920f020c4d2647edfbb954fa036082b92c9e12d" integrity sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg== -zod@^3.23.8, zod@^3.24.1, zod@^3.24.2, zod@^3.25.32, zod@^3.25.76: +zod@3.25.76, zod@^3.23.8, zod@^3.24.1, zod@^3.24.2, zod@^3.25.32, zod@^3.25.76: version "3.25.76" resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34" integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==