@webiny/api-headless-cms-ddb-es 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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.
Files changed (430) hide show
  1. package/README.md +6 -30
  2. package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
  3. package/abstractions/CmsDdbEsDataLoaders.js +5 -0
  4. package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
  5. package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
  6. package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
  7. package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
  8. package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
  9. package/abstractions/CmsDdbEsEntryEntity.js +5 -0
  10. package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
  11. package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
  12. package/abstractions/CmsDdbEsGroupEntity.js +5 -0
  13. package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
  14. package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
  15. package/abstractions/CmsDdbEsModelEntity.js +5 -0
  16. package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
  17. package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
  18. package/abstractions/CmsDdbEsOsTable.js +5 -0
  19. package/abstractions/CmsDdbEsOsTable.js.map +1 -0
  20. package/abstractions/CmsDdbEsTable.d.ts +5 -0
  21. package/abstractions/CmsDdbEsTable.js +5 -0
  22. package/abstractions/CmsDdbEsTable.js.map +1 -0
  23. package/definitions/entry.d.ts +4 -6
  24. package/definitions/entry.js +8 -179
  25. package/definitions/entry.js.map +1 -1
  26. package/definitions/group.d.ts +6 -7
  27. package/definitions/group.js +8 -63
  28. package/definitions/group.js.map +1 -1
  29. package/definitions/model.d.ts +6 -7
  30. package/definitions/model.js +8 -107
  31. package/definitions/model.js.map +1 -1
  32. package/definitions/types.d.ts +65 -0
  33. package/definitions/types.js +0 -0
  34. package/feature.d.ts +9 -0
  35. package/feature.js +55 -0
  36. package/feature.js.map +1 -0
  37. package/index.d.ts +2 -3
  38. package/index.js +2 -225
  39. package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
  40. package/operations/entry/DdbEsCreateEntry.js +134 -0
  41. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  42. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
  43. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
  44. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  45. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  46. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  47. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  48. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
  49. package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
  50. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  51. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  52. package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
  53. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  54. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  55. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  56. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  57. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  58. package/operations/entry/DdbEsGetEntry.js +27 -0
  59. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  60. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  61. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  62. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  63. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  64. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  65. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  66. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  67. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  68. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  69. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  70. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  71. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  72. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  73. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  74. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  75. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  76. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  77. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  78. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  79. package/operations/entry/DdbEsGetRevisions.js +33 -0
  80. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  81. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
  82. package/operations/entry/DdbEsGetUniqueFieldValues.js +76 -0
  83. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  84. package/operations/entry/DdbEsListEntries.d.ts +25 -0
  85. package/operations/entry/DdbEsListEntries.js +91 -0
  86. package/operations/entry/DdbEsListEntries.js.map +1 -0
  87. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  88. package/operations/entry/DdbEsMoveEntry.js +113 -0
  89. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  90. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  91. package/operations/entry/DdbEsMoveToBin.js +137 -0
  92. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  93. package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
  94. package/operations/entry/DdbEsPublishEntry.js +231 -0
  95. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  96. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  97. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  98. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  99. package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
  100. package/operations/entry/DdbEsUnpublishEntry.js +127 -0
  101. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  102. package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
  103. package/operations/entry/DdbEsUpdateEntry.js +175 -0
  104. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  105. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -2
  106. package/operations/entry/dataLoader/DataLoaderCache.js +21 -35
  107. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  108. package/operations/entry/dataLoader/constants.js +2 -7
  109. package/operations/entry/dataLoader/constants.js.map +1 -1
  110. package/operations/entry/dataLoader/createBatchScheduleFn.js +7 -22
  111. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  112. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  113. package/operations/entry/dataLoader/getAllEntryRevisions.js +20 -41
  114. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  115. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  116. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +30 -48
  117. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  118. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  119. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +30 -48
  120. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  121. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  122. package/operations/entry/dataLoader/getRevisionById.js +36 -58
  123. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  124. package/operations/entry/dataLoader/index.d.ts +3 -3
  125. package/operations/entry/dataLoader/index.js +13 -35
  126. package/operations/entry/dataLoader/index.js.map +1 -1
  127. package/operations/entry/dataLoader/types.d.ts +4 -4
  128. package/operations/entry/dataLoader/types.js +0 -7
  129. package/operations/entry/dataLoaders.d.ts +14 -14
  130. package/operations/entry/dataLoaders.js +92 -110
  131. package/operations/entry/dataLoaders.js.map +1 -1
  132. package/operations/entry/feature.d.ts +4 -0
  133. package/operations/entry/feature.js +53 -0
  134. package/operations/entry/feature.js.map +1 -0
  135. package/operations/entry/keys.d.ts +31 -1
  136. package/operations/entry/keys.js +44 -27
  137. package/operations/entry/keys.js.map +1 -1
  138. package/operations/entry/recordType.js +4 -18
  139. package/operations/entry/recordType.js.map +1 -1
  140. package/operations/entry/storageEntryUtils.d.ts +7 -0
  141. package/operations/entry/storageEntryUtils.js +14 -0
  142. package/operations/entry/storageEntryUtils.js.map +1 -0
  143. package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
  144. package/operations/entry/transformations/convertEntryKeys.js +21 -34
  145. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  146. package/operations/entry/transformations/index.d.ts +21 -18
  147. package/operations/entry/transformations/index.js +87 -123
  148. package/operations/entry/transformations/index.js.map +1 -1
  149. package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
  150. package/operations/entry/transformations/modifyEntryValues.js +12 -24
  151. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  152. package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
  153. package/operations/entry/transformations/transformEntryKeys.js +14 -24
  154. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  155. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  156. package/operations/group/DdbEsCreateGroup.js +35 -0
  157. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  158. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  159. package/operations/group/DdbEsDeleteGroup.js +31 -0
  160. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  161. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  162. package/operations/group/DdbEsGetGroup.js +31 -0
  163. package/operations/group/DdbEsGetGroup.js.map +1 -0
  164. package/operations/group/DdbEsListGroups.d.ts +14 -0
  165. package/operations/group/DdbEsListGroups.js +52 -0
  166. package/operations/group/DdbEsListGroups.js.map +1 -0
  167. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  168. package/operations/group/DdbEsUpdateGroup.js +35 -0
  169. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  170. package/operations/group/feature.d.ts +4 -0
  171. package/operations/group/feature.js +19 -0
  172. package/operations/group/feature.js.map +1 -0
  173. package/operations/group/keys.d.ts +15 -0
  174. package/operations/group/keys.js +17 -0
  175. package/operations/group/keys.js.map +1 -0
  176. package/operations/model/DdbEsCreateModel.d.ts +16 -0
  177. package/operations/model/DdbEsCreateModel.js +56 -0
  178. package/operations/model/DdbEsCreateModel.js.map +1 -0
  179. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  180. package/operations/model/DdbEsDeleteModel.js +31 -0
  181. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  182. package/operations/model/DdbEsGetModel.d.ts +12 -0
  183. package/operations/model/DdbEsGetModel.js +30 -0
  184. package/operations/model/DdbEsGetModel.js.map +1 -0
  185. package/operations/model/DdbEsListModels.d.ts +12 -0
  186. package/operations/model/DdbEsListModels.js +36 -0
  187. package/operations/model/DdbEsListModels.js.map +1 -0
  188. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  189. package/operations/model/DdbEsUpdateModel.js +36 -0
  190. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  191. package/operations/model/feature.d.ts +4 -0
  192. package/operations/model/feature.js +19 -0
  193. package/operations/model/feature.js.map +1 -0
  194. package/operations/model/keys.d.ts +15 -0
  195. package/operations/model/keys.js +17 -0
  196. package/operations/model/keys.js.map +1 -0
  197. package/package.json +40 -36
  198. package/requestFeature.d.ts +20 -0
  199. package/requestFeature.js +54 -0
  200. package/requestFeature.js.map +1 -0
  201. package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
  202. package/tasks/CreateElasticsearchIndexTask.js +40 -0
  203. package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
  204. package/types.d.ts +12 -159
  205. package/types.js +7 -39
  206. package/types.js.map +1 -1
  207. package/configurations.d.ts +0 -19
  208. package/configurations.js +0 -49
  209. package/configurations.js.map +0 -1
  210. package/definitions/entryElasticsearch.d.ts +0 -9
  211. package/definitions/entryElasticsearch.js +0 -41
  212. package/definitions/entryElasticsearch.js.map +0 -1
  213. package/definitions/system.d.ts +0 -9
  214. package/definitions/system.js +0 -42
  215. package/definitions/system.js.map +0 -1
  216. package/definitions/table.d.ts +0 -8
  217. package/definitions/table.js +0 -25
  218. package/definitions/table.js.map +0 -1
  219. package/definitions/tableElasticsearch.d.ts +0 -8
  220. package/definitions/tableElasticsearch.js +0 -25
  221. package/definitions/tableElasticsearch.js.map +0 -1
  222. package/dynamoDb/index.d.ts +0 -3
  223. package/dynamoDb/index.js +0 -16
  224. package/dynamoDb/index.js.map +0 -1
  225. package/dynamoDb/storage/longText.d.ts +0 -10
  226. package/dynamoDb/storage/longText.js +0 -96
  227. package/dynamoDb/storage/longText.js.map +0 -1
  228. package/dynamoDb/storage/richText.d.ts +0 -2
  229. package/dynamoDb/storage/richText.js +0 -59
  230. package/dynamoDb/storage/richText.js.map +0 -1
  231. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  232. package/elasticsearch/createElasticsearchIndex.js +0 -40
  233. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  234. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
  235. package/elasticsearch/deleteElasticsearchIndex.js +0 -38
  236. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  237. package/elasticsearch/index.d.ts +0 -2
  238. package/elasticsearch/index.js +0 -13
  239. package/elasticsearch/index.js.map +0 -1
  240. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  241. package/elasticsearch/indexing/dateTimeIndexing.js +0 -88
  242. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  243. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  244. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -54
  245. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  246. package/elasticsearch/indexing/index.d.ts +0 -2
  247. package/elasticsearch/indexing/index.js +0 -18
  248. package/elasticsearch/indexing/index.js.map +0 -1
  249. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  250. package/elasticsearch/indexing/jsonIndexing.js +0 -28
  251. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  252. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  253. package/elasticsearch/indexing/longTextIndexing.js +0 -42
  254. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  255. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  256. package/elasticsearch/indexing/numberIndexing.js +0 -41
  257. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  258. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  259. package/elasticsearch/indexing/objectIndexing.js +0 -201
  260. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  261. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  262. package/elasticsearch/indexing/richTextIndexing.js +0 -31
  263. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  264. package/elasticsearch/indices/base.d.ts +0 -2
  265. package/elasticsearch/indices/base.js +0 -13
  266. package/elasticsearch/indices/base.js.map +0 -1
  267. package/elasticsearch/indices/index.d.ts +0 -1
  268. package/elasticsearch/indices/index.js +0 -14
  269. package/elasticsearch/indices/index.js.map +0 -1
  270. package/elasticsearch/indices/japanese.d.ts +0 -2
  271. package/elasticsearch/indices/japanese.js +0 -14
  272. package/elasticsearch/indices/japanese.js.map +0 -1
  273. package/elasticsearch/search/index.d.ts +0 -3
  274. package/elasticsearch/search/index.js +0 -13
  275. package/elasticsearch/search/index.js.map +0 -1
  276. package/elasticsearch/search/refSearch.d.ts +0 -2
  277. package/elasticsearch/search/refSearch.js +0 -31
  278. package/elasticsearch/search/refSearch.js.map +0 -1
  279. package/elasticsearch/search/searchableJson.d.ts +0 -2
  280. package/elasticsearch/search/searchableJson.js +0 -60
  281. package/elasticsearch/search/searchableJson.js.map +0 -1
  282. package/elasticsearch/search/timeSearch.d.ts +0 -2
  283. package/elasticsearch/search/timeSearch.js +0 -27
  284. package/elasticsearch/search/timeSearch.js.map +0 -1
  285. package/helpers/entryIndexHelpers.d.ts +0 -18
  286. package/helpers/entryIndexHelpers.js +0 -190
  287. package/helpers/entryIndexHelpers.js.map +0 -1
  288. package/helpers/fieldIdentifier.d.ts +0 -6
  289. package/helpers/fieldIdentifier.js +0 -43
  290. package/helpers/fieldIdentifier.js.map +0 -1
  291. package/helpers/index.d.ts +0 -2
  292. package/helpers/index.js +0 -29
  293. package/helpers/index.js.map +0 -1
  294. package/index.js.map +0 -1
  295. package/operations/entry/dataLoader/types.js.map +0 -1
  296. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  297. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -34
  298. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  299. package/operations/entry/elasticsearch/body.d.ts +0 -13
  300. package/operations/entry/elasticsearch/body.js +0 -142
  301. package/operations/entry/elasticsearch/body.js.map +0 -1
  302. package/operations/entry/elasticsearch/fields.d.ts +0 -10
  303. package/operations/entry/elasticsearch/fields.js +0 -315
  304. package/operations/entry/elasticsearch/fields.js.map +0 -1
  305. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
  306. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -60
  307. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  308. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -17
  309. package/operations/entry/elasticsearch/filtering/exec.js +0 -175
  310. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  311. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  312. package/operations/entry/elasticsearch/filtering/index.js +0 -18
  313. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  314. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -16
  315. package/operations/entry/elasticsearch/filtering/path.js +0 -48
  316. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  317. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  318. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -30
  319. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  320. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  321. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -15
  322. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  323. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  324. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -69
  325. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  326. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  327. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -57
  328. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  329. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  330. package/operations/entry/elasticsearch/filtering/populated.js +0 -25
  331. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  332. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  333. package/operations/entry/elasticsearch/filtering/values.js +0 -24
  334. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  335. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
  336. package/operations/entry/elasticsearch/fullTextSearch.js +0 -91
  337. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  338. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  339. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -27
  340. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  341. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
  342. package/operations/entry/elasticsearch/initialQuery.js +0 -106
  343. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  344. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  345. package/operations/entry/elasticsearch/keyword.js +0 -36
  346. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  347. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
  348. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
  349. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
  350. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  351. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -18
  352. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  353. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -8
  354. package/operations/entry/elasticsearch/plugins/operator.js +0 -39
  355. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  356. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  357. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -18
  358. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  359. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  360. package/operations/entry/elasticsearch/plugins/search.js +0 -26
  361. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  362. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  363. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -18
  364. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  365. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  366. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -13
  367. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  368. package/operations/entry/elasticsearch/sort.d.ts +0 -12
  369. package/operations/entry/elasticsearch/sort.js +0 -89
  370. package/operations/entry/elasticsearch/sort.js.map +0 -1
  371. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
  372. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -32
  373. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  374. package/operations/entry/elasticsearch/types.d.ts +0 -41
  375. package/operations/entry/elasticsearch/types.js +0 -7
  376. package/operations/entry/elasticsearch/types.js.map +0 -1
  377. package/operations/entry/index.d.ts +0 -11
  378. package/operations/entry/index.js +0 -1881
  379. package/operations/entry/index.js.map +0 -1
  380. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
  381. package/operations/entry/transformations/transformEntryToIndex.js +0 -31
  382. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  383. package/operations/group/index.d.ts +0 -8
  384. package/operations/group/index.js +0 -179
  385. package/operations/group/index.js.map +0 -1
  386. package/operations/model/index.d.ts +0 -8
  387. package/operations/model/index.js +0 -183
  388. package/operations/model/index.js.map +0 -1
  389. package/operations/system/index.d.ts +0 -6
  390. package/operations/system/index.js +0 -94
  391. package/operations/system/index.js.map +0 -1
  392. package/operations/system/indexes.d.ts +0 -10
  393. package/operations/system/indexes.js +0 -41
  394. package/operations/system/indexes.js.map +0 -1
  395. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  396. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -52
  397. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  398. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  399. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -21
  400. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  401. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  402. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -27
  403. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  404. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  405. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -13
  406. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  407. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  408. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -40
  409. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  410. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  411. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -21
  412. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  413. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  414. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -21
  415. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  416. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  417. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -50
  418. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  419. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  420. package/plugins/CmsEntryFilterPlugin.js +0 -22
  421. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  422. package/plugins/index.d.ts +0 -8
  423. package/plugins/index.js +0 -95
  424. package/plugins/index.js.map +0 -1
  425. package/tasks/createIndexTaskPlugin.d.ts +0 -2
  426. package/tasks/createIndexTaskPlugin.js +0 -67
  427. package/tasks/createIndexTaskPlugin.js.map +0 -1
  428. package/values/NoValueContainer.d.ts +0 -5
  429. package/values/NoValueContainer.js +0 -20
  430. package/values/NoValueContainer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","tenant","exports"],"sources":["model.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: CreateModelEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n singularApiName: {\n type: \"string\",\n required: true\n },\n pluralApiName: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n icon: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n tags: {\n type: \"list\",\n required: false,\n default: []\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n descriptionFieldId: {\n type: \"string\"\n },\n imageFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDC,aAAa,EAAE;QACXF,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDP,IAAI,EAAE;QACFM,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDE,OAAO,EAAE;QACLH,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDG,eAAe,EAAE;QACbJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,aAAa,EAAE;QACXL,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDK,MAAM,EAAE;QACJN,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDM,KAAK,EAAE;QACHP,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDO,IAAI,EAAE;QACFR,IAAI,EAAE;MACV,CAAC;MACDS,WAAW,EAAE;QACTT,IAAI,EAAE;MACV,CAAC;MACDU,SAAS,EAAE;QACPV,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDU,OAAO,EAAE;QACLX,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDW,SAAS,EAAE;QACPZ,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDY,MAAM,EAAE;QACJb,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDa,MAAM,EAAE;QACJd,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDc,IAAI,EAAE;QACFf,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,KAAK;QACfe,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVjB,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDiB,YAAY,EAAE;QACVlB,IAAI,EAAE;MACV,CAAC;MACDmB,kBAAkB,EAAE;QAChBnB,IAAI,EAAE;MACV,CAAC;MACDoB,YAAY,EAAE;QACVpB,IAAI,EAAE;MACV,CAAC;MACDqB,MAAM,EAAE;QACJrB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACD,IAAIV,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC+B,OAAA,CAAAlC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"definitions/model.js","sources":["../../src/definitions/model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<StorageCmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createModelEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAsC;QACzC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
@@ -0,0 +1,65 @@
1
+ import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
+ import type { GenericRecord } from "@webiny/api/types.js";
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
4
+ export interface IEntryEntityAttributesData {
5
+ tenant: string;
6
+ entryId: string;
7
+ id: string;
8
+ modelId: string;
9
+ /**
10
+ * Revision-level meta fields. 👇
11
+ */
12
+ revisionCreatedOn: string;
13
+ revisionModifiedOn: string | null;
14
+ revisionSavedOn: string;
15
+ revisionDeletedOn: string | null;
16
+ revisionRestoredOn: string | null;
17
+ revisionFirstPublishedOn: string | null;
18
+ revisionLastPublishedOn: string | null;
19
+ revisionCreatedBy: CmsIdentity;
20
+ revisionModifiedBy: CmsIdentity | null;
21
+ revisionSavedBy: CmsIdentity;
22
+ revisionDeletedBy: CmsIdentity | null;
23
+ revisionRestoredBy: CmsIdentity | null;
24
+ revisionFirstPublishedBy: CmsIdentity | null;
25
+ revisionLastPublishedBy: CmsIdentity | null;
26
+ /**
27
+ * Entry-level meta fields. 👇
28
+ */
29
+ createdOn: string;
30
+ modifiedOn: string | null;
31
+ savedOn: string;
32
+ deletedOn: string | null;
33
+ restoredOn: string | null;
34
+ firstPublishedOn: string | null;
35
+ lastPublishedOn: string | null;
36
+ createdBy: CmsIdentity;
37
+ modifiedBy: CmsIdentity | null;
38
+ savedBy: CmsIdentity;
39
+ deletedBy: CmsIdentity | null;
40
+ restoredBy: CmsIdentity | null;
41
+ firstPublishedBy: CmsIdentity | null;
42
+ lastPublishedBy: CmsIdentity | null;
43
+ /**
44
+ * The rest. 👇
45
+ */
46
+ version: number;
47
+ locked: boolean;
48
+ status: CmsEntryStatus;
49
+ location?: ICmsEntryLocation;
50
+ wbyDeleted?: boolean | null;
51
+ binOriginalFolderId?: string;
52
+ values: GenericRecord;
53
+ meta?: GenericRecord;
54
+ system?: ICmsEntrySystem;
55
+ live: ICmsEntryLive | null;
56
+ revisionDescription: string | undefined;
57
+ /**
58
+ * A timestamp of when the entry should be automatically deleted from the database.
59
+ */
60
+ expiresAt: number | null;
61
+ }
62
+ export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
63
+ export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
64
+ export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
65
+ export type IEntryEntity = IEntity<IEntryEntityAttributes>;
File without changes
package/feature.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Root half of the DynamoDB+OpenSearch CMS storage: the table and entity definitions, built once per
3
+ * process. The storage operations and OpenSearch extension points are per request, in
4
+ * `HeadlessCmsDdbEsRequestFeature`.
5
+ */
6
+ export declare const HeadlessCmsDdbEsFeature: {
7
+ name: string;
8
+ register(container: import("@webiny/di").Container): void;
9
+ };
package/feature.js ADDED
@@ -0,0 +1,55 @@
1
+ import { DynamoDBClient, createTable } from "@webiny/db-dynamodb";
2
+ import { ENTITIES } from "./types.js";
3
+ import { createFeature } from "@webiny/feature/api/index.js";
4
+ import { createGroupEntity } from "./definitions/group.js";
5
+ import { createModelEntity } from "./definitions/model.js";
6
+ import { createEntryEntity } from "./definitions/entry.js";
7
+ import { createOpenSearchEntity, createOpenSearchTable } from "@webiny/api-opensearch-aws";
8
+ import { FilterUtilFeature } from "@webiny/db-dynamodb/feature/FilterUtil/feature.js";
9
+ import { CmsDdbEsTable } from "./abstractions/CmsDdbEsTable.js";
10
+ import { CmsDdbEsOsTable } from "./abstractions/CmsDdbEsOsTable.js";
11
+ import { CmsDdbEsGroupEntity } from "./abstractions/CmsDdbEsGroupEntity.js";
12
+ import { CmsDdbEsModelEntity } from "./abstractions/CmsDdbEsModelEntity.js";
13
+ import { CmsDdbEsEntryEntity } from "./abstractions/CmsDdbEsEntryEntity.js";
14
+ import { CmsDdbEsEntriesEsEntity } from "./abstractions/CmsDdbEsEntriesEsEntity.js";
15
+ const HeadlessCmsDdbEsFeature = createFeature({
16
+ name: "cms.storageOperations.openSearch",
17
+ register: (container)=>{
18
+ FilterUtilFeature.register(container);
19
+ const db = container.resolve(DynamoDBClient);
20
+ const documentClient = db.client;
21
+ const tableInstance = createTable({
22
+ name: process.env.DB_TABLE,
23
+ documentClient
24
+ });
25
+ const tableElasticsearchInstance = createOpenSearchTable({
26
+ name: process.env.DB_TABLE_OPENSEARCH,
27
+ documentClient
28
+ });
29
+ const groupEntity = createGroupEntity({
30
+ entityName: ENTITIES.GROUPS,
31
+ table: tableInstance
32
+ });
33
+ const modelEntity = createModelEntity({
34
+ entityName: ENTITIES.MODELS,
35
+ table: tableInstance
36
+ });
37
+ const entryEntity = createEntryEntity({
38
+ entityName: ENTITIES.ENTRIES,
39
+ table: tableInstance
40
+ });
41
+ const entriesEsEntity = createOpenSearchEntity({
42
+ entityName: ENTITIES.ENTRIES_ES,
43
+ table: tableElasticsearchInstance
44
+ });
45
+ container.registerInstance(CmsDdbEsTable, tableInstance);
46
+ container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);
47
+ container.registerInstance(CmsDdbEsGroupEntity, groupEntity);
48
+ container.registerInstance(CmsDdbEsModelEntity, modelEntity);
49
+ container.registerInstance(CmsDdbEsEntryEntity, entryEntity);
50
+ container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);
51
+ }
52
+ });
53
+ export { HeadlessCmsDdbEsFeature };
54
+
55
+ //# sourceMappingURL=feature.js.map
package/feature.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, DynamoDBClient } from \"@webiny/db-dynamodb\";\nimport { ENTITIES } from \"~/types.js\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch-aws\";\nimport { FilterUtilFeature } from \"@webiny/db-dynamodb/feature/FilterUtil/feature.js\";\nimport { CmsDdbEsTable } from \"~/abstractions/CmsDdbEsTable.js\";\nimport { CmsDdbEsOsTable } from \"~/abstractions/CmsDdbEsOsTable.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\n\n/**\n * Root half of the DynamoDB+OpenSearch CMS storage: the table and entity definitions, built once per\n * process. The storage operations and OpenSearch extension points are per request, in\n * `HeadlessCmsDdbEsRequestFeature`.\n */\nexport const HeadlessCmsDdbEsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n FilterUtilFeature.register(container);\n\n const db = container.resolve(DynamoDBClient);\n const documentClient = db.client;\n\n const tableInstance = createTable({\n name: process.env.DB_TABLE as string,\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: process.env.DB_TABLE_OPENSEARCH as string,\n documentClient\n });\n\n const groupEntity = createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n });\n const modelEntity = createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n });\n const entryEntity = createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n });\n const entriesEsEntity = createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n });\n\n // Register infrastructure instances (app-scoped)\n container.registerInstance(CmsDdbEsTable, tableInstance);\n container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);\n container.registerInstance(CmsDdbEsGroupEntity, groupEntity);\n container.registerInstance(CmsDdbEsModelEntity, modelEntity);\n container.registerInstance(CmsDdbEsEntryEntity, entryEntity);\n container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);\n }\n});\n"],"names":["HeadlessCmsDdbEsFeature","createFeature","container","FilterUtilFeature","db","DynamoDBClient","documentClient","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","groupEntity","createGroupEntity","ENTITIES","modelEntity","createModelEntity","entryEntity","createEntryEntity","entriesEsEntity","createOpenSearchEntity","CmsDdbEsTable","CmsDdbEsOsTable","CmsDdbEsGroupEntity","CmsDdbEsModelEntity","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity"],"mappings":";;;;;;;;;;;;;;AAoBO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAAUC,CAAAA;QACNC,kBAAkB,QAAQ,CAACD;QAE3B,MAAME,KAAKF,UAAU,OAAO,CAACG;QAC7B,MAAMC,iBAAiBF,GAAG,MAAM;QAEhC,MAAMG,gBAAgBC,YAAY;YAC9B,MAAMC,QAAQ,GAAG,CAAC,QAAQ;YAC1BH;QACJ;QACA,MAAMI,6BAA6BC,sBAAsB;YACrD,MAAMF,QAAQ,GAAG,CAAC,mBAAmB;YACrCH;QACJ;QAEA,MAAMM,cAAcC,kBAAkB;YAClC,YAAYC,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,MAAMQ,cAAcC,kBAAkB;YAClC,YAAYF,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,MAAMU,cAAcC,kBAAkB;YAClC,YAAYJ,SAAS,OAAO;YAC5B,OAAOP;QACX;QACA,MAAMY,kBAAkBC,uBAAuB;YAC3C,YAAYN,SAAS,UAAU;YAC/B,OAAOJ;QACX;QAGAR,UAAU,gBAAgB,CAACmB,eAAed;QAC1CL,UAAU,gBAAgB,CAACoB,iBAAiBZ;QAC5CR,UAAU,gBAAgB,CAACqB,qBAAqBX;QAChDV,UAAU,gBAAgB,CAACsB,qBAAqBT;QAChDb,UAAU,gBAAgB,CAACuB,qBAAqBR;QAChDf,UAAU,gBAAgB,CAACwB,yBAAyBP;IACxD;AACJ"}
package/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import type { StorageOperationsFactory } from "./types";
2
- export * from "./plugins";
3
- export declare const createStorageOperations: StorageOperationsFactory;
1
+ export { HeadlessCmsDdbEsFeature } from "./feature.js";
2
+ export { HeadlessCmsDdbEsRequestFeature } from "./requestFeature.js";
package/index.js CHANGED
@@ -1,225 +1,2 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- var _exportNames = {
8
- createStorageOperations: true
9
- };
10
- exports.createStorageOperations = void 0;
11
- var _filters = _interopRequireDefault(require("@webiny/db-dynamodb/plugins/filters"));
12
- var _elasticsearch = _interopRequireDefault(require("./elasticsearch"));
13
- var _dynamoDb = _interopRequireDefault(require("./dynamoDb"));
14
- var _system = require("./operations/system");
15
- var _model = require("./operations/model");
16
- var _entry = require("./operations/entry");
17
- var _types = require("./types");
18
- var _table = require("./definitions/table");
19
- var _tableElasticsearch = require("./definitions/tableElasticsearch");
20
- var _group = require("./definitions/group");
21
- var _model2 = require("./definitions/model");
22
- var _entry2 = require("./definitions/entry");
23
- var _entryElasticsearch = require("./definitions/entryElasticsearch");
24
- var _system2 = require("./definitions/system");
25
- var _createElasticsearchIndex = require("./elasticsearch/createElasticsearchIndex");
26
- var _plugins = require("@webiny/plugins");
27
- var _group2 = require("./operations/group");
28
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
29
- var _indices = require("./elasticsearch/indices");
30
- var _deleteElasticsearchIndex = require("./elasticsearch/deleteElasticsearchIndex");
31
- var _plugins2 = require("./plugins");
32
- Object.keys(_plugins2).forEach(function (key) {
33
- if (key === "default" || key === "__esModule") return;
34
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
35
- if (key in exports && exports[key] === _plugins2[key]) return;
36
- Object.defineProperty(exports, key, {
37
- enumerable: true,
38
- get: function () {
39
- return _plugins2[key];
40
- }
41
- });
42
- });
43
- var _plugins3 = require("./operations/entry/elasticsearch/filtering/plugins");
44
- var _CmsEntryFilterPlugin = require("./plugins/CmsEntryFilterPlugin");
45
- var _apiHeadlessCms = require("@webiny/api-headless-cms");
46
- var _indexes = require("./operations/system/indexes");
47
- var _createIndexTaskPlugin = require("./tasks/createIndexTaskPlugin");
48
- var _api = require("@webiny/api");
49
- const createStorageOperations = params => {
50
- const {
51
- attributes,
52
- table,
53
- esTable,
54
- documentClient,
55
- elasticsearch,
56
- plugins: userPlugins
57
- } = params;
58
- const tableInstance = (0, _table.createTable)({
59
- table,
60
- documentClient
61
- });
62
- const tableElasticsearchInstance = (0, _tableElasticsearch.createElasticsearchTable)({
63
- table: esTable,
64
- documentClient
65
- });
66
- const entities = {
67
- system: (0, _system2.createSystemEntity)({
68
- entityName: _types.ENTITIES.SYSTEM,
69
- table: tableInstance,
70
- attributes: attributes ? attributes[_types.ENTITIES.SYSTEM] : {}
71
- }),
72
- groups: (0, _group.createGroupEntity)({
73
- entityName: _types.ENTITIES.GROUPS,
74
- table: tableInstance,
75
- attributes: attributes ? attributes[_types.ENTITIES.GROUPS] : {}
76
- }),
77
- models: (0, _model2.createModelEntity)({
78
- entityName: _types.ENTITIES.MODELS,
79
- table: tableInstance,
80
- attributes: attributes ? attributes[_types.ENTITIES.MODELS] : {}
81
- }),
82
- entries: (0, _entry2.createEntryEntity)({
83
- entityName: _types.ENTITIES.ENTRIES,
84
- table: tableInstance,
85
- attributes: attributes ? attributes[_types.ENTITIES.ENTRIES] : {}
86
- }),
87
- entriesEs: (0, _entryElasticsearch.createEntryElasticsearchEntity)({
88
- entityName: _types.ENTITIES.ENTRIES_ES,
89
- table: tableElasticsearchInstance,
90
- attributes: attributes ? attributes[_types.ENTITIES.ENTRIES_ES] : {}
91
- })
92
- };
93
- const plugins = new _plugins.PluginsContainer([
94
- /**
95
- * DynamoDB filter plugins for the where conditions.
96
- */
97
- (0, _filters.default)(),
98
- /**
99
- * Field plugins for DynamoDB.
100
- */
101
- (0, _dynamoDb.default)(),
102
- /**
103
- * Field plugins for Elasticsearch.
104
- */
105
- (0, _elasticsearch.default)(),
106
- /**
107
- * Built-in Elasticsearch index templates.
108
- */
109
- (0, _indices.elasticsearchIndexPlugins)(),
110
- /**
111
- * Filter plugins used to apply filtering from where conditions to Elasticsearch query.
112
- */
113
- (0, _plugins3.createFilterPlugins)(),
114
- /**
115
- * User defined custom plugins.
116
- * They are at the end because we can then override existing plugins.
117
- */
118
- ...(userPlugins || [])]);
119
- const entries = (0, _entry.createEntriesStorageOperations)({
120
- entity: entities.entries,
121
- esEntity: entities.entriesEs,
122
- plugins,
123
- elasticsearch
124
- });
125
- return {
126
- name: "dynamodb:elasticsearch",
127
- beforeInit: async context => {
128
- context.db.registry.register({
129
- item: entities.entries,
130
- app: "cms",
131
- tags: ["regular", entities.entries.name]
132
- });
133
- context.db.registry.register({
134
- item: entities.entriesEs,
135
- app: "cms",
136
- tags: ["es", entities.entriesEs.name]
137
- });
138
- /**
139
- * Attach the elasticsearch into context if it is not already attached.
140
- */
141
- if (!context.elasticsearch) {
142
- context.elasticsearch = elasticsearch;
143
- }
144
- /**
145
- * Pass the plugins to the parent context.
146
- */
147
- context.plugins.register([(0, _dynamoDb.default)(), (0, _createIndexTaskPlugin.createIndexTaskPluginTest)(), (0, _indices.elasticsearchIndexPlugins)()]);
148
- /**
149
- * We need to fetch all the plugin types in the list from the main container.
150
- * This way we do not need to register plugins in the storage plugins contains.
151
- */
152
- const types = [_apiElasticsearch.ElasticsearchQueryBuilderOperatorPlugin.type,
153
- // Headless CMS
154
- "cms-model-field-to-graphql", _CmsEntryFilterPlugin.CmsEntryFilterPlugin.type, _plugins2.CmsEntryElasticsearchBodyModifierPlugin.type, _plugins2.CmsEntryElasticsearchFullTextSearchPlugin.type, _plugins2.CmsEntryElasticsearchIndexPlugin.type, _plugins2.CmsEntryElasticsearchQueryBuilderValueSearchPlugin.type, _plugins2.CmsEntryElasticsearchQueryModifierPlugin.type, _plugins2.CmsEntryElasticsearchSortModifierPlugin.type, _plugins2.CmsElasticsearchModelFieldPlugin.type, _apiHeadlessCms.StorageOperationsCmsModelPlugin.type, _apiHeadlessCms.StorageTransformPlugin.type, _plugins2.CmsEntryElasticsearchValuesModifier.type, _api.CompressorPlugin.type];
155
- for (const type of types) {
156
- plugins.mergeByType(context.plugins, type);
157
- }
158
- entries.dataLoaders.clearAll();
159
- },
160
- init: async context => {
161
- /**
162
- * We need to create indexes on before model create and on clone (create from).
163
- * Other apps create indexes on locale creation.
164
- */
165
- await (0, _indexes.createElasticsearchIndexesOnLocaleAfterCreate)({
166
- context,
167
- client: elasticsearch,
168
- plugins
169
- });
170
- context.cms.onModelBeforeCreate.subscribe(async ({
171
- model
172
- }) => {
173
- await (0, _createElasticsearchIndex.createElasticsearchIndex)({
174
- client: elasticsearch,
175
- model,
176
- plugins
177
- });
178
- });
179
- context.cms.onModelBeforeCreateFrom.subscribe(async ({
180
- model
181
- }) => {
182
- await (0, _createElasticsearchIndex.createElasticsearchIndex)({
183
- client: elasticsearch,
184
- model,
185
- plugins
186
- });
187
- });
188
- context.cms.onModelAfterDelete.subscribe(async ({
189
- model
190
- }) => {
191
- await (0, _deleteElasticsearchIndex.deleteElasticsearchIndex)({
192
- client: elasticsearch,
193
- model
194
- });
195
- });
196
- context.cms.onModelInitialize.subscribe(async ({
197
- model
198
- }) => {
199
- await (0, _createElasticsearchIndex.createElasticsearchIndex)({
200
- client: elasticsearch,
201
- model,
202
- plugins
203
- });
204
- });
205
- },
206
- getEntities: () => entities,
207
- getTable: () => tableInstance,
208
- getEsTable: () => tableElasticsearchInstance,
209
- system: (0, _system.createSystemStorageOperations)({
210
- entity: entities.system
211
- }),
212
- groups: (0, _group2.createGroupsStorageOperations)({
213
- entity: entities.groups,
214
- plugins
215
- }),
216
- models: (0, _model.createModelsStorageOperations)({
217
- entity: entities.models,
218
- elasticsearch
219
- }),
220
- entries
221
- };
222
- };
223
- exports.createStorageOperations = createStorageOperations;
224
-
225
- //# sourceMappingURL=index.js.map
1
+ export { HeadlessCmsDdbEsFeature } from "./feature.js";
2
+ export { HeadlessCmsDdbEsRequestFeature } from "./requestFeature.js";
@@ -0,0 +1,24 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
3
+ import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
4
+ import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
5
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
6
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
7
+ import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
8
+ import { CompressionHandler } from "@webiny/utils/exports/api.js";
9
+ declare class DdbEsCreateEntryImpl implements CreateEntryStorageOperation.Interface {
10
+ private entity;
11
+ private esEntity;
12
+ private dataLoaders;
13
+ private storageModelProvider;
14
+ private fieldIndexRegistry;
15
+ private compressionHandler;
16
+ private indexProvider;
17
+ private valuesModifiers;
18
+ constructor(entity: CmsDdbEsEntryEntity.Interface, esEntity: CmsDdbEsEntriesEsEntity.Interface, dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, compressionHandler: CompressionHandler.Interface, indexProvider: CmsModelOpenSearchIndexProvider.Interface, valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]);
19
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
20
+ }
21
+ export declare const DdbEsCreateEntry: typeof DdbEsCreateEntryImpl & {
22
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js").ICreateEntryStorageOperation>;
23
+ };
24
+ export {};
@@ -0,0 +1,134 @@
1
+ import error from "@webiny/error";
2
+ import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
3
+ import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
4
+ import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
5
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
6
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
7
+ import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
8
+ import { CompressionHandler } from "@webiny/utils/exports/api.js";
9
+ import { createConfigurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
10
+ import { createTransformer } from "./transformations/index.js";
11
+ import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys } from "./keys.js";
12
+ class DdbEsCreateEntryImpl {
13
+ constructor(entity, esEntity, dataLoaders, storageModelProvider, fieldIndexRegistry, compressionHandler, indexProvider, valuesModifiers){
14
+ this.entity = entity;
15
+ this.esEntity = esEntity;
16
+ this.dataLoaders = dataLoaders;
17
+ this.storageModelProvider = storageModelProvider;
18
+ this.fieldIndexRegistry = fieldIndexRegistry;
19
+ this.compressionHandler = compressionHandler;
20
+ this.indexProvider = indexProvider;
21
+ this.valuesModifiers = valuesModifiers;
22
+ }
23
+ async execute(initialModel, params) {
24
+ const { entry: initialEntry, storageEntry: initialStorageEntry } = params;
25
+ const model = this.storageModelProvider.getModel(initialModel);
26
+ const isPublished = "published" === initialEntry.status;
27
+ const locked = isPublished ? true : initialEntry.locked;
28
+ initialEntry.locked = locked;
29
+ initialStorageEntry.locked = locked;
30
+ const transformer = createTransformer({
31
+ fieldIndexRegistry: this.fieldIndexRegistry,
32
+ model,
33
+ entry: initialEntry,
34
+ storageEntry: initialStorageEntry,
35
+ compressionHandler: this.compressionHandler,
36
+ valuesModifiers: this.valuesModifiers
37
+ });
38
+ const { entry, storageEntry } = transformer.transformEntryKeys();
39
+ const esEntry = transformer.transformToIndex();
40
+ const configurations = createConfigurations(this.indexProvider);
41
+ const { index: esIndex } = await configurations.es({
42
+ model
43
+ });
44
+ const revisionKeys = createEntryRevisionKeys(entry);
45
+ const latestKeys = createEntryLatestKeys(entry);
46
+ const publishedKeys = createEntryPublishedKeys(entry);
47
+ const entityBatch = this.entity.createEntityWriter({
48
+ put: [
49
+ {
50
+ ...revisionKeys,
51
+ data: {
52
+ ...storageEntry,
53
+ locked
54
+ }
55
+ },
56
+ {
57
+ ...latestKeys,
58
+ data: {
59
+ ...storageEntry,
60
+ locked
61
+ }
62
+ }
63
+ ]
64
+ });
65
+ if (isPublished) entityBatch.put({
66
+ ...publishedKeys,
67
+ data: {
68
+ ...storageEntry,
69
+ locked
70
+ }
71
+ });
72
+ try {
73
+ await entityBatch.execute();
74
+ this.dataLoaders.clearAll({
75
+ tenant: entry.tenant
76
+ });
77
+ } catch (ex) {
78
+ throw new error(ex.message || "Could not insert entry data into the DynamoDB table.", ex.code || "CREATE_ENTRY_ERROR", {
79
+ error: ex,
80
+ entry,
81
+ storageEntry
82
+ });
83
+ }
84
+ const esLatestData = await transformer.getElasticsearchLatestEntryData();
85
+ const elasticsearchEntityBatch = this.esEntity.createEntityWriter({
86
+ put: [
87
+ {
88
+ ...latestKeys,
89
+ index: esIndex,
90
+ data: esLatestData
91
+ }
92
+ ]
93
+ });
94
+ if (isPublished) {
95
+ const esPublishedData = await transformer.getElasticsearchPublishedEntryData();
96
+ elasticsearchEntityBatch.put({
97
+ ...publishedKeys,
98
+ index: esIndex,
99
+ data: esPublishedData
100
+ });
101
+ }
102
+ try {
103
+ await elasticsearchEntityBatch.execute();
104
+ } catch (ex) {
105
+ throw new error(ex.message || "Could not insert entry data into the Elasticsearch DynamoDB table.", ex.code || "CREATE_ES_ENTRY_ERROR", {
106
+ error: ex,
107
+ entry,
108
+ esEntry
109
+ });
110
+ }
111
+ return initialStorageEntry;
112
+ }
113
+ }
114
+ const DdbEsCreateEntry = CreateEntryStorageOperation.createImplementation({
115
+ implementation: DdbEsCreateEntryImpl,
116
+ dependencies: [
117
+ CmsDdbEsEntryEntity,
118
+ CmsDdbEsEntriesEsEntity,
119
+ CmsDdbEsDataLoaders,
120
+ CmsStorageModelProvider,
121
+ CmsEntryOpenSearchFieldIndexRegistry,
122
+ CompressionHandler,
123
+ CmsModelOpenSearchIndexProvider,
124
+ [
125
+ CmsEntryOpenSearchValuesModifier,
126
+ {
127
+ multiple: true
128
+ }
129
+ ]
130
+ ]
131
+ });
132
+ export { DdbEsCreateEntry };
133
+
134
+ //# sourceMappingURL=DdbEsCreateEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsCreateEntry.js","sources":["../../../src/operations/entry/DdbEsCreateEntry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsCreateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { CreateEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport {\n CmsEntryOpenSearchFieldIndexRegistry,\n CmsEntryOpenSearchValuesModifier,\n CmsModelOpenSearchIndexProvider\n} from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\nimport { createConfigurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { createTransformer } from \"./transformations/index.js\";\nimport {\n createEntryLatestKeys,\n createEntryPublishedKeys,\n createEntryRevisionKeys\n} from \"./keys.js\";\n\nclass DdbEsCreateEntryImpl implements CreateEntryStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEsEntryEntity.Interface,\n private esEntity: CmsDdbEsEntriesEsEntity.Interface,\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface,\n private compressionHandler: CompressionHandler.Interface,\n private indexProvider: CmsModelOpenSearchIndexProvider.Interface,\n private valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsCreateParams<T>\n ) {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n\n const model = this.storageModelProvider.getModel<T>(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<T>({\n fieldIndexRegistry: this.fieldIndexRegistry,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry,\n compressionHandler: this.compressionHandler,\n valuesModifiers: this.valuesModifiers\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const esEntry = transformer.transformToIndex();\n\n const configurations = createConfigurations(this.indexProvider);\n const { index: esIndex } = await configurations.es({\n model\n });\n\n const revisionKeys = createEntryRevisionKeys(entry);\n const latestKeys = createEntryLatestKeys(entry);\n const publishedKeys = createEntryPublishedKeys(entry);\n\n const entityBatch = this.entity.createEntityWriter({\n put: [\n {\n ...revisionKeys,\n data: {\n ...storageEntry,\n locked\n }\n },\n {\n ...latestKeys,\n data: {\n ...storageEntry,\n locked\n }\n }\n ]\n });\n\n if (isPublished) {\n entityBatch.put({\n ...publishedKeys,\n data: {\n ...storageEntry,\n locked\n }\n });\n }\n\n try {\n await entityBatch.execute();\n this.dataLoaders.clearAll({\n tenant: entry.tenant\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\n const elasticsearchEntityBatch = this.esEntity.createEntityWriter({\n put: [\n {\n ...latestKeys,\n index: esIndex,\n data: esLatestData\n }\n ]\n });\n\n if (isPublished) {\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n elasticsearchEntityBatch.put({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n });\n }\n\n try {\n await elasticsearchEntityBatch.execute();\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\nexport const DdbEsCreateEntry = CreateEntryStorageOperation.createImplementation({\n implementation: DdbEsCreateEntryImpl,\n dependencies: [\n CmsDdbEsEntryEntity,\n CmsDdbEsEntriesEsEntity,\n CmsDdbEsDataLoaders,\n CmsStorageModelProvider,\n CmsEntryOpenSearchFieldIndexRegistry,\n CompressionHandler,\n CmsModelOpenSearchIndexProvider,\n [CmsEntryOpenSearchValuesModifier, { multiple: true }]\n ]\n});\n"],"names":["DdbEsCreateEntryImpl","entity","esEntity","dataLoaders","storageModelProvider","fieldIndexRegistry","compressionHandler","indexProvider","valuesModifiers","initialModel","params","initialEntry","initialStorageEntry","model","isPublished","locked","transformer","createTransformer","entry","storageEntry","esEntry","configurations","createConfigurations","esIndex","revisionKeys","createEntryRevisionKeys","latestKeys","createEntryLatestKeys","publishedKeys","createEntryPublishedKeys","entityBatch","ex","WebinyError","esLatestData","elasticsearchEntityBatch","esPublishedData","DdbEsCreateEntry","CreateEntryStorageOperation","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity","CmsDdbEsDataLoaders","CmsStorageModelProvider","CmsEntryOpenSearchFieldIndexRegistry","CompressionHandler","CmsModelOpenSearchIndexProvider","CmsEntryOpenSearchValuesModifier"],"mappings":";;;;;;;;;;;AAyBA,MAAMA;IACF,YACYC,MAAqC,EACrCC,QAA2C,EAC3CC,WAA0C,EAC1CC,oBAAuD,EACvDC,kBAAkE,EAClEC,kBAAgD,EAChDC,aAAwD,EACxDC,eAA6D,CACvE;aARUP,MAAM,GAANA;aACAC,QAAQ,GAARA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,kBAAkB,GAAlBA;aACAC,kBAAkB,GAAlBA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAgD,EAClD;QACE,MAAM,EAAE,OAAOC,YAAY,EAAE,cAAcC,mBAAmB,EAAE,GAAGF;QAEnE,MAAMG,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIJ;QAEpD,MAAMK,cAAcH,AAAwB,gBAAxBA,aAAa,MAAM;QACvC,MAAMI,SAASD,cAAc,OAAOH,aAAa,MAAM;QAEvDA,aAAa,MAAM,GAAGI;QACtBH,oBAAoB,MAAM,GAAGG;QAE7B,MAAMC,cAAcC,kBAAqB;YACrC,oBAAoB,IAAI,CAAC,kBAAkB;YAC3CJ;YACA,OAAOF;YACP,cAAcC;YACd,oBAAoB,IAAI,CAAC,kBAAkB;YAC3C,iBAAiB,IAAI,CAAC,eAAe;QACzC;QAEA,MAAM,EAAEM,KAAK,EAAEC,YAAY,EAAE,GAAGH,YAAY,kBAAkB;QAE9D,MAAMI,UAAUJ,YAAY,gBAAgB;QAE5C,MAAMK,iBAAiBC,qBAAqB,IAAI,CAAC,aAAa;QAC9D,MAAM,EAAE,OAAOC,OAAO,EAAE,GAAG,MAAMF,eAAe,EAAE,CAAC;YAC/CR;QACJ;QAEA,MAAMW,eAAeC,wBAAwBP;QAC7C,MAAMQ,aAAaC,sBAAsBT;QACzC,MAAMU,gBAAgBC,yBAAyBX;QAE/C,MAAMY,cAAc,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC/C,KAAK;gBACD;oBACI,GAAGN,YAAY;oBACf,MAAM;wBACF,GAAGL,YAAY;wBACfJ;oBACJ;gBACJ;gBACA;oBACI,GAAGW,UAAU;oBACb,MAAM;wBACF,GAAGP,YAAY;wBACfJ;oBACJ;gBACJ;aACH;QACL;QAEA,IAAID,aACAgB,YAAY,GAAG,CAAC;YACZ,GAAGF,aAAa;YAChB,MAAM;gBACF,GAAGT,YAAY;gBACfJ;YACJ;QACJ;QAGJ,IAAI;YACA,MAAMe,YAAY,OAAO;YACzB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;gBACtB,QAAQZ,MAAM,MAAM;YACxB;QACJ,EAAE,OAAOa,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,wDACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPb;gBACAC;YACJ;QAER;QAEA,MAAMc,eAAe,MAAMjB,YAAY,+BAA+B;QAEtE,MAAMkB,2BAA2B,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC9D,KAAK;gBACD;oBACI,GAAGR,UAAU;oBACb,OAAOH;oBACP,MAAMU;gBACV;aACH;QACL;QAEA,IAAInB,aAAa;YACb,MAAMqB,kBAAkB,MAAMnB,YAAY,kCAAkC;YAC5EkB,yBAAyB,GAAG,CAAC;gBACzB,GAAGN,aAAa;gBAChB,OAAOL;gBACP,MAAMY;YACV;QACJ;QAEA,IAAI;YACA,MAAMD,yBAAyB,OAAO;QAC1C,EAAE,OAAOH,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,sEACdA,GAAG,IAAI,IAAI,yBACX;gBACI,OAAOA;gBACPb;gBACAE;YACJ;QAER;QAEA,OAAOR;IACX;AACJ;AAEO,MAAMwB,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBrC;IAChB,cAAc;QACVsC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACA;YAACC;YAAkC;gBAAE,UAAU;YAAK;SAAE;KACzD;AACL"}
@@ -0,0 +1,24 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateRevisionFromParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { CreateEntryRevisionFromStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js";
3
+ import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
4
+ import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
5
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
6
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
7
+ import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
8
+ import { CompressionHandler } from "@webiny/utils/exports/api.js";
9
+ declare class DdbEsCreateEntryRevisionFromImpl implements CreateEntryRevisionFromStorageOperation.Interface {
10
+ private entity;
11
+ private esEntity;
12
+ private dataLoaders;
13
+ private storageModelProvider;
14
+ private fieldIndexRegistry;
15
+ private compressionHandler;
16
+ private indexProvider;
17
+ private valuesModifiers;
18
+ constructor(entity: CmsDdbEsEntryEntity.Interface, esEntity: CmsDdbEsEntriesEsEntity.Interface, dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, compressionHandler: CompressionHandler.Interface, indexProvider: CmsModelOpenSearchIndexProvider.Interface, valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]);
19
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
20
+ }
21
+ export declare const DdbEsCreateEntryRevisionFrom: typeof DdbEsCreateEntryRevisionFromImpl & {
22
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js").ICreateEntryRevisionFromStorageOperation>;
23
+ };
24
+ export {};