@webiny/api-headless-cms-ddb-es 6.0.0-alpha.5 → 6.0.0-rc.0

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 (282) hide show
  1. package/README.md +6 -30
  2. package/configurations.d.ts +4 -5
  3. package/configurations.js +12 -24
  4. package/configurations.js.map +1 -1
  5. package/definitions/entry.d.ts +4 -6
  6. package/definitions/entry.js +5 -174
  7. package/definitions/entry.js.map +1 -1
  8. package/definitions/group.d.ts +6 -7
  9. package/definitions/group.js +5 -58
  10. package/definitions/group.js.map +1 -1
  11. package/definitions/model.d.ts +6 -7
  12. package/definitions/model.js +5 -102
  13. package/definitions/model.js.map +1 -1
  14. package/definitions/types.d.ts +59 -0
  15. package/definitions/types.js +3 -0
  16. package/definitions/types.js.map +1 -0
  17. package/dynamoDb/index.d.ts +2 -2
  18. package/dynamoDb/index.js +5 -13
  19. package/dynamoDb/index.js.map +1 -1
  20. package/dynamoDb/storage/longText.js +10 -18
  21. package/dynamoDb/storage/longText.js.map +1 -1
  22. package/dynamoDb/storage/richText.js +10 -18
  23. package/dynamoDb/storage/richText.js.map +1 -1
  24. package/elasticsearch/createElasticsearchIndex.d.ts +1 -1
  25. package/elasticsearch/createElasticsearchIndex.js +7 -15
  26. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  27. package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
  28. package/elasticsearch/deleteElasticsearchIndex.js +3 -10
  29. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  30. package/elasticsearch/index.d.ts +1 -1
  31. package/elasticsearch/index.js +3 -11
  32. package/elasticsearch/index.js.map +1 -1
  33. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  34. package/elasticsearch/indexing/dateTimeIndexing.js +1 -8
  35. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  36. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  37. package/elasticsearch/indexing/defaultFieldIndexing.js +1 -8
  38. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  39. package/elasticsearch/indexing/index.d.ts +1 -1
  40. package/elasticsearch/indexing/index.js +8 -16
  41. package/elasticsearch/indexing/index.js.map +1 -1
  42. package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
  43. package/elasticsearch/indexing/jsonIndexing.js +1 -8
  44. package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
  45. package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
  46. package/elasticsearch/indexing/longTextIndexing.js +1 -8
  47. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  48. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  49. package/elasticsearch/indexing/numberIndexing.js +1 -8
  50. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  51. package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
  52. package/elasticsearch/indexing/objectIndexing.js +6 -13
  53. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  54. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  55. package/elasticsearch/indexing/richTextIndexing.js +1 -8
  56. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  57. package/elasticsearch/indices/base.d.ts +1 -1
  58. package/elasticsearch/indices/base.js +4 -10
  59. package/elasticsearch/indices/base.js.map +1 -1
  60. package/elasticsearch/indices/index.d.ts +1 -1
  61. package/elasticsearch/indices/index.js +3 -11
  62. package/elasticsearch/indices/index.js.map +1 -1
  63. package/elasticsearch/search/index.d.ts +1 -1
  64. package/elasticsearch/search/index.js +4 -11
  65. package/elasticsearch/search/index.js.map +1 -1
  66. package/elasticsearch/search/refSearch.d.ts +1 -1
  67. package/elasticsearch/search/refSearch.js +3 -10
  68. package/elasticsearch/search/refSearch.js.map +1 -1
  69. package/elasticsearch/search/searchableJson.d.ts +1 -1
  70. package/elasticsearch/search/searchableJson.js +9 -16
  71. package/elasticsearch/search/searchableJson.js.map +1 -1
  72. package/elasticsearch/search/timeSearch.d.ts +1 -1
  73. package/elasticsearch/search/timeSearch.js +3 -10
  74. package/elasticsearch/search/timeSearch.js.map +1 -1
  75. package/helpers/entryIndexHelpers.d.ts +9 -9
  76. package/helpers/entryIndexHelpers.js +32 -26
  77. package/helpers/entryIndexHelpers.js.map +1 -1
  78. package/helpers/fieldIdentifier.d.ts +1 -1
  79. package/helpers/fieldIdentifier.js +2 -10
  80. package/helpers/fieldIdentifier.js.map +1 -1
  81. package/helpers/index.d.ts +2 -2
  82. package/helpers/index.js +2 -27
  83. package/helpers/index.js.map +1 -1
  84. package/index.d.ts +2 -2
  85. package/index.js +98 -133
  86. package/index.js.map +1 -1
  87. package/operations/entry/dataLoader/DataLoaderCache.d.ts +0 -2
  88. package/operations/entry/dataLoader/DataLoaderCache.js +2 -9
  89. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  90. package/operations/entry/dataLoader/constants.js +1 -7
  91. package/operations/entry/dataLoader/constants.js.map +1 -1
  92. package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
  93. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  94. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  95. package/operations/entry/dataLoader/getAllEntryRevisions.js +11 -24
  96. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  97. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  98. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +18 -30
  99. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  100. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  101. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +18 -30
  102. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  103. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  104. package/operations/entry/dataLoader/getRevisionById.js +23 -35
  105. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  106. package/operations/entry/dataLoader/index.d.ts +3 -3
  107. package/operations/entry/dataLoader/index.js +10 -31
  108. package/operations/entry/dataLoader/index.js.map +1 -1
  109. package/operations/entry/dataLoader/types.d.ts +3 -4
  110. package/operations/entry/dataLoader/types.js +1 -5
  111. package/operations/entry/dataLoader/types.js.map +1 -1
  112. package/operations/entry/dataLoaders.d.ts +13 -13
  113. package/operations/entry/dataLoaders.js +15 -25
  114. package/operations/entry/dataLoaders.js.map +1 -1
  115. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  116. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -8
  117. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  118. package/operations/entry/elasticsearch/body.d.ts +2 -2
  119. package/operations/entry/elasticsearch/body.js +21 -28
  120. package/operations/entry/elasticsearch/body.js.map +1 -1
  121. package/operations/entry/elasticsearch/fields.d.ts +2 -2
  122. package/operations/entry/elasticsearch/fields.js +110 -24
  123. package/operations/entry/elasticsearch/fields.js.map +1 -1
  124. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
  125. package/operations/entry/elasticsearch/filtering/applyFiltering.js +9 -17
  126. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  127. package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -5
  128. package/operations/entry/elasticsearch/filtering/exec.js +48 -45
  129. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  130. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
  131. package/operations/entry/elasticsearch/filtering/index.js +1 -16
  132. package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
  133. package/operations/entry/elasticsearch/filtering/path.d.ts +1 -1
  134. package/operations/entry/elasticsearch/filtering/path.js +5 -15
  135. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  136. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +1 -1
  137. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +6 -14
  138. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
  139. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -1
  140. package/operations/entry/elasticsearch/filtering/plugins/index.js +5 -12
  141. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
  142. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +1 -1
  143. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +7 -15
  144. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
  145. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +1 -1
  146. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +7 -15
  147. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
  148. package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
  149. package/operations/entry/elasticsearch/filtering/populated.js +1 -8
  150. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  151. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  152. package/operations/entry/elasticsearch/filtering/values.js +4 -12
  153. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  154. package/operations/entry/elasticsearch/fullTextSearch.d.ts +2 -2
  155. package/operations/entry/elasticsearch/fullTextSearch.js +6 -12
  156. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  157. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
  158. package/operations/entry/elasticsearch/fullTextSearchFields.js +1 -8
  159. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  160. package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
  161. package/operations/entry/elasticsearch/initialQuery.js +9 -27
  162. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  163. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  164. package/operations/entry/elasticsearch/keyword.js +4 -9
  165. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  166. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +2 -2
  167. package/operations/entry/elasticsearch/plugins/bodyModifier.js +3 -10
  168. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  169. package/operations/entry/elasticsearch/plugins/operator.d.ts +1 -2
  170. package/operations/entry/elasticsearch/plugins/operator.js +4 -19
  171. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  172. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +2 -2
  173. package/operations/entry/elasticsearch/plugins/queryModifier.js +3 -10
  174. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  175. package/operations/entry/elasticsearch/plugins/search.d.ts +1 -1
  176. package/operations/entry/elasticsearch/plugins/search.js +5 -13
  177. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  178. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +2 -2
  179. package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -10
  180. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  181. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +1 -8
  182. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  183. package/operations/entry/elasticsearch/sort.d.ts +3 -3
  184. package/operations/entry/elasticsearch/sort.js +51 -33
  185. package/operations/entry/elasticsearch/sort.js.map +1 -1
  186. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
  187. package/operations/entry/elasticsearch/transformValueForSearch.js +4 -9
  188. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  189. package/operations/entry/elasticsearch/types.d.ts +2 -2
  190. package/operations/entry/elasticsearch/types.js +1 -5
  191. package/operations/entry/elasticsearch/types.js.map +1 -1
  192. package/operations/entry/index.d.ts +5 -4
  193. package/operations/entry/index.js +333 -515
  194. package/operations/entry/index.js.map +1 -1
  195. package/operations/entry/keys.d.ts +31 -1
  196. package/operations/entry/keys.js +56 -19
  197. package/operations/entry/keys.js.map +1 -1
  198. package/operations/entry/recordType.js +3 -12
  199. package/operations/entry/recordType.js.map +1 -1
  200. package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
  201. package/operations/entry/transformations/convertEntryKeys.js +2 -10
  202. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  203. package/operations/entry/transformations/index.d.ts +16 -16
  204. package/operations/entry/transformations/index.js +22 -30
  205. package/operations/entry/transformations/index.js.map +1 -1
  206. package/operations/entry/transformations/modifyEntryValues.d.ts +27 -34
  207. package/operations/entry/transformations/modifyEntryValues.js +1 -8
  208. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  209. package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
  210. package/operations/entry/transformations/transformEntryKeys.js +4 -11
  211. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  212. package/operations/entry/transformations/transformEntryToIndex.d.ts +6 -6
  213. package/operations/entry/transformations/transformEntryToIndex.js +3 -10
  214. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  215. package/operations/group/index.d.ts +5 -4
  216. package/operations/group/index.js +39 -73
  217. package/operations/group/index.js.map +1 -1
  218. package/operations/model/index.d.ts +3 -3
  219. package/operations/model/index.js +38 -57
  220. package/operations/model/index.js.map +1 -1
  221. package/package.json +27 -32
  222. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
  223. package/plugins/CmsElasticsearchModelFieldPlugin.js +2 -8
  224. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
  225. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +1 -1
  226. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +3 -11
  227. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  228. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
  229. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +3 -11
  230. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
  231. package/plugins/CmsEntryElasticsearchIndexPlugin.js +2 -9
  232. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  233. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +2 -2
  234. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
  235. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  236. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -1
  237. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
  238. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  239. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -1
  240. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +3 -11
  241. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  242. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +12 -12
  243. package/plugins/CmsEntryElasticsearchValuesModifier.js +4 -12
  244. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
  245. package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
  246. package/plugins/CmsEntryFilterPlugin.js +2 -9
  247. package/plugins/CmsEntryFilterPlugin.js.map +1 -1
  248. package/plugins/index.d.ts +8 -8
  249. package/plugins/index.js +8 -93
  250. package/plugins/index.js.map +1 -1
  251. package/tasks/createIndexTaskPlugin.d.ts +2 -2
  252. package/tasks/createIndexTaskPlugin.js +36 -62
  253. package/tasks/createIndexTaskPlugin.js.map +1 -1
  254. package/types.d.ts +23 -26
  255. package/types.js +5 -8
  256. package/types.js.map +1 -1
  257. package/values/NoValueContainer.js +1 -8
  258. package/values/NoValueContainer.js.map +1 -1
  259. package/definitions/entryElasticsearch.d.ts +0 -9
  260. package/definitions/entryElasticsearch.js +0 -41
  261. package/definitions/entryElasticsearch.js.map +0 -1
  262. package/definitions/system.d.ts +0 -9
  263. package/definitions/system.js +0 -42
  264. package/definitions/system.js.map +0 -1
  265. package/definitions/table.d.ts +0 -8
  266. package/definitions/table.js +0 -25
  267. package/definitions/table.js.map +0 -1
  268. package/definitions/tableElasticsearch.d.ts +0 -8
  269. package/definitions/tableElasticsearch.js +0 -25
  270. package/definitions/tableElasticsearch.js.map +0 -1
  271. package/elasticsearch/indices/japanese.d.ts +0 -2
  272. package/elasticsearch/indices/japanese.js +0 -14
  273. package/elasticsearch/indices/japanese.js.map +0 -1
  274. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
  275. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
  276. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
  277. package/operations/system/index.d.ts +0 -6
  278. package/operations/system/index.js +0 -94
  279. package/operations/system/index.js.map +0 -1
  280. package/operations/system/indexes.d.ts +0 -10
  281. package/operations/system/indexes.js +0 -41
  282. package/operations/system/indexes.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_CmsEntryElasticsearchBodyModifierPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CmsEntryElasticsearchIndexPlugin","_CmsEntryElasticsearchQueryBuilderValueSearchPlugin","_CmsEntryElasticsearchQueryModifierPlugin","_CmsEntryElasticsearchSortModifierPlugin","_CmsEntryElasticsearchFullTextSearchPlugin","_CmsElasticsearchModelFieldPlugin","_CmsEntryElasticsearchValuesModifier"],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryElasticsearchBodyModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchIndexPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchSortModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchFullTextSearchPlugin\";\nexport * from \"./CmsElasticsearchModelFieldPlugin\";\nexport * from \"./CmsEntryElasticsearchValuesModifier\";\n"],"mappings":";;;;;AAAA,IAAAA,wCAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,wCAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,wCAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,wCAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,iCAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,iCAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,iCAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,iCAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,mDAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,mDAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,mDAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,mDAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,yCAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,yCAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,yCAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,yCAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,wCAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,wCAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,wCAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,wCAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,0CAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,0CAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,0CAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,0CAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,iCAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,iCAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,iCAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,iCAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,oCAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,oCAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,oCAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,oCAAA,CAAAX,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryElasticsearchBodyModifierPlugin.js\";\nexport * from \"./CmsEntryElasticsearchIndexPlugin.js\";\nexport * from \"./CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nexport * from \"./CmsEntryElasticsearchQueryModifierPlugin.js\";\nexport * from \"./CmsEntryElasticsearchSortModifierPlugin.js\";\nexport * from \"./CmsEntryElasticsearchFullTextSearchPlugin.js\";\nexport * from \"./CmsElasticsearchModelFieldPlugin.js\";\nexport * from \"./CmsEntryElasticsearchValuesModifier.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import type { CmsContext } from "../types";
