@webiny/api-headless-cms-ddb-es
Version:
DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.
41 lines (39 loc) • 821 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createEntryElasticsearchEntity = void 0;
var _toolbox = require("@webiny/db-dynamodb/toolbox");
const createEntryElasticsearchEntity = params => {
const {
table,
entityName,
attributes
} = params;
return new _toolbox.Entity({
name: entityName,
table,
attributes: {
PK: {
type: "string",
partitionKey: true
},
SK: {
type: "string",
sortKey: true
},
index: {
type: "string"
},
data: {
type: "map"
},
TYPE: {
type: "string"
},
...(attributes || {})
}
});
};
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
//# sourceMappingURL=entryElasticsearch.js.map