@webiny/api-headless-cms-ddb 0.0.0-unstable.b14eaecf38 → 0.0.0-unstable.b6d7105cee
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 +10 -93
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +4 -5
- package/definitions/group.js +10 -64
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +4 -5
- package/definitions/model.js +10 -108
- package/definitions/model.js.map +1 -1
- package/definitions/table.d.ts +4 -6
- package/definitions/table.js +7 -26
- 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 +8 -12
- package/dynamoDb/index.js.map +1 -1
- package/index.d.ts +2 -3
- package/index.js +87 -128
- 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 +84 -272
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/index.d.ts +5 -4
- package/operations/entry/index.js +899 -807
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +46 -2
- package/operations/entry/keys.js +54 -49
- package/operations/entry/keys.js.map +1 -1
- package/operations/group/index.d.ts +4 -5
- package/operations/group/index.js +117 -158
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +3 -3
- package/operations/model/index.js +103 -134
- package/operations/model/index.js.map +1 -1
- package/package.json +32 -33
- package/plugins/index.d.ts +2 -4
- package/plugins/index.js +1 -49
- package/types.d.ts +25 -41
- package/types.js +8 -14
- package/types.js.map +1 -1
- package/definitions/settings.d.ts +0 -9
- package/definitions/settings.js +0 -53
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -9
- package/definitions/system.js +0 -41
- package/definitions/system.js.map +0 -1
- package/dynamoDb/path/plainObject.d.ts +0 -2
- package/dynamoDb/path/plainObject.js +0 -33
- package/dynamoDb/path/plainObject.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -91
- package/dynamoDb/storage/date.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -91
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -2
- package/dynamoDb/storage/richText.js +0 -95
- package/dynamoDb/storage/richText.js.map +0 -1
- package/dynamoDb/transformValue/datetime.d.ts +0 -5
- package/dynamoDb/transformValue/datetime.js +0 -45
- package/dynamoDb/transformValue/datetime.js.map +0 -1
- package/operations/entry/filtering/createExpressions.d.ts +0 -26
- package/operations/entry/filtering/createExpressions.js +0 -176
- package/operations/entry/filtering/createExpressions.js.map +0 -1
- package/operations/entry/filtering/createFields.d.ts +0 -14
- package/operations/entry/filtering/createFields.js +0 -105
- package/operations/entry/filtering/createFields.js.map +0 -1
- package/operations/entry/filtering/extractSort.d.ts +0 -17
- package/operations/entry/filtering/extractSort.js +0 -67
- package/operations/entry/filtering/extractSort.js.map +0 -1
- package/operations/entry/filtering/filter.d.ts +0 -15
- package/operations/entry/filtering/filter.js +0 -143
- package/operations/entry/filtering/filter.js.map +0 -1
- package/operations/entry/filtering/fullTextSearch.d.ts +0 -14
- package/operations/entry/filtering/fullTextSearch.js +0 -48
- package/operations/entry/filtering/fullTextSearch.js.map +0 -1
- package/operations/entry/filtering/getValue.d.ts +0 -5
- package/operations/entry/filtering/getValue.js +0 -63
- package/operations/entry/filtering/getValue.js.map +0 -1
- package/operations/entry/filtering/index.d.ts +0 -2
- package/operations/entry/filtering/index.js +0 -19
- package/operations/entry/filtering/index.js.map +0 -1
- package/operations/entry/filtering/mapPlugins.d.ts +0 -8
- package/operations/entry/filtering/mapPlugins.js +0 -31
- package/operations/entry/filtering/mapPlugins.js.map +0 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +0 -2
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +0 -41
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +0 -1
- package/operations/entry/filtering/plugins/index.d.ts +0 -1
- package/operations/entry/filtering/plugins/index.js +0 -13
- package/operations/entry/filtering/plugins/index.js.map +0 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +0 -2
- package/operations/entry/filtering/plugins/objectFilterCreate.js +0 -86
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +0 -1
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +0 -2
- package/operations/entry/filtering/plugins/refFilterCreate.js +0 -71
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +0 -1
- package/operations/entry/filtering/sort.d.ts +0 -12
- package/operations/entry/filtering/sort.js +0 -69
- package/operations/entry/filtering/sort.js.map +0 -1
- package/operations/entry/filtering/systemFields.d.ts +0 -4
- package/operations/entry/filtering/systemFields.js +0 -70
- package/operations/entry/filtering/systemFields.js.map +0 -1
- package/operations/entry/filtering/transform.d.ts +0 -6
- package/operations/entry/filtering/transform.js +0 -16
- package/operations/entry/filtering/transform.js.map +0 -1
- package/operations/entry/filtering/types.d.ts +0 -40
- package/operations/entry/filtering/types.js +0 -5
- package/operations/entry/filtering/types.js.map +0 -1
- package/operations/entry/filtering/values.d.ts +0 -2
- package/operations/entry/filtering/values.js +0 -22
- package/operations/entry/filtering/values.js.map +0 -1
- package/operations/entry/filtering/where.d.ts +0 -5
- package/operations/entry/filtering/where.js +0 -32
- package/operations/entry/filtering/where.js.map +0 -1
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -72
- package/operations/entry/systemFields.js.map +0 -1
- package/operations/settings/index.d.ts +0 -7
- package/operations/settings/index.js +0 -111
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -7
- package/operations/system/index.js +0 -82
- package/operations/system/index.js.map +0 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +0 -22
- package/plugins/CmsEntryFieldFilterPathPlugin.js +0 -41
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +0 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +0 -43
- package/plugins/CmsEntryFieldFilterPlugin.js +0 -24
- package/plugins/CmsEntryFieldFilterPlugin.js.map +0 -1
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +0 -42
- package/plugins/CmsEntryFieldSortingPlugin.js +0 -28
- package/plugins/CmsEntryFieldSortingPlugin.js.map +0 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +0 -11
- package/plugins/CmsFieldFilterValueTransformPlugin.js +0 -24
- package/plugins/CmsFieldFilterValueTransformPlugin.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,94 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
-
const createEntryEntity = params => {
|
|
11
|
-
const {
|
|
12
|
-
table,
|
|
13
|
-
entityName,
|
|
14
|
-
attributes
|
|
15
|
-
} = params;
|
|
16
|
-
return new _dynamodbToolbox.Entity({
|
|
17
|
-
name: entityName,
|
|
18
|
-
table,
|
|
19
|
-
attributes: (0, _objectSpread2.default)({
|
|
20
|
-
PK: {
|
|
21
|
-
type: "string",
|
|
22
|
-
partitionKey: true
|
|
23
|
-
},
|
|
24
|
-
SK: {
|
|
25
|
-
type: "string",
|
|
26
|
-
sortKey: true
|
|
27
|
-
},
|
|
28
|
-
GSI1_PK: {
|
|
29
|
-
type: "string"
|
|
30
|
-
},
|
|
31
|
-
GSI1_SK: {
|
|
32
|
-
type: "string"
|
|
33
|
-
},
|
|
34
|
-
TYPE: {
|
|
35
|
-
type: "string"
|
|
36
|
-
},
|
|
37
|
-
__type: {
|
|
38
|
-
type: "string"
|
|
39
|
-
},
|
|
40
|
-
webinyVersion: {
|
|
41
|
-
type: "string"
|
|
42
|
-
},
|
|
43
|
-
tenant: {
|
|
44
|
-
type: "string"
|
|
45
|
-
},
|
|
46
|
-
entryId: {
|
|
47
|
-
type: "string"
|
|
48
|
-
},
|
|
49
|
-
id: {
|
|
50
|
-
type: "string"
|
|
51
|
-
},
|
|
52
|
-
createdBy: {
|
|
53
|
-
type: "map"
|
|
54
|
-
},
|
|
55
|
-
ownedBy: {
|
|
56
|
-
type: "map"
|
|
57
|
-
},
|
|
58
|
-
modifiedBy: {
|
|
59
|
-
type: "map"
|
|
60
|
-
},
|
|
61
|
-
createdOn: {
|
|
62
|
-
type: "string"
|
|
63
|
-
},
|
|
64
|
-
savedOn: {
|
|
65
|
-
type: "string"
|
|
66
|
-
},
|
|
67
|
-
modelId: {
|
|
68
|
-
type: "string"
|
|
69
|
-
},
|
|
70
|
-
locale: {
|
|
71
|
-
type: "string"
|
|
72
|
-
},
|
|
73
|
-
publishedOn: {
|
|
74
|
-
type: "string"
|
|
75
|
-
},
|
|
76
|
-
version: {
|
|
77
|
-
type: "number"
|
|
78
|
-
},
|
|
79
|
-
locked: {
|
|
80
|
-
type: "boolean"
|
|
81
|
-
},
|
|
82
|
-
status: {
|
|
83
|
-
type: "string"
|
|
84
|
-
},
|
|
85
|
-
values: {
|
|
86
|
-
type: "map"
|
|
87
|
-
},
|
|
88
|
-
meta: {
|
|
89
|
-
type: "map"
|
|
90
|
-
}
|
|
91
|
-
}, attributes || {})
|
|
92
|
-
});
|
|
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
|
+
});
|
|
93
8
|
};
|
|
94
|
-
|
|
9
|
+
export { createEntryEntity };
|
|
10
|
+
|
|
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,65 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
-
const createGroupEntity = params => {
|
|
11
|
-
const {
|
|
12
|
-
table,
|
|
13
|
-
attributes,
|
|
14
|
-
entityName
|
|
15
|
-
} = params;
|
|
16
|
-
return new _dynamodbToolbox.Entity({
|
|
17
|
-
name: entityName,
|
|
18
|
-
table,
|
|
19
|
-
attributes: (0, _objectSpread2.default)({
|
|
20
|
-
PK: {
|
|
21
|
-
partitionKey: true
|
|
22
|
-
},
|
|
23
|
-
SK: {
|
|
24
|
-
sortKey: true
|
|
25
|
-
},
|
|
26
|
-
TYPE: {
|
|
27
|
-
type: "string"
|
|
28
|
-
},
|
|
29
|
-
webinyVersion: {
|
|
30
|
-
type: "string"
|
|
31
|
-
},
|
|
32
|
-
id: {
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
name: {
|
|
36
|
-
type: "string"
|
|
37
|
-
},
|
|
38
|
-
slug: {
|
|
39
|
-
type: "string"
|
|
40
|
-
},
|
|
41
|
-
locale: {
|
|
42
|
-
type: "string"
|
|
43
|
-
},
|
|
44
|
-
description: {
|
|
45
|
-
type: "string"
|
|
46
|
-
},
|
|
47
|
-
icon: {
|
|
48
|
-
type: "string"
|
|
49
|
-
},
|
|
50
|
-
createdBy: {
|
|
51
|
-
type: "map"
|
|
52
|
-
},
|
|
53
|
-
createdOn: {
|
|
54
|
-
type: "string"
|
|
55
|
-
},
|
|
56
|
-
savedOn: {
|
|
57
|
-
type: "string"
|
|
58
|
-
},
|
|
59
|
-
tenant: {
|
|
60
|
-
type: "string"
|
|
61
|
-
}
|
|
62
|
-
}, attributes || {})
|
|
63
|
-
});
|
|
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
|
+
});
|
|
64
8
|
};
|
|
65
|
-
|
|
9
|
+
export { createGroupEntity };
|
|
10
|
+
|
|
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,109 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
-
const createModelEntity = params => {
|
|
11
|
-
const {
|
|
12
|
-
table,
|
|
13
|
-
attributes,
|
|
14
|
-
entityName
|
|
15
|
-
} = params;
|
|
16
|
-
return new _dynamodbToolbox.Entity({
|
|
17
|
-
name: entityName,
|
|
18
|
-
table,
|
|
19
|
-
attributes: (0, _objectSpread2.default)({
|
|
20
|
-
PK: {
|
|
21
|
-
partitionKey: true
|
|
22
|
-
},
|
|
23
|
-
SK: {
|
|
24
|
-
sortKey: true
|
|
25
|
-
},
|
|
26
|
-
TYPE: {
|
|
27
|
-
type: "string",
|
|
28
|
-
required: true
|
|
29
|
-
},
|
|
30
|
-
webinyVersion: {
|
|
31
|
-
type: "string",
|
|
32
|
-
required: true
|
|
33
|
-
},
|
|
34
|
-
name: {
|
|
35
|
-
type: "string",
|
|
36
|
-
required: true
|
|
37
|
-
},
|
|
38
|
-
modelId: {
|
|
39
|
-
type: "string",
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
42
|
-
singularApiName: {
|
|
43
|
-
type: "string",
|
|
44
|
-
required: true
|
|
45
|
-
},
|
|
46
|
-
pluralApiName: {
|
|
47
|
-
type: "string",
|
|
48
|
-
required: true
|
|
49
|
-
},
|
|
50
|
-
locale: {
|
|
51
|
-
type: "string",
|
|
52
|
-
required: true
|
|
53
|
-
},
|
|
54
|
-
group: {
|
|
55
|
-
type: "map",
|
|
56
|
-
required: true
|
|
57
|
-
},
|
|
58
|
-
icon: {
|
|
59
|
-
type: "string"
|
|
60
|
-
},
|
|
61
|
-
description: {
|
|
62
|
-
type: "string"
|
|
63
|
-
},
|
|
64
|
-
createdOn: {
|
|
65
|
-
type: "string",
|
|
66
|
-
required: true
|
|
67
|
-
},
|
|
68
|
-
savedOn: {
|
|
69
|
-
type: "string",
|
|
70
|
-
required: true
|
|
71
|
-
},
|
|
72
|
-
createdBy: {
|
|
73
|
-
type: "map",
|
|
74
|
-
required: true
|
|
75
|
-
},
|
|
76
|
-
fields: {
|
|
77
|
-
type: "list",
|
|
78
|
-
required: true
|
|
79
|
-
},
|
|
80
|
-
layout: {
|
|
81
|
-
type: "list",
|
|
82
|
-
required: true
|
|
83
|
-
},
|
|
84
|
-
tags: {
|
|
85
|
-
type: "list",
|
|
86
|
-
required: false,
|
|
87
|
-
default: []
|
|
88
|
-
},
|
|
89
|
-
lockedFields: {
|
|
90
|
-
type: "list",
|
|
91
|
-
required: true
|
|
92
|
-
},
|
|
93
|
-
titleFieldId: {
|
|
94
|
-
type: "string"
|
|
95
|
-
},
|
|
96
|
-
descriptionFieldId: {
|
|
97
|
-
type: "string"
|
|
98
|
-
},
|
|
99
|
-
imageFieldId: {
|
|
100
|
-
type: "string"
|
|
101
|
-
},
|
|
102
|
-
tenant: {
|
|
103
|
-
type: "string",
|
|
104
|
-
required: true
|
|
105
|
-
}
|
|
106
|
-
}, attributes || {})
|
|
107
|
-
});
|
|
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
|
+
});
|
|
108
8
|
};
|
|
109
|
-
|
|
9
|
+
export { createModelEntity };
|
|
10
|
+
|
|
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,27 +1,8 @@
|
|
|
1
|
-
|
|
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 };
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTable = void 0;
|
|
7
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
8
|
-
const createTable = ({
|
|
9
|
-
table,
|
|
10
|
-
documentClient
|
|
11
|
-
}) => {
|
|
12
|
-
const tableConfig = {
|
|
13
|
-
name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
|
|
14
|
-
partitionKey: "PK",
|
|
15
|
-
sortKey: "SK",
|
|
16
|
-
DocumentClient: documentClient,
|
|
17
|
-
indexes: {
|
|
18
|
-
GSI1: {
|
|
19
|
-
partitionKey: "GSI1_PK",
|
|
20
|
-
sortKey: "GSI1_SK"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
25
|
-
return new _dynamodbToolbox.Table(config);
|
|
26
|
-
};
|
|
27
|
-
exports.createTable = createTable;
|
|
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("@webiny/api-headless-cms").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField> | import("..").CmsEntryFieldFilterPathPlugin | import("../types").CmsFieldFilterValueTransformPlugin)[];
|
|
2
1
|
export default _default;
|
|
2
|
+
declare function _default(): (import("@webiny/api-headless-cms-storage").CmsEntryFieldFilterPathPlugin | import("@webiny/api-headless-cms-storage").CmsFieldFilterValueTransformPlugin)[];
|
package/dynamoDb/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { createDatetimeTransformValuePlugin, createLocationFolderIdPathPlugin, createPlainObjectPathPlugin } from "@webiny/api-headless-cms-storage";
|
|
2
|
+
const dynamoDb = ()=>[
|
|
3
|
+
createPlainObjectPathPlugin(),
|
|
4
|
+
createLocationFolderIdPathPlugin(),
|
|
5
|
+
createDatetimeTransformValuePlugin()
|
|
6
|
+
];
|
|
7
|
+
export default dynamoDb;
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _richText = require("./storage/richText");
|
|
8
|
-
var _longText = require("./storage/longText");
|
|
9
|
-
var _date = require("./storage/date");
|
|
10
|
-
var _plainObject = require("./path/plainObject");
|
|
11
|
-
var _datetime = require("./transformValue/datetime");
|
|
12
|
-
var _default = () => [(0, _richText.createRichTextStorageTransformPlugin)(), (0, _longText.createLongTextStorageTransformPlugin)(), (0, _date.createDateStorageTransformPlugin)(), (0, _plainObject.createPlainObjectPathPlugin)(), (0, _datetime.createDatetimeTransformValuePlugin)()];
|
|
13
|
-
exports.default = _default;
|
|
9
|
+
//# 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 \"@webiny/api-headless-cms-storage\";\nimport { createLocationFolderIdPathPlugin } from \"@webiny/api-headless-cms-storage\";\nimport { createDatetimeTransformValuePlugin } from \"@webiny/api-headless-cms-storage\";\n\nexport default () => [\n createPlainObjectPathPlugin(),\n createLocationFolderIdPathPlugin(),\n createDatetimeTransformValuePlugin()\n];\n"],"names":["createPlainObjectPathPlugin","createLocationFolderIdPathPlugin","createDatetimeTransformValuePlugin"],"mappings":";AAIA,iBAAgB,IAAK;QACjBA;QACAC;QACAC;KACJ"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const createStorageOperations: StorageOperationsFactory;
|
|
1
|
+
export * from "./plugins/index.js";
|
|
2
|
+
export declare const registerDynamoDbStorageOperations: () => import("@webiny/handler").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>[];
|