es-alchemy
Advanced tools
Comparing version 1.9.2 to 1.10.0
@@ -0,1 +1,3 @@ | ||
const assert = require("assert"); | ||
const cloneDeep = require("lodash.clonedeep"); | ||
@@ -28,2 +30,3 @@ | ||
const registerIndex = (name, specs) => { | ||
assert(!name.includes("@"), "Index name must not include `@`."); | ||
indices[name] = { | ||
@@ -58,3 +61,3 @@ specs: Object.assign({ | ||
}, | ||
rest: rest(idx => indices[idx].mapping, options) | ||
rest: rest(() => Object.keys(indices).sort(), idx => indices[idx].mapping, options) | ||
}; | ||
@@ -64,2 +67,2 @@ }; | ||
module.exports.loadJsonInDir = loadJsonInDir; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJjbG9uZURlZXAiLCJyZXF1aXJlIiwibW9kZWwiLCJpbmRleCIsImRhdGEiLCJxdWVyeSIsInJlc3QiLCJsb2FkSnNvbkluRGlyIiwibW9kdWxlIiwiZXhwb3J0cyIsIm9wdGlvbnMiLCJtb2RlbHMiLCJyZWdpc3Rlck1vZGVsIiwibmFtZSIsInNwZWNzIiwiY29tcGlsZWQiLCJjb21waWxlIiwiaW5kaWNlcyIsInJlZ2lzdGVySW5kZXgiLCJPYmplY3QiLCJhc3NpZ24iLCJtYXBwaW5nIiwiZ2VuZXJhdGVNYXBwaW5nIiwiZmllbGRzIiwiZXh0cmFjdEZpZWxkcyIsInJlbHMiLCJleHRyYWN0UmVscyIsInJlZ2lzdGVyIiwiaWR4IiwibGlzdCIsImtleXMiLCJzb3J0IiwiZ2V0TWFwcGluZyIsImdldEZpZWxkcyIsImdldFJlbHMiLCJnZXRNb2RlbCIsImdldFNwZWNzIiwicmVtYXAiLCJpbnB1dCIsImJ1aWxkIiwib3B0cyJdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTUEsWUFBWUMsUUFBUSxrQkFBUixDQUFsQjs7QUFDQSxNQUFNQyxRQU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4gICAgfSxcbiAgICBxdWVyeToge1xuICAgICAgYnVpbGQ6IChpZHggPSBudWxsLCBvcHRzID0ge30pID0+IHF1ZXJ5LmJ1aWxkKGlkeCA9PT0gbnVsbCA/IG51bGwgOiBpbmRpY2VzW2lkeF0uZmllbGRzLCBvcHRzKVxuICAgIH0sXG4gICAgcmVzdDogcmVzdCgoKSA9PiBPYmplY3Qua2V5cyhpbmRpY2VzKS5zb3J0KCksIGlkeCA9PiBpbmRpY2VzW2lkeF0ubWFwcGluZywgb3B0aW9ucylcbiAgfTtcbn07XG5cbm1vZHVsZS5leHBvcnRzLmxvYWRKc29uSW5EaXIgPSBsb2FkSnNvbkluRGlyO1xuIl19 |
@@ -6,5 +6,7 @@ // Translate index from esalchemy syntax to ES syntax | ||
const objectHash = require("object-hash"); | ||
const buildPropertiesRec = (node, models) => { | ||
assert(typeof node === "object" && Array.isArray(node) === false, "Invalid specs definition."); | ||
assert(Object.keys(node).every(e => ["model", "fields", "sources", "nested", "flat", "version"].includes(e)), "Unknown specs entry provided."); | ||
assert(Object.keys(node).every(e => ["model", "fields", "sources", "nested", "flat"].includes(e)), "Unknown specs entry provided."); | ||
assert(typeof node.model === "string", "Model name not string."); | ||
@@ -41,8 +43,9 @@ assert(node.nested === undefined || typeof node.nested === "object" && !Array.isArray(node.nested), "Nested expected to be of type object."); | ||
assert(!get(specs, "model", "").endsWith("[]"), "Root node can not be Array."); | ||
const properties = buildPropertiesRec(specs, models); | ||
return { | ||
mappings: { | ||
[name]: { | ||
properties: buildPropertiesRec(specs, models), | ||
properties, | ||
_meta: { | ||
version: specs.version || null | ||
hash: objectHash(properties) | ||
} | ||
@@ -56,2 +59,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2luZGV4LmpzIl0sIm5hbWVzIjpbImFzc2VydCIsInJlcXVpcmUiLCJnZXQiLCJidWlsZFByb3B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B7XG4gICAgICAgIFtuYW1lXToge1xuICAgICAgICAgIHByb3BlcnRpZXM6IGJ1aWxkUHJvcGVydGllc1JlYyhzcGVjcywgbW9kZWxzKSxcbiAgICAgICAgICBfbWV0YToge1xuICAgICAgICAgICAgdmVyc2lvbjogc3BlY3MudmVyc2lvbiB8fCBudWxsXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfTtcbiAgfSxcbiAgZXh0cmFjdEZpZWxkczogc3BlY3MgPT4gZXh0cmFjdEZpZWxkc1JlYyhzcGVjcyksXG4gIGV4dHJhY3RSZWxzOiBzcGVjID0+IGV4dHJhY3RSZWxzUmVjKHNwZWMpXG59KTtcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2luZGV4LmpzIl0sIm5hbWVzIjpbImFzc2VydCIsInJlcXVpcmUiLCJnZXQiLCJvYmplY3RIYXNoIiwiYnVpbGRQcm9wZXJ0aWVzUmVjIiwibm9kZSIsIm1vZGVscyIsIkFycmF5IiwiaXNBcnJheSIsIk9iamVjdCIsImtleXMiLCJldmVyeSIsImUiLCJpbmNsdWRlcyIsIm1vZGVsIiwibmVzdGVkIiwidW5kZWZpbmVkIiwiZmllbGRzIiwiZW5kc1dpdGgiLCJzbGljZSIsImYiLCJjb21waWxlZCIsImVudHJpZXMiLCJyZWR1Y2UiLCJwcmV2Iiwia2V5IiwidmFsdWUiLCJhc3NpZ24iLCJwcm9wZXJ0aWVzIiwidHlwZSIsImluY2x1ZGVfaW5fcm9vdCIsImV4dHJhY3RGaWVsZHNSZWMiLCJwcmVmaXgiLCJtYXAiLCJyZWxOYW1lIiwiY2hpbGROb2RlIiwiY29uY2F0IiwicCIsImMiLCJmaWVsZCIsImpvaW4iLCJleHRyYWN0UmVsc1JlYyIsImNoaWxkUHJlZml4IiwibW9kdWxlIiwiZXhwb3J0cyIsImdlbmVyYXRl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|
@@ -1,4 +0,6 @@ | ||
module.exports = (call, idx) => call("POST", idx, { | ||
const get = require("lodash.get"); | ||
module.exports = (call, idx) => call("POST", `${idx}@*`, { | ||
endpoint: "_count" | ||
}).then(r => r.statusCode === 200 ? r.body.count : false); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvZGF0YS9jb3VudC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiY2FsbCIsImlkeCIsImVuZHBvaW50IiwidGhlbiIsInIiLCJzdGF0dXNDb2RlIiwiYm9keSIsImNvdW50Il0sIm1hcHBpbmdzIjoiQUFBQUEsT0FBT0MsT0FBUCxHQUFpQixDQUFDQyxJQUFELEVBQU9DLEdBQVAsS0FBZUQsS0FBSyxNQUFMLEVBQWFDLEdBQWIsRUFBa0I7QUFBRUMsWUFBVTtBQUFaLENBQWxCLEVBQzdCQyxJQUQ2QixDQUN4QkMsS0FBTUEsRUFBRUMsVUFBRixLQUFpQixHQUFqQixHQUF1QkQsRUFBRUUsSUFBRixDQUFPQyxLQUE5QixHQUFzQyxLQURwQixDQUFoQyIsImZpbGUiOiJjb3VudC5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKGNhbGwsIGlkeCkgPT4gY2FsbChcIlBPU1RcIiwgaWR4LCB7IGVuZHBvaW50OiBcIl9jb3VudFwiIH0pXG4gIC50aGVuKHIgPT4gKHIuc3RhdHVzQ29kZSA9PT0gMjAwID8gci5ib2R5LmNvdW50IDogZmFsc2UpKTtcbiJdfQ== | ||
}).then(r => r.statusCode === 200 && get(r, "body._shards.total", 0) !== 0 ? r.body.count : false); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvZGF0YS9jb3VudC5qcyJdLCJuYW1lcyI6WyJnZXQiLCJyZXF1aXJlIiwibW9kdWxlIiwiZXhwb3J0cyIsImNhbGwiLCJpZHgiLCJlbmRwb2ludCIsInRoZW4iLCJyIiwic3RhdHVzQ29kZSIsImJvZHkiLCJjb3VudCJdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTUEsTUFBTUMsUUFBUSxZQUFSLENBQVo7O0FBRUFDLE9BQU9DLE9BQVAsR0FBaUIsQ0FBQ0MsSUFBRCxFQUFPQyxHQUFQLEtBQWVELEtBQUssTUFBTCxFQUFjLEdBQUVDLEdBQUksSUFBcEIsRUFBeUI7QUFBRUMsWUFBVTtBQUFaLENBQXpCLEVBQzdCQyxJQUQ2QixDQUN4QkMsS0FBTUEsRUFBRUMsVUFBRixLQUFpQixHQUFqQixJQUF3QlQsSUFBSVEsQ0FBSixFQUFPLG9CQUFQLEVBQTZCLENBQTdCLE1BQW9DLENBQTVELEdBQWdFQSxFQUFFRSxJQUFGLENBQU9DLEtBQXZFLEdBQStFLEtBRDdELENBQWhDIiwiZmlsZSI6ImNvdW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgZ2V0ID0gcmVxdWlyZShcImxvZGFzaC5nZXRcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gKGNhbGwsIGlkeCkgPT4gY2FsbChcIlBPU1RcIiwgYCR7aWR4fUAqYCwgeyBlbmRwb2ludDogXCJfY291bnRcIiB9KVxuICAudGhlbihyID0+IChyLnN0YXR1c0NvZGUgPT09IDIwMCAmJiBnZXQociwgXCJib2R5Ll9zaGFyZHMudG90YWxcIiwgMCkgIT09IDAgPyByLmJvZHkuY291bnQgOiBmYWxzZSkpO1xuIl19 |
@@ -13,3 +13,3 @@ const assert = require("assert"); | ||
raw = false | ||
}) => call('GET', idx, { | ||
}) => call('GET', `${idx}@*`, { | ||
body: (() => { | ||
@@ -52,2 +52,2 @@ // PART 1: workaround for https://github.com/elastic/elasticsearch/issues/23796 | ||
}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NYXRoLm1heCgxLCAxICsgTWF0aC5mbG9vcigoZXNSZXN1bHQuYm9keS5oaXRzLnRvdGFsIC0gMC4xKSAvIGZpbHRlci5zaXplKSksXG4gICAgICAgICAgc2l6ZTogZmlsdGVyLnNpemVcbiAgICAgICAgfVxuICAgICAgfTtcbiAgfSk7XG4iXX0= |
@@ -1,5 +0,6 @@ | ||
module.exports = (call, idx) => call("POST", idx, { | ||
const get = require("lodash.get"); | ||
module.exports = (call, idx) => call("POST", `${idx}@*`, { | ||
endpoint: "_refresh" | ||
}) // eslint-disable-next-line no-underscore-dangle | ||
.then(r => r.statusCode === 200 && r.body._shards.failed === 0); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvZGF0YS9yZWZyZXNoLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJjYWxsIiwiaWR4IiwiZW5kcG9pbnQiLCJ0aGVuIiwiciIsInN0YXR1c0NvZGUiLCJib2R5IiwiX3NoYXJkcyIsImZhaWxlZCJdLCJtYXBwaW5ncyI6IkFBQUFBLE9BQU9DLE9BQVAsR0FBaUIsQ0FBQ0MsSUFBRCxFQUFPQyxHQUFQLEtBQWVELEtBQUssTUFBTCxFQUFhQyxHQUFiLEVBQWtCO0FBQUVDLFlBQVU7QUFBWixDQUFsQixFQUM5QjtBQUQ4QixDQUU3QkMsSUFGNkIsQ0FFeEJDLEtBQUtBLEVBQUVDLFVBQUYsS0FBaUIsR0FBakIsSUFBd0JELEVBQUVFLElBQUYsQ0FBT0MsT0FBUCxDQUFlQyxNQUFmLEtBQTBCLENBRi9CLENBQWhDIiwiZmlsZSI6InJlZnJlc2guanMiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IChjYWxsLCBpZHgpID0+IGNhbGwoXCJQT1NUXCIsIGlkeCwgeyBlbmRwb2ludDogXCJfcmVmcmVzaFwiIH0pXG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlcnNjb3JlLWRhbmdsZVxuICAudGhlbihyID0+IHIuc3RhdHVzQ29kZSA9PT0gMjAwICYmIHIuYm9keS5fc2hhcmRzLmZhaWxlZCA9PT0gMCk7XG4iXX0= | ||
}).then(r => r.statusCode === 200 && get(r, "body._shards.total", 0) !== 0 && get(r, "body._shards.failed") === 0); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvZGF0YS9yZWZyZXNoLmpzIl0sIm5hbWVzIjpbImdldCIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwiY2FsbCIsImlkeCIsImVuZHBvaW50IiwidGhlbiIsInIiLCJzdGF0dXNDb2RlIl0sIm1hcHBpbmdzIjoiQUFBQSxNQUFNQSxNQUFNQyxRQUFRLFlBQVIsQ0FBWjs7QUFFQUMsT0FBT0MsT0FBUCxHQUFpQixDQUFDQyxJQUFELEVBQU9DLEdBQVAsS0FBZUQsS0FBSyxNQUFMLEVBQWMsR0FBRUMsR0FBSSxJQUFwQixFQUF5QjtBQUFFQyxZQUFVO0FBQVosQ0FBekIsRUFDN0JDLElBRDZCLENBQ3hCQyxLQUFLQSxFQUFFQyxVQUFGLEtBQWlCLEdBQWpCLElBQXdCVCxJQUFJUSxDQUFKLEVBQU8sb0JBQVAsRUFBNkIsQ0FBN0IsTUFBb0MsQ0FBNUQsSUFBaUVSLElBQUlRLENBQUosRUFBTyxxQkFBUCxNQUFrQyxDQURoRixDQUFoQyIsImZpbGUiOiJyZWZyZXNoLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgZ2V0ID0gcmVxdWlyZShcImxvZGFzaC5nZXRcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gKGNhbGwsIGlkeCkgPT4gY2FsbChcIlBPU1RcIiwgYCR7aWR4fUAqYCwgeyBlbmRwb2ludDogXCJfcmVmcmVzaFwiIH0pXG4gIC50aGVuKHIgPT4gci5zdGF0dXNDb2RlID09PSAyMDAgJiYgZ2V0KHIsIFwiYm9keS5fc2hhcmRzLnRvdGFsXCIsIDApICE9PSAwICYmIGdldChyLCBcImJvZHkuX3NoYXJkcy5mYWlsZWRcIikgPT09IDApO1xuIl19 |
@@ -1,9 +0,31 @@ | ||
module.exports = (call, idx, { | ||
const historic = require("./../mapping/historic"); | ||
module.exports = async (call, idx, mapping, { | ||
remove = [], | ||
upsert = [] | ||
}) => { | ||
const payload = []; | ||
const oldVersionsEntries = Object.entries((await historic(call, idx, mapping))); | ||
const oldVersionsEmpty = oldVersionsEntries.filter(([_, docCount]) => docCount === 0).map(([name, _]) => name); | ||
const oldVersionsNonEmpty = oldVersionsEntries.filter(([_, docCount]) => docCount !== 0).map(([name, _]) => name); | ||
if (oldVersionsEmpty.length !== 0) { | ||
// delete old, empty versions | ||
await Promise.all(oldVersionsEmpty.map(i => call('DELETE', i))); | ||
} // eslint-disable-next-line no-underscore-dangle | ||
const index = `${idx}@${mapping.mappings[idx]._meta.hash}`; | ||
const payload = []; // delete elements from old index versions | ||
[...upsert.map(doc => doc.id), ...remove].forEach(docId => oldVersionsNonEmpty.forEach(i => payload.push(JSON.stringify({ | ||
delete: { | ||
_index: i, | ||
_type: idx, | ||
_id: docId | ||
} | ||
})))); | ||
upsert.forEach(doc => { | ||
payload.push(JSON.stringify({ | ||
update: { | ||
_index: index, | ||
_type: idx, | ||
@@ -21,2 +43,3 @@ _id: doc.id | ||
delete: { | ||
_index: index, | ||
_type: idx, | ||
@@ -32,3 +55,3 @@ _id: docId | ||
return call("POST", idx, { | ||
return call("POST", "", { | ||
endpoint: "_bulk", | ||
@@ -42,2 +65,2 @@ body: payload.concat("").join("\n"), | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2V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pO1xuICB9KTtcbiAgcmVtb3ZlLmZvckVhY2goKGRvY0lkKSA9PiB7XG4gICAgcGF5bG9hZC5wdXNoKEpTT04uc3RyaW5naWZ5KHsgZGVsZXRlOiB7IF9pbmRleDogaW5kZXgsIF90eXBlOiBpZHgsIF9pZDogZG9jSWQgfSB9KSk7XG4gIH0pO1xuXG4gIGlmIChwYXlsb2FkLmxlbmd0aCA9PT0gMCkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG4gIHJldHVybiBjYWxsKFwiUE9TVFwiLCBcIlwiLCB7XG4gICAgZW5kcG9pbnQ6IFwiX2J1bGtcIixcbiAgICBib2R5OiBwYXlsb2FkLmNvbmNhdChcIlwiKS5qb2luKFwiXFxuXCIpLFxuICAgIGhlYWRlcnM6IHsgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LW5kanNvbicgfSxcbiAgICBqc29uOiBmYWxzZVxuICB9KS50aGVuKHIgPT4gci5zdGF0dXNDb2RlID09PSAyMDAgJiYgIUpTT04ucGFyc2Uoci5ib2R5KS5lcnJvcnMpO1xufTtcbiJdfQ== |
@@ -1,4 +0,5 @@ | ||
module.exports = (call, idx, mapping) => call('PUT', idx, { | ||
// eslint-disable-next-line no-underscore-dangle | ||
module.exports = (call, idx, mapping) => call('PUT', `${idx}@${mapping.mappings[idx]._meta.hash}`, { | ||
body: mapping | ||
}).then(r => r.statusCode === 200 && r.body.acknowledged === true); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9jcmVhdGUuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsImNhbGwiLCJpZHgiLCJtYXBwaW5nIiwiYm9keSIsInRoZW4iLCJyIiwic3RhdHVzQ29kZSIsImFja25vd2xlZGdlZCJdLCJtYXBwaW5ncyI6IkFBQUFBLE9BQU9DLE9BQV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FELEVBQ3RDSyxJQURzQyxDQUNqQ0MsS0FBS0EsRUFBRUMsVUFBRixLQUFpQixHQUFqQixJQUF3QkQsRUFBRUYsSUFBRixDQUFPSSxZQUFQLEtBQXdCLElBRHBCLENBQXpDIiwiZmlsZSI6ImNyZWF0ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlcnNjb3JlLWRhbmdsZVxubW9kdWxlLmV4cG9ydHMgPSAoY2FsbCwgaWR4LCBtYXBwaW5nKSA9PiBjYWxsKCdQVVQnLCBgJHtpZHh9QCR7bWFwcGluZy5tYXBwaW5nc1tpZHhdLl9tZXRhLmhhc2h9YCwgeyBib2R5OiBtYXBwaW5nIH0pXG4gIC50aGVuKHIgPT4gci5zdGF0dXNDb2RlID09PSAyMDAgJiYgci5ib2R5LmFja25vd2xlZGdlZCA9PT0gdHJ1ZSk7XG4iXX0= |
@@ -1,2 +0,2 @@ | ||
module.exports = (call, idx) => call('DELETE', idx).then(r => r.statusCode === 200 && r.body.acknowledged === true || r.statusCode === 404); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9kZWxldGUuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsImNhbGwiLCJpZHgiLCJ0aGVuIiwiciIsInN0YXR1c0NvZGUiLCJib2R5IiwiYWNrbm93bGVkZ2VkIl0sIm1hcHBpbmdzIjoiQUFBQUEsT0FBT0MsT0FBUCxHQUFpQixDQUFDQyxJQUFELEVBQU9DLEdBQVAsS0FBZUQsS0FBSyxRQUFMLEVBQWVDLEdBQWYsRUFDN0JDLElBRDZCLENBQ3hCQyxLQUFNQSxFQUFFQyxVQUFGLEtBQWlCLEdBQWpCLElBQXdCRCxFQUFFRSxJQUFGLENBQU9DLFlBQVAsS0FBd0IsSUFBakQsSUFBMERILEVBQUVDLFVBQUYsS0FBaUIsR0FEeEQsQ0FBaEMiLCJmaWxlIjoiZGVsZXRlLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAoY2FsbCwgaWR4KSA9PiBjYWxsKCdERUxFVEUnLCBpZHgpXG4gIC50aGVuKHIgPT4gKHIuc3RhdHVzQ29kZSA9PT0gMjAwICYmIHIuYm9keS5hY2tub3dsZWRnZWQgPT09IHRydWUpIHx8IHIuc3RhdHVzQ29kZSA9PT0gNDA0KTtcbiJdfQ== | ||
module.exports = (call, idx) => call('DELETE', `${idx}@*`).then(r => r.statusCode === 200 && r.body.acknowledged === true); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9kZWxldGUuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsImNhbGwiLCJpZHgiLCJ0aGVuIiwiciIsInN0YXR1c0NvZGUiLCJib2R5IiwiYWNrbm93bGVkZ2VkIl0sIm1hcHBpbmdzIjoiQUFBQUEsT0FBT0MsT0FBUCxHQUFpQixDQUFDQyxJQUFELEVBQU9DLEdBQVAsS0FBZUQsS0FBSyxRQUFMLEVBQWdCLEdBQUVDLEdBQUksSUFBdEIsRUFDN0JDLElBRDZCLENBQ3hCQyxLQUFLQSxFQUFFQyxVQUFGLEtBQWlCLEdBQWpCLElBQXdCRCxFQUFFRSxJQUFGLENBQU9DLFlBQVAsS0FBd0IsSUFEN0IsQ0FBaEMiLCJmaWxlIjoiZGVsZXRlLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAoY2FsbCwgaWR4KSA9PiBjYWxsKCdERUxFVEUnLCBgJHtpZHh9QCpgKVxuICAudGhlbihyID0+IHIuc3RhdHVzQ29kZSA9PT0gMjAwICYmIHIuYm9keS5hY2tub3dsZWRnZWQgPT09IHRydWUpO1xuIl19 |
@@ -1,4 +0,5 @@ | ||
module.exports = (call, idx) => call("GET", idx, { | ||
module.exports = (call, idx, mapping) => call("GET", // eslint-disable-next-line no-underscore-dangle | ||
`${idx}@${mapping.mappings[idx]._meta.hash}`, { | ||
endpoint: "_mapping" | ||
}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9nZXQuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsImNhbGwiLCJpZHgiLCJlbmRwb2ludCJdLCJtYXBwaW5ncyI6IkFBQUFBLE9BQU9DLE9BQVAsR0FBaUIsQ0FBQ0MsSUFBRCxFQUFPQyxHQUFQLEtBQWVELEtBQUssS0FBTCxFQUFZQyxHQUFaLEVBQWlCO0FBQUVDLFlBQVU7QUFBWixDQUFqQixDQUFoQyIsImZpbGUiOiJnZXQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IChjYWxsLCBpZHgpID0+IGNhbGwoXCJHRVRcIiwgaWR4LCB7IGVuZHBvaW50OiBcIl9tYXBwaW5nXCIgfSk7XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9nZXQuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsImNhbGwiLCJpZHgiLCJtYXBwaW5nIiwibWFwcGluZ3MiLCJfbWV0YSIsImhhc2giLCJlbmRwb2ludCJdLCJtYXBwaW5ncyI6IkFBQUFBLE9BQU9DLE9BQVAsR0FBaUIsQ0FBQ0MsSUFBRCxFQUFPQyxHQUFQLEVBQVlDLE9BQVosS0FBd0JGLEtBQ3ZDLEtBRHVDLEVBRXZDO0FBQ0MsR0FBRUMsR0FBSSxJQUFHQyxRQUFRQyxRQUFSLENBQWlCRixHQUFqQixFQUFzQkcsS0FBdEIsQ0FBNEJDLElBQUssRUFISixFQUl2QztBQUFFQyxZQUFVO0FBQVosQ0FKdUMsQ0FBekMiLCJmaWxlIjoiZ2V0LmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAoY2FsbCwgaWR4LCBtYXBwaW5nKSA9PiBjYWxsKFxuICBcIkdFVFwiLFxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdW5kZXJzY29yZS1kYW5nbGVcbiAgYCR7aWR4fUAke21hcHBpbmcubWFwcGluZ3NbaWR4XS5fbWV0YS5oYXNofWAsXG4gIHsgZW5kcG9pbnQ6IFwiX21hcHBpbmdcIiB9XG4pO1xuIl19 |
module.exports = call => call("GET", "_cat", { | ||
endpoint: "indices" | ||
}).then(r => r.body.map(idx => idx.index)); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9saXN0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJjYWxsIiwiZW5kcG9pbnQiLCJ0aGVuIiwiciIsImJvZHkiLCJtYXAiLCJpZHgiLCJpbmRleCJdLCJtYXBwaW5ncyI6IkFBQUFBLE9BQU9DLE9BQVAsR0FBaUJDLFFBQVFBLEtBQUssS0FBTCxFQUFZLE1BQVosRUFBb0I7QUFBRUMsWUFBVTtBQUFaLENBQXBCLEVBQ3RCQyxJQURzQixDQUNqQkMsS0FBS0EsRUFBRUMsSUFBRixDQUFPQyxHQUFQLENBQVdDLE9BQU9BLElBQUlDLEtBQXRCLENBRFksQ0FBekIiLCJmaWxlIjoibGlzdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gY2FsbCA9PiBjYWxsKFwiR0VUXCIsIFwiX2NhdFwiLCB7IGVuZHBvaW50OiBcImluZGljZXNcIiB9KVxuICAudGhlbihyID0+IHIuYm9keS5tYXAoaWR4ID0+IGlkeC5pbmRleCkpO1xuIl19 | ||
}).then(r => [...new Set(r.body.map(idx => idx.index.split("@")[0]))]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvbWFwcGluZy9saXN0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJjYWxsIiwiZW5kcG9pbnQiLCJ0aGVuIiwiciIsIlNldCIsImJvZHkiLCJtYXAiLCJpZHgiLCJpbmRleCIsInNwbGl0Il0sIm1hcHBpbmdzIjoiQUFBQUEsT0FBT0MsT0FBUCxHQUFpQkMsUUFBUUEsS0FBSyxLQUFMLEVBQVksTUFBWixFQUFvQjtBQUFFQyxZQUFVO0FBQVosQ0FBcEIsRUFDdEJDLElBRHNCLENBQ2pCQyxLQUFLLENBQUMsR0FBRyxJQUFJQyxHQUFKLENBQVFELEVBQUVFLElBQUYsQ0FBT0MsR0FBUCxDQUFXQyxPQUFPQSxJQUFJQyxLQUFKLENBQVVDLEtBQVYsQ0FBZ0IsR0FBaEIsRUFBcUIsQ0FBckIsQ0FBbEIsQ0FBUixDQUFKLENBRFksQ0FBekIiLCJmaWxlIjoibGlzdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gY2FsbCA9PiBjYWxsKFwiR0VUXCIsIFwiX2NhdFwiLCB7IGVuZHBvaW50OiBcImluZGljZXNcIiB9KVxuICAudGhlbihyID0+IFsuLi5uZXcgU2V0KHIuYm9keS5tYXAoaWR4ID0+IGlkeC5pbmRleC5zcGxpdChcIkBcIilbMF0pKV0pO1xuIl19 |
@@ -13,2 +13,4 @@ const get = require("lodash.get"); | ||
const mappingHistoric = require("./mapping/historic"); | ||
const mappingRecreate = require("./mapping/recreate"); | ||
@@ -22,5 +24,7 @@ | ||
const dataHistoric = require("./data/historic"); | ||
const dataUpdate = require("./data/update"); | ||
module.exports = (getMapping, options) => { | ||
module.exports = (listIndices, getMapping, options) => { | ||
const call = (method, idx, { | ||
@@ -51,4 +55,5 @@ endpoint = "", | ||
delete: idx => mappingDelete(call, idx), | ||
get: idx => mappingGet(call, idx), | ||
get: idx => mappingGet(call, idx, getMapping(idx)), | ||
list: () => mappingList(call), | ||
historic: idx => mappingHistoric(call, idx, getMapping(idx)), | ||
recreate: idx => mappingRecreate(call, idx, getMapping(idx)) | ||
@@ -60,6 +65,9 @@ }, | ||
refresh: idx => dataRefresh(call, idx), | ||
update: (idx, opts) => dataUpdate(call, idx, opts) | ||
historic: (limit = 100) => dataHistoric(call, limit, () => listIndices().reduce((p, idx) => Object.assign(p, { | ||
[idx]: getMapping(idx) | ||
}), {})), | ||
update: (idx, opts) => dataUpdate(call, idx, getMapping(idx), opts) | ||
} | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlsL3Jlc3QvcmVzdC5qcyJdLCJuYW1lcyI6WyJnZXQiLCJyZXF1aXJlIiwicmVxdWVzdCIsIm1hcHBpbmdDcmVhdGUiLCJtYXBwaW5nRGVsZXRlIiwibWFwcGluZ0dldCIsIm1hcHBpbmdMaXN0IiwibWFwcGluZ1JlY3JlYXRlIiwiZGF0YUNvdW50IiwiZGF0YVF1ZXJ5IiwiZGF0YVJlZnJlc2giLCJkYXRhVXBkYXRlIiwibW9kdWxlIiwiZXhwb3J0cyIsImdldE1hcHBpbmciLCJvcHRpb25zIiwiY2FsbCIsIm1ldGhvZCIsImlkeCIsImVuZHBvaW50IiwiYm9keSIsImhlYWRlcnMiLCJqc29uIiwidXJpIiwiam9pbiIsImF3cyIsImtleSI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BpZHggPT4gbWFwcGluZ0dldChjYWxsLCBpZHgsIGdldE1hcHBpbmcoaWR4KSksXG4gICAgICBsaXN0OiAoKSA9PiBtYXBwaW5nTGlzdChjYWxsKSxcbiAgICAgIGhpc3RvcmljOiBpZHggPT4gbWFwcGluZ0hpc3RvcmljKGNhbGwsIGlkeCwgZ2V0TWFwcGluZyhpZHgpKSxcbiAgICAgIHJlY3JlYXRlOiBpZHggPT4gbWFwcGluZ1JlY3JlYXRlKGNhbGwsIGlkeCwgZ2V0TWFwcGluZyhpZHgpKVxuICAgIH0sXG4gICAgZGF0YToge1xuICAgICAgY291bnQ6IGlkeCA9PiBkYXRhQ291bnQoY2FsbCwgaWR4KSxcbiAgICAgIHF1ZXJ5OiAoaWR4LCBmaWx0ZXIsIG9wdHMgPSB7fSkgPT4gZGF0YVF1ZXJ5KGNhbGwsIGlkeCwgZmlsdGVyLCBvcHRzKSxcbiAgICAgIHJlZnJlc2g6IGlkeCA9PiBkYXRhUmVmcmVzaChjYWxsLCBpZHgpLFxuICAgICAgaGlzdG9yaWM6IChsaW1pdCA9IDEwMCkgPT4gZGF0YUhpc3RvcmljKGNhbGwsIGxpbWl0LCAoKSA9PiBsaXN0SW5kaWNlcygpXG4gICAgICAgIC5yZWR1Y2UoKHAsIGlkeCkgPT4gT2JqZWN0LmFzc2lnbihwLCB7IFtpZHhdOiBnZXRNYXBwaW5nKGlkeCkgfSksIHt9KSksXG4gICAgICB1cGRhdGU6IChpZHgsIG9wdHMpID0+IGRhdGFVcGRhdGUoY2FsbCwgaWR4LCBnZXRNYXBwaW5nKGlkeCksIG9wdHMpXG4gICAgfVxuICB9O1xufTtcbiJdfQ== |
{ | ||
"name": "es-alchemy", | ||
"version": "1.9.2", | ||
"version": "1.10.0", | ||
"description": "Simplification of Elasticsearch interactions", | ||
@@ -46,3 +46,3 @@ "main": "lib/index.js", | ||
"js-gardener": "1.31.7", | ||
"nyc": "13.0.1", | ||
"nyc": "13.1.0", | ||
"semantic-release": "15.9.17", | ||
@@ -100,4 +100,5 @@ "uuid": "3.3.2", | ||
"lodash.isequal": "4.5.0", | ||
"obj-paths": "1.2.0", | ||
"object-rewrite": "1.0.6" | ||
"obj-paths": "1.2.1", | ||
"object-hash": "1.3.0", | ||
"object-rewrite": "1.1.3" | ||
}, | ||
@@ -104,0 +105,0 @@ "peerDependencies": { |
@@ -26,3 +26,3 @@ [![Build Status](https://circleci.com/gh/loopmediagroup/es-alchemy.png?style=shield)](https://circleci.com/gh/loopmediagroup/es-alchemy) | ||
- Define indices based on the data models | ||
- Generate mappings from indices and then create them in Elasticsearch | ||
- Generate (current version) mappings from indices and then create them in Elasticsearch | ||
- Obtain input data as defined in the source mappings of index and remap it | ||
@@ -300,2 +300,11 @@ - Insert remapped data into Elasticsearch | ||
## Index Versions | ||
Indices are versioned using a computed hash deduced from their schema. So an index named `foo` uses | ||
multiple mappings as `foo@HASH` under the hood. When updating or deleting a document the document | ||
is removed from all old version and updated in the current version as required. Empty, old version are removed. | ||
When the version of an index changes the new index mapping needs to be created. Calling `mapping.create` on | ||
every initialization should be ok to do. | ||
## Api | ||
@@ -331,10 +340,12 @@ | ||
- `call(method: String, name: String, options: Object)` - make direct API call to Elasticsearch | ||
- `mapping.create(name: String)` - create mapping on Elasticsearch | ||
- `mapping.delete(name: String)` - delete mapping from Elasticsearch | ||
- `mapping.get(name: String)` - get mapping details from Elasticsearch | ||
- `mapping.recreate(name: String)` - recreate mapping on Elasticsearch | ||
- `data.count(name: String)` - get number of indexed elements from Elasticsearch | ||
- `data.query(name: String, filter: Object, options: Object)` - query for data in Elasticsearch. Use raw flag to obtain raw result from Elasticsearch. | ||
- `data.refresh(name: String)` - refresh Elasticsearch index, useful e.g. when testing | ||
- `data.update(name: String, options: Object)` - insert, update or delete objects in Elasticsearch | ||
- `mapping.create(name: String)` - create mapping on Elasticsearch (call when version changes) | ||
- `mapping.delete(name: String)` - delete mapping from Elasticsearch (deletes _all_ versions) | ||
- `mapping.get(name: String)` - get mapping details from Elasticsearch (current version) | ||
- `mapping.historic(name: String)` - get _old_ mapping versions and their respective document counts from Elasticsearch | ||
- `mapping.recreate(name: String)` - recreate mapping on Elasticsearch (deletes _all_ versions and recreates current version) | ||
- `data.count(name: String)` - get number of indexed elements from Elasticsearch (from _all_ versions) | ||
- `data.query(name: String, filter: Object, options: Object)` - query for data in Elasticsearch against all versions. Use raw flag to obtain raw result from Elasticsearch. | ||
- `data.refresh(name: String)` - refresh Elasticsearch index, useful e.g. when testing (all versions) | ||
- `data.historic(limit: Integer = 100)` - fetch historic data entries as `{ [ID]: [INDEX] }`. Order of results is random. | ||
- `data.update(name: String, options: Object)` - insert, update or delete objects in Elasticsearch (current version, removed touched documents from old versions and deletes old versions when empty) | ||
@@ -341,0 +352,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
119814
24
713
369
8
+ Addedobject-hash@1.3.0
+ Addedobj-paths@1.2.1(transitive)
+ Addedobject-hash@1.3.0(transitive)
+ Addedobject-rewrite@1.1.3(transitive)
+ Addedobject-scan@1.10.8(transitive)
- Removedobj-paths@1.2.0(transitive)
- Removedobject-rewrite@1.0.6(transitive)
- Removedobject-scan@1.10.6(transitive)
Updatedobj-paths@1.2.1
Updatedobject-rewrite@1.1.3