@webiny/api-headless-cms-ddb-es 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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 (430) hide show
  1. package/README.md +6 -30
  2. package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
  3. package/abstractions/CmsDdbEsDataLoaders.js +5 -0
  4. package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
  5. package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
  6. package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
  7. package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
  8. package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
  9. package/abstractions/CmsDdbEsEntryEntity.js +5 -0
  10. package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
  11. package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
  12. package/abstractions/CmsDdbEsGroupEntity.js +5 -0
  13. package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
  14. package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
  15. package/abstractions/CmsDdbEsModelEntity.js +5 -0
  16. package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
  17. package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
  18. package/abstractions/CmsDdbEsOsTable.js +5 -0
  19. package/abstractions/CmsDdbEsOsTable.js.map +1 -0
  20. package/abstractions/CmsDdbEsTable.d.ts +5 -0
  21. package/abstractions/CmsDdbEsTable.js +5 -0
  22. package/abstractions/CmsDdbEsTable.js.map +1 -0
  23. package/definitions/entry.d.ts +4 -6
  24. package/definitions/entry.js +8 -179
  25. package/definitions/entry.js.map +1 -1
  26. package/definitions/group.d.ts +6 -7
  27. package/definitions/group.js +8 -63
  28. package/definitions/group.js.map +1 -1
  29. package/definitions/model.d.ts +6 -7
  30. package/definitions/model.js +8 -107
  31. package/definitions/model.js.map +1 -1
  32. package/definitions/types.d.ts +65 -0
  33. package/definitions/types.js +0 -0
  34. package/feature.d.ts +9 -0
  35. package/feature.js +55 -0
  36. package/feature.js.map +1 -0
  37. package/index.d.ts +2 -3
  38. package/index.js +2 -225
  39. package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
  40. package/operations/entry/DdbEsCreateEntry.js +134 -0
  41. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  42. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
  43. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
  44. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  45. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  46. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  47. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  48. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
  49. package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
  50. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  51. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  52. package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
  53. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  54. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  55. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  56. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  57. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  58. package/operations/entry/DdbEsGetEntry.js +27 -0
  59. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  60. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  61. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  62. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  63. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  64. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  65. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  66. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  67. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  68. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  69. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  70. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  71. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  72. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  73. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  74. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  75. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  76. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  77. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  78. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  79. package/operations/entry/DdbEsGetRevisions.js +33 -0
  80. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  81. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
  82. package/operations/entry/DdbEsGetUniqueFieldValues.js +76 -0
  83. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  84. package/operations/entry/DdbEsListEntries.d.ts +25 -0
  85. package/operations/entry/DdbEsListEntries.js +91 -0
  86. package/operations/entry/DdbEsListEntries.js.map +1 -0
  87. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  88. package/operations/entry/DdbEsMoveEntry.js +113 -0
  89. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  90. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  91. package/operations/entry/DdbEsMoveToBin.js +137 -0
  92. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  93. package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
  94. package/operations/entry/DdbEsPublishEntry.js +231 -0
  95. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  96. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  97. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  98. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  99. package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
  100. package/operations/entry/DdbEsUnpublishEntry.js +127 -0
  101. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  102. package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
  103. package/operations/entry/DdbEsUpdateEntry.js +175 -0
  104. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  105. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -2
  106. package/operations/entry/dataLoader/DataLoaderCache.js +21 -35
  107. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  108. package/operations/entry/dataLoader/constants.js +2 -7
  109. package/operations/entry/dataLoader/constants.js.map +1 -1
  110. package/operations/entry/dataLoader/createBatchScheduleFn.js +7 -22
  111. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  112. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  113. package/operations/entry/dataLoader/getAllEntryRevisions.js +20 -41
  114. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  115. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  116. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +30 -48
  117. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  118. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  119. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +30 -48
  120. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  121. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  122. package/operations/entry/dataLoader/getRevisionById.js +36 -58
  123. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  124. package/operations/entry/dataLoader/index.d.ts +3 -3
  125. package/operations/entry/dataLoader/index.js +13 -35
  126. package/operations/entry/dataLoader/index.js.map +1 -1
  127. package/operations/entry/dataLoader/types.d.ts +4 -4
  128. package/operations/entry/dataLoader/types.js +0 -7
  129. package/operations/entry/dataLoaders.d.ts +14 -14
  130. package/operations/entry/dataLoaders.js +92 -110
  131. package/operations/entry/dataLoaders.js.map +1 -1
  132. package/operations/entry/feature.d.ts +4 -0
  133. package/operations/entry/feature.js +53 -0
  134. package/operations/entry/feature.js.map +1 -0
  135. package/operations/entry/keys.d.ts +31 -1
  136. package/operations/entry/keys.js +44 -27
  137. package/operations/entry/keys.js.map +1 -1
  138. package/operations/entry/recordType.js +4 -18
  139. package/operations/entry/recordType.js.map +1 -1
  140. package/operations/entry/storageEntryUtils.d.ts +7 -0
  141. package/operations/entry/storageEntryUtils.js +14 -0
  142. package/operations/entry/storageEntryUtils.js.map +1 -0
  143. package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
  144. package/operations/entry/transformations/convertEntryKeys.js +21 -34
  145. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  146. package/operations/entry/transformations/index.d.ts +21 -18
  147. package/operations/entry/transformations/index.js +87 -123
  148. package/operations/entry/transformations/index.js.map +1 -1
  149. package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
  150. package/operations/entry/transformations/modifyEntryValues.js +12 -24
  151. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  152. package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
  153. package/operations/entry/transformations/transformEntryKeys.js +14 -24
  154. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  155. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  156. package/operations/group/DdbEsCreateGroup.js +35 -0
  157. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  158. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  159. package/operations/group/DdbEsDeleteGroup.js +31 -0
  160. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  161. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  162. package/operations/group/DdbEsGetGroup.js +31 -0
  163. package/operations/group/DdbEsGetGroup.js.map +1 -0
  164. package/operations/group/DdbEsListGroups.d.ts +14 -0
  165. package/operations/group/DdbEsListGroups.js +52 -0
  166. package/operations/group/DdbEsListGroups.js.map +1 -0
  167. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  168. package/operations/group/DdbEsUpdateGroup.js +35 -0
  169. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  170. package/operations/group/feature.d.ts +4 -0
  171. package/operations/group/feature.js +19 -0
  172. package/operations/group/feature.js.map +1 -0
  173. package/operations/group/keys.d.ts +15 -0
  174. package/operations/group/keys.js +17 -0
  175. package/operations/group/keys.js.map +1 -0
  176. package/operations/model/DdbEsCreateModel.d.ts +16 -0
  177. package/operations/model/DdbEsCreateModel.js +56 -0
  178. package/operations/model/DdbEsCreateModel.js.map +1 -0
  179. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  180. package/operations/model/DdbEsDeleteModel.js +31 -0
  181. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  182. package/operations/model/DdbEsGetModel.d.ts +12 -0
  183. package/operations/model/DdbEsGetModel.js +30 -0
  184. package/operations/model/DdbEsGetModel.js.map +1 -0
  185. package/operations/model/DdbEsListModels.d.ts +12 -0
  186. package/operations/model/DdbEsListModels.js +36 -0
  187. package/operations/model/DdbEsListModels.js.map +1 -0
  188. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  189. package/operations/model/DdbEsUpdateModel.js +36 -0
  190. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  191. package/operations/model/feature.d.ts +4 -0
  192. package/operations/model/feature.js +19 -0
  193. package/operations/model/feature.js.map +1 -0
  194. package/operations/model/keys.d.ts +15 -0
  195. package/operations/model/keys.js +17 -0
  196. package/operations/model/keys.js.map +1 -0
  197. package/package.json +40 -36
  198. package/requestFeature.d.ts +20 -0
  199. package/requestFeature.js +54 -0
  200. package/requestFeature.js.map +1 -0
  201. package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
  202. package/tasks/CreateElasticsearchIndexTask.js +40 -0
  203. package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
  204. package/types.d.ts +12 -159
  205. package/types.js +7 -39
  206. package/types.js.map +1 -1
  207. package/configurations.d.ts +0 -19
  208. package/configurations.js +0 -49
  209. package/configurations.js.map +0 -1
  210. package/definitions/entryElasticsearch.d.ts +0 -9
  211. package/definitions/entryElasticsearch.js +0 -41
  212. package/definitions/entryElasticsearch.js.map +0 -1
  213. package/definitions/system.d.ts +0 -9
  214. package/definitions/system.js +0 -42
  215. package/definitions/system.js.map +0 -1
  216. package/definitions/table.d.ts +0 -8
  217. package/definitions/table.js +0 -25
  218. package/definitions/table.js.map +0 -1
  219. package/definitions/tableElasticsearch.d.ts +0 -8
  220. package/definitions/tableElasticsearch.js +0 -25
  221. package/definitions/tableElasticsearch.js.map +0 -1
  222. package/dynamoDb/index.d.ts +0 -3
  223. package/dynamoDb/index.js +0 -16
  224. package/dynamoDb/index.js.map +0 -1
  225. package/dynamoDb/storage/longText.d.ts +0 -10
  226. package/dynamoDb/storage/longText.js +0 -96
  227. package/dynamoDb/storage/longText.js.map +0 -1
  228. package/dynamoDb/storage/richText.d.ts +0 -2
  229. package/dynamoDb/storage/richText.js +0 -59
  230. package/dynamoDb/storage/richText.js.map +0 -1
  231. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  232. package/elasticsearch/createElasticsearchIndex.js +0 -40
  233. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  234. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
  235. package/elasticsearch/deleteElasticsearchIndex.js +0 -38
  236. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  237. package/elasticsearch/index.d.ts +0 -2
  238. package/elasticsearch/index.js +0 -13
  239. package/elasticsearch/index.js.map +0 -1
  240. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  241. package/elasticsearch/indexing/dateTimeIndexing.js +0 -88
  242. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  243. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  244. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -54
  245. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  246. package/elasticsearch/indexing/index.d.ts +0 -2
  247. package/elasticsearch/indexing/index.js +0 -18
  248. package/elasticsearch/indexing/index.js.map +0 -1
  249. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  250. package/elasticsearch/indexing/jsonIndexing.js +0 -28
  251. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  252. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  253. package/elasticsearch/indexing/longTextIndexing.js +0 -42
  254. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  255. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  256. package/elasticsearch/indexing/numberIndexing.js +0 -41
  257. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  258. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  259. package/elasticsearch/indexing/objectIndexing.js +0 -201
  260. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  261. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  262. package/elasticsearch/indexing/richTextIndexing.js +0 -31
  263. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  264. package/elasticsearch/indices/base.d.ts +0 -2
  265. package/elasticsearch/indices/base.js +0 -13
  266. package/elasticsearch/indices/base.js.map +0 -1
  267. package/elasticsearch/indices/index.d.ts +0 -1
  268. package/elasticsearch/indices/index.js +0 -14
  269. package/elasticsearch/indices/index.js.map +0 -1
  270. package/elasticsearch/indices/japanese.d.ts +0 -2
  271. package/elasticsearch/indices/japanese.js +0 -14
  272. package/elasticsearch/indices/japanese.js.map +0 -1
  273. package/elasticsearch/search/index.d.ts +0 -3
  274. package/elasticsearch/search/index.js +0 -13
  275. package/elasticsearch/search/index.js.map +0 -1
  276. package/elasticsearch/search/refSearch.d.ts +0 -2
  277. package/elasticsearch/search/refSearch.js +0 -31
  278. package/elasticsearch/search/refSearch.js.map +0 -1
  279. package/elasticsearch/search/searchableJson.d.ts +0 -2
  280. package/elasticsearch/search/searchableJson.js +0 -60
  281. package/elasticsearch/search/searchableJson.js.map +0 -1
  282. package/elasticsearch/search/timeSearch.d.ts +0 -2
  283. package/elasticsearch/search/timeSearch.js +0 -27
  284. package/elasticsearch/search/timeSearch.js.map +0 -1
  285. package/helpers/entryIndexHelpers.d.ts +0 -18
  286. package/helpers/entryIndexHelpers.js +0 -190
  287. package/helpers/entryIndexHelpers.js.map +0 -1
  288. package/helpers/fieldIdentifier.d.ts +0 -6
  289. package/helpers/fieldIdentifier.js +0 -43
  290. package/helpers/fieldIdentifier.js.map +0 -1
  291. package/helpers/index.d.ts +0 -2
  292. package/helpers/index.js +0 -29
  293. package/helpers/index.js.map +0 -1
  294. package/index.js.map +0 -1
  295. package/operations/entry/dataLoader/types.js.map +0 -1
  296. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  297. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -34
  298. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  299. package/operations/entry/elasticsearch/body.d.ts +0 -13
  300. package/operations/entry/elasticsearch/body.js +0 -142
  301. package/operations/entry/elasticsearch/body.js.map +0 -1
  302. package/operations/entry/elasticsearch/fields.d.ts +0 -10
  303. package/operations/entry/elasticsearch/fields.js +0 -315
  304. package/operations/entry/elasticsearch/fields.js.map +0 -1
  305. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
  306. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -60
  307. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  308. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -17
  309. package/operations/entry/elasticsearch/filtering/exec.js +0 -175
  310. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  311. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  312. package/operations/entry/elasticsearch/filtering/index.js +0 -18
  313. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  314. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -16
  315. package/operations/entry/elasticsearch/filtering/path.js +0 -48
  316. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  317. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  318. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -30
  319. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  320. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  321. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -15
  322. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  323. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  324. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -69
  325. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  326. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  327. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -57
  328. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  329. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  330. package/operations/entry/elasticsearch/filtering/populated.js +0 -25
  331. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  332. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  333. package/operations/entry/elasticsearch/filtering/values.js +0 -24
  334. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  335. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
  336. package/operations/entry/elasticsearch/fullTextSearch.js +0 -91
  337. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  338. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  339. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -27
  340. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  341. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
  342. package/operations/entry/elasticsearch/initialQuery.js +0 -106
  343. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  344. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  345. package/operations/entry/elasticsearch/keyword.js +0 -36
  346. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  347. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
  348. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
  349. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
  350. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  351. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -18
  352. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  353. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -8
  354. package/operations/entry/elasticsearch/plugins/operator.js +0 -39
  355. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  356. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  357. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -18
  358. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  359. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  360. package/operations/entry/elasticsearch/plugins/search.js +0 -26
  361. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  362. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  363. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -18
  364. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  365. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  366. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -13
  367. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  368. package/operations/entry/elasticsearch/sort.d.ts +0 -12
  369. package/operations/entry/elasticsearch/sort.js +0 -89
  370. package/operations/entry/elasticsearch/sort.js.map +0 -1
  371. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
  372. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -32
  373. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  374. package/operations/entry/elasticsearch/types.d.ts +0 -41
  375. package/operations/entry/elasticsearch/types.js +0 -7
  376. package/operations/entry/elasticsearch/types.js.map +0 -1
  377. package/operations/entry/index.d.ts +0 -11
  378. package/operations/entry/index.js +0 -1881
  379. package/operations/entry/index.js.map +0 -1
  380. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
  381. package/operations/entry/transformations/transformEntryToIndex.js +0 -31
  382. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  383. package/operations/group/index.d.ts +0 -8
  384. package/operations/group/index.js +0 -179
  385. package/operations/group/index.js.map +0 -1
  386. package/operations/model/index.d.ts +0 -8
  387. package/operations/model/index.js +0 -183
  388. package/operations/model/index.js.map +0 -1
  389. package/operations/system/index.d.ts +0 -6
  390. package/operations/system/index.js +0 -94
  391. package/operations/system/index.js.map +0 -1
  392. package/operations/system/indexes.d.ts +0 -10
  393. package/operations/system/indexes.js +0 -41
  394. package/operations/system/indexes.js.map +0 -1
  395. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  396. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -52
  397. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  398. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  399. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -21
  400. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  401. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  402. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -27
  403. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  404. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  405. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -13
  406. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  407. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  408. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -40
  409. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  410. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  411. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -21
  412. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  413. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  414. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -21
  415. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  416. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  417. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -50
  418. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  419. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  420. package/plugins/CmsEntryFilterPlugin.js +0 -22
  421. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  422. package/plugins/index.d.ts +0 -8
  423. package/plugins/index.js +0 -95
  424. package/plugins/index.js.map +0 -1
  425. package/tasks/createIndexTaskPlugin.d.ts +0 -2
  426. package/tasks/createIndexTaskPlugin.js +0 -67
  427. package/tasks/createIndexTaskPlugin.js.map +0 -1
  428. package/values/NoValueContainer.d.ts +0 -5
  429. package/values/NoValueContainer.js +0 -20
  430. package/values/NoValueContainer.js.map +0 -1
