@webiny/api-headless-cms-ddb-es 6.4.11 → 6.6.0-alpha.1

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 (384) 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/feature.d.ts +4 -1
  23. package/feature.js +60 -158
  24. package/feature.js.map +1 -1
  25. package/index.d.ts +1 -1
  26. package/index.js +1 -1
  27. package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
  28. package/operations/entry/DdbEsCreateEntry.js +134 -0
  29. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  30. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
  31. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
  32. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  33. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  34. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  35. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  36. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
  37. package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
  38. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  39. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  40. package/operations/entry/DdbEsDeleteMultipleEntries.js +77 -0
  41. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  42. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  43. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  44. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  45. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  46. package/operations/entry/DdbEsGetEntry.js +27 -0
  47. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  48. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  49. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  50. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  51. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  52. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  53. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  54. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  55. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  56. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  57. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  58. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  59. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  60. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  61. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  62. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  63. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  64. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  65. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  66. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  67. package/operations/entry/DdbEsGetRevisions.js +33 -0
  68. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  69. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
  70. package/operations/entry/DdbEsGetUniqueFieldValues.js +76 -0
  71. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  72. package/operations/entry/DdbEsListEntries.d.ts +25 -0
  73. package/operations/entry/DdbEsListEntries.js +91 -0
  74. package/operations/entry/DdbEsListEntries.js.map +1 -0
  75. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  76. package/operations/entry/DdbEsMoveEntry.js +113 -0
  77. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  78. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  79. package/operations/entry/DdbEsMoveToBin.js +137 -0
  80. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  81. package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
  82. package/operations/entry/DdbEsPublishEntry.js +231 -0
  83. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  84. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  85. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  86. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  87. package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
  88. package/operations/entry/DdbEsUnpublishEntry.js +127 -0
  89. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  90. package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
  91. package/operations/entry/DdbEsUpdateEntry.js +175 -0
  92. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  93. package/operations/entry/dataLoaders.d.ts +5 -5
  94. package/operations/entry/dataLoaders.js +11 -3
  95. package/operations/entry/dataLoaders.js.map +1 -1
  96. package/{features/CmsModelOpenSearchIndex → operations/entry}/feature.d.ts +1 -1
  97. package/operations/entry/feature.js +55 -0
  98. package/operations/entry/feature.js.map +1 -0
  99. package/operations/entry/storageEntryUtils.d.ts +7 -0
  100. package/operations/entry/storageEntryUtils.js +14 -0
  101. package/operations/entry/storageEntryUtils.js.map +1 -0
  102. package/operations/entry/transformations/index.d.ts +2 -3
  103. package/operations/entry/transformations/index.js +1 -1
  104. package/operations/entry/transformations/index.js.map +1 -1
  105. package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
  106. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  107. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  108. package/operations/group/DdbEsCreateGroup.js +35 -0
  109. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  110. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  111. package/operations/group/DdbEsDeleteGroup.js +31 -0
  112. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  113. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  114. package/operations/group/DdbEsGetGroup.js +31 -0
  115. package/operations/group/DdbEsGetGroup.js.map +1 -0
  116. package/operations/group/DdbEsListGroups.d.ts +14 -0
  117. package/operations/group/DdbEsListGroups.js +52 -0
  118. package/operations/group/DdbEsListGroups.js.map +1 -0
  119. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  120. package/operations/group/DdbEsUpdateGroup.js +35 -0
  121. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  122. package/{features/CmsEntryOpenSearchFilter → operations/group}/feature.d.ts +1 -1
  123. package/operations/group/feature.js +19 -0
  124. package/operations/group/feature.js.map +1 -0
  125. package/operations/group/keys.d.ts +15 -0
  126. package/operations/group/keys.js +17 -0
  127. package/operations/group/keys.js.map +1 -0
  128. package/operations/model/DdbEsCreateModel.d.ts +16 -0
  129. package/operations/model/DdbEsCreateModel.js +56 -0
  130. package/operations/model/DdbEsCreateModel.js.map +1 -0
  131. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  132. package/operations/model/DdbEsDeleteModel.js +31 -0
  133. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  134. package/operations/model/DdbEsGetModel.d.ts +12 -0
  135. package/operations/model/DdbEsGetModel.js +30 -0
  136. package/operations/model/DdbEsGetModel.js.map +1 -0
  137. package/operations/model/DdbEsListModels.d.ts +12 -0
  138. package/operations/model/DdbEsListModels.js +36 -0
  139. package/operations/model/DdbEsListModels.js.map +1 -0
  140. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  141. package/operations/model/DdbEsUpdateModel.js +36 -0
  142. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  143. package/{features/CmsEntryOpenSearchFieldIndex → operations/model}/feature.d.ts +1 -1
  144. package/operations/model/feature.js +19 -0
  145. package/operations/model/feature.js.map +1 -0
  146. package/operations/model/keys.d.ts +15 -0
  147. package/operations/model/keys.js +17 -0
  148. package/operations/model/keys.js.map +1 -0
  149. package/package.json +28 -24
  150. package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
  151. package/tasks/CreateElasticsearchIndexTask.js +40 -0
  152. package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
  153. package/types.d.ts +10 -49
  154. package/types.js.map +1 -1
  155. package/configurations.d.ts +0 -22
  156. package/configurations.js +0 -37
  157. package/configurations.js.map +0 -1
  158. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  159. package/elasticsearch/createElasticsearchIndex.js +0 -45
  160. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  161. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -10
  162. package/elasticsearch/deleteElasticsearchIndex.js +0 -23
  163. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  164. package/exports/api/cms/opensearch.d.ts +0 -9
  165. package/exports/api/cms/opensearch.js +0 -9
  166. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +0 -16
  167. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +0 -5
  168. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +0 -1
  169. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +0 -1
  170. package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -1
  171. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -14
  172. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +0 -42
  173. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
  174. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +0 -32
  175. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +0 -5
  176. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +0 -1
  177. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -11
  178. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +0 -5
  179. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
  180. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +0 -1
  181. package/features/CmsEntryOpenSearchFieldIndex/constants.js +0 -4
  182. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +0 -1
  183. package/features/CmsEntryOpenSearchFieldIndex/feature.js +0 -29
  184. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +0 -1
  185. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +0 -11
  186. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +0 -60
  187. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +0 -1
  188. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +0 -13
  189. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +0 -33
  190. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +0 -1
  191. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +0 -10
  192. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +0 -21
  193. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +0 -1
  194. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +0 -10
  195. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +0 -22
  196. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +0 -1
  197. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +0 -11
  198. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +0 -32
  199. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +0 -1
  200. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +0 -12
  201. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +0 -107
  202. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +0 -1
  203. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +0 -10
  204. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +0 -21
  205. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +0 -1
  206. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +0 -15
  207. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +0 -40
  208. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +0 -1
  209. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +0 -15
  210. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +0 -40
  211. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +0 -1
  212. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +0 -3
  213. package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -3
  214. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +0 -11
  215. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +0 -36
  216. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
  217. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +0 -37
  218. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +0 -5
  219. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +0 -1
  220. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +0 -9
  221. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +0 -5
  222. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
  223. package/features/CmsEntryOpenSearchFilter/constants.d.ts +0 -1
  224. package/features/CmsEntryOpenSearchFilter/constants.js +0 -4
  225. package/features/CmsEntryOpenSearchFilter/constants.js.map +0 -1
  226. package/features/CmsEntryOpenSearchFilter/feature.js +0 -17
  227. package/features/CmsEntryOpenSearchFilter/feature.js.map +0 -1
  228. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +0 -9
  229. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +0 -26
  230. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +0 -1
  231. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +0 -9
  232. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +0 -43
  233. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +0 -1
  234. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +0 -9
  235. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +0 -36
  236. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +0 -1
  237. package/features/CmsEntryOpenSearchFilter/index.d.ts +0 -3
  238. package/features/CmsEntryOpenSearchFilter/index.js +0 -3
  239. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +0 -20
  240. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +0 -5
  241. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +0 -1
  242. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +0 -1
  243. package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -1
  244. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +0 -16
  245. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +0 -5
  246. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +0 -1
  247. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +0 -1
  248. package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -1
  249. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +0 -15
  250. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +0 -5
  251. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +0 -1
  252. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +0 -1
  253. package/features/CmsEntryOpenSearchSortModifier/index.js +0 -1
  254. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -12
  255. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +0 -31
  256. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
  257. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +0 -22
  258. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +0 -5
  259. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +0 -1
  260. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -10
  261. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +0 -5
  262. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
  263. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +0 -4
  264. package/features/CmsEntryOpenSearchValueSearch/feature.js +0 -17
  265. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +0 -1
  266. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +0 -10
  267. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +0 -21
  268. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +0 -1
  269. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +0 -10
  270. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +0 -44
  271. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +0 -1
  272. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +0 -10
  273. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +0 -22
  274. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +0 -1
  275. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +0 -3
  276. package/features/CmsEntryOpenSearchValueSearch/index.js +0 -3
  277. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +0 -23
  278. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +0 -5
  279. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +0 -1
  280. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +0 -1
  281. package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -1
  282. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.d.ts +0 -25
  283. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js +0 -36
  284. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js.map +0 -1
  285. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.d.ts +0 -8
  286. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js +0 -17
  287. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js.map +0 -1
  288. package/features/CmsModelOpenSearchIndex/abstractions.d.ts +0 -20
  289. package/features/CmsModelOpenSearchIndex/abstractions.js +0 -5
  290. package/features/CmsModelOpenSearchIndex/abstractions.js.map +0 -1
  291. package/features/CmsModelOpenSearchIndex/feature.js +0 -13
  292. package/features/CmsModelOpenSearchIndex/feature.js.map +0 -1
  293. package/features/CmsModelOpenSearchIndex/index.d.ts +0 -3
  294. package/features/CmsModelOpenSearchIndex/index.js +0 -3
  295. package/helpers/entryIndexHelpers.d.ts +0 -20
  296. package/helpers/entryIndexHelpers.js +0 -80
  297. package/helpers/entryIndexHelpers.js.map +0 -1
  298. package/helpers/fieldIdentifier.d.ts +0 -6
  299. package/helpers/fieldIdentifier.js +0 -23
  300. package/helpers/fieldIdentifier.js.map +0 -1
  301. package/helpers/index.d.ts +0 -2
  302. package/helpers/index.js +0 -2
  303. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  304. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -9
  305. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  306. package/operations/entry/elasticsearch/body.d.ts +0 -30
  307. package/operations/entry/elasticsearch/body.js +0 -88
  308. package/operations/entry/elasticsearch/body.js.map +0 -1
  309. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +0 -4
  310. package/operations/entry/elasticsearch/fields/createSystemField.js +0 -9
  311. package/operations/entry/elasticsearch/fields/createSystemField.js.map +0 -1
  312. package/operations/entry/elasticsearch/fields/live.d.ts +0 -2
  313. package/operations/entry/elasticsearch/fields/live.js +0 -50
  314. package/operations/entry/elasticsearch/fields/live.js.map +0 -1
  315. package/operations/entry/elasticsearch/fields/location.d.ts +0 -2
  316. package/operations/entry/elasticsearch/fields/location.js +0 -50
  317. package/operations/entry/elasticsearch/fields/location.js.map +0 -1
  318. package/operations/entry/elasticsearch/fields/state.d.ts +0 -2
  319. package/operations/entry/elasticsearch/fields/state.js +0 -104
  320. package/operations/entry/elasticsearch/fields/state.js.map +0 -1
  321. package/operations/entry/elasticsearch/fields.d.ts +0 -12
  322. package/operations/entry/elasticsearch/fields.js +0 -207
  323. package/operations/entry/elasticsearch/fields.js.map +0 -1
  324. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -9
  325. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -39
  326. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  327. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -22
  328. package/operations/entry/elasticsearch/filtering/exec.js +0 -96
  329. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  330. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  331. package/operations/entry/elasticsearch/filtering/index.js +0 -1
  332. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -17
  333. package/operations/entry/elasticsearch/filtering/path.js +0 -27
  334. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  335. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  336. package/operations/entry/elasticsearch/filtering/populated.js +0 -12
  337. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  338. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  339. package/operations/entry/elasticsearch/filtering/values.js +0 -15
  340. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  341. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -13
  342. package/operations/entry/elasticsearch/fullTextSearch.js +0 -53
  343. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  344. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  345. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -10
  346. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  347. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -18
  348. package/operations/entry/elasticsearch/initialQuery.js +0 -43
  349. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  350. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  351. package/operations/entry/elasticsearch/keyword.js +0 -17
  352. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  353. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -7
  354. package/operations/entry/elasticsearch/plugins/operator.js +0 -13
  355. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  356. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  357. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -8
  358. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  359. package/operations/entry/elasticsearch/sort.d.ts +0 -12
  360. package/operations/entry/elasticsearch/sort.js +0 -80
  361. package/operations/entry/elasticsearch/sort.js.map +0 -1
  362. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -9
  363. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -12
  364. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  365. package/operations/entry/elasticsearch/types.d.ts +0 -34
  366. package/operations/entry/elasticsearch/types.js +0 -0
  367. package/operations/entry/index.d.ts +0 -34
  368. package/operations/entry/index.js +0 -1366
  369. package/operations/entry/index.js.map +0 -1
  370. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
  371. package/operations/entry/transformations/transformEntryToIndex.js +0 -20
  372. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  373. package/operations/group/index.d.ts +0 -9
  374. package/operations/group/index.js +0 -121
  375. package/operations/group/index.js.map +0 -1
  376. package/operations/model/index.d.ts +0 -10
  377. package/operations/model/index.js +0 -119
  378. package/operations/model/index.js.map +0 -1
  379. package/tasks/createIndexTaskPlugin.d.ts +0 -2
  380. package/tasks/createIndexTaskPlugin.js +0 -42
  381. package/tasks/createIndexTaskPlugin.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
