@webiny/api-headless-cms-ddb-es 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.e6f0dc8ca7

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 (431) hide show
  1. package/README.md +6 -30
  2. package/configurations.d.ts +7 -7
  3. package/configurations.js +16 -26
  4. package/configurations.js.map +1 -1
  5. package/definitions/entry.d.ts +4 -6
  6. package/definitions/entry.js +5 -174
  7. package/definitions/entry.js.map +1 -1
  8. package/definitions/group.d.ts +6 -7
  9. package/definitions/group.js +5 -58
  10. package/definitions/group.js.map +1 -1
  11. package/definitions/model.d.ts +6 -7
  12. package/definitions/model.js +5 -102
  13. package/definitions/model.js.map +1 -1
  14. package/definitions/types.d.ts +61 -0
  15. package/definitions/types.js +3 -0
  16. package/definitions/types.js.map +1 -0
  17. package/elasticsearch/createElasticsearchIndex.d.ts +4 -4
  18. package/elasticsearch/createElasticsearchIndex.js +61 -27
  19. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  20. package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
  21. package/elasticsearch/deleteElasticsearchIndex.js +3 -10
  22. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  23. package/exports/api/cms/opensearch.d.ts +9 -0
  24. package/exports/api/cms/opensearch.js +11 -0
  25. package/exports/api/cms/opensearch.js.map +1 -0
  26. package/feature.d.ts +1 -0
  27. package/feature.js +188 -0
  28. package/feature.js.map +1 -0
  29. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  30. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +4 -0
  31. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  32. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  33. package/features/CmsEntryOpenSearchBodyModifier/index.js +3 -0
  34. package/features/CmsEntryOpenSearchBodyModifier/index.js.map +1 -0
  35. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +13 -0
  36. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +36 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +35 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +4 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +4 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/constants.js +3 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  47. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
  48. package/features/CmsEntryOpenSearchFieldIndex/feature.js +24 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  50. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  51. package/{elasticsearch/indexing/dateTimeIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js} +21 -32
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +10 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +39 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +22 -0
  58. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  59. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  60. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +25 -0
  61. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  62. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  63. package/{elasticsearch/indexing/numberIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js} +11 -15
  64. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  65. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +10 -0
  66. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +158 -0
  67. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  68. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  69. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +22 -0
  70. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  71. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  72. package/features/CmsEntryOpenSearchFieldIndex/index.js +5 -0
  73. package/features/CmsEntryOpenSearchFieldIndex/index.js.map +1 -0
  74. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  75. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +38 -0
  76. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  77. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  78. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +4 -0
  79. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  80. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  81. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +4 -0
  82. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  83. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  84. package/features/CmsEntryOpenSearchFilter/constants.js +3 -0
  85. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  86. package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
  87. package/features/CmsEntryOpenSearchFilter/feature.js +16 -0
  88. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  89. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  90. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +23 -0
  91. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  92. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  93. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +61 -0
  94. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  95. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  96. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +49 -0
  97. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  98. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  99. package/features/CmsEntryOpenSearchFilter/index.js +5 -0
  100. package/features/CmsEntryOpenSearchFilter/index.js.map +1 -0
  101. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  102. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +4 -0
  103. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  104. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  105. package/features/CmsEntryOpenSearchFullTextSearch/index.js +3 -0
  106. package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +1 -0
  107. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  108. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +16 -0
  109. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  110. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  111. package/features/CmsEntryOpenSearchIndex/abstractions.js +4 -0
  112. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  113. package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
  114. package/features/CmsEntryOpenSearchIndex/feature.js +10 -0
  115. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  116. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  117. package/features/CmsEntryOpenSearchIndex/index.js +5 -0
  118. package/features/CmsEntryOpenSearchIndex/index.js.map +1 -0
  119. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  120. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +4 -0
  121. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  122. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  123. package/features/CmsEntryOpenSearchQueryModifier/index.js +3 -0
  124. package/features/CmsEntryOpenSearchQueryModifier/index.js.map +1 -0
  125. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  126. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +4 -0
  127. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  128. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  129. package/features/CmsEntryOpenSearchSortModifier/index.js +3 -0
  130. package/features/CmsEntryOpenSearchSortModifier/index.js.map +1 -0
  131. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  132. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +27 -0
  133. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  134. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  135. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +4 -0
  136. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  137. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  138. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +4 -0
  139. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  140. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
  141. package/features/CmsEntryOpenSearchValueSearch/feature.js +16 -0
  142. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  143. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  144. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +23 -0
  145. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  146. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  147. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +55 -0
  148. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  149. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  150. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +24 -0
  151. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  152. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  153. package/features/CmsEntryOpenSearchValueSearch/index.js +5 -0
  154. package/features/CmsEntryOpenSearchValueSearch/index.js.map +1 -0
  155. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  156. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +4 -0
  157. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  158. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  159. package/features/CmsEntryOpenSearchValuesModifier/index.js +3 -0
  160. package/features/CmsEntryOpenSearchValuesModifier/index.js.map +1 -0
  161. package/helpers/entryIndexHelpers.d.ts +13 -11
  162. package/helpers/entryIndexHelpers.js +38 -94
  163. package/helpers/entryIndexHelpers.js.map +1 -1
  164. package/helpers/fieldIdentifier.d.ts +1 -1
  165. package/helpers/fieldIdentifier.js +2 -10
  166. package/helpers/fieldIdentifier.js.map +1 -1
  167. package/helpers/index.d.ts +2 -2
  168. package/helpers/index.js +2 -27
  169. package/helpers/index.js.map +1 -1
  170. package/index.d.ts +1 -3
  171. package/index.js +1 -223
  172. package/index.js.map +1 -1
  173. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -2
  174. package/operations/entry/dataLoader/DataLoaderCache.js +3 -13
  175. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  176. package/operations/entry/dataLoader/constants.js +1 -7
  177. package/operations/entry/dataLoader/constants.js.map +1 -1
  178. package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
  179. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  180. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  181. package/operations/entry/dataLoader/getAllEntryRevisions.js +16 -26
  182. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  183. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  184. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +23 -31
  185. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  186. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  187. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +23 -31
  188. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  189. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  190. package/operations/entry/dataLoader/getRevisionById.js +26 -34
  191. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  192. package/operations/entry/dataLoader/index.d.ts +3 -3
  193. package/operations/entry/dataLoader/index.js +10 -31
  194. package/operations/entry/dataLoader/index.js.map +1 -1
  195. package/operations/entry/dataLoader/types.d.ts +4 -4
  196. package/operations/entry/dataLoader/types.js +1 -5
  197. package/operations/entry/dataLoader/types.js.map +1 -1
  198. package/operations/entry/dataLoaders.d.ts +13 -13
  199. package/operations/entry/dataLoaders.js +16 -24
  200. package/operations/entry/dataLoaders.js.map +1 -1
  201. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  202. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -8
  203. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  204. package/operations/entry/elasticsearch/body.d.ts +20 -4
  205. package/operations/entry/elasticsearch/body.js +49 -53
  206. package/operations/entry/elasticsearch/body.js.map +1 -1
  207. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
  208. package/operations/entry/elasticsearch/fields/createSystemField.js +10 -0
  209. package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
  210. package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
  211. package/operations/entry/elasticsearch/fields/live.js +45 -0
  212. package/operations/entry/elasticsearch/fields/live.js.map +1 -0
  213. package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
  214. package/operations/entry/elasticsearch/fields/location.js +45 -0
  215. package/operations/entry/elasticsearch/fields/location.js.map +1 -0
  216. package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
  217. package/operations/entry/elasticsearch/fields/state.js +93 -0
  218. package/operations/entry/elasticsearch/fields/state.js.map +1 -0
  219. package/operations/entry/elasticsearch/fields.d.ts +8 -6
  220. package/operations/entry/elasticsearch/fields.js +38 -122
  221. package/operations/entry/elasticsearch/fields.js.map +1 -1
  222. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +6 -5
  223. package/operations/entry/elasticsearch/filtering/applyFiltering.js +13 -20
  224. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  225. package/operations/entry/elasticsearch/filtering/exec.d.ts +11 -6
  226. package/operations/entry/elasticsearch/filtering/exec.js +47 -97
  227. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  228. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
  229. package/operations/entry/elasticsearch/filtering/index.js +1 -16
  230. package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
  231. package/operations/entry/elasticsearch/filtering/path.d.ts +5 -3
  232. package/operations/entry/elasticsearch/filtering/path.js +10 -20
  233. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  234. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -2
  235. package/operations/entry/elasticsearch/filtering/populated.js +1 -8
  236. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  237. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  238. package/operations/entry/elasticsearch/filtering/values.js +4 -12
  239. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  240. package/operations/entry/elasticsearch/fullTextSearch.d.ts +7 -6
  241. package/operations/entry/elasticsearch/fullTextSearch.js +39 -42
  242. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  243. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +4 -4
  244. package/operations/entry/elasticsearch/fullTextSearchFields.js +11 -18
  245. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  246. package/operations/entry/elasticsearch/initialQuery.d.ts +4 -4
  247. package/operations/entry/elasticsearch/initialQuery.js +9 -27
  248. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  249. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  250. package/operations/entry/elasticsearch/keyword.js +4 -9
  251. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  252. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -3
  253. package/operations/entry/elasticsearch/plugins/operator.js +4 -19
  254. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  255. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +2 -9
  256. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  257. package/operations/entry/elasticsearch/sort.d.ts +6 -6
  258. package/operations/entry/elasticsearch/sort.js +52 -36
  259. package/operations/entry/elasticsearch/sort.js.map +1 -1
  260. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +3 -10
  261. package/operations/entry/elasticsearch/transformValueForSearch.js +5 -20
  262. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  263. package/operations/entry/elasticsearch/types.d.ts +4 -11
  264. package/operations/entry/elasticsearch/types.js +1 -5
  265. package/operations/entry/elasticsearch/types.js.map +1 -1
  266. package/operations/entry/index.d.ts +26 -5
  267. package/operations/entry/index.js +421 -541
  268. package/operations/entry/index.js.map +1 -1
  269. package/operations/entry/keys.d.ts +31 -1
  270. package/operations/entry/keys.js +56 -19
  271. package/operations/entry/keys.js.map +1 -1
  272. package/operations/entry/recordType.js +3 -12
  273. package/operations/entry/recordType.js.map +1 -1
  274. package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
  275. package/operations/entry/transformations/convertEntryKeys.js +2 -10
  276. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  277. package/operations/entry/transformations/index.d.ts +24 -18
  278. package/operations/entry/transformations/index.js +31 -37
  279. package/operations/entry/transformations/index.js.map +1 -1
  280. package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
  281. package/operations/entry/transformations/modifyEntryValues.js +4 -11
  282. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  283. package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
  284. package/operations/entry/transformations/transformEntryKeys.js +4 -11
  285. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  286. package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -8
  287. package/operations/entry/transformations/transformEntryToIndex.js +9 -14
  288. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  289. package/operations/group/index.d.ts +7 -6
  290. package/operations/group/index.js +41 -78
  291. package/operations/group/index.js.map +1 -1
  292. package/operations/model/index.d.ts +4 -4
  293. package/operations/model/index.js +38 -58
  294. package/operations/model/index.js.map +1 -1
  295. package/package.json +32 -34
  296. package/tasks/createIndexTaskPlugin.d.ts +2 -2
  297. package/tasks/createIndexTaskPlugin.js +41 -60
  298. package/tasks/createIndexTaskPlugin.js.map +1 -1
  299. package/types.d.ts +26 -134
  300. package/types.js +2 -28
  301. package/types.js.map +1 -1
  302. package/values/NoValueContainer.d.ts +5 -0
  303. package/values/NoValueContainer.js +13 -0
  304. package/values/NoValueContainer.js.map +1 -0
  305. package/definitions/entryElasticsearch.d.ts +0 -9
  306. package/definitions/entryElasticsearch.js +0 -41
  307. package/definitions/entryElasticsearch.js.map +0 -1
  308. package/definitions/system.d.ts +0 -9
  309. package/definitions/system.js +0 -42
  310. package/definitions/system.js.map +0 -1
  311. package/definitions/table.d.ts +0 -8
  312. package/definitions/table.js +0 -25
  313. package/definitions/table.js.map +0 -1
  314. package/definitions/tableElasticsearch.d.ts +0 -8
  315. package/definitions/tableElasticsearch.js +0 -25
  316. package/definitions/tableElasticsearch.js.map +0 -1
  317. package/dynamoDb/index.d.ts +0 -3
  318. package/dynamoDb/index.js +0 -16
  319. package/dynamoDb/index.js.map +0 -1
  320. package/dynamoDb/storage/longText.d.ts +0 -10
  321. package/dynamoDb/storage/longText.js +0 -96
  322. package/dynamoDb/storage/longText.js.map +0 -1
  323. package/dynamoDb/storage/richText.d.ts +0 -2
  324. package/dynamoDb/storage/richText.js +0 -59
  325. package/dynamoDb/storage/richText.js.map +0 -1
  326. package/elasticsearch/index.d.ts +0 -2
  327. package/elasticsearch/index.js +0 -13
  328. package/elasticsearch/index.js.map +0 -1
  329. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  330. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  331. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  332. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -54
  333. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  334. package/elasticsearch/indexing/index.d.ts +0 -2
  335. package/elasticsearch/indexing/index.js +0 -18
  336. package/elasticsearch/indexing/index.js.map +0 -1
  337. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  338. package/elasticsearch/indexing/jsonIndexing.js +0 -28
  339. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  340. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  341. package/elasticsearch/indexing/longTextIndexing.js +0 -42
  342. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  343. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  344. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  345. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  346. package/elasticsearch/indexing/objectIndexing.js +0 -201
  347. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  348. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  349. package/elasticsearch/indexing/richTextIndexing.js +0 -31
  350. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  351. package/elasticsearch/indices/base.d.ts +0 -2
  352. package/elasticsearch/indices/base.js +0 -13
  353. package/elasticsearch/indices/base.js.map +0 -1
  354. package/elasticsearch/indices/index.d.ts +0 -1
  355. package/elasticsearch/indices/index.js +0 -14
  356. package/elasticsearch/indices/index.js.map +0 -1
  357. package/elasticsearch/indices/japanese.d.ts +0 -2
  358. package/elasticsearch/indices/japanese.js +0 -14
  359. package/elasticsearch/indices/japanese.js.map +0 -1
  360. package/elasticsearch/search/index.d.ts +0 -3
  361. package/elasticsearch/search/index.js +0 -12
  362. package/elasticsearch/search/index.js.map +0 -1
  363. package/elasticsearch/search/refSearch.d.ts +0 -2
  364. package/elasticsearch/search/refSearch.js +0 -31
  365. package/elasticsearch/search/refSearch.js.map +0 -1
  366. package/elasticsearch/search/timeSearch.d.ts +0 -2
  367. package/elasticsearch/search/timeSearch.js +0 -27
  368. package/elasticsearch/search/timeSearch.js.map +0 -1
  369. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  370. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -30
  371. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  372. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  373. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -15
  374. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  375. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  376. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -69
  377. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  378. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  379. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -57
  380. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  381. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
  382. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
  383. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
  384. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  385. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -18
  386. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  387. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  388. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -18
  389. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  390. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  391. package/operations/entry/elasticsearch/plugins/search.js +0 -26
  392. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  393. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  394. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -18
  395. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  396. package/operations/system/index.d.ts +0 -6
  397. package/operations/system/index.js +0 -94
  398. package/operations/system/index.js.map +0 -1
  399. package/operations/system/indexes.d.ts +0 -10
  400. package/operations/system/indexes.js +0 -41
  401. package/operations/system/indexes.js.map +0 -1
  402. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  403. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -52
  404. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  405. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  406. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -21
  407. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  408. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  409. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -27
  410. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  411. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  412. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -13
  413. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  414. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -31
  415. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -40
  416. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  417. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  418. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -21
  419. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  420. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  421. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -21
  422. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  423. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  424. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -50
  425. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  426. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  427. package/plugins/CmsEntryFilterPlugin.js +0 -22
  428. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  429. package/plugins/index.d.ts +0 -8
  430. package/plugins/index.js +0 -95
  431. package/plugins/index.js.map +0 -1
