@webiny/api-headless-cms-ddb-es 0.0.0-unstable.d4f203fa97 → 0.0.0-unstable.d7f521b032

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 (189) hide show
  1. package/configurations.js +0 -8
  2. package/configurations.js.map +1 -1
  3. package/definitions/entry.js +0 -5
  4. package/definitions/entry.js.map +1 -1
  5. package/definitions/entryElasticsearch.js +0 -5
  6. package/definitions/entryElasticsearch.js.map +1 -1
  7. package/definitions/group.js +0 -5
  8. package/definitions/group.js.map +1 -1
  9. package/definitions/model.js +5 -5
  10. package/definitions/model.js.map +1 -1
  11. package/definitions/settings.js +0 -5
  12. package/definitions/settings.js.map +1 -1
  13. package/definitions/system.js +0 -5
  14. package/definitions/system.js.map +1 -1
  15. package/definitions/table.js +0 -3
  16. package/definitions/table.js.map +1 -1
  17. package/definitions/tableElasticsearch.js +0 -3
  18. package/definitions/tableElasticsearch.js.map +1 -1
  19. package/dynamoDb/index.d.ts +1 -1
  20. package/dynamoDb/index.js +0 -5
  21. package/dynamoDb/index.js.map +1 -1
  22. package/dynamoDb/storage/date.d.ts +2 -1
  23. package/dynamoDb/storage/date.js +1 -16
  24. package/dynamoDb/storage/date.js.map +1 -1
  25. package/dynamoDb/storage/longText.d.ts +1 -1
  26. package/dynamoDb/storage/longText.js +7 -17
  27. package/dynamoDb/storage/longText.js.map +1 -1
  28. package/dynamoDb/storage/richText.d.ts +1 -1
  29. package/dynamoDb/storage/richText.js +9 -29
  30. package/dynamoDb/storage/richText.js.map +1 -1
  31. package/elasticsearch/createElasticsearchIndex.js +0 -11
  32. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  33. package/elasticsearch/deleteElasticsearchIndex.js +0 -7
  34. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  35. package/elasticsearch/index.js +0 -5
  36. package/elasticsearch/index.js.map +1 -1
  37. package/elasticsearch/indexing/dateTimeIndexing.js +4 -21
  38. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  39. package/elasticsearch/indexing/defaultFieldIndexing.js +15 -10
  40. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  41. package/elasticsearch/indexing/index.js +0 -9
  42. package/elasticsearch/indexing/index.js.map +1 -1
  43. package/elasticsearch/indexing/longTextIndexing.d.ts +4 -0
  44. package/elasticsearch/indexing/longTextIndexing.js +19 -9
  45. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  46. package/elasticsearch/indexing/numberIndexing.js +0 -9
  47. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  48. package/elasticsearch/indexing/objectIndexing.js +3 -30
  49. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  50. package/elasticsearch/indexing/richTextIndexing.js +0 -5
  51. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  52. package/elasticsearch/indices/base.js +0 -3
  53. package/elasticsearch/indices/base.js.map +1 -1
  54. package/elasticsearch/indices/index.js +0 -4
  55. package/elasticsearch/indices/index.js.map +1 -1
  56. package/elasticsearch/indices/japanese.js +0 -3
  57. package/elasticsearch/indices/japanese.js.map +1 -1
  58. package/elasticsearch/search/index.js +0 -4
  59. package/elasticsearch/search/index.js.map +1 -1
  60. package/elasticsearch/search/refSearch.js +0 -6
  61. package/elasticsearch/search/refSearch.js.map +1 -1
  62. package/elasticsearch/search/timeSearch.js +0 -7
  63. package/elasticsearch/search/timeSearch.js.map +1 -1
  64. package/helpers/entryIndexHelpers.js +20 -49
  65. package/helpers/entryIndexHelpers.js.map +1 -1
  66. package/helpers/index.js +0 -2
  67. package/helpers/index.js.map +1 -1
  68. package/index.js +13 -64
  69. package/index.js.map +1 -1
  70. package/operations/entry/dataLoaders.js +0 -52
  71. package/operations/entry/dataLoaders.js.map +1 -1
  72. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  73. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +32 -0
  74. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  75. package/operations/entry/elasticsearch/body.js +7 -29
  76. package/operations/entry/elasticsearch/body.js.map +1 -1
  77. package/operations/entry/elasticsearch/fields.js +79 -46
  78. package/operations/entry/elasticsearch/fields.js.map +1 -1
  79. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +3 -10
  80. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -9
  81. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  82. package/operations/entry/elasticsearch/filtering/exec.js +36 -91
  83. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  84. package/operations/entry/elasticsearch/filtering/index.js +0 -2
  85. package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
  86. package/operations/entry/elasticsearch/filtering/path.js +1 -8
  87. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  88. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
  89. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +28 -0
  90. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
  91. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
  92. package/operations/entry/elasticsearch/filtering/plugins/index.js +13 -0
  93. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
  94. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
  95. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +65 -0
  96. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
  97. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
  98. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +48 -0
  99. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
  100. package/operations/entry/elasticsearch/filtering/populated.js +0 -7
  101. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  102. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  103. package/operations/entry/elasticsearch/filtering/values.js +3 -9
  104. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  105. package/operations/entry/elasticsearch/fullTextSearch.d.ts +4 -1
  106. package/operations/entry/elasticsearch/fullTextSearch.js +70 -15
  107. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  108. package/operations/entry/elasticsearch/fullTextSearchFields.js +8 -35
  109. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  110. package/operations/entry/elasticsearch/initialQuery.js +5 -19
  111. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  112. package/operations/entry/elasticsearch/keyword.js +0 -4
  113. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  114. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -3
  115. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  116. package/operations/entry/elasticsearch/plugins/operator.js +0 -8
  117. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  118. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -3
  119. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  120. package/operations/entry/elasticsearch/plugins/search.js +0 -6
  121. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  122. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -3
  123. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  124. package/operations/entry/elasticsearch/sort.js +12 -15
  125. package/operations/entry/elasticsearch/sort.js.map +1 -1
  126. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -4
  127. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  128. package/operations/entry/elasticsearch/types.d.ts +9 -1
  129. package/operations/entry/elasticsearch/types.js.map +1 -1
  130. package/operations/entry/index.js +32 -155
  131. package/operations/entry/index.js.map +1 -1
  132. package/operations/entry/keys.js +0 -9
  133. package/operations/entry/keys.js.map +1 -1
  134. package/operations/entry/recordType.js +0 -6
  135. package/operations/entry/recordType.js.map +1 -1
  136. package/operations/group/index.js +2 -32
  137. package/operations/group/index.js.map +1 -1
  138. package/operations/model/index.js +0 -33
  139. package/operations/model/index.js.map +1 -1
  140. package/operations/settings/index.js +0 -24
  141. package/operations/settings/index.js.map +1 -1
  142. package/operations/system/index.js +0 -17
  143. package/operations/system/index.js.map +1 -1
  144. package/package.json +16 -16
  145. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +1 -0
  146. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +6 -8
  147. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  148. package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -6
  149. package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +1 -1
  150. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
  151. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +28 -0
  152. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
  153. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -5
  154. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  155. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +1 -0
  156. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +6 -12
  157. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  158. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -0
  159. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +6 -8
  160. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  161. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -0
  162. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +6 -8
  163. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  164. package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
  165. package/plugins/CmsEntryFilterPlugin.js +24 -0
  166. package/plugins/CmsEntryFilterPlugin.js.map +1 -0
  167. package/plugins/index.d.ts +1 -0
  168. package/plugins/index.js +11 -12
  169. package/plugins/index.js.map +1 -1
  170. package/types.js +0 -5
  171. package/types.js.map +1 -1
  172. package/helpers/createElasticsearchQueryBody.d.ts +0 -11
  173. package/helpers/createElasticsearchQueryBody.js +0 -618
  174. package/helpers/createElasticsearchQueryBody.js.map +0 -1
  175. package/helpers/fields.d.ts +0 -19
  176. package/helpers/fields.js +0 -196
  177. package/helpers/fields.js.map +0 -1
  178. package/helpers/searchPluginsList.d.ts +0 -6
  179. package/helpers/searchPluginsList.js +0 -26
  180. package/helpers/searchPluginsList.js.map +0 -1
  181. package/helpers/transformValueForSearch.d.ts +0 -12
  182. package/helpers/transformValueForSearch.js +0 -29
  183. package/helpers/transformValueForSearch.js.map +0 -1
  184. package/operations/entry/elasticsearch/filtering/isRefFieldFiltering.d.ts +0 -8
  185. package/operations/entry/elasticsearch/filtering/isRefFieldFiltering.js +0 -39
  186. package/operations/entry/elasticsearch/filtering/isRefFieldFiltering.js.map +0 -1
  187. package/operations/entry/elasticsearchFields.d.ts +0 -2
  188. package/operations/entry/elasticsearchFields.js +0 -38
  189. package/operations/entry/elasticsearchFields.js.map +0 -1
