@webiny/api-headless-cms-ddb-es 6.4.5 → 6.6.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +59 -157
  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 +23 -0
  28. package/operations/entry/DdbEsCreateEntry.js +131 -0
  29. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  30. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +23 -0
  31. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +136 -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 +23 -0
  37. package/operations/entry/DdbEsDeleteEntryRevision.js +133 -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 +17 -0
  70. package/operations/entry/DdbEsGetUniqueFieldValues.js +73 -0
  71. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  72. package/operations/entry/DdbEsListEntries.d.ts +24 -0
  73. package/operations/entry/DdbEsListEntries.js +88 -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 +23 -0
  82. package/operations/entry/DdbEsPublishEntry.js +228 -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 +23 -0
  88. package/operations/entry/DdbEsUnpublishEntry.js +124 -0
  89. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  90. package/operations/entry/DdbEsUpdateEntry.d.ts +23 -0
  91. package/operations/entry/DdbEsUpdateEntry.js +172 -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 +14 -0
  129. package/operations/model/DdbEsCreateModel.js +52 -0
  130. package/operations/model/DdbEsCreateModel.js.map +1 -0
  131. package/operations/model/DdbEsDeleteModel.d.ts +14 -0
  132. package/operations/model/DdbEsDeleteModel.js +50 -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 +26 -22
  150. package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
  151. package/tasks/CreateElasticsearchIndexTask.js +49 -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 -51
  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 -36
  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 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetEntriesByIds.js","sources":["../../../src/operations/entry/DdbEsGetEntriesByIds.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetByIdsParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetEntriesByIdsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetEntriesByIdsImpl implements GetEntriesByIdsStorageOperation.Interface {\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetByIdsParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const entries = await this.dataLoaders.getRevisionById<T>({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n });\n }\n}\n\nexport const DdbEsGetEntriesByIds = GetEntriesByIdsStorageOperation.createImplementation({\n implementation: DdbEsGetEntriesByIdsImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n});\n"],"names":["DdbEsGetEntriesByIdsImpl","dataLoaders","storageModelProvider","initialModel","params","model","entries","entry","convertEntryKeysFromStorage","DdbEsGetEntriesByIds","GetEntriesByIdsStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IACF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAA+C,EACjD;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAMG,UAAU,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAI;YACtDD;YACA,KAAKD,OAAO,GAAG;QACnB;QAEA,OAAOE,QAAQ,GAAG,CAACC,CAAAA,QACRC,4BAA+B;gBAClCH;gBACAE;YACJ;IAER;AACJ;AAEO,MAAME,uBAAuBC,gCAAgC,oBAAoB,CAAC;IACrF,gBAAgBV;IAChB,cAAc;QAACW;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js";
