@webiny/api-headless-cms-ddb-es
Version:
DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.
25 lines (23 loc) • 632 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createTable = void 0;
var _toolbox = require("@webiny/db-dynamodb/toolbox");
const createTable = ({
table,
documentClient
}) => {
const tableConfig = {
name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
partitionKey: "PK",
sortKey: "SK",
DocumentClient: documentClient,
autoExecute: true,
autoParse: true
};
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
return new _toolbox.Table(config);
};
exports.createTable = createTable;
//# sourceMappingURL=table.js.map
;