package/configurations.js CHANGED
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.configurations = void 0;
9
-
10
8
  var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
9
  const configurations = {
13
10
  es({
14
11
  model
@@ -17,27 +14,22 @@ const configurations = {
17
14
  tenant,
18
15
  locale
19
16
  } = model;
20
-
21
17
  if (!tenant) {
22
18
  throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
23
19
  } else if (!locale) {
24
20
  throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
25
21
  }
26
-
27
22
  const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
28
23
  const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
29
24
  const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || "";
30
-
31
25
  if (!prefix) {
32
26
  return {
33
27
  index
34
28
  };
35
29
  }
36
-
37
30
  return {
38
31
  index: prefix + index
39
32
  };
40
33
  }
41
-
42
34
  };
43
35
  exports.configurations = configurations;
@@ -1 +1 @@
1
- {"version":3,"names":["configurations","es","model","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","index","modelId","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX"],"sources":["configurations.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\ninterface CmsElasticsearchParams {\n model: CmsModel;\n}\ninterface Configurations {\n es: (params: CmsElasticsearchParams) => ElasticsearchConfig;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || \"\";\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n }\n};\n"],"mappings":";;;;;;;;;AACA;;AAaO,MAAMA,cAA8B,GAAG;EAC1CC,EAAE,CAAC;IAAEC;EAAF,CAAD,EAAY;IACV,MAAM;MAAEC,MAAF;MAAUC;IAAV,IAAqBF,KAA3B;;IAEA,IAAI,CAACC,MAAL,EAAa;MACT,MAAM,IAAIE,cAAJ,CACD,4EADC,EAEF,cAFE,CAAN;IAIH,CALD,MAKO,IAAI,CAACD,MAAL,EAAa;MAChB,MAAM,IAAIC,cAAJ,CACD,4EADC,EAEF,cAFE,CAAN;IAIH;;IAED,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAR,CAAYC,4BAAZ,KAA6C,MAAjE;IACA,MAAMC,KAAK,GAAG,CAACJ,WAAW,GAAG,MAAH,GAAYH,MAAxB,EAAgC,cAAhC,EAAgDC,MAAhD,EAAwDF,KAAK,CAACS,OAA9D,EACTC,IADS,CACJ,GADI,EAETC,WAFS,EAAd;IAIA,MAAMC,MAAM,GAAGP,OAAO,CAACC,GAAR,CAAYO,2BAAZ,IAA2C,EAA1D;;IACA,IAAI,CAACD,MAAL,EAAa;MACT,OAAO;QACHJ;MADG,CAAP;IAGH;;IACD,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IADb,CAAP;EAGH;;AA9ByC,CAAvC"}
1
+ {"version":3,"names":["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;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,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createEntryEntity = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
10
  const createEntryEntity = params => {
15
11
  const {
16
12
  table,
@@ -86,5 +82,4 @@ const createEntryEntity = params => {
86
82
  }, attributes || {})
87
83
  });
88
84
  };
89
-
90
85
  exports.createEntryEntity = createEntryEntity;
@@ -1 +1 @@
1
- {"version":3,"names":["createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","createdBy","ownedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","values","meta"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n publishedOn: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,iBAAiB,GAAIC,MAAD,IAAkD;EAC/E,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEH,UADQ;IAEdD,KAFc;IAGdE,UAAU;MACNG,EAAE,EAAE;QACAC,IAAI,EAAE,QADN;QAEAC,YAAY,EAAE;MAFd,CADE;MAKNC,EAAE,EAAE;QACAF,IAAI,EAAE,QADN;QAEAG,OAAO,EAAE;MAFT,CALE;MASNC,IAAI,EAAE;QACFJ,IAAI,EAAE;MADJ,CATA;MAYNK,MAAM,EAAE;QACJL,IAAI,EAAE;MADF,CAZF;MAeNM,aAAa,EAAE;QACXN,IAAI,EAAE;MADK,CAfT;MAkBNO,MAAM,EAAE;QACJP,IAAI,EAAE;MADF,CAlBF;MAqBNQ,OAAO,EAAE;QACLR,IAAI,EAAE;MADD,CArBH;MAwBNS,EAAE,EAAE;QACAT,IAAI,EAAE;MADN,CAxBE;MA2BNU,SAAS,EAAE;QACPV,IAAI,EAAE;MADC,CA3BL;MA8BNW,OAAO,EAAE;QACLX,IAAI,EAAE;MADD,CA9BH;MAiCNY,SAAS,EAAE;QACPZ,IAAI,EAAE;MADC,CAjCL;MAoCNa,OAAO,EAAE;QACLb,IAAI,EAAE;MADD,CApCH;MAuCNc,OAAO,EAAE;QACLd,IAAI,EAAE;MADD,CAvCH;MA0CNe,MAAM,EAAE;QACJf,IAAI,EAAE;MADF,CA1CF;MA6CNgB,WAAW,EAAE;QACThB,IAAI,EAAE;MADG,CA7CP;MAgDNiB,OAAO,EAAE;QACLjB,IAAI,EAAE;MADD,CAhDH;MAmDNkB,MAAM,EAAE;QACJlB,IAAI,EAAE;MADF,CAnDF;MAsDNmB,MAAM,EAAE;QACJnB,IAAI,EAAE;MADF,CAtDF;MAyDNoB,MAAM,EAAE;QACJpB,IAAI,EAAE;MADF,CAzDF;MA4DNqB,IAAI,EAAE;QACFrB,IAAI,EAAE;MADJ;IA5DA,GA+DFJ,UAAU,IAAI,EA/DZ;EAHI,CAAX,CAAP;AAqEH,CAvEM"}
1
+ {"version":3,"names":["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,MAA+B,IAAkB;EAC/E,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,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,MAAM,EAAE;QACJL,IAAI,EAAE;MACV,CAAC;MACDM,aAAa,EAAE;QACXN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV,CAAC;MACDQ,OAAO,EAAE;QACLR,IAAI,EAAE;MACV,CAAC;MACDS,EAAE,EAAE;QACAT,IAAI,EAAE;MACV,CAAC;MACDU,SAAS,EAAE;QACPV,IAAI,EAAE;MACV,CAAC;MACDW,OAAO,EAAE;QACLX,IAAI,EAAE;MACV,CAAC;MACDY,SAAS,EAAE;QACPZ,IAAI,EAAE;MACV,CAAC;MACDa,OAAO,EAAE;QACLb,IAAI,EAAE;MACV,CAAC;MACDc,OAAO,EAAE;QACLd,IAAI,EAAE;MACV,CAAC;MACDe,MAAM,EAAE;QACJf,IAAI,EAAE;MACV,CAAC;MACDgB,WAAW,EAAE;QACThB,IAAI,EAAE;MACV,CAAC;MACDiB,OAAO,EAAE;QACLjB,IAAI,EAAE;MACV,CAAC;MACDkB,MAAM,EAAE;QACJlB,IAAI,EAAE;MACV,CAAC;MACDmB,MAAM,EAAE;QACJnB,IAAI,EAAE;MACV,CAAC;MACDoB,MAAM,EAAE;QACJpB,IAAI,EAAE;MACV,CAAC;MACDqB,IAAI,EAAE;QACFrB,IAAI,EAAE;MACV;IAAC,GACGJ,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createEntryElasticsearchEntity = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
10
  const createEntryElasticsearchEntity = params => {
15
11
  const {
16
12
  table,
@@ -38,5 +34,4 @@ const createEntryElasticsearchEntity = params => {
38
34
  }, attributes || {})
39
35
  });
40
36
  };
41
-
42
37
  exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
@@ -1 +1 @@
1
- {"version":3,"names":["createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,8BAA8B,GACvCC,MAD0C,IAE5B;EACd,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEH,UADQ;IAEdD,KAFc;IAGdE,UAAU;MACNG,EAAE,EAAE;QACAC,IAAI,EAAE,QADN;QAEAC,YAAY,EAAE;MAFd,CADE;MAKNC,EAAE,EAAE;QACAF,IAAI,EAAE,QADN;QAEAG,OAAO,EAAE;MAFT,CALE;MASNC,KAAK,EAAE;QACHJ,IAAI,EAAE;MADH,CATD;MAYNK,IAAI,EAAE;QACFL,IAAI,EAAE;MADJ;IAZA,GAeFJ,UAAU,IAAI,EAfZ;EAHI,CAAX,CAAP;AAqBH,CAzBM"}
1
+ {"version":3,"names":["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,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createGroupEntity = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
10
  const createGroupEntity = params => {
15
11
  const {
16
12
  table,
@@ -66,5 +62,4 @@ const createGroupEntity = params => {
66
62
  }, attributes || {})
67
63
  });
68
64
  };
69
-
70
65
  exports.createGroupEntity = createGroupEntity;
@@ -1 +1 @@
1
- {"version":3,"names":["createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: CreateGroupEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,iBAAiB,GAAIC,MAAD,IAAkD;EAC/E,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEF,UADQ;IAEdF,KAFc;IAGdC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE;MADJ,CAPA;MAUNC,aAAa,EAAE;QACXD,IAAI,EAAE;MADK,CAVT;MAaNE,EAAE,EAAE;QACAF,IAAI,EAAE;MADN,CAbE;MAgBNN,IAAI,EAAE;QACFM,IAAI,EAAE;MADJ,CAhBA;MAmBNG,IAAI,EAAE;QACFH,IAAI,EAAE;MADJ,CAnBA;MAsBNI,MAAM,EAAE;QACJJ,IAAI,EAAE;MADF,CAtBF;MAyBNK,WAAW,EAAE;QACTL,IAAI,EAAE;MADG,CAzBP;MA4BNM,IAAI,EAAE;QACFN,IAAI,EAAE;MADJ,CA5BA;MAgCNO,SAAS,EAAE;QACPP,IAAI,EAAE;MADC,CAhCL;MAmCNQ,SAAS,EAAE;QACPR,IAAI,EAAE;MADC,CAnCL;MAsCNS,OAAO,EAAE;QACLT,IAAI,EAAE;MADD,CAtCH;MAyCNU,MAAM,EAAE;QACJV,IAAI,EAAE;MADF;IAzCF,GA4CFT,UAAU,IAAI,EA5CZ;EAHI,CAAX,CAAP;AAkDH,CApDM"}
1
+ {"version":3,"names":["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,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createModelEntity = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
10
  const createModelEntity = params => {
15
11
  const {
16
12
  table,
@@ -74,6 +70,11 @@ const createModelEntity = params => {
74
70
  type: "list",
75
71
  required: true
76
72
  },
73
+ tags: {
74
+ type: "list",
75
+ required: false,
76
+ default: []
77
+ },
77
78
  lockedFields: {
78
79
  type: "list",
79
80
  required: true
@@ -88,5 +89,4 @@ const createModelEntity = params => {
88
89
  }, attributes || {})
89
90
  });
90
91
  };
91
-
92
92
  exports.createModelEntity = createModelEntity;
@@ -1 +1 @@
1
- {"version":3,"names":["createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","locale","group","description","createdOn","savedOn","createdBy","fields","layout","lockedFields","titleFieldId","tenant"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: CreateModelEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,iBAAiB,GAAIC,MAAD,IAAkD;EAC/E,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEF,UADQ;IAEdF,KAFc;IAGdC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE,QADJ;QAEFC,QAAQ,EAAE;MAFR,CAPA;MAWNC,aAAa,EAAE;QACXF,IAAI,EAAE,QADK;QAEXC,QAAQ,EAAE;MAFC,CAXT;MAeNP,IAAI,EAAE;QACFM,IAAI,EAAE,QADJ;QAEFC,QAAQ,EAAE;MAFR,CAfA;MAmBNE,OAAO,EAAE;QACLH,IAAI,EAAE,QADD;QAELC,QAAQ,EAAE;MAFL,CAnBH;MAuBNG,MAAM,EAAE;QACJJ,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN,CAvBF;MA2BNI,KAAK,EAAE;QACHL,IAAI,EAAE,KADH;QAEHC,QAAQ,EAAE;MAFP,CA3BD;MA+BNK,WAAW,EAAE;QACTN,IAAI,EAAE;MADG,CA/BP;MAkCNO,SAAS,EAAE;QACPP,IAAI,EAAE,QADC;QAEPC,QAAQ,EAAE;MAFH,CAlCL;MAsCNO,OAAO,EAAE;QACLR,IAAI,EAAE,QADD;QAELC,QAAQ,EAAE;MAFL,CAtCH;MA0CNQ,SAAS,EAAE;QACPT,IAAI,EAAE,KADC;QAEPC,QAAQ,EAAE;MAFH,CA1CL;MA8CNS,MAAM,EAAE;QACJV,IAAI,EAAE,MADF;QAEJC,QAAQ,EAAE;MAFN,CA9CF;MAkDNU,MAAM,EAAE;QACJX,IAAI,EAAE,MADF;QAEJC,QAAQ,EAAE;MAFN,CAlDF;MAsDNW,YAAY,EAAE;QACVZ,IAAI,EAAE,MADI;QAEVC,QAAQ,EAAE;MAFA,CAtDR;MA0DNY,YAAY,EAAE;QACVb,IAAI,EAAE;MADI,CA1DR;MA6DNc,MAAM,EAAE;QACJd,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN;IA7DF,GAiEFV,UAAU,IAAI,EAjEZ;EAHI,CAAX,CAAP;AAuEH,CAzEM"}
1
+ {"version":3,"names":["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,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,MAAM,EAAE;QACJJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,KAAK,EAAE;QACHL,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDK,WAAW,EAAE;QACTN,IAAI,EAAE;MACV,CAAC;MACDO,SAAS,EAAE;QACPP,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDO,OAAO,EAAE;QACLR,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDQ,SAAS,EAAE;QACPT,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDS,MAAM,EAAE;QACJV,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDU,MAAM,EAAE;QACJX,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDW,IAAI,EAAE;QACFZ,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,KAAK;QACfY,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVd,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDc,YAAY,EAAE;QACVf,IAAI,EAAE;MACV,CAAC;MACDgB,MAAM,EAAE;QACJhB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd;IAAC,GACGV,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createSettingsEntity = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
10
  const createSettingsEntity = params => {
15
11
  const {
16
12
  entityName,
@@ -54,5 +50,4 @@ const createSettingsEntity = params => {
54
50
  }, attributes || {})
55
51
  });
56
52
  };
57
-
58
53
  exports.createSettingsEntity = createSettingsEntity;
@@ -1 +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"}
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,MAAkC,IAAkB;EACrF,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBC,KAAK;IACLC,UAAU;MACNG,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,GAAG,EAAE;QACDD,IAAI,EAAE;MACV,CAAC;MACDE,iBAAiB,EAAE;QACfF,IAAI,EAAE;MACV,CAAC;MACDG,iBAAiB,EAAE;QACfH,IAAI,EAAE;MACV,CAAC;MACDI,SAAS,EAAE;QACPJ,IAAI,EAAE;MACV,CAAC;MACDK,sBAAsB,EAAE;QACpBL,IAAI,EAAE;MACV,CAAC;MACDM,MAAM,EAAE;QACJN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV;IAAC,GACGR,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createSystemEntity = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
10
  const createSystemEntity = params => {
15
11
  const {
16
12
  entityName,
@@ -42,5 +38,4 @@ const createSystemEntity = params => {
42
38
  }, attributes || {})
43
39
  });
44
40
  };
45
-
46
41
  exports.createSystemEntity = createSystemEntity;
@@ -1 +1 @@
1
- {"version":3,"names":["createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,kBAAkB,GAAIC,MAAD,IAAmD;EACjF,MAAM;IAAEC,UAAF;IAAcC,UAAd;IAA0BC;EAA1B,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEJ,UADQ;IAEdE,KAFc;IAGdD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,OAAO,EAAE;QACLC,IAAI,EAAE;MADD,CAPH;MAUNC,MAAM,EAAE;QACJD,IAAI,EAAE;MADF,CAVF;MAaNE,MAAM,EAAE;QACJF,IAAI,EAAE;MADF,CAbF;MAgBNG,UAAU,EAAE;QACRH,IAAI,EAAE;MADE;IAhBN,GAmBFT,UAAU,IAAI,EAnBZ;EAHI,CAAX,CAAP;AAyBH,CA3BM"}
1
+ {"version":3,"names":["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"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createTable = void 0;
7
-
8
7
  var _dynamodbToolbox = require("dynamodb-toolbox");
9
-
10
8
  const createTable = ({
11
9
  table,
12
10
  documentClient
@@ -20,5 +18,4 @@ const createTable = ({
20
18
  const config = typeof table === "function" ? table(tableConfig) : tableConfig;
21
19
  return new _dynamodbToolbox.Table(config);
22
20
  };
23
-
24
21
  exports.createTable = createTable;
@@ -1 +1 @@
1
- {"version":3,"names":["createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","config","Table"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\nexport const createTable = ({ table, documentClient }: CreateTableParams): Table => {\n const tableConfig: TableConstructor = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;;AAEA;;AAOO,MAAMA,WAAW,GAAG,CAAC;EAAEC,KAAF;EAASC;AAAT,CAAD,KAAyD;EAChF,MAAMC,WAA6B,GAAG;IAClCC,IAAI,EAAEC,OAAO,CAACC,GAAR,CAAYC,qBAAZ,IAAsCF,OAAO,CAACC,GAAR,CAAYE,QADtB;IAElCC,YAAY,EAAE,IAFoB;IAGlCC,OAAO,EAAE,IAHyB;IAIlCC,cAAc,EAAET;EAJkB,CAAtC;EAOA,MAAMU,MAAM,GAAG,OAAOX,KAAP,KAAiB,UAAjB,GAA8BA,KAAK,CAACE,WAAD,CAAnC,GAAmDA,WAAlE;EAEA,OAAO,IAAIU,sBAAJ,CAAUD,MAAV,CAAP;AACH,CAXM"}
1
+ {"version":3,"names":["createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","config","Table"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\nexport const createTable = ({ table, documentClient }: CreateTableParams): Table => {\n const tableConfig: TableConstructor = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA;AAOO,MAAMA,WAAW,GAAG,CAAC;EAAEC,KAAK;EAAEC;AAAkC,CAAC,KAAY;EAChF,MAAMC,WAA6B,GAAG;IAClCC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC3EC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET;EACpB,CAAC;EAED,MAAMU,MAAM,GAAG,OAAOX,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIU,sBAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAAC"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createElasticsearchTable = void 0;
7
-
8
7
  var _dynamodbToolbox = require("dynamodb-toolbox");
9
-
10
8
  const createElasticsearchTable = ({
11
9
  table,
12
10
  documentClient
@@ -20,5 +18,4 @@ const createElasticsearchTable = ({
20
18
  const config = typeof table === "function" ? table(tableConfig) : tableConfig;
21
19
  return new _dynamodbToolbox.Table(config);
22
20
  };
23
-
24
21
  exports.createElasticsearchTable = createElasticsearchTable;
@@ -1 +1 @@
1
- {"version":3,"names":["createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","config","Table"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: CreateElasticsearchTableParams): Table => {\n const tableConfig: TableConstructor = {\n name: process.env.DB_TABLE_ELASTICSEARCH as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;;AAEA;;AAOO,MAAMA,wBAAwB,GAAG,CAAC;EACrCC,KADqC;EAErCC;AAFqC,CAAD,KAGK;EACzC,MAAMC,WAA6B,GAAG;IAClCC,IAAI,EAAEC,OAAO,CAACC,GAAR,CAAYC,sBADgB;IAElCC,YAAY,EAAE,IAFoB;IAGlCC,OAAO,EAAE,IAHyB;IAIlCC,cAAc,EAAER;EAJkB,CAAtC;EAOA,MAAMS,MAAM,GAAG,OAAOV,KAAP,KAAiB,UAAjB,GAA8BA,KAAK,CAACE,WAAD,CAAnC,GAAmDA,WAAlE;EAEA,OAAO,IAAIS,sBAAJ,CAAUD,MAAV,CAAP;AACH,CAdM"}
1
+ {"version":3,"names":["createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","config","Table"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: CreateElasticsearchTableParams): Table => {\n const tableConfig: TableConstructor = {\n name: process.env.DB_TABLE_ELASTICSEARCH as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA;AAOO,MAAMA,wBAAwB,GAAG,CAAC;EACrCC,KAAK;EACLC;AAC4B,CAAC,KAAY;EACzC,MAAMC,WAA6B,GAAG;IAClCC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,sBAAgC;IAClDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER;EACpB,CAAC;EAED,MAAMS,MAAM,GAAG,OAAOV,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIS,sBAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAAC"}
@@ -1,2 +1,2 @@
1
- declare const _default: () => import("@webiny/api-headless-cms").StorageTransformPlugin<any, any>[];
1
+ declare const _default: () => import("@webiny/api-headless-cms").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>[];
2
2
  export default _default;
package/dynamoDb/index.js CHANGED
@@ -4,13 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _richText = require("./storage/richText");
9
-
10
8
  var _longText = require("./storage/longText");
11
-
12
9
  var _date = require("./storage/date");
13
-
14
10
  var _default = () => [(0, _richText.createRichTextStorageTransformPlugin)(), (0, _longText.createLongTextStorageTransformPlugin)(), (0, _date.createDateStorageTransformPlugin)()];
15
-
16
11
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\n\nexport default () => [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createDateStorageTransformPlugin()\n];\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;eAEe,MAAM,CACjB,IAAAA,8CAAA,GADiB,EAEjB,IAAAC,8CAAA,GAFiB,EAGjB,IAAAC,sCAAA,GAHiB,C"}
1
+ {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\n\nexport default () => [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createDateStorageTransformPlugin()\n];\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAAkE,eAEnD,MAAM,CACjB,IAAAA,8CAAoC,GAAE,EACtC,IAAAC,8CAAoC,GAAE,EACtC,IAAAC,sCAAgC,GAAE,CACrC;AAAA"}
@@ -1,2 +1,3 @@
1
1
  import { StorageTransformPlugin } from "@webiny/api-headless-cms";
2
- export declare const createDateStorageTransformPlugin: () => StorageTransformPlugin<any, any>;
2
+ import { CmsModelField } from "@webiny/api-headless-cms/types";
3
+ export declare const createDateStorageTransformPlugin: () => StorageTransformPlugin<any, any, CmsModelField>;
@@ -1,21 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createDateStorageTransformPlugin = void 0;
9
-
10
8
  var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
9
  var _apiHeadlessCms = require("@webiny/api-headless-cms");
13
-
14
10
  /**
15
11
  * File is @internal
16
12
  */
17
- const excludeTypes = ["time", "dateTimeWithTimezone"];
18
13
 
14
+ const excludeTypes = ["time", "dateTimeWithTimezone"];
19
15
  const convertFromStorage = (field, value) => {
20
16
  try {
21
17
  if (field.multipleValues) {
@@ -23,28 +19,24 @@ const convertFromStorage = (field, value) => {
23
19
  return new Date(v);
24
20
  });
25
21
  }
26
-
27
22
  return new Date(value);
28
23
  } catch {
29
24
  console.log(`Could not transform from storage for field type`);
30
25
  return value;
31
26
  }
32
27
  };
33
-
34
28
  const convertValueToStorage = (field, value) => {
35
29
  if (value.toISOString) {
36
30
  return value.toISOString();
37
31
  } else if (typeof value === "string") {
38
32
  return value;
39
33
  }
40
-
41
34
  throw new _error.default("Error converting value to a storage type.", "TO_STORAGE_ERROR", {
42
35
  value: value,
43
36
  fieldId: field.fieldId,
44
37
  storageId: field.storageId
45
38
  });
46
39
  };
47
-
48
40
  const createDateStorageTransformPlugin = () => {
49
41
  return new _apiHeadlessCms.StorageTransformPlugin({
50
42
  fieldType: "datetime",
@@ -55,11 +47,9 @@ const createDateStorageTransformPlugin = () => {
55
47
  const {
56
48
  type
57
49
  } = field.settings || {};
58
-
59
50
  if (!value || !type || excludeTypes.includes(type)) {
60
51
  return value;
61
52
  }
62
-
63
53
  return convertFromStorage(field, value);
64
54
  },
65
55
  toStorage: async ({
@@ -69,24 +59,20 @@ const createDateStorageTransformPlugin = () => {
69
59
  const {
70
60
  type
71
61
  } = field.settings || {};
72
-
73
62
  if (!value || !type || excludeTypes.includes(type)) {
74
63
  return value;
75
64
  }
76
-
77
65
  if (field.multipleValues) {
78
66
  const multipleValues = value;
79
67
  return (multipleValues || []).filter(v => !!v).map(v => {
80
68
  return convertValueToStorage(field, v);
81
69
  });
82
70
  }
83
-
84
71
  if (value.toISOString) {
85
72
  return value.toISOString();
86
73
  } else if (typeof value === "string") {
87
74
  return value;
88
75
  }
89
-
90
76
  throw new _error.default("Error converting value to a storage type.", "TO_STORAGE_ERROR", {
91
77
  value,
92
78
  fieldId: field.fieldId,
@@ -95,5 +81,4 @@ const createDateStorageTransformPlugin = () => {
95
81
  }
96
82
  });
97
83
  };
98
-
99
84
  exports.createDateStorageTransformPlugin = createDateStorageTransformPlugin;
@@ -1 +1 @@
1
- {"version":3,"names":["excludeTypes","convertFromStorage","field","value","multipleValues","filter","v","map","Date","console","log","convertValueToStorage","toISOString","WebinyError","fieldId","storageId","createDateStorageTransformPlugin","StorageTransformPlugin","fieldType","fromStorage","type","settings","includes","toStorage"],"sources":["date.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nconst excludeTypes = [\"time\", \"dateTimeWithTimezone\"];\n\nconst convertFromStorage = (field: CmsModelField, value: string | string[]) => {\n try {\n if (field.multipleValues) {\n return ((value as string[]) || [])\n .filter(v => !!v)\n .map((v: string) => {\n return new Date(v);\n });\n }\n return new Date(value as string);\n } catch {\n console.log(`Could not transform from storage for field type`);\n return value;\n }\n};\n\nconst convertValueToStorage = (field: CmsModelField, value: any): any => {\n if ((value as any).toISOString) {\n return (value as Date).toISOString();\n } else if (typeof value === \"string\") {\n return value as string;\n }\n throw new WebinyError(\"Error converting value to a storage type.\", \"TO_STORAGE_ERROR\", {\n value: value,\n fieldId: field.fieldId,\n storageId: field.storageId\n });\n};\n\nexport const createDateStorageTransformPlugin = () => {\n return new StorageTransformPlugin({\n fieldType: \"datetime\",\n fromStorage: async ({ value, field }) => {\n const { type } = field.settings || {};\n if (!value || !type || excludeTypes.includes(type)) {\n return value;\n }\n return convertFromStorage(field, value);\n },\n toStorage: async ({ value, field }) => {\n const { type } = field.settings || {};\n if (!value || !type || excludeTypes.includes(type)) {\n return value;\n }\n if (field.multipleValues) {\n const multipleValues = value as (string | Date | null | undefined)[];\n return (multipleValues || [])\n .filter(v => !!v)\n .map(v => {\n return convertValueToStorage(field, v);\n });\n }\n if ((value as any).toISOString) {\n return (value as Date).toISOString();\n } else if (typeof value === \"string\") {\n return value as string;\n }\n throw new WebinyError(\"Error converting value to a storage type.\", \"TO_STORAGE_ERROR\", {\n value,\n fieldId: field.fieldId,\n storageId: field.storageId\n });\n }\n });\n};\n"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,CAAC,MAAD,EAAS,sBAAT,CAArB;;AAEA,MAAMC,kBAAkB,GAAG,CAACC,KAAD,EAAuBC,KAAvB,KAAoD;EAC3E,IAAI;IACA,IAAID,KAAK,CAACE,cAAV,EAA0B;MACtB,OAAO,CAAED,KAAD,IAAuB,EAAxB,EACFE,MADE,CACKC,CAAC,IAAI,CAAC,CAACA,CADZ,EAEFC,GAFE,CAEGD,CAAD,IAAe;QAChB,OAAO,IAAIE,IAAJ,CAASF,CAAT,CAAP;MACH,CAJE,CAAP;IAKH;;IACD,OAAO,IAAIE,IAAJ,CAASL,KAAT,CAAP;EACH,CATD,CASE,MAAM;IACJM,OAAO,CAACC,GAAR,CAAa,iDAAb;IACA,OAAOP,KAAP;EACH;AACJ,CAdD;;AAgBA,MAAMQ,qBAAqB,GAAG,CAACT,KAAD,EAAuBC,KAAvB,KAA2C;EACrE,IAAKA,KAAD,CAAeS,WAAnB,EAAgC;IAC5B,OAAQT,KAAD,CAAgBS,WAAhB,EAAP;EACH,CAFD,MAEO,IAAI,OAAOT,KAAP,KAAiB,QAArB,EAA+B;IAClC,OAAOA,KAAP;EACH;;EACD,MAAM,IAAIU,cAAJ,CAAgB,2CAAhB,EAA6D,kBAA7D,EAAiF;IACnFV,KAAK,EAAEA,KAD4E;IAEnFW,OAAO,EAAEZ,KAAK,CAACY,OAFoE;IAGnFC,SAAS,EAAEb,KAAK,CAACa;EAHkE,CAAjF,CAAN;AAKH,CAXD;;AAaO,MAAMC,gCAAgC,GAAG,MAAM;EAClD,OAAO,IAAIC,sCAAJ,CAA2B;IAC9BC,SAAS,EAAE,UADmB;IAE9BC,WAAW,EAAE,OAAO;MAAEhB,KAAF;MAASD;IAAT,CAAP,KAA4B;MACrC,MAAM;QAAEkB;MAAF,IAAWlB,KAAK,CAACmB,QAAN,IAAkB,EAAnC;;MACA,IAAI,CAAClB,KAAD,IAAU,CAACiB,IAAX,IAAmBpB,YAAY,CAACsB,QAAb,CAAsBF,IAAtB,CAAvB,EAAoD;QAChD,OAAOjB,KAAP;MACH;;MACD,OAAOF,kBAAkB,CAACC,KAAD,EAAQC,KAAR,CAAzB;IACH,CAR6B;IAS9BoB,SAAS,EAAE,OAAO;MAAEpB,KAAF;MAASD;IAAT,CAAP,KAA4B;MACnC,MAAM;QAAEkB;MAAF,IAAWlB,KAAK,CAACmB,QAAN,IAAkB,EAAnC;;MACA,IAAI,CAAClB,KAAD,IAAU,CAACiB,IAAX,IAAmBpB,YAAY,CAACsB,QAAb,CAAsBF,IAAtB,CAAvB,EAAoD;QAChD,OAAOjB,KAAP;MACH;;MACD,IAAID,KAAK,CAACE,cAAV,EAA0B;QACtB,MAAMA,cAAc,GAAGD,KAAvB;QACA,OAAO,CAACC,cAAc,IAAI,EAAnB,EACFC,MADE,CACKC,CAAC,IAAI,CAAC,CAACA,CADZ,EAEFC,GAFE,CAEED,CAAC,IAAI;UACN,OAAOK,qBAAqB,CAACT,KAAD,EAAQI,CAAR,CAA5B;QACH,CAJE,CAAP;MAKH;;MACD,IAAKH,KAAD,CAAeS,WAAnB,EAAgC;QAC5B,OAAQT,KAAD,CAAgBS,WAAhB,EAAP;MACH,CAFD,MAEO,IAAI,OAAOT,KAAP,KAAiB,QAArB,EAA+B;QAClC,OAAOA,KAAP;MACH;;MACD,MAAM,IAAIU,cAAJ,CAAgB,2CAAhB,EAA6D,kBAA7D,EAAiF;QACnFV,KADmF;QAEnFW,OAAO,EAAEZ,KAAK,CAACY,OAFoE;QAGnFC,SAAS,EAAEb,KAAK,CAACa;MAHkE,CAAjF,CAAN;IAKH;EAhC6B,CAA3B,CAAP;AAkCH,CAnCM"}
1
+ {"version":3,"names":["excludeTypes","convertFromStorage","field","value","multipleValues","filter","v","map","Date","console","log","convertValueToStorage","toISOString","WebinyError","fieldId","storageId","createDateStorageTransformPlugin","StorageTransformPlugin","fieldType","fromStorage","type","settings","includes","toStorage"],"sources":["date.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\ntype PartialCmsModelField = Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"multipleValues\">;\n\nconst excludeTypes = [\"time\", \"dateTimeWithTimezone\"];\n\nconst convertFromStorage = (field: PartialCmsModelField, value: string | string[]) => {\n try {\n if (field.multipleValues) {\n return ((value as string[]) || [])\n .filter(v => !!v)\n .map((v: string) => {\n return new Date(v);\n });\n }\n return new Date(value as string);\n } catch {\n console.log(`Could not transform from storage for field type`);\n return value;\n }\n};\n\nconst convertValueToStorage = (field: PartialCmsModelField, value: any): any => {\n if ((value as any).toISOString) {\n return (value as Date).toISOString();\n } else if (typeof value === \"string\") {\n return value as string;\n }\n throw new WebinyError(\"Error converting value to a storage type.\", \"TO_STORAGE_ERROR\", {\n value: value,\n fieldId: field.fieldId,\n storageId: field.storageId\n });\n};\n\nexport const createDateStorageTransformPlugin = () => {\n return new StorageTransformPlugin({\n fieldType: \"datetime\",\n fromStorage: async ({ value, field }) => {\n const { type } = field.settings || {};\n if (!value || !type || excludeTypes.includes(type)) {\n return value;\n }\n return convertFromStorage(field, value);\n },\n toStorage: async ({ value, field }) => {\n const { type } = field.settings || {};\n if (!value || !type || excludeTypes.includes(type)) {\n return value;\n }\n if (field.multipleValues) {\n const multipleValues = value as (string | Date | null | undefined)[];\n return (multipleValues || [])\n .filter(v => !!v)\n .map(v => {\n return convertValueToStorage(field, v);\n });\n }\n if ((value as any).toISOString) {\n return (value as Date).toISOString();\n } else if (typeof value === \"string\") {\n return value as string;\n }\n throw new WebinyError(\"Error converting value to a storage type.\", \"TO_STORAGE_ERROR\", {\n value,\n fieldId: field.fieldId,\n storageId: field.storageId\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAGA;AACA;AAJA;AACA;AACA;;AAOA,MAAMA,YAAY,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC;AAErD,MAAMC,kBAAkB,GAAG,CAACC,KAA2B,EAAEC,KAAwB,KAAK;EAClF,IAAI;IACA,IAAID,KAAK,CAACE,cAAc,EAAE;MACtB,OAAO,CAAED,KAAK,IAAiB,EAAE,EAC5BE,MAAM,CAACC,CAAC,IAAI,CAAC,CAACA,CAAC,CAAC,CAChBC,GAAG,CAAED,CAAS,IAAK;QAChB,OAAO,IAAIE,IAAI,CAACF,CAAC,CAAC;MACtB,CAAC,CAAC;IACV;IACA,OAAO,IAAIE,IAAI,CAACL,KAAK,CAAW;EACpC,CAAC,CAAC,MAAM;IACJM,OAAO,CAACC,GAAG,CAAE,iDAAgD,CAAC;IAC9D,OAAOP,KAAK;EAChB;AACJ,CAAC;AAED,MAAMQ,qBAAqB,GAAG,CAACT,KAA2B,EAAEC,KAAU,KAAU;EAC5E,IAAKA,KAAK,CAASS,WAAW,EAAE;IAC5B,OAAQT,KAAK,CAAUS,WAAW,EAAE;EACxC,CAAC,MAAM,IAAI,OAAOT,KAAK,KAAK,QAAQ,EAAE;IAClC,OAAOA,KAAK;EAChB;EACA,MAAM,IAAIU,cAAW,CAAC,2CAA2C,EAAE,kBAAkB,EAAE;IACnFV,KAAK,EAAEA,KAAK;IACZW,OAAO,EAAEZ,KAAK,CAACY,OAAO;IACtBC,SAAS,EAAEb,KAAK,CAACa;EACrB,CAAC,CAAC;AACN,CAAC;AAEM,MAAMC,gCAAgC,GAAG,MAAM;EAClD,OAAO,IAAIC,sCAAsB,CAAC;IAC9BC,SAAS,EAAE,UAAU;IACrBC,WAAW,EAAE,OAAO;MAAEhB,KAAK;MAAED;IAAM,CAAC,KAAK;MACrC,MAAM;QAAEkB;MAAK,CAAC,GAAGlB,KAAK,CAACmB,QAAQ,IAAI,CAAC,CAAC;MACrC,IAAI,CAAClB,KAAK,IAAI,CAACiB,IAAI,IAAIpB,YAAY,CAACsB,QAAQ,CAACF,IAAI,CAAC,EAAE;QAChD,OAAOjB,KAAK;MAChB;MACA,OAAOF,kBAAkB,CAACC,KAAK,EAAEC,KAAK,CAAC;IAC3C,CAAC;IACDoB,SAAS,EAAE,OAAO;MAAEpB,KAAK;MAAED;IAAM,CAAC,KAAK;MACnC,MAAM;QAAEkB;MAAK,CAAC,GAAGlB,KAAK,CAACmB,QAAQ,IAAI,CAAC,CAAC;MACrC,IAAI,CAAClB,KAAK,IAAI,CAACiB,IAAI,IAAIpB,YAAY,CAACsB,QAAQ,CAACF,IAAI,CAAC,EAAE;QAChD,OAAOjB,KAAK;MAChB;MACA,IAAID,KAAK,CAACE,cAAc,EAAE;QACtB,MAAMA,cAAc,GAAGD,KAA6C;QACpE,OAAO,CAACC,cAAc,IAAI,EAAE,EACvBC,MAAM,CAACC,CAAC,IAAI,CAAC,CAACA,CAAC,CAAC,CAChBC,GAAG,CAACD,CAAC,IAAI;UACN,OAAOK,qBAAqB,CAACT,KAAK,EAAEI,CAAC,CAAC;QAC1C,CAAC,CAAC;MACV;MACA,IAAKH,KAAK,CAASS,WAAW,EAAE;QAC5B,OAAQT,KAAK,CAAUS,WAAW,EAAE;MACxC,CAAC,MAAM,IAAI,OAAOT,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAOA,KAAK;MAChB;MACA,MAAM,IAAIU,cAAW,CAAC,2CAA2C,EAAE,kBAAkB,EAAE;QACnFV,KAAK;QACLW,OAAO,EAAEZ,KAAK,CAACY,OAAO;QACtBC,SAAS,EAAEb,KAAK,CAACa;MACrB,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
@@ -7,4 +7,4 @@ export interface StorageValue {
7
7
  value: string;
8
8
  isArray?: boolean;
9
9
  }
10
- export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue>;
10
+ export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue, import("@webiny/api-headless-cms/types").CmsModelField>;