@webiny/api-headless-cms-ddb-es 0.0.0-unstable.1e66d121db → 0.0.0-unstable.2696f9d9e8

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 (286) hide show
  1. package/configurations.d.ts +1 -1
  2. package/configurations.js +3 -9
  3. package/configurations.js.map +1 -1
  4. package/definitions/entry.d.ts +2 -2
  5. package/definitions/entry.js +67 -17
  6. package/definitions/entry.js.map +1 -1
  7. package/definitions/entryElasticsearch.d.ts +2 -2
  8. package/definitions/entryElasticsearch.js +8 -12
  9. package/definitions/entryElasticsearch.js.map +1 -1
  10. package/definitions/group.d.ts +2 -2
  11. package/definitions/group.js +8 -12
  12. package/definitions/group.js.map +1 -1
  13. package/definitions/model.d.ts +2 -2
  14. package/definitions/model.js +30 -12
  15. package/definitions/model.js.map +1 -1
  16. package/definitions/system.d.ts +2 -2
  17. package/definitions/system.js +8 -12
  18. package/definitions/system.js.map +1 -1
  19. package/definitions/table.d.ts +4 -4
  20. package/definitions/table.js +7 -6
  21. package/definitions/table.js.map +1 -1
  22. package/definitions/tableElasticsearch.d.ts +4 -4
  23. package/definitions/tableElasticsearch.js +7 -6
  24. package/definitions/tableElasticsearch.js.map +1 -1
  25. package/dynamoDb/index.d.ts +2 -1
  26. package/dynamoDb/index.js +8 -7
  27. package/dynamoDb/index.js.map +1 -1
  28. package/dynamoDb/storage/date.d.ts +2 -1
  29. package/dynamoDb/storage/date.js +23 -38
  30. package/dynamoDb/storage/date.js.map +1 -1
  31. package/dynamoDb/storage/longText.d.ts +1 -1
  32. package/dynamoDb/storage/longText.js +12 -18
  33. package/dynamoDb/storage/longText.js.map +1 -1
  34. package/dynamoDb/storage/richText.d.ts +1 -1
  35. package/dynamoDb/storage/richText.js +14 -37
  36. package/dynamoDb/storage/richText.js.map +1 -1
  37. package/elasticsearch/createElasticsearchIndex.d.ts +1 -1
  38. package/elasticsearch/createElasticsearchIndex.js +19 -40
  39. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  40. package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
  41. package/elasticsearch/deleteElasticsearchIndex.js +5 -10
  42. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  43. package/elasticsearch/index.d.ts +1 -1
  44. package/elasticsearch/index.js +2 -5
  45. package/elasticsearch/index.js.map +1 -1
  46. package/elasticsearch/indexing/dateTimeIndexing.js +8 -23
  47. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  48. package/elasticsearch/indexing/defaultFieldIndexing.js +17 -10
  49. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  50. package/elasticsearch/indexing/index.js +4 -10
  51. package/elasticsearch/indexing/index.js.map +1 -1
  52. package/elasticsearch/indexing/jsonIndexing.d.ts +2 -0
  53. package/elasticsearch/indexing/jsonIndexing.js +28 -0
  54. package/elasticsearch/indexing/jsonIndexing.js.map +1 -0
  55. package/elasticsearch/indexing/longTextIndexing.d.ts +4 -0
  56. package/elasticsearch/indexing/longTextIndexing.js +16 -10
  57. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  58. package/elasticsearch/indexing/numberIndexing.js +2 -9
  59. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  60. package/elasticsearch/indexing/objectIndexing.js +23 -45
  61. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  62. package/elasticsearch/indexing/richTextIndexing.js +2 -5
  63. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  64. package/elasticsearch/indices/base.js +5 -10
  65. package/elasticsearch/indices/base.js.map +1 -1
  66. package/elasticsearch/indices/index.d.ts +1 -1
  67. package/elasticsearch/indices/index.js +2 -4
  68. package/elasticsearch/indices/index.js.map +1 -1
  69. package/elasticsearch/indices/japanese.js +5 -10
  70. package/elasticsearch/indices/japanese.js.map +1 -1
  71. package/elasticsearch/search/index.js +2 -4
  72. package/elasticsearch/search/index.js.map +1 -1
  73. package/elasticsearch/search/refSearch.js +6 -8
  74. package/elasticsearch/search/refSearch.js.map +1 -1
  75. package/elasticsearch/search/timeSearch.js +3 -9
  76. package/elasticsearch/search/timeSearch.js.map +1 -1
  77. package/helpers/entryIndexHelpers.js +51 -65
  78. package/helpers/entryIndexHelpers.js.map +1 -1
  79. package/helpers/fieldIdentifier.d.ts +6 -0
  80. package/helpers/fieldIdentifier.js +43 -0
  81. package/helpers/fieldIdentifier.js.map +1 -0
  82. package/helpers/index.d.ts +1 -1
  83. package/helpers/index.js +11 -13
  84. package/helpers/index.js.map +1 -1
  85. package/index.d.ts +1 -0
  86. package/index.js +74 -68
  87. package/index.js.map +1 -1
  88. package/operations/entry/dataLoader/DataLoaderCache.d.ts +17 -0
  89. package/operations/entry/dataLoader/DataLoaderCache.js +41 -0
  90. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  91. package/operations/entry/dataLoader/constants.d.ts +1 -0
  92. package/operations/entry/dataLoader/constants.js +11 -0
  93. package/operations/entry/dataLoader/constants.js.map +1 -0
  94. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  95. package/operations/entry/dataLoader/createBatchScheduleFn.js +25 -0
  96. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  97. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  98. package/operations/entry/dataLoader/getAllEntryRevisions.js +45 -0
  99. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  100. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  101. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +52 -0
  102. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  103. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  104. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +52 -0
  105. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  106. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  107. package/operations/entry/dataLoader/getRevisionById.js +62 -0
  108. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  109. package/operations/entry/dataLoader/index.d.ts +8 -0
  110. package/operations/entry/dataLoader/index.js +40 -0
  111. package/operations/entry/dataLoader/index.js.map +1 -0
  112. package/operations/entry/dataLoader/types.d.ts +6 -0
  113. package/{upgrades/index.js → operations/entry/dataLoader/types.js} +1 -4
  114. package/operations/entry/dataLoader/types.js.map +1 -0
  115. package/operations/entry/dataLoaders.d.ts +16 -37
  116. package/operations/entry/dataLoaders.js +54 -303
  117. package/operations/entry/dataLoaders.js.map +1 -1
  118. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  119. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +34 -0
  120. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  121. package/operations/entry/elasticsearch/body.d.ts +13 -0
  122. package/operations/entry/elasticsearch/body.js +142 -0
  123. package/operations/entry/elasticsearch/body.js.map +1 -0
  124. package/operations/entry/elasticsearch/fields.d.ts +10 -0
  125. package/operations/entry/elasticsearch/fields.js +287 -0
  126. package/operations/entry/elasticsearch/fields.js.map +1 -0
  127. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +8 -0
  128. package/operations/entry/elasticsearch/filtering/applyFiltering.js +59 -0
  129. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
  130. package/operations/entry/elasticsearch/filtering/exec.d.ts +17 -0
  131. package/operations/entry/elasticsearch/filtering/exec.js +175 -0
  132. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
  133. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
  134. package/operations/entry/elasticsearch/filtering/index.js +18 -0
  135. package/operations/entry/elasticsearch/filtering/index.js.map +1 -0
  136. package/operations/entry/elasticsearch/filtering/path.d.ts +15 -0
  137. package/operations/entry/elasticsearch/filtering/path.js +46 -0
  138. package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
  139. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
  140. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +30 -0
  141. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
  142. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
  143. package/operations/entry/elasticsearch/filtering/plugins/index.js +15 -0
  144. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
  145. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
  146. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +69 -0
  147. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
  148. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
  149. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +50 -0
  150. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
  151. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
  152. package/operations/entry/elasticsearch/filtering/populated.js +25 -0
  153. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
  154. package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
  155. package/operations/entry/elasticsearch/filtering/values.js +24 -0
  156. package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
  157. package/operations/entry/elasticsearch/fullTextSearch.d.ts +12 -0
  158. package/operations/entry/elasticsearch/fullTextSearch.js +91 -0
  159. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
  160. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
  161. package/operations/entry/elasticsearch/fullTextSearchFields.js +27 -0
  162. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
  163. package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
  164. package/operations/entry/elasticsearch/initialQuery.js +105 -0
  165. package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
  166. package/operations/entry/elasticsearch/keyword.d.ts +2 -0
  167. package/operations/entry/elasticsearch/keyword.js +36 -0
  168. package/operations/entry/elasticsearch/keyword.js.map +1 -0
  169. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +9 -0
  170. package/operations/entry/elasticsearch/plugins/bodyModifier.js +18 -0
  171. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -0
  172. package/operations/entry/elasticsearch/plugins/operator.d.ts +8 -0
  173. package/operations/entry/elasticsearch/plugins/operator.js +39 -0
  174. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
  175. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +9 -0
  176. package/operations/entry/elasticsearch/plugins/queryModifier.js +18 -0
  177. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -0
  178. package/operations/entry/elasticsearch/plugins/search.d.ts +7 -0
  179. package/{helpers/searchPluginsList.js → operations/entry/elasticsearch/plugins/search.js} +8 -8
  180. package/operations/entry/elasticsearch/plugins/search.js.map +1 -0
  181. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +9 -0
  182. package/operations/entry/elasticsearch/plugins/sortModifier.js +18 -0
  183. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -0
  184. package/operations/entry/elasticsearch/sort.d.ts +12 -0
  185. package/operations/entry/elasticsearch/sort.js +83 -0
  186. package/operations/entry/elasticsearch/sort.js.map +1 -0
  187. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +16 -0
  188. package/operations/entry/elasticsearch/transformValueForSearch.js +32 -0
  189. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
  190. package/operations/entry/elasticsearch/types.d.ts +41 -0
  191. package/operations/entry/elasticsearch/types.js +7 -0
  192. package/operations/entry/elasticsearch/types.js.map +1 -0
  193. package/operations/entry/index.d.ts +2 -4
  194. package/operations/entry/index.js +670 -449
  195. package/operations/entry/index.js.map +1 -1
  196. package/operations/entry/keys.js +2 -9
  197. package/operations/entry/keys.js.map +1 -1
  198. package/operations/entry/recordType.d.ts +3 -0
  199. package/operations/entry/recordType.js +20 -0
  200. package/operations/entry/recordType.js.map +1 -0
  201. package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
  202. package/operations/entry/transformations/convertEntryKeys.js +38 -0
  203. package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
  204. package/operations/entry/transformations/index.d.ts +29 -0
  205. package/operations/entry/transformations/index.js +127 -0
  206. package/operations/entry/transformations/index.js.map +1 -0
  207. package/operations/entry/transformations/modifyEntryValues.d.ts +46 -0
  208. package/operations/entry/transformations/modifyEntryValues.js +28 -0
  209. package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
  210. package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
  211. package/operations/entry/transformations/transformEntryKeys.js +27 -0
  212. package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
  213. package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
  214. package/operations/entry/transformations/transformEntryToIndex.js +31 -0
  215. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
  216. package/operations/group/index.d.ts +1 -1
  217. package/operations/group/index.js +38 -54
  218. package/operations/group/index.js.map +1 -1
  219. package/operations/model/index.d.ts +1 -1
  220. package/operations/model/index.js +26 -47
  221. package/operations/model/index.js.map +1 -1
  222. package/operations/system/index.d.ts +1 -1
  223. package/operations/system/index.js +18 -23
  224. package/operations/system/index.js.map +1 -1
  225. package/operations/system/indexes.d.ts +10 -0
  226. package/operations/system/indexes.js +41 -0
  227. package/operations/system/indexes.js.map +1 -0
  228. package/package.json +36 -31
  229. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +69 -0
  230. package/plugins/CmsElasticsearchModelFieldPlugin.js +52 -0
  231. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -0
  232. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +5 -1
  233. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +10 -13
  234. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  235. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
  236. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +27 -0
  237. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
  238. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +1 -1
  239. package/plugins/CmsEntryElasticsearchIndexPlugin.js +6 -10
  240. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  241. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +1 -0
  242. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +12 -15
  243. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  244. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +2 -1
  245. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +10 -13
  246. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  247. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +2 -1
  248. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +10 -13
  249. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  250. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +33 -0
  251. package/plugins/CmsEntryElasticsearchValuesModifier.js +50 -0
  252. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -0
  253. package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
  254. package/plugins/CmsEntryFilterPlugin.js +22 -0
  255. package/plugins/CmsEntryFilterPlugin.js.map +1 -0
  256. package/plugins/index.d.ts +8 -0
  257. package/plugins/index.js +95 -0
  258. package/plugins/index.js.map +1 -0
  259. package/types.d.ts +27 -17
  260. package/types.js +6 -10
  261. package/types.js.map +1 -1
  262. package/definitions/settings.d.ts +0 -8
  263. package/definitions/settings.js +0 -58
  264. package/definitions/settings.js.map +0 -1
  265. package/helpers/createElasticsearchQueryBody.d.ts +0 -11
  266. package/helpers/createElasticsearchQueryBody.js +0 -613
  267. package/helpers/createElasticsearchQueryBody.js.map +0 -1
  268. package/helpers/fields.d.ts +0 -19
  269. package/helpers/fields.js +0 -205
  270. package/helpers/fields.js.map +0 -1
  271. package/helpers/searchPluginsList.d.ts +0 -6
  272. package/helpers/searchPluginsList.js.map +0 -1
  273. package/helpers/transformValueForSearch.d.ts +0 -12
  274. package/helpers/transformValueForSearch.js +0 -29
  275. package/helpers/transformValueForSearch.js.map +0 -1
  276. package/operations/entry/elasticsearchFields.d.ts +0 -2
  277. package/operations/entry/elasticsearchFields.js +0 -38
  278. package/operations/entry/elasticsearchFields.js.map +0 -1
  279. package/operations/settings/index.d.ts +0 -6
  280. package/operations/settings/index.js +0 -135
  281. package/operations/settings/index.js.map +0 -1
  282. package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
  283. package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
  284. package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
  285. package/upgrades/index.d.ts +0 -2
  286. package/upgrades/index.js.map +0 -1
