@webiny/api-headless-cms-ddb-es 6.1.0-beta.3 → 6.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/configurations.d.ts +3 -2
  2. package/configurations.js +10 -8
  3. package/configurations.js.map +1 -1
  4. package/elasticsearch/createElasticsearchIndex.d.ts +2 -2
  5. package/elasticsearch/createElasticsearchIndex.js +58 -16
  6. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  7. package/exports/api/cms/opensearch.d.ts +9 -0
  8. package/exports/api/cms/opensearch.js +11 -0
  9. package/exports/api/cms/opensearch.js.map +1 -0
  10. package/feature.d.ts +1 -0
  11. package/feature.js +188 -0
  12. package/feature.js.map +1 -0
  13. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  14. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +4 -0
  15. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  16. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  17. package/features/CmsEntryOpenSearchBodyModifier/index.js +3 -0
  18. package/features/CmsEntryOpenSearchBodyModifier/index.js.map +1 -0
  19. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +13 -0
  20. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +36 -0
  21. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  22. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +35 -0
  23. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +4 -0
  24. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  25. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  26. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +4 -0
  27. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  28. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  29. package/features/CmsEntryOpenSearchFieldIndex/constants.js +3 -0
  30. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  31. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +1 -0
  32. package/features/CmsEntryOpenSearchFieldIndex/feature.js +24 -0
  33. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  34. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  35. package/{elasticsearch/indexing/dateTimeIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js} +21 -19
  36. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +10 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +39 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +22 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +25 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  47. package/{elasticsearch/indexing/numberIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js} +11 -8
  48. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +10 -0
  50. package/{elasticsearch/indexing/objectIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js} +50 -86
  51. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +22 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/index.js +5 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/index.js.map +1 -0
  58. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  59. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +38 -0
  60. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  61. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  62. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +4 -0
  63. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  64. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  65. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +4 -0
  66. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  67. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  68. package/features/CmsEntryOpenSearchFilter/constants.js +3 -0
  69. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  70. package/features/CmsEntryOpenSearchFilter/feature.d.ts +1 -0
  71. package/features/CmsEntryOpenSearchFilter/feature.js +16 -0
  72. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  73. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  74. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +23 -0
  75. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  76. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  77. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +61 -0
  78. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  79. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  80. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +49 -0
  81. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  82. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  83. package/features/CmsEntryOpenSearchFilter/index.js +5 -0
  84. package/features/CmsEntryOpenSearchFilter/index.js.map +1 -0
  85. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  86. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +4 -0
  87. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  88. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  89. package/features/CmsEntryOpenSearchFullTextSearch/index.js +3 -0
  90. package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +1 -0
  91. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  92. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
  93. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  94. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  95. package/features/CmsEntryOpenSearchIndex/abstractions.js +4 -0
  96. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  97. package/features/CmsEntryOpenSearchIndex/feature.d.ts +1 -0
  98. package/features/CmsEntryOpenSearchIndex/feature.js +10 -0
  99. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  100. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  101. package/features/CmsEntryOpenSearchIndex/index.js +5 -0
  102. package/features/CmsEntryOpenSearchIndex/index.js.map +1 -0
  103. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  104. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +4 -0
  105. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  106. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  107. package/features/CmsEntryOpenSearchQueryModifier/index.js +3 -0
  108. package/features/CmsEntryOpenSearchQueryModifier/index.js.map +1 -0
  109. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  110. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +4 -0
  111. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  112. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  113. package/features/CmsEntryOpenSearchSortModifier/index.js +3 -0
  114. package/features/CmsEntryOpenSearchSortModifier/index.js.map +1 -0
  115. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  116. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +27 -0
  117. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  118. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  119. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +4 -0
  120. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  121. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  122. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +4 -0
  123. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  124. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +1 -0
  125. package/features/CmsEntryOpenSearchValueSearch/feature.js +16 -0
  126. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  127. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  128. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +23 -0
  129. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  130. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  131. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +55 -0
  132. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  133. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  134. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +24 -0
  135. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  136. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  137. package/features/CmsEntryOpenSearchValueSearch/index.js +5 -0
  138. package/features/CmsEntryOpenSearchValueSearch/index.js.map +1 -0
  139. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  140. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +4 -0
  141. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  142. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  143. package/features/CmsEntryOpenSearchValuesModifier/index.js +3 -0
  144. package/features/CmsEntryOpenSearchValuesModifier/index.js.map +1 -0
  145. package/helpers/entryIndexHelpers.d.ts +5 -3
  146. package/helpers/entryIndexHelpers.js +28 -90
  147. package/helpers/entryIndexHelpers.js.map +1 -1
  148. package/index.d.ts +1 -3
  149. package/index.js +1 -188
  150. package/index.js.map +1 -1
  151. package/operations/entry/elasticsearch/body.d.ts +18 -2
  152. package/operations/entry/elasticsearch/body.js +32 -29
  153. package/operations/entry/elasticsearch/body.js.map +1 -1
  154. package/operations/entry/elasticsearch/fields.d.ts +6 -4
  155. package/operations/entry/elasticsearch/fields.js +14 -57
  156. package/operations/entry/elasticsearch/fields.js.map +1 -1
  157. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +5 -4
  158. package/operations/entry/elasticsearch/filtering/applyFiltering.js +3 -3
  159. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  160. package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -0
  161. package/operations/entry/elasticsearch/filtering/exec.js +11 -64
  162. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  163. package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
  164. package/operations/entry/elasticsearch/filtering/path.js +4 -6
  165. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  166. package/operations/entry/elasticsearch/fullTextSearch.d.ts +2 -2
  167. package/operations/entry/elasticsearch/fullTextSearch.js +25 -29
  168. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  169. package/operations/entry/elasticsearch/sort.d.ts +2 -2
  170. package/operations/entry/elasticsearch/sort.js +2 -6
  171. package/operations/entry/elasticsearch/sort.js.map +1 -1
  172. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
  173. package/operations/entry/elasticsearch/transformValueForSearch.js +4 -14
  174. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  175. package/operations/entry/elasticsearch/types.d.ts +0 -7
  176. package/operations/entry/elasticsearch/types.js.map +1 -1
  177. package/operations/entry/index.d.ts +21 -1
  178. package/operations/entry/index.js +96 -39
  179. package/operations/entry/index.js.map +1 -1
  180. package/operations/entry/transformations/index.d.ts +8 -2
  181. package/operations/entry/transformations/index.js +14 -12
  182. package/operations/entry/transformations/index.js.map +1 -1
  183. package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
  184. package/operations/entry/transformations/modifyEntryValues.js +3 -3
  185. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  186. package/operations/entry/transformations/transformEntryToIndex.d.ts +4 -2
  187. package/operations/entry/transformations/transformEntryToIndex.js +6 -4
  188. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  189. package/operations/group/index.d.ts +2 -2
  190. package/operations/group/index.js +6 -9
  191. package/operations/group/index.js.map +1 -1
  192. package/package.json +25 -23
  193. package/tasks/createIndexTaskPlugin.js +8 -1
  194. package/tasks/createIndexTaskPlugin.js.map +1 -1
  195. package/types.d.ts +7 -112
  196. package/types.js +0 -23
  197. package/types.js.map +1 -1
  198. package/dynamoDb/index.d.ts +0 -3
  199. package/dynamoDb/index.js +0 -8
  200. package/dynamoDb/index.js.map +0 -1
  201. package/dynamoDb/storage/longText.d.ts +0 -10
  202. package/dynamoDb/storage/longText.js +0 -88
  203. package/dynamoDb/storage/longText.js.map +0 -1
  204. package/dynamoDb/storage/richText.d.ts +0 -2
  205. package/dynamoDb/storage/richText.js +0 -51
  206. package/dynamoDb/storage/richText.js.map +0 -1
  207. package/elasticsearch/index.d.ts +0 -2
  208. package/elasticsearch/index.js +0 -5
  209. package/elasticsearch/index.js.map +0 -1
  210. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  211. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  212. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  213. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  214. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  215. package/elasticsearch/indexing/index.d.ts +0 -2
  216. package/elasticsearch/indexing/index.js +0 -10
  217. package/elasticsearch/indexing/index.js.map +0 -1
  218. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  219. package/elasticsearch/indexing/jsonIndexing.js +0 -21
  220. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  221. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  222. package/elasticsearch/indexing/longTextIndexing.js +0 -35
  223. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  224. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  225. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  226. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  227. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  228. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  229. package/elasticsearch/indexing/richTextIndexing.js +0 -24
  230. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  231. package/elasticsearch/indices/base.d.ts +0 -2
  232. package/elasticsearch/indices/base.js +0 -7
  233. package/elasticsearch/indices/base.js.map +0 -1
  234. package/elasticsearch/indices/index.d.ts +0 -1
  235. package/elasticsearch/indices/index.js +0 -6
  236. package/elasticsearch/indices/index.js.map +0 -1
  237. package/elasticsearch/search/index.d.ts +0 -3
  238. package/elasticsearch/search/index.js +0 -6
  239. package/elasticsearch/search/index.js.map +0 -1
  240. package/elasticsearch/search/refSearch.d.ts +0 -2
  241. package/elasticsearch/search/refSearch.js +0 -24
  242. package/elasticsearch/search/refSearch.js.map +0 -1
  243. package/elasticsearch/search/searchableJson.d.ts +0 -2
  244. package/elasticsearch/search/searchableJson.js +0 -53
  245. package/elasticsearch/search/searchableJson.js.map +0 -1
  246. package/elasticsearch/search/timeSearch.d.ts +0 -2
  247. package/elasticsearch/search/timeSearch.js +0 -20
  248. package/elasticsearch/search/timeSearch.js.map +0 -1
  249. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  250. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
  251. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  252. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  253. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
  254. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  255. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  256. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
  257. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  258. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  259. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
  260. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  261. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  262. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
  263. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  264. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  265. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
  266. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  267. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  268. package/operations/entry/elasticsearch/plugins/search.js +0 -18
  269. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  270. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  271. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
  272. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  273. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  274. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
  275. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  276. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  277. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
  278. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  279. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -24
  280. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
  281. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  282. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  283. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
  284. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  285. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  286. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
  287. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  288. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  289. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
  290. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  291. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  292. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
  293. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  294. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  295. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
  296. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  297. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  298. package/plugins/CmsEntryFilterPlugin.js +0 -15
  299. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  300. package/plugins/index.d.ts +0 -8
  301. package/plugins/index.js +0 -10
  302. package/plugins/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["createSort","OpenSearchFieldPlugin","hasKeyword","createSearchPluginList","createFieldPathFactory","NoValueContainer","matchField","input","valuesMatch","match","fieldId","order","isValues","nonValues","createElasticsearchSort","params","sort","modelFields","plugins","length","searchPlugins","createFieldPath","fieldIdToStorageIdIdMap","sortPlugins","Object","values","reduce","field","parents","fieldIdPath","path","key","storageId","value","create","keyword","originalValue","unmappedType","sortable","searchable","ALL","transformedSort","map","matched","filter","Boolean","fieldPlugins"],"sources":["sort.ts"],"sourcesContent":["import type { Sort as OpenSearchSort } from \"@webiny/api-opensearch/types.js\";\nimport { createSort, OpenSearchFieldPlugin } from \"@webiny/api-opensearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { CmsEntryListSort, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { ModelFields } from \"./types.js\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword.js\";\nimport { createSearchPluginList } from \"~/operations/entry/elasticsearch/plugins/search.js\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path.js\";\nimport { NoValueContainer } from \"~/values/NoValueContainer.js\";\n\ninterface IMatchFieldResponse {\n fieldId: string;\n isValues: boolean;\n order: \"ASC\" | \"DESC\";\n}\n\nconst matchField = (input: string): IMatchFieldResponse | null => {\n const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (valuesMatch) {\n const [, fieldId, order] = valuesMatch;\n return {\n fieldId,\n isValues: true,\n order: order as \"ASC\" | \"DESC\"\n };\n }\n const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (!nonValues) {\n return null;\n }\n const [, fieldId, order] = nonValues;\n return {\n fieldId,\n isValues: false,\n order: order as \"ASC\" | \"DESC\"\n };\n};\n\ninterface Params {\n plugins: PluginsContainer;\n sort?: CmsEntryListSort;\n modelFields: ModelFields;\n model: CmsModel;\n}\n\nexport const createElasticsearchSort = (params: Params): OpenSearchSort => {\n const { sort, modelFields, plugins } = params;\n\n if (!sort || sort.length === 0) {\n return [\n {\n [\"id.keyword\"]: {\n order: \"asc\"\n }\n }\n ];\n }\n\n const searchPlugins = createSearchPluginList({\n plugins\n });\n\n const createFieldPath = createFieldPathFactory({\n plugins: searchPlugins\n });\n\n const fieldIdToStorageIdIdMap: Record<string, string> = {};\n\n const sortPlugins = Object.values(modelFields).reduce<Record<string, OpenSearchFieldPlugin>>(\n (plugins, field) => {\n /**\n * We do not support sorting by nested fields.\n */\n const isValues = field.parents.length === 1 && field.parents[0].fieldId === \"values\";\n if (field.parents.length > 0 && !isValues) {\n return plugins;\n }\n\n const fieldId = field.field.fieldId;\n const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;\n\n fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;\n\n const { path } = createFieldPath({\n key: field.field.storageId,\n field,\n value: NoValueContainer.create(),\n keyword: false,\n originalValue: NoValueContainer.create()\n });\n /**\n * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.\n */\n plugins[fieldIdPath] = new OpenSearchFieldPlugin({\n unmappedType: field.unmappedType,\n keyword: hasKeyword(field),\n sortable: field.sortable,\n searchable: field.searchable,\n field: fieldId,\n path\n });\n return plugins;\n },\n {\n [\"*\"]: new OpenSearchFieldPlugin({\n field: OpenSearchFieldPlugin.ALL,\n keyword: false\n })\n }\n );\n\n const transformedSort = sort\n .map(value => {\n const matched = matchField(value);\n if (!matched) {\n return null;\n }\n const { fieldId, order, isValues } = matched;\n const key = isValues ? `values.${fieldId}` : fieldId;\n if (fieldIdToStorageIdIdMap[key]) {\n return `${fieldIdToStorageIdIdMap[key]}_${order}`;\n }\n\n return value;\n })\n .filter(Boolean) as string[];\n return createSort({\n fieldPlugins: sortPlugins,\n sort: transformedSort\n });\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["createSort","OpenSearchFieldPlugin","hasKeyword","createFieldPathFactory","NoValueContainer","matchField","input","valuesMatch","match","fieldId","order","isValues","nonValues","createElasticsearchSort","params","sort","modelFields","valueSearchRegistry","length","createFieldPath","fieldIdToStorageIdIdMap","sortPlugins","Object","values","reduce","plugins","field","parents","fieldIdPath","path","key","storageId","value","create","keyword","originalValue","unmappedType","sortable","searchable","ALL","transformedSort","map","matched","filter","Boolean","fieldPlugins"],"sources":["sort.ts"],"sourcesContent":["import type { Sort as OpenSearchSort } from \"@webiny/api-opensearch/types.js\";\nimport { createSort, OpenSearchFieldPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsEntryListSort, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { ModelFields } from \"./types.js\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword.js\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path.js\";\nimport { NoValueContainer } from \"~/values/NoValueContainer.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\n\ninterface IMatchFieldResponse {\n fieldId: string;\n isValues: boolean;\n order: \"ASC\" | \"DESC\";\n}\n\nconst matchField = (input: string): IMatchFieldResponse | null => {\n const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (valuesMatch) {\n const [, fieldId, order] = valuesMatch;\n return {\n fieldId,\n isValues: true,\n order: order as \"ASC\" | \"DESC\"\n };\n }\n const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (!nonValues) {\n return null;\n }\n const [, fieldId, order] = nonValues;\n return {\n fieldId,\n isValues: false,\n order: order as \"ASC\" | \"DESC\"\n };\n};\n\ninterface Params {\n sort?: CmsEntryListSort;\n modelFields: ModelFields;\n model: CmsModel;\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n}\n\nexport const createElasticsearchSort = (params: Params): OpenSearchSort => {\n const { sort, modelFields, valueSearchRegistry } = params;\n\n if (!sort || sort.length === 0) {\n return [\n {\n [\"id.keyword\"]: {\n order: \"asc\"\n }\n }\n ];\n }\n\n const createFieldPath = createFieldPathFactory({\n valueSearchRegistry\n });\n\n const fieldIdToStorageIdIdMap: Record<string, string> = {};\n\n const sortPlugins = Object.values(modelFields).reduce<Record<string, OpenSearchFieldPlugin>>(\n (plugins, field) => {\n /**\n * We do not support sorting by nested fields.\n */\n const isValues = field.parents.length === 1 && field.parents[0].fieldId === \"values\";\n if (field.parents.length > 0 && !isValues) {\n return plugins;\n }\n\n const fieldId = field.field.fieldId;\n const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;\n\n fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;\n\n const { path } = createFieldPath({\n key: field.field.storageId,\n field,\n value: NoValueContainer.create(),\n keyword: false,\n originalValue: NoValueContainer.create()\n });\n /**\n * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.\n */\n plugins[fieldIdPath] = new OpenSearchFieldPlugin({\n unmappedType: field.unmappedType,\n keyword: hasKeyword(field),\n sortable: field.sortable,\n searchable: field.searchable,\n field: fieldId,\n path\n });\n return plugins;\n },\n {\n [\"*\"]: new OpenSearchFieldPlugin({\n field: OpenSearchFieldPlugin.ALL,\n keyword: false\n })\n }\n );\n\n const transformedSort = sort\n .map(value => {\n const matched = matchField(value);\n if (!matched) {\n return null;\n }\n const { fieldId, order, isValues } = matched;\n const key = isValues ? `values.${fieldId}` : fieldId;\n if (fieldIdToStorageIdIdMap[key]) {\n return `${fieldIdToStorageIdIdMap[key]}_${order}`;\n }\n\n return value;\n })\n .filter(Boolean) as string[];\n return createSort({\n fieldPlugins: sortPlugins,\n sort: transformedSort\n });\n};\n"],"mappings":"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","ignoreList":[]}
