@webiny/api-headless-cms-ddb-es 5.40.4-beta.2 → 5.40.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +9 -0
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +26 -0
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +1 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +13 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
- package/operations/entry/index.js +20 -21
- package/operations/entry/index.js.map +1 -1
- package/package.json +23 -23
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
+
interface LogIgnoredElasticsearchExceptionParams {
|
|
4
|
+
error: WebinyError;
|
|
5
|
+
model: CmsModel;
|
|
6
|
+
indexName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const logIgnoredEsResponseError: (params: LogIgnoredElasticsearchExceptionParams) => void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.logIgnoredEsResponseError = void 0;
|
|
7
|
+
const logIgnoredEsResponseError = params => {
|
|
8
|
+
const {
|
|
9
|
+
error,
|
|
10
|
+
indexName,
|
|
11
|
+
model
|
|
12
|
+
} = params;
|
|
13
|
+
console.log(`Ignoring Elasticsearch response error: ${error.message}`, {
|
|
14
|
+
modelId: model.modelId,
|
|
15
|
+
usedIndexName: indexName,
|
|
16
|
+
error: {
|
|
17
|
+
message: error.message,
|
|
18
|
+
code: error.code,
|
|
19
|
+
data: error.data,
|
|
20
|
+
stack: error.stack
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
exports.logIgnoredEsResponseError = logIgnoredEsResponseError;
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=logIgnoredEsResponseError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["logIgnoredEsResponseError","params","error","indexName","model","console","log","message","modelId","usedIndexName","code","data","stack","exports"],"sources":["logIgnoredEsResponseError.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface LogIgnoredElasticsearchExceptionParams {\n error: WebinyError;\n model: CmsModel;\n indexName: string;\n}\n\nexport const logIgnoredEsResponseError = (params: LogIgnoredElasticsearchExceptionParams) => {\n const { error, indexName, model } = params;\n\n console.log(`Ignoring Elasticsearch response error: ${error.message}`, {\n modelId: model.modelId,\n usedIndexName: indexName,\n error: {\n message: error.message,\n code: error.code,\n data: error.data,\n stack: error.stack\n }\n });\n};\n"],"mappings":";;;;;;AASO,MAAMA,yBAAyB,GAAIC,MAA8C,IAAK;EACzF,MAAM;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAE1CI,OAAO,CAACC,GAAG,CAAE,0CAAyCJ,KAAK,CAACK,OAAQ,EAAC,EAAE;IACnEC,OAAO,EAAEJ,KAAK,CAACI,OAAO;IACtBC,aAAa,EAAEN,SAAS;IACxBD,KAAK,EAAE;MACHK,OAAO,EAAEL,KAAK,CAACK,OAAO;MACtBG,IAAI,EAAER,KAAK,CAACQ,IAAI;MAChBC,IAAI,EAAET,KAAK,CAACS,IAAI;MAChBC,KAAK,EAAEV,KAAK,CAACU;IACjB;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAb,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldIgnoreEsResponseError = void 0;
|
|
7
|
+
const IGNORED_ES_SEARCH_EXCEPTIONS = ["index_not_found_exception", "search_phase_execution_exception"];
|
|
8
|
+
const shouldIgnoreEsResponseError = error => {
|
|
9
|
+
return IGNORED_ES_SEARCH_EXCEPTIONS.includes(error.message);
|
|
10
|
+
};
|
|
11
|
+
exports.shouldIgnoreEsResponseError = shouldIgnoreEsResponseError;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=shouldIgnoreEsResponseError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IGNORED_ES_SEARCH_EXCEPTIONS","shouldIgnoreEsResponseError","error","includes","message","exports"],"sources":["shouldIgnoreEsResponseError.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nconst IGNORED_ES_SEARCH_EXCEPTIONS = [\n \"index_not_found_exception\",\n \"search_phase_execution_exception\"\n];\n\nexport const shouldIgnoreEsResponseError = (error: WebinyError) => {\n return IGNORED_ES_SEARCH_EXCEPTIONS.includes(error.message);\n};\n"],"mappings":";;;;;;AAEA,MAAMA,4BAA4B,GAAG,CACjC,2BAA2B,EAC3B,kCAAkC,CACrC;AAEM,MAAMC,2BAA2B,GAAIC,KAAkB,IAAK;EAC/D,OAAOF,4BAA4B,CAACG,QAAQ,CAACD,KAAK,CAACE,OAAO,CAAC;AAC/D,CAAC;AAACC,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -18,25 +18,14 @@ var _get = require("@webiny/db-dynamodb/utils/get");
|
|
|
18
18
|
var _utils = require("@webiny/utils");
|
|
19
19
|
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
20
20
|
var _body = require("./elasticsearch/body");
|
|
21
|
+
var _logIgnoredEsResponseError = require("./elasticsearch/logIgnoredEsResponseError");
|
|
22
|
+
var _shouldIgnoreEsResponseError = require("./elasticsearch/shouldIgnoreEsResponseError");
|
|
21
23
|
var _recordType = require("./recordType");
|
|
22
24
|
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
|
23
25
|
var _dbDynamodb = require("@webiny/db-dynamodb");
|
|
24
26
|
var _transformations = require("./transformations");
|
|
25
27
|
var _convertEntryKeys = require("./transformations/convertEntryKeys");
|
|
26
28
|
var _constants = require("@webiny/api-headless-cms/constants");
|
|
27
|
-
const IGNORED_ES_SEARCH_EXCEPTIONS = ["index_not_found_exception", "search_phase_execution_exception"];
|
|
28
|
-
const shouldIgnoreElasticsearchException = ex => {
|
|
29
|
-
if (IGNORED_ES_SEARCH_EXCEPTIONS.includes(ex.message)) {
|
|
30
|
-
console.log(`Ignoring Elasticsearch exception: ${ex.message}`);
|
|
31
|
-
console.log({
|
|
32
|
-
code: ex.code,
|
|
33
|
-
data: ex.data,
|
|
34
|
-
stack: ex.stack
|
|
35
|
-
});
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
};
|
|
40
29
|
const createEntriesStorageOperations = params => {
|
|
41
30
|
const {
|
|
42
31
|
entity,
|
|
@@ -1178,12 +1167,17 @@ const createEntriesStorageOperations = params => {
|
|
|
1178
1167
|
index,
|
|
1179
1168
|
body
|
|
1180
1169
|
});
|
|
1181
|
-
} catch (
|
|
1170
|
+
} catch (error) {
|
|
1182
1171
|
/**
|
|
1183
1172
|
* We will silently ignore the `index_not_found_exception` error and return an empty result set.
|
|
1184
1173
|
* This is because the index might not exist yet, and we don't want to throw an error.
|
|
1185
1174
|
*/
|
|
1186
|
-
if (
|
|
1175
|
+
if ((0, _shouldIgnoreEsResponseError.shouldIgnoreEsResponseError)(error)) {
|
|
1176
|
+
(0, _logIgnoredEsResponseError.logIgnoredEsResponseError)({
|
|
1177
|
+
error,
|
|
1178
|
+
model,
|
|
1179
|
+
indexName: index
|
|
1180
|
+
});
|
|
1187
1181
|
return {
|
|
1188
1182
|
hasMoreItems: false,
|
|
1189
1183
|
totalCount: 0,
|
|
@@ -1191,8 +1185,8 @@ const createEntriesStorageOperations = params => {
|
|
|
1191
1185
|
items: []
|
|
1192
1186
|
};
|
|
1193
1187
|
}
|
|
1194
|
-
throw new _error.default(
|
|
1195
|
-
error
|
|
1188
|
+
throw new _error.default(error.message, error.code || "ELASTICSEARCH_ERROR", {
|
|
1189
|
+
error,
|
|
1196
1190
|
index,
|
|
1197
1191
|
body,
|
|
1198
1192
|
model
|
|
@@ -1774,12 +1768,17 @@ const createEntriesStorageOperations = params => {
|
|
|
1774
1768
|
index,
|
|
1775
1769
|
body
|
|
1776
1770
|
});
|
|
1777
|
-
} catch (
|
|
1778
|
-
if (
|
|
1771
|
+
} catch (error) {
|
|
1772
|
+
if ((0, _shouldIgnoreEsResponseError.shouldIgnoreEsResponseError)(error)) {
|
|
1773
|
+
(0, _logIgnoredEsResponseError.logIgnoredEsResponseError)({
|
|
1774
|
+
error,
|
|
1775
|
+
model,
|
|
1776
|
+
indexName: index
|
|
1777
|
+
});
|
|
1779
1778
|
return [];
|
|
1780
1779
|
}
|
|
1781
|
-
throw new _error.default(
|
|
1782
|
-
error
|
|
1780
|
+
throw new _error.default(error.message || "Error in the Elasticsearch query.", error.code || "ELASTICSEARCH_ERROR", {
|
|
1781
|
+
error,
|
|
1783
1782
|
index,
|
|
1784
1783
|
model,
|
|
1785
1784
|
body
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_types","_helpers","_configurations","_batchWrite","_dataLoaders","_keys","_query","_apiElasticsearch","_get","_utils","_cleanup","_body","_recordType","_apiHeadlessCms","_dbDynamodb","_transformations","_convertEntryKeys","_constants","IGNORED_ES_SEARCH_EXCEPTIONS","shouldIgnoreElasticsearchException","ex","includes","message","console","log","code","data","stack","createEntriesStorageOperations","params","entity","esEntity","elasticsearch","plugins","storageOperationsCmsModelPlugin","getStorageOperationsCmsModelPlugin","oneByType","StorageOperationsCmsModelPlugin","type","getStorageOperationsModel","model","plugin","getModel","dataLoaders","DataLoadersHandler","create","initialModel","entry","initialEntry","storageEntry","initialStorageEntry","isPublished","status","locked","transformer","createTransformer","transformEntryKeys","esEntry","transformToIndex","index","esIndex","configurations","es","revisionKeys","PK","createPartitionKey","id","locale","tenant","SK","createRevisionSortKey","latestKeys","createLatestSortKey","publishedKeys","createPublishedSortKey","items","putBatch","TYPE","createRecordType","createLatestRecordType","push","createPublishedRecordType","batchWriteAll","table","clearAll","WebinyError","error","esLatestData","getElasticsearchLatestEntryData","esItems","esPublishedData","getElasticsearchPublishedEntryData","createRevisionFrom","update","latestStorageEntry","getLatestRevisionByEntryId","ids","publishedStorageEntry","getPublishedRevisionByEntryId","updatingLatestRevision","elasticsearchLatestData","updatedEntryLevelMetaFields","pickEntryMetaFields","isEntryLevelEntryMetaField","updatedLatestStorageEntry","latestEsEntry","getClean","keys","latestEsEntryDataDecompressed","decompress","updatedLatestEntry","compress","elasticsearchPublishedData","length","move","folderId","partitionKey","queryAllParams","options","gte","latestSortKey","publishedSortKey","records","queryAll","latestRecord","undefined","publishedRecord","record","location","esGetItems","getBatch","esRecords","batchReadAll","Promise","all","map","filter","Boolean","esUpdateItems","item","moveToBin","updatedEntryMetaFields","isDeletedEntryMetaField","wbyDeleted","binOriginalFolderId","restoreFromBin","isRestoredEntryMetaField","deleteEntry","entryId","deleteItems","deleteBatch","deleteEsItems","deleteRevision","latestEntry","latestTransformer","deleteMultipleEntries","entries","revisions","getAllEntryRevisions","revision","version","list","limit","createLimit","body","createElasticsearchBody","after","decodeCursor","response","search","hasMoreItems","totalCount","cursor","hits","total","extractEntriesFromIndex","_source","convertEntryKeysFromStorage","pop","encodeCursor","sort","value","get","shift","publish","previouslyPublishedEntry","getRevisionById","CONTENT_ENTRY_STATUS","UNPUBLISHED","publishingLatestRevision","updatedMetaFields","transformedToIndex","PUBLISHED","unpublish","getRevisions","getByIds","getLatestByIds","getPublishedByIds","getPreviousRevision","queryParams","lt","zeroPad","filters","attr","eq","reverse","result","queryOne","cleanupItem","getUniqueFieldValues","where","fieldId","initialBody","field","fields","find","f","size","aggregations","terms","storageId","buckets","file","key","count","doc_count","delete","exports"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n CmsEntry,\n CmsModel,\n CONTENT_ENTRY_STATUS,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types\";\nimport { extractEntriesFromIndex } from \"~/helpers\";\nimport { configurations } from \"~/configurations\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { batchWriteAll, BatchWriteItem } from \"@webiny/db-dynamodb/utils/batchWrite\";\nimport { DataLoadersHandler } from \"./dataLoaders\";\nimport {\n createLatestSortKey,\n createPartitionKey,\n createPublishedSortKey,\n createRevisionSortKey\n} from \"./keys\";\nimport {\n queryAll,\n QueryAllParams,\n queryOne,\n QueryOneParams\n} from \"@webiny/db-dynamodb/utils/query\";\nimport {\n compress,\n createLimit,\n decodeCursor,\n decompress,\n encodeCursor\n} from \"@webiny/api-elasticsearch\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { zeroPad } from \"@webiny/utils\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport {\n ElasticsearchSearchResponse,\n SearchBody as ElasticsearchSearchBody\n} from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryStorageOperations, CmsIndexEntry } from \"~/types\";\nimport { createElasticsearchBody } from \"./elasticsearch/body\";\nimport { createLatestRecordType, createPublishedRecordType, createRecordType } from \"./recordType\";\nimport { StorageOperationsCmsModelPlugin } from \"@webiny/api-headless-cms\";\nimport { WriteRequest } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { batchReadAll, BatchReadItem } from \"@webiny/db-dynamodb\";\nimport { createTransformer } from \"./transformations\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys\";\nimport {\n isDeletedEntryMetaField,\n isEntryLevelEntryMetaField,\n isRestoredEntryMetaField,\n pickEntryMetaFields\n} from \"@webiny/api-headless-cms/constants\";\n\ninterface ElasticsearchDbRecord {\n index: string;\n data: Record<string, any>;\n}\n\nexport interface CreateEntriesStorageOperationsParams {\n entity: Entity<any>;\n esEntity: Entity<any>;\n elasticsearch: Client;\n plugins: PluginsContainer;\n}\n\nconst IGNORED_ES_SEARCH_EXCEPTIONS = [\n \"index_not_found_exception\",\n \"search_phase_execution_exception\"\n];\n\nconst shouldIgnoreElasticsearchException = (ex: WebinyError) => {\n if (IGNORED_ES_SEARCH_EXCEPTIONS.includes(ex.message)) {\n console.log(`Ignoring Elasticsearch exception: ${ex.message}`);\n console.log({\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n });\n return true;\n }\n return false;\n};\n\nexport const createEntriesStorageOperations = (\n params: CreateEntriesStorageOperationsParams\n): CmsEntryStorageOperations => {\n const { entity, esEntity, elasticsearch, plugins } = params;\n\n let storageOperationsCmsModelPlugin: StorageOperationsCmsModelPlugin | undefined;\n const getStorageOperationsCmsModelPlugin = () => {\n if (storageOperationsCmsModelPlugin) {\n return storageOperationsCmsModelPlugin;\n }\n storageOperationsCmsModelPlugin = plugins.oneByType<StorageOperationsCmsModelPlugin>(\n StorageOperationsCmsModelPlugin.type\n );\n return storageOperationsCmsModelPlugin;\n };\n\n const getStorageOperationsModel = (model: CmsModel): StorageOperationsCmsModel => {\n const plugin = getStorageOperationsCmsModelPlugin();\n return plugin.getModel(model);\n };\n\n const dataLoaders = new DataLoadersHandler({\n entity\n });\n\n const create: CmsEntryStorageOperations[\"create\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n\n const model = getStorageOperationsModel(initialModel);\n\n const isPublished = initialEntry.status === \"published\";\n const locked = isPublished ? true : initialEntry.locked;\n\n initialEntry.locked = locked;\n initialStorageEntry.locked = locked;\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const esEntry = transformer.transformToIndex();\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n locked,\n ...revisionKeys,\n TYPE: createRecordType()\n }),\n entity.putBatch({\n ...storageEntry,\n locked,\n ...latestKeys,\n TYPE: createLatestRecordType()\n })\n ];\n\n if (isPublished) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n locked,\n ...publishedKeys,\n TYPE: createPublishedRecordType()\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert entry data into the DynamoDB table.\",\n ex.code || \"CREATE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n const esItems: BatchWriteItem[] = [\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: esLatestData\n })\n ];\n if (isPublished) {\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert entry data into the Elasticsearch DynamoDB table.\",\n ex.code || \"CREATE_ES_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n esEntry\n }\n );\n }\n\n return initialStorageEntry;\n };\n\n const createRevisionFrom: CmsEntryStorageOperations[\"createRevisionFrom\"] = async (\n initialModel,\n params\n ) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n // We'll need this flag below.\n const isPublished = entry.status === \"published\";\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n TYPE: createRecordType(),\n ...revisionKeys\n }),\n entity.putBatch({\n ...storageEntry,\n TYPE: createLatestRecordType(),\n ...latestKeys\n })\n ];\n\n if (isPublished) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n TYPE: createPublishedRecordType(),\n ...publishedKeys\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create revision from given entry in the DynamoDB table.\",\n ex.code || \"CREATE_REVISION_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n const esItems: BatchWriteItem[] = [\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: esLatestData\n })\n ];\n\n if (isPublished) {\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update latest entry in the DynamoDB Elasticsearch table.\",\n ex.code || \"CREATE_REVISION_ERROR\",\n {\n error: ex,\n entry\n }\n );\n }\n /**\n * There are no modifications on the entry created so just return the data.\n */\n return initialStorageEntry;\n };\n\n const update: CmsEntryStorageOperations[\"update\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const isPublished = entry.status === \"published\";\n const locked = isPublished ? true : entry.locked;\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n /**\n * We need the latest entry to check if it needs to be updated.\n */\n const [latestStorageEntry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const [publishedStorageEntry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n locked,\n ...revisionKeys,\n TYPE: createRecordType()\n })\n ];\n if (isPublished) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n locked,\n ...publishedKeys,\n TYPE: createPublishedRecordType()\n })\n );\n }\n\n const esItems: BatchWriteItem[] = [];\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n /**\n * If the latest entry is the one being updated, we need to create a new latest entry records.\n */\n if (latestStorageEntry) {\n const updatingLatestRevision = latestStorageEntry.id === entry.id;\n if (updatingLatestRevision) {\n /**\n * First we update the regular DynamoDB table.\n */\n items.push(\n entity.putBatch({\n ...storageEntry,\n ...latestKeys,\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * And then update the Elasticsearch table to propagate changes to the Elasticsearch\n */\n const elasticsearchLatestData = await transformer.getElasticsearchLatestEntryData();\n\n esItems.push(\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: elasticsearchLatestData\n })\n );\n } else {\n /**\n * If not updating latest revision, we still want to update the latest revision's\n * entry-level meta fields to match the current revision's entry-level meta fields.\n */\n const updatedEntryLevelMetaFields = pickEntryMetaFields(\n entry,\n isEntryLevelEntryMetaField\n );\n\n const updatedLatestStorageEntry = {\n ...latestStorageEntry,\n ...latestKeys,\n ...updatedEntryLevelMetaFields\n };\n\n /**\n * First we update the regular DynamoDB table. Two updates are needed:\n * - one for the actual revision record\n * - one for the latest record\n */\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n PK: createPartitionKey({\n id: latestStorageEntry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(latestStorageEntry),\n TYPE: createRecordType()\n })\n );\n\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * Update the Elasticsearch table to propagate changes to the Elasticsearch.\n */\n const latestEsEntry = await getClean<ElasticsearchDbRecord>({\n entity: esEntity,\n keys: latestKeys\n });\n\n if (latestEsEntry) {\n const latestEsEntryDataDecompressed = (await decompress(\n plugins,\n latestEsEntry.data\n )) as CmsIndexEntry;\n\n const updatedLatestEntry = await compress(plugins, {\n ...latestEsEntryDataDecompressed,\n ...updatedEntryLevelMetaFields\n });\n\n esItems.push(\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: updatedLatestEntry\n })\n );\n }\n }\n }\n\n if (isPublished && publishedStorageEntry?.id === entry.id) {\n const elasticsearchPublishedData =\n await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: elasticsearchPublishedData\n })\n );\n }\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update entry DynamoDB records.\",\n ex.code || \"UPDATE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n if (esItems.length === 0) {\n return initialStorageEntry;\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update entry DynamoDB Elasticsearch records.\",\n ex.code || \"UPDATE_ES_ENTRY_ERROR\",\n {\n error: ex,\n entry\n }\n );\n }\n return initialStorageEntry;\n };\n\n const move: CmsEntryStorageOperations[\"move\"] = async (initialModel, id, folderId) => {\n const model = getStorageOperationsModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n });\n /**\n * First we need to fetch all the records in the regular DynamoDB table.\n */\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n };\n const latestSortKey = createLatestSortKey();\n const publishedSortKey = createPublishedSortKey();\n const records = await queryAll<CmsEntry>(queryAllParams);\n /**\n * Then update the folderId in each record and prepare it to be stored.\n */\n let latestRecord: CmsEntry | undefined = undefined;\n let publishedRecord: CmsEntry | undefined = undefined;\n const items: BatchWriteItem[] = [];\n for (const record of records) {\n items.push(\n entity.putBatch({\n ...record,\n location: {\n ...record?.location,\n folderId\n }\n })\n );\n /**\n * We need to get the published and latest records, so we can update the Elasticsearch.\n */\n if (record.SK === publishedSortKey) {\n publishedRecord = record;\n } else if (record.SK === latestSortKey) {\n latestRecord = record;\n }\n }\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not move all entry records from in the DynamoDB table.\",\n ex.code || \"MOVE_ENTRY_ERROR\",\n {\n error: ex,\n id\n }\n );\n }\n const esGetItems: BatchReadItem[] = [];\n if (publishedRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: publishedSortKey\n })\n );\n }\n if (latestRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: latestSortKey\n })\n );\n }\n if (esGetItems.length === 0) {\n return;\n }\n const esRecords = await batchReadAll<ElasticsearchDbRecord>({\n table: esEntity.table,\n items: esGetItems\n });\n const esItems = (\n await Promise.all(\n esRecords.map(async record => {\n if (!record) {\n return null;\n }\n return {\n ...record,\n data: await decompress(plugins, record.data)\n };\n })\n )\n ).filter(Boolean) as ElasticsearchDbRecord[];\n\n if (esItems.length === 0) {\n return;\n }\n const esUpdateItems: BatchWriteItem[] = [];\n for (const item of esItems) {\n esUpdateItems.push(\n esEntity.putBatch({\n ...item,\n data: await compress(plugins, {\n ...item.data,\n location: {\n ...item.data?.location,\n folderId\n }\n })\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esUpdateItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not move entry DynamoDB Elasticsearch records.\",\n ex.code || \"MOVE_ES_ENTRY_ERROR\",\n {\n error: ex,\n partitionKey\n }\n );\n }\n };\n\n const moveToBin: CmsEntryStorageOperations[\"moveToBin\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n /**\n * First we need to fetch all the records in the regular DynamoDB table.\n */\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n };\n\n const latestSortKey = createLatestSortKey();\n const publishedSortKey = createPublishedSortKey();\n const records = await queryAll<CmsEntry>(queryAllParams);\n\n /**\n * Let's pick the `deleted` meta fields from the entry.\n */\n const updatedEntryMetaFields = pickEntryMetaFields(entry, isDeletedEntryMetaField);\n\n /**\n * Then update all the records with data received.\n */\n let latestRecord: CmsEntry | undefined = undefined;\n let publishedRecord: CmsEntry | undefined = undefined;\n const items: BatchWriteItem[] = [];\n\n for (const record of records) {\n items.push(\n entity.putBatch({\n ...record,\n ...updatedEntryMetaFields,\n wbyDeleted: storageEntry.wbyDeleted,\n location: storageEntry.location,\n binOriginalFolderId: storageEntry.binOriginalFolderId\n })\n );\n /**\n * We need to get the published and latest records, so we can update the Elasticsearch.\n */\n if (record.SK === publishedSortKey) {\n publishedRecord = record;\n } else if (record.SK === latestSortKey) {\n latestRecord = record;\n }\n }\n\n /**\n * We write the records back to the primary DynamoDB table.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could mark as deleted all entry records from in the DynamoDB table.\",\n ex.code || \"MOVE_ENTRY_TO_BIN_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n /**\n * We need to get the published and latest records from Elasticsearch.\n */\n const esGetItems: BatchReadItem[] = [];\n if (publishedRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: publishedSortKey\n })\n );\n }\n if (latestRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: latestSortKey\n })\n );\n }\n if (esGetItems.length === 0) {\n return;\n }\n\n const esRecords = await batchReadAll<ElasticsearchDbRecord>({\n table: esEntity.table,\n items: esGetItems\n });\n\n const esItems = (\n await Promise.all(\n esRecords.map(async record => {\n if (!record) {\n return null;\n }\n return {\n ...record,\n data: await decompress(plugins, record.data)\n };\n })\n )\n ).filter(Boolean) as ElasticsearchDbRecord[];\n\n if (esItems.length === 0) {\n return;\n }\n\n /**\n * We update all ES records with data received.\n */\n const esUpdateItems: BatchWriteItem[] = [];\n for (const item of esItems) {\n esUpdateItems.push(\n esEntity.putBatch({\n ...item,\n data: await compress(plugins, {\n ...item.data,\n ...updatedEntryMetaFields,\n wbyDeleted: entry.wbyDeleted,\n location: entry.location,\n binOriginalFolderId: entry.binOriginalFolderId\n })\n })\n );\n }\n\n /**\n * We write the records back to the primary DynamoDB Elasticsearch table.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esUpdateItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not mark as deleted entry records from DynamoDB Elasticsearch table.\",\n ex.code || \"MOVE_ENTRY_TO_BIN_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n };\n\n const restoreFromBin: CmsEntryStorageOperations[\"restoreFromBin\"] = async (\n initialModel,\n params\n ) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n /**\n * Let's pick the `restored` meta fields from the storage entry.\n */\n const updatedEntryMetaFields = pickEntryMetaFields(entry, isRestoredEntryMetaField);\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n /**\n * First we need to fetch all the records in the regular DynamoDB table.\n */\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n };\n\n const latestSortKey = createLatestSortKey();\n const publishedSortKey = createPublishedSortKey();\n const records = await queryAll<CmsEntry>(queryAllParams);\n\n /**\n * Then update all the records with data received.\n */\n let latestRecord: CmsEntry | undefined = undefined;\n let publishedRecord: CmsEntry | undefined = undefined;\n const items: BatchWriteItem[] = [];\n\n for (const record of records) {\n items.push(\n entity.putBatch({\n ...record,\n ...updatedEntryMetaFields,\n wbyDeleted: storageEntry.wbyDeleted,\n location: storageEntry.location,\n binOriginalFolderId: storageEntry.binOriginalFolderId\n })\n );\n /**\n * We need to get the published and latest records, so we can update the Elasticsearch.\n */\n if (record.SK === publishedSortKey) {\n publishedRecord = record;\n } else if (record.SK === latestSortKey) {\n latestRecord = record;\n }\n }\n\n /**\n * We write the records back to the primary DynamoDB table.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not restore all entry records from in the DynamoDB table.\",\n ex.code || \"RESTORE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n /**\n * We need to get the published and latest records from Elasticsearch.\n */\n const esGetItems: BatchReadItem[] = [];\n if (publishedRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: publishedSortKey\n })\n );\n }\n if (latestRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: latestSortKey\n })\n );\n }\n\n const esRecords = await batchReadAll<ElasticsearchDbRecord>({\n table: esEntity.table,\n items: esGetItems\n });\n\n const esItems = (\n await Promise.all(\n esRecords.map(async record => {\n if (!record) {\n return null;\n }\n return {\n ...record,\n data: await decompress(plugins, record.data)\n };\n })\n )\n ).filter(Boolean) as ElasticsearchDbRecord[];\n\n if (esItems.length === 0) {\n return initialStorageEntry;\n }\n\n /**\n * We update all ES records with data received.\n */\n const esUpdateItems: BatchWriteItem[] = [];\n for (const item of esItems) {\n esUpdateItems.push(\n esEntity.putBatch({\n ...item,\n data: await compress(plugins, {\n ...item.data,\n ...updatedEntryMetaFields,\n wbyDeleted: entry.wbyDeleted,\n location: entry.location,\n binOriginalFolderId: entry.binOriginalFolderId\n })\n })\n );\n }\n\n /**\n * We write the records back to the primary DynamoDB Elasticsearch table.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esUpdateItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not restore entry records from DynamoDB Elasticsearch table.\",\n ex.code || \"RESTORE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n return initialStorageEntry;\n };\n\n const deleteEntry: CmsEntryStorageOperations[\"delete\"] = async (initialModel, params) => {\n const { entry } = params;\n const id = entry.id || entry.entryId;\n const model = getStorageOperationsModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n const items = await queryAll<CmsEntry>({\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n\n const esItems = await queryAll<CmsEntry>({\n entity: esEntity,\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n\n const deleteItems = items.map(item => {\n return entity.deleteBatch({\n PK: item.PK,\n SK: item.SK\n });\n });\n\n const deleteEsItems = esItems.map(item => {\n return esEntity.deleteBatch({\n PK: item.PK,\n SK: item.SK\n });\n });\n\n try {\n await batchWriteAll({\n table: entity.table,\n items: deleteItems\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not destroy entry records from DynamoDB table.\",\n ex.code || \"DELETE_ENTRY_ERROR\",\n {\n error: ex,\n id\n }\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: deleteEsItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not destroy entry records from DynamoDB Elasticsearch table.\",\n ex.code || \"DELETE_ENTRY_ERROR\",\n {\n error: ex,\n id\n }\n );\n }\n };\n\n const deleteRevision: CmsEntryStorageOperations[\"deleteRevision\"] = async (\n initialModel,\n params\n ) => {\n const { entry, latestEntry, latestStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n const { index } = configurations.es({\n model\n });\n /**\n * We need published entry to delete it if necessary.\n */\n const [publishedStorageEntry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n /**\n * We need to delete all existing records of the given entry revision.\n */\n const items = [\n /**\n * Delete records of given entry revision.\n */\n entity.deleteBatch({\n PK: partitionKey,\n SK: createRevisionSortKey(entry)\n })\n ];\n\n const esItems: BatchWriteItem[] = [];\n\n /**\n * If revision we are deleting is the published one as well, we need to delete those records as well.\n */\n if (publishedStorageEntry?.id === entry.id) {\n items.push(\n entity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n })\n );\n esItems.push(\n entity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n })\n );\n }\n\n if (latestEntry && latestStorageEntry) {\n /**\n * In the end we need to set the new latest entry.\n */\n items.push(\n entity.putBatch({\n ...latestStorageEntry,\n PK: partitionKey,\n SK: createLatestSortKey(),\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * Also perform an update on the actual revision. This is needed\n * because of updates on the entry-level meta fields.\n */\n items.push(\n entity.putBatch({\n ...latestStorageEntry,\n PK: createPartitionKey({\n id: latestStorageEntry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(latestStorageEntry),\n TYPE: createRecordType()\n })\n );\n\n const latestTransformer = createTransformer({\n plugins,\n model,\n entry: latestEntry,\n storageEntry: latestStorageEntry\n });\n\n const esLatestData = await latestTransformer.getElasticsearchLatestEntryData();\n esItems.push(\n esEntity.putBatch({\n PK: partitionKey,\n SK: createLatestSortKey(),\n index,\n data: esLatestData\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not batch write entry records to DynamoDB table.\",\n ex.code || \"DELETE_REVISION_ERROR\",\n {\n error: ex,\n entry,\n latestEntry,\n latestStorageEntry\n }\n );\n }\n\n if (esItems.length === 0) {\n return;\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not batch write entry records to DynamoDB Elasticsearch table.\",\n ex.code || \"DELETE_REVISION_ERROR\",\n {\n error: ex,\n entry,\n latestEntry,\n latestStorageEntry\n }\n );\n }\n };\n\n const deleteMultipleEntries: CmsEntryStorageOperations[\"deleteMultipleEntries\"] = async (\n initialModel,\n params\n ) => {\n const { entries } = params;\n const model = getStorageOperationsModel(initialModel);\n /**\n * First we need all the revisions of the entries we want to delete.\n */\n const revisions = await dataLoaders.getAllEntryRevisions({\n model,\n ids: entries\n });\n /**\n * Then we need to construct the queries for all the revisions and entries.\n */\n const items: Record<string, WriteRequest>[] = [];\n const esItems: Record<string, WriteRequest>[] = [];\n for (const id of entries) {\n /**\n * Latest item.\n */\n items.push(\n entity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"L\"\n })\n );\n esItems.push(\n esEntity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"L\"\n })\n );\n /**\n * Published item.\n */\n items.push(\n entity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"P\"\n })\n );\n esItems.push(\n esEntity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"P\"\n })\n );\n }\n /**\n * Exact revisions of all the entries\n */\n for (const revision of revisions) {\n items.push(\n entity.deleteBatch({\n PK: createPartitionKey({\n id: revision.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey({\n version: revision.version\n })\n })\n );\n }\n\n await batchWriteAll({\n table: entity.table,\n items\n });\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n };\n\n const list: CmsEntryStorageOperations[\"list\"] = async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const limit = createLimit(params.limit, 50);\n const { index } = configurations.es({\n model\n });\n\n const body = createElasticsearchBody({\n model,\n params: {\n ...params,\n limit,\n after: decodeCursor(params.after)\n },\n plugins\n });\n\n let response: ElasticsearchSearchResponse<CmsIndexEntry>;\n try {\n response = await elasticsearch.search({\n index,\n body\n });\n } catch (ex) {\n /**\n * We will silently ignore the `index_not_found_exception` error and return an empty result set.\n * This is because the index might not exist yet, and we don't want to throw an error.\n */\n if (shouldIgnoreElasticsearchException(ex)) {\n return {\n hasMoreItems: false,\n totalCount: 0,\n cursor: null,\n items: []\n };\n }\n throw new WebinyError(ex.message, ex.code || \"ELASTICSEARCH_ERROR\", {\n error: ex,\n index,\n body,\n model\n });\n }\n\n const { hits, total } = response?.body?.hits || {};\n\n const items = extractEntriesFromIndex({\n plugins,\n model,\n entries: hits.map(item => item._source)\n }).map(item => {\n return convertEntryKeysFromStorage({\n model,\n entry: item\n });\n });\n\n const hasMoreItems = items.length > limit;\n if (hasMoreItems) {\n /**\n * Remove the last item from results, we don't want to include it.\n */\n items.pop();\n }\n /**\n * Cursor is the `sort` value of the last item in the array.\n * https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#search-after\n */\n const cursor = items.length > 0 ? encodeCursor(hits[items.length - 1].sort) || null : null;\n return {\n hasMoreItems,\n totalCount: total.value,\n cursor,\n items\n };\n };\n\n const get: CmsEntryStorageOperations[\"get\"] = async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const { items } = await list(model, {\n ...params,\n limit: 1\n });\n return items.shift() || null;\n };\n\n const publish: CmsEntryStorageOperations[\"publish\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n /**\n * We need currently published entry to check if need to remove it.\n */\n const [publishedStorageEntry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n let latestEsEntry: ElasticsearchDbRecord | null = null;\n try {\n latestEsEntry = await getClean<ElasticsearchDbRecord>({\n entity: esEntity,\n keys: latestKeys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not read Elasticsearch latest data.\",\n ex.code || \"PUBLISH_LATEST_READ\",\n {\n error: ex,\n latestKeys: latestKeys,\n publishedKeys: publishedKeys\n }\n );\n }\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n ...revisionKeys,\n TYPE: createRecordType()\n })\n ];\n const esItems: BatchWriteItem[] = [];\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n if (publishedStorageEntry && publishedStorageEntry.id !== entry.id) {\n /**\n * If there is a `published` entry already, we need to set it to `unpublished`. We need to\n * execute two updates: update the previously published entry's status and the published entry record.\n * DynamoDB does not support `batchUpdate` - so here we load the previously published\n * entry's data to update its status within a batch operation. If, hopefully,\n * they introduce a true update batch operation, remove this `read` call.\n */\n const [previouslyPublishedEntry] = await dataLoaders.getRevisionById({\n model,\n ids: [publishedStorageEntry.id]\n });\n items.push(\n /**\n * Update currently published entry (unpublish it)\n */\n entity.putBatch({\n ...previouslyPublishedEntry,\n status: CONTENT_ENTRY_STATUS.UNPUBLISHED,\n TYPE: createRecordType(),\n PK: createPartitionKey(publishedStorageEntry),\n SK: createRevisionSortKey(publishedStorageEntry)\n })\n );\n }\n /**\n * Update the helper item in DB with the new published entry\n */\n items.push(\n entity.putBatch({\n ...storageEntry,\n ...publishedKeys,\n TYPE: createPublishedRecordType()\n })\n );\n\n /**\n * We need the latest entry to check if it needs to be updated as well in the Elasticsearch.\n */\n const [latestStorageEntry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n if (latestStorageEntry?.id === entry.id) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n ...latestKeys\n })\n );\n }\n\n if (latestEsEntry) {\n const publishingLatestRevision = latestStorageEntry?.id === entry.id;\n\n /**\n * Need to decompress the data from Elasticsearch DynamoDB table.\n *\n * No need to transform it for the storage because it was fetched\n * directly from the Elasticsearch table, where it sits transformed.\n */\n const latestEsEntryDataDecompressed = (await decompress(\n plugins,\n latestEsEntry.data\n )) as CmsIndexEntry;\n\n if (publishingLatestRevision) {\n const updatedMetaFields = pickEntryMetaFields(entry);\n\n const latestTransformer = createTransformer({\n plugins,\n model,\n transformedToIndex: {\n ...latestEsEntryDataDecompressed,\n status: CONTENT_ENTRY_STATUS.PUBLISHED,\n locked: true,\n ...updatedMetaFields\n }\n });\n\n esItems.push(\n esEntity.putBatch({\n index: esIndex,\n PK: createPartitionKey(latestEsEntryDataDecompressed),\n SK: createLatestSortKey(),\n data: await latestTransformer.getElasticsearchLatestEntryData()\n })\n );\n } else {\n const updatedEntryLevelMetaFields = pickEntryMetaFields(\n entry,\n isEntryLevelEntryMetaField\n );\n\n const updatedLatestStorageEntry = {\n ...latestStorageEntry,\n ...latestKeys,\n ...updatedEntryLevelMetaFields\n };\n\n /**\n * First we update the regular DynamoDB table. Two updates are needed:\n * - one for the actual revision record\n * - one for the latest record\n */\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n PK: createPartitionKey({\n id: latestStorageEntry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(latestStorageEntry),\n TYPE: createRecordType()\n })\n );\n\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * Update the Elasticsearch table to propagate changes to the Elasticsearch.\n */\n const latestEsEntry = await getClean<ElasticsearchDbRecord>({\n entity: esEntity,\n keys: latestKeys\n });\n\n if (latestEsEntry) {\n const latestEsEntryDataDecompressed = (await decompress(\n plugins,\n latestEsEntry.data\n )) as CmsIndexEntry;\n\n const updatedLatestEntry = await compress(plugins, {\n ...latestEsEntryDataDecompressed,\n ...updatedEntryLevelMetaFields\n });\n\n esItems.push(\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: updatedLatestEntry\n })\n );\n }\n }\n }\n\n /**\n * Update the published revision entry in ES.\n */\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n })\n );\n\n /**\n * Finally, execute regular table batch.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not store publish entry records in DynamoDB table.\",\n ex.code || \"PUBLISH_ERROR\",\n {\n error: ex,\n entry,\n latestStorageEntry,\n publishedStorageEntry\n }\n );\n }\n /**\n * And Elasticsearch table batch.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not store publish entry records in DynamoDB Elasticsearch table.\",\n ex.code || \"PUBLISH_ES_ERROR\",\n {\n error: ex,\n entry,\n latestStorageEntry,\n publishedStorageEntry\n }\n );\n }\n return initialStorageEntry;\n };\n\n const unpublish: CmsEntryStorageOperations[\"unpublish\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n const { entry, storageEntry } = await transformer.transformEntryKeys();\n\n /**\n * We need the latest entry to check if it needs to be updated.\n */\n const [latestStorageEntry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n const items = [\n entity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n }),\n entity.putBatch({\n ...storageEntry,\n PK: partitionKey,\n SK: createRevisionSortKey(entry),\n TYPE: createRecordType()\n })\n ];\n\n const esItems: BatchWriteItem[] = [\n esEntity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n })\n ];\n /**\n * If we are unpublishing the latest revision, let's also update the latest revision entry's status in both DynamoDB tables.\n */\n if (latestStorageEntry?.id === entry.id) {\n const { index } = configurations.es({\n model\n });\n\n items.push(\n entity.putBatch({\n ...storageEntry,\n PK: partitionKey,\n SK: createLatestSortKey(),\n TYPE: createLatestRecordType()\n })\n );\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n esItems.push(\n esEntity.putBatch({\n PK: partitionKey,\n SK: createLatestSortKey(),\n index,\n data: esLatestData\n })\n );\n }\n\n /**\n * Finally, execute regular table batch.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not store unpublished entry records in DynamoDB table.\",\n ex.code || \"UNPUBLISH_ERROR\",\n {\n entry,\n storageEntry\n }\n );\n }\n /**\n * And Elasticsearch table batch.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not store unpublished entry records in DynamoDB Elasticsearch table.\",\n ex.code || \"UNPUBLISH_ERROR\",\n {\n entry,\n storageEntry\n }\n );\n }\n return initialStorageEntry;\n };\n\n const getLatestRevisionByEntryId: CmsEntryStorageOperations[\"getLatestRevisionByEntryId\"] =\n async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const [entry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n };\n\n const getPublishedRevisionByEntryId: CmsEntryStorageOperations[\"getPublishedRevisionByEntryId\"] =\n async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const [entry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n };\n\n const getRevisionById: CmsEntryStorageOperations[\"getRevisionById\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const [entry] = await dataLoaders.getRevisionById({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n };\n\n const getRevisions: CmsEntryStorageOperations[\"getRevisions\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getAllEntryRevisions({\n model,\n ids: [params.id]\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getByIds: CmsEntryStorageOperations[\"getByIds\"] = async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getRevisionById({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getLatestByIds: CmsEntryStorageOperations[\"getLatestByIds\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: params.ids\n });\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getPublishedByIds: CmsEntryStorageOperations[\"getPublishedByIds\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getPreviousRevision: CmsEntryStorageOperations[\"getPreviousRevision\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const { tenant, locale } = model;\n const { entryId, version } = params;\n const queryParams: QueryOneParams = {\n entity,\n partitionKey: createPartitionKey({\n tenant,\n locale,\n id: entryId\n }),\n options: {\n lt: `REV#${zeroPad(version)}`,\n /**\n * We need to have extra checks because DynamoDB will return published or latest record if there is no REV# record.\n */\n filters: [\n {\n attr: \"TYPE\",\n eq: createRecordType()\n },\n {\n attr: \"version\",\n lt: version\n }\n ],\n reverse: true\n }\n };\n\n try {\n const result = await queryOne<CmsEntry>(queryParams);\n\n const entry = cleanupItem(entity, result);\n\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n entry,\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get previous version of given entry.\",\n ex.code || \"GET_PREVIOUS_VERSION_ERROR\",\n {\n ...params,\n error: ex,\n partitionKey: queryParams.partitionKey,\n options: queryParams.options,\n model\n }\n );\n }\n };\n\n const getUniqueFieldValues: CmsEntryStorageOperations[\"getUniqueFieldValues\"] = async (\n model,\n params\n ) => {\n const { where, fieldId } = params;\n\n const { index } = configurations.es({\n model\n });\n\n const initialBody = createElasticsearchBody({\n model,\n params: {\n limit: 1,\n where\n },\n plugins\n });\n\n const field = model.fields.find(f => f.fieldId === fieldId);\n if (!field) {\n throw new WebinyError(\n `Could not find field with given \"fieldId\" value.`,\n \"FIELD_NOT_FOUND\",\n {\n fieldId\n }\n );\n }\n\n const body: ElasticsearchSearchBody = {\n ...initialBody,\n /**\n * We do not need any hits returned, we only need the aggregations.\n */\n size: 0,\n aggregations: {\n getUniqueFieldValues: {\n terms: {\n field: `values.${field.storageId}.keyword`,\n size: 1000000\n }\n }\n }\n };\n\n let response: ElasticsearchSearchResponse<string> | undefined = undefined;\n\n try {\n response = await elasticsearch.search({\n index,\n body\n });\n } catch (ex) {\n if (shouldIgnoreElasticsearchException(ex)) {\n return [];\n }\n throw new WebinyError(\n ex.message || \"Error in the Elasticsearch query.\",\n ex.code || \"ELASTICSEARCH_ERROR\",\n {\n error: ex,\n index,\n model,\n body\n }\n );\n }\n\n const buckets = response.body.aggregations[\"getUniqueFieldValues\"]?.buckets || [];\n return buckets.map(file => {\n return {\n value: file.key,\n count: file.doc_count\n };\n });\n };\n\n return {\n create,\n createRevisionFrom,\n update,\n move,\n delete: deleteEntry,\n moveToBin,\n restoreFromBin,\n deleteRevision,\n deleteMultipleEntries,\n get,\n publish,\n unpublish,\n list,\n getLatestRevisionByEntryId,\n getPublishedRevisionByEntryId,\n getRevisionById,\n getRevisions,\n getByIds,\n getLatestByIds,\n getPublishedByIds,\n getPreviousRevision,\n getUniqueFieldValues,\n dataLoaders\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAIA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,iBAAA,GAAAR,OAAA;AAOA,IAAAS,IAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAMA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AAEA,IAAAe,WAAA,GAAAf,OAAA;AACA,IAAAgB,gBAAA,GAAAhB,OAAA;AACA,IAAAiB,iBAAA,GAAAjB,OAAA;AACA,IAAAkB,UAAA,GAAAlB,OAAA;AAmBA,MAAMmB,4BAA4B,GAAG,CACjC,2BAA2B,EAC3B,kCAAkC,CACrC;AAED,MAAMC,kCAAkC,GAAIC,EAAe,IAAK;EAC5D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,oBAAoB;IACpBtK;EACJ,CAAC;AACL,CAAC;AAACwL,OAAA,CAAAvM,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_types","_helpers","_configurations","_batchWrite","_dataLoaders","_keys","_query","_apiElasticsearch","_get","_utils","_cleanup","_body","_logIgnoredEsResponseError","_shouldIgnoreEsResponseError","_recordType","_apiHeadlessCms","_dbDynamodb","_transformations","_convertEntryKeys","_constants","createEntriesStorageOperations","params","entity","esEntity","elasticsearch","plugins","storageOperationsCmsModelPlugin","getStorageOperationsCmsModelPlugin","oneByType","StorageOperationsCmsModelPlugin","type","getStorageOperationsModel","model","plugin","getModel","dataLoaders","DataLoadersHandler","create","initialModel","entry","initialEntry","storageEntry","initialStorageEntry","isPublished","status","locked","transformer","createTransformer","transformEntryKeys","esEntry","transformToIndex","index","esIndex","configurations","es","revisionKeys","PK","createPartitionKey","id","locale","tenant","SK","createRevisionSortKey","latestKeys","createLatestSortKey","publishedKeys","createPublishedSortKey","items","putBatch","TYPE","createRecordType","createLatestRecordType","push","createPublishedRecordType","batchWriteAll","table","clearAll","ex","WebinyError","message","code","error","esLatestData","getElasticsearchLatestEntryData","esItems","data","esPublishedData","getElasticsearchPublishedEntryData","createRevisionFrom","update","latestStorageEntry","getLatestRevisionByEntryId","ids","publishedStorageEntry","getPublishedRevisionByEntryId","updatingLatestRevision","elasticsearchLatestData","updatedEntryLevelMetaFields","pickEntryMetaFields","isEntryLevelEntryMetaField","updatedLatestStorageEntry","latestEsEntry","getClean","keys","latestEsEntryDataDecompressed","decompress","updatedLatestEntry","compress","elasticsearchPublishedData","length","move","folderId","partitionKey","queryAllParams","options","gte","latestSortKey","publishedSortKey","records","queryAll","latestRecord","undefined","publishedRecord","record","location","esGetItems","getBatch","esRecords","batchReadAll","Promise","all","map","filter","Boolean","esUpdateItems","item","moveToBin","updatedEntryMetaFields","isDeletedEntryMetaField","wbyDeleted","binOriginalFolderId","restoreFromBin","isRestoredEntryMetaField","deleteEntry","entryId","deleteItems","deleteBatch","deleteEsItems","deleteRevision","latestEntry","latestTransformer","deleteMultipleEntries","entries","revisions","getAllEntryRevisions","revision","version","list","limit","createLimit","body","createElasticsearchBody","after","decodeCursor","response","search","shouldIgnoreEsResponseError","logIgnoredEsResponseError","indexName","hasMoreItems","totalCount","cursor","hits","total","extractEntriesFromIndex","_source","convertEntryKeysFromStorage","pop","encodeCursor","sort","value","get","shift","publish","previouslyPublishedEntry","getRevisionById","CONTENT_ENTRY_STATUS","UNPUBLISHED","publishingLatestRevision","updatedMetaFields","transformedToIndex","PUBLISHED","unpublish","getRevisions","getByIds","getLatestByIds","getPublishedByIds","getPreviousRevision","queryParams","lt","zeroPad","filters","attr","eq","reverse","result","queryOne","cleanupItem","getUniqueFieldValues","where","fieldId","initialBody","field","fields","find","f","size","aggregations","terms","storageId","buckets","file","key","count","doc_count","delete","exports"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n CmsEntry,\n CmsModel,\n CONTENT_ENTRY_STATUS,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types\";\nimport { extractEntriesFromIndex } from \"~/helpers\";\nimport { configurations } from \"~/configurations\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { batchWriteAll, BatchWriteItem } from \"@webiny/db-dynamodb/utils/batchWrite\";\nimport { DataLoadersHandler } from \"./dataLoaders\";\nimport {\n createLatestSortKey,\n createPartitionKey,\n createPublishedSortKey,\n createRevisionSortKey\n} from \"./keys\";\nimport {\n queryAll,\n QueryAllParams,\n queryOne,\n QueryOneParams\n} from \"@webiny/db-dynamodb/utils/query\";\nimport {\n compress,\n createLimit,\n decodeCursor,\n decompress,\n encodeCursor\n} from \"@webiny/api-elasticsearch\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { zeroPad } from \"@webiny/utils\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport {\n ElasticsearchSearchResponse,\n SearchBody as ElasticsearchSearchBody\n} from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryStorageOperations, CmsIndexEntry } from \"~/types\";\nimport { createElasticsearchBody } from \"./elasticsearch/body\";\nimport { logIgnoredEsResponseError } from \"./elasticsearch/logIgnoredEsResponseError\";\nimport { shouldIgnoreEsResponseError } from \"./elasticsearch/shouldIgnoreEsResponseError\";\nimport { createLatestRecordType, createPublishedRecordType, createRecordType } from \"./recordType\";\nimport { StorageOperationsCmsModelPlugin } from \"@webiny/api-headless-cms\";\nimport { WriteRequest } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { batchReadAll, BatchReadItem } from \"@webiny/db-dynamodb\";\nimport { createTransformer } from \"./transformations\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys\";\nimport {\n isDeletedEntryMetaField,\n isEntryLevelEntryMetaField,\n isRestoredEntryMetaField,\n pickEntryMetaFields\n} from \"@webiny/api-headless-cms/constants\";\n\ninterface ElasticsearchDbRecord {\n index: string;\n data: Record<string, any>;\n}\n\nexport interface CreateEntriesStorageOperationsParams {\n entity: Entity<any>;\n esEntity: Entity<any>;\n elasticsearch: Client;\n plugins: PluginsContainer;\n}\n\nexport const createEntriesStorageOperations = (\n params: CreateEntriesStorageOperationsParams\n): CmsEntryStorageOperations => {\n const { entity, esEntity, elasticsearch, plugins } = params;\n\n let storageOperationsCmsModelPlugin: StorageOperationsCmsModelPlugin | undefined;\n const getStorageOperationsCmsModelPlugin = () => {\n if (storageOperationsCmsModelPlugin) {\n return storageOperationsCmsModelPlugin;\n }\n storageOperationsCmsModelPlugin = plugins.oneByType<StorageOperationsCmsModelPlugin>(\n StorageOperationsCmsModelPlugin.type\n );\n return storageOperationsCmsModelPlugin;\n };\n\n const getStorageOperationsModel = (model: CmsModel): StorageOperationsCmsModel => {\n const plugin = getStorageOperationsCmsModelPlugin();\n return plugin.getModel(model);\n };\n\n const dataLoaders = new DataLoadersHandler({\n entity\n });\n\n const create: CmsEntryStorageOperations[\"create\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n\n const model = getStorageOperationsModel(initialModel);\n\n const isPublished = initialEntry.status === \"published\";\n const locked = isPublished ? true : initialEntry.locked;\n\n initialEntry.locked = locked;\n initialStorageEntry.locked = locked;\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const esEntry = transformer.transformToIndex();\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n locked,\n ...revisionKeys,\n TYPE: createRecordType()\n }),\n entity.putBatch({\n ...storageEntry,\n locked,\n ...latestKeys,\n TYPE: createLatestRecordType()\n })\n ];\n\n if (isPublished) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n locked,\n ...publishedKeys,\n TYPE: createPublishedRecordType()\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert entry data into the DynamoDB table.\",\n ex.code || \"CREATE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n const esItems: BatchWriteItem[] = [\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: esLatestData\n })\n ];\n if (isPublished) {\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert entry data into the Elasticsearch DynamoDB table.\",\n ex.code || \"CREATE_ES_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n esEntry\n }\n );\n }\n\n return initialStorageEntry;\n };\n\n const createRevisionFrom: CmsEntryStorageOperations[\"createRevisionFrom\"] = async (\n initialModel,\n params\n ) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n // We'll need this flag below.\n const isPublished = entry.status === \"published\";\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n TYPE: createRecordType(),\n ...revisionKeys\n }),\n entity.putBatch({\n ...storageEntry,\n TYPE: createLatestRecordType(),\n ...latestKeys\n })\n ];\n\n if (isPublished) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n TYPE: createPublishedRecordType(),\n ...publishedKeys\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create revision from given entry in the DynamoDB table.\",\n ex.code || \"CREATE_REVISION_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n const esItems: BatchWriteItem[] = [\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: esLatestData\n })\n ];\n\n if (isPublished) {\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update latest entry in the DynamoDB Elasticsearch table.\",\n ex.code || \"CREATE_REVISION_ERROR\",\n {\n error: ex,\n entry\n }\n );\n }\n /**\n * There are no modifications on the entry created so just return the data.\n */\n return initialStorageEntry;\n };\n\n const update: CmsEntryStorageOperations[\"update\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const isPublished = entry.status === \"published\";\n const locked = isPublished ? true : entry.locked;\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n /**\n * We need the latest entry to check if it needs to be updated.\n */\n const [latestStorageEntry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const [publishedStorageEntry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n locked,\n ...revisionKeys,\n TYPE: createRecordType()\n })\n ];\n if (isPublished) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n locked,\n ...publishedKeys,\n TYPE: createPublishedRecordType()\n })\n );\n }\n\n const esItems: BatchWriteItem[] = [];\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n /**\n * If the latest entry is the one being updated, we need to create a new latest entry records.\n */\n if (latestStorageEntry) {\n const updatingLatestRevision = latestStorageEntry.id === entry.id;\n if (updatingLatestRevision) {\n /**\n * First we update the regular DynamoDB table.\n */\n items.push(\n entity.putBatch({\n ...storageEntry,\n ...latestKeys,\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * And then update the Elasticsearch table to propagate changes to the Elasticsearch\n */\n const elasticsearchLatestData = await transformer.getElasticsearchLatestEntryData();\n\n esItems.push(\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: elasticsearchLatestData\n })\n );\n } else {\n /**\n * If not updating latest revision, we still want to update the latest revision's\n * entry-level meta fields to match the current revision's entry-level meta fields.\n */\n const updatedEntryLevelMetaFields = pickEntryMetaFields(\n entry,\n isEntryLevelEntryMetaField\n );\n\n const updatedLatestStorageEntry = {\n ...latestStorageEntry,\n ...latestKeys,\n ...updatedEntryLevelMetaFields\n };\n\n /**\n * First we update the regular DynamoDB table. Two updates are needed:\n * - one for the actual revision record\n * - one for the latest record\n */\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n PK: createPartitionKey({\n id: latestStorageEntry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(latestStorageEntry),\n TYPE: createRecordType()\n })\n );\n\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * Update the Elasticsearch table to propagate changes to the Elasticsearch.\n */\n const latestEsEntry = await getClean<ElasticsearchDbRecord>({\n entity: esEntity,\n keys: latestKeys\n });\n\n if (latestEsEntry) {\n const latestEsEntryDataDecompressed = (await decompress(\n plugins,\n latestEsEntry.data\n )) as CmsIndexEntry;\n\n const updatedLatestEntry = await compress(plugins, {\n ...latestEsEntryDataDecompressed,\n ...updatedEntryLevelMetaFields\n });\n\n esItems.push(\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: updatedLatestEntry\n })\n );\n }\n }\n }\n\n if (isPublished && publishedStorageEntry?.id === entry.id) {\n const elasticsearchPublishedData =\n await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: elasticsearchPublishedData\n })\n );\n }\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update entry DynamoDB records.\",\n ex.code || \"UPDATE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n if (esItems.length === 0) {\n return initialStorageEntry;\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update entry DynamoDB Elasticsearch records.\",\n ex.code || \"UPDATE_ES_ENTRY_ERROR\",\n {\n error: ex,\n entry\n }\n );\n }\n return initialStorageEntry;\n };\n\n const move: CmsEntryStorageOperations[\"move\"] = async (initialModel, id, folderId) => {\n const model = getStorageOperationsModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n });\n /**\n * First we need to fetch all the records in the regular DynamoDB table.\n */\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n };\n const latestSortKey = createLatestSortKey();\n const publishedSortKey = createPublishedSortKey();\n const records = await queryAll<CmsEntry>(queryAllParams);\n /**\n * Then update the folderId in each record and prepare it to be stored.\n */\n let latestRecord: CmsEntry | undefined = undefined;\n let publishedRecord: CmsEntry | undefined = undefined;\n const items: BatchWriteItem[] = [];\n for (const record of records) {\n items.push(\n entity.putBatch({\n ...record,\n location: {\n ...record?.location,\n folderId\n }\n })\n );\n /**\n * We need to get the published and latest records, so we can update the Elasticsearch.\n */\n if (record.SK === publishedSortKey) {\n publishedRecord = record;\n } else if (record.SK === latestSortKey) {\n latestRecord = record;\n }\n }\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not move all entry records from in the DynamoDB table.\",\n ex.code || \"MOVE_ENTRY_ERROR\",\n {\n error: ex,\n id\n }\n );\n }\n const esGetItems: BatchReadItem[] = [];\n if (publishedRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: publishedSortKey\n })\n );\n }\n if (latestRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: latestSortKey\n })\n );\n }\n if (esGetItems.length === 0) {\n return;\n }\n const esRecords = await batchReadAll<ElasticsearchDbRecord>({\n table: esEntity.table,\n items: esGetItems\n });\n const esItems = (\n await Promise.all(\n esRecords.map(async record => {\n if (!record) {\n return null;\n }\n return {\n ...record,\n data: await decompress(plugins, record.data)\n };\n })\n )\n ).filter(Boolean) as ElasticsearchDbRecord[];\n\n if (esItems.length === 0) {\n return;\n }\n const esUpdateItems: BatchWriteItem[] = [];\n for (const item of esItems) {\n esUpdateItems.push(\n esEntity.putBatch({\n ...item,\n data: await compress(plugins, {\n ...item.data,\n location: {\n ...item.data?.location,\n folderId\n }\n })\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esUpdateItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not move entry DynamoDB Elasticsearch records.\",\n ex.code || \"MOVE_ES_ENTRY_ERROR\",\n {\n error: ex,\n partitionKey\n }\n );\n }\n };\n\n const moveToBin: CmsEntryStorageOperations[\"moveToBin\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n /**\n * First we need to fetch all the records in the regular DynamoDB table.\n */\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n };\n\n const latestSortKey = createLatestSortKey();\n const publishedSortKey = createPublishedSortKey();\n const records = await queryAll<CmsEntry>(queryAllParams);\n\n /**\n * Let's pick the `deleted` meta fields from the entry.\n */\n const updatedEntryMetaFields = pickEntryMetaFields(entry, isDeletedEntryMetaField);\n\n /**\n * Then update all the records with data received.\n */\n let latestRecord: CmsEntry | undefined = undefined;\n let publishedRecord: CmsEntry | undefined = undefined;\n const items: BatchWriteItem[] = [];\n\n for (const record of records) {\n items.push(\n entity.putBatch({\n ...record,\n ...updatedEntryMetaFields,\n wbyDeleted: storageEntry.wbyDeleted,\n location: storageEntry.location,\n binOriginalFolderId: storageEntry.binOriginalFolderId\n })\n );\n /**\n * We need to get the published and latest records, so we can update the Elasticsearch.\n */\n if (record.SK === publishedSortKey) {\n publishedRecord = record;\n } else if (record.SK === latestSortKey) {\n latestRecord = record;\n }\n }\n\n /**\n * We write the records back to the primary DynamoDB table.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could mark as deleted all entry records from in the DynamoDB table.\",\n ex.code || \"MOVE_ENTRY_TO_BIN_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n /**\n * We need to get the published and latest records from Elasticsearch.\n */\n const esGetItems: BatchReadItem[] = [];\n if (publishedRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: publishedSortKey\n })\n );\n }\n if (latestRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: latestSortKey\n })\n );\n }\n if (esGetItems.length === 0) {\n return;\n }\n\n const esRecords = await batchReadAll<ElasticsearchDbRecord>({\n table: esEntity.table,\n items: esGetItems\n });\n\n const esItems = (\n await Promise.all(\n esRecords.map(async record => {\n if (!record) {\n return null;\n }\n return {\n ...record,\n data: await decompress(plugins, record.data)\n };\n })\n )\n ).filter(Boolean) as ElasticsearchDbRecord[];\n\n if (esItems.length === 0) {\n return;\n }\n\n /**\n * We update all ES records with data received.\n */\n const esUpdateItems: BatchWriteItem[] = [];\n for (const item of esItems) {\n esUpdateItems.push(\n esEntity.putBatch({\n ...item,\n data: await compress(plugins, {\n ...item.data,\n ...updatedEntryMetaFields,\n wbyDeleted: entry.wbyDeleted,\n location: entry.location,\n binOriginalFolderId: entry.binOriginalFolderId\n })\n })\n );\n }\n\n /**\n * We write the records back to the primary DynamoDB Elasticsearch table.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esUpdateItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not mark as deleted entry records from DynamoDB Elasticsearch table.\",\n ex.code || \"MOVE_ENTRY_TO_BIN_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n };\n\n const restoreFromBin: CmsEntryStorageOperations[\"restoreFromBin\"] = async (\n initialModel,\n params\n ) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n /**\n * Let's pick the `restored` meta fields from the storage entry.\n */\n const updatedEntryMetaFields = pickEntryMetaFields(entry, isRestoredEntryMetaField);\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n /**\n * First we need to fetch all the records in the regular DynamoDB table.\n */\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n };\n\n const latestSortKey = createLatestSortKey();\n const publishedSortKey = createPublishedSortKey();\n const records = await queryAll<CmsEntry>(queryAllParams);\n\n /**\n * Then update all the records with data received.\n */\n let latestRecord: CmsEntry | undefined = undefined;\n let publishedRecord: CmsEntry | undefined = undefined;\n const items: BatchWriteItem[] = [];\n\n for (const record of records) {\n items.push(\n entity.putBatch({\n ...record,\n ...updatedEntryMetaFields,\n wbyDeleted: storageEntry.wbyDeleted,\n location: storageEntry.location,\n binOriginalFolderId: storageEntry.binOriginalFolderId\n })\n );\n /**\n * We need to get the published and latest records, so we can update the Elasticsearch.\n */\n if (record.SK === publishedSortKey) {\n publishedRecord = record;\n } else if (record.SK === latestSortKey) {\n latestRecord = record;\n }\n }\n\n /**\n * We write the records back to the primary DynamoDB table.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not restore all entry records from in the DynamoDB table.\",\n ex.code || \"RESTORE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n /**\n * We need to get the published and latest records from Elasticsearch.\n */\n const esGetItems: BatchReadItem[] = [];\n if (publishedRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: publishedSortKey\n })\n );\n }\n if (latestRecord) {\n esGetItems.push(\n esEntity.getBatch({\n PK: partitionKey,\n SK: latestSortKey\n })\n );\n }\n\n const esRecords = await batchReadAll<ElasticsearchDbRecord>({\n table: esEntity.table,\n items: esGetItems\n });\n\n const esItems = (\n await Promise.all(\n esRecords.map(async record => {\n if (!record) {\n return null;\n }\n return {\n ...record,\n data: await decompress(plugins, record.data)\n };\n })\n )\n ).filter(Boolean) as ElasticsearchDbRecord[];\n\n if (esItems.length === 0) {\n return initialStorageEntry;\n }\n\n /**\n * We update all ES records with data received.\n */\n const esUpdateItems: BatchWriteItem[] = [];\n for (const item of esItems) {\n esUpdateItems.push(\n esEntity.putBatch({\n ...item,\n data: await compress(plugins, {\n ...item.data,\n ...updatedEntryMetaFields,\n wbyDeleted: entry.wbyDeleted,\n location: entry.location,\n binOriginalFolderId: entry.binOriginalFolderId\n })\n })\n );\n }\n\n /**\n * We write the records back to the primary DynamoDB Elasticsearch table.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esUpdateItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not restore entry records from DynamoDB Elasticsearch table.\",\n ex.code || \"RESTORE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n return initialStorageEntry;\n };\n\n const deleteEntry: CmsEntryStorageOperations[\"delete\"] = async (initialModel, params) => {\n const { entry } = params;\n const id = entry.id || entry.entryId;\n const model = getStorageOperationsModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n const items = await queryAll<CmsEntry>({\n entity,\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n\n const esItems = await queryAll<CmsEntry>({\n entity: esEntity,\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n\n const deleteItems = items.map(item => {\n return entity.deleteBatch({\n PK: item.PK,\n SK: item.SK\n });\n });\n\n const deleteEsItems = esItems.map(item => {\n return esEntity.deleteBatch({\n PK: item.PK,\n SK: item.SK\n });\n });\n\n try {\n await batchWriteAll({\n table: entity.table,\n items: deleteItems\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not destroy entry records from DynamoDB table.\",\n ex.code || \"DELETE_ENTRY_ERROR\",\n {\n error: ex,\n id\n }\n );\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: deleteEsItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not destroy entry records from DynamoDB Elasticsearch table.\",\n ex.code || \"DELETE_ENTRY_ERROR\",\n {\n error: ex,\n id\n }\n );\n }\n };\n\n const deleteRevision: CmsEntryStorageOperations[\"deleteRevision\"] = async (\n initialModel,\n params\n ) => {\n const { entry, latestEntry, latestStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n const { index } = configurations.es({\n model\n });\n /**\n * We need published entry to delete it if necessary.\n */\n const [publishedStorageEntry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n /**\n * We need to delete all existing records of the given entry revision.\n */\n const items = [\n /**\n * Delete records of given entry revision.\n */\n entity.deleteBatch({\n PK: partitionKey,\n SK: createRevisionSortKey(entry)\n })\n ];\n\n const esItems: BatchWriteItem[] = [];\n\n /**\n * If revision we are deleting is the published one as well, we need to delete those records as well.\n */\n if (publishedStorageEntry?.id === entry.id) {\n items.push(\n entity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n })\n );\n esItems.push(\n entity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n })\n );\n }\n\n if (latestEntry && latestStorageEntry) {\n /**\n * In the end we need to set the new latest entry.\n */\n items.push(\n entity.putBatch({\n ...latestStorageEntry,\n PK: partitionKey,\n SK: createLatestSortKey(),\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * Also perform an update on the actual revision. This is needed\n * because of updates on the entry-level meta fields.\n */\n items.push(\n entity.putBatch({\n ...latestStorageEntry,\n PK: createPartitionKey({\n id: latestStorageEntry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(latestStorageEntry),\n TYPE: createRecordType()\n })\n );\n\n const latestTransformer = createTransformer({\n plugins,\n model,\n entry: latestEntry,\n storageEntry: latestStorageEntry\n });\n\n const esLatestData = await latestTransformer.getElasticsearchLatestEntryData();\n esItems.push(\n esEntity.putBatch({\n PK: partitionKey,\n SK: createLatestSortKey(),\n index,\n data: esLatestData\n })\n );\n }\n\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not batch write entry records to DynamoDB table.\",\n ex.code || \"DELETE_REVISION_ERROR\",\n {\n error: ex,\n entry,\n latestEntry,\n latestStorageEntry\n }\n );\n }\n\n if (esItems.length === 0) {\n return;\n }\n\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not batch write entry records to DynamoDB Elasticsearch table.\",\n ex.code || \"DELETE_REVISION_ERROR\",\n {\n error: ex,\n entry,\n latestEntry,\n latestStorageEntry\n }\n );\n }\n };\n\n const deleteMultipleEntries: CmsEntryStorageOperations[\"deleteMultipleEntries\"] = async (\n initialModel,\n params\n ) => {\n const { entries } = params;\n const model = getStorageOperationsModel(initialModel);\n /**\n * First we need all the revisions of the entries we want to delete.\n */\n const revisions = await dataLoaders.getAllEntryRevisions({\n model,\n ids: entries\n });\n /**\n * Then we need to construct the queries for all the revisions and entries.\n */\n const items: Record<string, WriteRequest>[] = [];\n const esItems: Record<string, WriteRequest>[] = [];\n for (const id of entries) {\n /**\n * Latest item.\n */\n items.push(\n entity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"L\"\n })\n );\n esItems.push(\n esEntity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"L\"\n })\n );\n /**\n * Published item.\n */\n items.push(\n entity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"P\"\n })\n );\n esItems.push(\n esEntity.deleteBatch({\n PK: createPartitionKey({\n id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: \"P\"\n })\n );\n }\n /**\n * Exact revisions of all the entries\n */\n for (const revision of revisions) {\n items.push(\n entity.deleteBatch({\n PK: createPartitionKey({\n id: revision.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey({\n version: revision.version\n })\n })\n );\n }\n\n await batchWriteAll({\n table: entity.table,\n items\n });\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n };\n\n const list: CmsEntryStorageOperations[\"list\"] = async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const limit = createLimit(params.limit, 50);\n const { index } = configurations.es({\n model\n });\n\n const body = createElasticsearchBody({\n model,\n params: {\n ...params,\n limit,\n after: decodeCursor(params.after)\n },\n plugins\n });\n\n let response: ElasticsearchSearchResponse<CmsIndexEntry>;\n try {\n response = await elasticsearch.search({\n index,\n body\n });\n } catch (error) {\n /**\n * We will silently ignore the `index_not_found_exception` error and return an empty result set.\n * This is because the index might not exist yet, and we don't want to throw an error.\n */\n if (shouldIgnoreEsResponseError(error)) {\n logIgnoredEsResponseError({\n error,\n model,\n indexName: index\n });\n\n return {\n hasMoreItems: false,\n totalCount: 0,\n cursor: null,\n items: []\n };\n }\n\n throw new WebinyError(error.message, error.code || \"ELASTICSEARCH_ERROR\", {\n error,\n index,\n body,\n model\n });\n }\n\n const { hits, total } = response?.body?.hits || {};\n\n const items = extractEntriesFromIndex({\n plugins,\n model,\n entries: hits.map(item => item._source)\n }).map(item => {\n return convertEntryKeysFromStorage({\n model,\n entry: item\n });\n });\n\n const hasMoreItems = items.length > limit;\n if (hasMoreItems) {\n /**\n * Remove the last item from results, we don't want to include it.\n */\n items.pop();\n }\n /**\n * Cursor is the `sort` value of the last item in the array.\n * https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#search-after\n */\n const cursor = items.length > 0 ? encodeCursor(hits[items.length - 1].sort) || null : null;\n return {\n hasMoreItems,\n totalCount: total.value,\n cursor,\n items\n };\n };\n\n const get: CmsEntryStorageOperations[\"get\"] = async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const { items } = await list(model, {\n ...params,\n limit: 1\n });\n return items.shift() || null;\n };\n\n const publish: CmsEntryStorageOperations[\"publish\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n /**\n * We need currently published entry to check if need to remove it.\n */\n const [publishedStorageEntry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const revisionKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(entry)\n };\n const latestKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createLatestSortKey()\n };\n const publishedKeys = {\n PK: createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createPublishedSortKey()\n };\n\n let latestEsEntry: ElasticsearchDbRecord | null = null;\n try {\n latestEsEntry = await getClean<ElasticsearchDbRecord>({\n entity: esEntity,\n keys: latestKeys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not read Elasticsearch latest data.\",\n ex.code || \"PUBLISH_LATEST_READ\",\n {\n error: ex,\n latestKeys: latestKeys,\n publishedKeys: publishedKeys\n }\n );\n }\n\n const items = [\n entity.putBatch({\n ...storageEntry,\n ...revisionKeys,\n TYPE: createRecordType()\n })\n ];\n const esItems: BatchWriteItem[] = [];\n\n const { index: esIndex } = configurations.es({\n model\n });\n\n if (publishedStorageEntry && publishedStorageEntry.id !== entry.id) {\n /**\n * If there is a `published` entry already, we need to set it to `unpublished`. We need to\n * execute two updates: update the previously published entry's status and the published entry record.\n * DynamoDB does not support `batchUpdate` - so here we load the previously published\n * entry's data to update its status within a batch operation. If, hopefully,\n * they introduce a true update batch operation, remove this `read` call.\n */\n const [previouslyPublishedEntry] = await dataLoaders.getRevisionById({\n model,\n ids: [publishedStorageEntry.id]\n });\n items.push(\n /**\n * Update currently published entry (unpublish it)\n */\n entity.putBatch({\n ...previouslyPublishedEntry,\n status: CONTENT_ENTRY_STATUS.UNPUBLISHED,\n TYPE: createRecordType(),\n PK: createPartitionKey(publishedStorageEntry),\n SK: createRevisionSortKey(publishedStorageEntry)\n })\n );\n }\n /**\n * Update the helper item in DB with the new published entry\n */\n items.push(\n entity.putBatch({\n ...storageEntry,\n ...publishedKeys,\n TYPE: createPublishedRecordType()\n })\n );\n\n /**\n * We need the latest entry to check if it needs to be updated as well in the Elasticsearch.\n */\n const [latestStorageEntry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n if (latestStorageEntry?.id === entry.id) {\n items.push(\n entity.putBatch({\n ...storageEntry,\n ...latestKeys\n })\n );\n }\n\n if (latestEsEntry) {\n const publishingLatestRevision = latestStorageEntry?.id === entry.id;\n\n /**\n * Need to decompress the data from Elasticsearch DynamoDB table.\n *\n * No need to transform it for the storage because it was fetched\n * directly from the Elasticsearch table, where it sits transformed.\n */\n const latestEsEntryDataDecompressed = (await decompress(\n plugins,\n latestEsEntry.data\n )) as CmsIndexEntry;\n\n if (publishingLatestRevision) {\n const updatedMetaFields = pickEntryMetaFields(entry);\n\n const latestTransformer = createTransformer({\n plugins,\n model,\n transformedToIndex: {\n ...latestEsEntryDataDecompressed,\n status: CONTENT_ENTRY_STATUS.PUBLISHED,\n locked: true,\n ...updatedMetaFields\n }\n });\n\n esItems.push(\n esEntity.putBatch({\n index: esIndex,\n PK: createPartitionKey(latestEsEntryDataDecompressed),\n SK: createLatestSortKey(),\n data: await latestTransformer.getElasticsearchLatestEntryData()\n })\n );\n } else {\n const updatedEntryLevelMetaFields = pickEntryMetaFields(\n entry,\n isEntryLevelEntryMetaField\n );\n\n const updatedLatestStorageEntry = {\n ...latestStorageEntry,\n ...latestKeys,\n ...updatedEntryLevelMetaFields\n };\n\n /**\n * First we update the regular DynamoDB table. Two updates are needed:\n * - one for the actual revision record\n * - one for the latest record\n */\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n PK: createPartitionKey({\n id: latestStorageEntry.id,\n locale: model.locale,\n tenant: model.tenant\n }),\n SK: createRevisionSortKey(latestStorageEntry),\n TYPE: createRecordType()\n })\n );\n\n items.push(\n entity.putBatch({\n ...updatedLatestStorageEntry,\n TYPE: createLatestRecordType()\n })\n );\n\n /**\n * Update the Elasticsearch table to propagate changes to the Elasticsearch.\n */\n const latestEsEntry = await getClean<ElasticsearchDbRecord>({\n entity: esEntity,\n keys: latestKeys\n });\n\n if (latestEsEntry) {\n const latestEsEntryDataDecompressed = (await decompress(\n plugins,\n latestEsEntry.data\n )) as CmsIndexEntry;\n\n const updatedLatestEntry = await compress(plugins, {\n ...latestEsEntryDataDecompressed,\n ...updatedEntryLevelMetaFields\n });\n\n esItems.push(\n esEntity.putBatch({\n ...latestKeys,\n index: esIndex,\n data: updatedLatestEntry\n })\n );\n }\n }\n }\n\n /**\n * Update the published revision entry in ES.\n */\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n esItems.push(\n esEntity.putBatch({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n })\n );\n\n /**\n * Finally, execute regular table batch.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not store publish entry records in DynamoDB table.\",\n ex.code || \"PUBLISH_ERROR\",\n {\n error: ex,\n entry,\n latestStorageEntry,\n publishedStorageEntry\n }\n );\n }\n /**\n * And Elasticsearch table batch.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not store publish entry records in DynamoDB Elasticsearch table.\",\n ex.code || \"PUBLISH_ES_ERROR\",\n {\n error: ex,\n entry,\n latestStorageEntry,\n publishedStorageEntry\n }\n );\n }\n return initialStorageEntry;\n };\n\n const unpublish: CmsEntryStorageOperations[\"unpublish\"] = async (initialModel, params) => {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n const model = getStorageOperationsModel(initialModel);\n\n const transformer = createTransformer({\n plugins,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry\n });\n const { entry, storageEntry } = await transformer.transformEntryKeys();\n\n /**\n * We need the latest entry to check if it needs to be updated.\n */\n const [latestStorageEntry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [entry.id]\n });\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n locale: model.locale,\n tenant: model.tenant\n });\n\n const items = [\n entity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n }),\n entity.putBatch({\n ...storageEntry,\n PK: partitionKey,\n SK: createRevisionSortKey(entry),\n TYPE: createRecordType()\n })\n ];\n\n const esItems: BatchWriteItem[] = [\n esEntity.deleteBatch({\n PK: partitionKey,\n SK: createPublishedSortKey()\n })\n ];\n /**\n * If we are unpublishing the latest revision, let's also update the latest revision entry's status in both DynamoDB tables.\n */\n if (latestStorageEntry?.id === entry.id) {\n const { index } = configurations.es({\n model\n });\n\n items.push(\n entity.putBatch({\n ...storageEntry,\n PK: partitionKey,\n SK: createLatestSortKey(),\n TYPE: createLatestRecordType()\n })\n );\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n esItems.push(\n esEntity.putBatch({\n PK: partitionKey,\n SK: createLatestSortKey(),\n index,\n data: esLatestData\n })\n );\n }\n\n /**\n * Finally, execute regular table batch.\n */\n try {\n await batchWriteAll({\n table: entity.table,\n items\n });\n dataLoaders.clearAll({\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not store unpublished entry records in DynamoDB table.\",\n ex.code || \"UNPUBLISH_ERROR\",\n {\n entry,\n storageEntry\n }\n );\n }\n /**\n * And Elasticsearch table batch.\n */\n try {\n await batchWriteAll({\n table: esEntity.table,\n items: esItems\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message ||\n \"Could not store unpublished entry records in DynamoDB Elasticsearch table.\",\n ex.code || \"UNPUBLISH_ERROR\",\n {\n entry,\n storageEntry\n }\n );\n }\n return initialStorageEntry;\n };\n\n const getLatestRevisionByEntryId: CmsEntryStorageOperations[\"getLatestRevisionByEntryId\"] =\n async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const [entry] = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n };\n\n const getPublishedRevisionByEntryId: CmsEntryStorageOperations[\"getPublishedRevisionByEntryId\"] =\n async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const [entry] = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n };\n\n const getRevisionById: CmsEntryStorageOperations[\"getRevisionById\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const [entry] = await dataLoaders.getRevisionById({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n };\n\n const getRevisions: CmsEntryStorageOperations[\"getRevisions\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getAllEntryRevisions({\n model,\n ids: [params.id]\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getByIds: CmsEntryStorageOperations[\"getByIds\"] = async (initialModel, params) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getRevisionById({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getLatestByIds: CmsEntryStorageOperations[\"getLatestByIds\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getLatestRevisionByEntryId({\n model,\n ids: params.ids\n });\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getPublishedByIds: CmsEntryStorageOperations[\"getPublishedByIds\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const entries = await dataLoaders.getPublishedRevisionByEntryId({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage({\n model,\n entry\n });\n });\n };\n\n const getPreviousRevision: CmsEntryStorageOperations[\"getPreviousRevision\"] = async (\n initialModel,\n params\n ) => {\n const model = getStorageOperationsModel(initialModel);\n\n const { tenant, locale } = model;\n const { entryId, version } = params;\n const queryParams: QueryOneParams = {\n entity,\n partitionKey: createPartitionKey({\n tenant,\n locale,\n id: entryId\n }),\n options: {\n lt: `REV#${zeroPad(version)}`,\n /**\n * We need to have extra checks because DynamoDB will return published or latest record if there is no REV# record.\n */\n filters: [\n {\n attr: \"TYPE\",\n eq: createRecordType()\n },\n {\n attr: \"version\",\n lt: version\n }\n ],\n reverse: true\n }\n };\n\n try {\n const result = await queryOne<CmsEntry>(queryParams);\n\n const entry = cleanupItem(entity, result);\n\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage({\n entry,\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get previous version of given entry.\",\n ex.code || \"GET_PREVIOUS_VERSION_ERROR\",\n {\n ...params,\n error: ex,\n partitionKey: queryParams.partitionKey,\n options: queryParams.options,\n model\n }\n );\n }\n };\n\n const getUniqueFieldValues: CmsEntryStorageOperations[\"getUniqueFieldValues\"] = async (\n model,\n params\n ) => {\n const { where, fieldId } = params;\n\n const { index } = configurations.es({\n model\n });\n\n const initialBody = createElasticsearchBody({\n model,\n params: {\n limit: 1,\n where\n },\n plugins\n });\n\n const field = model.fields.find(f => f.fieldId === fieldId);\n if (!field) {\n throw new WebinyError(\n `Could not find field with given \"fieldId\" value.`,\n \"FIELD_NOT_FOUND\",\n {\n fieldId\n }\n );\n }\n\n const body: ElasticsearchSearchBody = {\n ...initialBody,\n /**\n * We do not need any hits returned, we only need the aggregations.\n */\n size: 0,\n aggregations: {\n getUniqueFieldValues: {\n terms: {\n field: `values.${field.storageId}.keyword`,\n size: 1000000\n }\n }\n }\n };\n\n let response: ElasticsearchSearchResponse<string> | undefined = undefined;\n\n try {\n response = await elasticsearch.search({\n index,\n body\n });\n } catch (error) {\n if (shouldIgnoreEsResponseError(error)) {\n logIgnoredEsResponseError({\n error,\n model,\n indexName: index\n });\n return [];\n }\n\n throw new WebinyError(\n error.message || \"Error in the Elasticsearch query.\",\n error.code || \"ELASTICSEARCH_ERROR\",\n {\n error,\n index,\n model,\n body\n }\n );\n }\n\n const buckets = response.body.aggregations[\"getUniqueFieldValues\"]?.buckets || [];\n return buckets.map(file => {\n return {\n value: file.key,\n count: file.doc_count\n };\n });\n };\n\n return {\n create,\n createRevisionFrom,\n update,\n move,\n delete: deleteEntry,\n moveToBin,\n restoreFromBin,\n deleteRevision,\n deleteMultipleEntries,\n get,\n publish,\n unpublish,\n list,\n getLatestRevisionByEntryId,\n getPublishedRevisionByEntryId,\n getRevisionById,\n getRevisions,\n getByIds,\n getLatestByIds,\n getPublishedByIds,\n getPreviousRevision,\n getUniqueFieldValues,\n dataLoaders\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAIA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,iBAAA,GAAAR,OAAA;AAOA,IAAAS,IAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAA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E,0BAA0B;IAC1BG,6BAA6B;IAC7B2F,eAAe;IACfQ,YAAY;IACZC,QAAQ;IACRC,cAAc;IACdC,iBAAiB;IACjBC,mBAAmB;IACnBW,oBAAoB;IACpB7K;EACJ,CAAC;AACL,CAAC;AAAC+L,OAAA,CAAA9M,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb-es",
|
|
3
|
-
"version": "5.40.
|
|
3
|
+
"version": "5.40.5-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-headless-cms",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "7.24.1",
|
|
30
|
-
"@webiny/api": "5.40.
|
|
31
|
-
"@webiny/api-elasticsearch": "5.40.
|
|
32
|
-
"@webiny/api-elasticsearch-tasks": "5.40.
|
|
33
|
-
"@webiny/api-headless-cms": "5.40.
|
|
34
|
-
"@webiny/aws-sdk": "5.40.
|
|
35
|
-
"@webiny/db-dynamodb": "5.40.
|
|
36
|
-
"@webiny/error": "5.40.
|
|
37
|
-
"@webiny/handler-db": "5.40.
|
|
38
|
-
"@webiny/plugins": "5.40.
|
|
39
|
-
"@webiny/utils": "5.40.
|
|
30
|
+
"@webiny/api": "5.40.5-beta.0",
|
|
31
|
+
"@webiny/api-elasticsearch": "5.40.5-beta.0",
|
|
32
|
+
"@webiny/api-elasticsearch-tasks": "5.40.5-beta.0",
|
|
33
|
+
"@webiny/api-headless-cms": "5.40.5-beta.0",
|
|
34
|
+
"@webiny/aws-sdk": "5.40.5-beta.0",
|
|
35
|
+
"@webiny/db-dynamodb": "5.40.5-beta.0",
|
|
36
|
+
"@webiny/error": "5.40.5-beta.0",
|
|
37
|
+
"@webiny/handler-db": "5.40.5-beta.0",
|
|
38
|
+
"@webiny/plugins": "5.40.5-beta.0",
|
|
39
|
+
"@webiny/utils": "5.40.5-beta.0",
|
|
40
40
|
"dataloader": "2.2.1",
|
|
41
41
|
"jsonpack": "1.1.5",
|
|
42
42
|
"lodash": "4.17.21"
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"@babel/preset-env": "7.24.3",
|
|
48
48
|
"@elastic/elasticsearch": "7.12.0",
|
|
49
49
|
"@types/jsonpack": "1.1.2",
|
|
50
|
-
"@webiny/api-dynamodb-to-elasticsearch": "5.40.
|
|
51
|
-
"@webiny/api-i18n": "5.40.
|
|
52
|
-
"@webiny/api-security": "5.40.
|
|
53
|
-
"@webiny/api-tenancy": "5.40.
|
|
54
|
-
"@webiny/api-wcp": "5.40.
|
|
55
|
-
"@webiny/cli": "5.40.
|
|
56
|
-
"@webiny/handler": "5.40.
|
|
57
|
-
"@webiny/handler-aws": "5.40.
|
|
58
|
-
"@webiny/handler-graphql": "5.40.
|
|
59
|
-
"@webiny/project-utils": "5.40.
|
|
60
|
-
"@webiny/tasks": "5.40.
|
|
50
|
+
"@webiny/api-dynamodb-to-elasticsearch": "5.40.5-beta.0",
|
|
51
|
+
"@webiny/api-i18n": "5.40.5-beta.0",
|
|
52
|
+
"@webiny/api-security": "5.40.5-beta.0",
|
|
53
|
+
"@webiny/api-tenancy": "5.40.5-beta.0",
|
|
54
|
+
"@webiny/api-wcp": "5.40.5-beta.0",
|
|
55
|
+
"@webiny/cli": "5.40.5-beta.0",
|
|
56
|
+
"@webiny/handler": "5.40.5-beta.0",
|
|
57
|
+
"@webiny/handler-aws": "5.40.5-beta.0",
|
|
58
|
+
"@webiny/handler-graphql": "5.40.5-beta.0",
|
|
59
|
+
"@webiny/project-utils": "5.40.5-beta.0",
|
|
60
|
+
"@webiny/tasks": "5.40.5-beta.0",
|
|
61
61
|
"jest": "29.7.0",
|
|
62
62
|
"jest-dynalite": "3.6.1",
|
|
63
63
|
"prettier": "2.8.8",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"build": "yarn webiny run build",
|
|
75
75
|
"watch": "yarn webiny run watch"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "f67778732392ed88f28da869ddacbf08a98cdec6"
|
|
78
78
|
}
|