@webiny/api-form-builder-so-ddb 5.25.0 → 5.26.0-beta.0
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/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +11 -11
package/index.js
CHANGED
|
@@ -60,7 +60,7 @@ const createFormBuilderStorageOperations = params => {
|
|
|
60
60
|
attributes,
|
|
61
61
|
table: tableName,
|
|
62
62
|
documentClient,
|
|
63
|
-
plugins:
|
|
63
|
+
plugins: userPlugins
|
|
64
64
|
} = params;
|
|
65
65
|
|
|
66
66
|
if (attributes) {
|
|
@@ -73,7 +73,7 @@ const createFormBuilderStorageOperations = params => {
|
|
|
73
73
|
/**
|
|
74
74
|
* User defined plugins.
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
userPlugins || [],
|
|
77
77
|
/**
|
|
78
78
|
* Form submission DynamoDB fields.
|
|
79
79
|
*/
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["reservedFields","isReserved","name","includes","WebinyError","createFormBuilderStorageOperations","params","attributes","table","tableName","documentClient","plugins","
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["reservedFields","isReserved","name","includes","WebinyError","createFormBuilderStorageOperations","params","attributes","table","tableName","documentClient","plugins","userPlugins","Object","values","forEach","attrs","keys","PluginsContainer","entities","form","entityName","ENTITIES","FORM","submission","SUBMISSION","system","SYSTEM","settings","SETTINGS","upgrade","getTable","getEntities","entity"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC,IAAD,EAAO,IAAP,EAAa,OAAb,EAAsB,MAAtB,EAA8B,MAA9B,EAAsC,QAAtC,EAAgD,SAAhD,EAA2D,SAA3D,CAAvB;;AAEA,MAAMC,UAAU,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AAAA,KAF+B;AAG/BD,MAAAA,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACe,gBAASG,UAAV,CAAb,GAAqC;AAH5B,KAAvB,CATC;AAcbC,IAAAA,MAAM,EAAE,gCAAmB;AACvBL,MAAAA,UAAU,EAAEC,gBAASK,MADE;AAEvBnB,MAAAA,KAFuB;AAGvBD,MAAAA,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACe,gBAASK,MAAV,CAAb,GAAiC;AAHhC,KAAnB,CAdK;AAmBbC,IAAAA,QAAQ,EAAE,oCAAqB;AAC3BP,MAAAA,UAAU,EAAEC,gBAASO,QADM;AAE3BrB,MAAAA,KAF2B;AAG3BD,MAAAA,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACe,gBAASO,QAAV,CAAb,GAAmC;AAH9B,KAArB;AAnBG,GAAjB;AA0BA;AACIC,IAAAA,OAAO,EAAE,IADb;AAEIC,IAAAA,QAAQ,EAAE,MAAMvB,KAFpB;AAGIwB,IAAAA,WAAW,EAAE,MAAMb;AAHvB,KAIO,4CAA8B;AAC7BX,IAAAA,KAD6B;AAE7ByB,IAAAA,MAAM,EAAEd,QAAQ,CAACO;AAFY,GAA9B,CAJP,GAQO,gDAAgC;AAC/BlB,IAAAA,KAD+B;AAE/ByB,IAAAA,MAAM,EAAEd,QAAQ,CAACS;AAFc,GAAhC,CARP,GAYO,wCAA4B;AAC3BpB,IAAAA,KAD2B;AAE3ByB,IAAAA,MAAM,EAAEd,QAAQ,CAACC,IAFU;AAG3BT,IAAAA;AAH2B,GAA5B,CAZP,GAiBO,oDAAkC;AACjCH,IAAAA,KADiC;AAEjCyB,IAAAA,MAAM,EAAEd,QAAQ,CAACK,UAFgB;AAGjCb,IAAAA;AAHiC,GAAlC,CAjBP;AAuBH,CAnFM","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-form-builder-so-ddb",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.26.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-form-builder",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@babel/runtime": "7.
|
|
24
|
-
"@webiny/api-form-builder": "5.
|
|
25
|
-
"@webiny/db-dynamodb": "5.
|
|
26
|
-
"@webiny/error": "5.
|
|
27
|
-
"@webiny/plugins": "5.
|
|
28
|
-
"@webiny/utils": "5.
|
|
23
|
+
"@babel/runtime": "7.16.7",
|
|
24
|
+
"@webiny/api-form-builder": "5.26.0-beta.0",
|
|
25
|
+
"@webiny/db-dynamodb": "5.26.0-beta.0",
|
|
26
|
+
"@webiny/error": "5.26.0-beta.0",
|
|
27
|
+
"@webiny/plugins": "5.26.0-beta.0",
|
|
28
|
+
"@webiny/utils": "5.26.0-beta.0",
|
|
29
29
|
"dynamodb-toolbox": "0.3.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@babel/core": "^7.16.0",
|
|
34
34
|
"@babel/preset-env": "^7.16.4",
|
|
35
35
|
"@babel/preset-typescript": "^7.16.0",
|
|
36
|
-
"@webiny/cli": "^5.
|
|
37
|
-
"@webiny/handler-db": "^5.
|
|
38
|
-
"@webiny/project-utils": "^5.
|
|
36
|
+
"@webiny/cli": "^5.26.0-beta.0",
|
|
37
|
+
"@webiny/handler-db": "^5.26.0-beta.0",
|
|
38
|
+
"@webiny/project-utils": "^5.26.0-beta.0",
|
|
39
39
|
"csvtojson": "^2.0.10",
|
|
40
40
|
"jest": "^26.6.3",
|
|
41
41
|
"jest-dynalite": "^3.2.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"build": "yarn webiny run build",
|
|
53
53
|
"watch": "yarn webiny run watch"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "4ce1afe0630101262047a016a4b00e4e01f47095"
|
|
56
56
|
}
|