UNPKG

@webiny/api-headless-cms-ddb-es

Version:

DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.

33 lines (31 loc) 926 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createRevisionSortKey = exports.createPublishedSortKey = exports.createPartitionKey = exports.createLatestSortKey = void 0; var _utils = require("@webiny/utils"); const createPartitionKey = params => { const { tenant, locale, id: initialId } = params; const { id } = (0, _utils.parseIdentifier)(initialId); return `T#${tenant}#L#${locale}#CMS#CME#${id}`; }; exports.createPartitionKey = createPartitionKey; const createRevisionSortKey = params => { return `REV#${(0, _utils.zeroPad)(params.version)}`; }; exports.createRevisionSortKey = createRevisionSortKey; const createLatestSortKey = () => { return "L"; }; exports.createLatestSortKey = createLatestSortKey; const createPublishedSortKey = () => { return "P"; }; exports.createPublishedSortKey = createPublishedSortKey; //# sourceMappingURL=keys.js.map