Skip to content

Commit 15c0644

Browse files
authored
making vis (completely) serializable (#64207)
1 parent 3f43763 commit 15c0644

File tree

50 files changed

+572
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+572
-402
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [extractSearchSourceReferences](./kibana-plugin-plugins-data-public.extractsearchsourcereferences.md)
4+
5+
## extractSearchSourceReferences variable
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
extractReferences: (state: SearchSourceFields) => [SearchSourceFields & {
11+
indexRefName?: string | undefined;
12+
}, SavedObjectReference[]]
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [injectSearchSourceReferences](./kibana-plugin-plugins-data-public.injectsearchsourcereferences.md)
4+
5+
## injectSearchSourceReferences variable
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
injectReferences: (searchSourceFields: SearchSourceFields & {
11+
indexRefName: string;
12+
}, references: SavedObjectReference[]) => SearchSourceFields
13+
```

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@
101101
| [esFilters](./kibana-plugin-plugins-data-public.esfilters.md) | |
102102
| [esKuery](./kibana-plugin-plugins-data-public.eskuery.md) | |
103103
| [esQuery](./kibana-plugin-plugins-data-public.esquery.md) | |
104+
| [extractSearchSourceReferences](./kibana-plugin-plugins-data-public.extractsearchsourcereferences.md) | |
104105
| [fieldFormats](./kibana-plugin-plugins-data-public.fieldformats.md) | |
105106
| [FilterBar](./kibana-plugin-plugins-data-public.filterbar.md) | |
106107
| [getIndexPatternFieldListCreator](./kibana-plugin-plugins-data-public.getindexpatternfieldlistcreator.md) | |
107108
| [getKbnTypeNames](./kibana-plugin-plugins-data-public.getkbntypenames.md) | Get the esTypes known by all kbnFieldTypes {<!-- -->Array<string>} |
108109
| [indexPatterns](./kibana-plugin-plugins-data-public.indexpatterns.md) | |
110+
| [injectSearchSourceReferences](./kibana-plugin-plugins-data-public.injectsearchsourcereferences.md) | |
111+
| [parseSearchSourceJSON](./kibana-plugin-plugins-data-public.parsesearchsourcejson.md) | |
109112
| [QueryStringInput](./kibana-plugin-plugins-data-public.querystringinput.md) | |
110113
| [search](./kibana-plugin-plugins-data-public.search.md) | |
111114
| [SearchBar](./kibana-plugin-plugins-data-public.searchbar.md) | |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [parseSearchSourceJSON](./kibana-plugin-plugins-data-public.parsesearchsourcejson.md)
4+
5+
## parseSearchSourceJSON variable
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
parseSearchSourceJSON: (searchSourceJSON: string) => SearchSourceFields
11+
```

src/legacy/ui/public/new_platform/__mocks__/helpers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { chartPluginMock } from '../../../../../plugins/charts/public/mocks';
3232
import { advancedSettingsMock } from '../../../../../plugins/advanced_settings/public/mocks';
3333
import { savedObjectsManagementPluginMock } from '../../../../../plugins/saved_objects_management/public/mocks';
3434
import { visualizationsPluginMock } from '../../../../../plugins/visualizations/public/mocks';
35+
import { discoverPluginMock } from '../../../../../plugins/discover/public/mocks';
3536
/* eslint-enable @kbn/eslint/no-restricted-paths */
3637

3738
export const pluginsMock = {
@@ -48,6 +49,7 @@ export const pluginsMock = {
4849
visualizations: visualizationsPluginMock.createSetupContract(),
4950
kibanaLegacy: kibanaLegacyPluginMock.createSetupContract(),
5051
savedObjectsManagement: savedObjectsManagementPluginMock.createSetupContract(),
52+
discover: discoverPluginMock.createSetupContract(),
5153
}),
5254
createStart: () => ({
5355
data: dataPluginMock.createStartContract(),
@@ -62,6 +64,7 @@ export const pluginsMock = {
6264
visualizations: visualizationsPluginMock.createStartContract(),
6365
kibanaLegacy: kibanaLegacyPluginMock.createStartContract(),
6466
savedObjectsManagement: savedObjectsManagementPluginMock.createStartContract(),
67+
discover: discoverPluginMock.createStartContract(),
6568
}),
6669
};
6770

src/legacy/ui/public/new_platform/new_platform.karma_mock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ export const npStart = {
515515
docViews: {
516516
DocViewer: () => null,
517517
},
518+
savedSearchLoader: {},
518519
},
519520
},
520521
};

src/legacy/ui/public/new_platform/set_services.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export function setStartServices(npStart: NpStart) {
5757
dataServices.setIndexPatterns(npStart.plugins.data.indexPatterns);
5858
dataServices.setQueryService(npStart.plugins.data.query);
5959
dataServices.setSearchService(npStart.plugins.data.search);
60+
6061
visualizationsServices.setI18n(npStart.core.i18n);
6162
visualizationsServices.setTypes(
6263
pick(npStart.plugins.visualizations, ['get', 'all', 'getAliases'])
@@ -82,4 +83,5 @@ export function setStartServices(npStart: NpStart) {
8283
visualizationTypes: visualizationsServices.getTypes(),
8384
});
8485
visualizationsServices.setSavedVisualizationsLoader(savedVisualizationsLoader);
86+
visualizationsServices.setSavedSearchLoader(npStart.plugins.discover.savedSearchLoader);
8587
}