@@ -1,16 +1,9 @@
1
- /**
2
- * We use any for input and output because they really can be anything.
3
- * Plugin, if exists, makes sure that response value is correct.
4
- */
5
1
  import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
6
- import type { OpenSearchQuerySearchValuePlugins } from "./types.js";
2
+ import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
7
3
  interface Params {
8
- plugins: OpenSearchQuerySearchValuePlugins;
4
+ valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
9
5
  field: CmsModelField;
10
6
  value: any;
11
7
  }
12
- /**
13
- * Transformed value can be anything.
14
- */
15
8
  export declare const transformValueForSearch: (params: Params) => any;
16
9
  export {};
@@ -1,24 +1,14 @@
1
- /**
2
- * We use any for input and output because they really can be anything.
3
- * Plugin, if exists, makes sure that response value is correct.
4
- */
5
-
6
- import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
7
- /**
8
- * Transformed value can be anything.
9
- */
10
1
  export const transformValueForSearch = params => {
11
2
  const {
12
3
  field,
13
- plugins,
4
+ valueSearchRegistry,
14
5
  value
15
6
  } = params;
16
- const fieldType = getBaseFieldType(field);
17
- const plugin = plugins[fieldType];
18
- if (!plugin) {
7
+ const search = valueSearchRegistry.get(field.type);
8
+ if (!search) {
19
9
  return value;
20
10
  }
21
- return plugin.transform({
11
+ return search.transform({
22
12
  field,
23
13
  value
24
14
  });
@@ -1 +1 @@
1
- {"version":3,"names":["getBaseFieldType","transformValueForSearch","params","field","plugins","value","fieldType","plugin","transform"],"sources":["transformValueForSearch.ts"],"sourcesContent":["/**\n * We use any for input and output because they really can be anything.\n * Plugin, if exists, makes sure that response value is correct.\n */\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { OpenSearchQuerySearchValuePlugins } from \"./types.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\n\ninterface Params {\n plugins: OpenSearchQuerySearchValuePlugins;\n field: CmsModelField;\n value: any;\n}\n\n/**\n * Transformed value can be anything.\n */\nexport const transformValueForSearch = (params: Params): any => {\n const { field, plugins, value } = params;\n const fieldType = getBaseFieldType(field);\n const plugin = plugins[fieldType];\n if (!plugin) {\n return value;\n }\n return plugin.transform({ field, value });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAGA,SAASA,gBAAgB,QAAQ,oDAAoD;AAQrF;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAIC,MAAc,IAAU;EAC5D,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;EACxC,MAAMI,SAAS,GAAGN,gBAAgB,CAACG,KAAK,CAAC;EACzC,MAAMI,MAAM,GAAGH,OAAO,CAACE,SAAS,CAAC;EACjC,IAAI,CAACC,MAAM,EAAE;IACT,OAAOF,KAAK;EAChB;EACA,OAAOE,MAAM,CAACC,SAAS,CAAC;IAAEL,KAAK;IAAEE;EAAM,CAAC,CAAC;AAC7C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["transformValueForSearch","params","field","valueSearchRegistry","value","search","get","type","transform"],"sources":["transformValueForSearch.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\n\ninterface Params {\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n field: CmsModelField;\n value: any;\n}\n\nexport const transformValueForSearch = (params: Params): any => {\n const { field, valueSearchRegistry, value } = params;\n const search = valueSearchRegistry.get(field.type);\n if (!search) {\n return value;\n }\n return search.transform({ field, value });\n};\n"],"mappings":"AASA,OAAO,MAAMA,uBAAuB,GAAIC,MAAc,IAAU;EAC5D,MAAM;IAAEC,KAAK;IAAEC,mBAAmB;IAAEC;EAAM,CAAC,GAAGH,MAAM;EACpD,MAAMI,MAAM,GAAGF,mBAAmB,CAACG,GAAG,CAACJ,KAAK,CAACK,IAAI,CAAC;EAClD,IAAI,CAACF,MAAM,EAAE;IACT,OAAOD,KAAK;EAChB;EACA,OAAOC,MAAM,CAACG,SAAS,CAAC;IAAEN,KAAK;IAAEE;EAAM,CAAC,CAAC;AAC7C,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../../plugins/index.js";
2
1
  import type { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
3
2
  import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
4
3
  /**
@@ -32,10 +31,4 @@ export interface ModelFields {
32
31
  export interface OpenSearchQueryBuilderOperatorPlugins {
33
32
  [key: string]: OpenSearchQueryBuilderOperatorPlugin;
34
33
  }
35
- /**
36
- * ./plugins/search
37
- */
38
- export interface OpenSearchQuerySearchValuePlugins {
39
- [fieldType: string]: CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
40
- }
41
34
  export {};
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/index.js\";\nimport type { OpenSearchQueryBuilderOperatorPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\n\n/**\n * ./fields\n */\ntype ModelFieldPath = string | ((value: string) => string);\n\nexport type FieldType = \"text\" | \"date\" | \"datetime\" | \"time\" | \"number\" | \"boolean\" | string;\n\nexport interface ModelFieldParent {\n fieldId: string;\n storageId: string;\n type: FieldType;\n}\nexport interface ModelField {\n unmappedType?: string;\n keyword?: boolean;\n searchable: boolean;\n sortable: boolean;\n type: FieldType;\n systemField?: boolean;\n field: CmsModelField;\n path?: ModelFieldPath;\n fullTextSearch?: boolean;\n parents: ModelFieldParent[];\n}\n\nexport interface ModelFields {\n [fieldId: string]: ModelField;\n}\n\n/**\n * ./plugins/operator\n */\nexport interface OpenSearchQueryBuilderOperatorPlugins {\n [key: string]: OpenSearchQueryBuilderOperatorPlugin;\n}\n/**\n * ./plugins/search\n */\nexport interface OpenSearchQuerySearchValuePlugins {\n [fieldType: string]: CmsEntryElasticsearchQueryBuilderValueSearchPlugin;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { OpenSearchQueryBuilderOperatorPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\n\n/**\n * ./fields\n */\ntype ModelFieldPath = string | ((value: string) => string);\n\nexport type FieldType = \"text\" | \"date\" | \"datetime\" | \"time\" | \"number\" | \"boolean\" | string;\n\nexport interface ModelFieldParent {\n fieldId: string;\n storageId: string;\n type: FieldType;\n}\nexport interface ModelField {\n unmappedType?: string;\n keyword?: boolean;\n searchable: boolean;\n sortable: boolean;\n type: FieldType;\n systemField?: boolean;\n field: CmsModelField;\n path?: ModelFieldPath;\n fullTextSearch?: boolean;\n parents: ModelFieldParent[];\n}\n\nexport interface ModelFields {\n [fieldId: string]: ModelField;\n}\n\n/**\n * ./plugins/operator\n */\nexport interface OpenSearchQueryBuilderOperatorPlugins {\n [key: string]: OpenSearchQueryBuilderOperatorPlugin;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,12 +1,32 @@
1
1
  import type { Client } from "@webiny/api-opensearch";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
2
  import { type IOpenSearchEntity as IElasticsearchEntity } from "@webiny/api-opensearch";
3
+ import type { PluginsContainer } from "@webiny/plugins";
4
4
  import type { CmsEntryStorageOperations } from "../../types.js";
5
5
  import type { IEntryEntity } from "../../definitions/types.js";
6
+ import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
7
+ import { CompressionHandler } from "@webiny/utils/features/compression/abstractions/CompressionHandler.js";
8
+ import type { CmsEntryOpenSearchBodyModifier } from "../../features/CmsEntryOpenSearchBodyModifier/index.js";
9
+ import type { CmsEntryOpenSearchSortModifier } from "../../features/CmsEntryOpenSearchSortModifier/index.js";
10
+ import type { CmsEntryOpenSearchValuesModifier } from "../../features/CmsEntryOpenSearchValuesModifier/index.js";
11
+ import type { CmsEntryOpenSearchQueryModifier } from "../../features/CmsEntryOpenSearchQueryModifier/index.js";
12
+ import type { CmsEntryOpenSearchValueSearchRegistry } from "../../features/CmsEntryOpenSearchValueSearch/index.js";
13
+ import type { CmsEntryOpenSearchFullTextSearch } from "../../features/CmsEntryOpenSearchFullTextSearch/index.js";
14
+ import type { CmsEntryOpenSearchFieldIndexRegistry } from "../../features/CmsEntryOpenSearchFieldIndex/index.js";
15
+ import type { CmsEntryOpenSearchFilterRegistry } from "../../features/CmsEntryOpenSearchFilter/index.js";
6
16
  export interface CreateEntriesStorageOperationsParams {
7
17
  entity: IEntryEntity;
8
18
  esEntity: IElasticsearchEntity;
9
19
  elasticsearch: Client;
10
20
  plugins: PluginsContainer;
21
+ fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
22
+ fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;
23
+ compressionHandler: CompressionHandler.Interface;
24
+ bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[];
25
+ sortModifiers: CmsEntryOpenSearchSortModifier.Interface[];
26
+ queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[];
27
+ valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
28
+ fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[];
29
+ valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[];
30
+ filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface;
11
31
  }
12
32
  export declare const createEntriesStorageOperations: (params: CreateEntriesStorageOperationsParams) => CmsEntryStorageOperations;
@@ -1,10 +1,11 @@
1
- import WebinyError from "@webiny/error";
1
+ import { WebinyError } from "@webiny/error";
2
2
  import { CONTENT_ENTRY_STATUS } from "@webiny/api-headless-cms/types/index.js";
3
3
  import { extractEntriesFromIndex } from "../../helpers/index.js";
4
4
  import { configurations } from "../../configurations.js";
5
+ import { createLimit, decodeCursor, encodeCursor } from "@webiny/api-opensearch";
5
6
  import { DataLoadersHandler } from "./dataLoaders.js";
6
7
  import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys, createLatestSortKey, createPartitionKey, createPublishedSortKey, createRevisionSortKey } from "./keys.js";
7
- import { compress, createLimit, decodeCursor, decompress, encodeCursor } from "@webiny/api-opensearch";
8
+ import { getTotalCount } from "@webiny/api-opensearch/types.js";
8
9
  import { createElasticsearchBody } from "./elasticsearch/body.js";
9
10
  import { shouldIgnoreEsResponseError } from "./elasticsearch/shouldIgnoreEsResponseError.js";
10
11
  import { StorageOperationsCmsModelPlugin } from "@webiny/api-headless-cms";
@@ -30,7 +31,17 @@ export const createEntriesStorageOperations = params => {
30
31
  entity,
31
32
  esEntity,
32
33
  elasticsearch,
33
- plugins
34
+ plugins,
35
+ fieldRegistry,
36
+ fieldIndexRegistry,
37
+ compressionHandler,
38
+ bodyModifiers,
39
+ sortModifiers,
40
+ queryModifiers,
41
+ valueSearchRegistry,
42
+ fullTextSearches,
43
+ valuesModifiers,
44
+ filterRegistry
34
45
  } = params;
35
46
  let storageOperationsCmsModelPlugin;
36
47
  const getStorageOperationsCmsModelPlugin = () => {
@@ -58,10 +69,13 @@ export const createEntriesStorageOperations = params => {
58
69
  initialEntry.locked = locked;
59
70
  initialStorageEntry.locked = locked;
60
71
  const transformer = createTransformer({
61
- plugins,
72
+ fieldRegistry,
73
+ fieldIndexRegistry,
62
74
  model,
63
75
  entry: initialEntry,
64
- storageEntry: initialStorageEntry
76
+ storageEntry: initialStorageEntry,
77
+ compressionHandler,
78
+ valuesModifiers
65
79
  });
66
80
  const {
67
81
  entry,
@@ -146,10 +160,13 @@ export const createEntriesStorageOperations = params => {
146
160
  } = params;
147
161
  const model = getStorageOperationsModel(initialModel);
148
162
  const transformer = createTransformer({
149
- plugins,
150
163
  model,
151
164
  entry: initialEntry,
152
- storageEntry: initialStorageEntry
165
+ storageEntry: initialStorageEntry,
166
+ fieldRegistry,
167
+ fieldIndexRegistry,
168
+ compressionHandler,
169
+ valuesModifiers
153
170
  });
154
171
  const {
155
172
  entry,
@@ -245,10 +262,13 @@ export const createEntriesStorageOperations = params => {
245
262
  } = params;
246
263
  const model = getStorageOperationsModel(initialModel);
247
264
  const transformer = createTransformer({
248
- plugins,
265
+ valuesModifiers,
249
266
  model,
250
267
  entry: initialEntry,
251
- storageEntry: initialStorageEntry
268
+ storageEntry: initialStorageEntry,
269
+ fieldRegistry,
270
+ fieldIndexRegistry,
271
+ compressionHandler
252
272
  });
253
273
  const {
254
274
  entry,
@@ -355,8 +375,8 @@ export const createEntriesStorageOperations = params => {
355
375
  */
356
376
  const latestEsEntry = await esEntity.getClean(latestKeys);
357
377
  if (latestEsEntry) {
358
- const latestEsEntryDataDecompressed = await decompress(plugins, latestEsEntry.data);
359
- const updatedLatestEntry = await compress(plugins, {
378
+ const latestEsEntryDataDecompressed = await compressionHandler.decompress(latestEsEntry.data);
379
+ const updatedLatestEntry = await compressionHandler.compress({
360
380
  ...latestEsEntryDataDecompressed,
361
381
  ...updatedEntryLevelMetaFields
362
382
  });
@@ -477,7 +497,7 @@ export const createEntriesStorageOperations = params => {
477
497
  }
478
498
  return {
479
499
  ...record,
480
- data: await decompress(plugins, record.data)
500
+ data: await compressionHandler.decompress(record.data)
481
501
  };
482
502
  }))).filter(item => !!item);
483
503
  if (esItems.length === 0) {
@@ -488,7 +508,7 @@ export const createEntriesStorageOperations = params => {
488
508
  put: await Promise.all(esItems.map(async item => {
489
509
  return {
490
510
  ...item,
491
- data: await compress(plugins, {
511
+ data: await compressionHandler.compress({
492
512
  ...item.data,
493
513
  location: {
494
514
  ...item.data?.location,
@@ -513,10 +533,13 @@ export const createEntriesStorageOperations = params => {
513
533
  } = params;
514
534
  const model = getStorageOperationsModel(initialModel);
515
535
  const transformer = createTransformer({
516
- plugins,
536
+ valuesModifiers,
517
537
  model,
518
538
  entry: initialEntry,
519
- storageEntry: initialStorageEntry
539
+ storageEntry: initialStorageEntry,
540
+ fieldRegistry,
541
+ fieldIndexRegistry,
542
+ compressionHandler
520
543
  });
521
544
  const {
522
545
  entry,
@@ -615,7 +638,7 @@ export const createEntriesStorageOperations = params => {
615
638
  }
616
639
  return {
617
640
  ...record,
618
- data: await decompress(plugins, record.data)
641
+ data: await compressionHandler.decompress(record.data)
619
642
  };
620
643
  }))).filter(item => !!item);
621
644
  if (esItems.length === 0) {
@@ -629,7 +652,7 @@ export const createEntriesStorageOperations = params => {
629
652
  for (const item of esItems) {
630
653
  elasticsearchEntityBatch.put({
631
654
  ...item,
632
- data: await compress(plugins, {
655
+ data: await compressionHandler.compress({
633
656
  ...item.data,
634
657
  ...updatedEntryMetaFields,
635
658
  wbyDeleted: entry.wbyDeleted,
@@ -659,10 +682,13 @@ export const createEntriesStorageOperations = params => {
659
682
  } = params;
660
683
  const model = getStorageOperationsModel(initialModel);
661
684
  const transformer = createTransformer({
662
- plugins,
685
+ valuesModifiers,
663
686
  model,
664
687
  entry: initialEntry,
665
- storageEntry: initialStorageEntry
688
+ storageEntry: initialStorageEntry,
689
+ fieldRegistry,
690
+ fieldIndexRegistry,
691
+ compressionHandler
666
692
  });
667
693
  const {
668
694
  entry,
@@ -758,7 +784,7 @@ export const createEntriesStorageOperations = params => {
758
784
  }
759
785
  return {
760
786
  ...record,
761
- data: await decompress(plugins, record.data)
787
+ data: await compressionHandler.decompress(record.data)
762
788
  };
763
789
  }))).filter(item => !!item);
764
790
  if (esItems.length === 0) {
@@ -772,7 +798,7 @@ export const createEntriesStorageOperations = params => {
772
798
  for (const item of esItems) {
773
799
  elasticsearchEntityBatch.put({
774
800
  ...item,
775
- data: await compress(plugins, {
801
+ data: await compressionHandler.compress({
776
802
  ...item.data,
777
803
  ...updatedEntryMetaFields,
778
804
  wbyDeleted: entry.wbyDeleted,
@@ -926,10 +952,13 @@ export const createEntriesStorageOperations = params => {
926
952
  data: latestStorageEntry
927
953
  });
928
954
  const latestTransformer = createTransformer({
929
- plugins,
955
+ valuesModifiers,
930
956
  model,
931
957
  entry: latestEntry,
932
- storageEntry: initialLatestStorageEntry
958
+ storageEntry: initialLatestStorageEntry,
959
+ fieldRegistry,
960
+ fieldIndexRegistry,
961
+ compressionHandler
933
962
  });
934
963
  const esLatestData = await latestTransformer.getElasticsearchLatestEntryData();
935
964
  const esLatestKeys = createEntryLatestKeys(latestEntry);
@@ -1045,6 +1074,14 @@ export const createEntriesStorageOperations = params => {
1045
1074
  });
1046
1075
  const body = createElasticsearchBody({
1047
1076
  model,
1077
+ fieldRegistry,
1078
+ fieldIndexRegistry,
1079
+ bodyModifiers,
1080
+ sortModifiers,
1081
+ queryModifiers,
1082
+ valueSearchRegistry,
1083
+ fullTextSearches,
1084
+ filterRegistry,
1048
1085
  params: {
1049
1086
  ...params,
1050
1087
  limit,
@@ -1081,9 +1118,10 @@ export const createEntriesStorageOperations = params => {
1081
1118
  const {
1082
1119
  hits,
1083
1120
  total
1084
- } = response?.body?.hits || {};
1121
+ } = response.body.hits;
1085
1122
  const items = extractEntriesFromIndex({
1086
- plugins,
1123
+ fieldRegistry,
1124
+ fieldIndexRegistry,
1087
1125
  model,
1088
1126
  entries: hits.map(item => {
1089
1127
  return item._source;
@@ -1108,7 +1146,7 @@ export const createEntriesStorageOperations = params => {
1108
1146
  const cursor = items.length > 0 ? encodeCursor(hits[items.length - 1].sort) || null : null;
1109
1147
  return {
1110
1148
  hasMoreItems,
1111
- totalCount: total.value,
1149
+ totalCount: getTotalCount(total),
1112
1150
  cursor,
1113
1151
  items
1114
1152
  };
@@ -1130,10 +1168,13 @@ export const createEntriesStorageOperations = params => {
1130
1168
  } = params;
1131
1169
  const model = getStorageOperationsModel(initialModel);
1132
1170
  const transformer = createTransformer({
1133
- plugins,
1171
+ valuesModifiers,
1134
1172
  model,
1135
1173
  entry: initialEntry,
1136
- storageEntry: initialStorageEntry
1174
+ storageEntry: initialStorageEntry,
1175
+ fieldRegistry,
1176
+ fieldIndexRegistry,
1177
+ compressionHandler
1137
1178
  });
1138
1179
  const {
1139
1180
  entry,
@@ -1295,18 +1336,21 @@ export const createEntriesStorageOperations = params => {
1295
1336
  * No need to transform it for the storage because it was fetched
1296
1337
  * directly from the Elasticsearch table, where it sits transformed.
1297
1338
  */
1298
- const latestEsEntryDataDecompressed = await decompress(plugins, latestEsEntry.data);
1339
+ const latestEsEntryDataDecompressed = await compressionHandler.decompress(latestEsEntry.data);
1299
1340
  if (publishingLatestRevision) {
1300
1341
  const updatedMetaFields = pickEntryMetaFields(entry);
1301
1342
  const latestTransformer = createTransformer({
1302
- plugins,
1343
+ valuesModifiers,
1303
1344
  model,
1304
1345
  transformedToIndex: {
1305
1346
  ...latestEsEntryDataDecompressed,
1306
1347
  status: CONTENT_ENTRY_STATUS.PUBLISHED,
1307
1348
  locked: true,
1308
1349
  ...updatedMetaFields
1309
- }
1350
+ },
1351
+ fieldRegistry,
1352
+ fieldIndexRegistry,
1353
+ compressionHandler
1310
1354
  });
1311
1355
  const esEntryLatestKeys = createEntryLatestKeys(latestEsEntryDataDecompressed);
1312
1356
  elasticsearchEntityWriter.put({
@@ -1322,12 +1366,12 @@ export const createEntriesStorageOperations = params => {
1322
1366
  */
1323
1367
  const latestEsEntry = await esEntity.getClean(latestKeys);
1324
1368
  if (latestEsEntry) {
1325
- const latestEsEntryDataDecompressed = await decompress(plugins, latestEsEntry.data);
1369
+ const latestEsEntryDataDecompressed = await compressionHandler.decompress(latestEsEntry.data);
1326
1370
  let latestRevisionStatus = latestEsEntryDataDecompressed.status;
1327
1371
  if (latestRevisionStatus === CONTENT_ENTRY_STATUS.PUBLISHED) {
1328
1372
  latestRevisionStatus = CONTENT_ENTRY_STATUS.UNPUBLISHED;
1329
1373
  }
1330
- const updatedLatestEntry = await compress(plugins, {
1374
+ const updatedLatestEntry = await compressionHandler.compress({
1331
1375
  ...latestEsEntryDataDecompressed,
1332
1376
  ...updatedEntryLevelMetaFields,
1333
1377
  status: latestRevisionStatus
@@ -1378,10 +1422,13 @@ export const createEntriesStorageOperations = params => {
1378
1422
  } = params;
1379
1423
  const model = getStorageOperationsModel(initialModel);
1380
1424
  const transformer = createTransformer({
1381
- plugins,
1425
+ valuesModifiers,
1382
1426
  model,
1383
1427
  entry: initialEntry,
1384
- storageEntry: initialStorageEntry
1428
+ storageEntry: initialStorageEntry,
1429
+ fieldRegistry,
1430
+ fieldIndexRegistry,
1431
+ compressionHandler
1385
1432
  });
1386
1433
  const {
1387
1434
  entry,
@@ -1617,6 +1664,14 @@ export const createEntriesStorageOperations = params => {
1617
1664
  });
1618
1665
  const initialBody = createElasticsearchBody({
1619
1666
  model,
1667
+ fieldRegistry,
1668
+ fieldIndexRegistry,
1669
+ bodyModifiers,
1670
+ sortModifiers,
1671
+ queryModifiers,
1672
+ valueSearchRegistry,
1673
+ fullTextSearches,
1674
+ filterRegistry,
1620
1675
  params: {
1621
1676
  limit: 1,
1622
1677
  where
@@ -1661,11 +1716,13 @@ export const createEntriesStorageOperations = params => {
1661
1716
  body
1662
1717
  });
1663
1718
  }
1664
- const buckets = response.body.aggregations["getUniqueFieldValues"]?.buckets || [];
1665
- return buckets.map(file => {
1719
+ const aggregations = response.body.aggregations || {};
1720
+ const agg = aggregations["getUniqueFieldValues"];
1721
+ const buckets = agg && "buckets" in agg && Array.isArray(agg.buckets) ? agg.buckets : [];
1722
+ return buckets.map(bucket => {
1666
1723
  return {
1667
- value: file.key,
1668
- count: file.doc_count
1724
+ value: bucket.key,
1725
+ count: bucket.doc_count
1669
1726
  };
1670
1727
  });
1671
1728
  };