Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"**/hoist-non-react-statics": "^3.3.2",
"**/isomorphic-fetch/node-fetch": "^2.6.7",
"**/remark-parse/trim": "1.0.1",
"**/typescript": "4.6.3",
"**/typescript": "4.7.4",
"globby/fast-glob": "^3.2.11"
},
"dependencies": {
Expand Down Expand Up @@ -1521,7 +1521,7 @@
"tree-kill": "^1.2.2",
"ts-morph": "^13.0.2",
"tsd": "^0.20.0",
"typescript": "4.6.3",
"typescript": "4.7.4",
"url-loader": "^2.2.0",
"val-loader": "^1.1.1",
"vinyl-fs": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class CoreKibanaRequest<
public readonly rewrittenUrl?: URL;

/** @internal */
protected readonly [requestSymbol]: Request;
protected readonly [requestSymbol]!: Request;

constructor(
request: RawRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class RootRoute implements ServerRoute {
try {
return await nodeFetch(url, {
agent: protocol === 'https:' ? this.getAgent() : undefined,
// @ts-expect-error ts upgrade v4.7.4
signal: controller.signal,
redirect: 'manual',
});
Expand Down
6 changes: 1 addition & 5 deletions packages/kbn-repo-packages/modern/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ function getPluginPackagesFilter(selector = {}) {
*/
function getDistributablePacakgesFilter() {
return (pkg) => {
if (
pkg.isDevOnly ||
pkg.manifest.type === 'functional-tests' ||
pkg.manifest.type === 'test-helper'
) {
if (pkg.isDevOnly()) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('createKibanaProgram', () => {
"fetch": Object {
"typeDescriptor": Object {
"locale": Object {
"kind": 149,
"kind": 150,
"type": "StringKeyword",
},
},
Expand Down
1 change: 1 addition & 0 deletions src/plugins/charts/common/static/components/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const LabelRotation = Object.freeze({
Horizontal: 0,
Vertical: 90,
Angled: 75,
VerticalRotation: 270,
});
export type LabelRotation = $Values<typeof LabelRotation>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export const TableRow = ({
// We should improve this and show a helpful tooltip why the filter buttons are not
// there/disabled when there are ignored values.
const isFilterable = Boolean(
mapping(column)?.filterable && filter && !row.raw._ignored?.includes(column)
mapping(column)?.filterable &&
typeof filter === 'function' &&
!row.raw._ignored?.includes(column)
);
rowCells.push(
<TableCell
Expand Down
10 changes: 6 additions & 4 deletions src/plugins/expressions/common/execution/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,18 +420,20 @@ export class Execution<
: of(resolvedArgs);

return args$.pipe(
tap((args) => this.execution.params.debug && Object.assign(head.debug, { args })),
tap((args) => this.execution.params.debug && Object.assign(head.debug ?? {}, { args })),
switchMap((args) => this.invokeFunction(fn, input, args)),
this.execution.params.partial ? identity : last(),
switchMap((output) => (getType(output) === 'error' ? throwError(output) : of(output))),
tap((output) => this.execution.params.debug && Object.assign(head.debug, { output })),
tap(
(output) => this.execution.params.debug && Object.assign(head.debug ?? {}, { output })
),
switchMap((output) => this.invokeChain<ChainOutput>(tail, output)),
catchError((rawError) => {
const error = createError(rawError);
error.error.message = `[${fnName}] > ${error.error.message}`;

if (this.execution.params.debug) {
Object.assign(head.debug, { error, rawError, success: false });
Object.assign(head.debug ?? {}, { error, rawError, success: false });
}

return of(error);
Expand All @@ -440,7 +442,7 @@ export class Execution<
}),
finalize(() => {
if (this.execution.params.debug) {
Object.assign(head.debug, { duration: now() - timeStart });
Object.assign(head.debug ?? {}, { duration: now() - timeStart });
}
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { KnownTypeToString } from '../types';
import { TypeString } from '../types';
import { ArgumentType } from './arguments';

export class ExpressionFunctionParameter<T = unknown> {
Expand Down Expand Up @@ -46,6 +46,6 @@ export class ExpressionFunctionParameter<T = unknown> {
}

accepts(type: string) {
return !this.types?.length || this.types.includes(type as KnownTypeToString<T>);
return !this.types?.length || this.types.includes(type as TypeString<T>);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { SelectOption, SwitchOption } from '@kbn/vis-default-editor-plugin/public';
import { Labels } from '@kbn/charts-plugin/public';
import type { LabelRotation, Labels } from '@kbn/charts-plugin/public';

import { TruncateLabelsOption } from '../../common';
import { getRotateOptions } from '../../../collections';
Expand All @@ -34,7 +34,8 @@ function LabelOptions({
}: LabelOptionsProps) {
const setAxisLabelRotate = useCallback(
(paramName: 'rotate', value: Labels['rotate']) => {
setAxisLabel(paramName, Number(value));
const rotation = Number(value) as LabelRotation;
setAxisLabel(paramName, rotation);
},
[setAxisLabel]
);
Expand Down Expand Up @@ -96,6 +97,7 @@ function LabelOptions({
options={rotateOptions}
paramName="rotate"
value={axisLabels.rotate}
// @ts-ignore ts upgrade v4.7.4
setValue={setAxisLabelRotate}
/>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const setupHandler = (commit: CommitFn, canvasOrigin: CanvasOriginFn, zoomScale?

// only commits the cursor position if there's a way to latch onto x/y calculation (canvasOrigin is knowable)
// or if left button is being held down (i.e. an element is being dragged)
if (buttons === 1 || canvasOrigin) {
//
if (buttons === 1 || canvasOrigin !== undefined) {
commit('cursorPosition', { x, y, altKey, metaKey, shiftKey, ctrlKey });
} else {
// clears cursorPosition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('CreateCaseForm', () => {
globalForm = form;

return (
// @ts-expect-error ts upgrade v4.7.4
<TestProviders {...testProviderProps}>
<Form form={form}>{children}</Form>
</TestProviders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ describe('EditableMarkdown', () => {
});

return (
// @ts-expect-error ts upgrade v4.7.4
<TestProviders {...testProviderProps}>
<Form form={form}>{children}</Form>
</TestProviders>
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/common/experimental_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const parseExperimentalConfigValue = (configValue: string[]): Experimenta
throw new FleetInvalidExperimentalValue(`[${value}] is not a supported experimental feature`);
}

// @ts-expect-error ts upgrade v4.7.4
enabledFeatures[value as keyof ExperimentalFeatures] = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ describe('Agent policy advanced options content', () => {
// remove when feature flag is removed
ExperimentalFeaturesService.init({
...allowedExperimentalValues,
// @ts-expect-error ts upgrade v4.7.4
agentTamperProtectionEnabled: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('AgentPolicyListPage', () => {
// todo: this can be removed when agentTamperProtectionEnabled feature flag is enabled/deleted
ExperimentalFeaturesService.init({
...allowedExperimentalValues,
// @ts-expect-error ts upgrade v4.7.4
agentTamperProtectionEnabled: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ describe('agent_list_page', () => {
// todo: this can be removed when agentTamperProtectionEnabled feature flag is enabled/deleted
ExperimentalFeaturesService.init({
...allowedExperimentalValues,
// @ts-expect-error ts upgrade v4.7.4
agentTamperProtectionEnabled: true,
});

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/server/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const createAppContextStartContractMock = (
securitySetup: securityMock.createSetup(),
securityStart: securityMock.createStart(),
logger: loggingSystemMock.create().get(),
// @ts-expect-error ts upgrade v4.7.4
experimentalFeatures: {
agentTamperProtectionEnabled: true,
diagnosticFileUploadEnabled: true,
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/server/routes/health_check/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const postHealthCheckHandler: FleetRequestHandler<
agent: new https.Agent({
rejectUnauthorized: false,
}),
// @ts-expect-error ts upgrade v4.7.4
signal: abortController.signal,
});
const bodyRes = await res.json();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class ExtensionPointStorageClient implements ExtensionPointStorageClientI
async pipeRun<
T extends ExtensionPoint['type'],
D extends NarrowExtensionPointToType<T> = NarrowExtensionPointToType<T>,
// @ts-expect-error ts upgrade v4.7.4
P extends Parameters<D['callback']> = Parameters<D['callback']>
>(
extensionType: T,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export interface ExtensionPointStorageClientInterface {
pipeRun<
T extends ExtensionPoint['type'],
D extends NarrowExtensionPointToType<T> = NarrowExtensionPointToType<T>,
// @ts-expect-error ts upgrade v4.7.4
P extends Parameters<D['callback']> = Parameters<D['callback']>
>(
extensionType: T,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export const ApmOverviewPage: React.FC<ComponentProps> = ({ clusters }) => {
getPageData={getPageData}
data-test-subj="apmOverviewPage"
>
{data && <ApmOverview {...data} onBrush={onBrush} zoomInfo={zoomInfo} />}
{
// @ts-expect-error ts upgrade v4.7.4
data && <ApmOverview {...data} onBrush={onBrush} zoomInfo={zoomInfo} />
}
</ApmTemplate>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export const EntSearchOverviewPage: React.FC<ComponentProps> = ({ clusters }) =>
data-test-subj="entSearchOverviewPage"
>
<div data-test-subj="entSearchOverviewPage">
{data && <EnterpriseSearchOverview {...data} onBrush={onBrush} zoomInfo={zoomInfo} />}
{
// @ts-expect-error ts upgrade v4.7.4
data && <EnterpriseSearchOverview {...data} onBrush={onBrush} zoomInfo={zoomInfo} />
}
</div>
</EntSearchTemplate>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const fieldDescriptorToBrowserFieldMapper = (fields: FieldDescriptor[]):
const browserField = browserFieldFactory(field, category);

if (browserFields[category] && browserFields[category]) {
// @ts-expect-error ts upgrade to v4.7.4
Object.assign(browserFields[category].fields, browserField);
} else {
browserFields[category] = { fields: browserField };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class Authenticator {
...providerCommonOptions,
name,
logger: options.loggers.get(type, name),
urls: { loggedOut: (request) => this.getLoggedOutURL(request, type) },
urls: { loggedOut: (request: KibanaRequest) => this.getLoggedOutURL(request, type) },
}),
this.options.config.authc.providers[type]?.[name]
),
Expand All @@ -275,7 +275,8 @@ export class Authenticator {
name: '__http__',
logger: options.loggers.get(HTTPAuthenticationProvider.type),
urls: {
loggedOut: (request) => this.getLoggedOutURL(request, HTTPAuthenticationProvider.type),
loggedOut: (request: KibanaRequest) =>
this.getLoggedOutURL(request, HTTPAuthenticationProvider.type),
},
})
);
Expand Down
18 changes: 10 additions & 8 deletions x-pack/plugins/security/server/session_management/session_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,18 @@ export function getSessionIndexSettings({
},
},
mappings: {
dynamic: 'strict',
dynamic: 'strict' as const,
_meta: { [SESSION_INDEX_MAPPINGS_VERSION_META_FIELD_NAME]: SESSION_INDEX_MAPPINGS_VERSION },
properties: {
usernameHash: { type: 'keyword' },
provider: { properties: { name: { type: 'keyword' }, type: { type: 'keyword' } } },
idleTimeoutExpiration: { type: 'date' },
createdAt: { type: 'date' },
lifespanExpiration: { type: 'date' },
accessAgreementAcknowledged: { type: 'boolean' },
content: { type: 'binary' },
usernameHash: { type: 'keyword' as const },
provider: {
properties: { name: { type: 'keyword' as const }, type: { type: 'keyword' as const } },
},
idleTimeoutExpiration: { type: 'date' as const },
createdAt: { type: 'date' as const },
lifespanExpiration: { type: 'date' as const },
accessAgreementAcknowledged: { type: 'boolean' as const },
content: { type: 'binary' as const },
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const OsqueryResponseAction = React.memo((props: OsqueryResponseActionPro
);
}

// @ts-expect-error ts upgrade v4.7.4
if (isMounted() && OsqueryForm) {
return (
<UseField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export const PageOverlay = memo<PageOverlayProps>(
useEffect(() => {
if (
isMounted() &&
// @ts-expect-error ts upgrade v4.7.4
onHide &&
hideOnUrlPathnameChange &&
!isHidden &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const InnerEventsForm = <T extends OperatingSystem>({
key={String(protectionField)}
id={htmlIdGenerator()()}
label={name}
// @ts-expect-error ts upgrade v4.7.4
data-test-subj={`policy${OPERATING_SYSTEM_TO_TEST_SUBJ[os]}Event_${protectionField}`}
checked={selection[protectionField]}
onChange={(event) => onValueSelection(protectionField, event.target.checked)}
Expand Down Expand Up @@ -164,6 +165,7 @@ const InnerEventsForm = <T extends OperatingSystem>({
<EuiCheckbox
id={htmlIdGenerator()()}
label={name}
// @ts-expect-error ts upgrade v4.7.4
data-test-subj={`policy${OPERATING_SYSTEM_TO_TEST_SUBJ[os]}Event_${protectionField}`}
checked={selection[protectionField]}
onChange={(event) => onValueSelection(protectionField, event.target.checked)}
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/security_solution/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"server/**/*.json",
"scripts/**/*.json",
"public/**/*.json",
"../../../typings/**/*",
"./public/management/cypress/cypress.d.ts"
"../../../typings/**/*"
],
"exclude": [
"target/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ describe('duration anomaly alert', () => {
const mockDate = 'date';
beforeAll(() => {
Date.now = jest.fn().mockReturnValue(new Date('2021-05-13T12:33:37.000Z'));
// @ts-expect-error ts upgrade v4.7.4
jest.spyOn(Intl, 'DateTimeFormat').mockImplementation(() => ({
format: jest.fn(),
formatToParts: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const StorybookContextDecorator: React.FC<StorybookContextDecoratorProps>
ExperimentalFeaturesService.init({
experimentalFeatures: {
rulesListDatagrid: true,
// @ts-expect-error ts upgrade v4.7.4
internalAlertsTable: true,
ruleTagFilter: true,
ruleStatusFilter: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const parseExperimentalConfigValue = (configValue: string[]): Experimenta
throw new TriggersActionsUIInvalidExperimentalValue(`[${value}] is not valid.`);
}

// @ts-expect-error ts upgrade v4.7.4
enabledFeatures[value as keyof ExperimentalFeatures] = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('getIsExperimentalFeatureEnabled', () => {
ExperimentalFeaturesService.init({
experimentalFeatures: {
rulesListDatagrid: true,
// @ts-expect-error ts upgrade v4.7.4
internalAlertsTable: true,
rulesDetailLogs: true,
ruleTagFilter: true,
Expand Down
Loading