@webiny/api-headless-cms-ddb 0.0.0-unstable.78f581c1d2 → 0.0.0-unstable.7be00a75a9
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/README.md +6 -20
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +9 -94
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +4 -5
- package/definitions/group.js +9 -68
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +4 -5
- package/definitions/model.js +9 -90
- package/definitions/model.js.map +1 -1
- package/definitions/table.d.ts +4 -6
- package/definitions/table.js +8 -30
- package/definitions/table.js.map +1 -1
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +11 -20
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/path/locationFolderId.d.ts +2 -0
- package/dynamoDb/path/locationFolderId.js +21 -0
- package/dynamoDb/path/locationFolderId.js.map +1 -0
- package/dynamoDb/path/plainObject.d.ts +1 -1
- package/dynamoDb/path/plainObject.js +13 -37
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/transformValue/datetime.d.ts +1 -1
- package/dynamoDb/transformValue/datetime.js +27 -50
- package/dynamoDb/transformValue/datetime.js.map +1 -1
- package/index.d.ts +2 -3
- package/index.js +83 -139
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +5 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +40 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +40 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +42 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +18 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +0 -0
- package/operations/entry/dataLoaders.d.ts +14 -30
- package/operations/entry/dataLoaders.js +83 -314
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createExpressions.d.ts +27 -0
- package/operations/entry/filtering/createExpressions.js +124 -0
- package/operations/entry/filtering/createExpressions.js.map +1 -0
- package/operations/entry/filtering/createFields.d.ts +16 -0
- package/operations/entry/filtering/createFields.js +93 -0
- package/operations/entry/filtering/createFields.js.map +1 -0
- package/operations/entry/filtering/extractSort.d.ts +17 -0
- package/operations/entry/filtering/extractSort.js +60 -0
- package/operations/entry/filtering/extractSort.js.map +1 -0
- package/operations/entry/filtering/filter.d.ts +16 -0
- package/operations/entry/filtering/filter.js +85 -0
- package/operations/entry/filtering/filter.js.map +1 -0
- package/operations/entry/filtering/fullTextSearch.d.ts +14 -0
- package/operations/entry/filtering/fullTextSearch.js +25 -0
- package/operations/entry/filtering/fullTextSearch.js.map +1 -0
- package/operations/entry/filtering/getValue.d.ts +5 -0
- package/operations/entry/filtering/getValue.js +37 -0
- package/operations/entry/filtering/getValue.js.map +1 -0
- package/operations/entry/filtering/index.d.ts +2 -0
- package/operations/entry/filtering/index.js +2 -0
- package/operations/entry/filtering/mapPlugins.d.ts +8 -0
- package/operations/entry/filtering/mapPlugins.js +18 -0
- package/operations/entry/filtering/mapPlugins.js.map +1 -0
- package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +33 -0
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -0
- package/operations/entry/filtering/plugins/index.d.ts +1 -0
- package/operations/entry/filtering/plugins/index.js +13 -0
- package/operations/entry/filtering/plugins/index.js.map +1 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.js +68 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +3 -0
- package/operations/entry/filtering/plugins/refFilterCreate.js +63 -0
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +49 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
- package/operations/entry/filtering/sort.d.ts +12 -0
- package/operations/entry/filtering/sort.js +41 -0
- package/operations/entry/filtering/sort.js.map +1 -0
- package/operations/entry/filtering/systemFields.d.ts +2 -0
- package/operations/entry/filtering/systemFields.js +149 -0
- package/operations/entry/filtering/systemFields.js.map +1 -0
- package/operations/entry/filtering/transform.d.ts +6 -0
- package/operations/entry/filtering/transform.js +7 -0
- package/operations/entry/filtering/transform.js.map +1 -0
- package/operations/entry/filtering/types.d.ts +40 -0
- package/operations/entry/filtering/types.js +0 -0
- package/operations/entry/filtering/values.d.ts +2 -0
- package/operations/entry/filtering/values.js +15 -0
- package/operations/entry/filtering/values.js.map +1 -0
- package/operations/entry/filtering/where.d.ts +5 -0
- package/operations/entry/filtering/where.js +22 -0
- package/operations/entry/filtering/where.js.map +1 -0
- package/operations/entry/index.d.ts +5 -4
- package/operations/entry/index.js +931 -845
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +46 -2
- package/operations/entry/keys.js +53 -66
- package/operations/entry/keys.js.map +1 -1
- package/operations/group/index.d.ts +4 -5
- package/operations/group/index.js +116 -187
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +3 -3
- package/operations/model/index.js +102 -158
- package/operations/model/index.js.map +1 -1
- package/package.json +34 -33
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +5 -4
- package/plugins/CmsEntryFieldFilterPathPlugin.js +25 -50
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
- package/plugins/CmsEntryFieldFilterPlugin.js +20 -0
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
- package/plugins/CmsEntryFieldSortingPlugin.js +20 -0
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js +19 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +4 -1
- package/plugins/index.js +4 -18
- package/types.d.ts +28 -21
- package/types.js +8 -15
- package/types.js.map +1 -1
- package/definitions/settings.d.ts +0 -9
- package/definitions/settings.js +0 -58
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -9
- package/definitions/system.js +0 -46
- package/definitions/system.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -2
- package/dynamoDb/storage/date.js +0 -99
- package/dynamoDb/storage/date.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -101
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -2
- package/dynamoDb/storage/richText.js +0 -113
- package/dynamoDb/storage/richText.js.map +0 -1
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -74
- package/operations/entry/systemFields.js.map +0 -1
- package/operations/entry/utils.d.ts +0 -36
- package/operations/entry/utils.js +0 -680
- package/operations/entry/utils.js.map +0 -1
- package/operations/settings/index.d.ts +0 -7
- package/operations/settings/index.js +0 -135
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -7
- package/operations/system/index.js +0 -99
- package/operations/system/index.js.map +0 -1
- package/plugins/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
# @webiny/api-headless-cms-ddb
|
|
2
2
|
|
|
3
|
-
[!
|
|
4
|
-
[
|
|
5
|
-
|
|
6
|
-
[](http://makeapullrequest.com)
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
npm install --save @webiny/api-headless-cms-ddb
|
|
12
|
-
```
|
|
9
|
+
---
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
yarn add @webiny/api-headless-cms-ddb
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Testing
|
|
21
|
-
To run the tests only for this package you must filter it with keywords.
|
|
22
|
-
### Command
|
|
23
|
-
````
|
|
24
|
-
yarn test packages/api-headless-cms --keyword=cms:ddb --keyword=cms:base
|
|
25
|
-
````
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/definitions/entry.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { IEntryEntity } from "./types.js";
|
|
3
3
|
interface Params {
|
|
4
|
-
table:
|
|
4
|
+
table: ITable;
|
|
5
5
|
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
6
|
}
|
|
8
|
-
export declare const createEntryEntity: (params: Params) =>
|
|
7
|
+
export declare const createEntryEntity: (params: Params) => IEntryEntity;
|
|
9
8
|
export {};
|
package/definitions/entry.js
CHANGED
|
@@ -1,96 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.createEntryEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
const createEntryEntity = params => {
|
|
15
|
-
const {
|
|
16
|
-
table,
|
|
17
|
-
entityName,
|
|
18
|
-
attributes
|
|
19
|
-
} = params;
|
|
20
|
-
return new _dynamodbToolbox.Entity({
|
|
21
|
-
name: entityName,
|
|
22
|
-
table,
|
|
23
|
-
attributes: (0, _objectSpread2.default)({
|
|
24
|
-
PK: {
|
|
25
|
-
type: "string",
|
|
26
|
-
partitionKey: true
|
|
27
|
-
},
|
|
28
|
-
SK: {
|
|
29
|
-
type: "string",
|
|
30
|
-
sortKey: true
|
|
31
|
-
},
|
|
32
|
-
GSI1_PK: {
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
GSI1_SK: {
|
|
36
|
-
type: "string"
|
|
37
|
-
},
|
|
38
|
-
TYPE: {
|
|
39
|
-
type: "string"
|
|
40
|
-
},
|
|
41
|
-
__type: {
|
|
42
|
-
type: "string"
|
|
43
|
-
},
|
|
44
|
-
webinyVersion: {
|
|
45
|
-
type: "string"
|
|
46
|
-
},
|
|
47
|
-
tenant: {
|
|
48
|
-
type: "string"
|
|
49
|
-
},
|
|
50
|
-
entryId: {
|
|
51
|
-
type: "string"
|
|
52
|
-
},
|
|
53
|
-
id: {
|
|
54
|
-
type: "string"
|
|
55
|
-
},
|
|
56
|
-
createdBy: {
|
|
57
|
-
type: "map"
|
|
58
|
-
},
|
|
59
|
-
ownedBy: {
|
|
60
|
-
type: "map"
|
|
61
|
-
},
|
|
62
|
-
createdOn: {
|
|
63
|
-
type: "string"
|
|
64
|
-
},
|
|
65
|
-
savedOn: {
|
|
66
|
-
type: "string"
|
|
67
|
-
},
|
|
68
|
-
modelId: {
|
|
69
|
-
type: "string"
|
|
70
|
-
},
|
|
71
|
-
locale: {
|
|
72
|
-
type: "string"
|
|
73
|
-
},
|
|
74
|
-
publishedOn: {
|
|
75
|
-
type: "string"
|
|
76
|
-
},
|
|
77
|
-
version: {
|
|
78
|
-
type: "number"
|
|
79
|
-
},
|
|
80
|
-
locked: {
|
|
81
|
-
type: "boolean"
|
|
82
|
-
},
|
|
83
|
-
status: {
|
|
84
|
-
type: "string"
|
|
85
|
-
},
|
|
86
|
-
values: {
|
|
87
|
-
type: "map"
|
|
88
|
-
},
|
|
89
|
-
meta: {
|
|
90
|
-
type: "map"
|
|
91
|
-
}
|
|
92
|
-
}, attributes || {})
|
|
93
|
-
});
|
|
1
|
+
import { createStandardEntity } from "@webiny/db-dynamodb";
|
|
2
|
+
const createEntryEntity = (params)=>{
|
|
3
|
+
const { table, entityName } = params;
|
|
4
|
+
return createStandardEntity({
|
|
5
|
+
name: entityName,
|
|
6
|
+
table: table.table
|
|
7
|
+
});
|
|
94
8
|
};
|
|
9
|
+
export { createEntryEntity };
|
|
95
10
|
|
|
96
|
-
|
|
11
|
+
//# sourceMappingURL=entry.js.map
|
package/definitions/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"definitions/entry.js","sources":["../../src/definitions/entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttributesData } from \"./types.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createEntryEntity = (params: Params): IEntryEntity => {\n const { table, entityName } = params;\n return createStandardEntity<IEntryEntityAttributesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"names":["createEntryEntity","params","table","entityName","createStandardEntity"],"mappings":";AAQO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAiD;QACpD,MAAMD;QACN,OAAOD,MAAM,KAAK;IACtB;AACJ"}
|
package/definitions/group.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { IGroupEntity } from "./types.js";
|
|
3
3
|
interface Params {
|
|
4
|
-
table:
|
|
4
|
+
table: ITable;
|
|
5
5
|
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
6
|
}
|
|
8
|
-
export declare const createGroupEntity: (params: Params) =>
|
|
7
|
+
export declare const createGroupEntity: (params: Params) => IGroupEntity;
|
|
9
8
|
export {};
|
package/definitions/group.js
CHANGED
|
@@ -1,70 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.createGroupEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
const createGroupEntity = params => {
|
|
15
|
-
const {
|
|
16
|
-
table,
|
|
17
|
-
attributes,
|
|
18
|
-
entityName
|
|
19
|
-
} = params;
|
|
20
|
-
return new _dynamodbToolbox.Entity({
|
|
21
|
-
name: entityName,
|
|
22
|
-
table,
|
|
23
|
-
attributes: (0, _objectSpread2.default)({
|
|
24
|
-
PK: {
|
|
25
|
-
partitionKey: true
|
|
26
|
-
},
|
|
27
|
-
SK: {
|
|
28
|
-
sortKey: true
|
|
29
|
-
},
|
|
30
|
-
TYPE: {
|
|
31
|
-
type: "string"
|
|
32
|
-
},
|
|
33
|
-
webinyVersion: {
|
|
34
|
-
type: "string"
|
|
35
|
-
},
|
|
36
|
-
id: {
|
|
37
|
-
type: "string"
|
|
38
|
-
},
|
|
39
|
-
name: {
|
|
40
|
-
type: "string"
|
|
41
|
-
},
|
|
42
|
-
slug: {
|
|
43
|
-
type: "string"
|
|
44
|
-
},
|
|
45
|
-
locale: {
|
|
46
|
-
type: "string"
|
|
47
|
-
},
|
|
48
|
-
description: {
|
|
49
|
-
type: "string"
|
|
50
|
-
},
|
|
51
|
-
icon: {
|
|
52
|
-
type: "string"
|
|
53
|
-
},
|
|
54
|
-
createdBy: {
|
|
55
|
-
type: "map"
|
|
56
|
-
},
|
|
57
|
-
createdOn: {
|
|
58
|
-
type: "string"
|
|
59
|
-
},
|
|
60
|
-
savedOn: {
|
|
61
|
-
type: "string"
|
|
62
|
-
},
|
|
63
|
-
tenant: {
|
|
64
|
-
type: "string"
|
|
65
|
-
}
|
|
66
|
-
}, attributes || {})
|
|
67
|
-
});
|
|
1
|
+
import { createStandardEntity } from "@webiny/db-dynamodb";
|
|
2
|
+
const createGroupEntity = (params)=>{
|
|
3
|
+
const { table, entityName } = params;
|
|
4
|
+
return createStandardEntity({
|
|
5
|
+
table: table.table,
|
|
6
|
+
name: entityName
|
|
7
|
+
});
|
|
68
8
|
};
|
|
9
|
+
export { createGroupEntity };
|
|
69
10
|
|
|
70
|
-
|
|
11
|
+
//# sourceMappingURL=group.js.map
|
package/definitions/group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"definitions/group.js","sources":["../../src/definitions/group.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IGroupEntity } from \"./types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createGroupEntity = (params: Params): IGroupEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsGroup>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createGroupEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAA+B;QAClC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
|
package/definitions/model.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { IModelEntity } from "./types.js";
|
|
3
3
|
interface Params {
|
|
4
|
-
table:
|
|
4
|
+
table: ITable;
|
|
5
5
|
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
6
|
}
|
|
8
|
-
export declare const createModelEntity: (params: Params) =>
|
|
7
|
+
export declare const createModelEntity: (params: Params) => IModelEntity;
|
|
9
8
|
export {};
|
package/definitions/model.js
CHANGED
|
@@ -1,92 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.createModelEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
const createModelEntity = params => {
|
|
15
|
-
const {
|
|
16
|
-
table,
|
|
17
|
-
attributes,
|
|
18
|
-
entityName
|
|
19
|
-
} = params;
|
|
20
|
-
return new _dynamodbToolbox.Entity({
|
|
21
|
-
name: entityName,
|
|
22
|
-
table,
|
|
23
|
-
attributes: (0, _objectSpread2.default)({
|
|
24
|
-
PK: {
|
|
25
|
-
partitionKey: true
|
|
26
|
-
},
|
|
27
|
-
SK: {
|
|
28
|
-
sortKey: true
|
|
29
|
-
},
|
|
30
|
-
TYPE: {
|
|
31
|
-
type: "string",
|
|
32
|
-
required: true
|
|
33
|
-
},
|
|
34
|
-
webinyVersion: {
|
|
35
|
-
type: "string",
|
|
36
|
-
required: true
|
|
37
|
-
},
|
|
38
|
-
name: {
|
|
39
|
-
type: "string",
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
42
|
-
modelId: {
|
|
43
|
-
type: "string",
|
|
44
|
-
required: true
|
|
45
|
-
},
|
|
46
|
-
locale: {
|
|
47
|
-
type: "string",
|
|
48
|
-
required: true
|
|
49
|
-
},
|
|
50
|
-
group: {
|
|
51
|
-
type: "map",
|
|
52
|
-
required: true
|
|
53
|
-
},
|
|
54
|
-
description: {
|
|
55
|
-
type: "string"
|
|
56
|
-
},
|
|
57
|
-
createdOn: {
|
|
58
|
-
type: "string",
|
|
59
|
-
required: true
|
|
60
|
-
},
|
|
61
|
-
savedOn: {
|
|
62
|
-
type: "string",
|
|
63
|
-
required: true
|
|
64
|
-
},
|
|
65
|
-
createdBy: {
|
|
66
|
-
type: "map",
|
|
67
|
-
required: true
|
|
68
|
-
},
|
|
69
|
-
fields: {
|
|
70
|
-
type: "list",
|
|
71
|
-
required: true
|
|
72
|
-
},
|
|
73
|
-
layout: {
|
|
74
|
-
type: "list",
|
|
75
|
-
required: true
|
|
76
|
-
},
|
|
77
|
-
lockedFields: {
|
|
78
|
-
type: "list",
|
|
79
|
-
required: true
|
|
80
|
-
},
|
|
81
|
-
titleFieldId: {
|
|
82
|
-
type: "string"
|
|
83
|
-
},
|
|
84
|
-
tenant: {
|
|
85
|
-
type: "string",
|
|
86
|
-
required: true
|
|
87
|
-
}
|
|
88
|
-
}, attributes || {})
|
|
89
|
-
});
|
|
1
|
+
import { createStandardEntity } from "@webiny/db-dynamodb";
|
|
2
|
+
const createModelEntity = (params)=>{
|
|
3
|
+
const { table, entityName } = params;
|
|
4
|
+
return createStandardEntity({
|
|
5
|
+
table: table.table,
|
|
6
|
+
name: entityName
|
|
7
|
+
});
|
|
90
8
|
};
|
|
9
|
+
export { createModelEntity };
|
|
91
10
|
|
|
92
|
-
|
|
11
|
+
//# sourceMappingURL=model.js.map
|
package/definitions/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"definitions/model.js","sources":["../../src/definitions/model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<StorageCmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createModelEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAsC;QACzC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
3
|
-
import { Table } from "dynamodb-toolbox";
|
|
1
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
4
2
|
interface Params {
|
|
5
|
-
|
|
6
|
-
documentClient:
|
|
3
|
+
name?: string;
|
|
4
|
+
documentClient: DynamoDBDocument;
|
|
7
5
|
}
|
|
8
|
-
export declare const createTable: (
|
|
6
|
+
export declare const createTable: (params: Params) => import("@webiny/db-dynamodb").ITable<string, "PK", "SK">;
|
|
9
7
|
export {};
|
package/definitions/table.js
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const createTable = ({
|
|
11
|
-
table,
|
|
12
|
-
documentClient
|
|
13
|
-
}) => {
|
|
14
|
-
const tableConfig = {
|
|
15
|
-
name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
|
|
16
|
-
partitionKey: "PK",
|
|
17
|
-
sortKey: "SK",
|
|
18
|
-
DocumentClient: documentClient,
|
|
19
|
-
indexes: {
|
|
20
|
-
GSI1: {
|
|
21
|
-
partitionKey: "GSI1_PK",
|
|
22
|
-
sortKey: "GSI1_SK"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
27
|
-
return new _dynamodbToolbox.Table(config);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.createTable = createTable;
|
|
1
|
+
import { createTable } from "@webiny/db-dynamodb";
|
|
2
|
+
const table_createTable = (params)=>createTable({
|
|
3
|
+
name: params.name || process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
|
|
4
|
+
documentClient: params.documentClient
|
|
5
|
+
});
|
|
6
|
+
export { table_createTable as createTable };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=table.js.map
|
package/definitions/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"definitions/table.js","sources":["../../src/definitions/table.ts"],"sourcesContent":["import { createTable as baseCreateTable } from \"@webiny/db-dynamodb\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\n\ninterface Params {\n name?: string;\n documentClient: DynamoDBDocument;\n}\n\nexport const createTable = (params: Params) => {\n return baseCreateTable({\n name: params.name || process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n documentClient: params.documentClient\n });\n};\n"],"names":["createTable","params","baseCreateTable","process"],"mappings":";AAQO,MAAMA,oBAAc,CAACC,SACjBC,YAAgB;QACnB,MAAMD,OAAO,IAAI,IAAIE,QAAQ,GAAG,CAAC,qBAAqB,IAAKA,QAAQ,GAAG,CAAC,QAAQ;QAC/E,gBAAgBF,OAAO,cAAc;IACzC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
+
export interface IEntryEntityAttributesData {
|
|
5
|
+
id: string;
|
|
6
|
+
entryId: string;
|
|
7
|
+
modelId: string;
|
|
8
|
+
tenant: string;
|
|
9
|
+
/**
|
|
10
|
+
* Revision-level meta fields. 👇
|
|
11
|
+
*/
|
|
12
|
+
revisionCreatedOn: string;
|
|
13
|
+
revisionModifiedOn: string | null;
|
|
14
|
+
revisionSavedOn: string;
|
|
15
|
+
revisionDeletedOn: string | null;
|
|
16
|
+
revisionRestoredOn: string | null;
|
|
17
|
+
revisionFirstPublishedOn: string | null;
|
|
18
|
+
revisionLastPublishedOn: string | null;
|
|
19
|
+
revisionCreatedBy: CmsIdentity;
|
|
20
|
+
revisionModifiedBy: CmsIdentity | null;
|
|
21
|
+
revisionSavedBy: CmsIdentity;
|
|
22
|
+
revisionDeletedBy: CmsIdentity | null;
|
|
23
|
+
revisionRestoredBy: CmsIdentity | null;
|
|
24
|
+
revisionFirstPublishedBy: CmsIdentity | null;
|
|
25
|
+
revisionLastPublishedBy: CmsIdentity | null;
|
|
26
|
+
/**
|
|
27
|
+
* Entry-level meta fields. 👇
|
|
28
|
+
*/
|
|
29
|
+
createdOn: string;
|
|
30
|
+
modifiedOn: string | null;
|
|
31
|
+
savedOn: string;
|
|
32
|
+
deletedOn: string | null;
|
|
33
|
+
restoredOn: string | null;
|
|
34
|
+
firstPublishedOn: string | null;
|
|
35
|
+
lastPublishedOn: string | null;
|
|
36
|
+
createdBy: CmsIdentity;
|
|
37
|
+
modifiedBy: CmsIdentity | null;
|
|
38
|
+
savedBy: CmsIdentity;
|
|
39
|
+
deletedBy: CmsIdentity | null;
|
|
40
|
+
restoredBy: CmsIdentity | null;
|
|
41
|
+
firstPublishedBy: CmsIdentity | null;
|
|
42
|
+
lastPublishedBy: CmsIdentity | null;
|
|
43
|
+
/**
|
|
44
|
+
* The rest. 👇
|
|
45
|
+
*/
|
|
46
|
+
version: number;
|
|
47
|
+
locked: boolean;
|
|
48
|
+
status: CmsEntryStatus;
|
|
49
|
+
location?: ICmsEntryLocation;
|
|
50
|
+
wbyDeleted?: boolean | null;
|
|
51
|
+
binOriginalFolderId?: string;
|
|
52
|
+
values: GenericRecord;
|
|
53
|
+
meta?: GenericRecord;
|
|
54
|
+
system?: ICmsEntrySystem;
|
|
55
|
+
live: ICmsEntryLive | null;
|
|
56
|
+
revisionDescription: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* A timestamp of when the entry should be automatically deleted from the database.
|
|
59
|
+
*/
|
|
60
|
+
expiresAt: number | null;
|
|
61
|
+
}
|
|
62
|
+
export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
|
|
63
|
+
export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
|
|
64
|
+
export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
|
|
65
|
+
export type IEntryEntity = IEntity<IEntryEntityAttributes>;
|
|
File without changes
|
package/dynamoDb/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => (import("
|
|
1
|
+
declare const _default: () => (import("../index.js").CmsEntryFieldFilterPathPlugin | import("../types.js").CmsFieldFilterValueTransformPlugin)[];
|
|
2
2
|
export default _default;
|
package/dynamoDb/index.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _date = require("./storage/date");
|
|
13
|
-
|
|
14
|
-
var _plainObject = require("./path/plainObject");
|
|
15
|
-
|
|
16
|
-
var _datetime = require("./transformValue/datetime");
|
|
17
|
-
|
|
18
|
-
var _default = () => [(0, _richText.createRichTextStorageTransformPlugin)(), (0, _longText.createLongTextStorageTransformPlugin)(), (0, _date.createDateStorageTransformPlugin)(), (0, _plainObject.createPlainObjectPathPlugin)(), (0, _datetime.createDatetimeTransformValuePlugin)()];
|
|
19
|
-
|
|
20
|
-
exports.default = _default;
|
|
1
|
+
import { createPlainObjectPathPlugin } from "./path/plainObject.js";
|
|
2
|
+
import { createDatetimeTransformValuePlugin } from "./transformValue/datetime.js";
|
|
3
|
+
import { createLocationFolderIdPathPlugin } from "./path/locationFolderId.js";
|
|
4
|
+
const dynamoDb = ()=>[
|
|
5
|
+
createPlainObjectPathPlugin(),
|
|
6
|
+
createLocationFolderIdPathPlugin(),
|
|
7
|
+
createDatetimeTransformValuePlugin()
|
|
8
|
+
];
|
|
9
|
+
export default dynamoDb;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
package/dynamoDb/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"dynamoDb/index.js","sources":["../../src/dynamoDb/index.ts"],"sourcesContent":["import { createPlainObjectPathPlugin } from \"./path/plainObject.js\";\nimport { createDatetimeTransformValuePlugin } from \"./transformValue/datetime.js\";\nimport { createLocationFolderIdPathPlugin } from \"~/dynamoDb/path/locationFolderId.js\";\n\nexport default () => [\n createPlainObjectPathPlugin(),\n createLocationFolderIdPathPlugin(),\n createDatetimeTransformValuePlugin()\n];\n"],"names":["createPlainObjectPathPlugin","createLocationFolderIdPathPlugin","createDatetimeTransformValuePlugin"],"mappings":";;;AAIA,iBAAgB,IAAK;QACjBA;QACAC;QACAC;KACJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
|
|
3
|
+
const createPath = ({ field })=>{
|
|
4
|
+
const { path } = field.settings || {};
|
|
5
|
+
if (!path) throw new error("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
|
|
6
|
+
field
|
|
7
|
+
});
|
|
8
|
+
return path;
|
|
9
|
+
};
|
|
10
|
+
const createLocationFolderIdPathPlugin = ()=>new CmsEntryFieldFilterPathPlugin({
|
|
11
|
+
fieldType: "text",
|
|
12
|
+
path: createPath,
|
|
13
|
+
canUse: (field, parents)=>{
|
|
14
|
+
if ("folderId" !== field.fieldId) return false;
|
|
15
|
+
if (!parents?.length) return false;
|
|
16
|
+
return "wbyAco_location" === parents[0];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export { createLocationFolderIdPathPlugin };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=locationFolderId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamoDb/path/locationFolderId.js","sources":["../../../src/dynamoDb/path/locationFolderId.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport type { CreatePathCallable } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\nimport { CmsEntryFieldFilterPathPlugin } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\n\nconst createPath: CreatePathCallable = ({ field }) => {\n const { path } = field.settings || {};\n if (!path) {\n throw new WebinyError(\"Missing path settings value.\", \"FIELD_SETTINGS_ERROR\", {\n field\n });\n }\n return path;\n};\n\nexport const createLocationFolderIdPathPlugin = (): CmsEntryFieldFilterPathPlugin => {\n return new CmsEntryFieldFilterPathPlugin({\n fieldType: \"text\",\n path: createPath,\n canUse: (field, parents) => {\n if (field.fieldId !== \"folderId\") {\n return false;\n } else if (!parents?.length) {\n return false;\n }\n return parents[0] === \"wbyAco_location\";\n }\n });\n};\n"],"names":["createPath","field","path","WebinyError","createLocationFolderIdPathPlugin","CmsEntryFieldFilterPathPlugin","parents"],"mappings":";;AAOA,MAAMA,aAAiC,CAAC,EAAEC,KAAK,EAAE;IAC7C,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,QAAQ,IAAI,CAAC;IACpC,IAAI,CAACC,MACD,MAAM,IAAIC,MAAY,gCAAgC,wBAAwB;QAC1EF;IACJ;IAEJ,OAAOC;AACX;AAEO,MAAME,mCAAmC,IACrC,IAAIC,8BAA8B;QACrC,WAAW;QACX,MAAML;QACN,QAAQ,CAACC,OAAOK;YACZ,IAAIL,AAAkB,eAAlBA,MAAM,OAAO,EACb,OAAO;YACJ,IAAI,CAACK,SAAS,QACjB,OAAO;YAEX,OAAOA,AAAe,sBAAfA,OAAO,CAAC,EAAE;QACrB;IACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin";
|
|
1
|
+
import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
|
|
2
2
|
export declare const createPlainObjectPathPlugin: () => CmsEntryFieldFilterPathPlugin;
|