@lowdefy/connection-elasticsearch 4.0.0-rc.0 → 4.0.0-rc.10

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,9 +14,9 @@
14
14
  limitations under the License.
15
15
  */ import { Client } from '@elastic/elasticsearch';
16
16
  import schema from './schema.js';
17
- async function ElasticsearchDelete({ request , connection }) {
17
+ async function ElasticsearchDelete({ request, connection }) {
18
18
  const client = new Client(connection);
19
- const { body: response } = await client.delete({
19
+ const { body: response } = await client.delete({
20
20
  ...request,
21
21
  index: request.index || connection.index
22
22
  });
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  type: 'number'
31
- },
31
+ }
32
32
  ],
33
33
  description: 'Unique identifier for the document.'
34
34
  },
@@ -51,7 +51,7 @@
51
51
  },
52
52
  {
53
53
  type: 'boolean'
54
- },
54
+ }
55
55
  ],
56
56
  description: 'If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for. Default: false.',
57
57
  enum: [
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,9 +14,9 @@
14
14
  limitations under the License.
15
15
  */ import { Client } from '@elastic/elasticsearch';
16
16
  import schema from './schema.js';
17
- async function ElasticsearchDeleteByQuery({ request , connection }) {
17
+ async function ElasticsearchDeleteByQuery({ request, connection }) {
18
18
  const client = new Client(connection);
19
- const { body: response } = await client.deleteByQuery({
19
+ const { body: response } = await client.deleteByQuery({
20
20
  ...request,
21
21
  index: request.index || connection.index
22
22
  });
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -111,7 +111,7 @@
111
111
  },
112
112
  {
113
113
  type: 'boolean'
114
- },
114
+ }
115
115
  ],
116
116
  description: 'If true, Elasticsearch refreshes all shards involved in the delete by query after the request completes. Defaults to false.',
117
117
  enum: [
@@ -175,7 +175,7 @@
175
175
  },
176
176
  {
177
177
  type: 'string'
178
- },
178
+ }
179
179
  ]
180
180
  },
181
181
  _source: {
@@ -185,7 +185,7 @@
185
185
  },
186
186
  {
187
187
  type: 'array'
188
- },
188
+ }
189
189
  ],
190
190
  items: {
191
191
  type: 'string'
@@ -217,7 +217,7 @@
217
217
  },
218
218
  {
219
219
  type: 'string'
220
- },
220
+ }
221
221
  ]
222
222
  },
223
223
  terminate_after: {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,13 +14,13 @@
14
14
  limitations under the License.
15
15
  */ import { Client } from '@elastic/elasticsearch';
16
16
  import schema from './schema.js';
17
- async function ElasticsearchIndex({ request , connection }) {
17
+ async function ElasticsearchIndex({ request, connection }) {
18
18
  const client = new Client(connection);
19
19
  const body = {
20
20
  ...request,
21
21
  index: request.index || connection.index
22
22
  };
23
- const { body: response } = await client.index(body);
23
+ const { body: response } = await client.index(body);
24
24
  return {
25
25
  response,
26
26
  id: response._id
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  type: 'number'
31
- },
31
+ }
32
32
  ],
33
33
  description: 'Unique identifier for the document.'
34
34
  },
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -15,9 +15,9 @@
15
15
  */ import { Client } from '@elastic/elasticsearch';
16
16
  import { get } from '@lowdefy/helpers';
17
17
  import schema from './schema.js';
18
- async function ElasticsearchSearch({ request , connection }) {
18
+ async function ElasticsearchSearch({ request, connection }) {
19
19
  const client = new Client(connection);
20
- const { body: response } = await client.search({
20
+ const { body: response } = await client.search({
21
21
  ...request,
22
22
  index: request.index || connection.index
23
23
  });
@@ -29,7 +29,7 @@ async function ElasticsearchSearch({ request , connection }) {
29
29
  // We return the results in the _source field as the main results
30
30
  // and return all other fields in the _meta field.
31
31
  const hits = rawHits.map((hit)=>{
32
- const { _source , ..._meta } = hit;
32
+ const { _source, ..._meta } = hit;
33
33
  return {
34
34
  ..._source,
35
35
  _meta
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@
53
53
  },
54
54
  {
55
55
  type: 'boolean'
56
- },
56
+ }
57
57
  ]
58
58
  },
59
59
  _source_exclude: {
@@ -74,7 +74,7 @@
74
74
  },
75
75
  {
76
76
  type: 'string'
77
- },
77
+ }
78
78
  ]
79
79
  },
80
80
  _source_excludes: {
@@ -95,7 +95,7 @@
95
95
  },
96
96
  {
97
97
  type: 'string'
98
- },
98
+ }
99
99
  ]
