@webiny/api-headless-cms-ddb-es 0.0.0-ee-vpcs.549378cf03

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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/configurations.d.ts +12 -0
  4. package/configurations.js +43 -0
  5. package/configurations.js.map +1 -0
  6. package/definitions/entry.d.ts +8 -0
  7. package/definitions/entry.js +90 -0
  8. package/definitions/entry.js.map +1 -0
  9. package/definitions/entryElasticsearch.d.ts +8 -0
  10. package/definitions/entryElasticsearch.js +42 -0
  11. package/definitions/entryElasticsearch.js.map +1 -0
  12. package/definitions/group.d.ts +8 -0
  13. package/definitions/group.js +70 -0
  14. package/definitions/group.js.map +1 -0
  15. package/definitions/model.d.ts +8 -0
  16. package/definitions/model.js +97 -0
  17. package/definitions/model.js.map +1 -0
  18. package/definitions/settings.d.ts +8 -0
  19. package/definitions/settings.js +58 -0
  20. package/definitions/settings.js.map +1 -0
  21. package/definitions/system.d.ts +8 -0
  22. package/definitions/system.js +46 -0
  23. package/definitions/system.js.map +1 -0
  24. package/definitions/table.d.ts +8 -0
  25. package/definitions/table.js +24 -0
  26. package/definitions/table.js.map +1 -0
  27. package/definitions/tableElasticsearch.d.ts +8 -0
  28. package/definitions/tableElasticsearch.js +24 -0
  29. package/definitions/tableElasticsearch.js.map +1 -0
  30. package/dynamoDb/index.d.ts +2 -0
  31. package/dynamoDb/index.js +16 -0
  32. package/dynamoDb/index.js.map +1 -0
  33. package/dynamoDb/storage/date.d.ts +3 -0
  34. package/dynamoDb/storage/date.js +99 -0
  35. package/dynamoDb/storage/date.js.map +1 -0
  36. package/dynamoDb/storage/longText.d.ts +10 -0
  37. package/dynamoDb/storage/longText.js +108 -0
  38. package/dynamoDb/storage/longText.js.map +1 -0
  39. package/dynamoDb/storage/richText.d.ts +7 -0
  40. package/dynamoDb/storage/richText.js +128 -0
  41. package/dynamoDb/storage/richText.js.map +1 -0
  42. package/elasticsearch/createElasticsearchIndex.d.ts +9 -0
  43. package/elasticsearch/createElasticsearchIndex.js +60 -0
  44. package/elasticsearch/createElasticsearchIndex.js.map +1 -0
  45. package/elasticsearch/deleteElasticsearchIndex.d.ts +8 -0
  46. package/elasticsearch/deleteElasticsearchIndex.js +43 -0
  47. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -0
  48. package/elasticsearch/index.d.ts +2 -0
  49. package/elasticsearch/index.js +16 -0
  50. package/elasticsearch/index.js.map +1 -0
  51. package/elasticsearch/indexing/dateTimeIndexing.d.ts +3 -0
  52. package/elasticsearch/indexing/dateTimeIndexing.js +103 -0
  53. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -0
  54. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +3 -0
  55. package/elasticsearch/indexing/defaultFieldIndexing.js +47 -0
  56. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -0
  57. package/elasticsearch/indexing/index.d.ts +2 -0
  58. package/elasticsearch/indexing/index.js +24 -0
  59. package/elasticsearch/indexing/index.js.map +1 -0
  60. package/elasticsearch/indexing/longTextIndexing.d.ts +7 -0
  61. package/elasticsearch/indexing/longTextIndexing.js +52 -0
  62. package/elasticsearch/indexing/longTextIndexing.js.map +1 -0
  63. package/elasticsearch/indexing/numberIndexing.d.ts +3 -0
  64. package/elasticsearch/indexing/numberIndexing.js +48 -0
  65. package/elasticsearch/indexing/numberIndexing.js.map +1 -0
  66. package/elasticsearch/indexing/objectIndexing.d.ts +12 -0
  67. package/elasticsearch/indexing/objectIndexing.js +223 -0
  68. package/elasticsearch/indexing/objectIndexing.js.map +1 -0
  69. package/elasticsearch/indexing/richTextIndexing.d.ts +3 -0
  70. package/elasticsearch/indexing/richTextIndexing.js +34 -0
  71. package/elasticsearch/indexing/richTextIndexing.js.map +1 -0
  72. package/elasticsearch/indices/base.d.ts +2 -0
  73. package/elasticsearch/indices/base.js +15 -0
  74. package/elasticsearch/indices/base.js.map +1 -0
  75. package/elasticsearch/indices/index.d.ts +1 -0
  76. package/elasticsearch/indices/index.js +16 -0
  77. package/elasticsearch/indices/index.js.map +1 -0
  78. package/elasticsearch/indices/japanese.d.ts +2 -0
  79. package/elasticsearch/indices/japanese.js +16 -0
  80. package/elasticsearch/indices/japanese.js.map +1 -0
  81. package/elasticsearch/search/index.d.ts +3 -0
  82. package/elasticsearch/search/index.js +14 -0
  83. package/elasticsearch/search/index.js.map +1 -0
  84. package/elasticsearch/search/refSearch.d.ts +2 -0
  85. package/elasticsearch/search/refSearch.js +35 -0
  86. package/elasticsearch/search/refSearch.js.map +1 -0
  87. package/elasticsearch/search/timeSearch.d.ts +2 -0
  88. package/elasticsearch/search/timeSearch.js +33 -0
  89. package/elasticsearch/search/timeSearch.js.map +1 -0
  90. package/helpers/entryIndexHelpers.d.ts +18 -0
  91. package/helpers/entryIndexHelpers.js +204 -0
  92. package/helpers/entryIndexHelpers.js.map +1 -0
  93. package/helpers/index.d.ts +1 -0
  94. package/helpers/index.js +18 -0
  95. package/helpers/index.js.map +1 -0
  96. package/index.d.ts +3 -0
  97. package/index.js +275 -0
  98. package/index.js.map +1 -0
  99. package/operations/entry/dataLoaders.d.ts +51 -0
  100. package/operations/entry/dataLoaders.js +365 -0
  101. package/operations/entry/dataLoaders.js.map +1 -0
  102. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  103. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +34 -0
  104. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  105. package/operations/entry/elasticsearch/body.d.ts +13 -0
  106. package/operations/entry/elasticsearch/body.js +162 -0
  107. package/operations/entry/elasticsearch/body.js.map +1 -0
  108. package/operations/entry/elasticsearch/fields.d.ts +9 -0
  109. package/operations/entry/elasticsearch/fields.js +248 -0
  110. package/operations/entry/elasticsearch/fields.js.map +1 -0
  111. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +8 -0
  112. package/operations/entry/elasticsearch/filtering/applyFiltering.js +66 -0
  113. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
  114. package/operations/entry/elasticsearch/filtering/exec.d.ts +17 -0
  115. package/operations/entry/elasticsearch/filtering/exec.js +215 -0
  116. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
  117. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
  118. package/operations/entry/elasticsearch/filtering/index.js +18 -0
  119. package/operations/entry/elasticsearch/filtering/index.js.map +1 -0
  120. package/operations/entry/elasticsearch/filtering/path.d.ts +15 -0
  121. package/operations/entry/elasticsearch/filtering/path.js +52 -0
  122. package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
  123. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
  124. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +35 -0
  125. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
  126. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
  127. package/operations/entry/elasticsearch/filtering/plugins/index.js +18 -0
  128. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
  129. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
  130. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +78 -0
  131. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
  132. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
  133. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +58 -0
  134. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
  135. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
  136. package/operations/entry/elasticsearch/filtering/populated.js +30 -0
  137. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
  138. package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
  139. package/operations/entry/elasticsearch/filtering/values.js +28 -0
  140. package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
  141. package/operations/entry/elasticsearch/fullTextSearch.d.ts +9 -0
  142. package/operations/entry/elasticsearch/fullTextSearch.js +34 -0
  143. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
  144. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
  145. package/operations/entry/elasticsearch/fullTextSearchFields.js +52 -0
  146. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
  147. package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
  148. package/operations/entry/elasticsearch/initialQuery.js +117 -0
  149. package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
  150. package/operations/entry/elasticsearch/keyword.d.ts +2 -0
  151. package/operations/entry/elasticsearch/keyword.js +38 -0
  152. package/operations/entry/elasticsearch/keyword.js.map +1 -0
  153. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +9 -0
  154. package/operations/entry/elasticsearch/plugins/bodyModifier.js +19 -0
  155. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -0
  156. package/operations/entry/elasticsearch/plugins/operator.d.ts +8 -0
  157. package/operations/entry/elasticsearch/plugins/operator.js +45 -0
  158. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
  159. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +9 -0
  160. package/operations/entry/elasticsearch/plugins/queryModifier.js +19 -0
  161. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -0
  162. package/operations/entry/elasticsearch/plugins/search.d.ts +7 -0
  163. package/operations/entry/elasticsearch/plugins/search.js +30 -0
  164. package/operations/entry/elasticsearch/plugins/search.js.map +1 -0
  165. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +9 -0
  166. package/operations/entry/elasticsearch/plugins/sortModifier.js +19 -0
  167. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -0
  168. package/operations/entry/elasticsearch/sort.d.ts +12 -0
  169. package/operations/entry/elasticsearch/sort.js +92 -0
  170. package/operations/entry/elasticsearch/sort.js.map +1 -0
  171. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +16 -0
  172. package/operations/entry/elasticsearch/transformValueForSearch.js +34 -0
  173. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
  174. package/operations/entry/elasticsearch/types.d.ts +41 -0
  175. package/operations/entry/elasticsearch/types.js +5 -0
  176. package/operations/entry/elasticsearch/types.js.map +1 -0
  177. package/operations/entry/elasticsearchFields.d.ts +2 -0
  178. package/operations/entry/elasticsearchFields.js +38 -0
  179. package/operations/entry/elasticsearchFields.js.map +1 -0
  180. package/operations/entry/index.d.ts +11 -0
  181. package/operations/entry/index.js +1251 -0
  182. package/operations/entry/index.js.map +1 -0
  183. package/operations/entry/keys.d.ts +12 -0
  184. package/operations/entry/keys.js +40 -0
  185. package/operations/entry/keys.js.map +1 -0
  186. package/operations/entry/recordType.d.ts +3 -0
  187. package/operations/entry/recordType.js +24 -0
  188. package/operations/entry/recordType.js.map +1 -0
  189. package/operations/group/index.d.ts +8 -0
  190. package/operations/group/index.js +195 -0
  191. package/operations/group/index.js.map +1 -0
  192. package/operations/model/index.d.ts +8 -0
  193. package/operations/model/index.js +204 -0
  194. package/operations/model/index.js.map +1 -0
  195. package/operations/settings/index.d.ts +6 -0
  196. package/operations/settings/index.js +135 -0
  197. package/operations/settings/index.js.map +1 -0
  198. package/operations/system/index.d.ts +6 -0
  199. package/operations/system/index.js +99 -0
  200. package/operations/system/index.js.map +1 -0
  201. package/package.json +68 -0
  202. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +20 -0
  203. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +24 -0
  204. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -0
  205. package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +12 -0
  206. package/plugins/CmsEntryElasticsearchFieldPlugin.js +24 -0
  207. package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +1 -0
  208. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +4 -0
  209. package/plugins/CmsEntryElasticsearchIndexPlugin.js +17 -0
  210. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -0
  211. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +30 -0
  212. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +43 -0
  213. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -0
  214. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +17 -0
  215. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +24 -0
  216. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -0
  217. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +17 -0
  218. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +24 -0
  219. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -0
  220. package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
  221. package/plugins/CmsEntryFilterPlugin.js +31 -0
  222. package/plugins/CmsEntryFilterPlugin.js.map +1 -0
  223. package/plugins/index.d.ts +6 -0
  224. package/plugins/index.js +83 -0
  225. package/plugins/index.js.map +1 -0
  226. package/types.d.ts +164 -0
  227. package/types.js +47 -0
  228. package/types.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @webiny/api-headless-cms-ddb-es
