@webiny/api-form-builder-so-ddb 0.0.0-ee-vpcs.549378cf03
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -0
- package/definitions/form.d.ts +9 -0
- package/definitions/form.js +106 -0
- package/definitions/form.js.map +1 -0
- package/definitions/settings.d.ts +9 -0
- package/definitions/settings.js +49 -0
- package/definitions/settings.js.map +1 -0
- package/definitions/submission.d.ts +9 -0
- package/definitions/submission.js +70 -0
- package/definitions/submission.js.map +1 -0
- package/definitions/system.d.ts +9 -0
- package/definitions/system.js +40 -0
- package/definitions/system.js.map +1 -0
- package/definitions/table.d.ts +8 -0
- package/definitions/table.js +29 -0
- package/definitions/table.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +135 -0
- package/index.js.map +1 -0
- package/operations/form/fields.d.ts +3 -0
- package/operations/form/fields.js +43 -0
- package/operations/form/fields.js.map +1 -0
- package/operations/form/index.d.ts +9 -0
- package/operations/form/index.js +738 -0
- package/operations/form/index.js.map +1 -0
- package/operations/settings/index.d.ts +7 -0
- package/operations/settings/index.js +118 -0
- package/operations/settings/index.js.map +1 -0
- package/operations/submission/fields.d.ts +3 -0
- package/operations/submission/fields.js +18 -0
- package/operations/submission/fields.js.map +1 -0
- package/operations/submission/index.d.ts +9 -0
- package/operations/submission/index.js +241 -0
- package/operations/submission/index.js.map +1 -0
- package/operations/system/index.d.ts +7 -0
- package/operations/system/index.js +101 -0
- package/operations/system/index.js.map +1 -0
- package/package.json +56 -0
- package/plugins/FormDynamoDbFieldPlugin.d.ts +4 -0
- package/plugins/FormDynamoDbFieldPlugin.js +17 -0
- package/plugins/FormDynamoDbFieldPlugin.js.map +1 -0
- package/plugins/FormSubmissionDynamoDbFieldPlugin.d.ts +4 -0
- package/plugins/FormSubmissionDynamoDbFieldPlugin.js +17 -0
- package/plugins/FormSubmissionDynamoDbFieldPlugin.js.map +1 -0
- package/types.d.ts +65 -0
- package/types.js +15 -0
- package/types.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Webiny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @webiny/api-form-builder-so-ddb
|
|
2
|
+
[](https://www.npmjs.com/package/@webiny/api-form-builder-so-ddb)
|
|
3
|
+
[](https://www.npmjs.com/package/@webiny/api-form-builder-so-ddb)
|
|
4
|
+
[](https://github.com/prettier/prettier)
|
|
5
|
+
[](http://makeapullrequest.com)
|
|
6
|
+
|
|
7
|
+
The DynamoDB Storage Operations for the [Webiny Forms (@webiny/api-form-builder)](../api-form-builder) API.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
With yarn:
|
|
11
|
+
```
|
|
12
|
+
yarn add @webiny/api-form-builder-so-ddb
|
|
13
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createFormEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createFormEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
+
|
|
14
|
+
const createFormEntity = params => {
|
|
15
|
+
const {
|
|
16
|
+
table,
|
|
17
|
+
entityName,
|
|
18
|
+
attributes
|
|
19
|
+
} = params;
|
|
20
|
+
return new _dynamodbToolbox.Entity({
|
|
21
|
+
table,
|
|
22
|
+
name: entityName,
|
|
23
|
+
attributes: (0, _objectSpread2.default)({
|
|
24
|
+
PK: {
|
|
25
|
+
partitionKey: true
|
|
26
|
+
},
|
|
27
|
+
SK: {
|
|
28
|
+
sortKey: true
|
|
29
|
+
},
|
|
30
|
+
GSI1_PK: {
|
|
31
|
+
type: "string"
|
|
32
|
+
},
|
|
33
|
+
GSI1_SK: {
|
|
34
|
+
type: "string"
|
|
35
|
+
},
|
|
36
|
+
TYPE: {
|
|
37
|
+
type: "string"
|
|
38
|
+
},
|
|
39
|
+
id: {
|
|
40
|
+
type: "string"
|
|
41
|
+
},
|
|
42
|
+
formId: {
|
|
43
|
+
type: "string"
|
|
44
|
+
},
|
|
45
|
+
tenant: {
|
|
46
|
+
type: "string"
|
|
47
|
+
},
|
|
48
|
+
locale: {
|
|
49
|
+
type: "string"
|
|
50
|
+
},
|
|
51
|
+
createdBy: {
|
|
52
|
+
type: "map"
|
|
53
|
+
},
|
|
54
|
+
ownedBy: {
|
|
55
|
+
type: "map"
|
|
56
|
+
},
|
|
57
|
+
savedOn: {
|
|
58
|
+
type: "string"
|
|
59
|
+
},
|
|
60
|
+
createdOn: {
|
|
61
|
+
type: "string"
|
|
62
|
+
},
|
|
63
|
+
name: {
|
|
64
|
+
type: "string"
|
|
65
|
+
},
|
|
66
|
+
slug: {
|
|
67
|
+
type: "string"
|
|
68
|
+
},
|
|
69
|
+
version: {
|
|
70
|
+
type: "number"
|
|
71
|
+
},
|
|
72
|
+
locked: {
|
|
73
|
+
type: "boolean"
|
|
74
|
+
},
|
|
75
|
+
published: {
|
|
76
|
+
type: "boolean"
|
|
77
|
+
},
|
|
78
|
+
publishedOn: {
|
|
79
|
+
type: "string"
|
|
80
|
+
},
|
|
81
|
+
status: {
|
|
82
|
+
type: "string"
|
|
83
|
+
},
|
|
84
|
+
fields: {
|
|
85
|
+
type: "list"
|
|
86
|
+
},
|
|
87
|
+
layout: {
|
|
88
|
+
type: "list"
|
|
89
|
+
},
|
|
90
|
+
stats: {
|
|
91
|
+
type: "map"
|
|
92
|
+
},
|
|
93
|
+
settings: {
|
|
94
|
+
type: "map"
|
|
95
|
+
},
|
|
96
|
+
triggers: {
|
|
97
|
+
type: "map"
|
|
98
|
+
},
|
|
99
|
+
webinyVersion: {
|
|
100
|
+
type: "string"
|
|
101
|
+
}
|
|
102
|
+
}, attributes || {})
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
exports.createFormEntity = createFormEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFormEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","id","formId","tenant","locale","createdBy","ownedBy","savedOn","createdOn","slug","version","locked","published","publishedOn","status","fields","layout","stats","settings","triggers","webinyVersion"],"sources":["form.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 createFormEntity = (params: Params): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n table,\n name: entityName,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n formId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n savedOn: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n published: {\n type: \"boolean\"\n },\n publishedOn: {\n type: \"string\"\n },\n status: {\n type: \"string\"\n },\n fields: {\n type: \"list\"\n },\n layout: {\n type: \"list\"\n },\n stats: {\n type: \"map\"\n },\n settings: {\n type: \"map\"\n },\n triggers: {\n type: \"map\"\n },\n webinyVersion: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,gBAAgB,GAAIC,MAAD,IAAiC;EAC7D,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdH,KADc;IAEdI,IAAI,EAAEH,UAFQ;IAGdC,UAAU;MACNG,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,OAAO,EAAE;QACLC,IAAI,EAAE;MADD,CAPH;MAUNC,OAAO,EAAE;QACLD,IAAI,EAAE;MADD,CAVH;MAaNE,IAAI,EAAE;QACFF,IAAI,EAAE;MADJ,CAbA;MAgBNG,EAAE,EAAE;QACAH,IAAI,EAAE;MADN,CAhBE;MAmBNI,MAAM,EAAE;QACJJ,IAAI,EAAE;MADF,CAnBF;MAsBNK,MAAM,EAAE;QACJL,IAAI,EAAE;MADF,CAtBF;MAyBNM,MAAM,EAAE;QACJN,IAAI,EAAE;MADF,CAzBF;MA4BNO,SAAS,EAAE;QACPP,IAAI,EAAE;MADC,CA5BL;MA+BNQ,OAAO,EAAE;QACLR,IAAI,EAAE;MADD,CA/BH;MAkCNS,OAAO,EAAE;QACLT,IAAI,EAAE;MADD,CAlCH;MAqCNU,SAAS,EAAE;QACPV,IAAI,EAAE;MADC,CArCL;MAwCNN,IAAI,EAAE;QACFM,IAAI,EAAE;MADJ,CAxCA;MA2CNW,IAAI,EAAE;QACFX,IAAI,EAAE;MADJ,CA3CA;MA8CNY,OAAO,EAAE;QACLZ,IAAI,EAAE;MADD,CA9CH;MAiDNa,MAAM,EAAE;QACJb,IAAI,EAAE;MADF,CAjDF;MAoDNc,SAAS,EAAE;QACPd,IAAI,EAAE;MADC,CApDL;MAuDNe,WAAW,EAAE;QACTf,IAAI,EAAE;MADG,CAvDP;MA0DNgB,MAAM,EAAE;QACJhB,IAAI,EAAE;MADF,CA1DF;MA6DNiB,MAAM,EAAE;QACJjB,IAAI,EAAE;MADF,CA7DF;MAgENkB,MAAM,EAAE;QACJlB,IAAI,EAAE;MADF,CAhEF;MAmENmB,KAAK,EAAE;QACHnB,IAAI,EAAE;MADH,CAnED;MAsENoB,QAAQ,EAAE;QACNpB,IAAI,EAAE;MADA,CAtEJ;MAyENqB,QAAQ,EAAE;QACNrB,IAAI,EAAE;MADA,CAzEJ;MA4ENsB,aAAa,EAAE;QACXtB,IAAI,EAAE;MADK;IA5ET,GA+EFR,UAAU,IAAI,EA/EZ;EAHI,CAAX,CAAP;AAqFH,CAvFM"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createSettingsEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createSettingsEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
+
|
|
14
|
+
const createSettingsEntity = params => {
|
|
15
|
+
const {
|
|
16
|
+
entityName,
|
|
17
|
+
attributes,
|
|
18
|
+
table
|
|
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
|
+
reCaptcha: {
|
|
34
|
+
type: "map"
|
|
35
|
+
},
|
|
36
|
+
domain: {
|
|
37
|
+
type: "string"
|
|
38
|
+
},
|
|
39
|
+
tenant: {
|
|
40
|
+
type: "string"
|
|
41
|
+
},
|
|
42
|
+
locale: {
|
|
43
|
+
type: "string"
|
|
44
|
+
}
|
|
45
|
+
}, attributes || {})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.createSettingsEntity = createSettingsEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSettingsEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","reCaptcha","domain","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, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n reCaptcha: {\n type: \"map\"\n },\n domain: {\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,MAAD,IAAiC;EACjE,MAAM;IAAEC,UAAF;IAAcC,UAAd;IAA0BC;EAA1B,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEJ,UADQ;IAEdE,KAFc;IAGdD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE;MADJ,CAPA;MAUNC,SAAS,EAAE;QACPD,IAAI,EAAE;MADC,CAVL;MAaNE,MAAM,EAAE;QACJF,IAAI,EAAE;MADF,CAbF;MAgBNG,MAAM,EAAE;QACJH,IAAI,EAAE;MADF,CAhBF;MAmBNI,MAAM,EAAE;QACJJ,IAAI,EAAE;MADF;IAnBF,GAsBFT,UAAU,IAAI,EAtBZ;EAHI,CAAX,CAAP;AA4BH,CA9BM"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createSubmissionEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createSubmissionEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
+
|
|
14
|
+
const createSubmissionEntity = params => {
|
|
15
|
+
const {
|
|
16
|
+
table,
|
|
17
|
+
entityName,
|
|
18
|
+
attributes
|
|
19
|
+
} = params;
|
|
20
|
+
return new _dynamodbToolbox.Entity({
|
|
21
|
+
table,
|
|
22
|
+
name: entityName,
|
|
23
|
+
attributes: (0, _objectSpread2.default)({
|
|
24
|
+
PK: {
|
|
25
|
+
partitionKey: true
|
|
26
|
+
},
|
|
27
|
+
SK: {
|
|
28
|
+
sortKey: true
|
|
29
|
+
},
|
|
30
|
+
id: {
|
|
31
|
+
type: "string"
|
|
32
|
+
},
|
|
33
|
+
TYPE: {
|
|
34
|
+
type: "string"
|
|
35
|
+
},
|
|
36
|
+
data: {
|
|
37
|
+
type: "map"
|
|
38
|
+
},
|
|
39
|
+
meta: {
|
|
40
|
+
type: "map"
|
|
41
|
+
},
|
|
42
|
+
form: {
|
|
43
|
+
type: "map"
|
|
44
|
+
},
|
|
45
|
+
logs: {
|
|
46
|
+
type: "list"
|
|
47
|
+
},
|
|
48
|
+
createdOn: {
|
|
49
|
+
type: "string"
|
|
50
|
+
},
|
|
51
|
+
savedOn: {
|
|
52
|
+
type: "string"
|
|
53
|
+
},
|
|
54
|
+
ownedBy: {
|
|
55
|
+
type: "map"
|
|
56
|
+
},
|
|
57
|
+
tenant: {
|
|
58
|
+
type: "string"
|
|
59
|
+
},
|
|
60
|
+
locale: {
|
|
61
|
+
type: "string"
|
|
62
|
+
},
|
|
63
|
+
webinyVersion: {
|
|
64
|
+
type: "string"
|
|
65
|
+
}
|
|
66
|
+
}, attributes || {})
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
exports.createSubmissionEntity = createSubmissionEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSubmissionEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","id","type","TYPE","data","meta","form","logs","createdOn","savedOn","ownedBy","tenant","locale","webinyVersion"],"sources":["submission.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 createSubmissionEntity = (params: Params): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n table,\n name: entityName,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n id: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n form: {\n type: \"map\"\n },\n logs: {\n type: \"list\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n ownedBy: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,sBAAsB,GAAIC,MAAD,IAAiC;EACnE,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdH,KADc;IAEdI,IAAI,EAAEH,UAFQ;IAGdC,UAAU;MACNG,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,EAAE,EAAE;QACAC,IAAI,EAAE;MADN,CAPE;MAUNC,IAAI,EAAE;QACFD,IAAI,EAAE;MADJ,CAVA;MAaNE,IAAI,EAAE;QACFF,IAAI,EAAE;MADJ,CAbA;MAgBNG,IAAI,EAAE;QACFH,IAAI,EAAE;MADJ,CAhBA;MAmBNI,IAAI,EAAE;QACFJ,IAAI,EAAE;MADJ,CAnBA;MAsBNK,IAAI,EAAE;QACFL,IAAI,EAAE;MADJ,CAtBA;MAyBNM,SAAS,EAAE;QACPN,IAAI,EAAE;MADC,CAzBL;MA4BNO,OAAO,EAAE;QACLP,IAAI,EAAE;MADD,CA5BH;MA+BNQ,OAAO,EAAE;QACLR,IAAI,EAAE;MADD,CA/BH;MAkCNS,MAAM,EAAE;QACJT,IAAI,EAAE;MADF,CAlCF;MAqCNU,MAAM,EAAE;QACJV,IAAI,EAAE;MADF,CArCF;MAwCNW,aAAa,EAAE;QACXX,IAAI,EAAE;MADK;IAxCT,GA2CFR,UAAU,IAAI,EA3CZ;EAHI,CAAX,CAAP;AAiDH,CAnDM"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { Attributes } from "../types";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: Table;
|
|
5
|
+
entityName: string;
|
|
6
|
+
attributes: Attributes;
|
|
7
|
+
}
|
|
8
|
+
export declare const createSystemEntity: (params: Params) => Entity<any>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createSystemEntity = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
+
|
|
14
|
+
const createSystemEntity = params => {
|
|
15
|
+
const {
|
|
16
|
+
entityName,
|
|
17
|
+
attributes,
|
|
18
|
+
table
|
|
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
|
+
version: {
|
|
31
|
+
type: "string"
|
|
32
|
+
},
|
|
33
|
+
tenant: {
|
|
34
|
+
type: "string"
|
|
35
|
+
}
|
|
36
|
+
}, attributes || {})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.createSystemEntity = createSystemEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","tenant"],"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 tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,kBAAkB,GAAIC,MAAD,IAAiC;EAC/D,MAAM;IAAEC,UAAF;IAAcC,UAAd;IAA0BC;EAA1B,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEJ,UADQ;IAEdE,KAFc;IAGdD,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,OAAO,EAAE;QACLC,IAAI,EAAE;MADD,CAPH;MAUNC,MAAM,EAAE;QACJD,IAAI,EAAE;MADF;IAVF,GAaFT,UAAU,IAAI,EAbZ;EAHI,CAAX,CAAP;AAmBH,CArBM"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createTable = void 0;
|
|
7
|
+
|
|
8
|
+
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
9
|
+
|
|
10
|
+
const createTable = params => {
|
|
11
|
+
const {
|
|
12
|
+
tableName,
|
|
13
|
+
documentClient
|
|
14
|
+
} = params;
|
|
15
|
+
return new _dynamodbToolbox.Table({
|
|
16
|
+
name: tableName || process.env.DB_TABLE,
|
|
17
|
+
partitionKey: "PK",
|
|
18
|
+
sortKey: "SK",
|
|
19
|
+
DocumentClient: documentClient,
|
|
20
|
+
indexes: {
|
|
21
|
+
GSI1: {
|
|
22
|
+
partitionKey: "GSI1_PK",
|
|
23
|
+
sortKey: "GSI1_SK"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.createTable = createTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTable","params","tableName","documentClient","Table","name","process","env","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1"],"sources":["table.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\n\ninterface Params {\n tableName?: string;\n documentClient: DocumentClient;\n}\n\nexport const createTable = (params: Params): Table => {\n const { tableName, documentClient } = params;\n\n return new Table({\n name: tableName || (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"],"mappings":";;;;;;;AACA;;AAOO,MAAMA,WAAW,GAAIC,MAAD,IAA2B;EAClD,MAAM;IAAEC,SAAF;IAAaC;EAAb,IAAgCF,MAAtC;EAEA,OAAO,IAAIG,sBAAJ,CAAU;IACbC,IAAI,EAAEH,SAAS,IAAKI,OAAO,CAACC,GAAR,CAAYC,QADnB;IAEbC,YAAY,EAAE,IAFD;IAGbC,OAAO,EAAE,IAHI;IAIbC,cAAc,EAAER,cAJH;IAKbS,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SADZ;QAEFC,OAAO,EAAE;MAFP;IADD;EALI,CAAV,CAAP;AAYH,CAfM"}
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createFormBuilderStorageOperations = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _types = require("./types");
|
|
13
|
+
|
|
14
|
+
var _table = require("./definitions/table");
|
|
15
|
+
|
|
16
|
+
var _form = require("./definitions/form");
|
|
17
|
+
|
|
18
|
+
var _submission = require("./definitions/submission");
|
|
19
|
+
|
|
20
|
+
var _system = require("./definitions/system");
|
|
21
|
+
|
|
22
|
+
var _settings = require("./definitions/settings");
|
|
23
|
+
|
|
24
|
+
var _system2 = require("./operations/system");
|
|
25
|
+
|
|
26
|
+
var _submission2 = require("./operations/submission");
|
|
27
|
+
|
|
28
|
+
var _settings2 = require("./operations/settings");
|
|
29
|
+
|
|
30
|
+
var _form2 = require("./operations/form");
|
|
31
|
+
|
|
32
|
+
var _plugins = require("@webiny/plugins");
|
|
33
|
+
|
|
34
|
+
var _filters = _interopRequireDefault(require("@webiny/db-dynamodb/plugins/filters"));
|
|
35
|
+
|
|
36
|
+
var _fields = _interopRequireDefault(require("./operations/submission/fields"));
|
|
37
|
+
|
|
38
|
+
var _fields2 = _interopRequireDefault(require("./operations/form/fields"));
|
|
39
|
+
|
|
40
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
41
|
+
|
|
42
|
+
const reservedFields = ["PK", "SK", "index", "data", "TYPE", "__type", "GSI1_PK", "GSI1_SK"];
|
|
43
|
+
|
|
44
|
+
const isReserved = name => {
|
|
45
|
+
if (reservedFields.includes(name) === false) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
throw new _error.default(`Attribute name "${name}" is not allowed.`, "ATTRIBUTE_NOT_ALLOWED", {
|
|
50
|
+
name
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const createFormBuilderStorageOperations = params => {
|
|
55
|
+
const {
|
|
56
|
+
attributes,
|
|
57
|
+
table: tableName,
|
|
58
|
+
documentClient,
|
|
59
|
+
plugins: userPlugins
|
|
60
|
+
} = params;
|
|
61
|
+
|
|
62
|
+
if (attributes) {
|
|
63
|
+
Object.values(attributes).forEach(attrs => {
|
|
64
|
+
Object.keys(attrs).forEach(isReserved);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const plugins = new _plugins.PluginsContainer([
|
|
69
|
+
/**
|
|
70
|
+
* User defined plugins.
|
|
71
|
+
*/
|
|
72
|
+
userPlugins || [],
|
|
73
|
+
/**
|
|
74
|
+
* Form submission DynamoDB fields.
|
|
75
|
+
*/
|
|
76
|
+
(0, _fields.default)(),
|
|
77
|
+
/**
|
|
78
|
+
* Form DynamoDB fields.
|
|
79
|
+
*/
|
|
80
|
+
(0, _fields2.default)(),
|
|
81
|
+
/**
|
|
82
|
+
* DynamoDB filter plugins for the where conditions.
|
|
83
|
+
*/
|
|
84
|
+
(0, _filters.default)()]);
|
|
85
|
+
const table = (0, _table.createTable)({
|
|
86
|
+
tableName,
|
|
87
|
+
documentClient
|
|
88
|
+
});
|
|
89
|
+
const entities = {
|
|
90
|
+
/**
|
|
91
|
+
* Regular entities.
|
|
92
|
+
*/
|
|
93
|
+
form: (0, _form.createFormEntity)({
|
|
94
|
+
entityName: _types.ENTITIES.FORM,
|
|
95
|
+
table,
|
|
96
|
+
attributes: attributes ? attributes[_types.ENTITIES.FORM] : {}
|
|
97
|
+
}),
|
|
98
|
+
submission: (0, _submission.createSubmissionEntity)({
|
|
99
|
+
entityName: _types.ENTITIES.SUBMISSION,
|
|
100
|
+
table,
|
|
101
|
+
attributes: attributes ? attributes[_types.ENTITIES.SUBMISSION] : {}
|
|
102
|
+
}),
|
|
103
|
+
system: (0, _system.createSystemEntity)({
|
|
104
|
+
entityName: _types.ENTITIES.SYSTEM,
|
|
105
|
+
table,
|
|
106
|
+
attributes: attributes ? attributes[_types.ENTITIES.SYSTEM] : {}
|
|
107
|
+
}),
|
|
108
|
+
settings: (0, _settings.createSettingsEntity)({
|
|
109
|
+
entityName: _types.ENTITIES.SETTINGS,
|
|
110
|
+
table,
|
|
111
|
+
attributes: attributes ? attributes[_types.ENTITIES.SETTINGS] : {}
|
|
112
|
+
})
|
|
113
|
+
};
|
|
114
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
115
|
+
upgrade: null,
|
|
116
|
+
getTable: () => table,
|
|
117
|
+
getEntities: () => entities
|
|
118
|
+
}, (0, _system2.createSystemStorageOperations)({
|
|
119
|
+
table,
|
|
120
|
+
entity: entities.system
|
|
121
|
+
})), (0, _settings2.createSettingsStorageOperations)({
|
|
122
|
+
table,
|
|
123
|
+
entity: entities.settings
|
|
124
|
+
})), (0, _form2.createFormStorageOperations)({
|
|
125
|
+
table,
|
|
126
|
+
entity: entities.form,
|
|
127
|
+
plugins
|
|
128
|
+
})), (0, _submission2.createSubmissionStorageOperations)({
|
|
129
|
+
table,
|
|
130
|
+
entity: entities.submission,
|
|
131
|
+
plugins
|
|
132
|
+
}));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
exports.createFormBuilderStorageOperations = createFormBuilderStorageOperations;
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reservedFields","isReserved","name","includes","WebinyError","createFormBuilderStorageOperations","params","attributes","table","tableName","documentClient","plugins","userPlugins","Object","values","forEach","attrs","keys","PluginsContainer","formSubmissionFields","formFields","dynamoDbValueFilters","createTable","entities","form","createFormEntity","entityName","ENTITIES","FORM","submission","createSubmissionEntity","SUBMISSION","system","createSystemEntity","SYSTEM","settings","createSettingsEntity","SETTINGS","upgrade","getTable","getEntities","createSystemStorageOperations","entity","createSettingsStorageOperations","createFormStorageOperations","createSubmissionStorageOperations"],"sources":["index.ts"],"sourcesContent":["import { FormBuilderStorageOperationsFactory, ENTITIES } from \"~/types\";\nimport { createTable } from \"~/definitions/table\";\nimport { createFormEntity } from \"~/definitions/form\";\nimport { createSubmissionEntity } from \"~/definitions/submission\";\nimport { createSystemEntity } from \"~/definitions/system\";\nimport { createSettingsEntity } from \"~/definitions/settings\";\nimport { createSystemStorageOperations } from \"~/operations/system\";\nimport { createSubmissionStorageOperations } from \"~/operations/submission\";\nimport { createSettingsStorageOperations } from \"~/operations/settings\";\nimport { createFormStorageOperations } from \"~/operations/form\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport dynamoDbValueFilters from \"@webiny/db-dynamodb/plugins/filters\";\nimport formSubmissionFields from \"~/operations/submission/fields\";\nimport formFields from \"~/operations/form/fields\";\nimport WebinyError from \"@webiny/error\";\n\nconst reservedFields = [\"PK\", \"SK\", \"index\", \"data\", \"TYPE\", \"__type\", \"GSI1_PK\", \"GSI1_SK\"];\n\nconst isReserved = (name: string): void => {\n if (reservedFields.includes(name) === false) {\n return;\n }\n throw new WebinyError(`Attribute name \"${name}\" is not allowed.`, \"ATTRIBUTE_NOT_ALLOWED\", {\n name\n });\n};\n\nexport const createFormBuilderStorageOperations: FormBuilderStorageOperationsFactory = params => {\n const { attributes, table: tableName, documentClient, plugins: userPlugins } = params;\n\n if (attributes) {\n Object.values(attributes).forEach(attrs => {\n Object.keys(attrs).forEach(isReserved);\n });\n }\n\n const plugins = new PluginsContainer([\n /**\n * User defined plugins.\n */\n userPlugins || [],\n /**\n * Form submission DynamoDB fields.\n */\n formSubmissionFields(),\n /**\n * Form DynamoDB fields.\n */\n formFields(),\n\n /**\n * DynamoDB filter plugins for the where conditions.\n */\n dynamoDbValueFilters()\n ]);\n\n const table = createTable({\n tableName,\n documentClient\n });\n\n const entities = {\n /**\n * Regular entities.\n */\n form: createFormEntity({\n entityName: ENTITIES.FORM,\n table,\n attributes: attributes ? attributes[ENTITIES.FORM] : {}\n }),\n submission: createSubmissionEntity({\n entityName: ENTITIES.SUBMISSION,\n table,\n attributes: attributes ? attributes[ENTITIES.SUBMISSION] : {}\n }),\n system: createSystemEntity({\n entityName: ENTITIES.SYSTEM,\n table,\n attributes: attributes ? attributes[ENTITIES.SYSTEM] : {}\n }),\n settings: createSettingsEntity({\n entityName: ENTITIES.SETTINGS,\n table,\n attributes: attributes ? attributes[ENTITIES.SETTINGS] : {}\n })\n };\n\n return {\n upgrade: null,\n getTable: () => table,\n getEntities: () => entities,\n ...createSystemStorageOperations({\n table,\n entity: entities.system\n }),\n ...createSettingsStorageOperations({\n table,\n entity: entities.settings\n }),\n ...createFormStorageOperations({\n table,\n entity: entities.form,\n plugins\n }),\n ...createSubmissionStorageOperations({\n table,\n entity: entities.submission,\n plugins\n })\n };\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _FormDynamoDbFieldPlugin = require("../../plugins/FormDynamoDbFieldPlugin");
|
|
9
|
+
|
|
10
|
+
var _default = () => [new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
11
|
+
field: "publishedOn",
|
|
12
|
+
type: "date"
|
|
13
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
14
|
+
field: "createdOn",
|
|
15
|
+
type: "date"
|
|
16
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
17
|
+
field: "savedOn",
|
|
18
|
+
type: "date"
|
|
19
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
20
|
+
field: "name"
|
|
21
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
22
|
+
field: "slug"
|
|
23
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
24
|
+
field: "locale"
|
|
25
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
26
|
+
field: "tenant"
|
|
27
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
28
|
+
field: "published",
|
|
29
|
+
type: "boolean"
|
|
30
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
31
|
+
field: "status"
|
|
32
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
33
|
+
field: "version",
|
|
34
|
+
type: "number"
|
|
35
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
36
|
+
field: "ownedBy",
|
|
37
|
+
path: "ownedBy.id"
|
|
38
|
+
}), new _FormDynamoDbFieldPlugin.FormDynamoDbFieldPlugin({
|
|
39
|
+
field: "createdBy",
|
|
40
|
+
path: "createdBy.id"
|
|
41
|
+
})];
|
|
42
|
+
|
|
43
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormDynamoDbFieldPlugin","field","type","path"],"sources":["fields.ts"],"sourcesContent":["import { FormDynamoDbFieldPlugin } from \"~/plugins/FormDynamoDbFieldPlugin\";\n\nexport default () => [\n new FormDynamoDbFieldPlugin({\n field: \"publishedOn\",\n type: \"date\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"createdOn\",\n type: \"date\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"savedOn\",\n type: \"date\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"name\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"slug\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"locale\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"tenant\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"published\",\n type: \"boolean\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"status\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"version\",\n type: \"number\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"ownedBy\",\n path: \"ownedBy.id\"\n }),\n new FormDynamoDbFieldPlugin({\n field: \"createdBy\",\n path: \"createdBy.id\"\n })\n];\n"],"mappings":";;;;;;;AAAA;;eAEe,MAAM,CACjB,IAAIA,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,aADiB;EAExBC,IAAI,EAAE;AAFkB,CAA5B,CADiB,EAKjB,IAAIF,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,WADiB;EAExBC,IAAI,EAAE;AAFkB,CAA5B,CALiB,EASjB,IAAIF,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,SADiB;EAExBC,IAAI,EAAE;AAFkB,CAA5B,CATiB,EAajB,IAAIF,gDAAJ,CAA4B;EACxBC,KAAK,EAAE;AADiB,CAA5B,CAbiB,EAgBjB,IAAID,gDAAJ,CAA4B;EACxBC,KAAK,EAAE;AADiB,CAA5B,CAhBiB,EAmBjB,IAAID,gDAAJ,CAA4B;EACxBC,KAAK,EAAE;AADiB,CAA5B,CAnBiB,EAsBjB,IAAID,gDAAJ,CAA4B;EACxBC,KAAK,EAAE;AADiB,CAA5B,CAtBiB,EAyBjB,IAAID,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,WADiB;EAExBC,IAAI,EAAE;AAFkB,CAA5B,CAzBiB,EA6BjB,IAAIF,gDAAJ,CAA4B;EACxBC,KAAK,EAAE;AADiB,CAA5B,CA7BiB,EAgCjB,IAAID,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,SADiB;EAExBC,IAAI,EAAE;AAFkB,CAA5B,CAhCiB,EAoCjB,IAAIF,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,SADiB;EAExBE,IAAI,EAAE;AAFkB,CAA5B,CApCiB,EAwCjB,IAAIH,gDAAJ,CAA4B;EACxBC,KAAK,EAAE,WADiB;EAExBE,IAAI,EAAE;AAFkB,CAA5B,CAxCiB,C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
+
import { FormBuilderFormStorageOperations } from "../../types";
|
|
4
|
+
export interface CreateFormStorageOperationsParams {
|
|
5
|
+
entity: Entity<any>;
|
|
6
|
+
table: Table;
|
|
7
|
+
plugins: PluginsContainer;
|
|
8
|
+
}
|
|
9
|
+
export declare const createFormStorageOperations: (params: CreateFormStorageOperationsParams) => FormBuilderFormStorageOperations;
|