100
100
  },
101
101
  _source_include: {
@@ -116,7 +116,7 @@
116
116
  },
117
117
  {
118
118
  type: 'string'
119
- },
119
+ }
120
120
  ]
121
121
  },
122
122
  _source_includes: {
@@ -137,7 +137,7 @@
137
137
  },
138
138
  {
139
139
  type: 'string'
140
- },
140
+ }
141
141
  ]
142
142
  },
143
143
  allow_no_indices: {
@@ -192,7 +192,7 @@
192
192
  },
193
193
  {
194
194
  type: 'string'
195
- },
195
+ }
196
196
  ]
197
197
  },
198
198
  error_trace: {
@@ -244,7 +244,7 @@
244
244
  },
245
245
  {
246
246
  type: 'string'
247
- },
247
+ }
248
248
  ],
249
249
  examples: [
250
250
  '',
@@ -301,7 +301,7 @@
301
301
  },
302
302
  {
303
303
  type: 'string'
304
- },
304
+ }
305
305
  ]
306
306
  },
307
307
  scroll: {
@@ -343,7 +343,7 @@
343
343
  },
344
344
  {
345
345
  type: 'string'
346
- },
346
+ }
347
347
  ]
348
348
  },
349
349
  source: {
@@ -361,7 +361,7 @@
361
361
  },
362
362
  {
363
363
  type: 'string'
364
- },
364
+ }
365
365
  ]
366
366
  },
367
367
  stored_fields: {
@@ -375,7 +375,7 @@
375
375
  },
376
376
  {
377
377
  type: 'string'
378
- },
378
+ }
379
379
  ]
380
380
  },
381
381
  suggest_field: {
@@ -427,7 +427,7 @@
427
427
  },
428
428
  {
429
429
  type: 'string'
430
- },
430
+ }
431
431
  ]
432
432
  },
433
433
  typed_keys: {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,9 +14,9 @@
14
14
  limitations under the License.
15
15
  */ import { Client } from '@elastic/elasticsearch';
16
16
  import schema from './schema.js';
17
- async function ElasticsearchUpdate({ request , connection }) {
17
+ async function ElasticsearchUpdate({ request, connection }) {
18
18
  const client = new Client(connection);
19
- const { body: response } = await client.update({
19
+ const { body: response } = await client.update({
20
20
  ...request,
21
21
  index: request.index || connection.index
22
22
  });
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
29
29
  },
30
30
  {
31
31
  type: 'number'
32
- },
32
+ }
33
33
  ],
34
34
  description: 'Unique identifier for the document to be updated.'
35
35
  },
@@ -57,7 +57,7 @@
57
57
  },
58
58
  {
59
59
  type: 'boolean'
60
- },
60
+ }
61
61
  ],
62
62
  description: 'If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for. Default: false.',
63
63
  enum: [
@@ -85,7 +85,7 @@
85
85
  },
86
86
  {
87
87
  type: 'array'
88
- },
88
+ }
89
89
  ],
90
90
  items: {
91
91
  type: 'string'
@@ -129,7 +129,7 @@
129
129
  required: [
130
130
  'script'
131
131
  ]
132
- },
132
+ }
133
133
  ],
134
134
  properties: {
135
135
  doc: {
@@ -159,7 +159,7 @@
159
159
  required: [
160
160
  'id'
161
161
  ]
162
- },
162
+ }
163
163
  ],
164
164
  properties: {
165
165
  lang: {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,9 +14,9 @@
14
14
  limitations under the License.
15
15
  */ import { Client } from '@elastic/elasticsearch';
16
16
  import schema from './schema.js';
17
- async function ElasticsearchUpdateByQuery({ request , connection }) {
17
+ async function ElasticsearchUpdateByQuery({ request, connection }) {
18
18
  const client = new Client(connection);
19
- const { body: response } = await client.updateByQuery({
19
+ const { body: response } = await client.updateByQuery({
20
20
  ...request,
21
21
  index: request.index || connection.index
22
22
  });
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -115,7 +115,7 @@
115
115
  },
116
116
  {
117
117
  type: 'boolean'
118
- },
118
+ }
119
119
  ],
120
120
  description: 'If true, Elasticsearch refreshes all shards involved in the delete by query after the request completes. Defaults to false.',
121
121
  enum: [
@@ -179,7 +179,7 @@
179
179
  },
180
180
  {
181
181
  type: 'string'
182
- },
182
+ }
183
183
  ]
184
184
  },
185
185
  _source: {
@@ -189,7 +189,7 @@
189
189
  },
190
190
  {
191
191
  type: 'array'
192
- },
192
+ }
193
193
  ],
