@webiny/api-form-builder-so-ddb-es 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd
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.js +3 -1
- package/configurations.js.map +1 -1
- package/definitions/elasticsearch.d.ts +43 -3
- package/definitions/elasticsearch.js +9 -8
- package/definitions/elasticsearch.js.map +1 -1
- package/definitions/form.d.ts +2 -2
- package/definitions/form.js +10 -9
- package/definitions/form.js.map +1 -1
- package/definitions/settings.d.ts +2 -2
- package/definitions/settings.js +9 -8
- package/definitions/settings.js.map +1 -1
- package/definitions/submission.d.ts +2 -2
- package/definitions/submission.js +9 -8
- package/definitions/submission.js.map +1 -1
- package/definitions/system.d.ts +2 -2
- package/definitions/system.js +9 -8
- package/definitions/system.js.map +1 -1
- package/definitions/table.d.ts +4 -4
- package/definitions/table.js +8 -4
- package/definitions/table.js.map +1 -1
- package/definitions/tableElasticsearch.d.ts +4 -4
- package/definitions/tableElasticsearch.js +8 -4
- package/definitions/tableElasticsearch.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.js +18 -29
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/indices/base.js +3 -1
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.js +3 -1
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/indices/japanese.js +3 -1
- package/elasticsearch/indices/japanese.js.map +1 -1
- package/index.js +28 -23
- package/index.js.map +1 -1
- package/operations/form/elasticsearchBody.d.ts +2 -2
- package/operations/form/elasticsearchBody.js +13 -13
- package/operations/form/elasticsearchBody.js.map +1 -1
- package/operations/form/elasticsearchFields.js +3 -1
- package/operations/form/elasticsearchFields.js.map +1 -1
- package/operations/form/fields.js +3 -1
- package/operations/form/fields.js.map +1 -1
- package/operations/form/index.d.ts +2 -2
- package/operations/form/index.js +123 -70
- package/operations/form/index.js.map +1 -1
- package/operations/settings/index.d.ts +2 -2
- package/operations/settings/index.js +26 -11
- package/operations/settings/index.js.map +1 -1
- package/operations/submission/elasticsearchBody.d.ts +2 -2
- package/operations/submission/elasticsearchBody.js +13 -13
- package/operations/submission/elasticsearchBody.js.map +1 -1
- package/operations/submission/elasticsearchFields.js +3 -1
- package/operations/submission/elasticsearchFields.js.map +1 -1
- package/operations/submission/index.d.ts +2 -2
- package/operations/submission/index.js +53 -27
- package/operations/submission/index.js.map +1 -1
- package/operations/system/index.d.ts +2 -2
- package/operations/system/index.js +22 -10
- package/operations/system/index.js.map +1 -1
- package/package.json +23 -20
- package/plugins/FormDynamoDbFieldPlugin.js +5 -4
- package/plugins/FormDynamoDbFieldPlugin.js.map +1 -1
- package/plugins/FormElasticsearchBodyModifierPlugin.js +5 -4
- package/plugins/FormElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/FormElasticsearchFieldPlugin.js +5 -4
- package/plugins/FormElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/FormElasticsearchIndexPlugin.js +5 -4
- package/plugins/FormElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/FormElasticsearchQueryModifierPlugin.js +5 -4
- package/plugins/FormElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/FormElasticsearchSortModifierPlugin.js +5 -4
- package/plugins/FormElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js +5 -4
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchFieldPlugin.js +5 -4
- package/plugins/SubmissionElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js +5 -4
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js +5 -4
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/index.js +3 -1
- package/plugins/index.js.map +1 -1
- package/types.d.ts +6 -8
- package/types.js +6 -4
- package/types.js.map +1 -1
package/configurations.js
CHANGED
package/configurations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configurations","es","params","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","tenantId","localeCode","WEBINY_ELASTICSEARCH_INDEX_LOCALE","index","filter","Boolean","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX"],"sources":["configurations.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nexport interface ElasticsearchConfigParams {\n tenant: string;\n locale: string;\n}\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\nexport const configurations = {\n es(params: ElasticsearchConfigParams): ElasticsearchConfig {\n const { tenant, locale } = params;\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n\n const tenantId = sharedIndex ? \"root\" : tenant;\n let localeCode: string | null = null;\n if (process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE === \"true\") {\n if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n localeCode = locale;\n }\n\n const index = [tenantId, localeCode, \"form-builder\"]\n .filter(Boolean)\n .join(\"-\")\n .toLowerCase();\n\n const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || \"\";\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n }\n};\n"],"mappings":";;;;;;;AAAA;AAWO,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","configurations","es","params","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","tenantId","localeCode","WEBINY_ELASTICSEARCH_INDEX_LOCALE","index","filter","Boolean","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX","exports"],"sources":["configurations.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nexport interface ElasticsearchConfigParams {\n tenant: string;\n locale: string;\n}\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\nexport const configurations = {\n es(params: ElasticsearchConfigParams): ElasticsearchConfig {\n const { tenant, locale } = params;\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n\n const tenantId = sharedIndex ? \"root\" : tenant;\n let localeCode: string | null = null;\n if (process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE === \"true\") {\n if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n localeCode = locale;\n }\n\n const index = [tenantId, localeCode, \"form-builder\"]\n .filter(Boolean)\n .join(\"-\")\n .toLowerCase();\n\n const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || \"\";\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n }\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWO,MAAMC,cAAc,GAAG;EAC1BC,EAAEA,CAACC,MAAiC,EAAuB;IACvD,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,MAAM;IACjC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CAChB,4EAA2E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B,KAAK,MAAM;IAEvE,MAAMC,QAAQ,GAAGJ,WAAW,GAAG,MAAM,GAAGH,MAAM;IAC9C,IAAIQ,UAAyB,GAAG,IAAI;IACpC,IAAIJ,OAAO,CAACC,GAAG,CAACI,iCAAiC,KAAK,MAAM,EAAE;MAC1D,IAAI,CAACR,MAAM,EAAE;QACT,MAAM,IAAIC,cAAW,CAChB,4EAA2E,EAC5E,cACJ,CAAC;MACL;MACAM,UAAU,GAAGP,MAAM;IACvB;IAEA,MAAMS,KAAK,GAAG,CAACH,QAAQ,EAAEC,UAAU,EAAE,cAAc,CAAC,CAC/CG,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAGX,OAAO,CAACC,GAAG,CAACW,2BAA2B,IAAI,EAAE;IAC5D,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHL;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEK,MAAM,GAAGL;IACpB,CAAC;EACL;AACJ,CAAC;AAACO,OAAA,CAAApB,cAAA,GAAAA,cAAA"}
|
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb
|
|
1
|
+
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
3
|
interface Params {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
8
|
-
export declare const createElasticsearchEntity: (params: Params) => Entity<{
|
|
8
|
+
export declare const createElasticsearchEntity: (params: Params) => Entity<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, boolean, boolean, boolean, string, string, string, boolean, {
|
|
9
|
+
PK: {
|
|
10
|
+
partitionKey: true;
|
|
11
|
+
};
|
|
12
|
+
SK: {
|
|
13
|
+
sortKey: true;
|
|
14
|
+
};
|
|
15
|
+
index: {
|
|
16
|
+
type: "string";
|
|
17
|
+
};
|
|
18
|
+
data: {
|
|
19
|
+
type: "map";
|
|
20
|
+
};
|
|
21
|
+
TYPE: {
|
|
22
|
+
type: "string";
|
|
23
|
+
};
|
|
24
|
+
}, {
|
|
25
|
+
PK: {
|
|
26
|
+
partitionKey: true;
|
|
27
|
+
};
|
|
28
|
+
SK: {
|
|
29
|
+
sortKey: true;
|
|
30
|
+
};
|
|
31
|
+
index: {
|
|
32
|
+
type: "string";
|
|
33
|
+
};
|
|
34
|
+
data: {
|
|
35
|
+
type: "map";
|
|
36
|
+
};
|
|
37
|
+
TYPE: {
|
|
38
|
+
type: "string";
|
|
39
|
+
};
|
|
40
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
[x: number]: any;
|
|
43
|
+
[x: symbol]: any;
|
|
44
|
+
}, {
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
[x: number]: any;
|
|
47
|
+
[x: symbol]: any;
|
|
48
|
+
}>;
|
|
9
49
|
export {};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createElasticsearchEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createElasticsearchEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
table,
|
|
13
11
|
entityName,
|
|
14
12
|
attributes
|
|
15
13
|
} = params;
|
|
16
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
17
15
|
name: entityName,
|
|
18
16
|
table,
|
|
19
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
20
18
|
PK: {
|
|
21
19
|
partitionKey: true
|
|
22
20
|
},
|
|
@@ -31,8 +29,11 @@ const createElasticsearchEntity = params => {
|
|
|
31
29
|
},
|
|
32
30
|
TYPE: {
|
|
33
31
|
type: "string"
|
|
34
|
-
}
|
|
35
|
-
|
|
32
|
+
},
|
|
33
|
+
...(attributes || {})
|
|
34
|
+
}
|
|
36
35
|
});
|
|
37
36
|
};
|
|
38
|
-
exports.createElasticsearchEntity = createElasticsearchEntity;
|
|
37
|
+
exports.createElasticsearchEntity = createElasticsearchEntity;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=elasticsearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","index","type","data","TYPE"],"sources":["elasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","index","type","data","TYPE","exports"],"sources":["elasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createElasticsearchEntity = (params: Params) => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n TYPE: {\n type: \"string\"\n },\n\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,yBAAyB,GAAIC,MAAc,IAAK;EACzD,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHC,IAAI,EAAE;MACV,CAAC;MACDC,IAAI,EAAE;QACFD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MAED,IAAIR,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,yBAAA,GAAAA,yBAAA"}
|
package/definitions/form.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb
|
|
1
|
+
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
3
|
interface Params {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
package/definitions/form.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createFormEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createFormEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
table,
|
|
13
11
|
entityName,
|
|
14
12
|
attributes
|
|
15
13
|
} = params;
|
|
16
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
17
15
|
table,
|
|
18
16
|
name: entityName,
|
|
19
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
20
18
|
PK: {
|
|
21
19
|
partitionKey: true
|
|
22
20
|
},
|
|
@@ -74,7 +72,7 @@ const createFormEntity = params => {
|
|
|
74
72
|
fields: {
|
|
75
73
|
type: "list"
|
|
76
74
|
},
|
|
77
|
-
|
|
75
|
+
steps: {
|
|
78
76
|
type: "list"
|
|
79
77
|
},
|
|
80
78
|
stats: {
|
|
@@ -88,8 +86,11 @@ const createFormEntity = params => {
|
|
|
88
86
|
},
|
|
89
87
|
webinyVersion: {
|
|
90
88
|
type: "string"
|
|
91
|
-
}
|
|
92
|
-
|
|
89
|
+
},
|
|
90
|
+
...(attributes || {})
|
|
91
|
+
}
|
|
93
92
|
});
|
|
94
93
|
};
|
|
95
|
-
exports.createFormEntity = createFormEntity;
|
|
94
|
+
exports.createFormEntity = createFormEntity;
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=form.js.map
|
package/definitions/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createFormEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","id","formId","tenant","locale","createdBy","ownedBy","savedOn","createdOn","slug","version","locked","published","publishedOn","status","fields","
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createFormEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","id","formId","tenant","locale","createdBy","ownedBy","savedOn","createdOn","slug","version","locked","published","publishedOn","status","fields","steps","stats","settings","triggers","webinyVersion","exports"],"sources":["form.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createFormEntity = (params: Params): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n table,\n name: entityName,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n formId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n savedOn: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n published: {\n type: \"boolean\"\n },\n publishedOn: {\n type: \"string\"\n },\n status: {\n type: \"string\"\n },\n fields: {\n type: \"list\"\n },\n steps: {\n type: \"list\"\n },\n stats: {\n type: \"map\"\n },\n settings: {\n type: \"map\"\n },\n triggers: {\n type: \"map\"\n },\n webinyVersion: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,gBAAgB,GAAIC,MAAc,IAAkB;EAC7D,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdH,KAAK;IACLI,IAAI,EAAEH,UAAU;IAChBC,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,EAAE,EAAE;QACAD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,MAAM,EAAE;QACJH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,SAAS,EAAE;QACPL,IAAI,EAAE;MACV,CAAC;MACDM,OAAO,EAAE;QACLN,IAAI,EAAE;MACV,CAAC;MACDO,OAAO,EAAE;QACLP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDS,IAAI,EAAE;QACFT,IAAI,EAAE;MACV,CAAC;MACDU,OAAO,EAAE;QACLV,IAAI,EAAE;MACV,CAAC;MACDW,MAAM,EAAE;QACJX,IAAI,EAAE;MACV,CAAC;MACDY,SAAS,EAAE;QACPZ,IAAI,EAAE;MACV,CAAC;MACDa,WAAW,EAAE;QACTb,IAAI,EAAE;MACV,CAAC;MACDc,MAAM,EAAE;QACJd,IAAI,EAAE;MACV,CAAC;MACDe,MAAM,EAAE;QACJf,IAAI,EAAE;MACV,CAAC;MACDgB,KAAK,EAAE;QACHhB,IAAI,EAAE;MACV,CAAC;MACDiB,KAAK,EAAE;QACHjB,IAAI,EAAE;MACV,CAAC;MACDkB,QAAQ,EAAE;QACNlB,IAAI,EAAE;MACV,CAAC;MACDmB,QAAQ,EAAE;QACNnB,IAAI,EAAE;MACV,CAAC;MACDoB,aAAa,EAAE;QACXpB,IAAI,EAAE;MACV,CAAC;MACD,IAAIR,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC6B,OAAA,CAAAjC,gBAAA,GAAAA,gBAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb
|
|
1
|
+
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
3
|
interface Params {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
package/definitions/settings.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createSettingsEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createSettingsEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
entityName,
|
|
13
11
|
attributes,
|
|
14
12
|
table
|
|
15
13
|
} = params;
|
|
16
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
17
15
|
name: entityName,
|
|
18
16
|
table,
|
|
19
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
20
18
|
PK: {
|
|
21
19
|
partitionKey: true
|
|
22
20
|
},
|
|
@@ -37,8 +35,11 @@ const createSettingsEntity = params => {
|
|
|
37
35
|
},
|
|
38
36
|
locale: {
|
|
39
37
|
type: "string"
|
|
40
|
-
}
|
|
41
|
-
|
|
38
|
+
},
|
|
39
|
+
...(attributes || {})
|
|
40
|
+
}
|
|
42
41
|
});
|
|
43
42
|
};
|
|
44
|
-
exports.createSettingsEntity = createSettingsEntity;
|
|
43
|
+
exports.createSettingsEntity = createSettingsEntity;
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSettingsEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","reCaptcha","domain","tenant","locale"],"sources":["settings.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createSettingsEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","reCaptcha","domain","tenant","locale","exports"],"sources":["settings.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSettingsEntity = (params: Params): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n reCaptcha: {\n type: \"map\"\n },\n domain: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,oBAAoB,GAAIC,MAAc,IAAkB;EACjE,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,SAAS,EAAE;QACPD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,MAAM,EAAE;QACJH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACc,OAAA,CAAAjB,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb
|
|
1
|
+
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
3
|
interface Params {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createSubmissionEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createSubmissionEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
table,
|
|
13
11
|
entityName,
|
|
14
12
|
attributes
|
|
15
13
|
} = params;
|
|
16
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
17
15
|
table,
|
|
18
16
|
name: entityName,
|
|
19
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
20
18
|
PK: {
|
|
21
19
|
partitionKey: true
|
|
22
20
|
},
|
|
@@ -58,8 +56,11 @@ const createSubmissionEntity = params => {
|
|
|
58
56
|
},
|
|
59
57
|
webinyVersion: {
|
|
60
58
|
type: "string"
|
|
61
|
-
}
|
|
62
|
-
|
|
59
|
+
},
|
|
60
|
+
...(attributes || {})
|
|
61
|
+
}
|
|
63
62
|
});
|
|
64
63
|
};
|
|
65
|
-
exports.createSubmissionEntity = createSubmissionEntity;
|
|
64
|
+
exports.createSubmissionEntity = createSubmissionEntity;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=submission.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSubmissionEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","id","type","TYPE","data","meta","form","logs","createdOn","savedOn","ownedBy","tenant","locale","webinyVersion"],"sources":["submission.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createSubmissionEntity","params","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","id","type","TYPE","data","meta","form","logs","createdOn","savedOn","ownedBy","tenant","locale","webinyVersion","exports"],"sources":["submission.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSubmissionEntity = (params: Params): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n table,\n name: entityName,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n id: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n form: {\n type: \"map\"\n },\n logs: {\n type: \"list\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n ownedBy: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,sBAAsB,GAAIC,MAAc,IAAkB;EACnE,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdH,KAAK;IACLI,IAAI,EAAEH,UAAU;IAChBC,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,EAAE,EAAE;QACAC,IAAI,EAAE;MACV,CAAC;MACDC,IAAI,EAAE;QACFD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACDM,SAAS,EAAE;QACPN,IAAI,EAAE;MACV,CAAC;MACDO,OAAO,EAAE;QACLP,IAAI,EAAE;MACV,CAAC;MACDQ,OAAO,EAAE;QACLR,IAAI,EAAE;MACV,CAAC;MACDS,MAAM,EAAE;QACJT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV,CAAC;MACDW,aAAa,EAAE;QACXX,IAAI,EAAE;MACV,CAAC;MACD,IAAIR,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACoB,OAAA,CAAAxB,sBAAA,GAAAA,sBAAA"}
|
package/definitions/system.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb
|
|
1
|
+
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
2
|
import { Attributes } from "../types";
|
|
3
3
|
interface Params {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
package/definitions/system.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createSystemEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createSystemEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
entityName,
|
|
13
11
|
attributes,
|
|
14
12
|
table
|
|
15
13
|
} = params;
|
|
16
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
17
15
|
name: entityName,
|
|
18
16
|
table,
|
|
19
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
20
18
|
PK: {
|
|
21
19
|
partitionKey: true
|
|
22
20
|
},
|
|
@@ -28,8 +26,11 @@ const createSystemEntity = params => {
|
|
|
28
26
|
},
|
|
29
27
|
tenant: {
|
|
30
28
|
type: "string"
|
|
31
|
-
}
|
|
32
|
-
|
|
29
|
+
},
|
|
30
|
+
...(attributes || {})
|
|
31
|
+
}
|
|
33
32
|
});
|
|
34
33
|
};
|
|
35
|
-
exports.createSystemEntity = createSystemEntity;
|
|
34
|
+
exports.createSystemEntity = createSystemEntity;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","tenant"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","tenant","exports"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: Params): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAc,IAAkB;EAC/D,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAd,kBAAA,GAAAA,kBAAA"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Table } from "dynamodb
|
|
1
|
+
import { DynamoDBClient } from "@webiny/aws-sdk/client-dynamodb";
|
|
2
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
3
3
|
interface Params {
|
|
4
4
|
tableName?: string;
|
|
5
|
-
documentClient:
|
|
5
|
+
documentClient: DynamoDBClient;
|
|
6
6
|
}
|
|
7
|
-
export declare const createTable: (params: Params) => Table
|
|
7
|
+
export declare const createTable: (params: Params) => Table<string, string, string>;
|
|
8
8
|
export {};
|
package/definitions/table.js
CHANGED
|
@@ -4,17 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createTable = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
8
|
const createTable = params => {
|
|
9
9
|
const {
|
|
10
10
|
tableName,
|
|
11
11
|
documentClient
|
|
12
12
|
} = params;
|
|
13
|
-
return new
|
|
13
|
+
return new _toolbox.Table({
|
|
14
14
|
name: tableName || process.env.DB_TABLE,
|
|
15
15
|
partitionKey: "PK",
|
|
16
16
|
sortKey: "SK",
|
|
17
|
-
DocumentClient: documentClient
|
|
17
|
+
DocumentClient: documentClient,
|
|
18
|
+
autoExecute: true,
|
|
19
|
+
autoParse: true
|
|
18
20
|
});
|
|
19
21
|
};
|
|
20
|
-
exports.createTable = createTable;
|
|
22
|
+
exports.createTable = createTable;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=table.js.map
|
package/definitions/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createTable","params","tableName","documentClient","Table","name","process","env","DB_TABLE","partitionKey","sortKey","DocumentClient"],"sources":["table.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createTable","params","tableName","documentClient","Table","name","process","env","DB_TABLE","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","exports"],"sources":["table.ts"],"sourcesContent":["import { DynamoDBClient } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\n\ninterface Params {\n tableName?: string;\n documentClient: DynamoDBClient;\n}\n\nexport const createTable = (params: Params): Table<string, string, string> => {\n const { tableName, documentClient } = params;\n\n return new Table({\n name: tableName || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,WAAW,GAAIC,MAAc,IAAoC;EAC1E,MAAM;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAGF,MAAM;EAE5C,OAAO,IAAIG,cAAK,CAAC;IACbC,IAAI,EAAEH,SAAS,IAAKI,OAAO,CAACC,GAAG,CAACC,QAAmB;IACnDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAd,WAAA,GAAAA,WAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Table } from "dynamodb
|
|
2
|
-
import {
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { DynamoDBClient } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
3
|
interface Params {
|
|
4
|
-
documentClient:
|
|
4
|
+
documentClient: DynamoDBClient;
|
|
5
5
|
tableName?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const createElasticsearchTable: (params: Params) => Table
|
|
7
|
+
export declare const createElasticsearchTable: (params: Params) => Table<string, string, string>;
|
|
8
8
|
export {};
|
|
@@ -4,17 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createElasticsearchTable = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
8
|
const createElasticsearchTable = params => {
|
|
9
9
|
const {
|
|
10
10
|
tableName,
|
|
11
11
|
documentClient
|
|
12
12
|
} = params;
|
|
13
|
-
return new
|
|
13
|
+
return new _toolbox.Table({
|
|
14
14
|
name: tableName || process.env.DB_TABLE_ELASTICSEARCH,
|
|
15
15
|
partitionKey: "PK",
|
|
16
16
|
sortKey: "SK",
|
|
17
|
-
DocumentClient: documentClient
|
|
17
|
+
DocumentClient: documentClient,
|
|
18
|
+
autoExecute: true,
|
|
19
|
+
autoParse: true
|
|
18
20
|
});
|
|
19
21
|
};
|
|
20
|
-
exports.createElasticsearchTable = createElasticsearchTable;
|
|
22
|
+
exports.createElasticsearchTable = createElasticsearchTable;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=tableElasticsearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElasticsearchTable","params","tableName","documentClient","Table","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createElasticsearchTable","params","tableName","documentClient","Table","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","exports"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DynamoDBClient } from \"@webiny/aws-sdk/client-dynamodb\";\n\ninterface Params {\n documentClient: DynamoDBClient;\n tableName?: string;\n}\n\nexport const createElasticsearchTable = (params: Params): Table<string, string, string> => {\n const { tableName, documentClient } = params;\n return new Table({\n name: tableName || (process.env.DB_TABLE_ELASTICSEARCH as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,wBAAwB,GAAIC,MAAc,IAAoC;EACvF,MAAM;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAGF,MAAM;EAC5C,OAAO,IAAIG,cAAK,CAAC;IACbC,IAAI,EAAEH,SAAS,IAAKI,OAAO,CAACC,GAAG,CAACC,sBAAiC;IACjEC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAd,wBAAA,GAAAA,wBAAA"}
|
|
@@ -1,52 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createElasticsearchIndex = void 0;
|
|
8
7
|
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
9
8
|
var _FormElasticsearchIndexPlugin = require("../plugins/FormElasticsearchIndexPlugin");
|
|
10
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
9
|
var _configurations = require("../configurations");
|
|
12
10
|
const createElasticsearchIndex = async params => {
|
|
13
11
|
const {
|
|
14
12
|
elasticsearch,
|
|
15
|
-
plugins
|
|
13
|
+
plugins,
|
|
16
14
|
locale,
|
|
17
15
|
tenant
|
|
18
16
|
} = params;
|
|
19
|
-
const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
|
|
20
|
-
container,
|
|
21
|
-
type: _FormElasticsearchIndexPlugin.FormElasticsearchIndexPlugin.type,
|
|
22
|
-
locale
|
|
23
|
-
});
|
|
24
17
|
const {
|
|
25
18
|
index
|
|
26
19
|
} = _configurations.configurations.es({
|
|
27
20
|
locale,
|
|
28
21
|
tenant
|
|
29
22
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
await (0, _apiElasticsearch.createIndex)({
|
|
24
|
+
client: elasticsearch,
|
|
25
|
+
index,
|
|
26
|
+
type: _FormElasticsearchIndexPlugin.FormElasticsearchIndexPlugin.type,
|
|
27
|
+
tenant,
|
|
28
|
+
locale,
|
|
29
|
+
plugins,
|
|
30
|
+
onExists: () => {
|
|
31
|
+
console.log(`Elasticsearch index "${index}" for the Form Builder already exists.`);
|
|
32
|
+
},
|
|
33
|
+
onError: ex => {
|
|
34
|
+
console.error(`Could not create the Form Builder Elasticsearch index "${index}".`);
|
|
35
|
+
return ex;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
index,
|
|
39
|
-
body: plugin.body
|
|
40
|
-
});
|
|
41
|
-
} catch (ex) {
|
|
42
|
-
throw new _error.default(ex.message || "Could not create Elasticsearch index for the Form Builder.", ex.code || "FB_ELASTICSEARCH_INDEX_ERROR", {
|
|
43
|
-
error: ex,
|
|
44
|
-
type: _FormElasticsearchIndexPlugin.FormElasticsearchIndexPlugin.type,
|
|
45
|
-
locale,
|
|
46
|
-
tenant,
|
|
47
|
-
index,
|
|
48
|
-
body: plugin.body
|
|
49
|
-
});
|
|
50
|
-
}
|
|
37
|
+
});
|
|
51
38
|
};
|
|
52
|
-
exports.createElasticsearchIndex = createElasticsearchIndex;
|
|
39
|
+
exports.createElasticsearchIndex = createElasticsearchIndex;
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=createElasticsearchIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_apiElasticsearch","require","_FormElasticsearchIndexPlugin","_configurations","createElasticsearchIndex","params","elasticsearch","plugins","locale","tenant","index","configurations","es","createIndex","client","type","FormElasticsearchIndexPlugin","onExists","console","log","onError","ex","error","exports"],"sources":["createElasticsearchIndex.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { createIndex } from \"@webiny/api-elasticsearch\";\nimport { FormElasticsearchIndexPlugin } from \"~/plugins/FormElasticsearchIndexPlugin\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { configurations } from \"~/configurations\";\n\ninterface CreateElasticsearchIndexParams {\n elasticsearch: Client;\n plugins: PluginsContainer;\n tenant: string;\n locale: string;\n}\n\nexport const createElasticsearchIndex = async (params: CreateElasticsearchIndexParams) => {\n const { elasticsearch, plugins, locale, tenant } = params;\n\n const { index } = configurations.es({\n locale,\n tenant\n });\n\n await createIndex({\n client: elasticsearch,\n index,\n type: FormElasticsearchIndexPlugin.type,\n tenant,\n locale,\n plugins,\n onExists: () => {\n console.log(`Elasticsearch index \"${index}\" for the Form Builder already exists.`);\n },\n onError: (ex: Error) => {\n console.error(`Could not create the Form Builder Elasticsearch index \"${index}\".`);\n return ex;\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AASO,MAAMG,wBAAwB,GAAG,MAAOC,MAAsC,IAAK;EACtF,MAAM;IAAEC,aAAa;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EAEzD,MAAM;IAAEK;EAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;IAChCJ,MAAM;IACNC;EACJ,CAAC,CAAC;EAEF,MAAM,IAAAI,6BAAW,EAAC;IACdC,MAAM,EAAER,aAAa;IACrBI,KAAK;IACLK,IAAI,EAAEC,0DAA4B,CAACD,IAAI;IACvCN,MAAM;IACND,MAAM;IACND,OAAO;IACPU,QAAQ,EAAEA,CAAA,KAAM;MACZC,OAAO,CAACC,GAAG,CAAE,wBAAuBT,KAAM,wCAAuC,CAAC;IACtF,CAAC;IACDU,OAAO,EAAGC,EAAS,IAAK;MACpBH,OAAO,CAACI,KAAK,CAAE,0DAAyDZ,KAAM,IAAG,CAAC;MAClF,OAAOW,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAnB,wBAAA,GAAAA,wBAAA"}
|
|
@@ -9,4 +9,6 @@ var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
|
9
9
|
const base = new _FormElasticsearchIndexPlugin.FormElasticsearchIndexPlugin({
|
|
10
10
|
body: (0, _apiElasticsearch.getBaseConfiguration)()
|
|
11
11
|
});
|
|
12
|
-
exports.base = base;
|
|
12
|
+
exports.base = base;
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["base","FormElasticsearchIndexPlugin","body","getBaseConfiguration"],"sources":["base.ts"],"sourcesContent":["import { FormElasticsearchIndexPlugin } from \"~/plugins/FormElasticsearchIndexPlugin\";\nimport { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const base = new FormElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n"],"mappings":";;;;;;AAAA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_FormElasticsearchIndexPlugin","require","_apiElasticsearch","base","FormElasticsearchIndexPlugin","body","getBaseConfiguration","exports"],"sources":["base.ts"],"sourcesContent":["import { FormElasticsearchIndexPlugin } from \"~/plugins/FormElasticsearchIndexPlugin\";\nimport { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const base = new FormElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n"],"mappings":";;;;;;AAAA,IAAAA,6BAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,MAAME,IAAI,GAAG,IAAIC,0DAA4B,CAAC;EACjDC,IAAI,EAAE,IAAAC,sCAAoB,EAAC;AAC/B,CAAC,CAAC;AAACC,OAAA,CAAAJ,IAAA,GAAAA,IAAA"}
|