@travetto/model-elasticsearch 8.0.0-alpha.13 → 8.0.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/index-manager.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-elasticsearch",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Elasticsearch backing for the travetto model module, with real-time modeling support for Elasticsearch mappings.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@elastic/elasticsearch": "^9.3.4",
|
|
32
|
-
"@travetto/config": "^8.0.0-alpha.
|
|
33
|
-
"@travetto/model": "^8.0.0-alpha.
|
|
34
|
-
"@travetto/model-indexed": "^8.0.0-alpha.
|
|
35
|
-
"@travetto/model-query": "^8.0.0-alpha.
|
|
32
|
+
"@travetto/config": "^8.0.0-alpha.13",
|
|
33
|
+
"@travetto/model": "^8.0.0-alpha.13",
|
|
34
|
+
"@travetto/model-indexed": "^8.0.0-alpha.15",
|
|
35
|
+
"@travetto/model-query": "^8.0.0-alpha.14"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@travetto/cli": "^8.0.0-alpha.
|
|
38
|
+
"@travetto/cli": "^8.0.0-alpha.18"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"@travetto/cli": {
|
package/src/index-manager.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type * as estypes from '@elastic/elasticsearch/api/types';
|
|
|
3
3
|
|
|
4
4
|
import { JSONUtil, type Class } from '@travetto/runtime';
|
|
5
5
|
import { ModelRegistryIndex, type ModelType, type ModelStorageSupport } from '@travetto/model';
|
|
6
|
+
import { warnIfIndexedUniqueIndex } from '@travetto/model-indexed';
|
|
6
7
|
|
|
7
8
|
import type { ElasticsearchModelConfig } from './config.ts';
|
|
8
9
|
import { ElasticsearchSchemaUtil } from './internal/schema.ts';
|
|
@@ -103,6 +104,8 @@ export class IndexManager implements ModelStorageSupport {
|
|
|
103
104
|
const { index } = this.getIdentity(cls);
|
|
104
105
|
const resolvedAlias = await this.#client.indices.getMapping({ index }).catch(() => undefined);
|
|
105
106
|
|
|
107
|
+
warnIfIndexedUniqueIndex(this, cls, ModelRegistryIndex.getIndices(cls));
|
|
108
|
+
|
|
106
109
|
if (resolvedAlias) {
|
|
107
110
|
const [currentIndex] = Object.keys(resolvedAlias ?? {});
|
|
108
111
|
const pendingMapping = ElasticsearchSchemaUtil.generateSchemaMapping(cls, this.config.schemaConfig);
|