@@ -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"}
package/feature.d.ts CHANGED
@@ -1 +1,4 @@
1
- export declare const registerCmsOpenSearchStorageOperations: () => import("@webiny/handler").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>[];
1
+ export declare const HeadlessCmsDdbEsFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
package/feature.js CHANGED
@@ -1,185 +1,87 @@
1
- import { createTable, registerExtension } from "@webiny/db-dynamodb";
2
- import { StorageOperationsFactory } from "@webiny/api-headless-cms/exports/api/cms/storage.js";
1
+ import { DynamoDBClient, createTable } from "@webiny/db-dynamodb";
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";
4
+ import { CmsEntryOpenSearchUtilsFeature } from "@webiny/api-headless-cms-utils-os";
11
5
  import { createGroupEntity } from "./definitions/group.js";
12
6
  import { createModelEntity } from "./definitions/model.js";
13
7
  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 { createCreateIndexTask } from "./tasks/createIndexTaskPlugin.js";
19
- import { ModelAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentModel/CreateModel/index.js";
20
- import { ModelAfterCreateFromEventHandler } from "@webiny/api-headless-cms/features/contentModel/CreateModelFrom/events.js";
21
- import { ModelAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentModel/DeleteModel/events.js";
22
- import { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
23
- import { CompressionHandler } from "@webiny/utils/exports/api.js";
24
- import { CmsEntryOpenSearchBodyModifier } from "./features/CmsEntryOpenSearchBodyModifier/index.js";
25
- import { CmsEntryOpenSearchSortModifier } from "./features/CmsEntryOpenSearchSortModifier/index.js";
26
- import { CmsEntryOpenSearchQueryModifier } from "./features/CmsEntryOpenSearchQueryModifier/index.js";
27
- import { CmsEntryOpenSearchFullTextSearch } from "./features/CmsEntryOpenSearchFullTextSearch/index.js";
28
- import { CmsEntryOpenSearchValuesModifier } from "./features/CmsEntryOpenSearchValuesModifier/index.js";
29
- import { CmsEntryOpenSearchFieldIndexFeature, CmsEntryOpenSearchFieldIndexRegistry } from "./features/CmsEntryOpenSearchFieldIndex/index.js";
30
- import { CmsEntryOpenSearchFilterFeature, CmsEntryOpenSearchFilterRegistry } from "./features/CmsEntryOpenSearchFilter/index.js";
31
- const createOpenSearchStorageOperations = (params)=>{
32
- const { table, esTable, documentClient, elasticsearch, plugins, container } = params;
33
- const tableInstance = createTable({
34
- name: table || process.env.DB_TABLE,
35
- documentClient
36
- });
37
- const tableElasticsearchInstance = createOpenSearchTable({
38
- name: esTable,
39
- documentClient
40
- });
41
- const entities = {
42
- groups: createGroupEntity({
8
+ import { createOpenSearchEntity, createOpenSearchTable } from "@webiny/api-opensearch-aws";
9
+ import { CreateElasticsearchIndexTask } from "./tasks/CreateElasticsearchIndexTask.js";
10
+ import { FilterRegistriesFeature } from "@webiny/api-headless-cms-storage";
11
+ import { FilterUtilFeature } from "@webiny/db-dynamodb/feature/FilterUtil/feature.js";
12
+ import { DbRegistry } from "@webiny/db/exports/api/db.js";
13
+ import { CmsDdbEsTable } from "./abstractions/CmsDdbEsTable.js";
14
+ import { CmsDdbEsOsTable } from "./abstractions/CmsDdbEsOsTable.js";
15
+ import { CmsDdbEsGroupEntity } from "./abstractions/CmsDdbEsGroupEntity.js";
16
+ import { CmsDdbEsModelEntity } from "./abstractions/CmsDdbEsModelEntity.js";
17
+ import { CmsDdbEsEntryEntity } from "./abstractions/CmsDdbEsEntryEntity.js";
18
+ import { CmsDdbEsEntriesEsEntity } from "./abstractions/CmsDdbEsEntriesEsEntity.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
+ CmsEntryOpenSearchUtilsFeature.register(container);
26
+ FilterRegistriesFeature.register(container);
27
+ FilterUtilFeature.register(container);
28
+ container.register(CreateElasticsearchIndexTask);
29
+ const db = container.resolve(DynamoDBClient);
30
+ const documentClient = db.client;
31
+ const tableInstance = createTable({
32
+ name: process.env.DB_TABLE,
33
+ documentClient
34
+ });
35
+ const tableElasticsearchInstance = createOpenSearchTable({
36
+ name: process.env.DB_TABLE_OPENSEARCH,
37
+ documentClient
38
+ });
39
+ const groupEntity = createGroupEntity({
43
40
  entityName: ENTITIES.GROUPS,
44
41
  table: tableInstance
45
- }),
46
- models: createModelEntity({
42
+ });
43
+ const modelEntity = createModelEntity({
47
44
  entityName: ENTITIES.MODELS,
48
45
  table: tableInstance
49
- }),
50
- entries: createEntryEntity({
46
+ });
47
+ const entryEntity = createEntryEntity({
51
48
  entityName: ENTITIES.ENTRIES,
52
49
  table: tableInstance
53
- }),
54
- entriesEs: createOpenSearchEntity({
50
+ });
51
+ const entriesEsEntity = createOpenSearchEntity({
55
52
  entityName: ENTITIES.ENTRIES_ES,
56
53
  table: tableElasticsearchInstance
57
- })
58
- };
59
- const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);
60
- const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);
61
- const compressionHandler = container.resolve(CompressionHandler);
62
- const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);
63
- const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);
64
- const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);
65
- const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);
66
- const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);
67
- const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);
68
- const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);
69
- const indexProvider = container.resolve(CmsModelOpenSearchIndexProvider);
70
- const configurations = createConfigurations(indexProvider);
71
- container.registerFactory(ModelAfterCreateEventHandler, ()=>({
72
- async handle (event) {
73
- const { model } = event.payload;
74
- await createElasticsearchIndex({
75
- client: elasticsearch,
76
- configurations,
77
- model
78
- });
79
- }
80
- }));
81
- container.registerFactory(ModelAfterCreateFromEventHandler, ()=>({
82
- async handle (event) {
83
- const { model } = event.payload;
84
- await createElasticsearchIndex({
85
- client: elasticsearch,
86
- configurations,
87
- model
88
- });
89
- }
90
- }));
91
- container.registerFactory(ModelAfterDeleteEventHandler, ()=>({
92
- async handle (event) {
93
- const { model } = event.payload;
94
- await deleteElasticsearchIndex({
95
- client: elasticsearch,
96
- configurations,
97
- model
98
- });
99
- }
100
- }));
101
- const entries = createEntriesStorageOperations({
102
- entity: entities.entries,
103
- esEntity: entities.entriesEs,
104
- plugins,
105
- elasticsearch,
106
- configurations,
107
- fieldRegistry,
108
- fieldIndexRegistry,
109
- compressionHandler,
110
- bodyModifiers,
111
- sortModifiers,
112
- queryModifiers,
113
- valueSearchRegistry,
114
- fullTextSearches,
115
- valuesModifiers,
116
- filterRegistry
117
- });
118
- return {
119
- name: "dynamodb:opensearch",
120
- beforeInit: async (context)=>{
121
- context.db.registry.register({
122
- item: entities.entries,
54
+ });
55
+ container.registerInstance(CmsDdbEsTable, tableInstance);
56
+ container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);
57
+ container.registerInstance(CmsDdbEsGroupEntity, groupEntity);
58
+ container.registerInstance(CmsDdbEsModelEntity, modelEntity);
59
+ container.registerInstance(CmsDdbEsEntryEntity, entryEntity);
60
+ container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);
61
+ try {
62
+ const dbRegistry = container.resolve(DbRegistry);
63
+ dbRegistry.register({
64
+ item: entryEntity,
123
65
  app: "cms",
124
66
  tags: [
125
67
  "regular",
126
- entities.entries.name
68
+ entryEntity.name
127
69
  ]
128
70
  });
129
- context.db.registry.register({
130
- item: entities.entriesEs,
71
+ dbRegistry.register({
72
+ item: entriesEsEntity,
131
73
  app: "cms",
132
74
  tags: [
133
75
  "es",
134
- entities.entriesEs.name
76
+ entriesEsEntity.name
135
77
  ]
136
78
  });
137
- createCreateIndexTask(context);
138
- entries.dataLoaders.clearAll();
139
- },
140
- getEntities: ()=>entities,
141
- getTable: ()=>tableInstance,
142
- getEsTable: ()=>tableElasticsearchInstance,
143
- groups: createGroupsStorageOperations({
144
- entity: entities.groups,
145
- container
146
- }),
147
- models: createModelsStorageOperations({
148
- entity: entities.models,
149
- elasticsearch,
150
- configurations
151
- }),
152
- entries
153
- };
154
- };
155
- class OpenSearchStorageOperationsFactoryImpl {
156
- async create(context) {
157
- return createOpenSearchStorageOperations({
158
- documentClient: context.db.driver.getClient(),
159
- elasticsearch: context.opensearch,
160
- plugins: context.plugins,
161
- container: context.container
162
- });
163
- }
164
- }
165
- const OpenSearchStorageOperationsFactory = StorageOperationsFactory.createImplementation({
166
- implementation: OpenSearchStorageOperationsFactoryImpl,
167
- dependencies: []
168
- });
169
- const storageOperationsFeature = createFeature({
170
- name: "cms.storageOperations.openSearch",
171
- register: (container)=>{
172
- CmsEntryOpenSearchFieldIndexFeature.register(container);
173
- CmsEntryOpenSearchFilterFeature.register(container);
174
- CmsModelOpenSearchIndexFeature.register(container);
175
- CmsEntryOpenSearchValueSearchFeature.register(container);
176
- container.register(OpenSearchStorageOperationsFactory).inSingletonScope();
79
+ } catch {}
80
+ DdbEsGroupStorageOpsFeature.register(container);
81
+ DdbEsModelStorageOpsFeature.register(container);
82
+ DdbEsEntryStorageOpsFeature.register(container);
177
83
  }
178
84
  });
