@travetto/model-elasticsearch 4.1.4 → 5.0.0-rc.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ArcSine Technologies
3
+ Copyright (c) 2023 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-elasticsearch",
3
- "version": "4.1.4",
3
+ "version": "5.0.0-rc.0",
4
4
  "description": "Elasticsearch backing for the travetto model module, with real-time modeling support for Elasticsearch mappings.",
5
5
  "keywords": [
6
6
  "elasticsearch",
@@ -28,12 +28,12 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@elastic/elasticsearch": "^8.14.0",
31
- "@travetto/config": "^4.1.2",
32
- "@travetto/model": "^4.1.3",
33
- "@travetto/model-query": "^4.1.4"
31
+ "@travetto/config": "^5.0.0-rc.0",
32
+ "@travetto/model": "^5.0.0-rc.0",
33
+ "@travetto/model-query": "^5.0.0-rc.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@travetto/command": "^4.1.1"
36
+ "@travetto/command": "^5.0.0-rc.0"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@travetto/command": {
@@ -1,6 +1,6 @@
1
1
  import { QueryDslQueryContainer, SearchRequest, SearchResponse, Sort, SortOptions } from '@elastic/elasticsearch/lib/api/types';
2
2
 
3
- import { Class, ObjectUtil } from '@travetto/base';
3
+ import { Class } from '@travetto/base';
4
4
  import { WhereClause, SelectClause, SortClause, Query } from '@travetto/model-query';
5
5
  import { QueryLanguageParser } from '@travetto/model-query/src/internal/query/parser';
6
6
  import { QueryVerifier } from '@travetto/model-query/src/internal/query/verifier';
@@ -35,7 +35,7 @@ export class ElasticsearchQueryUtil {
35
35
  for (const key of keys) {
36
36
  const subPath = `${path}${key}`;
37
37
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
38
- if (ObjectUtil.isPlainObject(sub[key]) && !Object.keys(sub[key] as Record<string, unknown>)[0].startsWith('$')) {
38
+ if (DataUtil.isPlainObject(sub[key]) && !Object.keys(sub[key] as Record<string, unknown>)[0].startsWith('$')) {
39
39
  Object.assign(out, this.extractSimple(sub[key], `${subPath}.`));
40
40
  } else {
41
41
  out[subPath] = sub[key];
@@ -93,7 +93,7 @@ export class ElasticsearchQueryUtil {
93
93
  ((key === 'id' && !path) ? '_id' : `${path}${key}`) :
94
94
  `${path}${key}`;
95
95
 
96
- if (ObjectUtil.isPlainObject(top)) {
96
+ if (DataUtil.isPlainObject(top)) {
97
97
  const subKey = Object.keys(top)[0];
98
98
  if (!subKey.startsWith('$')) {
99
99
  const inner = this.extractWhereTermQuery(declaredType, top, config, `${sPath}.`);
@@ -321,7 +321,7 @@ export class ElasticsearchQueryUtil {
321
321
  const obj = r._source!;
322
322
  if (includeId) {
323
323
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
324
- (obj as unknown as { _id: string })._id = r._id;
324
+ (obj as unknown as { _id: string })._id = r._id!;
325
325
  }
326
326
  out.push(obj);
327
327
  }