Server saved objects client through request context (#44143)

* Expose Saved Objects client in request context

* API Integration test for savedobjects in req context

* SavedObjectsClient docs

* SavedObjectsClient#find remove dependency on indexPatterns

And use the saved objects mappings instead

* Review comments

* Review comments, fixes and tests

* Use correct type for KQL syntax check
This commit is contained in:
Rudolf Meijering 2019-10-16 10:36:40 +02:00 committed by GitHub
parent 730ba21ed4
commit 3d28467d00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 743 additions and 585 deletions

View file

@ -20,11 +20,17 @@
export default function ({ getService }) {
const supertest = getService('supertest');
describe('core', () => {
it('provides access to request context', async () => (
describe('core request context', () => {
it('provides access to elasticsearch', async () => (
await supertest
.get('/testbed/ping')
.expect(200, 'Pong: true')
.get('/requestcontext/elasticsearch')
.expect(200, 'Elasticsearch: true')
));
it('provides access to SavedObjects client', async () => (
await supertest
.get('/requestcontext/savedobjectsclient')
.expect(200, 'SavedObjects client: {"page":1,"per_page":20,"total":0,"saved_objects":[]}')
));
});
}