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