@webiny/api-headless-cms-ddb-es 6.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/configurations.d.ts +3 -2
  2. package/configurations.js +10 -8
  3. package/configurations.js.map +1 -1
  4. package/elasticsearch/createElasticsearchIndex.d.ts +2 -2
  5. package/elasticsearch/createElasticsearchIndex.js +58 -16
  6. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  7. package/exports/api/cms/opensearch.d.ts +9 -0
  8. package/exports/api/cms/opensearch.js +11 -0
  9. package/exports/api/cms/opensearch.js.map +1 -0
  10. package/feature.d.ts +1 -0
  11. package/feature.js +188 -0
  12. package/feature.js.map +1 -0
  13. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  14. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +4 -0
  15. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  16. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  17. package/features/CmsEntryOpenSearchBodyModifier/index.js +3 -0
  18. package/features/CmsEntryOpenSearchBodyModifier/index.js.map +1 -0
  19. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +13 -0
  20. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +36 -0
  21. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  22. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +35 -0
  23. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +4 -0
  24. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  25. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  26. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +4 -0
  27. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  28. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  29. package/features/CmsEntryOpenSearchFieldIndex/constants.js +3 -0
  30. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  31. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +1 -0
  32. package/features/CmsEntryOpenSearchFieldIndex/feature.js +24 -0
  33. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  34. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  35. package/{elasticsearch/indexing/dateTimeIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js} +21 -19
  36. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +10 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +39 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +22 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +25 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  47. package/{elasticsearch/indexing/numberIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js} +11 -8
  48. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +10 -0
  50. package/{elasticsearch/indexing/objectIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js} +50 -86
  51. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +22 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/index.js +5 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/index.js.map +1 -0
  58. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  59. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +38 -0
  60. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  61. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  62. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +4 -0
  63. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  64. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  65. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +4 -0
  66. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  67. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  68. package/features/CmsEntryOpenSearchFilter/constants.js +3 -0
  69. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  70. package/features/CmsEntryOpenSearchFilter/feature.d.ts +1 -0
  71. package/features/CmsEntryOpenSearchFilter/feature.js +16 -0
  72. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  73. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  74. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +23 -0
  75. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  76. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  77. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +61 -0
  78. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  79. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  80. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +49 -0
  81. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  82. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  83. package/features/CmsEntryOpenSearchFilter/index.js +5 -0
  84. package/features/CmsEntryOpenSearchFilter/index.js.map +1 -0
  85. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  86. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +4 -0
  87. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  88. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  89. package/features/CmsEntryOpenSearchFullTextSearch/index.js +3 -0
  90. package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +1 -0
  91. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  92. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
  93. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  94. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  95. package/features/CmsEntryOpenSearchIndex/abstractions.js +4 -0
  96. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  97. package/features/CmsEntryOpenSearchIndex/feature.d.ts +1 -0
  98. package/features/CmsEntryOpenSearchIndex/feature.js +10 -0
  99. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  100. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  101. package/features/CmsEntryOpenSearchIndex/index.js +5 -0
  102. package/features/CmsEntryOpenSearchIndex/index.js.map +1 -0
  103. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  104. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +4 -0
  105. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  106. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  107. package/features/CmsEntryOpenSearchQueryModifier/index.js +3 -0
  108. package/features/CmsEntryOpenSearchQueryModifier/index.js.map +1 -0
  109. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  110. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +4 -0
  111. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  112. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  113. package/features/CmsEntryOpenSearchSortModifier/index.js +3 -0
  114. package/features/CmsEntryOpenSearchSortModifier/index.js.map +1 -0
  115. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  116. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +27 -0
  117. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  118. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  119. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +4 -0
  120. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  121. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  122. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +4 -0
  123. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  124. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +1 -0
  125. package/features/CmsEntryOpenSearchValueSearch/feature.js +16 -0
  126. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  127. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  128. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +23 -0
  129. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  130. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  131. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +55 -0
  132. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  133. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  134. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +24 -0
  135. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  136. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  137. package/features/CmsEntryOpenSearchValueSearch/index.js +5 -0
  138. package/features/CmsEntryOpenSearchValueSearch/index.js.map +1 -0
  139. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  140. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +4 -0
  141. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  142. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  143. package/features/CmsEntryOpenSearchValuesModifier/index.js +3 -0
  144. package/features/CmsEntryOpenSearchValuesModifier/index.js.map +1 -0
  145. package/helpers/entryIndexHelpers.d.ts +5 -3
  146. package/helpers/entryIndexHelpers.js +28 -90
  147. package/helpers/entryIndexHelpers.js.map +1 -1
  148. package/index.d.ts +1 -3
  149. package/index.js +1 -188
  150. package/index.js.map +1 -1
  151. package/operations/entry/elasticsearch/body.d.ts +18 -2
  152. package/operations/entry/elasticsearch/body.js +32 -29
  153. package/operations/entry/elasticsearch/body.js.map +1 -1
  154. package/operations/entry/elasticsearch/fields.d.ts +6 -4
  155. package/operations/entry/elasticsearch/fields.js +14 -57
  156. package/operations/entry/elasticsearch/fields.js.map +1 -1
  157. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +5 -4
  158. package/operations/entry/elasticsearch/filtering/applyFiltering.js +3 -3
  159. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  160. package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -0
  161. package/operations/entry/elasticsearch/filtering/exec.js +11 -64
  162. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  163. package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
  164. package/operations/entry/elasticsearch/filtering/path.js +4 -6
  165. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  166. package/operations/entry/elasticsearch/fullTextSearch.d.ts +2 -2
  167. package/operations/entry/elasticsearch/fullTextSearch.js +25 -29
  168. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  169. package/operations/entry/elasticsearch/sort.d.ts +2 -2
  170. package/operations/entry/elasticsearch/sort.js +2 -6
  171. package/operations/entry/elasticsearch/sort.js.map +1 -1
  172. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
  173. package/operations/entry/elasticsearch/transformValueForSearch.js +4 -14
  174. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  175. package/operations/entry/elasticsearch/types.d.ts +0 -7
  176. package/operations/entry/elasticsearch/types.js.map +1 -1
  177. package/operations/entry/index.d.ts +21 -1
  178. package/operations/entry/index.js +96 -39
  179. package/operations/entry/index.js.map +1 -1
  180. package/operations/entry/transformations/index.d.ts +8 -2
  181. package/operations/entry/transformations/index.js +14 -12
  182. package/operations/entry/transformations/index.js.map +1 -1
  183. package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
  184. package/operations/entry/transformations/modifyEntryValues.js +3 -3
  185. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  186. package/operations/entry/transformations/transformEntryToIndex.d.ts +4 -2
  187. package/operations/entry/transformations/transformEntryToIndex.js +6 -4
  188. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  189. package/operations/group/index.d.ts +2 -2
  190. package/operations/group/index.js +6 -9
  191. package/operations/group/index.js.map +1 -1
  192. package/package.json +25 -23
  193. package/tasks/createIndexTaskPlugin.js +8 -1
  194. package/tasks/createIndexTaskPlugin.js.map +1 -1
  195. package/types.d.ts +7 -112
  196. package/types.js +0 -23
  197. package/types.js.map +1 -1
  198. package/dynamoDb/index.d.ts +0 -3
  199. package/dynamoDb/index.js +0 -8
  200. package/dynamoDb/index.js.map +0 -1
  201. package/dynamoDb/storage/longText.d.ts +0 -10
  202. package/dynamoDb/storage/longText.js +0 -88
  203. package/dynamoDb/storage/longText.js.map +0 -1
  204. package/dynamoDb/storage/richText.d.ts +0 -2
  205. package/dynamoDb/storage/richText.js +0 -51
  206. package/dynamoDb/storage/richText.js.map +0 -1
  207. package/elasticsearch/index.d.ts +0 -2
  208. package/elasticsearch/index.js +0 -5
  209. package/elasticsearch/index.js.map +0 -1
  210. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  211. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  212. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  213. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  214. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  215. package/elasticsearch/indexing/index.d.ts +0 -2
  216. package/elasticsearch/indexing/index.js +0 -10
  217. package/elasticsearch/indexing/index.js.map +0 -1
  218. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  219. package/elasticsearch/indexing/jsonIndexing.js +0 -21
  220. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  221. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  222. package/elasticsearch/indexing/longTextIndexing.js +0 -35
  223. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  224. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  225. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  226. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  227. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  228. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  229. package/elasticsearch/indexing/richTextIndexing.js +0 -24
  230. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  231. package/elasticsearch/indices/base.d.ts +0 -2
  232. package/elasticsearch/indices/base.js +0 -7
  233. package/elasticsearch/indices/base.js.map +0 -1
  234. package/elasticsearch/indices/index.d.ts +0 -1
  235. package/elasticsearch/indices/index.js +0 -6
  236. package/elasticsearch/indices/index.js.map +0 -1
  237. package/elasticsearch/search/index.d.ts +0 -3
  238. package/elasticsearch/search/index.js +0 -6
  239. package/elasticsearch/search/index.js.map +0 -1
  240. package/elasticsearch/search/refSearch.d.ts +0 -2
  241. package/elasticsearch/search/refSearch.js +0 -24
  242. package/elasticsearch/search/refSearch.js.map +0 -1
  243. package/elasticsearch/search/searchableJson.d.ts +0 -2
  244. package/elasticsearch/search/searchableJson.js +0 -53
  245. package/elasticsearch/search/searchableJson.js.map +0 -1
  246. package/elasticsearch/search/timeSearch.d.ts +0 -2
  247. package/elasticsearch/search/timeSearch.js +0 -20
  248. package/elasticsearch/search/timeSearch.js.map +0 -1
  249. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  250. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
  251. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  252. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  253. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
  254. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  255. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  256. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
  257. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  258. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  259. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
  260. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  261. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  262. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
  263. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  264. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  265. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
  266. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  267. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  268. package/operations/entry/elasticsearch/plugins/search.js +0 -18
  269. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  270. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  271. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
  272. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  273. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  274. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
  275. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  276. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  277. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
  278. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  279. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -24
  280. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
  281. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  282. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  283. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
  284. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  285. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  286. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
  287. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  288. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  289. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
  290. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  291. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  292. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
  293. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  294. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  295. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
  296. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  297. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  298. package/plugins/CmsEntryFilterPlugin.js +0 -15
  299. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  300. package/plugins/index.d.ts +0 -8
  301. package/plugins/index.js +0 -10
  302. package/plugins/index.js.map +0 -1
