@webiny/api-form-builder-so-ddb 0.0.0-mt-2 → 0.0.0-unstable.06b2ede40f

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.
Files changed (45) hide show
  1. package/definitions/form.d.ts +6 -4
  2. package/definitions/form.js +9 -17
  3. package/definitions/form.js.map +1 -0
  4. package/definitions/settings.d.ts +6 -4
  5. package/definitions/settings.js +8 -16
  6. package/definitions/settings.js.map +1 -0
  7. package/definitions/submission.d.ts +6 -4
  8. package/definitions/submission.js +8 -16
  9. package/definitions/submission.js.map +1 -0
  10. package/definitions/system.d.ts +6 -4
  11. package/definitions/system.js +8 -16
  12. package/definitions/system.js.map +1 -0
  13. package/definitions/table.d.ts +7 -6
  14. package/definitions/table.js +7 -6
  15. package/definitions/table.js.map +1 -0
  16. package/index.d.ts +2 -1
  17. package/index.js +57 -59
  18. package/index.js.map +1 -0
  19. package/operations/form/fields.js +2 -3
  20. package/operations/form/fields.js.map +1 -0
  21. package/operations/form/index.d.ts +6 -6
  22. package/operations/form/index.js +123 -177
  23. package/operations/form/index.js.map +1 -0
  24. package/operations/settings/index.d.ts +5 -5
  25. package/operations/settings/index.js +23 -31
  26. package/operations/settings/index.js.map +1 -0
  27. package/operations/submission/fields.js +2 -3
  28. package/operations/submission/fields.js.map +1 -0
  29. package/operations/submission/index.d.ts +6 -6
  30. package/operations/submission/index.js +30 -53
  31. package/operations/submission/index.js.map +1 -0
  32. package/operations/system/index.d.ts +5 -5
  33. package/operations/system/index.js +19 -28
  34. package/operations/system/index.js.map +1 -0
  35. package/package.json +19 -25
  36. package/plugins/FormDynamoDbFieldPlugin.js +5 -9
  37. package/plugins/FormDynamoDbFieldPlugin.js.map +1 -0
  38. package/plugins/FormSubmissionDynamoDbFieldPlugin.js +5 -9
  39. package/plugins/FormSubmissionDynamoDbFieldPlugin.js.map +1 -0
  40. package/plugins/index.d.ts +2 -0
  41. package/plugins/index.js +29 -0
  42. package/plugins/index.js.map +1 -0
  43. package/types.d.ts +9 -11
  44. package/types.js +5 -5
  45. package/types.js.map +1 -0
@@ -1,54 +1,44 @@
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.createSystemStorageOperations = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
13
-
14
8
  var _error = _interopRequireDefault(require("@webiny/error"));
15
-
16
9
  var _get = require("@webiny/db-dynamodb/utils/get");