3
+ import { ListEntriesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetEntryImpl implements GetEntryStorageOperation.Interface {
6
+ private listEntries;
7
+ private storageModelProvider;
8
+ constructor(listEntries: ListEntriesStorageOperation.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetParams): Promise<import("@webiny/api-headless-cms/types/types").CmsEntry<T> | null>;
10
+ }
11
+ export declare const DdbEsGetEntry: typeof DdbEsGetEntryImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js").IGetEntryStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,27 @@
1
+ import { GetEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js";
2
+ import { ListEntriesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ class DdbEsGetEntryImpl {
5
+ constructor(listEntries, storageModelProvider){
6
+ this.listEntries = listEntries;
7
+ this.storageModelProvider = storageModelProvider;
8
+ }
9
+ async execute(initialModel, params) {
10
+ const model = this.storageModelProvider.getModel(initialModel);
11
+ const { items } = await this.listEntries.execute(model, {
12
+ ...params,
13
+ limit: 1
14
+ });
15
+ return items.shift() || null;
16
+ }
17
+ }
18
+ const DdbEsGetEntry = GetEntryStorageOperation.createImplementation({
19
+ implementation: DdbEsGetEntryImpl,
20
+ dependencies: [
21
+ ListEntriesStorageOperation,
22
+ CmsStorageModelProvider
23
+ ]
24
+ });
25
+ export { DdbEsGetEntry };
26
+
27
+ //# sourceMappingURL=DdbEsGetEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetEntry.js","sources":["../../../src/operations/entry/DdbEsGetEntry.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js\";\nimport { ListEntriesStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass DdbEsGetEntryImpl implements GetEntryStorageOperation.Interface {\n constructor(\n private listEntries: ListEntriesStorageOperation.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetParams\n ) {\n const model = this.storageModelProvider.getModel(initialModel);\n\n const { items } = await this.listEntries.execute<T>(model, {\n ...params,\n limit: 1\n });\n return items.shift() || null;\n }\n}\n\nexport const DdbEsGetEntry = GetEntryStorageOperation.createImplementation({\n implementation: DdbEsGetEntryImpl,\n dependencies: [ListEntriesStorageOperation, CmsStorageModelProvider]\n});\n"],"names":["DdbEsGetEntryImpl","listEntries","storageModelProvider","initialModel","params","model","items","DdbEsGetEntry","GetEntryStorageOperation","ListEntriesStorageOperation","CmsStorageModelProvider"],"mappings":";;;AASA,MAAMA;IACF,YACYC,WAAkD,EAClDC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAA0C,EAC5C;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACF;QAEjD,MAAM,EAAEG,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAID,OAAO;YACvD,GAAGD,MAAM;YACT,OAAO;QACX;QACA,OAAOE,MAAM,KAAK,MAAM;IAC5B;AACJ;AAEO,MAAMC,gBAAgBC,yBAAyB,oBAAoB,CAAC;IACvE,gBAAgBR;IAChB,cAAc;QAACS;QAA6BC;KAAwB;AACxE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetLatestByIdsParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetLatestEntriesByIdsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js";
3
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetLatestEntriesByIdsImpl implements GetLatestEntriesByIdsStorageOperation.Interface {
6
+ private dataLoaders;
7
+ private storageModelProvider;
8
+ constructor(dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>[]>;
10
+ }
11
+ export declare const DdbEsGetLatestEntriesByIds: typeof DdbEsGetLatestEntriesByIdsImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js").IGetLatestEntriesByIdsStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,31 @@
1
+ import { GetLatestEntriesByIdsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js";
2
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
5
+ class DdbEsGetLatestEntriesByIdsImpl {
6
+ constructor(dataLoaders, storageModelProvider){
7
+ this.dataLoaders = dataLoaders;
8
+ this.storageModelProvider = storageModelProvider;
9
+ }
10
+ async execute(initialModel, params) {
11
+ const model = this.storageModelProvider.getModel(initialModel);
12
+ const entries = await this.dataLoaders.getLatestRevisionByEntryId({
13
+ model,
14
+ ids: params.ids
15
+ });
16
+ return entries.map((entry)=>convertEntryKeysFromStorage({
17
+ model,
18
+ entry
19
+ }));
20
+ }
21
+ }
22
+ const DdbEsGetLatestEntriesByIds = GetLatestEntriesByIdsStorageOperation.createImplementation({
23
+ implementation: DdbEsGetLatestEntriesByIdsImpl,
24
+ dependencies: [
25
+ CmsDdbEsDataLoaders,
26
+ CmsStorageModelProvider
27
+ ]
28
+ });
29
+ export { DdbEsGetLatestEntriesByIds };
30
+
31
+ //# sourceMappingURL=DdbEsGetLatestEntriesByIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetLatestEntriesByIds.js","sources":["../../../src/operations/entry/DdbEsGetLatestEntriesByIds.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetLatestByIdsParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetLatestEntriesByIdsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetLatestEntriesByIdsImpl implements GetLatestEntriesByIdsStorageOperation.Interface {\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetLatestByIdsParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const entries = await this.dataLoaders.getLatestRevisionByEntryId<T>({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n });\n }\n}\n\nexport const DdbEsGetLatestEntriesByIds =\n GetLatestEntriesByIdsStorageOperation.createImplementation({\n implementation: DdbEsGetLatestEntriesByIdsImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n });\n"],"names":["DdbEsGetLatestEntriesByIdsImpl","dataLoaders","storageModelProvider","initialModel","params","model","entries","entry","convertEntryKeysFromStorage","DdbEsGetLatestEntriesByIds","GetLatestEntriesByIdsStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IACF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAqD,EACvD;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAMG,UAAU,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAI;YACjED;YACA,KAAKD,OAAO,GAAG;QACnB;QAEA,OAAOE,QAAQ,GAAG,CAACC,CAAAA,QACRC,4BAA+B;gBAClCH;gBACAE;YACJ;IAER;AACJ;AAEO,MAAME,6BACTC,sCAAsC,oBAAoB,CAAC;IACvD,gBAAgBV;IAChB,cAAc;QAACW;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetLatestRevisionParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetLatestRevisionByEntryIdStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js";
3
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetLatestRevisionByEntryIdImpl implements GetLatestRevisionByEntryIdStorageOperation.Interface {
6
+ private dataLoaders;
7
+ private storageModelProvider;
8
+ constructor(dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T> | null>;
10
+ }
11
+ export declare const DdbEsGetLatestRevisionByEntryId: typeof DdbEsGetLatestRevisionByEntryIdImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js").IGetLatestRevisionByEntryIdStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,34 @@
1
+ import { GetLatestRevisionByEntryIdStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js";
2
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
5
+ class DdbEsGetLatestRevisionByEntryIdImpl {
6
+ constructor(dataLoaders, storageModelProvider){
7
+ this.dataLoaders = dataLoaders;
8
+ this.storageModelProvider = storageModelProvider;
9
+ }
10
+ async execute(initialModel, params) {
11
+ const model = this.storageModelProvider.getModel(initialModel);
12
+ const [entry] = await this.dataLoaders.getLatestRevisionByEntryId({
13
+ model,
14
+ ids: [
15
+ params.id
16
+ ]
17
+ });
18
+ if (!entry) return null;
19
+ return convertEntryKeysFromStorage({
20
+ model,
21
+ entry
22
+ });
23
+ }
24
+ }
25
+ const DdbEsGetLatestRevisionByEntryId = GetLatestRevisionByEntryIdStorageOperation.createImplementation({
26
+ implementation: DdbEsGetLatestRevisionByEntryIdImpl,
27
+ dependencies: [
28
+ CmsDdbEsDataLoaders,
29
+ CmsStorageModelProvider
30
+ ]
31
+ });
32
+ export { DdbEsGetLatestRevisionByEntryId };
33
+
34
+ //# sourceMappingURL=DdbEsGetLatestRevisionByEntryId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetLatestRevisionByEntryId.js","sources":["../../../src/operations/entry/DdbEsGetLatestRevisionByEntryId.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetLatestRevisionParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetLatestRevisionByEntryIdStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetLatestRevisionByEntryIdImpl\n implements GetLatestRevisionByEntryIdStorageOperation.Interface\n{\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetLatestRevisionParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const [entry] = await this.dataLoaders.getLatestRevisionByEntryId<T>({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n }\n}\n\nexport const DdbEsGetLatestRevisionByEntryId =\n GetLatestRevisionByEntryIdStorageOperation.createImplementation({\n implementation: DdbEsGetLatestRevisionByEntryIdImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n });\n"],"names":["DdbEsGetLatestRevisionByEntryIdImpl","dataLoaders","storageModelProvider","initialModel","params","model","entry","convertEntryKeysFromStorage","DdbEsGetLatestRevisionByEntryId","GetLatestRevisionByEntryIdStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IAGF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAwD,EAC1D;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAM,CAACG,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAI;YACjED;YACA,KAAK;gBAACD,OAAO,EAAE;aAAC;QACpB;QACA,IAAI,CAACE,OACD,OAAO;QAEX,OAAOC,4BAA+B;YAClCF;YACAC;QACJ;IACJ;AACJ;AAEO,MAAME,kCACTC,2CAA2C,oBAAoB,CAAC;IAC5D,gBAAgBT;IAChB,cAAc;QAACU;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetPreviousRevisionParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetPreviousRevisionStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js";
3
+ import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetPreviousRevisionImpl implements GetPreviousRevisionStorageOperation.Interface {
6
+ private entity;
7
+ private storageModelProvider;
8
+ constructor(entity: CmsDdbEsEntryEntity.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T> | null>;
10
+ }
11
+ export declare const DdbEsGetPreviousRevision: typeof DdbEsGetPreviousRevisionImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js").IGetPreviousRevisionStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,56 @@
1
+ import error from "@webiny/error";
2
+ import { GetPreviousRevisionStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js";
3
+ import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ import { createPartitionKey } from "./keys.js";
6
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
7
+ class DdbEsGetPreviousRevisionImpl {
8
+ constructor(entity, storageModelProvider){
9
+ this.entity = entity;
10
+ this.storageModelProvider = storageModelProvider;
11
+ }
12
+ async execute(initialModel, params) {
13
+ const model = this.storageModelProvider.getModel(initialModel);
14
+ const { tenant } = model;
15
+ const { entryId, version } = params;
16
+ const partitionKey = createPartitionKey({
17
+ tenant,
18
+ id: entryId
19
+ });
20
+ const options = {
21
+ beginsWith: "REV#",
22
+ reverse: true
23
+ };
24
+ try {
25
+ const unfilteredEntries = (await this.entity.queryAll({
26
+ partitionKey,
27
+ options
28
+ })).map((item)=>item.data);
29
+ const entries = unfilteredEntries.filter((item)=>item.version < version);
30
+ const entry = entries[0];
31
+ if (!entry) return null;
32
+ return convertEntryKeysFromStorage({
33
+ entry,
34
+ model
35
+ });
36
+ } catch (ex) {
37
+ throw new error(ex.message || "Could not get previous version of given entry.", ex.code || "GET_PREVIOUS_VERSION_ERROR", {
38
+ ...params,
39
+ error: ex,
40
+ partitionKey,
41
+ options,
42
+ model
43
+ });
44
+ }
45
+ }
46
+ }
47
+ const DdbEsGetPreviousRevision = GetPreviousRevisionStorageOperation.createImplementation({
48
+ implementation: DdbEsGetPreviousRevisionImpl,
49
+ dependencies: [
50
+ CmsDdbEsEntryEntity,
51
+ CmsStorageModelProvider
52
+ ]
53
+ });
54
+ export { DdbEsGetPreviousRevision };
55
+
56
+ //# sourceMappingURL=DdbEsGetPreviousRevision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetPreviousRevision.js","sources":["../../../src/operations/entry/DdbEsGetPreviousRevision.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetPreviousRevisionParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetPreviousRevisionStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { createPartitionKey } from \"./keys.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\nimport type { IEntityQueryAllParams } from \"@webiny/db-dynamodb\";\n\nclass DdbEsGetPreviousRevisionImpl implements GetPreviousRevisionStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEsEntryEntity.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetPreviousRevisionParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const { tenant } = model;\n const { entryId, version } = params;\n\n const partitionKey = createPartitionKey({\n tenant,\n id: entryId\n });\n const options: IEntityQueryAllParams[\"options\"] = {\n beginsWith: `REV#`,\n reverse: true\n };\n\n try {\n const unfilteredEntries = (\n await this.entity.queryAll({\n partitionKey,\n options\n })\n ).map(item => {\n return item.data;\n });\n\n const entries = unfilteredEntries.filter(item => {\n return item.version < version;\n });\n\n const entry = entries[0];\n\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage<T>({\n entry,\n model\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get previous version of given entry.\",\n ex.code || \"GET_PREVIOUS_VERSION_ERROR\",\n {\n ...params,\n error: ex,\n partitionKey,\n options,\n model\n }\n );\n }\n }\n}\n\nexport const DdbEsGetPreviousRevision = GetPreviousRevisionStorageOperation.createImplementation({\n implementation: DdbEsGetPreviousRevisionImpl,\n dependencies: [CmsDdbEsEntryEntity, CmsStorageModelProvider]\n});\n"],"names":["DdbEsGetPreviousRevisionImpl","entity","storageModelProvider","initialModel","params","model","tenant","entryId","version","partitionKey","createPartitionKey","options","unfilteredEntries","item","entries","entry","convertEntryKeysFromStorage","ex","WebinyError","DdbEsGetPreviousRevision","GetPreviousRevisionStorageOperation","CmsDdbEsEntryEntity","CmsStorageModelProvider"],"mappings":";;;;;;AAaA,MAAMA;IACF,YACYC,MAAqC,EACrCC,oBAAuD,CACjE;aAFUD,MAAM,GAANA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAA0D,EAC5D;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAM,EAAEG,MAAM,EAAE,GAAGD;QACnB,MAAM,EAAEE,OAAO,EAAEC,OAAO,EAAE,GAAGJ;QAE7B,MAAMK,eAAeC,mBAAmB;YACpCJ;YACA,IAAIC;QACR;QACA,MAAMI,UAA4C;YAC9C,YAAY;YACZ,SAAS;QACb;QAEA,IAAI;YACA,MAAMC,oBACF,OAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACvBH;gBACAE;YACJ,EAAC,EACH,GAAG,CAACE,CAAAA,OACKA,KAAK,IAAI;YAGpB,MAAMC,UAAUF,kBAAkB,MAAM,CAACC,CAAAA,OAC9BA,KAAK,OAAO,GAAGL;YAG1B,MAAMO,QAAQD,OAAO,CAAC,EAAE;YAExB,IAAI,CAACC,OACD,OAAO;YAEX,OAAOC,4BAA+B;gBAClCD;gBACAV;YACJ;QACJ,EAAE,OAAOY,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,kDACdA,GAAG,IAAI,IAAI,8BACX;gBACI,GAAGb,MAAM;gBACT,OAAOa;gBACPR;gBACAE;gBACAN;YACJ;QAER;IACJ;AACJ;AAEO,MAAMc,2BAA2BC,oCAAoC,oBAAoB,CAAC;IAC7F,gBAAgBpB;IAChB,cAAc;QAACqB;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetPublishedByIdsParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetPublishedEntriesByIdsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js";
3
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetPublishedEntriesByIdsImpl implements GetPublishedEntriesByIdsStorageOperation.Interface {
6
+ private dataLoaders;
7
+ private storageModelProvider;
8
+ constructor(dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>[]>;
10
+ }
11
+ export declare const DdbEsGetPublishedEntriesByIds: typeof DdbEsGetPublishedEntriesByIdsImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js").IGetPublishedEntriesByIdsStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,31 @@
1
+ import { GetPublishedEntriesByIdsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js";
2
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
5
+ class DdbEsGetPublishedEntriesByIdsImpl {
6
+ constructor(dataLoaders, storageModelProvider){
7
+ this.dataLoaders = dataLoaders;
8
+ this.storageModelProvider = storageModelProvider;
9
+ }
10
+ async execute(initialModel, params) {
11
+ const model = this.storageModelProvider.getModel(initialModel);
12
+ const entries = await this.dataLoaders.getPublishedRevisionByEntryId({
13
+ model,
14
+ ids: params.ids
15
+ });
16
+ return entries.map((entry)=>convertEntryKeysFromStorage({
17
+ model,
18
+ entry
19
+ }));
20
+ }
21
+ }
22
+ const DdbEsGetPublishedEntriesByIds = GetPublishedEntriesByIdsStorageOperation.createImplementation({
23
+ implementation: DdbEsGetPublishedEntriesByIdsImpl,
24
+ dependencies: [
25
+ CmsDdbEsDataLoaders,
26
+ CmsStorageModelProvider
27
+ ]
28
+ });
29
+ export { DdbEsGetPublishedEntriesByIds };
30
+
31
+ //# sourceMappingURL=DdbEsGetPublishedEntriesByIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetPublishedEntriesByIds.js","sources":["../../../src/operations/entry/DdbEsGetPublishedEntriesByIds.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetPublishedByIdsParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetPublishedEntriesByIdsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetPublishedEntriesByIdsImpl\n implements GetPublishedEntriesByIdsStorageOperation.Interface\n{\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedByIdsParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const entries = await this.dataLoaders.getPublishedRevisionByEntryId<T>({\n model,\n ids: params.ids\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n });\n }\n}\n\nexport const DdbEsGetPublishedEntriesByIds =\n GetPublishedEntriesByIdsStorageOperation.createImplementation({\n implementation: DdbEsGetPublishedEntriesByIdsImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n });\n"],"names":["DdbEsGetPublishedEntriesByIdsImpl","dataLoaders","storageModelProvider","initialModel","params","model","entries","entry","convertEntryKeysFromStorage","DdbEsGetPublishedEntriesByIds","GetPublishedEntriesByIdsStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IAGF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAwD,EAC1D;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAMG,UAAU,MAAM,IAAI,CAAC,WAAW,CAAC,6BAA6B,CAAI;YACpED;YACA,KAAKD,OAAO,GAAG;QACnB;QAEA,OAAOE,QAAQ,GAAG,CAACC,CAAAA,QACRC,4BAA+B;gBAClCH;gBACAE;YACJ;IAER;AACJ;AAEO,MAAME,gCACTC,yCAAyC,oBAAoB,CAAC;IAC1D,gBAAgBV;IAChB,cAAc;QAACW;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetPublishedRevisionParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetPublishedRevisionByEntryIdStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js";
3
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetPublishedRevisionByEntryIdImpl implements GetPublishedRevisionByEntryIdStorageOperation.Interface {
6
+ private dataLoaders;
7
+ private storageModelProvider;
8
+ constructor(dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T> | null>;
10
+ }
11
+ export declare const DdbEsGetPublishedRevisionByEntryId: typeof DdbEsGetPublishedRevisionByEntryIdImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js").IGetPublishedRevisionByEntryIdStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,34 @@
1
+ import { GetPublishedRevisionByEntryIdStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js";
2
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
5
+ class DdbEsGetPublishedRevisionByEntryIdImpl {
6
+ constructor(dataLoaders, storageModelProvider){
7
+ this.dataLoaders = dataLoaders;
8
+ this.storageModelProvider = storageModelProvider;
9
+ }
10
+ async execute(initialModel, params) {
11
+ const model = this.storageModelProvider.getModel(initialModel);
12
+ const [entry] = await this.dataLoaders.getPublishedRevisionByEntryId({
13
+ model,
14
+ ids: [
15
+ params.id
16
+ ]
17
+ });
18
+ if (!entry) return null;
19
+ return convertEntryKeysFromStorage({
20
+ model,
21
+ entry
22
+ });
23
+ }
24
+ }
25
+ const DdbEsGetPublishedRevisionByEntryId = GetPublishedRevisionByEntryIdStorageOperation.createImplementation({
26
+ implementation: DdbEsGetPublishedRevisionByEntryIdImpl,
27
+ dependencies: [
28
+ CmsDdbEsDataLoaders,
29
+ CmsStorageModelProvider
30
+ ]
31
+ });
32
+ export { DdbEsGetPublishedRevisionByEntryId };
33
+
34
+ //# sourceMappingURL=DdbEsGetPublishedRevisionByEntryId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetPublishedRevisionByEntryId.js","sources":["../../../src/operations/entry/DdbEsGetPublishedRevisionByEntryId.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetPublishedRevisionParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetPublishedRevisionByEntryIdStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetPublishedRevisionByEntryIdImpl\n implements GetPublishedRevisionByEntryIdStorageOperation.Interface\n{\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedRevisionParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const [entry] = await this.dataLoaders.getPublishedRevisionByEntryId<T>({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n }\n}\n\nexport const DdbEsGetPublishedRevisionByEntryId =\n GetPublishedRevisionByEntryIdStorageOperation.createImplementation({\n implementation: DdbEsGetPublishedRevisionByEntryIdImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n });\n"],"names":["DdbEsGetPublishedRevisionByEntryIdImpl","dataLoaders","storageModelProvider","initialModel","params","model","entry","convertEntryKeysFromStorage","DdbEsGetPublishedRevisionByEntryId","GetPublishedRevisionByEntryIdStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IAGF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAA2D,EAC7D;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAM,CAACG,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,6BAA6B,CAAI;YACpED;YACA,KAAK;gBAACD,OAAO,EAAE;aAAC;QACpB;QACA,IAAI,CAACE,OACD,OAAO;QAEX,OAAOC,4BAA+B;YAClCF;YACAC;QACJ;IACJ;AACJ;AAEO,MAAME,qCACTC,8CAA8C,oBAAoB,CAAC;IAC/D,gBAAgBT;IAChB,cAAc;QAACU;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetRevisionParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetRevisionByIdStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js";
3
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetRevisionByIdImpl implements GetRevisionByIdStorageOperation.Interface {
6
+ private dataLoaders;
7
+ private storageModelProvider;
8
+ constructor(dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T> | null>;
10
+ }
11
+ export declare const DdbEsGetRevisionById: typeof DdbEsGetRevisionByIdImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js").IGetRevisionByIdStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,34 @@
1
+ import { GetRevisionByIdStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js";
2
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
5
+ class DdbEsGetRevisionByIdImpl {
6
+ constructor(dataLoaders, storageModelProvider){
7
+ this.dataLoaders = dataLoaders;
8
+ this.storageModelProvider = storageModelProvider;
9
+ }
10
+ async execute(initialModel, params) {
11
+ const model = this.storageModelProvider.getModel(initialModel);
12
+ const [entry] = await this.dataLoaders.getRevisionById({
13
+ model,
14
+ ids: [
15
+ params.id
16
+ ]
17
+ });
18
+ if (!entry) return null;
19
+ return convertEntryKeysFromStorage({
20
+ model,
21
+ entry
22
+ });
23
+ }
24
+ }
25
+ const DdbEsGetRevisionById = GetRevisionByIdStorageOperation.createImplementation({
26
+ implementation: DdbEsGetRevisionByIdImpl,
27
+ dependencies: [
28
+ CmsDdbEsDataLoaders,
29
+ CmsStorageModelProvider
30
+ ]
31
+ });
32
+ export { DdbEsGetRevisionById };
33
+
34
+ //# sourceMappingURL=DdbEsGetRevisionById.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetRevisionById.js","sources":["../../../src/operations/entry/DdbEsGetRevisionById.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetRevisionParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetRevisionByIdStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetRevisionByIdImpl implements GetRevisionByIdStorageOperation.Interface {\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const [entry] = await this.dataLoaders.getRevisionById<T>({\n model,\n ids: [params.id]\n });\n if (!entry) {\n return null;\n }\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n }\n}\n\nexport const DdbEsGetRevisionById = GetRevisionByIdStorageOperation.createImplementation({\n implementation: DdbEsGetRevisionByIdImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n});\n"],"names":["DdbEsGetRevisionByIdImpl","dataLoaders","storageModelProvider","initialModel","params","model","entry","convertEntryKeysFromStorage","DdbEsGetRevisionById","GetRevisionByIdStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IACF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAkD,EACpD;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAM,CAACG,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAI;YACtDD;YACA,KAAK;gBAACD,OAAO,EAAE;aAAC;QACpB;QACA,IAAI,CAACE,OACD,OAAO;QAEX,OAAOC,4BAA+B;YAClCF;YACAC;QACJ;IACJ;AACJ;AAEO,MAAME,uBAAuBC,gCAAgC,oBAAoB,CAAC;IACrF,gBAAgBT;IAChB,cAAc;QAACU;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,14 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetRevisionsParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetRevisionsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js";
3
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
4
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
5
+ declare class DdbEsGetRevisionsImpl implements GetRevisionsStorageOperation.Interface {
6
+ private dataLoaders;
7
+ private storageModelProvider;
8
+ constructor(dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
9
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>[]>;
10
+ }
11
+ export declare const DdbEsGetRevisions: typeof DdbEsGetRevisionsImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js").IGetRevisionsStorageOperation>;
13
+ };
14
+ export {};
@@ -0,0 +1,33 @@
1
+ import { GetRevisionsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js";
2
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
3
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
4
+ import { convertEntryKeysFromStorage } from "./transformations/convertEntryKeys.js";
5
+ class DdbEsGetRevisionsImpl {
6
+ constructor(dataLoaders, storageModelProvider){
7
+ this.dataLoaders = dataLoaders;
8
+ this.storageModelProvider = storageModelProvider;
9
+ }
10
+ async execute(initialModel, params) {
11
+ const model = this.storageModelProvider.getModel(initialModel);
12
+ const entries = await this.dataLoaders.getAllEntryRevisions({
13
+ model,
14
+ ids: [
15
+ params.id
16
+ ]
17
+ });
18
+ return entries.map((entry)=>convertEntryKeysFromStorage({
19
+ model,
20
+ entry
21
+ }));
22
+ }
23
+ }
24
+ const DdbEsGetRevisions = GetRevisionsStorageOperation.createImplementation({
25
+ implementation: DdbEsGetRevisionsImpl,
26
+ dependencies: [
27
+ CmsDdbEsDataLoaders,
28
+ CmsStorageModelProvider
29
+ ]
30
+ });
31
+ export { DdbEsGetRevisions };
32
+
33
+ //# sourceMappingURL=DdbEsGetRevisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetRevisions.js","sources":["../../../src/operations/entry/DdbEsGetRevisions.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetRevisionsParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetRevisionsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { convertEntryKeysFromStorage } from \"./transformations/convertEntryKeys.js\";\n\nclass DdbEsGetRevisionsImpl implements GetRevisionsStorageOperation.Interface {\n constructor(\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionsParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const entries = await this.dataLoaders.getAllEntryRevisions<T>({\n model,\n ids: [params.id]\n });\n\n return entries.map(entry => {\n return convertEntryKeysFromStorage<T>({\n model,\n entry\n });\n });\n }\n}\n\nexport const DdbEsGetRevisions = GetRevisionsStorageOperation.createImplementation({\n implementation: DdbEsGetRevisionsImpl,\n dependencies: [CmsDdbEsDataLoaders, CmsStorageModelProvider]\n});\n"],"names":["DdbEsGetRevisionsImpl","dataLoaders","storageModelProvider","initialModel","params","model","entries","entry","convertEntryKeysFromStorage","DdbEsGetRevisions","GetRevisionsStorageOperation","CmsDdbEsDataLoaders","CmsStorageModelProvider"],"mappings":";;;;AAUA,MAAMA;IACF,YACYC,WAA0C,EAC1CC,oBAAuD,CACjE;aAFUD,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAmD,EACrD;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAMG,UAAU,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAI;YAC3DD;YACA,KAAK;gBAACD,OAAO,EAAE;aAAC;QACpB;QAEA,OAAOE,QAAQ,GAAG,CAACC,CAAAA,QACRC,4BAA+B;gBAClCH;gBACAE;YACJ;IAER;AACJ;AAEO,MAAME,oBAAoBC,6BAA6B,oBAAoB,CAAC;IAC/E,gBAAgBV;IAChB,cAAc;QAACW;QAAqBC;KAAwB;AAChE"}
@@ -0,0 +1,17 @@
1
+ import type { CmsModel, CmsEntryStorageOperationsGetUniqueFieldValuesParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { GetUniqueFieldValuesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js";
3
+ import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
4
+ import { CmsEntryOpenSearchBodyBuilder } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
5
+ declare class DdbEsGetUniqueFieldValuesImpl implements GetUniqueFieldValuesStorageOperation.Interface {
6
+ private bodyBuilder;
7
+ private elasticsearch;
8
+ constructor(bodyBuilder: CmsEntryOpenSearchBodyBuilder.Interface, openSearchClient: OpenSearchClient.Interface);
9
+ execute(model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams): Promise<{
10
+ value: string;
11
+ count: number;
12
+ }[]>;
13
+ }
14
+ export declare const DdbEsGetUniqueFieldValues: typeof DdbEsGetUniqueFieldValuesImpl & {
15
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js").IGetUniqueFieldValuesStorageOperation>;
16
+ };
17
+ export {};
@@ -0,0 +1,73 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { GetUniqueFieldValuesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js";
3
+ import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
4
+ import { configurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
5
+ import { shouldIgnoreEsResponseError } from "@webiny/api-headless-cms-utils-os/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js";
6
+ import { CmsEntryOpenSearchBodyBuilder } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
7
+ class DdbEsGetUniqueFieldValuesImpl {
8
+ constructor(bodyBuilder, openSearchClient){
9
+ this.bodyBuilder = bodyBuilder;
10
+ this.elasticsearch = openSearchClient.use();
11
+ }
12
+ async execute(model, params) {
13
+ const { where, fieldId } = params;
14
+ const { index } = configurations.es({
15
+ model
16
+ });
17
+ const initialBody = this.bodyBuilder.build({
18
+ model,
19
+ params: {
20
+ limit: 1,
21
+ where
22
+ }
23
+ });
24
+ const field = model.fields.find((f)=>f.fieldId === fieldId);
25
+ if (!field) throw new _webiny_error('Could not find field with given "fieldId" value.', "FIELD_NOT_FOUND", {
26
+ fieldId
27
+ });
28
+ const body = {
29
+ ...initialBody,
30
+ size: 0,
31
+ aggregations: {
32
+ getUniqueFieldValues: {
33
+ terms: {
34
+ field: `values.${field.storageId}.keyword`,
35
+ size: 1000000
36
+ }
37
+ }
38
+ }
39
+ };
40
+ let response;
41
+ try {
42
+ response = await this.elasticsearch.search({
43
+ index,
44
+ body
45
+ });
46
+ } catch (error) {
47
+ if (shouldIgnoreEsResponseError(error)) return [];
48
+ throw new _webiny_error(error.message || "Error in the Elasticsearch query.", error.code || "OPENSEARCH_ERROR", {
49
+ error,
50
+ index,
51
+ model,
52
+ body
53
+ });
54
+ }
55
+ const aggregations = response.body.aggregations || {};
56
+ const agg = aggregations["getUniqueFieldValues"];
57
+ const buckets = agg && "buckets" in agg && Array.isArray(agg.buckets) ? agg.buckets : [];
58
+ return buckets.map((bucket)=>({
59
+ value: bucket.key,
60
+ count: bucket.doc_count
61
+ }));
62
+ }
63
+ }
64
+ const DdbEsGetUniqueFieldValues = GetUniqueFieldValuesStorageOperation.createImplementation({
65
+ implementation: DdbEsGetUniqueFieldValuesImpl,
66
+ dependencies: [
67
+ CmsEntryOpenSearchBodyBuilder,
68
+ OpenSearchClient
69
+ ]
70
+ });
71
+ export { DdbEsGetUniqueFieldValues };
72
+
73
+ //# sourceMappingURL=DdbEsGetUniqueFieldValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbEsGetUniqueFieldValues.js","sources":["../../../src/operations/entry/DdbEsGetUniqueFieldValues.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryStorageOperationsGetUniqueFieldValuesParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetUniqueFieldValuesStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js\";\nimport { OpenSearchClient } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport type { Client } from \"@webiny/api-opensearch\";\nimport type {\n OpenSearchSearchResponse,\n SearchBody as OpenSearchSearchBody\n} from \"@webiny/api-opensearch/types.js\";\nimport { configurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { shouldIgnoreEsResponseError } from \"@webiny/api-headless-cms-utils-os/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js\";\nimport { CmsEntryOpenSearchBodyBuilder } from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\n\nclass DdbEsGetUniqueFieldValuesImpl implements GetUniqueFieldValuesStorageOperation.Interface {\n private elasticsearch: Client;\n\n constructor(\n private bodyBuilder: CmsEntryOpenSearchBodyBuilder.Interface,\n openSearchClient: OpenSearchClient.Interface\n ) {\n this.elasticsearch = openSearchClient.use();\n }\n\n async execute(model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams) {\n const { where, fieldId } = params;\n\n const { index } = configurations.es({\n model\n });\n\n const initialBody = this.bodyBuilder.build({\n model,\n params: {\n limit: 1,\n where\n }\n });\n\n const field = model.fields.find(f => f.fieldId === fieldId);\n if (!field) {\n throw new WebinyError(\n `Could not find field with given \"fieldId\" value.`,\n \"FIELD_NOT_FOUND\",\n {\n fieldId\n }\n );\n }\n\n const body: OpenSearchSearchBody = {\n ...initialBody,\n /**\n * We do not need any hits returned, we only need the aggregations.\n */\n size: 0,\n aggregations: {\n getUniqueFieldValues: {\n terms: {\n field: `values.${field.storageId}.keyword`,\n size: 1000000\n }\n }\n }\n };\n\n let response: OpenSearchSearchResponse | undefined = undefined;\n\n try {\n response = await this.elasticsearch.search({\n index,\n body\n });\n } catch (error) {\n if (shouldIgnoreEsResponseError(error)) {\n return [];\n }\n\n throw new WebinyError(\n error.message || \"Error in the Elasticsearch query.\",\n error.code || \"OPENSEARCH_ERROR\",\n {\n error,\n index,\n model,\n body\n }\n );\n }\n\n const aggregations = response.body.aggregations || {};\n const agg = aggregations[\"getUniqueFieldValues\"];\n const buckets = agg && \"buckets\" in agg && Array.isArray(agg.buckets) ? agg.buckets : [];\n return buckets.map((bucket: { key: string; doc_count: number }) => {\n return {\n value: bucket.key,\n count: bucket.doc_count\n };\n });\n }\n}\n\nexport const DdbEsGetUniqueFieldValues = GetUniqueFieldValuesStorageOperation.createImplementation({\n implementation: DdbEsGetUniqueFieldValuesImpl,\n dependencies: [CmsEntryOpenSearchBodyBuilder, OpenSearchClient]\n});\n"],"names":["DdbEsGetUniqueFieldValuesImpl","bodyBuilder","openSearchClient","model","params","where","fieldId","index","configurations","initialBody","field","f","WebinyError","body","response","error","shouldIgnoreEsResponseError","aggregations","agg","buckets","Array","bucket","DdbEsGetUniqueFieldValues","GetUniqueFieldValuesStorageOperation","CmsEntryOpenSearchBodyBuilder","OpenSearchClient"],"mappings":";;;;;;AAgBA,MAAMA;IAGF,YACYC,WAAoD,EAC5DC,gBAA4C,CAC9C;aAFUD,WAAW,GAAXA;QAGR,IAAI,CAAC,aAAa,GAAGC,iBAAiB,GAAG;IAC7C;IAEA,MAAM,QAAQC,KAAe,EAAEC,MAA2D,EAAE;QACxF,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAE,GAAGF;QAE3B,MAAM,EAAEG,KAAK,EAAE,GAAGC,eAAe,EAAE,CAAC;YAChCL;QACJ;QAEA,MAAMM,cAAc,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;YACvCN;YACA,QAAQ;gBACJ,OAAO;gBACPE;YACJ;QACJ;QAEA,MAAMK,QAAQP,MAAM,MAAM,CAAC,IAAI,CAACQ,CAAAA,IAAKA,EAAE,OAAO,KAAKL;QACnD,IAAI,CAACI,OACD,MAAM,IAAIE,cACN,oDACA,mBACA;YACIN;QACJ;QAIR,MAAMO,OAA6B;YAC/B,GAAGJ,WAAW;YAId,MAAM;YACN,cAAc;gBACV,sBAAsB;oBAClB,OAAO;wBACH,OAAO,CAAC,OAAO,EAAEC,MAAM,SAAS,CAAC,QAAQ,CAAC;wBAC1C,MAAM;oBACV;gBACJ;YACJ;QACJ;QAEA,IAAII;QAEJ,IAAI;YACAA,WAAW,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;gBACvCP;gBACAM;YACJ;QACJ,EAAE,OAAOE,OAAO;YACZ,IAAIC,4BAA4BD,QAC5B,OAAO,EAAE;YAGb,MAAM,IAAIH,cACNG,MAAM,OAAO,IAAI,qCACjBA,MAAM,IAAI,IAAI,oBACd;gBACIA;gBACAR;gBACAJ;gBACAU;YACJ;QAER;QAEA,MAAMI,eAAeH,SAAS,IAAI,CAAC,YAAY,IAAI,CAAC;QACpD,MAAMI,MAAMD,YAAY,CAAC,uBAAuB;QAChD,MAAME,UAAUD,OAAO,aAAaA,OAAOE,MAAM,OAAO,CAACF,IAAI,OAAO,IAAIA,IAAI,OAAO,GAAG,EAAE;QACxF,OAAOC,QAAQ,GAAG,CAAC,CAACE,SACT;gBACH,OAAOA,OAAO,GAAG;gBACjB,OAAOA,OAAO,SAAS;YAC3B;IAER;AACJ;AAEO,MAAMC,4BAA4BC,qCAAqC,oBAAoB,CAAC;IAC/F,gBAAgBvB;IAChB,cAAc;QAACwB;QAA+BC;KAAiB;AACnE"}