@webiny/api-headless-cms-ddb-es 0.0.0-unstable.df7a8bb475 → 0.0.0-unstable.e1999482d0

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 (397) hide show
  1. package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
  2. package/abstractions/CmsDdbEsDataLoaders.js +5 -0
  3. package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
  4. package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
  5. package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
  6. package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
  7. package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
  8. package/abstractions/CmsDdbEsEntryEntity.js +5 -0
  9. package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
  10. package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
  11. package/abstractions/CmsDdbEsGroupEntity.js +5 -0
  12. package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
  13. package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
  14. package/abstractions/CmsDdbEsModelEntity.js +5 -0
  15. package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
  16. package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
  17. package/abstractions/CmsDdbEsOsTable.js +5 -0
  18. package/abstractions/CmsDdbEsOsTable.js.map +1 -0
  19. package/abstractions/CmsDdbEsTable.d.ts +5 -0
  20. package/abstractions/CmsDdbEsTable.js +5 -0
  21. package/abstractions/CmsDdbEsTable.js.map +1 -0
  22. package/debuggerNamespaces.d.ts +12 -0
  23. package/debuggerNamespaces.js +0 -0
  24. package/definitions/entry.js +7 -9
  25. package/definitions/entry.js.map +1 -1
  26. package/definitions/group.js +7 -9
  27. package/definitions/group.js.map +1 -1
  28. package/definitions/model.js +7 -9
  29. package/definitions/model.js.map +1 -1
  30. package/definitions/types.d.ts +9 -3
  31. package/definitions/types.js +0 -3
  32. package/feature.d.ts +10 -0
  33. package/feature.js +69 -0
  34. package/feature.js.map +1 -0
  35. package/index.d.ts +1 -3
  36. package/index.js +1 -190
  37. package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
  38. package/operations/entry/DdbEsCreateEntry.js +134 -0
  39. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  40. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
  41. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
  42. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  43. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  44. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  45. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  46. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
  47. package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
  48. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  49. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  50. package/operations/entry/DdbEsDeleteMultipleEntries.js +78 -0
  51. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  52. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  53. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  54. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  55. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  56. package/operations/entry/DdbEsGetEntry.js +27 -0
  57. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  58. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  59. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  60. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  61. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  62. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  63. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  64. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  65. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  66. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  67. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  68. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  69. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  70. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  71. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  72. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  73. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  74. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  75. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  76. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  77. package/operations/entry/DdbEsGetRevisions.js +33 -0
  78. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  79. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
  80. package/operations/entry/DdbEsGetUniqueFieldValues.js +77 -0
  81. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  82. package/operations/entry/DdbEsListEntries.d.ts +28 -0
  83. package/operations/entry/DdbEsListEntries.js +110 -0
  84. package/operations/entry/DdbEsListEntries.js.map +1 -0
  85. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  86. package/operations/entry/DdbEsMoveEntry.js +113 -0
  87. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  88. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  89. package/operations/entry/DdbEsMoveToBin.js +137 -0
  90. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  91. package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
  92. package/operations/entry/DdbEsPublishEntry.js +231 -0
  93. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  94. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  95. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  96. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  97. package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
  98. package/operations/entry/DdbEsUnpublishEntry.js +127 -0
  99. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  100. package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
  101. package/operations/entry/DdbEsUpdateEntry.js +175 -0
  102. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  103. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
  104. package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
  105. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  106. package/operations/entry/dataLoader/constants.js +2 -1
  107. package/operations/entry/dataLoader/constants.js.map +1 -1
  108. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  109. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  110. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
  111. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  112. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +28 -34
  113. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  114. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +28 -34
  115. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  116. package/operations/entry/dataLoader/getRevisionById.js +33 -43
  117. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  118. package/operations/entry/dataLoader/index.js +8 -9
  119. package/operations/entry/dataLoader/index.js.map +1 -1
  120. package/operations/entry/dataLoader/types.d.ts +1 -0
  121. package/operations/entry/dataLoader/types.js +0 -3
  122. package/operations/entry/dataLoaders.d.ts +5 -5
  123. package/operations/entry/dataLoaders.js +89 -97
  124. package/operations/entry/dataLoaders.js.map +1 -1
  125. package/operations/entry/feature.d.ts +4 -0
  126. package/operations/entry/feature.js +55 -0
  127. package/operations/entry/feature.js.map +1 -0
  128. package/operations/entry/keys.js +43 -63
  129. package/operations/entry/keys.js.map +1 -1
  130. package/operations/entry/recordType.js +4 -9
  131. package/operations/entry/recordType.js.map +1 -1
  132. package/operations/entry/storageEntryUtils.d.ts +7 -0
  133. package/operations/entry/storageEntryUtils.js +14 -0
  134. package/operations/entry/storageEntryUtils.js.map +1 -0
  135. package/operations/entry/transformations/convertEntryKeys.js +21 -26
  136. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  137. package/operations/entry/transformations/index.d.ts +6 -3
  138. package/operations/entry/transformations/index.js +85 -113
  139. package/operations/entry/transformations/index.js.map +1 -1
  140. package/operations/entry/transformations/modifyEntryValues.d.ts +7 -5
  141. package/operations/entry/transformations/modifyEntryValues.js +12 -17
  142. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  143. package/operations/entry/transformations/transformEntryKeys.js +13 -16
  144. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  145. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  146. package/operations/group/DdbEsCreateGroup.js +35 -0
  147. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  148. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  149. package/operations/group/DdbEsDeleteGroup.js +31 -0
  150. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  151. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  152. package/operations/group/DdbEsGetGroup.js +31 -0
  153. package/operations/group/DdbEsGetGroup.js.map +1 -0
  154. package/operations/group/DdbEsListGroups.d.ts +14 -0
  155. package/operations/group/DdbEsListGroups.js +52 -0
  156. package/operations/group/DdbEsListGroups.js.map +1 -0
  157. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  158. package/operations/group/DdbEsUpdateGroup.js +35 -0
  159. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  160. package/operations/group/feature.d.ts +4 -0
  161. package/operations/group/feature.js +19 -0
  162. package/operations/group/feature.js.map +1 -0
  163. package/operations/group/keys.d.ts +15 -0
  164. package/operations/group/keys.js +17 -0
  165. package/operations/group/keys.js.map +1 -0
  166. package/operations/model/DdbEsCreateModel.d.ts +16 -0
  167. package/operations/model/DdbEsCreateModel.js +56 -0
  168. package/operations/model/DdbEsCreateModel.js.map +1 -0
  169. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  170. package/operations/model/DdbEsDeleteModel.js +31 -0
  171. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  172. package/operations/model/DdbEsGetModel.d.ts +12 -0
  173. package/operations/model/DdbEsGetModel.js +30 -0
  174. package/operations/model/DdbEsGetModel.js.map +1 -0
  175. package/operations/model/DdbEsListModels.d.ts +12 -0
  176. package/operations/model/DdbEsListModels.js +36 -0
  177. package/operations/model/DdbEsListModels.js.map +1 -0
  178. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  179. package/operations/model/DdbEsUpdateModel.js +36 -0
  180. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  181. package/operations/model/feature.d.ts +4 -0
  182. package/operations/model/feature.js +19 -0
  183. package/operations/model/feature.js.map +1 -0
  184. package/operations/model/keys.d.ts +15 -0
  185. package/operations/model/keys.js +17 -0
  186. package/operations/model/keys.js.map +1 -0
  187. package/package.json +39 -30
  188. package/registry/CmsEntitiesDbRegistryDecorator.d.ts +27 -0
  189. package/registry/CmsEntitiesDbRegistryDecorator.js +46 -0
  190. package/registry/CmsEntitiesDbRegistryDecorator.js.map +1 -0
  191. package/tasks/CreateElasticsearchIndexTask.d.ts +15 -0
  192. package/tasks/CreateElasticsearchIndexTask.js +49 -0
  193. package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
  194. package/types.d.ts +11 -155
  195. package/types.js +7 -36
  196. package/types.js.map +1 -1
  197. package/configurations.d.ts +0 -18
  198. package/configurations.js +0 -37
  199. package/configurations.js.map +0 -1
  200. package/definitions/types.js.map +0 -1
  201. package/dynamoDb/index.d.ts +0 -3
  202. package/dynamoDb/index.js +0 -8
  203. package/dynamoDb/index.js.map +0 -1
  204. package/dynamoDb/storage/longText.d.ts +0 -10
  205. package/dynamoDb/storage/longText.js +0 -88
  206. package/dynamoDb/storage/longText.js.map +0 -1
  207. package/dynamoDb/storage/richText.d.ts +0 -2
  208. package/dynamoDb/storage/richText.js +0 -51
  209. package/dynamoDb/storage/richText.js.map +0 -1
  210. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  211. package/elasticsearch/createElasticsearchIndex.js +0 -32
  212. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  213. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
  214. package/elasticsearch/deleteElasticsearchIndex.js +0 -31
  215. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  216. package/elasticsearch/index.d.ts +0 -2
  217. package/elasticsearch/index.js +0 -5
  218. package/elasticsearch/index.js.map +0 -1
  219. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  220. package/elasticsearch/indexing/dateTimeIndexing.js +0 -81
  221. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  222. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  223. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  224. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  225. package/elasticsearch/indexing/index.d.ts +0 -2
  226. package/elasticsearch/indexing/index.js +0 -10
  227. package/elasticsearch/indexing/index.js.map +0 -1
  228. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  229. package/elasticsearch/indexing/jsonIndexing.js +0 -21
  230. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  231. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  232. package/elasticsearch/indexing/longTextIndexing.js +0 -35
  233. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  234. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  235. package/elasticsearch/indexing/numberIndexing.js +0 -34
  236. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  237. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  238. package/elasticsearch/indexing/objectIndexing.js +0 -194
  239. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  240. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  241. package/elasticsearch/indexing/richTextIndexing.js +0 -24
  242. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  243. package/elasticsearch/indices/base.d.ts +0 -2
  244. package/elasticsearch/indices/base.js +0 -7
  245. package/elasticsearch/indices/base.js.map +0 -1
  246. package/elasticsearch/indices/index.d.ts +0 -1
  247. package/elasticsearch/indices/index.js +0 -6
  248. package/elasticsearch/indices/index.js.map +0 -1
  249. package/elasticsearch/search/index.d.ts +0 -3
  250. package/elasticsearch/search/index.js +0 -6
  251. package/elasticsearch/search/index.js.map +0 -1
  252. package/elasticsearch/search/refSearch.d.ts +0 -2
  253. package/elasticsearch/search/refSearch.js +0 -24
  254. package/elasticsearch/search/refSearch.js.map +0 -1
  255. package/elasticsearch/search/searchableJson.d.ts +0 -2
  256. package/elasticsearch/search/searchableJson.js +0 -53
  257. package/elasticsearch/search/searchableJson.js.map +0 -1
  258. package/elasticsearch/search/timeSearch.d.ts +0 -2
  259. package/elasticsearch/search/timeSearch.js +0 -20
  260. package/elasticsearch/search/timeSearch.js.map +0 -1
  261. package/helpers/entryIndexHelpers.d.ts +0 -18
  262. package/helpers/entryIndexHelpers.js +0 -196
  263. package/helpers/entryIndexHelpers.js.map +0 -1
  264. package/helpers/fieldIdentifier.d.ts +0 -6
  265. package/helpers/fieldIdentifier.js +0 -35
  266. package/helpers/fieldIdentifier.js.map +0 -1
  267. package/helpers/index.d.ts +0 -2
  268. package/helpers/index.js +0 -4
  269. package/helpers/index.js.map +0 -1
  270. package/index.js.map +0 -1
  271. package/operations/entry/dataLoader/types.js.map +0 -1
  272. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  273. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -27
  274. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  275. package/operations/entry/elasticsearch/body.d.ts +0 -13
  276. package/operations/entry/elasticsearch/body.js +0 -135
  277. package/operations/entry/elasticsearch/body.js.map +0 -1
  278. package/operations/entry/elasticsearch/fields.d.ts +0 -10
  279. package/operations/entry/elasticsearch/fields.js +0 -401
  280. package/operations/entry/elasticsearch/fields.js.map +0 -1
  281. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
  282. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -52
  283. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  284. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -18
  285. package/operations/entry/elasticsearch/filtering/exec.js +0 -178
  286. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  287. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  288. package/operations/entry/elasticsearch/filtering/index.js +0 -3
  289. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  290. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -16
  291. package/operations/entry/elasticsearch/filtering/path.js +0 -38
  292. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  293. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  294. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
  295. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  296. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  297. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
  298. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  299. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  300. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
  301. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  302. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  303. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
  304. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  305. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  306. package/operations/entry/elasticsearch/filtering/populated.js +0 -18
  307. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  308. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  309. package/operations/entry/elasticsearch/filtering/values.js +0 -16
  310. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  311. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
  312. package/operations/entry/elasticsearch/fullTextSearch.js +0 -85
  313. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  314. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  315. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -20
  316. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  317. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
  318. package/operations/entry/elasticsearch/initialQuery.js +0 -88
  319. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  320. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  321. package/operations/entry/elasticsearch/keyword.js +0 -31
  322. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  323. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  324. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
  325. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  326. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -7
  327. package/operations/entry/elasticsearch/plugins/operator.js +0 -24
  328. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  329. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  330. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
  331. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  332. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  333. package/operations/entry/elasticsearch/plugins/search.js +0 -18
  334. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  335. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  336. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
  337. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  338. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  339. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -6
  340. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  341. package/operations/entry/elasticsearch/sort.d.ts +0 -12
  342. package/operations/entry/elasticsearch/sort.js +0 -107
  343. package/operations/entry/elasticsearch/sort.js.map +0 -1
  344. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
  345. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -27
  346. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  347. package/operations/entry/elasticsearch/types.d.ts +0 -41
  348. package/operations/entry/elasticsearch/types.js +0 -3
  349. package/operations/entry/elasticsearch/types.js.map +0 -1
  350. package/operations/entry/index.d.ts +0 -12
  351. package/operations/entry/index.js +0 -1699
  352. package/operations/entry/index.js.map +0 -1
  353. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
  354. package/operations/entry/transformations/transformEntryToIndex.js +0 -24
  355. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  356. package/operations/group/index.d.ts +0 -9
  357. package/operations/group/index.js +0 -145
  358. package/operations/group/index.js.map +0 -1
  359. package/operations/model/index.d.ts +0 -8
  360. package/operations/model/index.js +0 -164
  361. package/operations/model/index.js.map +0 -1
  362. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  363. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
  364. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  365. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  366. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
  367. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  368. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  369. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
  370. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  371. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  372. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
  373. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  374. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  375. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
  376. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  377. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  378. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
  379. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  380. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  381. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
  382. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  383. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  384. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
  385. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  386. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  387. package/plugins/CmsEntryFilterPlugin.js +0 -15
  388. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  389. package/plugins/index.d.ts +0 -8
  390. package/plugins/index.js +0 -10
  391. package/plugins/index.js.map +0 -1
  392. package/tasks/createIndexTaskPlugin.d.ts +0 -2
  393. package/tasks/createIndexTaskPlugin.js +0 -41
  394. package/tasks/createIndexTaskPlugin.js.map +0 -1
  395. package/values/NoValueContainer.d.ts +0 -5
  396. package/values/NoValueContainer.js +0 -13
  397. package/values/NoValueContainer.js.map +0 -1