@@ -1,175 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createExecFiltering = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _search = require("../plugins/search");
10
- var _operator = require("../plugins/operator");
11
- var _initialQuery = require("../initialQuery");
12
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
13
- var _values = require("./values");
14
- var _populated = require("./populated");
15
- var _applyFiltering = require("./applyFiltering");
16
- var _CmsEntryFilterPlugin = require("../../../../plugins/CmsEntryFilterPlugin");
17
- var _assignMinimumShouldMatchToQuery = require("../assignMinimumShouldMatchToQuery");
18
- const createExecFiltering = params => {
19
- const {
20
- fields,
21
- plugins,
22
- model
23
- } = params;
24
-
25
- /**
26
- * We need the search plugins as key -> plugin value, so it is easy to find plugin we need, without iterating through array.
27
- */
28
- const searchPlugins = (0, _search.createSearchPluginList)({
29
- plugins
30
- });
31
- /**
32
- * We need the operator plugins, which we execute on our where conditions.
33
- */
34
- const operatorPlugins = (0, _operator.createOperatorPluginList)({
35
- plugins,
36
- locale: model.locale
37
- });
38
- const applyFiltering = (0, _applyFiltering.createApplyFiltering)({
39
- operatorPlugins,
40
- searchPlugins
41
- });
42
- const filteringPlugins = plugins.byType(_CmsEntryFilterPlugin.CmsEntryFilterPlugin.type).reduce((collection, plugin) => {
43
- collection[plugin.fieldType] = plugin;
44
- return collection;
45
- }, {});
46
- const getFilterPlugin = type => {
47
- const plugin = filteringPlugins[type] || filteringPlugins["*"];
48
- if (plugin) {
49
- return plugin;
50
- }
51
- throw new _error.default(`There is no filtering plugin for the given field type "${type}".`, "FILTERING_PLUGIN_ERROR", {
52
- type
53
- });
54
- };
55
- const execFiltering = params => {
56
- const {
57
- where: initialWhere,
58
- query
59
- } = params;
60
- /**
61
- * No point in continuing if no "where" conditions exist.
62
- */
63
- const keys = Object.keys(initialWhere);
64
- if (keys.length === 0) {
65
- return;
66
- }
67
- const where = {
68
- ...initialWhere
69
- };
70
- for (const key in where) {
71
- const value = where[key];
72
- /**
73
- * We always skip if no value is defined.
74
- * Only skip undefined value, null is valid.
75
- */
76
- if (value === undefined) {
77
- continue;
78
- }
79
- //
80
- /**
81
- * When we are running with AND, the "value" MUST be an array.
82
- */else if (key === "AND") {
83
- const childWhereList = (0, _values.getWhereValues)(value, "AND");
84
- const childQuery = (0, _initialQuery.createBaseQuery)();
85
- for (const childWhere of childWhereList) {
86
- execFiltering({
87
- query: childQuery,
88
- where: childWhere
89
- });
90
- }
91
- const childQueryBool = (0, _populated.getPopulated)(childQuery);
92
- if (Object.keys(childQueryBool).length === 0) {
93
- continue;
94
- }
95
- query.filter.push({
96
- bool: childQueryBool
97
- });
98
- continue;
99
- }
100
- //
101
- /**
102
- * When we are running with OR, the "value" must be an array.
103
- */else if (key === "OR") {
104
- const childWhereList = (0, _values.getWhereValues)(value, "OR");
105
- /**
106
- * Each of the conditions MUST produce it's own should section.
107
- */
108
- const should = [];
109
- for (const childWhere of childWhereList) {
110
- const childQuery = (0, _initialQuery.createBaseQuery)();
111
- execFiltering({
112
- query: childQuery,
113
- where: childWhere
114
- });
115
- const childQueryBool = (0, _populated.getPopulated)(childQuery);
116
- if (Object.keys(childQueryBool).length === 0) {
117
- continue;
118
- }
119
- should.push({
120
- bool: childQueryBool
121
- });
122
- }
123
- if (should.length === 0) {
124
- continue;
125
- }
126
- query.should.push(...should);
127
- /**
128
- * If there are any should, minimum to have is 1.
129
- * Of course, do not override if it's already set.
130
- */
131
- (0, _assignMinimumShouldMatchToQuery.assignMinimumShouldMatchToQuery)({
132
- query
133
- });
134
- continue;
135
- }
136
- const {
137
- field: whereFieldId,
138
- operator
139
- } = (0, _apiElasticsearch.parseWhereKey)(key);
140
- let fieldId = whereFieldId;
141
-
142
- /**
143
- * TODO This will be required until the storage operations receive the fieldId instead of field storageId.
144
- * TODO For this to work without field searching, we need to refactor how the query looks like.
145
- *
146
- * Storage operations should NEVER receive an field storageId, only alias - fieldId.
147
- */
148
- const cmsModelField = model.fields.find(f => f.fieldId === fieldId);
149
- if (!cmsModelField && !fields[fieldId]) {
150
- throw new _error.default(`There is no CMS Model Field "${fieldId}".`);
151
- } else if (cmsModelField) {
152
- fieldId = cmsModelField.fieldId;
153
- }
154
- const field = fields[fieldId];
155
- if (!field) {
156
- throw new _error.default(`There is no field "${fieldId}".`, "EXEC_FILTERING_ERROR");
157
- }
158
- const filterPlugin = getFilterPlugin(field.type);
159
- filterPlugin.exec({
160
- applyFiltering,
161
- getFilterPlugin,
162
- key,
163
- value,
164
- operator,
165
- field,
166
- fields,
167
- query
168
- });
169
- }
170
- };
171
- return execFiltering;
172
- };
173
- exports.createExecFiltering = createExecFiltering;
174
-
175
- //# sourceMappingURL=exec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_search","_operator","_initialQuery","_apiElasticsearch","_values","_populated","_applyFiltering","_CmsEntryFilterPlugin","_assignMinimumShouldMatchToQuery","createExecFiltering","params","fields","plugins","model","searchPlugins","createSearchPluginList","operatorPlugins","createOperatorPluginList","locale","applyFiltering","createApplyFiltering","filteringPlugins","byType","CmsEntryFilterPlugin","type","reduce","collection","plugin","fieldType","getFilterPlugin","WebinyError","execFiltering","where","initialWhere","query","keys","Object","length","key","value","undefined","childWhereList","getWhereValues","childQuery","createBaseQuery","childWhere","childQueryBool","getPopulated","filter","push","bool","should","assignMinimumShouldMatchToQuery","field","whereFieldId","operator","parseWhereKey","fieldId","cmsModelField","find","f","filterPlugin","exec","exports"],"sources":["exec.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { CmsEntryListWhere, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport type { ModelFields } from \"~/operations/entry/elasticsearch/types\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { ElasticsearchBoolQueryConfig, Query } from \"@webiny/api-elasticsearch/types\";\nimport { createSearchPluginList } from \"~/operations/entry/elasticsearch/plugins/search\";\nimport { createOperatorPluginList } from \"~/operations/entry/elasticsearch/plugins/operator\";\nimport { createBaseQuery } from \"~/operations/entry/elasticsearch/initialQuery\";\nimport { parseWhereKey } from \"@webiny/api-elasticsearch\";\nimport { getWhereValues } from \"./values\";\nimport { getPopulated } from \"./populated\";\nimport { createApplyFiltering } from \"./applyFiltering\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\nimport { assignMinimumShouldMatchToQuery } from \"~/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery\";\n\nexport interface CreateExecParams {\n model: CmsModel;\n fields: ModelFields;\n plugins: PluginsContainer;\n}\nexport interface ExecParams {\n where: CmsEntryListWhere;\n query: ElasticsearchBoolQueryConfig;\n}\nexport interface CreateExecFilteringResponse {\n (params: ExecParams): void;\n}\nexport const createExecFiltering = (params: CreateExecParams): CreateExecFilteringResponse => {\n const { fields, plugins, model } = params;\n\n /**\n * We need the search plugins as key -> plugin value, so it is easy to find plugin we need, without iterating through array.\n */\n const searchPlugins = createSearchPluginList({\n plugins\n });\n /**\n * We need the operator plugins, which we execute on our where conditions.\n */\n const operatorPlugins = createOperatorPluginList({\n plugins,\n locale: model.locale\n });\n\n const applyFiltering = createApplyFiltering({\n operatorPlugins,\n searchPlugins\n });\n\n const filteringPlugins = plugins\n .byType<CmsEntryFilterPlugin>(CmsEntryFilterPlugin.type)\n .reduce<Record<string, CmsEntryFilterPlugin>>((collection, plugin) => {\n collection[plugin.fieldType] = plugin;\n\n return collection;\n }, {});\n\n const getFilterPlugin = (type: string) => {\n const plugin = filteringPlugins[type] || filteringPlugins[\"*\"];\n if (plugin) {\n return plugin;\n }\n throw new WebinyError(\n `There is no filtering plugin for the given field type \"${type}\".`,\n \"FILTERING_PLUGIN_ERROR\",\n {\n type\n }\n );\n };\n\n const execFiltering = (params: ExecParams) => {\n const { where: initialWhere, query } = params;\n /**\n * No point in continuing if no \"where\" conditions exist.\n */\n const keys = Object.keys(initialWhere);\n if (keys.length === 0) {\n return;\n }\n const where: CmsEntryListWhere = {\n ...initialWhere\n };\n\n for (const key in where) {\n const value = where[key];\n /**\n * We always skip if no value is defined.\n * Only skip undefined value, null is valid.\n */\n if (value === undefined) {\n continue;\n }\n //\n /**\n * When we are running with AND, the \"value\" MUST be an array.\n */\n else if (key === \"AND\") {\n const childWhereList = getWhereValues(value, \"AND\");\n\n const childQuery = createBaseQuery();\n\n for (const childWhere of childWhereList) {\n execFiltering({\n query: childQuery,\n where: childWhere\n });\n }\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n query.filter.push({\n bool: childQueryBool\n });\n\n continue;\n }\n //\n /**\n * When we are running with OR, the \"value\" must be an array.\n */\n else if (key === \"OR\") {\n const childWhereList = getWhereValues(value, \"OR\");\n /**\n * Each of the conditions MUST produce it's own should section.\n */\n const should: Query[] = [];\n for (const childWhere of childWhereList) {\n const childQuery = createBaseQuery();\n execFiltering({\n query: childQuery,\n where: childWhere\n });\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n should.push({\n bool: childQueryBool\n });\n }\n if (should.length === 0) {\n continue;\n }\n query.should.push(...should);\n /**\n * If there are any should, minimum to have is 1.\n * Of course, do not override if it's already set.\n */\n assignMinimumShouldMatchToQuery({\n query\n });\n continue;\n }\n const { field: whereFieldId, operator } = parseWhereKey(key);\n\n let fieldId: string = whereFieldId;\n\n /**\n * TODO This will be required until the storage operations receive the fieldId instead of field storageId.\n * TODO For this to work without field searching, we need to refactor how the query looks like.\n *\n * Storage operations should NEVER receive an field storageId, only alias - fieldId.\n */\n const cmsModelField = model.fields.find(f => f.fieldId === fieldId);\n if (!cmsModelField && !fields[fieldId]) {\n throw new WebinyError(`There is no CMS Model Field \"${fieldId}\".`);\n } else if (cmsModelField) {\n fieldId = cmsModelField.fieldId;\n }\n\n const field = fields[fieldId];\n if (!field) {\n throw new WebinyError(`There is no field \"${fieldId}\".`, \"EXEC_FILTERING_ERROR\");\n }\n const filterPlugin = getFilterPlugin(field.type);\n\n filterPlugin.exec({\n applyFiltering,\n getFilterPlugin,\n key,\n value,\n operator,\n field,\n fields,\n query\n });\n }\n };\n\n return execFiltering;\n};\n"],"mappings":"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","ignoreList":[]}
@@ -1 +0,0 @@
1
- export * from "./exec";
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exec = require("./exec");
7
- Object.keys(_exec).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _exec[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _exec[key];
14
- }
15
- });
16
- });
17
-
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_exec","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from \"./exec\";\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import type { ElasticsearchQuerySearchValuePlugins, ModelField } from "../types";
2
- interface FieldPathFactoryParams {
3
- plugins: ElasticsearchQuerySearchValuePlugins;
4
- }
5
- interface FieldPathParams {
6
- field: ModelField;
7
- key: string;
8
- value: any;
9
- originalValue: any;
10
- keyword: boolean;
11
- }
12
- export declare const createFieldPathFactory: ({ plugins }: FieldPathFactoryParams) => (params: FieldPathParams) => {
13
- basePath: string;
14
- path: string;
15
- };
16
- export {};
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFieldPathFactory = void 0;
7
- const createFieldPathFactory = ({
8
- plugins
9
- }) => {
10
- return params => {
11
- const {
12
- field,
13
- key,
14
- value,
15
- keyword,
16
- originalValue
17
- } = params;
18
- const plugin = plugins[field.type];
19
- let fieldPath = null;
20
- if (plugin) {
21
- fieldPath = plugin.createPath({
22
- field: field.field,
23
- value,
24
- key,
25
- originalValue
26
- });
27
- }
28
- if (!fieldPath) {
29
- fieldPath = field.field.storageId;
30
- if (field.path) {
31
- fieldPath = typeof field.path === "function" ? field.path(value) : field.path;
32
- }
33
- }
34
- const result = [];
35
- if (!field.systemField) {
36
- result.push("values");
37
- }
38
- result.push(...field.parents.map(p => p.storageId));
39
- result.push(fieldPath);
40
- return {
41
- basePath: result.join("."),
42
- path: result.concat(keyword ? ["keyword"] : []).join(".")
43
- };
44
- };
45
- };
46
- exports.createFieldPathFactory = createFieldPathFactory;
47
-
48
- //# sourceMappingURL=path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createFieldPathFactory","plugins","params","field","key","value","keyword","originalValue","plugin","type","fieldPath","createPath","storageId","path","result","systemField","push","parents","map","p","basePath","join","concat","exports"],"sources":["path.ts"],"sourcesContent":["import type {\n ElasticsearchQuerySearchValuePlugins,\n ModelField\n} from \"~/operations/entry/elasticsearch/types\";\n\ninterface FieldPathFactoryParams {\n plugins: ElasticsearchQuerySearchValuePlugins;\n}\ninterface FieldPathParams {\n field: ModelField;\n key: string;\n value: any;\n originalValue: any;\n keyword: boolean;\n}\n\nexport const createFieldPathFactory = ({ plugins }: FieldPathFactoryParams) => {\n return (params: FieldPathParams) => {\n const { field, key, value, keyword, originalValue } = params;\n const plugin = plugins[field.type];\n\n let fieldPath: string | null = null;\n if (plugin) {\n fieldPath = plugin.createPath({ field: field.field, value, key, originalValue });\n }\n if (!fieldPath) {\n fieldPath = field.field.storageId;\n if (field.path) {\n fieldPath = typeof field.path === \"function\" ? field.path(value) : field.path;\n }\n }\n\n const result: string[] = [];\n if (!field.systemField) {\n result.push(\"values\");\n }\n result.push(...field.parents.map(p => p.storageId));\n result.push(fieldPath);\n\n return {\n basePath: result.join(\".\"),\n path: result.concat(keyword ? [\"keyword\"] : []).join(\".\")\n };\n };\n};\n"],"mappings":";;;;;;AAgBO,MAAMA,sBAAsB,GAAGA,CAAC;EAAEC;AAAgC,CAAC,KAAK;EAC3E,OAAQC,MAAuB,IAAK;IAChC,MAAM;MAAEC,KAAK;MAAEC,GAAG;MAAEC,KAAK;MAAEC,OAAO;MAAEC;IAAc,CAAC,GAAGL,MAAM;IAC5D,MAAMM,MAAM,GAAGP,OAAO,CAACE,KAAK,CAACM,IAAI,CAAC;IAElC,IAAIC,SAAwB,GAAG,IAAI;IACnC,IAAIF,MAAM,EAAE;MACRE,SAAS,GAAGF,MAAM,CAACG,UAAU,CAAC;QAAER,KAAK,EAAEA,KAAK,CAACA,KAAK;QAAEE,KAAK;QAAED,GAAG;QAAEG;MAAc,CAAC,CAAC;IACpF;IACA,IAAI,CAACG,SAAS,EAAE;MACZA,SAAS,GAAGP,KAAK,CAACA,KAAK,CAACS,SAAS;MACjC,IAAIT,KAAK,CAACU,IAAI,EAAE;QACZH,SAAS,GAAG,OAAOP,KAAK,CAACU,IAAI,KAAK,UAAU,GAAGV,KAAK,CAACU,IAAI,CAACR,KAAK,CAAC,GAAGF,KAAK,CAACU,IAAI;MACjF;IACJ;IAEA,MAAMC,MAAgB,GAAG,EAAE;IAC3B,IAAI,CAACX,KAAK,CAACY,WAAW,EAAE;MACpBD,MAAM,CAACE,IAAI,CAAC,QAAQ,CAAC;IACzB;IACAF,MAAM,CAACE,IAAI,CAAC,GAAGb,KAAK,CAACc,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACP,SAAS,CAAC,CAAC;IACnDE,MAAM,CAACE,IAAI,CAACN,SAAS,CAAC;IAEtB,OAAO;MACHU,QAAQ,EAAEN,MAAM,CAACO,IAAI,CAAC,GAAG,CAAC;MAC1BR,IAAI,EAAEC,MAAM,CAACQ,MAAM,CAAChB,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAACe,IAAI,CAAC,GAAG;IAC5D,CAAC;EACL,CAAC;AACL,CAAC;AAACE,OAAA,CAAAvB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin";
2
- export declare const createDefaultFilterPlugin: () => CmsEntryFilterPlugin;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createDefaultFilterPlugin = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _CmsEntryFilterPlugin = require("../../../../../plugins/CmsEntryFilterPlugin");
10
- const createDefaultFilterPlugin = () => {
11
- const plugin = new _CmsEntryFilterPlugin.CmsEntryFilterPlugin({
12
- fieldType: _CmsEntryFilterPlugin.CmsEntryFilterPlugin.ALL,
13
- exec: params => {
14
- const {
15
- applyFiltering,
16
- field
17
- } = params;
18
- if (!params.field.searchable) {
19
- const identifier = [...field.parents.map(p => p.fieldId), field.field.fieldId].join(".");
20
- throw new _error.default(`Field "${identifier}" is not searchable.`);
21
- }
22
- applyFiltering(params);
23
- }
24
- });
25
- plugin.name = `${plugin.type}.default.all`;
26
- return plugin;
27
- };
28
- exports.createDefaultFilterPlugin = createDefaultFilterPlugin;
29
-
30
- //# sourceMappingURL=defaultFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_CmsEntryFilterPlugin","createDefaultFilterPlugin","plugin","CmsEntryFilterPlugin","fieldType","ALL","exec","params","applyFiltering","field","searchable","identifier","parents","map","p","fieldId","join","WebinyError","name","type","exports"],"sources":["defaultFilterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,MAAM,GAAG,IAAIC,0CAAoB,CAAC;IACpCC,SAAS,EAAED,0CAAoB,CAACE,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,IAAIC,cAAW,CAAC,UAAUN,UAAU,sBAAsB,CAAC;MACrE;MACAH,cAAc,CAACD,MAAM,CAAC;IAC1B;EACJ,CAAC,CAAC;EAEFL,MAAM,CAACgB,IAAI,GAAG,GAAGhB,MAAM,CAACiB,IAAI,cAAc;EAE1C,OAAOjB,MAAM;AACjB,CAAC;AAACkB,OAAA,CAAAnB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- export declare const createFilterPlugins: () => import("../../../../../plugins/CmsEntryFilterPlugin").CmsEntryFilterPlugin[];
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFilterPlugins = void 0;
7
- var _defaultFilterPlugin = require("./defaultFilterPlugin");
8
- var _objectFilterPlugin = require("./objectFilterPlugin");
9
- var _refFilterPlugin = require("./refFilterPlugin");
10
- const createFilterPlugins = () => {
11
- return [(0, _defaultFilterPlugin.createDefaultFilterPlugin)(), (0, _objectFilterPlugin.createObjectFilterPlugin)(), (0, _refFilterPlugin.createRefFilterPlugin)()];
12
- };
13
- exports.createFilterPlugins = createFilterPlugins;
14
-
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_defaultFilterPlugin","require","_objectFilterPlugin","_refFilterPlugin","createFilterPlugins","createDefaultFilterPlugin","createObjectFilterPlugin","createRefFilterPlugin","exports"],"sources":["index.ts"],"sourcesContent":["import { createDefaultFilterPlugin } from \"./defaultFilterPlugin\";\nimport { createObjectFilterPlugin } from \"./objectFilterPlugin\";\nimport { createRefFilterPlugin } from \"./refFilterPlugin\";\n\nexport const createFilterPlugins = () => {\n return [createDefaultFilterPlugin(), createObjectFilterPlugin(), createRefFilterPlugin()];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AAEO,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EACrC,OAAO,CAAC,IAAAC,8CAAyB,EAAC,CAAC,EAAE,IAAAC,4CAAwB,EAAC,CAAC,EAAE,IAAAC,sCAAqB,EAAC,CAAC,CAAC;AAC7F,CAAC;AAACC,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin";
2
- export declare const createObjectFilterPlugin: () => CmsEntryFilterPlugin;
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createObjectFilterPlugin = void 0;
8
- var _CmsEntryFilterPlugin = require("../../../../../plugins/CmsEntryFilterPlugin");
9
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
10
- var _error = _interopRequireDefault(require("@webiny/error"));
11
- const createObjectFilterPlugin = () => {
12
- const plugin = new _CmsEntryFilterPlugin.CmsEntryFilterPlugin({
13
- fieldType: "object",
14
- exec: params => {
15
- const {
16
- applyFiltering,
17
- value: where,
18
- fields,
19
- field: parentField,
20
- getFilterPlugin,
21
- query
22
- } = params;
23
- /**
24
- * Because this is an object field, we must construct filters based on the value property.
25
- * Value property is actually a where condition.
26
- */
27
- for (const key in where) {
28
- const value = where[key];
29
- if (value === undefined) {
30
- continue;
31
- }
32
- const {
33
- field: whereFieldId,
34
- operator
35
- } = (0, _apiElasticsearch.parseWhereKey)(key);
36
- const identifier = [...parentField.parents.map(p => p.fieldId), parentField.field.fieldId, whereFieldId].join(".");
37
- const field = fields[identifier];
38
- if (!field) {
39
- throw new _error.default(`There is no field "${identifier}".`, "OBJECT_FILTER_FIELD_ERROR", {
40
- fields: Object.keys(fields)
41
- });
42
- }
43
- /**
44
- * We need to find the filter plugin for the child field.
45
- * This will throw error if no plugin can be found.
46
- */
47
- const plugin = getFilterPlugin(field.type);
48
- /**
49
- * Basically this allows us to go into depth as much as we want with the object fields.
50
- */
51
- plugin.exec({
52
- applyFiltering,
53
- getFilterPlugin,
54
- key,
55
- value,
56
- operator,
57
- field,
58
- fields,
59
- query
60
- });
61
- }
62
- }
63
- });
64
- plugin.name = `${plugin.type}.default.object`;
65
- return plugin;
66
- };
67
- exports.createObjectFilterPlugin = createObjectFilterPlugin;
68
-
69
- //# sourceMappingURL=objectFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_CmsEntryFilterPlugin","require","_apiElasticsearch","_error","_interopRequireDefault","createObjectFilterPlugin","plugin","CmsEntryFilterPlugin","fieldType","exec","params","applyFiltering","value","where","fields","field","parentField","getFilterPlugin","query","key","undefined","whereFieldId","operator","parseWhereKey","identifier","parents","map","p","fieldId","join","WebinyError","Object","keys","type","name","exports"],"sources":["objectFilterPlugin.ts"],"sourcesContent":["import { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\nimport { parseWhereKey } from \"@webiny/api-elasticsearch\";\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,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEO,MAAMI,wBAAwB,GAAGA,CAAA,KAAM;EAC1C,MAAMC,MAAM,GAAG,IAAIC,0CAAoB,CAAC;IACpCC,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,GAAG,IAAAC,+BAAa,EAACJ,GAAG,CAAC;QAE5D,MAAMK,UAAU,GAAG,CACf,GAAGR,WAAW,CAACS,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,CAAC,EAC1CZ,WAAW,CAACD,KAAK,CAACa,OAAO,EACzBP,YAAY,CACf,CAACQ,IAAI,CAAC,GAAG,CAAC;QACX,MAAMd,KAAK,GAAGD,MAAM,CAACU,UAAU,CAAC;QAChC,IAAI,CAACT,KAAK,EAAE;UACR,MAAM,IAAIe,cAAW,CACjB,sBAAsBN,UAAU,IAAI,EACpC,2BAA2B,EAC3B;YACIV,MAAM,EAAEiB,MAAM,CAACC,IAAI,CAAClB,MAAM;UAC9B,CACJ,CAAC;QACL;QACA;AAChB;AACA;AACA;QACgB,MAAMR,MAAM,GAAGW,eAAe,CAACF,KAAK,CAACkB,IAAI,CAAC;QAC1C;AAChB;AACA;QACgB3B,MAAM,CAACG,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;EAEFZ,MAAM,CAAC4B,IAAI,GAAG,GAAG5B,MAAM,CAAC2B,IAAI,iBAAiB;EAE7C,OAAO3B,MAAM;AACjB,CAAC;AAAC6B,OAAA,CAAA9B,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin";
2
- export declare const createRefFilterPlugin: () => CmsEntryFilterPlugin;
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createRefFilterPlugin = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _CmsEntryFilterPlugin = require("../../../../../plugins/CmsEntryFilterPlugin");
10
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
11
- const createRefFilterPlugin = () => {
12
- const plugin = new _CmsEntryFilterPlugin.CmsEntryFilterPlugin({
13
- fieldType: "ref",
14
- exec: params => {
15
- const {
16
- applyFiltering,
17
- query,
18
- field
19
- } = params;
20
- let values = params.value;
21
- /**
22
- * We must have an object when querying in the ref field.
23
- */
24
- if (typeof values !== "object") {
25
- throw new _error.default(`When querying by ref field, value of the field must be an object.`, "OBJECT_REQUIRED", {
26
- value: values
27
- });
28
- }
29
- if (values === null || values === undefined) {
30
- values = {
31
- entryId: null
32
- };
33
- }
34
- for (const key in values) {
35
- const {
36
- operator
37
- } = (0, _apiElasticsearch.parseWhereKey)(key);
38
- const value = values[key];
39
- if (value === undefined) {
40
- continue;
41
- }
42
- applyFiltering({
43
- query,
44
- field,
45
- operator,
46
- key,
47
- value
48
- });
49
- }
50
- }
51
- });
52
- plugin.name = `${plugin.type}.default.ref`;
53
- return plugin;
54
- };
55
- exports.createRefFilterPlugin = createRefFilterPlugin;
56
-
57
- //# sourceMappingURL=refFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_CmsEntryFilterPlugin","_apiElasticsearch","createRefFilterPlugin","plugin","CmsEntryFilterPlugin","fieldType","exec","params","applyFiltering","query","field","values","value","WebinyError","undefined","entryId","key","operator","parseWhereKey","name","type","exports"],"sources":["refFilterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\nimport { parseWhereKey } from \"@webiny/api-elasticsearch\";\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEO,MAAMG,qBAAqB,GAAGA,CAAA,KAAM;EACvC,MAAMC,MAAM,GAAG,IAAIC,0CAAoB,CAAC;IACpCC,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,IAAIE,cAAW,CACjB,mEAAmE,EACnE,iBAAiB,EACjB;UACID,KAAK,EAAED;QACX,CACJ,CAAC;MACL;MAEA,IAAIA,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAKG,SAAS,EAAE;QACzCH,MAAM,GAAG;UACLI,OAAO,EAAE;QACb,CAAC;MACL;MAEA,KAAK,MAAMC,GAAG,IAAIL,MAAM,EAAE;QACtB,MAAM;UAAEM;QAAS,CAAC,GAAG,IAAAC,+BAAa,EAACF,GAAG,CAAC;QACvC,MAAMJ,KAAK,GAAGD,MAAM,CAACK,GAAG,CAAC;QACzB,IAAIJ,KAAK,KAAKE,SAAS,EAAE;UACrB;QACJ;QAEAN,cAAc,CAAC;UACXC,KAAK;UACLC,KAAK;UACLO,QAAQ;UACRD,GAAG;UACHJ;QACJ,CAAC,CAAC;MACN;IACJ;EACJ,CAAC,CAAC;EAEFT,MAAM,CAACgB,IAAI,GAAG,GAAGhB,MAAM,CAACiB,IAAI,cAAc;EAE1C,OAAOjB,MAAM;AACjB,CAAC;AAACkB,OAAA,CAAAnB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
2
- export declare const getPopulated: (query: ElasticsearchBoolQueryConfig) => Partial<ElasticsearchBoolQueryConfig>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPopulated = void 0;
7
- const getPopulated = query => {
8
- const result = {};
9
- let key;
10
- for (key in query) {
11
- const value = query[key];
12
- if (value === undefined || Array.isArray(value) && value.length === 0) {
13
- continue;
14
- }
15
- /**
16
- * TODO figure out better types.
17
- */
18
- // @ts-expect-error
19
- result[key] = value;
20
- }
21
- return result;
22
- };
23
- exports.getPopulated = getPopulated;
24
-
25
- //# sourceMappingURL=populated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getPopulated","query","result","key","value","undefined","Array","isArray","length","exports"],"sources":["populated.ts"],"sourcesContent":["import type { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\n\nexport const getPopulated = (\n query: ElasticsearchBoolQueryConfig\n): Partial<ElasticsearchBoolQueryConfig> => {\n const result: Partial<ElasticsearchBoolQueryConfig> = {};\n let key: keyof ElasticsearchBoolQueryConfig;\n for (key in query) {\n const value = query[key];\n if (value === undefined || (Array.isArray(value) && value.length === 0)) {\n continue;\n }\n /**\n * TODO figure out better types.\n */\n // @ts-expect-error\n result[key] = value;\n }\n return result;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,YAAY,GACrBC,KAAmC,IACK;EACxC,MAAMC,MAA6C,GAAG,CAAC,CAAC;EACxD,IAAIC,GAAuC;EAC3C,KAAKA,GAAG,IAAIF,KAAK,EAAE;IACf,MAAMG,KAAK,GAAGH,KAAK,CAACE,GAAG,CAAC;IACxB,IAAIC,KAAK,KAAKC,SAAS,IAAKC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,IAAIA,KAAK,CAACI,MAAM,KAAK,CAAE,EAAE;MACrE;IACJ;IACA;AACR;AACA;IACQ;IACAN,MAAM,CAACC,GAAG,CAAC,GAAGC,KAAK;EACvB;EACA,OAAOF,MAAM;AACjB,CAAC;AAACO,OAAA,CAAAT,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { CmsEntryListWhere } from "@webiny/api-headless-cms/types";
2
- export declare const getWhereValues: (value: unknown, condition: "AND" | "OR") => CmsEntryListWhere[];
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getWhereValues = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- const getWhereValues = (value, condition) => {
10
- const values = value;
11
- if (!Array.isArray(values)) {
12
- throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is not an array.`, `MALFORMED_${condition}_CONDITION`, {
13
- value
14
- });
15
- } else if (values.length === 0) {
16
- throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is empty array.`, `MALFORMED_${condition}_CONDITION`, {
17
- value
18
- });
19
- }
20
- return values;
21
- };
22
- exports.getWhereValues = getWhereValues;
23
-
24
- //# sourceMappingURL=values.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","getWhereValues","value","condition","values","Array","isArray","WebinyError","length","exports"],"sources":["values.ts"],"sourcesContent":["import type { CmsEntryListWhere } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\nexport const getWhereValues = (value: unknown, condition: \"AND\" | \"OR\") => {\n const values = value as CmsEntryListWhere[] | undefined;\n if (!Array.isArray(values)) {\n throw new WebinyError(\n `Trying to run filtering with \"${condition}\", but the value sent is not an array.`,\n `MALFORMED_${condition}_CONDITION`,\n {\n value\n }\n );\n } else if (values.length === 0) {\n throw new WebinyError(\n `Trying to run filtering with \"${condition}\", but the value sent is empty array.`,\n `MALFORMED_${condition}_CONDITION`,\n {\n value\n }\n );\n }\n return values;\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,MAAMC,cAAc,GAAGA,CAACC,KAAc,EAAEC,SAAuB,KAAK;EACvE,MAAMC,MAAM,GAAGF,KAAwC;EACvD,IAAI,CAACG,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IACxB,MAAM,IAAIG,cAAW,CACjB,iCAAiCJ,SAAS,wCAAwC,EAClF,aAAaA,SAAS,YAAY,EAClC;MACID;IACJ,CACJ,CAAC;EACL,CAAC,MAAM,IAAIE,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAID,cAAW,CACjB,iCAAiCJ,SAAS,uCAAuC,EACjF,aAAaA,SAAS,YAAY,EAClC;MACID;IACJ,CACJ,CAAC;EACL;EACA,OAAOE,MAAM;AACjB,CAAC;AAACK,OAAA,CAAAR,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import type { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
2
- import type { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
3
- import type { PluginsContainer } from "@webiny/plugins";
4
- interface Params {
5
- plugins: PluginsContainer;
6
- model: CmsModel;
7
- query: ElasticsearchBoolQueryConfig;
8
- term?: string;
9
- fields: CmsModelField[];
10
- }
11
- export declare const applyFullTextSearch: (params: Params) => void;
12
- export {};