@opra/elastic 1.0.7 → 1.0.9

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.
@@ -54,7 +54,7 @@ function prepareFilterAst(ast, negative) {
54
54
  return prepareFilterAst(ast.expression, negative);
55
55
  }
56
56
  if (ast instanceof common_1.OpraFilter.ComparisonExpression) {
57
- if (!(ast.left instanceof common_1.OpraFilter.QualifiedIdentifier)) {
57
+ if (!(ast.left instanceof common_1.OpraFilter.QualifiedIdentifier || ast.left instanceof common_1.OpraFilter.StringLiteral)) {
58
58
  throw new Error('Left side of ComparisonExpression must be a QualifiedIdentifier');
59
59
  }
60
60
  const left = prepareFilterAst(ast.left);
@@ -86,6 +86,7 @@ class ElasticEntityService extends elastic_service_js_1.ElasticService {
86
86
  (0, valgen_1.isNotNullish)(input._id, { label: 'input._id' });
87
87
  const inputCodec = this._getInputCodec('create');
88
88
  const doc = inputCodec(input);
89
+ delete doc._id;
89
90
  const { options } = command;
90
91
  const request = {
91
92
  ...options?.request,
@@ -51,7 +51,7 @@ function prepareFilterAst(ast, negative) {
51
51
  return prepareFilterAst(ast.expression, negative);
52
52
  }
53
53
  if (ast instanceof OpraFilter.ComparisonExpression) {
54
- if (!(ast.left instanceof OpraFilter.QualifiedIdentifier)) {
54
+ if (!(ast.left instanceof OpraFilter.QualifiedIdentifier || ast.left instanceof OpraFilter.StringLiteral)) {
55
55
  throw new Error('Left side of ComparisonExpression must be a QualifiedIdentifier');
56
56
  }
57
57
  const left = prepareFilterAst(ast.left);
@@ -83,6 +83,7 @@ export class ElasticEntityService extends ElasticService {
83
83
  isNotNullish(input._id, { label: 'input._id' });
84
84
  const inputCodec = this._getInputCodec('create');
85
85
  const doc = inputCodec(input);
86
+ delete doc._id;
86
87
  const { options } = command;
87
88
  const request = {
88
89
  ...options?.request,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/elastic",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Opra Elastic Search adapter package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "peerDependencies": {
14
14
  "@elastic/elasticsearch": ">=8.7.0",
15
- "@opra/common": "^1.0.7",
16
- "@opra/core": "^1.0.7"
15
+ "@opra/common": "^1.0.9",
16
+ "@opra/core": "^1.0.9"
17
17
  },
18
18
  "type": "module",
19
19
  "exports": {