UNPKG

@webiny/api-page-builder-so-ddb-es

Version:

The DynamoDB + Elasticsearch storage operations Webiny Page Builder API.

59 lines (57 loc) 1.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createSortKey = exports.createPublishedType = exports.createPublishedSortKey = exports.createPublishedPathType = exports.createPathSortKey = exports.createPathPartitionKey = exports.createPartitionKey = exports.createLatestType = exports.createLatestSortKey = exports.createBasicType = void 0; var _utils = require("@webiny/utils"); const createBasePartitionKey = params => { const { tenant, locale } = params; return `T#${tenant}#L#${locale}#PB#`; }; const createPartitionKey = params => { const { id } = (0, _utils.parseIdentifier)(params.id); return `${createBasePartitionKey(params)}P#${id}`; }; exports.createPartitionKey = createPartitionKey; const createSortKey = params => { return `REV#${(0, _utils.zeroPad)(params.version)}`; }; exports.createSortKey = createSortKey; const createPathPartitionKey = params => { return `${createBasePartitionKey(params)}PATH`; }; exports.createPathPartitionKey = createPathPartitionKey; const createPathSortKey = params => { return params.path; }; exports.createPathSortKey = createPathSortKey; const createPublishedSortKey = () => { return "P"; }; exports.createPublishedSortKey = createPublishedSortKey; const createLatestSortKey = () => { return "L"; }; exports.createLatestSortKey = createLatestSortKey; const createBasicType = () => { return "pb.page"; }; exports.createBasicType = createBasicType; const createLatestType = () => { return "pb.page.l"; }; exports.createLatestType = createLatestType; const createPublishedType = () => { return "pb.page.p"; }; exports.createPublishedType = createPublishedType; const createPublishedPathType = () => { return "pb.page.p.path"; }; exports.createPublishedPathType = createPublishedPathType; //# sourceMappingURL=keys.js.map