@webiny/api-headless-cms-ddb-es 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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 (385) hide show
  1. package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
  2. package/abstractions/CmsDdbEsDataLoaders.js +5 -0
  3. package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
  4. package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
  5. package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
  6. package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
  7. package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
  8. package/abstractions/CmsDdbEsEntryEntity.js +5 -0
  9. package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
  10. package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
  11. package/abstractions/CmsDdbEsGroupEntity.js +5 -0
  12. package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
  13. package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
  14. package/abstractions/CmsDdbEsModelEntity.js +5 -0
  15. package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
  16. package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
  17. package/abstractions/CmsDdbEsOsTable.js +5 -0
  18. package/abstractions/CmsDdbEsOsTable.js.map +1 -0
  19. package/abstractions/CmsDdbEsTable.d.ts +5 -0
  20. package/abstractions/CmsDdbEsTable.js +5 -0
  21. package/abstractions/CmsDdbEsTable.js.map +1 -0
  22. package/debuggerNamespaces.d.ts +12 -0
  23. package/feature.d.ts +10 -1
  24. package/feature.js +48 -180
  25. package/feature.js.map +1 -1
  26. package/index.d.ts +1 -1
  27. package/index.js +1 -1
  28. package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
  29. package/operations/entry/DdbEsCreateEntry.js +134 -0
  30. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  31. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
  32. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
  33. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  34. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  35. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  36. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  37. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
  38. package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
  39. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  40. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  41. package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
  42. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  43. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  44. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  45. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  46. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  47. package/operations/entry/DdbEsGetEntry.js +27 -0
  48. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  49. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  50. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  51. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  52. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  53. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  54. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  55. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  56. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  57. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  58. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  59. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  60. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  61. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  62. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  63. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  64. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  65. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  66. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  67. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  68. package/operations/entry/DdbEsGetRevisions.js +33 -0
  69. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  70. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
  71. package/operations/entry/DdbEsGetUniqueFieldValues.js +77 -0
  72. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  73. package/operations/entry/DdbEsListEntries.d.ts +28 -0
  74. package/operations/entry/DdbEsListEntries.js +110 -0
  75. package/operations/entry/DdbEsListEntries.js.map +1 -0
  76. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  77. package/operations/entry/DdbEsMoveEntry.js +113 -0
  78. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  79. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  80. package/operations/entry/DdbEsMoveToBin.js +137 -0
  81. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  82. package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
  83. package/operations/entry/DdbEsPublishEntry.js +231 -0
  84. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  85. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  86. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  87. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  88. package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
  89. package/operations/entry/DdbEsUnpublishEntry.js +127 -0
  90. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  91. package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
  92. package/operations/entry/DdbEsUpdateEntry.js +175 -0
  93. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  94. package/operations/entry/dataLoaders.d.ts +5 -5
  95. package/operations/entry/dataLoaders.js +11 -3
  96. package/operations/entry/dataLoaders.js.map +1 -1
  97. package/{features/CmsModelOpenSearchIndex → operations/entry}/feature.d.ts +1 -1
  98. package/operations/entry/feature.js +55 -0
  99. package/operations/entry/feature.js.map +1 -0
  100. package/operations/entry/storageEntryUtils.d.ts +7 -0
  101. package/operations/entry/storageEntryUtils.js +14 -0
  102. package/operations/entry/storageEntryUtils.js.map +1 -0
  103. package/operations/entry/transformations/index.d.ts +2 -3
  104. package/operations/entry/transformations/index.js +1 -1
  105. package/operations/entry/transformations/index.js.map +1 -1
  106. package/operations/entry/transformations/modifyEntryValues.d.ts +1 -1
  107. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  108. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  109. package/operations/group/DdbEsCreateGroup.js +35 -0
  110. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  111. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  112. package/operations/group/DdbEsDeleteGroup.js +31 -0
  113. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  114. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  115. package/operations/group/DdbEsGetGroup.js +31 -0
  116. package/operations/group/DdbEsGetGroup.js.map +1 -0
  117. package/operations/group/DdbEsListGroups.d.ts +14 -0
  118. package/operations/group/DdbEsListGroups.js +52 -0
  119. package/operations/group/DdbEsListGroups.js.map +1 -0
  120. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  121. package/operations/group/DdbEsUpdateGroup.js +35 -0
  122. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  123. package/{features/CmsEntryOpenSearchFilter → operations/group}/feature.d.ts +1 -1
  124. package/operations/group/feature.js +19 -0
  125. package/operations/group/feature.js.map +1 -0
  126. package/operations/group/keys.d.ts +15 -0
  127. package/operations/group/keys.js +17 -0
  128. package/operations/group/keys.js.map +1 -0
  129. package/operations/model/DdbEsCreateModel.d.ts +16 -0
  130. package/operations/model/DdbEsCreateModel.js +56 -0
  131. package/operations/model/DdbEsCreateModel.js.map +1 -0
  132. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  133. package/operations/model/DdbEsDeleteModel.js +31 -0
  134. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  135. package/operations/model/DdbEsGetModel.d.ts +12 -0
  136. package/operations/model/DdbEsGetModel.js +30 -0
  137. package/operations/model/DdbEsGetModel.js.map +1 -0
  138. package/operations/model/DdbEsListModels.d.ts +12 -0
  139. package/operations/model/DdbEsListModels.js +36 -0
  140. package/operations/model/DdbEsListModels.js.map +1 -0
  141. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  142. package/operations/model/DdbEsUpdateModel.js +36 -0
  143. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  144. package/{features/CmsEntryOpenSearchFieldIndex → operations/model}/feature.d.ts +1 -1
  145. package/operations/model/feature.js +19 -0
  146. package/operations/model/feature.js.map +1 -0
  147. package/operations/model/keys.d.ts +15 -0
  148. package/operations/model/keys.js +17 -0
  149. package/operations/model/keys.js.map +1 -0
  150. package/package.json +27 -23
  151. package/registry/CmsEntitiesDbRegistryDecorator.d.ts +27 -0
  152. package/registry/CmsEntitiesDbRegistryDecorator.js +46 -0
  153. package/registry/CmsEntitiesDbRegistryDecorator.js.map +1 -0
  154. package/tasks/CreateElasticsearchIndexTask.d.ts +6 -7
  155. package/tasks/CreateElasticsearchIndexTask.js +14 -12
  156. package/tasks/CreateElasticsearchIndexTask.js.map +1 -1
  157. package/types.d.ts +9 -45
  158. package/types.js.map +1 -1
  159. package/configurations.d.ts +0 -22
  160. package/configurations.js +0 -37
  161. package/configurations.js.map +0 -1
  162. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  163. package/elasticsearch/createElasticsearchIndex.js +0 -45
  164. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  165. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -10
  166. package/elasticsearch/deleteElasticsearchIndex.js +0 -23
  167. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  168. package/exports/api/cms/opensearch.d.ts +0 -9
  169. package/exports/api/cms/opensearch.js +0 -9
  170. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +0 -16
  171. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +0 -5
  172. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +0 -1
  173. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +0 -1
  174. package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -1
  175. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -14
  176. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +0 -42
  177. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
  178. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +0 -32
  179. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +0 -5
  180. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +0 -1
  181. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -11
  182. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +0 -5
  183. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
  184. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +0 -1
  185. package/features/CmsEntryOpenSearchFieldIndex/constants.js +0 -4
  186. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +0 -1
  187. package/features/CmsEntryOpenSearchFieldIndex/feature.js +0 -29
  188. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +0 -1
  189. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +0 -11
  190. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +0 -60
  191. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +0 -1
  192. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +0 -13
  193. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +0 -33
  194. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +0 -1
  195. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +0 -10
  196. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +0 -21
  197. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +0 -1
  198. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +0 -10
  199. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +0 -22
  200. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +0 -1
  201. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +0 -11
  202. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +0 -32
  203. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +0 -1
  204. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +0 -12
  205. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +0 -116
  206. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +0 -1
  207. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +0 -10
  208. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +0 -21
  209. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +0 -1
  210. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +0 -15
  211. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +0 -40
  212. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +0 -1
  213. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +0 -15
  214. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +0 -40
  215. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +0 -1
  216. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +0 -3
  217. package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -3
  218. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +0 -11
  219. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +0 -36
  220. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
  221. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +0 -37
  222. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +0 -5
  223. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +0 -1
  224. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +0 -9
  225. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +0 -5
  226. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
  227. package/features/CmsEntryOpenSearchFilter/constants.d.ts +0 -1
  228. package/features/CmsEntryOpenSearchFilter/constants.js +0 -4
  229. package/features/CmsEntryOpenSearchFilter/constants.js.map +0 -1
  230. package/features/CmsEntryOpenSearchFilter/feature.js +0 -17
  231. package/features/CmsEntryOpenSearchFilter/feature.js.map +0 -1
  232. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +0 -9
  233. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +0 -26
  234. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +0 -1
  235. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +0 -9
  236. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +0 -43
  237. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +0 -1
  238. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +0 -9
  239. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +0 -36
  240. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +0 -1
  241. package/features/CmsEntryOpenSearchFilter/index.d.ts +0 -3
  242. package/features/CmsEntryOpenSearchFilter/index.js +0 -3
  243. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +0 -20
  244. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +0 -5
  245. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +0 -1
  246. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +0 -1
  247. package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -1
  248. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +0 -16
  249. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +0 -5
  250. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +0 -1
  251. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +0 -1
  252. package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -1
  253. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +0 -15
  254. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +0 -5
  255. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +0 -1
  256. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +0 -1
  257. package/features/CmsEntryOpenSearchSortModifier/index.js +0 -1
  258. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -12
  259. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +0 -31
  260. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
  261. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +0 -22
  262. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +0 -5
  263. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +0 -1
  264. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -10
  265. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +0 -5
  266. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
  267. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +0 -4
  268. package/features/CmsEntryOpenSearchValueSearch/feature.js +0 -17
  269. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +0 -1
  270. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +0 -10
  271. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +0 -21
  272. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +0 -1
  273. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +0 -10
  274. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +0 -44
  275. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +0 -1
  276. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +0 -10
  277. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +0 -22
  278. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +0 -1
  279. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +0 -3
  280. package/features/CmsEntryOpenSearchValueSearch/index.js +0 -3
  281. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +0 -23
  282. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +0 -5
  283. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +0 -1
  284. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +0 -1
  285. package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -1
  286. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.d.ts +0 -25
  287. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js +0 -36
  288. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js.map +0 -1
  289. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.d.ts +0 -8
  290. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js +0 -17
  291. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js.map +0 -1
  292. package/features/CmsModelOpenSearchIndex/abstractions.d.ts +0 -20
  293. package/features/CmsModelOpenSearchIndex/abstractions.js +0 -5
  294. package/features/CmsModelOpenSearchIndex/abstractions.js.map +0 -1
  295. package/features/CmsModelOpenSearchIndex/feature.js +0 -13
  296. package/features/CmsModelOpenSearchIndex/feature.js.map +0 -1
  297. package/features/CmsModelOpenSearchIndex/index.d.ts +0 -3
  298. package/features/CmsModelOpenSearchIndex/index.js +0 -3
  299. package/helpers/entryIndexHelpers.d.ts +0 -20
  300. package/helpers/entryIndexHelpers.js +0 -80
  301. package/helpers/entryIndexHelpers.js.map +0 -1
  302. package/helpers/fieldIdentifier.d.ts +0 -6
  303. package/helpers/fieldIdentifier.js +0 -23
  304. package/helpers/fieldIdentifier.js.map +0 -1
  305. package/helpers/index.d.ts +0 -2
  306. package/helpers/index.js +0 -2
  307. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  308. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -9
  309. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  310. package/operations/entry/elasticsearch/body.d.ts +0 -32
  311. package/operations/entry/elasticsearch/body.js +0 -89
  312. package/operations/entry/elasticsearch/body.js.map +0 -1
  313. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +0 -4
  314. package/operations/entry/elasticsearch/fields/createSystemField.js +0 -9
  315. package/operations/entry/elasticsearch/fields/createSystemField.js.map +0 -1
  316. package/operations/entry/elasticsearch/fields/live.d.ts +0 -2
  317. package/operations/entry/elasticsearch/fields/live.js +0 -50
  318. package/operations/entry/elasticsearch/fields/live.js.map +0 -1
  319. package/operations/entry/elasticsearch/fields/location.d.ts +0 -2
  320. package/operations/entry/elasticsearch/fields/location.js +0 -50
  321. package/operations/entry/elasticsearch/fields/location.js.map +0 -1
  322. package/operations/entry/elasticsearch/fields/state.d.ts +0 -2
  323. package/operations/entry/elasticsearch/fields/state.js +0 -104
  324. package/operations/entry/elasticsearch/fields/state.js.map +0 -1
  325. package/operations/entry/elasticsearch/fields.d.ts +0 -12
  326. package/operations/entry/elasticsearch/fields.js +0 -207
  327. package/operations/entry/elasticsearch/fields.js.map +0 -1
  328. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -9
  329. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -39
  330. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  331. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -22
  332. package/operations/entry/elasticsearch/filtering/exec.js +0 -96
  333. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  334. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  335. package/operations/entry/elasticsearch/filtering/index.js +0 -1
  336. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -17
  337. package/operations/entry/elasticsearch/filtering/path.js +0 -27
  338. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  339. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  340. package/operations/entry/elasticsearch/filtering/populated.js +0 -12
  341. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  342. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  343. package/operations/entry/elasticsearch/filtering/values.js +0 -15
  344. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  345. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -13
  346. package/operations/entry/elasticsearch/fullTextSearch.js +0 -53
  347. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  348. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  349. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -10
  350. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  351. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -18
  352. package/operations/entry/elasticsearch/initialQuery.js +0 -43
  353. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  354. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  355. package/operations/entry/elasticsearch/keyword.js +0 -17
  356. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  357. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -7
  358. package/operations/entry/elasticsearch/plugins/operator.js +0 -10
  359. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  360. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  361. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -8
  362. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  363. package/operations/entry/elasticsearch/sort.d.ts +0 -15
  364. package/operations/entry/elasticsearch/sort.js +0 -80
  365. package/operations/entry/elasticsearch/sort.js.map +0 -1
  366. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -9
  367. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -12
  368. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  369. package/operations/entry/elasticsearch/types.d.ts +0 -31
  370. package/operations/entry/index.d.ts +0 -38
  371. package/operations/entry/index.js +0 -1403
  372. package/operations/entry/index.js.map +0 -1
  373. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
  374. package/operations/entry/transformations/transformEntryToIndex.js +0 -20
  375. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  376. package/operations/group/index.d.ts +0 -9
  377. package/operations/group/index.js +0 -121
  378. package/operations/group/index.js.map +0 -1
  379. package/operations/model/index.d.ts +0 -10
  380. package/operations/model/index.js +0 -119
  381. package/operations/model/index.js.map +0 -1
  382. package/values/NoValueContainer.d.ts +0 -5
  383. package/values/NoValueContainer.js +0 -11
  384. package/values/NoValueContainer.js.map +0 -1
  385. /package/{operations/entry/elasticsearch/types.js → debuggerNamespaces.js} +0 -0
