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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/README.md +6 -30
  2. package/configurations.d.ts +4 -5
  3. package/configurations.js +12 -24
  4. package/configurations.js.map +1 -1
  5. package/definitions/entry.d.ts +4 -6
  6. package/definitions/entry.js +5 -174
  7. package/definitions/entry.js.map +1 -1
  8. package/definitions/group.d.ts +6 -7
  9. package/definitions/group.js +5 -58
  10. package/definitions/group.js.map +1 -1
  11. package/definitions/model.d.ts +6 -7
  12. package/definitions/model.js +5 -102
  13. package/definitions/model.js.map +1 -1
  14. package/definitions/types.d.ts +59 -0
  15. package/definitions/types.js +3 -0
  16. package/definitions/types.js.map +1 -0
  17. package/dynamoDb/index.d.ts +2 -2
  18. package/dynamoDb/index.js +5 -13
  19. package/dynamoDb/index.js.map +1 -1
  20. package/dynamoDb/storage/longText.js +10 -18
  21. package/dynamoDb/storage/longText.js.map +1 -1
  22. package/dynamoDb/storage/richText.js +10 -18
  23. package/dynamoDb/storage/richText.js.map +1 -1
  24. package/elasticsearch/createElasticsearchIndex.d.ts +1 -1
  25. package/elasticsearch/createElasticsearchIndex.js +7 -15
  26. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  27. package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
  28. package/elasticsearch/deleteElasticsearchIndex.js +3 -10
  29. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  30. package/elasticsearch/index.d.ts +1 -1
  31. package/elasticsearch/index.js +3 -11
  32. package/elasticsearch/index.js.map +1 -1
  33. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  34. package/elasticsearch/indexing/dateTimeIndexing.js +1 -8
  35. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  36. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  37. package/elasticsearch/indexing/defaultFieldIndexing.js +1 -8
  38. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  39. package/elasticsearch/indexing/index.d.ts +1 -1
  40. package/elasticsearch/indexing/index.js +8 -16
  41. package/elasticsearch/indexing/index.js.map +1 -1
  42. package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
  43. package/elasticsearch/indexing/jsonIndexing.js +1 -8
  44. package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
  45. package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
  46. package/elasticsearch/indexing/longTextIndexing.js +1 -8
  47. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  48. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  49. package/elasticsearch/indexing/numberIndexing.js +1 -8
  50. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  51. package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
  52. package/elasticsearch/indexing/objectIndexing.js +6 -13
  53. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  54. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  55. package/elasticsearch/indexing/richTextIndexing.js +1 -8
  56. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  57. package/elasticsearch/indices/base.d.ts +1 -1
  58. package/elasticsearch/indices/base.js +4 -10
  59. package/elasticsearch/indices/base.js.map +1 -1
  60. package/elasticsearch/indices/index.d.ts +1 -1
  61. package/elasticsearch/indices/index.js +3 -11
  62. package/elasticsearch/indices/index.js.map +1 -1
  63. package/elasticsearch/search/index.d.ts +1 -1
  64. package/elasticsearch/search/index.js +4 -11
  65. package/elasticsearch/search/index.js.map +1 -1
  66. package/elasticsearch/search/refSearch.d.ts +1 -1
  67. package/elasticsearch/search/refSearch.js +3 -10
  68. package/elasticsearch/search/refSearch.js.map +1 -1
  69. package/elasticsearch/search/searchableJson.d.ts +1 -1
  70. package/elasticsearch/search/searchableJson.js +9 -16
  71. package/elasticsearch/search/searchableJson.js.map +1 -1
  72. package/elasticsearch/search/timeSearch.d.ts +1 -1
  73. package/elasticsearch/search/timeSearch.js +3 -10
  74. package/elasticsearch/search/timeSearch.js.map +1 -1
  75. package/helpers/entryIndexHelpers.d.ts +9 -9
  76. package/helpers/entryIndexHelpers.js +32 -26
  77. package/helpers/entryIndexHelpers.js.map +1 -1
  78. package/helpers/fieldIdentifier.d.ts +1 -1
  79. package/helpers/fieldIdentifier.js +2 -10
  80. package/helpers/fieldIdentifier.js.map +1 -1
  81. package/helpers/index.d.ts +2 -2
  82. package/helpers/index.js +2 -27
  83. package/helpers/index.js.map +1 -1
  84. package/index.d.ts +2 -2
  85. package/index.js +98 -133
  86. package/index.js.map +1 -1
  87. package/operations/entry/dataLoader/DataLoaderCache.d.ts +0 -2
  88. package/operations/entry/dataLoader/DataLoaderCache.js +2 -9
  89. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  90. package/operations/entry/dataLoader/constants.js +1 -7
  91. package/operations/entry/dataLoader/constants.js.map +1 -1
  92. package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
  93. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  94. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  95. package/operations/entry/dataLoader/getAllEntryRevisions.js +11 -24
  96. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  97. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  98. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +18 -30
  99. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  100. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  101. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +18 -30
  102. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  103. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  104. package/operations/entry/dataLoader/getRevisionById.js +23 -35
  105. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  106. package/operations/entry/dataLoader/index.d.ts +3 -3
  107. package/operations/entry/dataLoader/index.js +10 -31
  108. package/operations/entry/dataLoader/index.js.map +1 -1
  109. package/operations/entry/dataLoader/types.d.ts +3 -4
  110. package/operations/entry/dataLoader/types.js +1 -5
  111. package/operations/entry/dataLoader/types.js.map +1 -1
  112. package/operations/entry/dataLoaders.d.ts +13 -13
  113. package/operations/entry/dataLoaders.js +15 -25
  114. package/operations/entry/dataLoaders.js.map +1 -1
  115. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  116. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -8
  117. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  118. package/operations/entry/elasticsearch/body.d.ts +2 -2
  119. package/operations/entry/elasticsearch/body.js +21 -28
  120. package/operations/entry/elasticsearch/body.js.map +1 -1
  121. package/operations/entry/elasticsearch/fields.d.ts +2 -2
  122. package/operations/entry/elasticsearch/fields.js +110 -24
  123. package/operations/entry/elasticsearch/fields.js.map +1 -1
  124. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
  125. package/operations/entry/elasticsearch/filtering/applyFiltering.js +9 -17
  126. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  127. package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -5
  128. package/operations/entry/elasticsearch/filtering/exec.js +48 -45
  129. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  130. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
  131. package/operations/entry/elasticsearch/filtering/index.js +1 -16
  132. package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
  133. package/operations/entry/elasticsearch/filtering/path.d.ts +1 -1
  134. package/operations/entry/elasticsearch/filtering/path.js +5 -15
  135. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  136. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +1 -1
  137. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +6 -14
  138. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
  139. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -1
  140. package/operations/entry/elasticsearch/filtering/plugins/index.js +5 -12
  141. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
  142. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +1 -1
  143. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +7 -15
  144. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
  145. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +1 -1
  146. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +7 -15
  147. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
  148. package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
  149. package/operations/entry/elasticsearch/filtering/populated.js +1 -8
  150. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  151. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  152. package/operations/entry/elasticsearch/filtering/values.js +4 -12
  153. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  154. package/operations/entry/elasticsearch/fullTextSearch.d.ts +2 -2
  155. package/operations/entry/elasticsearch/fullTextSearch.js +6 -12
  156. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  157. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
  158. package/operations/entry/elasticsearch/fullTextSearchFields.js +1 -8
  159. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  160. package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
  161. package/operations/entry/elasticsearch/initialQuery.js +9 -27
  162. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  163. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  164. package/operations/entry/elasticsearch/keyword.js +4 -9
  165. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  166. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +2 -2
  167. package/operations/entry/elasticsearch/plugins/bodyModifier.js +3 -10
  168. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  169. package/operations/entry/elasticsearch/plugins/operator.d.ts +1 -2
  170. package/operations/entry/elasticsearch/plugins/operator.js +4 -19
  171. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  172. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +2 -2
  173. package/operations/entry/elasticsearch/plugins/queryModifier.js +3 -10
  174. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  175. package/operations/entry/elasticsearch/plugins/search.d.ts +1 -1
  176. package/operations/entry/elasticsearch/plugins/search.js +5 -13
  177. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  178. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +2 -2
  179. package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -10
  180. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  181. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +1 -8
  182. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  183. package/operations/entry/elasticsearch/sort.d.ts +3 -3
  184. package/operations/entry/elasticsearch/sort.js +51 -33
  185. package/operations/entry/elasticsearch/sort.js.map +1 -1
  186. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
  187. package/operations/entry/elasticsearch/transformValueForSearch.js +4 -9
  188. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  189. package/operations/entry/elasticsearch/types.d.ts +2 -2
  190. package/operations/entry/elasticsearch/types.js +1 -5
  191. package/operations/entry/elasticsearch/types.js.map +1 -1
  192. package/operations/entry/index.d.ts +5 -4
  193. package/operations/entry/index.js +333 -515
  194. package/operations/entry/index.js.map +1 -1
  195. package/operations/entry/keys.d.ts +31 -1
  196. package/operations/entry/keys.js +56 -19
  197. package/operations/entry/keys.js.map +1 -1
  198. package/operations/entry/recordType.js +3 -12
  199. package/operations/entry/recordType.js.map +1 -1
  200. package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
  201. package/operations/entry/transformations/convertEntryKeys.js +2 -10
  202. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  203. package/operations/entry/transformations/index.d.ts +16 -16
  204. package/operations/entry/transformations/index.js +22 -30
  205. package/operations/entry/transformations/index.js.map +1 -1
  206. package/operations/entry/transformations/modifyEntryValues.d.ts +27 -34
  207. package/operations/entry/transformations/modifyEntryValues.js +1 -8
  208. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  209. package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
  210. package/operations/entry/transformations/transformEntryKeys.js +4 -11
  211. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  212. package/operations/entry/transformations/transformEntryToIndex.d.ts +6 -6
  213. package/operations/entry/transformations/transformEntryToIndex.js +3 -10
  214. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  215. package/operations/group/index.d.ts +5 -4
  216. package/operations/group/index.js +39 -73
  217. package/operations/group/index.js.map +1 -1
  218. package/operations/model/index.d.ts +3 -3
  219. package/operations/model/index.js +38 -57
  220. package/operations/model/index.js.map +1 -1
  221. package/package.json +27 -32
  222. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
  223. package/plugins/CmsElasticsearchModelFieldPlugin.js +2 -8
  224. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
  225. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +1 -1
  226. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +3 -11
  227. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  228. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
  229. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +3 -11
  230. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
  231. package/plugins/CmsEntryElasticsearchIndexPlugin.js +2 -9
  232. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  233. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +2 -2
  234. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
  235. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  236. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -1
  237. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
  238. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  239. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -1
  240. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +3 -11
  241. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  242. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +12 -12
  243. package/plugins/CmsEntryElasticsearchValuesModifier.js +4 -12
  244. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
  245. package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
  246. package/plugins/CmsEntryFilterPlugin.js +2 -9
  247. package/plugins/CmsEntryFilterPlugin.js.map +1 -1
  248. package/plugins/index.d.ts +8 -8
  249. package/plugins/index.js +8 -93
  250. package/plugins/index.js.map +1 -1
  251. package/tasks/createIndexTaskPlugin.d.ts +2 -2
  252. package/tasks/createIndexTaskPlugin.js +36 -62
  253. package/tasks/createIndexTaskPlugin.js.map +1 -1
  254. package/types.d.ts +23 -26
  255. package/types.js +5 -8
  256. package/types.js.map +1 -1
  257. package/values/NoValueContainer.js +1 -8
  258. package/values/NoValueContainer.js.map +1 -1
  259. package/definitions/entryElasticsearch.d.ts +0 -9
  260. package/definitions/entryElasticsearch.js +0 -41
  261. package/definitions/entryElasticsearch.js.map +0 -1
  262. package/definitions/system.d.ts +0 -9
  263. package/definitions/system.js +0 -42
  264. package/definitions/system.js.map +0 -1
  265. package/definitions/table.d.ts +0 -8
  266. package/definitions/table.js +0 -25
  267. package/definitions/table.js.map +0 -1
  268. package/definitions/tableElasticsearch.d.ts +0 -8
  269. package/definitions/tableElasticsearch.js +0 -25
  270. package/definitions/tableElasticsearch.js.map +0 -1
  271. package/elasticsearch/indices/japanese.d.ts +0 -2
  272. package/elasticsearch/indices/japanese.js +0 -14
  273. package/elasticsearch/indices/japanese.js.map +0 -1
  274. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
  275. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
  276. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
  277. package/operations/system/index.d.ts +0 -6
  278. package/operations/system/index.js +0 -94
  279. package/operations/system/index.js.map +0 -1
  280. package/operations/system/indexes.d.ts +0 -10
  281. package/operations/system/indexes.js +0 -41
  282. package/operations/system/indexes.js.map +0 -1
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,15 +1,14 @@
1
- import type { CmsModel } from "@webiny/api-headless-cms/types";
2
- import type { CmsContext } from "./types";
3
- import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
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
4
  interface ConfigurationsElasticsearch {
5
5
  index: string;
6
6
  }
