Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion apps/app/src/server/service/search-delegator/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,20 @@ class ElasticsearchDelegator
});
}
}

async createAuditlogIndex(index: string) {
if (isES7ClientDelegator(this.client)) {
const { mappings } = await import('./mappings/mappings-auditlog-es7');
return this.client.indices.create({ index, body: { ...mappings } });
}
if (isES8ClientDelegator(this.client)) {
const { mappings } = await import('./mappings/mappings-auditlog-es8');
return this.client.indices.create({ index, ...mappings });
}
if (isES9ClientDelegator(this.client)) {
const { mappings } = await import('./mappings/mappings-auditlog-es9');
return this.client.indices.create({ index, ...mappings });
}
}
/**
* generate object that is related to page.grant*
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { estypes } from '@elastic/elasticsearch7';

type Mappings = {
mappings: estypes.MappingTypeMapping;
};

export const mappings: Mappings = {
mappings: {
properties: {
username: { type: 'keyword' },
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { estypes } from '@elastic/elasticsearch8';

type Mappings = {
mappings: estypes.IndicesCreateRequest['mappings'];
};

export const mappings: Mappings = {
mappings: {
properties: {
username: { type: 'keyword' },
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { estypes } from '@elastic/elasticsearch9';

type Mappings = {
mappings: estypes.IndicesCreateRequest['mappings'];
};

export const mappings: Mappings = {
mappings: {
properties: {
username: { type: 'keyword' },
},
},
};
Loading