Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/elastic/kibana into event-l…
Browse files Browse the repository at this point in the history
…og/hidden-again
  • Loading branch information
ymao1 committed Jan 13, 2022
2 parents bcf2825 + 0da9156 commit 97e3961
Show file tree
Hide file tree
Showing 286 changed files with 7,662 additions and 3,732 deletions.
5 changes: 4 additions & 1 deletion docs/user/security/audit-logging.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ Refer to the corresponding {es} logs for potential write errors.
| `user_logout`
| `unknown` | User is logging out.

| `session_cleanup`
| `unknown` | Removing invalid or expired session.

| `access_agreement_acknowledged`
| N/A | User has acknowledged the access agreement.
| n/a | User has acknowledged the access agreement.

3+a|
===== Category: database
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
"@dnd-kit/core": "^3.1.1",
"@dnd-kit/sortable": "^4.0.0",
"@dnd-kit/utilities": "^2.0.0",
"@elastic/apm-rum": "^5.10.0",
"@elastic/apm-rum-react": "^1.3.2",
"@elastic/apm-rum": "^5.10.1",
"@elastic/apm-rum-react": "^1.3.3",
"@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace",
"@elastic/charts": "40.2.0",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
Expand Down Expand Up @@ -602,6 +602,7 @@
"@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types",
"@types/kbn__std": "link:bazel-bin/packages/kbn-std/npm_module_types",
"@types/kbn__telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types",
"@types/kbn__ui-shared-deps-npm": "link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types",
"@types/kbn__utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module_types",
"@types/kbn__utils": "link:bazel-bin/packages/kbn-utils/npm_module_types",
"@types/license-checker": "15.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ filegroup(
srcs = [
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-datemath:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
Expand Down Expand Up @@ -119,6 +120,7 @@ filegroup(
"//packages/kbn-server-route-repository:build_types",
"//packages/kbn-std:build_types",
"//packages/kbn-telemetry-tools:build_types",
"//packages/kbn-ui-shared-deps-npm:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
],
Expand Down
12 changes: 12 additions & 0 deletions packages/elastic-safer-lodash-set/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@ filegroup(
],
visibility = ["//visibility:public"],
)

alias(
name = "npm_module_types",
actual = PKG_BASE_NAME,
visibility = ["//visibility:public"],
)

alias(
name = "build_types",
actual = "build",
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion packages/kbn-apm-config-loader/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-utils:npm_module_types",
"@npm//@elastic/apm-rum",
"@npm//@types/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-logging",
"//packages/kbn-std:npm_module_types",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TYPES_DEPS = [
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
"//packages/kbn-ui-shared-deps-src",
"//packages/kbn-utils:npm_module_types",
"@npm//chalk",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-storybook/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
"//packages/kbn-ui-shared-deps-src",
"//packages/kbn-utils:npm_module_types",
"@npm//@storybook/addons",
Expand Down
26 changes: 22 additions & 4 deletions packages/kbn-ui-shared-deps-npm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-ui-shared-deps-npm"
PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-npm"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__ui-shared-deps-npm"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -150,7 +151,7 @@ webpack(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types", ":shared_built_assets"],
deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand All @@ -169,3 +170,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
3 changes: 1 addition & 2 deletions packages/kbn-ui-shared-deps-npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "target_node/index.js",
"browser": "target_node/entry.js",
"types": "target_types/index.d.ts"
"browser": "target_node/entry.js"
}
14 changes: 10 additions & 4 deletions packages/kbn-ui-shared-deps-npm/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@

const Path = require('path');

// extracted const vars
const distDir = Path.resolve(__dirname, '../shared_built_assets');
const dllManifestPath = Path.resolve(distDir, 'kbn-ui-shared-deps-npm-manifest.json');
const dllFilename = 'kbn-ui-shared-deps-npm.dll.js';
const publicPathLoader = require.resolve('./public_path_loader');

/**
* Absolute path to the distributable directory
*/
exports.distDir = Path.resolve(__dirname, '../shared_built_assets');
exports.distDir = distDir;

/**
* Path to dll manifest of modules included in this bundle
*/
exports.dllManifestPath = Path.resolve(exports.distDir, 'kbn-ui-shared-deps-npm-manifest.json');
exports.dllManifestPath = dllManifestPath;

/**
* Filename of the main bundle file in the distributable directory
*/
exports.dllFilename = 'kbn-ui-shared-deps-npm.dll.js';
exports.dllFilename = dllFilename;

/**
* Filename of the light-theme css file in the distributable directory
Expand Down Expand Up @@ -54,4 +60,4 @@ exports.darkCssDistFilename = (themeVersion) => {
/**
* Webpack loader for configuring the public path lookup from `window.__kbnPublicPath__`.
*/
exports.publicPathLoader = require.resolve('./public_path_loader');
exports.publicPathLoader = publicPathLoader;
4 changes: 2 additions & 2 deletions packages/kbn-ui-shared-deps-src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/elastic-datemath:npm_module_types",
"//packages/elastic-safer-lodash-set",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-analytics:npm_module_types",
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-i18n-react:npm_module_types",
"//packages/kbn-monaco:npm_module_types",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
"@npm//@elastic/eui",
"@npm//webpack",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/

import type { collectSavedObjects } from './lib/collect_saved_objects';
import type { checkReferenceOrigins } from './lib/check_reference_origins';
import type { regenerateIds } from './lib/regenerate_ids';
import type { validateReferences } from './lib/validate_references';
import type { checkConflicts } from './lib/check_conflicts';
import type { checkOriginConflicts } from './lib/check_origin_conflicts';
import type { createSavedObjects } from './lib/create_saved_objects';
import type { executeImportHooks } from './lib/execute_import_hooks';

export const mockCollectSavedObjects = jest.fn() as jest.MockedFunction<typeof collectSavedObjects>;
jest.mock('./lib/collect_saved_objects', () => ({
collectSavedObjects: mockCollectSavedObjects,
}));

export const mockCheckReferenceOrigins = jest.fn() as jest.MockedFunction<
typeof checkReferenceOrigins
>;
jest.mock('./lib/check_reference_origins', () => ({
checkReferenceOrigins: mockCheckReferenceOrigins,
}));

export const mockRegenerateIds = jest.fn() as jest.MockedFunction<typeof regenerateIds>;
jest.mock('./lib/regenerate_ids', () => ({
regenerateIds: mockRegenerateIds,
}));

export const mockValidateReferences = jest.fn() as jest.MockedFunction<typeof validateReferences>;
jest.mock('./lib/validate_references', () => ({
validateReferences: mockValidateReferences,
}));

export const mockCheckConflicts = jest.fn() as jest.MockedFunction<typeof checkConflicts>;
jest.mock('./lib/check_conflicts', () => ({
checkConflicts: mockCheckConflicts,
}));

export const mockCheckOriginConflicts = jest.fn() as jest.MockedFunction<
typeof checkOriginConflicts
>;
jest.mock('./lib/check_origin_conflicts', () => ({
checkOriginConflicts: mockCheckOriginConflicts,
}));

export const mockCreateSavedObjects = jest.fn() as jest.MockedFunction<typeof createSavedObjects>;
jest.mock('./lib/create_saved_objects', () => ({
createSavedObjects: mockCreateSavedObjects,
}));

export const mockExecuteImportHooks = jest.fn() as jest.MockedFunction<typeof executeImportHooks>;
jest.mock('./lib/execute_import_hooks', () => ({
executeImportHooks: mockExecuteImportHooks,
}));
Loading

0 comments on commit 97e3961

Please sign in to comment.