@webiny/api-headless-cms-ddb-es 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9

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 (388) hide show
  1. package/configurations.d.ts +5 -4
  2. package/configurations.js +27 -33
  3. package/configurations.js.map +1 -1
  4. package/definitions/entry.js +7 -9
  5. package/definitions/entry.js.map +1 -1
  6. package/definitions/group.js +7 -9
  7. package/definitions/group.js.map +1 -1
  8. package/definitions/model.js +7 -9
  9. package/definitions/model.js.map +1 -1
  10. package/definitions/types.d.ts +9 -3
  11. package/definitions/types.js +0 -3
  12. package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
  13. package/elasticsearch/createElasticsearchIndex.js +52 -27
  14. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  15. package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
  16. package/elasticsearch/deleteElasticsearchIndex.js +18 -26
  17. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  18. package/exports/api/cms/opensearch.d.ts +9 -0
  19. package/exports/api/cms/opensearch.js +9 -0
  20. package/feature.d.ts +1 -0
  21. package/feature.js +179 -0
  22. package/feature.js.map +1 -0
  23. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  24. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +5 -0
  25. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  26. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  27. package/features/CmsEntryOpenSearchBodyModifier/index.js +1 -0
  28. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +14 -0
  29. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +42 -0
  30. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  31. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +32 -0
  32. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +5 -0
  33. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  34. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  35. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +5 -0
  36. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/constants.js +4 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/feature.js +29 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +60 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +13 -0
  47. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +33 -0
  48. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  50. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +21 -0
  51. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +22 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +32 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  58. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +12 -0
  59. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +107 -0
  60. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  61. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  62. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +21 -0
  63. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  64. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +15 -0
  65. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +40 -0
  66. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +1 -0
  67. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +15 -0
  68. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +40 -0
  69. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +1 -0
  70. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  71. package/features/CmsEntryOpenSearchFieldIndex/index.js +3 -0
  72. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  73. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +36 -0
  74. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  75. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  76. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +5 -0
  77. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  78. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  79. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +5 -0
  80. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  81. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  82. package/features/CmsEntryOpenSearchFilter/constants.js +4 -0
  83. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  84. package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
  85. package/features/CmsEntryOpenSearchFilter/feature.js +17 -0
  86. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  87. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  88. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +26 -0
  89. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  90. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  91. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +43 -0
  92. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  93. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  94. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +36 -0
  95. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  96. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  97. package/features/CmsEntryOpenSearchFilter/index.js +3 -0
  98. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  99. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +5 -0
  100. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  101. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  102. package/features/CmsEntryOpenSearchFullTextSearch/index.js +1 -0
  103. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  104. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
  105. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  106. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  107. package/features/CmsEntryOpenSearchIndex/abstractions.js +5 -0
  108. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  109. package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
  110. package/features/CmsEntryOpenSearchIndex/feature.js +11 -0
  111. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  112. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  113. package/features/CmsEntryOpenSearchIndex/index.js +3 -0
  114. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  115. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +5 -0
  116. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  117. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  118. package/features/CmsEntryOpenSearchQueryModifier/index.js +1 -0
  119. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  120. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +5 -0
  121. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  122. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  123. package/features/CmsEntryOpenSearchSortModifier/index.js +1 -0
  124. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  125. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +31 -0
  126. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  127. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  128. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +5 -0
  129. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  130. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  131. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +5 -0
  132. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  133. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
  134. package/features/CmsEntryOpenSearchValueSearch/feature.js +17 -0
  135. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  136. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  137. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +21 -0
  138. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  139. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  140. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +44 -0
  141. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  142. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  143. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +22 -0
  144. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  145. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  146. package/features/CmsEntryOpenSearchValueSearch/index.js +3 -0
  147. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  148. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +5 -0
  149. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  150. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  151. package/features/CmsEntryOpenSearchValuesModifier/index.js +1 -0
  152. package/helpers/entryIndexHelpers.d.ts +6 -4
  153. package/helpers/entryIndexHelpers.js +70 -186
  154. package/helpers/entryIndexHelpers.js.map +1 -1
  155. package/helpers/fieldIdentifier.js +18 -30
  156. package/helpers/fieldIdentifier.js.map +1 -1
  157. package/helpers/index.js +0 -2
  158. package/index.d.ts +1 -3
  159. package/index.js +1 -190
  160. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
  161. package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
  162. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  163. package/operations/entry/dataLoader/constants.js +2 -1
  164. package/operations/entry/dataLoader/constants.js.map +1 -1
  165. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  166. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  167. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
  168. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  169. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +28 -34
  170. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  171. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +28 -34
  172. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  173. package/operations/entry/dataLoader/getRevisionById.js +33 -43
  174. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  175. package/operations/entry/dataLoader/index.js +8 -9
  176. package/operations/entry/dataLoader/index.js.map +1 -1
  177. package/operations/entry/dataLoader/types.d.ts +1 -0
  178. package/operations/entry/dataLoader/types.js +0 -3
  179. package/operations/entry/dataLoaders.js +81 -97
  180. package/operations/entry/dataLoaders.js.map +1 -1
  181. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  182. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +6 -24
  183. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  184. package/operations/entry/elasticsearch/body.d.ts +19 -3
  185. package/operations/entry/elasticsearch/body.js +74 -122
  186. package/operations/entry/elasticsearch/body.js.map +1 -1
  187. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
  188. package/operations/entry/elasticsearch/fields/createSystemField.js +9 -0
  189. package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
  190. package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
  191. package/operations/entry/elasticsearch/fields/live.js +50 -0
  192. package/operations/entry/elasticsearch/fields/live.js.map +1 -0
  193. package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
  194. package/operations/entry/elasticsearch/fields/location.js +50 -0
  195. package/operations/entry/elasticsearch/fields/location.js.map +1 -0
  196. package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
  197. package/operations/entry/elasticsearch/fields/state.js +104 -0
  198. package/operations/entry/elasticsearch/fields/state.js.map +1 -0
  199. package/operations/entry/elasticsearch/fields.d.ts +6 -4
  200. package/operations/entry/elasticsearch/fields.js +194 -388
  201. package/operations/entry/elasticsearch/fields.js.map +1 -1
  202. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +6 -5
  203. package/operations/entry/elasticsearch/filtering/applyFiltering.js +32 -45
  204. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  205. package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -2
  206. package/operations/entry/elasticsearch/filtering/exec.js +84 -166
  207. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  208. package/operations/entry/elasticsearch/filtering/index.js +0 -2
  209. package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
  210. package/operations/entry/elasticsearch/filtering/path.js +24 -35
  211. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  212. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -2
  213. package/operations/entry/elasticsearch/filtering/populated.js +8 -14
  214. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  215. package/operations/entry/elasticsearch/filtering/values.js +11 -12
  216. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  217. package/operations/entry/elasticsearch/fullTextSearch.d.ts +7 -6
  218. package/operations/entry/elasticsearch/fullTextSearch.js +45 -79
  219. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  220. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +4 -4
  221. package/operations/entry/elasticsearch/fullTextSearchFields.js +7 -17
  222. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  223. package/operations/entry/elasticsearch/initialQuery.d.ts +3 -3
  224. package/operations/entry/elasticsearch/initialQuery.js +37 -80
  225. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  226. package/operations/entry/elasticsearch/keyword.js +13 -27
  227. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  228. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
  229. package/operations/entry/elasticsearch/plugins/operator.js +10 -21
  230. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  231. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -4
  232. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  233. package/operations/entry/elasticsearch/sort.d.ts +4 -4
  234. package/operations/entry/elasticsearch/sort.js +69 -96
  235. package/operations/entry/elasticsearch/sort.js.map +1 -1
  236. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
  237. package/operations/entry/elasticsearch/transformValueForSearch.js +9 -24
  238. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  239. package/operations/entry/elasticsearch/types.d.ts +3 -10
  240. package/operations/entry/elasticsearch/types.js +0 -3
  241. package/operations/entry/index.d.ts +22 -2
  242. package/operations/entry/index.js +1316 -1650
  243. package/operations/entry/index.js.map +1 -1
  244. package/operations/entry/keys.js +43 -63
  245. package/operations/entry/keys.js.map +1 -1
  246. package/operations/entry/recordType.js +4 -9
  247. package/operations/entry/recordType.js.map +1 -1
  248. package/operations/entry/transformations/convertEntryKeys.js +21 -26
  249. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  250. package/operations/entry/transformations/index.d.ts +6 -2
  251. package/operations/entry/transformations/index.js +84 -112
  252. package/operations/entry/transformations/index.js.map +1 -1
  253. package/operations/entry/transformations/modifyEntryValues.d.ts +6 -4
  254. package/operations/entry/transformations/modifyEntryValues.js +12 -17
  255. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  256. package/operations/entry/transformations/transformEntryKeys.js +13 -16
  257. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  258. package/operations/entry/transformations/transformEntryToIndex.d.ts +2 -2
  259. package/operations/entry/transformations/transformEntryToIndex.js +16 -20
  260. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  261. package/operations/group/index.d.ts +2 -2
  262. package/operations/group/index.js +115 -139
  263. package/operations/group/index.js.map +1 -1
  264. package/operations/model/index.d.ts +1 -1
  265. package/operations/model/index.js +128 -157
  266. package/operations/model/index.js.map +1 -1
  267. package/package.json +35 -30
  268. package/tasks/createIndexTaskPlugin.js +36 -32
  269. package/tasks/createIndexTaskPlugin.js.map +1 -1
  270. package/types.d.ts +7 -112
  271. package/types.js +7 -36
  272. package/types.js.map +1 -1
  273. package/values/NoValueContainer.js +8 -10
  274. package/values/NoValueContainer.js.map +1 -1
  275. package/definitions/types.js.map +0 -1
  276. package/dynamoDb/index.d.ts +0 -3
  277. package/dynamoDb/index.js +0 -8
  278. package/dynamoDb/index.js.map +0 -1
  279. package/dynamoDb/storage/longText.d.ts +0 -10
  280. package/dynamoDb/storage/longText.js +0 -88
  281. package/dynamoDb/storage/longText.js.map +0 -1
  282. package/dynamoDb/storage/richText.d.ts +0 -2
  283. package/dynamoDb/storage/richText.js +0 -51
  284. package/dynamoDb/storage/richText.js.map +0 -1
  285. package/elasticsearch/index.d.ts +0 -2
  286. package/elasticsearch/index.js +0 -5
  287. package/elasticsearch/index.js.map +0 -1
  288. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  289. package/elasticsearch/indexing/dateTimeIndexing.js +0 -81
  290. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  291. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  292. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  293. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  294. package/elasticsearch/indexing/index.d.ts +0 -2
  295. package/elasticsearch/indexing/index.js +0 -10
  296. package/elasticsearch/indexing/index.js.map +0 -1
  297. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  298. package/elasticsearch/indexing/jsonIndexing.js +0 -21
  299. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  300. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  301. package/elasticsearch/indexing/longTextIndexing.js +0 -35
  302. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  303. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  304. package/elasticsearch/indexing/numberIndexing.js +0 -34
  305. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  306. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  307. package/elasticsearch/indexing/objectIndexing.js +0 -194
  308. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  309. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  310. package/elasticsearch/indexing/richTextIndexing.js +0 -24
  311. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  312. package/elasticsearch/indices/base.d.ts +0 -2
  313. package/elasticsearch/indices/base.js +0 -7
  314. package/elasticsearch/indices/base.js.map +0 -1
  315. package/elasticsearch/indices/index.d.ts +0 -1
  316. package/elasticsearch/indices/index.js +0 -6
  317. package/elasticsearch/indices/index.js.map +0 -1
  318. package/elasticsearch/search/index.d.ts +0 -3
  319. package/elasticsearch/search/index.js +0 -6
  320. package/elasticsearch/search/index.js.map +0 -1
  321. package/elasticsearch/search/refSearch.d.ts +0 -2
  322. package/elasticsearch/search/refSearch.js +0 -24
  323. package/elasticsearch/search/refSearch.js.map +0 -1
  324. package/elasticsearch/search/searchableJson.d.ts +0 -2
  325. package/elasticsearch/search/searchableJson.js +0 -53
  326. package/elasticsearch/search/searchableJson.js.map +0 -1
  327. package/elasticsearch/search/timeSearch.d.ts +0 -2
  328. package/elasticsearch/search/timeSearch.js +0 -20
  329. package/elasticsearch/search/timeSearch.js.map +0 -1
  330. package/helpers/index.js.map +0 -1
  331. package/index.js.map +0 -1
  332. package/operations/entry/dataLoader/types.js.map +0 -1
  333. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  334. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  335. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
  336. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  337. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  338. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
  339. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  340. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  341. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
  342. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  343. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  344. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
  345. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  346. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  347. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
  348. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  349. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  350. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
  351. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  352. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  353. package/operations/entry/elasticsearch/plugins/search.js +0 -18
  354. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  355. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  356. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
  357. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  358. package/operations/entry/elasticsearch/types.js.map +0 -1
  359. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  360. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
  361. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  362. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  363. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
  364. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  365. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  366. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
  367. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  368. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  369. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
  370. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  371. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  372. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
  373. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  374. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  375. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
  376. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  377. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  378. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
  379. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  380. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  381. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
  382. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  383. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  384. package/plugins/CmsEntryFilterPlugin.js +0 -15
  385. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  386. package/plugins/index.d.ts +0 -8
  387. package/plugins/index.js +0 -10
  388. package/plugins/index.js.map +0 -1
