@webiny/api-headless-cms-ddb-es 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/configurations.d.ts +5 -4
  2. package/configurations.js +27 -33
  3. package/configurations.js.map +1 -1
  4. package/definitions/entry.js +7 -9
  5. package/definitions/entry.js.map +1 -1
  6. package/definitions/group.js +7 -9
  7. package/definitions/group.js.map +1 -1
  8. package/definitions/model.js +7 -9
  9. package/definitions/model.js.map +1 -1
  10. package/definitions/types.d.ts +9 -3
  11. package/definitions/types.js +0 -3
  12. package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
  13. package/elasticsearch/createElasticsearchIndex.js +52 -27
  14. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  15. package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
  16. package/elasticsearch/deleteElasticsearchIndex.js +18 -26
  17. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  18. package/exports/api/cms/opensearch.d.ts +9 -0
  19. package/exports/api/cms/opensearch.js +9 -0
  20. package/feature.d.ts +1 -0
  21. package/feature.js +179 -0
  22. package/feature.js.map +1 -0
  23. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
  24. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +5 -0
  25. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
  26. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
  27. package/features/CmsEntryOpenSearchBodyModifier/index.js +1 -0
  28. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +14 -0
  29. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +42 -0
  30. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  31. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +32 -0
  32. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +5 -0
  33. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
  34. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
  35. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +5 -0
  36. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
  37. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
  38. package/features/CmsEntryOpenSearchFieldIndex/constants.js +4 -0
  39. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
  40. package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
  41. package/features/CmsEntryOpenSearchFieldIndex/feature.js +29 -0
  42. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
  43. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
  44. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +60 -0
  45. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
  46. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +13 -0
  47. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +33 -0
  48. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
  49. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
  50. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +21 -0
  51. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
  52. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
  53. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +22 -0
  54. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
  55. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
  56. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +32 -0
  57. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
  58. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +12 -0
  59. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +107 -0
  60. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
  61. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
  62. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +21 -0
  63. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
  64. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +15 -0
  65. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +40 -0
  66. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +1 -0
  67. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +15 -0
  68. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +40 -0
  69. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +1 -0
  70. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
  71. package/features/CmsEntryOpenSearchFieldIndex/index.js +3 -0
  72. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
  73. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +36 -0
  74. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  75. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
  76. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +5 -0
  77. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
  78. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
  79. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +5 -0
  80. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
  81. package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
  82. package/features/CmsEntryOpenSearchFilter/constants.js +4 -0
  83. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
  84. package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
  85. package/features/CmsEntryOpenSearchFilter/feature.js +17 -0
  86. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
  87. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
  88. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +26 -0
  89. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
  90. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
  91. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +43 -0
  92. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
  93. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
  94. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +36 -0
  95. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
  96. package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
  97. package/features/CmsEntryOpenSearchFilter/index.js +3 -0
  98. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
  99. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +5 -0
  100. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
  101. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
  102. package/features/CmsEntryOpenSearchFullTextSearch/index.js +1 -0
  103. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
  104. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
  105. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
  106. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
  107. package/features/CmsEntryOpenSearchIndex/abstractions.js +5 -0
  108. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
  109. package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
  110. package/features/CmsEntryOpenSearchIndex/feature.js +11 -0
  111. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
  112. package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
  113. package/features/CmsEntryOpenSearchIndex/index.js +3 -0
  114. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
  115. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +5 -0
  116. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
  117. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
  118. package/features/CmsEntryOpenSearchQueryModifier/index.js +1 -0
  119. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
  120. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +5 -0
  121. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
  122. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
  123. package/features/CmsEntryOpenSearchSortModifier/index.js +1 -0
  124. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
  125. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +31 -0
  126. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  127. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
  128. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +5 -0
  129. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
  130. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
  131. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +5 -0
  132. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
  133. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
  134. package/features/CmsEntryOpenSearchValueSearch/feature.js +17 -0
  135. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
  136. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
  137. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +21 -0
  138. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
  139. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
  140. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +44 -0
  141. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
  142. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
  143. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +22 -0
  144. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
  145. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
  146. package/features/CmsEntryOpenSearchValueSearch/index.js +3 -0
  147. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
  148. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +5 -0
  149. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
  150. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
  151. package/features/CmsEntryOpenSearchValuesModifier/index.js +1 -0
  152. package/helpers/entryIndexHelpers.d.ts +6 -4
  153. package/helpers/entryIndexHelpers.js +70 -186
  154. package/helpers/entryIndexHelpers.js.map +1 -1
  155. package/helpers/fieldIdentifier.js +18 -30
  156. package/helpers/fieldIdentifier.js.map +1 -1
  157. package/helpers/index.js +0 -2
  158. package/index.d.ts +1 -3
  159. package/index.js +1 -190
  160. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
  161. package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
  162. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  163. package/operations/entry/dataLoader/constants.js +2 -1
  164. package/operations/entry/dataLoader/constants.js.map +1 -1
  165. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  166. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  167. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
  168. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  169. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +28 -34
  170. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  171. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +28 -34
  172. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  173. package/operations/entry/dataLoader/getRevisionById.js +33 -43
  174. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  175. package/operations/entry/dataLoader/index.js +8 -9
  176. package/operations/entry/dataLoader/index.js.map +1 -1
  177. package/operations/entry/dataLoader/types.d.ts +1 -0
  178. package/operations/entry/dataLoader/types.js +0 -3
  179. package/operations/entry/dataLoaders.js +81 -97
  180. package/operations/entry/dataLoaders.js.map +1 -1
  181. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  182. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +6 -24
  183. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  184. package/operations/entry/elasticsearch/body.d.ts +19 -3
  185. package/operations/entry/elasticsearch/body.js +74 -122
  186. package/operations/entry/elasticsearch/body.js.map +1 -1
  187. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
  188. package/operations/entry/elasticsearch/fields/createSystemField.js +9 -0
  189. package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
  190. package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
  191. package/operations/entry/elasticsearch/fields/live.js +50 -0
  192. package/operations/entry/elasticsearch/fields/live.js.map +1 -0
  193. package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
  194. package/operations/entry/elasticsearch/fields/location.js +50 -0
  195. package/operations/entry/elasticsearch/fields/location.js.map +1 -0
  196. package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
  197. package/operations/entry/elasticsearch/fields/state.js +104 -0
  198. package/operations/entry/elasticsearch/fields/state.js.map +1 -0
  199. package/operations/entry/elasticsearch/fields.d.ts +6 -4
  200. package/operations/entry/elasticsearch/fields.js +194 -388
  201. package/operations/entry/elasticsearch/fields.js.map +1 -1
  202. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +6 -5
  203. package/operations/entry/elasticsearch/filtering/applyFiltering.js +32 -45
  204. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  205. package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -2
  206. package/operations/entry/elasticsearch/filtering/exec.js +84 -166
  207. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  208. package/operations/entry/elasticsearch/filtering/index.js +0 -2
  209. package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
  210. package/operations/entry/elasticsearch/filtering/path.js +24 -35
  211. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  212. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -2
  213. package/operations/entry/elasticsearch/filtering/populated.js +8 -14
  214. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  215. package/operations/entry/elasticsearch/filtering/values.js +11 -12
  216. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  217. package/operations/entry/elasticsearch/fullTextSearch.d.ts +7 -6
  218. package/operations/entry/elasticsearch/fullTextSearch.js +45 -79
  219. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  220. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +4 -4
  221. package/operations/entry/elasticsearch/fullTextSearchFields.js +7 -17
  222. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  223. package/operations/entry/elasticsearch/initialQuery.d.ts +3 -3
  224. package/operations/entry/elasticsearch/initialQuery.js +37 -80
  225. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  226. package/operations/entry/elasticsearch/keyword.js +13 -27
  227. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  228. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
  229. package/operations/entry/elasticsearch/plugins/operator.js +10 -21
  230. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  231. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -4
  232. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  233. package/operations/entry/elasticsearch/sort.d.ts +4 -4
  234. package/operations/entry/elasticsearch/sort.js +69 -96
  235. package/operations/entry/elasticsearch/sort.js.map +1 -1
  236. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
  237. package/operations/entry/elasticsearch/transformValueForSearch.js +9 -24
  238. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  239. package/operations/entry/elasticsearch/types.d.ts +3 -10
  240. package/operations/entry/elasticsearch/types.js +0 -3
  241. package/operations/entry/index.d.ts +22 -2
  242. package/operations/entry/index.js +1316 -1650
  243. package/operations/entry/index.js.map +1 -1
  244. package/operations/entry/keys.js +43 -63
  245. package/operations/entry/keys.js.map +1 -1
  246. package/operations/entry/recordType.js +4 -9
  247. package/operations/entry/recordType.js.map +1 -1
  248. package/operations/entry/transformations/convertEntryKeys.js +21 -26
  249. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  250. package/operations/entry/transformations/index.d.ts +6 -2
  251. package/operations/entry/transformations/index.js +84 -112
  252. package/operations/entry/transformations/index.js.map +1 -1
  253. package/operations/entry/transformations/modifyEntryValues.d.ts +6 -4
  254. package/operations/entry/transformations/modifyEntryValues.js +12 -17
  255. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  256. package/operations/entry/transformations/transformEntryKeys.js +13 -16
  257. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  258. package/operations/entry/transformations/transformEntryToIndex.d.ts +2 -2
  259. package/operations/entry/transformations/transformEntryToIndex.js +16 -20
  260. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  261. package/operations/group/index.d.ts +2 -2
  262. package/operations/group/index.js +115 -139
  263. package/operations/group/index.js.map +1 -1
  264. package/operations/model/index.d.ts +1 -1
  265. package/operations/model/index.js +128 -157
  266. package/operations/model/index.js.map +1 -1
  267. package/package.json +35 -30
  268. package/tasks/createIndexTaskPlugin.js +36 -32
  269. package/tasks/createIndexTaskPlugin.js.map +1 -1
  270. package/types.d.ts +7 -112
  271. package/types.js +7 -36
  272. package/types.js.map +1 -1
  273. package/values/NoValueContainer.js +8 -10
  274. package/values/NoValueContainer.js.map +1 -1
  275. package/definitions/types.js.map +0 -1
  276. package/dynamoDb/index.d.ts +0 -3
  277. package/dynamoDb/index.js +0 -8
  278. package/dynamoDb/index.js.map +0 -1
  279. package/dynamoDb/storage/longText.d.ts +0 -10
  280. package/dynamoDb/storage/longText.js +0 -88
  281. package/dynamoDb/storage/longText.js.map +0 -1
  282. package/dynamoDb/storage/richText.d.ts +0 -2
  283. package/dynamoDb/storage/richText.js +0 -51
  284. package/dynamoDb/storage/richText.js.map +0 -1
  285. package/elasticsearch/index.d.ts +0 -2
  286. package/elasticsearch/index.js +0 -5
  287. package/elasticsearch/index.js.map +0 -1
  288. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  289. package/elasticsearch/indexing/dateTimeIndexing.js +0 -81
  290. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  291. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  292. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
  293. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  294. package/elasticsearch/indexing/index.d.ts +0 -2
  295. package/elasticsearch/indexing/index.js +0 -10
  296. package/elasticsearch/indexing/index.js.map +0 -1
  297. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  298. package/elasticsearch/indexing/jsonIndexing.js +0 -21
  299. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  300. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  301. package/elasticsearch/indexing/longTextIndexing.js +0 -35
  302. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  303. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  304. package/elasticsearch/indexing/numberIndexing.js +0 -34
  305. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  306. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  307. package/elasticsearch/indexing/objectIndexing.js +0 -194
  308. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  309. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  310. package/elasticsearch/indexing/richTextIndexing.js +0 -24
  311. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  312. package/elasticsearch/indices/base.d.ts +0 -2
  313. package/elasticsearch/indices/base.js +0 -7
  314. package/elasticsearch/indices/base.js.map +0 -1
  315. package/elasticsearch/indices/index.d.ts +0 -1
  316. package/elasticsearch/indices/index.js +0 -6
  317. package/elasticsearch/indices/index.js.map +0 -1
  318. package/elasticsearch/search/index.d.ts +0 -3
  319. package/elasticsearch/search/index.js +0 -6
  320. package/elasticsearch/search/index.js.map +0 -1
  321. package/elasticsearch/search/refSearch.d.ts +0 -2
  322. package/elasticsearch/search/refSearch.js +0 -24
  323. package/elasticsearch/search/refSearch.js.map +0 -1
  324. package/elasticsearch/search/searchableJson.d.ts +0 -2
  325. package/elasticsearch/search/searchableJson.js +0 -53
  326. package/elasticsearch/search/searchableJson.js.map +0 -1
  327. package/elasticsearch/search/timeSearch.d.ts +0 -2
  328. package/elasticsearch/search/timeSearch.js +0 -20
  329. package/elasticsearch/search/timeSearch.js.map +0 -1
  330. package/helpers/index.js.map +0 -1
  331. package/index.js.map +0 -1
  332. package/operations/entry/dataLoader/types.js.map +0 -1
  333. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  334. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  335. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
  336. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  337. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  338. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
  339. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  340. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  341. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
  342. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  343. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  344. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
  345. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  346. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  347. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
  348. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  349. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  350. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
  351. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  352. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  353. package/operations/entry/elasticsearch/plugins/search.js +0 -18
  354. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  355. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  356. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
  357. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  358. package/operations/entry/elasticsearch/types.js.map +0 -1
  359. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  360. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
  361. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  362. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  363. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
  364. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  365. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  366. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
  367. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  368. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  369. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
  370. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  371. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  372. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
  373. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  374. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  375. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
  376. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  377. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  378. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
  379. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  380. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  381. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
  382. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  383. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  384. package/plugins/CmsEntryFilterPlugin.js +0 -15
  385. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  386. package/plugins/index.d.ts +0 -8
  387. package/plugins/index.js +0 -10
  388. package/plugins/index.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import type { PluginsContainer } from "@webiny/plugins";
