@webiny/api-form-builder-so-ddb 5.34.8 → 5.35.0-beta.1

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.
@@ -1,48 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createSystemStorageOperations = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
13
-
14
10
  var _error = _interopRequireDefault(require("@webiny/error"));
15
-
16
11
  var _get = require("@webiny/db-dynamodb/utils/get");
17
-
18
12
  const createSystemStorageOperations = params => {
19
13
  const {
20
14
  entity
21
15
  } = params;
22
-
23
16
  const createSystemPartitionKey = ({
24
17
  tenant
25
18
  }) => {
26
19
  return `T#${tenant}#SYSTEM`;
27
20
  };
28
-
29
21
  const createSystemSortKey = () => {
30
22
  return "FB";
31
23
  };
32
-
33
24
  const createKeys = params => {
34
25
  return {
35
26
  PK: createSystemPartitionKey(params),
36
27
  SK: createSystemSortKey()
37
28
  };
38
29
  };
39
-
40
30
  const createSystem = async params => {
41
31
  const {
42
32
  system
43
33
  } = params;
44
34
  const keys = createKeys(system);
45
-
46
35
  try {
47
36
  await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)({}, system), keys));
48
37
  return system;
@@ -53,10 +42,8 @@ const createSystemStorageOperations = params => {
53
42
  });
54
43
  }
55
44
  };
56
-
57
45
  const getSystem = async params => {
58
46
  const keys = createKeys(params);
59
-
60
47
  try {
61
48
  const item = await (0, _get.get)({
62
49
  entity,
@@ -69,14 +56,12 @@ const createSystemStorageOperations = params => {
69
56
  });
70
57
  }
71
58
  };
72
-
73
59
  const updateSystem = async params => {
74
60
  const {
75
61
  system,
76
62
  original
77
63
  } = params;
78
64
  const keys = createKeys(system);
79
-
80
65
  try {
81
66
  await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)({}, system), keys));
82
67
  return system;
@@ -88,7 +73,6 @@ const createSystemStorageOperations = params => {
88
73
  });
89
74
  }
90
75
  };
91
-
92
76
  return {
93
77
  createSystem,
94
78
  getSystem,
@@ -97,5 +81,4 @@ const createSystemStorageOperations = params => {
97
81
  createSystemSortKey
98
82
  };
99
83
  };
100
-
101
84
  exports.createSystemStorageOperations = createSystemStorageOperations;