package/types.js CHANGED
@@ -5,29 +5,6 @@
5
5
  * @category CmsEntry
6
6
  */
7
7
 
8
- /**
9
- * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
10
- *
11
- * @category Elasticsearch
12
- * @category CmsEntry
13
- */
14
-
15
- /**
16
- * Arguments for the method that is transforming content entry from Elasticsearch into the original one.
17
- *
18
- * @category Elasticsearch
19
- * @category CmsEntry
20
- */
21
-
22
- /**
23
- * A plugin defining transformation of entry for Elasticsearch.
24
- *
25
- * @category Plugin
26
- * @category ContentModelField
27
- * @category CmsEntry
28
- * @category Elasticsearch
29
- */
30
-
31
8
  export let ENTITIES = /*#__PURE__*/function (ENTITIES) {
32
9
  ENTITIES["GROUPS"] = "CmsGroups";
33
10
  ENTITIES["MODELS"] = "CmsModels";
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import type { Plugin, PluginCollection } from \"@webiny/plugins/types.js\";\nimport type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsEntryValues,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n CmsModelFieldType,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { Client } from \"@webiny/api-opensearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { IOpenSearchEntity as IElasticsearchEntity } from \"@webiny/api-opensearch\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Partial<T>;\n /**\n * Dev can add whatever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: CmsModelFieldType;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: string;\n esTable?: string;\n plugins?: PluginCollection;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n\nexport interface IGetEntitiesResponse {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n entriesEs: IElasticsearchEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => ITable;\n getEsTable: () => ITable;\n getEntities: () => IGetEntitiesResponse;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":"AAmBA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkDA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsEntryValues,\n CmsModel,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type {\n Client,\n IOpenSearchEntity as IElasticsearchEntity,\n OpenSearchContext\n} from \"@webiny/api-opensearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport interface CmsContext extends BaseCmsContext, OpenSearchContext {}\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Partial<T>;\n /**\n * Dev can add whatever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: string;\n esTable?: string;\n plugins: PluginsContainer;\n container: CmsContext[\"container\"];\n}\n\nexport interface IGetEntitiesResponse {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n entriesEs: IElasticsearchEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => ITable;\n getEsTable: () => ITable;\n getEntities: () => IGetEntitiesResponse;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":"AAmBA;AACA;AACA;AACA;AACA;AACA;;AAYA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- declare const _default: () => import("@webiny/api-headless-cms/index.js").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types/modelField.js").CmsModelField>[];
2
- export default _default;
3
- export declare const createDynamoDbPlugins: () => import("@webiny/api-headless-cms/index.js").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types/modelField.js").CmsModelField>[];
package/dynamoDb/index.js DELETED
@@ -1,8 +0,0 @@
1
- import { createRichTextStorageTransformPlugin } from "./storage/richText.js";
2
- import { createLongTextStorageTransformPlugin } from "./storage/longText.js";
3
- export default () => createDynamoDbPlugins();
4
- export const createDynamoDbPlugins = () => {
5
- return [createRichTextStorageTransformPlugin(), createLongTextStorageTransformPlugin()];
6
- };
7
-
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDynamoDbPlugins"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText.js\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText.js\";\n\nexport default () => createDynamoDbPlugins();\n\nexport const createDynamoDbPlugins = () => {\n return [createRichTextStorageTransformPlugin(), createLongTextStorageTransformPlugin()];\n};\n"],"mappings":"AAAA,SAASA,oCAAoC;AAC7C,SAASC,oCAAoC;AAE7C,eAAe,MAAMC,qBAAqB,CAAC,CAAC;AAE5C,OAAO,MAAMA,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,CAACF,oCAAoC,CAAC,CAAC,EAAEC,oCAAoC,CAAC,CAAC,CAAC;AAC3F,CAAC","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
5
- export interface StorageValue {
6
- compression: string;
7
- value: string;
8
- isArray?: boolean;
9
- }
10
- export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue, import("@webiny/api-headless-cms/types").CmsModelField>;
@@ -1,88 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
-
5
- import WebinyError from "@webiny/error";
6
- import { compress as gzip, decompress as ungzip } from "@webiny/utils/compression/gzip.js";
7
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
8
- const GZIP = "gzip";
9
- const TO_STORAGE_ENCODING = "base64";
10
- const FROM_STORAGE_ENCODING = "utf8";
11
- const convertToBuffer = value => {
12
- if (typeof value === "string") {
13
- return Buffer.from(value, TO_STORAGE_ENCODING);
14
- }
15
- return value;
16
- };
17
- export const createLongTextStorageTransformPlugin = () => {
18
- const plugin = new StorageTransformPlugin({
19
- name: "headless-cms.storage-transform.long-text.default",
20
- fieldType: "long-text",
21
- fromStorage: async ({
22
- field,
23
- value: storageValue
24
- }) => {
25
- const typeOf = typeof storageValue;
26
- if (!storageValue || typeOf === "string" || typeOf === "number" || Array.isArray(storageValue) === true) {
27
- return storageValue;
28
- } else if (typeOf !== "object") {
29
- throw new WebinyError(`LongText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
30
- }
31
- const {
32
- compression,
33
- value,
34
- isArray
35
- } = storageValue;
36
- /**
37
- * Check if possibly undefined, null, empty...
38
- */
39
- if (!compression) {
40
- throw new WebinyError(`Missing compression in "fromStorage" function in field "${field.storageId}" - ${field.fieldId}.": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
41
- value: storageValue
42
- });
43
- } else if (compression !== GZIP) {
44
- throw new WebinyError(`This plugin cannot transform something not compressed with "GZIP".`, "WRONG_COMPRESSION", {
45
- compression
46
- });
47
- }
48
- try {
49
- const buf = await ungzip(convertToBuffer(value));
50
- const result = buf.toString(FROM_STORAGE_ENCODING);
51
- if (!isArray) {
52
- return result;
53
- }
54
- return JSON.parse(result);
55
- } catch (ex) {
56
- console.log("Error while transforming long-text.");
57
- console.log(ex.message);
58
- return "";
59
- }
60
- },
61
- toStorage: async ({
62
- value: initialValue
63
- }) => {
64
- /**
65
- * There is a possibility that we are trying to compress already compressed value.
66
- */
67
- if (initialValue && initialValue.hasOwnProperty("compression") === true) {
68
- return initialValue;
69
- }
70
- const isArray = Array.isArray(initialValue);
71
- const value = isArray ? JSON.stringify(initialValue) : initialValue;
72
- const compressedValue = await gzip(value);
73
- const result = {
74
- compression: GZIP,
75
- value: compressedValue.toString(TO_STORAGE_ENCODING)
76
- };
77
- if (!isArray) {
78
- return result;
79
- }
80
- result.isArray = isArray;
81
- return result;
82
- }
83
- });
84
- plugin.name = plugin.name = `headless-cms.dynamodb.storageTransform.long-text`;
85
- return plugin;
86
- };
87
-
88
- //# sourceMappingURL=longText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","compress","gzip","decompress","ungzip","StorageTransformPlugin","GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","createLongTextStorageTransformPlugin","plugin","name","fieldType","fromStorage","field","storageValue","typeOf","Array","isArray","storageId","fieldId","compression","JSON","stringify","buf","result","toString","parse","ex","console","log","message","toStorage","initialValue","hasOwnProperty","compressedValue"],"sources":["longText.ts"],"sourcesContent":["/**\n * File is @internal\n */\n\nimport WebinyError from \"@webiny/error\";\nimport { compress as gzip, decompress as ungzip } from \"@webiny/utils/compression/gzip.js\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nconst convertToBuffer = (value: string | Buffer): Buffer => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport interface StorageValue {\n compression: string;\n value: string;\n isArray?: boolean;\n}\n\nexport const createLongTextStorageTransformPlugin = () => {\n const plugin = new StorageTransformPlugin<string | string[], StorageValue>({\n name: \"headless-cms.storage-transform.long-text.default\",\n fieldType: \"long-text\",\n fromStorage: async ({ field, value: storageValue }) => {\n const typeOf = typeof storageValue;\n if (\n !storageValue ||\n typeOf === \"string\" ||\n typeOf === \"number\" ||\n Array.isArray(storageValue) === true\n ) {\n return storageValue as unknown as string | string[];\n } else if (typeOf !== \"object\") {\n throw new WebinyError(\n `LongText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n const { compression, value, isArray } = storageValue;\n /**\n * Check if possibly undefined, null, empty...\n */\n if (!compression) {\n throw new WebinyError(\n `Missing compression in \"fromStorage\" function in field \"${\n field.storageId\n }\" - ${field.fieldId}.\": ${JSON.stringify(storageValue)}.`,\n \"MISSING_COMPRESSION\",\n {\n value: storageValue\n }\n );\n } else if (compression !== GZIP) {\n throw new WebinyError(\n `This plugin cannot transform something not compressed with \"GZIP\".`,\n \"WRONG_COMPRESSION\",\n {\n compression\n }\n );\n }\n try {\n const buf = await ungzip(convertToBuffer(value));\n const result = buf.toString(FROM_STORAGE_ENCODING);\n if (!isArray) {\n return result;\n }\n return JSON.parse(result);\n } catch (ex) {\n console.log(\"Error while transforming long-text.\");\n console.log(ex.message);\n return \"\";\n }\n },\n toStorage: async ({ value: initialValue }) => {\n /**\n * There is a possibility that we are trying to compress already compressed value.\n */\n if (initialValue && initialValue.hasOwnProperty(\"compression\") === true) {\n return initialValue as unknown as StorageValue;\n }\n const isArray = Array.isArray(initialValue);\n const value = isArray ? JSON.stringify(initialValue) : initialValue;\n const compressedValue = await gzip(value);\n\n const result: StorageValue = {\n compression: GZIP,\n value: compressedValue.toString(TO_STORAGE_ENCODING)\n };\n if (!isArray) {\n return result;\n }\n result.isArray = isArray;\n return result;\n }\n });\n plugin.name = plugin.name = `headless-cms.dynamodb.storageTransform.long-text`;\n\n return plugin;\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,QAAQ,IAAIC,IAAI,EAAEC,UAAU,IAAIC,MAAM,QAAQ,mCAAmC;AAC1F,SAASC,sBAAsB,QAAQ,0BAA0B;AAEjE,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAG,MAAM;AAEpC,MAAMC,eAAe,GAAIC,KAAsB,IAAa;EACxD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOC,MAAM,CAACC,IAAI,CAACF,KAAK,EAAEH,mBAAmB,CAAC;EAClD;EACA,OAAOG,KAAK;AAChB,CAAC;AAQD,OAAO,MAAMG,oCAAoC,GAAGA,CAAA,KAAM;EACtD,MAAMC,MAAM,GAAG,IAAIT,sBAAsB,CAAkC;IACvEU,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAA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ACF,EAAE,CAACG,OAAO,CAAC;QACvB,OAAO,EAAE;MACb;IACJ,CAAC;IACDC,SAAS,EAAE,MAAAA,CAAO;MAAE1B,KAAK,EAAE2B;IAAa,CAAC,KAAK;MAC1C;AACZ;AACA;MACY,IAAIA,YAAY,IAAIA,YAAY,CAACC,cAAc,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE;QACrE,OAAOD,YAAY;MACvB;MACA,MAAMf,OAAO,GAAGD,KAAK,CAACC,OAAO,CAACe,YAAY,CAAC;MAC3C,MAAM3B,KAAK,GAAGY,OAAO,GAAGI,IAAI,CAACC,SAAS,CAACU,YAAY,CAAC,GAAGA,YAAY;MACnE,MAAME,eAAe,GAAG,MAAMrC,IAAI,CAACQ,KAAK,CAAC;MAEzC,MAAMmB,MAAoB,GAAG;QACzBJ,WAAW,EAAEnB,IAAI;QACjBI,KAAK,EAAE6B,eAAe,CAACT,QAAQ,CAACvB,mBAAmB;MACvD,CAAC;MACD,IAAI,CAACe,OAAO,EAAE;QACV,OAAOO,MAAM;MACjB;MACAA,MAAM,CAACP,OAAO,GAAGA,OAAO;MACxB,OAAOO,MAAM;IACjB;EACJ,CAAC,CAAC;EACFf,MAAM,CAACC,IAAI,GAAGD,MAAM,CAACC,IAAI,GAAG,kDAAkD;EAE9E,OAAOD,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
2
- export declare const createRichTextStorageTransformPlugin: () => StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>;
@@ -1,51 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
3
- import { CompressorPlugin } from "@webiny/api";
4
- export const createRichTextStorageTransformPlugin = () => {
5
- const plugin = new StorageTransformPlugin({
6
- name: "headless-cms.storage-transform.rich-text.default",
7
- fieldType: "rich-text",
8
- fromStorage: async ({
9
- field,
10
- value: storageValue,
11
- plugins
12
- }) => {
13
- if (!storageValue) {
14
- return storageValue;
15
- } else if (typeof storageValue !== "object") {
16
- throw new WebinyError(`RichText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
17
- }
18
- let compressor;
19
- try {
20
- compressor = plugins.oneByType(CompressorPlugin.type);
21
- } catch {
22
- return storageValue;
23
- }
24
- try {
25
- return await compressor.getCompressor().decompress(storageValue);
26
- } catch {
27
- return storageValue;
28
- }
29
- },
30
- toStorage: async ({
31
- value,
32
- plugins
33
- }) => {
34
- let compressor;
35
- try {
36
- compressor = plugins.oneByType(CompressorPlugin.type);
37
- } catch {
38
- return value;
39
- }
40
- try {
41
- return await compressor.getCompressor().compress(value);
42
- } catch {
43
- return value;
44
- }
45
- }
46
- });
47
- plugin.name = `headless-cms.dynamodb.storageTransform.rich-text`;
48
- return plugin;
49
- };
50
-
51
- //# sourceMappingURL=richText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","StorageTransformPlugin","CompressorPlugin","createRichTextStorageTransformPlugin","plugin","name","fieldType","fromStorage","field","value","storageValue","plugins","storageId","fieldId","compressor","oneByType","type","getCompressor","decompress","toStorage","compress"],"sources":["richText.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CompressorPlugin } from \"@webiny/api\";\n\nexport const createRichTextStorageTransformPlugin = () => {\n const plugin = new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.rich-text.default\",\n fieldType: \"rich-text\",\n fromStorage: async ({ field, value: storageValue, plugins }) => {\n if (!storageValue) {\n return storageValue;\n } else if (typeof storageValue !== \"object\") {\n throw new WebinyError(\n `RichText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch {\n return storageValue;\n }\n\n try {\n return await compressor.getCompressor().decompress(storageValue);\n } catch {\n return storageValue;\n }\n },\n toStorage: async ({ value, plugins }) => {\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch {\n return value;\n }\n try {\n return await compressor.getCompressor().compress(value);\n } catch {\n return value;\n }\n }\n });\n plugin.name = `headless-cms.dynamodb.storageTransform.rich-text`;\n\n return plugin;\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,OAAO,MAAMC,oCAAoC,GAAGA,CAAA,KAAM;EACtD,MAAMC,MAAM,GAAG,IAAIH,sBAAsB,CAAC;IACtCI,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,MAAAA,CAAO;MAAEC,KAAK;MAAEC,KAAK,EAAEC,YAAY;MAAEC;IAAQ,CAAC,KAAK;MAC5D,IAAI,CAACD,YAAY,EAAE;QACf,OAAOA,YAAY;MACvB,CAAC,MAAM,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;QACzC,MAAM,IAAIV,WAAW,CACjB,gFAAgFQ,KAAK,CAACI,SAAS,OAAOJ,KAAK,CAACK,OAAO,GACvH,CAAC;MACL;MAEA,IAAIC,UAA4B;MAEhC,IAAI;QACAA,UAAU,GAAGH,OAAO,CAACI,SAAS,CAAmBb,gBAAgB,CAACc,IAAI,CAAC;MAC3E,CAAC,CAAC,MAAM;QACJ,OAAON,YAAY;MACvB;MAEA,IAAI;QACA,OAAO,MAAMI,UAAU,CAACG,aAAa,CAAC,CAAC,CAACC,UAAU,CAACR,YAAY,CAAC;MACpE,CAAC,CAAC,MAAM;QACJ,OAAOA,YAAY;MACvB;IACJ,CAAC;IACDS,SAAS,EAAE,MAAAA,CAAO;MAAEV,KAAK;MAAEE;IAAQ,CAAC,KAAK;MACrC,IAAIG,UAA4B;MAEhC,IAAI;QACAA,UAAU,GAAGH,OAAO,CAACI,SAAS,CAAmBb,gBAAgB,CAACc,IAAI,CAAC;MAC3E,CAAC,CAAC,MAAM;QACJ,OAAOP,KAAK;MAChB;MACA,IAAI;QACA,OAAO,MAAMK,UAAU,CAACG,aAAa,CAAC,CAAC,CAACG,QAAQ,CAACX,KAAK,CAAC;MAC3D,CAAC,CAAC,MAAM;QACJ,OAAOA,KAAK;MAChB;IACJ;EACJ,CAAC,CAAC;EACFL,MAAM,CAACC,IAAI,GAAG,kDAAkD;EAEhE,OAAOD,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const _default: () => (import("../types.js").CmsModelFieldToElasticsearchPlugin[] | import("../index.js").CmsEntryElasticsearchQueryBuilderValueSearchPlugin[])[];
2
- export default _default;
@@ -1,5 +0,0 @@
1
- import elasticsearchIndexingPlugins from "./indexing/index.js";
2
- import elasticsearchSearchPlugins from "./search/index.js";
3
- export default () => [elasticsearchIndexingPlugins(), elasticsearchSearchPlugins()];
4
-
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["elasticsearchIndexingPlugins","elasticsearchSearchPlugins"],"sources":["index.ts"],"sourcesContent":["import elasticsearchIndexingPlugins from \"./indexing/index.js\";\nimport elasticsearchSearchPlugins from \"./search/index.js\";\n\nexport default () => [elasticsearchIndexingPlugins(), elasticsearchSearchPlugins()];\n"],"mappings":"AAAA,OAAOA,4BAA4B;AACnC,OAAOC,0BAA0B;AAEjC,eAAe,MAAM,CAACD,4BAA4B,CAAC,CAAC,EAAEC,0BAA0B,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
2
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
- export default _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["convertTimeToNumber","time","hours","minutes","seconds","split","map","Number","convertNumberToTime","value","undefined","Math","floor","v","String","padStart","join","convertValueFromIndex","field","type","settings","dateValue","Date","toISOString","slice","convertValueToIndex","name","fieldType","unmappedType","toIndex","Array","isArray","fromIndex"],"sources":["dateTimeIndexing.ts"],"sourcesContent":["import type { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n const hours = Math.floor(value / 60 / 60);\n\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-datetime\",\n fieldType: \"datetime\",\n unmappedType: () => {\n return \"date\";\n },\n toIndex({ field, value }) {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n const dateValue = convertValueToIndex(value, field as CmsModelDateTimeField);\n return {\n value: dateValue\n };\n },\n fromIndex({ field, value }) {\n if (Array.isArray(value)) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);\n }\n});\n"],"mappings":"AAGA,MAAMA,mBAAmB,GAAIC,IAAa,IAAoB;EAC1D,IAAI,CAACA,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EACA,MAAM,CAACC,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EACjE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAED,MAAMI,mBAAmB,GAAIC,KAAc,IAAoB;EAC3D,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,EAAE;IACvC,OAAO,IAAI;EACf;EAEA,MAAMP,KAAK,GAAGS,IAAI,CAACC,KAAK,CAACH,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC;EAEzC,MAAMN,OAAO,GAAGQ,IAAI,CAACC,KAAK,CAAC,CAACH,KAAK,GAAGP,KAAK,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;EAE1D,MAAME,OAAO,GAAGO,IAAI,CAACC,KAAK,CAACH,KAAK,GAAGP,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,CAAC;EAElE,OAAO,CAACD,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC,CAACE,GAAG,CAACO,CAAC,IAAIC,MAAM,CAACD,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;AACnF,CAAC;AAED,MAAMC,qBAAqB,GAAGA,CAC1BR,KAAsB,EACtBS,KAA4B,KACZ;EAChB,MAAMC,IAAI,GAAGD,KAAK,CAACE,QAAQ,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,KAAK,EAAES,KAA8B,CAAC;IAC5E,OAAO;MACHT,KAAK,EAAEY;IACX,CAAC;EACL,CAAC;EACDW,SAASA,CAAC;IAAEd,KAAK;IAAET;EAAM,CAAC,EAAE;IACxB,IAAIqB,KAAK,CAACC,OAAO,CAACtB,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK,CAACH,GAAG,CAAEO,CAAS,IAAK;QAC5B,OAAOI,qBAAqB,CAACJ,CAAC,EAAEK,KAA8B,CAAC;MACnE,CAAC,CAAC;IACN;IACA,OAAOD,qBAAqB,CAACR,KAAK,EAAES,KAA8B,CAAC;EACvE;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
2
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
- export default _default;
@@ -1,47 +0,0 @@
1
- export default () => ({
2
- type: "cms-model-field-to-elastic-search",
3
- name: "cms-model-field-to-elastic-search-default",
4
- fieldType: "*",
5
- toIndex({
6
- field,
7
- getFieldTypePlugin,
8
- value
9
- }) {
10
- const fieldTypePlugin = getFieldTypePlugin(field.type);
11
-
12
- // when field is searchable, assign it to `values`
13
- if (fieldTypePlugin.isSearchable === true) {
14
- return {
15
- value
16
- };
17
- }
18
-
19
- // when field is not searchable, move its value to `rawValues`.
20
- // `rawValues` is a field in ES index that's not being indexed.
21
- return {
22
- rawValue: value
23
- };
24
- },
25
- fromIndex({
26
- field,
27
- getFieldTypePlugin,
28
- value,
29
- rawValue
30
- }) {
31
- const {
32
- isSearchable
33
- } = getFieldTypePlugin(field.type);
34
- /**
35
- * We will return the rawValue in case if not searchable and value in case of not searchable field.
36
- * This is to make sure that changed isSearchable parameter does not make the data to be null / undefined.
37
- *
38
- * Users can change isSearchable parameter at any time on the GraphQL field - and that could create a problem for them.
39
- */
40
- if (isSearchable) {
41
- return value === undefined ? rawValue : value;
42
- }
43
- return rawValue === undefined ? value : rawValue;
44
- }
45
- });
46
-
47
- //# sourceMappingURL=defaultFieldIndexing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["type","name","fieldType","toIndex","field","getFieldTypePlugin","value","fieldTypePlugin","isSearchable","rawValue","fromIndex","undefined"],"sources":["defaultFieldIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-default\",\n fieldType: \"*\",\n toIndex({ field, getFieldTypePlugin, value }) {\n const fieldTypePlugin = getFieldTypePlugin(field.type);\n\n // when field is searchable, assign it to `values`\n if (fieldTypePlugin.isSearchable === true) {\n return { value };\n }\n\n // when field is not searchable, move its value to `rawValues`.\n // `rawValues` is a field in ES index that's not being indexed.\n return { rawValue: value };\n },\n fromIndex({ field, getFieldTypePlugin, value, rawValue }) {\n const { isSearchable } = getFieldTypePlugin(field.type);\n /**\n * We will return the rawValue in case if not searchable and value in case of not searchable field.\n * This is to make sure that changed isSearchable parameter does not make the data to be null / undefined.\n *\n * Users can change isSearchable parameter at any time on the GraphQL field - and that could create a problem for them.\n */\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n});\n"],"mappings":"AAEA,eAAe,OAA2C;EACtDA,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,2CAA2C;EACjDC,SAAS,EAAE,GAAG;EACdC,OAAOA,CAAC;IAAEC,KAAK;IAAEC,kBAAkB;IAAEC;EAAM,CAAC,EAAE;IAC1C,MAAMC,eAAe,GAAGF,kBAAkB,CAACD,KAAK,CAACJ,IAAI,CAAC;;IAEtD;IACA,IAAIO,eAAe,CAACC,YAAY,KAAK,IAAI,EAAE;MACvC,OAAO;QAAEF;MAAM,CAAC;IACpB;;IAEA;IACA;IACA,OAAO;MAAEG,QAAQ,EAAEH;IAAM,CAAC;EAC9B,CAAC;EACDI,SAASA,CAAC;IAAEN,KAAK;IAAEC,kBAAkB;IAAEC,KAAK;IAAEG;EAAS,CAAC,EAAE;IACtD,MAAM;MAAED;IAAa,CAAC,GAAGH,kBAAkB,CAACD,KAAK,CAACJ,IAAI,CAAC;IACvD;AACR;AACA;AACA;AACA;AACA;IACQ,IAAIQ,YAAY,EAAE;MACd,OAAOF,KAAK,KAAKK,SAAS,GAAGF,QAAQ,GAAGH,KAAK;IACjD;IACA,OAAOG,QAAQ,KAAKE,SAAS,GAAGL,KAAK,GAAGG,QAAQ;EACpD;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const _default: () => import("../../types.js").CmsModelFieldToElasticsearchPlugin[];
2
- export default _default;
@@ -1,10 +0,0 @@
1
- import richTextIndexing from "./richTextIndexing.js";
2
- import longTextIndexing from "./longTextIndexing.js";
3
- import defaultFieldIndexing from "./defaultFieldIndexing.js";
4
- import dateTimeIndexing from "./dateTimeIndexing.js";
5
- import numberIndexing from "./numberIndexing.js";
6
- import objectIndexing from "./objectIndexing.js";
7
- import { createJsonIndexing } from "./jsonIndexing.js";
8
- export default () => [dateTimeIndexing(), richTextIndexing(), longTextIndexing(), defaultFieldIndexing(), numberIndexing(), objectIndexing(), createJsonIndexing()];
9
-
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["richTextIndexing","longTextIndexing","defaultFieldIndexing","dateTimeIndexing","numberIndexing","objectIndexing","createJsonIndexing"],"sources":["index.ts"],"sourcesContent":["import richTextIndexing from \"./richTextIndexing.js\";\nimport longTextIndexing from \"./longTextIndexing.js\";\nimport defaultFieldIndexing from \"./defaultFieldIndexing.js\";\nimport dateTimeIndexing from \"./dateTimeIndexing.js\";\nimport numberIndexing from \"./numberIndexing.js\";\nimport objectIndexing from \"./objectIndexing.js\";\nimport { createJsonIndexing } from \"./jsonIndexing.js\";\n\nexport default () => [\n dateTimeIndexing(),\n richTextIndexing(),\n longTextIndexing(),\n defaultFieldIndexing(),\n numberIndexing(),\n objectIndexing(),\n createJsonIndexing()\n];\n"],"mappings":"AAAA,OAAOA,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,oBAAoB;AAC3B,OAAOC,gBAAgB;AACvB,OAAOC,cAAc;AACrB,OAAOC,cAAc;AACrB,SAASC,kBAAkB;AAE3B,eAAe,MAAM,CACjBH,gBAAgB,CAAC,CAAC,EAClBH,gBAAgB,CAAC,CAAC,EAClBC,gBAAgB,CAAC,CAAC,EAClBC,oBAAoB,CAAC,CAAC,EACtBE,cAAc,CAAC,CAAC,EAChBC,cAAc,CAAC,CAAC,EAChBC,kBAAkB,CAAC,CAAC,CACvB","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
2
- export declare const createJsonIndexing: () => CmsModelFieldToElasticsearchPlugin;
@@ -1,21 +0,0 @@
1
- export const createJsonIndexing = () => {
2
- return {
3
- type: "cms-model-field-to-elastic-search",
4
- name: "cms-model-field-to-elastic-search-json",
5
- fieldType: "json",
6
- toIndex({
7
- value
8
- }) {
9
- return {
10
- rawValue: value
11
- };
12
- },
13
- fromIndex({
14
- rawValue
15
- }) {
16
- return rawValue;
17
- }
18
- };
19
- };
20
-
21
- //# sourceMappingURL=jsonIndexing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createJsonIndexing","type","name","fieldType","toIndex","value","rawValue","fromIndex"],"sources":["jsonIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nexport const createJsonIndexing = (): CmsModelFieldToElasticsearchPlugin => {\n return {\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-json\",\n fieldType: \"json\",\n toIndex({ value }) {\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,kBAAkB,GAAGA,CAAA,KAA0C;EACxE,OAAO;IACHC,IAAI,EAAE,mCAAmC;IACzCC,IAAI,EAAE,wCAAwC;IAC9CC,SAAS,EAAE,MAAM;IACjBC,OAAOA,CAAC;MAAEC;IAAM,CAAC,EAAE;MACf,OAAO;QACHC,QAAQ,EAAED;MACd,CAAC;IACL,CAAC;IACDE,SAASA,CAAC;MAAED;IAAS,CAAC,EAAE;MACpB,OAAOA,QAAQ;IACnB;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
2
- /**
3
- * The long-text indexing plugin must take in consideration that users might have list of long-text fields.
4
- * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.
5
- */
6
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
7
- export default _default;
@@ -1,35 +0,0 @@
1
- /**
2
- * The long-text indexing plugin must take in consideration that users might have list of long-text fields.
3
- * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.
4
- */
5
- export default () => ({
6
- type: "cms-model-field-to-elastic-search",
7
- name: "cms-model-field-to-elastic-search-long-text",
8
- fieldType: "long-text",
9
- toIndex({
10
- rawValue
11
- }) {
12
- /**
13
- * We take the raw value, before it was prepared via `transformToStorage` for storage (there might be some transform due to DynamoDB) and store it in the Elasticsearch to be indexed.
14
- */
15
- return {
16
- value: Array.isArray(rawValue) ? rawValue : rawValue || ""
17
- };
18
- },
19
- /**
20
- * When taking value from the index, we can return the original value.
21
- * At that point the `transformFromStorage` does not need to do anything.
22
- *
23
- * We need to decode to support older systems.
24
- */
25
- fromIndex({
26
- value
27
- }) {
28
- if (Array.isArray(value)) {
29
- return value;
30
- }
31
- return value || "";
32
- }
33
- });
34
-
35
- //# sourceMappingURL=longTextIndexing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["type","name","fieldType","toIndex","rawValue","value","Array","isArray","fromIndex"],"sources":["longTextIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\n/**\n * The long-text indexing plugin must take in consideration that users might have list of long-text fields.\n * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.\n */\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-long-text\",\n fieldType: \"long-text\",\n toIndex({ rawValue }) {\n /**\n * We take the raw value, before it was prepared via `transformToStorage` for storage (there might be some transform due to DynamoDB) and store it in the Elasticsearch to be indexed.\n */\n return {\n value: Array.isArray(rawValue) ? rawValue : rawValue || \"\"\n };\n },\n /**\n * When taking value from the index, we can return the original value.\n * At that point the `transformFromStorage` does not need to do anything.\n *\n * We need to decode to support older systems.\n */\n fromIndex({ value }) {\n if (Array.isArray(value)) {\n return value;\n }\n return value || \"\";\n }\n});\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA,eAAe,OAA2C;EACtDA,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAS,CAAC,EAAE;IAClB;AACR;AACA;IACQ,OAAO;MACHC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAGA,QAAQ,IAAI;IAC5D,CAAC;EACL,CAAC;EACD;AACJ;AACA;AACA;AACA;AACA;EACII,SAASA,CAAC;IAAEH;EAAM,CAAC,EAAE;IACjB,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK;IAChB;IACA,OAAOA,KAAK,IAAI,EAAE;EACtB;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
2
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
- export default _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["convertToString","value","Array","isArray","map","String","convertToFloat","parseFloat","v","type","name","fieldType","unmappedType","toIndex","fromIndex"],"sources":["numberIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nconst convertToString = (value: number[] | number) => {\n if (Array.isArray(value) === false) {\n return value;\n }\n return (value as number[]).map(String);\n};\n\nconst convertToFloat = (value: string[] | number) => {\n if (Array.isArray(value) === false) {\n return typeof value === \"string\" ? parseFloat(value) : value;\n }\n return (value as string[]).map(v => parseFloat(v));\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-number\",\n fieldType: \"number\",\n unmappedType: () => {\n return \"float\";\n },\n toIndex({ value }) {\n return {\n value: convertToString(value)\n };\n },\n fromIndex({ value }) {\n return convertToFloat(value);\n }\n});\n"],"mappings":"AAEA,MAAMA,eAAe,GAAIC,KAAwB,IAAK;EAClD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAOA,KAAK;EAChB;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACC,MAAM,CAAC;AAC1C,CAAC;AAED,MAAMC,cAAc,GAAIL,KAAwB,IAAK;EACjD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGM,UAAU,CAACN,KAAK,CAAC,GAAGA,KAAK;EAChE;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACI,CAAC,IAAID,UAAU,CAACC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,eAAe,OAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,0CAA0C;EAChDC,SAAS,EAAE,QAAQ;EACnBC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAO,OAAO;EAClB,CAAC;EACDC,OAAOA,CAAC;IAAEZ;EAAM,CAAC,EAAE;IACf,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAK;IAChC,CAAC;EACL,CAAC;EACDa,SAASA,CAAC;IAAEb;EAAM,CAAC,EAAE;IACjB,OAAOK,cAAc,CAACL,KAAK,CAAC;EAChC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- /**
2
- * TODO remove rawValue when field aliases and field types targeting will be active.
3
- *
4
- * Currently we use rawValue for the values that we do not want to be indexed.
5
- * When field aliases and types in the value path will be active, we can target the keys directly.
6
- *
7
- * This change will be incompatible with the current systems so we will need to release a major version.
8
- *
9
- */
10
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
11
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
12
- export default _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["getFieldIdentifiers","processToIndex","fields","value","sourceValue","rawValue","sourceRawValue","getFieldIndexPlugin","getFieldTypePlugin","plugins","model","reducer","values","field","plugin","type","toIndex","identifiers","valueIdentifier","rawValueIdentifier","undefined","reduce","processFromIndex","fromIndex","name","fieldType","initialValue","initialRawValue","settings","list","result","key","push","length","source","map","_","index"],"sources":["objectIndexing.ts"],"sourcesContent":["/**\n * TODO remove rawValue when field aliases and field types targeting will be active.\n *\n * Currently we use rawValue for the values that we do not want to be indexed.\n * When field aliases and types in the value path will be active, we can target the keys directly.\n *\n * This change will be incompatible with the current systems so we will need to release a major version.\n *\n */\n\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\nimport type {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { getFieldIdentifiers } from \"~/helpers/index.js\";\n\ninterface ProcessToIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue: Record<string, any>;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<\"value\" | \"rawValue\", Record<string, any>>;\n}\n\ninterface ProcessFromIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue?: Record<string, any> | null;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<string, any>;\n}\n\ninterface ReducerValue {\n value: {\n [key: string]: string;\n };\n rawValue: {\n [key: string]: string;\n };\n}\n\nconst processToIndex: ProcessToIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: ReducerValue, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.toIndex) {\n return values;\n }\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins\n });\n\n if (value !== undefined) {\n values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n if (rawValue !== undefined) {\n values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] =\n rawValue;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, { value: {}, rawValue: {} });\n};\nconst processFromIndex: ProcessFromIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: Record<string, string>, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.fromIndex) {\n return values;\n }\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const value = plugin.fromIndex({\n plugins,\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue\n ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier]\n : null,\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (value !== undefined) {\n values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, {});\n};\n\ninterface ToIndexMultipleFieldValue {\n value: Record<string, string>[];\n rawValue: Record<string, string>[];\n}\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-object\",\n fieldType: \"object\",\n toIndex({\n plugins,\n model,\n field,\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin\n }) {\n if (!initialValue) {\n return {\n value: null\n };\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.list) {\n const result: ToIndexMultipleFieldValue = {\n value: [],\n rawValue: []\n };\n for (const key in initialValue) {\n const { value, rawValue } = processToIndex({\n value: initialValue[key],\n rawValue: initialRawValue[key],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n\n result.value.push(value);\n result.rawValue.push(rawValue);\n }\n\n return {\n value: result.value.length > 0 ? result.value : undefined,\n rawValue: result.rawValue.length > 0 ? result.rawValue : undefined\n };\n }\n\n return processToIndex({\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n },\n fromIndex({ field, value, rawValue, model, plugins, getFieldIndexPlugin, getFieldTypePlugin }) {\n if (!value) {\n return null;\n }\n\n const fields = field.settings?.fields || [];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.list) {\n /**\n * Why this `value || rawValue || []`?\n * It's possible that an object contains all non-indexable fields, or vice-versa, and so\n * we can never be sure which array we can reliably use as a source of values.\n */\n const source = value || rawValue || [];\n\n return source.map((_: any, index: number) =>\n processFromIndex({\n value: value ? value[index] || {} : {},\n rawValue: rawValue ? rawValue[index] || {} : {},\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n })\n );\n }\n\n return processFromIndex({\n value,\n rawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n }\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,mBAAmB;AAmC5B,MAAMC,cAA8B,GAAGA,CAAC;EACpCC,MAAM;EACNC,KAAK,EAAEC,WAAW;EAClBC,QAAQ,EAAEC,cAAc;EACxBC,mBAAmB;EACnBC,kBAAkB;EAClBC,OAAO;EACPC;AACJ,CAAC,KAAK;EACF,MAAMC,OAAO,GAAGA,CAACC,MAAoB,EAAEC,KAAoB,KAAK;IAC5D,MAAMC,MAAM,GAAGP,mBAAmB,CAACM,KAAK,CAACE,IAAI,CAAC;IAC9C,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,EAAE;MAC5B,OAAOJ,MAAM;IACjB;IAEA,MAAMK,WAAW,GAAGjB,mBAAmB,CAACI,WAAW,EAAEE,cAAc,EAAEO,KAAK,CAAC;IAC3E,IAAI,CAACI,WAAW,EAAE;MACd,OAAOL,MAAM;IACjB;IAEA,MAAM;MAAET,KAAK;MAAEE;IAAS,CAAC,GAAGS,MAAM,CAACE,OAAO,CAAC;MACvCN,KAAK;MACLG,KAAK;MACLV,KAAK,EAAEC,WAAW,CAACa,WAAW,CAACC,eAAe,IAAID,WAAW,CAACE,kBAAkB,CAAC;MACjFd,QAAQ,EAAEC,cAAc,CAACW,WAAW,CAACE,kBAAkB,IAAIF,WAAW,CAACC,eAAe,CAAC;MACvFX,mBAAmB;MACnBC,kBAAkB;MAClBC;IACJ,CAAC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;IACL;IAEA,OAAOoB,gBAAgB,CAAC;MACpBnB,KAAK;MACLE,QAAQ;MACRE,mBAAmB;MACnBC,kBAAkB;MAClBE,KAAK;MACLD,OAAO;MACPP;IACJ,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
2
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
- export default _default;
@@ -1,24 +0,0 @@
1
- export default () => ({
2
- type: "cms-model-field-to-elastic-search",
3
- name: "cms-model-field-to-elastic-search-rich-text",
4
- fieldType: "rich-text",
5
- toIndex({
6
- value
7
- }) {
8
- // TODO: convert rich-text object to a searchable string to offer full-text search at some point
9
-
10
- /**
11
- * We want to store rich-text value as a "rawValue", meaning it wont' be indexed by ES.
12
- */
13
- return {
14
- rawValue: value
15
- };
16
- },
17
- fromIndex({
18
- rawValue
19
- }) {
20
- return rawValue;
21
- }
22
- });
23
-
24
- //# sourceMappingURL=richTextIndexing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["type","name","fieldType","toIndex","value","rawValue","fromIndex"],"sources":["richTextIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-rich-text\",\n fieldType: \"rich-text\",\n toIndex({ value }) {\n // TODO: convert rich-text object to a searchable string to offer full-text search at some point\n\n /**\n * We want to store rich-text value as a \"rawValue\", meaning it wont' be indexed by ES.\n */\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n});\n"],"mappings":"AAEA,eAAe,OAA2C;EACtDA,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IACd,CAAC;EACL,CAAC;EACDE,SAASA,CAAC;IAAED;EAAS,CAAC,EAAE;IACpB,OAAOA,QAAQ;EACnB;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchIndexPlugin } from "../../plugins/CmsEntryElasticsearchIndexPlugin.js";
2
- export declare const base: CmsEntryElasticsearchIndexPlugin;
@@ -1,7 +0,0 @@
1
- import { getBaseConfiguration } from "@webiny/api-opensearch";
2
- import { CmsEntryElasticsearchIndexPlugin } from "../../plugins/CmsEntryElasticsearchIndexPlugin.js";
3
- export const base = new CmsEntryElasticsearchIndexPlugin({
4
- body: getBaseConfiguration()
5
- });
6
-
7
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getBaseConfiguration","CmsEntryElasticsearchIndexPlugin","base","body"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-opensearch\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin.js\";\n\nexport const base = new CmsEntryElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,gCAAgC;AAEzC,OAAO,MAAMC,IAAI,GAAG,IAAID,gCAAgC,CAAC;EACrDE,IAAI,EAAEH,oBAAoB,CAAC;AAC/B,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- export declare const elasticsearchIndexPlugins: () => import("../../index.js").CmsEntryElasticsearchIndexPlugin[];
@@ -1,6 +0,0 @@
1
- import { base } from "./base.js";
2
- export const elasticsearchIndexPlugins = () => {
3
- return [base];
4
- };
5
-
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["base","elasticsearchIndexPlugins"],"sources":["index.ts"],"sourcesContent":["import { base } from \"./base.js\";\n\nexport const elasticsearchIndexPlugins = () => {\n return [base];\n};\n"],"mappings":"AAAA,SAASA,IAAI;AAEb,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,CAACD,IAAI,CAAC;AACjB,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- declare const _default: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin[];
3
- export default _default;
@@ -1,6 +0,0 @@
1
- import { createTimeSearchPlugin } from "./timeSearch.js";
2
- import { createRefSearchPlugin } from "./refSearch.js";
3
- import { createSearchableJsonSearchPlugin } from "./searchableJson.js";
4
- export default () => [createTimeSearchPlugin(), createRefSearchPlugin(), createSearchableJsonSearchPlugin()];
5
-
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createTimeSearchPlugin","createRefSearchPlugin","createSearchableJsonSearchPlugin"],"sources":["index.ts"],"sourcesContent":["import { createTimeSearchPlugin } from \"./timeSearch.js\";\nimport { createRefSearchPlugin } from \"./refSearch.js\";\nimport { createSearchableJsonSearchPlugin } from \"./searchableJson.js\";\nimport type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\n\nexport default (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin[] => [\n createTimeSearchPlugin(),\n createRefSearchPlugin(),\n createSearchableJsonSearchPlugin()\n];\n"],"mappings":"AAAA,SAASA,sBAAsB;AAC/B,SAASC,qBAAqB;AAC9B,SAASC,gCAAgC;AAGzC,eAAe,MAA4D,CACvEF,sBAAsB,CAAC,CAAC,EACxBC,qBAAqB,CAAC,CAAC,EACvBC,gCAAgC,CAAC,CAAC,CACrC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- export declare const createRefSearchPlugin: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin;