Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

es-alchemy

Package Overview
Dependencies
Maintainers
1
Versions
318
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-alchemy - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

lib/resources/field-remap.js

4

lib/index.js

@@ -52,3 +52,3 @@ const cloneDeep = require("lodash.clonedeep");

data: {
remap: (idx, input) => data.remap(indices[idx].specs, input)
remap: (idx, input) => data.remap(indices[idx].specs, input, models)
},

@@ -63,2 +63,2 @@ query: {

module.exports.loadJsonInDir = loadJsonInDir;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJjbG9uZURlZXAiLCJyZXF1aXJlIiwibW9kZWwiLCJpbmRleCIsImRhdGEiLCJxdWVyeSIsInJlc3QiLCJsb2FkSnNvbkluRGlyIiwibW9kdWxlIiwiZXhwb3J0cyIsIm9wdGlvbnMiLCJtb2RlbHMiLCJyZWdpc3Rlck1vZGVsIiwibmFtZSIsInNwZWNzIiwiY29tcGlsZWQiLCJjb21waWxlIiwiaW5kaWNlcyIsInJlZ2lzdGVySW5kZXgiLCJPYmplY3QiLCJhc3NpZ24iLCJtYXBwaW5nIiwiZ2VuZXJhdGVNYXBwaW5nIiwiZmllbGRzIiwiZXh0cmFjdEZpZWxkcyIsInJlbHMiLCJleHRyYWN0UmVscyIsInJlZ2lzdGVyIiwiaWR4IiwibGlzdCIsImtleXMiLCJzb3J0IiwiZ2V0TWFwcGluZyIsImdldEZpZWxkcyIsImdldFJlbHMiLCJnZXRNb2RlbCIsImdldFNwZWNzIiwicmVtYXAiLCJpbnB1dCIsImJ1aWxkIiwib3B0cyJdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTUEsWUFBWUMsUUFBUSxrQkFBUixDQUFsQjs7QUFDQSxN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LCBzcGVjcykgPT4gcmVnaXN0ZXJNb2RlbChuYW1lLCBzcGVjcylcbiAgICB9LFxuICAgIGluZGV4OiB7XG4gICAgICByZWdpc3RlcjogKGlkeCwgc3BlY3MpID0+IHJlZ2lzdGVySW5kZXgoaWR4LCBzcGVjcyksXG4gICAgICBsaXN0OiAoKSA9PiBPYmplY3Qua2V5cyhpbmRpY2VzKS5zb3J0KCksXG4gICAgICBnZXRNYXBwaW5nOiBpZHggPT4gY2xvbmVEZWVwKGluZGljZXNbaWR4XS5tYXBwaW5nKSxcbiAgICAgIGdldEZpZWxkczogaWR4ID0+IGNsb25lRGVlcChpbmRpY2VzW2lkeF0uZmllbGRzKSxcbiAgICAgIGdldFJlbHM6IGlkeCA9PiBjbG9uZURlZXAoaW5kaWNlc1tpZHhdLnJlbHMpLFxuICAgICAgZ2V0TW9kZWw6IGlkeCA9PiBpbmRpY2VzW2lkeF0uc3BlY3MubW9kZWwsXG4gICAgICBnZXRTcGVjczogaWR4ID0+IGNsb25lRGVlcChpbmRpY2VzW2lkeF0uc3BlY3MpXG4gICAgfSxcbiAgICBkYXRhOiB7XG4gICAgICByZW1hcDogKGlkeCwgaW5wdXQpID0+IGRhdGEucmVtYXAoaW5kaWNlc1tpZHhdLnNwZWNzLCBpbnB1dCwgbW9kZWxzKVxuICAgIH0sXG4gICAgcXVlcnk6IHtcbiAgICAgIGJ1aWxkOiAoaWR4ID0gbnVsbCwgb3B0cyA9IHt9KSA9PiBxdWVyeS5idWlsZChpZHggPT09IG51bGwgPyBudWxsIDogaW5kaWNlc1tpZHhdLmZpZWxkcywgb3B0cylcbiAgICB9LFxuICAgIHJlc3Q6IHJlc3QoaWR4ID0+IGluZGljZXNbaWR4XS5tYXBwaW5nLCBvcHRpb25zKVxuICB9O1xufTtcblxubW9kdWxlLmV4cG9ydHMubG9hZEpzb25JbkRpciA9IGxvYWRKc29uSW5EaXI7XG4iXX0=
// Convert raw data into index ready data
const assert = require("assert");
const remapRec = (specs, input) => {
const fieldRemap = require("../resources/field-remap");
const remapRec = (specs, input, models) => {
const result = [];

@@ -13,8 +15,9 @@ assert(specs.sources === undefined || Array.isArray(specs.sources) && specs.sources.length !== 0, "Invalid sources definition.");

const entry = {};
const fieldTypes = models[specs.model.endsWith("[]") ? specs.model.slice(0, -2) : specs.model].specs.fields;
specs.fields // handle top level
.map(field => [field, origin[field]]).filter(kv => kv[1] !== undefined).reduce((prev, [key, value]) => Object.assign(prev, {
[key]: value
[key]: fieldRemap[fieldTypes[key]](value)
}), entry);
Object.entries(specs.nested || {}) // handle nested
.map(([key, value]) => [key, remapRec(value, origin)]).filter(kv => kv[1] !== undefined).reduce((prev, [key, value]) => Object.assign(prev, {
.map(([key, value]) => [key, remapRec(value, origin, models)]).filter(kv => kv[1] !== undefined).reduce((prev, [key, value]) => Object.assign(prev, {
[key]: value

@@ -28,3 +31,3 @@ }), entry);

module.exports.remap = (specs, input) => remapRec(specs, input);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2RhdGEuanMiXSwibmFtZXMiOlsiYXNzZXJ0IiwicmVxdWlyZSIsInJlbWFwUmVjIiwic3BlY3MiLCJpbnB1dCIsInJlc3VsdCIsInNvdXJjZXMiLCJ1bmRlZmluZWQiLCJBcnJheSIsImlzQXJyYXkiLCJsZW5ndGgiLCJtYXAiLCJzb3VyY2VQYXRoIiwic3BsaXQiLCJyZWR1Y2UiLCJvcmlnaW5zIiwic2VnbWVudCIsIm9yaWdpbiIsImZpbHRlciIsInByZXYiLCJuZXh0IiwiY29uY2F0IiwiZm9yRWFjaCIsImVudHJ5IiwiZmllbGRzIiwiZmllbGQiLCJrdiIsImtleSIsInZhbHVlIiwiT2JqZWN0IiwiYXNzaWduIiwiZW50cmllcyIsIm5lc3RlZCIsInB1c2giLCJtb2RlbCIsImVuZHNXaXRoIiwibW9kdWxlIiwiZXhwb3J0cyIsInJlbWFwIl0sIm1h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ICAgIC5maWx0ZXIoa3YgPT4ga3ZbMV0gIT09IHVuZGVmaW5lZClcbiAgICAgICAgLnJlZHVjZSgocHJldiwgW2tleSwgdmFsdWVdKSA9PiBPYmplY3QuYXNzaWduKHByZXYsIHsgW2tleV06IHZhbHVlIH0pLCBlbnRyeSk7XG4gICAgICByZXN1bHQucHVzaChlbnRyeSk7XG4gICAgfSkpO1xuICBhc3NlcnQoXG4gICAgc3BlY3MubW9kZWwuZW5kc1dpdGgoXCJbXVwiKSB8fCByZXN1bHQubGVuZ3RoIDw9IDEsXG4gICAgXCJNb3JlIHRoYW4gb25lIHJlc3VsdCBmb3IgcmVsYXRpb25zaGlwLlwiXG4gICk7XG4gIHJldHVybiBzcGVjcy5tb2RlbC5lbmRzV2l0aChcIltdXCIpID8gcmVzdWx0IDogcmVzdWx0WzBdO1xufTtcblxubW9kdWxlLmV4cG9ydHMucmVtYXAgPSAoc3BlY3MsIGlucHV0KSA9PiByZW1hcFJlYyhzcGVjcywgaW5wdXQpO1xuIl19
module.exports.remap = (specs, input, models) => remapRec(specs, input, models);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2RhdGEuanMiXSwibmFtZXMiOlsiYXNzZXJ0IiwicmVxdWlyZSIsImZpZWxkUmVtYXAiLCJyZW1hcFJlYyIsInNwZWNzIiwiaW5wdXQiLCJtb2RlbHMiLCJyZXN1bHQiLCJzb3VyY2VzIiwidW5kZWZpbmVkIiwiQXJyYXkiLCJpc0FycmF5IiwibGVuZ3RoIiwibWFwIiwic291cmNlUGF0aCIsInNwbGl0IiwicmVkdWNlIiwib3JpZ2lucyIsInNlZ21lbnQiLCJvcmlnaW4iLCJmaWx0ZXIiLCJwcmV2IiwibmV4dCIsImNvbmNhdCIsImZvckVhY2giLCJlbnRyeSIsImZpZWxkVHlwZXMiLCJtb2RlbCIsImVuZHNXaXRoIiwic2xpY2UiLCJmaWVsZH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B8fCByZXN1bHQubGVuZ3RoIDw9IDEsXG4gICAgXCJNb3JlIHRoYW4gb25lIHJlc3VsdCBmb3IgcmVsYXRpb25zaGlwLlwiXG4gICk7XG4gIHJldHVybiBzcGVjcy5tb2RlbC5lbmRzV2l0aChcIltdXCIpID8gcmVzdWx0IDogcmVzdWx0WzBdO1xufTtcblxubW9kdWxlLmV4cG9ydHMucmVtYXAgPSAoc3BlY3MsIGlucHV0LCBtb2RlbHMpID0+IHJlbWFwUmVjKHNwZWNzLCBpbnB1dCwgbW9kZWxzKTtcbiJdfQ==
{
"name": "es-alchemy",
"version": "1.6.0",
"version": "1.7.0",
"description": "Simplification of Elasticsearch interactions",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc