-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Search] Client side session service #76889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
1396af4
7bc93c3
e6f31d8
7de920f
b6eac29
9615706
812015d
739dde9
a9dec42
63c04d3
fc6d3c2
154a146
12e7898
f1390e2
1f9c340
e6a794d
13be80c
3e9dc9b
6f0b080
4f73686
021d12f
3035450
dd48dd2
21b44b7
aaa08cc
5a8dee8
8e09b74
396578d
f6fbb08
551335d
9b0e7ca
57b2a74
848eb0c
4e6f47d
741e8cd
40c9411
2c3d594
1142434
af29d63
a7fcea4
9c6972b
a9a1715
ecd5cce
8abced8
0f956c0
eed53fb
9b13bf9
990aba6
36400f0
8a25855
7b432ea
2c8e9ea
fc33904
dd7da3f
862d53a
db7ea0e
cd2bc82
b4034c2
3c0331f
b7e441d
92de71d
b07a802
b5beec7
2c503b8
26e8539
abffc40
6ce7fa9
8ae20f7
936391b
10e239b
fc8a3f8
5597cab
31189dc
40ba6c7
beb00b9
607f7ab
24310bd
ed3d8c0
8b557ab
ea0724b
d60d97d
1f0524e
87518d4
da7850a
b7f00c5
fac858d
c064626
3924dfd
5365204
1483a41
c8294b6
52aa231
798dc5e
e181864
0cca933
69179e6
a2f9b65
4d11ab6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [isCompleteResponse](./kibana-plugin-plugins-data-public.iscompleteresponse.md) | ||
|
|
||
| ## isCompleteResponse variable | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| isCompleteResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchOptions](./kibana-plugin-plugins-data-public.isearchoptions.md) > [sessionId](./kibana-plugin-plugins-data-public.isearchoptions.sessionid.md) | ||
|
|
||
| ## ISearchOptions.sessionId property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| sessionId?: string; | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [isErrorResponse](./kibana-plugin-plugins-data-public.iserrorresponse.md) | ||
|
|
||
| ## isErrorResponse variable | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| isErrorResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [isPartialResponse](./kibana-plugin-plugins-data-public.ispartialresponse.md) | ||
|
|
||
| ## isPartialResponse variable | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| isPartialResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) > [onRequestComplete](./kibana-plugin-plugins-data-public.searchinterceptor.onrequestcomplete.md) | ||
|
|
||
| ## SearchInterceptor.onRequestComplete() method | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| protected onRequestComplete(request: IEsSearchRequest, sessionId?: string): void; | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| | --- | --- | --- | | ||
| | request | <code>IEsSearchRequest</code> | | | ||
| | sessionId | <code>string</code> | | | ||
|
|
||
| <b>Returns:</b> | ||
|
|
||
| `void` | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) > [onRequestError](./kibana-plugin-plugins-data-public.searchinterceptor.onrequesterror.md) | ||
|
|
||
| ## SearchInterceptor.onRequestError() method | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| protected onRequestError(request: IEsSearchRequest, sessionId?: string): void; | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| | --- | --- | --- | | ||
| | request | <code>IEsSearchRequest</code> | | | ||
| | sessionId | <code>string</code> | | | ||
|
|
||
| <b>Returns:</b> | ||
|
|
||
| `void` | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) > [onRequestStart](./kibana-plugin-plugins-data-public.searchinterceptor.onrequeststart.md) | ||
|
|
||
| ## SearchInterceptor.onRequestStart() method | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| protected onRequestStart(request: IEsSearchRequest, sessionId: string | undefined, timeoutSignal: AbortSignal, searchId?: string): void; | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| | --- | --- | --- | | ||
| | request | <code>IEsSearchRequest</code> | | | ||
| | sessionId | <code>string | undefined</code> | | | ||
| | timeoutSignal | <code>AbortSignal</code> | | | ||
| | searchId | <code>string</code> | | | ||
|
|
||
| <b>Returns:</b> | ||
|
|
||
| `void` | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [isCompleteResponse](./kibana-plugin-plugins-data-server.iscompleteresponse.md) | ||
|
|
||
| ## isCompleteResponse variable | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| isCompleteResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) > [sessionId](./kibana-plugin-plugins-data-server.isearchoptions.sessionid.md) | ||
|
|
||
| ## ISearchOptions.sessionId property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| sessionId?: string; | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [isErrorResponse](./kibana-plugin-plugins-data-server.iserrorresponse.md) | ||
|
|
||
| ## isErrorResponse variable | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| isErrorResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,3 +24,5 @@ export { | |
| ES_SEARCH_STRATEGY, | ||
| ISearchOptions, | ||
| } from './types'; | ||
|
|
||
| export * from './utils'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { IEsSearchResponse } from './types'; | ||
|
|
||
| export const isErrorResponse = (response?: IEsSearchResponse) => { | ||
| return !response || (!response.isRunning && response.isPartial); | ||
| }; | ||
|
|
||
| export const isCompleteResponse = (response?: IEsSearchResponse) => { | ||
| return response && !response.isRunning && !response.isPartial; | ||
| }; | ||
|
|
||
| export const isPartialResponse = (response?: IEsSearchResponse) => { | ||
| return response && response.isRunning && response.isPartial; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,6 +210,14 @@ export class DataPublicPlugin | |
| storage: this.storage, | ||
| }); | ||
|
|
||
| /* | ||
| Clear any open sessions upon navigation to make sure they are not used mistakenly by | ||
| another application. | ||
| */ | ||
| core.application.currentAppId$.subscribe(() => { | ||
|
||
| search.session.clear(); | ||
| }); | ||
|
|
||
| return { | ||
| ...dataServices, | ||
| ui: { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.