@@ -1,18 +1,33 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createElasticsearchSort = void 0;
7
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
8
- var _keyword = require("./keyword");
9
- var _search = require("./plugins/search");
10
- var _path = require("./filtering/path");
11
- const createElasticsearchSort = params => {
1
+ import { createSort, OpenSearchFieldPlugin } from "@webiny/api-opensearch";
2
+ import { hasKeyword } from "./keyword.js";
3
+ import { createFieldPathFactory } from "./filtering/path.js";
4
+ import { NoValueContainer } from "../../../values/NoValueContainer.js";
5
+ const matchField = input => {
6
+ const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
7
+ if (valuesMatch) {
8
+ const [, fieldId, order] = valuesMatch;
9
+ return {
10
+ fieldId,
11
+ isValues: true,
12
+ order: order
13
+ };
14
+ }
15
+ const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
16
+ if (!nonValues) {
17
+ return null;
18
+ }
19
+ const [, fieldId, order] = nonValues;
20
+ return {
21
+ fieldId,
22
+ isValues: false,
23
+ order: order
24
+ };
25
+ };
26
+ export const createElasticsearchSort = params => {
12
27
  const {
13
28
  sort,
14
29
  modelFields,
15
- plugins
30
+ valueSearchRegistry
16
31
  } = params;
17
32
  if (!sort || sort.length === 0) {
18
33
  return [{
@@ -21,39 +36,36 @@ const createElasticsearchSort = params => {
21
36
  }
22
37
  }];
23
38
  }
24
- const searchPlugins = (0, _search.createSearchPluginList)({
25
- plugins
26
- });
27
- const createFieldPath = (0, _path.createFieldPathFactory)({
28
- plugins: searchPlugins
39
+ const createFieldPath = createFieldPathFactory({
40
+ valueSearchRegistry
29
41
  });
30
42
  const fieldIdToStorageIdIdMap = {};
31
43
  const sortPlugins = Object.values(modelFields).reduce((plugins, field) => {
32
44
  /**
33
45
  * We do not support sorting by nested fields.
34
46
  */
35
- if (field.parents.length > 0) {
47
+ const isValues = field.parents.length === 1 && field.parents[0].fieldId === "values";
48
+ if (field.parents.length > 0 && !isValues) {
36
49
  return plugins;
37
50
  }
38
- const {
39
- fieldId,
40
- storageId
41
- } = field.field;
42
- fieldIdToStorageIdIdMap[fieldId] = fieldId;
51
+ const fieldId = field.field.fieldId;
52
+ const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;
53
+ fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;
43
54
  const {
44
55
  path
45
56
  } = createFieldPath({
46
- key: storageId,
57
+ key: field.field.storageId,
47
58
  field,
48
- value: "",
49
- keyword: false
59
+ value: NoValueContainer.create(),
60
+ keyword: false,
61
+ originalValue: NoValueContainer.create()
50
62
  });
51
63
  /**
52
64
  * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.
53
65
  */
54
- plugins[fieldId] = new _apiElasticsearch.ElasticsearchFieldPlugin({
66
+ plugins[fieldIdPath] = new OpenSearchFieldPlugin({
55
67
  unmappedType: field.unmappedType,
56
- keyword: (0, _keyword.hasKeyword)(field),
68
+ keyword: hasKeyword(field),
57
69
  sortable: field.sortable,
58
70
  searchable: field.searchable,
59
71
  field: fieldId,
@@ -61,27 +73,31 @@ const createElasticsearchSort = params => {
61
73
  });
62
74
  return plugins;
63
75
  }, {
64
- ["*"]: new _apiElasticsearch.ElasticsearchFieldPlugin({
65
- field: _apiElasticsearch.ElasticsearchFieldPlugin.ALL,
76
+ ["*"]: new OpenSearchFieldPlugin({
77
+ field: OpenSearchFieldPlugin.ALL,
66
78
  keyword: false
67
79
  })
68
80
  });
69
81
  const transformedSort = sort.map(value => {
70
- const matched = value.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
82
+ const matched = matchField(value);
71
83
  if (!matched) {
72
84
  return null;
73
85
  }
74
- const [, fieldId, order] = matched;
75
- if (fieldIdToStorageIdIdMap[fieldId]) {
76
- return `${fieldIdToStorageIdIdMap[fieldId]}_${order}`;
86
+ const {
87
+ fieldId,
88
+ order,
89
+ isValues
90
+ } = matched;
91
+ const key = isValues ? `values.${fieldId}` : fieldId;
92
+ if (fieldIdToStorageIdIdMap[key]) {
93
+ return `${fieldIdToStorageIdIdMap[key]}_${order}`;
77
94
  }
78
95
  return value;
79
96
  }).filter(Boolean);
80
- return (0, _apiElasticsearch.createSort)({
97
+ return createSort({
81
98
  fieldPlugins: sortPlugins,
82
99
  sort: transformedSort
83
100
  });
84
101
  };
85
- exports.createElasticsearchSort = createElasticsearchSort;
86
102
 
87
103
  //# sourceMappingURL=sort.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearch","require","_keyword","_search","_path","createElasticsearchSort","params","sort","modelFields","plugins","length","order","searchPlugins","createSearchPluginList","createFieldPath","createFieldPathFactory","fieldIdToStorageIdIdMap","sortPlugins","Object","values","reduce","field","parents","fieldId","storageId","path","key","value","keyword","ElasticsearchFieldPlugin","unmappedType","hasKeyword","sortable","searchable","ALL","transformedSort","map","matched","match","filter","Boolean","createSort","fieldPlugins","exports"],"sources":["sort.ts"],"sourcesContent":["import type { Sort as esSort } from \"@webiny/api-elasticsearch/types\";\nimport { createSort, ElasticsearchFieldPlugin } from \"@webiny/api-elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { CmsEntryListSort, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport type { ModelFields } from \"./types\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword\";\nimport { createSearchPluginList } from \"~/operations/entry/elasticsearch/plugins/search\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path\";\n\ninterface Params {\n plugins: PluginsContainer;\n sort?: CmsEntryListSort;\n modelFields: ModelFields;\n model: CmsModel;\n}\nexport const createElasticsearchSort = (params: Params): esSort => {\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, ElasticsearchFieldPlugin>>(\n (plugins, field) => {\n /**\n * We do not support sorting by nested fields.\n */\n if (field.parents.length > 0) {\n return plugins;\n }\n const { fieldId, storageId } = field.field;\n\n fieldIdToStorageIdIdMap[fieldId] = fieldId;\n\n const { path } = createFieldPath({\n key: storageId,\n field,\n value: \"\",\n keyword: false\n });\n /**\n * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.\n */\n plugins[fieldId] = new ElasticsearchFieldPlugin({\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 ElasticsearchFieldPlugin({\n field: ElasticsearchFieldPlugin.ALL,\n keyword: false\n })\n }\n );\n\n const transformedSort = sort\n .map(value => {\n const matched = value.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (!matched) {\n return null;\n }\n const [, fieldId, order] = matched;\n if (fieldIdToStorageIdIdMap[fieldId]) {\n return `${fieldIdToStorageIdIdMap[fieldId]}_${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":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAQO,MAAMI,uBAAuB,GAAIC,MAAc,IAAa;EAC/D,MAAM;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAGH,MAAM;EAE7C,IAAI,CAACC,IAAI,IAAIA,IAAI,CAACG,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO,CACH;MACI,CAAC,YAAY,GAAG;QACZC,KAAK,EAAE;MACX;IACJ,CAAC,CACJ;EACL;EAEA,MAAMC,aAAa,GAAG,IAAAC,8BAAsB,EAAC;IACzCJ;EACJ,CAAC,CAAC;EAEF,MAAMK,eAAe,GAAG,IAAAC,4BAAsB,EAAC;IAC3CN,OAAO,EAAEG;EACb,CAAC,CAAC;EAEF,MAAMI,uBAA+C,GAAG,CAAC,CAAC;EAE1D,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACX,WAAW,CAAC,CAACY,MAAM,CACjD,CAACX,OAAO,EAAEY,KAAK,KAAK;IAChB;AACZ;AACA;IACY,IAAIA,KAAK,CAACC,OAAO,CAACZ,MA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,4BAAU,EAAC;IACdC,YAAY,EAAEzB,WAAW;IACzBV,IAAI,EAAE4B;EACV,CAAC,CAAC;AACN,CAAC;AAACQ,OAAA,CAAAtC,uBAAA,GAAAA,uBAAA","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: transformedS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AAC;IACjC,IAAI,CAACU,OAAO,EAAE;MACV,OAAO,IAAI;IACf;IACA,MAAM;MAAEjC,OAAO;MAAEC,KAAK;MAAEC;IAAS,CAAC,GAAG+B,OAAO;IAC5C,MAAMZ,GAAG,GAAGnB,QAAQ,GAAG,UAAUF,OAAO,EAAE,GAAGA,OAAO;IACpD,IAAIW,uBAAuB,CAACU,GAAG,CAAC,EAAE;MAC9B,OAAO,GAAGV,uBAAuB,CAACU,GAAG,CAAC,IAAIpB,KAAK,EAAE;IACrD;IAEA,OAAOsB,KAAK;EAChB,CAAC,CAAC,CACDW,MAAM,CAACC,OAAO,CAAa;EAChC,OAAO5C,UAAU,CAAC;IACd6C,YAAY,EAAExB,WAAW;IACzBN,IAAI,EAAEyB;EACV,CAAC,CAAC;AACN,CAAC","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
- import type { CmsModelField } from "@webiny/api-headless-cms/types";
6
- import type { ElasticsearchQuerySearchValuePlugins } from "./types";
1
+ import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
2
+ import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
7
3
  interface Params {
8
- plugins: ElasticsearchQuerySearchValuePlugins;
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,32 +1,17 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.transformValueForSearch = void 0;
7
- /**
8
- * We use any for input and output because they really can be anything.
9
- * Plugin, if exists, makes sure that response value is correct.
10
- */
11
-
12
- /**
13
- * Transformed value can be anything.
14
- */
15
- const transformValueForSearch = params => {
1
+ export const transformValueForSearch = params => {
16
2
  const {
17
3
  field,
18
- plugins,
4
+ valueSearchRegistry,
19
5
  value
20
6
  } = params;
21
- const plugin = plugins[field.type];
22
- if (!plugin) {
7
+ const search = valueSearchRegistry.get(field.type);
8
+ if (!search) {
23
9
  return value;
24
10
  }
25
- return plugin.transform({
11
+ return search.transform({
26
12
  field,
27
13
  value
28
14
  });
29
15
  };
30
- exports.transformValueForSearch = transformValueForSearch;
31
16
 
32
17
  //# sourceMappingURL=transformValueForSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["transformValueForSearch","params","field","plugins","value","plugin","type","transform","exports"],"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\";\nimport type { ElasticsearchQuerySearchValuePlugins } from \"./types\";\n\ninterface Params {\n plugins: ElasticsearchQuerySearchValuePlugins;\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 plugin = plugins[field.type];\n if (!plugin) {\n return value;\n }\n return plugin.transform({ field, value });\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACO,MAAMA,uBAAuB,GAAIC,MAAc,IAAU;EAC5D,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;EACxC,MAAMI,MAAM,GAAGF,OAAO,CAACD,KAAK,CAACI,IAAI,CAAC;EAClC,IAAI,CAACD,MAAM,EAAE;IACT,OAAOD,KAAK;EAChB;EACA,OAAOC,MAAM,CAACE,SAAS,CAAC;IAAEL,KAAK;IAAEE;EAAM,CAAC,CAAC;AAC7C,CAAC;AAACI,OAAA,CAAAR,uBAAA,GAAAA,uBAAA","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,6 +1,5 @@
1
- import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../../plugins";
2
- import type { ElasticsearchQueryBuilderOperatorPlugin } from "@webiny/api-elasticsearch";
3
- import type { CmsModelField } from "@webiny/api-headless-cms/types";
1
+ import type { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
2
+ import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
4
3
  /**
5
4
  * ./fields
6
5
  */
@@ -29,13 +28,7 @@ export interface ModelFields {
29
28
  /**
30
29
  * ./plugins/operator
31
30
  */
32
- export interface ElasticsearchQueryBuilderOperatorPlugins {
33
- [key: string]: ElasticsearchQueryBuilderOperatorPlugin;
34
- }
35
- /**
36
- * ./plugins/search
37
- */
38
- export interface ElasticsearchQuerySearchValuePlugins {
39
- [fieldType: string]: CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
31
+ export interface OpenSearchQueryBuilderOperatorPlugins {
32
+ [key: string]: OpenSearchQueryBuilderOperatorPlugin;
40
33
  }
41
34
  export {};
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins\";\nimport type { ElasticsearchQueryBuilderOperatorPlugin } from \"@webiny/api-elasticsearch\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\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 ElasticsearchQueryBuilderOperatorPlugins {\n [key: string]: ElasticsearchQueryBuilderOperatorPlugin;\n}\n/**\n * ./plugins/search\n */\nexport interface ElasticsearchQuerySearchValuePlugins {\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,11 +1,32 @@
1
- import type { Entity } from "@webiny/db-dynamodb/toolbox";
2
- import type { Client } from "@elastic/elasticsearch";
1
+ import type { Client } from "@webiny/api-opensearch";
2
+ import { type IOpenSearchEntity as IElasticsearchEntity } from "@webiny/api-opensearch";
3
3
  import type { PluginsContainer } from "@webiny/plugins";
4
- import type { CmsEntryStorageOperations } from "../../types";
4
+ import type { CmsEntryStorageOperations } from "../../types.js";
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";
5
16
  export interface CreateEntriesStorageOperationsParams {
6
- entity: Entity<any>;
7
- esEntity: Entity<any>;
17
+ entity: IEntryEntity;
18
+ esEntity: IElasticsearchEntity;
8
19
  elasticsearch: Client;
9
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;
10
31
  }
11
32
  export declare const createEntriesStorageOperations: (params: CreateEntriesStorageOperationsParams) => CmsEntryStorageOperations;