@@ -1 +1 @@
1
- {"version":3,"names":["createSystemStorageOperations","params","entity","createSystemPartitionKey","tenant","createSystemSortKey","createKeys","PK","SK","createSystem","system","keys","put","ex","WebinyError","message","code","getSystem","item","get","cleanupItem","updateSystem","original"],"sources":["index.ts"],"sourcesContent":["import {\n FormBuilderStorageOperationsCreateSystemParams,\n FormBuilderStorageOperationsGetSystemParams,\n FormBuilderStorageOperationsUpdateSystemParams,\n System\n} from \"@webiny/api-form-builder/types\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\nimport { FormBuilderSystemCreateKeysParams, FormBuilderSystemStorageOperations } from \"~/types\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport WebinyError from \"@webiny/error\";\nimport { get } from \"@webiny/db-dynamodb/utils/get\";\n\nexport interface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n table: Table;\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 entity.put({\n ...system,\n ...keys\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 const item = await get<System>({ entity, keys });\n return cleanupItem(entity, item);\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 entity.put({\n ...system,\n ...keys\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":";;;;;;;;;;;AAQA;;AACA;;AACA;;AAOO,MAAMA,6BAA6B,GACtCC,MADyC,IAEJ;EACrC,MAAM;IAAEC;EAAF,IAAaD,MAAnB;;EAEA,MAAME,wBAAwB,GAAG,CAAC;IAAEC;EAAF,CAAD,KAA2D;IACxF,OAAQ,KAAIA,MAAO,SAAnB;EACH,CAFD;;EAIA,MAAMC,mBAAmB,GAAG,MAAc;IACtC,OAAO,IAAP;EACH,CAFD;;EAIA,MAAMC,UAAU,GAAIL,MAAD,IAA+C;IAC9D,OAAO;MACHM,EAAE,EAAEJ,wBAAwB,CAACF,MAAD,CADzB;MAEHO,EAAE,EAAEH,mBAAmB;IAFpB,CAAP;EAIH,CALD;;EAOA,MAAMI,YAAY,GAAG,MACjBR,MADiB,IAEC;IAClB,MAAM;MAAES;IAAF,IAAaT,M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,CAAN;IASH;EACJ,CAvBD;;EAyBA,OAAO;IACHD,YADG;IAEHQ,SAFG;IAGHI,YAHG;IAIHlB,wBAJG;IAKHE;EALG,CAAP;AAOH,CA/FM"}
1
+ {"version":3,"names":["createSystemStorageOperations","params","entity","createSystemPartitionKey","tenant","createSystemSortKey","createKeys","PK","SK","createSystem","system","keys","put","ex","WebinyError","message","code","getSystem","item","get","cleanupItem","updateSystem","original"],"sources":["index.ts"],"sourcesContent":["import {\n FormBuilderStorageOperationsCreateSystemParams,\n FormBuilderStorageOperationsGetSystemParams,\n FormBuilderStorageOperationsUpdateSystemParams,\n System\n} from \"@webiny/api-form-builder/types\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\nimport { FormBuilderSystemCreateKeysParams, FormBuilderSystemStorageOperations } from \"~/types\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport WebinyError from \"@webiny/error\";\nimport { get } from \"@webiny/db-dynamodb/utils/get\";\n\nexport interface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n table: Table;\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 entity.put({\n ...system,\n ...keys\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 const item = await get<System>({ entity, keys });\n return cleanupItem(entity, item);\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 entity.put({\n ...system,\n ...keys\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":";;;;;;;;AAQA;AACA;AACA;AAOO,MAAMA,6BAA6B,GACtCC,MAA2C,IACN;EACrC,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EAEzB,MAAME,wBAAwB,GAAG,CAAC;IAAEC;EAA0C,CAAC,KAAa;IACxF,OAAQ,KAAIA,MAAO,SAAQ;EAC/B,CAAC;EAED,MAAMC,mBAAmB,GAAG,MAAc;IACtC,OAAO,IAAI;EACf,CAAC;EAED,MAAMC,UAAU,GAAIL,MAAyC,IAAK;IAC9D,OAAO;MACHM,EAAE,EAAEJ,wBAAwB,CAACF,MAAM,CAAC;MACpCO,EAAE,EAAEH,mBAAmB;IAC3B,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,MAAMR,MAAM,CAACU,GAAG,6DACTF,MAAM,GACNC,IAAI,EACT;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,c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"version": "5.34.8",
3
+ "version": "5.35.0-beta.1",
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.19.0",
24
- "@webiny/api-form-builder": "5.34.8",
25
- "@webiny/db-dynamodb": "5.34.8",
26
- "@webiny/error": "5.34.8",
27
- "@webiny/plugins": "5.34.8",
28
- "@webiny/utils": "5.34.8",
23
+ "@babel/runtime": "7.20.13",
24
+ "@webiny/api-form-builder": "5.35.0-beta.1",
25
+ "@webiny/db-dynamodb": "5.35.0-beta.1",
26
+ "@webiny/error": "5.35.0-beta.1",
27
+ "@webiny/plugins": "5.35.0-beta.1",
28
+ "@webiny/utils": "5.35.0-beta.1",
29
29
  "dynamodb-toolbox": "0.3.5"
30
30
  },
31
31
  "devDependencies": {
@@ -33,9 +33,9 @@
33
33
  "@babel/core": "^7.19.3",
34
34
  "@babel/preset-env": "^7.19.4",
35
35
  "@babel/preset-typescript": "^7.18.6",
36
- "@webiny/cli": "^5.34.8",
37
- "@webiny/handler-db": "^5.34.8",
38
- "@webiny/project-utils": "^5.34.8",
36
+ "@webiny/cli": "^5.35.0-beta.1",
37
+ "@webiny/handler-db": "^5.35.0-beta.1",
38
+ "@webiny/project-utils": "^5.35.0-beta.1",
39
39
  "csvtojson": "^2.0.10",
40
40
  "jest": "^28.1.0",
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": "6e77eebaac687279fe82ea04f667b7e84214b96a"
55
+ "gitHead": "6b376faedf02e056efbbf1e4d46d537850773ce0"
56
56
  }
@@ -1,17 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.FormDynamoDbFieldPlugin = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin");
13
-
14
10
  class FormDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
15
-
16
11
  exports.FormDynamoDbFieldPlugin = FormDynamoDbFieldPlugin;
17
12
  (0, _defineProperty2.default)(FormDynamoDbFieldPlugin, "type", "formBuilder.dynamodb.field.form");
@@ -1 +1 @@
1
- {"version":3,"names":["FormDynamoDbFieldPlugin","FieldPlugin"],"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;;AAEO,MAAMA,uBAAN,SAAsCC,wBAAtC,CAAkD;;;8BAA5CD,uB,UACsC,iC"}
1
+ {"version":3,"names":["FormDynamoDbFieldPlugin","FieldPlugin"],"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;AAEO,MAAMA,uBAAuB,SAASC,wBAAW,CAAC;AAExD;AAAA,8BAFYD,uBAAuB,UACe,iCAAiC"}
@@ -1,17 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.FormSubmissionDynamoDbFieldPlugin = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin");
13
-
14
10
  class FormSubmissionDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
15
-
16
11
  exports.FormSubmissionDynamoDbFieldPlugin = FormSubmissionDynamoDbFieldPlugin;
17
12
  (0, _defineProperty2.default)(FormSubmissionDynamoDbFieldPlugin, "type", "formBuilder.dynamodb.field.formSubmission");
@@ -1 +1 @@
1
- {"version":3,"names":["FormSubmissionDynamoDbFieldPlugin","FieldPlugin"],"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;;AAEO,MAAMA,iCAAN,SAAgDC,wBAAhD,CAA4D;;;8BAAtDD,iC,UACsC,2C"}
1
+ {"version":3,"names":["FormSubmissionDynamoDbFieldPlugin","FieldPlugin"],"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;AAEO,MAAMA,iCAAiC,SAASC,wBAAW,CAAC;AAElE;AAAA,8BAFYD,iCAAiC,UACK,2CAA2C"}
@@ -0,0 +1,2 @@
1
+ export * from "./FormDynamoDbFieldPlugin";
2
+ export * from "./FormSubmissionDynamoDbFieldPlugin";
@@ -0,0 +1,27 @@
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
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./FormDynamoDbFieldPlugin\";\nexport * from \"./FormSubmissionDynamoDbFieldPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
package/types.js CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ENTITIES = void 0;
7
7
  let ENTITIES;
8
8
  exports.ENTITIES = ENTITIES;
9
-
10
9
  (function (ENTITIES) {
11
10
  ENTITIES["FORM"] = "FormBuilderForm";
12
11
  ENTITIES["SUBMISSION"] = "FormBuilderSubmission";
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import {\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 { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table, Entity } from \"dynamodb-toolbox\";\nimport { DynamoDBTypes } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\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: DocumentClient;\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;\n getEntities(): Record<Entities, Entity<any>>;\n}\n\nexport interface FormBuilderStorageOperationsFactory {\n (params: FormBuilderStorageOperationsFactoryParams): FormBuilderStorageOperations;\n}\n"],"mappings":";;;;;;IAoBYA,Q;;;WAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,wBAAAA,Q"}
1
+ {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import {\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 { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table, Entity } from \"dynamodb-toolbox\";\nimport { DynamoDBTypes } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\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: DocumentClient;\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;\n getEntities(): Record<Entities, Entity<any>>;\n}\n\nexport interface FormBuilderStorageOperationsFactory {\n (params: FormBuilderStorageOperationsFactoryParams): FormBuilderStorageOperations;\n}\n"],"mappings":";;;;;;IAoBYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ"}