@webiny/api-form-builder-so-ddb 5.43.0-beta.1 → 5.43.0-beta.2
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 -1
- package/index.js.map +1 -1
- package/package.json +11 -10
package/index.js
CHANGED
|
@@ -35,6 +35,7 @@ Object.keys(_plugins2).forEach(function (key) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
+
var _api = require("@webiny/api");
|
|
38
39
|
const reservedFields = ["PK", "SK", "index", "data", "TYPE", "__type", "GSI1_PK", "GSI1_SK"];
|
|
39
40
|
const isReserved = name => {
|
|
40
41
|
if (reservedFields.includes(name) === false) {
|
|
@@ -104,7 +105,7 @@ const createFormBuilderStorageOperations = params => {
|
|
|
104
105
|
};
|
|
105
106
|
return {
|
|
106
107
|
beforeInit: async context => {
|
|
107
|
-
const types = [_plugins2.FormDynamoDbFieldPlugin.type, _plugins2.FormSubmissionDynamoDbFieldPlugin.type];
|
|
108
|
+
const types = [_plugins2.FormDynamoDbFieldPlugin.type, _plugins2.FormSubmissionDynamoDbFieldPlugin.type, _api.CompressorPlugin.type];
|
|
108
109
|
for (const type of types) {
|
|
109
110
|
plugins.mergeByType(context.plugins, type);
|
|
110
111
|
}
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_filters","_interopRequireDefault","require","_fields","_fields2","_error","_types","_table","_form","_submission","_system","_settings","_system2","_submission2","_settings2","_form2","_plugins","_plugins2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","reservedFields","isReserved","name","includes","WebinyError","createFormBuilderStorageOperations","params","attributes","table","tableName","documentClient","plugins","userPlugins","values","attrs","PluginsContainer","formSubmissionFields","formFields","dynamoDbValueFilters","createTable","entities","form","createFormEntity","entityName","ENTITIES","FORM","submission","createSubmissionEntity","SUBMISSION","system","createSystemEntity","SYSTEM","settings","createSettingsEntity","SETTINGS","beforeInit","context","types","FormDynamoDbFieldPlugin","type","FormSubmissionDynamoDbFieldPlugin","mergeByType","getTable","getEntities","createSystemStorageOperations","entity","createSettingsStorageOperations","createFormStorageOperations","createSubmissionStorageOperations"],"sources":["index.ts"],"sourcesContent":["import dynamoDbValueFilters from \"@webiny/db-dynamodb/plugins/filters\";\nimport formSubmissionFields from \"~/operations/submission/fields\";\nimport formFields from \"~/operations/form/fields\";\nimport WebinyError from \"@webiny/error\";\nimport { 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 { FormDynamoDbFieldPlugin, FormSubmissionDynamoDbFieldPlugin } from \"~/plugins\";\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 * from \"./plugins\";\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 beforeInit: async context => {\n const types: string[] = [\n FormDynamoDbFieldPlugin.type,\n FormSubmissionDynamoDbFieldPlugin.type\n ];\n for (const type of types) {\n plugins.mergeByType(context.plugins, type);\n }\n },\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":";;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,QAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;
|
|
1
|
+
{"version":3,"names":["_filters","_interopRequireDefault","require","_fields","_fields2","_error","_types","_table","_form","_submission","_system","_settings","_system2","_submission2","_settings2","_form2","_plugins","_plugins2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_api","reservedFields","isReserved","name","includes","WebinyError","createFormBuilderStorageOperations","params","attributes","table","tableName","documentClient","plugins","userPlugins","values","attrs","PluginsContainer","formSubmissionFields","formFields","dynamoDbValueFilters","createTable","entities","form","createFormEntity","entityName","ENTITIES","FORM","submission","createSubmissionEntity","SUBMISSION","system","createSystemEntity","SYSTEM","settings","createSettingsEntity","SETTINGS","beforeInit","context","types","FormDynamoDbFieldPlugin","type","FormSubmissionDynamoDbFieldPlugin","CompressorPlugin","mergeByType","getTable","getEntities","createSystemStorageOperations","entity","createSettingsStorageOperations","createFormStorageOperations","createSubmissionStorageOperations"],"sources":["index.ts"],"sourcesContent":["import dynamoDbValueFilters from \"@webiny/db-dynamodb/plugins/filters\";\nimport formSubmissionFields from \"~/operations/submission/fields\";\nimport formFields from \"~/operations/form/fields\";\nimport WebinyError from \"@webiny/error\";\nimport { 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 { FormDynamoDbFieldPlugin, FormSubmissionDynamoDbFieldPlugin } from \"~/plugins\";\nimport { CompressorPlugin } from \"@webiny/api\";\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 * from \"./plugins\";\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 beforeInit: async context => {\n const types: string[] = [\n FormDynamoDbFieldPlugin.type,\n FormSubmissionDynamoDbFieldPlugin.type,\n CompressorPlugin.type\n ];\n for (const type of types) {\n plugins.mergeByType(context.plugins, type);\n }\n },\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":";;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,QAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AAcAgB,MAAA,CAAAC,IAAA,CAAAF,SAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,SAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,SAAA,CAAAI,GAAA;IAAA;EAA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AK;MACLsC,MAAM,EAAE1B,QAAQ,CAACY;IACrB,CAAC,CAAC;IACF,GAAG,IAAAgB,kCAA2B,EAAC;MAC3BxC,KAAK;MACLsC,MAAM,EAAE1B,QAAQ,CAACC,IAAI;MACrBV;IACJ,CAAC,CAAC;IACF,GAAG,IAAAsC,8CAAiC,EAAC;MACjCzC,KAAK;MACLsC,MAAM,EAAE1B,QAAQ,CAACM,UAAU;MAC3Bf;IACJ,CAAC;EACL,CAAC;AACL,CAAC;AAAChB,OAAA,CAAAU,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-form-builder-so-ddb",
|
|
3
|
-
"version": "5.43.0-beta.
|
|
3
|
+
"version": "5.43.0-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-form-builder",
|
|
@@ -21,16 +21,17 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@webiny/api
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
24
|
+
"@webiny/api": "5.43.0-beta.2",
|
|
25
|
+
"@webiny/api-form-builder": "5.43.0-beta.2",
|
|
26
|
+
"@webiny/aws-sdk": "5.43.0-beta.2",
|
|
27
|
+
"@webiny/db-dynamodb": "5.43.0-beta.2",
|
|
28
|
+
"@webiny/error": "5.43.0-beta.2",
|
|
29
|
+
"@webiny/plugins": "5.43.0-beta.2",
|
|
30
|
+
"@webiny/utils": "5.43.0-beta.2"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@webiny/handler-db": "5.43.0-beta.
|
|
33
|
-
"@webiny/project-utils": "5.43.0-beta.
|
|
33
|
+
"@webiny/handler-db": "5.43.0-beta.2",
|
|
34
|
+
"@webiny/project-utils": "5.43.0-beta.2",
|
|
34
35
|
"csvtojson": "2.0.10",
|
|
35
36
|
"jest": "29.7.0",
|
|
36
37
|
"jest-dynalite": "3.6.1",
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"build": "node ../cli/bin.js run build",
|
|
46
47
|
"watch": "node ../cli/bin.js run watch"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "dbed8c263df662358aca18c3cf452cd280f2dfd9"
|
|
49
50
|
}
|