@webiny/api-form-builder-so-ddb-es 0.0.0-mt-2 → 0.0.0-unstable.1e66d121db
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/configurations.d.ts +7 -5
- package/configurations.js +31 -9
- package/configurations.js.map +1 -0
- package/definitions/elasticsearch.d.ts +2 -1
- package/definitions/elasticsearch.js +3 -7
- package/definitions/elasticsearch.js.map +1 -0
- package/definitions/form.d.ts +2 -1
- package/definitions/form.js +3 -7
- package/definitions/form.js.map +1 -0
- package/definitions/settings.d.ts +2 -1
- package/definitions/settings.js +3 -7
- package/definitions/settings.js.map +1 -0
- package/definitions/submission.d.ts +2 -1
- package/definitions/submission.js +3 -7
- package/definitions/submission.js.map +1 -0
- package/definitions/system.d.ts +2 -1
- package/definitions/system.js +3 -7
- package/definitions/system.js.map +1 -0
- package/definitions/table.d.ts +3 -2
- package/definitions/table.js.map +1 -0
- package/definitions/tableElasticsearch.d.ts +2 -1
- package/definitions/tableElasticsearch.js.map +1 -0
- package/elasticsearch/createElasticsearchIndex.d.ts +10 -0
- package/elasticsearch/createElasticsearchIndex.js +63 -0
- package/elasticsearch/createElasticsearchIndex.js.map +1 -0
- package/elasticsearch/indices/base.d.ts +2 -0
- package/elasticsearch/indices/base.js +19 -0
- package/elasticsearch/indices/base.js.map +1 -0
- package/elasticsearch/indices/index.d.ts +1 -0
- package/elasticsearch/indices/index.js +16 -0
- package/elasticsearch/indices/index.js.map +1 -0
- package/elasticsearch/indices/japanese.d.ts +2 -0
- package/elasticsearch/indices/japanese.js +20 -0
- package/elasticsearch/indices/japanese.js.map +1 -0
- package/index.js +35 -32
- package/index.js.map +1 -0
- package/operations/form/elasticsearchBody.js +8 -17
- package/operations/form/elasticsearchBody.js.map +1 -0
- package/operations/form/elasticsearchFields.js.map +1 -0
- package/operations/form/fields.js.map +1 -0
- package/operations/form/index.d.ts +2 -2
- package/operations/form/index.js +49 -48
- package/operations/form/index.js.map +1 -0
- package/operations/settings/index.d.ts +2 -2
- package/operations/settings/index.js +4 -8
- package/operations/settings/index.js.map +1 -0
- package/operations/submission/elasticsearchBody.js +10 -12
- package/operations/submission/elasticsearchBody.js.map +1 -0
- package/operations/submission/elasticsearchFields.js.map +1 -0
- package/operations/submission/index.d.ts +2 -2
- package/operations/submission/index.js +19 -22
- package/operations/submission/index.js.map +1 -0
- package/operations/system/index.d.ts +2 -2
- package/operations/system/index.js +4 -8
- package/operations/system/index.js.map +1 -0
- package/package.json +23 -27
- package/plugins/FormDynamoDbFieldPlugin.js +1 -1
- package/plugins/FormDynamoDbFieldPlugin.js.map +1 -0
- package/plugins/FormElasticsearchBodyModifierPlugin.js +1 -1
- package/plugins/FormElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/FormElasticsearchFieldPlugin.js +1 -1
- package/plugins/FormElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/FormElasticsearchIndexPlugin.d.ts +4 -0
- package/plugins/FormElasticsearchIndexPlugin.js +17 -0
- package/plugins/FormElasticsearchIndexPlugin.js.map +1 -0
- package/plugins/FormElasticsearchQueryModifierPlugin.js +1 -1
- package/plugins/FormElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/FormElasticsearchSortModifierPlugin.js +1 -1
- package/plugins/FormElasticsearchSortModifierPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js +1 -1
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchFieldPlugin.js +1 -1
- package/plugins/SubmissionElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js +1 -1
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js +1 -1
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js.map +1 -0
- package/types.d.ts +2 -2
- package/types.js.map +1 -0
- package/operations/system/createElasticsearchIndex.d.ts +0 -6
- package/operations/system/createElasticsearchIndex.js +0 -70
- package/upgrades/5.16.0/index.d.ts +0 -8
- package/upgrades/5.16.0/index.js +0 -141
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-form-builder-so-ddb-es",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-unstable.1e66d121db",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-form-builder",
|
|
@@ -21,39 +21,35 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/runtime": "7.
|
|
24
|
+
"@babel/runtime": "7.19.0",
|
|
25
25
|
"@elastic/elasticsearch": "7.12.0",
|
|
26
|
-
"@webiny/api
|
|
27
|
-
"@webiny/api-
|
|
28
|
-
"@webiny/api-
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"@webiny/plugins": "0.0.0-mt-2",
|
|
36
|
-
"@webiny/utils": "0.0.0-mt-2",
|
|
37
|
-
"dynamodb-toolbox": "0.3.4",
|
|
38
|
-
"elastic-ts": "0.7.0"
|
|
26
|
+
"@webiny/api": "0.0.0-unstable.1e66d121db",
|
|
27
|
+
"@webiny/api-elasticsearch": "0.0.0-unstable.1e66d121db",
|
|
28
|
+
"@webiny/api-form-builder": "0.0.0-unstable.1e66d121db",
|
|
29
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.1e66d121db",
|
|
30
|
+
"@webiny/error": "0.0.0-unstable.1e66d121db",
|
|
31
|
+
"@webiny/plugins": "0.0.0-unstable.1e66d121db",
|
|
32
|
+
"@webiny/utils": "0.0.0-unstable.1e66d121db",
|
|
33
|
+
"dynamodb-toolbox": "0.3.5",
|
|
34
|
+
"elastic-ts": "0.8.0"
|
|
39
35
|
},
|
|
40
36
|
"devDependencies": {
|
|
41
|
-
"@babel/cli": "^7.
|
|
42
|
-
"@babel/core": "^7.
|
|
43
|
-
"@babel/preset-env": "^7.
|
|
44
|
-
"@babel/preset-typescript": "^7.
|
|
45
|
-
"@
|
|
46
|
-
"@webiny/
|
|
47
|
-
"@webiny/
|
|
48
|
-
"@webiny/handler-db": "^0.0.0-
|
|
49
|
-
"@webiny/project-utils": "^0.0.0-
|
|
37
|
+
"@babel/cli": "^7.19.3",
|
|
38
|
+
"@babel/core": "^7.19.3",
|
|
39
|
+
"@babel/preset-env": "^7.19.4",
|
|
40
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
41
|
+
"@webiny/api-dynamodb-to-elasticsearch": "^0.0.0-unstable.1e66d121db",
|
|
42
|
+
"@webiny/cli": "^0.0.0-unstable.1e66d121db",
|
|
43
|
+
"@webiny/handler-aws": "^0.0.0-unstable.1e66d121db",
|
|
44
|
+
"@webiny/handler-db": "^0.0.0-unstable.1e66d121db",
|
|
45
|
+
"@webiny/project-utils": "^0.0.0-unstable.1e66d121db",
|
|
50
46
|
"csvtojson": "^2.0.10",
|
|
51
|
-
"jest": "^
|
|
47
|
+
"jest": "^28.1.0",
|
|
52
48
|
"jest-dynalite": "^3.2.0",
|
|
53
49
|
"jest-environment-node": "^27.2.4",
|
|
54
50
|
"rimraf": "^3.0.2",
|
|
55
51
|
"ttypescript": "^1.5.12",
|
|
56
|
-
"typescript": "
|
|
52
|
+
"typescript": "4.7.4"
|
|
57
53
|
},
|
|
58
54
|
"publishConfig": {
|
|
59
55
|
"access": "public",
|
|
@@ -63,5 +59,5 @@
|
|
|
63
59
|
"build": "yarn webiny run build",
|
|
64
60
|
"watch": "yarn webiny run watch"
|
|
65
61
|
},
|
|
66
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b670bf27c5039de1a2b0be764a09ba4cb94ad5e2"
|
|
67
63
|
}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin"],"sources":["FormElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import { ElasticsearchBodyModifierPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchBodyModifierPlugin\";\n\nexport class FormElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin {\n public static override readonly type: string = \"formBuilder.elasticsearch.modifier.body.form\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,mCAAN,SAAkDC,gEAAlD,CAAkF;;;8BAA5ED,mC,UACsC,8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormElasticsearchFieldPlugin","ElasticsearchFieldPlugin"],"sources":["FormElasticsearchFieldPlugin.ts"],"sourcesContent":["import { ElasticsearchFieldPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchFieldPlugin\";\n\nexport class FormElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {\n public static override readonly type: string = \"formBuilder.elasticsearch.fieldDefinition.form\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,4BAAN,SAA2CC,kDAA3C,CAAoE;;;8BAA9DD,4B,UACsC,gD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FormElasticsearchIndexPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _ElasticsearchIndexPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchIndexPlugin");
|
|
13
|
+
|
|
14
|
+
class FormElasticsearchIndexPlugin extends _ElasticsearchIndexPlugin.ElasticsearchIndexPlugin {}
|
|
15
|
+
|
|
16
|
+
exports.FormElasticsearchIndexPlugin = FormElasticsearchIndexPlugin;
|
|
17
|
+
(0, _defineProperty2.default)(FormElasticsearchIndexPlugin, "type", "formBuilder.form.elasticsearch.index");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormElasticsearchIndexPlugin","ElasticsearchIndexPlugin"],"sources":["FormElasticsearchIndexPlugin.ts"],"sourcesContent":["import { ElasticsearchIndexPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchIndexPlugin\";\n\nexport class FormElasticsearchIndexPlugin extends ElasticsearchIndexPlugin {\n public static override readonly type: string = \"formBuilder.form.elasticsearch.index\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,4BAAN,SAA2CC,kDAA3C,CAAoE;;;8BAA9DD,4B,UACsC,sC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin"],"sources":["FormElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import { ElasticsearchQueryModifierPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchQueryModifierPlugin\";\n\nexport class FormElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin {\n public static override readonly type: string = \"formBuilder.elasticsearch.modifier.query.form\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,oCAAN,SAAmDC,kEAAnD,CAAoF;;;8BAA9ED,oC,UACsC,+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin"],"sources":["FormElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import { ElasticsearchSortModifierPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchSortModifierPlugin\";\n\nexport class FormElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin {\n public static override readonly type: string = \"formBuilder.elasticsearch.modifier.sort.form\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,mCAAN,SAAkDC,gEAAlD,CAAkF;;;8BAA5ED,mC,UACsC,8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SubmissionElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin"],"sources":["SubmissionElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import { ElasticsearchBodyModifierPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchBodyModifierPlugin\";\n\nexport class SubmissionElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin {\n public static override readonly type: string =\n \"formBuilder.elasticsearch.modifier.body.submission\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,yCAAN,SAAwDC,gEAAxD,CAAwF;;;8BAAlFD,yC,UAEL,oD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SubmissionElasticsearchFieldPlugin","ElasticsearchFieldPlugin"],"sources":["SubmissionElasticsearchFieldPlugin.ts"],"sourcesContent":["import { ElasticsearchFieldPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchFieldPlugin\";\n\nexport class SubmissionElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {\n public static override readonly type: string =\n \"formBuilder.elasticsearch.fieldDefinition.submission\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,kCAAN,SAAiDC,kDAAjD,CAA0E;;;8BAApED,kC,UAEL,sD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SubmissionElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin"],"sources":["SubmissionElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import { ElasticsearchQueryModifierPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchQueryModifierPlugin\";\n\nexport class SubmissionElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin {\n public static override readonly type: string =\n \"formBuilder.elasticsearch.modifier.query.submission\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,0CAAN,SAAyDC,kEAAzD,CAA0F;;;8BAApFD,0C,UAEL,qD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SubmissionElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin"],"sources":["SubmissionElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import { ElasticsearchSortModifierPlugin } from \"@webiny/api-elasticsearch/plugins/definition/ElasticsearchSortModifierPlugin\";\n\nexport class SubmissionElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin {\n public static override readonly type: string =\n \"formBuilder.elasticsearch.modifier.sort.submission\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,yCAAN,SAAwDC,gEAAxD,CAAwF;;;8BAAlFD,yC,UAEL,oD"}
|
package/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Table, Entity } from "dynamodb-toolbox";
|
|
|
4
4
|
import { DynamoDBTypes } from "dynamodb-toolbox/dist/classes/Table";
|
|
5
5
|
import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
|
|
6
6
|
import { Client } from "@elastic/elasticsearch";
|
|
7
|
-
import {
|
|
7
|
+
import { PluginCollection } from "@webiny/plugins/types";
|
|
8
8
|
export declare type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
|
|
9
9
|
export declare type Attributes = Record<string, AttributeDefinition>;
|
|
10
10
|
export declare enum ENTITIES {
|
|
@@ -21,7 +21,7 @@ export interface FormBuilderStorageOperationsFactoryParams {
|
|
|
21
21
|
table?: string;
|
|
22
22
|
esTable?: string;
|
|
23
23
|
attributes?: Record<ENTITIES, Attributes>;
|
|
24
|
-
plugins?:
|
|
24
|
+
plugins?: PluginCollection;
|
|
25
25
|
}
|
|
26
26
|
export interface FormBuilderSystemCreateKeysParams {
|
|
27
27
|
tenant: string;
|
package/types.js.map
ADDED
|
@@ -0,0 +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 { Client } from \"@elastic/elasticsearch\";\nimport { PluginCollection } from \"@webiny/plugins/types\";\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n FORM = \"FormBuilderForm\",\n ES_FORM = \"FormBuilderFormEs\",\n SUBMISSION = \"FormBuilderSubmission\",\n ES_SUBMISSION = \"FormBuilderSubmissionEs\",\n SYSTEM = \"FormBuilderSystem\",\n SETTINGS = \"FormBuilderSettings\"\n}\n\nexport interface FormBuilderStorageOperationsFactoryParams {\n documentClient: DocumentClient;\n elasticsearch: Client;\n table?: string;\n esTable?: string;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: PluginCollection;\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 FormBuilderFormCreateKeyParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport interface FormBuilderFormStorageOperations extends BaseFormBuilderFormStorageOperations {\n createFormPartitionKey: (params: FormBuilderFormCreateKeyParams) => 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\" | \"esForm\" | \"submission\" | \"esSubmission\" | \"system\" | \"settings\";\n\nexport interface FormBuilderStorageOperations\n extends BaseFormBuilderStorageOperations,\n FormBuilderSettingsStorageOperations,\n FormBuilderSubmissionStorageOperations,\n FormBuilderFormStorageOperations,\n FormBuilderSystemStorageOperations {\n getTable(): Table;\n getEsTable(): Table;\n getEntities(): Record<Entities, Entity<any>>;\n}\n\nexport interface FormBuilderStorageOperationsFactory {\n (params: FormBuilderStorageOperationsFactoryParams): FormBuilderStorageOperations;\n}\n"],"mappings":";;;;;;IAqBYA,Q;;;WAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,wBAAAA,Q"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createElasticsearchIndex = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _configurations = _interopRequireDefault(require("../../configurations"));
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
const createElasticsearchIndex = async params => {
|
|
19
|
-
const {
|
|
20
|
-
tenant,
|
|
21
|
-
elasticsearch
|
|
22
|
-
} = params;
|
|
23
|
-
|
|
24
|
-
const esIndex = _configurations.default.es({
|
|
25
|
-
tenant
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const {
|
|
29
|
-
body: exists
|
|
30
|
-
} = await elasticsearch.indices.exists(esIndex);
|
|
31
|
-
|
|
32
|
-
if (exists) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
await elasticsearch.indices.create(_objectSpread(_objectSpread({}, esIndex), {}, {
|
|
37
|
-
body: {
|
|
38
|
-
/**
|
|
39
|
-
* need this part for sorting to work on text fields
|
|
40
|
-
*/
|
|
41
|
-
settings: {
|
|
42
|
-
analysis: {
|
|
43
|
-
analyzer: {
|
|
44
|
-
lowercase_analyzer: {
|
|
45
|
-
type: "custom",
|
|
46
|
-
filter: ["lowercase", "trim"],
|
|
47
|
-
tokenizer: "keyword"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
mappings: {
|
|
53
|
-
properties: {
|
|
54
|
-
property: {
|
|
55
|
-
type: "text",
|
|
56
|
-
fields: {
|
|
57
|
-
keyword: {
|
|
58
|
-
type: "keyword",
|
|
59
|
-
ignore_above: 256
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
analyzer: "lowercase_analyzer"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}));
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
exports.createElasticsearchIndex = createElasticsearchIndex;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UpgradePlugin } from "@webiny/api-upgrade/types";
|
|
2
|
-
import { FormBuilderContext } from "@webiny/api-form-builder/types";
|
|
3
|
-
declare const _default: () => UpgradePlugin<FormBuilderContext>;
|
|
4
|
-
/**
|
|
5
|
-
* This upgrade adds:
|
|
6
|
-
* - formId (first part of the id) and webinyVersion to the form records
|
|
7
|
-
*/
|
|
8
|
-
export default _default;
|
package/upgrades/5.16.0/index.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
13
|
-
|
|
14
|
-
var _utils = require("@webiny/utils");
|
|
15
|
-
|
|
16
|
-
var _batchWrite = require("@webiny/db-dynamodb/utils/batchWrite");
|
|
17
|
-
|
|
18
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
const upgradeForms = async params => {
|
|
25
|
-
const {
|
|
26
|
-
storageOperations,
|
|
27
|
-
tenant,
|
|
28
|
-
locale,
|
|
29
|
-
webinyVersion
|
|
30
|
-
} = params;
|
|
31
|
-
/**
|
|
32
|
-
* We need all of the forms from the database.
|
|
33
|
-
* We are getting them from the Elasticsearch because there is no general PK for the forms.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
let forms = [];
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
const {
|
|
40
|
-
items
|
|
41
|
-
} = await storageOperations.listForms({
|
|
42
|
-
where: {
|
|
43
|
-
latest: true,
|
|
44
|
-
tenant: tenant.id,
|
|
45
|
-
locale: locale.code
|
|
46
|
-
},
|
|
47
|
-
after: null,
|
|
48
|
-
limit: 10000,
|
|
49
|
-
sort: ["createdOn_DESC"]
|
|
50
|
-
});
|
|
51
|
-
forms = items;
|
|
52
|
-
} catch (ex) {
|
|
53
|
-
console.log(ex.message);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (forms.length === 0) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const entity = storageOperations.getEntities().form;
|
|
62
|
-
const items = [];
|
|
63
|
-
/**
|
|
64
|
-
* ## Regular DynamoDB table.
|
|
65
|
-
* We need to get all the records from all of the forms.
|
|
66
|
-
* Unfortunately, we need to query in a loop to be able to get those forms.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
for (const form of forms) {
|
|
70
|
-
const {
|
|
71
|
-
id: formId
|
|
72
|
-
} = (0, _utils.parseIdentifier)(form.id);
|
|
73
|
-
const formRecords = await (0, _query.queryAll)({
|
|
74
|
-
entity,
|
|
75
|
-
partitionKey: storageOperations.createFormPartitionKey({
|
|
76
|
-
id: form.id,
|
|
77
|
-
tenant: tenant.id,
|
|
78
|
-
locale: locale.code
|
|
79
|
-
})
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
for (const record of formRecords) {
|
|
83
|
-
/**
|
|
84
|
-
* Checks for "just in case".
|
|
85
|
-
*/
|
|
86
|
-
if (!record || !record.PK || !record.SK) {
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
items.push(entity.putBatch(_objectSpread(_objectSpread({}, record), {}, {
|
|
91
|
-
formId,
|
|
92
|
-
webinyVersion
|
|
93
|
-
})));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* And finally write all the records to the database again.
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
await (0, _batchWrite.batchWriteAll)({
|
|
103
|
-
table: entity.table,
|
|
104
|
-
items
|
|
105
|
-
});
|
|
106
|
-
} catch (ex) {
|
|
107
|
-
throw new _error.default("Could not update all form records.", "UPGRADE_FORM_RECORDS_ERROR", {
|
|
108
|
-
error: ex
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* ## Elasticsearch DynamoDB table.
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* This upgrade adds:
|
|
118
|
-
* - formId (first part of the id) and webinyVersion to the form records
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
var _default = () => {
|
|
123
|
-
return {
|
|
124
|
-
type: "api-upgrade",
|
|
125
|
-
app: "form-builder",
|
|
126
|
-
version: "5.16.0",
|
|
127
|
-
apply: async context => {
|
|
128
|
-
const tenant = context.tenancy.getCurrentTenant();
|
|
129
|
-
const locale = context.i18nContent.getLocale();
|
|
130
|
-
const storageOperations = context.formBuilder.storageOperations;
|
|
131
|
-
await upgradeForms({
|
|
132
|
-
storageOperations,
|
|
133
|
-
tenant,
|
|
134
|
-
locale,
|
|
135
|
-
webinyVersion: context.WEBINY_VERSION
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
exports.default = _default;
|