@@ -1,40 +1,34 @@
1
- import DataLoader from "dataloader";
1
+ import dataloader from "dataloader";
2
2
  import { createBatchScheduleFn } from "./createBatchScheduleFn.js";
3
3
  import { createLatestSortKey, createPartitionKey } from "../keys.js";
4
- export const createGetLatestRevisionByEntryId = params => {
5
- const {
6
- entity,
7
- tenant
8
- } = params;
9
- const latestKey = createLatestSortKey();
10
- return new DataLoader(async ids => {
11
- const reader = entity.createEntityReader();
12
- const keys = new Set();
13
- for (const id of ids) {
14
- const partitionKey = createPartitionKey({
15
- tenant,
16
- id
17
- });
18
- if (keys.has(partitionKey)) {
19
- continue;
20
- }
21
- keys.add(partitionKey);
22
- reader.get({
23
- PK: partitionKey,
24
- SK: latestKey
25
- });
26
- }
27
- const items = (await reader.execute()).map(item => {
28
- return item.data;
4
+ const createGetLatestRevisionByEntryId = (params)=>{
5
+ const { entity, tenant, modelId } = params;
6
+ const latestKey = createLatestSortKey();
7
+ return new dataloader(async (ids)=>{
8
+ const reader = entity.createEntityReader();
9
+ const keys = new Set();
10
+ for (const id of ids){
11
+ const partitionKey = createPartitionKey({
12
+ tenant,
13
+ id
14
+ });
15
+ if (!keys.has(partitionKey)) {
16
+ keys.add(partitionKey);
17
+ reader.get({
18
+ PK: partitionKey,
19
+ SK: latestKey
20
+ });
21
+ }
22
+ }
23
+ const items = (await reader.execute()).map((item)=>item.data);
24
+ return ids.map((entryId)=>items.filter((item)=>{
25
+ if (item.modelId !== modelId) return false;
26
+ return entryId === item.entryId;
27
+ }));
28
+ }, {
29
+ batchScheduleFn: createBatchScheduleFn()
29
30
  });
30
- return ids.map(entryId => {
31
- return items.filter(item => {
32
- return entryId === item.entryId;
33
- });
34
- });
35
- }, {
36
- batchScheduleFn: createBatchScheduleFn()
37
- });
38
31
  };
32
+ export { createGetLatestRevisionByEntryId };
39
33
 
40
34
  //# sourceMappingURL=getLatestRevisionByEntryId.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DataLoader","createBatchScheduleFn","createLatestSortKey","createPartitionKey","createGetLatestRevisionByEntryId","params","entity","tenant","latestKey","ids","reader","createEntityReader","keys","Set","id","partitionKey","has","add","get","PK","SK","items","execute","map","item","data","entryId","filter","batchScheduleFn"],"sources":["getLatestRevisionByEntryId.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\nimport { createLatestSortKey, createPartitionKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\n\nexport const createGetLatestRevisionByEntryId = (params: IDataLoaderParams) => {\n const { entity, tenant } = params;\n\n const latestKey = createLatestSortKey();\n\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n if (keys.has(partitionKey)) {\n continue;\n }\n keys.add(partitionKey);\n reader.get({\n PK: partitionKey,\n SK: latestKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(entryId => {\n return items.filter(item => {\n return entryId === item.entryId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AAEnC,SAASC,qBAAqB;AAC9B,SAASC,mBAAmB,EAAEC,kBAAkB;AAGhD,OAAO,MAAMC,gCAAgC,GAAIC,MAAyB,IAAK;EAC3E,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEjC,MAAMG,SAAS,GAAGN,mBAAmB,CAAC,CAAC;EAEvC,OAAO,IAAIF,UAAU,CACjB,MAAMS,GAAG,IAAI;IACT,MAAMC,MAAM,GAAGJ,MAAM,CAACK,kBAAkB,CAAC,CAAC;IAE1C,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;IAE9B,KAAK,MAAMC,EAAE,IAAIL,GAAG,EAAE;MAClB,MAAMM,YAAY,GAAGZ,kBAAkB,CAAC;QACpCI,MAAM;QACNO;MACJ,CAAC,CAAC;MACF,IAAIF,IAAI,CAACI,GAAG,CAACD,YAAY,CAAC,EAAE;QACxB;MACJ;MACAH,IAAI,CAACK,GAAG,CAACF,YAAY,CAAC;MACtBL,MAAM,CAACQ,GAAG,CAAC;QACPC,EAAE,EAAEJ,YAAY;QAChBK,EAAE,EAAEZ;MACR,CAAC,CAAC;IACN;IAEA,MAAMa,KAAK,GAAG,CAAC,MAAMX,MAAM,CAACY,OAAO,CAAC,CAAC,EAAEC,GAAG,CAACC,IAAI,IAAI;MAC/C,OAAOA,IAAI,CAACC,IAAI;IACpB,CAAC,CAAC;IAEF,OAAOhB,GAAG,CAACc,GAAG,CAACG,OAAO,IAAI;MACtB,OAAOL,KAAK,CAACM,MAAM,CAACH,IAAI,IAAI;QACxB,OAAOE,OAAO,KAAKF,IAAI,CAACE,OAAO;MACnC,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC,EACD;IACIE,eAAe,EAAE3B,qBAAqB,CAAC;EAC3C,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/dataLoader/getLatestRevisionByEntryId.js","sources":["../../../../src/operations/entry/dataLoader/getLatestRevisionByEntryId.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\nimport { createLatestSortKey, createPartitionKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\n\nexport const createGetLatestRevisionByEntryId = (params: IDataLoaderParams) => {\n const { entity, tenant, modelId } = params;\n\n const latestKey = createLatestSortKey();\n\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n if (keys.has(partitionKey)) {\n continue;\n }\n keys.add(partitionKey);\n reader.get({\n PK: partitionKey,\n SK: latestKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(entryId => {\n return items.filter(item => {\n if (item.modelId !== modelId) {\n return false;\n }\n return entryId === item.entryId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"names":["createGetLatestRevisionByEntryId","params","entity","tenant","modelId","latestKey","createLatestSortKey","DataLoader","ids","reader","keys","Set","id","partitionKey","createPartitionKey","items","item","entryId","createBatchScheduleFn"],"mappings":";;;AAMO,MAAMA,mCAAmC,CAACC;IAC7C,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGH;IAEpC,MAAMI,YAAYC;IAElB,OAAO,IAAIC,WACP,OAAMC;QACF,MAAMC,SAASP,OAAO,kBAAkB;QAExC,MAAMQ,OAAO,IAAIC;QAEjB,KAAK,MAAMC,MAAMJ,IAAK;YAClB,MAAMK,eAAeC,mBAAmB;gBACpCX;gBACAS;YACJ;YACA,KAAIF,KAAK,GAAG,CAACG;gBAGbH,KAAK,GAAG,CAACG;gBACTJ,OAAO,GAAG,CAAC;oBACP,IAAII;oBACJ,IAAIR;gBACR;;QACJ;QAEA,MAAMU,QAAS,OAAMN,OAAO,OAAO,EAAC,EAAG,GAAG,CAACO,CAAAA,OAChCA,KAAK,IAAI;QAGpB,OAAOR,IAAI,GAAG,CAACS,CAAAA,UACJF,MAAM,MAAM,CAACC,CAAAA;gBAChB,IAAIA,KAAK,OAAO,KAAKZ,SACjB,OAAO;gBAEX,OAAOa,YAAYD,KAAK,OAAO;YACnC;IAER,GACA;QACI,iBAAiBE;IACrB;AAER"}
@@ -1,40 +1,34 @@
1
- import DataLoader from "dataloader";
1
+ import dataloader from "dataloader";
2
2
  import { createPartitionKey, createPublishedSortKey } from "../keys.js";
3
3
  import { createBatchScheduleFn } from "./createBatchScheduleFn.js";
4
- export const createGetPublishedRevisionByEntryId = params => {
5
- const {
6
- entity,
7
- tenant
8
- } = params;
9
- const publishedKey = createPublishedSortKey();
10
- return new DataLoader(async ids => {
11
- const reader = entity.createEntityReader();
12
- const keys = new Set();
13
- for (const id of ids) {
14
- const partitionKey = createPartitionKey({
15
- tenant,
16
- id
17
- });
18
- if (keys.has(partitionKey)) {
19
- continue;
20
- }
21
- keys.add(partitionKey);
22
- reader.get({
23
- PK: partitionKey,
24
- SK: publishedKey
25
- });
26
- }
27
- const items = (await reader.execute()).map(item => {
28
- return item.data;
4
+ const createGetPublishedRevisionByEntryId = (params)=>{
5
+ const { entity, tenant, modelId } = params;
6
+ const publishedKey = createPublishedSortKey();
7
+ return new dataloader(async (ids)=>{
8
+ const reader = entity.createEntityReader();
9
+ const keys = new Set();
10
+ for (const id of ids){
11
+ const partitionKey = createPartitionKey({
12
+ tenant,
13
+ id
14
+ });
15
+ if (!keys.has(partitionKey)) {
16
+ keys.add(partitionKey);
17
+ reader.get({
18
+ PK: partitionKey,
19
+ SK: publishedKey
20
+ });
21
+ }
22
+ }
23
+ const items = (await reader.execute()).map((item)=>item.data);
24
+ return ids.map((entryId)=>items.filter((item)=>{
25
+ if (item.modelId !== modelId) return false;
26
+ return entryId === item.entryId;
27
+ }));
28
+ }, {
29
+ batchScheduleFn: createBatchScheduleFn()
29
30
  });
30
- return ids.map(entryId => {
31
- return items.filter(item => {
32
- return entryId === item.entryId;
33
- });
34
- });
35
- }, {
36
- batchScheduleFn: createBatchScheduleFn()
37
- });
38
31
  };
32
+ export { createGetPublishedRevisionByEntryId };
39
33
 
40
34
  //# sourceMappingURL=getPublishedRevisionByEntryId.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DataLoader","createPartitionKey","createPublishedSortKey","createBatchScheduleFn","createGetPublishedRevisionByEntryId","params","entity","tenant","publishedKey","ids","reader","createEntityReader","keys","Set","id","partitionKey","has","add","get","PK","SK","items","execute","map","item","data","entryId","filter","batchScheduleFn"],"sources":["getPublishedRevisionByEntryId.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey, createPublishedSortKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetPublishedRevisionByEntryId = (params: IDataLoaderParams) => {\n const { entity, tenant } = params;\n\n const publishedKey = createPublishedSortKey();\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n if (keys.has(partitionKey)) {\n continue;\n }\n keys.add(partitionKey);\n reader.get({\n PK: partitionKey,\n SK: publishedKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(entryId => {\n return items.filter(item => {\n return entryId === item.entryId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AAEnC,SAASC,kBAAkB,EAAEC,sBAAsB;AAEnD,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,mCAAmC,GAAIC,MAAyB,IAAK;EAC9E,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEjC,MAAMG,YAAY,GAAGN,sBAAsB,CAAC,CAAC;EAC7C,OAAO,IAAIF,UAAU,CACjB,MAAMS,GAAG,IAAI;IACT,MAAMC,MAAM,GAAGJ,MAAM,CAACK,kBAAkB,CAAC,CAAC;IAE1C,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;IAE9B,KAAK,MAAMC,EAAE,IAAIL,GAAG,EAAE;MAClB,MAAMM,YAAY,GAAGd,kBAAkB,CAAC;QACpCM,MAAM;QACNO;MACJ,CAAC,CAAC;MACF,IAAIF,IAAI,CAACI,GAAG,CAACD,YAAY,CAAC,EAAE;QACxB;MACJ;MACAH,IAAI,CAACK,GAAG,CAACF,YAAY,CAAC;MACtBL,MAAM,CAACQ,GAAG,CAAC;QACPC,EAAE,EAAEJ,YAAY;QAChBK,EAAE,EAAEZ;MACR,CAAC,CAAC;IACN;IAEA,MAAMa,KAAK,GAAG,CAAC,MAAMX,MAAM,CAACY,OAAO,CAAC,CAAC,EAAEC,GAAG,CAACC,IAAI,IAAI;MAC/C,OAAOA,IAAI,CAACC,IAAI;IACpB,CAAC,CAAC;IAEF,OAAOhB,GAAG,CAACc,GAAG,CAACG,OAAO,IAAI;MACtB,OAAOL,KAAK,CAACM,MAAM,CAACH,IAAI,IAAI;QACxB,OAAOE,OAAO,KAAKF,IAAI,CAACE,OAAO;MACnC,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC,EACD;IACIE,eAAe,EAAEzB,qBAAqB,CAAC;EAC3C,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/dataLoader/getPublishedRevisionByEntryId.js","sources":["../../../../src/operations/entry/dataLoader/getPublishedRevisionByEntryId.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey, createPublishedSortKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetPublishedRevisionByEntryId = (params: IDataLoaderParams) => {\n const { entity, tenant, modelId } = params;\n\n const publishedKey = createPublishedSortKey();\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n if (keys.has(partitionKey)) {\n continue;\n }\n keys.add(partitionKey);\n reader.get({\n PK: partitionKey,\n SK: publishedKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(entryId => {\n return items.filter(item => {\n if (item.modelId !== modelId) {\n return false;\n }\n return entryId === item.entryId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"names":["createGetPublishedRevisionByEntryId","params","entity","tenant","modelId","publishedKey","createPublishedSortKey","DataLoader","ids","reader","keys","Set","id","partitionKey","createPartitionKey","items","item","entryId","createBatchScheduleFn"],"mappings":";;;AAMO,MAAMA,sCAAsC,CAACC;IAChD,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGH;IAEpC,MAAMI,eAAeC;IACrB,OAAO,IAAIC,WACP,OAAMC;QACF,MAAMC,SAASP,OAAO,kBAAkB;QAExC,MAAMQ,OAAO,IAAIC;QAEjB,KAAK,MAAMC,MAAMJ,IAAK;YAClB,MAAMK,eAAeC,mBAAmB;gBACpCX;gBACAS;YACJ;YACA,KAAIF,KAAK,GAAG,CAACG;gBAGbH,KAAK,GAAG,CAACG;gBACTJ,OAAO,GAAG,CAAC;oBACP,IAAII;oBACJ,IAAIR;gBACR;;QACJ;QAEA,MAAMU,QAAS,OAAMN,OAAO,OAAO,EAAC,EAAG,GAAG,CAACO,CAAAA,OAChCA,KAAK,IAAI;QAGpB,OAAOR,IAAI,GAAG,CAACS,CAAAA,UACJF,MAAM,MAAM,CAACC,CAAAA;gBAChB,IAAIA,KAAK,OAAO,KAAKZ,SACjB,OAAO;gBAEX,OAAOa,YAAYD,KAAK,OAAO;YACnC;IAER,GACA;QACI,iBAAiBE;IACrB;AAER"}
@@ -1,50 +1,40 @@
1
- import DataLoader from "dataloader";
1
+ import dataloader from "dataloader";
2
2
  import { createPartitionKey, createRevisionSortKey } from "../keys.js";
3
3
  import { parseIdentifier } from "@webiny/utils";
4
4
  import { createBatchScheduleFn } from "./createBatchScheduleFn.js";
5
- export const createGetRevisionById = params => {
6
- const {
7
- entity,
8
- tenant
9
- } = params;
10
- return new DataLoader(async ids => {
11
- const reader = entity.createEntityReader();
12
- const keys = new Set();
13
- for (const id of ids) {
14
- const partitionKey = createPartitionKey({
15
- tenant,
16
- id
17
- });
18
- const {
19
- version
20
- } = parseIdentifier(id);
21
- if (version === null) {
22
- continue;
23
- }
24
- const sortKey = createRevisionSortKey({
25
- version
26
- });
27
- const key = `${partitionKey}__${sortKey}`;
28
- if (keys.has(key)) {
29
- continue;
30
- }
31
- keys.add(key);
32
- reader.get({
33
- PK: partitionKey,
34
- SK: sortKey
35
- });
36
- }
37
- const items = (await reader.execute()).map(item => {
38
- return item.data;
5
+ const createGetRevisionById = (params)=>{
6
+ const { entity, tenant, modelId } = params;
7
+ return new dataloader(async (ids)=>{
8
+ const reader = entity.createEntityReader();
9
+ const keys = new Set();
10
+ for (const id of ids){
11
+ const partitionKey = createPartitionKey({
12
+ tenant,
13
+ id
14
+ });
15
+ const { version } = parseIdentifier(id);
16
+ if (null === version) continue;
17
+ const sortKey = createRevisionSortKey({
18
+ version
19
+ });
20
+ const key = `${partitionKey}__${sortKey}`;
21
+ if (!keys.has(key)) {
22
+ keys.add(key);
23
+ reader.get({
24
+ PK: partitionKey,
25
+ SK: sortKey
26
+ });
27
+ }
28
+ }
29
+ const items = (await reader.execute()).map((item)=>item.data);
30
+ return ids.map((id)=>items.filter((item)=>{
31
+ if (item.modelId !== modelId) return false;
32
+ return id === item.id;
33
+ }));
34
+ }, {
35
+ batchScheduleFn: createBatchScheduleFn()
39
36
  });
40
- return ids.map(id => {
41
- return items.filter(item => {
42
- return id === item.id;
43
- });
44
- });
45
- }, {
46
- batchScheduleFn: createBatchScheduleFn()
47
- });
48
37
  };
38
+ export { createGetRevisionById };
49
39
 
50
40
  //# sourceMappingURL=getRevisionById.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DataLoader","createPartitionKey","createRevisionSortKey","parseIdentifier","createBatchScheduleFn","createGetRevisionById","params","entity","tenant","ids","reader","createEntityReader","keys","Set","id","partitionKey","version","sortKey","key","has","add","get","PK","SK","items","execute","map","item","data","filter","batchScheduleFn"],"sources":["getRevisionById.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey, createRevisionSortKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetRevisionById = (params: IDataLoaderParams) => {\n const { entity, tenant } = params;\n\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n const { version } = parseIdentifier(id);\n if (version === null) {\n continue;\n }\n const sortKey = createRevisionSortKey({\n version\n });\n const key = `${partitionKey}__${sortKey}`;\n if (keys.has(key)) {\n continue;\n }\n keys.add(key);\n\n reader.get({\n PK: partitionKey,\n SK: sortKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(id => {\n return items.filter(item => {\n return id === item.id;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AAEnC,SAASC,kBAAkB,EAAEC,qBAAqB;AAElD,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,qBAAqB,GAAIC,MAAyB,IAAK;EAChE,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEjC,OAAO,IAAIN,UAAU,CACjB,MAAMS,GAAG,IAAI;IACT,MAAMC,MAAM,GAAGH,MAAM,CAACI,kBAAkB,CAAC,CAAC;IAE1C,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;IAE9B,KAAK,MAAMC,EAAE,IAAIL,GAAG,EAAE;MAClB,MAAMM,YAAY,GAAGd,kBAAkB,CAAC;QACpCO,MAAM;QACNM;MACJ,CAAC,CAAC;MACF,MAAM;QAAEE;MAAQ,CAAC,GAAGb,eAAe,CAACW,EAAE,CAAC;MACvC,IAAIE,OAAO,KAAK,IAAI,EAAE;QAClB;MACJ;MACA,MAAMC,OAAO,GAAGf,qBAAqB,CAAC;QAClCc;MACJ,CAAC,CAAC;MACF,MAAME,GAAG,GAAG,GAAGH,YAAY,KAAKE,OAAO,EAAE;MACzC,IAAIL,IAAI,CAACO,GAAG,CAACD,GAAG,CAAC,EAAE;QACf;MACJ;MACAN,IAAI,CAACQ,GAAG,CAACF,GAAG,CAAC;MAEbR,MAAM,CAACW,GAAG,CAAC;QACPC,EAAE,EAAEP,YAAY;QAChBQ,EAAE,EAAEN;MACR,CAAC,CAAC;IACN;IAEA,MAAMO,KAAK,GAAG,CAAC,MAAMd,MAAM,CAACe,OAAO,CAAC,CAAC,EAAEC,GAAG,CAACC,IAAI,IAAI;MAC/C,OAAOA,IAAI,CAACC,IAAI;IACpB,CAAC,CAAC;IAEF,OAAOnB,GAAG,CAACiB,GAAG,CAACZ,EAAE,IAAI;MACjB,OAAOU,KAAK,CAACK,MAAM,CAACF,IAAI,IAAI;QACxB,OAAOb,EAAE,KAAKa,IAAI,CAACb,EAAE;MACzB,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC,EACD;IACIgB,eAAe,EAAE1B,qBAAqB,CAAC;EAC3C,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/dataLoader/getRevisionById.js","sources":["../../../../src/operations/entry/dataLoader/getRevisionById.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey, createRevisionSortKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetRevisionById = (params: IDataLoaderParams) => {\n const { entity, tenant, modelId } = params;\n\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n const { version } = parseIdentifier(id);\n if (version === null) {\n continue;\n }\n const sortKey = createRevisionSortKey({\n version\n });\n const key = `${partitionKey}__${sortKey}`;\n if (keys.has(key)) {\n continue;\n }\n keys.add(key);\n\n reader.get({\n PK: partitionKey,\n SK: sortKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(id => {\n return items.filter(item => {\n if (item.modelId !== modelId) {\n return false;\n }\n return id === item.id;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"names":["createGetRevisionById","params","entity","tenant","modelId","DataLoader","ids","reader","keys","Set","id","partitionKey","createPartitionKey","version","parseIdentifier","sortKey","createRevisionSortKey","key","items","item","createBatchScheduleFn"],"mappings":";;;;AAOO,MAAMA,wBAAwB,CAACC;IAClC,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGH;IAEpC,OAAO,IAAII,WACP,OAAMC;QACF,MAAMC,SAASL,OAAO,kBAAkB;QAExC,MAAMM,OAAO,IAAIC;QAEjB,KAAK,MAAMC,MAAMJ,IAAK;YAClB,MAAMK,eAAeC,mBAAmB;gBACpCT;gBACAO;YACJ;YACA,MAAM,EAAEG,OAAO,EAAE,GAAGC,gBAAgBJ;YACpC,IAAIG,AAAY,SAAZA,SACA;YAEJ,MAAME,UAAUC,sBAAsB;gBAClCH;YACJ;YACA,MAAMI,MAAM,GAAGN,aAAa,EAAE,EAAEI,SAAS;YACzC,KAAIP,KAAK,GAAG,CAACS;gBAGbT,KAAK,GAAG,CAACS;gBAETV,OAAO,GAAG,CAAC;oBACP,IAAII;oBACJ,IAAII;gBACR;;QACJ;QAEA,MAAMG,QAAS,OAAMX,OAAO,OAAO,EAAC,EAAG,GAAG,CAACY,CAAAA,OAChCA,KAAK,IAAI;QAGpB,OAAOb,IAAI,GAAG,CAACI,CAAAA,KACJQ,MAAM,MAAM,CAACC,CAAAA;gBAChB,IAAIA,KAAK,OAAO,KAAKf,SACjB,OAAO;gBAEX,OAAOM,OAAOS,KAAK,EAAE;YACzB;IAER,GACA;QACI,iBAAiBC;IACrB;AAER"}
@@ -4,16 +4,15 @@ import { createGetPublishedRevisionByEntryId } from "./getPublishedRevisionByEnt
4
4
  import { createGetRevisionById } from "./getRevisionById.js";
5
5
  export * from "./DataLoaderCache.js";
6
6
  const dataLoaders = {
7
- getAllEntryRevisions: createGetAllEntryRevisions,
8
- getLatestRevisionByEntryId: createGetLatestRevisionByEntryId,
9
- getPublishedRevisionByEntryId: createGetPublishedRevisionByEntryId,
10
- getRevisionById: createGetRevisionById
7
+ getAllEntryRevisions: createGetAllEntryRevisions,
8
+ getLatestRevisionByEntryId: createGetLatestRevisionByEntryId,
9
+ getPublishedRevisionByEntryId: createGetPublishedRevisionByEntryId,
10
+ getRevisionById: createGetRevisionById
11
11
  };
12
- export const getDataLoaderFactory = name => {
13
- if (!dataLoaders[name]) {
14
- throw new Error(`Missing data loader "${name}".`);
15
- }
16
- return dataLoaders[name];
12
+ const getDataLoaderFactory = (name)=>{
13
+ if (!dataLoaders[name]) throw new Error(`Missing data loader "${name}".`);
14
+ return dataLoaders[name];
17
15
  };
16
+ export { getDataLoaderFactory };
18
17
 
19
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createGetAllEntryRevisions","createGetLatestRevisionByEntryId","createGetPublishedRevisionByEntryId","createGetRevisionById","dataLoaders","getAllEntryRevisions","getLatestRevisionByEntryId","getPublishedRevisionByEntryId","getRevisionById","getDataLoaderFactory","name","Error"],"sources":["index.ts"],"sourcesContent":["import type DataLoader from \"dataloader\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { createGetAllEntryRevisions } from \"./getAllEntryRevisions.js\";\nimport { createGetLatestRevisionByEntryId } from \"./getLatestRevisionByEntryId.js\";\nimport { createGetPublishedRevisionByEntryId } from \"./getPublishedRevisionByEntryId.js\";\nimport { createGetRevisionById } from \"./getRevisionById.js\";\n\nexport * from \"./DataLoaderCache.js\";\n\ninterface Callable {\n (params: IDataLoaderParams): DataLoader<any, any>;\n}\n\nconst dataLoaders: Record<string, Callable> = {\n getAllEntryRevisions: createGetAllEntryRevisions,\n getLatestRevisionByEntryId: createGetLatestRevisionByEntryId,\n getPublishedRevisionByEntryId: createGetPublishedRevisionByEntryId,\n getRevisionById: createGetRevisionById\n};\n\nexport type DataLoaders =\n | \"getAllEntryRevisions\"\n | \"getRevisionById\"\n | \"getPublishedRevisionByEntryId\"\n | \"getLatestRevisionByEntryId\";\n\nexport const getDataLoaderFactory = (name: string) => {\n if (!dataLoaders[name]) {\n throw new Error(`Missing data loader \"${name}\".`);\n }\n return dataLoaders[name];\n};\n"],"mappings":"AAEA,SAASA,0BAA0B;AACnC,SAASC,gCAAgC;AACzC,SAASC,mCAAmC;AAC5C,SAASC,qBAAqB;AAE9B;AAMA,MAAMC,WAAqC,GAAG;EAC1CC,oBAAoB,EAAEL,0BAA0B;EAChDM,0BAA0B,EAAEL,gCAAgC;EAC5DM,6BAA6B,EAAEL,mCAAmC;EAClEM,eAAe,EAAEL;AACrB,CAAC;AAQD,OAAO,MAAMM,oBAAoB,GAAIC,IAAY,IAAK;EAClD,IAAI,CAACN,WAAW,CAACM,IAAI,CAAC,EAAE;IACpB,MAAM,IAAIC,KAAK,CAAC,wBAAwBD,IAAI,IAAI,CAAC;EACrD;EACA,OAAON,WAAW,CAACM,IAAI,CAAC;AAC5B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/dataLoader/index.js","sources":["../../../../src/operations/entry/dataLoader/index.ts"],"sourcesContent":["import type DataLoader from \"dataloader\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { createGetAllEntryRevisions } from \"./getAllEntryRevisions.js\";\nimport { createGetLatestRevisionByEntryId } from \"./getLatestRevisionByEntryId.js\";\nimport { createGetPublishedRevisionByEntryId } from \"./getPublishedRevisionByEntryId.js\";\nimport { createGetRevisionById } from \"./getRevisionById.js\";\n\nexport * from \"./DataLoaderCache.js\";\n\ninterface Callable {\n (params: IDataLoaderParams): DataLoader<any, any>;\n}\n\nconst dataLoaders: Record<string, Callable> = {\n getAllEntryRevisions: createGetAllEntryRevisions,\n getLatestRevisionByEntryId: createGetLatestRevisionByEntryId,\n getPublishedRevisionByEntryId: createGetPublishedRevisionByEntryId,\n getRevisionById: createGetRevisionById\n};\n\nexport type DataLoaders =\n | \"getAllEntryRevisions\"\n | \"getRevisionById\"\n | \"getPublishedRevisionByEntryId\"\n | \"getLatestRevisionByEntryId\";\n\nexport const getDataLoaderFactory = (name: string) => {\n if (!dataLoaders[name]) {\n throw new Error(`Missing data loader \"${name}\".`);\n }\n return dataLoaders[name];\n};\n"],"names":["dataLoaders","createGetAllEntryRevisions","createGetLatestRevisionByEntryId","createGetPublishedRevisionByEntryId","createGetRevisionById","getDataLoaderFactory","name","Error"],"mappings":";;;;;AAaA,MAAMA,cAAwC;IAC1C,sBAAsBC;IACtB,4BAA4BC;IAC5B,+BAA+BC;IAC/B,iBAAiBC;AACrB;AAQO,MAAMC,uBAAuB,CAACC;IACjC,IAAI,CAACN,WAAW,CAACM,KAAK,EAClB,MAAM,IAAIC,MAAM,CAAC,qBAAqB,EAAED,KAAK,EAAE,CAAC;IAEpD,OAAON,WAAW,CAACM,KAAK;AAC5B"}
@@ -2,4 +2,5 @@ import type { IEntryEntity } from "../../../definitions/types.js";
2
2
  export interface IDataLoaderParams {
3
3
  entity: IEntryEntity;
4
4
  tenant: string;
5
+ modelId: string;
5
6
  }
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -5,16 +5,13 @@ interface DataLoaderParams {
5
5
  model: Pick<CmsModel, "tenant" | "modelId">;
6
6
  ids: readonly string[];
7
7
  }
8
- interface IDataLoadersHandlerParams {
9
- entity: IEntryEntity;
10
- }
11
8
  export interface ClearAllParams {
12
9
  model: Pick<CmsModel, "tenant" | "modelId">;
13
10
  }
14
- export declare class DataLoadersHandler implements IDataLoadersHandler {
11
+ declare class DataLoadersHandlerImpl implements IDataLoadersHandler {
15
12
  private readonly entity;
16
13
  private readonly cache;
17
- constructor(params: IDataLoadersHandlerParams);
14
+ constructor(entity: IEntryEntity);
18
15
  getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
19
16
  getRevisionById<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
20
17
  getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
@@ -27,4 +24,7 @@ export declare class DataLoadersHandler implements IDataLoadersHandler {
27
24
  private loadMany;
28
25
  clearAll(params?: DataLoadersHandlerInterfaceClearAllParams): void;
29
26
  }
27
+ export declare const DataLoadersHandler: typeof DataLoadersHandlerImpl & {
28
+ __abstraction: import("@webiny/di").Abstraction<IDataLoadersHandler>;
29
+ };
30
30
  export {};
@@ -1,106 +1,98 @@
1
- import WebinyError from "@webiny/error";
1
+ import error from "@webiny/error";
2
2
  import { DataLoaderCache } from "./dataLoader/DataLoaderCache.js";
3
3
  import { getDataLoaderFactory } from "./dataLoader/index.js";
4
4
  import { parseIdentifier } from "@webiny/utils";
5
- export class DataLoadersHandler {
6
- cache = new DataLoaderCache();
7
- constructor(params) {
8
- this.entity = params.entity;
9
- }
10
- async getAllEntryRevisions(params) {
11
- const ids = params.ids.map(id => {
12
- const {
13
- id: entryId
14
- } = parseIdentifier(id);
15
- return entryId;
16
- });
17
- return await this.loadMany("getAllEntryRevisions", params, ids);
18
- }
19
- async getRevisionById(params) {
20
- return await this.loadMany("getRevisionById", params, params.ids);
21
- }
22
- async getPublishedRevisionByEntryId(params) {
23
- const ids = params.ids.map(id => {
24
- const {
25
- id: entryId
26
- } = parseIdentifier(id);
27
- return entryId;
28
- });
29
- return await this.loadMany("getPublishedRevisionByEntryId", params, ids);
30
- }
31
- async getLatestRevisionByEntryId(params) {
32
- const ids = params.ids.map(id => {
33
- const {
34
- id: entryId
35
- } = parseIdentifier(id);
36
- return entryId;
37
- });
38
- return await this.loadMany("getLatestRevisionByEntryId", params, ids);
39
- }
40
-
41
- /**
42
- * TODO @ts-refactor
43
- * Maybe pass on the generics to DataLoader definition?
44
- */
45
- getLoader(name, params) {
46
- const {
47
- model
48
- } = params;
49
- const cacheParams = {
50
- tenant: model.tenant,
51
- name
52
- };
53
- let loader = this.cache.getDataLoader(cacheParams);
54
- if (loader) {
55
- return loader;
5
+ import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
6
+ import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
7
+ class DataLoadersHandlerImpl {
8
+ constructor(entity){
9
+ this.entity = entity;
10
+ this.cache = new DataLoaderCache();
11
+ }
12
+ async getAllEntryRevisions(params) {
13
+ const ids = params.ids.map((id)=>{
14
+ const { id: entryId } = parseIdentifier(id);
15
+ return entryId;
16
+ });
17
+ return await this.loadMany("getAllEntryRevisions", params, ids);
18
+ }
19
+ async getRevisionById(params) {
20
+ return await this.loadMany("getRevisionById", params, params.ids);
21
+ }
22
+ async getPublishedRevisionByEntryId(params) {
23
+ const ids = params.ids.map((id)=>{
24
+ const { id: entryId } = parseIdentifier(id);
25
+ return entryId;
26
+ });
27
+ return await this.loadMany("getPublishedRevisionByEntryId", params, ids);
56
28
  }
57
- const factory = getDataLoaderFactory(name);
58
- loader = factory({
59
- entity: this.entity,
60
- tenant: model.tenant
61
- });
62
- this.cache.setDataLoader(cacheParams, loader);
63
- return loader;
64
- }
65
- async loadMany(loader, params, ids) {
66
- let results = [];
67
- try {
68
- results = await this.getLoader(loader, params).loadMany(ids);
69
- if (Array.isArray(results) === true) {
70
- return results.reduce((acc, res) => {
71
- if (Array.isArray(res) === false) {
72
- if (res && res.message) {
73
- throw new WebinyError(res.message, res.code, {
74
- ...res,
75
- data: JSON.stringify(res.data || {})
76
- });
77
- }
78
- throw new WebinyError("Result from the data loader must be an array of arrays which contain requested items.", "DATA_LOADER_RESULTS_ERROR", {
79
- ...params,
80
- loader
29
+ async getLatestRevisionByEntryId(params) {
30
+ const ids = params.ids.map((id)=>{
31
+ const { id: entryId } = parseIdentifier(id);
32
+ return entryId;
33
+ });
34
+ return await this.loadMany("getLatestRevisionByEntryId", params, ids);
35
+ }
36
+ getLoader(name, params) {
37
+ const { model } = params;
38
+ const cacheParams = {
39
+ tenant: model.tenant,
40
+ modelId: model.modelId,
41
+ name
42
+ };
43
+ let loader = this.cache.getDataLoader(cacheParams);
44
+ if (loader) return loader;
45
+ const factory = getDataLoaderFactory(name);
46
+ loader = factory({
47
+ entity: this.entity,
48
+ tenant: model.tenant,
49
+ modelId: model.modelId
50
+ });
51
+ this.cache.setDataLoader(cacheParams, loader);
52
+ return loader;
53
+ }
54
+ async loadMany(loader, params, ids) {
55
+ let results = [];
56
+ try {
57
+ results = await this.getLoader(loader, params).loadMany(ids);
58
+ if (true === Array.isArray(results)) return results.reduce((acc, res)=>{
59
+ if (false === Array.isArray(res)) {
60
+ if (res && res.message) throw new error(res.message, res.code, {
61
+ ...res,
62
+ data: JSON.stringify(res.data || {})
63
+ });
64
+ throw new error("Result from the data loader must be an array of arrays which contain requested items.", "DATA_LOADER_RESULTS_ERROR", {
65
+ ...params,
66
+ loader
67
+ });
68
+ }
69
+ acc.push(...res);
70
+ return acc;
71
+ }, []);
72
+ } catch (ex) {
73
+ throw new error(ex.message || "Data loader error.", ex.code || "DATA_LOADER_ERROR", {
74
+ error: ex,
75
+ ...params,
76
+ loader,
77
+ ids
81
78
  });
82
- }
83
- acc.push(...res);
84
- return acc;
85
- }, []);
86
- }
87
- } catch (ex) {
88
- throw new WebinyError(ex.message || "Data loader error.", ex.code || "DATA_LOADER_ERROR", {
89
- error: ex,
90
- ...params,
91
- loader,
92
- ids
93
- });
79
+ }
80
+ throw new error("Data loader did not return array of items or empty array.", "INVALID_DATA_LOADER_RESULT", {
81
+ loader,
82
+ ids,
83
+ results
84
+ });
85
+ }
86
+ clearAll(params) {
87
+ this.cache.clearAll(params);
94
88
  }
95
- throw new WebinyError(`Data loader did not return array of items or empty array.`, "INVALID_DATA_LOADER_RESULT", {
96
- loader,
97
- ids,
98
- results
99
- });
100
- }
101
- clearAll(params) {
102
- this.cache.clearAll(params?.model);
103
- }
104
89
  }
90
+ const DataLoadersHandler = CmsDdbEsDataLoaders.createImplementation({
91
+ implementation: DataLoadersHandlerImpl,
92
+ dependencies: [
93
+ CmsDdbEsEntryEntity
94
+ ]
95
+ });
96
+ export { DataLoadersHandler };
105
97
 
106
98
  //# sourceMappingURL=dataLoaders.js.map