@@ -3,7 +3,7 @@ interface ElasticsearchConfig {
3
3
  index: string;
4
4
  }
5
5
  interface CmsElasticsearchParams {
6
- model: CmsModel;
6
+ model: Pick<CmsModel, "tenant" | "locale" | "modelId">;
7
7
  }
8
8
  interface Configurations {
9
9
  es: (params: CmsElasticsearchParams) => ElasticsearchConfig;
package/configurations.js CHANGED
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.configurations = void 0;
9
-
10
8
  var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
9
  const configurations = {
13
10
  es({
14
11
  model
@@ -17,27 +14,24 @@ const configurations = {
17
14
  tenant,
18
15
  locale
19
16
  } = model;
20
-
21
17
  if (!tenant) {
22
18
  throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
23
19
  } else if (!locale) {
24
20
  throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
25
21
  }
26
-
27
22
  const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
28
23
  const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
29
24
  const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || "";
30
-
31
25
  if (!prefix) {
32
26
  return {
33
27
  index
34
28
  };
35
29
  }
36
-
37
30
  return {
38
31
  index: prefix + index
39
32
  };
40
33
  }
41
-
42
34
  };
43
- exports.configurations = configurations;
35
+ 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":["_error","_interopRequireDefault","require","configurations","es","model","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","index","modelId","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX","exports"],"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: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAcO,MAAMC,cAA8B,GAAG;EAC1CC,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CAChB,4EAA2E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAChB,4EAA2E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B,KAAK,MAAM;IACvE,MAAMC,KAAK,GAAG,CAACJ,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACS,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAGP,OAAO,CAACC,GAAG,CAACO,2BAA2B,IAAI,EAAE;IAC5D,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL;AACJ,CAAC;AAACM,OAAA,CAAAhB,cAAA,GAAAA,cAAA"}
@@ -1,7 +1,7 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
1
+ import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
2
  import { Attributes } from "../types";
3
3
  export interface CreateEntryEntityParams {
4
- table: Table;
4
+ table: Table<string, string, string>;
5
5
  entityName: string;
6
6
  attributes: Attributes;
7
7
  }
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.createEntryEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
14
8
  const createEntryEntity = params => {
15
9
  const {
16
10
  table,
17
11
  entityName,
18
12
  attributes
19
13
  } = params;
20
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
21
15
  name: entityName,
22
16
  table,
23
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
24
18
  PK: {
25
19
  type: "string",
26
20
  partitionKey: true
@@ -47,25 +41,76 @@ const createEntryEntity = params => {
47
41
  id: {
48
42
  type: "string"
49
43
  },
50
- createdBy: {
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
+ revisionFirstPublishedOn: {
57
+ type: "string"
58
+ },
59
+ revisionLastPublishedOn: {
60
+ type: "string"
61
+ },
62
+ revisionCreatedBy: {
63
+ type: "map"
64
+ },
65
+ revisionSavedBy: {
51
66
  type: "map"
52
67
  },
53
- ownedBy: {
68
+ revisionModifiedBy: {
54
69
  type: "map"
55
70
  },
71
+ revisionFirstPublishedBy: {
72
+ type: "map"
73
+ },
74
+ revisionLastPublishedBy: {
75
+ type: "map"
76
+ },
77
+ /**
78
+ * Entry-level meta fields. 👇
79
+ */
56
80
  createdOn: {
57
81
  type: "string"
58
82
  },
59
83
  savedOn: {
60
84
  type: "string"
61
85
  },
62
- modelId: {
86
+ modifiedOn: {
63
87
  type: "string"
64
88
  },
65
- locale: {
89
+ firstPublishedOn: {
66
90
  type: "string"
67
91
  },
68
- publishedOn: {
92
+ lastPublishedOn: {
93
+ type: "string"
94
+ },
95
+ createdBy: {
96
+ type: "map"
97
+ },
98
+ savedBy: {
99
+ type: "map"
100
+ },
101
+ modifiedBy: {
102
+ type: "map"
103
+ },
104
+ firstPublishedBy: {
105
+ type: "map"
106
+ },
107
+ lastPublishedBy: {
108
+ type: "map"
109
+ },
110
+ modelId: {
111
+ type: "string"
112
+ },
113
+ locale: {
69
114
  type: "string"
70
115
  },
71
116
  version: {
@@ -77,14 +122,19 @@ const createEntryEntity = params => {
77
122
  status: {
78
123
  type: "string"
79
124
  },
125
+ location: {
126
+ type: "map"
127
+ },
80
128
  values: {
81
129
  type: "map"
82
130
  },
83
131
  meta: {
84
132
  type: "map"
85
- }
86
- }, attributes || {})
133
+ },
134
+ ...(attributes || {})
135
+ }
87
136
  });
88
137
  };
138
+ exports.createEntryEntity = createEntryEntity;
89
139
 
90
- exports.createEntryEntity = createEntryEntity;
140
+ //# 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":["_toolbox","require","createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","firstPublishedBy","lastPublishedBy","modelId","locale","version","locked","status","location","values","meta","exports"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { 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 revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { 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 firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\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 values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,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;MACV,CAAC;MACDQ,OAAO,EAAE;QACLR,IAAI,EAAE;MACV,CAAC;MACDS,EAAE,EAAE;QACAT,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYU,iBAAiB,EAAE;QAAEV,IAAI,EAAE;MAAS,CAAC;MACrCW,eAAe,EAAE;QAAEX,IAAI,EAAE;MAAS,CAAC;MACnCY,kBAAkB,EAAE;QAAEZ,IAAI,EAAE;MAAS,CAAC;MACtCa,wBAAwB,EAAE;QAAEb,IAAI,EAAE;MAAS,CAAC;MAC5Cc,uBAAuB,EAAE;QAAEd,IAAI,EAAE;MAAS,CAAC;MAC3Ce,iBAAiB,EAAE;QAAEf,IAAI,EAAE;MAAM,CAAC;MAClCgB,eAAe,EAAE;QAAEhB,IAAI,EAAE;MAAM,CAAC;MAChCiB,kBAAkB,EAAE;QAAEjB,IAAI,EAAE;MAAM,CAAC;MACnCkB,wBAAwB,EAAE;QAAElB,IAAI,EAAE;MAAM,CAAC;MACzCmB,uBAAuB,EAAE;QAAEnB,IAAI,EAAE;MAAM,CAAC;MAExC;AACZ;AACA;MACYoB,SAAS,EAAE;QAAEpB,IAAI,EAAE;MAAS,CAAC;MAC7BqB,OAAO,EAAE;QAAErB,IAAI,EAAE;MAAS,CAAC;MAC3BsB,UAAU,EAAE;QAAEtB,IAAI,EAAE;MAAS,CAAC;MAC9BuB,gBAAgB,EAAE;QAAEvB,IAAI,EAAE;MAAS,CAAC;MACpCwB,eAAe,EAAE;QAAExB,IAAI,EAAE;MAAS,CAAC;MACnCyB,SAAS,EAAE;QAAEzB,IAAI,EAAE;MAAM,CAAC;MAC1B0B,OAAO,EAAE;QAAE1B,IAAI,EAAE;MAAM,CAAC;MACxB2B,UAAU,EAAE;QAAE3B,IAAI,EAAE;MAAM,CAAC;MAC3B4B,gBAAgB,EAAE;QAAE5B,IAAI,EAAE;MAAM,CAAC;MACjC6B,eAAe,EAAE;QAAE7B,IAAI,EAAE;MAAM,CAAC;MAEhC8B,OAAO,EAAE;QACL9B,IAAI,EAAE;MACV,CAAC;MACD+B,MAAM,EAAE;QACJ/B,IAAI,EAAE;MACV,CAAC;MACDgC,OAAO,EAAE;QACLhC,IAAI,EAAE;MACV,CAAC;MACDiC,MAAM,EAAE;QACJjC,IAAI,EAAE;MACV,CAAC;MACDkC,MAAM,EAAE;QACJlC,IAAI,EAAE;MACV,CAAC;MACDmC,QAAQ,EAAE;QACNnC,IAAI,EAAE;MACV,CAAC;MACDoC,MAAM,EAAE;QACJpC,IAAI,EAAE;MACV,CAAC;MACDqC,IAAI,EAAE;QACFrC,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC0C,OAAA,CAAA9C,iBAAA,GAAAA,iBAAA"}
@@ -1,7 +1,7 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
1
+ import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
2
  import { Attributes } from "../types";
3
3
  export interface CreateEntryElasticsearchEntityParams {
4
- table: Table;
4
+ table: Table<string, string, string>;
5
5
  entityName: string;
6
6
  attributes: Attributes;
7
7
  }
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.createEntryElasticsearchEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
14
8
  const createEntryElasticsearchEntity = params => {
15
9
  const {
16
10
  table,
17
11
  entityName,
18
12
  attributes
19
13
  } = params;
20
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
21
15
  name: entityName,
22
16
  table,
23
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
24
18
  PK: {
25
19
  type: "string",
26
20
  partitionKey: true
@@ -34,9 +28,11 @@ const createEntryElasticsearchEntity = params => {
34
28
  },
35
29
  data: {
36
30
  type: "map"
37
- }
38
- }, attributes || {})
31
+ },
32
+ ...(attributes || {})
33
+ }
39
34
  });
40
35
  };
36
+ exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
41
37
 
42
- exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
38
+ //# sourceMappingURL=entryElasticsearch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,8BAA8B,GACvCC,MAD0C,IAE5B;EACd,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,KAAK,EAAE;QACHJ,IAAI,EAAE;MADH,CATD;MAYNK,IAAI,EAAE;QACFL,IAAI,EAAE;MADJ;IAZA,GAeFJ,UAAU,IAAI,EAfZ;EAHI,CAAX,CAAP;AAqBH,CAzBM"}
1
+ {"version":3,"names":["_toolbox","require","createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACU,OAAA,CAAAd,8BAAA,GAAAA,8BAAA"}
@@ -1,7 +1,7 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
1
+ import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
2
  import { Attributes } from "../types";
3
3
  export interface CreateGroupEntityParams {
4
- table: Table;
4
+ table: Table<string, string, string>;
5
5
  entityName: string;
6
6
  attributes: Attributes;
7
7
  }
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.createGroupEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
14
8
  const createGroupEntity = params => {
15
9
  const {
16
10
  table,
17
11
  attributes,
18
12
  entityName
19
13
  } = params;
20
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
21
15
  name: entityName,
22
16
  table,
23
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
24
18
  PK: {
25
19
  partitionKey: true
26
20
  },
@@ -62,9 +56,11 @@ const createGroupEntity = params => {
62
56
  },
63
57
  tenant: {
64
58
  type: "string"
65
- }
66
- }, attributes || {})
59
+ },
60
+ ...(attributes || {})
61
+ }
67
62
  });
68
63
  };
64
+ exports.createGroupEntity = createGroupEntity;
69
65
 
70
- exports.createGroupEntity = createGroupEntity;
66
+ //# 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":["_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 { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { 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":";;;;;;AAAA,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"}
@@ -1,7 +1,7 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
1
+ import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
2
  import { Attributes } from "../types";
3
3
  export interface CreateModelEntityParams {
4
- table: Table;
4
+ table: Table<string, string, string>;
5
5
  entityName: string;
6
6
  attributes: Attributes;
7
7
  }
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.createModelEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
14
8
  const createModelEntity = params => {
15
9
  const {
16
10
  table,
17
11
  attributes,
18
12
  entityName
19
13
  } = params;
20
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
21
15
  name: entityName,
22
16
  table,
23
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
24
18
  PK: {
25
19
  partitionKey: true
26
20
  },
@@ -43,6 +37,14 @@ const createModelEntity = params => {
43
37
  type: "string",
44
38
  required: true
45
39
  },
40
+ singularApiName: {
41
+ type: "string",
42
+ required: true
43
+ },
44
+ pluralApiName: {
45
+ type: "string",
46
+ required: true
47
+ },
46
48
  locale: {
47
49
  type: "string",
48
50
  required: true
@@ -51,6 +53,9 @@ const createModelEntity = params => {
51
53
  type: "map",
52
54
  required: true
53
55
  },
56
+ icon: {
57
+ type: "string"
58
+ },
54
59
  description: {
55
60
  type: "string"
56
61
  },
@@ -74,6 +79,11 @@ const createModelEntity = params => {
74
79
  type: "list",
75
80
  required: true
76
81
  },
82
+ tags: {
83
+ type: "list",
84
+ required: false,
85
+ default: []
86
+ },
77
87
  lockedFields: {
78
88
  type: "list",
79
89
  required: true
@@ -81,12 +91,20 @@ const createModelEntity = params => {
81
91
  titleFieldId: {
82
92
  type: "string"
83
93
  },
94
+ descriptionFieldId: {
95
+ type: "string"
96
+ },
97
+ imageFieldId: {
98
+ type: "string"
99
+ },
84
100
  tenant: {
85
101
  type: "string",
86
102
  required: true
87
- }
88
- }, attributes || {})
103
+ },
104
+ ...(attributes || {})
105
+ }
89
106
  });