src/plugins/data/public/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ export {
358358
SearchResponse,
359359
SearchError,
360360
ISearchSource,
361+
parseSearchSourceJSON,
362+
injectSearchSourceReferences,
363+
extractSearchSourceReferences,
361364
SearchSourceFields,
362365
EsQuerySortValue,
363366
SortDirection,

src/plugins/data/public/public.api.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import * as React_2 from 'react';
4646
import { Required } from '@kbn/utility-types';
4747
import * as Rx from 'rxjs';
4848
import { SavedObject as SavedObject_2 } from 'src/core/public';
49-
import { SavedObjectReference } from 'kibana/public';
5049
import { SavedObjectsClientContract } from 'src/core/public';
5150
import { SearchParams } from 'elasticsearch';
5251
import { SearchResponse as SearchResponse_2 } from 'elasticsearch';
@@ -420,6 +419,14 @@ export type ExistsFilter = Filter & {
420419
exists?: FilterExistsProperty;
421420
};
422421

422+
// Warning: (ae-forgotten-export) The symbol "SavedObjectReference" needs to be exported by the entry point index.d.ts
423+
// Warning: (ae-missing-release-tag) "extractReferences" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
424+
//
425+
// @public (undocumented)
426+
export const extractSearchSourceReferences: (state: SearchSourceFields) => [SearchSourceFields & {
427+
indexRefName?: string | undefined;
428+
}, SavedObjectReference[]];
429+
423430
// Warning: (ae-missing-release-tag) "FetchOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
424431
//
425432
// @public (undocumented)
@@ -1059,6 +1066,13 @@ export interface IndexPatternTypeMeta {
10591066
aggs?: Record<string, IndexPatternAggRestrictions>;
10601067
}
10611068

1069+
// Warning: (ae-missing-release-tag) "injectReferences" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
1070+
//
1071+
// @public (undocumented)
1072+
export const injectSearchSourceReferences: (searchSourceFields: SearchSourceFields & {
1073+
indexRefName: string;
1074+
}, references: SavedObjectReference[]) => SearchSourceFields;
1075+
10621076
// Warning: (ae-missing-release-tag) "InputTimeRange" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
10631077
//
10641078
// @public (undocumented)
@@ -1273,6 +1287,11 @@ export interface OptionedValueProp {
12731287
// @public (undocumented)
12741288
export type ParsedInterval = ReturnType<typeof parseEsInterval>;
12751289

1290+
// Warning: (ae-missing-release-tag) "parseSearchSourceJSON" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
1291+
//
1292+
// @public (undocumented)
1293+
export const parseSearchSourceJSON: (searchSourceJSON: string) => SearchSourceFields;
1294+
12761295
// Warning: (ae-missing-release-tag) "PhraseFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
12771296
//
12781297
// @public (undocumented)
@@ -1809,20 +1828,20 @@ export type TSearchStrategyProvider<T extends TStrategyTypes> = (context: ISearc
18091828
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "getFromSavedObject" needs to be exported by the entry point index.d.ts
18101829
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts
18111830
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts
1812-
// src/plugins/data/public/index.ts:374:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
1813-
// src/plugins/data/public/index.ts:374:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
1814-
// src/plugins/data/public/index.ts:374:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
1815-
// src/plugins/data/public/index.ts:374:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
1816-
// src/plugins/data/public/index.ts:376:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
1817-
// src/plugins/data/public/index.ts:377:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
1818-
// src/plugins/data/public/index.ts:386:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
1819-
// src/plugins/data/public/index.ts:387:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
1820-
// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
1821-
// src/plugins/data/public/index.ts:392:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
1822-
// src/plugins/data/public/index.ts:393:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
1823-
// src/plugins/data/public/index.ts:396:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
1824-
// src/plugins/data/public/index.ts:397:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
1825-
// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
1831+
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
1832+
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
1833+
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
1834+
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
1835+
// src/plugins/data/public/index.ts:379:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
1836+
// src/plugins/data/public/index.ts:380:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
1837+
// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
1838+
// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
1839+
// src/plugins/data/public/index.ts:391:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
1840+
// src/plugins/data/public/index.ts:395:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
1841+
// src/plugins/data/public/index.ts:396:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
1842+
// src/plugins/data/public/index.ts:399:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
1843+
// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
1844+
// src/plugins/data/public/index.ts:403:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
18261845
// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:33:33 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts
18271846
// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:37:1 - (ae-forgotten-export) The symbol "QueryStateChange" needs to be exported by the entry point index.d.ts
18281847
// src/plugins/data/public/types.ts:52:5 - (ae-forgotten-export) The symbol "createFiltersFromValueClickAction" needs to be exported by the entry point index.d.ts

src/plugins/data/public/search/expressions/esaggs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export const esaggs = (): ExpressionFunctionDefinition<typeof name, Input, Argum
282282
const aggs = searchService.aggs.createAggConfigs(indexPattern, aggConfigsState);
283283

284284
// we should move searchSource creation inside courier request handler
285-
const searchSource = searchService.searchSource.create();
285+
const searchSource = await searchService.searchSource.create();
286286

287287
searchSource.setField('index', indexPattern);
288288
searchSource.setField('size', 0);

0 commit comments

Comments
 (0)