194
194
  items: {
195
195
  type: 'string'
@@ -221,7 +221,7 @@
221
221
  },
222
222
  {
223
223
  type: 'string'
224
- },
224
+ }
225
225
  ]
226
226
  },
227
227
  terminate_after: {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@
45
45
  type: 'string',
46
46
  format: 'uri',
47
47
  pattern: '^(https?)://'
48
- },
48
+ }
49
49
  ]
50
50
  },
51
51
  nodes: {
@@ -67,7 +67,7 @@
67
67
  }
68
68
  },
69
69
  'http://localhost:9200',
70
- 'https://your.node.company.tld:443',
70
+ 'https://your.node.company.tld:443'
71
71
  ],
72
72
  anyOf: [
73
73
  {
@@ -91,7 +91,7 @@
91
91
  type: 'string',
92
92
  format: 'uri',
93
93
  pattern: '^(https?)://'
94
- },
94
+ }
95
95
  ]
96
96
  },
97
97
  index: {
@@ -107,7 +107,7 @@
107
107
  },
108
108
  {
109
109
  apiKey: 'base64EncodedApiKey'
110
- },
110
+ }
111
111
  ],
112
112
  anyOf: [
113
113
  {
@@ -115,7 +115,7 @@
115
115
  },
116
116
  {
117
117
  $ref: '#/definitions/BasicAuth'
118
- },
118
+ }
119
119
  ],
120
120
  errorMessage: {
121
121
  anyOf: 'Elasticsearch connection property "auth" should be an object containing credentials'
@@ -210,7 +210,7 @@
210
210
  },
211
211
  {
212
212
  agent: false
213
- },
213
+ }
214
214
  ],
215
215
  anyOf: [
216
216
  {
@@ -224,7 +224,7 @@
224
224
  },
225
225
  {
226
226
  type: 'object'
227
- },
227
+ }
228
228
  ]
229
229
  },
230
230
  name: {
@@ -242,7 +242,7 @@
242
242
  examples: [
243
243
  {
244
244
  'X-Foo': 'Bar'
245
- },
245
+ }
246
246
  ],
247
247
  type: 'object',
248
248
  default: {}
@@ -262,7 +262,7 @@
262
262
  examples: [
263
263
  {
264
264
  id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA=='
265
- },
265
+ }
266
266
  ],
267
267
  properties: {
268
268
  id: {
@@ -350,7 +350,7 @@
350
350
  },
351
351
  {
352
352
  type: 'string'
353
- },
353
+ }
354
354
  ],
355
355
  errorMessage: {
356
356
  anyOf: 'Elasticsearch API key should be specified as a string, or an object containing Elasticsearch cloud credentials'
@@ -400,7 +400,7 @@
400
400
  ingest: true,
401
401
  ml: false
402
402
  }
403
- },
403
+ }
404
404
  ],
405
405
  properties: {
406
406
  agent: {
@@ -411,7 +411,7 @@
411
411
  examples: [
412
412
  {
413
413
  'X-Foo': 'Bar'
414
- },
414
+ }
415
415
  ]
416
416
  },
417
417
  id: {
@@ -456,7 +456,7 @@
456
456
  required: [
457
457
  'nodes'
458
458
  ]
459
- },
459
+ }
460
460
  ],
461
461
  errorMessage: {
462
462
  type: 'Elasticsearch connection properties should be an object.',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/namespace */ /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/connection-elasticsearch",
3
- "version": "4.0.0-rc.0",
3
+ "version": "4.0.0-rc.10",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -38,21 +38,22 @@
38
38
  "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
39
39
  "clean": "rm -rf dist",
40
40
  "prepublishOnly": "pnpm build",
41
- "test": "jest --coverage"
41
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
42
42
  },
43
43
  "dependencies": {
44
44
  "@elastic/elasticsearch": "7.16.0",
45
- "@lowdefy/helpers": "4.0.0-rc.0"
45
+ "@lowdefy/helpers": "4.0.0-rc.10"
46
46
  },
47
47
  "devDependencies": {
48
- "@lowdefy/ajv": "4.0.0-rc.0",
49
- "@swc/cli": "0.1.57",
50
- "@swc/core": "1.2.194",
51
- "@swc/jest": "0.2.21",
52
- "jest": "28.1.0"
48
+ "@jest/globals": "28.1.3",
49
+ "@lowdefy/ajv": "4.0.0-rc.10",
50
+ "@swc/cli": "0.1.62",
51
+ "@swc/core": "1.3.70",
52
+ "@swc/jest": "0.2.27",
53
+ "jest": "28.1.3"
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
56
57
  },
57
- "gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
58
+ "gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
58
59
  }