90
107
  };
108
+ exports.createModelEntity = createModelEntity;
91
109
 
92
- exports.createModelEntity = createModelEntity;
110
+ //# 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":["_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 { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { 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":";;;;;;AAAA,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;MACDC,aAAa,EAAE;QACXF,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDP,IAAI,EAAE;QACFM,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDE,OAAO,EAAE;QACLH,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDG,eAAe,EAAE;QACbJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,aAAa,EAAE;QACXL,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDK,MAAM,EAAE;QACJN,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDM,KAAK,EAAE;QACHP,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDO,IAAI,EAAE;QACFR,IAAI,EAAE;MACV,CAAC;MACDS,WAAW,EAAE;QACTT,IAAI,EAAE;MACV,CAAC;MACDU,SAAS,EAAE;QACPV,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDU,OAAO,EAAE;QACLX,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDW,SAAS,EAAE;QACPZ,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDY,MAAM,EAAE;QACJb,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDa,MAAM,EAAE;QACJd,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDc,IAAI,EAAE;QACFf,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,KAAK;QACfe,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVjB,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDiB,YAAY,EAAE;QACVlB,IAAI,EAAE;MACV,CAAC;MACDmB,kBAAkB,EAAE;QAChBnB,IAAI,EAAE;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"}
@@ -1,7 +1,7 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
1
+ import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
2
  import { Attributes } from "../types";
