@webiny/api-form-builder-so-ddb 0.0.0-mt-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.
- package/LICENSE +21 -0
- package/README.md +13 -0
- package/definitions/form.d.ts +8 -0
- package/definitions/form.js +110 -0
- package/definitions/settings.d.ts +8 -0
- package/definitions/settings.js +53 -0
- package/definitions/submission.d.ts +8 -0
- package/definitions/submission.js +74 -0
- package/definitions/system.d.ts +8 -0
- package/definitions/system.js +44 -0
- package/definitions/table.d.ts +7 -0
- package/definitions/table.js +29 -0
- package/index.d.ts +2 -0
- package/index.js +139 -0
- package/operations/form/fields.d.ts +3 -0
- package/operations/form/fields.js +43 -0
- package/operations/form/index.d.ts +9 -0
- package/operations/form/index.js +745 -0
- package/operations/settings/index.d.ts +7 -0
- package/operations/settings/index.js +122 -0
- package/operations/submission/fields.d.ts +3 -0
- package/operations/submission/fields.js +18 -0
- package/operations/submission/index.d.ts +9 -0
- package/operations/submission/index.js +247 -0
- package/operations/system/index.d.ts +7 -0
- package/operations/system/index.js +105 -0
- package/package.json +56 -0
- package/plugins/FormDynamoDbFieldPlugin.d.ts +4 -0
- package/plugins/FormDynamoDbFieldPlugin.js +17 -0
- package/plugins/FormSubmissionDynamoDbFieldPlugin.d.ts +4 -0
- package/plugins/FormSubmissionDynamoDbFieldPlugin.js +17 -0
- package/types.d.ts +65 -0
- package/types.js +15 -0
package/types.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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>;
|
|
9
|
+
export declare enum ENTITIES {
|
|
10
|
+
FORM = "FormBuilderForm",
|
|
11
|
+
SUBMISSION = "FormBuilderSubmission",
|
|
12
|
+
SYSTEM = "FormBuilderSystem",
|
|
13
|
+
SETTINGS = "FormBuilderSettings"
|
|
14
|
+
}
|
|
15
|
+
export interface FormBuilderStorageOperationsFactoryParams {
|
|
16
|
+
documentClient: DocumentClient;
|
|
17
|
+
table?: string;
|
|
18
|
+
attributes?: Record<ENTITIES, Attributes>;
|
|
19
|
+
plugins?: Plugin;
|
|
20
|
+
}
|
|
21
|
+
export interface FormBuilderSystemCreateKeysParams {
|
|
22
|
+
tenant: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FormBuilderSystemStorageOperations extends BaseFormBuilderSystemStorageOperations {
|
|
25
|
+
createSystemPartitionKey: (params: FormBuilderSystemCreateKeysParams) => string;
|
|
26
|
+
createSystemSortKey: () => string;
|
|
27
|
+
}
|
|
28
|
+
export interface FormBuilderFormCreatePartitionKeyParams {
|
|
29
|
+
tenant: string;
|
|
30
|
+
locale: string;
|
|
31
|
+
}
|
|
32
|
+
export interface FormBuilderFormCreateGSIPartitionKeyParams {
|
|
33
|
+
id?: string;
|
|
34
|
+
formId?: string;
|
|
35
|
+
tenant: string;
|
|
36
|
+
locale: string;
|
|
37
|
+
}
|
|
38
|
+
export interface FormBuilderFormStorageOperations extends BaseFormBuilderFormStorageOperations {
|
|
39
|
+
createFormPartitionKey: (params: FormBuilderFormCreatePartitionKeyParams) => string;
|
|
40
|
+
}
|
|
41
|
+
export interface FormBuilderSubmissionStorageOperationsCreatePartitionKeyParams {
|
|
42
|
+
tenant: string;
|
|
43
|
+
locale: string;
|
|
44
|
+
formId: string;
|
|
45
|
+
}
|
|
46
|
+
export interface FormBuilderSubmissionStorageOperations extends BaseFormBuilderSubmissionStorageOperations {
|
|
47
|
+
createSubmissionPartitionKey: (params: FormBuilderSubmissionStorageOperationsCreatePartitionKeyParams) => string;
|
|
48
|
+
createSubmissionSortKey: (id: string) => string;
|
|
49
|
+
}
|
|
50
|
+
export interface FormBuilderSettingsStorageOperationsCreatePartitionKeyParams {
|
|
51
|
+
tenant: string;
|
|
52
|
+
locale: string;
|
|
53
|
+
}
|
|
54
|
+
export interface FormBuilderSettingsStorageOperations extends BaseFormBuilderSettingsStorageOperations {
|
|
55
|
+
createSettingsPartitionKey: (params: FormBuilderSettingsStorageOperationsCreatePartitionKeyParams) => string;
|
|
56
|
+
createSettingsSortKey: () => string;
|
|
57
|
+
}
|
|
58
|
+
export declare type Entities = "form" | "submission" | "system" | "settings";
|
|
59
|
+
export interface FormBuilderStorageOperations extends BaseFormBuilderStorageOperations, FormBuilderSettingsStorageOperations, FormBuilderSubmissionStorageOperations, FormBuilderFormStorageOperations, FormBuilderSystemStorageOperations {
|
|
60
|
+
getTable(): Table;
|
|
61
|
+
getEntities(): Record<Entities, Entity<any>>;
|
|
62
|
+
}
|
|
63
|
+
export interface FormBuilderStorageOperationsFactory {
|
|
64
|
+
(params: FormBuilderStorageOperationsFactoryParams): FormBuilderStorageOperations;
|
|
65
|
+
}
|
package/types.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ENTITIES = void 0;
|
|
7
|
+
let ENTITIES;
|
|
8
|
+
exports.ENTITIES = ENTITIES;
|
|
9
|
+
|
|
10
|
+
(function (ENTITIES) {
|
|
11
|
+
ENTITIES["FORM"] = "FormBuilderForm";
|
|
12
|
+
ENTITIES["SUBMISSION"] = "FormBuilderSubmission";
|
|
13
|
+
ENTITIES["SYSTEM"] = "FormBuilderSystem";
|
|
14
|
+
ENTITIES["SETTINGS"] = "FormBuilderSettings";
|
|
15
|
+
})(ENTITIES || (exports.ENTITIES = ENTITIES = {}));
|