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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/configurations.d.ts +3 -2
  2. package/configurations.js +10 -8
  3. package/configurations.js.map +1 -1
  4. package/elasticsearch/createElasticsearchIndex.d.ts +2 -2
  5. package/elasticsearch/createElasticsearchIndex.js +58 -16
  6. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  7. package/exports/api/cms/opensearch.d.ts +9 -0
  8. package/exports/api/cms/opensearch.js +11 -0
  9. package/exports/api/cms/opensearch.js.map +1 -0
  10. package/feature.d.ts +1 -0
  11. package/feature.js +188 -0
  12. package/feature.js.map +1 -0
  13. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  14. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +4 -0
  15. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  16. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  17. package/features/CmsEntryOpenSearchBodyModifier/index.js +3 -0
  18. package/features/CmsEntryOpenSearchBodyModifier/index.js.map +1 -0
  19. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +13 -0
  20. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +36 -0
  21. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  22. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +35 -0
  23. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +4 -0
  24. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  25. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  26. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +4 -0
  27. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  28. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  29. package/features/CmsEntryOpenSearchFieldIndex/constants.js +3 -0
  30. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  31. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +1 -0
  32. package/features/CmsEntryOpenSearchFieldIndex/feature.js +24 -0
  33. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  34. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  35. package/{elasticsearch/indexing/dateTimeIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js} +21 -19
  36. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +10 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +39 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +22 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +25 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  47. package/{elasticsearch/indexing/numberIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js} +11 -8
  48. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +10 -0
  50. package/{elasticsearch/indexing/objectIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js} +50 -86
  51. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +22 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/index.js +5 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/index.js.map +1 -0
  58. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  59. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +38 -0
  60. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  61. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  62. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +4 -0
  63. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  64. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  65. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +4 -0
  66. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  67. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  68. package/features/CmsEntryOpenSearchFilter/constants.js +3 -0
  69. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  70. package/features/CmsEntryOpenSearchFilter/feature.d.ts +1 -0
  71. package/features/CmsEntryOpenSearchFilter/feature.js +16 -0
  72. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  73. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  74. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +23 -0
  75. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  76. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  77. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +61 -0
  78. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  79. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  80. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +49 -0
  81. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  82. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  83. package/features/CmsEntryOpenSearchFilter/index.js +5 -0
  84. package/features/CmsEntryOpenSearchFilter/index.js.map +1 -0
  85. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  86. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +4 -0
  87. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  88. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  89. package/features/CmsEntryOpenSearchFullTextSearch/index.js +3 -0
  90. package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +1 -0
  91. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  92. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
  93. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  94. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  95. package/features/CmsEntryOpenSearchIndex/abstractions.js +4 -0
  96. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  97. package/features/CmsEntryOpenSearchIndex/feature.d.ts +1 -0
  98. package/features/CmsEntryOpenSearchIndex/feature.js +10 -0
  99. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  100. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  101. package/features/CmsEntryOpenSearchIndex/index.js +5 -0
  102. package/features/CmsEntryOpenSearchIndex/index.js.map +1 -0
  103. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  104. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +4 -0
  105. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  106. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  107. package/features/CmsEntryOpenSearchQueryModifier/index.js +3 -0
  108. package/features/CmsEntryOpenSearchQueryModifier/index.js.map +1 -0
  109. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  110. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +4 -0
  111. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  112. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  113. package/features/CmsEntryOpenSearchSortModifier/index.js +3 -0
  114. package/features/CmsEntryOpenSearchSortModifier/index.js.map +1 -0
  115. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  116. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +27 -0
  117. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  118. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  119. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +4 -0
  120. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  121. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  122. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +4 -0
  123. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  124. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +1 -0
  125. package/features/CmsEntryOpenSearchValueSearch/feature.js +16 -0
  126. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  127. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  128. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +23 -0
  129. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  130. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  131. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +55 -0
  132. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  133. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  134. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +24 -0
  135. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  136. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  137. package/features/CmsEntryOpenSearchValueSearch/index.js +5 -0
  138. package/features/CmsEntryOpenSearchValueSearch/index.js.map +1 -0
  139. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  140. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +4 -0
  141. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  142. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  143. package/features/CmsEntryOpenSearchValuesModifier/index.js +3 -0
  144. package/features/CmsEntryOpenSearchValuesModifier/index.js.map +1 -0
  145. package/helpers/entryIndexHelpers.d.ts +5 -3
  146. package/helpers/entryIndexHelpers.js +28 -90
  147. package/helpers/entryIndexHelpers.js.map +1 -1
  148. package/index.d.ts +1 -3
  149. package/index.js +1 -188
  150. package/index.js.map +1 -1
  151. package/operations/entry/elasticsearch/body.d.ts +18 -2
  152. package/operations/entry/elasticsearch/body.js +32 -29
  153. package/operations/entry/elasticsearch/body.js.map +1 -1
  154. package/operations/entry/elasticsearch/fields.d.ts +6 -4
  155. package/operations/entry/elasticsearch/fields.js +14 -57
  156. package/operations/entry/elasticsearch/fields.js.map +1 -1
  157. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +5 -4
  158. package/operations/entry/elasticsearch/filtering/applyFiltering.js +3 -3
  159. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  160. package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -0
  161. package/operations/entry/elasticsearch/filtering/exec.js +11 -64
  162. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  163. package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
  164. package/operations/entry/elasticsearch/filtering/path.js +4 -6
  165. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  166. package/operations/entry/elasticsearch/fullTextSearch.d.ts +2 -2
  167. package/operations/entry/elasticsearch/fullTextSearch.js +25 -29
  168. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  169. package/operations/entry/elasticsearch/sort.d.ts +2 -2
  170. package/operations/entry/elasticsearch/sort.js +2 -6
  171. package/operations/entry/elasticsearch/sort.js.map +1 -1
  172. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
  173. package/operations/entry/elasticsearch/transformValueForSearch.js +4 -14
  174. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  175. package/operations/entry/elasticsearch/types.d.ts +0 -7
  176. package/operations/entry/elasticsearch/types.js.map +1 -1
  177. package/operations/entry/index.d.ts +21 -1
  178. package/operations/entry/index.js +96 -39
  179. package/operations/entry/index.js.map +1 -1
  180. package/operations/entry/transformations/index.d.ts +8 -2
  181. package/operations/entry/transformations/index.js +14 -12
  182. package/operations/entry/transformations/index.js.map +1 -1
  183. package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
  184. package/operations/entry/transformations/modifyEntryValues.js +3 -3
  185. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  186. package/operations/entry/transformations/transformEntryToIndex.d.ts +4 -2
  187. package/operations/entry/transformations/transformEntryToIndex.js +6 -4
  188. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  189. package/operations/group/index.d.ts +2 -2
  190. package/operations/group/index.js +6 -9
  191. package/operations/group/index.js.map +1 -1
  192. package/package.json +25 -23
  193. package/tasks/createIndexTaskPlugin.js +8 -1
  194. package/tasks/createIndexTaskPlugin.js.map +1 -1
  195. package/types.d.ts +7 -112
  196. package/types.js +0 -23
  197. package/types.js.map +1 -1
  198. package/dynamoDb/index.d.ts +0 -3
  199. package/dynamoDb/index.js +0 -8
  200. package/dynamoDb/index.js.map +0 -1
  201. package/dynamoDb/storage/longText.d.ts +0 -10
  202. package/dynamoDb/storage/longText.js +0 -88
  203. package/dynamoDb/storage/longText.js.map +0 -1
  204. package/dynamoDb/storage/richText.d.ts +0 -2
  205. package/dynamoDb/storage/richText.js +0 -51
  206. package/dynamoDb/storage/richText.js.map +0 -1
  207. package/elasticsearch/index.d.ts +0 -2
  208. package/elasticsearch/index.js +0 -5
  209. package/elasticsearch/index.js.map +0 -1
  210. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  211. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  212. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  213. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  214. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  215. package/elasticsearch/indexing/index.d.ts +0 -2
  216. package/elasticsearch/indexing/index.js +0 -10
  217. package/elasticsearch/indexing/index.js.map +0 -1
  218. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  219. package/elasticsearch/indexing/jsonIndexing.js +0 -21
  220. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  221. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  222. package/elasticsearch/indexing/longTextIndexing.js +0 -35
  223. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  224. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  225. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  226. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  227. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  228. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  229. package/elasticsearch/indexing/richTextIndexing.js +0 -24
  230. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  231. package/elasticsearch/indices/base.d.ts +0 -2
  232. package/elasticsearch/indices/base.js +0 -7
  233. package/elasticsearch/indices/base.js.map +0 -1
  234. package/elasticsearch/indices/index.d.ts +0 -1
  235. package/elasticsearch/indices/index.js +0 -6
  236. package/elasticsearch/indices/index.js.map +0 -1
  237. package/elasticsearch/search/index.d.ts +0 -3
  238. package/elasticsearch/search/index.js +0 -6
  239. package/elasticsearch/search/index.js.map +0 -1
  240. package/elasticsearch/search/refSearch.d.ts +0 -2
  241. package/elasticsearch/search/refSearch.js +0 -24
  242. package/elasticsearch/search/refSearch.js.map +0 -1
  243. package/elasticsearch/search/searchableJson.d.ts +0 -2
  244. package/elasticsearch/search/searchableJson.js +0 -53
  245. package/elasticsearch/search/searchableJson.js.map +0 -1
  246. package/elasticsearch/search/timeSearch.d.ts +0 -2
  247. package/elasticsearch/search/timeSearch.js +0 -20
  248. package/elasticsearch/search/timeSearch.js.map +0 -1
  249. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  250. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
  251. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  252. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  253. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
  254. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  255. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  256. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
  257. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  258. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  259. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
  260. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  261. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  262. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
  263. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  264. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  265. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
  266. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  267. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  268. package/operations/entry/elasticsearch/plugins/search.js +0 -18
  269. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  270. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  271. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
  272. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  273. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  274. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
  275. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  276. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  277. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
  278. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  279. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -24
  280. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
  281. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  282. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  283. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
  284. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  285. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  286. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
  287. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  288. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  289. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
  290. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  291. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  292. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
  293. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  294. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  295. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
  296. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  297. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  298. package/plugins/CmsEntryFilterPlugin.js +0 -15
  299. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  300. package/plugins/index.d.ts +0 -8
  301. package/plugins/index.js +0 -10
  302. package/plugins/index.js.map +0 -1