2
- export declare const createIndexTaskPluginTest: () => import("@webiny/api-elasticsearch-tasks").CreateElasticsearchIndexTaskPlugin<CmsContext>;
1
+ import type { CmsContext } from "../types.js";
2
+ export declare const createCreateIndexTask: (context: CmsContext) => void;
@@ -1,67 +1,41 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createIndexTaskPluginTest = void 0;
7
- var _apiElasticsearchTasks = require("@webiny/api-elasticsearch-tasks");
8
- var _configurations = require("../configurations");
9
- const createIndexTaskPluginTest = () => {
10
- return (0, _apiElasticsearchTasks.createElasticsearchIndexTaskPlugin)({
11
- name: "elasticsearch.cms.createIndexTaskPlugin",
12
- getIndexList: async ({
13
- context,
14
- locale,
15
- tenant
16
- }) => {
17
- const originalTenant = context.tenancy.getCurrentTenant();
18
- if (!originalTenant) {
19
- return [];
20
- }
21
- const originalLocale = context.i18n.getCurrentLocale("content");
22
- if (!originalLocale) {
23
- return [];
24
- }
25
- const selectedTenant = await context.tenancy.getTenantById(tenant);
26
- if (!selectedTenant) {
27
- return [];
28
- }
29
- const selectedLocale = await context.i18n.getLocale(locale);
30
- if (!selectedLocale) {
31
- return [];
32
- }
33
- const models = await context.cms.listModels();
34
- if (models.length === 0) {
35
- return [];
36
- }
37
- context.tenancy.setCurrentTenant(selectedTenant);
38
- context.i18n.setCurrentLocale("content", selectedLocale);
39
- const indexes = models.map(model => {
40
- const {
41
- index
42
- } = _configurations.configurations.es({
43
- model: {
44
- modelId: model.modelId,
45
- tenant,
46
- locale
47
- }
48
- });
49
- return {
50
- index,
51
- settings: _configurations.configurations.indexSettings({
52
- context,
53
- model: {
54
- locale
55
- }
56
- })
57
- };
58
- });
59
- context.tenancy.setCurrentTenant(originalTenant);
60
- context.i18n.setCurrentLocale("content", originalLocale);
61
- return indexes;
1
+ import { OpensearchTenantIndexFactory } from "@webiny/api-elasticsearch-tasks";
2
+ import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
3
+ import { configurations } from "../configurations.js";
4
+ class CreateElasticsearchIndexTask {
5
+ constructor(context, listModels) {
6
+ this.context = context;
7
+ this.listModels = listModels;
8
+ }
9
+ async getIndexList(tenant) {
10
+ const result = await this.listModels.execute();
11
+ const models = result.value;
12
+ if (models.length === 0) {
13
+ return [];
62
14
  }
15
+ const indexes = models.map(model => {
16
+ const {
17
+ index
18
+ } = configurations.es({
19
+ model: {
20
+ modelId: model.modelId,
21
+ tenant: tenant.id
22
+ }
23
+ });
24
+ return {
25
+ index,
26
+ settings: configurations.indexSettings({
27
+ context: this.context
28
+ })
29
+ };
30
+ });
31
+ return indexes;
32
+ }
33
+ }
34
+ export const createCreateIndexTask = context => {
35
+ context.container.registerFactory(OpensearchTenantIndexFactory, () => {
36
+ const listModels = context.container.resolve(ListModelsUseCase);
37
+ return new CreateElasticsearchIndexTask(context, listModels);
63
38
  });
64
39
  };
65
- exports.createIndexTaskPluginTest = createIndexTaskPluginTest;
66
40
 
67
41
  //# sourceMappingURL=createIndexTaskPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearchTasks","require","_configurations","createIndexTaskPluginTest","createElasticsearchIndexTaskPlugin","name","getIndexList","context","locale","tenant","originalTenant","tenancy","getCurrentTenant","originalLocale","i18n","getCurrentLocale","selectedTenant","getTenantById","selectedLocale","getLocale","models","cms","listModels","length","setCurrentTenant","setCurrentLocale","indexes","map","model","index","configurations","es","modelId","settings","indexSettings","exports"],"sources":["createIndexTaskPlugin.ts"],"sourcesContent":["import type { CreateElasticsearchIndexTaskPluginIndex } from \"@webiny/api-elasticsearch-tasks\";\nimport { createElasticsearchIndexTaskPlugin } from \"@webiny/api-elasticsearch-tasks\";\nimport { configurations } from \"~/configurations\";\nimport type { CmsContext } from \"~/types\";\n\nexport const createIndexTaskPluginTest = () => {\n return createElasticsearchIndexTaskPlugin<CmsContext>({\n name: \"elasticsearch.cms.createIndexTaskPlugin\",\n getIndexList: async ({ context, locale, tenant }) => {\n const originalTenant = context.tenancy.getCurrentTenant();\n if (!originalTenant) {\n return [];\n }\n const originalLocale = context.i18n.getCurrentLocale(\"content\");\n if (!originalLocale) {\n return [];\n }\n\n const selectedTenant = await context.tenancy.getTenantById(tenant);\n if (!selectedTenant) {\n return [];\n }\n const selectedLocale = await context.i18n.getLocale(locale);\n if (!selectedLocale) {\n return [];\n }\n const models = await context.cms.listModels();\n if (models.length === 0) {\n return [];\n }\n\n context.tenancy.setCurrentTenant(selectedTenant);\n context.i18n.setCurrentLocale(\"content\", selectedLocale);\n\n const indexes = models.map<CreateElasticsearchIndexTaskPluginIndex>(model => {\n const { index } = configurations.es({\n model: {\n modelId: model.modelId,\n tenant,\n locale\n }\n });\n return {\n index,\n settings: configurations.indexSettings({\n context,\n model: {\n locale\n }\n })\n };\n });\n\n context.tenancy.setCurrentTenant(originalTenant);\n context.i18n.setCurrentLocale(\"content\", originalLocale);\n return indexes;\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAGO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,IAAAC,yDAAkC,EAAa;IAClDC,IAAI,EAAE,yCAAyC;IAC/CC,YAAY,EAAE,MAAAA,CAAO;MAAEC,OAAO;MAAEC,MAAM;MAAEC;IAAO,CAAC,KAAK;MACjD,MAAMC,cAAc,GAAGH,OAAO,CAACI,OAAO,CAACC,gBAAgB,CAAC,CAAC;MACzD,IAAI,CAACF,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAMG,cAAc,GAAGN,OAAO,CAACO,IAAI,CAACC,gBAAgB,CAAC,SAAS,CAAC;MAC/D,IAAI,CAACF,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MAEA,MAAMG,cAAc,GAAG,MAAMT,OAAO,CAACI,OAAO,CAACM,aAAa,CAACR,MAAM,CAAC;MAClE,IAAI,CAACO,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAME,cAAc,GAAG,MAAMX,OAAO,CAACO,IAAI,CAACK,SAAS,CAACX,MAAM,CAAC;MAC3D,IAAI,CAACU,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAME,MAAM,GAAG,MAAMb,OAAO,CAACc,GAAG,CAACC,UAAU,CAAC,CAAC;MAC7C,IAAIF,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,EAAE;MACb;MAEAhB,OAAO,CAACI,OAAO,CAACa,gBAAgB,CAACR,cAAc,CAAC;MAChDT,OAAO,CAACO,IAAI,CAACW,gBAAgB,CAAC,SAAS,EAAEP,cAAc,CAAC;MAExD,MAAMQ,OAAO,GAAGN,MAAM,CAACO,GAAG,CAA0CC,KAAK,IAAI;QACzE,MAAM;UAAEC;QAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;UAChCH,KAAK,EAAE;YACHI,OAAO,EAAEJ,KAAK,CAACI,OAAO;YACtBvB,MAAM;YACND;UACJ;QACJ,CAAC,CAAC;QACF,OAAO;UACHqB,KAAK;UACLI,QAAQ,EAAEH,8BAAc,CAACI,aAAa,CAAC;YACnC3B,OAAO;YACPqB,KAAK,EAAE;cACHpB;YACJ;UACJ,CAAC;QACL,CAAC;MACL,CAAC,CAAC;MAEFD,OAAO,CAACI,OAAO,CAACa,gBAAgB,CAACd,cAAc,CAAC;MAChDH,OAAO,CAACO,IAAI,CAACW,gBAAgB,CAAC,SAAS,EAAEZ,cAAc,CAAC;MACxD,OAAOa,OAAO;IAClB;EACJ,CAAC,CAAC;AACN,CAAC;AAACS,OAAA,CAAAhC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"names":["OpensearchTenantIndexFactory","ListModelsUseCase","configurations","CreateElasticsearchIndexTask","constructor","context","listModels","getIndexList","tenant","result","execute","models","value","length","indexes","map","model","index","es","modelId","id","settings","indexSettings","createCreateIndexTask","container","registerFactory","resolve"],"sources":["createIndexTaskPlugin.ts"],"sourcesContent":["import { OpensearchTenantIndexFactory } from \"@webiny/api-elasticsearch-tasks\";\nimport type { Tenant } from \"@webiny/api-core/types/tenancy.js\";\nimport { ListModelsUseCase } from \"@webiny/api-headless-cms/features/contentModel/ListModels/index.js\";\nimport { configurations } from \"~/configurations.js\";\nimport type { CmsContext } from \"~/types.js\";\n\nclass CreateElasticsearchIndexTask implements OpensearchTenantIndexFactory.Interface {\n constructor(\n private context: CmsContext,\n private listModels: ListModelsUseCase.Interface\n ) {}\n\n async getIndexList(tenant: Tenant): Promise<OpensearchTenantIndexFactory.IndexConfig[]> {\n const result = await this.listModels.execute();\n const models = result.value;\n\n if (models.length === 0) {\n return [];\n }\n\n const indexes = models.map<OpensearchTenantIndexFactory.IndexConfig>(model => {\n const { index } = configurations.es({\n model: {\n modelId: model.modelId,\n tenant: tenant.id\n }\n });\n return {\n index,\n settings: configurations.indexSettings({\n context: this.context\n })\n };\n });\n\n return indexes;\n }\n}\n\nexport const createCreateIndexTask = (context: CmsContext) => {\n context.container.registerFactory(OpensearchTenantIndexFactory, () => {\n const listModels = context.container.resolve(ListModelsUseCase);\n return new CreateElasticsearchIndexTask(context, listModels);\n });\n};\n"],"mappings":"AAAA,SAASA,4BAA4B,QAAQ,iCAAiC;AAE9E,SAASC,iBAAiB,QAAQ,oEAAoE;AACtG,SAASC,cAAc;AAGvB,MAAMC,4BAA4B,CAAmD;EACjFC,WAAWA,CACCC,OAAmB,EACnBC,UAAuC,EACjD;IAAA,KAFUD,OAAmB,GAAnBA,OAAmB;IAAA,KACnBC,UAAuC,GAAvCA,UAAuC;EAChD;EAEH,MAAMC,YAAYA,CAACC,MAAc,EAAuD;IACpF,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,UAAU,CAACI,OAAO,CAAC,CAAC;IAC9C,MAAMC,MAAM,GAAGF,MAAM,CAACG,KAAK;IAE3B,IAAID,MAAM,CAACE,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO,EAAE;IACb;IAEA,MAAMC,OAAO,GAAGH,MAAM,CAACI,GAAG,CAA2CC,KAAK,IAAI;MAC1E,MAAM;QAAEC;MAAM,CAAC,GAAGf,cAAc,CAACgB,EAAE,CAAC;QAChCF,KAAK,EAAE;UACHG,OAAO,EAAEH,KAAK,CAACG,OAAO;UACtBX,MAAM,EAAEA,MAAM,CAACY;QACnB;MACJ,CAAC,CAAC;MACF,OAAO;QACHH,KAAK;QACLI,QAAQ,EAAEnB,cAAc,CAACoB,aAAa,CAAC;UACnCjB,OAAO,EAAE,IAAI,CAACA;QAClB,CAAC;MACL,CAAC;IACL,CAAC,CAAC;IAEF,OAAOS,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMS,qBAAqB,GAAIlB,OAAmB,IAAK;EAC1DA,OAAO,CAACmB,SAAS,CAACC,eAAe,CAACzB,4BAA4B,EAAE,MAAM;IAClE,MAAMM,UAAU,GAAGD,OAAO,CAACmB,SAAS,CAACE,OAAO,CAACzB,iBAAiB,CAAC;IAC/D,OAAO,IAAIE,4BAA4B,CAACE,OAAO,EAAEC,UAAU,CAAC;EAChE,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
package/types.d.ts CHANGED
@@ -1,27 +1,24 @@
1
- import type { Plugin, PluginCollection } from "@webiny/plugins/types";
2
- import type { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
3
- import type { AttributeDefinition, Entity, Table, TableConstructor } from "@webiny/db-dynamodb/toolbox";
4
- import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
1
+ import type { Plugin, PluginCollection } from "@webiny/plugins/types.js";
2
+ import type { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsEntryValues, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types/index.js";
3
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
5
4
  import type { Client } from "@elastic/elasticsearch";
6
5
  import type { PluginsContainer } from "@webiny/plugins";
6
+ import type { IEntryEntity, IGroupEntity, IModelEntity } from "./definitions/types.js";
7
+ import type { IElasticsearchEntity } from "@webiny/api-elasticsearch";
8
+ import type { ITable } from "@webiny/db-dynamodb";
7
9
  /**
8
10
  * A definition of the entry that is being prepared for the Elasticsearch.
9
11
  *
10
12
  * @category Elasticsearch
11
13
  * @category CmsEntry
12
14
  */
13
- export interface CmsIndexEntry extends CmsEntry {
15
+ export interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {
14
16
  /**
15
17
  * Values that are not going to be indexed.
16
18
  */
17
- rawValues: Record<string, any>;
19
+ rawValues: Partial<T>;
18
20
  /**
19
- * A first part of the ID, without the revision.
20
- * For example, we can search for all the revisions of the given entry.
21
- */
22
- primaryId: string;
23
- /**
24
- * Dev can add what ever keys they want and need. Just need to be careful not to break the entry.
21
+ * Dev can add whatever keys they want and need. Just need to be careful not to break the entry.
25
22
  */
26
23
  [key: string]: any;
27
24
  }
@@ -127,43 +124,43 @@ export interface CmsModelFieldToElasticsearchPlugin extends Plugin {
127
124
  */
128
125
  fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;
129
126
  }
130
- export type Attributes = Record<string, AttributeDefinition>;
131
127
  export declare enum ENTITIES {
132
- SYSTEM = "CmsSystem",
133
128
  GROUPS = "CmsGroups",
134
129
  MODELS = "CmsModels",
135
130
  ENTRIES = "CmsEntries",
136
131
  ENTRIES_ES = "CmsEntriesElasticsearch"
137
132
  }
138
- export interface TableModifier {
139
- (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;
140
- }
141
133
  export interface StorageOperationsFactoryParams {
142
134
  documentClient: DynamoDBDocument;
143
135
  elasticsearch: Client;
144
- table?: TableModifier;
145
- esTable?: TableModifier;
146
- attributes?: Record<ENTITIES, Attributes>;
136
+ table?: string;
137
+ esTable?: string;
147
138
  plugins?: PluginCollection;
148
139
  }
149
140
  export interface CmsContext extends BaseCmsContext {
150
141
  [key: string]: any;
151
142
  }
143
+ export interface IGetEntitiesResponse {
144
+ groups: IGroupEntity;
145
+ models: IModelEntity;
146
+ entries: IEntryEntity;
147
+ entriesEs: IElasticsearchEntity;
148
+ }
152
149
  export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {
153
- getTable: () => Table<string, string, string>;
154
- getEsTable: () => Table<string, string, string>;
155
- getEntities: () => Record<"system" | "groups" | "models" | "entries" | "entriesEs", Entity<any>>;
150
+ getTable: () => ITable;
151
+ getEsTable: () => ITable;
152
+ getEntities: () => IGetEntitiesResponse;
156
153
  }
157
154
  export interface StorageOperationsFactory {
158
155
  (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
159
156
  }
160
157
  export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
161
- dataLoaders: DataLoadersHandlerInterface;
158
+ dataLoaders: IDataLoadersHandler;
162
159
  }
163
160
  export interface DataLoadersHandlerInterfaceClearAllParams {
164
- model: Pick<CmsModel, "tenant" | "locale">;
161
+ model: Pick<CmsModel, "tenant">;
165
162
  }
166
- export interface DataLoadersHandlerInterface {
163
+ export interface IDataLoadersHandler {
167
164
  clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
168
165
  }
169
166
  export {};
package/types.js CHANGED
@@ -1,27 +1,24 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ENTITIES = void 0;
7
1
  /**
8
2
  * A definition of the entry that is being prepared for the Elasticsearch.
9
3
  *
10
4
  * @category Elasticsearch
11
5
  * @category CmsEntry
12
6
  */
7
+
13
8
  /**
14
9
  * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
15
10
  *
16
11
  * @category Elasticsearch
17
12
  * @category CmsEntry
18
13
  */
14
+
19
15
  /**
20
16
  * Arguments for the method that is transforming content entry from Elasticsearch into the original one.
21
17
  *
22
18
  * @category Elasticsearch
23
19
  * @category CmsEntry
24
20
  */
21
+
25
22
  /**
26
23
  * A plugin defining transformation of entry for Elasticsearch.
27
24
  *
@@ -30,8 +27,8 @@ exports.ENTITIES = void 0;
30
27
  * @category CmsEntry
31
28
  * @category Elasticsearch
32
29
  */
33
- let ENTITIES = exports.ENTITIES = /*#__PURE__*/function (ENTITIES) {
34
- ENTITIES["SYSTEM"] = "CmsSystem";
30
+
31
+ export let ENTITIES = /*#__PURE__*/function (ENTITIES) {
35
32
  ENTITIES["GROUPS"] = "CmsGroups";
36
33
  ENTITIES["MODELS"] = "CmsModels";
37
34
  ENTITIES["ENTRIES"] = "CmsEntries";
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import type { Plugin, PluginCollection } from \"@webiny/plugins/types\";\nimport type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n CmsModelFieldType,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport type {\n AttributeDefinition,\n Entity,\n Table,\n TableConstructor\n} from \"@webiny/db-dynamodb/toolbox\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry extends CmsEntry {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Record<string, any>;\n /**\n * A first part of the ID, without the revision.\n * For example, we can search for all the revisions of the given entry.\n */\n primaryId: string;\n /**\n * Dev can add what ever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: CmsModelFieldType;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: TableModifier;\n esTable?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: PluginCollection;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => Table<string, string, string>;\n getEsTable: () => Table<string, string, string>;\n getEntities: () => Record<\n \"system\" | \"groups\" | \"models\" | \"entries\" | \"entriesEs\",\n Entity<any>\n >;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;AAqBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IA2DYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import type { Plugin, PluginCollection } from \"@webiny/plugins/types.js\";\nimport type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsEntryValues,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n CmsModelFieldType,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { IElasticsearchEntity } from \"@webiny/api-elasticsearch\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Partial<T>;\n /**\n * Dev can add whatever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: CmsModelFieldType;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: string;\n esTable?: string;\n plugins?: PluginCollection;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n\nexport interface IGetEntitiesResponse {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n entriesEs: IElasticsearchEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => ITable;\n getEsTable: () => ITable;\n getEntities: () => IGetEntitiesResponse;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":"AAmBA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkDA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NoValueContainer = void 0;
7
- class NoValueContainer {
1
+ export class NoValueContainer {
8
2
  constructor() {
9
3
  //
10
4
  }
@@ -15,6 +9,5 @@ class NoValueContainer {
15
9
  return value instanceof NoValueContainer;
16
10
  }
17
11
  }
18
- exports.NoValueContainer = NoValueContainer;
19
12
 
20
13
  //# sourceMappingURL=NoValueContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NoValueContainer","constructor","create","is","value","exports"],"sources":["NoValueContainer.ts"],"sourcesContent":["export class NoValueContainer {\n private constructor() {\n //\n }\n\n public static create(): NoValueContainer {\n return new NoValueContainer();\n }\n\n public static is(value: unknown): boolean {\n return value instanceof NoValueContainer;\n }\n}\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,CAAC;EAClBC,WAAWA,CAAA,EAAG;IAClB;EAAA;EAGJ,OAAcC,MAAMA,CAAA,EAAqB;IACrC,OAAO,IAAIF,gBAAgB,CAAC,CAAC;EACjC;EAEA,OAAcG,EAAEA,CAACC,KAAc,EAAW;IACtC,OAAOA,KAAK,YAAYJ,gBAAgB;EAC5C;AACJ;AAACK,OAAA,CAAAL,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["NoValueContainer","constructor","create","is","value"],"sources":["NoValueContainer.ts"],"sourcesContent":["export class NoValueContainer {\n private constructor() {\n //\n }\n\n public static create(): NoValueContainer {\n return new NoValueContainer();\n }\n\n public static is(value: unknown): boolean {\n return value instanceof NoValueContainer;\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,CAAC;EAClBC,WAAWA,CAAA,EAAG;IAClB;EAAA;EAGJ,OAAcC,MAAMA,CAAA,EAAqB;IACrC,OAAO,IAAIF,gBAAgB,CAAC,CAAC;EACjC;EAEA,OAAcG,EAAEA,CAACC,KAAc,EAAW;IACtC,OAAOA,KAAK,YAAYJ,gBAAgB;EAC5C;AACJ","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
4
- export interface CreateEntryElasticsearchEntityParams {
5
- table: Table<string, string, string>;
6
- entityName: string;
7
- attributes: Attributes;
8
- }
9
- export declare const createEntryElasticsearchEntity: (params: CreateEntryElasticsearchEntityParams) => Entity<any>;
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createEntryElasticsearchEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createEntryElasticsearchEntity = params => {
9
- const {
10
- table,
11
- entityName,
12
- attributes
13
- } = params;
14
- return new _toolbox.Entity({
15
- name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- type: "string",
20
- partitionKey: true
21
- },
22
- SK: {
23
- type: "string",
24
- sortKey: true
25
- },
26
- index: {
27
- type: "string"
28
- },
29
- data: {
30
- type: "map"
31
- },
32
- TYPE: {
33
- type: "string"
34
- },
35
- ...(attributes || {})
36
- }
37
- });
38
- };
39
- exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
40
-
41
- //# sourceMappingURL=entryElasticsearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_toolbox","require","createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data","TYPE","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n TYPE: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
4
- export interface CreateSystemEntityParams {
5
- table: Table<string, string, string>;
6
- entityName: string;
7
- attributes: Attributes;
8
- }
9
- export declare const createSystemEntity: (params: CreateSystemEntityParams) => Entity<any>;
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createSystemEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createSystemEntity = params => {
9
- const {
10
- entityName,
11
- attributes,
12
- table
13
- } = params;
14
- return new _toolbox.Entity({
15
- name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- partitionKey: true
20
- },
21
- SK: {
22
- sortKey: true
23
- },
24
- version: {
25
- type: "string"
26
- },
27
- locale: {
28
- type: "string"
29
- },
30
- tenant: {
31
- type: "string"
32
- },
33
- readAPIKey: {
34
- type: "string"
35
- },
36
- ...(attributes || {})
37
- }
38
- });
39
- };
40
- exports.createSystemEntity = createSystemEntity;
41
-
42
- //# sourceMappingURL=system.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey","exports"],"sources":["system.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import type { TableModifier } from "../types";
2
- import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
3
- import { Table } from "@webiny/db-dynamodb/toolbox";
4
- export interface CreateTableParams {
5
- table?: TableModifier;
6
- documentClient: DynamoDBDocument;
7
- }
8
- export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table<string, string, string>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createTable = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createTable = ({
9
- table,
10
- documentClient
11
- }) => {
12
- const tableConfig = {
13
- name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
14
- partitionKey: "PK",
15
- sortKey: "SK",
16
- DocumentClient: documentClient,
17
- autoExecute: true,
18
- autoParse: true
19
- };
20
- const config = typeof table === "function" ? table(tableConfig) : tableConfig;
21
- return new _toolbox.Table(config);
22
- };
23
- exports.createTable = createTable;
24
-
25
- //# sourceMappingURL=table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_toolbox","require","createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["table.ts"],"sourcesContent":["import type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createTable = ({\n table,\n documentClient\n}: CreateTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMO,MAAMC,WAAW,GAAGA,CAAC;EACxBC,KAAK;EACLC;AACe,CAAC,KAAoC;EACpD,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC3EC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOb,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIY,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAhB,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import type { TableModifier } from "../types";
2
- import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
3
- import { Table } from "@webiny/db-dynamodb/toolbox";
4
- export interface CreateElasticsearchTableParams {
5
- table?: TableModifier;
6
- documentClient: DynamoDBDocument;
7
- }
8
- export declare const createElasticsearchTable: ({ table, documentClient }: CreateElasticsearchTableParams) => Table<string, string, string>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createElasticsearchTable = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createElasticsearchTable = ({
9
- table,
10
- documentClient
11
- }) => {
12
- const tableConfig = {
13
- name: process.env.DB_TABLE_ELASTICSEARCH,
14
- partitionKey: "PK",
15
- sortKey: "SK",
16
- DocumentClient: documentClient,
17
- autoExecute: true,
18
- autoParse: true
19
- };
20
- const config = typeof table === "function" ? table(tableConfig) : tableConfig;
21
- return new _toolbox.Table(config);
22
- };
23
- exports.createElasticsearchTable = createElasticsearchTable;
24
-
25
- //# sourceMappingURL=tableElasticsearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_toolbox","require","createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: CreateElasticsearchTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_ELASTICSEARCH as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAGA,CAAC;EACrCC,KAAK;EACLC;AAC4B,CAAC,KAAoC;EACjE,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,sBAAgC;IAClDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOZ,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIW,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAf,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryElasticsearchIndexPlugin } from "../../plugins/CmsEntryElasticsearchIndexPlugin";
2
- export declare const japanese: CmsEntryElasticsearchIndexPlugin;
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.japanese = void 0;
7
- var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
8
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
9
- const japanese = exports.japanese = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
10
- body: (0, _apiElasticsearch.getJapaneseConfiguration)(),
11
- locales: ["ja", "ja-jp"]
12
- });
13
-
14
- //# sourceMappingURL=japanese.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_CmsEntryElasticsearchIndexPlugin","require","_apiElasticsearch","japanese","exports","CmsEntryElasticsearchIndexPlugin","body","getJapaneseConfiguration","locales"],"sources":["japanese.ts"],"sourcesContent":["import { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\nimport { getJapaneseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const japanese = new CmsEntryElasticsearchIndexPlugin({\n body: getJapaneseConfiguration(),\n locales: [\"ja\", \"ja-jp\"]\n});\n"],"mappings":";;;;;;AAAA,IAAAA,iCAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,MAAME,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAIE,kEAAgC,CAAC;EACzDC,IAAI,EAAE,IAAAC,0CAAwB,EAAC,CAAC;EAChCC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO;AAC3B,CAAC,CAAC","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import type WebinyError from "@webiny/error";
2
- import type { CmsModel } from "@webiny/api-headless-cms/types";
3
- interface LogIgnoredElasticsearchExceptionParams {
4
- error: WebinyError;
5
- model: CmsModel;
6
- indexName: string;
7
- }
8
- export declare const logIgnoredEsResponseError: (params: LogIgnoredElasticsearchExceptionParams) => void;
9
- export {};
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.logIgnoredEsResponseError = void 0;
7
- const logIgnoredEsResponseError = params => {
8
- const {
9
- error,
10
- indexName,
11
- model
12
- } = params;
13
- console.log(`Ignoring Elasticsearch response error: ${error.message}`, {
14
- modelId: model.modelId,
15
- usedIndexName: indexName,
16
- error: {
17
- message: error.message,
18
- code: error.code,
19
- data: error.data,
20
- stack: error.stack
21
- }
22
- });
23
- };
24
- exports.logIgnoredEsResponseError = logIgnoredEsResponseError;
25
-
26
- //# sourceMappingURL=logIgnoredEsResponseError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["logIgnoredEsResponseError","params","error","indexName","model","console","log","message","modelId","usedIndexName","code","data","stack","exports"],"sources":["logIgnoredEsResponseError.ts"],"sourcesContent":["import type WebinyError from \"@webiny/error\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface LogIgnoredElasticsearchExceptionParams {\n error: WebinyError;\n model: CmsModel;\n indexName: string;\n}\n\nexport const logIgnoredEsResponseError = (params: LogIgnoredElasticsearchExceptionParams) => {\n const { error, indexName, model } = params;\n\n console.log(`Ignoring Elasticsearch response error: ${error.message}`, {\n modelId: model.modelId,\n usedIndexName: indexName,\n error: {\n message: error.message,\n code: error.code,\n data: error.data,\n stack: error.stack\n }\n });\n};\n"],"mappings":";;;;;;AASO,MAAMA,yBAAyB,GAAIC,MAA8C,IAAK;EACzF,MAAM;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAE1CI,OAAO,CAACC,GAAG,CAAC,0CAA0CJ,KAAK,CAACK,OAAO,EAAE,EAAE;IACnEC,OAAO,EAAEJ,KAAK,CAACI,OAAO;IACtBC,aAAa,EAAEN,SAAS;IACxBD,KAAK,EAAE;MACHK,OAAO,EAAEL,KAAK,CAACK,OAAO;MACtBG,IAAI,EAAER,KAAK,CAACQ,IAAI;MAChBC,IAAI,EAAET,KAAK,CAACS,IAAI;MAChBC,KAAK,EAAEV,KAAK,CAACU;IACjB;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAb,yBAAA,GAAAA,yBAAA","ignoreList":[]}