@webiny/api-form-builder-so-ddb-es 0.0.0-unstable.fcdad0bc61 → 0.0.0-unstable.fdd9228b5d
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 +14 -7
- package/configurations.js +18 -15
- package/configurations.js.map +1 -1
- package/definitions/elasticsearch.d.ts +45 -4
- package/definitions/elasticsearch.js +8 -12
- package/definitions/elasticsearch.js.map +1 -1
- package/definitions/form.d.ts +4 -3
- package/definitions/form.js +9 -13
- package/definitions/form.js.map +1 -1
- package/definitions/settings.d.ts +4 -3
- package/definitions/settings.js +8 -12
- package/definitions/settings.js.map +1 -1
- package/definitions/submission.d.ts +4 -3
- package/definitions/submission.js +8 -12
- package/definitions/submission.js.map +1 -1
- package/definitions/system.d.ts +4 -3
- package/definitions/system.js +8 -12
- package/definitions/system.js.map +1 -1
- package/definitions/table.d.ts +4 -4
- package/definitions/table.js +7 -6
- package/definitions/table.js.map +1 -1
- package/definitions/tableElasticsearch.d.ts +4 -4
- package/definitions/tableElasticsearch.js +7 -6
- package/definitions/tableElasticsearch.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +2 -2
- package/elasticsearch/createElasticsearchIndex.js +17 -39
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/indices/base.js +3 -5
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.d.ts +1 -1
- package/elasticsearch/indices/index.js +2 -4
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/indices/japanese.js +3 -5
- package/elasticsearch/indices/japanese.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +73 -57
- package/index.js.map +1 -1
- package/operations/form/elasticsearchBody.d.ts +4 -4
- package/operations/form/elasticsearchBody.js +13 -40
- package/operations/form/elasticsearchBody.js.map +1 -1
- package/operations/form/elasticsearchFields.js +2 -3
- package/operations/form/elasticsearchFields.js.map +1 -1
- package/operations/form/fields.js +2 -3
- package/operations/form/fields.js.map +1 -1
- package/operations/form/index.d.ts +6 -6
- package/operations/form/index.js +167 -215
- package/operations/form/index.js.map +1 -1
- package/operations/settings/index.d.ts +3 -3
- package/operations/settings/index.js +25 -30
- package/operations/settings/index.js.map +1 -1
- package/operations/submission/elasticsearchBody.d.ts +4 -4
- package/operations/submission/elasticsearchBody.js +13 -42
- package/operations/submission/elasticsearchBody.js.map +1 -1
- package/operations/submission/elasticsearchFields.js +2 -3
- package/operations/submission/elasticsearchFields.js.map +1 -1
- package/operations/submission/index.d.ts +5 -5
- package/operations/submission/index.js +54 -77
- package/operations/submission/index.js.map +1 -1
- package/operations/system/index.d.ts +3 -3
- package/operations/system/index.js +21 -27
- package/operations/system/index.js.map +1 -1
- package/package.json +28 -31
- package/plugins/FormDynamoDbFieldPlugin.js +5 -9
- package/plugins/FormDynamoDbFieldPlugin.js.map +1 -1
- package/plugins/FormElasticsearchBodyModifierPlugin.js +5 -9
- package/plugins/FormElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/FormElasticsearchFieldPlugin.js +5 -9
- package/plugins/FormElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/FormElasticsearchIndexPlugin.js +5 -9
- package/plugins/FormElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/FormElasticsearchQueryModifierPlugin.js +5 -9
- package/plugins/FormElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/FormElasticsearchSortModifierPlugin.js +5 -9
- package/plugins/FormElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js +5 -9
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchFieldPlugin.js +5 -9
- package/plugins/SubmissionElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js +5 -9
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js +5 -9
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/index.d.ts +10 -0
- package/plugins/index.js +117 -0
- package/plugins/index.js.map +1 -0
- package/tasks/createIndexTaskPlugin.d.ts +2 -0
- package/tasks/createIndexTaskPlugin.js +36 -0
- package/tasks/createIndexTaskPlugin.js.map +1 -0
- package/types.d.ts +16 -14
- package/types.js +6 -6
- package/types.js.map +1 -1
package/configurations.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
|
|
2
|
+
import type { FormBuilderContext } from "@webiny/api-form-builder/types";
|
|
3
|
+
export interface ConfigurationsElasticsearch {
|
|
4
|
+
index: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ConfigurationsElasticsearchParams {
|
|
2
7
|
tenant: string;
|
|
3
8
|
locale: string;
|
|
4
9
|
}
|
|
5
|
-
interface
|
|
6
|
-
|
|
10
|
+
export interface ConfigurationsIndexSettingsParams {
|
|
11
|
+
context: FormBuilderContext;
|
|
12
|
+
locale: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Configurations {
|
|
15
|
+
es: (params: ConfigurationsElasticsearchParams) => ConfigurationsElasticsearch;
|
|
16
|
+
indexSettings: (params: ConfigurationsIndexSettingsParams) => Partial<ElasticsearchIndexRequestBody>;
|
|
7
17
|
}
|
|
8
|
-
export declare const configurations:
|
|
9
|
-
es(params: ElasticsearchConfigParams): ElasticsearchConfig;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
18
|
+
export declare const configurations: Configurations;
|
package/configurations.js
CHANGED
|
@@ -1,50 +1,53 @@
|
|
|
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.configurations = void 0;
|
|
9
|
-
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
10
|
+
var _plugins = require("./plugins");
|
|
11
|
+
const configurations = exports.configurations = {
|
|
13
12
|
es(params) {
|
|
14
13
|
const {
|
|
15
14
|
tenant,
|
|
16
15
|
locale
|
|
17
16
|
} = params;
|
|
18
|
-
|
|
19
17
|
if (!tenant) {
|
|
20
18
|
throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
|
|
20
|
+
const sharedIndex = (0, _apiElasticsearch.isSharedElasticsearchIndex)();
|
|
24
21
|
const tenantId = sharedIndex ? "root" : tenant;
|
|
25
22
|
let localeCode = null;
|
|
26
|
-
|
|
27
23
|
if (process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE === "true") {
|
|
28
24
|
if (!locale) {
|
|
29
25
|
throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
localeCode = locale;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
const index = [tenantId, localeCode, "form-builder"].filter(Boolean).join("-").toLowerCase();
|
|
36
|
-
const prefix =
|
|
37
|
-
|
|
30
|
+
const prefix = (0, _apiElasticsearch.getElasticsearchIndexPrefix)();
|
|
38
31
|
if (!prefix) {
|
|
39
32
|
return {
|
|
40
33
|
index
|
|
41
34
|
};
|
|
42
35
|
}
|
|
43
|
-
|
|
44
36
|
return {
|
|
45
37
|
index: prefix + index
|
|
46
38
|
};
|
|
39
|
+
},
|
|
40
|
+
indexSettings: ({
|
|
41
|
+
context,
|
|
42
|
+
locale
|
|
43
|
+
}) => {
|
|
44
|
+
const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
|
|
45
|
+
container: context.plugins,
|
|
46
|
+
type: _plugins.FormElasticsearchIndexPlugin.type,
|
|
47
|
+
locale
|
|
48
|
+
});
|
|
49
|
+
return plugin ? plugin.body : {};
|
|
47
50
|
}
|
|
48
|
-
|
|
49
51
|
};
|
|
50
|
-
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=configurations.js.map
|
package/configurations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configurations","es","params","tenant","locale","WebinyError","sharedIndex","
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","_plugins","configurations","exports","es","params","tenant","locale","WebinyError","sharedIndex","isSharedElasticsearchIndex","tenantId","localeCode","process","env","WEBINY_ELASTICSEARCH_INDEX_LOCALE","index","filter","Boolean","join","toLowerCase","prefix","getElasticsearchIndexPrefix","indexSettings","context","plugin","getLastAddedIndexPlugin","container","plugins","type","FormElasticsearchIndexPlugin","body"],"sources":["configurations.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport { FormElasticsearchIndexPlugin } from \"~/plugins\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\nimport type { FormBuilderContext } from \"@webiny/api-form-builder/types\";\n\nexport interface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface ConfigurationsElasticsearchParams {\n tenant: string;\n locale: string;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: FormBuilderContext;\n locale: string;\n}\n\nexport interface Configurations {\n es: (params: ConfigurationsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es(params) {\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 = isSharedElasticsearchIndex();\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 = getElasticsearchIndexPrefix();\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context, locale }) => {\n const plugin = getLastAddedIndexPlugin<FormElasticsearchIndexPlugin>({\n container: context.plugins,\n type: FormElasticsearchIndexPlugin.type,\n locale\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAyBO,MAAMG,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1CE,EAAEA,CAACC,MAAM,EAAE;IACP,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,MAAM;IACjC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;IAEhD,MAAMC,QAAQ,GAAGF,WAAW,GAAG,MAAM,GAAGH,MAAM;IAC9C,IAAIM,UAAyB,GAAG,IAAI;IACpC,IAAIC,OAAO,CAACC,GAAG,CAACC,iCAAiC,KAAK,MAAM,EAAE;MAC1D,IAAI,CAACR,MAAM,EAAE;QACT,MAAM,IAAIC,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;MACL;MACAI,UAAU,GAAGL,MAAM;IACvB;IAEA,MAAMS,KAAK,GAAG,CAACL,QAAQ,EAAEC,UAAU,EAAE,cAAc,CAAC,CAC/CK,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;IAC5C,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHL;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEK,MAAM,GAAGL;IACpB,CAAC;EACL,CAAC;EACDO,aAAa,EAAEA,CAAC;IAAEC,OAAO;IAAEjB;EAAO,CAAC,KAAK;IACpC,MAAMkB,MAAM,GAAG,IAAAC,yCAAuB,EAA+B;MACjEC,SAAS,EAAEH,OAAO,CAACI,OAAO;MAC1BC,IAAI,EAAEC,qCAA4B,CAACD,IAAI;MACvCtB;IACJ,CAAC,CAAC;IAEF,OAAOkB,MAAM,GAAGA,MAAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
3
4
|
interface Params {
|
|
4
|
-
table: Table
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
|
8
|
-
export declare const createElasticsearchEntity: (params: Params) => Entity<{
|
|
9
|
+
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, {
|
|
10
|
+
PK: {
|
|
11
|
+
partitionKey: true;
|
|
12
|
+
};
|
|
13
|
+
SK: {
|
|
14
|
+
sortKey: true;
|
|
15
|
+
};
|
|
16
|
+
index: {
|
|
17
|
+
type: "string";
|
|
18
|
+
};
|
|
19
|
+
data: {
|
|
20
|
+
type: "map";
|
|
21
|
+
};
|
|
22
|
+
TYPE: {
|
|
23
|
+
type: "string";
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
PK: {
|
|
27
|
+
partitionKey: true;
|
|
28
|
+
};
|
|
29
|
+
SK: {
|
|
30
|
+
sortKey: true;
|
|
31
|
+
};
|
|
32
|
+
index: {
|
|
33
|
+
type: "string";
|
|
34
|
+
};
|
|
35
|
+
data: {
|
|
36
|
+
type: "map";
|
|
37
|
+
};
|
|
38
|
+
TYPE: {
|
|
39
|
+
type: "string";
|
|
40
|
+
};
|
|
41
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
[x: number]: any;
|
|
44
|
+
[x: symbol]: any;
|
|
45
|
+
}, {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
[x: number]: any;
|
|
48
|
+
[x: symbol]: any;
|
|
49
|
+
}>;
|
|
9
50
|
export {};
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createElasticsearchEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
14
8
|
const createElasticsearchEntity = params => {
|
|
15
9
|
const {
|
|
16
10
|
table,
|
|
17
11
|
entityName,
|
|
18
12
|
attributes
|
|
19
13
|
} = params;
|
|
20
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
21
15
|
name: entityName,
|
|
22
16
|
table,
|
|
23
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
24
18
|
PK: {
|
|
25
19
|
partitionKey: true
|
|
26
20
|
},
|
|
@@ -35,9 +29,11 @@ const createElasticsearchEntity = params => {
|
|
|
35
29
|
},
|
|
36
30
|
TYPE: {
|
|
37
31
|
type: "string"
|
|
38
|
-
}
|
|
39
|
-
|
|
32
|
+
},
|
|
33
|
+
...(attributes || {})
|
|
34
|
+
}
|
|
40
35
|
});
|
|
41
36
|
};
|
|
37
|
+
exports.createElasticsearchEntity = createElasticsearchEntity;
|
|
42
38
|
|
|
43
|
-
|
|
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 {
|
|
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 type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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 ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,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;MACD,IAAIR,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
package/definitions/form.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
3
4
|
interface Params {
|
|
4
|
-
table: Table
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
package/definitions/form.js
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createFormEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
14
8
|
const createFormEntity = params => {
|
|
15
9
|
const {
|
|
16
10
|
table,
|
|
17
11
|
entityName,
|
|
18
12
|
attributes
|
|
19
13
|
} = params;
|
|
20
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
21
15
|
table,
|
|
22
16
|
name: entityName,
|
|
23
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
24
18
|
PK: {
|
|
25
19
|
partitionKey: true
|
|
26
20
|
},
|
|
@@ -78,7 +72,7 @@ const createFormEntity = params => {
|
|
|
78
72
|
fields: {
|
|
79
73
|
type: "list"
|
|
80
74
|
},
|
|
81
|
-
|
|
75
|
+
steps: {
|
|
82
76
|
type: "list"
|
|
83
77
|
},
|
|
84
78
|
stats: {
|
|
@@ -92,9 +86,11 @@ const createFormEntity = params => {
|
|
|
92
86
|
},
|
|
93
87
|
webinyVersion: {
|
|
94
88
|
type: "string"
|
|
95
|
-
}
|
|
96
|
-
|
|
89
|
+
},
|
|
90
|
+
...(attributes || {})
|
|
91
|
+
}
|
|
97
92
|
});
|
|
98
93
|
};
|
|
94
|
+
exports.createFormEntity = createFormEntity;
|
|
99
95
|
|
|
100
|
-
|
|
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 type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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":";;;;;;AACA,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","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
3
4
|
interface Params {
|
|
4
|
-
table: Table
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
package/definitions/settings.js
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createSettingsEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
14
8
|
const createSettingsEntity = params => {
|
|
15
9
|
const {
|
|
16
10
|
entityName,
|
|
17
11
|
attributes,
|
|
18
12
|
table
|
|
19
13
|
} = params;
|
|
20
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
21
15
|
name: entityName,
|
|
22
16
|
table,
|
|
23
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
24
18
|
PK: {
|
|
25
19
|
partitionKey: true
|
|
26
20
|
},
|
|
@@ -41,9 +35,11 @@ const createSettingsEntity = params => {
|
|
|
41
35
|
},
|
|
42
36
|
locale: {
|
|
43
37
|
type: "string"
|
|
44
|
-
}
|
|
45
|
-
|
|
38
|
+
},
|
|
39
|
+
...(attributes || {})
|
|
40
|
+
}
|
|
46
41
|
});
|
|
47
42
|
};
|
|
43
|
+
exports.createSettingsEntity = createSettingsEntity;
|
|
48
44
|
|
|
49
|
-
|
|
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 {
|
|
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 type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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":";;;;;;AACA,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","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
3
4
|
interface Params {
|
|
4
|
-
table: Table
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createSubmissionEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
14
8
|
const createSubmissionEntity = params => {
|
|
15
9
|
const {
|
|
16
10
|
table,
|
|
17
11
|
entityName,
|
|
18
12
|
attributes
|
|
19
13
|
} = params;
|
|
20
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
21
15
|
table,
|
|
22
16
|
name: entityName,
|
|
23
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
24
18
|
PK: {
|
|
25
19
|
partitionKey: true
|
|
26
20
|
},
|
|
@@ -62,9 +56,11 @@ const createSubmissionEntity = params => {
|
|
|
62
56
|
},
|
|
63
57
|
webinyVersion: {
|
|
64
58
|
type: "string"
|
|
65
|
-
}
|
|
66
|
-
|
|
59
|
+
},
|
|
60
|
+
...(attributes || {})
|
|
61
|
+
}
|
|
67
62
|
});
|
|
68
63
|
};
|
|
64
|
+
exports.createSubmissionEntity = createSubmissionEntity;
|
|
69
65
|
|
|
70
|
-
|
|
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 {
|
|
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 type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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":";;;;;;AACA,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","ignoreList":[]}
|
package/definitions/system.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
3
4
|
interface Params {
|
|
4
|
-
table: Table
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
package/definitions/system.js
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createSystemEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
14
8
|
const createSystemEntity = params => {
|
|
15
9
|
const {
|
|
16
10
|
entityName,
|
|
17
11
|
attributes,
|
|
18
12
|
table
|
|
19
13
|
} = params;
|
|
20
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
21
15
|
name: entityName,
|
|
22
16
|
table,
|
|
23
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
24
18
|
PK: {
|
|
25
19
|
partitionKey: true
|
|
26
20
|
},
|
|
@@ -32,9 +26,11 @@ const createSystemEntity = params => {
|
|
|
32
26
|
},
|
|
33
27
|
tenant: {
|
|
34
28
|
type: "string"
|
|
35
|
-
}
|
|
36
|
-
|
|
29
|
+
},
|
|
30
|
+
...(attributes || {})
|
|
31
|
+
}
|
|
37
32
|
});
|
|
38
33
|
};
|
|
34
|
+
exports.createSystemEntity = createSystemEntity;
|
|
39
35
|
|
|
40
|
-
|
|
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 {
|
|
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 type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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":";;;;;;AACA,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","ignoreList":[]}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Table } from "dynamodb
|
|
1
|
+
import type { DynamoDBDocument } 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: DynamoDBDocument;
|
|
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,20 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createTable = void 0;
|
|
7
|
-
|
|
8
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
9
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createTable = params => {
|
|
11
9
|
const {
|
|
12
10
|
tableName,
|
|
13
11
|
documentClient
|
|
14
12
|
} = params;
|
|
15
|
-
return new
|
|
13
|
+
return new _toolbox.Table({
|
|
16
14
|
name: tableName || process.env.DB_TABLE,
|
|
17
15
|
partitionKey: "PK",
|
|
18
16
|
sortKey: "SK",
|
|
19
|
-
DocumentClient: documentClient
|
|
17
|
+
DocumentClient: documentClient,
|
|
18
|
+
autoExecute: true,
|
|
19
|
+
autoParse: true
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
+
exports.createTable = createTable;
|
|
22
23
|
|
|
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 type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\n\ninterface Params {\n tableName?: string;\n documentClient: DynamoDBDocument;\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","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Table } from "dynamodb
|
|
2
|
-
import {
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
3
|
interface Params {
|
|
4
|
-
documentClient:
|
|
4
|
+
documentClient: DynamoDBDocument;
|
|
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 {};
|