3
3
  export interface CreateSystemEntityParams {
4
- table: Table;
4
+ table: Table<string, string, string>;
5
5
  entityName: string;
6
6
  attributes: Attributes;
7
7
  }
@@ -1,26 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.createSystemEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
14
8
  const createSystemEntity = params => {
15
9
  const {
16
10
  entityName,
17
11
  attributes,
18
12
  table
19
13
  } = params;
20
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
21
15
  name: entityName,
22
16
  table,
23
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
24
18
  PK: {
25
19
  partitionKey: true
26
20
  },
@@ -38,9 +32,11 @@ const createSystemEntity = params => {
38
32
  },
39
33
  readAPIKey: {
40
34
  type: "string"
41
- }
42
- }, attributes || {})
35
+ },
36
+ ...(attributes || {})
37
+ }
43
38
  });
44
39
  };
40
+ exports.createSystemEntity = createSystemEntity;
45
41
 
46
- exports.createSystemEntity = createSystemEntity;
42
+ //# sourceMappingURL=system.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,kBAAkB,GAAIC,MAAD,IAAmD;EACjF,MAAM;IAAEC,UAAF;IAAcC,UAAd;IAA0BC;EAA1B,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEJ,UADQ;IAEdE,KAFc;IAGdD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,OAAO,EAAE;QACLC,IAAI,EAAE;MADD,CAPH;MAUNC,MAAM,EAAE;QACJD,IAAI,EAAE;MADF,CAVF;MAaNE,MAAM,EAAE;QACJF,IAAI,EAAE;MADF,CAbF;MAgBNG,UAAU,EAAE;QACRH,IAAI,EAAE;MADE;IAhBN,GAmBFT,UAAU,IAAI,EAnBZ;EAHI,CAAX,CAAP;AAyBH,CA3BM"}
1
+ {"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey","exports"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA"}
@@ -1,8 +1,8 @@
1
1
  import { TableModifier } from "../types";
2
- import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
- import { Table } from "dynamodb-toolbox";
2
+ import { DynamoDBClient } from "@webiny/aws-sdk/client-dynamodb";
3
+ import { Table } from "@webiny/db-dynamodb/toolbox";
4
4
  export interface CreateTableParams {
5
5
  table?: TableModifier;
6
- documentClient: DocumentClient;
6
+ documentClient: DynamoDBClient;
7
7
  }
8
- export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table;
8
+ export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table<string, string, string>;
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createTable = void 0;
7
-
8
- var _dynamodbToolbox = require("dynamodb-toolbox");
9
-
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
10
8
  const createTable = ({
11
9
  table,
12
10
  documentClient
@@ -15,10 +13,13 @@ const createTable = ({
15
13
  name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
16
14
  partitionKey: "PK",
17
15
  sortKey: "SK",
18
- DocumentClient: documentClient
16
+ DocumentClient: documentClient,
17
+ autoExecute: true,
18
+ autoParse: true
19
19
  };
20
20
  const config = typeof table === "function" ? table(tableConfig) : tableConfig;
21
- return new _dynamodbToolbox.Table(config);
21
+ return new _toolbox.Table(config);
22
22
  };
23
+ exports.createTable = createTable;
23
24
 
24
- exports.createTable = createTable;
25
+ //# sourceMappingURL=table.js.map