@webiny/api-headless-cms-ddb-es 0.0.0-unstable.615a930a68 → 0.0.0-unstable.61c048f412

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 (309) hide show
  1. package/README.md +6 -30
  2. package/configurations.d.ts +12 -6
  3. package/configurations.js +20 -26
  4. package/configurations.js.map +1 -1
  5. package/definitions/entry.d.ts +4 -5
  6. package/definitions/entry.js +6 -83
  7. package/definitions/entry.js.map +1 -1
  8. package/definitions/group.d.ts +6 -6
  9. package/definitions/group.js +6 -63
  10. package/definitions/group.js.map +1 -1
  11. package/definitions/model.d.ts +6 -6
  12. package/definitions/model.js +6 -85
  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 -1
  18. package/dynamoDb/index.js +8 -16
  19. package/dynamoDb/index.js.map +1 -1
  20. package/dynamoDb/storage/longText.d.ts +1 -1
  21. package/dynamoDb/storage/longText.js +21 -34
  22. package/dynamoDb/storage/longText.js.map +1 -1
  23. package/dynamoDb/storage/richText.d.ts +1 -6
  24. package/dynamoDb/storage/richText.js +28 -105
  25. package/dynamoDb/storage/richText.js.map +1 -1
  26. package/elasticsearch/createElasticsearchIndex.d.ts +4 -4
  27. package/elasticsearch/createElasticsearchIndex.js +22 -50
  28. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  29. package/elasticsearch/deleteElasticsearchIndex.d.ts +3 -3
  30. package/elasticsearch/deleteElasticsearchIndex.js +7 -19
  31. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  32. package/elasticsearch/index.d.ts +1 -1
  33. package/elasticsearch/index.js +4 -15
  34. package/elasticsearch/index.js.map +1 -1
  35. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  36. package/elasticsearch/indexing/dateTimeIndexing.js +8 -30
  37. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  38. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  39. package/elasticsearch/indexing/defaultFieldIndexing.js +17 -17
  40. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  41. package/elasticsearch/indexing/index.d.ts +1 -1
  42. package/elasticsearch/indexing/index.js +10 -24
  43. package/elasticsearch/indexing/index.js.map +1 -1
  44. package/elasticsearch/indexing/jsonIndexing.d.ts +2 -0
  45. package/elasticsearch/indexing/jsonIndexing.js +21 -0
  46. package/elasticsearch/indexing/jsonIndexing.js.map +1 -0
  47. package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
  48. package/elasticsearch/indexing/longTextIndexing.js +4 -21
  49. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  50. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  51. package/elasticsearch/indexing/numberIndexing.js +2 -16
  52. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  53. package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
  54. package/elasticsearch/indexing/objectIndexing.js +23 -52
  55. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  56. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  57. package/elasticsearch/indexing/richTextIndexing.js +2 -12
  58. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  59. package/elasticsearch/indices/base.d.ts +1 -1
  60. package/elasticsearch/indices/base.js +5 -13
  61. package/elasticsearch/indices/base.js.map +1 -1
  62. package/elasticsearch/indices/index.d.ts +1 -1
  63. package/elasticsearch/indices/index.js +4 -14
  64. package/elasticsearch/indices/index.js.map +1 -1
  65. package/elasticsearch/search/index.d.ts +1 -1
  66. package/elasticsearch/search/index.js +5 -13
  67. package/elasticsearch/search/index.js.map +1 -1
  68. package/elasticsearch/search/refSearch.d.ts +1 -1
  69. package/elasticsearch/search/refSearch.js +4 -15
  70. package/elasticsearch/search/refSearch.js.map +1 -1
  71. package/elasticsearch/search/searchableJson.d.ts +2 -0
  72. package/elasticsearch/search/searchableJson.js +53 -0
  73. package/elasticsearch/search/searchableJson.js.map +1 -0
  74. package/elasticsearch/search/timeSearch.d.ts +1 -1
  75. package/elasticsearch/search/timeSearch.js +5 -18
  76. package/elasticsearch/search/timeSearch.js.map +1 -1
  77. package/helpers/entryIndexHelpers.d.ts +10 -10
  78. package/helpers/entryIndexHelpers.js +76 -84
  79. package/helpers/entryIndexHelpers.js.map +1 -1
  80. package/helpers/fieldIdentifier.d.ts +6 -0
  81. package/helpers/fieldIdentifier.js +35 -0
  82. package/helpers/fieldIdentifier.js.map +1 -0
  83. package/helpers/index.d.ts +2 -1
  84. package/helpers/index.js +3 -17
  85. package/helpers/index.js.map +1 -1
  86. package/index.d.ts +2 -2
  87. package/index.js +119 -204
  88. package/index.js.map +1 -1
  89. package/operations/entry/dataLoader/DataLoaderCache.d.ts +15 -0
  90. package/operations/entry/dataLoader/DataLoaderCache.js +34 -0
  91. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  92. package/operations/entry/dataLoader/constants.d.ts +1 -0
  93. package/operations/entry/dataLoader/constants.js +4 -0
  94. package/operations/entry/dataLoader/constants.js.map +1 -0
  95. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  96. package/operations/entry/dataLoader/createBatchScheduleFn.js +19 -0
  97. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  98. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  99. package/operations/entry/dataLoader/getAllEntryRevisions.js +32 -0
  100. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  101. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  102. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +40 -0
  103. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  104. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  105. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +40 -0
  106. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  107. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  108. package/operations/entry/dataLoader/getRevisionById.js +50 -0
  109. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  110. package/operations/entry/dataLoader/index.d.ts +8 -0
  111. package/operations/entry/dataLoader/index.js +19 -0
  112. package/operations/entry/dataLoader/index.js.map +1 -0
  113. package/operations/entry/dataLoader/types.d.ts +5 -0
  114. package/operations/entry/dataLoader/types.js +3 -0
  115. package/operations/entry/dataLoader/types.js.map +1 -0
  116. package/operations/entry/dataLoaders.d.ts +17 -38
  117. package/operations/entry/dataLoaders.js +55 -314
  118. package/operations/entry/dataLoaders.js.map +1 -1
  119. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  120. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +27 -0
  121. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  122. package/operations/entry/elasticsearch/body.d.ts +3 -3
  123. package/operations/entry/elasticsearch/body.js +28 -55
  124. package/operations/entry/elasticsearch/body.js.map +1 -1
  125. package/operations/entry/elasticsearch/fields.d.ts +6 -5
  126. package/operations/entry/elasticsearch/fields.js +274 -121
  127. package/operations/entry/elasticsearch/fields.js.map +1 -1
  128. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
  129. package/operations/entry/elasticsearch/filtering/applyFiltering.js +11 -25
  130. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  131. package/operations/entry/elasticsearch/filtering/exec.d.ts +7 -6
  132. package/operations/entry/elasticsearch/filtering/exec.js +60 -96
  133. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  134. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
  135. package/operations/entry/elasticsearch/filtering/index.js +2 -17
  136. package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
  137. package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
  138. package/operations/entry/elasticsearch/filtering/path.js +10 -24
  139. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  140. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +1 -1
  141. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +8 -21
  142. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
  143. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -1
  144. package/operations/entry/elasticsearch/filtering/plugins/index.js +6 -16
  145. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
  146. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +1 -1
  147. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +10 -27
  148. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
  149. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +1 -1
  150. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +16 -25
  151. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
  152. package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
  153. package/operations/entry/elasticsearch/filtering/populated.js +3 -15
  154. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  155. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  156. package/operations/entry/elasticsearch/filtering/values.js +5 -17
  157. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  158. package/operations/entry/elasticsearch/fullTextSearch.d.ts +5 -2
  159. package/operations/entry/elasticsearch/fullTextSearch.js +72 -21
  160. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  161. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
  162. package/operations/entry/elasticsearch/fullTextSearchFields.js +10 -42
  163. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  164. package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
  165. package/operations/entry/elasticsearch/initialQuery.js +15 -44
  166. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  167. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  168. package/operations/entry/elasticsearch/keyword.js +5 -12
  169. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  170. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +4 -4
  171. package/operations/entry/elasticsearch/plugins/bodyModifier.js +4 -12
  172. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  173. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -3
  174. package/operations/entry/elasticsearch/plugins/operator.js +5 -26
  175. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  176. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +4 -4
  177. package/operations/entry/elasticsearch/plugins/queryModifier.js +4 -12
  178. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  179. package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
  180. package/operations/entry/elasticsearch/plugins/search.js +6 -18
  181. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  182. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +4 -4
  183. package/operations/entry/elasticsearch/plugins/sortModifier.js +4 -12
  184. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  185. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
  186. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -0
  187. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
  188. package/operations/entry/elasticsearch/sort.d.ts +4 -4
  189. package/operations/entry/elasticsearch/sort.js +64 -49
  190. package/operations/entry/elasticsearch/sort.js.map +1 -1
  191. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
  192. package/operations/entry/elasticsearch/transformValueForSearch.js +5 -12
  193. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  194. package/operations/entry/elasticsearch/types.d.ts +8 -8
  195. package/operations/entry/elasticsearch/types.js +2 -4
  196. package/operations/entry/elasticsearch/types.js.map +1 -1
  197. package/operations/entry/index.d.ts +7 -6
  198. package/operations/entry/index.js +1184 -736
  199. package/operations/entry/index.js.map +1 -1
  200. package/operations/entry/keys.d.ts +31 -1
  201. package/operations/entry/keys.js +57 -27
  202. package/operations/entry/keys.js.map +1 -1
  203. package/operations/entry/recordType.js +4 -17
  204. package/operations/entry/recordType.js.map +1 -1
  205. package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
  206. package/operations/entry/transformations/convertEntryKeys.js +30 -0
  207. package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
  208. package/operations/entry/transformations/index.d.ts +29 -0
  209. package/operations/entry/transformations/index.js +119 -0
  210. package/operations/entry/transformations/index.js.map +1 -0
  211. package/operations/entry/transformations/modifyEntryValues.d.ts +51 -0
  212. package/operations/entry/transformations/modifyEntryValues.js +21 -0
  213. package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
  214. package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
  215. package/operations/entry/transformations/transformEntryKeys.js +20 -0
  216. package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
  217. package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
  218. package/operations/entry/transformations/transformEntryToIndex.js +24 -0
  219. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
  220. package/operations/group/index.d.ts +6 -5
  221. package/operations/group/index.js +47 -97
  222. package/operations/group/index.js.map +1 -1
  223. package/operations/model/index.d.ts +4 -4
  224. package/operations/model/index.js +38 -78
  225. package/operations/model/index.js.map +1 -1
  226. package/package.json +35 -37
  227. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +69 -0
  228. package/plugins/CmsElasticsearchModelFieldPlugin.js +46 -0
  229. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -0
  230. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +4 -2
  231. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +7 -18
  232. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  233. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
  234. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +19 -0
  235. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
  236. package/plugins/CmsEntryElasticsearchIndexPlugin.js +5 -16
  237. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  238. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +4 -2
  239. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +11 -22
  240. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  241. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +4 -2
  242. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +7 -18
  243. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  244. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +4 -2
  245. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +7 -18
  246. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  247. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +33 -0
  248. package/plugins/CmsEntryElasticsearchValuesModifier.js +42 -0
  249. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -0
  250. package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
  251. package/plugins/CmsEntryFilterPlugin.js +5 -21
  252. package/plugins/CmsEntryFilterPlugin.js.map +1 -1
  253. package/plugins/index.d.ts +8 -6
  254. package/plugins/index.js +10 -83
  255. package/plugins/index.js.map +1 -1
  256. package/tasks/createIndexTaskPlugin.d.ts +2 -0
  257. package/tasks/createIndexTaskPlugin.js +41 -0
  258. package/tasks/createIndexTaskPlugin.js.map +1 -0
  259. package/types.d.ts +38 -36
  260. package/types.js +5 -13
  261. package/types.js.map +1 -1
  262. package/values/NoValueContainer.d.ts +5 -0
  263. package/values/NoValueContainer.js +13 -0
  264. package/values/NoValueContainer.js.map +1 -0
  265. package/definitions/entryElasticsearch.d.ts +0 -8
  266. package/definitions/entryElasticsearch.js +0 -42
  267. package/definitions/entryElasticsearch.js.map +0 -1
  268. package/definitions/settings.d.ts +0 -8
  269. package/definitions/settings.js +0 -58
  270. package/definitions/settings.js.map +0 -1
  271. package/definitions/system.d.ts +0 -8
  272. package/definitions/system.js +0 -46
  273. package/definitions/system.js.map +0 -1
  274. package/definitions/table.d.ts +0 -8
  275. package/definitions/table.js +0 -24
  276. package/definitions/table.js.map +0 -1
  277. package/definitions/tableElasticsearch.d.ts +0 -8
  278. package/definitions/tableElasticsearch.js +0 -24
  279. package/definitions/tableElasticsearch.js.map +0 -1
  280. package/dynamoDb/storage/date.d.ts +0 -2
  281. package/dynamoDb/storage/date.js +0 -99
  282. package/dynamoDb/storage/date.js.map +0 -1
  283. package/elasticsearch/indices/japanese.d.ts +0 -2
  284. package/elasticsearch/indices/japanese.js +0 -16
  285. package/elasticsearch/indices/japanese.js.map +0 -1
  286. package/helpers/createElasticsearchQueryBody.d.ts +0 -11
  287. package/helpers/createElasticsearchQueryBody.js +0 -618
  288. package/helpers/createElasticsearchQueryBody.js.map +0 -1
  289. package/helpers/fields.d.ts +0 -19
  290. package/helpers/fields.js +0 -196
  291. package/helpers/fields.js.map +0 -1
  292. package/helpers/searchPluginsList.d.ts +0 -6
  293. package/helpers/searchPluginsList.js +0 -26
  294. package/helpers/searchPluginsList.js.map +0 -1
  295. package/helpers/transformValueForSearch.d.ts +0 -12
  296. package/helpers/transformValueForSearch.js +0 -29
  297. package/helpers/transformValueForSearch.js.map +0 -1
  298. package/operations/entry/elasticsearchFields.d.ts +0 -2
  299. package/operations/entry/elasticsearchFields.js +0 -38
  300. package/operations/entry/elasticsearchFields.js.map +0 -1
  301. package/operations/settings/index.d.ts +0 -6
  302. package/operations/settings/index.js +0 -135
  303. package/operations/settings/index.js.map +0 -1
  304. package/operations/system/index.d.ts +0 -6
  305. package/operations/system/index.js +0 -99
  306. package/operations/system/index.js.map +0 -1
  307. package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
  308. package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
  309. package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
