@webiny/api-page-builder-so-ddb-es 0.0.0-mt-1
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/LICENSE +21 -0
- package/README.md +30 -0
- package/definitions/categoryEntity.d.ts +6 -0
- package/definitions/categoryEntity.js +68 -0
- package/definitions/menuEntity.d.ts +6 -0
- package/definitions/menuEntity.js +68 -0
- package/definitions/pageElasticsearchEntity.d.ts +6 -0
- package/definitions/pageElasticsearchEntity.js +47 -0
- package/definitions/pageElementEntity.d.ts +6 -0
- package/definitions/pageElementEntity.js +74 -0
- package/definitions/pageEntity.d.ts +6 -0
- package/definitions/pageEntity.js +113 -0
- package/definitions/settingsEntity.d.ts +6 -0
- package/definitions/settingsEntity.js +77 -0
- package/definitions/systemEntity.d.ts +6 -0
- package/definitions/systemEntity.js +44 -0
- package/definitions/table.d.ts +6 -0
- package/definitions/table.js +30 -0
- package/definitions/tableElasticsearch.d.ts +5 -0
- package/definitions/tableElasticsearch.js +37 -0
- package/index.d.ts +8 -0
- package/index.js +26 -0
- package/operations/category/CategoryDataLoader.d.ts +20 -0
- package/operations/category/CategoryDataLoader.js +77 -0
- package/operations/category/CategoryStorageOperations.d.ts +29 -0
- package/operations/category/CategoryStorageOperations.js +243 -0
- package/operations/category/fields.d.ts +3 -0
- package/operations/category/fields.js +28 -0
- package/operations/category/index.d.ts +5 -0
- package/operations/category/index.js +28 -0
- package/operations/configurations.d.ts +36 -0
- package/operations/configurations.js +71 -0
- package/operations/menu/MenuStorageOperations.d.ts +23 -0
- package/operations/menu/MenuStorageOperations.js +235 -0
- package/operations/menu/fields.d.ts +3 -0
- package/operations/menu/fields.js +25 -0
- package/operations/menu/index.d.ts +5 -0
- package/operations/menu/index.js +28 -0
- package/operations/pageElement/PageElementStorageOperations.d.ts +23 -0
- package/operations/pageElement/PageElementStorageOperations.js +234 -0
- package/operations/pageElement/fields.d.ts +3 -0
- package/operations/pageElement/fields.js +19 -0
- package/operations/pageElement/index.d.ts +7 -0
- package/operations/pageElement/index.js +28 -0
- package/operations/pages/PageStorageOperations.d.ts +79 -0
- package/operations/pages/PageStorageOperations.js +1117 -0
- package/operations/pages/elasticsearchQueryBody.d.ts +18 -0
- package/operations/pages/elasticsearchQueryBody.js +271 -0
- package/operations/pages/fields.d.ts +3 -0
- package/operations/pages/fields.js +42 -0
- package/operations/pages/helpers.d.ts +42 -0
- package/operations/pages/helpers.js +89 -0
- package/operations/pages/index.d.ts +5 -0
- package/operations/pages/index.js +33 -0
- package/operations/settings/SettingsStorageOperations.d.ts +35 -0
- package/operations/settings/SettingsStorageOperations.js +191 -0
- package/operations/settings/index.d.ts +7 -0
- package/operations/settings/index.js +23 -0
- package/operations/system/InstallationDdbEsPlugin.d.ts +2 -0
- package/operations/system/InstallationDdbEsPlugin.js +73 -0
- package/operations/system/SystemStorageOperations.d.ts +16 -0
- package/operations/system/SystemStorageOperations.js +114 -0
- package/operations/system/index.d.ts +5 -0
- package/operations/system/index.js +29 -0
- package/package.json +65 -0
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/IndexPageDataPlugin.d.ts +18 -0
- package/plugins/definitions/IndexPageDataPlugin.js +32 -0
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchFieldPlugin.d.ts +5 -0
- package/plugins/definitions/PageElasticsearchFieldPlugin.js +22 -0
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.js +17 -0
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/SearchLatestPagesPlugin.d.ts +4 -0
- package/plugins/definitions/SearchLatestPagesPlugin.js +17 -0
- package/plugins/definitions/SearchPagesPlugin.d.ts +24 -0
- package/plugins/definitions/SearchPagesPlugin.js +39 -0
- package/plugins/definitions/SearchPublishedPagesPlugin.d.ts +4 -0
- package/plugins/definitions/SearchPublishedPagesPlugin.js +17 -0
- package/upgrades/index.d.ts +2 -0
- package/upgrades/index.js +14 -0
- package/upgrades/v5.15.0/category.d.ts +2 -0
- package/upgrades/v5.15.0/category.js +75 -0
- package/upgrades/v5.15.0/index.d.ts +4 -0
- package/upgrades/v5.15.0/index.js +52 -0
- package/upgrades/v5.15.0/menu.d.ts +2 -0
- package/upgrades/v5.15.0/menu.js +75 -0
- package/upgrades/v5.15.0/pageElement.d.ts +2 -0
- package/upgrades/v5.15.0/pageElement.js +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Webiny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @webiny/api-page-builder-so-ddb-es
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@webiny/api-page-builder-so-ddb-es)
|
|
4
|
+
[](https://www.npmjs.com/package/@webiny/api-page-builder-so-ddb-es)
|
|
5
|
+
[](https://github.com/prettier/prettier)
|
|
6
|
+
[](http://makeapullrequest.com)
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install --save @webiny/api-page-builder-so-ddb-es
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Or if you prefer yarn:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
yarn add @webiny/api-page-builder-so-ddb-es
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Testing
|
|
22
|
+
To run the tests only for this package you must filter it with keywords.
|
|
23
|
+
|
|
24
|
+
### Env variables
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Command
|
|
28
|
+
````
|
|
29
|
+
yarn test packages/api-page-builder --keyword=pb:ddb-es --keyword=pb:base
|
|
30
|
+
````
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.defineCategoryEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 defineCategoryEntity = params => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbCategory";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
TYPE: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
name: {
|
|
41
|
+
type: "string"
|
|
42
|
+
},
|
|
43
|
+
slug: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
url: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
layout: {
|
|
50
|
+
type: "string"
|
|
51
|
+
},
|
|
52
|
+
createdOn: {
|
|
53
|
+
type: "string"
|
|
54
|
+
},
|
|
55
|
+
createdBy: {
|
|
56
|
+
type: "map"
|
|
57
|
+
},
|
|
58
|
+
tenant: {
|
|
59
|
+
type: "string"
|
|
60
|
+
},
|
|
61
|
+
locale: {
|
|
62
|
+
type: "string"
|
|
63
|
+
}
|
|
64
|
+
}, attributes)
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.defineCategoryEntity = defineCategoryEntity;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.defineMenuEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 defineMenuEntity = params => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbMenu";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
TYPE: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
title: {
|
|
41
|
+
type: "string"
|
|
42
|
+
},
|
|
43
|
+
slug: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
description: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
items: {
|
|
50
|
+
type: "list"
|
|
51
|
+
},
|
|
52
|
+
createdOn: {
|
|
53
|
+
type: "string"
|
|
54
|
+
},
|
|
55
|
+
createdBy: {
|
|
56
|
+
type: "map"
|
|
57
|
+
},
|
|
58
|
+
tenant: {
|
|
59
|
+
type: "string"
|
|
60
|
+
},
|
|
61
|
+
locale: {
|
|
62
|
+
type: "string"
|
|
63
|
+
}
|
|
64
|
+
}, attributes)
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.defineMenuEntity = defineMenuEntity;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.definePageElasticsearchEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 definePageElasticsearchEntity = params => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbPageElasticsearch";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
index: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
data: {
|
|
41
|
+
type: "map"
|
|
42
|
+
}
|
|
43
|
+
}, attributes)
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.definePageElasticsearchEntity = definePageElasticsearchEntity;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.definePageElementEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 definePageElementEntity = params => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbPageElement";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
TYPE: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
id: {
|
|
41
|
+
type: "string"
|
|
42
|
+
},
|
|
43
|
+
name: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
category: {
|
|
50
|
+
type: "string"
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
type: "map"
|
|
54
|
+
},
|
|
55
|
+
preview: {
|
|
56
|
+
type: "map"
|
|
57
|
+
},
|
|
58
|
+
createdOn: {
|
|
59
|
+
type: "string"
|
|
60
|
+
},
|
|
61
|
+
createdBy: {
|
|
62
|
+
type: "map"
|
|
63
|
+
},
|
|
64
|
+
tenant: {
|
|
65
|
+
type: "string"
|
|
66
|
+
},
|
|
67
|
+
locale: {
|
|
68
|
+
type: "string"
|
|
69
|
+
}
|
|
70
|
+
}, attributes)
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.definePageElementEntity = definePageElementEntity;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.definePageEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbPage";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
TYPE: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
id: {
|
|
41
|
+
type: "string"
|
|
42
|
+
},
|
|
43
|
+
pid: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
tenant: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
locale: {
|
|
50
|
+
type: "string"
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
type: "string"
|
|
54
|
+
},
|
|
55
|
+
editor: {
|
|
56
|
+
type: "string"
|
|
57
|
+
},
|
|
58
|
+
createdFrom: {
|
|
59
|
+
type: "string"
|
|
60
|
+
},
|
|
61
|
+
path: {
|
|
62
|
+
type: "string"
|
|
63
|
+
},
|
|
64
|
+
category: {
|
|
65
|
+
type: "string"
|
|
66
|
+
},
|
|
67
|
+
content: {
|
|
68
|
+
type: "map"
|
|
69
|
+
},
|
|
70
|
+
publishedOn: {
|
|
71
|
+
type: "string"
|
|
72
|
+
},
|
|
73
|
+
version: {
|
|
74
|
+
type: "number"
|
|
75
|
+
},
|
|
76
|
+
settings: {
|
|
77
|
+
type: "map"
|
|
78
|
+
},
|
|
79
|
+
locked: {
|
|
80
|
+
type: "boolean"
|
|
81
|
+
},
|
|
82
|
+
status: {
|
|
83
|
+
type: "string"
|
|
84
|
+
},
|
|
85
|
+
visibility: {
|
|
86
|
+
type: "map"
|
|
87
|
+
},
|
|
88
|
+
home: {
|
|
89
|
+
type: "boolean"
|
|
90
|
+
},
|
|
91
|
+
notFound: {
|
|
92
|
+
type: "boolean"
|
|
93
|
+
},
|
|
94
|
+
createdOn: {
|
|
95
|
+
type: "string"
|
|
96
|
+
},
|
|
97
|
+
savedOn: {
|
|
98
|
+
type: "string"
|
|
99
|
+
},
|
|
100
|
+
createdBy: {
|
|
101
|
+
type: "map"
|
|
102
|
+
},
|
|
103
|
+
ownedBy: {
|
|
104
|
+
type: "map"
|
|
105
|
+
},
|
|
106
|
+
webinyVersion: {
|
|
107
|
+
type: "string"
|
|
108
|
+
}
|
|
109
|
+
}, attributes)
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
exports.definePageEntity = definePageEntity;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.defineSettingsEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbSettings";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
name: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
websiteUrl: {
|
|
41
|
+
type: "string"
|
|
42
|
+
},
|
|
43
|
+
websitePreviewUrl: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
favicon: {
|
|
47
|
+
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
|
+
}
|
|
73
|
+
}, attributes)
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
exports.defineSettingsEntity = defineSettingsEntity;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.defineSystemEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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 => {
|
|
21
|
+
const {
|
|
22
|
+
context,
|
|
23
|
+
table
|
|
24
|
+
} = params;
|
|
25
|
+
const entityName = "PbSystem";
|
|
26
|
+
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
27
|
+
return new _dynamodbToolbox.Entity({
|
|
28
|
+
name: entityName,
|
|
29
|
+
table,
|
|
30
|
+
attributes: _objectSpread({
|
|
31
|
+
PK: {
|
|
32
|
+
partitionKey: true
|
|
33
|
+
},
|
|
34
|
+
SK: {
|
|
35
|
+
sortKey: true
|
|
36
|
+
},
|
|
37
|
+
version: {
|
|
38
|
+
type: "string"
|
|
39
|
+
}
|
|
40
|
+
}, attributes)
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.defineSystemEntity = defineSystemEntity;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.defineTable = void 0;
|
|
9
|
+
|
|
10
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
11
|
+
|
|
12
|
+
var _configurations = _interopRequireDefault(require("../operations/configurations"));
|
|
13
|
+
|
|
14
|
+
var _table = require("@webiny/db-dynamodb/utils/table");
|
|
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),
|
|
24
|
+
partitionKey: "PK",
|
|
25
|
+
sortKey: "SK",
|
|
26
|
+
DocumentClient: (0, _documentClient.getDocumentClient)(context)
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.defineTable = defineTable;
|