@webiny/api-headless-cms-ddb-es 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.9bd236cf5e

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 (276) hide show
  1. package/configurations.d.ts +12 -5
  2. package/configurations.js +18 -4
  3. package/configurations.js.map +1 -1
  4. package/definitions/entry.d.ts +4 -3
  5. package/definitions/entry.js +104 -13
  6. package/definitions/entry.js.map +1 -1
  7. package/definitions/entryElasticsearch.d.ts +4 -3
  8. package/definitions/entryElasticsearch.js +12 -8
  9. package/definitions/entryElasticsearch.js.map +1 -1
  10. package/definitions/group.d.ts +4 -3
  11. package/definitions/group.js +9 -8
  12. package/definitions/group.js.map +1 -1
  13. package/definitions/model.d.ts +4 -3
  14. package/definitions/model.js +9 -8
  15. package/definitions/model.js.map +1 -1
  16. package/definitions/system.d.ts +4 -3
  17. package/definitions/system.js +9 -8
  18. package/definitions/system.js.map +1 -1
  19. package/definitions/table.d.ts +5 -5
  20. package/definitions/table.js +8 -4
  21. package/definitions/table.js.map +1 -1
  22. package/definitions/tableElasticsearch.d.ts +5 -5
  23. package/definitions/tableElasticsearch.js +8 -4
  24. package/definitions/tableElasticsearch.js.map +1 -1
  25. package/dynamoDb/index.d.ts +1 -0
  26. package/dynamoDb/index.js +9 -4
  27. package/dynamoDb/index.js.map +1 -1
  28. package/dynamoDb/storage/longText.js +4 -1
  29. package/dynamoDb/storage/longText.js.map +1 -1
  30. package/dynamoDb/storage/richText.d.ts +0 -5
  31. package/dynamoDb/storage/richText.js +24 -70
  32. package/dynamoDb/storage/richText.js.map +1 -1
  33. package/elasticsearch/createElasticsearchIndex.d.ts +4 -4
  34. package/elasticsearch/createElasticsearchIndex.js +20 -29
  35. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  36. package/elasticsearch/deleteElasticsearchIndex.d.ts +3 -3
  37. package/elasticsearch/deleteElasticsearchIndex.js +6 -4
  38. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  39. package/elasticsearch/index.js +3 -1
  40. package/elasticsearch/index.js.map +1 -1
  41. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  42. package/elasticsearch/indexing/dateTimeIndexing.js +5 -5
  43. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  44. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  45. package/elasticsearch/indexing/defaultFieldIndexing.js +3 -1
  46. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  47. package/elasticsearch/indexing/index.js +5 -2
  48. package/elasticsearch/indexing/index.js.map +1 -1
  49. package/elasticsearch/indexing/jsonIndexing.d.ts +2 -0
  50. package/elasticsearch/indexing/jsonIndexing.js +28 -0
  51. package/elasticsearch/indexing/jsonIndexing.js.map +1 -0
  52. package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
  53. package/elasticsearch/indexing/longTextIndexing.js +3 -1
  54. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  55. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  56. package/elasticsearch/indexing/numberIndexing.js +3 -1
  57. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  58. package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
  59. package/elasticsearch/indexing/objectIndexing.js +8 -12
  60. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  61. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  62. package/elasticsearch/indexing/richTextIndexing.js +3 -1
  63. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  64. package/elasticsearch/indices/base.js +3 -2
  65. package/elasticsearch/indices/base.js.map +1 -1
  66. package/elasticsearch/indices/index.js +3 -1
  67. package/elasticsearch/indices/index.js.map +1 -1
  68. package/elasticsearch/indices/japanese.js +3 -2
  69. package/elasticsearch/indices/japanese.js.map +1 -1
  70. package/elasticsearch/search/index.d.ts +1 -1
  71. package/elasticsearch/search/index.js +5 -2
  72. package/elasticsearch/search/index.js.map +1 -1
  73. package/elasticsearch/search/refSearch.js +3 -1
  74. package/elasticsearch/search/refSearch.js.map +1 -1
  75. package/elasticsearch/search/searchableJson.d.ts +2 -0
  76. package/elasticsearch/search/searchableJson.js +60 -0
  77. package/elasticsearch/search/searchableJson.js.map +1 -0
  78. package/elasticsearch/search/timeSearch.js +4 -3
  79. package/elasticsearch/search/timeSearch.js.map +1 -1
  80. package/helpers/entryIndexHelpers.d.ts +3 -3
  81. package/helpers/entryIndexHelpers.js +19 -13
  82. package/helpers/entryIndexHelpers.js.map +1 -1
  83. package/helpers/fieldIdentifier.d.ts +3 -3
  84. package/helpers/fieldIdentifier.js +6 -2
  85. package/helpers/fieldIdentifier.js.map +1 -1
  86. package/helpers/index.js +3 -1
  87. package/helpers/index.js.map +1 -1
  88. package/index.d.ts +1 -1
  89. package/index.js +28 -20
  90. package/index.js.map +1 -1
  91. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -1
  92. package/operations/entry/dataLoader/DataLoaderCache.js +7 -9
  93. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  94. package/operations/entry/dataLoader/constants.js +3 -2
  95. package/operations/entry/dataLoader/constants.js.map +1 -1
  96. package/operations/entry/dataLoader/createBatchScheduleFn.js +3 -1
  97. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  98. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +2 -2
  99. package/operations/entry/dataLoader/getAllEntryRevisions.js +3 -1
  100. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  101. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +2 -2
  102. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +5 -6
  103. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  104. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +2 -2
  105. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +5 -6
  106. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  107. package/operations/entry/dataLoader/getRevisionById.d.ts +2 -2
  108. package/operations/entry/dataLoader/getRevisionById.js +5 -6
  109. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  110. package/operations/entry/dataLoader/index.d.ts +3 -3
  111. package/operations/entry/dataLoader/index.js +3 -1
  112. package/operations/entry/dataLoader/index.js.map +1 -1
  113. package/operations/entry/dataLoader/types.d.ts +1 -1
  114. package/operations/entry/dataLoader/types.js +3 -1
  115. package/operations/entry/dataLoader/types.js.map +1 -1
  116. package/operations/entry/dataLoaders.d.ts +3 -3
  117. package/operations/entry/dataLoaders.js +15 -14
  118. package/operations/entry/dataLoaders.js.map +1 -1
  119. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  120. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +3 -1
  121. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  122. package/operations/entry/elasticsearch/body.d.ts +3 -3
  123. package/operations/entry/elasticsearch/body.js +3 -1
  124. package/operations/entry/elasticsearch/body.js.map +1 -1
  125. package/operations/entry/elasticsearch/fields.d.ts +2 -2
  126. package/operations/entry/elasticsearch/fields.js +91 -76
  127. package/operations/entry/elasticsearch/fields.js.map +1 -1
  128. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
  129. package/operations/entry/elasticsearch/filtering/applyFiltering.js +4 -1
  130. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  131. package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -4
  132. package/operations/entry/elasticsearch/filtering/exec.js +6 -3
  133. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  134. package/operations/entry/elasticsearch/filtering/index.js +3 -1
  135. package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
  136. package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
  137. package/operations/entry/elasticsearch/filtering/path.js +7 -3
  138. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  139. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +3 -1
  140. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
  141. package/operations/entry/elasticsearch/filtering/plugins/index.js +3 -1
  142. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
  143. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +3 -1
  144. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
  145. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +12 -3
  146. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
  147. package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
  148. package/operations/entry/elasticsearch/filtering/populated.js +4 -2
  149. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  150. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  151. package/operations/entry/elasticsearch/filtering/values.js +3 -1
  152. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  153. package/operations/entry/elasticsearch/fullTextSearch.d.ts +3 -3
  154. package/operations/entry/elasticsearch/fullTextSearch.js +3 -1
  155. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  156. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
  157. package/operations/entry/elasticsearch/fullTextSearchFields.js +3 -1
  158. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  159. package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
  160. package/operations/entry/elasticsearch/initialQuery.js +5 -2
  161. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  162. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  163. package/operations/entry/elasticsearch/keyword.js +3 -1
  164. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  165. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +9 -0
  166. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +26 -0
  167. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +1 -0
  168. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +3 -3
  169. package/operations/entry/elasticsearch/plugins/bodyModifier.js +3 -1
  170. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  171. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
  172. package/operations/entry/elasticsearch/plugins/operator.js +3 -1
  173. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  174. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +3 -3
  175. package/operations/entry/elasticsearch/plugins/queryModifier.js +3 -1
  176. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  177. package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
  178. package/operations/entry/elasticsearch/plugins/search.js +3 -1
  179. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  180. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +3 -3
  181. package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -1
  182. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  183. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
  184. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +13 -0
  185. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
  186. package/operations/entry/elasticsearch/sort.d.ts +4 -4
  187. package/operations/entry/elasticsearch/sort.js +12 -4
  188. package/operations/entry/elasticsearch/sort.js.map +1 -1
  189. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
  190. package/operations/entry/elasticsearch/transformValueForSearch.js +3 -1
  191. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  192. package/operations/entry/elasticsearch/types.d.ts +5 -5
  193. package/operations/entry/elasticsearch/types.js +3 -1
  194. package/operations/entry/elasticsearch/types.js.map +1 -1
  195. package/operations/entry/index.d.ts +4 -4
  196. package/operations/entry/index.js +1040 -476
  197. package/operations/entry/index.js.map +1 -1
  198. package/operations/entry/keys.js +3 -1
  199. package/operations/entry/keys.js.map +1 -1
  200. package/operations/entry/recordType.js +3 -1
  201. package/operations/entry/recordType.js.map +1 -1
  202. package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
  203. package/operations/entry/transformations/convertEntryKeys.js +38 -0
  204. package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
  205. package/operations/entry/transformations/index.d.ts +29 -0
  206. package/operations/entry/transformations/index.js +127 -0
  207. package/operations/entry/transformations/index.js.map +1 -0
  208. package/operations/entry/transformations/modifyEntryValues.d.ts +58 -0
  209. package/operations/entry/transformations/modifyEntryValues.js +28 -0
  210. package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
  211. package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
  212. package/operations/entry/transformations/transformEntryKeys.js +27 -0
  213. package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
  214. package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
  215. package/operations/entry/transformations/transformEntryToIndex.js +31 -0
  216. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
  217. package/operations/group/index.d.ts +3 -3
  218. package/operations/group/index.js +38 -24
  219. package/operations/group/index.js.map +1 -1
  220. package/operations/model/index.d.ts +3 -3
  221. package/operations/model/index.js +26 -14
  222. package/operations/model/index.js.map +1 -1
  223. package/operations/system/index.d.ts +2 -2
  224. package/operations/system/index.js +19 -7
  225. package/operations/system/index.js.map +1 -1
  226. package/operations/system/indexes.d.ts +10 -0
  227. package/operations/system/indexes.js +41 -0
  228. package/operations/system/indexes.js.map +1 -0
  229. package/package.json +35 -35
  230. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
  231. package/plugins/CmsElasticsearchModelFieldPlugin.js +11 -7
  232. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
  233. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
  234. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +4 -5
  235. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  236. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
  237. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +4 -5
  238. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
  239. package/plugins/CmsEntryElasticsearchIndexPlugin.js +5 -4
  240. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  241. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +2 -1
  242. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +8 -5
  243. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  244. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
  245. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +4 -5
  246. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  247. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
  248. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +4 -5
  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 +3 -3
  254. package/plugins/CmsEntryFilterPlugin.js +4 -6
  255. package/plugins/CmsEntryFilterPlugin.js.map +1 -1
  256. package/plugins/index.d.ts +1 -0
  257. package/plugins/index.js +14 -1
  258. package/plugins/index.js.map +1 -1
  259. package/tasks/createIndexTaskPlugin.d.ts +2 -0
  260. package/tasks/createIndexTaskPlugin.js +67 -0
  261. package/tasks/createIndexTaskPlugin.js.map +1 -0
  262. package/types.d.ts +18 -22
  263. package/types.js +5 -5
  264. package/types.js.map +1 -1
  265. package/values/NoValueContainer.d.ts +5 -0
  266. package/values/NoValueContainer.js +20 -0
  267. package/values/NoValueContainer.js.map +1 -0
  268. package/definitions/settings.d.ts +0 -8
  269. package/definitions/settings.js +0 -53
  270. package/definitions/settings.js.map +0 -1
  271. package/dynamoDb/storage/date.d.ts +0 -3
  272. package/dynamoDb/storage/date.js +0 -77
  273. package/dynamoDb/storage/date.js.map +0 -1
  274. package/operations/settings/index.d.ts +0 -6
  275. package/operations/settings/index.js +0 -111
  276. package/operations/settings/index.js.map +0 -1
