Skip to content

Commit

Permalink
Update naming and endpoints to 'doc source'
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Caldwell committed Mar 16, 2021
1 parent 5403d56 commit 739026a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/maps/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

export interface CreateIndexSourceResp {
export interface CreateDocSourceResp {
success: boolean;
error?: Error;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { ElasticsearchClient, IScopedClusterClient } from 'kibana/server';
import {
INDEX_META_DATA_CREATED_BY,
CreateIndexSourceResp,
CreateDocSourceResp,
IndexSourceMappings,
BodySettings,
} from '../common';
Expand All @@ -21,12 +21,12 @@ const DEFAULT_MAPPINGS = {
},
};

export async function createIndexSource(
export async function createDocSource(
index: string,
mappings: IndexSourceMappings,
{ asCurrentUser }: IScopedClusterClient,
indexPatternsService: IndexPatternsService
): Promise<CreateIndexSourceResp> {
): Promise<CreateDocSourceResp> {
try {
await createIndex(index, mappings, asCurrentUser);
await indexPatternsService.createAndSave(
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { schema } from '@kbn/config-schema';
import fs from 'fs';
import path from 'path';
import { initMVTRoutes } from './mvt/mvt_routes';
import { createIndexSource } from './create_index_source';
import { createDocSource } from './create_doc_source';

const EMPTY_EMS_CLIENT = {
async getFileLayers() {
Expand Down Expand Up @@ -619,7 +619,7 @@ export async function initRoutes(
context.core.savedObjects.client,
context.core.elasticsearch.client.asCurrentUser
);
const result = await createIndexSource(
const result = await createDocSource(
index,
mappings,
context.core.elasticsearch.client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import expect from '@kbn/expect';
export default function ({ getService }) {
const supertest = getService('supertest');

describe('index and pattern creation', () => {
describe('doc source creation', () => {
it('should create an index and pattern', async () => {
const resp = await supertest
.post(`/api/maps/docSource`)
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration/apis/maps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ({ loadTestFile, getService }) {
});

describe('', () => {
loadTestFile(require.resolve('./create_index_and_pattern'));
loadTestFile(require.resolve('./create_doc_source'));
loadTestFile(require.resolve('./fonts_api'));
loadTestFile(require.resolve('./index_settings'));
loadTestFile(require.resolve('./migrations'));
Expand Down

0 comments on commit 739026a

Please sign in to comment.