7
7
  export interface CmsElasticsearchParams {
8
- model: Pick<CmsModel, "tenant" | "locale" | "modelId">;
8
+ model: Pick<CmsModel, "tenant" | "modelId">;
9
9
  }
10
10
  export interface ConfigurationsIndexSettingsParams {
11
11
  context: CmsContext;
12
- model: Pick<CmsModel, "locale">;
13
12
  }
14
13
  export interface Configurations {
15
14
  es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
package/configurations.js CHANGED
@@ -1,29 +1,19 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.configurations = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
10
- var _plugins = require("./plugins");
11
- const configurations = exports.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 = {
12
5
  es({
13
6
  model
14
7
  }) {
15
8
  const {
16
- tenant,
17
- locale
9
+ tenant
18
10
  } = model;
19
11
  if (!tenant) {
20
- throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
21
- } else if (!locale) {
22
- 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");
23
13
  }
24
- const sharedIndex = (0, _apiElasticsearch.isSharedElasticsearchIndex)();
25
- const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
26
- const prefix = (0, _apiElasticsearch.getElasticsearchIndexPrefix)();
14
+ const sharedIndex = isSharedElasticsearchIndex();
15
+ const index = [sharedIndex ? "root" : tenant, "headless-cms", model.modelId].join("-").toLowerCase();
16
+ const prefix = getElasticsearchIndexPrefix();
27
17
  if (!prefix) {
28
18
  return {
29
19
  index
@@ -34,13 +24,11 @@ const configurations = exports.configurations = {
34
24
  };
35
25
  },
36
26
  indexSettings: ({
37
- context,
38
- model
27
+ context
39
28
  }) => {
40
- const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
29
+ const plugin = getLastAddedIndexPlugin({
41
30
  container: context.plugins,
42
- type: _plugins.CmsEntryElasticsearchIndexPlugin.type,
43
- locale: model.locale
31
+ type: CmsEntryElasticsearchIndexPlugin.type
44
32
  });
45
33
  return plugin ? plugin.body : {};
46
34
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","_plugins","configurations","exports","es","model","tenant","locale","WebinyError","sharedIndex","isSharedElasticsearchIndex","index","modelId","join","toLowerCase","prefix","getElasticsearchIndexPrefix","indexSettings","context","plugin","getLastAddedIndexPlugin","container","plugins","type","CmsEntryElasticsearchIndexPlugin","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsContext } from \"~/types\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n model: Pick<CmsModel, \"locale\">;\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, 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 = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, 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, model }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryEl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AAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
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,9 +1,7 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IEntryEntity } from "../definitions/types.js";
4
3
  export interface CreateEntryEntityParams {
5
- table: Table<string, string, string>;
4
+ table: ITable;
6
5
  entityName: string;
7
- attributes: Attributes;
8
6
  }
9
- export declare const createEntryEntity: (params: CreateEntryEntityParams) => Entity<any>;
7
+ export declare const createEntryEntity: (params: CreateEntryEntityParams) => IEntryEntity;
@@ -1,182 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createEntryEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createEntryEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createEntryEntity = params => {
9
3
  const {
10
4
  table,
11
- entityName,
12
- attributes
5
+ entityName
13
6
  } = params;
14
- return new _toolbox.Entity({
7
+ return createStandardEntity({
15
8
  name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- type: "string",
20
- partitionKey: true
21
- },
22
- SK: {
23
- type: "string",
24
- sortKey: true
25
- },
26
- TYPE: {
27
- type: "string"
28
- },
29
- __type: {
30
- type: "string"
31
- },
32
- webinyVersion: {
33
- type: "string"
34
- },
35
- tenant: {
36
- type: "string"
37
- },
38
- entryId: {
39
- type: "string"
40
- },
41
- id: {
42
- type: "string"
43
- },
44
- /**
45
- * Revision-level meta fields. 👇
46
- */
47
- revisionCreatedOn: {
48
- type: "string"
49
- },
50
- revisionSavedOn: {
51
- type: "string"
52
- },
53
- revisionModifiedOn: {
54
- type: "string"
55
- },
56
- revisionDeletedOn: {
57
- type: "string"
58
- },
59
- revisionRestoredOn: {
60
- type: "string"
61
- },
62
- revisionFirstPublishedOn: {
63
- type: "string"
64
- },
65
- revisionLastPublishedOn: {
66
- type: "string"
67
- },
68
- revisionCreatedBy: {
69
- type: "map"
70
- },
71
- revisionSavedBy: {
72
- type: "map"
73
- },
74
- revisionModifiedBy: {
75
- type: "map"
76
- },
77
- revisionDeletedBy: {
78
- type: "map"
79
- },
80
- revisionRestoredBy: {
81
- type: "map"
82
- },
83
- revisionFirstPublishedBy: {
84
- type: "map"
85
- },
86
- revisionLastPublishedBy: {
87
- type: "map"
88
- },
89
- /**
90
- * Entry-level meta fields. 👇
91
- */
92
- createdOn: {
93
- type: "string"
94
- },
95
- savedOn: {
96
- type: "string"
97
- },
98
- modifiedOn: {
99
- type: "string"
100
- },
101
- deletedOn: {
102
- type: "string"
103
- },
104
- restoredOn: {
105
- type: "string"
106
- },
107
- firstPublishedOn: {
108
- type: "string"
109
- },
110
- lastPublishedOn: {
111
- type: "string"
112
- },
113
- createdBy: {
114
- type: "map"
115
- },
116
- savedBy: {
117
- type: "map"
118
- },
119
- modifiedBy: {
120
- type: "map"
121
- },
122
- deletedBy: {
123
- type: "map"
124
- },
125
- restoredBy: {
126
- type: "map"
127
- },
128
- firstPublishedBy: {
129
- type: "map"
130
- },
131
- lastPublishedBy: {
132
- type: "map"
133
- },
134
- /**
135
- * Deprecated fields. 👇
136
- */
137
- ownedBy: {
138
- type: "map"
139
- },
140
- publishedOn: {
141
- type: "string"
142
- },
143
- /**
144
- * The rest. 👇
145
- */
146
- modelId: {
147
- type: "string"
148
- },
149
- locale: {
150
- type: "string"
151
- },
152
- version: {
153
- type: "number"
154
- },
155
- locked: {
156
- type: "boolean"
157
- },
158
- status: {
159
- type: "string"
160
- },
161
- location: {
162
- type: "map"
163
- },
164
- wbyDeleted: {
165
- type: "boolean"
166
- },
167
- binOriginalFolderId: {
168
- type: "string"
169
- },
170
- values: {
171
- type: "map"
172
- },
173
- meta: {
174
- type: "map"
175
- },
176
- ...(attributes || {})
177
- }
9
+ table: table.table
178
10
  });
179
11
  };
180
- exports.createEntryEntity = createEntryEntity;
181
12
 
182
13
  //# sourceMappingURL=entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionDeletedOn","revisionRestoredOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionDeletedBy","revisionRestoredBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","deletedOn","restoredOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","deletedBy","restoredBy","firstPublishedBy","lastPublishedBy","ownedBy","publishedOn","modelId","locale","version","locked","status","location","wbyDeleted","binOriginalFolderId","values","meta","exports"],"sources":["entry.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table<string, string, string>;\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\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: { type: \"string\" },\n revisionSavedOn: { type: \"string\" },\n revisionModifiedOn: { type: \"string\" },\n revisionDeletedOn: { type: \"string\" },\n revisionRestoredOn: { type: \"string\" },\n revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { type: \"map\" },\n revisionDeletedBy: { type: \"map\" },\n revisionRestoredBy: { type: \"map\" },\n revisionFirstPublishedBy: { type: \"map\" },\n revisionLastPublishedBy: { type: \"map\" },\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: { type: \"string\" },\n savedOn: { type: \"string\" },\n modifiedOn: { type: \"string\" },\n deletedOn: { type: \"string\" },\n restoredOn: { type: \"string\" },\n firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n deletedBy: { type: \"map\" },\n restoredBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\n\n /**\n * Deprecated fields. 👇\n */\n ownedBy: {\n type: \"map\"\n },\n publishedOn: {\n type: \"string\"\n },\n\n /**\n * The rest. 👇\n */\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n location: {\n type: \"map\"\n },\n wbyDeleted: {\n type: \"boolean\"\n },\n binOriginalFolderId: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,MAAM,EAAE;QACJL,IAAI,EAAE;MACV,CAAC;MACDM,aAAa,EAAE;QACXN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE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,EAAE;QAAE9B,IAAI,EAAE;MAAS,CAAC;MACnC+B,SAAS,EAAE;QAAE/B,IAAI,EAAE;MAAM,CAAC;MAC1BgC,OAAO,EAAE;QAAEhC,IAAI,EAAE;MAAM,CAAC;MACxBiC,UAAU,EAAE;QAAEjC,IAAI,EAAE;MAAM,CAAC;MAC3BkC,SAAS,EAAE;QAAElC,IAAI,EAAE;MAAM,CAAC;MAC1BmC,UAAU,EAAE;QAAEnC,IAAI,EAAE;MAAM,CAAC;MAC3BoC,gBAAgB,EAAE;QAAEpC,IAAI,EAAE;MAAM,CAAC;MACjCqC,eAAe,EAAE;QAAErC,IAAI,EAAE;MAAM,CAAC;MAEhC;AACZ;AACA;MACYsC,OAAO,EAAE;QACLtC,IAAI,EAAE;MACV,CAAC;MACDuC,WAAW,EAAE;QACTvC,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYwC,OAAO,EAAE;QACLxC,IAAI,EAAE;MACV,CAAC;MACDyC,MAAM,EAAE;QACJzC,IAAI,EAAE;MACV,CAAC;MACD0C,OAAO,EAAE;QACL1C,IAAI,EAAE;MACV,CAAC;MACD2C,MAAM,EAAE;QACJ3C,IAAI,EAAE;MACV,CAAC;MACD4C,MAAM,EAAE;QACJ5C,IAAI,EAAE;MACV,CAAC;MACD6C,QAAQ,EAAE;QACN7C,IAAI,EAAE;MACV,CAAC;MACD8C,UAAU,EAAE;QACR9C,IAAI,EAAE;MACV,CAAC;MACD+C,mBAAmB,EAAE;QACjB/C,IAAI,EAAE;MACV,CAAC;MACDgD,MAAM,EAAE;QACJhD,IAAI,EAAE;MACV,CAAC;MACDiD,IAAI,EAAE;QACFjD,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACsD,OAAA,CAAA1D,iBAAA,GAAAA,iBAAA","ignoreList":[]}
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,9 +1,8 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
4
- export interface CreateGroupEntityParams {
5
- table: Table<string, string, string>;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IGroupEntity } from "../definitions/types.js";
3
+ interface Params {
4
+ table: ITable;
6
5
  entityName: string;
7
- attributes: Attributes;
8
6
  }
9
- export declare const createGroupEntity: (params: CreateGroupEntityParams) => Entity<any>;
7
+ export declare const createGroupEntity: (params: Params) => IGroupEntity;
8
+ export {};
@@ -1,66 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createGroupEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createGroupEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createGroupEntity = params => {
9
3
  const {
10
4
  table,
11
- attributes,
12
5
  entityName
13
6
  } = params;
14
- return new _toolbox.Entity({
15
- name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- partitionKey: true
20
- },
21
- SK: {
22
- sortKey: true
23
- },
24
- TYPE: {
25
- type: "string"
26
- },
27
- webinyVersion: {
28
- type: "string"
29
- },
30
- id: {
31
- type: "string"
32
- },
33
- name: {
34
- type: "string"
35
- },
36
- slug: {
37
- type: "string"
38
- },
39
- locale: {
40
- type: "string"
41
- },
42
- description: {
43
- type: "string"
44
- },
45
- icon: {
46
- type: "string"
47
- },
48
- createdBy: {
49
- type: "map"
50
- },
51
- createdOn: {
52
- type: "string"
53
- },
54
- savedOn: {
55
- type: "string"
56
- },
57
- tenant: {
58
- type: "string"
59
- },
60
- ...(attributes || {})
61
- }
7
+ return createStandardEntity({
8
+ table: table.table,
9
+ name: entityName
62
10
  });
63
11
  };
64
- exports.createGroupEntity = createGroupEntity;
65
12
 
66
13
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant","exports"],"sources":["group.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table<string, string, string>;\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":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,aAAa,EAAE;QACXD,IAAI,EAAE;MACV,CAAC;MACDE,EAAE,EAAE;QACAF,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,WAAW,EAAE;QACTL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MAEDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDS,OAAO,EAAE;QACLT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACoB,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
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,9 +1,8 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
4
- export interface CreateModelEntityParams {
5
- table: Table<string, string, string>;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IModelEntity } from "../definitions/types.js";
3
+ interface Params {
4
+ table: ITable;
6
5
  entityName: string;
7
- attributes: Attributes;
8
6
  }
9
- export declare const createModelEntity: (params: CreateModelEntityParams) => Entity<any>;
7
+ export declare const createModelEntity: (params: Params) => IModelEntity;
8
+ export {};
@@ -1,110 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createModelEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createModelEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createModelEntity = params => {
9
3
  const {
10
4
  table,
11
- attributes,
12
5
  entityName
13
6
  } = params;
14
- return new _toolbox.Entity({
15
- name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- partitionKey: true
20
- },
21
- SK: {
22
- sortKey: true
23
- },
24
- TYPE: {
25
- type: "string",
26
- required: true
27
- },
28
- webinyVersion: {
29
- type: "string",
30
- required: true
31
- },
32
- name: {
33
- type: "string",
34
- required: true
35
- },
36
- modelId: {
37
- type: "string",
38
- required: true
39
- },
40
- singularApiName: {
41
- type: "string",
42
- required: true
43
- },
44
- pluralApiName: {
45
- type: "string",
46
- required: true
47
- },
48
- locale: {
49
- type: "string",
50
- required: true
51
- },
52
- group: {
53
- type: "map",
54
- required: true
55
- },
56
- icon: {
57
- type: "string"
58
- },
59
- description: {
60
- type: "string"
61
- },
62
- createdOn: {
63
- type: "string",
64
- required: true
65
- },
66
- savedOn: {
67
- type: "string",
68
- required: true
69
- },
70
- createdBy: {
71
- type: "map",
72
- required: true
73
- },
74
- fields: {
75
- type: "list",
76
- required: true
77
- },
78
- layout: {
79
- type: "list",
80
- required: true
81
- },
82
- tags: {
83
- type: "list",
84
- required: false,
85
- default: []
86
- },
87
- lockedFields: {
88
- type: "list",
89
- required: true
90
- },
91
- titleFieldId: {
92
- type: "string"
93
- },
94
- descriptionFieldId: {
95
- type: "string"
96
- },
97
- imageFieldId: {
98
- type: "string"
99
- },
100
- tenant: {
101
- type: "string",
102
- required: true
103
- },
104
- ...(attributes || {})
105
- }
7
+ return createStandardEntity({
8
+ table: table.table,
9
+ name: entityName
106
10
  });
107
11
  };
108
- exports.createModelEntity = createModelEntity;
109
12
 
110
13
  //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","tenant","exports"],"sources":["model.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table<string, string, string>;\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 singularApiName: {\n type: \"string\",\n required: true\n },\n pluralApiName: {\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 icon: {\n type: \"string\"\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 tags: {\n type: \"list\",\n required: false,\n default: []\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n descriptionFieldId: {\n type: \"string\"\n },\n imageFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC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E;MACV,CAAC;MACDoB,YAAY,EAAE;QACVpB,IAAI,EAAE;MACV,CAAC;MACDqB,MAAM,EAAE;QACJrB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACD,IAAIV,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC+B,OAAA,CAAAlC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
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":[]}