@@ -1,12 +1,19 @@
1
- import { CmsModel } from "@webiny/api-headless-cms/types";
2
- interface ElasticsearchConfig {
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";
4
+ interface ConfigurationsElasticsearch {
3
5
  index: string;
4
6
  }
5
- interface CmsElasticsearchParams {
7
+ export interface CmsElasticsearchParams {
6
8
  model: Pick<CmsModel, "tenant" | "locale" | "modelId">;
7
9
  }
8
- interface Configurations {
9
- es: (params: CmsElasticsearchParams) => ElasticsearchConfig;
10
+ export interface ConfigurationsIndexSettingsParams {
11
+ context: CmsContext;
12
+ model: Pick<CmsModel, "locale">;
13
+ }
14
+ export interface Configurations {
15
+ es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
16
+ indexSettings: (params: ConfigurationsIndexSettingsParams) => Partial<ElasticsearchIndexRequestBody>;
10
17
  }
11
18
  export declare const configurations: Configurations;
12
19
  export {};
package/configurations.js CHANGED
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.configurations = void 0;
8
8
  var _error = _interopRequireDefault(require("@webiny/error"));
9
- const configurations = {
9
+ var _apiElasticsearch = require("@webiny/api-elasticsearch");
10
+ var _plugins = require("./plugins");
11
+ const configurations = exports.configurations = {
10
12
  es({
11
13
  model
12
14
  }) {
@@ -19,9 +21,9 @@ const configurations = {
19
21
  } else if (!locale) {
20
22
  throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
21
23
  }
22
- const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
24
+ const sharedIndex = (0, _apiElasticsearch.isSharedElasticsearchIndex)();
23
25
  const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
24
- const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || "";
26
+ const prefix = (0, _apiElasticsearch.getElasticsearchIndexPrefix)();
25
27
  if (!prefix) {
26
28
  return {
27
29
  index
@@ -30,6 +32,18 @@ const configurations = {
30
32
  return {
31
33
  index: prefix + index
32
34
  };
35
+ },
36
+ indexSettings: ({
37
+ context,
38
+ model
39
+ }) => {
40
+ const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
41
+ container: context.plugins,
42
+ type: _plugins.CmsEntryElasticsearchIndexPlugin.type,
43
+ locale: model.locale
44
+ });
45
+ return plugin ? plugin.body : {};
33
46
  }
34
47
  };
35
- exports.configurations = configurations;
48
+
49
+ //# 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: 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;AAcO,MAAMA,cAA8B,GAAG;EAC1CC,EAAE,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,cAAc,CACjB;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAChB,4EAA2E,EAC5E,cAAc,CACjB;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,EAAE;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;AAAC"}
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: CmsEntryElasticsearchIndexPlugin.type,\n locale: model.locale\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAsBO,MAAMG,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1CE,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;IAChD,MAAMC,KAAK,GAAG,CAACF,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACO,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;IAE5C,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDM,aAAa,EAAEA,CAAC;IAAEC,OAAO;IAAEb;EAAM,CAAC,KAAK;IACnC,MAAMc,MAAM,GAAG,IAAAC,yCAAuB,EAAmC;MACrEC,SAAS,EAAEH,OAAO,CAACI,OAAO;MAC1BC,IAAI,EAAEC,yCAAgC,CAACD,IAAI;MAC3ChB,MAAM,EAAEF,KAAK,CAACE;IAClB,CAAC,CAAC;IAEF,OAAOY,MAAM,GAAGA,MAAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
@@ -1,7 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateEntryEntityParams {
4
- table: Table;
5
+ table: Table<string, string, string>;
5
6
  entityName: string;
6
7
  attributes: Attributes;
7
8
  }
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createEntryEntity = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _dynamodbToolbox = require("dynamodb-toolbox");
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
10
8
  const createEntryEntity = params => {
11
9
  const {
12
10
  table,
13
11
  entityName,
14
12
  attributes
15
13
  } = params;
16
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
17
15
  name: entityName,
18
16
  table,
19
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
20
18
  PK: {
21
19
  type: "string",
22
20
  partitionKey: true
@@ -43,30 +41,114 @@ const createEntryEntity = params => {
43
41
  id: {
44
42
  type: "string"
45
43
  },
46
- 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
+ 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: {
47
69
  type: "map"
48
70
  },
49
- ownedBy: {
71
+ revisionSavedBy: {
50
72
  type: "map"
51
73
  },
52
- modifiedBy: {
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: {
53
87
  type: "map"
54
88
  },
89
+ /**
90
+ * Entry-level meta fields. 👇
91
+ */
55
92
  createdOn: {
56
93
  type: "string"
57
94
  },
58
95
  savedOn: {
59
96
  type: "string"
60
97
  },
61
- modelId: {
98
+ modifiedOn: {
62
99
  type: "string"
63
100
  },
64
- locale: {
101
+ deletedOn: {
102
+ type: "string"
103
+ },
104
+ restoredOn: {
105
+ type: "string"
106
+ },
107
+ firstPublishedOn: {
108
+ type: "string"
109
+ },
110
+ lastPublishedOn: {
65
111
  type: "string"
66
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
+ },
67
140
  publishedOn: {
68
141
  type: "string"
69
142
  },
143
+ /**
144
+ * The rest. 👇
145
+ */
146
+ modelId: {
147
+ type: "string"
148
+ },
149
+ locale: {
150
+ type: "string"
151
+ },
70
152
  version: {
71
153
  type: "number"
72
154
  },
@@ -79,13 +161,22 @@ const createEntryEntity = params => {
79
161
  location: {
80
162
  type: "map"
81
163
  },
164
+ wbyDeleted: {
165
+ type: "boolean"
166
+ },
167
+ binOriginalFolderId: {
168
+ type: "string"
169
+ },
82
170
  values: {
83
171
  type: "map"
84
172
  },
85
173
  meta: {
86
174
  type: "map"
87
- }
88
- }, attributes || {})
175
+ },
176
+ ...(attributes || {})
177
+ }
89
178
  });
90
179
  };
91
- exports.createEntryEntity = createEntryEntity;
180
+ exports.createEntryEntity = createEntryEntity;
181
+
182
+ //# 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","modifiedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","location","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 modifiedBy: {\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 location: {\n type: \"map\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;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E;QACJtB,IAAI,EAAE;MACV,CAAC;MACDuB,IAAI,EAAE;QACFvB,IAAI,EAAE;MACV;IAAC,GACGJ,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
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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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,7 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateEntryElasticsearchEntityParams {
4
- table: Table;
5
+ table: Table<string, string, string>;
5
6
  entityName: string;
6
7
  attributes: Attributes;
7
8
  }
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createEntryElasticsearchEntity = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _dynamodbToolbox = require("dynamodb-toolbox");
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
10
8
  const createEntryElasticsearchEntity = params => {
11
9
  const {
12
10
  table,
13
11
  entityName,
14
12
  attributes
15
13
  } = params;
16
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
17
15
  name: entityName,
18
16
  table,
19
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
20
18
  PK: {
21
19
  type: "string",
22
20
  partitionKey: true
@@ -30,8 +28,14 @@ const createEntryElasticsearchEntity = params => {
30
28
  },
31
29
  data: {
32
30
  type: "map"
33
- }
34
- }, attributes || {})
31
+ },
32
+ TYPE: {
33
+ type: "string"
34
+ },
35
+ ...(attributes || {})
36
+ }
35
37
  });
36
38
  };
37
- exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
39
+ exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
40
+
41
+ //# 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,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU;MACNG,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;IAAC,GACGJ,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
1
+ {"version":3,"names":["_toolbox","require","createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data","TYPE","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n TYPE: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -1,7 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateGroupEntityParams {
4
- table: Table;
5
+ table: Table<string, string, string>;
5
6
  entityName: string;
6
7
  attributes: Attributes;
7
8
  }
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createGroupEntity = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _dynamodbToolbox = require("dynamodb-toolbox");
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
10
8
  const createGroupEntity = params => {
11
9
  const {
12
10
  table,
13
11
  attributes,
14
12
  entityName
15
13
  } = params;
16
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
17
15
  name: entityName,
18
16
  table,
19
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
20
18
  PK: {
21
19
  partitionKey: true
22
20
  },
@@ -58,8 +56,11 @@ const createGroupEntity = params => {
58
56
  },
59
57
  tenant: {
60
58
  type: "string"
61
- }
62
- }, attributes || {})
59
+ },
60
+ ...(attributes || {})
61
+ }
63
62
  });
