@webiny/api-headless-cms-ddb-es 0.0.0-mt-2 → 0.0.0-unstable.06b2ede40f

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 (325) hide show
  1. package/configurations.d.ts +15 -8
  2. package/configurations.js +29 -12
  3. package/configurations.js.map +1 -0
  4. package/definitions/entry.d.ts +6 -5
  5. package/definitions/entry.js +111 -20
  6. package/definitions/entry.js.map +1 -0
  7. package/definitions/entryElasticsearch.d.ts +6 -5
  8. package/definitions/entryElasticsearch.js +11 -16
  9. package/definitions/entryElasticsearch.js.map +1 -0
  10. package/definitions/group.d.ts +6 -5
  11. package/definitions/group.js +8 -16
  12. package/definitions/group.js.map +1 -0
  13. package/definitions/model.d.ts +6 -5
  14. package/definitions/model.js +30 -16
  15. package/definitions/model.js.map +1 -0
  16. package/definitions/system.d.ts +6 -5
  17. package/definitions/system.js +8 -16
  18. package/definitions/system.js.map +1 -0
  19. package/definitions/table.d.ts +6 -6
  20. package/definitions/table.js +7 -6
  21. package/definitions/table.js.map +1 -0
  22. package/definitions/tableElasticsearch.d.ts +6 -6
  23. package/definitions/tableElasticsearch.js +7 -6
  24. package/definitions/tableElasticsearch.js.map +1 -0
  25. package/dynamoDb/index.d.ts +2 -1
  26. package/dynamoDb/index.js +10 -12
  27. package/dynamoDb/index.js.map +1 -0
  28. package/dynamoDb/storage/longText.d.ts +7 -4
  29. package/dynamoDb/storage/longText.js +75 -62
  30. package/dynamoDb/storage/longText.js.map +1 -0
  31. package/dynamoDb/storage/richText.d.ts +2 -8
  32. package/dynamoDb/storage/richText.js +49 -100
  33. package/dynamoDb/storage/richText.js.map +1 -0
  34. package/elasticsearch/createElasticsearchIndex.d.ts +9 -0
  35. package/elasticsearch/createElasticsearchIndex.js +40 -0
  36. package/elasticsearch/createElasticsearchIndex.js.map +1 -0
  37. package/elasticsearch/deleteElasticsearchIndex.d.ts +8 -0
  38. package/elasticsearch/deleteElasticsearchIndex.js +38 -0
  39. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -0
  40. package/elasticsearch/index.d.ts +1 -1
  41. package/elasticsearch/index.js +3 -6
  42. package/elasticsearch/index.js.map +1 -0
  43. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  44. package/elasticsearch/indexing/dateTimeIndexing.js +21 -22
  45. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -0
  46. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  47. package/elasticsearch/indexing/defaultFieldIndexing.js +17 -10
  48. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -0
  49. package/elasticsearch/indexing/index.js +5 -11
  50. package/elasticsearch/indexing/index.js.map +1 -0
  51. package/elasticsearch/indexing/jsonIndexing.d.ts +2 -0
  52. package/elasticsearch/indexing/jsonIndexing.js +28 -0
  53. package/elasticsearch/indexing/jsonIndexing.js.map +1 -0
  54. package/elasticsearch/indexing/longTextIndexing.d.ts +5 -1
  55. package/elasticsearch/indexing/longTextIndexing.js +16 -10
  56. package/elasticsearch/indexing/longTextIndexing.js.map +1 -0
  57. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  58. package/elasticsearch/indexing/numberIndexing.js +2 -9
  59. package/elasticsearch/indexing/numberIndexing.js.map +1 -0
  60. package/elasticsearch/indexing/objectIndexing.d.ts +10 -1
  61. package/elasticsearch/indexing/objectIndexing.js +37 -36
  62. package/elasticsearch/indexing/objectIndexing.js.map +1 -0
  63. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  64. package/elasticsearch/indexing/richTextIndexing.js +2 -5
  65. package/elasticsearch/indexing/richTextIndexing.js.map +1 -0
  66. package/elasticsearch/indices/base.d.ts +2 -0
  67. package/elasticsearch/indices/base.js +13 -0
  68. package/elasticsearch/indices/base.js.map +1 -0
  69. package/elasticsearch/indices/index.d.ts +1 -0
  70. package/elasticsearch/indices/index.js +14 -0
  71. package/elasticsearch/indices/index.js.map +1 -0
  72. package/elasticsearch/indices/japanese.d.ts +2 -0
  73. package/elasticsearch/indices/japanese.js +14 -0
  74. package/elasticsearch/indices/japanese.js.map +1 -0
  75. package/elasticsearch/search/index.d.ts +2 -2
  76. package/elasticsearch/search/index.js +6 -9
  77. package/elasticsearch/search/index.js.map +1 -0
  78. package/elasticsearch/search/refSearch.d.ts +2 -3
  79. package/elasticsearch/search/refSearch.js +24 -17
  80. package/elasticsearch/search/refSearch.js.map +1 -0
  81. package/elasticsearch/search/searchableJson.d.ts +2 -0
  82. package/elasticsearch/search/searchableJson.js +60 -0
  83. package/elasticsearch/search/searchableJson.js.map +1 -0
  84. package/elasticsearch/search/timeSearch.d.ts +2 -3
  85. package/elasticsearch/search/timeSearch.js +18 -16
  86. package/elasticsearch/search/timeSearch.js.map +1 -0
  87. package/helpers/entryIndexHelpers.d.ts +3 -3
  88. package/helpers/entryIndexHelpers.js +59 -58
  89. package/helpers/entryIndexHelpers.js.map +1 -0
  90. package/helpers/fieldIdentifier.d.ts +6 -0
  91. package/helpers/fieldIdentifier.js +43 -0
  92. package/helpers/fieldIdentifier.js.map +1 -0
  93. package/helpers/index.d.ts +1 -1
  94. package/helpers/index.js +11 -13
  95. package/helpers/index.js.map +1 -0
  96. package/index.d.ts +2 -1
  97. package/index.js +132 -78
  98. package/index.js.map +1 -0
  99. package/operations/entry/dataLoader/DataLoaderCache.d.ts +17 -0
  100. package/operations/entry/dataLoader/DataLoaderCache.js +41 -0
  101. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  102. package/operations/entry/dataLoader/constants.d.ts +1 -0
  103. package/operations/entry/dataLoader/constants.js +10 -0
  104. package/operations/entry/dataLoader/constants.js.map +1 -0
  105. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  106. package/operations/entry/dataLoader/createBatchScheduleFn.js +25 -0
  107. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  108. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  109. package/operations/entry/dataLoader/getAllEntryRevisions.js +45 -0
  110. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  111. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  112. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +52 -0
  113. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  114. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  115. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +52 -0
  116. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  117. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  118. package/operations/entry/dataLoader/getRevisionById.js +62 -0
  119. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  120. package/operations/entry/dataLoader/index.d.ts +8 -0
  121. package/operations/entry/dataLoader/index.js +40 -0
  122. package/operations/entry/dataLoader/index.js.map +1 -0
  123. package/operations/entry/dataLoader/types.d.ts +6 -0
  124. package/operations/entry/dataLoader/types.js +7 -0
  125. package/operations/entry/dataLoader/types.js.map +1 -0
  126. package/operations/entry/dataLoaders.d.ts +21 -38
  127. package/operations/entry/dataLoaders.js +59 -290
  128. package/operations/entry/dataLoaders.js.map +1 -0
  129. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  130. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +34 -0
  131. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  132. package/operations/entry/elasticsearch/body.d.ts +13 -0
  133. package/operations/entry/elasticsearch/body.js +142 -0
  134. package/operations/entry/elasticsearch/body.js.map +1 -0
  135. package/operations/entry/elasticsearch/fields.d.ts +10 -0
  136. package/operations/entry/elasticsearch/fields.js +315 -0
  137. package/operations/entry/elasticsearch/fields.js.map +1 -0
  138. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +8 -0
  139. package/operations/entry/elasticsearch/filtering/applyFiltering.js +60 -0
  140. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
  141. package/operations/entry/elasticsearch/filtering/exec.d.ts +17 -0
  142. package/operations/entry/elasticsearch/filtering/exec.js +175 -0
  143. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
  144. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
  145. package/operations/entry/elasticsearch/filtering/index.js +18 -0
  146. package/operations/entry/elasticsearch/filtering/index.js.map +1 -0
  147. package/operations/entry/elasticsearch/filtering/path.d.ts +16 -0
  148. package/operations/entry/elasticsearch/filtering/path.js +48 -0
  149. package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
  150. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
  151. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +30 -0
  152. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
  153. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
  154. package/operations/entry/elasticsearch/filtering/plugins/index.js +15 -0
  155. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
  156. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
  157. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +69 -0
  158. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
  159. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
  160. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +57 -0
  161. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
  162. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
  163. package/operations/entry/elasticsearch/filtering/populated.js +25 -0
  164. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
  165. package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
  166. package/operations/entry/elasticsearch/filtering/values.js +24 -0
  167. package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
  168. package/operations/entry/elasticsearch/fullTextSearch.d.ts +12 -0
  169. package/operations/entry/elasticsearch/fullTextSearch.js +91 -0
  170. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
  171. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
  172. package/operations/entry/elasticsearch/fullTextSearchFields.js +27 -0
  173. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
  174. package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
  175. package/operations/entry/elasticsearch/initialQuery.js +106 -0
  176. package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
  177. package/operations/entry/elasticsearch/keyword.d.ts +2 -0
  178. package/operations/entry/elasticsearch/keyword.js +36 -0
  179. package/operations/entry/elasticsearch/keyword.js.map +1 -0
  180. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +9 -0
  181. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +26 -0
  182. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +1 -0
  183. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +9 -0
  184. package/operations/entry/elasticsearch/plugins/bodyModifier.js +18 -0
  185. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -0
  186. package/operations/entry/elasticsearch/plugins/operator.d.ts +8 -0
  187. package/operations/entry/elasticsearch/plugins/operator.js +39 -0
  188. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
  189. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +9 -0
  190. package/operations/entry/elasticsearch/plugins/queryModifier.js +18 -0
  191. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -0
  192. package/operations/entry/elasticsearch/plugins/search.d.ts +7 -0
  193. package/{helpers/searchPluginsList.js → operations/entry/elasticsearch/plugins/search.js} +9 -9
  194. package/operations/entry/elasticsearch/plugins/search.js.map +1 -0
  195. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +9 -0
  196. package/operations/entry/elasticsearch/plugins/sortModifier.js +18 -0
  197. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -0
  198. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
  199. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +13 -0
  200. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
  201. package/operations/entry/elasticsearch/sort.d.ts +12 -0
  202. package/operations/entry/elasticsearch/sort.js +89 -0
  203. package/operations/entry/elasticsearch/sort.js.map +1 -0
  204. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +16 -0
  205. package/operations/entry/elasticsearch/transformValueForSearch.js +32 -0
  206. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
  207. package/operations/entry/elasticsearch/types.d.ts +41 -0
  208. package/operations/entry/elasticsearch/types.js +7 -0
  209. package/operations/entry/elasticsearch/types.js.map +1 -0
  210. package/operations/entry/index.d.ts +6 -8
  211. package/operations/entry/index.js +1422 -693
  212. package/operations/entry/index.js.map +1 -0
  213. package/operations/entry/keys.js +2 -9
  214. package/operations/entry/keys.js.map +1 -0
  215. package/operations/entry/recordType.d.ts +3 -0
  216. package/operations/entry/recordType.js +20 -0
  217. package/operations/entry/recordType.js.map +1 -0
  218. package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
  219. package/operations/entry/transformations/convertEntryKeys.js +38 -0
  220. package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
  221. package/operations/entry/transformations/index.d.ts +29 -0
  222. package/operations/entry/transformations/index.js +127 -0
  223. package/operations/entry/transformations/index.js.map +1 -0
  224. package/operations/entry/transformations/modifyEntryValues.d.ts +58 -0
  225. package/operations/entry/transformations/modifyEntryValues.js +28 -0
  226. package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
  227. package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
  228. package/operations/entry/transformations/transformEntryKeys.js +27 -0
  229. package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
  230. package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
  231. package/operations/entry/transformations/transformEntryToIndex.js +31 -0
  232. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
  233. package/operations/group/index.d.ts +5 -5
  234. package/operations/group/index.js +40 -63
  235. package/operations/group/index.js.map +1 -0
  236. package/operations/model/index.d.ts +5 -5
  237. package/operations/model/index.js +56 -78
  238. package/operations/model/index.js.map +1 -0
  239. package/operations/system/index.d.ts +4 -4
  240. package/operations/system/index.js +20 -31
  241. package/operations/system/index.js.map +1 -0
  242. package/operations/system/indexes.d.ts +10 -0
  243. package/operations/system/indexes.js +41 -0
  244. package/operations/system/indexes.js.map +1 -0
  245. package/package.json +38 -40
  246. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +69 -0
  247. package/plugins/CmsElasticsearchModelFieldPlugin.js +52 -0
  248. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -0
  249. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +9 -4
  250. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +10 -13
  251. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -0
  252. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
  253. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +27 -0
  254. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
  255. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +4 -0
  256. package/plugins/CmsEntryElasticsearchIndexPlugin.js +13 -0
  257. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -0
  258. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +32 -0
  259. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +40 -0
  260. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -0
  261. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +6 -4
  262. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +10 -13
  263. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -0
  264. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +6 -4
  265. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +10 -13
  266. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -0
  267. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +33 -0
  268. package/plugins/CmsEntryElasticsearchValuesModifier.js +50 -0
  269. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -0
  270. package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
  271. package/plugins/CmsEntryFilterPlugin.js +22 -0
  272. package/plugins/CmsEntryFilterPlugin.js.map +1 -0
  273. package/plugins/index.d.ts +8 -0
  274. package/plugins/index.js +95 -0
  275. package/plugins/index.js.map +1 -0
  276. package/tasks/createIndexTaskPlugin.d.ts +2 -0
  277. package/tasks/createIndexTaskPlugin.js +67 -0
  278. package/tasks/createIndexTaskPlugin.js.map +1 -0
  279. package/types.d.ts +30 -52
  280. package/types.js +5 -23
  281. package/types.js.map +1 -0
  282. package/values/NoValueContainer.d.ts +5 -0
  283. package/values/NoValueContainer.js +20 -0
  284. package/values/NoValueContainer.js.map +1 -0
  285. package/definitions/settings.d.ts +0 -8
  286. package/definitions/settings.js +0 -62
  287. package/dynamoDb/storage/date.d.ts +0 -3
  288. package/dynamoDb/storage/date.js +0 -65
  289. package/helpers/createElasticsearchQueryBody.d.ts +0 -11
  290. package/helpers/createElasticsearchQueryBody.js +0 -375
  291. package/helpers/fields.d.ts +0 -77
  292. package/helpers/fields.js +0 -174
  293. package/helpers/operatorPluginsList.d.ts +0 -7
  294. package/helpers/operatorPluginsList.js +0 -30
  295. package/helpers/searchPluginsList.d.ts +0 -6
  296. package/helpers/transformValueForSearch.d.ts +0 -9
  297. package/helpers/transformValueForSearch.js +0 -26
  298. package/operations/entry/elasticsearchFields.d.ts +0 -2
  299. package/operations/entry/elasticsearchFields.js +0 -32
  300. package/operations/entry/fields.d.ts +0 -3
  301. package/operations/entry/fields.js +0 -60
  302. package/operations/settings/index.d.ts +0 -6
  303. package/operations/settings/index.js +0 -141
  304. package/operations/system/createElasticsearchTemplate.d.ts +0 -5
  305. package/operations/system/createElasticsearchTemplate.js +0 -62
  306. package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
  307. package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
  308. package/upgrades/index.d.ts +0 -2
  309. package/upgrades/index.js +0 -16
  310. package/upgrades/utils.d.ts +0 -1
  311. package/upgrades/utils.js +0 -16
  312. package/upgrades/v5.0.0/cleanDatabaseRecord.d.ts +0 -6
  313. package/upgrades/v5.0.0/cleanDatabaseRecord.js +0 -16
  314. package/upgrades/v5.0.0/createOldVersionIndiceName.d.ts +0 -2
  315. package/upgrades/v5.0.0/createOldVersionIndiceName.js +0 -12
  316. package/upgrades/v5.0.0/entryValueFixer.d.ts +0 -4
  317. package/upgrades/v5.0.0/entryValueFixer.js +0 -124
  318. package/upgrades/v5.0.0/fieldFinder.d.ts +0 -6
  319. package/upgrades/v5.0.0/fieldFinder.js +0 -42
  320. package/upgrades/v5.0.0/helpers.d.ts +0 -4
  321. package/upgrades/v5.0.0/helpers.js +0 -57
  322. package/upgrades/v5.0.0/index.d.ts +0 -4
  323. package/upgrades/v5.0.0/index.js +0 -232
  324. package/upgrades/v5.8.0/index.d.ts +0 -4
  325. package/upgrades/v5.8.0/index.js +0 -426
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.elasticsearchFields = void 0;
7
-
8
- var _CmsEntryElasticsearchFieldPlugin = require("../../plugins/CmsEntryElasticsearchFieldPlugin");
9
-
10
- const elasticsearchFields = [new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
11
- field: "createdOn",
12
- unmappedType: "date"
13
- }), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
14
- field: "savedOn",
15
- unmappedType: "date"
16
- }), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
17
- field: "publishedOn",
18
- unmappedType: "date"
19
- }), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
20
- field: "ownedBy",
21
- path: "ownedBy.id"
22
- }), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
23
- field: "createdBy",
24
- path: "createdBy.id"
25
- }),
26
- /**
27
- * Always add the ALL fields plugin because of the keyword/path build.
28
- */
29
- new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
30
- field: _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin.ALL
31
- })];
32
- exports.elasticsearchFields = elasticsearchFields;
@@ -1,3 +0,0 @@
1
- import { CmsModel } from "@webiny/api-headless-cms/types";
2
- import { CmsEntryElasticsearchFieldPlugin } from "../../plugins/CmsEntryElasticsearchFieldPlugin";
3
- export declare const createElasticsearchFields: (model: CmsModel) => Record<string, CmsEntryElasticsearchFieldPlugin>;
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createElasticsearchFields = void 0;
7
-
8
- var _CmsEntryElasticsearchFieldPlugin = require("../../plugins/CmsEntryElasticsearchFieldPlugin");
9
-
10
- const fieldsWithKeywords = ["text", "long-text", "rich-text", "id", "ref"];
11
- /**
12
- * We need to map entry system fields that have different paths, no keyword or not sortable.
13
- */
14
-
15
- const systemFields = {
16
- createdBy: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
17
- field: "createdBy",
18
- path: "createdBy.id",
19
- searchable: true,
20
- keyword: true,
21
- sortable: false
22
- }),
23
- ownedBy: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
24
- field: "ownedBy",
25
- path: "ownedBy.id",
26
- searchable: true,
27
- keyword: true,
28
- sortable: false
29
- }),
30
- createdOn: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
31
- field: "createdOn",
32
- path: "createdOn",
33
- searchable: true,
34
- keyword: false,
35
- sortable: false,
36
- unmappedType: "date"
37
- }),
38
- savedOn: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
39
- field: "savedOn",
40
- path: "savedOn",
41
- searchable: true,
42
- keyword: false,
43
- sortable: false,
44
- unmappedType: "date"
45
- })
46
- };
47
-
48
- const createElasticsearchFields = model => {
49
- return model.fields.reduce((fields, field) => {
50
- fields[field.fieldId] = new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
51
- field: field.fieldId,
52
- path: `values.${field.fieldId}`,
53
- searchable: true,
54
- keyword: fieldsWithKeywords.includes(field.type)
55
- });
56
- return fields;
57
- }, systemFields);
58
- };
59
-
60
- exports.createElasticsearchFields = createElasticsearchFields;
@@ -1,6 +0,0 @@
1
- import { CmsSettingsStorageOperations } from "@webiny/api-headless-cms/types";
2
- import { Entity } from "dynamodb-toolbox";
3
- export interface Params {
4
- entity: Entity<any>;
5
- }
6
- export declare const createSettingsStorageOperations: (params: Params) => CmsSettingsStorageOperations;
@@ -1,141 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createSettingsStorageOperations = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _get = require("@webiny/db-dynamodb/utils/get");
13
-
14
- var _error = _interopRequireDefault(require("@webiny/error"));
15
-
16
- var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
17
-
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19
-
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
-
22
- const convertToDbData = settings => {
23
- return _objectSpread(_objectSpread({}, settings), {}, {
24
- contentModelLastChange: settings.contentModelLastChange.toISOString()
25
- });
26
- };
27
-
28
- const convertFromDbData = settings => {
29
- if (!settings) {
30
- return null;
31
- }
32
-
33
- let contentModelLastChange;
34
-
35
- try {
36
- contentModelLastChange = new Date(settings.contentModelLastChange);
37
- } catch {
38
- contentModelLastChange = new Date();
39
- }
40
-
41
- return _objectSpread(_objectSpread({}, settings), {}, {
42
- contentModelLastChange
43
- });
44
- };
45
-
46
- const createPartitionKey = ({
47
- tenant,
48
- locale
49
- }) => {
50
- return `T#${tenant}#L#${locale}#CMS#SETTINGS`;
51
- };
52
-
53
- const createSortKey = () => {
54
- return "settings";
55
- };
56
-
57
- const createKeys = params => {
58
- return {
59
- PK: createPartitionKey(params),
60
- SK: createSortKey()
61
- };
62
- };
63
-
64
- const createSettingsStorageOperations = params => {
65
- const {
66
- entity
67
- } = params;
68
-
69
- const create = async params => {
70
- const {
71
- settings
72
- } = params;
73
- const keys = createKeys(settings);
74
- const dbSettings = convertToDbData(settings);
75
-
76
- try {
77
- await entity.put(_objectSpread(_objectSpread({}, dbSettings), keys));
78
- return settings;
79
- } catch (ex) {
80
- throw new _error.default(ex.message || "Could not create settings.", ex.code || "CREATE_SETTINGS_ERROR", {
81
- error: ex,
82
- settings,
83
- dbSettings,
84
- keys
85
- });
86
- }
87
- };
88
-
89
- const update = async params => {
90
- const {
91
- settings,
92
- original
93
- } = params;
94
- const keys = createKeys(settings);
95
- const dbSettings = convertToDbData(settings);
96
-
97
- try {
98
- await entity.put(_objectSpread(_objectSpread({}, dbSettings), keys));
99
- return settings;
100
- } catch (ex) {
101
- throw new _error.default(ex.message || "Could not update settings.", ex.code || "UPDATE_SETTINGS_ERROR", {
102
- error: ex,
103
- settings,
104
- dbSettings,
105
- original,
106
- keys
107
- });
108
- }
109
- };
110
-
111
- const get = async params => {
112
- const keys = createKeys(params);
113
-
114
- try {
115
- const record = await (0, _get.get)({
116
- entity,
117
- keys
118
- });
119
-
120
- if (!record) {
121
- return null;
122
- }
123
-
124
- const settings = (0, _cleanup.cleanupItem)(entity, record);
125
- return convertFromDbData(settings);
126
- } catch (ex) {
127
- throw new _error.default(ex.message || "Could not get settings.", ex.code || "GET_SETTINGS_ERROR", {
128
- error: ex,
129
- keys
130
- });
131
- }
132
- };
133
-
134
- return {
135
- create,
136
- get,
137
- update
138
- };
139
- };
140
-
141
- exports.createSettingsStorageOperations = createSettingsStorageOperations;
@@ -1,5 +0,0 @@
1
- import { Client } from "@elastic/elasticsearch";
2
- export interface Params {
3
- elasticsearch: Client;
4
- }
5
- export declare const createElasticsearchTemplate: (params: Params) => Promise<void>;
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createElasticsearchTemplate = void 0;
9
-
10
- var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
- const createElasticsearchTemplate = async params => {
13
- const {
14
- elasticsearch
15
- } = params;
16
- const options = {
17
- name: "headless-cms-entries-index",
18
- body: {
19
- index_patterns: ["*headless-cms*"],
20
- settings: {
21
- analysis: {
22
- analyzer: {
23
- lowercase_analyzer: {
24
- type: "custom",
25
- filter: ["lowercase", "trim"],
26
- tokenizer: "keyword"
27
- }
28
- }
29
- }
30
- },
31
- mappings: {
32
- properties: {
33
- property: {
34
- type: "text",
35
- fields: {
36
- keyword: {
37
- type: "keyword",
38
- ignore_above: 256
39
- }
40
- },
41
- analyzer: "lowercase_analyzer"
42
- },
43
- rawValues: {
44
- type: "object",
45
- enabled: false
46
- }
47
- }
48
- }
49
- }
50
- };
51
-
52
- try {
53
- await elasticsearch.indices.putTemplate(options);
54
- } catch (ex) {
55
- throw new _error.default(ex.message || "Could not create Elasticsearch index template for the Headless CMS.", ex.code || "CMS_ELASTICSEARCH_TEMPLATE_ERROR", {
56
- error: ex,
57
- options
58
- });
59
- }
60
- };
61
-
62
- exports.createElasticsearchTemplate = createElasticsearchTemplate;
@@ -1,12 +0,0 @@
1
- import { ElasticsearchFieldPlugin, Params as BaseParams } from "@webiny/api-elasticsearch/plugins/definition/ElasticsearchFieldPlugin";
2
- export interface Params extends BaseParams {
3
- /**
4
- * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
5
- */
6
- modelId?: string;
7
- }
8
- export declare class CmsEntryElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {
9
- static readonly type: string;
10
- readonly modelId?: string;
11
- constructor(params: Params);
12
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.CmsEntryElasticsearchFieldPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _ElasticsearchFieldPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchFieldPlugin");
13
-
14
- class CmsEntryElasticsearchFieldPlugin extends _ElasticsearchFieldPlugin.ElasticsearchFieldPlugin {
15
- constructor(params) {
16
- super(params);
17
- (0, _defineProperty2.default)(this, "modelId", void 0);
18
- this.modelId = params.modelId;
19
- }
20
-
21
- }
22
-
23
- exports.CmsEntryElasticsearchFieldPlugin = CmsEntryElasticsearchFieldPlugin;
24
- (0, _defineProperty2.default)(CmsEntryElasticsearchFieldPlugin, "type", "elasticsearch.fieldDefinition.cms.entry");
@@ -1,2 +0,0 @@
1
- declare const _default: () => import("@webiny/api-upgrade").UpgradePlugin<import("@webiny/api-headless-cms/types").CmsContext>[];
2
- export default _default;
package/upgrades/index.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _index = _interopRequireDefault(require("./v5.0.0/index"));
11
-
12
- var _index2 = _interopRequireDefault(require("./v5.8.0/index"));
13
-
14
- var _default = () => [(0, _index.default)(), (0, _index2.default)()];
15
-
16
- exports.default = _default;
@@ -1 +0,0 @@
1
- export declare const paginateBatch: (items: any, perPage: any, execute: any) => Promise<void>;
package/upgrades/utils.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.paginateBatch = void 0;
7
-
8
- const paginateBatch = async (items, perPage, execute) => {
9
- const pages = Math.ceil(items.length / perPage);
10
-
11
- for (let i = 0; i < pages; i++) {
12
- await execute(items.slice(i * perPage, i * perPage + perPage));
13
- }
14
- };
15
-
16
- exports.paginateBatch = paginateBatch;
@@ -1,6 +0,0 @@
1
- import { CmsEntry, CmsModel } from "@webiny/api-headless-cms/types";
2
- export declare const cleanDatabaseRecord: <T extends CmsModel | CmsEntry>(record: T & {
3
- PK?: string;
4
- SK?: string;
5
- TYPE?: string;
6
- }) => T;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.cleanDatabaseRecord = void 0;
9
-
10
- var _lodash = _interopRequireDefault(require("lodash.omit"));
11
-
12
- const cleanDatabaseRecord = record => {
13
- return (0, _lodash.default)(record, ["PK", "SK", "TYPE"]);
14
- };
15
-
16
- exports.cleanDatabaseRecord = cleanDatabaseRecord;
@@ -1,2 +0,0 @@
1
- import { CmsContext } from "@webiny/api-headless-cms/types";
2
- export declare const createOldVersionIndiceName: (context: CmsContext) => string;
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createOldVersionIndiceName = void 0;
7
-
8
- const createOldVersionIndiceName = context => {
9
- return `${context.tenancy.getCurrentTenant().id}-headless-cms`;
10
- };
11
-
12
- exports.createOldVersionIndiceName = createOldVersionIndiceName;
@@ -1,4 +0,0 @@
1
- import { ModelFieldFinder } from "./fieldFinder";
2
- import { CmsIndexEntry } from "../../types";
3
- import { CmsEntry, CmsModel } from "@webiny/api-headless-cms/types";
4
- export declare const entryValueFixer: (_: CmsModel, finder: ModelFieldFinder, target: CmsIndexEntry) => CmsEntry;
@@ -1,124 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.entryValueFixer = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _cleanDatabaseRecord = require("./cleanDatabaseRecord");
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- const convertTimeToNumber = time => {
19
- if (!time) {
20
- return null;
21
- }
22
-
23
- const [hours, minutes, seconds = 0] = time.split(":").map(Number);
24
- return hours * 60 * 60 + minutes * 60 + seconds;
25
- };
26
-
27
- const fixRawValues = (target, finder) => {
28
- const entry = _objectSpread({}, target);
29
-
30
- for (const fieldId in entry.rawValues) {
31
- // if field is ref field then continue, otherwise break
32
- const field = finder.findById(target.modelId, fieldId);
33
-
34
- if (field.type !== "ref") {
35
- continue;
36
- }
37
-
38
- const existingValue = entry.values[fieldId];
39
- const rawValue = entry.rawValues[fieldId]; // always remove from rawValue
40
-
41
- delete entry.rawValues[fieldId]; // if there is something in values - do not switch it
42
-
43
- if (typeof existingValue !== "undefined" || rawValue === undefined || rawValue === null) {
44
- continue;
45
- }
46
-
47
- entry.values[fieldId] = rawValue;
48
- }
49
-
50
- return entry;
51
- };
52
-
53
- const fixTime = (field, time) => {
54
- if (isNaN(time) === false) {
55
- return parseInt(time);
56
- } // lets not reinvent the wheel
57
-
58
-
59
- try {
60
- return convertTimeToNumber(time);
61
- } catch (err) {
62
- console.log(`fixTime on field "${field.fieldId}" failed`, err);
63
- return null;
64
- }
65
- };
66
-
67
- const fixDateTime = (field, dateTime) => {
68
- switch (field.settings.type) {
69
- case "time":
70
- return fixTime(field, dateTime);
71
-
72
- case "date":
73
- return new Date(dateTime).toISOString();
74
-
75
- case "dateTimeWithoutTimezone":
76
- return new Date(dateTime).toISOString();
77
-
78
- default:
79
- return dateTime;
80
- }
81
- };
82
-
83
- const fixNumber = (_, value) => {
84
- if (value === undefined || value === null) {
85
- return null;
86
- }
87
-
88
- return parseFloat(value);
89
- };
90
-
91
- const fieldFixMethods = {
92
- datetime: fixDateTime,
93
- number: fixNumber
94
- };
95
-
96
- const fixFieldValues = (target, finder) => {
97
- const entry = _objectSpread({}, target);
98
-
99
- for (const fieldId in target.values) {
100
- const field = finder.findById(target.modelId, fieldId);
101
-
102
- if (!field) {
103
- continue;
104
- }
105
-
106
- const fixMethod = fieldFixMethods[field.type];
107
-
108
- if (!fixMethod) {
109
- continue;
110
- } else if (target.values[fieldId] === null || target.values[fieldId] === undefined) {
111
- continue;
112
- }
113
-
114
- target.values[fieldId] = fixMethod(field, target.values[fieldId]);
115
- }
116
-
117
- return entry;
118
- };
119
-
120
- const entryValueFixer = (_, finder, target) => {
121
- return (0, _cleanDatabaseRecord.cleanDatabaseRecord)(fixFieldValues(fixRawValues(target, finder), finder));
122
- };
123
-
124
- exports.entryValueFixer = entryValueFixer;
@@ -1,6 +0,0 @@
1
- import { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
2
- export interface ModelFieldFinder {
3
- findById: (model: CmsModel | string, fieldId: string) => CmsModelField;
4
- findByType: (model: CmsModel | string, type: string) => CmsModelField[];
5
- }
6
- export declare const createFieldFinder: (models: CmsModel[]) => ModelFieldFinder;
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFieldFinder = void 0;
7
-
8
- const createFieldFinder = models => {
9
- const modelsList = {};
10
-
11
- for (const model of models) {
12
- const values = {
13
- id: {},
14
- type: {}
15
- };
16
-
17
- for (const field of model.fields) {
18
- values.id[field.fieldId] = field;
19
-
20
- if (!values.type[field.type]) {
21
- values.type[field.type] = [];
22
- }
23
-
24
- values.type[field.type].push(field);
25
- }
26
-
27
- modelsList[model.modelId] = values;
28
- }
29
-
30
- return {
31
- findById: (model, fieldId) => {
32
- const modelId = typeof model === "string" ? model : model.modelId;
33
- return modelsList[modelId].id[fieldId];
34
- },
35
- findByType: (model, type) => {
36
- const modelId = typeof model === "string" ? model : model.modelId;
37
- return modelsList[modelId].type[type];
38
- }
39
- };
40
- };
41
-
42
- exports.createFieldFinder = createFieldFinder;
@@ -1,4 +0,0 @@
1
- export * from "./cleanDatabaseRecord";
2
- export * from "./entryValueFixer";
3
- export * from "./fieldFinder";
4
- export * from "./createOldVersionIndiceName";
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _cleanDatabaseRecord = require("./cleanDatabaseRecord");
8
-
9
- Object.keys(_cleanDatabaseRecord).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _cleanDatabaseRecord[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _cleanDatabaseRecord[key];
16
- }
17
- });
18
- });
19
-
20
- var _entryValueFixer = require("./entryValueFixer");
21
-
22
- Object.keys(_entryValueFixer).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _entryValueFixer[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function () {
28
- return _entryValueFixer[key];
29
- }
30
- });
31
- });
32
-
33
- var _fieldFinder = require("./fieldFinder");
34
-
35
- Object.keys(_fieldFinder).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _fieldFinder[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function () {
41
- return _fieldFinder[key];
42
- }
43
- });
44
- });
45
-
46
- var _createOldVersionIndiceName = require("./createOldVersionIndiceName");
47
-
48
- Object.keys(_createOldVersionIndiceName).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (key in exports && exports[key] === _createOldVersionIndiceName[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function () {
54
- return _createOldVersionIndiceName[key];
55
- }
56
- });
57
- });