@@ -1,31 +1,17 @@
1
1
  import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
2
- const noKeywordFields = ["date", "datetime", "number", "boolean"];
3
- export const hasKeyword = field => {
4
- const fieldType = getBaseFieldType(field);
5
- /**
6
- * We defined some field types that MUST have no keyword added to the field path
7
- */
8
- if (noKeywordFields.includes(fieldType)) {
9
- return false;
10
- }
11
- /**
12
- * If field has unmapped type defined, do not add keyword.
13
- */
14
- //
15
- else if (field.unmappedType) {
16
- return false;
17
- }
18
- /**
19
- * And if specifically defined that field has no keyword, do not add it.
20
- */
21
- //
22
- else if (field.keyword === false) {
23
- return false;
24
- }
25
- /**
26
- * All other fields have keyword added.
27
- */
28
- return true;
2
+ const noKeywordFields = [
3
+ "date",
4
+ "datetime",
5
+ "number",
6
+ "boolean"
7
+ ];
8
+ const hasKeyword = (field)=>{
9
+ const fieldType = getBaseFieldType(field);
10
+ if (noKeywordFields.includes(fieldType)) return false;
11
+ if (field.unmappedType) return false;
12
+ if (false === field.keyword) return false;
13
+ return true;
29
14
  };
15
+ export { hasKeyword };
30
16
 
31
17
  //# sourceMappingURL=keyword.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getBaseFieldType","noKeywordFields","hasKeyword","field","fieldType","includes","unmappedType","keyword"],"sources":["keyword.ts"],"sourcesContent":["import type { ModelField } from \"./types.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\n\nconst noKeywordFields: string[] = [\"date\", \"datetime\", \"number\", \"boolean\"];\nexport const hasKeyword = (field: ModelField): boolean => {\n const fieldType = getBaseFieldType(field);\n /**\n * We defined some field types that MUST have no keyword added to the field path\n */\n if (noKeywordFields.includes(fieldType)) {\n return false;\n }\n /**\n * If field has unmapped type defined, do not add keyword.\n */\n //\n else if (field.unmappedType) {\n return false;\n }\n /**\n * And if specifically defined that field has no keyword, do not add it.\n */\n //\n else if (field.keyword === false) {\n return false;\n }\n /**\n * All other fields have keyword added.\n */\n return true;\n};\n"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,oDAAoD;AAErF,MAAMC,eAAyB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC;AAC3E,OAAO,MAAMC,UAAU,GAAIC,KAAiB,IAAc;EACtD,MAAMC,SAAS,GAAGJ,gBAAgB,CAACG,KAAK,CAAC;EACzC;AACJ;AACA;EACI,IAAIF,eAAe,CAACI,QAAQ,CAACD,SAAS,CAAC,EAAE;IACrC,OAAO,KAAK;EAChB;EACA;AACJ;AACA;EACI;EAAA,KACK,IAAID,KAAK,CAACG,YAAY,EAAE;IACzB,OAAO,KAAK;EAChB;EACA;AACJ;AACA;EACI;EAAA,KACK,IAAIH,KAAK,CAACI,OAAO,KAAK,KAAK,EAAE;IAC9B,OAAO,KAAK;EAChB;EACA;AACJ;AACA;EACI,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/elasticsearch/keyword.js","sources":["../../../../src/operations/entry/elasticsearch/keyword.ts"],"sourcesContent":["import type { ModelField } from \"./types.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\n\nconst noKeywordFields: string[] = [\"date\", \"datetime\", \"number\", \"boolean\"];\nexport const hasKeyword = (field: ModelField): boolean => {\n const fieldType = getBaseFieldType(field);\n /**\n * We defined some field types that MUST have no keyword added to the field path\n */\n if (noKeywordFields.includes(fieldType)) {\n return false;\n }\n /**\n * If field has unmapped type defined, do not add keyword.\n */\n //\n else if (field.unmappedType) {\n return false;\n }\n /**\n * And if specifically defined that field has no keyword, do not add it.\n */\n //\n else if (field.keyword === false) {\n return false;\n }\n /**\n * All other fields have keyword added.\n */\n return true;\n};\n"],"names":["noKeywordFields","hasKeyword","field","fieldType","getBaseFieldType"],"mappings":";AAGA,MAAMA,kBAA4B;IAAC;IAAQ;IAAY;IAAU;CAAU;AACpE,MAAMC,aAAa,CAACC;IACvB,MAAMC,YAAYC,iBAAiBF;IAInC,IAAIF,gBAAgB,QAAQ,CAACG,YACzB,OAAO;IAMN,IAAID,MAAM,YAAY,EACvB,OAAO;IAMN,IAAIA,AAAkB,UAAlBA,MAAM,OAAO,EAClB,OAAO;IAKX,OAAO;AACX"}
@@ -1,7 +1,7 @@
1
1
  import type { PluginsContainer } from "@webiny/plugins";
2
- import type { ElasticsearchQueryBuilderOperatorPlugins } from "../types.js";
2
+ import type { OpenSearchQueryBuilderOperatorPlugins } from "../types.js";
3
3
  interface Params {
4
4
  plugins: PluginsContainer;
5
5
  }
6
- export declare const createOperatorPluginList: (params: Params) => ElasticsearchQueryBuilderOperatorPlugins;
6
+ export declare const createOperatorPluginList: (params: Params) => OpenSearchQueryBuilderOperatorPlugins;
7
7
  export {};
@@ -1,24 +1,13 @@
1
- import { ElasticsearchQueryBuilderOperatorPlugin } from "@webiny/api-elasticsearch";
2
- export const createOperatorPluginList = params => {
3
- const {
4
- plugins
5
- } = params;
6
- /**
7
- * We always set the last one operator plugin added.
8
- * This way user can override the plugins.
9
- */
10
- return plugins.byType(ElasticsearchQueryBuilderOperatorPlugin.type).reduce((acc, plugin) => {
11
- const operator = plugin.getOperator();
12
- /**
13
- * We also only allow the override of the plugins if the new plugin is NOT a default one.
14
- * If a user sets the plugin name ending with .default, we cannot do anything about it.
15
- */
16
- if (!!acc[operator] && (plugin.name || "").match(/\.default$/)) {
17
- return acc;
18
- }
19
- acc[operator] = plugin;
20
- return acc;
21
- }, {});
1
+ import { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
2
+ const createOperatorPluginList = (params)=>{
3
+ const { plugins } = params;
4
+ return plugins.byType(OpenSearchQueryBuilderOperatorPlugin.type).reduce((acc, plugin)=>{
5
+ const operator = plugin.getOperator();
6
+ if (!!acc[operator] && (plugin.name || "").match(/\.default$/)) return acc;
7
+ acc[operator] = plugin;
8
+ return acc;
9
+ }, {});
22
10
  };
11
+ export { createOperatorPluginList };
23
12
 
24
13
  //# sourceMappingURL=operator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ElasticsearchQueryBuilderOperatorPlugin","createOperatorPluginList","params","plugins","byType","type","reduce","acc","plugin","operator","getOperator","name","match"],"sources":["operator.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport { ElasticsearchQueryBuilderOperatorPlugin } from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchQueryBuilderOperatorPlugins } from \"../types.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n}\nexport const createOperatorPluginList = (\n params: Params\n): ElasticsearchQueryBuilderOperatorPlugins => {\n const { plugins } = params;\n /**\n * We always set the last one operator plugin added.\n * This way user can override the plugins.\n */\n return plugins\n .byType<ElasticsearchQueryBuilderOperatorPlugin>(\n ElasticsearchQueryBuilderOperatorPlugin.type\n )\n .reduce<ElasticsearchQueryBuilderOperatorPlugins>((acc, plugin) => {\n const operator = plugin.getOperator();\n /**\n * We also only allow the override of the plugins if the new plugin is NOT a default one.\n * If a user sets the plugin name ending with .default, we cannot do anything about it.\n */\n if (!!acc[operator] && (plugin.name || \"\").match(/\\.default$/)) {\n return acc;\n }\n acc[operator] = plugin;\n return acc;\n }, {});\n};\n"],"mappings":"AACA,SAASA,uCAAuC,QAAQ,2BAA2B;AAMnF,OAAO,MAAMC,wBAAwB,GACjCC,MAAc,IAC6B;EAC3C,MAAM;IAAEC;EAAQ,CAAC,GAAGD,MAAM;EAC1B;AACJ;AACA;AACA;EACI,OAAOC,OAAO,CACTC,MAAM,CACHJ,uCAAuC,CAACK,IAC5C,CAAC,CACAC,MAAM,CAA2C,CAACC,GAAG,EAAEC,MAAM,KAAK;IAC/D,MAAMC,QAAQ,GAAGD,MAAM,CAACE,WAAW,CAAC,CAAC;IACrC;AACZ;AACA;AACA;IACY,IAAI,CAAC,CAACH,GAAG,CAACE,QAAQ,CAAC,IAAI,CAACD,MAAM,CAACG,IAAI,IAAI,EAAE,EAAEC,KAAK,CAAC,YAAY,CAAC,EAAE;MAC5D,OAAOL,GAAG;IACd;IACAA,GAAG,CAACE,QAAQ,CAAC,GAAGD,MAAM;IACtB,OAAOD,GAAG;EACd,CAAC,EAAE,CAAC,CAAC,CAAC;AACd,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/elasticsearch/plugins/operator.js","sources":["../../../../../src/operations/entry/elasticsearch/plugins/operator.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport { OpenSearchQueryBuilderOperatorPlugin } from \"@webiny/api-opensearch\";\nimport type { OpenSearchQueryBuilderOperatorPlugins } from \"../types.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n}\nexport const createOperatorPluginList = (params: Params): OpenSearchQueryBuilderOperatorPlugins => {\n const { plugins } = params;\n /**\n * We always set the last one operator plugin added.\n * This way user can override the plugins.\n */\n return plugins\n .byType<OpenSearchQueryBuilderOperatorPlugin>(OpenSearchQueryBuilderOperatorPlugin.type)\n .reduce<OpenSearchQueryBuilderOperatorPlugins>((acc, plugin) => {\n const operator = plugin.getOperator();\n /**\n * We also only allow the override of the plugins if the new plugin is NOT a default one.\n * If a user sets the plugin name ending with .default, we cannot do anything about it.\n */\n if (!!acc[operator] && (plugin.name || \"\").match(/\\.default$/)) {\n return acc;\n }\n acc[operator] = plugin;\n return acc;\n }, {});\n};\n"],"names":["createOperatorPluginList","params","plugins","OpenSearchQueryBuilderOperatorPlugin","acc","plugin","operator"],"mappings":";AAOO,MAAMA,2BAA2B,CAACC;IACrC,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAKpB,OAAOC,QACF,MAAM,CAAuCC,qCAAqC,IAAI,EACtF,MAAM,CAAwC,CAACC,KAAKC;QACjD,MAAMC,WAAWD,OAAO,WAAW;QAKnC,IAAI,CAAC,CAACD,GAAG,CAACE,SAAS,IAAKD,AAAAA,CAAAA,OAAO,IAAI,IAAI,EAAC,EAAG,KAAK,CAAC,eAC7C,OAAOD;QAEXA,GAAG,CAACE,SAAS,GAAGD;QAChB,OAAOD;IACX,GAAG,CAAC;AACZ"}
@@ -1,6 +1,8 @@
1
- const IGNORED_ES_SEARCH_EXCEPTIONS = ["index_not_found_exception", "search_phase_execution_exception"];
2
- export const shouldIgnoreEsResponseError = error => {
3
- return IGNORED_ES_SEARCH_EXCEPTIONS.includes(error.message);
4
- };
1
+ const IGNORED_ES_SEARCH_EXCEPTIONS = [
2
+ "index_not_found_exception",
3
+ "search_phase_execution_exception"
4
+ ];
5
+ const shouldIgnoreEsResponseError = (error)=>IGNORED_ES_SEARCH_EXCEPTIONS.some((ignoredMessage)=>error.message.includes(ignoredMessage));
6
+ export { shouldIgnoreEsResponseError };
5
7
 
6
8
  //# sourceMappingURL=shouldIgnoreEsResponseError.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IGNORED_ES_SEARCH_EXCEPTIONS","shouldIgnoreEsResponseError","error","includes","message"],"sources":["shouldIgnoreEsResponseError.ts"],"sourcesContent":["import type WebinyError from \"@webiny/error\";\n\nconst IGNORED_ES_SEARCH_EXCEPTIONS = [\n \"index_not_found_exception\",\n \"search_phase_execution_exception\"\n];\n\nexport const shouldIgnoreEsResponseError = (error: WebinyError) => {\n return IGNORED_ES_SEARCH_EXCEPTIONS.includes(error.message);\n};\n"],"mappings":"AAEA,MAAMA,4BAA4B,GAAG,CACjC,2BAA2B,EAC3B,kCAAkC,CACrC;AAED,OAAO,MAAMC,2BAA2B,GAAIC,KAAkB,IAAK;EAC/D,OAAOF,4BAA4B,CAACG,QAAQ,CAACD,KAAK,CAACE,OAAO,CAAC;AAC/D,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/elasticsearch/shouldIgnoreEsResponseError.js","sources":["../../../../src/operations/entry/elasticsearch/shouldIgnoreEsResponseError.ts"],"sourcesContent":["import type WebinyError from \"@webiny/error\";\n\nconst IGNORED_ES_SEARCH_EXCEPTIONS = [\n \"index_not_found_exception\",\n \"search_phase_execution_exception\"\n];\n\nexport const shouldIgnoreEsResponseError = (error: WebinyError) => {\n return IGNORED_ES_SEARCH_EXCEPTIONS.some(ignoredMessage =>\n error.message.includes(ignoredMessage)\n );\n};\n"],"names":["IGNORED_ES_SEARCH_EXCEPTIONS","shouldIgnoreEsResponseError","error","ignoredMessage"],"mappings":"AAEA,MAAMA,+BAA+B;IACjC;IACA;CACH;AAEM,MAAMC,8BAA8B,CAACC,QACjCF,6BAA6B,IAAI,CAACG,CAAAA,iBACrCD,MAAM,OAAO,CAAC,QAAQ,CAACC"}
@@ -1,12 +1,12 @@
1
- import type { Sort as esSort } from "@webiny/api-elasticsearch/types.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
1
+ import type { Sort as OpenSearchSort } from "@webiny/api-opensearch/types.js";
3
2
  import type { CmsEntryListSort, CmsModel } from "@webiny/api-headless-cms/types/index.js";
4
3
  import type { ModelFields } from "./types.js";
4
+ import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
5
5
  interface Params {
6
- plugins: PluginsContainer;
7
6
  sort?: CmsEntryListSort;
8
7
  modelFields: ModelFields;
9
8
  model: CmsModel;
9
+ valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
10
10
  }
11
- export declare const createElasticsearchSort: (params: Params) => esSort;
11
+ export declare const createElasticsearchSort: (params: Params) => OpenSearchSort;
12
12
  export {};
@@ -1,107 +1,80 @@
1
- import { createSort, ElasticsearchFieldPlugin } from "@webiny/api-elasticsearch";
1
+ import { OpenSearchFieldPlugin, createSort } from "@webiny/api-opensearch";
2
2
  import { hasKeyword } from "./keyword.js";
3
- import { createSearchPluginList } from "./plugins/search.js";
4
3
  import { createFieldPathFactory } from "./filtering/path.js";
5
4
  import { NoValueContainer } from "../../../values/NoValueContainer.js";
6
- const matchField = input => {
7
- const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
8
- if (valuesMatch) {
9
- const [, fieldId, order] = valuesMatch;
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) return null;
17
+ const [, fieldId, order] = nonValues;
10
18
  return {
11
- fieldId,
12
- isValues: true,
13
- order: order
19
+ fieldId,
20
+ isValues: false,
21
+ order: order
14
22
  };
15
- }
16
- const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
17
- if (!nonValues) {
18
- return null;
19
- }
20
- const [, fieldId, order] = nonValues;
21
- return {
22
- fieldId,
23
- isValues: false,
24
- order: order
25
- };
26
23
  };
27
- export const createElasticsearchSort = params => {
28
- const {
29
- sort,
30
- modelFields,
31
- plugins
32
- } = params;
33
- if (!sort || sort.length === 0) {
34
- return [{
35
- ["id.keyword"]: {
36
- order: "asc"
37
- }
38
- }];
39
- }
40
- const searchPlugins = createSearchPluginList({
41
- plugins
42
- });
43
- const createFieldPath = createFieldPathFactory({
44
- plugins: searchPlugins
45
- });
46
- const fieldIdToStorageIdIdMap = {};
47
- const sortPlugins = Object.values(modelFields).reduce((plugins, field) => {
48
- /**
49
- * We do not support sorting by nested fields.
50
- */
51
- const isValues = field.parents.length === 1 && field.parents[0].fieldId === "values";
52
- if (field.parents.length > 0 && !isValues) {
53
- return plugins;
54
- }
55
- const fieldId = field.field.fieldId;
56
- const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;
57
- fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;
58
- const {
59
- path
60
- } = createFieldPath({
61
- key: field.field.storageId,
62
- field,
63
- value: NoValueContainer.create(),
64
- keyword: false,
65
- originalValue: NoValueContainer.create()
24
+ const createElasticsearchSort = (params)=>{
25
+ const { sort, modelFields, valueSearchRegistry } = params;
26
+ if (!sort || 0 === sort.length) return [
27
+ {
28
+ ["id.keyword"]: {
29
+ order: "asc"
30
+ }
31
+ }
32
+ ];
33
+ const createFieldPath = createFieldPathFactory({
34
+ valueSearchRegistry
66
35
  });
67
- /**
68
- * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.
69
- */
70
- plugins[fieldIdPath] = new ElasticsearchFieldPlugin({
71
- unmappedType: field.unmappedType,
72
- keyword: hasKeyword(field),
73
- sortable: field.sortable,
74
- searchable: field.searchable,
75
- field: fieldId,
76
- path
36
+ const fieldIdToStorageIdIdMap = {};
37
+ const sortPlugins = Object.values(modelFields).reduce((plugins, field)=>{
38
+ const isValues = 1 === field.parents.length && "values" === field.parents[0].fieldId;
39
+ if (field.parents.length > 0 && !isValues) return plugins;
40
+ const fieldId = field.field.fieldId;
41
+ const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;
42
+ fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;
43
+ const { path } = createFieldPath({
44
+ key: field.field.storageId,
45
+ field,
46
+ value: NoValueContainer.create(),
47
+ keyword: false,
48
+ originalValue: NoValueContainer.create()
49
+ });
50
+ plugins[fieldIdPath] = new OpenSearchFieldPlugin({
51
+ unmappedType: field.unmappedType,
52
+ keyword: hasKeyword(field),
53
+ sortable: field.sortable,
54
+ searchable: field.searchable,
55
+ field: fieldId,
56
+ path
57
+ });
58
+ return plugins;
59
+ }, {
60
+ ["*"]: new OpenSearchFieldPlugin({
61
+ field: OpenSearchFieldPlugin.ALL,
62
+ keyword: false
63
+ })
64
+ });
65
+ const transformedSort = sort.map((value)=>{
66
+ const matched = matchField(value);
67
+ if (!matched) return null;
68
+ const { fieldId, order, isValues } = matched;
69
+ const key = isValues ? `values.${fieldId}` : fieldId;
70
+ if (fieldIdToStorageIdIdMap[key]) return `${fieldIdToStorageIdIdMap[key]}_${order}`;
71
+ return value;
72
+ }).filter(Boolean);
73
+ return createSort({
74
+ fieldPlugins: sortPlugins,
75
+ sort: transformedSort
77
76
  });
78
- return plugins;
79
- }, {
80
- ["*"]: new ElasticsearchFieldPlugin({
81
- field: ElasticsearchFieldPlugin.ALL,
82
- keyword: false
83
- })
84
- });
85
- const transformedSort = sort.map(value => {
86
- const matched = matchField(value);
87
- if (!matched) {
88
- return null;
89
- }
90
- const {
91
- fieldId,
92
- order,
93
- isValues
94
- } = matched;
95
- const key = isValues ? `values.${fieldId}` : fieldId;
96
- if (fieldIdToStorageIdIdMap[key]) {
97
- return `${fieldIdToStorageIdIdMap[key]}_${order}`;
98
- }
99
- return value;
100
- }).filter(Boolean);
101
- return createSort({
102
- fieldPlugins: sortPlugins,
103
- sort: transformedSort
104
- });
105
77
  };
78
+ export { createElasticsearchSort };
106
79
 
107
80
  //# sourceMappingURL=sort.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createSort","ElasticsearchFieldPlugin","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 esSort } from \"@webiny/api-elasticsearch/types.js\";\nimport { createSort, ElasticsearchFieldPlugin } from \"@webiny/api-elasticsearch\";\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): 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 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 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 = 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":"AACA,SAASA,UAAU,EAAEC,wBAAwB,QAAQ,2BAA2B;AAIhF,SAASC,UAAU;AACnB,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAC/B,SAASC,gBAAgB;AAQzB,MAAMC,UAAU,GAAIC,KAAa,IAAiC;EAC9D,MAAMC,WAAW,GAAGD,KAAK,CAACE,KAAK,CAAC,sCAAsC,CAAC;EACvE,IAAID,WAAW,EAAE;IACb,MAAM,GAAGE,OAAO,EAAEC,KAAK,CAAC,GAAGH,WAAW;IACtC,OAAO;MACHE,OAAO;MACPE,QAAQ,EAAE,IAAI;MACdD,KAAK,EAAEA;IACX,CAAC;EACL;EACA,MAAME,SAAS,GAAGN,KAAK,CAACE,KAAK,CAAC,+BAA+B,CAAC;EAC9D,IAAI,CAACI,SAAS,EAAE;IACZ,OAAO,IAAI;EACf;EACA,MAAM,GAAGH,OAAO,EAAEC,KAAK,CAAC,GAAGE,SAAS;EACpC,OAAO;IACHH,OAAO;IACPE,QAAQ,EAAE,KAAK;IACfD,KAAK,EAAEA;EACX,CAAC;AACL,CAAC;AASD,OAAO,MAAMG,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;QACZR,KAAK,EAAE;MACX;IACJ,CAAC,CACJ;EACL;EAEA,MAAMS,aAAa,GAAGjB,sBAAsB,CAAC;IACzCe;EACJ,CAAC,CAAC;EAEF,MAAMG,eAAe,GAAGjB,sBAAsB,CAAC;IAC3Cc,OAAO,EAAEE;EACb,CAAC,CAAC;EAEF,MAAME,uBAA+C,GAAG,CAAC,CAAC;EAE1D,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACR,WAAW,CAAC,CAACS,MAAM,CACjD,CAACR,OAAO,EAAES,KAAK,KAAK;IAChB;AACZ;AACA;IACY,MAAMf,QAAQ,GAAGe,KAAK,CAACC,OAAO,CAACT,MAAM,KAAK,CAAC,IAAIQ,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAClB,OAAO,KAAK,QAAQ;IACpF,IAAIiB,KAAK,CAACC,OAAO,CAACT,MAAM,GAAG,CAAC,IAAI,CAACP,QAAQ,EAAE;MACvC,OAAOM,OAAO;IAClB;IAEA,MAAMR,OAAO,GAAGiB,KAAK,CAACA,KAAK,CAACjB,OAAO;IACnC,MAAMmB,WAAW,GAAGjB,QAAQ,GAAG,UAAUF,OAAO,EAAE,GAAGA,OAAO;IAE5DY,uBAAuB,CAACO,WAAW,CAAC,GAAGA,WAAW;IAElD,MAAM;MAAEC;IAAK,CAAC,GAAGT,eAAe,CAAC;MAC7BU,GAAG,EAAEJ,KAAK,CAACA,KAAK,CAACK,SAAS;MAC1BL,KAAK;MACLM,KAAK,EAAE5B,gBAAgB,CAAC6B,MAAM,CAAC,CAAC;MAChCC,OAAO,EAAE,KAAK;MACdC,aAAa,EAAE/B,gBAAgB,CAAC6B,MAAM,CAAC;IAC3C,CAAC,CAAC;IACF;AACZ;AACA;IACYhB,OAAO,CAACW,WAAW,CAAC,GAAG,IAAI5B,wBAAwB,CAAC;MAChDoC,YAAY,EAAEV,KAAK,CAACU,YAAY;MAChCF,OAAO,EAAEjC,UAAU,CAACyB,KAAK,CAAC;MAC1BW,QAAQ,EAAEX,KAAK,CAACW,QAAQ;MACxBC,UAAU,EAAEZ,KAAK,CAACY,UAAU;MAC5BZ,KAAK,EAAEjB,OAAO;MACdoB;IACJ,CAAC,CAAC;IACF,OAAOZ,OAAO;EAClB,CAAC,EACD;IACI,CAAC,GAAG,GAAG,IAAIjB,wBAAwB,CAAC;MAChC0B,KAAK,EAAE1B,wBAAwB,CAACuC,GAAG;MACnCL,OAAO,EAAE;IACb,CAAC;EACL,CACJ,CAAC;EAED,MAAMM,eAAe,GAAGzB,IAAI,CACvB0B,GAAG,CAACT,KAAK,IAAI;IACV,MAAMU,OAAO,GAAGrC,UAAU,CAAC2B,KAAK,CAAC;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,IAAIY,uBAAuB,CAACS,GAAG,CAAC,EAAE;MAC9B,OAAO,GAAGT,uBAAuB,CAACS,GAAG,CAAC,IAAIpB,KAAK,EAAE;IACrD;IAEA,OAAOsB,KAAK;EAChB,CAAC,CAAC,CACDW,MAAM,CAACC,OAAO,CAAa;EAChC,OAAO7C,UAAU,CAAC;IACd8C,YAAY,EAAEvB,WAAW;IACzBP,IAAI,EAAEyB;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/elasticsearch/sort.js","sources":["../../../../src/operations/entry/elasticsearch/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"],"names":["matchField","input","valuesMatch","fieldId","order","nonValues","createElasticsearchSort","params","sort","modelFields","valueSearchRegistry","createFieldPath","createFieldPathFactory","fieldIdToStorageIdIdMap","sortPlugins","Object","plugins","field","isValues","fieldIdPath","path","NoValueContainer","OpenSearchFieldPlugin","hasKeyword","transformedSort","value","matched","key","Boolean","createSort"],"mappings":";;;;AAeA,MAAMA,aAAa,CAACC;IAChB,MAAMC,cAAcD,MAAM,KAAK,CAAC;IAChC,IAAIC,aAAa;QACb,MAAM,GAAGC,SAASC,MAAM,GAAGF;QAC3B,OAAO;YACHC;YACA,UAAU;YACV,OAAOC;QACX;IACJ;IACA,MAAMC,YAAYJ,MAAM,KAAK,CAAC;IAC9B,IAAI,CAACI,WACD,OAAO;IAEX,MAAM,GAAGF,SAASC,MAAM,GAAGC;IAC3B,OAAO;QACHF;QACA,UAAU;QACV,OAAOC;IACX;AACJ;AASO,MAAME,0BAA0B,CAACC;IACpC,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,mBAAmB,EAAE,GAAGH;IAEnD,IAAI,CAACC,QAAQA,AAAgB,MAAhBA,KAAK,MAAM,EACpB,OAAO;QACH;YACI,CAAC,aAAa,EAAE;gBACZ,OAAO;YACX;QACJ;KACH;IAGL,MAAMG,kBAAkBC,uBAAuB;QAC3CF;IACJ;IAEA,MAAMG,0BAAkD,CAAC;IAEzD,MAAMC,cAAcC,OAAO,MAAM,CAACN,aAAa,MAAM,CACjD,CAACO,SAASC;QAIN,MAAMC,WAAWD,AAAyB,MAAzBA,MAAM,OAAO,CAAC,MAAM,IAAUA,AAA6B,aAA7BA,MAAM,OAAO,CAAC,EAAE,CAAC,OAAO;QACvE,IAAIA,MAAM,OAAO,CAAC,MAAM,GAAG,KAAK,CAACC,UAC7B,OAAOF;QAGX,MAAMb,UAAUc,MAAM,KAAK,CAAC,OAAO;QACnC,MAAME,cAAcD,WAAW,CAAC,OAAO,EAAEf,SAAS,GAAGA;QAErDU,uBAAuB,CAACM,YAAY,GAAGA;QAEvC,MAAM,EAAEC,IAAI,EAAE,GAAGT,gBAAgB;YAC7B,KAAKM,MAAM,KAAK,CAAC,SAAS;YAC1BA;YACA,OAAOI,iBAAiB,MAAM;YAC9B,SAAS;YACT,eAAeA,iBAAiB,MAAM;QAC1C;QAIAL,OAAO,CAACG,YAAY,GAAG,IAAIG,sBAAsB;YAC7C,cAAcL,MAAM,YAAY;YAChC,SAASM,WAAWN;YACpB,UAAUA,MAAM,QAAQ;YACxB,YAAYA,MAAM,UAAU;YAC5B,OAAOd;YACPiB;QACJ;QACA,OAAOJ;IACX,GACA;QACI,CAAC,IAAI,EAAE,IAAIM,sBAAsB;YAC7B,OAAOA,sBAAsB,GAAG;YAChC,SAAS;QACb;IACJ;IAGJ,MAAME,kBAAkBhB,KACnB,GAAG,CAACiB,CAAAA;QACD,MAAMC,UAAU1B,WAAWyB;QAC3B,IAAI,CAACC,SACD,OAAO;QAEX,MAAM,EAAEvB,OAAO,EAAEC,KAAK,EAAEc,QAAQ,EAAE,GAAGQ;QACrC,MAAMC,MAAMT,WAAW,CAAC,OAAO,EAAEf,SAAS,GAAGA;QAC7C,IAAIU,uBAAuB,CAACc,IAAI,EAC5B,OAAO,GAAGd,uBAAuB,CAACc,IAAI,CAAC,CAAC,EAAEvB,OAAO;QAGrD,OAAOqB;IACX,GACC,MAAM,CAACG;IACZ,OAAOC,WAAW;QACd,cAAcf;QACd,MAAMU;IACV;AACJ"}
@@ -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 { ElasticsearchQuerySearchValuePlugins } from "./types.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,27 +1,12 @@
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
- export const transformValueForSearch = params => {
11
- const {
12
- field,
13
- plugins,
14
- value
15
- } = params;
16
- const fieldType = getBaseFieldType(field);
17
- const plugin = plugins[fieldType];
18
- if (!plugin) {
19
- return value;
20
- }
21
- return plugin.transform({
22
- field,
23
- value
24
- });
1
+ const transformValueForSearch = (params)=>{
2
+ const { field, valueSearchRegistry, value } = params;
3
+ const search = valueSearchRegistry.get(field.type);
4
+ if (!search) return value;
5
+ return search.transform({
6
+ field,
7
+ value
8
+ });
25
9
  };
10
+ export { transformValueForSearch };
26
11
 
27
12
  //# sourceMappingURL=transformValueForSearch.js.map
@@ -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 { ElasticsearchQuerySearchValuePlugins } from \"./types.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\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 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,"file":"operations/entry/elasticsearch/transformValueForSearch.js","sources":["../../../../src/operations/entry/elasticsearch/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"],"names":["transformValueForSearch","params","field","valueSearchRegistry","value","search"],"mappings":"AASO,MAAMA,0BAA0B,CAACC;IACpC,MAAM,EAAEC,KAAK,EAAEC,mBAAmB,EAAEC,KAAK,EAAE,GAAGH;IAC9C,MAAMI,SAASF,oBAAoB,GAAG,CAACD,MAAM,IAAI;IACjD,IAAI,CAACG,QACD,OAAOD;IAEX,OAAOC,OAAO,SAAS,CAAC;QAAEH;QAAOE;IAAM;AAC3C"}
@@ -1,5 +1,4 @@
1
- import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../../plugins/index.js";
2
- import type { ElasticsearchQueryBuilderOperatorPlugin } from "@webiny/api-elasticsearch";
1
+ import type { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
3
2
  import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
4
3
  /**
5
4
  * ./fields
@@ -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,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1,12 +1,32 @@
1
- import type { Client } from "@elastic/elasticsearch";
1
+ import type { Client } from "@webiny/api-opensearch";
2
+ import { type IOpenSearchEntity as IElasticsearchEntity } from "@webiny/api-opensearch";
2
3
  import type { PluginsContainer } from "@webiny/plugins";
3
- import { type IElasticsearchEntity } from "@webiny/api-elasticsearch";
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;