@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,142 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createElasticsearchBody = void 0;
7
- var _fields = require("./fields");
8
- var _fullTextSearchFields = require("./fullTextSearchFields");
9
- var _initialQuery = require("./initialQuery");
10
- var _fullTextSearch = require("./fullTextSearch");
11
- var _queryModifier = require("./plugins/queryModifier");
12
- var _sortModifier = require("./plugins/sortModifier");
13
- var _bodyModifier = require("./plugins/bodyModifier");
14
- var _sort = require("./sort");
15
- var _filtering = require("./filtering");
16
- var _assignMinimumShouldMatchToQuery = require("./assignMinimumShouldMatchToQuery");
17
- const createElasticsearchBody = ({
18
- plugins,
19
- model,
20
- params
21
- }) => {
22
- const {
23
- fields,
24
- search: term,
25
- where,
26
- sort: initialSort,
27
- after,
28
- limit
29
- } = params;
30
- /**
31
- * We need the model fields constructed as a key -> field value, so we do not need to iterate through array when we require some field.
32
- */
33
- const modelFields = (0, _fields.createModelFields)({
34
- plugins,
35
- model
36
- });
37
-
38
- /**
39
- * We need the query modifier plugins.
40
- */
41
- const queryModifierPlugins = (0, _queryModifier.createQueryModifierPluginList)({
42
- plugins,
43
- model
44
- });
45
- /**
46
- * We need the sort modifier plugins.
47
- */
48
- const sortModifierPlugins = (0, _sortModifier.createSortModifierPluginList)({
49
- plugins,
50
- model
51
- });
52
- /**
53
- * We need the body modifier plugins.
54
- */
55
- const bodyModifierPlugins = (0, _bodyModifier.createBodyModifierPluginList)({
56
- plugins,
57
- model
58
- });
59
- /**
60
- * We need the fields which we can search through via the full text search.
61
- *
62
- */
63
- const fullTextSearchFields = (0, _fullTextSearchFields.createFullTextSearchFields)({
64
- model,
65
- term,
66
- fields
67
- });
68
- /**
69
- * The initial elasticsearch query where we attach some default conditions we always need.
70
- */
71
- const query = (0, _initialQuery.createInitialQuery)({
72
- where,
73
- model
74
- });
75
- /**
76
- * Apply the full text search, if term is set.
77
- */
78
- (0, _fullTextSearch.applyFullTextSearch)({
79
- model,
80
- plugins,
81
- query,
82
- term,
83
- fields: fullTextSearchFields
84
- });
85
- const execFiltering = (0, _filtering.createExecFiltering)({
86
- model,
87
- fields: modelFields,
88
- plugins
89
- });
90
- execFiltering({
91
- where,
92
- query
93
- });
94
- for (const pl of queryModifierPlugins) {
95
- pl.modifyQuery({
96
- query,
97
- model,
98
- where
99
- });
100
- }
101
- const sort = (0, _sort.createElasticsearchSort)({
102
- plugins,
103
- sort: initialSort,
104
- modelFields,
105
- model
106
- });
107
- for (const pl of sortModifierPlugins) {
108
- pl.modifySort({
109
- sort,
110
- model
111
- });
112
- }
113
- const boolQuery = {
114
- must: query.must.length > 0 ? query.must : undefined,
115
- must_not: query.must_not.length > 0 ? query.must_not : undefined,
116
- should: query.should.length > 0 ? query.should : undefined,
117
- filter: query.filter.length > 0 ? query.filter : undefined
118
- };
119
- (0, _assignMinimumShouldMatchToQuery.assignMinimumShouldMatchToQuery)({
120
- query: boolQuery
121
- });
122
- const body = {
123
- query: {
124
- bool: boolQuery
125
- },
126
- sort,
127
- size: (limit || 0) + 1,
128
- search_after: after,
129
- track_total_hits: true
130
- };
131
- for (const pl of bodyModifierPlugins) {
132
- pl.modifyBody({
133
- body,
134
- model,
135
- where
136
- });
137
- }
138
- return body;
139
- };
140
- exports.createElasticsearchBody = createElasticsearchBody;
141
-
142
- //# sourceMappingURL=body.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_fields","require","_fullTextSearchFields","_initialQuery","_fullTextSearch","_queryModifier","_sortModifier","_bodyModifier","_sort","_filtering","_assignMinimumShouldMatchToQuery","createElasticsearchBody","plugins","model","params","fields","search","term","where","sort","initialSort","after","limit","modelFields","createModelFields","queryModifierPlugins","createQueryModifierPluginList","sortModifierPlugins","createSortModifierPluginList","bodyModifierPlugins","createBodyModifierPluginList","fullTextSearchFields","createFullTextSearchFields","query","createInitialQuery","applyFullTextSearch","execFiltering","createExecFiltering","pl","modifyQuery","createElasticsearchSort","modifySort","boolQuery","must","length","undefined","must_not","should","filter","assignMinimumShouldMatchToQuery","body","bool","size","search_after","track_total_hits","modifyBody","exports"],"sources":["body.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport type {\n CmsEntryListParams,\n CmsEntryListWhere,\n CmsModel\n} from \"@webiny/api-headless-cms/types\";\nimport { createModelFields } from \"./fields\";\nimport { createFullTextSearchFields } from \"./fullTextSearchFields\";\nimport { createInitialQuery } from \"./initialQuery\";\nimport { applyFullTextSearch } from \"./fullTextSearch\";\nimport { createQueryModifierPluginList } from \"./plugins/queryModifier\";\nimport { createSortModifierPluginList } from \"./plugins/sortModifier\";\nimport { createBodyModifierPluginList } from \"./plugins/bodyModifier\";\nimport { createElasticsearchSort } from \"./sort\";\nimport type { PrimitiveValue, SearchBody, BoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport { createExecFiltering } from \"./filtering\";\nimport { assignMinimumShouldMatchToQuery } from \"./assignMinimumShouldMatchToQuery\";\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n params: Omit<CmsEntryListParams, \"where\" | \"after\"> & {\n where: CmsEntryListWhere;\n after?: PrimitiveValue[];\n };\n}\nexport const createElasticsearchBody = ({ plugins, model, params }: Params): SearchBody => {\n const { fields, search: term, where, sort: initialSort, after, limit } = params;\n /**\n * We need the model fields constructed as a key -> field value, so we do not need to iterate through array when we require some field.\n */\n const modelFields = createModelFields({\n plugins,\n model\n });\n\n /**\n * We need the query modifier plugins.\n */\n const queryModifierPlugins = createQueryModifierPluginList({\n plugins,\n model\n });\n /**\n * We need the sort modifier plugins.\n */\n const sortModifierPlugins = createSortModifierPluginList({\n plugins,\n model\n });\n /**\n * We need the body modifier plugins.\n */\n const bodyModifierPlugins = createBodyModifierPluginList({\n plugins,\n model\n });\n /**\n * We need the fields which we can search through via the full text search.\n *\n */\n const fullTextSearchFields = createFullTextSearchFields({\n model,\n term,\n fields\n });\n /**\n * The initial elasticsearch query where we attach some default conditions we always need.\n */\n const query = createInitialQuery({\n where,\n model\n });\n /**\n * Apply the full text search, if term is set.\n */\n applyFullTextSearch({\n model,\n plugins,\n query,\n term,\n fields: fullTextSearchFields\n });\n\n const execFiltering = createExecFiltering({\n model,\n fields: modelFields,\n plugins\n });\n\n execFiltering({\n where,\n query\n });\n\n for (const pl of queryModifierPlugins) {\n pl.modifyQuery({ query, model, where });\n }\n\n const sort = createElasticsearchSort({\n plugins,\n sort: initialSort,\n modelFields,\n model\n });\n\n for (const pl of sortModifierPlugins) {\n pl.modifySort({\n sort,\n model\n });\n }\n\n const boolQuery: BoolQueryConfig = {\n must: query.must.length > 0 ? query.must : undefined,\n must_not: query.must_not.length > 0 ? query.must_not : undefined,\n should: query.should.length > 0 ? query.should : undefined,\n filter: query.filter.length > 0 ? query.filter : undefined\n };\n\n assignMinimumShouldMatchToQuery({\n query: boolQuery\n });\n\n const body: SearchBody = {\n query: {\n bool: boolQuery\n },\n sort,\n size: (limit || 0) + 1,\n search_after: after,\n track_total_hits: true\n };\n\n for (const pl of bodyModifierPlugins) {\n pl.modifyBody({\n body,\n model,\n where\n });\n }\n\n return body;\n};\n"],"mappings":";;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAEA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,gCAAA,GAAAT,OAAA;AAUO,MAAMU,uBAAuB,GAAGA,CAAC;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAe,CAAC,KAAiB;EACvF,MAAM;IAAEC,MAAM;IAAEC,MAAM,EAAEC,IAAI;IAAEC,KAAK;IAAEC,IAAI,EAAEC,WA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V;EACJ,CAAC,CAAC;EAEF,KAAK,MAAMyB,EAAE,IAAIX,mBAAmB,EAAE;IAClCW,EAAE,CAACG,UAAU,CAAC;MACVtB,IAAI;MACJN;IACJ,CAAC,CAAC;EACN;EAEA,MAAM6B,SAA0B,GAAG;IAC/BC,IAAI,EAAEV,KAAK,CAACU,IAAI,CAACC,MAAM,GAAG,CAAC,GAAGX,KAAK,CAACU,IAAI,GAAGE,SAAS;IACpDC,QAAQ,EAAEb,KAAK,CAACa,QAAQ,CAACF,MAAM,GAAG,CAAC,GAAGX,KAAK,CAACa,QAAQ,GAAGD,SAAS;IAChEE,MAAM,EAAEd,KAAK,CAACc,MAAM,CAACH,MAAM,GAAG,CAAC,GAAGX,KAAK,CAACc,MAAM,GAAGF,SAAS;IAC1DG,MAAM,EAAEf,KAAK,CAACe,MAAM,CAACJ,MAAM,GAAG,CAAC,GAAGX,KAAK,CAACe,MAAM,GAAGH;EACrD,CAAC;EAED,IAAAI,gEAA+B,EAAC;IAC5BhB,KAAK,EAAES;EACX,CAAC,CAAC;EAEF,MAAMQ,IAAgB,GAAG;IACrBjB,KAAK,EAAE;MACHkB,IAAI,EAAET;IACV,CAAC;IACDvB,IAAI;IACJiC,IAAI,EAAE,CAAC9B,KAAK,IAAI,CAAC,IAAI,CAAC;IACtB+B,YAAY,EAAEhC,KAAK;IACnBiC,gBAAgB,EAAE;EACtB,CAAC;EAED,KAAK,MAAMhB,EAAE,IAAIT,mBAAmB,EAAE;IAClCS,EAAE,CAACiB,UAAU,CAAC;MACVL,IAAI;MACJrC,KAAK;MACLK;IACJ,CAAC,CAAC;EACN;EAEA,OAAOgC,IAAI;AACf,CAAC;AAACM,OAAA,CAAA7C,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import type { PluginsContainer } from "@webiny/plugins";
2
- import type { CmsModel } from "@webiny/api-headless-cms/types";
3
- interface Params {
4
- plugins: PluginsContainer;
5
- model: CmsModel;
6
- }
7
- export declare const createModelFields: ({ plugins, model }: Params) => {
8
- [x: string]: import("./types").ModelField;
9
- };
10
- export {};
@@ -1,315 +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.createModelFields = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _plugins = require("../../../plugins");
10
- var _constants = require("@webiny/api-headless-cms/constants");
11
- const createSystemField = field => {
12
- return {
13
- ...field,
14
- id: field.fieldId,
15
- label: field.fieldId
16
- };
17
- };
18
- const createSystemFields = () => {
19
- const onMetaFields = _constants.ENTRY_META_FIELDS.filter(_constants.isDateTimeEntryMetaField).reduce((current, fieldName) => {
20
- return {
21
- ...current,
22
- [fieldName]: {
23
- type: "date",
24
- unmappedType: "date",
25
- keyword: false,
26
- systemField: true,
27
- searchable: true,
28
- sortable: true,
29
- field: createSystemField({
30
- storageId: fieldName,
31
- fieldId: fieldName,
32
- type: "text",
33
- settings: {
34
- type: "dateTimeWithoutTimezone"
35
- }
36
- }),
37
- parents: []
38
- }
39
- };
40
- }, {});
41
- const byMetaFields = _constants.ENTRY_META_FIELDS.filter(_constants.isIdentityEntryMetaField).reduce((current, fieldName) => {
42
- return {
43
- ...current,
44
- [fieldName]: {
45
- type: "text",
46
- unmappedType: undefined,
47
- systemField: true,
48
- searchable: true,
49
- sortable: true,
50
- path: `${fieldName}.id`,
51
- field: createSystemField({
52
- storageId: fieldName,
53
- fieldId: fieldName,
54
- type: "text"
55
- }),
56
- parents: []
57
- }
58
- };
59
- }, {});
60
- return {
61
- id: {
62
- type: "text",
63
- systemField: true,
64
- searchable: true,
65
- sortable: true,
66
- field: createSystemField({
67
- storageId: "id",
68
- fieldId: "id",
69
- type: "text"
70
- }),
71
- parents: []
72
- },
73
- entryId: {
74
- type: "text",
75
- systemField: true,
76
- searchable: true,
77
- sortable: true,
78
- field: createSystemField({
79
- storageId: "entryId",
80
- fieldId: "entryId",
81
- type: "text"
82
- }),
83
- parents: []
84
- },
85
- ...onMetaFields,
86
- ...byMetaFields,
87
- wbyAco_location: {
88
- type: "object",
89
- systemField: true,
90
- searchable: true,
91
- sortable: true,
92
- field: createSystemField({
93
- storageId: "location",
94
- fieldId: "wbyAco_location",
95
- type: "object",
96
- settings: {
97
- fields: [{
98
- id: "folderId",
99
- fieldId: "folderId",
100
- storageId: "folderId",
101
- type: "text",
102
- label: "Folder ID"
103
- }]
104
- }
105
- }),
106
- parents: []
107
- },
108
- "wbyAco_location.folderId": {
109
- type: "text",
110
- systemField: true,
111
- searchable: true,
112
- sortable: true,
113
- field: createSystemField({
114
- id: "folderId",
115
- fieldId: "folderId",
116
- storageId: "folderId",
117
- type: "text",
118
- label: "Folder ID"
119
- }),
120
- parents: [{
121
- fieldId: "wbyAco_location",
122
- type: "object",
123
- storageId: "location"
124
- }]
125
- },
126
- version: {
127
- type: "number",
128
- unmappedType: undefined,
129
- keyword: false,
130
- systemField: true,
131
- searchable: true,
132
- sortable: true,
133
- field: createSystemField({
134
- storageId: "version",
135
- fieldId: "version",
136
- type: "number"
137
- }),
138
- parents: []
139
- },
140
- status: {
141
- type: "string",
142
- unmappedType: undefined,
143
- keyword: false,
144
- systemField: true,
145
- searchable: true,
146
- sortable: false,
147
- field: createSystemField({
148
- storageId: "status",
149
- fieldId: "status",
150
- type: "string"
151
- }),
152
- parents: []
153
- },
154
- wbyDeleted: {
155
- type: "boolean",
156
- unmappedType: undefined,
157
- keyword: false,
158
- systemField: true,
159
- searchable: true,
160
- sortable: false,
161
- field: createSystemField({
162
- storageId: "wbyDeleted",
163
- fieldId: "wbyDeleted",
164
- type: "boolean"
165
- }),
166
- parents: []
167
- },
168
- binOriginalFolderId: {
169
- type: "text",
170
- unmappedType: undefined,
171
- keyword: false,
172
- systemField: true,
173
- searchable: true,
174
- sortable: false,
175
- field: createSystemField({
176
- storageId: "binOriginalFolderId",
177
- fieldId: "binOriginalFolderId",
178
- type: "text"
179
- }),
180
- parents: []
181
- }
182
- };
183
- };
184
- const buildCustomFields = params => {
185
- const {
186
- fields,
187
- fieldTypePlugins
188
- } = params;
189
- return fields.reduce((collection, field) => {
190
- const typePlugin = fieldTypePlugins[field.fieldType];
191
- if (!typePlugin) {
192
- return collection;
193
- }
194
- let unmappedType = undefined;
195
- if (typePlugin.unmappedType) {
196
- unmappedType = typePlugin.unmappedType(field);
197
- }
198
- collection[field.fieldId] = {
199
- type: field.fieldType,
200
- field: createSystemField({
201
- storageId: field.fieldId,
202
- fieldId: field.fieldId,
203
- type: field.fieldType
204
- }),
205
- unmappedType,
206
- fullTextSearch: field.searchable ? typePlugin.fullTextSearch : false,
207
- searchable: field.searchable || typePlugin.searchable,
208
- sortable: field.sortable || typePlugin.sortable,
209
- systemField: false,
210
- path: field.path,
211
- parents: []
212
- };
213
- return collection;
214
- }, {});
215
- };
216
- const buildFieldsList = params => {
217
- const {
218
- plugins,
219
- fields,
220
- parents
221
- } = params;
222
- return fields.reduce((result, field) => {
223
- const plugin = plugins[field.type];
224
- if (!plugin) {
225
- throw new _error.default(`There is no plugin for field type "${field.type}".`);
226
- }
227
- const {
228
- searchable,
229
- sortable,
230
- unmappedType,
231
- fullTextSearch
232
- } = plugin;
233
- /**
234
- * If a field has child fields, go through them and add them to a result.
235
- */
236
- const childFields = field.settings?.fields || [];
237
- if (childFields.length > 0) {
238
- /**
239
- * Let's build all the child fields
240
- */
241
- const childResult = buildFieldsList({
242
- fields: childFields,
243
- plugins,
244
- parents: [...parents, {
245
- fieldId: field.fieldId,
246
- storageId: field.storageId,
247
- type: field.type
248
- }]
249
- });
250
- Object.assign(result, childResult);
251
- }
252
- const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(".");
253
- result[identifier] = {
254
- type: field.type,
255
- parents,
256
- searchable,
257
- sortable,
258
- fullTextSearch,
259
- unmappedType: typeof unmappedType === "function" ? unmappedType(field) : undefined,
260
- systemField: false,
261
- field
262
- };
263
- return result;
264
- }, {});
265
- };
266
- const createModelFields = ({
267
- plugins,
268
- model
269
- }) => {
270
- const fields = model.fields;
271
- const fieldDefinitionPlugins = plugins.byType(_plugins.CmsElasticsearchModelFieldPlugin.type).filter(plugin => {
272
- return plugin.canBeApplied(model.modelId);
273
- });
274
- /**
275
- * Collect all unmappedType from elastic plugins.
276
- */
277
- const unmappedTypes = plugins.byType("cms-model-field-to-elastic-search").reduce((acc, plugin) => {
278
- if (!plugin.unmappedType) {
279
- return acc;
280
- }
281
- acc[plugin.fieldType] = plugin.unmappedType;
282
- return acc;
283
- }, {});
284
- /**
285
- * Collect all field types from the plugins.
286
- */
287
- const fieldTypePlugins = plugins.byType("cms-model-field-to-graphql").reduce((types, plugin) => {
288
- const {
289
- fieldType,
290
- fullTextSearch
291
- } = plugin;
292
- types[fieldType] = {
293
- unmappedType: unmappedTypes[fieldType],
294
- searchable: plugin.isSearchable,
295
- sortable: plugin.isSortable,
296
- fullTextSearch
297
- };
298
- return types;
299
- }, {});
300
- return {
301
- ...createSystemFields(),
302
- ...buildCustomFields({
303
- fields: fieldDefinitionPlugins,
304
- fieldTypePlugins
305
- }),
306
- ...buildFieldsList({
307
- fields,
308
- plugins: fieldTypePlugins,
309
- parents: []
310
- })
311
- };
312
- };
313
- exports.createModelFields = createModelFields;
314
-
315
- //# sourceMappingURL=fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_plugins","_constants","createSystemField","field","id","fieldId","label","createSystemFields","onMetaFields","ENTRY_META_FIELDS","filter","isDateTimeEntryMetaField","reduce","current","fieldName","type","unmappedType","keyword","systemField","searchable","sortable","storageId","settings","parents","byMetaFields","isIdentityEntryMetaField","undefined","path","entryId","wbyAco_location","fields","version","status","wbyDeleted","binOriginalFolderId","buildCustomFields","params","fieldTypePlugins","collection","typePlugin","fieldType","fullTextSearch","buildFieldsList","plugins","result","plugin","WebinyError","childFields","length","childResult","Object","assign","identifier","map","p","join","createModelFields","model","fieldDefinitionPlugins","byType","CmsElasticsearchModelFieldPlugin","canBeApplied","modelId","unmappedTypes","acc","types","isSearchable","isSortable","exports"],"sources":["fields.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types\";\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport type { ModelFieldParent, ModelFields } from \"./types\";\nimport { CmsElasticsearchModelFieldPlugin } from \"~/plugins\";\nimport {\n ENTRY_META_FIELDS,\n isDateTimeEntryMetaField,\n isIdentityEntryMetaField\n} from \"@webiny/api-headless-cms/constants\";\n\ntype PartialCmsModelField = Partial<CmsModelField> &\n Pick<CmsModelField, \"storageId\" | \"fieldId\" | \"type\">;\nconst createSystemField = (field: PartialCmsModelField): CmsModelField => {\n return {\n ...field,\n id: field.fieldId,\n label: field.fieldId\n };\n};\n\nconst createSystemFields = (): ModelFields => {\n const onMetaFields = ENTRY_META_FIELDS.filter(isDateTimeEntryMetaField).reduce(\n (current, fieldName) => {\n return {\n ...current,\n [fieldName]: {\n type: \"date\",\n unmappedType: \"date\",\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: fieldName,\n fieldId: fieldName,\n type: \"text\",\n settings: {\n type: \"dateTimeWithoutTimezone\"\n }\n }),\n parents: []\n }\n };\n },\n {}\n );\n\n const byMetaFields = ENTRY_META_FIELDS.filter(isIdentityEntryMetaField).reduce(\n (current, fieldName) => {\n return {\n ...current,\n [fieldName]: {\n type: \"text\",\n unmappedType: undefined,\n systemField: true,\n searchable: true,\n sortable: true,\n path: `${fieldName}.id`,\n field: createSystemField({\n storageId: fieldName,\n fieldId: fieldName,\n type: \"text\"\n }),\n parents: []\n }\n };\n },\n {}\n );\n\n return {\n id: {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"id\",\n fieldId: \"id\",\n type: \"text\"\n }),\n parents: []\n },\n entryId: {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"entryId\",\n fieldId: \"entryId\",\n type: \"text\"\n }),\n parents: []\n },\n\n ...onMetaFields,\n ...byMetaFields,\n\n wbyAco_location: {\n type: \"object\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"location\",\n fieldId: \"wbyAco_location\",\n type: \"object\",\n settings: {\n fields: [\n {\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n }\n ]\n }\n }),\n parents: []\n },\n \"wbyAco_location.folderId\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n }),\n parents: [\n {\n fieldId: \"wbyAco_location\",\n type: \"object\",\n storageId: \"location\"\n }\n ]\n },\n version: {\n type: \"number\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"version\",\n fieldId: \"version\",\n type: \"number\"\n }),\n parents: []\n },\n status: {\n type: \"string\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"status\",\n fieldId: \"status\",\n type: \"string\"\n }),\n parents: []\n },\n wbyDeleted: {\n type: \"boolean\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"wbyDeleted\",\n fieldId: \"wbyDeleted\",\n type: \"boolean\"\n }),\n parents: []\n },\n binOriginalFolderId: {\n type: \"text\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"binOriginalFolderId\",\n fieldId: \"binOriginalFolderId\",\n type: \"text\"\n }),\n parents: []\n }\n };\n};\n\ninterface UnmappedFieldTypes {\n [type: string]: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string | undefined;\n}\n\ninterface FieldTypePlugin {\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string | undefined;\n searchable: boolean;\n sortable: boolean;\n fullTextSearch?: boolean;\n}\n\ninterface FieldTypePlugins {\n [key: string]: FieldTypePlugin;\n}\n\ninterface BuildCustomFieldsParams {\n fields: CmsElasticsearchModelFieldPlugin[];\n fieldTypePlugins: FieldTypePlugins;\n}\n\nconst buildCustomFields = (params: BuildCustomFieldsParams) => {\n const { fields, fieldTypePlugins } = params;\n\n return fields.reduce<ModelFields>((collection, field) => {\n const typePlugin = fieldTypePlugins[field.fieldType];\n if (!typePlugin) {\n return collection;\n }\n let unmappedType: string | undefined = undefined;\n if (typePlugin.unmappedType) {\n unmappedType = typePlugin.unmappedType(field);\n }\n\n collection[field.fieldId] = {\n type: field.fieldType,\n field: createSystemField({\n storageId: field.fieldId,\n fieldId: field.fieldId,\n type: field.fieldType\n }),\n unmappedType,\n fullTextSearch: field.searchable ? typePlugin.fullTextSearch : false,\n searchable: field.searchable || typePlugin.searchable,\n sortable: field.sortable || typePlugin.sortable,\n systemField: false,\n path: field.path,\n parents: []\n };\n\n return collection;\n }, {});\n};\n\ninterface BuildParams {\n plugins: FieldTypePlugins;\n fields: CmsModelField[];\n parents: ModelFieldParent[];\n}\n\nconst buildFieldsList = (params: BuildParams): ModelFields => {\n const { plugins, fields, parents } = params;\n\n return fields.reduce<ModelFields>((result, field) => {\n const plugin = plugins[field.type];\n if (!plugin) {\n throw new WebinyError(`There is no plugin for field type \"${field.type}\".`);\n }\n\n const { searchable, sortable, unmappedType, fullTextSearch } = plugin;\n /**\n * If a field has child fields, go through them and add them to a result.\n */\n const childFields = field.settings?.fields || [];\n if (childFields.length > 0) {\n /**\n * Let's build all the child fields\n */\n const childResult = buildFieldsList({\n fields: childFields,\n plugins,\n parents: [\n ...parents,\n {\n fieldId: field.fieldId,\n storageId: field.storageId,\n type: field.type\n }\n ]\n });\n Object.assign(result, childResult);\n }\n\n const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(\".\");\n\n result[identifier] = {\n type: field.type,\n parents,\n searchable,\n sortable,\n fullTextSearch,\n unmappedType: typeof unmappedType === \"function\" ? unmappedType(field) : undefined,\n systemField: false,\n field\n };\n\n return result;\n }, {});\n};\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\n\nexport const createModelFields = ({ plugins, model }: Params) => {\n const fields = model.fields;\n const fieldDefinitionPlugins = plugins\n .byType<CmsElasticsearchModelFieldPlugin>(CmsElasticsearchModelFieldPlugin.type)\n .filter(plugin => {\n return plugin.canBeApplied(model.modelId);\n });\n /**\n * Collect all unmappedType from elastic plugins.\n */\n const unmappedTypes = plugins\n .byType<CmsModelFieldToElasticsearchPlugin>(\"cms-model-field-to-elastic-search\")\n .reduce<UnmappedFieldTypes>((acc, plugin) => {\n if (!plugin.unmappedType) {\n return acc;\n }\n acc[plugin.fieldType] = plugin.unmappedType;\n return acc;\n }, {});\n /**\n * Collect all field types from the plugins.\n */\n const fieldTypePlugins = plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce<FieldTypePlugins>((types, plugin) => {\n const { fieldType, fullTextSearch } = plugin;\n types[fieldType] = {\n unmappedType: unmappedTypes[fieldType],\n searchable: plugin.isSearchable,\n sortable: plugin.isSortable,\n fullTextSearch\n };\n return types;\n }, {});\n\n return {\n ...createSystemFields(),\n ...buildCustomFields({\n fields: fieldDefinitionPlugins,\n fieldTypePlugins\n }),\n ...buildFieldsList({\n fields,\n plugins: fieldTypePlugins,\n parents: []\n })\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAQA,MAAMG,iBAAiB,GAAIC,KAA2B,IAAoB;EACtE,OAA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Ae,CAAC,GAAGI,MAAM;IAC5CoB,KAAK,CAACzB,SAAS,CAAC,GAAG;MACfxB,YAAY,EAAE+C,aAAa,CAACvB,SAAS,CAAC;MACtCrB,UAAU,EAAE0B,MAAM,CAACqB,YAAY;MAC/B9C,QAAQ,EAAEyB,MAAM,CAACsB,UAAU;MAC3B1B;IACJ,CAAC;IACD,OAAOwB,KAAK;EAChB,CAAC,EAAE,CAAC,CAAC,CAAC;EAEV,OAAO;IACH,GAAG1D,kBAAkB,CAAC,CAAC;IACvB,GAAG4B,iBAAiB,CAAC;MACjBL,MAAM,EAAE4B,sBAAsB;MAC9BrB;IACJ,CAAC,CAAC;IACF,GAAGK,eAAe,CAAC;MACfZ,MAAM;MACNa,OAAO,EAAEN,gBAAgB;MACzBd,OAAO,EAAE;IACb,CAAC;EACL,CAAC;AACL,CAAC;AAAC6C,OAAA,CAAAZ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import type { ElasticsearchQueryBuilderOperatorPlugins, ElasticsearchQuerySearchValuePlugins } from "../types";
2
- import type { ApplyFilteringCb } from "../../../../plugins/CmsEntryFilterPlugin";
3
- interface CreateParams {
4
- operatorPlugins: ElasticsearchQueryBuilderOperatorPlugins;
5
- searchPlugins: ElasticsearchQuerySearchValuePlugins;
6
- }
7
- export declare const createApplyFiltering: ({ operatorPlugins, searchPlugins }: CreateParams) => ApplyFilteringCb;
8
- export {};
@@ -1,60 +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.createApplyFiltering = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _transformValueForSearch = require("../transformValueForSearch");
10
- var _keyword = require("../keyword");
11
- var _path = require("./path");
12
- const createApplyFiltering = ({
13
- operatorPlugins,
14
- searchPlugins
15
- }) => {
16
- const createFieldPath = (0, _path.createFieldPathFactory)({
17
- plugins: searchPlugins
18
- });
19
- return params => {
20
- const {
21
- key,
22
- value: initialValue,
23
- query,
24
- operator,
25
- field
26
- } = params;
27
- const plugin = operatorPlugins[operator];
28
- if (!plugin) {
29
- throw new _error.default(`Elasticsearch operator "${operator}" plugin missing.`, "PLUGIN_MISSING", {
30
- operator
31
- });
32
- }
33
- const value = (0, _transformValueForSearch.transformValueForSearch)({
34
- plugins: searchPlugins,
35
- field: field.field,
36
- value: initialValue
37
- });
38
- const keyword = (0, _keyword.hasKeyword)(field);
39
- const {
40
- basePath,
41
- path
42
- } = createFieldPath({
43
- field,
44
- value,
45
- originalValue: initialValue,
46
- key,
47
- keyword
48
- });
49
- plugin.apply(query, {
50
- name: field.field.fieldId,
51
- basePath,
52
- path,
53
- value,
54
- keyword
55
- });
56
- };
57
- };
58
- exports.createApplyFiltering = createApplyFiltering;
59
-
60
- //# sourceMappingURL=applyFiltering.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_transformValueForSearch","_keyword","_path","createApplyFiltering","operatorPlugins","searchPlugins","createFieldPath","createFieldPathFactory","plugins","params","key","value","initialValue","query","operator","field","plugin","WebinyError","transformValueForSearch","keyword","hasKeyword","basePath","path","originalValue","apply","name","fieldId","exports"],"sources":["applyFiltering.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { transformValueForSearch } from \"~/operations/entry/elasticsearch/transformValueForSearch\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword\";\nimport type {\n ElasticsearchQueryBuilderOperatorPlugins,\n ElasticsearchQuerySearchValuePlugins\n} from \"~/operations/entry/elasticsearch/types\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path\";\nimport type { ApplyFilteringCb } from \"~/plugins/CmsEntryFilterPlugin\";\n\ninterface CreateParams {\n operatorPlugins: ElasticsearchQueryBuilderOperatorPlugins;\n searchPlugins: ElasticsearchQuerySearchValuePlugins;\n}\n\nexport const createApplyFiltering = ({\n operatorPlugins,\n searchPlugins\n}: CreateParams): ApplyFilteringCb => {\n const createFieldPath = createFieldPathFactory({\n plugins: searchPlugins\n });\n\n return params => {\n const { key, value: initialValue, query, operator, field } = params;\n\n const plugin = operatorPlugins[operator];\n if (!plugin) {\n throw new WebinyError(\n `Elasticsearch operator \"${operator}\" plugin missing.`,\n \"PLUGIN_MISSING\",\n {\n operator\n }\n );\n }\n\n const value = transformValueForSearch({\n plugins: searchPlugins,\n field: field.field,\n value: initialValue\n });\n\n const keyword = hasKeyword(field);\n\n const { basePath, path } = createFieldPath({\n field,\n value,\n originalValue: initialValue,\n key,\n keyword\n });\n\n plugin.apply(query, {\n name: field.field.fieldId,\n basePath,\n path,\n value,\n keyword\n });\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AAQO,MAAMI,oBAAoB,GAAGA,CAAC;EACjCC,eAAe;EACfC;AACU,CAAC,KAAuB;EAClC,MAAMC,eAAe,GAAG,IAAAC,4BAAsB,EAAC;IAC3CC,OAAO,EAAEH;EACb,CAAC,CAAC;EAEF,OAAOI,MAAM,IAAI;IACb,MAAM;MAAEC,GAAG;MAAEC,KAAK,EAAEC,YAAY;MAAEC,KAAK;MAAEC,QAAQ;MAAEC;IAAM,CAAC,GAAGN,MAAM;IAEnE,MAAMO,MAAM,GAAGZ,eAAe,CAACU,QAAQ,CAAC;IACxC,IAAI,CAACE,MAAM,EAAE;MACT,MAAM,IAAIC,cAAW,CACjB,2BAA2BH,QAAQ,mBAAmB,EACtD,gBAAgB,EAChB;QACIA;MACJ,CACJ,CAAC;IACL;IAEA,MAAMH,KAAK,GAAG,IAAAO,gDAAuB,EAAC;MAClCV,OAAO,EAAEH,aAAa;MACtBU,KAAK,EAAEA,KAAK,CAACA,KAAK;MAClBJ,KAAK,EAAEC;IACX,CAAC,CAAC;IAEF,MAAMO,OAAO,GAAG,IAAAC,mBAAU,EAACL,KAAK,CAAC;IAEjC,MAAM;MAAEM,QAAQ;MAAEC;IAAK,CAAC,GAAGhB,eAAe,CAAC;MACvCS,KAAK;MACLJ,KAAK;MACLY,aAAa,EAAEX,YAAY;MAC3BF,GAAG;MACHS;IACJ,CAAC,CAAC;IAEFH,MAAM,CAACQ,KAAK,CAACX,KAAK,EAAE;MAChBY,IAAI,EAAEV,KAAK,CAACA,KAAK,CAACW,OAAO;MACzBL,QAAQ;MACRC,IAAI;MACJX,KAAK;MACLQ;IACJ,CAAC,CAAC;EACN,CAAC;AACL,CAAC;AAACQ,OAAA,CAAAxB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- import type { CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types";
2
- import type { ModelFields } from "../types";
3
- import type { PluginsContainer } from "@webiny/plugins";
4
- import type { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
5
- export interface CreateExecParams {
6
- model: CmsModel;
7
- fields: ModelFields;
8
- plugins: PluginsContainer;
9
- }
10
- export interface ExecParams {
11
- where: CmsEntryListWhere;
12
- query: ElasticsearchBoolQueryConfig;
13
- }
14
- export interface CreateExecFilteringResponse {
15
- (params: ExecParams): void;
16
- }
17
- export declare const createExecFiltering: (params: CreateExecParams) => CreateExecFilteringResponse;