@webiny/api-form-builder-so-ddb-es
Version:
[](https://www.npmjs.com/package/@webiny/api-form-builder-so-ddb-es) [](https://www.npmjs.com/package/@webiny
39 lines (37 loc) • 748 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createElasticsearchEntity = void 0;
var _toolbox = require("@webiny/db-dynamodb/toolbox");
const createElasticsearchEntity = params => {
const {
table,
entityName,
attributes
} = params;
return new _toolbox.Entity({
name: entityName,
table,
attributes: {
PK: {
partitionKey: true
},
SK: {
sortKey: true
},
index: {
type: "string"
},
data: {
type: "map"
},
TYPE: {
type: "string"
},
...(attributes || {})
}
});
};
exports.createElasticsearchEntity = createElasticsearchEntity;
//# sourceMappingURL=elasticsearch.js.map