@webiny/api-headless-cms-ddb 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e
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/definitions/entry.d.ts +2 -1
- package/definitions/entry.js +6 -12
- package/definitions/entry.js.map +1 -0
- package/definitions/group.d.ts +2 -1
- package/definitions/group.js +3 -12
- package/definitions/group.js.map +1 -0
- package/definitions/model.d.ts +2 -1
- package/definitions/model.js +8 -12
- package/definitions/model.js.map +1 -0
- package/definitions/settings.d.ts +2 -1
- package/definitions/settings.js +3 -12
- package/definitions/settings.js.map +1 -0
- package/definitions/system.d.ts +2 -1
- package/definitions/system.js +3 -12
- package/definitions/system.js.map +1 -0
- package/definitions/table.d.ts +2 -1
- package/definitions/table.js +0 -3
- package/definitions/table.js.map +1 -0
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +6 -17
- package/dynamoDb/index.js.map +1 -0
- package/dynamoDb/path/plainObject.d.ts +2 -3
- package/dynamoDb/path/plainObject.js +25 -25
- package/dynamoDb/path/plainObject.js.map +1 -0
- package/dynamoDb/storage/date.d.ts +3 -3
- package/dynamoDb/storage/date.js +80 -54
- package/dynamoDb/storage/date.js.map +1 -0
- package/dynamoDb/storage/longText.d.ts +7 -4
- package/dynamoDb/storage/longText.js +72 -64
- package/dynamoDb/storage/longText.js.map +1 -0
- package/dynamoDb/storage/richText.d.ts +2 -8
- package/dynamoDb/storage/richText.js +62 -77
- package/dynamoDb/storage/richText.js.map +1 -0
- package/dynamoDb/transformValue/datetime.d.ts +4 -2
- package/dynamoDb/transformValue/datetime.js +28 -30
- package/dynamoDb/transformValue/datetime.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +50 -41
- package/index.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +12 -8
- package/operations/entry/dataLoaders.js +27 -52
- package/operations/entry/dataLoaders.js.map +1 -0
- package/operations/entry/filtering/createExpressions.d.ts +26 -0
- package/operations/entry/filtering/createExpressions.js +176 -0
- package/operations/entry/filtering/createExpressions.js.map +1 -0
- package/operations/entry/filtering/createFields.d.ts +14 -0
- package/operations/entry/filtering/createFields.js +105 -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 +67 -0
- package/operations/entry/filtering/extractSort.js.map +1 -0
- package/operations/entry/filtering/filter.d.ts +15 -0
- package/operations/entry/filtering/filter.js +143 -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 +48 -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 +63 -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 +19 -0
- package/operations/entry/filtering/index.js.map +1 -0
- package/operations/entry/filtering/mapPlugins.d.ts +8 -0
- package/operations/entry/filtering/mapPlugins.js +31 -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 +41 -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 +86 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/refFilterCreate.js +71 -0
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
- package/operations/entry/filtering/sort.d.ts +12 -0
- package/operations/entry/filtering/sort.js +69 -0
- package/operations/entry/filtering/sort.js.map +1 -0
- package/operations/entry/filtering/systemFields.d.ts +4 -0
- package/operations/entry/filtering/systemFields.js +70 -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 +16 -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 +5 -0
- package/operations/entry/filtering/types.js.map +1 -0
- package/operations/entry/filtering/values.d.ts +2 -0
- package/operations/entry/filtering/values.js +22 -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 +32 -0
- package/operations/entry/filtering/where.js.map +1 -0
- package/operations/entry/index.d.ts +2 -2
- package/operations/entry/index.js +273 -309
- package/operations/entry/index.js.map +1 -0
- package/operations/entry/keys.js +7 -14
- package/operations/entry/keys.js.map +1 -0
- package/operations/entry/systemFields.js +24 -2
- package/operations/entry/systemFields.js.map +1 -0
- package/operations/group/index.d.ts +3 -2
- package/operations/group/index.js +9 -45
- package/operations/group/index.js.map +1 -0
- package/operations/model/index.d.ts +3 -2
- package/operations/model/index.js +13 -37
- package/operations/model/index.js.map +1 -0
- package/operations/settings/index.d.ts +3 -2
- package/operations/settings/index.js +7 -37
- package/operations/settings/index.js.map +1 -0
- package/operations/system/index.d.ts +3 -2
- package/operations/system/index.js +5 -28
- package/operations/system/index.js.map +1 -0
- package/package.json +22 -23
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +22 -0
- package/plugins/CmsEntryFieldFilterPathPlugin.js +41 -0
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -0
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
- package/plugins/CmsEntryFieldFilterPlugin.js +24 -0
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
- package/plugins/CmsEntryFieldSortingPlugin.js +28 -0
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
- package/plugins/index.d.ts +3 -0
- package/plugins/index.js +38 -0
- package/plugins/index.js.map +1 -0
- package/types.d.ts +2 -33
- package/types.js +0 -1
- package/types.js.map +1 -0
- package/dynamoDb/path/ref.d.ts +0 -3
- package/dynamoDb/path/ref.js +0 -27
- package/operations/entry/utils.d.ts +0 -31
- package/operations/entry/utils.js +0 -406
package/definitions/entry.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
|
|
3
|
+
interface Params {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
8
|
export declare const createEntryEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
package/definitions/entry.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createEntryEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
10
|
const createEntryEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
table,
|
|
@@ -24,7 +16,7 @@ const createEntryEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
type: "string",
|
|
30
22
|
partitionKey: true
|
|
@@ -89,9 +81,11 @@ const createEntryEntity = params => {
|
|
|
89
81
|
},
|
|
90
82
|
values: {
|
|
91
83
|
type: "map"
|
|
84
|
+
},
|
|
85
|
+
meta: {
|
|
86
|
+
type: "map"
|
|
92
87
|
}
|
|
93
88
|
}, attributes || {})
|
|
94
89
|
});
|
|
95
90
|
};
|
|
96
|
-
|
|
97
91
|
exports.createEntryEntity = createEntryEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","GSI1_PK","GSI1_SK","TYPE","__type","webinyVersion","tenant","entryId","id","createdBy","ownedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","values","meta"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: Params): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n publishedOn: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AAQO,MAAMA,iBAAiB,GAAIC,MAAc,IAAkB;EAC9D,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU;MACNG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLJ,IAAI,EAAE;MACV,CAAC;MACDK,OAAO,EAAE;QACLL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV,CAAC;MACDQ,aAAa,EAAE;QACXR,IAAI,EAAE;MACV,CAAC;MACDS,MAAM,EAAE;QACJT,IAAI,EAAE;MACV,CAAC;MACDU,OAAO,EAAE;QACLV,IAAI,EAAE;MACV,CAAC;MACDW,EAAE,EAAE;QACAX,IAAI,EAAE;MACV,CAAC;MACDY,SAAS,EAAE;QACPZ,IAAI,EAAE;MACV,CAAC;MACDa,OAAO,EAAE;QACLb,IAAI,EAAE;MACV,CAAC;MACDc,SAAS,EAAE;QACPd,IAAI,EAAE;MACV,CAAC;MACDe,OAAO,EAAE;QACLf,IAAI,EAAE;MACV,CAAC;MACDgB,OAAO,EAAE;QACLhB,IAAI,EAAE;MACV,CAAC;MACDiB,MAAM,EAAE;QACJjB,IAAI,EAAE;MACV,CAAC;MACDkB,WAAW,EAAE;QACTlB,IAAI,EAAE;MACV,CAAC;MACDmB,OAAO,EAAE;QACLnB,IAAI,EAAE;MACV,CAAC;MACDoB,MAAM,EAAE;QACJpB,IAAI,EAAE;MACV,CAAC;MACDqB,MAAM,EAAE;QACJrB,IAAI,EAAE;MACV,CAAC;MACDsB,MAAM,EAAE;QACJtB,IAAI,EAAE;MACV,CAAC;MACDuB,IAAI,EAAE;QACFvB,IAAI,EAAE;MACV;IAAC,GACGJ,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/definitions/group.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
|
|
3
|
+
interface Params {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
8
|
export declare const createGroupEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
package/definitions/group.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createGroupEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
10
|
const createGroupEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
table,
|
|
@@ -24,7 +16,7 @@ const createGroupEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
partitionKey: true
|
|
30
22
|
},
|
|
@@ -70,5 +62,4 @@ const createGroupEntity = params => {
|
|
|
70
62
|
}, attributes || {})
|
|
71
63
|
});
|
|
72
64
|
};
|
|
73
|
-
|
|
74
65
|
exports.createGroupEntity = createGroupEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: Params): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AAQO,MAAMA,iBAAiB,GAAIC,MAAc,IAAkB;EAC9D,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,aAAa,EAAE;QACXD,IAAI,EAAE;MACV,CAAC;MACDE,EAAE,EAAE;QACAF,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,WAAW,EAAE;QACTL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MAEDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDS,OAAO,EAAE;QACLT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/definitions/model.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
|
|
3
|
+
interface Params {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
8
|
export declare const createModelEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
package/definitions/model.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createModelEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
10
|
const createModelEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
table,
|
|
@@ -24,7 +16,7 @@ const createModelEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
partitionKey: true
|
|
30
22
|
},
|
|
@@ -78,6 +70,11 @@ const createModelEntity = params => {
|
|
|
78
70
|
type: "list",
|
|
79
71
|
required: true
|
|
80
72
|
},
|
|
73
|
+
tags: {
|
|
74
|
+
type: "list",
|
|
75
|
+
required: false,
|
|
76
|
+
default: []
|
|
77
|
+
},
|
|
81
78
|
lockedFields: {
|
|
82
79
|
type: "list",
|
|
83
80
|
required: true
|
|
@@ -92,5 +89,4 @@ const createModelEntity = params => {
|
|
|
92
89
|
}, attributes || {})
|
|
93
90
|
});
|
|
94
91
|
};
|
|
95
|
-
|
|
96
92
|
exports.createModelEntity = createModelEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","locale","group","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","tenant"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: Params): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n tags: {\n type: \"list\",\n required: false,\n default: []\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,iBAAiB,GAAIC,MAAc,IAAkB;EAC9D,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDC,aAAa,EAAE;QACXF,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDP,IAAI,EAAE;QACFM,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDE,OAAO,EAAE;QACLH,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDG,MAAM,EAAE;QACJJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,KAAK,EAAE;QACHL,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDK,WAAW,EAAE;QACTN,IAAI,EAAE;MACV,CAAC;MACDO,SAAS,EAAE;QACPP,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDO,OAAO,EAAE;QACLR,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDQ,SAAS,EAAE;QACPT,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDS,MAAM,EAAE;QACJV,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDU,MAAM,EAAE;QACJX,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDW,IAAI,EAAE;QACFZ,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,KAAK;QACfY,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVd,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDc,YAAY,EAAE;QACVf,IAAI,EAAE;MACV,CAAC;MACDgB,MAAM,EAAE;QACJhB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd;IAAC,GACGV,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
|
|
3
|
+
interface Params {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
8
|
export declare const createSettingsEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
package/definitions/settings.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createSettingsEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
10
|
const createSettingsEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
entityName,
|
|
@@ -24,7 +16,7 @@ const createSettingsEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
partitionKey: true
|
|
30
22
|
},
|
|
@@ -58,5 +50,4 @@ const createSettingsEntity = params => {
|
|
|
58
50
|
}, attributes || {})
|
|
59
51
|
});
|
|
60
52
|
};
|
|
61
|
-
|
|
62
53
|
exports.createSettingsEntity = createSettingsEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSettingsEntity","params","entityName","table","attributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","key","uploadMinFileSize","uploadMaxFileSize","srcPrefix","contentModelLastChange","tenant","locale"],"sources":["settings.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSettingsEntity = (params: Params): Entity<any> => {\n const { entityName, table, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n key: {\n type: \"string\"\n },\n uploadMinFileSize: {\n type: \"number\"\n },\n uploadMaxFileSize: {\n type: \"number\"\n },\n srcPrefix: {\n type: \"string\"\n },\n contentModelLastChange: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,oBAAoB,GAAIC,MAAc,IAAkB;EACjE,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBC,KAAK;IACLC,UAAU;MACNG,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,GAAG,EAAE;QACDD,IAAI,EAAE;MACV,CAAC;MACDE,iBAAiB,EAAE;QACfF,IAAI,EAAE;MACV,CAAC;MACDG,iBAAiB,EAAE;QACfH,IAAI,EAAE;MACV,CAAC;MACDI,SAAS,EAAE;QACPJ,IAAI,EAAE;MACV,CAAC;MACDK,sBAAsB,EAAE;QACpBL,IAAI,EAAE;MACV,CAAC;MACDM,MAAM,EAAE;QACJN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV;IAAC,GACGR,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/definitions/system.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
|
-
|
|
3
|
+
interface Params {
|
|
4
4
|
table: Table;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
8
|
export declare const createSystemEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
package/definitions/system.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createSystemEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
10
|
const createSystemEntity = params => {
|
|
19
11
|
const {
|
|
20
12
|
entityName,
|
|
@@ -24,7 +16,7 @@ const createSystemEntity = params => {
|
|
|
24
16
|
return new _dynamodbToolbox.Entity({
|
|
25
17
|
name: entityName,
|
|
26
18
|
table,
|
|
27
|
-
attributes:
|
|
19
|
+
attributes: (0, _objectSpread2.default)({
|
|
28
20
|
PK: {
|
|
29
21
|
partitionKey: true
|
|
30
22
|
},
|
|
@@ -46,5 +38,4 @@ const createSystemEntity = params => {
|
|
|
46
38
|
}, attributes || {})
|
|
47
39
|
});
|
|
48
40
|
};
|
|
49
|
-
|
|
50
41
|
exports.createSystemEntity = createSystemEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\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 locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AASO,MAAMA,kBAAkB,GAAIC,MAAc,IAAkB;EAC/D,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV;IAAC,GACGT,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TableModifier } from "../types";
|
|
2
2
|
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
3
3
|
import { Table } from "dynamodb-toolbox";
|
|
4
|
-
|
|
4
|
+
interface Params {
|
|
5
5
|
table?: TableModifier;
|
|
6
6
|
documentClient: DocumentClient;
|
|
7
7
|
}
|
|
8
8
|
export declare const createTable: ({ table, documentClient }: Params) => Table;
|
|
9
|
+
export {};
|
package/definitions/table.js
CHANGED
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createTable = void 0;
|
|
7
|
-
|
|
8
7
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
9
|
-
|
|
10
8
|
const createTable = ({
|
|
11
9
|
table,
|
|
12
10
|
documentClient
|
|
@@ -26,5 +24,4 @@ const createTable = ({
|
|
|
26
24
|
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
27
25
|
return new _dynamodbToolbox.Table(config);
|
|
28
26
|
};
|
|
29
|
-
|
|
30
27
|
exports.createTable = createTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1","config","Table"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\ninterface Params {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\nexport const createTable = ({ table, documentClient }: Params): Table => {\n const tableConfig: TableConstructor = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n }\n }\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA;AAOO,MAAMA,WAAW,GAAG,CAAC;EAAEC,KAAK;EAAEC;AAAuB,CAAC,KAAY;EACrE,MAAMC,WAA6B,GAAG;IAClCC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC3EC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb;IACJ;EACJ,CAAC;EAED,MAAMI,MAAM,GAAG,OAAOb,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIY,sBAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAAC"}
|
package/dynamoDb/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => (import("@webiny/api-headless-cms").StorageTransformPlugin<any, any> | import("
|
|
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
2
|
export default _default;
|
package/dynamoDb/index.js
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
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
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _plainObject = _interopRequireDefault(require("./path/plainObject"));
|
|
17
|
-
|
|
18
|
-
var _ref = _interopRequireDefault(require("./path/ref"));
|
|
19
|
-
|
|
20
|
-
var _datetime = _interopRequireDefault(require("./transformValue/datetime"));
|
|
21
|
-
|
|
22
|
-
var _default = () => [(0, _richText.default)(), (0, _longText.default)(), (0, _date.default)(), (0, _plainObject.default)(), (0, _ref.default)(), (0, _datetime.default)()];
|
|
23
|
-
|
|
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)()];
|
|
24
13
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin","createPlainObjectPathPlugin","createDatetimeTransformValuePlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\nimport { createPlainObjectPathPlugin } from \"./path/plainObject\";\nimport { createDatetimeTransformValuePlugin } from \"./transformValue/datetime\";\n\nexport default () => [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createDateStorageTransformPlugin(),\n createPlainObjectPathPlugin(),\n createDatetimeTransformValuePlugin()\n];\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAA+E,eAEhE,MAAM,CACjB,IAAAA,8CAAoC,GAAE,EACtC,IAAAC,8CAAoC,GAAE,EACtC,IAAAC,sCAAgC,GAAE,EAClC,IAAAC,wCAA2B,GAAE,EAC7B,IAAAC,4CAAkC,GAAE,CACvC;AAAA"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
export default _default;
|
|
1
|
+
import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin";
|
|
2
|
+
export declare const createPlainObjectPathPlugin: () => CmsEntryFieldFilterPathPlugin;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
7
|
+
exports.createPlainObjectPathPlugin = void 0;
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
var _CmsEntryFieldFilterPathPlugin = require("../../plugins/CmsEntryFieldFilterPathPlugin");
|
|
10
|
+
/**
|
|
11
|
+
* File is @internal
|
|
12
|
+
*/
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!path) {
|
|
24
|
-
throw new _error.default("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
|
|
25
|
-
field
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return path;
|
|
14
|
+
const createPath = ({
|
|
15
|
+
field
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
path
|
|
19
|
+
} = field.settings || {};
|
|
20
|
+
if (!path) {
|
|
21
|
+
throw new _error.default("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
|
|
22
|
+
field
|
|
23
|
+
});
|
|
30
24
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
return path;
|
|
26
|
+
};
|
|
27
|
+
const createPlainObjectPathPlugin = () => {
|
|
28
|
+
return new _CmsEntryFieldFilterPathPlugin.CmsEntryFieldFilterPathPlugin({
|
|
29
|
+
fieldType: "plainObject",
|
|
30
|
+
path: createPath
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.createPlainObjectPathPlugin = createPlainObjectPathPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPath","field","path","settings","WebinyError","createPlainObjectPathPlugin","CmsEntryFieldFilterPathPlugin","fieldType"],"sources":["plainObject.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport {\n CmsEntryFieldFilterPathPlugin,\n CreatePathCallable\n} from \"~/plugins/CmsEntryFieldFilterPathPlugin\";\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 createPlainObjectPathPlugin = (): CmsEntryFieldFilterPathPlugin => {\n return new CmsEntryFieldFilterPathPlugin({\n fieldType: \"plainObject\",\n path: createPath\n });\n};\n"],"mappings":";;;;;;;AAGA;AACA;AAJA;AACA;AACA;;AAOA,MAAMA,UAA8B,GAAG,CAAC;EAAEC;AAAM,CAAC,KAAK;EAClD,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK,CAACE,QAAQ,IAAI,CAAC,CAAC;EACrC,IAAI,CAACD,IAAI,EAAE;IACP,MAAM,IAAIE,cAAW,CAAC,8BAA8B,EAAE,sBAAsB,EAAE;MAC1EH;IACJ,CAAC,CAAC;EACN;EACA,OAAOC,IAAI;AACf,CAAC;AAEM,MAAMG,2BAA2B,GAAG,MAAqC;EAC5E,OAAO,IAAIC,4DAA6B,CAAC;IACrCC,SAAS,EAAE,aAAa;IACxBL,IAAI,EAAEF;EACV,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StorageTransformPlugin } from "@webiny/api-headless-cms
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { StorageTransformPlugin } from "@webiny/api-headless-cms";
|
|
2
|
+
import { CmsModelField } from "@webiny/api-headless-cms/types";
|
|
3
|
+
export declare const createDateStorageTransformPlugin: () => StorageTransformPlugin<any, any, CmsModelField>;
|
package/dynamoDb/storage/date.js
CHANGED
|
@@ -1,65 +1,91 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
7
|
+
exports.createDateStorageTransformPlugin = void 0;
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
|
10
|
+
/**
|
|
11
|
+
* File is @internal
|
|
12
|
+
*/
|
|
13
13
|
|
|
14
14
|
const excludeTypes = ["time", "dateTimeWithTimezone"];
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
return new Date(value);
|
|
31
|
-
} catch {
|
|
32
|
-
console.log(`Could not transform from storage for field type`);
|
|
33
|
-
return value;
|
|
15
|
+
const convertFromStorage = (field, value) => {
|
|
16
|
+
try {
|
|
17
|
+
if (field.multipleValues) {
|
|
18
|
+
const result = [];
|
|
19
|
+
for (const v of value) {
|
|
20
|
+
if (!v) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
result.push(new Date(v));
|
|
25
|
+
} catch {}
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}) => {
|
|
40
|
-
const {
|
|
41
|
-
type
|
|
42
|
-
} = field.settings || {};
|
|
43
|
-
|
|
44
|
-
if (!value || !type || excludeTypes.includes(type)) {
|
|
45
|
-
return value;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (value.toISOString) {
|
|
49
|
-
return value.toISOString();
|
|
50
|
-
} else if (typeof value === "string") {
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
throw new _error.default("Error converting value to a storage type.", "TO_STORAGE_ERROR", {
|
|
55
|
-
value,
|
|
56
|
-
fieldId: field.fieldId
|
|
57
|
-
});
|
|
29
|
+
return new Date(value);
|
|
30
|
+
} catch {
|
|
31
|
+
console.log(`Could not transform from storage for field type`);
|
|
32
|
+
return value;
|
|
58
33
|
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
var _default = () => {
|
|
62
|
-
return plugin;
|
|
63
34
|
};
|
|
64
|
-
|
|
65
|
-
|
|
35
|
+
const convertValueToStorage = (field, value) => {
|
|
36
|
+
if (value.toISOString) {
|
|
37
|
+
return value.toISOString();
|
|
38
|
+
} else if (typeof value === "string") {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
throw new _error.default("Error converting value to a storage type.", "TO_STORAGE_ERROR", {
|
|
42
|
+
value: value,
|
|
43
|
+
fieldId: field.fieldId,
|
|
44
|
+
storageId: field.storageId
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const createDateStorageTransformPlugin = () => {
|
|
48
|
+
return new _apiHeadlessCms.StorageTransformPlugin({
|
|
49
|
+
fieldType: "datetime",
|
|
50
|
+
fromStorage: async ({
|
|
51
|
+
value,
|
|
52
|
+
field
|
|
53
|
+
}) => {
|
|
54
|
+
const {
|
|
55
|
+
type
|
|
56
|
+
} = field.settings || {};
|
|
57
|
+
if (!value || !type || excludeTypes.includes(type)) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
return convertFromStorage(field, value);
|
|
61
|
+
},
|
|
62
|
+
toStorage: async ({
|
|
63
|
+
value,
|
|
64
|
+
field
|
|
65
|
+
}) => {
|
|
66
|
+
const {
|
|
67
|
+
type
|
|
68
|
+
} = field.settings || {};
|
|
69
|
+
if (!value || !type || excludeTypes.includes(type)) {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
if (field.multipleValues) {
|
|
73
|
+
const multipleValues = value;
|
|
74
|
+
return (multipleValues || []).filter(v => !!v).map(v => {
|
|
75
|
+
return convertValueToStorage(field, v);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (value.toISOString) {
|
|
79
|
+
return value.toISOString();
|
|
80
|
+
} else if (typeof value === "string") {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
throw new _error.default("Error converting value to a storage type.", "TO_STORAGE_ERROR", {
|
|
84
|
+
value,
|
|
85
|
+
fieldId: field.fieldId,
|
|
86
|
+
storageId: field.storageId
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
exports.createDateStorageTransformPlugin = createDateStorageTransformPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["excludeTypes","convertFromStorage","field","value","multipleValues","result","v","push","Date","console","log","convertValueToStorage","toISOString","WebinyError","fieldId","storageId","createDateStorageTransformPlugin","StorageTransformPlugin","fieldType","fromStorage","type","settings","includes","toStorage","filter","map"],"sources":["date.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nconst excludeTypes = [\"time\", \"dateTimeWithTimezone\"];\n\nconst convertFromStorage = (\n field: Pick<CmsModelField, \"multipleValues\">,\n value: string | string[]\n) => {\n try {\n if (field.multipleValues) {\n const result: Date[] = [];\n for (const v of value) {\n if (!v) {\n continue;\n }\n try {\n result.push(new Date(v));\n } catch {}\n }\n return result;\n }\n return new Date(value as string);\n } catch {\n console.log(`Could not transform from storage for field type`);\n return value;\n }\n};\n\nconst convertValueToStorage = (field: CmsModelField, value: any): any => {\n if ((value as any).toISOString) {\n return (value as Date).toISOString();\n } else if (typeof value === \"string\") {\n return value as string;\n }\n throw new WebinyError(\"Error converting value to a storage type.\", \"TO_STORAGE_ERROR\", {\n value: value,\n fieldId: field.fieldId,\n storageId: field.storageId\n });\n};\n\nexport const createDateStorageTransformPlugin = () => {\n return new StorageTransformPlugin({\n fieldType: \"datetime\",\n fromStorage: async ({ value, field }) => {\n const { type } = field.settings || {};\n if (!value || !type || excludeTypes.includes(type)) {\n return value;\n }\n return convertFromStorage(field, value);\n },\n toStorage: async ({ value, field }) => {\n const { type } = field.settings || {};\n if (!value || !type || excludeTypes.includes(type)) {\n return value;\n }\n if (field.multipleValues) {\n const multipleValues = value as (string | Date | null | undefined)[];\n return (multipleValues || [])\n .filter(v => !!v)\n .map(v => {\n return convertValueToStorage(field, v);\n });\n }\n if ((value as any).toISOString) {\n return (value as Date).toISOString();\n } else if (typeof value === \"string\") {\n return value as string;\n }\n throw new WebinyError(\"Error converting value to a storage type.\", \"TO_STORAGE_ERROR\", {\n value,\n fieldId: field.fieldId,\n storageId: field.storageId\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAGA;AACA;AAJA;AACA;AACA;;AAKA,MAAMA,YAAY,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC;AAErD,MAAMC,kBAAkB,GAAG,CACvBC,KAA4C,EAC5CC,KAAwB,KACvB;EACD,IAAI;IACA,IAAID,KAAK,CAACE,cAAc,EAAE;MACtB,MAAMC,MAAc,GAAG,EAAE;MACzB,KAAK,MAAMC,CAAC,IAAIH,KAAK,EAAE;QACnB,IAAI,CAACG,CAAC,EAAE;UACJ;QACJ;QACA,IAAI;UACAD,MAAM,CAACE,IAAI,CAAC,IAAIC,IAAI,CAACF,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC;MACb;MACA,OAAOD,MAAM;IACjB;IACA,OAAO,IAAIG,IAAI,CAACL,KAAK,CAAW;EACpC,CAAC,CAAC,MAAM;IACJM,OAAO,CAACC,GAAG,CAAE,iDAAgD,CAAC;IAC9D,OAAOP,KAAK;EAChB;AACJ,CAAC;AAED,MAAMQ,qBAAqB,GAAG,CAACT,KAAoB,EAAEC,KAAU,KAAU;EACrE,IAAKA,KAAK,CAASS,WAAW,EAAE;IAC5B,OAAQT,KAAK,CAAUS,WAAW,EAAE;EACxC,CAAC,MAAM,IAAI,OAAOT,KAAK,KAAK,QAAQ,EAAE;IAClC,OAAOA,KAAK;EAChB;EACA,MAAM,IAAIU,cAAW,CAAC,2CAA2C,EAAE,kBAAkB,EAAE;IACnFV,KAAK,EAAEA,KAAK;IACZW,OAAO,EAAEZ,KAAK,CAACY,OAAO;IACtBC,SAAS,EAAEb,KAAK,CAACa;EACrB,CAAC,CAAC;AACN,CAAC;AAEM,MAAMC,gCAAgC,GAAG,MAAM;EAClD,OAAO,IAAIC,sCAAsB,CAAC;IAC9BC,SAAS,EAAE,UAAU;IACrBC,WAAW,EAAE,OAAO;MAAEhB,KAAK;MAAED;IAAM,CAAC,KAAK;MACrC,MAAM;QAAEkB;MAAK,CAAC,GAAGlB,KAAK,CAACmB,QAAQ,IAAI,CAAC,CAAC;MACrC,IAAI,CAAClB,KAAK,IAAI,CAACiB,IAAI,IAAIpB,YAAY,CAACsB,QAAQ,CAACF,IAAI,CAAC,EAAE;QAChD,OAAOjB,KAAK;MAChB;MACA,OAAOF,kBAAkB,CAACC,KAAK,EAAEC,KAAK,CAAC;IAC3C,CAAC;IACDoB,SAAS,EAAE,OAAO;MAAEpB,KAAK;MAAED;IAAM,CAAC,KAAK;MACnC,MAAM;QAAEkB;MAAK,CAAC,GAAGlB,KAAK,CAACmB,QAAQ,IAAI,CAAC,CAAC;MACrC,IAAI,CAAClB,KAAK,IAAI,CAACiB,IAAI,IAAIpB,YAAY,CAACsB,QAAQ,CAACF,IAAI,CAAC,EAAE;QAChD,OAAOjB,KAAK;MAChB;MACA,IAAID,KAAK,CAACE,cAAc,EAAE;QACtB,MAAMA,cAAc,GAAGD,KAA6C;QACpE,OAAO,CAACC,cAAc,IAAI,EAAE,EACvBoB,MAAM,CAAClB,CAAC,IAAI,CAAC,CAACA,CAAC,CAAC,CAChBmB,GAAG,CAACnB,CAAC,IAAI;UACN,OAAOK,qBAAqB,CAACT,KAAK,EAAEI,CAAC,CAAC;QAC1C,CAAC,CAAC;MACV;MACA,IAAKH,KAAK,CAASS,WAAW,EAAE;QAC5B,OAAQT,KAAK,CAAUS,WAAW,EAAE;MACxC,CAAC,MAAM,IAAI,OAAOT,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAOA,KAAK;MAChB;MACA,MAAM,IAAIU,cAAW,CAAC,2CAA2C,EAAE,kBAAkB,EAAE;QACnFV,KAAK;QACLW,OAAO,EAAEZ,KAAK,CAACY,OAAO;QACtBC,SAAS,EAAEb,KAAK,CAACa;MACrB,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|