@webiny/api-form-builder-so-ddb-es 0.0.0-mt-2 → 0.0.0-unstable.06b2ede40f
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 +16 -7
- package/configurations.js +38 -13
- package/configurations.js.map +1 -0
- package/definitions/elasticsearch.d.ts +47 -5
- package/definitions/elasticsearch.js +8 -16
- package/definitions/elasticsearch.js.map +1 -0
- package/definitions/form.d.ts +6 -4
- package/definitions/form.js +9 -17
- package/definitions/form.js.map +1 -0
- package/definitions/settings.d.ts +6 -4
- package/definitions/settings.js +8 -16
- package/definitions/settings.js.map +1 -0
- package/definitions/submission.d.ts +6 -4
- package/definitions/submission.js +8 -16
- package/definitions/submission.js.map +1 -0
- package/definitions/system.d.ts +6 -4
- package/definitions/system.js +8 -16
- package/definitions/system.js.map +1 -0
- package/definitions/table.d.ts +7 -6
- package/definitions/table.js +7 -6
- package/definitions/table.js.map +1 -0
- package/definitions/tableElasticsearch.d.ts +6 -5
- package/definitions/tableElasticsearch.js +7 -6
- package/definitions/tableElasticsearch.js.map +1 -0
- package/elasticsearch/createElasticsearchIndex.d.ts +10 -0
- package/elasticsearch/createElasticsearchIndex.js +41 -0
- package/elasticsearch/createElasticsearchIndex.js.map +1 -0
- package/elasticsearch/indices/base.d.ts +2 -0
- package/elasticsearch/indices/base.js +13 -0
- package/elasticsearch/indices/base.js.map +1 -0
- package/elasticsearch/indices/index.d.ts +1 -0
- package/elasticsearch/indices/index.js +14 -0
- package/elasticsearch/indices/index.js.map +1 -0
- package/elasticsearch/indices/japanese.d.ts +2 -0
- package/elasticsearch/indices/japanese.js +14 -0
- package/elasticsearch/indices/japanese.js.map +1 -0
- package/index.d.ts +2 -1
- package/index.js +100 -81
- package/index.js.map +1 -0
- package/operations/form/elasticsearchBody.d.ts +4 -4
- package/operations/form/elasticsearchBody.js +19 -63
- package/operations/form/elasticsearchBody.js.map +1 -0
- package/operations/form/elasticsearchFields.js +2 -3
- package/operations/form/elasticsearchFields.js.map +1 -0
- package/operations/form/fields.js +2 -3
- package/operations/form/fields.js.map +1 -0
- package/operations/form/index.d.ts +8 -8
- package/operations/form/index.js +196 -243
- package/operations/form/index.js.map +1 -0
- package/operations/settings/index.d.ts +5 -5
- package/operations/settings/index.js +26 -35
- package/operations/settings/index.js.map +1 -0
- package/operations/submission/elasticsearchBody.d.ts +4 -4
- package/operations/submission/elasticsearchBody.js +22 -61
- package/operations/submission/elasticsearchBody.js.map +1 -0
- package/operations/submission/elasticsearchFields.js +2 -3
- package/operations/submission/elasticsearchFields.js.map +1 -0
- package/operations/submission/index.d.ts +7 -7
- package/operations/submission/index.js +68 -96
- package/operations/submission/index.js.map +1 -0
- package/operations/system/index.d.ts +5 -5
- package/operations/system/index.js +22 -32
- package/operations/system/index.js.map +1 -0
- package/package.json +28 -35
- package/plugins/FormDynamoDbFieldPlugin.js +5 -9
- package/plugins/FormDynamoDbFieldPlugin.js.map +1 -0
- package/plugins/FormElasticsearchBodyModifierPlugin.d.ts +1 -1
- package/plugins/FormElasticsearchBodyModifierPlugin.js +6 -10
- package/plugins/FormElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/FormElasticsearchFieldPlugin.d.ts +1 -1
- package/plugins/FormElasticsearchFieldPlugin.js +6 -10
- package/plugins/FormElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/FormElasticsearchIndexPlugin.d.ts +4 -0
- package/plugins/FormElasticsearchIndexPlugin.js +13 -0
- package/plugins/FormElasticsearchIndexPlugin.js.map +1 -0
- package/plugins/FormElasticsearchQueryModifierPlugin.d.ts +1 -1
- package/plugins/FormElasticsearchQueryModifierPlugin.js +6 -10
- package/plugins/FormElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/FormElasticsearchSortModifierPlugin.d.ts +1 -1
- package/plugins/FormElasticsearchSortModifierPlugin.js +6 -10
- package/plugins/FormElasticsearchSortModifierPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.d.ts +1 -1
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js +6 -10
- package/plugins/SubmissionElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchFieldPlugin.d.ts +1 -1
- package/plugins/SubmissionElasticsearchFieldPlugin.js +6 -10
- package/plugins/SubmissionElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.d.ts +1 -1
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js +6 -10
- package/plugins/SubmissionElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/SubmissionElasticsearchSortModifierPlugin.d.ts +1 -1
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js +6 -10
- package/plugins/SubmissionElasticsearchSortModifierPlugin.js.map +1 -0
- 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 +17 -15
- package/types.js +6 -6
- 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/configurations.d.ts
CHANGED
|
@@ -1,9 +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;
|
|
8
|
+
locale: string;
|
|
9
|
+
}
|
|
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>;
|
|
3
17
|
}
|
|
4
|
-
declare const
|
|
5
|
-
es(params: ElasticsearchConfigParams): {
|
|
6
|
-
index: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
18
|
+
export declare const configurations: Configurations;
|
package/configurations.js
CHANGED
|
@@ -1,28 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
7
|
+
exports.configurations = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
10
|
+
var _plugins = require("./plugins");
|
|
11
|
+
const configurations = exports.configurations = {
|
|
8
12
|
es(params) {
|
|
9
13
|
const {
|
|
10
|
-
tenant
|
|
14
|
+
tenant,
|
|
15
|
+
locale
|
|
11
16
|
} = params;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
if (!tenant) {
|
|
18
|
+
throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
|
|
19
|
+
}
|
|
20
|
+
const sharedIndex = (0, _apiElasticsearch.isSharedElasticsearchIndex)();
|
|
21
|
+
const tenantId = sharedIndex ? "root" : tenant;
|
|
22
|
+
let localeCode = null;
|
|
23
|
+
if (process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE === "true") {
|
|
24
|
+
if (!locale) {
|
|
25
|
+
throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
|
|
26
|
+
}
|
|
27
|
+
localeCode = locale;
|
|
28
|
+
}
|
|
29
|
+
const index = [tenantId, localeCode, "form-builder"].filter(Boolean).join("-").toLowerCase();
|
|
30
|
+
const prefix = (0, _apiElasticsearch.getElasticsearchIndexPrefix)();
|
|
31
|
+
if (!prefix) {
|
|
17
32
|
return {
|
|
18
|
-
index
|
|
33
|
+
index
|
|
19
34
|
};
|
|
20
35
|
}
|
|
21
|
-
|
|
22
36
|
return {
|
|
23
|
-
index
|
|
37
|
+
index: prefix + index
|
|
24
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 : {};
|
|
25
50
|
}
|
|
26
|
-
|
|
27
51
|
};
|
|
28
|
-
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=configurations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
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
|
+
}>;
|
|
50
|
+
export {};
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createElasticsearchEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
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
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
18
8
|
const createElasticsearchEntity = params => {
|
|
19
9
|
const {
|
|
20
10
|
table,
|
|
21
11
|
entityName,
|
|
22
12
|
attributes
|
|
23
13
|
} = params;
|
|
24
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
25
15
|
name: entityName,
|
|
26
16
|
table,
|
|
27
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
28
18
|
PK: {
|
|
29
19
|
partitionKey: true
|
|
30
20
|
},
|
|
@@ -39,9 +29,11 @@ const createElasticsearchEntity = params => {
|
|
|
39
29
|
},
|
|
40
30
|
TYPE: {
|
|
41
31
|
type: "string"
|
|
42
|
-
}
|
|
43
|
-
|
|
32
|
+
},
|
|
33
|
+
...(attributes || {})
|
|
34
|
+
}
|
|
44
35
|
});
|
|
45
36
|
};
|
|
37
|
+
exports.createElasticsearchEntity = createElasticsearchEntity;
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
//# sourceMappingURL=elasticsearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
|
8
9
|
export declare const createFormEntity: (params: Params) => Entity<any>;
|
|
10
|
+
export {};
|
package/definitions/form.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createFormEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
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
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
18
8
|
const createFormEntity = params => {
|
|
19
9
|
const {
|
|
20
10
|
table,
|
|
21
11
|
entityName,
|
|
22
12
|
attributes
|
|
23
13
|
} = params;
|
|
24
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
25
15
|
table,
|
|
26
16
|
name: entityName,
|
|
27
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
28
18
|
PK: {
|
|
29
19
|
partitionKey: true
|
|
30
20
|
},
|
|
@@ -82,7 +72,7 @@ const createFormEntity = params => {
|
|
|
82
72
|
fields: {
|
|
83
73
|
type: "list"
|
|
84
74
|
},
|
|
85
|
-
|
|
75
|
+
steps: {
|
|
86
76
|
type: "list"
|
|
87
77
|
},
|
|
88
78
|
stats: {
|
|
@@ -96,9 +86,11 @@ const createFormEntity = params => {
|
|
|
96
86
|
},
|
|
97
87
|
webinyVersion: {
|
|
98
88
|
type: "string"
|
|
99
|
-
}
|
|
100
|
-
|
|
89
|
+
},
|
|
90
|
+
...(attributes || {})
|
|
91
|
+
}
|
|
101
92
|
});
|
|
102
93
|
};
|
|
94
|
+
exports.createFormEntity = createFormEntity;
|
|
103
95
|
|
|
104
|
-
|
|
96
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
|
8
9
|
export declare const createSettingsEntity: (params: Params) => Entity<any>;
|
|
10
|
+
export {};
|
package/definitions/settings.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createSettingsEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
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
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
18
8
|
const createSettingsEntity = params => {
|
|
19
9
|
const {
|
|
20
10
|
entityName,
|
|
21
11
|
attributes,
|
|
22
12
|
table
|
|
23
13
|
} = params;
|
|
24
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
25
15
|
name: entityName,
|
|
26
16
|
table,
|
|
27
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
28
18
|
PK: {
|
|
29
19
|
partitionKey: true
|
|
30
20
|
},
|
|
@@ -45,9 +35,11 @@ const createSettingsEntity = params => {
|
|
|
45
35
|
},
|
|
46
36
|
locale: {
|
|
47
37
|
type: "string"
|
|
48
|
-
}
|
|
49
|
-
|
|
38
|
+
},
|
|
39
|
+
...(attributes || {})
|
|
40
|
+
}
|
|
50
41
|
});
|
|
51
42
|
};
|
|
43
|
+
exports.createSettingsEntity = createSettingsEntity;
|
|
52
44
|
|
|
53
|
-
|
|
45
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
|
8
9
|
export declare const createSubmissionEntity: (params: Params) => Entity<any>;
|
|
10
|
+
export {};
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createSubmissionEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
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
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
18
8
|
const createSubmissionEntity = params => {
|
|
19
9
|
const {
|
|
20
10
|
table,
|
|
21
11
|
entityName,
|
|
22
12
|
attributes
|
|
23
13
|
} = params;
|
|
24
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
25
15
|
table,
|
|
26
16
|
name: entityName,
|
|
27
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
28
18
|
PK: {
|
|
29
19
|
partitionKey: true
|
|
30
20
|
},
|
|
@@ -66,9 +56,11 @@ const createSubmissionEntity = params => {
|
|
|
66
56
|
},
|
|
67
57
|
webinyVersion: {
|
|
68
58
|
type: "string"
|
|
69
|
-
}
|
|
70
|
-
|
|
59
|
+
},
|
|
60
|
+
...(attributes || {})
|
|
61
|
+
}
|
|
71
62
|
});
|
|
72
63
|
};
|
|
64
|
+
exports.createSubmissionEntity = createSubmissionEntity;
|
|
73
65
|
|
|
74
|
-
|
|
66
|
+
//# sourceMappingURL=submission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
import type { Attributes } from "../types";
|
|
4
|
+
interface Params {
|
|
5
|
+
table: Table<string, string, string>;
|
|
5
6
|
entityName: string;
|
|
6
7
|
attributes: Attributes;
|
|
7
8
|
}
|
|
8
9
|
export declare const createSystemEntity: (params: Params) => Entity<any>;
|
|
10
|
+
export {};
|
package/definitions/system.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.createSystemEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
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
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
18
8
|
const createSystemEntity = params => {
|
|
19
9
|
const {
|
|
20
10
|
entityName,
|
|
21
11
|
attributes,
|
|
22
12
|
table
|
|
23
13
|
} = params;
|
|
24
|
-
return new
|
|
14
|
+
return new _toolbox.Entity({
|
|
25
15
|
name: entityName,
|
|
26
16
|
table,
|
|
27
|
-
attributes:
|
|
17
|
+
attributes: {
|
|
28
18
|
PK: {
|
|
29
19
|
partitionKey: true
|
|
30
20
|
},
|
|
@@ -36,9 +26,11 @@ const createSystemEntity = params => {
|
|
|
36
26
|
},
|
|
37
27
|
tenant: {
|
|
38
28
|
type: "string"
|
|
39
|
-
}
|
|
40
|
-
|
|
29
|
+
},
|
|
30
|
+
...(attributes || {})
|
|
31
|
+
}
|
|
41
32
|
});
|
|
42
33
|
};
|
|
34
|
+
exports.createSystemEntity = createSystemEntity;
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Table } from "dynamodb
|
|
3
|
-
|
|
4
|
-
tableName
|
|
5
|
-
documentClient:
|
|
1
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
2
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
+
interface Params {
|
|
4
|
+
tableName?: string;
|
|
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
|
+
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
|
|
@@ -0,0 +1 @@
|
|
|
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,7 +1,8 @@
|
|
|
1
|
-
import { Table } from "dynamodb
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
documentClient:
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
+
interface Params {
|
|
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
|
+
export {};
|
|
@@ -4,20 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createElasticsearchTable = void 0;
|
|
7
|
-
|
|
8
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
9
|
-
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createElasticsearchTable = 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_ELASTICSEARCH,
|
|
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.createElasticsearchTable = createElasticsearchTable;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
//# sourceMappingURL=tableElasticsearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\n\ninterface Params {\n documentClient: DynamoDBDocument;\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","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Client } from "@elastic/elasticsearch";
|
|
2
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
|
+
interface CreateElasticsearchIndexParams {
|
|
4
|
+
elasticsearch: Client;
|
|
5
|
+
plugins: PluginsContainer;
|
|
6
|
+
tenant: string;
|
|
7
|
+
locale: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const createElasticsearchIndex: (params: CreateElasticsearchIndexParams) => Promise<void>;
|
|
10
|
+
export {};
|