2
1
  import type { CmsEntry, CmsEntryValues, CmsStorageEntry, StorageOperationsCmsModel } from "@webiny/api-headless-cms/types/index.js";
2
+ import type { CmsEntryOpenSearchFieldIndexRegistry } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
3
3
  interface TransformEntryToIndexParams<T extends CmsEntryValues = CmsEntryValues> {
4
- plugins: PluginsContainer;
5
4
  model: StorageOperationsCmsModel<T>;
6
5
  entry: CmsEntry<T>;
7
6
  storageEntry: CmsStorageEntry<T>;
7
+ fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;
8
8
  }
9
9
  export declare const transformEntryToIndex: <T extends CmsEntryValues = CmsEntryValues>(params: TransformEntryToIndexParams<T>) => import("../../../types").CmsIndexEntry<T>;
10
10
  export {};
@@ -1,24 +1,20 @@
1
1
  import { prepareEntryToIndex } from "../../../helpers/index.js";
2
- export const transformEntryToIndex = params => {
3
- const {
4
- plugins,
5
- model,
6
- entry,
7
- storageEntry
8
- } = params;
9
- const result = prepareEntryToIndex({
10
- plugins,
11
- model,
12
- entry: structuredClone(entry),
13
- storageEntry: structuredClone(storageEntry)
14
- });
15
- delete result["PK"];
16
- delete result["SK"];
17
- delete result["GSI1_PK"];
18
- delete result["GSI1_SK"];
19
- delete result["published"];
20
- delete result["latest"];
21
- return result;
2
+ const transformEntryToIndex = (params)=>{
3
+ const { model, entry, storageEntry, fieldIndexRegistry } = params;
4
+ const result = prepareEntryToIndex({
5
+ model,
6
+ entry: structuredClone(entry),
7
+ storageEntry: structuredClone(storageEntry),
8
+ fieldIndexRegistry
9
+ });
10
+ delete result["PK"];
11
+ delete result["SK"];
12
+ delete result["GSI1_PK"];
13
+ delete result["GSI1_SK"];
14
+ delete result["published"];
15
+ delete result["latest"];
16
+ return result;
22
17
  };
18
+ export { transformEntryToIndex };
23
19
 
24
20
  //# sourceMappingURL=transformEntryToIndex.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["prepareEntryToIndex","transformEntryToIndex","params","plugins","model","entry","storageEntry","result","structuredClone"],"sources":["transformEntryToIndex.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport type {\n CmsEntry,\n CmsEntryValues,\n CmsStorageEntry,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { prepareEntryToIndex } from \"~/helpers/index.js\";\n\ninterface TransformEntryToIndexParams<T extends CmsEntryValues = CmsEntryValues> {\n plugins: PluginsContainer;\n model: StorageOperationsCmsModel<T>;\n entry: CmsEntry<T>;\n storageEntry: CmsStorageEntry<T>;\n}\n\nexport const transformEntryToIndex = <T extends CmsEntryValues = CmsEntryValues>(\n params: TransformEntryToIndexParams<T>\n) => {\n const { plugins, model, entry, storageEntry } = params;\n const result = prepareEntryToIndex<T>({\n plugins,\n model,\n entry: structuredClone(entry),\n storageEntry: structuredClone(storageEntry)\n });\n\n delete result[\"PK\"];\n delete result[\"SK\"];\n delete result[\"GSI1_PK\"];\n delete result[\"GSI1_SK\"];\n delete result[\"published\"];\n delete result[\"latest\"];\n\n return result;\n};\n"],"mappings":"AAOA,SAASA,mBAAmB;AAS5B,OAAO,MAAMC,qBAAqB,GAC9BC,MAAsC,IACrC;EACD,MAAM;IAAEC,OAAO;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGJ,MAAM;EACtD,MAAMK,MAAM,GAAGP,mBAAmB,CAAI;IAClCG,OAAO;IACPC,KAAK;IACLC,KAAK,EAAEG,eAAe,CAACH,KAAK,CAAC;IAC7BC,YAAY,EAAEE,eAAe,CAACF,YAAY;EAC9C,CAAC,CAAC;EAEF,OAAOC,MAAM,CAAC,IAAI,CAAC;EACnB,OAAOA,MAAM,CAAC,IAAI,CAAC;EACnB,OAAOA,MAAM,CAAC,SAAS,CAAC;EACxB,OAAOA,MAAM,CAAC,SAAS,CAAC;EACxB,OAAOA,MAAM,CAAC,WAAW,CAAC;EAC1B,OAAOA,MAAM,CAAC,QAAQ,CAAC;EAEvB,OAAOA,MAAM;AACjB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/entry/transformations/transformEntryToIndex.js","sources":["../../../../src/operations/entry/transformations/transformEntryToIndex.ts"],"sourcesContent":["import type {\n CmsEntry,\n CmsEntryValues,\n CmsStorageEntry,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { prepareEntryToIndex } from \"~/helpers/index.js\";\nimport type { CmsEntryOpenSearchFieldIndexRegistry } from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\n\ninterface TransformEntryToIndexParams<T extends CmsEntryValues = CmsEntryValues> {\n model: StorageOperationsCmsModel<T>;\n entry: CmsEntry<T>;\n storageEntry: CmsStorageEntry<T>;\n fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;\n}\n\nexport const transformEntryToIndex = <T extends CmsEntryValues = CmsEntryValues>(\n params: TransformEntryToIndexParams<T>\n) => {\n const { model, entry, storageEntry, fieldIndexRegistry } = params;\n const result = prepareEntryToIndex<T>({\n model,\n entry: structuredClone(entry),\n storageEntry: structuredClone(storageEntry),\n fieldIndexRegistry\n });\n\n delete result[\"PK\"];\n delete result[\"SK\"];\n delete result[\"GSI1_PK\"];\n delete result[\"GSI1_SK\"];\n delete result[\"published\"];\n delete result[\"latest\"];\n\n return result;\n};\n"],"names":["transformEntryToIndex","params","model","entry","storageEntry","fieldIndexRegistry","result","prepareEntryToIndex","structuredClone"],"mappings":";AAgBO,MAAMA,wBAAwB,CACjCC;IAEA,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAEC,kBAAkB,EAAE,GAAGJ;IAC3D,MAAMK,SAASC,oBAAuB;QAClCL;QACA,OAAOM,gBAAgBL;QACvB,cAAcK,gBAAgBJ;QAC9BC;IACJ;IAEA,OAAOC,MAAM,CAAC,KAAK;IACnB,OAAOA,MAAM,CAAC,KAAK;IACnB,OAAOA,MAAM,CAAC,UAAU;IACxB,OAAOA,MAAM,CAAC,UAAU;IACxB,OAAOA,MAAM,CAAC,YAAY;IAC1B,OAAOA,MAAM,CAAC,SAAS;IAEvB,OAAOA;AACX"}
@@ -1,9 +1,9 @@
1
1
  import type { CmsGroupStorageOperations } from "@webiny/api-headless-cms/types/index.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
2
  import { IGroupEntity } from "../../definitions/types.js";
3
+ import type { CmsContext } from "../../types.js";
4
4
  interface CreateGroupsStorageOperationsParams {
5
5
  entity: IGroupEntity;
6
- plugins: PluginsContainer;
6
+ container: CmsContext["container"];
7
7
  }
8
8
  export declare const createGroupsStorageOperations: (params: CreateGroupsStorageOperationsParams) => CmsGroupStorageOperations;
9
9
  export {};
@@ -1,145 +1,121 @@
1
- import WebinyError from "@webiny/error";
2
- import { filterItems, sortItems, ValueFilterPlugin } from "@webiny/db-dynamodb";
3
- const createPartitionKey = params => {
4
- const {
5
- tenant
6
- } = params;
7
- return `T#${tenant}#CMS#CMG`;
1
+ import error from "@webiny/error";
2
+ import { sortItems } from "@webiny/db-dynamodb";
3
+ import { FilterUtil } from "@webiny/db-dynamodb/exports/api/db.js";
4
+ const createPartitionKey = (params)=>{
5
+ const { tenant } = params;
6
+ return `T#${tenant}#CMS#CMG`;
8
7
  };
9
- const createSortKeys = params => {
10
- const {
11
- id
12
- } = params;
13
- return id;
8
+ const createSortKeys = (params)=>{
9
+ const { id } = params;
10
+ return id;
14
11
  };
15
- const createKeys = params => {
16
- return {
17
- PK: createPartitionKey(params),
18
- SK: createSortKeys(params),
19
- GSI_TENANT: params.tenant
20
- };
21
- };
22
- const createType = () => {
23
- return "cms.group";
24
- };
25
- export const createGroupsStorageOperations = params => {
26
- const {
27
- entity,
28
- plugins
29
- } = params;
30
- const filteringPlugins = plugins.byType(ValueFilterPlugin.type);
31
- if (filteringPlugins.length === 0) {
32
- throw new WebinyError("DynamoDB filtering plugins not loaded.", "MISSING_DYNAMODB_FILTERING_PLUGINS");
33
- }
34
- const create = async params => {
35
- const {
36
- group
37
- } = params;
38
- const keys = createKeys(group);
39
- try {
40
- await entity.put({
41
- data: group,
42
- TYPE: createType(),
43
- ...keys
44
- });
45
- } catch (ex) {
46
- throw new WebinyError(ex.message || "Could not create group.", ex.code || "CREATE_GROUP_ERROR", {
47
- error: ex,
48
- group,
49
- keys
50
- });
51
- }
52
- };
53
- const update = async params => {
54
- const {
55
- group
56
- } = params;
57
- const keys = createKeys(group);
58
- try {
59
- await entity.put({
60
- data: group,
61
- TYPE: createType(),
62
- ...keys
63
- });
64
- } catch (ex) {
65
- throw new WebinyError(ex.message || "Could not update group.", ex.code || "UPDATE_GROUP_ERROR", {
66
- error: ex,
67
- group,
68
- keys
69
- });
70
- }
71
- };
72
- const deleteGroup = async params => {
73
- const {
74
- group
75
- } = params;
76
- const keys = createKeys(group);
77
- try {
78
- await entity.delete(keys);
79
- } catch (ex) {
80
- throw new WebinyError(ex.message || "Could not delete group.", ex.code || "DELETE_GROUP_ERROR", {
81
- error: ex,
82
- group,
83
- keys
84
- });
85
- }
86
- };
87
- const get = async params => {
88
- const keys = createKeys(params);
89
- try {
90
- const result = await entity.get(keys);
91
- return result ? result.data : null;
92
- } catch (ex) {
93
- throw new WebinyError(ex.message || "Could not get group.", ex.code || "GET_GROUP_ERROR", {
94
- error: ex,
95
- ...params,
96
- keys
97
- });
98
- }
99
- };
100
- const list = async params => {
101
- const {
102
- sort,
103
- where
104
- } = params;
105
- let records = [];
106
- try {
107
- const ddbRecords = await entity.queryAll({
108
- partitionKey: createPartitionKey(where),
109
- options: {
110
- gte: " "
111
- }
112
- });
113
- records = ddbRecords.map(item => item.data);
114
- } catch (ex) {
115
- throw new WebinyError(ex.message || "Could not list groups.", ex.code || "LIST_GROUP_ERROR", {
116
- error: ex,
117
- ...params,
118
- sort,
119
- where
120
- });
121
- }
122
- const filteredItems = filterItems({
123
- items: records,
124
- where,
125
- fields: [],
126
- plugins
12
+ const createKeys = (params)=>({
13
+ PK: createPartitionKey(params),
14
+ SK: createSortKeys(params),
15
+ GSI_TENANT: params.tenant
127
16
  });
128
- if (!sort || sort.length === 0) {
129
- return filteredItems;
130
- }
131
- return sortItems({
132
- items: filteredItems,
133
- sort
134
- });
135
- };
136
- return {
137
- create,
138
- update,
139
- delete: deleteGroup,
140
- get,
141
- list
142
- };
17
+ const createType = ()=>"cms.group";
18
+ const createGroupsStorageOperations = (params)=>{
19
+ const { entity, container } = params;
20
+ const filterUtil = container.resolve(FilterUtil);
21
+ const create = async (params)=>{
22
+ const { group } = params;
23
+ const keys = createKeys(group);
24
+ try {
25
+ await entity.put({
26
+ data: group,
27
+ TYPE: createType(),
28
+ ...keys
29
+ });
30
+ } catch (ex) {
31
+ throw new error(ex.message || "Could not create group.", ex.code || "CREATE_GROUP_ERROR", {
32
+ error: ex,
33
+ group,
34
+ keys
35
+ });
36
+ }
37
+ };
38
+ const update = async (params)=>{
39
+ const { group } = params;
40
+ const keys = createKeys(group);
41
+ try {
42
+ await entity.put({
43
+ data: group,
44
+ TYPE: createType(),
45
+ ...keys
46
+ });
47
+ } catch (ex) {
48
+ throw new error(ex.message || "Could not update group.", ex.code || "UPDATE_GROUP_ERROR", {
49
+ error: ex,
50
+ group,
51
+ keys
52
+ });
53
+ }
54
+ };
55
+ const deleteGroup = async (params)=>{
56
+ const { group } = params;
57
+ const keys = createKeys(group);
58
+ try {
59
+ await entity.delete(keys);
60
+ } catch (ex) {
61
+ throw new error(ex.message || "Could not delete group.", ex.code || "DELETE_GROUP_ERROR", {
62
+ error: ex,
63
+ group,
64
+ keys
65
+ });
66
+ }
67
+ };
68
+ const get = async (params)=>{
69
+ const keys = createKeys(params);
70
+ try {
71
+ const result = await entity.get(keys);
72
+ return result ? result.data : null;
73
+ } catch (ex) {
74
+ throw new error(ex.message || "Could not get group.", ex.code || "GET_GROUP_ERROR", {
75
+ error: ex,
76
+ ...params,
77
+ keys
78
+ });
79
+ }
80
+ };
81
+ const list = async (params)=>{
82
+ const { sort, where } = params;
83
+ let records = [];
84
+ try {
85
+ const ddbRecords = await entity.queryAll({
86
+ partitionKey: createPartitionKey(where),
87
+ options: {
88
+ gte: " "
89
+ }
90
+ });
91
+ records = ddbRecords.map((item)=>item.data);
92
+ } catch (ex) {
93
+ throw new error(ex.message || "Could not list groups.", ex.code || "LIST_GROUP_ERROR", {
94
+ error: ex,
95
+ ...params,
96
+ sort,
97
+ where
98
+ });
99
+ }
100
+ const filteredItems = filterUtil.filter({
101
+ items: records,
102
+ where,
103
+ fields: []
104
+ });
105
+ if (!sort || 0 === sort.length) return filteredItems;
106
+ return sortItems({
107
+ items: filteredItems,
108
+ sort
109
+ });
110
+ };
111
+ return {
112
+ create,
113
+ update,
114
+ delete: deleteGroup,
115
+ get,
116
+ list
117
+ };
143
118
  };
119
+ export { createGroupsStorageOperations };
144
120
 
145
121
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","filterItems","sortItems","ValueFilterPlugin","createPartitionKey","params","tenant","createSortKeys","id","createKeys","PK","SK","GSI_TENANT","createType","createGroupsStorageOperations","entity","plugins","filteringPlugins","byType","type","length","create","group","keys","put","data","TYPE","ex","message","code","error","update","deleteGroup","delete","get","result","list","sort","where","records","ddbRecords","queryAll","partitionKey","options","gte","map","item","filteredItems","items","fields"],"sources":["index.ts"],"sourcesContent":["import type {\n CmsGroup,\n CmsGroupStorageOperations,\n CmsGroupStorageOperationsCreateParams,\n CmsGroupStorageOperationsDeleteParams,\n CmsGroupStorageOperationsGetParams,\n CmsGroupStorageOperationsListParams,\n CmsGroupStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { filterItems, sortItems, ValueFilterPlugin } from \"@webiny/db-dynamodb\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { IGroupEntity } from \"~/definitions/types.js\";\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = (params: PartitionKeyParams): string => {\n const { tenant } = params;\n return `T#${tenant}#CMS#CMG`;\n};\n\ninterface SortKeyParams {\n id: string;\n}\nconst createSortKeys = (params: SortKeyParams): string => {\n const { id } = params;\n return id;\n};\n\ninterface IDynamoDbTableKeys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\nconst createKeys = (params: PartitionKeyParams & SortKeyParams): IDynamoDbTableKeys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKeys(params),\n GSI_TENANT: params.tenant\n };\n};\n\nconst createType = (): string => {\n return \"cms.group\";\n};\n\ninterface CreateGroupsStorageOperationsParams {\n entity: IGroupEntity;\n plugins: PluginsContainer;\n}\nexport const createGroupsStorageOperations = (\n params: CreateGroupsStorageOperationsParams\n): CmsGroupStorageOperations => {\n const { entity, plugins } = params;\n\n const filteringPlugins = plugins.byType<ValueFilterPlugin>(ValueFilterPlugin.type);\n if (filteringPlugins.length === 0) {\n throw new WebinyError(\n \"DynamoDB filtering plugins not loaded.\",\n \"MISSING_DYNAMODB_FILTERING_PLUGINS\"\n );\n }\n\n const create = async (params: CmsGroupStorageOperationsCreateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create group.\",\n ex.code || \"CREATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const update = async (params: CmsGroupStorageOperationsUpdateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const deleteGroup = async (params: CmsGroupStorageOperationsDeleteParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete group.\",\n ex.code || \"DELETE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const get = async (params: CmsGroupStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const result = await entity.get(keys);\n\n return result ? result.data : null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get group.\",\n ex.code || \"GET_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n keys\n }\n );\n }\n };\n const list = async (params: CmsGroupStorageOperationsListParams) => {\n const { sort, where } = params;\n\n let records: CmsGroup[] = [];\n try {\n const ddbRecords = await entity.queryAll({\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n });\n records = ddbRecords.map(item => item.data);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list groups.\",\n ex.code || \"LIST_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n sort,\n where\n }\n );\n }\n\n const filteredItems = filterItems({\n items: records,\n where,\n fields: [],\n plugins\n });\n if (!sort || sort.length === 0) {\n return filteredItems;\n }\n\n return sortItems({\n items: filteredItems,\n sort\n });\n };\n\n return {\n create,\n update,\n delete: deleteGroup,\n get,\n list\n };\n};\n"],"mappings":"AASA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,WAAW,EAAEC,SAAS,EAAEC,iBAAiB,QAAQ,qBAAqB;AAO/E,MAAMC,kBAAkB,GAAIC,MAA0B,IAAa;EAC/D,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EACzB,OAAO,KAAKC,MAAM,UAAU;AAChC,CAAC;AAKD,MAAMC,cAAc,GAAIF,MAAqB,IAAa;EACtD,MAAM;IAAEG;EAAG,CAAC,GAAGH,MAAM;EACrB,OAAOG,EAAE;AACb,CAAC;AAOD,MAAMC,UAAU,GAAIJ,MAA0C,IAAyB;EACnF,OAAO;IACHK,EAAE,EAAEN,kBAAkB,CAACC,MAAM,CAAC;IAC9BM,EAAE,EAAEJ,cAAc,CAACF,MAAM,CAAC;IAC1BO,UAAU,EAAEP,MAAM,CAACC;EACvB,CAAC;AACL,CAAC;AAED,MAAMO,UAAU,GAAGA,CAAA,KAAc;EAC7B,OAAO,WAAW;AACtB,CAAC;AAMD,OAAO,MAAMC,6BAA6B,GACtCT,MAA2C,IACf;EAC5B,MAAM;IAAEU,MAAM;IAAEC;EAAQ,CAAC,GAAGX,MAAM;EAElC,MAAMY,gBAAgB,GAAGD,OAAO,CAACE,MAAM,CAAoBf,iBAAiB,CAACgB,IAAI,CAAC;EAClF,IAAIF,gBAAgB,CAACG,MAAM,KAAK,CAAC,EAAE;IAC/B,MAAM,IAAIpB,WAAW,CACjB,wCAAwC,EACxC,oCACJ,CAAC;EACL;EAEA,MAAMqB,MAAM,GAAG,MAAOhB,MAA6C,IAAK;IACpE,MAAM;MAAEiB;IAAM,CAAC,GAAGjB,MAAM;IACxB,MAAMk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,CACJ,CAAC;IACL;IAEA,MAAMS,aAAa,GAAG9C,WAAW,CAAC;MAC9B+C,KAAK,EAAET,OAAO;MACdD,KAAK;MACLW,MAAM,EAAE,EAAE;MACVjC;IACJ,CAAC,CAAC;IACF,IAAI,CAACqB,IAAI,IAAIA,IAAI,CAACjB,MAAM,KAAK,CAAC,EAAE;MAC5B,OAAO2B,aAAa;IACxB;IAEA,OAAO7C,SAAS,CAAC;MACb8C,KAAK,EAAED,aAAa;MACpBV;IACJ,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHhB,MAAM;IACNU,MAAM;IACNE,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"operations/group/index.js","sources":["../../../src/operations/group/index.ts"],"sourcesContent":["import type {\n CmsGroup,\n CmsGroupStorageOperations,\n CmsGroupStorageOperationsCreateParams,\n CmsGroupStorageOperationsDeleteParams,\n CmsGroupStorageOperationsGetParams,\n CmsGroupStorageOperationsListParams,\n CmsGroupStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { sortItems } from \"@webiny/db-dynamodb\";\nimport { IGroupEntity } from \"~/definitions/types.js\";\nimport { FilterUtil } from \"@webiny/db-dynamodb/exports/api/db.js\";\nimport type { CmsContext } from \"~/types.js\";\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = (params: PartitionKeyParams): string => {\n const { tenant } = params;\n return `T#${tenant}#CMS#CMG`;\n};\n\ninterface SortKeyParams {\n id: string;\n}\nconst createSortKeys = (params: SortKeyParams): string => {\n const { id } = params;\n return id;\n};\n\ninterface IDynamoDbTableKeys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\nconst createKeys = (params: PartitionKeyParams & SortKeyParams): IDynamoDbTableKeys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKeys(params),\n GSI_TENANT: params.tenant\n };\n};\n\nconst createType = (): string => {\n return \"cms.group\";\n};\n\ninterface CreateGroupsStorageOperationsParams {\n entity: IGroupEntity;\n container: CmsContext[\"container\"];\n}\nexport const createGroupsStorageOperations = (\n params: CreateGroupsStorageOperationsParams\n): CmsGroupStorageOperations => {\n const { entity, container } = params;\n\n const filterUtil = container.resolve(FilterUtil);\n\n const create = async (params: CmsGroupStorageOperationsCreateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create group.\",\n ex.code || \"CREATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const update = async (params: CmsGroupStorageOperationsUpdateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const deleteGroup = async (params: CmsGroupStorageOperationsDeleteParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete group.\",\n ex.code || \"DELETE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const get = async (params: CmsGroupStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const result = await entity.get(keys);\n\n return result ? result.data : null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get group.\",\n ex.code || \"GET_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n keys\n }\n );\n }\n };\n const list = async (params: CmsGroupStorageOperationsListParams) => {\n const { sort, where } = params;\n\n let records: CmsGroup[] = [];\n try {\n const ddbRecords = await entity.queryAll({\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n });\n records = ddbRecords.map(item => item.data);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list groups.\",\n ex.code || \"LIST_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n sort,\n where\n }\n );\n }\n\n const filteredItems = filterUtil.filter({\n items: records,\n where,\n fields: []\n });\n if (!sort || sort.length === 0) {\n return filteredItems;\n }\n\n return sortItems({\n items: filteredItems,\n sort\n });\n };\n\n return {\n create,\n update,\n delete: deleteGroup,\n get,\n list\n };\n};\n"],"names":["createPartitionKey","params","tenant","createSortKeys","id","createKeys","createType","createGroupsStorageOperations","entity","container","filterUtil","FilterUtil","create","group","keys","ex","WebinyError","update","deleteGroup","get","result","list","sort","where","records","ddbRecords","item","filteredItems","sortItems"],"mappings":";;;AAkBA,MAAMA,qBAAqB,CAACC;IACxB,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO,CAAC,EAAE,EAAEC,OAAO,QAAQ,CAAC;AAChC;AAKA,MAAMC,iBAAiB,CAACF;IACpB,MAAM,EAAEG,EAAE,EAAE,GAAGH;IACf,OAAOG;AACX;AAOA,MAAMC,aAAa,CAACJ,SACT;QACH,IAAID,mBAAmBC;QACvB,IAAIE,eAAeF;QACnB,YAAYA,OAAO,MAAM;IAC7B;AAGJ,MAAMK,aAAa,IACR;AAOJ,MAAMC,gCAAgC,CACzCN;IAEA,MAAM,EAAEO,MAAM,EAAEC,SAAS,EAAE,GAAGR;IAE9B,MAAMS,aAAaD,UAAU,OAAO,CAACE;IAErC,MAAMC,SAAS,OAAOX;QAClB,MAAM,EAAEY,KAAK,EAAE,GAAGZ;QAClB,MAAMa,OAAOT,WAAWQ;QACxB,IAAI;YACA,MAAML,OAAO,GAAG,CAAC;gBACb,MAAMK;gBACN,MAAMP;gBACN,GAAGQ,IAAI;YACX;QACJ,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPF;gBACAC;YACJ;QAER;IACJ;IACA,MAAMG,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MACND,GAAG,OAAO,IAAI,0BACdA,GAAG,IAAI,IAAI,oBACX;gBACI,OAAOA;gBACP,GAAGd,MAAM;gBACTqB;gBACAC;YACJ;QAER;QAEA,MAAMI,gBAAgBjB,WAAW,MAAM,CAAC;YACpC,OAAOc;YACPD;YACA,QAAQ,EAAE;QACd;QACA,IAAI,CAACD,QAAQA,AAAgB,MAAhBA,KAAK,MAAM,EACpB,OAAOK;QAGX,OAAOC,UAAU;YACb,OAAOD;YACPL;QACJ;IACJ;IAEA,OAAO;QACHV;QACAK;QACA,QAAQC;QACRC;QACAE;IACJ;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import type { CmsModelStorageOperations } from "@webiny/api-headless-cms/types/index.js";
2
- import type { Client } from "@elastic/elasticsearch";
2
+ import type { Client } from "@webiny/api-opensearch";
3
3
  import type { IModelEntity } from "../../definitions/types.js";
4
4
  export interface CreateModelsStorageOperationsParams {
5
5
  entity: IModelEntity;