179
- const registerCmsOpenSearchStorageOperations = ()=>[
180
- registerExtension(),
181
- createRegisterExtensionPlugin((context)=>storageOperationsFeature.register(context.container))
182
- ];
183
- export { registerCmsOpenSearchStorageOperations };
85
+ export { HeadlessCmsDdbEsFeature };
184
86
 
185
87
  //# sourceMappingURL=feature.js.map
package/feature.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, registerExtension as registerDynamoDbExtension } 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 type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.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 { createCreateIndexTask } from \"~/tasks/createIndexTaskPlugin.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\";\n\nconst createOpenSearchStorageOperations: IStorageOperationsFactory = params => {\n const { table, esTable, documentClient, elasticsearch, plugins, container } = params;\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\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 elasticsearch,\n configurations,\n fieldRegistry,\n fieldIndexRegistry,\n compressionHandler,\n bodyModifiers,\n sortModifiers,\n queryModifiers,\n valueSearchRegistry,\n fullTextSearches,\n valuesModifiers,\n filterRegistry\n });\n\n return {\n name: \"dynamodb:opensearch\",\n beforeInit: async context => {\n context.db.registry.register({\n item: entities.entries,\n app: \"cms\",\n tags: [\"regular\", entities.entries.name]\n });\n context.db.registry.register({\n item: entities.entriesEs,\n app: \"cms\",\n tags: [\"es\", entities.entriesEs.name]\n });\n // TODO we know that context is ok, but types are missing elasticsearch/opensearch\n // @ts-expect-error\n createCreateIndexTask(context);\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 async create(context: CmsContext) {\n return createOpenSearchStorageOperations({\n documentClient: context.db.driver.getClient() as DynamoDBDocument,\n elasticsearch: context.opensearch,\n plugins: context.plugins,\n container: context.container\n });\n }\n}\n\nconst OpenSearchStorageOperationsFactory = StorageOperationsFactoryAbstraction.createImplementation(\n {\n implementation: OpenSearchStorageOperationsFactoryImpl,\n dependencies: []\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(OpenSearchStorageOperationsFactory).inSingletonScope();\n }\n});\n\nexport const registerCmsOpenSearchStorageOperations = () => {\n return [\n registerDynamoDbExtension(),\n createRegisterExtensionPlugin(context => {\n return storageOperationsFeature.register(context.container);\n })\n ];\n};\n"],"names":["createOpenSearchStorageOperations","params","table","esTable","documentClient","elasticsearch","plugins","container","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","indexProvider","CmsModelOpenSearchIndexProvider","configurations","createConfigurations","ModelAfterCreateEventHandler","event","model","createElasticsearchIndex","ModelAfterCreateFromEventHandler","ModelAfterDeleteEventHandler","deleteElasticsearchIndex","entries","createEntriesStorageOperations","context","createCreateIndexTask","createGroupsStorageOperations","createModelsStorageOperations","OpenSearchStorageOperationsFactoryImpl","OpenSearchStorageOperationsFactory","StorageOperationsFactoryAbstraction","storageOperationsFeature","createFeature","CmsEntryOpenSearchFieldIndexFeature","CmsEntryOpenSearchFilterFeature","CmsModelOpenSearchIndexFeature","CmsEntryOpenSearchValueSearchFeature","registerCmsOpenSearchStorageOperations","registerDynamoDbExtension","createRegisterExtensionPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAMA,oCAA+DC,CAAAA;IACjE,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,cAAc,EAAEC,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGN;IAE9E,MAAMO,gBAAgBC,YAAY;QAC9B,MAAMP,SAAUQ,QAAQ,GAAG,CAAC,QAAQ;QACpCN;IACJ;IACA,MAAMO,6BAA6BC,sBAAsB;QACrD,MAAMT;QACNC;IACJ;IAEA,MAAMS,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,gBAAgBZ,UAAU,OAAO,CAACa;IACxC,MAAMC,qBAAqBd,UAAU,OAAO,CAACe;IAC7C,MAAMC,qBAAqBhB,UAAU,OAAO,CAACiB;IAC7C,MAAMC,gBAAgBlB,UAAU,UAAU,CAACmB;IAC3C,MAAMC,gBAAgBpB,UAAU,UAAU,CAACqB;IAC3C,MAAMC,iBAAiBtB,UAAU,UAAU,CAACuB;IAC5C,MAAMC,sBAAsBxB,UAAU,OAAO,CAACyB;IAC9C,MAAMC,mBAAmB1B,UAAU,UAAU,CAAC2B;IAC9C,MAAMC,kBAAkB5B,UAAU,UAAU,CAAC6B;IAC7C,MAAMC,iBAAiB9B,UAAU,OAAO,CAAC+B;IAEzC,MAAMC,gBAAgBhC,UAAU,OAAO,CAACiC;IACxC,MAAMC,iBAAiBC,qBAAqBH;IAE5ChC,UAAU,eAAe,CAACoC,8BAA8B,IAAO;YAC3D,MAAM,QAAOC,KAAK;gBACd,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;gBAC/B,MAAME,yBAAyB;oBAC3B,QAAQzC;oBACRoC;oBACAI;gBACJ;YACJ;QACJ;IAEAtC,UAAU,eAAe,CAACwC,kCAAkC,IAAO;YAC/D,MAAM,QAAOH,KAAK;gBACd,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;gBAC/B,MAAME,yBAAyB;oBAC3B,QAAQzC;oBACRoC;oBACAI;gBACJ;YACJ;QACJ;IAEAtC,UAAU,eAAe,CAACyC,8BAA8B,IAAO;YAC3D,MAAM,QAAOJ,KAAK;gBACd,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;gBAC/B,MAAMK,yBAAyB;oBAC3B,QAAQ5C;oBACRoC;oBACAI;gBACJ;YACJ;QACJ;IAEA,MAAMK,UAAUC,+BAA+B;QAC3C,QAAQtC,SAAS,OAAO;QACxB,UAAUA,SAAS,SAAS;QAC5BP;QACAD;QACAoC;QACAtB;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;IACJ;IAEA,OAAO;QACH,MAAM;QACN,YAAY,OAAMe;YACdA,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBACzB,MAAMvC,SAAS,OAAO;gBACtB,KAAK;gBACL,MAAM;oBAAC;oBAAWA,SAAS,OAAO,CAAC,IAAI;iBAAC;YAC5C;YACAuC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBACzB,MAAMvC,SAAS,SAAS;gBACxB,KAAK;gBACL,MAAM;oBAAC;oBAAMA,SAAS,SAAS,CAAC,IAAI;iBAAC;YACzC;YAGAwC,sBAAsBD;YAEtBF,QAAQ,WAAW,CAAC,QAAQ;QAChC;QACA,aAAa,IAAMrC;QACnB,UAAU,IAAML;QAChB,YAAY,IAAMG;QAClB,QAAQ2C,8BAA8B;YAClC,QAAQzC,SAAS,MAAM;YACvBN;QACJ;QACA,QAAQgD,8BAA8B;YAClC,QAAQ1C,SAAS,MAAM;YACvBR;YACAoC;QACJ;QACAS;IACJ;AACJ;AAEA,MAAMM;IAGF,MAAa,OAAOJ,OAAmB,EAAE;QACrC,OAAOpD,kCAAkC;YACrC,gBAAgBoD,QAAQ,EAAE,CAAC,MAAM,CAAC,SAAS;YAC3C,eAAeA,QAAQ,UAAU;YACjC,SAASA,QAAQ,OAAO;YACxB,WAAWA,QAAQ,SAAS;QAChC;IACJ;AACJ;AAEA,MAAMK,qCAAqCC,yBAAAA,oBAAwD,CAC/F;IACI,gBAAgBF;IAChB,cAAc,EAAE;AACpB;AAGJ,MAAMG,2BAA2BC,cAAc;IAC3C,MAAM;IACN,UAAUrD,CAAAA;QACNsD,oCAAoC,QAAQ,CAACtD;QAC7CuD,gCAAgC,QAAQ,CAACvD;QACzCwD,+BAA+B,QAAQ,CAACxD;QACxCyD,qCAAqC,QAAQ,CAACzD;QAC9CA,UAAU,QAAQ,CAACkD,oCAAoC,gBAAgB;IAC3E;AACJ;AAEO,MAAMQ,yCAAyC,IAC3C;QACHC;QACAC,8BAA8Bf,CAAAA,UACnBO,yBAAyB,QAAQ,CAACP,QAAQ,SAAS;KAEjE"}
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 { CmsEntryOpenSearchUtilsFeature } from \"@webiny/api-headless-cms-utils-os\";\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 { CreateElasticsearchIndexTask } from \"~/tasks/CreateElasticsearchIndexTask.js\";\nimport { FilterRegistriesFeature } from \"@webiny/api-headless-cms-storage\";\nimport { FilterUtilFeature } from \"@webiny/db-dynamodb/feature/FilterUtil/feature.js\";\nimport { DbRegistry } from \"@webiny/db/exports/api/db.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 { DdbEsGroupStorageOpsFeature } from \"~/operations/group/feature.js\";\nimport { DdbEsModelStorageOpsFeature } from \"~/operations/model/feature.js\";\nimport { DdbEsEntryStorageOpsFeature } from \"~/operations/entry/feature.js\";\n\nexport const HeadlessCmsDdbEsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n CmsEntryOpenSearchUtilsFeature.register(container);\n FilterRegistriesFeature.register(container);\n FilterUtilFeature.register(container);\n\n container.register(CreateElasticsearchIndexTask);\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 // Register entities in DbRegistry (optional — may not be available in all contexts)\n try {\n const dbRegistry = container.resolve(DbRegistry);\n dbRegistry.register({\n item: entryEntity,\n app: \"cms\",\n tags: [\"regular\", entryEntity.name]\n });\n dbRegistry.register({\n item: entriesEsEntity,\n app: \"cms\",\n tags: [\"es\", entriesEsEntity.name]\n });\n } catch {\n // DbRegistry not registered — skip entity registration\n }\n\n DdbEsGroupStorageOpsFeature.register(container);\n DdbEsModelStorageOpsFeature.register(container);\n DdbEsEntryStorageOpsFeature.register(container);\n }\n});\n"],"names":["HeadlessCmsDdbEsFeature","createFeature","container","CmsEntryOpenSearchUtilsFeature","FilterRegistriesFeature","FilterUtilFeature","CreateElasticsearchIndexTask","db","DynamoDBClient","documentClient","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","groupEntity","createGroupEntity","ENTITIES","modelEntity","createModelEntity","entryEntity","createEntryEntity","entriesEsEntity","createOpenSearchEntity","CmsDdbEsTable","CmsDdbEsOsTable","CmsDdbEsGroupEntity","CmsDdbEsModelEntity","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity","dbRegistry","DbRegistry","DdbEsGroupStorageOpsFeature","DdbEsModelStorageOpsFeature","DdbEsEntryStorageOpsFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAAUC,CAAAA;QACNC,+BAA+B,QAAQ,CAACD;QACxCE,wBAAwB,QAAQ,CAACF;QACjCG,kBAAkB,QAAQ,CAACH;QAE3BA,UAAU,QAAQ,CAACI;QAEnB,MAAMC,KAAKL,UAAU,OAAO,CAACM;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;QAGAX,UAAU,gBAAgB,CAACsB,eAAed;QAC1CR,UAAU,gBAAgB,CAACuB,iBAAiBZ;QAC5CX,UAAU,gBAAgB,CAACwB,qBAAqBX;QAChDb,UAAU,gBAAgB,CAACyB,qBAAqBT;QAChDhB,UAAU,gBAAgB,CAAC0B,qBAAqBR;QAChDlB,UAAU,gBAAgB,CAAC2B,yBAAyBP;QAGpD,IAAI;YACA,MAAMQ,aAAa5B,UAAU,OAAO,CAAC6B;YACrCD,WAAW,QAAQ,CAAC;gBAChB,MAAMV;gBACN,KAAK;gBACL,MAAM;oBAAC;oBAAWA,YAAY,IAAI;iBAAC;YACvC;YACAU,WAAW,QAAQ,CAAC;gBAChB,MAAMR;gBACN,KAAK;gBACL,MAAM;oBAAC;oBAAMA,gBAAgB,IAAI;iBAAC;YACtC;QACJ,EAAE,OAAM,CAER;QAEAU,4BAA4B,QAAQ,CAAC9B;QACrC+B,4BAA4B,QAAQ,CAAC/B;QACrCgC,4BAA4B,QAAQ,CAAChC;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