@webiny/api-headless-cms-ddb-es 0.0.0-unstable.78f581c1d2 → 0.0.0-unstable.7be00a75a9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/README.md +6 -30
  2. package/configurations.d.ts +13 -6
  3. package/configurations.js +28 -40
  4. package/configurations.js.map +1 -1
  5. package/definitions/entry.d.ts +4 -5
  6. package/definitions/entry.js +9 -88
  7. package/definitions/entry.js.map +1 -1
  8. package/definitions/group.d.ts +6 -6
  9. package/definitions/group.js +9 -68
  10. package/definitions/group.js.map +1 -1
  11. package/definitions/model.d.ts +6 -6
  12. package/definitions/model.js +9 -90
  13. package/definitions/model.js.map +1 -1
  14. package/definitions/types.d.ts +65 -0
  15. package/definitions/types.js +0 -0
  16. package/elasticsearch/createElasticsearchIndex.d.ts +5 -5
  17. package/elasticsearch/createElasticsearchIndex.js +53 -56
  18. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  19. package/elasticsearch/deleteElasticsearchIndex.d.ts +3 -3
  20. package/elasticsearch/deleteElasticsearchIndex.js +20 -40
  21. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  22. package/exports/api/cms/opensearch.d.ts +9 -0
  23. package/exports/api/cms/opensearch.js +9 -0
  24. package/feature.d.ts +1 -0
  25. package/feature.js +179 -0
  26. package/feature.js.map +1 -0
  27. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  28. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +5 -0
  29. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  30. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  31. package/features/CmsEntryOpenSearchBodyModifier/index.js +1 -0
  32. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +14 -0
  33. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +42 -0
  34. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  35. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +32 -0
  36. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +5 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +5 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/constants.js +4 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/feature.js +29 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  47. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  48. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +60 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  50. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +13 -0
  51. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +33 -0
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +21 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +22 -0
  58. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  59. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  60. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +32 -0
  61. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  62. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +12 -0
  63. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +107 -0
  64. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  65. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  66. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +21 -0
  67. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  68. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +15 -0
  69. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +40 -0
  70. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +1 -0
  71. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +15 -0
  72. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +40 -0
  73. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +1 -0
  74. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  75. package/features/CmsEntryOpenSearchFieldIndex/index.js +3 -0
  76. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  77. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +36 -0
  78. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  79. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  80. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +5 -0
  81. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  82. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  83. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +5 -0
  84. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  85. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  86. package/features/CmsEntryOpenSearchFilter/constants.js +4 -0
  87. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  88. package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
  89. package/features/CmsEntryOpenSearchFilter/feature.js +17 -0
  90. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  91. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  92. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +26 -0
  93. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  94. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  95. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +43 -0
  96. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  97. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  98. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +36 -0
  99. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  100. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  101. package/features/CmsEntryOpenSearchFilter/index.js +3 -0
  102. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  103. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +5 -0
  104. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  105. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  106. package/features/CmsEntryOpenSearchFullTextSearch/index.js +1 -0
  107. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  108. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
  109. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  110. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  111. package/features/CmsEntryOpenSearchIndex/abstractions.js +5 -0
  112. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  113. package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
  114. package/features/CmsEntryOpenSearchIndex/feature.js +11 -0
  115. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  116. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  117. package/features/CmsEntryOpenSearchIndex/index.js +3 -0
  118. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  119. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +5 -0
  120. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  121. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  122. package/features/CmsEntryOpenSearchQueryModifier/index.js +1 -0
  123. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  124. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +5 -0
  125. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  126. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  127. package/features/CmsEntryOpenSearchSortModifier/index.js +1 -0
  128. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  129. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +31 -0
  130. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  131. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  132. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +5 -0
  133. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  134. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  135. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +5 -0
  136. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  137. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
  138. package/features/CmsEntryOpenSearchValueSearch/feature.js +17 -0
  139. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  140. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  141. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +21 -0
  142. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  143. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  144. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +44 -0
  145. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  146. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  147. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +22 -0
  148. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  149. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  150. package/features/CmsEntryOpenSearchValueSearch/index.js +3 -0
  151. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  152. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +5 -0
  153. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  154. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  155. package/features/CmsEntryOpenSearchValuesModifier/index.js +1 -0
  156. package/helpers/entryIndexHelpers.d.ts +13 -11
  157. package/helpers/entryIndexHelpers.js +72 -196
  158. package/helpers/entryIndexHelpers.js.map +1 -1
  159. package/helpers/fieldIdentifier.d.ts +6 -0
  160. package/helpers/fieldIdentifier.js +23 -0
  161. package/helpers/fieldIdentifier.js.map +1 -0
  162. package/helpers/index.d.ts +2 -2
  163. package/helpers/index.js +2 -31
  164. package/index.d.ts +1 -3
  165. package/index.js +1 -268
  166. package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
  167. package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
  168. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  169. package/operations/entry/dataLoader/constants.d.ts +1 -0
  170. package/operations/entry/dataLoader/constants.js +5 -0
  171. package/operations/entry/dataLoader/constants.js.map +1 -0
  172. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  173. package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
  174. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  175. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  176. package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
  177. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  178. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  179. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +34 -0
  180. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  181. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  182. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +34 -0
  183. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  184. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  185. package/operations/entry/dataLoader/getRevisionById.js +40 -0
  186. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  187. package/operations/entry/dataLoader/index.d.ts +8 -0
  188. package/operations/entry/dataLoader/index.js +18 -0
  189. package/operations/entry/dataLoader/index.js.map +1 -0
  190. package/operations/entry/dataLoader/types.d.ts +6 -0
  191. package/operations/entry/dataLoader/types.js +0 -0
  192. package/operations/entry/dataLoaders.d.ts +17 -38
  193. package/operations/entry/dataLoaders.js +82 -357
  194. package/operations/entry/dataLoaders.js.map +1 -1
  195. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  196. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +9 -0
  197. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  198. package/operations/entry/elasticsearch/body.d.ts +29 -0
  199. package/operations/entry/elasticsearch/body.js +87 -0
  200. package/operations/entry/elasticsearch/body.js.map +1 -0
  201. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
  202. package/operations/entry/elasticsearch/fields/createSystemField.js +9 -0
  203. package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
  204. package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
  205. package/operations/entry/elasticsearch/fields/live.js +50 -0
  206. package/operations/entry/elasticsearch/fields/live.js.map +1 -0
  207. package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
  208. package/operations/entry/elasticsearch/fields/location.js +50 -0
  209. package/operations/entry/elasticsearch/fields/location.js.map +1 -0
  210. package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
  211. package/operations/entry/elasticsearch/fields/state.js +104 -0
  212. package/operations/entry/elasticsearch/fields/state.js.map +1 -0
  213. package/operations/entry/elasticsearch/fields.d.ts +12 -0
  214. package/operations/entry/elasticsearch/fields.js +207 -0
  215. package/operations/entry/elasticsearch/fields.js.map +1 -0
  216. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +9 -0
  217. package/operations/entry/elasticsearch/filtering/applyFiltering.js +39 -0
  218. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
  219. package/operations/entry/elasticsearch/filtering/exec.d.ts +22 -0
  220. package/operations/entry/elasticsearch/filtering/exec.js +96 -0
  221. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
  222. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
  223. package/operations/entry/elasticsearch/filtering/index.js +1 -0
  224. package/operations/entry/elasticsearch/filtering/path.d.ts +17 -0
  225. package/operations/entry/elasticsearch/filtering/path.js +27 -0
  226. package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
  227. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
  228. package/operations/entry/elasticsearch/filtering/populated.js +12 -0
  229. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
  230. package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
  231. package/operations/entry/elasticsearch/filtering/values.js +15 -0
  232. package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
  233. package/operations/entry/elasticsearch/fullTextSearch.d.ts +13 -0
  234. package/operations/entry/elasticsearch/fullTextSearch.js +51 -0
  235. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
  236. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
  237. package/operations/entry/elasticsearch/fullTextSearchFields.js +10 -0
  238. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
  239. package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
  240. package/operations/entry/elasticsearch/initialQuery.js +45 -0
  241. package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
  242. package/operations/entry/elasticsearch/keyword.d.ts +2 -0
  243. package/operations/entry/elasticsearch/keyword.js +17 -0
  244. package/operations/entry/elasticsearch/keyword.js.map +1 -0
  245. package/operations/entry/elasticsearch/plugins/operator.d.ts +7 -0
  246. package/operations/entry/elasticsearch/plugins/operator.js +13 -0
  247. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
  248. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
  249. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +8 -0
  250. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
  251. package/operations/entry/elasticsearch/sort.d.ts +12 -0
  252. package/operations/entry/elasticsearch/sort.js +80 -0
  253. package/operations/entry/elasticsearch/sort.js.map +1 -0
  254. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +9 -0
  255. package/operations/entry/elasticsearch/transformValueForSearch.js +12 -0
  256. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
  257. package/operations/entry/elasticsearch/types.d.ts +34 -0
  258. package/operations/entry/elasticsearch/types.js +0 -0
  259. package/operations/entry/index.d.ts +27 -8
  260. package/operations/entry/index.js +1344 -1245
  261. package/operations/entry/index.js.map +1 -1
  262. package/operations/entry/keys.d.ts +31 -1
  263. package/operations/entry/keys.js +45 -35
  264. package/operations/entry/keys.js.map +1 -1
  265. package/operations/entry/recordType.d.ts +3 -0
  266. package/operations/entry/recordType.js +6 -0
  267. package/operations/entry/recordType.js.map +1 -0
  268. package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
  269. package/operations/entry/transformations/convertEntryKeys.js +25 -0
  270. package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
  271. package/operations/entry/transformations/index.d.ts +33 -0
  272. package/operations/entry/transformations/index.js +91 -0
  273. package/operations/entry/transformations/index.js.map +1 -0
  274. package/operations/entry/transformations/modifyEntryValues.d.ts +53 -0
  275. package/operations/entry/transformations/modifyEntryValues.js +16 -0
  276. package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
  277. package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
  278. package/operations/entry/transformations/transformEntryKeys.js +17 -0
  279. package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
  280. package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
  281. package/operations/entry/transformations/transformEntryToIndex.js +20 -0
  282. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
  283. package/operations/group/index.d.ts +7 -6
  284. package/operations/group/index.js +116 -190
  285. package/operations/group/index.js.map +1 -1
  286. package/operations/model/index.d.ts +4 -4
  287. package/operations/model/index.js +130 -199
  288. package/operations/model/index.js.map +1 -1
  289. package/package.json +44 -41
  290. package/tasks/createIndexTaskPlugin.d.ts +2 -0
  291. package/tasks/createIndexTaskPlugin.js +45 -0
  292. package/tasks/createIndexTaskPlugin.js.map +1 -0
  293. package/types.d.ts +34 -137
  294. package/types.js +10 -47
  295. package/types.js.map +1 -1
  296. package/values/NoValueContainer.d.ts +5 -0
  297. package/values/NoValueContainer.js +11 -0
  298. package/values/NoValueContainer.js.map +1 -0
  299. package/definitions/entryElasticsearch.d.ts +0 -8
  300. package/definitions/entryElasticsearch.js +0 -42
  301. package/definitions/entryElasticsearch.js.map +0 -1
  302. package/definitions/settings.d.ts +0 -8
  303. package/definitions/settings.js +0 -58
  304. package/definitions/settings.js.map +0 -1
  305. package/definitions/system.d.ts +0 -8
  306. package/definitions/system.js +0 -46
  307. package/definitions/system.js.map +0 -1
  308. package/definitions/table.d.ts +0 -8
  309. package/definitions/table.js +0 -24
  310. package/definitions/table.js.map +0 -1
  311. package/definitions/tableElasticsearch.d.ts +0 -8
  312. package/definitions/tableElasticsearch.js +0 -24
  313. package/definitions/tableElasticsearch.js.map +0 -1
  314. package/dynamoDb/index.d.ts +0 -2
  315. package/dynamoDb/index.js +0 -16
  316. package/dynamoDb/index.js.map +0 -1
  317. package/dynamoDb/storage/date.d.ts +0 -2
  318. package/dynamoDb/storage/date.js +0 -99
  319. package/dynamoDb/storage/date.js.map +0 -1
  320. package/dynamoDb/storage/longText.d.ts +0 -10
  321. package/dynamoDb/storage/longText.js +0 -101
  322. package/dynamoDb/storage/longText.js.map +0 -1
  323. package/dynamoDb/storage/richText.d.ts +0 -7
  324. package/dynamoDb/storage/richText.js +0 -128
  325. package/dynamoDb/storage/richText.js.map +0 -1
  326. package/elasticsearch/index.d.ts +0 -2
  327. package/elasticsearch/index.js +0 -16
  328. package/elasticsearch/index.js.map +0 -1
  329. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  330. package/elasticsearch/indexing/dateTimeIndexing.js +0 -103
  331. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  332. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  333. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  334. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  335. package/elasticsearch/indexing/index.d.ts +0 -2
  336. package/elasticsearch/indexing/index.js +0 -24
  337. package/elasticsearch/indexing/index.js.map +0 -1
  338. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -3
  339. package/elasticsearch/indexing/longTextIndexing.js +0 -36
  340. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  341. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  342. package/elasticsearch/indexing/numberIndexing.js +0 -48
  343. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  344. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  345. package/elasticsearch/indexing/objectIndexing.js +0 -223
  346. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  347. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  348. package/elasticsearch/indexing/richTextIndexing.js +0 -34
  349. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  350. package/elasticsearch/indices/base.d.ts +0 -2
  351. package/elasticsearch/indices/base.js +0 -15
  352. package/elasticsearch/indices/base.js.map +0 -1
  353. package/elasticsearch/indices/index.d.ts +0 -1
  354. package/elasticsearch/indices/index.js +0 -16
  355. package/elasticsearch/indices/index.js.map +0 -1
  356. package/elasticsearch/indices/japanese.d.ts +0 -2
  357. package/elasticsearch/indices/japanese.js +0 -16
  358. package/elasticsearch/indices/japanese.js.map +0 -1
  359. package/elasticsearch/search/index.d.ts +0 -3
  360. package/elasticsearch/search/index.js +0 -14
  361. package/elasticsearch/search/index.js.map +0 -1
  362. package/elasticsearch/search/refSearch.d.ts +0 -2
  363. package/elasticsearch/search/refSearch.js +0 -33
  364. package/elasticsearch/search/refSearch.js.map +0 -1
  365. package/elasticsearch/search/timeSearch.d.ts +0 -2
  366. package/elasticsearch/search/timeSearch.js +0 -33
  367. package/elasticsearch/search/timeSearch.js.map +0 -1
  368. package/helpers/createElasticsearchQueryBody.d.ts +0 -11
  369. package/helpers/createElasticsearchQueryBody.js +0 -611
  370. package/helpers/createElasticsearchQueryBody.js.map +0 -1
  371. package/helpers/fields.d.ts +0 -19
  372. package/helpers/fields.js +0 -205
  373. package/helpers/fields.js.map +0 -1
  374. package/helpers/index.js.map +0 -1
  375. package/helpers/searchPluginsList.d.ts +0 -6
  376. package/helpers/searchPluginsList.js +0 -26
  377. package/helpers/searchPluginsList.js.map +0 -1
  378. package/helpers/transformValueForSearch.d.ts +0 -12
  379. package/helpers/transformValueForSearch.js +0 -29
  380. package/helpers/transformValueForSearch.js.map +0 -1
  381. package/index.js.map +0 -1
  382. package/operations/entry/elasticsearchFields.d.ts +0 -2
  383. package/operations/entry/elasticsearchFields.js +0 -38
  384. package/operations/entry/elasticsearchFields.js.map +0 -1
  385. package/operations/settings/index.d.ts +0 -6
  386. package/operations/settings/index.js +0 -135
  387. package/operations/settings/index.js.map +0 -1
  388. package/operations/system/index.d.ts +0 -6
  389. package/operations/system/index.js +0 -99
  390. package/operations/system/index.js.map +0 -1
  391. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -20
  392. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -24
  393. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  394. package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
  395. package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
  396. package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
  397. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  398. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -17
  399. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  400. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -30
  401. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -43
  402. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  403. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -17
  404. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -24
  405. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  406. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -17
  407. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -24
  408. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  409. package/plugins/index.d.ts +0 -6
  410. package/plugins/index.js +0 -83
  411. package/plugins/index.js.map +0 -1
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _default = () => ({
9
- type: "cms-model-field-to-elastic-search",
10
- name: "cms-model-field-to-elastic-search-long-text",
11
- fieldType: "long-text",
12
-
13
- toIndex({
14
- rawValue
15
- }) {
16
- /**
17
- * We want to store the value (rawValue) from entry before it was prepared for storage as value to be searched on.
18
- * And we want to store prepared value into rawValue so it is not indexed.
19
- */
20
- return {
21
- value: rawValue ? encodeURIComponent(rawValue) : ""
22
- };
23
- },
24
-
25
- /**
26
- * When extracting from index, we can return the value that was stored to be searched - and then no decompression will be required.
27
- */
28
- fromIndex({
29
- value
30
- }) {
31
- return value ? decodeURIComponent(value) : "";
32
- }
33
-
34
- });
35
-
36
- exports.default = _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["type","name","fieldType","toIndex","rawValue","value","encodeURIComponent","fromIndex","decodeURIComponent"],"sources":["longTextIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\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 want to store the value (rawValue) from entry before it was prepared for storage as value to be searched on.\n * And we want to store prepared value into rawValue so it is not indexed.\n */\n return {\n value: rawValue ? encodeURIComponent(rawValue) : \"\"\n };\n },\n /**\n * When extracting from index, we can return the value that was stored to be searched - and then no decompression will be required.\n */\n fromIndex({ value }) {\n return value ? decodeURIComponent(value) : \"\";\n }\n});\n"],"mappings":";;;;;;;eAEe,OAA2C;EACtDA,IAAI,EAAE,mCADgD;EAEtDC,IAAI,EAAE,6CAFgD;EAGtDC,SAAS,EAAE,WAH2C;;EAItDC,OAAO,CAAC;IAAEC;EAAF,CAAD,EAAe;IAClB;AACR;AACA;AACA;IACQ,OAAO;MACHC,KAAK,EAAED,QAAQ,GAAGE,kBAAkB,CAACF,QAAD,CAArB,GAAkC;IAD9C,CAAP;EAGH,CAZqD;;EAatD;AACJ;AACA;EACIG,SAAS,CAAC;IAAEF;EAAF,CAAD,EAAY;IACjB,OAAOA,KAAK,GAAGG,kBAAkB,CAACH,KAAD,CAArB,GAA+B,EAA3C;EACH;;AAlBqD,CAA3C,C"}
@@ -1,3 +0,0 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
- export default _default;
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- const convertToString = value => {
9
- if (Array.isArray(value) === false) {
10
- return value;
11
- }
12
-
13
- return value.map(String);
14
- };
15
-
16
- const convertToFloat = value => {
17
- if (Array.isArray(value) === false) {
18
- return typeof value === "string" ? parseFloat(value) : value;
19
- }
20
-
21
- return value.map(v => parseFloat(v));
22
- };
23
-
24
- var _default = () => ({
25
- type: "cms-model-field-to-elastic-search",
26
- name: "cms-model-field-to-elastic-search-number",
27
- fieldType: "number",
28
- unmappedType: () => {
29
- return "float";
30
- },
31
-
32
- toIndex({
33
- value
34
- }) {
35
- return {
36
- value: convertToString(value)
37
- };
38
- },
39
-
40
- fromIndex({
41
- value
42
- }) {
43
- return convertToFloat(value);
44
- }
45
-
46
- });
47
-
48
- exports.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 { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\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,KAAD,IAA8B;EAClD,IAAIC,KAAK,CAACC,OAAN,CAAcF,KAAd,MAAyB,KAA7B,EAAoC;IAChC,OAAOA,KAAP;EACH;;EACD,OAAQA,KAAD,CAAoBG,GAApB,CAAwBC,MAAxB,CAAP;AACH,CALD;;AAOA,MAAMC,cAAc,GAAIL,KAAD,IAA8B;EACjD,IAAIC,KAAK,CAACC,OAAN,CAAcF,KAAd,MAAyB,KAA7B,EAAoC;IAChC,OAAO,OAAOA,KAAP,KAAiB,QAAjB,GAA4BM,UAAU,CAACN,KAAD,CAAtC,GAAgDA,KAAvD;EACH;;EACD,OAAQA,KAAD,CAAoBG,GAApB,CAAwBI,CAAC,IAAID,UAAU,CAACC,CAAD,CAAvC,CAAP;AACH,CALD;;eAOe,OAA2C;EACtDC,IAAI,EAAE,mCADgD;EAEtDC,IAAI,EAAE,0CAFgD;EAGtDC,SAAS,EAAE,QAH2C;EAItDC,YAAY,EAAE,MAAM;IAChB,OAAO,OAAP;EACH,CANqD;;EAOtDC,OAAO,CAAC;IAAEZ;EAAF,CAAD,EAAY;IACf,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAD;IADnB,CAAP;EAGH,CAXqD;;EAYtDa,SAAS,CAAC;IAAEb;EAAF,CAAD,EAAY;IACjB,OAAOK,cAAc,CAACL,KAAD,CAArB;EACH;;AAdqD,CAA3C,C"}
@@ -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 { CmsModelFieldToElasticsearchPlugin } from "../../types";
11
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
12
- export default _default;
@@ -1,223 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- /**
9
- * TODO remove rawValue when field aliases and field types targeting will be active.
10
- *
11
- * Currently we use rawValue for the values that we do not want to be indexed.
12
- * When field aliases and types in the value path will be active, we can target the keys directly.
13
- *
14
- * This change will be incompatible with the current systems so we will need to release a major version.
15
- *
16
- */
17
- const processToIndex = ({
18
- fields,
19
- value: sourceValue,
20
- rawValue: sourceRawValue,
21
- getFieldIndexPlugin,
22
- getFieldTypePlugin,
23
- plugins,
24
- model
25
- }) => {
26
- const reducer = (values, field) => {
27
- const plugin = getFieldIndexPlugin(field.type);
28
-
29
- if (!plugin || !plugin.toIndex) {
30
- return values;
31
- }
32
-
33
- const {
34
- value,
35
- rawValue
36
- } = plugin.toIndex({
37
- model,
38
- field,
39
- value: sourceValue[field.storageId],
40
- rawValue: sourceRawValue[field.storageId],
41
- getFieldIndexPlugin,
42
- getFieldTypePlugin,
43
- plugins
44
- });
45
-
46
- if (value !== undefined) {
47
- values.value[field.storageId] = value;
48
- }
49
-
50
- if (rawValue !== undefined) {
51
- values.rawValue[field.storageId] = rawValue;
52
- }
53
-
54
- return values;
55
- };
56
-
57
- return fields.reduce(reducer, {
58
- value: {},
59
- rawValue: {}
60
- });
61
- };
62
-
63
- const processFromIndex = ({
64
- fields,
65
- value: sourceValue,
66
- rawValue: sourceRawValue,
67
- getFieldIndexPlugin,
68
- getFieldTypePlugin,
69
- plugins,
70
- model
71
- }) => {
72
- const reducer = (values, field) => {
73
- const plugin = getFieldIndexPlugin(field.type);
74
-
75
- if (!plugin || !plugin.fromIndex) {
76
- return values;
77
- }
78
-
79
- const value = plugin.fromIndex({
80
- plugins,
81
- model,
82
- field,
83
- value: sourceValue[field.storageId],
84
- rawValue: sourceRawValue[field.storageId],
85
- getFieldIndexPlugin,
86
- getFieldTypePlugin
87
- });
88
-
89
- if (value !== undefined) {
90
- values[field.storageId] = value;
91
- }
92
-
93
- return values;
94
- };
95
-
96
- return fields.reduce(reducer, {});
97
- };
98
-
99
- var _default = () => ({
100
- type: "cms-model-field-to-elastic-search",
101
- name: "cms-model-field-to-elastic-search-object",
102
- fieldType: "object",
103
-
104
- toIndex({
105
- plugins,
106
- model,
107
- field,
108
- value: initialValue,
109
- rawValue: initialRawValue,
110
- getFieldIndexPlugin,
111
- getFieldTypePlugin
112
- }) {
113
- var _field$settings;
114
-
115
- if (!initialValue) {
116
- return {
117
- value: null
118
- };
119
- }
120
-
121
- const fields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
122
- /**
123
- * In "object" field, value is either an object or an array of objects.
124
- */
125
-
126
- if (field.multipleValues) {
127
- const result = {
128
- value: [],
129
- rawValue: []
130
- };
131
-
132
- for (const key in initialValue) {
133
- const {
134
- value,
135
- rawValue
136
- } = processToIndex({
137
- value: initialValue[key],
138
- rawValue: initialRawValue[key],
139
- getFieldIndexPlugin,
140
- getFieldTypePlugin,
141
- model,
142
- plugins,
143
- fields
144
- });
145
-
146
- if (Object.keys(value).length > 0) {
147
- result.value.push(value);
148
- }
149
-
150
- if (Object.keys(rawValue).length > 0) {
151
- result.rawValue.push(rawValue);
152
- }
153
- }
154
-
155
- return {
156
- value: result.value.length > 0 ? result.value : undefined,
157
- rawValue: result.rawValue.length > 0 ? result.rawValue : undefined
158
- };
159
- }
160
-
161
- return processToIndex({
162
- value: initialValue,
163
- rawValue: initialRawValue,
164
- getFieldIndexPlugin,
165
- getFieldTypePlugin,
166
- model,
167
- plugins,
168
- fields
169
- });
170
- },
171
-
172
- fromIndex({
173
- field,
174
- value,
175
- rawValue,
176
- model,
177
- plugins,
178
- getFieldIndexPlugin,
179
- getFieldTypePlugin
180
- }) {
181
- var _field$settings2;
182
-
183
- if (!value) {
184
- return null;
185
- }
186
-
187
- const fields = ((_field$settings2 = field.settings) === null || _field$settings2 === void 0 ? void 0 : _field$settings2.fields) || [];
188
- /**
189
- * In "object" field, value is either an object or an array of objects.
190
- */
191
-
192
- if (field.multipleValues) {
193
- /**
194
- * Why this `value || rawValue || []`?
195
- * It's possible that an object contains all non-indexable fields, or vice-versa, and so
196
- * we can never be sure which array we can reliably use as a source of values.
197
- */
198
- const source = value || rawValue || [];
199
- return source.map((_, index) => processFromIndex({
200
- value: value ? value[index] || {} : {},
201
- rawValue: rawValue ? rawValue[index] || {} : {},
202
- getFieldIndexPlugin,
203
- getFieldTypePlugin,
204
- model,
205
- plugins,
206
- fields
207
- }));
208
- }
209
-
210
- return processFromIndex({
211
- value,
212
- rawValue,
213
- getFieldIndexPlugin,
214
- getFieldTypePlugin,
215
- model,
216
- plugins,
217
- fields
218
- });
219
- }
220
-
221
- });
222
-
223
- exports.default = _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["processToIndex","fields","value","sourceValue","rawValue","sourceRawValue","getFieldIndexPlugin","getFieldTypePlugin","plugins","model","reducer","values","field","plugin","type","toIndex","storageId","undefined","reduce","processFromIndex","fromIndex","name","fieldType","initialValue","initialRawValue","settings","multipleValues","result","key","Object","keys","length","push","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 { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\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>;\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 const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[field.storageId],\n rawValue: sourceRawValue[field.storageId],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins\n });\n\n if (value !== undefined) {\n values.value[field.storageId] = value;\n }\n if (rawValue !== undefined) {\n values.rawValue[field.storageId] = 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 value = plugin.fromIndex({\n plugins,\n model,\n field,\n value: sourceValue[field.storageId],\n rawValue: sourceRawValue[field.storageId],\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (value !== undefined) {\n values[field.storageId] = 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 { value: null };\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.multipleValues) {\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 if (Object.keys(value).length > 0) {\n result.value.push(value);\n }\n\n if (Object.keys(rawValue).length > 0) {\n result.rawValue.push(rawValue);\n }\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.multipleValues) {\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":"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"}
@@ -1,3 +0,0 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
- declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
- export default _default;
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _default = () => ({
9
- type: "cms-model-field-to-elastic-search",
10
- name: "cms-model-field-to-elastic-search-rich-text",
11
- fieldType: "rich-text",
12
-
13
- toIndex({
14
- value
15
- }) {
16
- // TODO: convert rich-text object to a searchable string to offer full-text search at some point
17
-
18
- /**
19
- * We want to store rich-text value as a "rawValue", meaning it wont' be indexed by ES.
20
- */
21
- return {
22
- rawValue: value
23
- };
24
- },
25
-
26
- fromIndex({
27
- rawValue
28
- }) {
29
- return rawValue;
30
- }
31
-
32
- });
33
-
34
- exports.default = _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["type","name","fieldType","toIndex","value","rawValue","fromIndex"],"sources":["richTextIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\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":";;;;;;;eAEe,OAA2C;EACtDA,IAAI,EAAE,mCADgD;EAEtDC,IAAI,EAAE,6CAFgD;EAGtDC,SAAS,EAAE,WAH2C;;EAItDC,OAAO,CAAC;IAAEC;EAAF,CAAD,EAAY;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IADP,CAAP;EAGH,CAbqD;;EActDE,SAAS,CAAC;IAAED;EAAF,CAAD,EAAe;IACpB,OAAOA,QAAP;EACH;;AAhBqD,CAA3C,C"}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchIndexPlugin } from "../../plugins/CmsEntryElasticsearchIndexPlugin";
2
- export declare const base: CmsEntryElasticsearchIndexPlugin;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.base = void 0;
7
-
8
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
9
-
10
- var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
11
-
12
- const base = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
13
- body: (0, _apiElasticsearch.getBaseConfiguration)()
14
- });
15
- exports.base = base;
@@ -1 +0,0 @@
1
- {"version":3,"names":["base","CmsEntryElasticsearchIndexPlugin","body","getBaseConfiguration"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\n\nexport const base = new CmsEntryElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,IAAI,GAAG,IAAIC,kEAAJ,CAAqC;EACrDC,IAAI,EAAE,IAAAC,sCAAA;AAD+C,CAArC,CAAb"}
@@ -1 +0,0 @@
1
- export declare const elasticsearchIndexPlugins: () => import("../..").CmsEntryElasticsearchIndexPlugin[];
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.elasticsearchIndexPlugins = void 0;
7
-
8
- var _base = require("./base");
9
-
10
- var _japanese = require("./japanese");
11
-
12
- const elasticsearchIndexPlugins = () => {
13
- return [_base.base, _japanese.japanese];
14
- };
15
-
16
- exports.elasticsearchIndexPlugins = elasticsearchIndexPlugins;
@@ -1 +0,0 @@
1
- {"version":3,"names":["elasticsearchIndexPlugins","base","japanese"],"sources":["index.ts"],"sourcesContent":["import { base } from \"./base\";\nimport { japanese } from \"./japanese\";\n\nexport const elasticsearchIndexPlugins = () => {\n return [base, japanese];\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,yBAAyB,GAAG,MAAM;EAC3C,OAAO,CAACC,UAAD,EAAOC,kBAAP,CAAP;AACH,CAFM"}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchIndexPlugin } from "../../plugins/CmsEntryElasticsearchIndexPlugin";
2
- export declare const japanese: CmsEntryElasticsearchIndexPlugin;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.japanese = void 0;
7
-
8
- var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
9
-
10
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
11
-
12
- const japanese = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
13
- body: (0, _apiElasticsearch.getJapaneseConfiguration)(),
14
- locales: ["ja", "ja-jp"]
15
- });
16
- exports.japanese = japanese;
@@ -1 +0,0 @@
1
- {"version":3,"names":["japanese","CmsEntryElasticsearchIndexPlugin","body","getJapaneseConfiguration","locales"],"sources":["japanese.ts"],"sourcesContent":["import { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\nimport { getJapaneseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const japanese = new CmsEntryElasticsearchIndexPlugin({\n body: getJapaneseConfiguration(),\n locales: [\"ja\", \"ja-jp\"]\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,QAAQ,GAAG,IAAIC,kEAAJ,CAAqC;EACzDC,IAAI,EAAE,IAAAC,0CAAA,GADmD;EAEzDC,OAAO,EAAE,CAAC,IAAD,EAAO,OAAP;AAFgD,CAArC,CAAjB"}
@@ -1,3 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
2
- declare const _default: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin[];
3
- export default _default;
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _timeSearch = require("./timeSearch");
9
-
10
- var _refSearch = require("./refSearch");
11
-
12
- var _default = () => [(0, _timeSearch.createTimeSearchPlugin)(), (0, _refSearch.createRefSearchPlugin)()];
13
-
14
- exports.default = _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["createTimeSearchPlugin","createRefSearchPlugin"],"sources":["index.ts"],"sourcesContent":["import { createTimeSearchPlugin } from \"./timeSearch\";\nimport { createRefSearchPlugin } from \"./refSearch\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\n\nexport default (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin[] => [\n createTimeSearchPlugin(),\n createRefSearchPlugin()\n];\n"],"mappings":";;;;;;;AAAA;;AACA;;eAGe,MAA4D,CACvE,IAAAA,kCAAA,GADuE,EAEvE,IAAAC,gCAAA,GAFuE,C"}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
2
- export declare const createRefSearchPlugin: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createRefSearchPlugin = void 0;
7
-
8
- var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
9
-
10
- const createPath = ({
11
- field,
12
- key
13
- }) => {
14
- if (key && key.match("entryId") === null) {
15
- return `${field.storageId}.id`;
16
- }
17
-
18
- return `${field.storageId}.entryId`;
19
- };
20
-
21
- const transform = params => {
22
- return params.value;
23
- };
24
-
25
- const createRefSearchPlugin = () => {
26
- return new _CmsEntryElasticsearchQueryBuilderValueSearchPlugin.CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
27
- fieldType: "ref",
28
- path: createPath,
29
- transform
30
- });
31
- };
32
-
33
- exports.createRefSearchPlugin = createRefSearchPlugin;
@@ -1 +0,0 @@
1
- {"version":3,"names":["createPath","field","key","match","storageId","transform","params","value","createRefSearchPlugin","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","fieldType","path"],"sources":["refSearch.ts"],"sourcesContent":["import {\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin,\n CreatePathCallable,\n TransformCallable\n} from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\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<string> = params => {\n return params.value;\n};\n\nexport const createRefSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"ref\",\n path: createPath,\n transform\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAMA,MAAMA,UAAsC,GAAG,CAAC;EAAEC,KAAF;EAASC;AAAT,CAAD,KAAoB;EAC/D,IAAIA,GAAG,IAAIA,GAAG,CAACC,KAAJ,CAAU,SAAV,MAAyB,IAApC,EAA0C;IACtC,OAAQ,GAAEF,KAAK,CAACG,SAAU,KAA1B;EACH;;EACD,OAAQ,GAAEH,KAAK,CAACG,SAAU,UAA1B;AACH,CALD;;AAOA,MAAMC,SAAoC,GAAGC,MAAM,IAAI;EACnD,OAAOA,MAAM,CAACC,KAAd;AACH,CAFD;;AAIO,MAAMC,qBAAqB,GAAG,MAA0D;EAC3F,OAAO,IAAIC,sGAAJ,CAAuD;IAC1DC,SAAS,EAAE,KAD+C;IAE1DC,IAAI,EAAEX,UAFoD;IAG1DK;EAH0D,CAAvD,CAAP;AAKH,CANM"}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
2
- export declare const createTimeSearchPlugin: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createTimeSearchPlugin = void 0;
7
-
8
- var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
9
-
10
- const transform = params => {
11
- var _field$settings;
12
-
13
- const {
14
- field,
15
- value
16
- } = params;
17
-
18
- if (!value || ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.type) !== "time") {
19
- return value;
20
- }
21
-
22
- const [hours, minutes, seconds = 0] = value.split(":").map(Number);
23
- return hours * 60 * 60 + minutes * 60 + seconds;
24
- };
25
-
26
- const createTimeSearchPlugin = () => {
27
- return new _CmsEntryElasticsearchQueryBuilderValueSearchPlugin.CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
28
- fieldType: "datetime",
29
- transform
30
- });
31
- };
32
-
33
- exports.createTimeSearchPlugin = createTimeSearchPlugin;
@@ -1 +0,0 @@
1
- {"version":3,"names":["transform","params","field","value","settings","type","hours","minutes","seconds","split","map","Number","createTimeSearchPlugin","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","fieldType"],"sources":["timeSearch.ts"],"sourcesContent":["import {\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin,\n TransformCallable\n} from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\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":";;;;;;;AAAA;;AAKA,MAAMA,SAA4B,GAAGC,MAAM,IAAI;EAAA;;EAC3C,MAAM;IAAEC,KAAF;IAASC;EAAT,IAAmBF,MAAzB;;EACA,IAAI,CAACE,KAAD,IAAU,oBAAAD,KAAK,CAACE,QAAN,oEAAgBC,IAAhB,MAAyB,MAAvC,EAA+C;IAC3C,OAAOF,KAAP;EACH;;EACD,MAAM,CAACG,KAAD,EAAQC,OAAR,EAAiBC,OAAO,GAAG,CAA3B,IAAgCL,KAAK,CAACM,KAAN,CAAY,GAAZ,EAAiBC,GAAjB,CAAqBC,MAArB,CAAtC;EACA,OAAOL,KAAK,GAAG,EAAR,GAAa,EAAb,GAAkBC,OAAO,GAAG,EAA5B,GAAiCC,OAAxC;AACH,CAPD;;AASO,MAAMI,sBAAsB,GAAG,MAA0D;EAC5F,OAAO,IAAIC,sGAAJ,CAAuD;IAC1DC,SAAS,EAAE,UAD+C;IAE1Dd;EAF0D,CAAvD,CAAP;AAIH,CALM"}
@@ -1,11 +0,0 @@
1
- import { CmsEntryListParams, CmsModel } from "@webiny/api-headless-cms/types";
2
- import { SearchBody as esSearchBody } from "@webiny/api-elasticsearch/types";
3
- import { PluginsContainer } from "@webiny/plugins";
4
- interface CreateElasticsearchParams {
5
- plugins: PluginsContainer;
6
- model: CmsModel;
7
- args: CmsEntryListParams;
8
- parentPath?: string;
9
- }
10
- export declare const createElasticsearchQueryBody: (params: CreateElasticsearchParams) => esSearchBody;
11
- export {};