64
63
  };
65
- exports.createGroupEntity = createGroupEntity;
64
+ exports.createGroupEntity = createGroupEntity;
65
+
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,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU;MACNI,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;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
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,7 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateModelEntityParams {
4
- table: Table;
5
+ table: Table<string, string, string>;
5
6
  entityName: string;
6
7
  attributes: Attributes;
7
8
  }
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createModelEntity = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _dynamodbToolbox = require("dynamodb-toolbox");
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
10
8
  const createModelEntity = params => {
11
9
  const {
12
10
  table,
13
11
  attributes,
14
12
  entityName
15
13
  } = params;
16
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
17
15
  name: entityName,
18
16
  table,
19
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
20
18
  PK: {
21
19
  partitionKey: true
22
20
  },
@@ -102,8 +100,11 @@ const createModelEntity = params => {
102
100
  tenant: {
103
101
  type: "string",
104
102
  required: true
105
- }
106
- }, attributes || {})
103
+ },
104
+ ...(attributes || {})
105
+ }
107
106
  });
108
107
  };
109
- exports.createModelEntity = createModelEntity;
108
+ exports.createModelEntity = createModelEntity;
109
+
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","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","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 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;AASO,MAAMA,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU;MACNI,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;IAAC,GACGV,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
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;MACD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V,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,7 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateSystemEntityParams {
4
- table: Table;
5
+ table: Table<string, string, string>;
5
6
  entityName: string;
6
7
  attributes: Attributes;
7
8
  }
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createSystemEntity = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _dynamodbToolbox = require("dynamodb-toolbox");
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
10
8
  const createSystemEntity = params => {
11
9
  const {
12
10
  entityName,
13
11
  attributes,
14
12
  table
15
13
  } = params;
16
- return new _dynamodbToolbox.Entity({
14
+ return new _toolbox.Entity({
17
15
  name: entityName,
18
16
  table,
19
- attributes: (0, _objectSpread2.default)({
17
+ attributes: {
20
18
  PK: {
21
19
  partitionKey: true
22
20
  },
@@ -34,8 +32,11 @@ const createSystemEntity = params => {
34
32
  },
35
33
  readAPIKey: {
36
34
  type: "string"
37
- }
38
- }, attributes || {})
35
+ },
36
+ ...(attributes || {})
37
+ }
39
38
  });
40
39
  };
41
- exports.createSystemEntity = createSystemEntity;
40
+ exports.createSystemEntity = createSystemEntity;
41
+
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,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,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;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
1
+ {"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey","exports"],"sources":["system.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { TableModifier } from "../types";
2
- import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
- import { Table } from "dynamodb-toolbox";
1
+ import type { TableModifier } from "../types";
2
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
3
+ import { Table } from "@webiny/db-dynamodb/toolbox";
4
4
  export interface CreateTableParams {
5
5
  table?: TableModifier;
6
- documentClient: DocumentClient;
6
+ documentClient: DynamoDBDocument;
7
7
  }
8
- export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table;
8
+ export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table<string, string, string>;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createTable = void 0;
7
- var _dynamodbToolbox = require("dynamodb-toolbox");
7
+ var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
8
  const createTable = ({
9
9
  table,
10
10
  documentClient
@@ -13,9 +13,13 @@ const createTable = ({
13
13
  name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
14
14
  partitionKey: "PK",
15
15
  sortKey: "SK",
16
- DocumentClient: documentClient
16
+ DocumentClient: documentClient,
17
+ autoExecute: true,
18
+ autoParse: true
17
19
  };
18
20
  const config = typeof table === "function" ? table(tableConfig) : tableConfig;
19
- return new _dynamodbToolbox.Table(config);
21
+ return new _toolbox.Table(config);
20
22
  };
21
- exports.createTable = createTable;
23
+ exports.createTable = createTable;
24
+
25
+ //# sourceMappingURL=table.js.map