@webiny/api-page-builder-so-ddb-es
Version: 
The DynamoDB + Elasticsearch storage operations Webiny Page Builder API.
74 lines (72 loc) • 1.32 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createPageBlockEntity = void 0;
var _toolbox = require("@webiny/db-dynamodb/toolbox");
const createPageBlockEntity = params => {
  const {
    entityName,
    attributes,
    table
  } = params;
  return new _toolbox.Entity({
    name: entityName,
    table,
    attributes: {
      PK: {
        partitionKey: true
      },
      SK: {
        sortKey: true
      },
      GSI1_PK: {
        type: "string"
      },
      GSI1_SK: {
        type: "string"
      },
      TYPE: {
        type: "string"
      },
      id: {
        type: "string"
      },
      name: {
        type: "string"
      },
      blockCategory: {
        type: "string"
      },
      content: {
        type: "map"
      },
      preview: {
        type: "map"
      },
      createdOn: {
        type: "string"
      },
      createdBy: {
        type: "map"
      },
      tenant: {
        type: "string"
      },
      locale: {
        type: "string"
      },
      dataSources: {
        type: "list",
        default: []
      },
      dataBindings: {
        type: "list",
        default: []
      },
      ...(attributes || {})
    }
  });
};
exports.createPageBlockEntity = createPageBlockEntity;
//# sourceMappingURL=pageBlockEntity.js.map