From 1ed2ec8e57ab5da100988b00c697e2d6d6d615e9 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 31 Oct 2022 14:46:52 +0100 Subject: [PATCH] [Files] move to src (#144044) --- .github/CODEOWNERS | 4 +- .i18nrc.json | 6 +- docs/developer/plugin-list.asciidoc | 8 +- .../files_example/.i18nrc.json | 0 .../files_example/README.md | 0 .../files_example/common/index.ts | 5 +- .../files_example/kibana.json | 0 .../files_example/public/application.tsx | 5 +- .../files_example/public/components/app.tsx | 5 +- .../public/components/confirm_button.tsx | 5 +- .../public/components/details_flyout.tsx | 6 +- .../public/components/file_picker.tsx | 5 +- .../files_example/public/components/modal.tsx | 5 +- .../files_example/public/imports.ts | 5 +- .../files_example/public/index.ts | 5 +- .../files_example/public/plugin.ts | 5 +- .../files_example/public/types.ts | 5 +- .../files_example/server/index.ts | 5 +- .../files_example/server/plugin.ts | 5 +- .../files_example/server/types.ts | 5 +- examples/files_example/tsconfig.json | 20 +++++ src/dev/storybook/aliases.ts | 2 +- {x-pack => src}/plugins/files/.i18nrc.json | 0 .../plugins/files/.storybook/main.ts | 5 +- .../plugins/files/.storybook/manager.ts | 7 +- {x-pack => src}/plugins/files/README.md | 0 .../plugins/files/common/api_routes.ts | 5 +- .../plugins/files/common/constants.ts | 5 +- .../files/common/file_kinds_registry/index.ts | 6 +- {x-pack => src}/plugins/files/common/index.ts | 5 +- {x-pack => src}/plugins/files/common/types.ts | 6 +- .../plugins/files/docs/tutorial.mdx | 2 +- src/plugins/files/jest.config.js | 16 ++++ .../plugins/files/jest.integration.config.js | 7 +- {x-pack => src}/plugins/files/kibana.json | 0 .../files/public/components/context.tsx | 5 +- .../components/clear_filter_button.tsx | 6 +- .../file_picker/components/error_content.tsx | 5 +- .../file_picker/components/file_card.scss | 0 .../file_picker/components/file_card.tsx | 5 +- .../file_picker/components/file_grid.tsx | 5 +- .../file_picker/components/modal_footer.tsx | 5 +- .../file_picker/components/pagination.tsx | 5 +- .../file_picker/components/search_field.tsx | 5 +- .../file_picker/components/select_button.tsx | 5 +- .../file_picker/components/title.tsx | 6 +- .../file_picker/components/upload_files.tsx | 5 +- .../public/components/file_picker/context.tsx | 5 +- .../components/file_picker/file_picker.scss | 0 .../file_picker/file_picker.stories.tsx | 6 +- .../file_picker/file_picker.test.tsx | 6 +- .../components/file_picker/file_picker.tsx | 5 +- .../file_picker/file_picker_state.test.ts | 5 +- .../file_picker/file_picker_state.ts | 6 +- .../components/file_picker/i18n_texts.ts | 50 ++++++++++++ .../public/components/file_picker/index.tsx | 5 +- .../components/image/components/blurhash.tsx | 6 +- .../components/image/components/img.tsx | 6 +- .../components/image/components/index.ts | 5 +- .../image/image.constants.stories.tsx | 5 +- .../public/components/image/image.stories.tsx | 6 +- .../files/public/components/image/image.tsx | 6 +- .../files/public/components/image/index.ts | 5 +- .../files/public/components/image/styles.ts | 5 +- .../components/image/use_viewport_observer.ts | 5 +- .../image/viewport_observer.test.ts | 6 +- .../components/image/viewport_observer.ts | 6 +- .../plugins/files/public/components/index.ts | 5 +- .../files/public/components/stories_shared.ts | 5 +- .../upload_file/components/cancel_button.tsx | 5 +- .../upload_file/components/clear_button.tsx | 5 +- .../upload_file/components/control_button.tsx | 5 +- .../upload_file/components/index.ts | 5 +- .../upload_file/components/retry_button.tsx | 6 +- .../upload_file/components/upload_button.tsx | 5 +- .../public/components/upload_file/context.ts | 6 +- .../components/upload_file/i18n_texts.ts | 42 ++++++++++ .../public/components/upload_file/index.tsx | 5 +- .../upload_file/upload_file.component.tsx | 5 +- .../upload_file/upload_file.stories.tsx | 6 +- .../upload_file/upload_file.test.tsx | 5 +- .../components/upload_file/upload_file.tsx | 5 +- .../upload_file/upload_state.test.ts | 5 +- .../components/upload_file/upload_state.ts | 5 +- .../components/upload_file/util/index.ts | 5 +- .../upload_file/util/parse_file_name.test.ts | 5 +- .../upload_file/util/parse_file_name.ts | 5 +- .../upload_file/util/simple_state_subject.ts | 5 +- .../public/components/use_behavior_subject.ts | 5 +- .../components/util/image_metadata.test.ts | 6 +- .../public/components/util/image_metadata.ts | 5 +- .../files/public/components/util/index.ts | 5 +- .../public/files_client/files_client.test.ts | 5 +- .../files/public/files_client/files_client.ts | 5 +- .../files/public/files_client/index.ts | 5 +- {x-pack => src}/plugins/files/public/index.ts | 5 +- {x-pack => src}/plugins/files/public/mocks.ts | 5 +- .../plugins/files/public/plugin.ts | 5 +- {x-pack => src}/plugins/files/public/types.ts | 5 +- .../plugins/files/server/audit_events.ts | 5 +- .../blob_storage_service/adapters/README.md | 0 .../es/content_stream/content_stream.test.ts | 5 +- .../es/content_stream/content_stream.ts | 5 +- .../adapters/es/content_stream/index.ts | 5 +- .../adapters/es/es.test.ts | 6 +- .../blob_storage_service/adapters/es/es.ts | 5 +- .../blob_storage_service/adapters/es/index.ts | 5 +- .../adapters/es/integration_tests/es.test.ts | 5 +- .../adapters/es/mappings.ts | 5 +- .../blob_storage_service/adapters/index.ts | 5 +- .../blob_storage_service.ts | 6 +- .../server/blob_storage_service/index.ts | 5 +- .../server/blob_storage_service/types.ts | 5 +- .../plugins/files/server/feature.ts | 9 ++- .../plugins/files/server/file/errors.ts | 5 +- .../plugins/files/server/file/file.test.ts | 6 +- .../plugins/files/server/file/file.ts | 5 +- .../server/file/file_attributes_reducer.ts | 6 +- .../plugins/files/server/file/index.ts | 5 +- .../plugins/files/server/file/to_json.ts | 5 +- .../file_client/create_es_file_client.ts | 5 +- .../files/server/file_client/file_client.ts | 6 +- .../file_metadata_client/adapters/es_index.ts | 5 +- .../file_metadata_client/adapters/index.ts | 5 +- .../adapters/query_filters.ts | 6 +- .../adapters/saved_objects.ts | 5 +- .../file_metadata_client.ts | 5 +- .../file_client/file_metadata_client/index.ts | 5 +- .../plugins/files/server/file_client/index.ts | 5 +- .../integration_tests/es_file_client.test.ts | 6 +- .../file_client/stream_transforms/index.ts | 5 +- .../max_byte_size_transform/errors.ts | 5 +- .../max_byte_size_transform/index.ts | 5 +- .../max_byte_size_transform.test.ts | 5 +- .../max_byte_size_transform.ts | 5 +- .../plugins/files/server/file_client/types.ts | 5 +- .../plugins/files/server/file_client/utils.ts | 5 +- .../files/server/file_service/errors.ts | 5 +- .../server/file_service/file_action_types.ts | 5 +- .../files/server/file_service/file_service.ts | 5 +- .../file_service/file_service_factory.ts | 5 +- .../files/server/file_service/index.ts | 5 +- .../file_service/internal_file_service.ts | 5 +- .../files/server/file_share_service/errors.ts | 5 +- .../generate_share_token.test.ts | 5 +- .../generate_share_token.ts | 5 +- .../files/server/file_share_service/index.ts | 5 +- .../internal_file_share_service.ts | 6 +- .../files/server/file_share_service/types.ts | 5 +- {x-pack => src}/plugins/files/server/index.ts | 5 +- .../files/server/integration_tests/README.md | 0 .../integration_tests/file_service.test.ts | 9 +-- {x-pack => src}/plugins/files/server/mocks.ts | 6 +- .../plugins/files/server/plugin.ts | 5 +- .../plugins/files/server/routes/api_routes.ts | 5 +- .../files/server/routes/common.test.ts | 5 +- .../plugins/files/server/routes/common.ts | 6 +- .../files/server/routes/common_schemas.ts | 5 +- .../files/server/routes/file_kind/create.ts | 5 +- .../files/server/routes/file_kind/delete.ts | 5 +- .../files/server/routes/file_kind/download.ts | 5 +- .../server/routes/file_kind/enhance_router.ts | 5 +- .../server/routes/file_kind/get_by_id.ts | 5 +- .../files/server/routes/file_kind/helpers.ts | 5 +- .../files/server/routes/file_kind/index.ts | 6 +- .../integration_tests/file_kind_http.test.ts | 5 +- .../files/server/routes/file_kind/list.ts | 6 +- .../server/routes/file_kind/share/get.ts | 6 +- .../server/routes/file_kind/share/list.ts | 6 +- .../server/routes/file_kind/share/share.ts | 6 +- .../server/routes/file_kind/share/unshare.ts | 6 +- .../files/server/routes/file_kind/types.ts | 5 +- .../files/server/routes/file_kind/update.ts | 5 +- .../server/routes/file_kind/upload.test.ts | 5 +- .../files/server/routes/file_kind/upload.ts | 5 +- .../plugins/files/server/routes/find.ts | 6 +- .../plugins/files/server/routes/index.ts | 5 +- .../routes/integration_tests/routes.test.ts | 5 +- .../plugins/files/server/routes/metrics.ts | 6 +- .../server/routes/public_facing/download.ts | 6 +- .../plugins/files/server/routes/test_utils.ts | 5 +- .../plugins/files/server/routes/types.ts | 5 +- .../files/server/saved_objects/file.ts | 5 +- .../files/server/saved_objects/file_share.ts | 5 +- .../files/server/saved_objects/index.ts | 5 +- .../plugins/files/server/test_utils/index.ts | 5 +- .../setup_integration_environment.ts | 12 +-- {x-pack => src}/plugins/files/server/types.ts | 6 +- .../plugins/files/server/usage/counters.ts | 5 +- .../plugins/files/server/usage/index.ts | 5 +- .../usage/integration_tests/usage.test.ts | 5 +- .../server/usage/register_usage_collector.ts | 6 +- .../plugins/files/server/usage/schema.ts | 5 +- {x-pack => src}/plugins/files/tsconfig.json | 6 +- src/plugins/telemetry/schema/oss_plugins.json | 77 +++++++++++++++++++ tsconfig.base.json | 8 +- x-pack/.i18nrc.json | 1 - x-pack/examples/files_example/tsconfig.json | 22 ------ x-pack/plugins/files/jest.config.js | 15 ---- .../components/file_picker/i18n_texts.ts | 49 ------------ .../components/upload_file/i18n_texts.ts | 41 ---------- .../services/endpoint_response_actions.ts | 2 +- .../plugins/security_solution/tsconfig.json | 4 +- .../schema/xpack_plugins.json | 77 ------------------- 204 files changed, 792 insertions(+), 588 deletions(-) rename {x-pack/examples => examples}/files_example/.i18nrc.json (100%) rename {x-pack/examples => examples}/files_example/README.md (100%) rename {x-pack/examples => examples}/files_example/common/index.ts (78%) rename {x-pack/examples => examples}/files_example/kibana.json (100%) rename {x-pack/examples => examples}/files_example/public/application.tsx (84%) rename {x-pack/examples => examples}/files_example/public/components/app.tsx (96%) rename {x-pack/examples => examples}/files_example/public/components/confirm_button.tsx (85%) rename {x-pack/examples => examples}/files_example/public/components/details_flyout.tsx (94%) rename {x-pack/examples => examples}/files_example/public/components/file_picker.tsx (79%) rename {x-pack/examples => examples}/files_example/public/components/modal.tsx (84%) rename {x-pack/examples => examples}/files_example/public/imports.ts (69%) rename {x-pack/examples => examples}/files_example/public/index.ts (66%) rename {x-pack/examples => examples}/files_example/public/plugin.ts (90%) rename {x-pack/examples => examples}/files_example/public/types.ts (79%) rename {x-pack/examples => examples}/files_example/server/index.ts (72%) rename {x-pack/examples => examples}/files_example/server/plugin.ts (83%) rename {x-pack/examples => examples}/files_example/server/types.ts (66%) create mode 100644 examples/files_example/tsconfig.json rename {x-pack => src}/plugins/files/.i18nrc.json (100%) rename {x-pack => src}/plugins/files/.storybook/main.ts (64%) rename {x-pack => src}/plugins/files/.storybook/manager.ts (63%) rename {x-pack => src}/plugins/files/README.md (100%) rename {x-pack => src}/plugins/files/common/api_routes.ts (93%) rename {x-pack => src}/plugins/files/common/constants.ts (79%) rename {x-pack => src}/plugins/files/common/file_kinds_registry/index.ts (89%) rename {x-pack => src}/plugins/files/common/index.ts (77%) rename {x-pack => src}/plugins/files/common/types.ts (98%) rename {x-pack => src}/plugins/files/docs/tutorial.mdx (99%) create mode 100644 src/plugins/files/jest.config.js rename {x-pack => src}/plugins/files/jest.integration.config.js (52%) rename {x-pack => src}/plugins/files/kibana.json (100%) rename {x-pack => src}/plugins/files/public/components/context.tsx (86%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/clear_filter_button.tsx (85%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/error_content.tsx (84%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/file_card.scss (100%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/file_card.tsx (94%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/file_grid.tsx (86%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/modal_footer.tsx (91%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/pagination.tsx (84%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/search_field.tsx (85%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/select_button.tsx (85%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/title.tsx (69%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/upload_files.tsx (86%) rename {x-pack => src}/plugins/files/public/components/file_picker/context.tsx (88%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.scss (100%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.stories.tsx (96%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.test.tsx (95%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.tsx (94%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker_state.test.ts (97%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker_state.ts (97%) create mode 100644 src/plugins/files/public/components/file_picker/i18n_texts.ts rename {x-pack => src}/plugins/files/public/components/file_picker/index.tsx (75%) rename {x-pack => src}/plugins/files/public/components/image/components/blurhash.tsx (89%) rename {x-pack => src}/plugins/files/public/components/image/components/img.tsx (89%) rename {x-pack => src}/plugins/files/public/components/image/components/index.ts (59%) rename {x-pack => src}/plugins/files/public/components/image/image.constants.stories.tsx (97%) rename {x-pack => src}/plugins/files/public/components/image/image.stories.tsx (92%) rename {x-pack => src}/plugins/files/public/components/image/image.tsx (93%) rename {x-pack => src}/plugins/files/public/components/image/index.ts (57%) rename {x-pack => src}/plugins/files/public/components/image/styles.ts (72%) rename {x-pack => src}/plugins/files/public/components/image/use_viewport_observer.ts (85%) rename {x-pack => src}/plugins/files/public/components/image/viewport_observer.test.ts (92%) rename {x-pack => src}/plugins/files/public/components/image/viewport_observer.ts (89%) rename {x-pack => src}/plugins/files/public/components/index.ts (67%) rename {x-pack => src}/plugins/files/public/components/stories_shared.ts (77%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/cancel_button.tsx (86%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/clear_button.tsx (76%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/control_button.tsx (86%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/index.ts (58%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/retry_button.tsx (81%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/upload_button.tsx (87%) rename {x-pack => src}/plugins/files/public/components/upload_file/context.ts (66%) create mode 100644 src/plugins/files/public/components/upload_file/i18n_texts.ts rename {x-pack => src}/plugins/files/public/components/upload_file/index.tsx (76%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.component.tsx (95%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.stories.tsx (95%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.test.tsx (97%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.tsx (95%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_state.test.ts (97%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_state.ts (97%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/index.ts (61%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/parse_file_name.test.ts (82%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/parse_file_name.ts (71%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/simple_state_subject.ts (78%) rename {x-pack => src}/plugins/files/public/components/use_behavior_subject.ts (66%) rename {x-pack => src}/plugins/files/public/components/util/image_metadata.test.ts (86%) rename {x-pack => src}/plugins/files/public/components/util/image_metadata.ts (92%) rename {x-pack => src}/plugins/files/public/components/util/index.ts (61%) rename {x-pack => src}/plugins/files/public/files_client/files_client.test.ts (89%) rename {x-pack => src}/plugins/files/public/files_client/files_client.ts (96%) rename {x-pack => src}/plugins/files/public/files_client/index.ts (53%) rename {x-pack => src}/plugins/files/public/index.ts (75%) rename {x-pack => src}/plugins/files/public/mocks.ts (80%) rename {x-pack => src}/plugins/files/public/plugin.ts (91%) rename {x-pack => src}/plugins/files/public/types.ts (96%) rename {x-pack => src}/plugins/files/server/audit_events.ts (79%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/README.md (100%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts (98%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts (98%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts (69%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/es.test.ts (91%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/es.ts (96%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/index.ts (56%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts (96%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/mappings.ts (86%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/index.ts (56%) rename {x-pack => src}/plugins/files/server/blob_storage_service/blob_storage_service.ts (88%) rename {x-pack => src}/plugins/files/server/blob_storage_service/index.ts (65%) rename {x-pack => src}/plugins/files/server/blob_storage_service/types.ts (90%) rename {x-pack => src}/plugins/files/server/feature.ts (77%) rename {x-pack => src}/plugins/files/server/file/errors.ts (76%) rename {x-pack => src}/plugins/files/server/file/file.test.ts (95%) rename {x-pack => src}/plugins/files/server/file/file.ts (96%) rename {x-pack => src}/plugins/files/server/file/file_attributes_reducer.ts (86%) rename {x-pack => src}/plugins/files/server/file/index.ts (69%) rename {x-pack => src}/plugins/files/server/file/to_json.ts (86%) rename {x-pack => src}/plugins/files/server/file_client/create_es_file_client.ts (90%) rename {x-pack => src}/plugins/files/server/file_client/file_client.ts (97%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts (95%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/index.ts (60%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts (91%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts (95%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts (93%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/index.ts (72%) rename {x-pack => src}/plugins/files/server/file_client/index.ts (81%) rename {x-pack => src}/plugins/files/server/file_client/integration_tests/es_file_client.test.ts (96%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/index.ts (55%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts (65%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts (55%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts (87%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts (79%) rename {x-pack => src}/plugins/files/server/file_client/types.ts (94%) rename {x-pack => src}/plugins/files/server/file_client/utils.ts (71%) rename {x-pack => src}/plugins/files/server/file_service/errors.ts (61%) rename {x-pack => src}/plugins/files/server/file_service/file_action_types.ts (91%) rename {x-pack => src}/plugins/files/server/file_service/file_service.ts (92%) rename {x-pack => src}/plugins/files/server/file_service/file_service_factory.ts (96%) rename {x-pack => src}/plugins/files/server/file_service/index.ts (71%) rename {x-pack => src}/plugins/files/server/file_service/internal_file_service.ts (95%) rename {x-pack => src}/plugins/files/server/file_share_service/errors.ts (74%) rename {x-pack => src}/plugins/files/server/file_share_service/generate_share_token.test.ts (70%) rename {x-pack => src}/plugins/files/server/file_share_service/generate_share_token.ts (82%) rename {x-pack => src}/plugins/files/server/file_share_service/index.ts (74%) rename {x-pack => src}/plugins/files/server/file_share_service/internal_file_share_service.ts (97%) rename {x-pack => src}/plugins/files/server/file_share_service/types.ts (85%) rename {x-pack => src}/plugins/files/server/index.ts (85%) rename {x-pack => src}/plugins/files/server/integration_tests/README.md (100%) rename {x-pack => src}/plugins/files/server/integration_tests/file_service.test.ts (98%) rename {x-pack => src}/plugins/files/server/mocks.ts (92%) rename {x-pack => src}/plugins/files/server/plugin.ts (94%) rename {x-pack => src}/plugins/files/server/routes/api_routes.ts (89%) rename {x-pack => src}/plugins/files/server/routes/common.test.ts (91%) rename {x-pack => src}/plugins/files/server/routes/common.ts (87%) rename {x-pack => src}/plugins/files/server/routes/common_schemas.ts (87%) rename {x-pack => src}/plugins/files/server/routes/file_kind/create.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/delete.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/download.ts (90%) rename {x-pack => src}/plugins/files/server/routes/file_kind/enhance_router.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/get_by_id.ts (88%) rename {x-pack => src}/plugins/files/server/routes/file_kind/helpers.ts (85%) rename {x-pack => src}/plugins/files/server/routes/file_kind/index.ts (86%) rename {x-pack => src}/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts (97%) rename {x-pack => src}/plugins/files/server/routes/file_kind/list.ts (91%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/get.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/list.ts (88%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/share.ts (92%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/unshare.ts (88%) rename {x-pack => src}/plugins/files/server/routes/file_kind/types.ts (81%) rename {x-pack => src}/plugins/files/server/routes/file_kind/update.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/upload.test.ts (93%) rename {x-pack => src}/plugins/files/server/routes/file_kind/upload.ts (94%) rename {x-pack => src}/plugins/files/server/routes/find.ts (92%) rename {x-pack => src}/plugins/files/server/routes/index.ts (74%) rename {x-pack => src}/plugins/files/server/routes/integration_tests/routes.test.ts (97%) rename {x-pack => src}/plugins/files/server/routes/metrics.ts (84%) rename {x-pack => src}/plugins/files/server/routes/public_facing/download.ts (91%) rename {x-pack => src}/plugins/files/server/routes/test_utils.ts (82%) rename {x-pack => src}/plugins/files/server/routes/types.ts (86%) rename {x-pack => src}/plugins/files/server/saved_objects/file.ts (85%) rename {x-pack => src}/plugins/files/server/saved_objects/file_share.ts (84%) rename {x-pack => src}/plugins/files/server/saved_objects/index.ts (67%) rename {x-pack => src}/plugins/files/server/test_utils/index.ts (63%) rename {x-pack => src}/plugins/files/server/test_utils/setup_integration_environment.ts (92%) rename {x-pack => src}/plugins/files/server/types.ts (85%) rename {x-pack => src}/plugins/files/server/usage/counters.ts (84%) rename {x-pack => src}/plugins/files/server/usage/index.ts (62%) rename {x-pack => src}/plugins/files/server/usage/integration_tests/usage.test.ts (91%) rename {x-pack => src}/plugins/files/server/usage/register_usage_collector.ts (85%) rename {x-pack => src}/plugins/files/server/usage/schema.ts (89%) rename {x-pack => src}/plugins/files/tsconfig.json (62%) delete mode 100644 x-pack/examples/files_example/tsconfig.json delete mode 100644 x-pack/plugins/files/jest.config.js delete mode 100644 x-pack/plugins/files/public/components/file_picker/i18n_texts.ts delete mode 100644 x-pack/plugins/files/public/components/upload_file/i18n_texts.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4dc48e657542b..f536168edb6e8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -84,8 +84,8 @@ /x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services /x-pack/plugins/runtime_fields @elastic/kibana-app-services /src/plugins/dashboard/public/application/embeddable/viewport/print_media @elastic/kibana-app-services -x-pack/plugins/files @elastic/kibana-app-services -x-pack/examples/files_example @elastic/kibana-app-services +/src/plugins/files @elastic/kibana-app-services +/examples/files_example @elastic/kibana-app-services /x-pack/test/search_sessions_integration/ @elastic/kibana-app-services /test/plugin_functional/test_suites/panel_actions @elastic/kibana-app-services /test/plugin_functional/test_suites/data_plugin @elastic/kibana-app-services diff --git a/.i18nrc.json b/.i18nrc.json index 874c4ecbcc1ba..2894905ae8f88 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -9,10 +9,7 @@ "charts": "src/plugins/charts", "console": "src/plugins/console", "contentManagement": "packages/content-management", - "core": [ - "src/core", - "packages/core" - ], + "core": ["src/core", "packages/core"], "customIntegrations": "src/plugins/custom_integrations", "dashboard": "src/plugins/dashboard", "controls": "src/plugins/controls", @@ -41,6 +38,7 @@ "expressionTagcloud": "src/plugins/chart_expressions/expression_tagcloud", "eventAnnotation": "src/plugins/event_annotation", "fieldFormats": "src/plugins/field_formats", + "files": "src/plugins/files", "flot": "packages/kbn-flot-charts/lib", "guidedOnboarding": "src/plugins/guided_onboarding", "guidedOnboardingPackage": "packages/kbn-guided-onboarding", diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index feb87de90c2e6..32d807e016ebb 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -176,6 +176,10 @@ for use in their own application. |Index pattern fields formatters +|{kib-repo}blob/{branch}/src/plugins/files/README.md[files] +|File upload, download, sharing, and serving over HTTP implementation in Kibana. + + |{kib-repo}blob/{branch}/src/plugins/guided_onboarding/README.md[guidedOnboarding] |This plugin contains the code for the Guided Onboarding project. Guided onboarding consists of guides for Solutions (Enterprise Search, Observability, Security) that can be completed as a checklist of steps. The guides help users to ingest their data and to navigate to the correct Solutions pages. @@ -491,10 +495,6 @@ activities. |The features plugin enhance Kibana with a per-feature privilege system. -|{kib-repo}blob/{branch}/x-pack/plugins/files/README.md[files] -|File upload, download, sharing, and serving over HTTP implementation in Kibana. - - |{kib-repo}blob/{branch}/x-pack/plugins/file_upload[fileUpload] |WARNING: Missing README. diff --git a/x-pack/examples/files_example/.i18nrc.json b/examples/files_example/.i18nrc.json similarity index 100% rename from x-pack/examples/files_example/.i18nrc.json rename to examples/files_example/.i18nrc.json diff --git a/x-pack/examples/files_example/README.md b/examples/files_example/README.md similarity index 100% rename from x-pack/examples/files_example/README.md rename to examples/files_example/README.md diff --git a/x-pack/examples/files_example/common/index.ts b/examples/files_example/common/index.ts similarity index 78% rename from x-pack/examples/files_example/common/index.ts rename to examples/files_example/common/index.ts index aeb807e30aadf..566edb64b4240 100644 --- a/x-pack/examples/files_example/common/index.ts +++ b/examples/files_example/common/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileKind, FileImageMetadata } from '@kbn/files-plugin/common'; diff --git a/x-pack/examples/files_example/kibana.json b/examples/files_example/kibana.json similarity index 100% rename from x-pack/examples/files_example/kibana.json rename to examples/files_example/kibana.json diff --git a/x-pack/examples/files_example/public/application.tsx b/examples/files_example/public/application.tsx similarity index 84% rename from x-pack/examples/files_example/public/application.tsx rename to examples/files_example/public/application.tsx index 0bad6975c6da0..0795ec3a77420 100644 --- a/x-pack/examples/files_example/public/application.tsx +++ b/examples/files_example/public/application.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/examples/files_example/public/components/app.tsx b/examples/files_example/public/components/app.tsx similarity index 96% rename from x-pack/examples/files_example/public/components/app.tsx rename to examples/files_example/public/components/app.tsx index 9d10e33a8b23d..1f77ca9566cbc 100644 --- a/x-pack/examples/files_example/public/components/app.tsx +++ b/examples/files_example/public/components/app.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { useState } from 'react'; diff --git a/x-pack/examples/files_example/public/components/confirm_button.tsx b/examples/files_example/public/components/confirm_button.tsx similarity index 85% rename from x-pack/examples/files_example/public/components/confirm_button.tsx rename to examples/files_example/public/components/confirm_button.tsx index 05e64243bb374..b60f84b3369d0 100644 --- a/x-pack/examples/files_example/public/components/confirm_button.tsx +++ b/examples/files_example/public/components/confirm_button.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { useState, FunctionComponent } from 'react'; diff --git a/x-pack/examples/files_example/public/components/details_flyout.tsx b/examples/files_example/public/components/details_flyout.tsx similarity index 94% rename from x-pack/examples/files_example/public/components/details_flyout.tsx rename to examples/files_example/public/components/details_flyout.tsx index a417752d1a666..0303095a11a09 100644 --- a/x-pack/examples/files_example/public/components/details_flyout.tsx +++ b/examples/files_example/public/components/details_flyout.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 moment from 'moment'; import type { FunctionComponent } from 'react'; import React from 'react'; diff --git a/x-pack/examples/files_example/public/components/file_picker.tsx b/examples/files_example/public/components/file_picker.tsx similarity index 79% rename from x-pack/examples/files_example/public/components/file_picker.tsx rename to examples/files_example/public/components/file_picker.tsx index bc30ab92654d8..72a2057755742 100644 --- a/x-pack/examples/files_example/public/components/file_picker.tsx +++ b/examples/files_example/public/components/file_picker.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/examples/files_example/public/components/modal.tsx b/examples/files_example/public/components/modal.tsx similarity index 84% rename from x-pack/examples/files_example/public/components/modal.tsx rename to examples/files_example/public/components/modal.tsx index d8289257617cf..a314e5bd8ea4e 100644 --- a/x-pack/examples/files_example/public/components/modal.tsx +++ b/examples/files_example/public/components/modal.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FunctionComponent } from 'react'; diff --git a/x-pack/examples/files_example/public/imports.ts b/examples/files_example/public/imports.ts similarity index 69% rename from x-pack/examples/files_example/public/imports.ts rename to examples/files_example/public/imports.ts index 82835ba213615..f21a30a390e60 100644 --- a/x-pack/examples/files_example/public/imports.ts +++ b/examples/files_example/public/imports.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { diff --git a/x-pack/examples/files_example/public/index.ts b/examples/files_example/public/index.ts similarity index 66% rename from x-pack/examples/files_example/public/index.ts rename to examples/files_example/public/index.ts index 15e472c4f4cc6..e3128e6064517 100644 --- a/x-pack/examples/files_example/public/index.ts +++ b/examples/files_example/public/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FilesExamplePlugin } from './plugin'; diff --git a/x-pack/examples/files_example/public/plugin.ts b/examples/files_example/public/plugin.ts similarity index 90% rename from x-pack/examples/files_example/public/plugin.ts rename to examples/files_example/public/plugin.ts index 4906b59d4d6fc..ba0b1dfd54378 100644 --- a/x-pack/examples/files_example/public/plugin.ts +++ b/examples/files_example/public/plugin.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { AppNavLinkStatus } from '@kbn/core-application-browser'; diff --git a/x-pack/examples/files_example/public/types.ts b/examples/files_example/public/types.ts similarity index 79% rename from x-pack/examples/files_example/public/types.ts rename to examples/files_example/public/types.ts index 0ac384055aaf3..4ca9eb148872f 100644 --- a/x-pack/examples/files_example/public/types.ts +++ b/examples/files_example/public/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { MyImageMetadata } from '../common'; diff --git a/x-pack/examples/files_example/server/index.ts b/examples/files_example/server/index.ts similarity index 72% rename from x-pack/examples/files_example/server/index.ts rename to examples/files_example/server/index.ts index 5b6de87308e5e..d7edefbe1876d 100644 --- a/x-pack/examples/files_example/server/index.ts +++ b/examples/files_example/server/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { PluginInitializerContext } from '@kbn/core/server'; diff --git a/x-pack/examples/files_example/server/plugin.ts b/examples/files_example/server/plugin.ts similarity index 83% rename from x-pack/examples/files_example/server/plugin.ts rename to examples/files_example/server/plugin.ts index 2b077d6f3e88a..5ab9571a64207 100644 --- a/x-pack/examples/files_example/server/plugin.ts +++ b/examples/files_example/server/plugin.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; diff --git a/x-pack/examples/files_example/server/types.ts b/examples/files_example/server/types.ts similarity index 66% rename from x-pack/examples/files_example/server/types.ts rename to examples/files_example/server/types.ts index b1cef58620ca5..7f12e7fd94a1c 100644 --- a/x-pack/examples/files_example/server/types.ts +++ b/examples/files_example/server/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FilesSetup, FilesStart } from '@kbn/files-plugin/server'; diff --git a/examples/files_example/tsconfig.json b/examples/files_example/tsconfig.json new file mode 100644 index 0000000000000..2ce0ddb8f7d66 --- /dev/null +++ b/examples/files_example/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "index.ts", + "common/**/*", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*" + ], + "exclude": [], + "kbn_references": [ + { "path": "../../src/core/tsconfig.json" }, + { "path": "../developer_examples/tsconfig.json" }, + { "path": "../../src/plugins/files/tsconfig.json" }, + ] +} diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 85999d75b8997..7ad2c16224d62 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -33,7 +33,7 @@ export const storybookAliases = { expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook', expression_shape: 'src/plugins/expression_shape/.storybook', expression_tagcloud: 'src/plugins/chart_expressions/expression_tagcloud/.storybook', - files: 'x-pack/plugins/files/.storybook', + files: 'src/plugins/files/.storybook', fleet: 'x-pack/plugins/fleet/.storybook', home: 'src/plugins/home/.storybook', infra: 'x-pack/plugins/infra/.storybook', diff --git a/x-pack/plugins/files/.i18nrc.json b/src/plugins/files/.i18nrc.json similarity index 100% rename from x-pack/plugins/files/.i18nrc.json rename to src/plugins/files/.i18nrc.json diff --git a/x-pack/plugins/files/.storybook/main.ts b/src/plugins/files/.storybook/main.ts similarity index 64% rename from x-pack/plugins/files/.storybook/main.ts rename to src/plugins/files/.storybook/main.ts index e82ec6c47bbec..f9d5b3ea3eddc 100644 --- a/x-pack/plugins/files/.storybook/main.ts +++ b/src/plugins/files/.storybook/main.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { defaultConfig } from '@kbn/storybook'; diff --git a/x-pack/plugins/files/.storybook/manager.ts b/src/plugins/files/.storybook/manager.ts similarity index 63% rename from x-pack/plugins/files/.storybook/manager.ts rename to src/plugins/files/.storybook/manager.ts index 167046920a796..d49eea1784792 100644 --- a/x-pack/plugins/files/.storybook/manager.ts +++ b/src/plugins/files/.storybook/manager.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { addons } from '@storybook/addons'; @@ -13,7 +14,7 @@ addons.setConfig({ theme: create({ base: 'light', brandTitle: 'Kibana React Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/x-pack/plugins/files', + brandUrl: 'https://github.com/elastic/kibana/tree/main/src/plugins/files', }), showPanel: true.valueOf, selectedPanel: PANEL_ID, diff --git a/x-pack/plugins/files/README.md b/src/plugins/files/README.md similarity index 100% rename from x-pack/plugins/files/README.md rename to src/plugins/files/README.md diff --git a/x-pack/plugins/files/common/api_routes.ts b/src/plugins/files/common/api_routes.ts similarity index 93% rename from x-pack/plugins/files/common/api_routes.ts rename to src/plugins/files/common/api_routes.ts index 2f522e7c77150..7d95d24be9ec0 100644 --- a/x-pack/plugins/files/common/api_routes.ts +++ b/src/plugins/files/common/api_routes.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { TypeOf, Type } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/common/constants.ts b/src/plugins/files/common/constants.ts similarity index 79% rename from x-pack/plugins/files/common/constants.ts rename to src/plugins/files/common/constants.ts index 665945c1c65c1..19f0736eeaf47 100644 --- a/x-pack/plugins/files/common/constants.ts +++ b/src/plugins/files/common/constants.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ /** diff --git a/x-pack/plugins/files/common/file_kinds_registry/index.ts b/src/plugins/files/common/file_kinds_registry/index.ts similarity index 89% rename from x-pack/plugins/files/common/file_kinds_registry/index.ts rename to src/plugins/files/common/file_kinds_registry/index.ts index 5df6744546c03..afed906bd0aa3 100644 --- a/x-pack/plugins/files/common/file_kinds_registry/index.ts +++ b/src/plugins/files/common/file_kinds_registry/index.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { createGetterSetter } from '@kbn/kibana-utils-plugin/common'; import assert from 'assert'; import { FileKind } from '..'; diff --git a/x-pack/plugins/files/common/index.ts b/src/plugins/files/common/index.ts similarity index 77% rename from x-pack/plugins/files/common/index.ts rename to src/plugins/files/common/index.ts index be06c5708ce06..ece05d00a8bd3 100755 --- a/x-pack/plugins/files/common/index.ts +++ b/src/plugins/files/common/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { FILE_SO_TYPE, PLUGIN_ID, PLUGIN_NAME, ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; diff --git a/x-pack/plugins/files/common/types.ts b/src/plugins/files/common/types.ts similarity index 98% rename from x-pack/plugins/files/common/types.ts rename to src/plugins/files/common/types.ts index 53f97962597a8..48b05076fe02d 100644 --- a/x-pack/plugins/files/common/types.ts +++ b/src/plugins/files/common/types.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { SavedObject } from '@kbn/core/server'; import type { Observable } from 'rxjs'; import type { Readable } from 'stream'; diff --git a/x-pack/plugins/files/docs/tutorial.mdx b/src/plugins/files/docs/tutorial.mdx similarity index 99% rename from x-pack/plugins/files/docs/tutorial.mdx rename to src/plugins/files/docs/tutorial.mdx index b3bfed56dd865..deef2de26045d 100644 --- a/x-pack/plugins/files/docs/tutorial.mdx +++ b/src/plugins/files/docs/tutorial.mdx @@ -53,7 +53,7 @@ Consumers of the file service are able to decide what metadata they want to asso ### How to set up files for your plugin -All setup examples are based on the [`filesExample` plugin](https://github.com/elastic/kibana/blob/d431e87f7ff43833bff085e5bb5b2ab603bfa05d/x-pack/examples/files_example/README.md). +All setup examples are based on the [`filesExample` plugin](https://github.com/elastic/kibana/blob/d431e87f7ff43833bff085e5bb5b2ab603bfa05d/examples/files_example/README.md). First add the `files` plugin as a required dependency in your `kibana.json`: diff --git a/src/plugins/files/jest.config.js b/src/plugins/files/jest.config.js new file mode 100644 index 0000000000000..96e2f529c9ace --- /dev/null +++ b/src/plugins/files/jest.config.js @@ -0,0 +1,16 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/src/plugins/files'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/files', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/files/{common,public,server}/**/*.{js,ts,tsx}'], +}; diff --git a/x-pack/plugins/files/jest.integration.config.js b/src/plugins/files/jest.integration.config.js similarity index 52% rename from x-pack/plugins/files/jest.integration.config.js rename to src/plugins/files/jest.integration.config.js index fbcfd8ed04b67..f0fa0a8ccef45 100644 --- a/x-pack/plugins/files/jest.integration.config.js +++ b/src/plugins/files/jest.integration.config.js @@ -1,12 +1,13 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ module.exports = { preset: '@kbn/test/jest_integration', rootDir: '../../..', - roots: ['/x-pack/plugins/files'], + roots: ['/src/plugins/files'], }; diff --git a/x-pack/plugins/files/kibana.json b/src/plugins/files/kibana.json similarity index 100% rename from x-pack/plugins/files/kibana.json rename to src/plugins/files/kibana.json diff --git a/x-pack/plugins/files/public/components/context.tsx b/src/plugins/files/public/components/context.tsx similarity index 86% rename from x-pack/plugins/files/public/components/context.tsx rename to src/plugins/files/public/components/context.tsx index a18ea212beffe..fbf73999b625f 100644 --- a/x-pack/plugins/files/public/components/context.tsx +++ b/src/plugins/files/public/components/context.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { createContext, useContext, type FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx b/src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx similarity index 85% rename from x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx rename to src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx index 8ce3383c7e852..c8a373f70cd55 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx +++ b/src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import type { FunctionComponent } from 'react'; import useObservable from 'react-use/lib/useObservable'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/error_content.tsx b/src/plugins/files/public/components/file_picker/components/error_content.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/components/error_content.tsx rename to src/plugins/files/public/components/file_picker/components/error_content.tsx index c2925c793fe63..d37b2ffdc2f46 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/error_content.tsx +++ b/src/plugins/files/public/components/file_picker/components/error_content.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_card.scss b/src/plugins/files/public/components/file_picker/components/file_card.scss similarity index 100% rename from x-pack/plugins/files/public/components/file_picker/components/file_card.scss rename to src/plugins/files/public/components/file_picker/components/file_card.scss diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_card.tsx b/src/plugins/files/public/components/file_picker/components/file_card.tsx similarity index 94% rename from x-pack/plugins/files/public/components/file_picker/components/file_card.tsx rename to src/plugins/files/public/components/file_picker/components/file_card.tsx index 89d8e84c0397c..398634bc352d6 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/file_card.tsx +++ b/src/plugins/files/public/components/file_picker/components/file_card.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { useMemo } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_grid.tsx b/src/plugins/files/public/components/file_picker/components/file_grid.tsx similarity index 86% rename from x-pack/plugins/files/public/components/file_picker/components/file_grid.tsx rename to src/plugins/files/public/components/file_picker/components/file_grid.tsx index 2f2a9722d55b7..b2d9658e0a07f 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/file_grid.tsx +++ b/src/plugins/files/public/components/file_picker/components/file_grid.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx b/src/plugins/files/public/components/file_picker/components/modal_footer.tsx similarity index 91% rename from x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx rename to src/plugins/files/public/components/file_picker/components/modal_footer.tsx index 643efec8abebd..0a9ad3b3dcafa 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx +++ b/src/plugins/files/public/components/file_picker/components/modal_footer.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiModalFooter } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx b/src/plugins/files/public/components/file_picker/components/pagination.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/components/pagination.tsx rename to src/plugins/files/public/components/file_picker/components/pagination.tsx index 397a1cda06e48..3384edcab16c2 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx +++ b/src/plugins/files/public/components/file_picker/components/pagination.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/search_field.tsx b/src/plugins/files/public/components/file_picker/components/search_field.tsx similarity index 85% rename from x-pack/plugins/files/public/components/file_picker/components/search_field.tsx rename to src/plugins/files/public/components/file_picker/components/search_field.tsx index bb1fe3580d2bb..e1feb83800abc 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/search_field.tsx +++ b/src/plugins/files/public/components/file_picker/components/search_field.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/select_button.tsx b/src/plugins/files/public/components/file_picker/components/select_button.tsx similarity index 85% rename from x-pack/plugins/files/public/components/file_picker/components/select_button.tsx rename to src/plugins/files/public/components/file_picker/components/select_button.tsx index b6f1fa846fa48..c1a1fbdef3b5b 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/select_button.tsx +++ b/src/plugins/files/public/components/file_picker/components/select_button.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiButton } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/title.tsx b/src/plugins/files/public/components/file_picker/components/title.tsx similarity index 69% rename from x-pack/plugins/files/public/components/file_picker/components/title.tsx rename to src/plugins/files/public/components/file_picker/components/title.tsx index de1015241f656..2d4de8881fa76 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/title.tsx +++ b/src/plugins/files/public/components/file_picker/components/title.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import type { FunctionComponent } from 'react'; import { EuiTitle } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx b/src/plugins/files/public/components/file_picker/components/upload_files.tsx similarity index 86% rename from x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx rename to src/plugins/files/public/components/file_picker/components/upload_files.tsx index 143d20fd63ec0..a33f458bdf9d2 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx +++ b/src/plugins/files/public/components/file_picker/components/upload_files.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/context.tsx b/src/plugins/files/public/components/file_picker/context.tsx similarity index 88% rename from x-pack/plugins/files/public/components/file_picker/context.tsx rename to src/plugins/files/public/components/file_picker/context.tsx index 67e745b745829..48d0ea3986253 100644 --- a/x-pack/plugins/files/public/components/file_picker/context.tsx +++ b/src/plugins/files/public/components/file_picker/context.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { createContext, useContext, useMemo, useEffect } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.scss b/src/plugins/files/public/components/file_picker/file_picker.scss similarity index 100% rename from x-pack/plugins/files/public/components/file_picker/file_picker.scss rename to src/plugins/files/public/components/file_picker/file_picker.scss diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx b/src/plugins/files/public/components/file_picker/file_picker.stories.tsx similarity index 96% rename from x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx rename to src/plugins/files/public/components/file_picker/file_picker.stories.tsx index 9d40b112b4060..517663ebbbbbe 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.stories.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx b/src/plugins/files/public/components/file_picker/file_picker.test.tsx similarity index 95% rename from x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx rename to src/plugins/files/public/components/file_picker/file_picker.test.tsx index b9005c89503f3..58c86739755a8 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.test.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; import { act } from 'react-dom/test-utils'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.tsx b/src/plugins/files/public/components/file_picker/file_picker.tsx similarity index 94% rename from x-pack/plugins/files/public/components/file_picker/file_picker.tsx rename to src/plugins/files/public/components/file_picker/file_picker.tsx index 6c95cd225ae27..9472f87f7b912 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts b/src/plugins/files/public/components/file_picker/file_picker_state.test.ts similarity index 97% rename from x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts rename to src/plugins/files/public/components/file_picker/file_picker_state.test.ts index 3a5adb08a7af2..0e7971e60bdcc 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts +++ b/src/plugins/files/public/components/file_picker/file_picker_state.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ jest.mock('rxjs', () => { diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts b/src/plugins/files/public/components/file_picker/file_picker_state.ts similarity index 97% rename from x-pack/plugins/files/public/components/file_picker/file_picker_state.ts rename to src/plugins/files/public/components/file_picker/file_picker_state.ts index 708288f9cb4df..42214f77c9cf2 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts +++ b/src/plugins/files/public/components/file_picker/file_picker_state.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { map, tap, diff --git a/src/plugins/files/public/components/file_picker/i18n_texts.ts b/src/plugins/files/public/components/file_picker/i18n_texts.ts new file mode 100644 index 0000000000000..0958e99cdffe1 --- /dev/null +++ b/src/plugins/files/public/components/file_picker/i18n_texts.ts @@ -0,0 +1,50 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + title: i18n.translate('files.filePicker.title', { + defaultMessage: 'Select a file', + }), + loadingFilesErrorTitle: i18n.translate('files.filePicker.error.loadingTitle', { + defaultMessage: 'Could not load files', + }), + retryButtonLabel: i18n.translate('files.filePicker.error.retryButtonLabel', { + defaultMessage: 'Retry', + }), + emptyStatePrompt: i18n.translate('files.filePicker.emptyStatePrompt', { + defaultMessage: 'No files found', + }), + emptyStatePromptSubtitle: i18n.translate('files.filePicker.emptyStatePromptSubtitle', { + defaultMessage: 'Upload your first file.', + }), + selectFileLabel: i18n.translate('files.filePicker.selectFileButtonLable', { + defaultMessage: 'Select file', + }), + selectFilesLabel: (nrOfFiles: number) => + i18n.translate('files.filePicker.selectFilesButtonLable', { + defaultMessage: 'Select {nrOfFiles} files', + values: { nrOfFiles }, + }), + searchFieldPlaceholder: i18n.translate('files.filePicker.searchFieldPlaceholder', { + defaultMessage: 'my-file-*', + }), + emptyFileGridPrompt: i18n.translate('files.filePicker.emptyGridPrompt', { + defaultMessage: 'No files matched filter', + }), + loadMoreButtonLabel: i18n.translate('files.filePicker.loadMoreButtonLabel', { + defaultMessage: 'Load more', + }), + clearFilterButton: i18n.translate('files.filePicker.clearFilterButtonLabel', { + defaultMessage: 'Clear filter', + }), + uploadFilePlaceholderText: i18n.translate('files.filePicker.uploadFilePlaceholderText', { + defaultMessage: 'Drag and drop to upload new files', + }), +}; diff --git a/x-pack/plugins/files/public/components/file_picker/index.tsx b/src/plugins/files/public/components/file_picker/index.tsx similarity index 75% rename from x-pack/plugins/files/public/components/file_picker/index.tsx rename to src/plugins/files/public/components/file_picker/index.tsx index 47c892ef1cadd..9ec6b9f778035 100644 --- a/x-pack/plugins/files/public/components/file_picker/index.tsx +++ b/src/plugins/files/public/components/file_picker/index.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { lazy, Suspense } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/components/blurhash.tsx b/src/plugins/files/public/components/image/components/blurhash.tsx similarity index 89% rename from x-pack/plugins/files/public/components/image/components/blurhash.tsx rename to src/plugins/files/public/components/image/components/blurhash.tsx index 62dfb8b1f075d..7a931e91ddaea 100644 --- a/x-pack/plugins/files/public/components/image/components/blurhash.tsx +++ b/src/plugins/files/public/components/image/components/blurhash.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { decode } from 'blurhash'; import React, { useRef, useEffect } from 'react'; import type { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/components/img.tsx b/src/plugins/files/public/components/image/components/img.tsx similarity index 89% rename from x-pack/plugins/files/public/components/image/components/img.tsx rename to src/plugins/files/public/components/image/components/img.tsx index 25f45eec22f6e..855d4547058a5 100644 --- a/x-pack/plugins/files/public/components/image/components/img.tsx +++ b/src/plugins/files/public/components/image/components/img.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import type { ImgHTMLAttributes, MutableRefObject } from 'react'; import type { EuiImageSize } from '@elastic/eui/src/components/image/image_types'; diff --git a/x-pack/plugins/files/public/components/image/components/index.ts b/src/plugins/files/public/components/image/components/index.ts similarity index 59% rename from x-pack/plugins/files/public/components/image/components/index.ts rename to src/plugins/files/public/components/image/components/index.ts index 7fee8f7fd63fb..bae3c92eab517 100644 --- a/x-pack/plugins/files/public/components/image/components/index.ts +++ b/src/plugins/files/public/components/image/components/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { Img } from './img'; diff --git a/x-pack/plugins/files/public/components/image/image.constants.stories.tsx b/src/plugins/files/public/components/image/image.constants.stories.tsx similarity index 97% rename from x-pack/plugins/files/public/components/image/image.constants.stories.tsx rename to src/plugins/files/public/components/image/image.constants.stories.tsx index cc5ff23cd2810..b9b3a5c3831cb 100644 --- a/x-pack/plugins/files/public/components/image/image.constants.stories.tsx +++ b/src/plugins/files/public/components/image/image.constants.stories.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export function getImageData(): Blob { diff --git a/x-pack/plugins/files/public/components/image/image.stories.tsx b/src/plugins/files/public/components/image/image.stories.tsx similarity index 92% rename from x-pack/plugins/files/public/components/image/image.stories.tsx rename to src/plugins/files/public/components/image/image.stories.tsx index ff8825485f9cb..d26a74470bdca 100644 --- a/x-pack/plugins/files/public/components/image/image.stories.tsx +++ b/src/plugins/files/public/components/image/image.stories.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/image/image.tsx b/src/plugins/files/public/components/image/image.tsx similarity index 93% rename from x-pack/plugins/files/public/components/image/image.tsx rename to src/plugins/files/public/components/image/image.tsx index 0b6c9d48fa81d..e2cb78d910e3d 100644 --- a/x-pack/plugins/files/public/components/image/image.tsx +++ b/src/plugins/files/public/components/image/image.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { HTMLAttributes } from 'react'; import { type ImgHTMLAttributes, useState, useEffect } from 'react'; import { css } from '@emotion/react'; diff --git a/x-pack/plugins/files/public/components/image/index.ts b/src/plugins/files/public/components/image/index.ts similarity index 57% rename from x-pack/plugins/files/public/components/image/index.ts rename to src/plugins/files/public/components/image/index.ts index 05ffe3dd1c4e7..2e7825acc1260 100644 --- a/x-pack/plugins/files/public/components/image/index.ts +++ b/src/plugins/files/public/components/image/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { Image } from './image'; diff --git a/x-pack/plugins/files/public/components/image/styles.ts b/src/plugins/files/public/components/image/styles.ts similarity index 72% rename from x-pack/plugins/files/public/components/image/styles.ts rename to src/plugins/files/public/components/image/styles.ts index b14121c667a50..d69580bcb51a5 100644 --- a/x-pack/plugins/files/public/components/image/styles.ts +++ b/src/plugins/files/public/components/image/styles.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { css } from '@emotion/react'; diff --git a/x-pack/plugins/files/public/components/image/use_viewport_observer.ts b/src/plugins/files/public/components/image/use_viewport_observer.ts similarity index 85% rename from x-pack/plugins/files/public/components/image/use_viewport_observer.ts rename to src/plugins/files/public/components/image/use_viewport_observer.ts index c1951b4448de8..6e43cc9d124f6 100644 --- a/x-pack/plugins/files/public/components/image/use_viewport_observer.ts +++ b/src/plugins/files/public/components/image/use_viewport_observer.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { useCallback, useEffect, useRef, useState } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/viewport_observer.test.ts b/src/plugins/files/public/components/image/viewport_observer.test.ts similarity index 92% rename from x-pack/plugins/files/public/components/image/viewport_observer.test.ts rename to src/plugins/files/public/components/image/viewport_observer.test.ts index 5e5ebd3d42029..f5dafb25fc724 100644 --- a/x-pack/plugins/files/public/components/image/viewport_observer.test.ts +++ b/src/plugins/files/public/components/image/viewport_observer.test.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { TestScheduler } from 'rxjs/testing'; import { ViewportObserver } from './viewport_observer'; diff --git a/x-pack/plugins/files/public/components/image/viewport_observer.ts b/src/plugins/files/public/components/image/viewport_observer.ts similarity index 89% rename from x-pack/plugins/files/public/components/image/viewport_observer.ts rename to src/plugins/files/public/components/image/viewport_observer.ts index c0efe3d095594..165af5aecb98c 100644 --- a/x-pack/plugins/files/public/components/image/viewport_observer.ts +++ b/src/plugins/files/public/components/image/viewport_observer.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { once } from 'lodash'; import { Observable, ReplaySubject } from 'rxjs'; import { take } from 'rxjs/operators'; diff --git a/x-pack/plugins/files/public/components/index.ts b/src/plugins/files/public/components/index.ts similarity index 67% rename from x-pack/plugins/files/public/components/index.ts rename to src/plugins/files/public/components/index.ts index c5ab1382b4dfa..e4470d4a58be7 100644 --- a/x-pack/plugins/files/public/components/index.ts +++ b/src/plugins/files/public/components/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { Image, type ImageProps } from './image'; diff --git a/x-pack/plugins/files/public/components/stories_shared.ts b/src/plugins/files/public/components/stories_shared.ts similarity index 77% rename from x-pack/plugins/files/public/components/stories_shared.ts rename to src/plugins/files/public/components/stories_shared.ts index a82ec3295b1d0..f20058ea0f58e 100644 --- a/x-pack/plugins/files/public/components/stories_shared.ts +++ b/src/plugins/files/public/components/stories_shared.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileKind } from '../../common'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx b/src/plugins/files/public/components/upload_file/components/cancel_button.tsx similarity index 86% rename from x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx rename to src/plugins/files/public/components/upload_file/components/cancel_button.tsx index b71a6221f3b2d..4bf6aead09120 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/cancel_button.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiButton, EuiButtonIcon } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx b/src/plugins/files/public/components/upload_file/components/clear_button.tsx similarity index 76% rename from x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx rename to src/plugins/files/public/components/upload_file/components/clear_button.tsx index 929fe0dcc65b0..09733a9c58769 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/clear_button.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/control_button.tsx b/src/plugins/files/public/components/upload_file/components/control_button.tsx similarity index 86% rename from x-pack/plugins/files/public/components/upload_file/components/control_button.tsx rename to src/plugins/files/public/components/upload_file/components/control_button.tsx index 351cf2c39edd1..c52d72545e04e 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/control_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/control_button.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/index.ts b/src/plugins/files/public/components/upload_file/components/index.ts similarity index 58% rename from x-pack/plugins/files/public/components/upload_file/components/index.ts rename to src/plugins/files/public/components/upload_file/components/index.ts index fbc7ffd8eda79..427af9af2cc48 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/index.ts +++ b/src/plugins/files/public/components/upload_file/components/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { ControlButton } from './control_button'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx b/src/plugins/files/public/components/upload_file/components/retry_button.tsx similarity index 81% rename from x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx rename to src/plugins/files/public/components/upload_file/components/retry_button.tsx index 355495aa25c17..273515331b3c9 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/retry_button.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiButton } from '@elastic/eui'; import type { FunctionComponent } from 'react'; import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx b/src/plugins/files/public/components/upload_file/components/upload_button.tsx similarity index 87% rename from x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx rename to src/plugins/files/public/components/upload_file/components/upload_button.tsx index ff6320ab0b95a..2bd024ad2e1ad 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/upload_button.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiButton } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/context.ts b/src/plugins/files/public/components/upload_file/context.ts similarity index 66% rename from x-pack/plugins/files/public/components/upload_file/context.ts rename to src/plugins/files/public/components/upload_file/context.ts index e88f5d2441489..187639cb3dda0 100644 --- a/x-pack/plugins/files/public/components/upload_file/context.ts +++ b/src/plugins/files/public/components/upload_file/context.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import type { UploadState } from './upload_state'; diff --git a/src/plugins/files/public/components/upload_file/i18n_texts.ts b/src/plugins/files/public/components/upload_file/i18n_texts.ts new file mode 100644 index 0000000000000..19ac5b3e0a67d --- /dev/null +++ b/src/plugins/files/public/components/upload_file/i18n_texts.ts @@ -0,0 +1,42 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + defaultPickerLabel: i18n.translate('files.uploadFile.defaultFilePickerLabel', { + defaultMessage: 'Upload a file', + }), + upload: i18n.translate('files.uploadFile.uploadButtonLabel', { + defaultMessage: 'Upload', + }), + uploading: i18n.translate('files.uploadFile.uploadingButtonLabel', { + defaultMessage: 'Uploading', + }), + uploadComplete: i18n.translate('files.uploadFile.uploadCompleteButtonLabel', { + defaultMessage: 'Upload complete', + }), + retry: i18n.translate('files.uploadFile.retryButtonLabel', { + defaultMessage: 'Retry', + }), + clear: i18n.translate('files.uploadFile.clearButtonLabel', { + defaultMessage: 'Clear', + }), + cancel: i18n.translate('files.uploadFile.cancelButtonLabel', { + defaultMessage: 'Cancel', + }), + uploadDone: i18n.translate('files.uploadFile.uploadDoneToolTipContent', { + defaultMessage: 'Your file was successfully uploaded!', + }), + fileTooLarge: (expectedSize: string) => + i18n.translate('files.uploadFile.fileTooLargeErrorMessage', { + defaultMessage: + 'File is too large. Maximum size is {expectedSize, plural, one {# byte} other {# bytes} }.', + values: { expectedSize }, + }), +}; diff --git a/x-pack/plugins/files/public/components/upload_file/index.tsx b/src/plugins/files/public/components/upload_file/index.tsx similarity index 76% rename from x-pack/plugins/files/public/components/upload_file/index.tsx rename to src/plugins/files/public/components/upload_file/index.tsx index 8e9e89c33c799..83aae0a111b43 100644 --- a/x-pack/plugins/files/public/components/upload_file/index.tsx +++ b/src/plugins/files/public/components/upload_file/index.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React, { lazy, Suspense } from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx b/src/plugins/files/public/components/upload_file/upload_file.component.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx rename to src/plugins/files/public/components/upload_file/upload_file.component.tsx index 8c81ae3fdcb21..92e3cb85cb398 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.component.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx b/src/plugins/files/public/components/upload_file/upload_file.stories.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx rename to src/plugins/files/public/components/upload_file/upload_file.stories.tsx index 635400223fc17..2a07b8b8f5db5 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.stories.tsx @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx b/src/plugins/files/public/components/upload_file/upload_file.test.tsx similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx rename to src/plugins/files/public/components/upload_file/upload_file.test.tsx index 7682b085eb060..a8230094ccd78 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.test.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.tsx b/src/plugins/files/public/components/upload_file/upload_file.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.tsx rename to src/plugins/files/public/components/upload_file/upload_file.tsx index ae23739afbf2e..0d468c2991150 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.tsx @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EuiFilePicker } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_state.test.ts b/src/plugins/files/public/components/upload_file/upload_state.test.ts similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_state.test.ts rename to src/plugins/files/public/components/upload_file/upload_state.test.ts index a834103a2c9cb..7a73009c35c49 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_state.test.ts +++ b/src/plugins/files/public/components/upload_file/upload_state.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { DeeplyMockedKeys } from '@kbn/utility-types-jest'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_state.ts b/src/plugins/files/public/components/upload_file/upload_state.ts similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_state.ts rename to src/plugins/files/public/components/upload_file/upload_state.ts index 061f65115c799..d9331c18868ac 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_state.ts +++ b/src/plugins/files/public/components/upload_file/upload_state.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { diff --git a/x-pack/plugins/files/public/components/upload_file/util/index.ts b/src/plugins/files/public/components/upload_file/util/index.ts similarity index 61% rename from x-pack/plugins/files/public/components/upload_file/util/index.ts rename to src/plugins/files/public/components/upload_file/util/index.ts index e8fbb4e1ecedc..18bdee6fcffe0 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/index.ts +++ b/src/plugins/files/public/components/upload_file/util/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { SimpleStateSubject, createStateSubject } from './simple_state_subject'; diff --git a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts b/src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts similarity index 82% rename from x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts rename to src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts index bfe27b50a9f43..76d342a70cf7e 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts +++ b/src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { parseFileName } from './parse_file_name'; diff --git a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts b/src/plugins/files/public/components/upload_file/util/parse_file_name.ts similarity index 71% rename from x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts rename to src/plugins/files/public/components/upload_file/util/parse_file_name.ts index 485b3013631dd..aaa7b9a759f7b 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts +++ b/src/plugins/files/public/components/upload_file/util/parse_file_name.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ interface Result { diff --git a/x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts b/src/plugins/files/public/components/upload_file/util/simple_state_subject.ts similarity index 78% rename from x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts rename to src/plugins/files/public/components/upload_file/util/simple_state_subject.ts index a55259b4962ed..b5cc19a9ea3ee 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts +++ b/src/plugins/files/public/components/upload_file/util/simple_state_subject.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { merge } from 'lodash'; diff --git a/x-pack/plugins/files/public/components/use_behavior_subject.ts b/src/plugins/files/public/components/use_behavior_subject.ts similarity index 66% rename from x-pack/plugins/files/public/components/use_behavior_subject.ts rename to src/plugins/files/public/components/use_behavior_subject.ts index f68ae6faef28c..441a14667df18 100644 --- a/x-pack/plugins/files/public/components/use_behavior_subject.ts +++ b/src/plugins/files/public/components/use_behavior_subject.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { BehaviorSubject } from 'rxjs'; diff --git a/x-pack/plugins/files/public/components/util/image_metadata.test.ts b/src/plugins/files/public/components/util/image_metadata.test.ts similarity index 86% rename from x-pack/plugins/files/public/components/util/image_metadata.test.ts rename to src/plugins/files/public/components/util/image_metadata.test.ts index 16980aee00296..de4cba5c82dc9 100644 --- a/x-pack/plugins/files/public/components/util/image_metadata.test.ts +++ b/src/plugins/files/public/components/util/image_metadata.test.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { fitToBox } from './image_metadata'; describe('util', () => { describe('fitToBox', () => { diff --git a/x-pack/plugins/files/public/components/util/image_metadata.ts b/src/plugins/files/public/components/util/image_metadata.ts similarity index 92% rename from x-pack/plugins/files/public/components/util/image_metadata.ts rename to src/plugins/files/public/components/util/image_metadata.ts index 9c6e74f4c0101..75a42efed585c 100644 --- a/x-pack/plugins/files/public/components/util/image_metadata.ts +++ b/src/plugins/files/public/components/util/image_metadata.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 * as bh from 'blurhash'; diff --git a/x-pack/plugins/files/public/components/util/index.ts b/src/plugins/files/public/components/util/index.ts similarity index 61% rename from x-pack/plugins/files/public/components/util/index.ts rename to src/plugins/files/public/components/util/index.ts index e3e30fdb17bb3..5c25ffd636a5c 100644 --- a/x-pack/plugins/files/public/components/util/index.ts +++ b/src/plugins/files/public/components/util/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { getImageMetadata, isImage, fitToBox } from './image_metadata'; diff --git a/x-pack/plugins/files/public/files_client/files_client.test.ts b/src/plugins/files/public/files_client/files_client.test.ts similarity index 89% rename from x-pack/plugins/files/public/files_client/files_client.test.ts rename to src/plugins/files/public/files_client/files_client.test.ts index 63bed16c07ead..caef61d231110 100644 --- a/x-pack/plugins/files/public/files_client/files_client.test.ts +++ b/src/plugins/files/public/files_client/files_client.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { apiRoutes } from './files_client'; diff --git a/x-pack/plugins/files/public/files_client/files_client.ts b/src/plugins/files/public/files_client/files_client.ts similarity index 96% rename from x-pack/plugins/files/public/files_client/files_client.ts rename to src/plugins/files/public/files_client/files_client.ts index f92b2c91d2796..86a2c1c92957c 100644 --- a/x-pack/plugins/files/public/files_client/files_client.ts +++ b/src/plugins/files/public/files_client/files_client.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { HttpStart } from '@kbn/core/public'; diff --git a/x-pack/plugins/files/public/files_client/index.ts b/src/plugins/files/public/files_client/index.ts similarity index 53% rename from x-pack/plugins/files/public/files_client/index.ts rename to src/plugins/files/public/files_client/index.ts index 60f3022e825df..cc493c053e61d 100644 --- a/x-pack/plugins/files/public/files_client/index.ts +++ b/src/plugins/files/public/files_client/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { createFilesClient } from './files_client'; diff --git a/x-pack/plugins/files/public/index.ts b/src/plugins/files/public/index.ts similarity index 75% rename from x-pack/plugins/files/public/index.ts rename to src/plugins/files/public/index.ts index a9bd88615ff12..5822efb655735 100644 --- a/x-pack/plugins/files/public/index.ts +++ b/src/plugins/files/public/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FilesPlugin } from './plugin'; diff --git a/x-pack/plugins/files/public/mocks.ts b/src/plugins/files/public/mocks.ts similarity index 80% rename from x-pack/plugins/files/public/mocks.ts rename to src/plugins/files/public/mocks.ts index c34438d096a2b..c19843f3f098d 100644 --- a/x-pack/plugins/files/public/mocks.ts +++ b/src/plugins/files/public/mocks.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { DeeplyMockedKeys } from '@kbn/utility-types-jest'; diff --git a/x-pack/plugins/files/public/plugin.ts b/src/plugins/files/public/plugin.ts similarity index 91% rename from x-pack/plugins/files/public/plugin.ts rename to src/plugins/files/public/plugin.ts index 2f5481f8f2511..a91b565d2a540 100644 --- a/x-pack/plugins/files/public/plugin.ts +++ b/src/plugins/files/public/plugin.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; diff --git a/x-pack/plugins/files/public/types.ts b/src/plugins/files/public/types.ts similarity index 96% rename from x-pack/plugins/files/public/types.ts rename to src/plugins/files/public/types.ts index fcc5c11b1ae45..eb5d28a02f6d4 100644 --- a/x-pack/plugins/files/public/types.ts +++ b/src/plugins/files/public/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileJSON } from '../common'; diff --git a/x-pack/plugins/files/server/audit_events.ts b/src/plugins/files/server/audit_events.ts similarity index 79% rename from x-pack/plugins/files/server/audit_events.ts rename to src/plugins/files/server/audit_events.ts index ab5d33a65b764..aea5b6b199fd9 100644 --- a/x-pack/plugins/files/server/audit_events.ts +++ b/src/plugins/files/server/audit_events.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { EcsEventOutcome } from '@kbn/logging'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/README.md b/src/plugins/files/server/blob_storage_service/adapters/README.md similarity index 100% rename from x-pack/plugins/files/server/blob_storage_service/adapters/README.md rename to src/plugins/files/server/blob_storage_service/adapters/README.md diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts similarity index 98% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts index 56f61e83e47f9..48410081da3ff 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts similarity index 98% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts index 746c66798b5e8..b4b34b5cca83f 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 cuid from 'cuid'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts similarity index 69% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts index a31e0c8b672dc..e3a21c52f3f07 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts similarity index 91% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts index 9d1ddda739717..bc2cbe0870d59 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Readable } from 'stream'; import { promisify } from 'util'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.ts similarity index 96% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/es.ts index 96421a06e95c5..2bf582e18d321 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 assert from 'assert'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts b/src/plugins/files/server/blob_storage_service/adapters/es/index.ts similarity index 56% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/index.ts index 75ac82acb66df..c0c37cd4c2878 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts similarity index 96% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts index 8bcc8c503bb49..8e5b7d63218e6 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 sinon from 'sinon'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts b/src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts similarity index 86% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts index dbcd57a06ba18..6f7f99d818193 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/index.ts b/src/plugins/files/server/blob_storage_service/adapters/index.ts similarity index 56% rename from x-pack/plugins/files/server/blob_storage_service/adapters/index.ts rename to src/plugins/files/server/blob_storage_service/adapters/index.ts index 75ac82acb66df..c0c37cd4c2878 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/index.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts b/src/plugins/files/server/blob_storage_service/blob_storage_service.ts similarity index 88% rename from x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts rename to src/plugins/files/server/blob_storage_service/blob_storage_service.ts index ecd2c6e3d3dad..0cc4ba81997b8 100644 --- a/x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts +++ b/src/plugins/files/server/blob_storage_service/blob_storage_service.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { ElasticsearchClient, Logger } from '@kbn/core/server'; import { BlobStorageSettings, ES_FIXED_SIZE_INDEX_BLOB_STORE } from '../../common'; import { BlobStorageClient } from './types'; diff --git a/x-pack/plugins/files/server/blob_storage_service/index.ts b/src/plugins/files/server/blob_storage_service/index.ts similarity index 65% rename from x-pack/plugins/files/server/blob_storage_service/index.ts rename to src/plugins/files/server/blob_storage_service/index.ts index fd8d4e190c092..4b1d0ec29a2dc 100644 --- a/x-pack/plugins/files/server/blob_storage_service/index.ts +++ b/src/plugins/files/server/blob_storage_service/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { BlobStorageService } from './blob_storage_service'; diff --git a/x-pack/plugins/files/server/blob_storage_service/types.ts b/src/plugins/files/server/blob_storage_service/types.ts similarity index 90% rename from x-pack/plugins/files/server/blob_storage_service/types.ts rename to src/plugins/files/server/blob_storage_service/types.ts index 6a5c40708a973..7ced9ec9df708 100644 --- a/x-pack/plugins/files/server/blob_storage_service/types.ts +++ b/src/plugins/files/server/blob_storage_service/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { JsonValue } from '@kbn/utility-types'; diff --git a/x-pack/plugins/files/server/feature.ts b/src/plugins/files/server/feature.ts similarity index 77% rename from x-pack/plugins/files/server/feature.ts rename to src/plugins/files/server/feature.ts index 1685e95cc9fa6..81ba7978e49f6 100644 --- a/x-pack/plugins/files/server/feature.ts +++ b/src/plugins/files/server/feature.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common'; @@ -15,14 +16,14 @@ import { hiddenTypes } from './saved_objects'; // TODO: This should be registered once we have a management section for files content export const filesFeature: KibanaFeatureConfig = { id: PLUGIN_ID, - name: i18n.translate('xpack.files.featureRegistry.filesFeatureName', { + name: i18n.translate('files.featureRegistry.filesFeatureName', { defaultMessage: 'Files', }), minimumLicense: 'basic', order: 10000, category: DEFAULT_APP_CATEGORIES.management, app: [PLUGIN_ID], - privilegesTooltip: i18n.translate('xpack.files.featureRegistry.filesPrivilegesTooltip', { + privilegesTooltip: i18n.translate('files.featureRegistry.filesPrivilegesTooltip', { defaultMessage: 'Provide access to files across all apps', }), privileges: { diff --git a/x-pack/plugins/files/server/file/errors.ts b/src/plugins/files/server/file/errors.ts similarity index 76% rename from x-pack/plugins/files/server/file/errors.ts rename to src/plugins/files/server/file/errors.ts index 34ce179555ff0..db504adf79d27 100644 --- a/x-pack/plugins/files/server/file/errors.ts +++ b/src/plugins/files/server/file/errors.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ /* eslint-disable max-classes-per-file */ diff --git a/x-pack/plugins/files/server/file/file.test.ts b/src/plugins/files/server/file/file.test.ts similarity index 95% rename from x-pack/plugins/files/server/file/file.test.ts rename to src/plugins/files/server/file/file.test.ts index b2e9167c685b3..b42a360682cf9 100644 --- a/x-pack/plugins/files/server/file/file.test.ts +++ b/src/plugins/files/server/file/file.test.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { of } from 'rxjs'; import type { ElasticsearchClient, ISavedObjectsRepository } from '@kbn/core/server'; import { createSandbox } from 'sinon'; diff --git a/x-pack/plugins/files/server/file/file.ts b/src/plugins/files/server/file/file.ts similarity index 96% rename from x-pack/plugins/files/server/file/file.ts rename to src/plugins/files/server/file/file.ts index c1b9d8ad12fde..d8f246d864882 100644 --- a/x-pack/plugins/files/server/file/file.ts +++ b/src/plugins/files/server/file/file.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file/file_attributes_reducer.ts b/src/plugins/files/server/file/file_attributes_reducer.ts similarity index 86% rename from x-pack/plugins/files/server/file/file_attributes_reducer.ts rename to src/plugins/files/server/file/file_attributes_reducer.ts index fdb2768408af5..1a035c32e1243 100644 --- a/x-pack/plugins/files/server/file/file_attributes_reducer.ts +++ b/src/plugins/files/server/file/file_attributes_reducer.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileJSON, UpdatableFileMetadata } from '../../common'; export type Action = diff --git a/x-pack/plugins/files/server/file/index.ts b/src/plugins/files/server/file/index.ts similarity index 69% rename from x-pack/plugins/files/server/file/index.ts rename to src/plugins/files/server/file/index.ts index 2b584945cb71f..3aa6709356642 100644 --- a/x-pack/plugins/files/server/file/index.ts +++ b/src/plugins/files/server/file/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 * as fileErrors from './errors'; diff --git a/x-pack/plugins/files/server/file/to_json.ts b/src/plugins/files/server/file/to_json.ts similarity index 86% rename from x-pack/plugins/files/server/file/to_json.ts rename to src/plugins/files/server/file/to_json.ts index 98096940fe75f..d1cb00277549a 100644 --- a/x-pack/plugins/files/server/file/to_json.ts +++ b/src/plugins/files/server/file/to_json.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { pickBy } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/create_es_file_client.ts b/src/plugins/files/server/file_client/create_es_file_client.ts similarity index 90% rename from x-pack/plugins/files/server/file_client/create_es_file_client.ts rename to src/plugins/files/server/file_client/create_es_file_client.ts index 9f453a6a25bfc..1fb14b1fdfbba 100644 --- a/x-pack/plugins/files/server/file_client/create_es_file_client.ts +++ b/src/plugins/files/server/file_client/create_es_file_client.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Logger, ElasticsearchClient } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file_client/file_client.ts b/src/plugins/files/server/file_client/file_client.ts similarity index 97% rename from x-pack/plugins/files/server/file_client/file_client.ts rename to src/plugins/files/server/file_client/file_client.ts index 6954ac9c635d7..4e49bc1e1d69c 100644 --- a/x-pack/plugins/files/server/file_client/file_client.ts +++ b/src/plugins/files/server/file_client/file_client.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 moment from 'moment'; import { Readable } from 'stream'; import mimeType from 'mime'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts similarity index 95% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts index dcfe39e112075..8e78c471dde2b 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { once } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts similarity index 60% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts index 9e7273b685f89..965cbe0fa1907 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { SavedObjectsFileMetadataClient } from './saved_objects'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts similarity index 91% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts index e5c49b8f12b9d..14e757fae691a 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { pipe, forEach } from 'lodash/fp'; import { escapeKuery, KueryNode, nodeBuilder, nodeTypes } from '@kbn/es-query'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts similarity index 95% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts index b1a43a05bfb7b..f0f547bb4704f 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { reduce } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts b/src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts similarity index 93% rename from x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts rename to src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts index 5136fc9744d51..2738d75d8222c 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { ES_FIXED_SIZE_INDEX_BLOB_STORE } from '../../../common/constants'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts b/src/plugins/files/server/file_client/file_metadata_client/index.ts similarity index 72% rename from x-pack/plugins/files/server/file_client/file_metadata_client/index.ts rename to src/plugins/files/server/file_client/file_metadata_client/index.ts index 690a6b472b00f..97948a5ebee35 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export type { diff --git a/x-pack/plugins/files/server/file_client/index.ts b/src/plugins/files/server/file_client/index.ts similarity index 81% rename from x-pack/plugins/files/server/file_client/index.ts rename to src/plugins/files/server/file_client/index.ts index 46eec400b77bc..f034f67ec9c68 100644 --- a/x-pack/plugins/files/server/file_client/index.ts +++ b/src/plugins/files/server/file_client/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { EsIndexFilesMetadataClient, SavedObjectsFileMetadataClient } from './file_metadata_client'; diff --git a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts b/src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts similarity index 96% rename from x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts rename to src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts index 0ae1b9c7d29f8..c9d78cb33ac17 100644 --- a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts +++ b/src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Readable } from 'stream'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { TestEnvironmentUtils, setupIntegrationEnvironment } from '../../test_utils'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/index.ts b/src/plugins/files/server/file_client/stream_transforms/index.ts similarity index 55% rename from x-pack/plugins/files/server/file_client/stream_transforms/index.ts rename to src/plugins/files/server/file_client/stream_transforms/index.ts index b3a82e897a02c..a89ef117795a9 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/index.ts +++ b/src/plugins/files/server/file_client/stream_transforms/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts similarity index 65% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts index 3b2c236e8a287..8c846f9bde101 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export class MaxByteSizeExceededError extends Error { diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts similarity index 55% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts index b3a82e897a02c..a89ef117795a9 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts similarity index 87% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts index 9697624edb471..0b9ca5fe8a455 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Readable, Writable, pipeline } from 'stream'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts similarity index 79% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts index c2634bcbf8fe2..a94f9858a996c 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Transform } from 'stream'; diff --git a/x-pack/plugins/files/server/file_client/types.ts b/src/plugins/files/server/file_client/types.ts similarity index 94% rename from x-pack/plugins/files/server/file_client/types.ts rename to src/plugins/files/server/file_client/types.ts index 19a50f7249fa2..5f991f0bbceb1 100644 --- a/x-pack/plugins/files/server/file_client/types.ts +++ b/src/plugins/files/server/file_client/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { File, FileShareJSONWithToken, UpdatableFileMetadata } from '../../common/types'; diff --git a/x-pack/plugins/files/server/file_client/utils.ts b/src/plugins/files/server/file_client/utils.ts similarity index 71% rename from x-pack/plugins/files/server/file_client/utils.ts rename to src/plugins/files/server/file_client/utils.ts index b8b51117e8ac1..88e0901680f0c 100644 --- a/x-pack/plugins/files/server/file_client/utils.ts +++ b/src/plugins/files/server/file_client/utils.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileMetadata } from '../../common'; diff --git a/x-pack/plugins/files/server/file_service/errors.ts b/src/plugins/files/server/file_service/errors.ts similarity index 61% rename from x-pack/plugins/files/server/file_service/errors.ts rename to src/plugins/files/server/file_service/errors.ts index 905f26cf8fe14..67bd93e0c782d 100644 --- a/x-pack/plugins/files/server/file_service/errors.ts +++ b/src/plugins/files/server/file_service/errors.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export class FileNotFoundError extends Error { diff --git a/x-pack/plugins/files/server/file_service/file_action_types.ts b/src/plugins/files/server/file_service/file_action_types.ts similarity index 91% rename from x-pack/plugins/files/server/file_service/file_action_types.ts rename to src/plugins/files/server/file_service/file_action_types.ts index f0242cb523d40..dfe5ed2f0ba9b 100644 --- a/x-pack/plugins/files/server/file_service/file_action_types.ts +++ b/src/plugins/files/server/file_service/file_action_types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Pagination, UpdatableFileMetadata } from '../../common/types'; diff --git a/x-pack/plugins/files/server/file_service/file_service.ts b/src/plugins/files/server/file_service/file_service.ts similarity index 92% rename from x-pack/plugins/files/server/file_service/file_service.ts rename to src/plugins/files/server/file_service/file_service.ts index e48b0a6ea38ca..9dc1b0769cedf 100644 --- a/x-pack/plugins/files/server/file_service/file_service.ts +++ b/src/plugins/files/server/file_service/file_service.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FilesMetrics, File, FileJSON } from '../../common'; diff --git a/x-pack/plugins/files/server/file_service/file_service_factory.ts b/src/plugins/files/server/file_service/file_service_factory.ts similarity index 96% rename from x-pack/plugins/files/server/file_service/file_service_factory.ts rename to src/plugins/files/server/file_service/file_service_factory.ts index 393777c9a9abf..50ceafb6fc249 100644 --- a/x-pack/plugins/files/server/file_service/file_service_factory.ts +++ b/src/plugins/files/server/file_service/file_service_factory.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { diff --git a/x-pack/plugins/files/server/file_service/index.ts b/src/plugins/files/server/file_service/index.ts similarity index 71% rename from x-pack/plugins/files/server/file_service/index.ts rename to src/plugins/files/server/file_service/index.ts index 457e5f3d4dfb8..5d332a51d3a52 100644 --- a/x-pack/plugins/files/server/file_service/index.ts +++ b/src/plugins/files/server/file_service/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { FileServiceFactoryImpl as FileServiceFactory } from './file_service_factory'; diff --git a/x-pack/plugins/files/server/file_service/internal_file_service.ts b/src/plugins/files/server/file_service/internal_file_service.ts similarity index 95% rename from x-pack/plugins/files/server/file_service/internal_file_service.ts rename to src/plugins/files/server/file_service/internal_file_service.ts index 7768237e9fd50..7f6922a3842db 100644 --- a/x-pack/plugins/files/server/file_service/internal_file_service.ts +++ b/src/plugins/files/server/file_service/internal_file_service.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Logger, SavedObjectsErrorHelpers } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file_share_service/errors.ts b/src/plugins/files/server/file_share_service/errors.ts similarity index 74% rename from x-pack/plugins/files/server/file_share_service/errors.ts rename to src/plugins/files/server/file_share_service/errors.ts index 89979f0689979..193b30e6e1881 100644 --- a/x-pack/plugins/files/server/file_share_service/errors.ts +++ b/src/plugins/files/server/file_share_service/errors.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ /* eslint-disable max-classes-per-file */ diff --git a/x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts b/src/plugins/files/server/file_share_service/generate_share_token.test.ts similarity index 70% rename from x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts rename to src/plugins/files/server/file_share_service/generate_share_token.test.ts index 93767c7484986..53122395f6685 100644 --- a/x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts +++ b/src/plugins/files/server/file_share_service/generate_share_token.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { generateShareToken } from './generate_share_token'; diff --git a/x-pack/plugins/files/server/file_share_service/generate_share_token.ts b/src/plugins/files/server/file_share_service/generate_share_token.ts similarity index 82% rename from x-pack/plugins/files/server/file_share_service/generate_share_token.ts rename to src/plugins/files/server/file_share_service/generate_share_token.ts index ef779db49223a..d20bf8bd97391 100644 --- a/x-pack/plugins/files/server/file_share_service/generate_share_token.ts +++ b/src/plugins/files/server/file_share_service/generate_share_token.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 crypto from 'crypto'; diff --git a/x-pack/plugins/files/server/file_share_service/index.ts b/src/plugins/files/server/file_share_service/index.ts similarity index 74% rename from x-pack/plugins/files/server/file_share_service/index.ts rename to src/plugins/files/server/file_share_service/index.ts index dd52ec05777c1..d4f2f1eba9df6 100644 --- a/x-pack/plugins/files/server/file_share_service/index.ts +++ b/src/plugins/files/server/file_share_service/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { InternalFileShareService } from './internal_file_share_service'; diff --git a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts b/src/plugins/files/server/file_share_service/internal_file_share_service.ts similarity index 97% rename from x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts rename to src/plugins/files/server/file_share_service/internal_file_share_service.ts index 4d5bd95bf4b28..beef345cc8510 100644 --- a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts +++ b/src/plugins/files/server/file_share_service/internal_file_share_service.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 moment from 'moment'; import { SavedObjectsClientContract, diff --git a/x-pack/plugins/files/server/file_share_service/types.ts b/src/plugins/files/server/file_share_service/types.ts similarity index 85% rename from x-pack/plugins/files/server/file_share_service/types.ts rename to src/plugins/files/server/file_share_service/types.ts index bf3147d933083..9e353172eb7aa 100644 --- a/x-pack/plugins/files/server/file_share_service/types.ts +++ b/src/plugins/files/server/file_share_service/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileShareJSON, FileShare } from '../../common/types'; diff --git a/x-pack/plugins/files/server/index.ts b/src/plugins/files/server/index.ts similarity index 85% rename from x-pack/plugins/files/server/index.ts rename to src/plugins/files/server/index.ts index fe2bd3e69eec0..5fb3a1e7f6c8e 100755 --- a/x-pack/plugins/files/server/index.ts +++ b/src/plugins/files/server/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { PluginInitializerContext } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/integration_tests/README.md b/src/plugins/files/server/integration_tests/README.md similarity index 100% rename from x-pack/plugins/files/server/integration_tests/README.md rename to src/plugins/files/server/integration_tests/README.md diff --git a/x-pack/plugins/files/server/integration_tests/file_service.test.ts b/src/plugins/files/server/integration_tests/file_service.test.ts similarity index 98% rename from x-pack/plugins/files/server/integration_tests/file_service.test.ts rename to src/plugins/files/server/integration_tests/file_service.test.ts index 9ea208ca29855..30c3ecd5d9e4d 100644 --- a/x-pack/plugins/files/server/integration_tests/file_service.test.ts +++ b/src/plugins/files/server/integration_tests/file_service.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { CoreStart, ElasticsearchClient } from '@kbn/core/server'; @@ -37,7 +38,6 @@ describe('FileService', () => { let fileService: FileServiceStart; let blobStorageService: BlobStorageService; let esClient: ElasticsearchClient; - let coreSetup: Awaited>; let coreStart: CoreStart; let fileServiceFactory: FileServiceFactory; let security: ReturnType; @@ -48,8 +48,7 @@ describe('FileService', () => { manageES = await startES(); kbnRoot = createRootWithCorePlugins(); await kbnRoot.preboot(); - coreSetup = await kbnRoot.setup(); - FileServiceFactory.setup(coreSetup.savedObjects); + await kbnRoot.setup(); coreStart = await kbnRoot.start(); setFileKindsRegistry(new FileKindsRegistryImpl()); const fileKindsRegistry = getFileKindsRegistry(); diff --git a/x-pack/plugins/files/server/mocks.ts b/src/plugins/files/server/mocks.ts similarity index 92% rename from x-pack/plugins/files/server/mocks.ts rename to src/plugins/files/server/mocks.ts index de9a495818ff2..60f0b5c38ee8d 100644 --- a/x-pack/plugins/files/server/mocks.ts +++ b/src/plugins/files/server/mocks.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { KibanaRequest } from '@kbn/core/server'; import { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import * as stream from 'stream'; diff --git a/x-pack/plugins/files/server/plugin.ts b/src/plugins/files/server/plugin.ts similarity index 94% rename from x-pack/plugins/files/server/plugin.ts rename to src/plugins/files/server/plugin.ts index 08357e28bd3d0..95408f1fc18c5 100755 --- a/x-pack/plugins/files/server/plugin.ts +++ b/src/plugins/files/server/plugin.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { diff --git a/x-pack/plugins/files/server/routes/api_routes.ts b/src/plugins/files/server/routes/api_routes.ts similarity index 89% rename from x-pack/plugins/files/server/routes/api_routes.ts rename to src/plugins/files/server/routes/api_routes.ts index b40696bfe61e7..1c0df1808f22b 100644 --- a/x-pack/plugins/files/server/routes/api_routes.ts +++ b/src/plugins/files/server/routes/api_routes.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { diff --git a/x-pack/plugins/files/server/routes/common.test.ts b/src/plugins/files/server/routes/common.test.ts similarity index 91% rename from x-pack/plugins/files/server/routes/common.test.ts rename to src/plugins/files/server/routes/common.test.ts index 1f9292e3ff07a..3b10adb5226f9 100644 --- a/x-pack/plugins/files/server/routes/common.test.ts +++ b/src/plugins/files/server/routes/common.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { File } from '../file'; diff --git a/x-pack/plugins/files/server/routes/common.ts b/src/plugins/files/server/routes/common.ts similarity index 87% rename from x-pack/plugins/files/server/routes/common.ts rename to src/plugins/files/server/routes/common.ts index 8e17a39511b53..aba84ee6487ec 100644 --- a/x-pack/plugins/files/server/routes/common.ts +++ b/src/plugins/files/server/routes/common.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 mime from 'mime'; import type { ResponseHeaders } from '@kbn/core/server'; import type { File } from '../../common/types'; diff --git a/x-pack/plugins/files/server/routes/common_schemas.ts b/src/plugins/files/server/routes/common_schemas.ts similarity index 87% rename from x-pack/plugins/files/server/routes/common_schemas.ts rename to src/plugins/files/server/routes/common_schemas.ts index 449e4995ac5dd..3f99f1cca8059 100644 --- a/x-pack/plugins/files/server/routes/common_schemas.ts +++ b/src/plugins/files/server/routes/common_schemas.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/create.ts b/src/plugins/files/server/routes/file_kind/create.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/create.ts rename to src/plugins/files/server/routes/file_kind/create.ts index 78a7260771a16..7609265313bd4 100644 --- a/x-pack/plugins/files/server/routes/file_kind/create.ts +++ b/src/plugins/files/server/routes/file_kind/create.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/delete.ts b/src/plugins/files/server/routes/file_kind/delete.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/delete.ts rename to src/plugins/files/server/routes/file_kind/delete.ts index ec23525f2686a..da7bb7bade214 100644 --- a/x-pack/plugins/files/server/routes/file_kind/delete.ts +++ b/src/plugins/files/server/routes/file_kind/delete.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/download.ts b/src/plugins/files/server/routes/file_kind/download.ts similarity index 90% rename from x-pack/plugins/files/server/routes/file_kind/download.ts rename to src/plugins/files/server/routes/file_kind/download.ts index d4ae37ddb6623..4776d37485c93 100644 --- a/x-pack/plugins/files/server/routes/file_kind/download.ts +++ b/src/plugins/files/server/routes/file_kind/download.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/enhance_router.ts b/src/plugins/files/server/routes/file_kind/enhance_router.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/enhance_router.ts rename to src/plugins/files/server/routes/file_kind/enhance_router.ts index b2a4f58fb8fd1..87be1c4e08ea0 100644 --- a/x-pack/plugins/files/server/routes/file_kind/enhance_router.ts +++ b/src/plugins/files/server/routes/file_kind/enhance_router.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { RequestHandler, RouteMethod, RouteRegistrar } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/get_by_id.ts b/src/plugins/files/server/routes/file_kind/get_by_id.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/get_by_id.ts rename to src/plugins/files/server/routes/file_kind/get_by_id.ts index 4d86e05564fdf..914d1e70b77d4 100644 --- a/x-pack/plugins/files/server/routes/file_kind/get_by_id.ts +++ b/src/plugins/files/server/routes/file_kind/get_by_id.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/helpers.ts b/src/plugins/files/server/routes/file_kind/helpers.ts similarity index 85% rename from x-pack/plugins/files/server/routes/file_kind/helpers.ts rename to src/plugins/files/server/routes/file_kind/helpers.ts index 12006fb87837b..4ec6afccebd75 100644 --- a/x-pack/plugins/files/server/routes/file_kind/helpers.ts +++ b/src/plugins/files/server/routes/file_kind/helpers.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { IKibanaResponse, kibanaResponseFactory } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/index.ts b/src/plugins/files/server/routes/file_kind/index.ts similarity index 86% rename from x-pack/plugins/files/server/routes/file_kind/index.ts rename to src/plugins/files/server/routes/file_kind/index.ts index 1bd61b8fb2f2e..40649656790c3 100644 --- a/x-pack/plugins/files/server/routes/file_kind/index.ts +++ b/src/plugins/files/server/routes/file_kind/index.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FileKind } from '../../../common/types'; import { FilesRouter } from '../types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts b/src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts similarity index 97% rename from x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts rename to src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts index 6acd1e3317344..58a6d195a0bdb 100644 --- a/x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts +++ b/src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { UpdatableFileMetadata } from '../../../../common/types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/list.ts b/src/plugins/files/server/routes/file_kind/list.ts similarity index 91% rename from x-pack/plugins/files/server/routes/file_kind/list.ts rename to src/plugins/files/server/routes/file_kind/list.ts index 96d1d8cc27273..54d8e98fc24f6 100644 --- a/x-pack/plugins/files/server/routes/file_kind/list.ts +++ b/src/plugins/files/server/routes/file_kind/list.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import type { FileJSON, FileKind } from '../../../common/types'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/get.ts b/src/plugins/files/server/routes/file_kind/share/get.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/share/get.ts rename to src/plugins/files/server/routes/file_kind/share/get.ts index b39e7c2ccbc92..07e00d4ad800b 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/get.ts +++ b/src/plugins/files/server/routes/file_kind/share/get.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import { FileShareNotFoundError } from '../../../file_share_service/errors'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/list.ts b/src/plugins/files/server/routes/file_kind/share/list.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/share/list.ts rename to src/plugins/files/server/routes/file_kind/share/list.ts index 91a893d2dd31a..470102cb815f0 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/list.ts +++ b/src/plugins/files/server/routes/file_kind/share/list.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/share.ts b/src/plugins/files/server/routes/file_kind/share/share.ts similarity index 92% rename from x-pack/plugins/files/server/routes/file_kind/share/share.ts rename to src/plugins/files/server/routes/file_kind/share/share.ts index f4c8f660e080b..3d3c5adb53e70 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/share.ts +++ b/src/plugins/files/server/routes/file_kind/share/share.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import { ExpiryDateInThePastError } from '../../../file_share_service/errors'; import { CreateHandler, FileKindRouter } from '../types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/unshare.ts b/src/plugins/files/server/routes/file_kind/share/unshare.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/share/unshare.ts rename to src/plugins/files/server/routes/file_kind/share/unshare.ts index 49e59898433b1..a41f5db8a5970 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/unshare.ts +++ b/src/plugins/files/server/routes/file_kind/share/unshare.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; diff --git a/x-pack/plugins/files/server/routes/file_kind/types.ts b/src/plugins/files/server/routes/file_kind/types.ts similarity index 81% rename from x-pack/plugins/files/server/routes/file_kind/types.ts rename to src/plugins/files/server/routes/file_kind/types.ts index 148767f27a285..c82b097d7472c 100644 --- a/x-pack/plugins/files/server/routes/file_kind/types.ts +++ b/src/plugins/files/server/routes/file_kind/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { IRouter, RequestHandler } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/update.ts b/src/plugins/files/server/routes/file_kind/update.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/update.ts rename to src/plugins/files/server/routes/file_kind/update.ts index 9621fc56c311c..048e846322c5b 100644 --- a/x-pack/plugins/files/server/routes/file_kind/update.ts +++ b/src/plugins/files/server/routes/file_kind/update.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.test.ts b/src/plugins/files/server/routes/file_kind/upload.test.ts similarity index 93% rename from x-pack/plugins/files/server/routes/file_kind/upload.test.ts rename to src/plugins/files/server/routes/file_kind/upload.test.ts index 59a906f5ea988..49a207ea80345 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.test.ts +++ b/src/plugins/files/server/routes/file_kind/upload.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { Readable } from 'stream'; diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.ts b/src/plugins/files/server/routes/file_kind/upload.ts similarity index 94% rename from x-pack/plugins/files/server/routes/file_kind/upload.ts rename to src/plugins/files/server/routes/file_kind/upload.ts index 10c230de469b9..88ef492ba11fb 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.ts +++ b/src/plugins/files/server/routes/file_kind/upload.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/find.ts b/src/plugins/files/server/routes/find.ts similarity index 92% rename from x-pack/plugins/files/server/routes/find.ts rename to src/plugins/files/server/routes/find.ts index 80a398189dae3..4ad1deaceb076 100644 --- a/x-pack/plugins/files/server/routes/find.ts +++ b/src/plugins/files/server/routes/find.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import type { CreateHandler, FilesRouter } from './types'; import { FileJSON } from '../../common'; diff --git a/x-pack/plugins/files/server/routes/index.ts b/src/plugins/files/server/routes/index.ts similarity index 74% rename from x-pack/plugins/files/server/routes/index.ts rename to src/plugins/files/server/routes/index.ts index 0a71599ac773e..69565ebc8492e 100644 --- a/x-pack/plugins/files/server/routes/index.ts +++ b/src/plugins/files/server/routes/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FilesRouter } from './types'; diff --git a/x-pack/plugins/files/server/routes/integration_tests/routes.test.ts b/src/plugins/files/server/routes/integration_tests/routes.test.ts similarity index 97% rename from x-pack/plugins/files/server/routes/integration_tests/routes.test.ts rename to src/plugins/files/server/routes/integration_tests/routes.test.ts index a01f377a0364b..b7cfb34e0638d 100644 --- a/x-pack/plugins/files/server/routes/integration_tests/routes.test.ts +++ b/src/plugins/files/server/routes/integration_tests/routes.test.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { CreateFileKindHttpEndpoint } from '../../../common/api_routes'; diff --git a/x-pack/plugins/files/server/routes/metrics.ts b/src/plugins/files/server/routes/metrics.ts similarity index 84% rename from x-pack/plugins/files/server/routes/metrics.ts rename to src/plugins/files/server/routes/metrics.ts index 9ae898e17bb87..6e3a63b7b67c6 100644 --- a/x-pack/plugins/files/server/routes/metrics.ts +++ b/src/plugins/files/server/routes/metrics.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { FILES_MANAGE_PRIVILEGE } from '../../common/constants'; import type { FilesRouter } from './types'; diff --git a/x-pack/plugins/files/server/routes/public_facing/download.ts b/src/plugins/files/server/routes/public_facing/download.ts similarity index 91% rename from x-pack/plugins/files/server/routes/public_facing/download.ts rename to src/plugins/files/server/routes/public_facing/download.ts index bd77cabaf7e4d..1635f9a7d39fd 100644 --- a/x-pack/plugins/files/server/routes/public_facing/download.ts +++ b/src/plugins/files/server/routes/public_facing/download.ts @@ -1,9 +1,11 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { schema } from '@kbn/config-schema'; import { Readable } from 'stream'; import { NoDownloadAvailableError } from '../../file/errors'; diff --git a/x-pack/plugins/files/server/routes/test_utils.ts b/src/plugins/files/server/routes/test_utils.ts similarity index 82% rename from x-pack/plugins/files/server/routes/test_utils.ts rename to src/plugins/files/server/routes/test_utils.ts index 3ec4233fbcbf4..58f00ddbab0fc 100644 --- a/x-pack/plugins/files/server/routes/test_utils.ts +++ b/src/plugins/files/server/routes/test_utils.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/x-pack/plugins/files/server/routes/types.ts b/src/plugins/files/server/routes/types.ts similarity index 86% rename from x-pack/plugins/files/server/routes/types.ts rename to src/plugins/files/server/routes/types.ts index f47808a85c3bf..cfe47a7652359 100644 --- a/x-pack/plugins/files/server/routes/types.ts +++ b/src/plugins/files/server/routes/types.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { diff --git a/x-pack/plugins/files/server/saved_objects/file.ts b/src/plugins/files/server/saved_objects/file.ts similarity index 85% rename from x-pack/plugins/files/server/saved_objects/file.ts rename to src/plugins/files/server/saved_objects/file.ts index 352a00016f86d..af8f7ef9ef089 100644 --- a/x-pack/plugins/files/server/saved_objects/file.ts +++ b/src/plugins/files/server/saved_objects/file.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { SavedObjectsType, SavedObjectsFieldMapping } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/saved_objects/file_share.ts b/src/plugins/files/server/saved_objects/file_share.ts similarity index 84% rename from x-pack/plugins/files/server/saved_objects/file_share.ts rename to src/plugins/files/server/saved_objects/file_share.ts index e71253582b381..244a027e7f73c 100644 --- a/x-pack/plugins/files/server/saved_objects/file_share.ts +++ b/src/plugins/files/server/saved_objects/file_share.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { SavedObjectsFieldMapping, SavedObjectsType } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/saved_objects/index.ts b/src/plugins/files/server/saved_objects/index.ts similarity index 67% rename from x-pack/plugins/files/server/saved_objects/index.ts rename to src/plugins/files/server/saved_objects/index.ts index 2871e4f52f272..c8c03781db99d 100644 --- a/x-pack/plugins/files/server/saved_objects/index.ts +++ b/src/plugins/files/server/saved_objects/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { fileObjectType } from './file'; diff --git a/x-pack/plugins/files/server/test_utils/index.ts b/src/plugins/files/server/test_utils/index.ts similarity index 63% rename from x-pack/plugins/files/server/test_utils/index.ts rename to src/plugins/files/server/test_utils/index.ts index 98215f70649db..5e5b871cece12 100644 --- a/x-pack/plugins/files/server/test_utils/index.ts +++ b/src/plugins/files/server/test_utils/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ export { setupIntegrationEnvironment } from './setup_integration_environment'; diff --git a/x-pack/plugins/files/server/test_utils/setup_integration_environment.ts b/src/plugins/files/server/test_utils/setup_integration_environment.ts similarity index 92% rename from x-pack/plugins/files/server/test_utils/setup_integration_environment.ts rename to src/plugins/files/server/test_utils/setup_integration_environment.ts index 1c31649d1e8f2..e0c01ca8f0a6d 100644 --- a/x-pack/plugins/files/server/test_utils/setup_integration_environment.ts +++ b/src/plugins/files/server/test_utils/setup_integration_environment.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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 { defaults } from 'lodash'; @@ -20,11 +21,6 @@ export type TestEnvironmentUtils = Awaited/x-pack/plugins/files'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/files', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/files/{common,public,server}/**/*.{js,ts,tsx}'], -}; diff --git a/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts b/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts deleted file mode 100644 index 59ea5457ec6c4..0000000000000 --- a/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const i18nTexts = { - title: i18n.translate('xpack.files.filePicker.title', { - defaultMessage: 'Select a file', - }), - loadingFilesErrorTitle: i18n.translate('xpack.files.filePicker.error.loadingTitle', { - defaultMessage: 'Could not load files', - }), - retryButtonLabel: i18n.translate('xpack.files.filePicker.error.retryButtonLabel', { - defaultMessage: 'Retry', - }), - emptyStatePrompt: i18n.translate('xpack.files.filePicker.emptyStatePrompt', { - defaultMessage: 'No files found', - }), - emptyStatePromptSubtitle: i18n.translate('xpack.files.filePicker.emptyStatePromptSubtitle', { - defaultMessage: 'Upload your first file.', - }), - selectFileLabel: i18n.translate('xpack.files.filePicker.selectFileButtonLable', { - defaultMessage: 'Select file', - }), - selectFilesLabel: (nrOfFiles: number) => - i18n.translate('xpack.files.filePicker.selectFilesButtonLable', { - defaultMessage: 'Select {nrOfFiles} files', - values: { nrOfFiles }, - }), - searchFieldPlaceholder: i18n.translate('xpack.files.filePicker.searchFieldPlaceholder', { - defaultMessage: 'my-file-*', - }), - emptyFileGridPrompt: i18n.translate('xpack.files.filePicker.emptyGridPrompt', { - defaultMessage: 'No files matched filter', - }), - loadMoreButtonLabel: i18n.translate('xpack.files.filePicker.loadMoreButtonLabel', { - defaultMessage: 'Load more', - }), - clearFilterButton: i18n.translate('xpack.files.filePicker.clearFilterButtonLabel', { - defaultMessage: 'Clear filter', - }), - uploadFilePlaceholderText: i18n.translate('xpack.files.filePicker.uploadFilePlaceholderText', { - defaultMessage: 'Drag and drop to upload new files', - }), -}; diff --git a/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts b/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts deleted file mode 100644 index b58616e3d86b0..0000000000000 --- a/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const i18nTexts = { - defaultPickerLabel: i18n.translate('xpack.files.uploadFile.defaultFilePickerLabel', { - defaultMessage: 'Upload a file', - }), - upload: i18n.translate('xpack.files.uploadFile.uploadButtonLabel', { - defaultMessage: 'Upload', - }), - uploading: i18n.translate('xpack.files.uploadFile.uploadingButtonLabel', { - defaultMessage: 'Uploading', - }), - uploadComplete: i18n.translate('xpack.files.uploadFile.uploadCompleteButtonLabel', { - defaultMessage: 'Upload complete', - }), - retry: i18n.translate('xpack.files.uploadFile.retryButtonLabel', { - defaultMessage: 'Retry', - }), - clear: i18n.translate('xpack.files.uploadFile.clearButtonLabel', { - defaultMessage: 'Clear', - }), - cancel: i18n.translate('xpack.files.uploadFile.cancelButtonLabel', { - defaultMessage: 'Cancel', - }), - uploadDone: i18n.translate('xpack.files.uploadFile.uploadDoneToolTipContent', { - defaultMessage: 'Your file was successfully uploaded!', - }), - fileTooLarge: (expectedSize: string) => - i18n.translate('xpack.files.uploadFile.fileTooLargeErrorMessage', { - defaultMessage: - 'File is too large. Maximum size is {expectedSize, plural, one {# byte} other {# bytes} }.', - values: { expectedSize }, - }), -}; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts b/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts index e778a94e90ac9..ddbdd660efb52 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts @@ -226,7 +226,7 @@ export const sendEndpointActionResponse = async ( // Index the file content (just one chunk) // call to `.index()` copied from File plugin here: - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 + // https://github.com/elastic/kibana/blob/main/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 await esClient.index( { index: FILE_STORAGE_DATA_INDEX, diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 51a166cccd5e5..9dd16bd332c13 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -19,6 +19,7 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../src/plugins/files/tsconfig.json"}, { "path": "../../../src/plugins/home/tsconfig.json" }, { "path": "../../../src/plugins/inspector/tsconfig.json" }, { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, @@ -46,7 +47,6 @@ { "path": "../security/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, { "path": "../threat_intelligence/tsconfig.json" }, - { "path": "../timelines/tsconfig.json" }, - { "path": "../files/tsconfig.json"} + { "path": "../timelines/tsconfig.json" } ] } diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index 5eb2c8d5a5869..aa1ad20363166 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -5116,83 +5116,6 @@ } } }, - "files": { - "properties": { - "countByExtension": { - "type": "array", - "items": { - "properties": { - "extension": { - "type": "keyword" - }, - "count": { - "type": "long" - } - } - } - }, - "countByStatus": { - "properties": { - "AWAITING_UPLOAD": { - "type": "long", - "_meta": { - "description": "Number of files awaiting upload" - } - }, - "DELETED": { - "type": "long", - "_meta": { - "description": "Number of files that are marked as deleted" - } - }, - "READY": { - "type": "long", - "_meta": { - "description": "Number of files that are ready for download" - } - }, - "UPLOADING": { - "type": "long", - "_meta": { - "description": "Number of files that are currently uploading" - } - }, - "UPLOAD_ERROR": { - "type": "long", - "_meta": { - "description": "Number of files that failed to upload" - } - } - } - }, - "storage": { - "properties": { - "esFixedSizeIndex": { - "properties": { - "capacity": { - "type": "long", - "_meta": { - "description": "Capacity of the fixed size index" - } - }, - "available": { - "type": "long", - "_meta": { - "description": "Available storage in bytes" - } - }, - "used": { - "type": "long", - "_meta": { - "description": "Used storage in bytes" - } - } - } - } - } - } - } - }, "fleet": { "properties": { "agents_enabled": {