@@ -1,24 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- const createPath = ({
3
- field,
4
- key
5
- }) => {
6
- if (key && key.match("entryId") === null) {
7
- return `${field.storageId}.id`;
8
- }
9
- return `${field.storageId}.entryId`;
10
- };
11
- const transform = ({
12
- value
13
- }) => {
14
- return value;
15
- };
16
- export const createRefSearchPlugin = () => {
17
- return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
18
- fieldType: "ref",
19
- path: createPath,
20
- transform
21
- });
22
- };
23
-
24
- //# sourceMappingURL=refSearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","createPath","field","key","match","storageId","transform","value","createRefSearchPlugin","fieldType","path"],"sources":["refSearch.ts"],"sourcesContent":["import type {\n CreatePathCallable,\n TransformCallable\n} from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\n\nconst createPath: CreatePathCallable<string> = ({ field, key }) => {\n if (key && key.match(\"entryId\") === null) {\n return `${field.storageId}.id`;\n }\n return `${field.storageId}.entryId`;\n};\n\nconst transform: TransformCallable = ({ value }) => {\n return value;\n};\n\nexport const createRefSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"ref\",\n path: createPath,\n transform\n });\n};\n"],"mappings":"AAIA,SAASA,kDAAkD;AAE3D,MAAMC,UAAsC,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAI,CAAC,KAAK;EAC/D,IAAIA,GAAG,IAAIA,GAAG,CAACC,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACtC,OAAO,GAAGF,KAAK,CAACG,SAAS,KAAK;EAClC;EACA,OAAO,GAAGH,KAAK,CAACG,SAAS,UAAU;AACvC,CAAC;AAED,MAAMC,SAA4B,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAChD,OAAOA,KAAK;AAChB,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAA0D;EAC3F,OAAO,IAAIR,kDAAkD,CAAC;IAC1DS,SAAS,EAAE,KAAK;IAChBC,IAAI,EAAET,UAAU;IAChBK;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- export declare const createSearchableJsonSearchPlugin: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
@@ -1,53 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- import { WebinyError } from "@webiny/error";
3
- import { NoValueContainer } from "../../values/NoValueContainer.js";
4
- const getKey = params => {
5
- const {
6
- field,
7
- value
8
- } = params;
9
- const keys = Object.keys(value);
10
- if (keys.length === 0) {
11
- throw new WebinyError(`Searchable JSON field "${field.fieldId}" cannot be empty.`, "EMPTY_SEARCHABLE_JSON_FIELD", {
12
- field,
13
- value
14
- });
15
- } else if (keys.length > 1) {
16
- throw new WebinyError(`Searchable JSON field "${field.fieldId}" can only have one key.`, "MULTIPLE_KEYS_IN_SEARCHABLE_JSON_FIELD", {
17
- field,
18
- value,
19
- keys
20
- });
21
- }
22
- return keys[0];
23
- };
24
- export const createSearchableJsonSearchPlugin = () => {
25
- return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
26
- fieldType: "searchable-json",
27
- transform: params => {
28
- const {
29
- value
30
- } = params;
31
- if (NoValueContainer.is(value)) {
32
- return null;
33
- }
34
- const key = getKey(params);
35
- return value[key] || null;
36
- },
37
- path: params => {
38
- const {
39
- field
40
- } = params;
41
- if (NoValueContainer.is(params.originalValue)) {
42
- return `${field.storageId}.unknown`;
43
- }
44
- const key = getKey({
45
- field,
46
- value: params.originalValue
47
- });
48
- return `${field.storageId}.${key}`;
49
- }
50
- });
51
- };
52
-
53
- //# sourceMappingURL=searchableJson.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","WebinyError","NoValueContainer","getKey","params","field","value","keys","Object","length","fieldId","createSearchableJsonSearchPlugin","fieldType","transform","is","key","path","originalValue","storageId"],"sources":["searchableJson.ts"],"sourcesContent":["import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nimport { WebinyError } from \"@webiny/error\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { NoValueContainer } from \"~/values/NoValueContainer.js\";\n\ninterface IGetKeyParams {\n field: CmsModelField;\n value: {\n [key: string]: any;\n };\n}\n\nconst getKey = (params: IGetKeyParams): string => {\n const { field, value } = params;\n const keys = Object.keys(value);\n if (keys.length === 0) {\n throw new WebinyError(\n `Searchable JSON field \"${field.fieldId}\" cannot be empty.`,\n \"EMPTY_SEARCHABLE_JSON_FIELD\",\n {\n field,\n value\n }\n );\n } else if (keys.length > 1) {\n throw new WebinyError(\n `Searchable JSON field \"${field.fieldId}\" can only have one key.`,\n \"MULTIPLE_KEYS_IN_SEARCHABLE_JSON_FIELD\",\n {\n field,\n value,\n keys\n }\n );\n }\n return keys[0];\n};\n\nexport const createSearchableJsonSearchPlugin =\n (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"searchable-json\",\n transform: params => {\n const { value } = params;\n\n if (NoValueContainer.is(value)) {\n return null;\n }\n\n const key = getKey(params);\n return value[key] || null;\n },\n path: params => {\n const { field } = params;\n\n if (NoValueContainer.is(params.originalValue)) {\n return `${field.storageId}.unknown`;\n }\n\n const key = getKey({\n field,\n value: params.originalValue\n });\n\n return `${field.storageId}.${key}`;\n }\n });\n };\n"],"mappings":"AAAA,SAASA,kDAAkD;AAC3D,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,gBAAgB;AASzB,MAAMC,MAAM,GAAIC,MAAqB,IAAa;EAC9C,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAC/B,MAAMG,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,KAAK,CAAC;EAC/B,IAAIC,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE;IACnB,MAAM,IAAIR,WAAW,CACjB,0BAA0BI,KAAK,CAACK,OAAO,oBAAoB,EAC3D,6BAA6B,EAC7B;MACIL,KAAK;MACLC;IACJ,CACJ,CAAC;EACL,CAAC,MAAM,IAAIC,IAAI,CAACE,MAAM,GAAG,CAAC,EAAE;IACxB,MAAM,IAAIR,WAAW,CACjB,0BAA0BI,KAAK,CAACK,OAAO,0BAA0B,EACjE,wCAAwC,EACxC;MACIL,KAAK;MACLC,KAAK;MACLC;IACJ,CACJ,CAAC;EACL;EACA,OAAOA,IAAI,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,MAAMI,gCAAgC,GACzCA,CAAA,KAA0D;EACtD,OAAO,IAAIX,kDAAkD,CAAC;IAC1DY,SAAS,EAAE,iBAAiB;IAC5BC,SAAS,EAAET,MAAM,IAAI;MACjB,MAAM;QAAEE;MAAM,CAAC,GAAGF,MAAM;MAExB,IAAIF,gBAAgB,CAACY,EAAE,CAACR,KAAK,CAAC,EAAE;QAC5B,OAAO,IAAI;MACf;MAEA,MAAMS,GAAG,GAAGZ,MAAM,CAACC,MAAM,CAAC;MAC1B,OAAOE,KAAK,CAACS,GAAG,CAAC,IAAI,IAAI;IAC7B,CAAC;IACDC,IAAI,EAAEZ,MAAM,IAAI;MACZ,MAAM;QAAEC;MAAM,CAAC,GAAGD,MAAM;MAExB,IAAIF,gBAAgB,CAACY,EAAE,CAACV,MAAM,CAACa,aAAa,CAAC,EAAE;QAC3C,OAAO,GAAGZ,KAAK,CAACa,SAAS,UAAU;MACvC;MAEA,MAAMH,GAAG,GAAGZ,MAAM,CAAC;QACfE,KAAK;QACLC,KAAK,EAAEF,MAAM,CAACa;MAClB,CAAC,CAAC;MAEF,OAAO,GAAGZ,KAAK,CAACa,SAAS,IAAIH,GAAG,EAAE;IACtC;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- export declare const createTimeSearchPlugin: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
@@ -1,20 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
2
- const transform = params => {
3
- const {
4
- field,
5
- value
6
- } = params;
7
- if (!value || field.settings?.type !== "time") {
8
- return value;
9
- }
10
- const [hours, minutes, seconds = 0] = value.split(":").map(Number);
11
- return hours * 60 * 60 + minutes * 60 + seconds;
12
- };
13
- export const createTimeSearchPlugin = () => {
14
- return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
15
- fieldType: "datetime",
16
- transform
17
- });
18
- };
19
-
20
- //# sourceMappingURL=timeSearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","transform","params","field","value","settings","type","hours","minutes","seconds","split","map","Number","createTimeSearchPlugin","fieldType"],"sources":["timeSearch.ts"],"sourcesContent":["import type { TransformCallable } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\n\nconst transform: TransformCallable = params => {\n const { field, value } = params;\n if (!value || field.settings?.type !== \"time\") {\n return value;\n }\n const [hours, minutes, seconds = 0] = value.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nexport const createTimeSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"datetime\",\n transform\n });\n};\n"],"mappings":"AACA,SAASA,kDAAkD;AAE3D,MAAMC,SAA4B,GAAGC,MAAM,IAAI;EAC3C,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAC/B,IAAI,CAACE,KAAK,IAAID,KAAK,CAACE,QAAQ,EAAEC,IAAI,KAAK,MAAM,EAAE;IAC3C,OAAOF,KAAK;EAChB;EACA,MAAM,CAACG,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGL,KAAK,CAACM,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAED,OAAO,MAAMI,sBAAsB,GAAGA,CAAA,KAA0D;EAC5F,OAAO,IAAIb,kDAAkD,CAAC;IAC1Dc,SAAS,EAAE,UAAU;IACrBb;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin.js";
2
- export declare const createDefaultFilterPlugin: () => CmsEntryFilterPlugin;
@@ -1,22 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin.js";
3
- export const createDefaultFilterPlugin = () => {
4
- const plugin = new CmsEntryFilterPlugin({
5
- fieldType: CmsEntryFilterPlugin.ALL,
6
- exec: params => {
7
- const {
8
- applyFiltering,
9
- field
10
- } = params;
11
- if (!params.field.searchable) {
12
- const identifier = [...field.parents.map(p => p.fieldId), field.field.fieldId].join(".");
13
- throw new WebinyError(`Field "${identifier}" is not searchable.`);
14
- }
15
- applyFiltering(params);
16
- }
17
- });
18
- plugin.name = `${plugin.type}.default.all`;
19
- return plugin;
20
- };
21
-
22
- //# sourceMappingURL=defaultFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","CmsEntryFilterPlugin","createDefaultFilterPlugin","plugin","fieldType","ALL","exec","params","applyFiltering","field","searchable","identifier","parents","map","p","fieldId","join","name","type"],"sources":["defaultFilterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin.js\";\n\nexport const createDefaultFilterPlugin = () => {\n const plugin = new CmsEntryFilterPlugin({\n fieldType: CmsEntryFilterPlugin.ALL,\n exec: params => {\n const { applyFiltering, field } = params;\n if (!params.field.searchable) {\n const identifier = [...field.parents.map(p => p.fieldId), field.field.fieldId].join(\n \".\"\n );\n throw new WebinyError(`Field \"${identifier}\" is not searchable.`);\n }\n applyFiltering(params);\n }\n });\n\n plugin.name = `${plugin.type}.default.all`;\n\n return plugin;\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,oBAAoB;AAE7B,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,MAAM,GAAG,IAAIF,oBAAoB,CAAC;IACpCG,SAAS,EAAEH,oBAAoB,CAACI,GAAG;IACnCC,IAAI,EAAEC,MAAM,IAAI;MACZ,MAAM;QAAEC,cAAc;QAAEC;MAAM,CAAC,GAAGF,MAAM;MACxC,IAAI,CAACA,MAAM,CAACE,KAAK,CAACC,UAAU,EAAE;QAC1B,MAAMC,UAAU,GAAG,CAAC,GAAGF,KAAK,CAACG,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,CAAC,EAAEN,KAAK,CAACA,KAAK,CAACM,OAAO,CAAC,CAACC,IAAI,CAC/E,GACJ,CAAC;QACD,MAAM,IAAIhB,WAAW,CAAC,UAAUW,UAAU,sBAAsB,CAAC;MACrE;MACAH,cAAc,CAACD,MAAM,CAAC;IAC1B;EACJ,CAAC,CAAC;EAEFJ,MAAM,CAACc,IAAI,GAAG,GAAGd,MAAM,CAACe,IAAI,cAAc;EAE1C,OAAOf,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- export declare const createFilterPlugins: () => import("../../../../../plugins/CmsEntryFilterPlugin.js").CmsEntryFilterPlugin[];
@@ -1,8 +0,0 @@
1
- import { createDefaultFilterPlugin } from "./defaultFilterPlugin.js";
2
- import { createObjectFilterPlugin } from "./objectFilterPlugin.js";
3
- import { createRefFilterPlugin } from "./refFilterPlugin.js";
4
- export const createFilterPlugins = () => {
5
- return [createDefaultFilterPlugin(), createObjectFilterPlugin(), createRefFilterPlugin()];
6
- };
7
-
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createDefaultFilterPlugin","createObjectFilterPlugin","createRefFilterPlugin","createFilterPlugins"],"sources":["index.ts"],"sourcesContent":["import { createDefaultFilterPlugin } from \"./defaultFilterPlugin.js\";\nimport { createObjectFilterPlugin } from \"./objectFilterPlugin.js\";\nimport { createRefFilterPlugin } from \"./refFilterPlugin.js\";\n\nexport const createFilterPlugins = () => {\n return [createDefaultFilterPlugin(), createObjectFilterPlugin(), createRefFilterPlugin()];\n};\n"],"mappings":"AAAA,SAASA,yBAAyB;AAClC,SAASC,wBAAwB;AACjC,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACrC,OAAO,CAACH,yBAAyB,CAAC,CAAC,EAAEC,wBAAwB,CAAC,CAAC,EAAEC,qBAAqB,CAAC,CAAC,CAAC;AAC7F,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin.js";
2
- export declare const createObjectFilterPlugin: () => CmsEntryFilterPlugin;
@@ -1,61 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin.js";
2
- import { parseWhereKey } from "@webiny/api-opensearch";
3
- import WebinyError from "@webiny/error";
4
- export const createObjectFilterPlugin = () => {
5
- const plugin = new CmsEntryFilterPlugin({
6
- fieldType: "object",
7
- exec: params => {
8
- const {
9
- applyFiltering,
10
- value: where,
11
- fields,
12
- field: parentField,
13
- getFilterPlugin,
14
- query
15
- } = params;
16
- /**
17
- * Because this is an object field, we must construct filters based on the value property.
18
- * Value property is actually a where condition.
19
- */
20
- for (const key in where) {
21
- const value = where[key];
22
- if (value === undefined) {
23
- continue;
24
- }
25
- const {
26
- field: whereFieldId,
27
- operator
28
- } = parseWhereKey(key);
29
- const identifier = [...parentField.parents.map(p => p.fieldId), parentField.field.fieldId, whereFieldId].join(".");
30
- const field = fields[identifier];
31
- if (!field) {
32
- throw new WebinyError(`There is no field "${identifier}".`, "OBJECT_FILTER_FIELD_ERROR", {
33
- fields: Object.keys(fields)
34
- });
35
- }
36
- /**
37
- * We need to find the filter plugin for the child field.
38
- * This will throw error if no plugin can be found.
39
- */
40
- const plugin = getFilterPlugin(field.type);
41
- /**
42
- * Basically this allows us to go into depth as much as we want with the object fields.
43
- */
44
- plugin.exec({
45
- applyFiltering,
46
- getFilterPlugin,
47
- key,
48
- value,
49
- operator,
50
- field,
51
- fields,
52
- query
53
- });
54
- }
55
- }
56
- });
57
- plugin.name = `${plugin.type}.default.object`;
58
- return plugin;
59
- };
60
-
61
- //# sourceMappingURL=objectFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryFilterPlugin","parseWhereKey","WebinyError","createObjectFilterPlugin","plugin","fieldType","exec","params","applyFiltering","value","where","fields","field","parentField","getFilterPlugin","query","key","undefined","whereFieldId","operator","identifier","parents","map","p","fieldId","join","Object","keys","type","name"],"sources":["objectFilterPlugin.ts"],"sourcesContent":["import { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin.js\";\nimport { parseWhereKey } from \"@webiny/api-opensearch\";\nimport WebinyError from \"@webiny/error\";\n\nexport const createObjectFilterPlugin = () => {\n const plugin = new CmsEntryFilterPlugin({\n fieldType: \"object\",\n exec: params => {\n const {\n applyFiltering,\n value: where,\n fields,\n field: parentField,\n getFilterPlugin,\n query\n } = params;\n /**\n * Because this is an object field, we must construct filters based on the value property.\n * Value property is actually a where condition.\n */\n for (const key in where) {\n const value = where[key];\n if (value === undefined) {\n continue;\n }\n const { field: whereFieldId, operator } = parseWhereKey(key);\n\n const identifier = [\n ...parentField.parents.map(p => p.fieldId),\n parentField.field.fieldId,\n whereFieldId\n ].join(\".\");\n const field = fields[identifier];\n if (!field) {\n throw new WebinyError(\n `There is no field \"${identifier}\".`,\n \"OBJECT_FILTER_FIELD_ERROR\",\n {\n fields: Object.keys(fields)\n }\n );\n }\n /**\n * We need to find the filter plugin for the child field.\n * This will throw error if no plugin can be found.\n */\n const plugin = getFilterPlugin(field.type);\n /**\n * Basically this allows us to go into depth as much as we want with the object fields.\n */\n plugin.exec({\n applyFiltering,\n getFilterPlugin,\n key,\n value,\n operator,\n field,\n fields,\n query\n });\n }\n }\n });\n\n plugin.name = `${plugin.type}.default.object`;\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,oBAAoB;AAC7B,SAASC,aAAa,QAAQ,wBAAwB;AACtD,OAAOC,WAAW,MAAM,eAAe;AAEvC,OAAO,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EAC1C,MAAMC,MAAM,GAAG,IAAIJ,oBAAoB,CAAC;IACpCK,SAAS,EAAE,QAAQ;IACnBC,IAAI,EAAEC,MAAM,IAAI;MACZ,MAAM;QACFC,cAAc;QACdC,KAAK,EAAEC,KAAK;QACZC,MAAM;QACNC,KAAK,EAAEC,WAAW;QAClBC,eAAe;QACfC;MACJ,CAAC,GAAGR,MAAM;MACV;AACZ;AACA;AACA;MACY,KAAK,MAAMS,GAAG,IAAIN,KAAK,EAAE;QACrB,MAAMD,KAAK,GAAGC,KAAK,CAACM,GAAG,CAAC;QACxB,IAAIP,KAAK,KAAKQ,SAAS,EAAE;UACrB;QACJ;QACA,MAAM;UAAEL,KAAK,EAAEM,YAAY;UAAEC;QAAS,CAAC,GAAGlB,aAAa,CAACe,GAAG,CAAC;QAE5D,MAAMI,UAAU,GAAG,CACf,GAAGP,WAAW,CAACQ,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,CAAC,EAC1CX,WAAW,CAACD,KAAK,CAACY,OAAO,EACzBN,YAAY,CACf,CAACO,IAAI,CAAC,GAAG,CAAC;QACX,MAAMb,KAAK,GAAGD,MAAM,CAACS,UAAU,CAAC;QAChC,IAAI,CAACR,KAAK,EAAE;UACR,MAAM,IAAIV,WAAW,CACjB,sBAAsBkB,UAAU,IAAI,EACpC,2BAA2B,EAC3B;YACIT,MAAM,EAAEe,MAAM,CAACC,IAAI,CAAChB,MAAM;UAC9B,CACJ,CAAC;QACL;QACA;AAChB;AACA;AACA;QACgB,MAAMP,MAAM,GAAGU,eAAe,CAACF,KAAK,CAACgB,IAAI,CAAC;QAC1C;AAChB;AACA;QACgBxB,MAAM,CAACE,IAAI,CAAC;UACRE,cAAc;UACdM,eAAe;UACfE,GAAG;UACHP,KAAK;UACLU,QAAQ;UACRP,KAAK;UACLD,MAAM;UACNI;QACJ,CAAC,CAAC;MACN;IACJ;EACJ,CAAC,CAAC;EAEFX,MAAM,CAACyB,IAAI,GAAG,GAAGzB,MAAM,CAACwB,IAAI,iBAAiB;EAE7C,OAAOxB,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin.js";
2
- export declare const createRefFilterPlugin: () => CmsEntryFilterPlugin;
@@ -1,49 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin.js";
3
- import { parseWhereKey } from "@webiny/api-opensearch";
4
- export const createRefFilterPlugin = () => {
5
- const plugin = new CmsEntryFilterPlugin({
6
- fieldType: "ref",
7
- exec: params => {
8
- const {
9
- applyFiltering,
10
- query,
11
- field
12
- } = params;
13
- let values = params.value;
14
- /**
15
- * We must have an object when querying in the ref field.
16
- */
17
- if (typeof values !== "object") {
18
- throw new WebinyError(`When querying by ref field, value of the field must be an object.`, "OBJECT_REQUIRED", {
19
- value: values
20
- });
21
- }
22
- if (values === null || values === undefined) {
23
- values = {
24
- entryId: null
25
- };
26
- }
27
- for (const key in values) {
28
- const {
29
- operator
30
- } = parseWhereKey(key);
31
- const value = values[key];
32
- if (value === undefined) {
33
- continue;
34
- }
35
- applyFiltering({
36
- query,
37
- field,
38
- operator,
39
- key,
40
- value
41
- });
42
- }
43
- }
44
- });
45
- plugin.name = `${plugin.type}.default.ref`;
46
- return plugin;
47
- };
48
-
49
- //# sourceMappingURL=refFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","CmsEntryFilterPlugin","parseWhereKey","createRefFilterPlugin","plugin","fieldType","exec","params","applyFiltering","query","field","values","value","undefined","entryId","key","operator","name","type"],"sources":["refFilterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin.js\";\nimport { parseWhereKey } from \"@webiny/api-opensearch\";\n\nexport const createRefFilterPlugin = () => {\n const plugin = new CmsEntryFilterPlugin({\n fieldType: \"ref\",\n exec: params => {\n const { applyFiltering, query, field } = params;\n\n let values = params.value;\n /**\n * We must have an object when querying in the ref field.\n */\n if (typeof values !== \"object\") {\n throw new WebinyError(\n `When querying by ref field, value of the field must be an object.`,\n \"OBJECT_REQUIRED\",\n {\n value: values\n }\n );\n }\n\n if (values === null || values === undefined) {\n values = {\n entryId: null\n };\n }\n\n for (const key in values) {\n const { operator } = parseWhereKey(key);\n const value = values[key];\n if (value === undefined) {\n continue;\n }\n\n applyFiltering({\n query,\n field,\n operator,\n key,\n value\n });\n }\n }\n });\n\n plugin.name = `${plugin.type}.default.ref`;\n\n return plugin;\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,oBAAoB;AAC7B,SAASC,aAAa,QAAQ,wBAAwB;AAEtD,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,MAAMC,MAAM,GAAG,IAAIH,oBAAoB,CAAC;IACpCI,SAAS,EAAE,KAAK;IAChBC,IAAI,EAAEC,MAAM,IAAI;MACZ,MAAM;QAAEC,cAAc;QAAEC,KAAK;QAAEC;MAAM,CAAC,GAAGH,MAAM;MAE/C,IAAII,MAAM,GAAGJ,MAAM,CAACK,KAAK;MACzB;AACZ;AACA;MACY,IAAI,OAAOD,MAAM,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAIX,WAAW,CACjB,mEAAmE,EACnE,iBAAiB,EACjB;UACIY,KAAK,EAAED;QACX,CACJ,CAAC;MACL;MAEA,IAAIA,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAKE,SAAS,EAAE;QACzCF,MAAM,GAAG;UACLG,OAAO,EAAE;QACb,CAAC;MACL;MAEA,KAAK,MAAMC,GAAG,IAAIJ,MAAM,EAAE;QACtB,MAAM;UAAEK;QAAS,CAAC,GAAGd,aAAa,CAACa,GAAG,CAAC;QACvC,MAAMH,KAAK,GAAGD,MAAM,CAACI,GAAG,CAAC;QACzB,IAAIH,KAAK,KAAKC,SAAS,EAAE;UACrB;QACJ;QAEAL,cAAc,CAAC;UACXC,KAAK;UACLC,KAAK;UACLM,QAAQ;UACRD,GAAG;UACHH;QACJ,CAAC,CAAC;MACN;IACJ;EACJ,CAAC,CAAC;EAEFR,MAAM,CAACa,IAAI,GAAG,GAAGb,MAAM,CAACc,IAAI,cAAc;EAE1C,OAAOd,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import { CmsEntryElasticsearchBodyModifierPlugin } from "../../../../plugins/index.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
4
- interface Params {
5
- plugins: PluginsContainer;
6
- model: CmsModel;
7
- }
8
- export declare const createBodyModifierPluginList: ({ plugins, model }: Params) => import("@webiny/plugins/PluginsContainer").WithName<CmsEntryElasticsearchBodyModifierPlugin>[];
9
- export {};
@@ -1,11 +0,0 @@
1
- import { CmsEntryElasticsearchBodyModifierPlugin } from "../../../../plugins/index.js";
2
- export const createBodyModifierPluginList = ({
3
- plugins,
4
- model
5
- }) => {
6
- return plugins.byType(CmsEntryElasticsearchBodyModifierPlugin.type).filter(pl => {
7
- return !pl.modelId || pl.modelId === model.modelId;
8
- });
9
- };
10
-
11
- //# sourceMappingURL=bodyModifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryElasticsearchBodyModifierPlugin","createBodyModifierPluginList","plugins","model","byType","type","filter","pl","modelId"],"sources":["bodyModifier.ts"],"sourcesContent":["import { CmsEntryElasticsearchBodyModifierPlugin } from \"~/plugins/index.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\nexport const createBodyModifierPluginList = ({ plugins, model }: Params) => {\n return plugins\n .byType<CmsEntryElasticsearchBodyModifierPlugin>(\n CmsEntryElasticsearchBodyModifierPlugin.type\n )\n .filter(pl => {\n return !pl.modelId || pl.modelId === model.modelId;\n });\n};\n"],"mappings":"AAAA,SAASA,uCAAuC;AAQhD,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAc,CAAC,KAAK;EACxE,OAAOD,OAAO,CACTE,MAAM,CACHJ,uCAAuC,CAACK,IAC5C,CAAC,CACAC,MAAM,CAACC,EAAE,IAAI;IACV,OAAO,CAACA,EAAE,CAACC,OAAO,IAAID,EAAE,CAACC,OAAO,KAAKL,KAAK,CAACK,OAAO;EACtD,CAAC,CAAC;AACV,CAAC","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import { CmsEntryElasticsearchQueryModifierPlugin } from "../../../../plugins/index.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
4
- interface Params {
5
- plugins: PluginsContainer;
6
- model: CmsModel;
7
- }
8
- export declare const createQueryModifierPluginList: ({ plugins, model }: Params) => import("@webiny/plugins/PluginsContainer").WithName<CmsEntryElasticsearchQueryModifierPlugin>[];
9
- export {};
@@ -1,11 +0,0 @@
1
- import { CmsEntryElasticsearchQueryModifierPlugin } from "../../../../plugins/index.js";
2
- export const createQueryModifierPluginList = ({
3
- plugins,
4
- model
5
- }) => {
6
- return plugins.byType(CmsEntryElasticsearchQueryModifierPlugin.type).filter(pl => {
7
- return !pl.modelId || pl.modelId === model.modelId;
8
- });
9
- };
10
-
11
- //# sourceMappingURL=queryModifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryElasticsearchQueryModifierPlugin","createQueryModifierPluginList","plugins","model","byType","type","filter","pl","modelId"],"sources":["queryModifier.ts"],"sourcesContent":["import { CmsEntryElasticsearchQueryModifierPlugin } from \"~/plugins/index.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\nexport const createQueryModifierPluginList = ({ plugins, model }: Params) => {\n return plugins\n .byType<CmsEntryElasticsearchQueryModifierPlugin>(\n CmsEntryElasticsearchQueryModifierPlugin.type\n )\n .filter(pl => {\n return !pl.modelId || pl.modelId === model.modelId;\n });\n};\n"],"mappings":"AAAA,SAASA,wCAAwC;AAQjD,OAAO,MAAMC,6BAA6B,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAc,CAAC,KAAK;EACzE,OAAOD,OAAO,CACTE,MAAM,CACHJ,wCAAwC,CAACK,IAC7C,CAAC,CACAC,MAAM,CAACC,EAAE,IAAI;IACV,OAAO,CAACA,EAAE,CAACC,OAAO,IAAID,EAAE,CAACC,OAAO,KAAKL,KAAK,CAACK,OAAO;EACtD,CAAC,CAAC;AACV,CAAC","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- import type { PluginsContainer } from "@webiny/plugins";
2
- import type { OpenSearchQuerySearchValuePlugins } from "../types.js";
3
- interface Params {
4
- plugins: PluginsContainer;
5
- }
6
- export declare const createSearchPluginList: ({ plugins }: Params) => OpenSearchQuerySearchValuePlugins;
7
- export {};
@@ -1,18 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../../../plugins/index.js";
3
- export const createSearchPluginList = ({
4
- plugins
5
- }) => {
6
- return plugins.byType(CmsEntryElasticsearchQueryBuilderValueSearchPlugin.type).reduce((plugins, plugin) => {
7
- if (plugins[plugin.fieldType]) {
8
- throw new WebinyError("There is a ElasticsearchQueryBuilderValueSearchPlugin defined for the field type.", "PLUGIN_ALREADY_EXISTS", {
9
- fieldType: plugin.fieldType,
10
- name: plugin.name || "unknown"
11
- });
12
- }
13
- plugins[plugin.fieldType] = plugin;
14
- return plugins;
15
- }, {});
16
- };
17
-
18
- //# sourceMappingURL=search.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","createSearchPluginList","plugins","byType","type","reduce","plugin","fieldType","name"],"sources":["search.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/index.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { OpenSearchQuerySearchValuePlugins } from \"../types.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n}\nexport const createSearchPluginList = ({ plugins }: Params): OpenSearchQuerySearchValuePlugins => {\n return plugins\n .byType<CmsEntryElasticsearchQueryBuilderValueSearchPlugin>(\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin.type\n )\n .reduce<OpenSearchQuerySearchValuePlugins>((plugins, plugin) => {\n if (plugins[plugin.fieldType]) {\n throw new WebinyError(\n \"There is a ElasticsearchQueryBuilderValueSearchPlugin defined for the field type.\",\n \"PLUGIN_ALREADY_EXISTS\",\n {\n fieldType: plugin.fieldType,\n name: plugin.name || \"unknown\"\n }\n );\n }\n plugins[plugin.fieldType] = plugin;\n\n return plugins;\n }, {});\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,kDAAkD;AAO3D,OAAO,MAAMC,sBAAsB,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAAwC;EAC9F,OAAOA,OAAO,CACTC,MAAM,CACHH,kDAAkD,CAACI,IACvD,CAAC,CACAC,MAAM,CAAoC,CAACH,OAAO,EAAEI,MAAM,KAAK;IAC5D,IAAIJ,OAAO,CAACI,MAAM,CAACC,SAAS,CAAC,EAAE;MAC3B,MAAM,IAAIR,WAAW,CACjB,mFAAmF,EACnF,uBAAuB,EACvB;QACIQ,SAAS,EAAED,MAAM,CAACC,SAAS;QAC3BC,IAAI,EAAEF,MAAM,CAACE,IAAI,IAAI;MACzB,CACJ,CAAC;IACL;IACAN,OAAO,CAACI,MAAM,CAACC,SAAS,CAAC,GAAGD,MAAM;IAElC,OAAOJ,OAAO;EAClB,CAAC,EAAE,CAAC,CAAC,CAAC;AACd,CAAC","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import { CmsEntryElasticsearchSortModifierPlugin } from "../../../../plugins/index.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
4
- interface Params {
5
- plugins: PluginsContainer;
6
- model: CmsModel;
7
- }
8
- export declare const createSortModifierPluginList: ({ plugins, model }: Params) => import("@webiny/plugins/PluginsContainer").WithName<CmsEntryElasticsearchSortModifierPlugin>[];
9
- export {};
@@ -1,11 +0,0 @@
1
- import { CmsEntryElasticsearchSortModifierPlugin } from "../../../../plugins/index.js";
2
- export const createSortModifierPluginList = ({
3
- plugins,
4
- model
5
- }) => {
6
- return plugins.byType(CmsEntryElasticsearchSortModifierPlugin.type).filter(pl => {
7
- return !pl.modelId || pl.modelId === model.modelId;
8
- });
9
- };
10
-
11
- //# sourceMappingURL=sortModifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryElasticsearchSortModifierPlugin","createSortModifierPluginList","plugins","model","byType","type","filter","pl","modelId"],"sources":["sortModifier.ts"],"sourcesContent":["import { CmsEntryElasticsearchSortModifierPlugin } from \"~/plugins/index.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\nexport const createSortModifierPluginList = ({ plugins, model }: Params) => {\n return plugins\n .byType<CmsEntryElasticsearchSortModifierPlugin>(\n CmsEntryElasticsearchSortModifierPlugin.type\n )\n .filter(pl => {\n return !pl.modelId || pl.modelId === model.modelId;\n });\n};\n"],"mappings":"AAAA,SAASA,uCAAuC;AAQhD,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAc,CAAC,KAAK;EACxE,OAAOD,OAAO,CACTE,MAAM,CACHJ,uCAAuC,CAACK,IAC5C,CAAC,CACAC,MAAM,CAACC,EAAE,IAAI;IACV,OAAO,CAACA,EAAE,CAACC,OAAO,IAAID,EAAE,CAACC,OAAO,KAAKL,KAAK,CAACK,OAAO;EACtD,CAAC,CAAC;AACV,CAAC","ignoreList":[]}
@@ -1,69 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { CmsModelFieldType } from "@webiny/api-headless-cms/types/index.js";
3
- /**
4
- * A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.
5
- *
6
- * This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.
7
- */
8
- export interface CmsModelFieldPluginParams {
9
- /**
10
- * The type of the field.
11
- * Can be something custom, like "my-field-type".
12
- */
13
- fieldType: CmsModelFieldType;
14
- /**
15
- * The ID of the field on the GraphQL side
16
- */
17
- fieldId: string;
18
- /**
19
- * The path to the field in the Elasticsearch document.
20
- */
21
- path: string;
22
- /**
23
- * If the field should be applied only to specific models.
24
- * Or excluded from the specific models.
25
- *
26
- * The default is to apply to all models.
27
- */
28
- models?: {
29
- include?: string[];
30
- exclude?: string[];
31
- };
32
- /**
33
- * The unmapped type of the field.
34
- * In most cases, this will be undefined.
35
- * When does it need to be set?
36
- *
37
- * When you are using a custom field type, other than the ones that are defined in the CMS.
38
- * Let's say you create a field of type `my-field-type`, in which you want to store dates. By the default, it will, in most cases be set as string - if you did not specify the value transformer.
39
- * If you want to be able to sort/filter properly by this field, you need to specify the unmapped type as "date".
40
- */
41
- unmappedType?: string;
42
- /**
43
- * Is this field searchable?
44
- * If set to false, an error will be thrown when trying to search/filter by this field.
45
- */
46
- searchable?: boolean;
47
- /**
48
- * Is this field sortable?
49
- * If set to false, an error will be thrown when trying to sort by this field.
50
- */
51
- sortable?: boolean;
52
- /**
53
- * If the .keyword should be applied when doing the filtering or sorting on the field.
54
- */
55
- keyword?: boolean;
56
- }
57
- export declare class CmsElasticsearchModelFieldPlugin extends Plugin {
58
- static readonly type: string;
59
- private readonly field;
60
- get fieldType(): string;
61
- get fieldId(): string;
62
- get path(): string;
63
- get unmappedType(): string | undefined;
64
- get searchable(): boolean | undefined;
65
- get sortable(): boolean | undefined;
66
- get keyword(): boolean | undefined;
67
- constructor(field: CmsModelFieldPluginParams);
68
- canBeApplied(modelId: string): boolean;
69
- }
@@ -1,46 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
-
3
- /**
4
- * A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.
5
- *
6
- * This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.
7
- */
8
-
9
- export class CmsElasticsearchModelFieldPlugin extends Plugin {
10
- static type = "headlessCms.elasticsearch.model.field";
11
- get fieldType() {
12
- return this.field.fieldType;
13
- }
14
- get fieldId() {
15
- return this.field.fieldId;
16
- }
17
- get path() {
18
- return this.field.path;
19
- }
20
- get unmappedType() {
21
- return this.field.unmappedType;
22
- }
23
- get searchable() {
24
- return this.field.searchable;
25
- }
26
- get sortable() {
27
- return this.field.sortable;
28
- }
29
- get keyword() {
30
- return this.field.keyword;
31
- }
32
- constructor(field) {
33
- super();
34
- this.field = field;
35
- }
36
- canBeApplied(modelId) {
37
- if (this.field.models?.include?.length) {
38
- return this.field.models.include.includes(modelId);
39
- } else if (this.field.models?.exclude?.length) {
40
- return this.field.models.exclude.includes(modelId) === false;
41
- }
42
- return true;
43
- }
44
- }
45
-
46
- //# sourceMappingURL=CmsElasticsearchModelFieldPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Plugin","CmsElasticsearchModelFieldPlugin","type","fieldType","field","fieldId","path","unmappedType","searchable","sortable","keyword","constructor","canBeApplied","modelId","models","include","length","includes","exclude"],"sources":["CmsElasticsearchModelFieldPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsModelFieldType } from \"@webiny/api-headless-cms/types/index.js\";\n\n/**\n * A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.\n *\n * This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.\n */\nexport interface CmsModelFieldPluginParams {\n /**\n * The type of the field.\n * Can be something custom, like \"my-field-type\".\n */\n fieldType: CmsModelFieldType;\n /**\n * The ID of the field on the GraphQL side\n */\n fieldId: string;\n /**\n * The path to the field in the Elasticsearch document.\n */\n path: string;\n /**\n * If the field should be applied only to specific models.\n * Or excluded from the specific models.\n *\n * The default is to apply to all models.\n */\n models?: {\n include?: string[];\n exclude?: string[];\n };\n /**\n * The unmapped type of the field.\n * In most cases, this will be undefined.\n * When does it need to be set?\n *\n * When you are using a custom field type, other than the ones that are defined in the CMS.\n * Let's say you create a field of type `my-field-type`, in which you want to store dates. By the default, it will, in most cases be set as string - if you did not specify the value transformer.\n * If you want to be able to sort/filter properly by this field, you need to specify the unmapped type as \"date\".\n */\n unmappedType?: string;\n /**\n * Is this field searchable?\n * If set to false, an error will be thrown when trying to search/filter by this field.\n */\n searchable?: boolean;\n /**\n * Is this field sortable?\n * If set to false, an error will be thrown when trying to sort by this field.\n */\n sortable?: boolean;\n /**\n * If the .keyword should be applied when doing the filtering or sorting on the field.\n */\n keyword?: boolean;\n}\n\nexport class CmsElasticsearchModelFieldPlugin extends Plugin {\n public static override readonly type: string = \"headlessCms.elasticsearch.model.field\";\n\n private readonly field: CmsModelFieldPluginParams;\n\n public get fieldType() {\n return this.field.fieldType;\n }\n public get fieldId() {\n return this.field.fieldId;\n }\n public get path() {\n return this.field.path;\n }\n\n public get unmappedType() {\n return this.field.unmappedType;\n }\n\n public get searchable() {\n return this.field.searchable;\n }\n\n public get sortable() {\n return this.field.sortable;\n }\n\n public get keyword() {\n return this.field.keyword;\n }\n\n public constructor(field: CmsModelFieldPluginParams) {\n super();\n this.field = field;\n }\n\n public canBeApplied(modelId: string): boolean {\n if (this.field.models?.include?.length) {\n return this.field.models.include.includes(modelId);\n } else if (this.field.models?.exclude?.length) {\n return this.field.models.exclude.includes(modelId) === false;\n }\n return true;\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,iBAAiB;;AAGxC;AACA;AACA;AACA;AACA;;AAmDA,OAAO,MAAMC,gCAAgC,SAASD,MAAM,CAAC;EACzD,OAAgCE,IAAI,GAAW,uCAAuC;EAItF,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACC,KAAK,CAACD,SAAS;EAC/B;EACA,IAAWE,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACD,KAAK,CAACC,OAAO;EAC7B;EACA,IAAWC,IAAIA,CAAA,EAAG;IACd,OAAO,IAAI,CAACF,KAAK,CAACE,IAAI;EAC1B;EAEA,IAAWC,YAAYA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACH,KAAK,CAACG,YAAY;EAClC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACJ,KAAK,CAACI,UAAU;EAChC;EAEA,IAAWC,QAAQA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACL,KAAK,CAACK,QAAQ;EAC9B;EAEA,IAAWC,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACN,KAAK,CAACM,OAAO;EAC7B;EAEOC,WAAWA,CAACP,KAAgC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,KAAK,GAAGA,KAAK;EACtB;EAEOQ,YAAYA,CAACC,OAAe,EAAW;IAC1C,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE;MACpC,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACC,OAAO,CAACE,QAAQ,CAACJ,OAAO,CAAC;IACtD,CAAC,MAAM,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEI,OAAO,EAAEF,MAAM,EAAE;MAC3C,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACI,OAAO,CAACD,QAAQ,CAACJ,OAAO,CAAC,KAAK,KAAK;IAChE;IACA,OAAO,IAAI;EACf;AACJ","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- import type { ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-opensearch";
2
- import { OpenSearchBodyModifierPlugin } from "@webiny/api-opensearch";
3
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
4
- export interface ModifyBodyParams extends BaseModifyBodyParams {
5
- model: CmsModel;
6
- where: {
7
- [key: string]: any;
8
- };
9
- }
10
- export interface CmsEntryElasticsearchBodyModifierPluginConfig {
11
- modifyBody: ModifyBodyCallable<ModifyBodyParams>;
12
- /**
13
- * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
14
- */
15
- modelId?: string;
16
- }
17
- export declare class CmsEntryElasticsearchBodyModifierPlugin extends OpenSearchBodyModifierPlugin<ModifyBodyParams> {
18
- static readonly type: string;
19
- readonly modelId?: string;
20
- constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig);
21
- }
22
- export declare const createCmsEntryElasticsearchBodyModifierPlugin: (config: CmsEntryElasticsearchBodyModifierPluginConfig) => CmsEntryElasticsearchBodyModifierPlugin;
@@ -1,13 +0,0 @@
1
- import { OpenSearchBodyModifierPlugin } from "@webiny/api-opensearch";
2
- export class CmsEntryElasticsearchBodyModifierPlugin extends OpenSearchBodyModifierPlugin {
3
- static type = "cms.elasticsearch.modifier.body.entry";
4
- constructor(config) {
5
- super(config.modifyBody);
6
- this.modelId = config.modelId;
7
- }
8
- }
9
- export const createCmsEntryElasticsearchBodyModifierPlugin = config => {
10
- return new CmsEntryElasticsearchBodyModifierPlugin(config);
11
- };
12
-
13
- //# sourceMappingURL=CmsEntryElasticsearchBodyModifierPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["OpenSearchBodyModifierPlugin","CmsEntryElasticsearchBodyModifierPlugin","type","constructor","config","modifyBody","modelId","createCmsEntryElasticsearchBodyModifierPlugin"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import type {\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-opensearch\";\nimport { OpenSearchBodyModifierPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends OpenSearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchBodyModifierPlugin = (\n config: CmsEntryElasticsearchBodyModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchBodyModifierPlugin(config);\n};\n"],"mappings":"AAIA,SAASA,4BAA4B,QAAQ,wBAAwB;AAkBrE,OAAO,MAAMC,uCAAuC,SAASD,4BAA4B,CAAmB;EACxG,OAAgCE,IAAI,GAAW,uCAAuC;EAI/EC,WAAWA,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IAExB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAEA,OAAO,MAAMC,6CAA6C,GACtDH,MAAqD,IACpD;EACD,OAAO,IAAIH,uCAAuC,CAACG,MAAM,CAAC;AAC9D,CAAC","ignoreList":[]}