2
+
3
+ [![](https://img.shields.io/npm/dw/@webiny/api-headless-cms-ddb-es.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb-es)
4
+ [![](https://img.shields.io/npm/v/@webiny/api-headless-cms-ddb-es.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb-es)
5
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
7
+
8
+ ## Install
9
+
10
+ ```
11
+ npm install --save @webiny/api-headless-cms-ddb-es
12
+ ```
13
+
14
+ Or if you prefer yarn:
15
+
16
+ ```
17
+ yarn add @webiny/api-headless-cms-ddb-es
18
+ ```
19
+
20
+
21
+ ## Testing
22
+ To run the tests only for this package you must filter it with keywords.
23
+
24
+ ### Env variables
25
+
26
+ ###### LOCAL_ELASTICSEARCH
27
+ If set, does not run Elasticsearch when starting the tests, use local one. You must install it and run if, of course.
28
+
29
+ ###### ELASTICSEARCH_PORT
30
+ Custom port for local elasticsearch.
31
+
32
+ ### Command
33
+ ````
34
+ ELASTICSEARCH_PORT=9200 LOCAL_ELASTICSEARCH=true yarn test packages/api-headless-cms --keyword=cms:ddb-es --keyword=cms:base
35
+ ````
@@ -0,0 +1,12 @@
1
+ import { CmsModel } from "@webiny/api-headless-cms/types";
2
+ interface ElasticsearchConfig {
3
+ index: string;
4
+ }
5
+ interface CmsElasticsearchParams {
6
+ model: CmsModel;
7
+ }
8
+ interface Configurations {
9
+ es: (params: CmsElasticsearchParams) => ElasticsearchConfig;
10
+ }
11
+ export declare const configurations: Configurations;
12
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.configurations = void 0;
9
+
10
+ var _error = _interopRequireDefault(require("@webiny/error"));
11
+
12
+ const configurations = {
13
+ es({
14
+ model
15
+ }) {
16
+ const {
17
+ tenant,
18
+ locale
19
+ } = model;
20
+
21
+ if (!tenant) {
22
+ throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
23
+ } else if (!locale) {
24
+ throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
25
+ }
26
+
27
+ const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
28
+ const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
29
+ const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || "";
30
+
31
+ if (!prefix) {
32
+ return {
33
+ index
34
+ };
35
+ }
36
+
37
+ return {
38
+ index: prefix + index
39
+ };
40
+ }
41
+
42
+ };
43
+ exports.configurations = configurations;
@@ -0,0 +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"}
@@ -0,0 +1,8 @@
1
+ import { Entity, Table } from "dynamodb-toolbox";
2
+ import { Attributes } from "../types";
3
+ export interface CreateEntryEntityParams {
4
+ table: Table;
5
+ entityName: string;
6
+ attributes: Attributes;
7
+ }
8
+ export declare const createEntryEntity: (params: CreateEntryEntityParams) => Entity<any>;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createEntryEntity = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _dynamodbToolbox = require("dynamodb-toolbox");
13
+
14
+ const createEntryEntity = params => {
15
+ const {
16
+ table,
17
+ entityName,
18
+ attributes
19
+ } = params;
20
+ return new _dynamodbToolbox.Entity({
21
+ name: entityName,
22
+ table,
23
+ attributes: (0, _objectSpread2.default)({
24
+ PK: {
25
+ type: "string",
26
+ partitionKey: true
27
+ },
28
+ SK: {
29
+ type: "string",
30
+ sortKey: true
31
+ },
32
+ TYPE: {
33
+ type: "string"
34
+ },
35
+ __type: {
36
+ type: "string"
37
+ },
38
+ webinyVersion: {
39
+ type: "string"
40
+ },
41
+ tenant: {
42
+ type: "string"
43
+ },
44
+ entryId: {
45
+ type: "string"
46
+ },
47
+ id: {
48
+ type: "string"
49
+ },
50
+ createdBy: {
51
+ type: "map"
52
+ },
53
+ ownedBy: {
54
+ type: "map"
55
+ },
56
+ createdOn: {
57
+ type: "string"
58
+ },
59
+ savedOn: {
60
+ type: "string"
61
+ },
62
+ modelId: {
63
+ type: "string"
64
+ },
65
+ locale: {
66
+ type: "string"
67
+ },
68
+ publishedOn: {
69
+ type: "string"
70
+ },
71
+ version: {
72
+ type: "number"
73
+ },
74
+ locked: {
75
+ type: "boolean"
76
+ },
77
+ status: {
78
+ type: "string"
79
+ },
80
+ values: {
81
+ type: "map"
82
+ },
83
+ meta: {
84
+ type: "map"
85
+ }
86
+ }, attributes || {})
87
+ });
88
+ };
89
+
90
+ exports.createEntryEntity = createEntryEntity;
@@ -0,0 +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"}
@@ -0,0 +1,8 @@
1
+ import { Entity, Table } from "dynamodb-toolbox";
2
+ import { Attributes } from "../types";
3
+ export interface CreateEntryElasticsearchEntityParams {
4
+ table: Table;
5
+ entityName: string;
6
+ attributes: Attributes;
7
+ }
8
+ export declare const createEntryElasticsearchEntity: (params: CreateEntryElasticsearchEntityParams) => Entity<any>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createEntryElasticsearchEntity = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _dynamodbToolbox = require("dynamodb-toolbox");
13
+
14
+ const createEntryElasticsearchEntity = params => {
15
+ const {
16
+ table,
17
+ entityName,
18
+ attributes
19
+ } = params;
20
+ return new _dynamodbToolbox.Entity({
21
+ name: entityName,
22
+ table,
23
+ attributes: (0, _objectSpread2.default)({
24
+ PK: {
25
+ type: "string",
26
+ partitionKey: true
27
+ },
28
+ SK: {
29
+ type: "string",
30
+ sortKey: true
31
+ },
32
+ index: {
33
+ type: "string"
34
+ },
35
+ data: {
36
+ type: "map"
37
+ }
38
+ }, attributes || {})
39
+ });
40
+ };
41
+
42
+ exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
@@ -0,0 +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"}
@@ -0,0 +1,8 @@
1
+ import { Entity, Table } from "dynamodb-toolbox";
2
+ import { Attributes } from "../types";
3
+ export interface CreateGroupEntityParams {
4
+ table: Table;
5
+ entityName: string;
6
+ attributes: Attributes;
7
+ }
8
+ export declare const createGroupEntity: (params: CreateGroupEntityParams) => Entity<any>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createGroupEntity = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _dynamodbToolbox = require("dynamodb-toolbox");
13
+
14
+ const createGroupEntity = params => {
15
+ const {
16
+ table,
17
+ attributes,
18
+ entityName
19
+ } = params;
20
+ return new _dynamodbToolbox.Entity({
21
+ name: entityName,
22
+ table,
23
+ attributes: (0, _objectSpread2.default)({
24
+ PK: {
25
+ partitionKey: true
26
+ },
27
+ SK: {
28
+ sortKey: true
29
+ },
30
+ TYPE: {
31
+ type: "string"
32
+ },
33
+ webinyVersion: {
34
+ type: "string"
35
+ },
36
+ id: {
37
+ type: "string"
38
+ },
39
+ name: {
40
+ type: "string"
41
+ },
42
+ slug: {
43
+ type: "string"
44
+ },
45
+ locale: {
46
+ type: "string"
47
+ },
48
+ description: {
49
+ type: "string"
50
+ },
51
+ icon: {
52
+ type: "string"
53
+ },
54
+ createdBy: {
55
+ type: "map"
56
+ },
57
+ createdOn: {
58
+ type: "string"
59
+ },
60
+ savedOn: {
61
+ type: "string"
62
+ },
63
+ tenant: {
64
+ type: "string"
65
+ }
66
+ }, attributes || {})
67
+ });
68
+ };
69
+
70
+ exports.createGroupEntity = createGroupEntity;
@@ -0,0 +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"}
@@ -0,0 +1,8 @@
1
+ import { Entity, Table } from "dynamodb-toolbox";
2
+ import { Attributes } from "../types";
3
+ export interface CreateModelEntityParams {
4
+ table: Table;
5
+ entityName: string;
6
+ attributes: Attributes;
7
+ }
8
+ export declare const createModelEntity: (params: CreateModelEntityParams) => Entity<any>;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createModelEntity = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _dynamodbToolbox = require("dynamodb-toolbox");
13
+
14
+ const createModelEntity = params => {
15
+ const {
16
+ table,
17
+ attributes,
18
+ entityName
19
+ } = params;
20
+ return new _dynamodbToolbox.Entity({
21
+ name: entityName,
22
+ table,
23
+ attributes: (0, _objectSpread2.default)({
24
+ PK: {
25
+ partitionKey: true
26
+ },
27
+ SK: {
28
+ sortKey: true
29
+ },
30
+ TYPE: {
31
+ type: "string",
32
+ required: true
33
+ },
34
+ webinyVersion: {
35
+ type: "string",
36
+ required: true
37
+ },
38
+ name: {
39
+ type: "string",
40
+ required: true
41
+ },
42
+ modelId: {
43
+ type: "string",
44
+ required: true
45
+ },
46
+ locale: {
47
+ type: "string",
48
+ required: true
49
+ },
50
+ group: {
51
+ type: "map",
52
+ required: true
53
+ },
54
+ description: {
55
+ type: "string"
56
+ },
57
+ createdOn: {
58
+ type: "string",
59
+ required: true
60
+ },
61
+ savedOn: {
62
+ type: "string",
63
+ required: true
64
+ },
65
+ createdBy: {
66
+ type: "map",
67
+ required: true
68
+ },
69
+ fields: {
70
+ type: "list",
71
+ required: true
72
+ },
73
+ layout: {
74
+ type: "list",
75
+ required: true
76
+ },
77
+ tags: {
78
+ type: "list",
79
+ required: false,
80
+ default: []
81
+ },
82
+ lockedFields: {
83
+ type: "list",
84
+ required: true
85
+ },
86
+ titleFieldId: {
87
+ type: "string"
88
+ },
89
+ tenant: {
90
+ type: "string",
91
+ required: true
92
+ }
93
+ }, attributes || {})
94
+ });
95
+ };
96
+
97
+ exports.createModelEntity = createModelEntity;
@@ -0,0 +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","tags","default","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 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 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,IAAI,EAAE;QACFZ,IAAI,EAAE,MADJ;QAEFC,QAAQ,EAAE,KAFR;QAGFY,OAAO,EAAE;MAHP,CAtDA;MA2DNC,YAAY,EAAE;QACVd,IAAI,EAAE,MADI;QAEVC,QAAQ,EAAE;MAFA,CA3DR;MA+DNc,YAAY,EAAE;QACVf,IAAI,EAAE;MADI,CA/DR;MAkENgB,MAAM,EAAE;QACJhB,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN;IAlEF,GAsEFV,UAAU,IAAI,EAtEZ;EAHI,CAAX,CAAP;AA4EH,CA9EM"}
@@ -0,0 +1,8 @@
1
+ import { Entity, Table } from "dynamodb-toolbox";
2
+ import { Attributes } from "../types";
3
+ export interface CreateSettingsEntityParams {
4
+ table: Table;
5
+ entityName: string;
6
+ attributes: Attributes;
7
+ }
8
+ export declare const createSettingsEntity: (params: CreateSettingsEntityParams) => Entity<any>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createSettingsEntity = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _dynamodbToolbox = require("dynamodb-toolbox");
13
+
14
+ const createSettingsEntity = params => {
15
+ const {
16
+ entityName,
17
+ table,
18
+ attributes
19
+ } = params;
20
+ return new _dynamodbToolbox.Entity({
21
+ name: entityName,
22
+ table,
23
+ attributes: (0, _objectSpread2.default)({
24
+ PK: {
25
+ partitionKey: true
26
+ },
27
+ SK: {
28
+ sortKey: true
29
+ },
30
+ TYPE: {
31
+ type: "string"
32
+ },
33
+ key: {
34
+ type: "string"
35
+ },
36
+ uploadMinFileSize: {
37
+ type: "number"
38
+ },
39
+ uploadMaxFileSize: {
40
+ type: "number"
41
+ },
42
+ srcPrefix: {
43
+ type: "string"
44
+ },
45
+ contentModelLastChange: {
46
+ type: "string"
47
+ },
48
+ tenant: {
49
+ type: "string"
50
+ },
51
+ locale: {
52
+ type: "string"
53
+ }
54
+ }, attributes || {})
55
+ });
56
+ };
57
+
58
+ exports.createSettingsEntity = createSettingsEntity;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createSettingsEntity","params","entityName","table","attributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","key","uploadMinFileSize","uploadMaxFileSize","srcPrefix","contentModelLastChange","tenant","locale"],"sources":["settings.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSettingsEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSettingsEntity = (params: CreateSettingsEntityParams): Entity<any> => {\n const { entityName, table, attributes } = 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 key: {\n type: \"string\"\n },\n uploadMinFileSize: {\n type: \"number\"\n },\n uploadMaxFileSize: {\n type: \"number\"\n },\n srcPrefix: {\n type: \"string\"\n },\n contentModelLastChange: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,oBAAoB,GAAIC,MAAD,IAAqD;EACrF,MAAM;IAAEC,UAAF;IAAcC,KAAd;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEJ,UADQ;IAEdC,KAFc;IAGdC,UAAU;MACNG,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE;MADJ,CAPA;MAUNC,GAAG,EAAE;QACDD,IAAI,EAAE;MADL,CAVC;MAaNE,iBAAiB,EAAE;QACfF,IAAI,EAAE;MADS,CAbb;MAgBNG,iBAAiB,EAAE;QACfH,IAAI,EAAE;MADS,CAhBb;MAmBNI,SAAS,EAAE;QACPJ,IAAI,EAAE;MADC,CAnBL;MAsBNK,sBAAsB,EAAE;QACpBL,IAAI,EAAE;MADc,CAtBlB;MAyBNM,MAAM,EAAE;QACJN,IAAI,EAAE;MADF,CAzBF;MA4BNO,MAAM,EAAE;QACJP,IAAI,EAAE;MADF;IA5BF,GA+BFR,UAAU,IAAI,EA/BZ;EAHI,CAAX,CAAP;AAqCH,CAvCM"}
@@ -0,0 +1,8 @@
1
+ import { Entity, Table } from "dynamodb-toolbox";
2
+ import { Attributes } from "../types";
3
+ export interface CreateSystemEntityParams {
4
+ table: Table;
5
+ entityName: string;
6
+ attributes: Attributes;
7
+ }
8
+ export declare const createSystemEntity: (params: CreateSystemEntityParams) => Entity<any>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createSystemEntity = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _dynamodbToolbox = require("dynamodb-toolbox");
13
+
14
+ const createSystemEntity = params => {
15
+ const {
16
+ entityName,
17
+ attributes,
18
+ table
19
+ } = params;
20
+ return new _dynamodbToolbox.Entity({
21
+ name: entityName,
22
+ table,
23
+ attributes: (0, _objectSpread2.default)({
24
+ PK: {
25
+ partitionKey: true
26
+ },
27
+ SK: {
28
+ sortKey: true
29
+ },
30
+ version: {
31
+ type: "string"
32
+ },
33
+ locale: {
34
+ type: "string"
35
+ },
36
+ tenant: {
37
+ type: "string"
38
+ },
39
+ readAPIKey: {
40
+ type: "string"
41
+ }
42
+ }, attributes || {})
43
+ });
44
+ };
45
+
46
+ exports.createSystemEntity = createSystemEntity;
@@ -0,0 +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"}
@@ -0,0 +1,8 @@
1
+ import { TableModifier } from "../types";
2
+ import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
+ import { Table } from "dynamodb-toolbox";
4
+ export interface CreateTableParams {
5
+ table?: TableModifier;
6
+ documentClient: DocumentClient;
7
+ }
8
+ export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createTable = void 0;
7
+
8
+ var _dynamodbToolbox = require("dynamodb-toolbox");
9
+
10
+ const createTable = ({
11
+ table,
12
+ documentClient
13
+ }) => {
14
+ const tableConfig = {
15
+ name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
16
+ partitionKey: "PK",
17
+ sortKey: "SK",
18
+ DocumentClient: documentClient
19
+ };
20
+ const config = typeof table === "function" ? table(tableConfig) : tableConfig;
21
+ return new _dynamodbToolbox.Table(config);
22
+ };
23
+
24
+ exports.createTable = createTable;