es-alchemy
Advanced tools
Comparing version 10.3.2 to 10.4.0
@@ -5,3 +5,3 @@ import assert from 'assert'; | ||
export default async (call, versions, actions_) => { | ||
export default async (call, versions, actions_, raw) => { | ||
Joi.assert(actions_, Joi.array().items(Joi.object().keys({ | ||
@@ -74,3 +74,3 @@ idx: Joi.string().valid(...versions.list()), | ||
if (payload.length === 0) { | ||
return true; | ||
throw new Error('No Actions provided'); | ||
} | ||
@@ -84,2 +84,5 @@ const r = await call('POST', '', { | ||
assert(r.statusCode === 200, r.body); | ||
if (raw === true) { | ||
return r.body; | ||
} | ||
if (r.body.errors === false) { | ||
@@ -86,0 +89,0 @@ return true; |
@@ -136,3 +136,3 @@ import get from 'lodash.get'; | ||
uniques: (idx, field, opts = {}) => dataUniques(call, idx, getFields(idx), field, opts), | ||
update: (opts) => dataUpdate(call, versions, opts), | ||
update: (actions, raw = false) => dataUpdate(call, versions, actions, raw), | ||
version: (idx, id) => dataVersion(call, idx, getMapping(idx), id) | ||
@@ -139,0 +139,0 @@ } |
{ | ||
"name": "es-alchemy", | ||
"type": "module", | ||
"version": "10.3.2", | ||
"version": "10.4.0", | ||
"description": "Simplification of Opensearch interactions", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -414,3 +414,3 @@ # ESAlchemy | ||
- `data.uniques(index: String, fields: String[] || String, opts = { filterBy = {}, limit = 20, cursor = null, count = boolean })` - get unique values from index for field, using filter. When count true, the counts per unique are returned | ||
- `data.update(options: Object)` - update or delete documents in Opensearch (all index versions) | ||
- `data.update(actions: Object, raw: Boolean = false)` - update or delete documents in Opensearch (all index versions), raw flag always resolves with full response | ||
- `data.version(index: String, id: String)` - get version number in alias for document or null if document does not exist | ||
@@ -417,0 +417,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75515
1736