@@ -0,0 +1,5 @@
1
+ import type { IDataLoadersHandler } from "../types.js";
2
+ export declare const CmsDdbEsDataLoaders: import("@webiny/di").Abstraction<IDataLoadersHandler>;
3
+ export declare namespace CmsDdbEsDataLoaders {
4
+ type Interface = IDataLoadersHandler;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsDataLoaders = createAbstraction("Cms/DdbEs/DataLoaders");
3
+ export { CmsDdbEsDataLoaders };
4
+
5
+ //# sourceMappingURL=CmsDdbEsDataLoaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsDataLoaders.js","sources":["../../src/abstractions/CmsDdbEsDataLoaders.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IDataLoadersHandler } from \"~/types.js\";\n\nexport const CmsDdbEsDataLoaders = createAbstraction<IDataLoadersHandler>(\"Cms/DdbEs/DataLoaders\");\n\nexport namespace CmsDdbEsDataLoaders {\n export type Interface = IDataLoadersHandler;\n}\n"],"names":["CmsDdbEsDataLoaders","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAuC"}
@@ -0,0 +1,5 @@
1
+ import type { IOpenSearchEntity } from "@webiny/api-opensearch-aws";
2
+ export declare const CmsDdbEsEntriesEsEntity: import("@webiny/di").Abstraction<IOpenSearchEntity>;
3
+ export declare namespace CmsDdbEsEntriesEsEntity {
4
+ type Interface = IOpenSearchEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsEntriesEsEntity = createAbstraction("Cms/DdbEs/EntriesEsEntity");
3
+ export { CmsDdbEsEntriesEsEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsEntriesEsEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsEntriesEsEntity.js","sources":["../../src/abstractions/CmsDdbEsEntriesEsEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IOpenSearchEntity } from \"@webiny/api-opensearch-aws\";\n\nexport const CmsDdbEsEntriesEsEntity = createAbstraction<IOpenSearchEntity>(\n \"Cms/DdbEs/EntriesEsEntity\"\n);\n\nexport namespace CmsDdbEsEntriesEsEntity {\n export type Interface = IOpenSearchEntity;\n}\n"],"names":["CmsDdbEsEntriesEsEntity","createAbstraction"],"mappings":";AAGO,MAAMA,0BAA0BC,kBACnC"}
@@ -0,0 +1,5 @@
1
+ import type { IEntryEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEsEntryEntity: import("@webiny/di").Abstraction<IEntryEntity>;
3
+ export declare namespace CmsDdbEsEntryEntity {
4
+ type Interface = IEntryEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsEntryEntity = createAbstraction("Cms/DdbEs/EntryEntity");
3
+ export { CmsDdbEsEntryEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsEntryEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsEntryEntity.js","sources":["../../src/abstractions/CmsDdbEsEntryEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsEntryEntity = createAbstraction<IEntryEntity>(\"Cms/DdbEs/EntryEntity\");\n\nexport namespace CmsDdbEsEntryEntity {\n export type Interface = IEntryEntity;\n}\n"],"names":["CmsDdbEsEntryEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { IGroupEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEsGroupEntity: import("@webiny/di").Abstraction<IGroupEntity>;
3
+ export declare namespace CmsDdbEsGroupEntity {
4
+ type Interface = IGroupEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsGroupEntity = createAbstraction("Cms/DdbEs/GroupEntity");
3
+ export { CmsDdbEsGroupEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsGroupEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsGroupEntity.js","sources":["../../src/abstractions/CmsDdbEsGroupEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsGroupEntity = createAbstraction<IGroupEntity>(\"Cms/DdbEs/GroupEntity\");\n\nexport namespace CmsDdbEsGroupEntity {\n export type Interface = IGroupEntity;\n}\n"],"names":["CmsDdbEsGroupEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { IModelEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEsModelEntity: import("@webiny/di").Abstraction<IModelEntity>;
3
+ export declare namespace CmsDdbEsModelEntity {
4
+ type Interface = IModelEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsModelEntity = createAbstraction("Cms/DdbEs/ModelEntity");
3
+ export { CmsDdbEsModelEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsModelEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsModelEntity.js","sources":["../../src/abstractions/CmsDdbEsModelEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsModelEntity = createAbstraction<IModelEntity>(\"Cms/DdbEs/ModelEntity\");\n\nexport namespace CmsDdbEsModelEntity {\n export type Interface = IModelEntity;\n}\n"],"names":["CmsDdbEsModelEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { ITable } from "@webiny/db-dynamodb";
2
+ export declare const CmsDdbEsOsTable: import("@webiny/di").Abstraction<ITable<string, string, string>>;
3
+ export declare namespace CmsDdbEsOsTable {
4
+ type Interface = ITable;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsOsTable = createAbstraction("Cms/DdbEs/OsTable");
3
+ export { CmsDdbEsOsTable };
4
+
5
+ //# sourceMappingURL=CmsDdbEsOsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsOsTable.js","sources":["../../src/abstractions/CmsDdbEsOsTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbEsOsTable = createAbstraction<ITable>(\"Cms/DdbEs/OsTable\");\n\nexport namespace CmsDdbEsOsTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbEsOsTable","createAbstraction"],"mappings":";AAGO,MAAMA,kBAAkBC,kBAA0B"}
@@ -0,0 +1,5 @@
1
+ import type { ITable } from "@webiny/db-dynamodb";
2
+ export declare const CmsDdbEsTable: import("@webiny/di").Abstraction<ITable<string, string, string>>;
3
+ export declare namespace CmsDdbEsTable {
4
+ type Interface = ITable;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsTable = createAbstraction("Cms/DdbEs/Table");
3
+ export { CmsDdbEsTable };
4
+
5
+ //# sourceMappingURL=CmsDdbEsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsTable.js","sources":["../../src/abstractions/CmsDdbEsTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbEsTable = createAbstraction<ITable>(\"Cms/DdbEs/Table\");\n\nexport namespace CmsDdbEsTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbEsTable","createAbstraction"],"mappings":";AAGO,MAAMA,gBAAgBC,kBAA0B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Claims the `cms.` debug namespace prefix.
3
+ *
4
+ * The module specifier has to be exactly this one: augmenting a relative path would silently do
5
+ * nothing.
6
+ */
7
+ declare module "@webiny/api-core/features/debugger/abstractions.js" {
8
+ interface DebugNamespaces {
9
+ cms: `cms.${string}`;
10
+ }
11
+ }
12
+ export {};
package/feature.d.ts CHANGED
@@ -1 +1,10 @@
1
- export declare const registerCmsOpenSearchStorageOperations: () => import("@webiny/handler").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>[];
1
+ /**
2
+ * DynamoDB+OpenSearch CMS storage. Register it once, in the root container. Tables and entities are
3
+ * built once per process; the storage operations are transient, and per-request state (the entry
4
+ * DataLoaders, the filter registries, the OpenSearch field indexes and model index cache) is
5
+ * container scoped, so each request (child) container gets its own.
6
+ */
7
+ export declare const HeadlessCmsDdbEsFeature: {
8
+ name: string;
9
+ register(container: import("@webiny/di").Container): void;
10
+ };
package/feature.js CHANGED
@@ -1,201 +1,69 @@
1
1
  import { DynamoDBClient, createTable } from "@webiny/db-dynamodb";
2
- import { StorageOperationsFactory } from "@webiny/api-headless-cms/exports/api/cms/storage.js";
3
2
  import { ENTITIES } from "./types.js";
4
- import { createRegisterExtensionPlugin } from "@webiny/handler";
5
3
  import { createFeature } from "@webiny/feature/api/index.js";
6
- import { CmsEntryOpenSearchValueSearchFeature, CmsEntryOpenSearchValueSearchRegistry } from "./features/CmsEntryOpenSearchValueSearch/index.js";
7
- import { CmsModelOpenSearchIndexFeature, CmsModelOpenSearchIndexProvider } from "./features/CmsModelOpenSearchIndex/index.js";
8
- import { createConfigurations } from "./configurations.js";
9
- import { createModelsStorageOperations } from "./operations/model/index.js";
10
- import { createEntriesStorageOperations } from "./operations/entry/index.js";
11
4
  import { createGroupEntity } from "./definitions/group.js";
12
5
  import { createModelEntity } from "./definitions/model.js";
13
6
  import { createEntryEntity } from "./definitions/entry.js";
14
- import { createElasticsearchIndex } from "./elasticsearch/createElasticsearchIndex.js";
15
- import { createGroupsStorageOperations } from "./operations/group/index.js";
16
- import { createOpenSearchEntity, createOpenSearchTable } from "@webiny/api-opensearch";
17
- import { deleteElasticsearchIndex } from "./elasticsearch/deleteElasticsearchIndex.js";
18
- import { ModelAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentModel/CreateModel/index.js";
19
- import { ModelAfterCreateFromEventHandler } from "@webiny/api-headless-cms/features/contentModel/CreateModelFrom/events.js";
20
- import { ModelAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentModel/DeleteModel/events.js";
21
- import { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
22
- import { CompressionHandler } from "@webiny/utils/exports/api.js";
23
- import { CmsEntryOpenSearchBodyModifier } from "./features/CmsEntryOpenSearchBodyModifier/index.js";
24
- import { CmsEntryOpenSearchSortModifier } from "./features/CmsEntryOpenSearchSortModifier/index.js";
25
- import { CmsEntryOpenSearchQueryModifier } from "./features/CmsEntryOpenSearchQueryModifier/index.js";
26
- import { CmsEntryOpenSearchFullTextSearch } from "./features/CmsEntryOpenSearchFullTextSearch/index.js";
27
- import { CmsEntryOpenSearchValuesModifier } from "./features/CmsEntryOpenSearchValuesModifier/index.js";
28
- import { CmsEntryOpenSearchFieldIndexFeature, CmsEntryOpenSearchFieldIndexRegistry } from "./features/CmsEntryOpenSearchFieldIndex/index.js";
29
- import { CmsEntryOpenSearchFilterFeature, CmsEntryOpenSearchFilterRegistry } from "./features/CmsEntryOpenSearchFilter/index.js";
30
- import { DbRegistry } from "@webiny/db/exports/api/db.js";
31
- import { OpenSearchClient, OpenSearchFieldFactory, OpenSearchQueryBuilderOperatorRegistry } from "@webiny/api-opensearch/exports/api/opensearch.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
+ import { CmsEntryOpenSearchUtilsFeature } from "@webiny/api-headless-cms-utils-os";
16
+ import { FilterRegistriesFeature } from "@webiny/api-headless-cms-storage";
32
17
  import { CreateElasticsearchIndexTask } from "./tasks/CreateElasticsearchIndexTask.js";
33
- const createOpenSearchStorageOperations = (params)=>{
34
- const { table, esTable, elasticsearch, plugins, container } = params;
35
- const db = container.resolve(DynamoDBClient);
36
- const documentClient = db.client;
37
- const tableInstance = createTable({
38
- name: table || process.env.DB_TABLE,
39
- documentClient
40
- });
41
- const tableElasticsearchInstance = createOpenSearchTable({
42
- name: esTable,
43
- documentClient
44
- });
45
- const entities = {
46
- groups: createGroupEntity({
18
+ import { CmsEntitiesDbRegistryDecorator } from "./registry/CmsEntitiesDbRegistryDecorator.js";
19
+ import { DdbEsGroupStorageOpsFeature } from "./operations/group/feature.js";
20
+ import { DdbEsModelStorageOpsFeature } from "./operations/model/feature.js";
21
+ import { DdbEsEntryStorageOpsFeature } from "./operations/entry/feature.js";
22
+ const HeadlessCmsDdbEsFeature = createFeature({
23
+ name: "cms.storageOperations.openSearch",
24
+ register: (container)=>{
25
+ FilterUtilFeature.register(container);
26
+ const db = container.resolve(DynamoDBClient);
27
+ const documentClient = db.client;
28
+ const tableInstance = createTable({
29
+ name: process.env.DB_TABLE,
30
+ documentClient
31
+ });
32
+ const tableElasticsearchInstance = createOpenSearchTable({
33
+ name: process.env.DB_TABLE_OPENSEARCH,
34
+ documentClient
35
+ });
36
+ const groupEntity = createGroupEntity({
47
37
  entityName: ENTITIES.GROUPS,
48
38
  table: tableInstance
49
- }),
50
- models: createModelEntity({
39
+ });
40
+ const modelEntity = createModelEntity({
51
41
  entityName: ENTITIES.MODELS,
52
42
  table: tableInstance
53
- }),
54
- entries: createEntryEntity({
43
+ });
44
+ const entryEntity = createEntryEntity({
55
45
  entityName: ENTITIES.ENTRIES,
56
46
  table: tableInstance
57
- }),
58
- entriesEs: createOpenSearchEntity({
47
+ });
48
+ const entriesEsEntity = createOpenSearchEntity({
59
49
  entityName: ENTITIES.ENTRIES_ES,
60
50
  table: tableElasticsearchInstance
61
- })
62
- };
63
- const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);
64
- const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);
65
- const compressionHandler = container.resolve(CompressionHandler);
66
- const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);
67
- const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);
68
- const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);
69
- const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);
70
- const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);
71
- const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);
72
- const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);
73
- const operatorRegistry = container.resolve(OpenSearchQueryBuilderOperatorRegistry);
74
- const fieldFactory = container.resolve(OpenSearchFieldFactory);
75
- const indexProvider = container.resolve(CmsModelOpenSearchIndexProvider);
76
- const configurations = createConfigurations(indexProvider);
77
- container.registerFactory(ModelAfterCreateEventHandler, ()=>({
78
- async handle (event) {
79
- const { model } = event.payload;
80
- await createElasticsearchIndex({
81
- client: elasticsearch,
82
- configurations,
83
- model
84
- });
85
- }
86
- }));
87
- container.registerFactory(ModelAfterCreateFromEventHandler, ()=>({
88
- async handle (event) {
89
- const { model } = event.payload;
90
- await createElasticsearchIndex({
91
- client: elasticsearch,
92
- configurations,
93
- model
94
- });
95
- }
96
- }));
97
- container.registerFactory(ModelAfterDeleteEventHandler, ()=>({
98
- async handle (event) {
99
- const { model } = event.payload;
100
- await deleteElasticsearchIndex({
101
- client: elasticsearch,
102
- configurations,
103
- model
104
- });
105
- }
106
- }));
107
- const entries = createEntriesStorageOperations({
108
- entity: entities.entries,
109
- esEntity: entities.entriesEs,
110
- plugins,
111
- configurations,
112
- operatorRegistry,
113
- elasticsearch,
114
- fieldRegistry,
115
- fieldIndexRegistry,
116
- compressionHandler,
117
- bodyModifiers,
118
- sortModifiers,
119
- queryModifiers,
120
- valueSearchRegistry,
121
- fullTextSearches,
122
- valuesModifiers,
123
- filterRegistry,
124
- fieldFactory
125
- });
126
- return {
127
- name: "dynamodb:opensearch",
128
- beforeInit: async (context)=>{
129
- const dbRegistry = context.container.resolve(DbRegistry);
130
- dbRegistry.register({
131
- item: entities.entries,
132
- app: "cms",
133
- tags: [
134
- "regular",
135
- entities.entries.name
136
- ]
137
- });
138
- dbRegistry.register({
139
- item: entities.entriesEs,
140
- app: "cms",
141
- tags: [
142
- "es",
143
- entities.entriesEs.name
144
- ]
145
- });
146
- entries.dataLoaders.clearAll();
147
- },
148
- getEntities: ()=>entities,
149
- getTable: ()=>tableInstance,
150
- getEsTable: ()=>tableElasticsearchInstance,
151
- groups: createGroupsStorageOperations({
152
- entity: entities.groups,
153
- container
154
- }),
155
- models: createModelsStorageOperations({
156
- entity: entities.models,
157
- elasticsearch,
158
- configurations
159
- }),
160
- entries
161
- };
162
- };
163
- class OpenSearchStorageOperationsFactoryImpl {
164
- constructor(openSearchClient){
165
- this.openSearchClient = openSearchClient;
166
- }
167
- async create(context) {
168
- return createOpenSearchStorageOperations({
169
- elasticsearch: this.openSearchClient.use(),
170
- plugins: context.plugins,
171
- container: context.container
172
51
  });
173
- }
174
- }
175
- const OpenSearchStorageOperationsFactory = StorageOperationsFactory.createImplementation({
176
- implementation: OpenSearchStorageOperationsFactoryImpl,
177
- dependencies: [
178
- OpenSearchClient
179
- ]
180
- });
181
- const storageOperationsFeature = createFeature({
182
- name: "cms.storageOperations.openSearch",
183
- register: (container)=>{
184
- CmsEntryOpenSearchFieldIndexFeature.register(container);
185
- CmsEntryOpenSearchFilterFeature.register(container);
186
- CmsModelOpenSearchIndexFeature.register(container);
187
- CmsEntryOpenSearchValueSearchFeature.register(container);
52
+ container.registerInstance(CmsDdbEsTable, tableInstance);
53
+ container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);
54
+ container.registerInstance(CmsDdbEsGroupEntity, groupEntity);
55
+ container.registerInstance(CmsDdbEsModelEntity, modelEntity);
56
+ container.registerInstance(CmsDdbEsEntryEntity, entryEntity);
57
+ container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);
58
+ CmsEntryOpenSearchUtilsFeature.register(container);
59
+ FilterRegistriesFeature.register(container);
188
60
  container.register(CreateElasticsearchIndexTask);
189
- container.register(OpenSearchStorageOperationsFactory).inSingletonScope();
61
+ container.registerDecorator(CmsEntitiesDbRegistryDecorator);
62
+ DdbEsGroupStorageOpsFeature.register(container);
63
+ DdbEsModelStorageOpsFeature.register(container);
64
+ DdbEsEntryStorageOpsFeature.register(container);
190
65
  }
191
66
  });
192
- const registerCmsOpenSearchStorageOperations = ()=>{
193
- const plugin = createRegisterExtensionPlugin((context)=>storageOperationsFeature.register(context.container));
194
- plugin.name = "cms.registerOpenSearchStorageOperations";
195
- return [
196
- plugin
197
- ];
198
- };
199
- export { registerCmsOpenSearchStorageOperations };
67
+ export { HeadlessCmsDdbEsFeature };
200
68
 
201
69
  //# sourceMappingURL=feature.js.map
package/feature.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, DynamoDBClient } from \"@webiny/db-dynamodb\";\nimport { StorageOperationsFactory as StorageOperationsFactoryAbstraction } from \"@webiny/api-headless-cms/exports/api/cms/storage.js\";\nimport type { CmsContext, StorageOperationsFactory as IStorageOperationsFactory } from \"~/types.js\";\nimport { ENTITIES } from \"~/types.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport {\n CmsEntryOpenSearchValueSearchFeature,\n CmsEntryOpenSearchValueSearchRegistry\n} from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport {\n CmsModelOpenSearchIndexFeature,\n CmsModelOpenSearchIndexProvider\n} from \"~/features/CmsModelOpenSearchIndex/index.js\";\nimport { createConfigurations } from \"~/configurations.js\";\nimport { createModelsStorageOperations } from \"./operations/model/index.js\";\nimport { createEntriesStorageOperations } from \"./operations/entry/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createElasticsearchIndex } from \"~/elasticsearch/createElasticsearchIndex.js\";\nimport { createGroupsStorageOperations } from \"~/operations/group/index.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch\";\nimport { deleteElasticsearchIndex } from \"./elasticsearch/deleteElasticsearchIndex.js\";\nimport { ModelAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModel/index.js\";\nimport { ModelAfterCreateFromEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModelFrom/events.js\";\nimport { ModelAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentModel/DeleteModel/events.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\nimport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { CmsEntryOpenSearchValuesModifier } from \"~/features/CmsEntryOpenSearchValuesModifier/index.js\";\nimport {\n CmsEntryOpenSearchFieldIndexFeature,\n CmsEntryOpenSearchFieldIndexRegistry\n} from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport {\n CmsEntryOpenSearchFilterFeature,\n CmsEntryOpenSearchFilterRegistry\n} from \"~/features/CmsEntryOpenSearchFilter/index.js\";\nimport { DbRegistry } from \"@webiny/db/exports/api/db.js\";\nimport {\n OpenSearchClient,\n OpenSearchFieldFactory,\n OpenSearchQueryBuilderOperatorRegistry\n} from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport { CreateElasticsearchIndexTask } from \"~/tasks/CreateElasticsearchIndexTask.js\";\n\nconst createOpenSearchStorageOperations: IStorageOperationsFactory = params => {\n const { table, esTable, elasticsearch, plugins, container } = params;\n\n const db = container.resolve(DynamoDBClient);\n const documentClient = db.client;\n\n const tableInstance = createTable({\n name: table || (process.env.DB_TABLE as string),\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: esTable,\n documentClient\n });\n\n const entities = {\n groups: createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n }),\n models: createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n }),\n entries: createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n }),\n entriesEs: createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n })\n };\n\n const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);\n const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);\n const compressionHandler = container.resolve(CompressionHandler);\n const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);\n const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);\n const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);\n const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);\n const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);\n const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);\n const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);\n const operatorRegistry = container.resolve(OpenSearchQueryBuilderOperatorRegistry);\n const fieldFactory = container.resolve(OpenSearchFieldFactory);\n\n const indexProvider = container.resolve(CmsModelOpenSearchIndexProvider);\n const configurations = createConfigurations(indexProvider);\n\n container.registerFactory(ModelAfterCreateEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n configurations,\n model\n });\n }\n }));\n\n container.registerFactory(ModelAfterCreateFromEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n configurations,\n model\n });\n }\n }));\n\n container.registerFactory(ModelAfterDeleteEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await deleteElasticsearchIndex({\n client: elasticsearch,\n configurations,\n model\n });\n }\n }));\n\n const entries = createEntriesStorageOperations({\n entity: entities.entries,\n esEntity: entities.entriesEs,\n plugins,\n configurations,\n operatorRegistry,\n elasticsearch,\n fieldRegistry,\n fieldIndexRegistry,\n compressionHandler,\n bodyModifiers,\n sortModifiers,\n queryModifiers,\n valueSearchRegistry,\n fullTextSearches,\n valuesModifiers,\n filterRegistry,\n fieldFactory\n });\n\n return {\n name: \"dynamodb:opensearch\",\n beforeInit: async context => {\n const dbRegistry = context.container.resolve(DbRegistry);\n\n dbRegistry.register({\n item: entities.entries,\n app: \"cms\",\n tags: [\"regular\", entities.entries.name]\n });\n dbRegistry.register({\n item: entities.entriesEs,\n app: \"cms\",\n tags: [\"es\", entities.entriesEs.name]\n });\n\n entries.dataLoaders.clearAll();\n },\n getEntities: () => entities,\n getTable: () => tableInstance,\n getEsTable: () => tableElasticsearchInstance,\n groups: createGroupsStorageOperations({\n entity: entities.groups,\n container\n }),\n models: createModelsStorageOperations({\n entity: entities.models,\n elasticsearch,\n configurations\n }),\n entries\n };\n};\n\nclass OpenSearchStorageOperationsFactoryImpl\n implements StorageOperationsFactoryAbstraction.Interface\n{\n public constructor(private readonly openSearchClient: OpenSearchClient.Interface) {}\n\n public async create(context: CmsContext) {\n return createOpenSearchStorageOperations({\n elasticsearch: this.openSearchClient.use(),\n plugins: context.plugins,\n container: context.container\n });\n }\n}\n\nconst OpenSearchStorageOperationsFactory = StorageOperationsFactoryAbstraction.createImplementation(\n {\n implementation: OpenSearchStorageOperationsFactoryImpl,\n dependencies: [OpenSearchClient]\n }\n);\n\nconst storageOperationsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n CmsEntryOpenSearchFieldIndexFeature.register(container);\n CmsEntryOpenSearchFilterFeature.register(container);\n CmsModelOpenSearchIndexFeature.register(container);\n CmsEntryOpenSearchValueSearchFeature.register(container);\n container.register(CreateElasticsearchIndexTask);\n container.register(OpenSearchStorageOperationsFactory).inSingletonScope();\n }\n});\n\nexport const registerCmsOpenSearchStorageOperations = () => {\n const plugin = createRegisterExtensionPlugin(context => {\n return storageOperationsFeature.register(context.container);\n });\n\n plugin.name = \"cms.registerOpenSearchStorageOperations\";\n\n return [plugin];\n};\n"],"names":["createOpenSearchStorageOperations","params","table","esTable","elasticsearch","plugins","container","db","DynamoDBClient","documentClient","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","entities","createGroupEntity","ENTITIES","createModelEntity","createEntryEntity","createOpenSearchEntity","fieldRegistry","CmsModelFieldToGraphQLRegistry","fieldIndexRegistry","CmsEntryOpenSearchFieldIndexRegistry","compressionHandler","CompressionHandler","bodyModifiers","CmsEntryOpenSearchBodyModifier","sortModifiers","CmsEntryOpenSearchSortModifier","queryModifiers","CmsEntryOpenSearchQueryModifier","valueSearchRegistry","CmsEntryOpenSearchValueSearchRegistry","fullTextSearches","CmsEntryOpenSearchFullTextSearch","valuesModifiers","CmsEntryOpenSearchValuesModifier","filterRegistry","CmsEntryOpenSearchFilterRegistry","operatorRegistry","OpenSearchQueryBuilderOperatorRegistry","fieldFactory","OpenSearchFieldFactory","indexProvider","CmsModelOpenSearchIndexProvider","configurations","createConfigurations","ModelAfterCreateEventHandler","event","model","createElasticsearchIndex","ModelAfterCreateFromEventHandler","ModelAfterDeleteEventHandler","deleteElasticsearchIndex","entries","createEntriesStorageOperations","context","dbRegistry","DbRegistry","createGroupsStorageOperations","createModelsStorageOperations","OpenSearchStorageOperationsFactoryImpl","openSearchClient","OpenSearchStorageOperationsFactory","StorageOperationsFactoryAbstraction","OpenSearchClient","storageOperationsFeature","createFeature","CmsEntryOpenSearchFieldIndexFeature","CmsEntryOpenSearchFilterFeature","CmsModelOpenSearchIndexFeature","CmsEntryOpenSearchValueSearchFeature","CreateElasticsearchIndexTask","registerCmsOpenSearchStorageOperations","plugin","createRegisterExtensionPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,oCAA+DC,CAAAA;IACjE,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGL;IAE9D,MAAMM,KAAKD,UAAU,OAAO,CAACE;IAC7B,MAAMC,iBAAiBF,GAAG,MAAM;IAEhC,MAAMG,gBAAgBC,YAAY;QAC9B,MAAMT,SAAUU,QAAQ,GAAG,CAAC,QAAQ;QACpCH;IACJ;IACA,MAAMI,6BAA6BC,sBAAsB;QACrD,MAAMX;QACNM;IACJ;IAEA,MAAMM,WAAW;QACb,QAAQC,kBAAkB;YACtB,YAAYC,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,QAAQQ,kBAAkB;YACtB,YAAYD,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,SAASS,kBAAkB;YACvB,YAAYF,SAAS,OAAO;YAC5B,OAAOP;QACX;QACA,WAAWU,uBAAuB;YAC9B,YAAYH,SAAS,UAAU;YAC/B,OAAOJ;QACX;IACJ;IAEA,MAAMQ,gBAAgBf,UAAU,OAAO,CAACgB;IACxC,MAAMC,qBAAqBjB,UAAU,OAAO,CAACkB;IAC7C,MAAMC,qBAAqBnB,UAAU,OAAO,CAACoB;IAC7C,MAAMC,gBAAgBrB,UAAU,UAAU,CAACsB;IAC3C,MAAMC,gBAAgBvB,UAAU,UAAU,CAACwB;IAC3C,MAAMC,iBAAiBzB,UAAU,UAAU,CAAC0B;IAC5C,MAAMC,sBAAsB3B,UAAU,OAAO,CAAC4B;IAC9C,MAAMC,mBAAmB7B,UAAU,UAAU,CAAC8B;IAC9C,MAAMC,kBAAkB/B,UAAU,UAAU,CAACgC;IAC7C,MAAMC,iBAAiBjC,UAAU,OAAO,CAACkC;IACzC,MAAMC,mBAAmBnC,UAAU,OAAO,CAACoC;IAC3C,MAAMC,eAAerC,UAAU,OAAO,CAACsC;IAEvC,MAAMC,gBAAgBvC,UAAU,OAAO,CAACwC;IACxC,MAAMC,iBAAiBC,qBAAqBH;IAE5CvC,UAAU,eAAe,CAAC2C,8BAA8B,IAAO;YAC3D,MAAM,QAAOC,KAAK;gBACd,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;gBAC/B,MAAME,yBAAyB;oBAC3B,QAAQhD;oBACR2C;oBACAI;gBACJ;YACJ;QACJ;IAEA7C,UAAU,eAAe,CAAC+C,kCAAkC,IAAO;YAC/D,MAAM,QAAOH,KAAK;gBACd,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;gBAC/B,MAAME,yBAAyB;oBAC3B,QAAQhD;oBACR2C;oBACAI;gBACJ;YACJ;QACJ;IAEA7C,UAAU,eAAe,CAACgD,8BAA8B,IAAO;YAC3D,MAAM,QAAOJ,KAAK;gBACd,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;gBAC/B,MAAMK,yBAAyB;oBAC3B,QAAQnD;oBACR2C;oBACAI;gBACJ;YACJ;QACJ;IAEA,MAAMK,UAAUC,+BAA+B;QAC3C,QAAQ1C,SAAS,OAAO;QACxB,UAAUA,SAAS,SAAS;QAC5BV;QACA0C;QACAN;QACArC;QACAiB;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAI;IACJ;IAEA,OAAO;QACH,MAAM;QACN,YAAY,OAAMe;YACd,MAAMC,aAAaD,QAAQ,SAAS,CAAC,OAAO,CAACE;YAE7CD,WAAW,QAAQ,CAAC;gBAChB,MAAM5C,SAAS,OAAO;gBACtB,KAAK;gBACL,MAAM;oBAAC;oBAAWA,SAAS,OAAO,CAAC,IAAI;iBAAC;YAC5C;YACA4C,WAAW,QAAQ,CAAC;gBAChB,MAAM5C,SAAS,SAAS;gBACxB,KAAK;gBACL,MAAM;oBAAC;oBAAMA,SAAS,SAAS,CAAC,IAAI;iBAAC;YACzC;YAEAyC,QAAQ,WAAW,CAAC,QAAQ;QAChC;QACA,aAAa,IAAMzC;QACnB,UAAU,IAAML;QAChB,YAAY,IAAMG;QAClB,QAAQgD,8BAA8B;YAClC,QAAQ9C,SAAS,MAAM;YACvBT;QACJ;QACA,QAAQwD,8BAA8B;YAClC,QAAQ/C,SAAS,MAAM;YACvBX;YACA2C;QACJ;QACAS;IACJ;AACJ;AAEA,MAAMO;IAGF,YAAoCC,gBAA4C,CAAE;aAA9CA,gBAAgB,GAAhBA;IAA+C;IAEnF,MAAa,OAAON,OAAmB,EAAE;QACrC,OAAO1D,kCAAkC;YACrC,eAAe,IAAI,CAAC,gBAAgB,CAAC,GAAG;YACxC,SAAS0D,QAAQ,OAAO;YACxB,WAAWA,QAAQ,SAAS;QAChC;IACJ;AACJ;AAEA,MAAMO,qCAAqCC,yBAAAA,oBAAwD,CAC/F;IACI,gBAAgBH;IAChB,cAAc;QAACI;KAAiB;AACpC;AAGJ,MAAMC,2BAA2BC,cAAc;IAC3C,MAAM;IACN,UAAU/D,CAAAA;QACNgE,oCAAoC,QAAQ,CAAChE;QAC7CiE,gCAAgC,QAAQ,CAACjE;QACzCkE,+BAA+B,QAAQ,CAAClE;QACxCmE,qCAAqC,QAAQ,CAACnE;QAC9CA,UAAU,QAAQ,CAACoE;QACnBpE,UAAU,QAAQ,CAAC2D,oCAAoC,gBAAgB;IAC3E;AACJ;AAEO,MAAMU,yCAAyC;IAClD,MAAMC,SAASC,8BAA8BnB,CAAAA,UAClCU,yBAAyB,QAAQ,CAACV,QAAQ,SAAS;IAG9DkB,OAAO,IAAI,GAAG;IAEd,OAAO;QAACA;KAAO;AACnB"}
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\";\nimport { CmsEntryOpenSearchUtilsFeature } from \"@webiny/api-headless-cms-utils-os\";\nimport { FilterRegistriesFeature } from \"@webiny/api-headless-cms-storage\";\nimport { CreateElasticsearchIndexTask } from \"~/tasks/CreateElasticsearchIndexTask.js\";\nimport { CmsEntitiesDbRegistryDecorator } from \"~/registry/CmsEntitiesDbRegistryDecorator.js\";\nimport { DdbEsGroupStorageOpsFeature } from \"~/operations/group/feature.js\";\nimport { DdbEsModelStorageOpsFeature } from \"~/operations/model/feature.js\";\nimport { DdbEsEntryStorageOpsFeature } from \"~/operations/entry/feature.js\";\n\n/**\n * DynamoDB+OpenSearch CMS storage. Register it once, in the root container. Tables and entities are\n * built once per process; the storage operations are transient, and per-request state (the entry\n * DataLoaders, the filter registries, the OpenSearch field indexes and model index cache) is\n * container scoped, so each request (child) container gets its own.\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 CmsEntryOpenSearchUtilsFeature.register(container);\n FilterRegistriesFeature.register(container);\n\n container.register(CreateElasticsearchIndexTask);\n\n // Adds the CMS entities to every request's DbRegistry, for the DDB to OpenSearch sync.\n container.registerDecorator(CmsEntitiesDbRegistryDecorator);\n\n DdbEsGroupStorageOpsFeature.register(container);\n DdbEsModelStorageOpsFeature.register(container);\n DdbEsEntryStorageOpsFeature.register(container);\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","CmsEntryOpenSearchUtilsFeature","FilterRegistriesFeature","CreateElasticsearchIndexTask","CmsEntitiesDbRegistryDecorator","DdbEsGroupStorageOpsFeature","DdbEsModelStorageOpsFeature","DdbEsEntryStorageOpsFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BO,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;QAEpDQ,+BAA+B,QAAQ,CAACzB;QACxC0B,wBAAwB,QAAQ,CAAC1B;QAEjCA,UAAU,QAAQ,CAAC2B;QAGnB3B,UAAU,iBAAiB,CAAC4B;QAE5BC,4BAA4B,QAAQ,CAAC7B;QACrC8B,4BAA4B,QAAQ,CAAC9B;QACrC+B,4BAA4B,QAAQ,CAAC/B;IACzC;AACJ"}
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { registerCmsOpenSearchStorageOperations } from "./feature.js";
1
+ export { HeadlessCmsDdbEsFeature } from "./feature.js";
package/index.js CHANGED
@@ -1 +1 @@
1
- export { registerCmsOpenSearchStorageOperations } from "./feature.js";
1
+ export { HeadlessCmsDdbEsFeature } from "./feature.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