package/README.md CHANGED
@@ -1,35 +1,11 @@
1
1
  # @webiny/api-headless-cms-ddb-es
2
2
 
3
- [![](https://img.shields.io/npm/dw/@webiny/api-headless-cms-ddb-es.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb-es)
4
- [![](https://img.shields.io/npm/v/@webiny/api-headless-cms-ddb-es.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb-es)
5
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
7
6
 
8
- ## Install
7
+ 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
9
8
 
10
- ```
11
- npm install --save @webiny/api-headless-cms-ddb-es
12
- ```
9
+ ---
13
10
 
14
- Or if you prefer yarn:
15
-
16
- ```
17
- yarn add @webiny/api-headless-cms-ddb-es
18
- ```
19
-
20
-
21
- ## Testing
22
- To run the tests only for this package you must filter it with keywords.
23
-
24
- ### Env variables
25
-
26
- ###### LOCAL_ELASTICSEARCH
27
- If set, does not run Elasticsearch when starting the tests, use local one. You must install it and run if, of course.
28
-
29
- ###### ELASTICSEARCH_PORT
30
- Custom port for local elasticsearch.
31
-
32
- ### Command
33
- ````
34
- ELASTICSEARCH_PORT=9200 LOCAL_ELASTICSEARCH=true yarn test packages/api-headless-cms --keyword=cms:ddb-es --keyword=cms:base
35
- ````
11
+ _This README file is automatically generated during the publish process._
@@ -1,12 +1,18 @@
1
- import { CmsModel } from "@webiny/api-headless-cms/types";
2
- interface ElasticsearchConfig {
1
+ import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
2
+ import type { CmsContext } from "./types.js";
3
+ import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types.js";
4
+ interface ConfigurationsElasticsearch {
3
5
  index: string;
4
6
  }
5
- interface CmsElasticsearchParams {
6
- model: CmsModel;
7
+ export interface CmsElasticsearchParams {
8
+ model: Pick<CmsModel, "tenant" | "modelId">;
7
9
  }
8
- interface Configurations {
9
- es: (params: CmsElasticsearchParams) => ElasticsearchConfig;
10
+ export interface ConfigurationsIndexSettingsParams {
11
+ context: CmsContext;
12
+ }
13
+ export interface Configurations {
14
+ es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
15
+ indexSettings: (params: ConfigurationsIndexSettingsParams) => Partial<ElasticsearchIndexRequestBody>;
10
16
  }
11
17
  export declare const configurations: Configurations;
12
18
  export {};
package/configurations.js CHANGED
@@ -1,43 +1,37 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.configurations = void 0;
9
-
10
- var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
- const configurations = {
1
+ import WebinyError from "@webiny/error";
2
+ import { getElasticsearchIndexPrefix, getLastAddedIndexPlugin, isSharedElasticsearchIndex } from "@webiny/api-elasticsearch";
3
+ import { CmsEntryElasticsearchIndexPlugin } from "./plugins/index.js";
4
+ export const configurations = {
13
5
  es({
14
6
  model
15
7
  }) {
16
8
  const {
17
- tenant,
18
- locale
9
+ tenant
19
10
  } = model;
20
-
21
11
  if (!tenant) {
22
- throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
23
- } else if (!locale) {
24
- throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
12
+ throw new WebinyError(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
25
13
  }
26
-
27
- const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
28
- const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
29
- const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || "";
30
-
14
+ const sharedIndex = isSharedElasticsearchIndex();
15
+ const index = [sharedIndex ? "root" : tenant, "headless-cms", model.modelId].join("-").toLowerCase();
16
+ const prefix = getElasticsearchIndexPrefix();
31
17
  if (!prefix) {
32
18
  return {
33
19
  index
34
20
  };
35
21
  }
36
-
37
22
  return {
38
23
  index: prefix + index
39
24
  };
25
+ },
26
+ indexSettings: ({
27
+ context
28
+ }) => {
29
+ const plugin = getLastAddedIndexPlugin({
30
+ container: context.plugins,
31
+ type: CmsEntryElasticsearchIndexPlugin.type
32
+ });
33
+ return plugin ? plugin.body : {};
40
34
  }
41
-
42
35
  };
43
- exports.configurations = configurations;
36
+
37
+ //# sourceMappingURL=configurations.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["configurations","es","model","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","index","modelId","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX"],"sources":["configurations.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\ninterface CmsElasticsearchParams {\n model: CmsModel;\n}\ninterface Configurations {\n es: (params: CmsElasticsearchParams) => ElasticsearchConfig;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || \"\";\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n }\n};\n"],"mappings":";;;;;;;;;AACA;;AAaO,MAAMA,cAA8B,GAAG;EAC1CC,EAAE,CAAC;IAAEC;EAAF,CAAD,EAAY;IACV,MAAM;MAAEC,MAAF;MAAUC;IAAV,IAAqBF,KAA3B;;IAEA,IAAI,CAACC,MAAL,EAAa;MACT,MAAM,IAAIE,cAAJ,CACD,4EADC,EAEF,cAFE,CAAN;IAIH,CALD,MAKO,IAAI,CAACD,MAAL,EAAa;MAChB,MAAM,IAAIC,cAAJ,CACD,4EADC,EAEF,cAFE,CAAN;IAIH;;IAED,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAR,CAAYC,4BAAZ,KAA6C,MAAjE;IACA,MAAMC,KAAK,GAAG,CAACJ,WAAW,GAAG,MAAH,GAAYH,MAAxB,EAAgC,cAAhC,EAAgDC,MAAhD,EAAwDF,KAAK,CAACS,OAA9D,EACTC,IADS,CACJ,GADI,EAETC,WAFS,EAAd;IAIA,MAAMC,MAAM,GAAGP,OAAO,CAACC,GAAR,CAAYO,2BAAZ,IAA2C,EAA1D;;IACA,IAAI,CAACD,MAAL,EAAa;MACT,OAAO;QACHJ;MADG,CAAP;IAGH;;IACD,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IADb,CAAP;EAGH;;AA9ByC,CAAvC"}
1
+ {"version":3,"names":["WebinyError","getElasticsearchIndexPrefix","getLastAddedIndexPlugin","isSharedElasticsearchIndex","CmsEntryElasticsearchIndexPlugin","configurations","es","model","tenant","sharedIndex","index","modelId","join","toLowerCase","prefix","indexSettings","context","plugin","container","plugins","type","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsContext } from \"~/types.js\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types.js\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/index.js\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryElasticsearchIndexPlugin.type\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":"AACA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SACIC,2BAA2B,EAC3BC,uBAAuB,EACvBC,0BAA0B,QACvB,2BAA2B;AAElC,SAASC,gCAAgC;AAqBzC,OAAO,MAAMC,cAA8B,GAAG;EAC1CC,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC;IAAO,CAAC,GAAGD,KAAK;IAExB,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIR,WAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMS,WAAW,GAAGN,0BAA0B,CAAC,CAAC;IAChD,MAAMO,KAAK,GAAG,CAACD,WAAW,GAAG,MAAM,GAAGD,MAAM,EAAE,cAAc,EAAED,KAAK,CAACI,OAAO,CAAC,CACvEC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAGb,2BAA2B,CAAC,CAAC;IAE5C,IAAI,CAACa,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDK,aAAa,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC5B,MAAMC,MAAM,GAAGf,uBAAuB,CAAmC;MACrEgB,SAAS,EAAEF,OAAO,CAACG,OAAO;MAC1BC,IAAI,EAAEhB,gCAAgC,CAACgB;IAC3C,CAAC,CAAC;IAEF,OAAOH,MAAM,GAAGA,MAAM,CAACI,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IEntryEntity } from "../definitions/types.js";
3
3
  export interface CreateEntryEntityParams {
4
- table: Table;
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createEntryEntity: (params: CreateEntryEntityParams) => Entity<any>;
7
+ export declare const createEntryEntity: (params: CreateEntryEntityParams) => IEntryEntity;
@@ -1,90 +1,13 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createEntryEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- const createEntryEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createEntryEntity = params => {
15
3
  const {
16
4
  table,
17
- entityName,
18
- attributes
5
+ entityName
19
6
  } = params;
20
- return new _dynamodbToolbox.Entity({
7
+ return createStandardEntity({
21
8
  name: entityName,
22
- table,
23
- attributes: (0, _objectSpread2.default)({
24
- PK: {
25
- type: "string",
26
- partitionKey: true
27
- },
28
- SK: {
29
- type: "string",
30
- sortKey: true
31
- },
32
- TYPE: {
33
- type: "string"
34
- },
35
- __type: {
36
- type: "string"
37
- },
38
- webinyVersion: {
39
- type: "string"
40
- },
41
- tenant: {
42
- type: "string"
43
- },
44
- entryId: {
45
- type: "string"
46
- },
47
- id: {
48
- type: "string"
49
- },
50
- createdBy: {
51
- type: "map"
52
- },
53
- ownedBy: {
54
- type: "map"
55
- },
56
- createdOn: {
57
- type: "string"
58
- },
59
- savedOn: {
60
- type: "string"
61
- },
62
- modelId: {
63
- type: "string"
64
- },
65
- locale: {
66
- type: "string"
67
- },
68
- publishedOn: {
69
- type: "string"
70
- },
71
- version: {
72
- type: "number"
73
- },
74
- locked: {
75
- type: "boolean"
76
- },
77
- status: {
78
- type: "string"
79
- },
80
- values: {
81
- type: "map"
82
- },
83
- meta: {
84
- type: "map"
85
- }
86
- }, attributes || {})
9
+ table: table.table
87
10
  });
88
11
  };
89
12
 
90
- exports.createEntryEntity = createEntryEntity;
13
+ //# sourceMappingURL=entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","createdBy","ownedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","values","meta"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): 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 TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n publishedOn: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,iBAAiB,GAAIC,MAAD,IAAkD;EAC/E,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEH,UADQ;IAEdD,KAFc;IAGdE,UAAU;MACNG,EAAE,EAAE;QACAC,IAAI,EAAE,QADN;QAEAC,YAAY,EAAE;MAFd,CADE;MAKNC,EAAE,EAAE;QACAF,IAAI,EAAE,QADN;QAEAG,OAAO,EAAE;MAFT,CALE;MASNC,IAAI,EAAE;QACFJ,IAAI,EAAE;MADJ,CATA;MAYNK,MAAM,EAAE;QACJL,IAAI,EAAE;MADF,CAZF;MAeNM,aAAa,EAAE;QACXN,IAAI,EAAE;MADK,CAfT;MAkBNO,MAAM,EAAE;QACJP,IAAI,EAAE;MADF,CAlBF;MAqBNQ,OAAO,EAAE;QACLR,IAAI,EAAE;MADD,CArBH;MAwBNS,EAAE,EAAE;QACAT,IAAI,EAAE;MADN,CAxBE;MA2BNU,SAAS,EAAE;QACPV,IAAI,EAAE;MADC,CA3BL;MA8BNW,OAAO,EAAE;QACLX,IAAI,EAAE;MADD,CA9BH;MAiCNY,SAAS,EAAE;QACPZ,IAAI,EAAE;MADC,CAjCL;MAoCNa,OAAO,EAAE;QACLb,IAAI,EAAE;MADD,CApCH;MAuCNc,OAAO,EAAE;QACLd,IAAI,EAAE;MADD,CAvCH;MA0CNe,MAAM,EAAE;QACJf,IAAI,EAAE;MADF,CA1CF;MA6CNgB,WAAW,EAAE;QACThB,IAAI,EAAE;MADG,CA7CP;MAgDNiB,OAAO,EAAE;QACLjB,IAAI,EAAE;MADD,CAhDH;MAmDNkB,MAAM,EAAE;QACJlB,IAAI,EAAE;MADF,CAnDF;MAsDNmB,MAAM,EAAE;QACJnB,IAAI,EAAE;MADF,CAtDF;MAyDNoB,MAAM,EAAE;QACJpB,IAAI,EAAE;MADF,CAzDF;MA4DNqB,IAAI,EAAE;QACFrB,IAAI,EAAE;MADJ;IA5DA,GA+DFJ,UAAU,IAAI,EA/DZ;EAHI,CAAX,CAAP;AAqEH,CAvEM"}
1
+ {"version":3,"names":["createStandardEntity","createEntryEntity","params","table","entityName","name"],"sources":["entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttributesData } from \"~/definitions/types.js\";\n\nexport interface CreateEntryEntityParams {\n table: ITable;\n entityName: string;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): IEntryEntity => {\n const { table, entityName } = params;\n return createStandardEntity<IEntryEntityAttributesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AAOvE,OAAO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAmB;EAChF,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAA6B;IACpDK,IAAI,EAAED,UAAU;IAChBD,KAAK,EAAEA,KAAK,CAACA;EACjB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
3
- export interface CreateGroupEntityParams {
4
- table: Table;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IGroupEntity } from "../definitions/types.js";
3
+ interface Params {
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createGroupEntity: (params: CreateGroupEntityParams) => Entity<any>;
7
+ export declare const createGroupEntity: (params: Params) => IGroupEntity;
8
+ export {};
@@ -1,70 +1,13 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createGroupEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- const createGroupEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createGroupEntity = params => {
15
3
  const {
16
4
  table,
17
- attributes,
18
5
  entityName
19
6
  } = params;
20
- return new _dynamodbToolbox.Entity({
21
- name: entityName,
22
- table,
23
- attributes: (0, _objectSpread2.default)({
24
- PK: {
25
- partitionKey: true
26
- },
27
- SK: {
28
- sortKey: true
29
- },
30
- TYPE: {
31
- type: "string"
32
- },
33
- webinyVersion: {
34
- type: "string"
35
- },
36
- id: {
37
- type: "string"
38
- },
39
- name: {
40
- type: "string"
41
- },
42
- slug: {
43
- type: "string"
44
- },
45
- locale: {
46
- type: "string"
47
- },
48
- description: {
49
- type: "string"
50
- },
51
- icon: {
52
- type: "string"
53
- },
54
- createdBy: {
55
- type: "map"
56
- },
57
- createdOn: {
58
- type: "string"
59
- },
60
- savedOn: {
61
- type: "string"
62
- },
63
- tenant: {
64
- type: "string"
65
- }
66
- }, attributes || {})
7
+ return createStandardEntity({
8
+ table: table.table,
9
+ name: entityName
67
10
  });
68
11
  };
69
12
 
70
- exports.createGroupEntity = createGroupEntity;
13
+ //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: CreateGroupEntityParams): Entity<any> => {\n const { table, attributes, entityName } = 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 TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,iBAAiB,GAAIC,MAAD,IAAkD;EAC/E,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEF,UADQ;IAEdF,KAFc;IAGdC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE;MADJ,CAPA;MAUNC,aAAa,EAAE;QACXD,IAAI,EAAE;MADK,CAVT;MAaNE,EAAE,EAAE;QACAF,IAAI,EAAE;MADN,CAbE;MAgBNN,IAAI,EAAE;QACFM,IAAI,EAAE;MADJ,CAhBA;MAmBNG,IAAI,EAAE;QACFH,IAAI,EAAE;MADJ,CAnBA;MAsBNI,MAAM,EAAE;QACJJ,IAAI,EAAE;MADF,CAtBF;MAyBNK,WAAW,EAAE;QACTL,IAAI,EAAE;MADG,CAzBP;MA4BNM,IAAI,EAAE;QACFN,IAAI,EAAE;MADJ,CA5BA;MAgCNO,SAAS,EAAE;QACPP,IAAI,EAAE;MADC,CAhCL;MAmCNQ,SAAS,EAAE;QACPR,IAAI,EAAE;MADC,CAnCL;MAsCNS,OAAO,EAAE;QACLT,IAAI,EAAE;MADD,CAtCH;MAyCNU,MAAM,EAAE;QACJV,IAAI,EAAE;MADF;IAzCF,GA4CFT,UAAU,IAAI,EA5CZ;EAHI,CAAX,CAAP;AAkDH,CApDM"}
1
+ {"version":3,"names":["createStandardEntity","createGroupEntity","params","table","entityName","name"],"sources":["group.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\nexport const createGroupEntity = (params: Params): IGroupEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsGroup>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AAQvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
3
- export interface CreateModelEntityParams {
4
- table: Table;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IModelEntity } from "../definitions/types.js";
3
+ interface Params {
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createModelEntity: (params: CreateModelEntityParams) => Entity<any>;
7
+ export declare const createModelEntity: (params: Params) => IModelEntity;
8
+ export {};
@@ -1,92 +1,13 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createModelEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- const createModelEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createModelEntity = params => {
15
3
  const {
16
4
  table,
17
- attributes,
18
5
  entityName
19
6
  } = params;
20
- return new _dynamodbToolbox.Entity({
21
- name: entityName,
22
- table,
23
- attributes: (0, _objectSpread2.default)({
24
- PK: {
25
- partitionKey: true
26
- },
27
- SK: {
28
- sortKey: true
29
- },
30
- TYPE: {
31
- type: "string",
32
- required: true
33
- },
34
- webinyVersion: {
35
- type: "string",
36
- required: true
37
- },
38
- name: {
39
- type: "string",
40
- required: true
41
- },
42
- modelId: {
43
- type: "string",
44
- required: true
45
- },
46
- locale: {
47
- type: "string",
48
- required: true
49
- },
50
- group: {
51
- type: "map",
52
- required: true
53
- },
54
- description: {
55
- type: "string"
56
- },
57
- createdOn: {
58
- type: "string",
59
- required: true
60
- },
61
- savedOn: {
62
- type: "string",
63
- required: true
64
- },
65
- createdBy: {
66
- type: "map",
67
- required: true
68
- },
69
- fields: {
70
- type: "list",
71
- required: true
72
- },
73
- layout: {
74
- type: "list",
75
- required: true
76
- },
77
- lockedFields: {
78
- type: "list",
79
- required: true
80
- },
81
- titleFieldId: {
82
- type: "string"
83
- },
84
- tenant: {
85
- type: "string",
86
- required: true
87
- }
88
- }, attributes || {})
7
+ return createStandardEntity({
8
+ table: table.table,
9
+ name: entityName
89
10
  });
90
11
  };
91
12
 
92
- exports.createModelEntity = createModelEntity;
13
+ //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","locale","group","description","createdOn","savedOn","createdBy","fields","layout","lockedFields","titleFieldId","tenant"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: CreateModelEntityParams): Entity<any> => {\n const { table, attributes, entityName } = 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 TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,iBAAiB,GAAIC,MAAD,IAAkD;EAC/E,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEF,UADQ;IAEdF,KAFc;IAGdC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE,QADJ;QAEFC,QAAQ,EAAE;MAFR,CAPA;MAWNC,aAAa,EAAE;QACXF,IAAI,EAAE,QADK;QAEXC,QAAQ,EAAE;MAFC,CAXT;MAeNP,IAAI,EAAE;QACFM,IAAI,EAAE,QADJ;QAEFC,QAAQ,EAAE;MAFR,CAfA;MAmBNE,OAAO,EAAE;QACLH,IAAI,EAAE,QADD;QAELC,QAAQ,EAAE;MAFL,CAnBH;MAuBNG,MAAM,EAAE;QACJJ,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN,CAvBF;MA2BNI,KAAK,EAAE;QACHL,IAAI,EAAE,KADH;QAEHC,QAAQ,EAAE;MAFP,CA3BD;MA+BNK,WAAW,EAAE;QACTN,IAAI,EAAE;MADG,CA/BP;MAkCNO,SAAS,EAAE;QACPP,IAAI,EAAE,QADC;QAEPC,QAAQ,EAAE;MAFH,CAlCL;MAsCNO,OAAO,EAAE;QACLR,IAAI,EAAE,QADD;QAELC,QAAQ,EAAE;MAFL,CAtCH;MA0CNQ,SAAS,EAAE;QACPT,IAAI,EAAE,KADC;QAEPC,QAAQ,EAAE;MAFH,CA1CL;MA8CNS,MAAM,EAAE;QACJV,IAAI,EAAE,MADF;QAEJC,QAAQ,EAAE;MAFN,CA9CF;MAkDNU,MAAM,EAAE;QACJX,IAAI,EAAE,MADF;QAEJC,QAAQ,EAAE;MAFN,CAlDF;MAsDNW,YAAY,EAAE;QACVZ,IAAI,EAAE,MADI;QAEVC,QAAQ,EAAE;MAFA,CAtDR;MA0DNY,YAAY,EAAE;QACVb,IAAI,EAAE;MADI,CA1DR;MA6DNc,MAAM,EAAE;QACJd,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN;IA7DF,GAiEFV,UAAU,IAAI,EAjEZ;EAHI,CAAX,CAAP;AAuEH,CAzEM"}
1
+ {"version":3,"names":["createStandardEntity","createModelEntity","params","table","entityName","name"],"sources":["model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
+ import type { GenericRecord } from "@webiny/api/types.js";
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, CmsModel, ICmsEntryLocation, IEntryState } from "@webiny/api-headless-cms/types/index.js";
4
+ export interface IEntryEntityAttributesData {
5
+ tenant: string;
6
+ entryId: string;
7
+ id: string;
8
+ modelId: string;
9
+ /**
10
+ * Revision-level meta fields. 👇
11
+ */
12
+ revisionCreatedOn: string;
13
+ revisionModifiedOn: string | null;
14
+ revisionSavedOn: string;
15
+ revisionDeletedOn: string | null;
16
+ revisionRestoredOn: string | null;
17
+ revisionFirstPublishedOn: string | null;
18
+ revisionLastPublishedOn: string | null;
19
+ revisionCreatedBy: CmsIdentity;
20
+ revisionModifiedBy: CmsIdentity | null;
21
+ revisionSavedBy: CmsIdentity;
22
+ revisionDeletedBy: CmsIdentity | null;
23
+ revisionRestoredBy: CmsIdentity | null;
24
+ revisionFirstPublishedBy: CmsIdentity | null;
25
+ revisionLastPublishedBy: CmsIdentity | null;
26
+ /**
27
+ * Entry-level meta fields. 👇
28
+ */
29
+ createdOn: string;
30
+ modifiedOn: string | null;
31
+ savedOn: string;
32
+ deletedOn: string | null;
33
+ restoredOn: string | null;
34
+ firstPublishedOn: string | null;
35
+ lastPublishedOn: string | null;
36
+ createdBy: CmsIdentity;
37
+ modifiedBy: CmsIdentity | null;
38
+ savedBy: CmsIdentity;
39
+ deletedBy: CmsIdentity | null;
40
+ restoredBy: CmsIdentity | null;
41
+ firstPublishedBy: CmsIdentity | null;
42
+ lastPublishedBy: CmsIdentity | null;
43
+ /**
44
+ * The rest. 👇
45
+ */
46
+ version: number;
47
+ locked: boolean;
48
+ status: CmsEntryStatus;
49
+ location?: ICmsEntryLocation;
50
+ wbyDeleted?: boolean | null;
51
+ binOriginalFolderId?: string;
52
+ values: GenericRecord;
53
+ meta?: GenericRecord;
54
+ state?: IEntryState;
55
+ }
56
+ export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
57
+ export type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;
58
+ export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
59
+ export type IEntryEntity = IEntity<IEntryEntityAttributes>;
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type {\n CmsEntryStatus,\n CmsGroup,\n CmsIdentity,\n CmsModel,\n ICmsEntryLocation,\n IEntryState\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IEntryEntityAttributesData {\n tenant: string;\n entryId: string;\n id: string;\n modelId: string;\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: string;\n revisionModifiedOn: string | null;\n revisionSavedOn: string;\n revisionDeletedOn: string | null;\n revisionRestoredOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionSavedBy: CmsIdentity;\n revisionDeletedBy: CmsIdentity | null;\n revisionRestoredBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: string;\n modifiedOn: string | null;\n savedOn: string;\n deletedOn: string | null;\n restoredOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n modifiedBy: CmsIdentity | null;\n savedBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n restoredBy: CmsIdentity | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * The rest. 👇\n */\n version: number;\n locked: boolean;\n status: CmsEntryStatus;\n location?: ICmsEntryLocation;\n wbyDeleted?: boolean | null;\n binOriginalFolderId?: string;\n values: GenericRecord;\n meta?: GenericRecord;\n state?: IEntryState;\n}\n\nexport type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;\n\nexport type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;\nexport type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;\nexport type IEntryEntity = IEntity<IEntryEntityAttributes>;\n"],"mappings":"","ignoreList":[]}
@@ -1,2 +1,3 @@
1
- declare const _default: () => import("@webiny/api-headless-cms").StorageTransformPlugin<any, any>[];
1
+ declare const _default: () => import("@webiny/api-headless-cms/index.js").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types/modelField.js").CmsModelField>[];
2
2
  export default _default;
3
+ export declare const createDynamoDbPlugins: () => import("@webiny/api-headless-cms/index.js").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types/modelField.js").CmsModelField>[];
package/dynamoDb/index.js CHANGED
@@ -1,16 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _richText = require("./storage/richText");
9
-
10
- var _longText = require("./storage/longText");
11
-
12
- var _date = require("./storage/date");
13
-
14
- var _default = () => [(0, _richText.createRichTextStorageTransformPlugin)(), (0, _longText.createLongTextStorageTransformPlugin)(), (0, _date.createDateStorageTransformPlugin)()];
15
-
16
- exports.default = _default;
1
+ import { createRichTextStorageTransformPlugin } from "./storage/richText.js";
2
+ import { createLongTextStorageTransformPlugin } from "./storage/longText.js";
3
+ export default () => createDynamoDbPlugins();
4
+ export const createDynamoDbPlugins = () => {
5
+ return [createRichTextStorageTransformPlugin(), createLongTextStorageTransformPlugin()];
6
+ };
7
+
8
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\n\nexport default () => [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createDateStorageTransformPlugin()\n];\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;eAEe,MAAM,CACjB,IAAAA,8CAAA,GADiB,EAEjB,IAAAC,8CAAA,GAFiB,EAGjB,IAAAC,sCAAA,GAHiB,C"}
1
+ {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDynamoDbPlugins"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText.js\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText.js\";\n\nexport default () => createDynamoDbPlugins();\n\nexport const createDynamoDbPlugins = () => {\n return [createRichTextStorageTransformPlugin(), createLongTextStorageTransformPlugin()];\n};\n"],"mappings":"AAAA,SAASA,oCAAoC;AAC7C,SAASC,oCAAoC;AAE7C,eAAe,MAAMC,qBAAqB,CAAC,CAAC;AAE5C,OAAO,MAAMA,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,CAACF,oCAAoC,CAAC,CAAC,EAAEC,oCAAoC,CAAC,CAAC,CAAC;AAC3F,CAAC","ignoreList":[]}
@@ -7,4 +7,4 @@ export interface StorageValue {
7
7
  value: string;
8
8
  isArray?: boolean;
9
9
  }
10
- export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue>;
10
+ export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue, import("@webiny/api-headless-cms/types").CmsModelField>;