17
-
18
- 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; }
19
-
20
- 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; }
21
-
10
+ var _dbDynamodb = require("@webiny/db-dynamodb");
22
11
  const createSystemStorageOperations = params => {
23
12
  const {
24
13
  entity
25
14
  } = params;
26
-
27
15
  const createSystemPartitionKey = ({
28
16
  tenant
29
17
  }) => {
30
18
  return `T#${tenant}#SYSTEM`;
31
19
  };
32
-
33
20
  const createSystemSortKey = () => {
34
21
  return "FB";
35
22
  };
36
-
37
23
  const createKeys = params => {
38
24
  return {
39
25
  PK: createSystemPartitionKey(params),
40
26
  SK: createSystemSortKey()
41
27
  };
42
28
  };
43
-
44
29
  const createSystem = async params => {
45
30
  const {
46
31
  system
47
32
  } = params;
48
33
  const keys = createKeys(system);
49
-
50
34
  try {
51
- await entity.put(_objectSpread(_objectSpread({}, system), keys));
35
+ await (0, _dbDynamodb.put)({
36
+ entity,
37
+ item: {
38
+ ...system,
39
+ ...keys
40
+ }
41
+ });
52
42
  return system;
53
43
  } catch (ex) {
54
44
  throw new _error.default(ex.message || "Could not create the system record by given keys.", ex.code || "CREATE_SYSTEM_ERROR", {
@@ -57,32 +47,33 @@ const createSystemStorageOperations = params => {
57
47
  });
58
48
  }
59
49
  };
60
-
61
50
  const getSystem = async params => {
62
51
  const keys = createKeys(params);
63
-
64
52
  try {
65
- const item = await (0, _get.get)({
53
+ return await (0, _get.getClean)({
66
54
  entity,
67
55
  keys
68
56
  });
69
- return (0, _cleanup.cleanupItem)(entity, item);
70
57
  } catch (ex) {
71
58
  throw new _error.default(ex.message || "Could not get the system record by given keys.", ex.code || "LOAD_SYSTEM_ERROR", {
72
59
  keys
73
60
  });
74
61
  }
75
62
  };
76
-
77
63
  const updateSystem = async params => {
78
64
  const {
79
65
  system,
80
66
  original
81
67
  } = params;
82
68
  const keys = createKeys(system);
83
-
84
69
  try {
85
- await entity.put(_objectSpread(_objectSpread({}, system), keys));
70
+ await (0, _dbDynamodb.put)({
71
+ entity,
72
+ item: {
73
+ ...system,
74
+ ...keys
75
+ }
76
+ });
86
77
  return system;
87
78
  } catch (ex) {
88
79
  throw new _error.default(ex.message || "Could not update the system record by given keys.", ex.code || "UPDATE_SYSTEM_ERROR", {
@@ -92,7 +83,6 @@ const createSystemStorageOperations = params => {
92
83
  });
93
84
  }
94
85
  };
95
-
96
86
  return {
97
87
  createSystem,
98
88
  getSystem,
@@ -101,5 +91,6 @@ const createSystemStorageOperations = params => {
101
91
  createSystemSortKey
102
92
  };
103
93
  };
94
+ exports.createSystemStorageOperations = createSystemStorageOperations;
104
95
 
105
- exports.createSystemStorageOperations = createSystemStorageOperations;
96
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_get","_dbDynamodb","createSystemStorageOperations","params","entity","createSystemPartitionKey","tenant","createSystemSortKey","createKeys","PK","SK","createSystem","system","keys","put","item","ex","WebinyError","message","code","getSystem","getClean","updateSystem","original","exports"],"sources":["index.ts"],"sourcesContent":["import type {\n FormBuilderStorageOperationsCreateSystemParams,\n FormBuilderStorageOperationsGetSystemParams,\n FormBuilderStorageOperationsUpdateSystemParams,\n System\n} from \"@webiny/api-form-builder/types\";\nimport type { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type {\n FormBuilderSystemCreateKeysParams,\n FormBuilderSystemStorageOperations\n} from \"~/types\";\nimport WebinyError from \"@webiny/error\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { put } from \"@webiny/db-dynamodb\";\n\nexport interface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n table: Table<string, string, string>;\n}\n\nexport const createSystemStorageOperations = (\n params: CreateSystemStorageOperationsParams\n): FormBuilderSystemStorageOperations => {\n const { entity } = params;\n\n const createSystemPartitionKey = ({ tenant }: FormBuilderSystemCreateKeysParams): string => {\n return `T#${tenant}#SYSTEM`;\n };\n\n const createSystemSortKey = (): string => {\n return \"FB\";\n };\n\n const createKeys = (params: FormBuilderSystemCreateKeysParams) => {\n return {\n PK: createSystemPartitionKey(params),\n SK: createSystemSortKey()\n };\n };\n\n const createSystem = async (\n params: FormBuilderStorageOperationsCreateSystemParams\n ): Promise<System> => {\n const { system } = params;\n const keys = createKeys(system);\n\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create the system record by given keys.\",\n ex.code || \"CREATE_SYSTEM_ERROR\",\n {\n keys,\n system\n }\n );\n }\n };\n\n const getSystem = async (\n params: FormBuilderStorageOperationsGetSystemParams\n ): Promise<System | null> => {\n const keys = createKeys(params);\n\n try {\n return await getClean<System>({ entity, keys });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get the system record by given keys.\",\n ex.code || \"LOAD_SYSTEM_ERROR\",\n {\n keys\n }\n );\n }\n };\n\n const updateSystem = async (\n params: FormBuilderStorageOperationsUpdateSystemParams\n ): Promise<System> => {\n const { system, original } = params;\n const keys = createKeys(system);\n\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update the system record by given keys.\",\n ex.code || \"UPDATE_SYSTEM_ERROR\",\n {\n keys,\n original,\n system\n }\n );\n }\n };\n\n return {\n createSystem,\n getSystem,\n updateSystem,\n createSystemPartitionKey,\n createSystemSortKey\n };\n};\n"],"mappings":";;;;;;;AAWA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOO,MAAMG,6BAA6B,GACtCC,MAA2C,IACN;EACrC,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EAEzB,MAAME,wBAAwB,GAAGA,CAAC;IAAEC;EAA0C,CAAC,KAAa;IACxF,OAAO,KAAKA,MAAM,SAAS;EAC/B,CAAC;EAED,MAAMC,mBAAmB,GAAGA,CAAA,KAAc;IACtC,OAAO,IAAI;EACf,CAAC;EAED,MAAMC,UAAU,GAAIL,MAAyC,IAAK;IAC9D,OAAO;MACHM,EAAE,EAAEJ,wBAAwB,CAACF,MAAM,CAAC;MACpCO,EAAE,EAAEH,mBAAmB,CAAC;IAC5B,CAAC;EACL,CAAC;EAED,MAAMI,YAAY,GAAG,MACjBR,MAAsD,IACpC;IAClB,MAAM;MAAES;IAAO,CAAC,GAAGT,MAAM;IACzB,MAAMU,IAAI,GAAGL,UAAU,CAACI,MAAM,CAAC;IAE/B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNV,MAAM;QACNW,IAAI,EAAE;UACF,GAAGH,MAAM;UACT,GAAGC;QACP;MACJ,CAAC,CAAC;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOI,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,mDAAmD,EACjEF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIN,IAAI;QACJD;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMQ,SAAS,GAAG,MACdjB,MAAmD,IAC1B;IACzB,MAAMU,IAAI,GAAGL,UAAU,CAACL,MAAM,CAAC;IAE/B,IAAI;MACA,OAAO,MAAM,IAAAkB,aAAQ,EAAS;QAAEjB,MAAM;QAAES;MAAK,CAAC,CAAC;IACnD,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,gDAAgD,EAC9DF,EAAE,CAACG,IAAI,IAAI,mBAAmB,EAC9B;QACIN;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMS,YAAY,GAAG,MACjBnB,MAAsD,IACpC;IAClB,MAAM;MAAES,MAAM;MAAEW;IAAS,CAAC,GAAGpB,MAAM;IACnC,MAAMU,IAAI,GAAGL,UAAU,CAACI,MAAM,CAAC;IAE/B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNV,MAAM;QACNW,IAAI,EAAE;UACF,GAAGH,MAAM;UACT,GAAGC;QACP;MACJ,CAAC,CAAC;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOI,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,mDAAmD,EACjEF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIN,IAAI;QACJU,QAAQ;QACRX;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHD,YAAY;IACZS,SAAS;IACTE,YAAY;IACZjB,wBAAwB;IACxBE;EACJ,CAAC;AACL,CAAC;AAACiB,OAAA,CAAAtB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@webiny/api-form-builder-so-ddb",
3
- "version": "0.0.0-mt-2",
3
+ "version": "0.0.0-unstable.06b2ede40f",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "@webiny/api-form-builder",
7
7
  "storage-operations",
8
8
  "dynamodb",
9
+ "ddb",
9
10
  "fb:ddb"
10
11
  ],
11
12
  "repository": {
@@ -20,37 +21,30 @@
20
21
  ],
21
22
  "license": "MIT",
22
23
  "dependencies": {
23
- "@babel/runtime": "7.15.4",
24
- "@webiny/api-form-builder": "0.0.0-mt-2",
25
- "@webiny/db-dynamodb": "0.0.0-mt-2",
26
- "@webiny/error": "0.0.0-mt-2",
27
- "@webiny/plugins": "0.0.0-mt-2",
28
- "@webiny/utils": "0.0.0-mt-2",
29
- "dynamodb-toolbox": "0.3.4"
24
+ "@webiny/api": "0.0.0-unstable.06b2ede40f",
25
+ "@webiny/api-form-builder": "0.0.0-unstable.06b2ede40f",
26
+ "@webiny/aws-sdk": "0.0.0-unstable.06b2ede40f",
27
+ "@webiny/db-dynamodb": "0.0.0-unstable.06b2ede40f",
28
+ "@webiny/error": "0.0.0-unstable.06b2ede40f",
29
+ "@webiny/plugins": "0.0.0-unstable.06b2ede40f",
30
+ "@webiny/utils": "0.0.0-unstable.06b2ede40f"
30
31
  },
31
32
  "devDependencies": {
32
- "@babel/cli": "^7.5.5",
33
- "@babel/core": "^7.5.5",
34
- "@babel/preset-env": "^7.5.5",
35
- "@babel/preset-typescript": "^7.8.3",
36
- "@webiny/cli": "^0.0.0-mt-2",
37
- "@webiny/handler-db": "^0.0.0-mt-2",
38
- "@webiny/project-utils": "^0.0.0-mt-2",
39
- "csvtojson": "^2.0.10",
40
- "jest": "^26.6.3",
41
- "jest-dynalite": "^3.2.0",
42
- "jest-environment-node": "^27.2.4",
43
- "rimraf": "^3.0.2",
44
- "ttypescript": "^1.5.12",
45
- "typescript": "^4.1.3"
33
+ "@webiny/handler-db": "0.0.0-unstable.06b2ede40f",
34
+ "@webiny/project-utils": "0.0.0-unstable.06b2ede40f",
35
+ "csvtojson": "2.0.10",
36
+ "jest": "29.7.0",
37
+ "jest-dynalite": "3.6.1",
38
+ "rimraf": "6.0.1",
39
+ "typescript": "5.3.3"
46
40
  },
47
41
  "publishConfig": {
48
42
  "access": "public",
49
43
  "directory": "dist"
50
44
  },
51
45
  "scripts": {
52
- "build": "yarn webiny run build",
53
- "watch": "yarn webiny run watch"
46
+ "build": "node ../cli/bin.js run build",
47
+ "watch": "node ../cli/bin.js run watch"
54
48
  },
55
- "gitHead": "3c0dcfb3c22c9f83107fdb97b25014cd03d9db7d"
49
+ "gitHead": "06b2ede40fc2212a70eeafd74afd50b56fb0ce82"
56
50
  }
@@ -1,17 +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.FormDynamoDbFieldPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
7
  var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin");
13
-
14
- class FormDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
15
-
8
+ class FormDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {
9
+ static type = "formBuilder.dynamodb.field.form";
10
+ }
16
11
  exports.FormDynamoDbFieldPlugin = FormDynamoDbFieldPlugin;
17
- (0, _defineProperty2.default)(FormDynamoDbFieldPlugin, "type", "formBuilder.dynamodb.field.form");
12
+
13
+ //# sourceMappingURL=FormDynamoDbFieldPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FieldPlugin","require","FormDynamoDbFieldPlugin","FieldPlugin","type","exports"],"sources":["FormDynamoDbFieldPlugin.ts"],"sourcesContent":["import { FieldPlugin } from \"@webiny/db-dynamodb/plugins/definitions/FieldPlugin\";\n\nexport class FormDynamoDbFieldPlugin extends FieldPlugin {\n public static override readonly type: string = \"formBuilder.dynamodb.field.form\";\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,uBAAuB,SAASC,wBAAW,CAAC;EACrD,OAAgCC,IAAI,GAAW,iCAAiC;AACpF;AAACC,OAAA,CAAAH,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -1,17 +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.FormSubmissionDynamoDbFieldPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
7
  var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin");
13
-
14
- class FormSubmissionDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
15
-
8
+ class FormSubmissionDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {
9
+ static type = "formBuilder.dynamodb.field.formSubmission";
10
+ }
16
11
  exports.FormSubmissionDynamoDbFieldPlugin = FormSubmissionDynamoDbFieldPlugin;
17
- (0, _defineProperty2.default)(FormSubmissionDynamoDbFieldPlugin, "type", "formBuilder.dynamodb.field.formSubmission");
12
+
13
+ //# sourceMappingURL=FormSubmissionDynamoDbFieldPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FieldPlugin","require","FormSubmissionDynamoDbFieldPlugin","FieldPlugin","type","exports"],"sources":["FormSubmissionDynamoDbFieldPlugin.ts"],"sourcesContent":["import { FieldPlugin } from \"@webiny/db-dynamodb/plugins/definitions/FieldPlugin\";\n\nexport class FormSubmissionDynamoDbFieldPlugin extends FieldPlugin {\n public static override readonly type: string = \"formBuilder.dynamodb.field.formSubmission\";\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,iCAAiC,SAASC,wBAAW,CAAC;EAC/D,OAAgCC,IAAI,GAAW,2CAA2C;AAC9F;AAACC,OAAA,CAAAH,iCAAA,GAAAA,iCAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./FormDynamoDbFieldPlugin";
2
+ export * from "./FormSubmissionDynamoDbFieldPlugin";
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _FormDynamoDbFieldPlugin = require("./FormDynamoDbFieldPlugin");
7
+ Object.keys(_FormDynamoDbFieldPlugin).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _FormDynamoDbFieldPlugin[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _FormDynamoDbFieldPlugin[key];
14
+ }
15
+ });
16
+ });
17
+ var _FormSubmissionDynamoDbFieldPlugin = require("./FormSubmissionDynamoDbFieldPlugin");
18
+ Object.keys(_FormSubmissionDynamoDbFieldPlugin).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _FormSubmissionDynamoDbFieldPlugin[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _FormSubmissionDynamoDbFieldPlugin[key];
25
+ }
26
+ });
27
+ });
28
+
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FormDynamoDbFieldPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_FormSubmissionDynamoDbFieldPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./FormDynamoDbFieldPlugin\";\nexport * from \"./FormSubmissionDynamoDbFieldPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,wBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,wBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,wBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kCAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kCAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kCAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,kCAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
package/types.d.ts CHANGED
@@ -1,11 +1,9 @@
1
- import { FormBuilderStorageOperations as BaseFormBuilderStorageOperations, FormBuilderSystemStorageOperations as BaseFormBuilderSystemStorageOperations, FormBuilderSubmissionStorageOperations as BaseFormBuilderSubmissionStorageOperations, FormBuilderSettingsStorageOperations as BaseFormBuilderSettingsStorageOperations, FormBuilderFormStorageOperations as BaseFormBuilderFormStorageOperations } from "@webiny/api-form-builder/types";
2
- import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
- import { Table, Entity } from "dynamodb-toolbox";
4
- import { DynamoDBTypes } from "dynamodb-toolbox/dist/classes/Table";
5
- import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
6
- import { Plugin } from "@webiny/plugins";
7
- export declare type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
8
- export declare type Attributes = Record<string, AttributeDefinition>;
1
+ import type { FormBuilderStorageOperations as BaseFormBuilderStorageOperations, FormBuilderSystemStorageOperations as BaseFormBuilderSystemStorageOperations, FormBuilderSubmissionStorageOperations as BaseFormBuilderSubmissionStorageOperations, FormBuilderSettingsStorageOperations as BaseFormBuilderSettingsStorageOperations, FormBuilderFormStorageOperations as BaseFormBuilderFormStorageOperations } from "@webiny/api-form-builder/types";
2
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
3
+ import type { Entity, Table } from "@webiny/db-dynamodb/toolbox";
4
+ import type { AttributeDefinition } from "@webiny/db-dynamodb/toolbox";
5
+ import type { Plugin } from "@webiny/plugins";
6
+ export type Attributes = Record<string, AttributeDefinition>;
9
7
  export declare enum ENTITIES {
10
8
  FORM = "FormBuilderForm",
11
9
  SUBMISSION = "FormBuilderSubmission",
@@ -13,7 +11,7 @@ export declare enum ENTITIES {
13
11
  SETTINGS = "FormBuilderSettings"
14
12
  }
15
13
  export interface FormBuilderStorageOperationsFactoryParams {
16
- documentClient: DocumentClient;
14
+ documentClient: DynamoDBDocument;
17
15
  table?: string;
18
16
  attributes?: Record<ENTITIES, Attributes>;
19
17
  plugins?: Plugin;
@@ -55,9 +53,9 @@ export interface FormBuilderSettingsStorageOperations extends BaseFormBuilderSet
55
53
  createSettingsPartitionKey: (params: FormBuilderSettingsStorageOperationsCreatePartitionKeyParams) => string;
56
54
  createSettingsSortKey: () => string;
57
55
  }
58
- export declare type Entities = "form" | "submission" | "system" | "settings";
56
+ export type Entities = "form" | "submission" | "system" | "settings";
59
57
  export interface FormBuilderStorageOperations extends BaseFormBuilderStorageOperations, FormBuilderSettingsStorageOperations, FormBuilderSubmissionStorageOperations, FormBuilderFormStorageOperations, FormBuilderSystemStorageOperations {
60
- getTable(): Table;
58
+ getTable(): Table<string, string, string>;
61
59
  getEntities(): Record<Entities, Entity<any>>;
62
60
  }
63
61
  export interface FormBuilderStorageOperationsFactory {
package/types.js CHANGED
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ENTITIES = void 0;
7
- let ENTITIES;
8
- exports.ENTITIES = ENTITIES;
9
-
10
- (function (ENTITIES) {
7
+ let ENTITIES = exports.ENTITIES = /*#__PURE__*/function (ENTITIES) {
11
8
  ENTITIES["FORM"] = "FormBuilderForm";
12
9
  ENTITIES["SUBMISSION"] = "FormBuilderSubmission";
13
10
  ENTITIES["SYSTEM"] = "FormBuilderSystem";
14
11
  ENTITIES["SETTINGS"] = "FormBuilderSettings";
15
- })(ENTITIES || (exports.ENTITIES = ENTITIES = {}));
12
+ return ENTITIES;
13
+ }({});
14
+
15
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import type {\n FormBuilderStorageOperations as BaseFormBuilderStorageOperations,\n FormBuilderSystemStorageOperations as BaseFormBuilderSystemStorageOperations,\n FormBuilderSubmissionStorageOperations as BaseFormBuilderSubmissionStorageOperations,\n FormBuilderSettingsStorageOperations as BaseFormBuilderSettingsStorageOperations,\n FormBuilderFormStorageOperations as BaseFormBuilderFormStorageOperations\n} from \"@webiny/api-form-builder/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { AttributeDefinition } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Plugin } from \"@webiny/plugins\";\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n FORM = \"FormBuilderForm\",\n SUBMISSION = \"FormBuilderSubmission\",\n SYSTEM = \"FormBuilderSystem\",\n SETTINGS = \"FormBuilderSettings\"\n}\n\nexport interface FormBuilderStorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n table?: string;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin;\n}\n\nexport interface FormBuilderSystemCreateKeysParams {\n tenant: string;\n}\n\nexport interface FormBuilderSystemStorageOperations extends BaseFormBuilderSystemStorageOperations {\n createSystemPartitionKey: (params: FormBuilderSystemCreateKeysParams) => string;\n createSystemSortKey: () => string;\n}\n\nexport interface FormBuilderFormCreatePartitionKeyParams {\n tenant: string;\n locale: string;\n}\n\nexport interface FormBuilderFormCreateGSIPartitionKeyParams {\n id?: string;\n formId?: string;\n tenant: string;\n locale: string;\n}\n\nexport interface FormBuilderFormStorageOperations extends BaseFormBuilderFormStorageOperations {\n createFormPartitionKey: (params: FormBuilderFormCreatePartitionKeyParams) => string;\n}\n\nexport interface FormBuilderSubmissionStorageOperationsCreatePartitionKeyParams {\n tenant: string;\n locale: string;\n formId: string;\n}\n\nexport interface FormBuilderSubmissionStorageOperations\n extends BaseFormBuilderSubmissionStorageOperations {\n createSubmissionPartitionKey: (\n params: FormBuilderSubmissionStorageOperationsCreatePartitionKeyParams\n ) => string;\n createSubmissionSortKey: (id: string) => string;\n}\n\nexport interface FormBuilderSettingsStorageOperationsCreatePartitionKeyParams {\n tenant: string;\n locale: string;\n}\n\nexport interface FormBuilderSettingsStorageOperations\n extends BaseFormBuilderSettingsStorageOperations {\n createSettingsPartitionKey: (\n params: FormBuilderSettingsStorageOperationsCreatePartitionKeyParams\n ) => string;\n createSettingsSortKey: () => string;\n}\n\nexport type Entities = \"form\" | \"submission\" | \"system\" | \"settings\";\n\nexport interface FormBuilderStorageOperations\n extends BaseFormBuilderStorageOperations,\n FormBuilderSettingsStorageOperations,\n FormBuilderSubmissionStorageOperations,\n FormBuilderFormStorageOperations,\n FormBuilderSystemStorageOperations {\n getTable(): Table<string, string, string>;\n getEntities(): Record<Entities, Entity<any>>;\n}\n\nexport interface FormBuilderStorageOperationsFactory {\n (params: FormBuilderStorageOperationsFactoryParams): FormBuilderStorageOperations;\n}\n"],"mappings":";;;;;;IAcYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}