@webiny/api-page-builder-so-ddb-es 0.0.0-mt-2 → 0.0.0-unstable.06b2ede40f
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.
- package/configurations.d.ts +18 -0
- package/configurations.js +53 -0
- package/configurations.js.map +1 -0
- package/definitions/blockCategoryEntity.d.ts +10 -0
- package/definitions/blockCategoryEntity.js +57 -0
- package/definitions/blockCategoryEntity.js.map +1 -0
- package/definitions/categoryEntity.d.ts +10 -6
- package/definitions/categoryEntity.js +12 -23
- package/definitions/categoryEntity.js.map +1 -0
- package/definitions/menuEntity.d.ts +10 -6
- package/definitions/menuEntity.js +12 -23
- package/definitions/menuEntity.js.map +1 -0
- package/definitions/pageBlockEntity.d.ts +10 -0
- package/definitions/pageBlockEntity.js +74 -0
- package/definitions/pageBlockEntity.js.map +1 -0
- package/definitions/pageElasticsearchEntity.d.ts +10 -6
- package/definitions/pageElasticsearchEntity.js +15 -23
- package/definitions/pageElasticsearchEntity.js.map +1 -0
- package/definitions/pageElementEntity.d.ts +10 -6
- package/definitions/pageElementEntity.js +12 -23
- package/definitions/pageElementEntity.js.map +1 -0
- package/definitions/pageEntity.d.ts +10 -6
- package/definitions/pageEntity.js +20 -32
- package/definitions/pageEntity.js.map +1 -0
- package/definitions/pageTemplateEntity.d.ts +10 -0
- package/definitions/pageTemplateEntity.js +42 -0
- package/definitions/pageTemplateEntity.js.map +1 -0
- package/definitions/settingsEntity.d.ts +8 -6
- package/definitions/settingsEntity.js +11 -54
- package/definitions/settingsEntity.js.map +1 -0
- package/definitions/systemEntity.d.ts +10 -6
- package/definitions/systemEntity.js +15 -23
- package/definitions/systemEntity.js.map +1 -0
- package/definitions/table.d.ts +8 -5
- package/definitions/table.js +22 -21
- package/definitions/table.js.map +1 -0
- package/definitions/tableElasticsearch.d.ts +9 -5
- package/definitions/tableElasticsearch.js +16 -28
- package/definitions/tableElasticsearch.js.map +1 -0
- package/elasticsearch/createElasticsearchIndex.d.ts +9 -0
- package/elasticsearch/createElasticsearchIndex.js +41 -0
- package/elasticsearch/createElasticsearchIndex.js.map +1 -0
- package/elasticsearch/indices/base.d.ts +2 -0
- package/elasticsearch/indices/base.js +14 -0
- package/elasticsearch/indices/base.js.map +1 -0
- package/elasticsearch/indices/index.d.ts +1 -0
- package/elasticsearch/indices/index.js +14 -0
- package/elasticsearch/indices/index.js.map +1 -0
- package/elasticsearch/indices/japanese.d.ts +2 -0
- package/elasticsearch/indices/japanese.js +15 -0
- package/elasticsearch/indices/japanese.js.map +1 -0
- package/index.d.ts +3 -8
- package/index.js +246 -16
- package/index.js.map +1 -0
- package/operations/blockCategory/dataLoader.d.ts +17 -0
- package/operations/blockCategory/dataLoader.js +63 -0
- package/operations/blockCategory/dataLoader.js.map +1 -0
- package/operations/blockCategory/fields.d.ts +2 -0
- package/operations/blockCategory/fields.js +27 -0
- package/operations/blockCategory/fields.js.map +1 -0
- package/operations/blockCategory/index.d.ts +8 -0
- package/operations/blockCategory/index.js +192 -0
- package/operations/blockCategory/index.js.map +1 -0
- package/operations/blockCategory/keys.d.ts +9 -0
- package/operations/blockCategory/keys.js +23 -0
- package/operations/blockCategory/keys.js.map +1 -0
- package/operations/category/dataLoader.d.ts +17 -0
- package/operations/category/{CategoryDataLoader.js → dataLoader.js} +13 -27
- package/operations/category/dataLoader.js.map +1 -0
- package/operations/category/fields.d.ts +1 -2
- package/operations/category/fields.js +4 -5
- package/operations/category/fields.js.map +1 -0
- package/operations/category/index.d.ts +7 -4
- package/operations/category/index.js +185 -21
- package/operations/category/index.js.map +1 -0
- package/operations/category/keys.d.ts +9 -0
- package/operations/category/keys.js +23 -0
- package/operations/category/keys.js.map +1 -0
- package/operations/menu/fields.d.ts +1 -2
- package/operations/menu/fields.js +19 -18
- package/operations/menu/fields.js.map +1 -0
- package/operations/menu/index.d.ts +7 -4
- package/operations/menu/index.js +193 -21
- package/operations/menu/index.js.map +1 -0
- package/operations/pageBlock/compression.d.ts +18 -0
- package/operations/pageBlock/compression.js +42 -0
- package/operations/pageBlock/compression.js.map +1 -0
- package/operations/pageBlock/dataLoader.d.ts +17 -0
- package/operations/pageBlock/dataLoader.js +63 -0
- package/operations/pageBlock/dataLoader.js.map +1 -0
- package/operations/pageBlock/fields.d.ts +2 -0
- package/operations/pageBlock/fields.js +24 -0
- package/operations/pageBlock/fields.js.map +1 -0
- package/operations/pageBlock/index.d.ts +8 -0
- package/operations/pageBlock/index.js +219 -0
- package/operations/pageBlock/index.js.map +1 -0
- package/operations/pageBlock/keys.d.ts +20 -0
- package/operations/pageBlock/keys.js +37 -0
- package/operations/pageBlock/keys.js.map +1 -0
- package/operations/pageElement/fields.d.ts +1 -2
- package/operations/pageElement/fields.js +4 -5
- package/operations/pageElement/fields.js.map +1 -0
- package/operations/pageElement/index.d.ts +7 -6
- package/operations/pageElement/index.js +182 -21
- package/operations/pageElement/index.js.map +1 -0
- package/operations/pageTemplate/dataLoader.d.ts +17 -0
- package/operations/pageTemplate/dataLoader.js +62 -0
- package/operations/pageTemplate/dataLoader.js.map +1 -0
- package/operations/pageTemplate/fields.d.ts +2 -0
- package/operations/pageTemplate/fields.js +24 -0
- package/operations/pageTemplate/fields.js.map +1 -0
- package/operations/pageTemplate/index.d.ts +8 -0
- package/operations/pageTemplate/index.js +204 -0
- package/operations/pageTemplate/index.js.map +1 -0
- package/operations/pageTemplate/keys.d.ts +5 -0
- package/operations/pageTemplate/keys.js +23 -0
- package/operations/pageTemplate/keys.js.map +1 -0
- package/operations/pages/elasticsearchQueryBody.d.ts +8 -12
- package/operations/pages/elasticsearchQueryBody.js +43 -101
- package/operations/pages/elasticsearchQueryBody.js.map +1 -0
- package/operations/pages/fields.d.ts +3 -2
- package/operations/pages/fields.js +18 -5
- package/operations/pages/fields.js.map +1 -0
- package/operations/pages/helpers.d.ts +10 -18
- package/operations/pages/helpers.js +34 -33
- package/operations/pages/helpers.js.map +1 -0
- package/operations/pages/index.d.ts +10 -4
- package/operations/pages/index.js +785 -18
- package/operations/pages/index.js.map +1 -0
- package/operations/pages/keys.d.ts +24 -0
- package/operations/pages/keys.js +59 -0
- package/operations/pages/keys.js.map +1 -0
- package/operations/pages/logIgnoredEsResponseError.d.ts +7 -0
- package/operations/pages/logIgnoredEsResponseError.js +28 -0
- package/operations/pages/logIgnoredEsResponseError.js.map +1 -0
- package/operations/pages/shouldIgnoreEsResponseError.d.ts +2 -0
- package/operations/pages/shouldIgnoreEsResponseError.js +13 -0
- package/operations/pages/shouldIgnoreEsResponseError.js.map +1 -0
- package/operations/settings/index.d.ts +11 -6
- package/operations/settings/index.js +140 -15
- package/operations/settings/index.js.map +1 -0
- package/operations/system/index.d.ts +5 -4
- package/operations/system/index.js +94 -23
- package/operations/system/index.js.map +1 -0
- package/package.json +44 -36
- package/plugins/definitions/BlockCategoryDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/BlockCategoryDynamoDbElasticFieldPlugin.js +13 -0
- package/plugins/definitions/BlockCategoryDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.js +5 -9
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/IndexPageDataPlugin.d.ts +12 -11
- package/plugins/definitions/IndexPageDataPlugin.js +3 -12
- package/plugins/definitions/IndexPageDataPlugin.js.map +1 -0
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.js +5 -9
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageBlockDynamoDbFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageBlockDynamoDbFieldPlugin.js +13 -0
- package/plugins/definitions/PageBlockDynamoDbFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageDynamoDbElasticsearchFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageDynamoDbElasticsearchFieldPlugin.js +13 -0
- package/plugins/definitions/PageDynamoDbElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.d.ts +6 -2
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.js +6 -10
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchFieldPlugin.d.ts +1 -2
- package/plugins/definitions/PageElasticsearchFieldPlugin.js +5 -14
- package/plugins/definitions/PageElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchIndexPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchIndexPlugin.js +13 -0
- package/plugins/definitions/PageElasticsearchIndexPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.d.ts +8 -2
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.js +6 -10
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.d.ts +6 -2
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.js +6 -10
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.js.map +1 -0
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.js +5 -9
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageTemplateDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageTemplateDynamoDbElasticFieldPlugin.js +13 -0
- package/plugins/definitions/PageTemplateDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/SearchLatestPagesPlugin.d.ts +1 -1
- package/plugins/definitions/SearchLatestPagesPlugin.js +5 -9
- package/plugins/definitions/SearchLatestPagesPlugin.js.map +1 -0
- package/plugins/definitions/SearchPagesPlugin.d.ts +4 -4
- package/plugins/definitions/SearchPagesPlugin.js +2 -13
- package/plugins/definitions/SearchPagesPlugin.js.map +1 -0
- package/plugins/definitions/SearchPublishedPagesPlugin.d.ts +1 -1
- package/plugins/definitions/SearchPublishedPagesPlugin.js +5 -9
- package/plugins/definitions/SearchPublishedPagesPlugin.js.map +1 -0
- package/plugins/definitions/index.d.ts +15 -0
- package/plugins/definitions/index.js +172 -0
- package/plugins/definitions/index.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +18 -0
- package/plugins/index.js.map +1 -0
- package/tasks/createIndexTaskPlugin.d.ts +2 -0
- package/tasks/createIndexTaskPlugin.js +36 -0
- package/tasks/createIndexTaskPlugin.js.map +1 -0
- package/types.d.ts +63 -0
- package/types.js +21 -0
- package/types.js.map +1 -0
- package/operations/category/CategoryDataLoader.d.ts +0 -20
- package/operations/category/CategoryStorageOperations.d.ts +0 -29
- package/operations/category/CategoryStorageOperations.js +0 -243
- package/operations/configurations.d.ts +0 -36
- package/operations/configurations.js +0 -71
- package/operations/menu/MenuStorageOperations.d.ts +0 -23
- package/operations/menu/MenuStorageOperations.js +0 -235
- package/operations/pageElement/PageElementStorageOperations.d.ts +0 -23
- package/operations/pageElement/PageElementStorageOperations.js +0 -234
- package/operations/pages/PageStorageOperations.d.ts +0 -79
- package/operations/pages/PageStorageOperations.js +0 -1117
- package/operations/settings/SettingsStorageOperations.d.ts +0 -35
- package/operations/settings/SettingsStorageOperations.js +0 -191
- package/operations/system/InstallationDdbEsPlugin.d.ts +0 -2
- package/operations/system/InstallationDdbEsPlugin.js +0 -73
- package/operations/system/SystemStorageOperations.d.ts +0 -16
- package/operations/system/SystemStorageOperations.js +0 -114
- package/upgrades/index.d.ts +0 -2
- package/upgrades/index.js +0 -14
- package/upgrades/v5.15.0/category.d.ts +0 -2
- package/upgrades/v5.15.0/category.js +0 -75
- package/upgrades/v5.15.0/index.d.ts +0 -4
- package/upgrades/v5.15.0/index.js +0 -52
- package/upgrades/v5.15.0/menu.d.ts +0 -2
- package/upgrades/v5.15.0/menu.js +0 -75
- package/upgrades/v5.15.0/pageElement.d.ts +0 -2
- package/upgrades/v5.15.0/pageElement.js +0 -75
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
|
-
const definePageEntity = params => {
|
|
6
|
+
exports.createPageEntity = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createPageEntity = params => {
|
|
21
9
|
const {
|
|
22
|
-
|
|
10
|
+
entityName,
|
|
11
|
+
attributes,
|
|
23
12
|
table
|
|
24
13
|
} = params;
|
|
25
|
-
|
|
26
|
-
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
-
return new _dynamodbToolbox.Entity({
|
|
14
|
+
return new _toolbox.Entity({
|
|
28
15
|
name: entityName,
|
|
29
16
|
table,
|
|
30
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
31
18
|
PK: {
|
|
32
19
|
partitionKey: true
|
|
33
20
|
},
|
|
@@ -82,15 +69,6 @@ const definePageEntity = params => {
|
|
|
82
69
|
status: {
|
|
83
70
|
type: "string"
|
|
84
71
|
},
|
|
85
|
-
visibility: {
|
|
86
|
-
type: "map"
|
|
87
|
-
},
|
|
88
|
-
home: {
|
|
89
|
-
type: "boolean"
|
|
90
|
-
},
|
|
91
|
-
notFound: {
|
|
92
|
-
type: "boolean"
|
|
93
|
-
},
|
|
94
72
|
createdOn: {
|
|
95
73
|
type: "string"
|
|
96
74
|
},
|
|
@@ -105,9 +83,19 @@ const definePageEntity = params => {
|
|
|
105
83
|
},
|
|
106
84
|
webinyVersion: {
|
|
107
85
|
type: "string"
|
|
108
|
-
}
|
|
109
|
-
|
|
86
|
+
},
|
|
87
|
+
dataSources: {
|
|
88
|
+
type: "list",
|
|
89
|
+
default: []
|
|
90
|
+
},
|
|
91
|
+
dataBindings: {
|
|
92
|
+
type: "list",
|
|
93
|
+
default: []
|
|
94
|
+
},
|
|
95
|
+
...(attributes || {})
|
|
96
|
+
}
|
|
110
97
|
});
|
|
111
98
|
};
|
|
99
|
+
exports.createPageEntity = createPageEntity;
|
|
112
100
|
|
|
113
|
-
|
|
101
|
+
//# sourceMappingURL=pageEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createPageEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","id","pid","tenant","locale","title","editor","createdFrom","path","category","content","publishedOn","version","settings","locked","status","createdOn","savedOn","createdBy","ownedBy","webinyVersion","dataSources","default","dataBindings","exports"],"sources":["pageEntity.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createPageEntity = (params: Params): 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 TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n pid: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n editor: {\n type: \"string\"\n },\n createdFrom: {\n type: \"string\"\n },\n path: {\n type: \"string\"\n },\n category: {\n type: \"string\"\n },\n content: {\n type: \"map\"\n },\n publishedOn: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n settings: {\n type: \"map\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n webinyVersion: {\n type: \"string\"\n },\n dataSources: {\n type: \"list\",\n default: []\n },\n dataBindings: {\n type: \"list\",\n default: []\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,gBAAgB,GAAIC,MAAc,IAAkB;EAC7D,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,EAAE,EAAE;QACAD,IAAI,EAAE;MACV,CAAC;MACDE,GAAG,EAAE;QACDF,IAAI,EAAE;MACV,CAAC;MACDG,MAAM,EAAE;QACJH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,KAAK,EAAE;QACHL,IAAI,EAAE;MACV,CAAC;MACDM,MAAM,EAAE;QACJN,IAAI,EAAE;MACV,CAAC;MACDO,WAAW,EAAE;QACTP,IAAI,EAAE;MACV,CAAC;MACDQ,IAAI,EAAE;QACFR,IAAI,EAAE;MACV,CAAC;MACDS,QAAQ,EAAE;QACNT,IAAI,EAAE;MACV,CAAC;MACDU,OAAO,EAAE;QACLV,IAAI,EAAE;MACV,CAAC;MACDW,WAAW,EAAE;QACTX,IAAI,EAAE;MACV,CAAC;MACDY,OAAO,EAAE;QACLZ,IAAI,EAAE;MACV,CAAC;MACDa,QAAQ,EAAE;QACNb,IAAI,EAAE;MACV,CAAC;MACDc,MAAM,EAAE;QACJd,IAAI,EAAE;MACV,CAAC;MACDe,MAAM,EAAE;QACJf,IAAI,EAAE;MACV,CAAC;MACDgB,SAAS,EAAE;QACPhB,IAAI,EAAE;MACV,CAAC;MACDiB,OAAO,EAAE;QACLjB,IAAI,EAAE;MACV,CAAC;MACDkB,SAAS,EAAE;QACPlB,IAAI,EAAE;MACV,CAAC;MACDmB,OAAO,EAAE;QACLnB,IAAI,EAAE;MACV,CAAC;MACDoB,aAAa,EAAE;QACXpB,IAAI,EAAE;MACV,CAAC;MACDqB,WAAW,EAAE;QACTrB,IAAI,EAAE,MAAM;QACZsB,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVvB,IAAI,EAAE,MAAM;QACZsB,OAAO,EAAE;MACb,CAAC;MACD,IAAI/B,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACiC,OAAA,CAAApC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table: Table<string, string, string>;
|
|
6
|
+
entityName: string;
|
|
7
|
+
attributes: Attributes;
|
|
8
|
+
}
|
|
9
|
+
export declare const createPageTemplateEntity: (params: Params) => Entity<any>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createPageTemplateEntity = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createPageTemplateEntity = params => {
|
|
9
|
+
const {
|
|
10
|
+
entityName,
|
|
11
|
+
attributes,
|
|
12
|
+
table
|
|
13
|
+
} = params;
|
|
14
|
+
return new _toolbox.Entity({
|
|
15
|
+
name: entityName,
|
|
16
|
+
table,
|
|
17
|
+
attributes: {
|
|
18
|
+
PK: {
|
|
19
|
+
partitionKey: true
|
|
20
|
+
},
|
|
21
|
+
SK: {
|
|
22
|
+
sortKey: true
|
|
23
|
+
},
|
|
24
|
+
GSI1_PK: {
|
|
25
|
+
type: "string"
|
|
26
|
+
},
|
|
27
|
+
GSI1_SK: {
|
|
28
|
+
type: "string"
|
|
29
|
+
},
|
|
30
|
+
TYPE: {
|
|
31
|
+
type: "string"
|
|
32
|
+
},
|
|
33
|
+
data: {
|
|
34
|
+
type: "map"
|
|
35
|
+
},
|
|
36
|
+
...(attributes || {})
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
exports.createPageTemplateEntity = createPageTemplateEntity;
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=pageTemplateEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createPageTemplateEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","data","exports"],"sources":["pageTemplateEntity.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createPageTemplateEntity = (params: Params): 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 GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,wBAAwB,GAAIC,MAAc,IAAkB;EACrE,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
|
+
entityName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const createSettingsEntity: (params: Params) => Entity<any>;
|
|
8
|
+
export {};
|
|
@@ -1,77 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
|
-
const defineSettingsEntity = params => {
|
|
6
|
+
exports.createSettingsEntity = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createSettingsEntity = params => {
|
|
21
9
|
const {
|
|
22
|
-
|
|
10
|
+
entityName,
|
|
23
11
|
table
|
|
24
12
|
} = params;
|
|
25
|
-
|
|
26
|
-
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
-
return new _dynamodbToolbox.Entity({
|
|
13
|
+
return new _toolbox.Entity({
|
|
28
14
|
name: entityName,
|
|
29
15
|
table,
|
|
30
|
-
attributes:
|
|
16
|
+
attributes: {
|
|
31
17
|
PK: {
|
|
32
18
|
partitionKey: true
|
|
33
19
|
},
|
|
34
20
|
SK: {
|
|
35
21
|
sortKey: true
|
|
36
22
|
},
|
|
37
|
-
|
|
38
|
-
type: "string"
|
|
39
|
-
},
|
|
40
|
-
websiteUrl: {
|
|
41
|
-
type: "string"
|
|
42
|
-
},
|
|
43
|
-
websitePreviewUrl: {
|
|
23
|
+
TYPE: {
|
|
44
24
|
type: "string"
|
|
45
25
|
},
|
|
46
|
-
|
|
26
|
+
data: {
|
|
47
27
|
type: "map"
|
|
48
|
-
},
|
|
49
|
-
logo: {
|
|
50
|
-
type: "map"
|
|
51
|
-
},
|
|
52
|
-
prerendering: {
|
|
53
|
-
type: "map"
|
|
54
|
-
},
|
|
55
|
-
social: {
|
|
56
|
-
type: "map"
|
|
57
|
-
},
|
|
58
|
-
pages: {
|
|
59
|
-
type: "map"
|
|
60
|
-
},
|
|
61
|
-
type: {
|
|
62
|
-
type: "string"
|
|
63
|
-
},
|
|
64
|
-
tenant: {
|
|
65
|
-
type: "string"
|
|
66
|
-
},
|
|
67
|
-
locale: {
|
|
68
|
-
type: "string"
|
|
69
|
-
},
|
|
70
|
-
TYPE: {
|
|
71
|
-
type: "string"
|
|
72
28
|
}
|
|
73
|
-
}
|
|
29
|
+
}
|
|
74
30
|
});
|
|
75
31
|
};
|
|
32
|
+
exports.createSettingsEntity = createSettingsEntity;
|
|
76
33
|
|
|
77
|
-
|
|
34
|
+
//# sourceMappingURL=settingsEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createSettingsEntity","params","entityName","table","Entity","name","attributes","PK","partitionKey","SK","sortKey","TYPE","type","data","exports"],"sources":["settingsEntity.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n}\n\nexport const createSettingsEntity = (params: Params): Entity<any> => {\n const { entityName, 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 TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,oBAAoB,GAAIC,MAAc,IAAkB;EACjE,MAAM;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGF,MAAM;EACpC,OAAO,IAAIG,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBC,KAAK;IACLG,UAAU,EAAE;MACRC,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,IAAI,EAAE;QACFD,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAd,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
table: Table
|
|
6
|
-
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table: Table<string, string, string>;
|
|
6
|
+
entityName: string;
|
|
7
|
+
attributes: Attributes;
|
|
8
|
+
}
|
|
9
|
+
export declare const createSystemEntity: (params: Params) => Entity<any>;
|
|
10
|
+
export {};
|
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
|
-
const defineSystemEntity = params => {
|
|
6
|
+
exports.createSystemEntity = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createSystemEntity = params => {
|
|
21
9
|
const {
|
|
22
|
-
|
|
10
|
+
entityName,
|
|
11
|
+
attributes,
|
|
23
12
|
table
|
|
24
13
|
} = params;
|
|
25
|
-
|
|
26
|
-
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
-
return new _dynamodbToolbox.Entity({
|
|
14
|
+
return new _toolbox.Entity({
|
|
28
15
|
name: entityName,
|
|
29
16
|
table,
|
|
30
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
31
18
|
PK: {
|
|
32
19
|
partitionKey: true
|
|
33
20
|
},
|
|
@@ -36,9 +23,14 @@ const defineSystemEntity = params => {
|
|
|
36
23
|
},
|
|
37
24
|
version: {
|
|
38
25
|
type: "string"
|
|
39
|
-
}
|
|
40
|
-
|
|
26
|
+
},
|
|
27
|
+
tenant: {
|
|
28
|
+
type: "string"
|
|
29
|
+
},
|
|
30
|
+
...(attributes || {})
|
|
31
|
+
}
|
|
41
32
|
});
|
|
42
33
|
};
|
|
34
|
+
exports.createSystemEntity = createSystemEntity;
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
//# sourceMappingURL=systemEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","tenant","exports"],"sources":["systemEntity.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: Params): 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 tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAc,IAAkB;EAC/D,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Table } from "dynamodb
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
+
import type { TableModifier } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table?: TableModifier;
|
|
6
|
+
documentClient: DynamoDBDocument;
|
|
5
7
|
}
|
|
6
|
-
export declare const
|
|
8
|
+
export declare const createTable: ({ table, documentClient }: Params) => Table<string, string, string>;
|
|
9
|
+
export {};
|
package/definitions/table.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _documentClient = require("@webiny/db-dynamodb/utils/documentClient");
|
|
17
|
-
|
|
18
|
-
const defineTable = params => {
|
|
19
|
-
const {
|
|
20
|
-
context
|
|
21
|
-
} = params;
|
|
22
|
-
return new _dynamodbToolbox.Table({
|
|
23
|
-
name: _configurations.default.db().table || (0, _table.getTable)(context),
|
|
6
|
+
exports.createTable = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createTable = ({
|
|
9
|
+
table,
|
|
10
|
+
documentClient
|
|
11
|
+
}) => {
|
|
12
|
+
const tableConfig = {
|
|
13
|
+
name: process.env.DB_PAGE_BUILDER || process.env.DB_TABLE,
|
|
24
14
|
partitionKey: "PK",
|
|
25
15
|
sortKey: "SK",
|
|
26
|
-
DocumentClient:
|
|
27
|
-
|
|
16
|
+
DocumentClient: documentClient,
|
|
17
|
+
indexes: {
|
|
18
|
+
GSI1: {
|
|
19
|
+
partitionKey: "GSI1_PK",
|
|
20
|
+
sortKey: "GSI1_SK"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
autoExecute: true,
|
|
24
|
+
autoParse: true
|
|
25
|
+
};
|
|
26
|
+
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
27
|
+
return new _toolbox.Table(config);
|
|
28
28
|
};
|
|
29
|
+
exports.createTable = createTable;
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createTable","table","documentClient","tableConfig","name","process","env","DB_PAGE_BUILDER","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1","autoExecute","autoParse","config","Table","exports"],"sources":["table.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport type { TableModifier } from \"~/types\";\n\ninterface Params {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createTable = ({ table, documentClient }: Params): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_PAGE_BUILDER || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n }\n },\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,WAAW,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAuB,CAAC,KAAoC;EAC7F,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,eAAe,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IACrEC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb;IACJ,CAAC;IACDI,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOf,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIc,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAlB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { TableModifier } from "../types";
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
4
|
+
interface Params {
|
|
5
|
+
table?: TableModifier;
|
|
6
|
+
documentClient: DynamoDBDocument;
|
|
7
|
+
}
|
|
8
|
+
export declare const createElasticsearchTable: ({ table, documentClient }: Params) => Table<string, string, string>;
|
|
9
|
+
export {};
|
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
17
|
-
|
|
18
|
-
const defineTableElasticsearch = params => {
|
|
19
|
-
const {
|
|
20
|
-
context
|
|
21
|
-
} = params;
|
|
22
|
-
|
|
23
|
-
const tableName = _configurations.default.esDb().table;
|
|
24
|
-
|
|
25
|
-
if (!tableName) {
|
|
26
|
-
throw new _error.default(`Missing Elasticsearch table in the configuration.`, "TABLE_NAME_ERROR");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return new _dynamodbToolbox.Table({
|
|
30
|
-
name: tableName,
|
|
6
|
+
exports.createElasticsearchTable = void 0;
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
+
const createElasticsearchTable = ({
|
|
9
|
+
table,
|
|
10
|
+
documentClient
|
|
11
|
+
}) => {
|
|
12
|
+
const tableConfig = {
|
|
13
|
+
name: process.env.DB_TABLE_ELASTICSEARCH,
|
|
31
14
|
partitionKey: "PK",
|
|
32
15
|
sortKey: "SK",
|
|
33
|
-
DocumentClient:
|
|
34
|
-
|
|
16
|
+
DocumentClient: documentClient,
|
|
17
|
+
autoExecute: true,
|
|
18
|
+
autoParse: true
|
|
19
|
+
};
|
|
20
|
+
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
21
|
+
return new _toolbox.Table(config);
|
|
35
22
|
};
|
|
23
|
+
exports.createElasticsearchTable = createElasticsearchTable;
|
|
36
24
|
|
|
37
|
-
|
|
25
|
+
//# sourceMappingURL=tableElasticsearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\ninterface Params {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: Params): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_ELASTICSEARCH as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAGA,CAAC;EACrCC,KAAK;EACLC;AACI,CAAC,KAAoC;EACzC,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,sBAAgC;IAClDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOZ,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIW,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAf,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Client } from "@elastic/elasticsearch";
|
|
2
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
|
+
export interface ExecOnBeforeInstallParams {
|
|
4
|
+
elasticsearch: Client;
|
|
5
|
+
plugins: PluginsContainer;
|
|
6
|
+
tenant: string;
|
|
7
|
+
locale: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const createElasticsearchIndex: (params: ExecOnBeforeInstallParams) => Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createElasticsearchIndex = void 0;
|
|
7
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
+
var _PageElasticsearchIndexPlugin = require("../plugins/definitions/PageElasticsearchIndexPlugin");
|
|
9
|
+
var _configurations = require("../configurations");
|
|
10
|
+
const createElasticsearchIndex = async params => {
|
|
11
|
+
const {
|
|
12
|
+
elasticsearch,
|
|
13
|
+
plugins,
|
|
14
|
+
locale,
|
|
15
|
+
tenant
|
|
16
|
+
} = params;
|
|
17
|
+
const {
|
|
18
|
+
index
|
|
19
|
+
} = _configurations.configurations.es({
|
|
20
|
+
locale,
|
|
21
|
+
tenant
|
|
22
|
+
});
|
|
23
|
+
await (0, _apiElasticsearch.createIndex)({
|
|
24
|
+
plugins,
|
|
25
|
+
client: elasticsearch,
|
|
26
|
+
type: _PageElasticsearchIndexPlugin.PageElasticsearchIndexPlugin.type,
|
|
27
|
+
index,
|
|
28
|
+
tenant,
|
|
29
|
+
locale,
|
|
30
|
+
onExists: () => {
|
|
31
|
+
console.log(`Elasticsearch index "${index}" for the Page Builder Pages already exists.`);
|
|
32
|
+
},
|
|
33
|
+
onError: ex => {
|
|
34
|
+
console.error(`Could not create the Page Builder Pages Elasticsearch index "${index}".`, ex);
|
|
35
|
+
return ex;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
exports.createElasticsearchIndex = createElasticsearchIndex;
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=createElasticsearchIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_apiElasticsearch","require","_PageElasticsearchIndexPlugin","_configurations","createElasticsearchIndex","params","elasticsearch","plugins","locale","tenant","index","configurations","es","createIndex","client","type","PageElasticsearchIndexPlugin","onExists","console","log","onError","ex","error","exports"],"sources":["createElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@elastic/elasticsearch\";\nimport { createIndex } from \"@webiny/api-elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { PageElasticsearchIndexPlugin } from \"~/plugins/definitions/PageElasticsearchIndexPlugin\";\nimport { configurations } from \"~/configurations\";\n\nexport interface ExecOnBeforeInstallParams {\n elasticsearch: Client;\n plugins: PluginsContainer;\n tenant: string;\n locale: string;\n}\n\nexport const createElasticsearchIndex = async (\n params: ExecOnBeforeInstallParams\n): Promise<void> => {\n const { elasticsearch, plugins, locale, tenant } = params;\n\n const { index } = configurations.es({\n locale,\n tenant\n });\n await createIndex({\n plugins,\n client: elasticsearch,\n type: PageElasticsearchIndexPlugin.type,\n index,\n tenant,\n locale,\n onExists: () => {\n console.log(\n `Elasticsearch index \"${index}\" for the Page Builder Pages already exists.`\n );\n },\n onError: (ex: Error) => {\n console.error(\n `Could not create the Page Builder Pages Elasticsearch index \"${index}\".`,\n ex\n );\n return ex;\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,6BAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AASO,MAAMG,wBAAwB,GAAG,MACpCC,MAAiC,IACjB;EAChB,MAAM;IAAEC,aAAa;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EAEzD,MAAM;IAAEK;EAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;IAChCJ,MAAM;IACNC;EACJ,CAAC,CAAC;EACF,MAAM,IAAAI,6BAAW,EAAC;IACdN,OAAO;IACPO,MAAM,EAAER,aAAa;IACrBS,IAAI,EAAEC,0DAA4B,CAACD,IAAI;IACvCL,KAAK;IACLD,MAAM;IACND,MAAM;IACNS,QAAQ,EAAEA,CAAA,KAAM;MACZC,OAAO,CAACC,GAAG,CACP,wBAAwBT,KAAK,8CACjC,CAAC;IACL,CAAC;IACDU,OAAO,EAAGC,EAAS,IAAK;MACpBH,OAAO,CAACI,KAAK,CACT,gEAAgEZ,KAAK,IAAI,EACzEW,EACJ,CAAC;MACD,OAAOA,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAnB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.base = void 0;
|
|
7
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
+
var _PageElasticsearchIndexPlugin = require("../../plugins/definitions/PageElasticsearchIndexPlugin");
|
|
9
|
+
const base = exports.base = new _PageElasticsearchIndexPlugin.PageElasticsearchIndexPlugin({
|
|
10
|
+
body: (0, _apiElasticsearch.getBaseConfiguration)()
|
|
11
|
+
});
|
|
12
|
+
base.name = "pageBuilder.elasticsearch.index.page.default";
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_apiElasticsearch","require","_PageElasticsearchIndexPlugin","base","exports","PageElasticsearchIndexPlugin","body","getBaseConfiguration","name"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\nimport { PageElasticsearchIndexPlugin } from \"~/plugins/definitions/PageElasticsearchIndexPlugin\";\n\nexport const base = new PageElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n\nbase.name = \"pageBuilder.elasticsearch.index.page.default\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AAEO,MAAME,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAIE,0DAA4B,CAAC;EACjDC,IAAI,EAAE,IAAAC,sCAAoB,EAAC;AAC/B,CAAC,CAAC;AAEFJ,IAAI,CAACK,IAAI,GAAG,8CAA8C","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const elasticsearchIndexPlugins: () => import("../..").PageElasticsearchIndexPlugin[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.elasticsearchIndexPlugins = void 0;
|
|
7
|
+
var _base = require("./base");
|
|
8
|
+
var _japanese = require("./japanese");
|
|
9
|
+
const elasticsearchIndexPlugins = () => {
|
|
10
|
+
return [_base.base, _japanese.japanese];
|
|
11
|
+
};
|
|
12
|
+
exports.elasticsearchIndexPlugins = elasticsearchIndexPlugins;
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_base","require","_japanese","elasticsearchIndexPlugins","base","japanese","exports"],"sources":["index.ts"],"sourcesContent":["import { base } from \"./base\";\nimport { japanese } from \"./japanese\";\n\nexport const elasticsearchIndexPlugins = () => {\n return [base, japanese];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,CAACC,UAAI,EAAEC,kBAAQ,CAAC;AAC3B,CAAC;AAACC,OAAA,CAAAH,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.japanese = void 0;
|
|
7
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
+
var _PageElasticsearchIndexPlugin = require("../../plugins/definitions/PageElasticsearchIndexPlugin");
|
|
9
|
+
const japanese = exports.japanese = new _PageElasticsearchIndexPlugin.PageElasticsearchIndexPlugin({
|
|
10
|
+
body: (0, _apiElasticsearch.getJapaneseConfiguration)(),
|
|
11
|
+
locales: ["ja", "ja-jp"]
|
|
12
|
+
});
|
|
13
|
+
japanese.name = "pageBuilder.elasticsearch.index.page.ja-jp";
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=japanese.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_apiElasticsearch","require","_PageElasticsearchIndexPlugin","japanese","exports","PageElasticsearchIndexPlugin","body","getJapaneseConfiguration","locales","name"],"sources":["japanese.ts"],"sourcesContent":["import { getJapaneseConfiguration } from \"@webiny/api-elasticsearch\";\nimport { PageElasticsearchIndexPlugin } from \"~/plugins/definitions/PageElasticsearchIndexPlugin\";\n\nexport const japanese = new PageElasticsearchIndexPlugin({\n body: getJapaneseConfiguration(),\n locales: [\"ja\", \"ja-jp\"]\n});\n\njapanese.name = \"pageBuilder.elasticsearch.index.page.ja-jp\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AAEO,MAAME,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAIE,0DAA4B,CAAC;EACrDC,IAAI,EAAE,IAAAC,0CAAwB,EAAC,CAAC;EAChCC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO;AAC3B,CAAC,CAAC;AAEFL,QAAQ,CAACM,IAAI,GAAG,4CAA4C","ignoreList":[]}
|