Skip to content

Commit

Permalink
[Search] Extract connectors to package (elastic#165590)
Browse files Browse the repository at this point in the history
## Summary

This moves connectors functions to a shared package so Serverless Search
and Enterprise Search can both use it.

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
sphilipse and kibanamachine authored Sep 6, 2023
1 parent 782ab86 commit b335c3a
Show file tree
Hide file tree
Showing 161 changed files with 2,016 additions and 1,670 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ src/plugins/screenshot_mode @elastic/appex-sharedux
x-pack/examples/screenshotting_example @elastic/appex-sharedux
x-pack/plugins/screenshotting @elastic/kibana-reporting-services
packages/kbn-search-api-panels @elastic/enterprise-search-frontend
packages/kbn-search-connectors @elastic/enterprise-search-frontend
examples/search_examples @elastic/kibana-data-discovery
packages/kbn-search-response-warnings @elastic/kibana-data-discovery
x-pack/plugins/searchprofiler @elastic/platform-deployment-management
Expand Down
34 changes: 27 additions & 7 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
"apmOss": "src/plugins/apm_oss",
"autocomplete": "packages/kbn-securitysolution-autocomplete/src",
"bfetch": "src/plugins/bfetch",
"cases": ["packages/kbn-cases-components"],
"cases": [
"packages/kbn-cases-components"
],
"cellActions": "packages/kbn-cell-actions",
"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",
"domDragDrop": "packages/kbn-dom-drag-drop",
Expand All @@ -21,7 +26,10 @@
"dataViews": "src/plugins/data_views",
"defaultNavigation": "packages/default-nav",
"devTools": "src/plugins/dev_tools",
"discover": ["src/plugins/discover", "packages/kbn-discover-utils"],
"discover": [
"src/plugins/discover",
"packages/kbn-discover-utils"
],
"savedSearch": "src/plugins/saved_search",
"embeddableApi": "src/plugins/embeddable",
"embeddableExamples": "examples/embeddable_examples",
Expand Down Expand Up @@ -89,6 +97,7 @@
"savedObjects": "src/plugins/saved_objects",
"savedObjectsFinder": "src/plugins/saved_objects_finder",
"savedObjectsManagement": "src/plugins/saved_objects_management",
"searchConnectors": "packages/kbn-search-connectors",
"server": "src/legacy/server",
"share": "src/plugins/share",
"sharedUXPackages": "packages/shared-ux",
Expand All @@ -100,9 +109,17 @@
"languageDocumentationPopover": "packages/kbn-language-documentation-popover/src",
"textBasedLanguages": "src/plugins/text_based_languages",
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
"timelion": ["src/plugins/vis_types/timelion"],
"uiActions": ["src/plugins/ui_actions", "packages/kbn-ui-actions-browser"],
"telemetry": [
"src/plugins/telemetry",
"src/plugins/telemetry_management_section"
],
"timelion": [
"src/plugins/vis_types/timelion"
],
"uiActions": [
"src/plugins/ui_actions",
"packages/kbn-ui-actions-browser"
],
"uiActionsEnhanced": "src/plugins/ui_actions_enhanced",
"uiActionsExamples": "examples/ui_action_examples",
"usageCollection": "src/plugins/usage_collection",
Expand All @@ -122,7 +139,10 @@
"visTypeXy": "src/plugins/vis_types/xy",
"visualizations": "src/plugins/visualizations",
"visualizationUiComponents": "packages/kbn-visualization-ui-components",
"unifiedDocViewer": ["src/plugins/unified_doc_viewer", "packages/kbn-unified-doc-viewer"],
"unifiedDocViewer": [
"src/plugins/unified_doc_viewer",
"packages/kbn-unified-doc-viewer"
],
"unifiedSearch": "src/plugins/unified_search",
"unifiedFieldList": "packages/kbn-unified-field-list",
"unifiedHistogram": "src/plugins/unified_histogram",
Expand Down
7 changes: 1 addition & 6 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ xpack.observability.enabled: false
xpack.securitySolution.enabled: false
xpack.serverless.observability.enabled: false
xpack.uptime.enabled: false
enterpriseSearch.enabled: true
enterpriseSearch.canDeployEntSearch: false
enterpriseSearch.hasConnectors: true
enterpriseSearch.hasNativeConnectors: false
enterpriseSearch.hasWebCrawler: false
enterpriseSearch.ui.enabled: false
enterpriseSearch.enabled: false
monitoring.ui.enabled: false
xpack.fleet.enabled: false

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@
"@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example",
"@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting",
"@kbn/search-api-panels": "link:packages/kbn-search-api-panels",
"@kbn/search-connectors": "link:packages/kbn-search-connectors",
"@kbn/search-examples-plugin": "link:examples/search_examples",
"@kbn/search-response-warnings": "link:packages/kbn-search-response-warnings",
"@kbn/searchprofiler-plugin": "link:x-pack/plugins/searchprofiler",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-search-connectors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/search-connectors

Empty package generated by @kbn/generate
Original file line number Diff line number Diff line change
@@ -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 { i18n } from '@kbn/i18n';
Expand All @@ -17,13 +18,17 @@ export interface ConnectorServerSideDefinition {
serviceType: string;
}

/* The consumer should host these icons and transform the iconPath into something usable
* Enterprise Search and Serverless Search do this right now
*/

export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
{
iconPath: 'azure_blob_storage.svg',
isBeta: true,
isNative: true,
keywords: ['cloud', 'azure', 'blob', 's3', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.azureBlob.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.azureBlob.name', {
defaultMessage: 'Azure Blob Storage',
}),
serviceType: 'azure_blob_storage',
Expand All @@ -33,7 +38,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: false,
isNative: true,
keywords: ['confluence', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.confluence.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.confluence.name', {
defaultMessage: 'Confluence Cloud & Server',
}),
serviceType: 'confluence',
Expand All @@ -44,7 +49,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: true,
isTechPreview: false,
keywords: ['dropbox', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.dropbox.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.dropbox.name', {
defaultMessage: 'Dropbox',
}),
serviceType: 'dropbox',
Expand All @@ -54,7 +59,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: false,
isNative: true,
keywords: ['jira', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.jira.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.jira.name', {
defaultMessage: 'Jira Cloud & Server',
}),
serviceType: 'jira',
Expand All @@ -64,7 +69,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['github', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.github.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.github.name', {
defaultMessage: 'GitHub & GitHub Enterprise Server',
}),
serviceType: 'github',
Expand All @@ -74,7 +79,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['google', 'cloud', 'blob', 's3', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.googleCloud.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.googleCloud.name', {
defaultMessage: 'Google Cloud Storage',
}),
serviceType: 'google_cloud_storage',
Expand All @@ -84,7 +89,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['google', 'drive', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.googleDrive.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.googleDrive.name', {
defaultMessage: 'Google Drive',
}),
serviceType: 'google_drive',
Expand All @@ -94,7 +99,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: false,
isNative: true,
keywords: ['mongo', 'mongodb', 'database', 'nosql', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.mongodb.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.mongodb.name', {
defaultMessage: 'MongoDB',
}),
serviceType: 'mongodb',
Expand All @@ -104,7 +109,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: false,
isNative: true,
keywords: ['mysql', 'sql', 'database', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.mysql.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.mysql.name', {
defaultMessage: 'MySQL',
}),
serviceType: 'mysql',
Expand All @@ -114,7 +119,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: true,
keywords: ['mssql', 'microsoft', 'sql', 'database', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.microsoftSQL.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.microsoftSQL.name', {
defaultMessage: 'Microsoft SQL',
}),
serviceType: 'mssql',
Expand All @@ -124,7 +129,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: false,
isNative: true,
keywords: ['network', 'drive', 'file', 'directory', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.networkDrive.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.networkDrive.name', {
defaultMessage: 'Network drive',
}),
serviceType: 'network_drive',
Expand All @@ -134,7 +139,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: true,
keywords: ['postgresql', 'sql', 'database', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.postgresql.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.postgresql.name', {
defaultMessage: 'PostgreSQL',
}),
serviceType: 'postgresql',
Expand All @@ -145,7 +150,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: false,
isTechPreview: false,
keywords: ['salesforce', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.salesforce.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.salesforce.name', {
defaultMessage: 'Salesforce',
}),
serviceType: 'salesforce',
Expand All @@ -156,7 +161,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: true,
isTechPreview: false,
keywords: ['servicenow', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.serviceNow.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.serviceNow.name', {
defaultMessage: 'ServiceNow',
}),
serviceType: 'servicenow',
Expand All @@ -167,7 +172,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: true,
isTechPreview: false,
keywords: ['sharepoint', 'office365', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.sharepoint_online.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.sharepoint_online.name', {
defaultMessage: 'Sharepoint Online',
}),
serviceType: 'sharepoint_online',
Expand All @@ -178,7 +183,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: false,
isTechPreview: true,
keywords: ['google', 'gmail', 'connector', 'mail'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.gmail.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.gmail.name', {
defaultMessage: 'Gmail',
}),
serviceType: 'gmail',
Expand All @@ -188,7 +193,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['oracle', 'sql', 'database', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.oracle.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.oracle.name', {
defaultMessage: 'Oracle',
}),
serviceType: 'oracle',
Expand All @@ -198,7 +203,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['network', 'drive', 'file', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.oneDrive.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.oneDrive.name', {
defaultMessage: 'OneDrive',
}),
serviceType: 'onedrive',
Expand All @@ -208,7 +213,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['s3', 'cloud', 'amazon', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.s3.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.s3.name', {
defaultMessage: 'S3',
}),
serviceType: 's3',
Expand All @@ -219,7 +224,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: false,
isTechPreview: true,
keywords: ['slack', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.slack.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.slack.name', {
defaultMessage: 'Slack',
}),
serviceType: 'slack',
Expand All @@ -230,7 +235,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isNative: false,
isTechPreview: false,
keywords: ['sharepoint', 'cloud', 'connector'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.sharepointServer.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.sharepointServer.name', {
defaultMessage: 'Sharepoint Server',
}),
serviceType: 'sharepoint_server',
Expand All @@ -240,7 +245,7 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [
isBeta: true,
isNative: false,
keywords: ['custom', 'connector', 'code'],
name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.customConnector.name', {
name: i18n.translate('searchConnectors.content.nativeConnectors.customConnector.name', {
defaultMessage: 'Customized connector',
}),
serviceType: '',
Expand Down
19 changes: 19 additions & 0 deletions packages/kbn-search-connectors/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

export const CONNECTORS_INDEX = '.elastic-connectors';
export const CURRENT_CONNECTORS_INDEX = '.elastic-connectors-v1';
export const CONNECTORS_JOBS_INDEX = '.elastic-connectors-sync-jobs';
export const CURRENT_CONNECTORS_JOB_INDEX = '.elastic-connectors-sync-jobs-v1';
export const CONNECTORS_VERSION = 1;
export const CONNECTORS_ACCESS_CONTROL_INDEX_PREFIX = '.search-acl-filter-';

export * from './connectors';
export * from './lib';
export * from './types';
export * from './utils';
13 changes: 13 additions & 0 deletions packages/kbn-search-connectors/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +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 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: ['<rootDir>/packages/kbn-search-connectors'],
};
5 changes: 5 additions & 0 deletions packages/kbn-search-connectors/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/search-connectors",
"owner": "@elastic/enterprise-search-frontend"
}
Loading

0 comments on commit b335c3a

Please sign in to comment.