UNPKG

dsl-builder

Version:

OpenSearch Query Builder - Extract from OpenSearch Dashboards

95 lines (94 loc) 3.2 kB
"use strict"; /* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DATA_STRUCTURE_META_TYPES = void 0; /** * Represents the hierarchical structure of data within a data source. * * @example * * const openSearchCluster: DataStructure = { * id: "b18e5f58-cf71-11ee-ad92-2468ce360004", * title: "Data Cluster1", * type: "DATA_SOURCE", * children: [ * { * id: "b18e5f58-cf71-11ee-ad92-2468ce360004::logs-2023.05", * title: "logs-2023.05", * type: "INDEX", * parent: { id: "b18e5f58-cf71-11ee-ad92-2468ce360004", title: "Data Cluster1", type: "DATA_SOURCE" }, * meta: { * type: 'FEATURE', * icon: 'indexIcon', * tooltip: 'Logs from May 2023' * } * }, * { * id: "b18e5f58-cf71-11ee-ad92-2468ce360004::logs-2023.06", * title: "logs-2023.06", * type: "INDEX", * parent: { id: "b18e5f58-cf71-11ee-ad92-2468ce360004", title: "Data Cluster1", type: "DATA_SOURCE" }, * meta: { * type: 'FEATURE', * icon: 'indexIcon', * tooltip: 'Logs from June 2023' * } * } * ], * meta: { * type: 'FEATURE', * icon: 'clusterIcon', * tooltip: 'OpenSearch Cluster' * } * }; * * Example of an S3 data source with a connection, database, and tables: * * const s3DataSource: DataStructure = { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003", * title: "Flint MDS cluster name", * type: "DATA_SOURCE", * children: [ * { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3", * title: "mys3", * type: "CONNECTION", * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003", title: "Flint MDS cluster name", type: "DATA_SOURCE" }, * children: [ * { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb", * title: "defaultDb", * type: "DATABASE", * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3", title: "mys3", type: "CONNECTION" }, * children: [ * { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb.table1", * title: "table1", * type: "TABLE", * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb", title: "defaultDb", type: "DATABASE" } * }, * { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb.table2", * title: "table2", * type: "TABLE", * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb", title: "defaultDb", type: "DATABASE" } * } * ] * } * ] * } * ] * }; */ /** * DataStructureMeta types */ var DATA_STRUCTURE_META_TYPES; (function (DATA_STRUCTURE_META_TYPES) { DATA_STRUCTURE_META_TYPES["FEATURE"] = "FEATURE"; DATA_STRUCTURE_META_TYPES["TYPE"] = "TYPE"; DATA_STRUCTURE_META_TYPES["CUSTOM"] = "CUSTOM"; })(DATA_STRUCTURE_META_TYPES = exports.DATA_STRUCTURE_META_TYPES || (exports.DATA_STRUCTURE_META_TYPES = {}));