@webiny/api-headless-cms-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/entry.d.ts +2 -2
- package/definitions/entry.js +63 -14
- package/definitions/entry.js.map +1 -1
- package/definitions/entryElasticsearch.d.ts +2 -2
- package/definitions/entryElasticsearch.js +9 -8
- package/definitions/entryElasticsearch.js.map +1 -1
- package/definitions/group.d.ts +2 -2
- package/definitions/group.js +9 -8
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +2 -2
- package/definitions/model.js +9 -8
- package/definitions/model.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/dynamoDb/index.d.ts +1 -0
- package/dynamoDb/index.js +9 -3
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/date.js +19 -12
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.js +3 -1
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +5 -5
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +1 -1
- package/elasticsearch/createElasticsearchIndex.js +19 -29
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
- package/elasticsearch/deleteElasticsearchIndex.js +6 -4
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.js +3 -1
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +5 -5
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +3 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.js +5 -2
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +2 -0
- package/elasticsearch/indexing/jsonIndexing.js +28 -0
- package/elasticsearch/indexing/jsonIndexing.js.map +1 -0
- package/elasticsearch/indexing/longTextIndexing.js +3 -1
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.js +3 -1
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.js +8 -12
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +3 -1
- package/elasticsearch/indexing/richTextIndexing.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/elasticsearch/search/index.js +3 -1
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.js +3 -1
- package/elasticsearch/search/refSearch.js.map +1 -1
- package/elasticsearch/search/timeSearch.js +4 -3
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.js +19 -13
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +2 -2
- package/helpers/fieldIdentifier.js +6 -2
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.js +3 -1
- package/helpers/index.js.map +1 -1
- package/index.js +14 -16
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.js +7 -9
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +3 -1
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +3 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js +3 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +3 -4
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +3 -4
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.js +3 -4
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.js +3 -1
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +1 -1
- package/operations/entry/dataLoader/types.js +3 -1
- package/operations/entry/dataLoader/types.js.map +1 -1
- package/operations/entry/dataLoaders.d.ts +1 -1
- package/operations/entry/dataLoaders.js +15 -14
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +3 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.js +3 -1
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.js +63 -76
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +3 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.js +6 -3
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +3 -1
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/path.js +3 -1
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +3 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +3 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +3 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +3 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/populated.js +4 -2
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +3 -1
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.js +3 -1
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.js +3 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.js +3 -1
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.js +3 -1
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +3 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.js +3 -1
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.js +3 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/search.js +3 -1
- package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
- package/operations/entry/elasticsearch/sort.js +3 -1
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.js +3 -1
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.js +3 -1
- package/operations/entry/index.d.ts +1 -1
- package/operations/entry/index.js +454 -296
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +3 -1
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +3 -1
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
- package/operations/entry/transformations/convertEntryKeys.js +38 -0
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +29 -0
- package/operations/entry/transformations/index.js +127 -0
- package/operations/entry/transformations/index.js.map +1 -0
- package/operations/entry/transformations/modifyEntryValues.d.ts +46 -0
- package/operations/entry/transformations/modifyEntryValues.js +28 -0
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
- package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
- package/operations/entry/transformations/transformEntryKeys.js +27 -0
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
- package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
- package/operations/entry/transformations/transformEntryToIndex.js +31 -0
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
- package/operations/group/index.d.ts +1 -1
- package/operations/group/index.js +38 -24
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +1 -1
- package/operations/model/index.js +26 -14
- package/operations/model/index.js.map +1 -1
- package/operations/system/index.d.ts +1 -1
- package/operations/system/index.js +19 -7
- package/operations/system/index.js.map +1 -1
- package/operations/system/indexes.d.ts +10 -0
- package/operations/system/indexes.js +41 -0
- package/operations/system/indexes.js.map +1 -0
- package/package.json +28 -25
- package/plugins/CmsElasticsearchModelFieldPlugin.js +11 -7
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +4 -5
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +4 -5
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +5 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +8 -5
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +4 -5
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +4 -5
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +33 -0
- package/plugins/CmsEntryElasticsearchValuesModifier.js +50 -0
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -0
- package/plugins/CmsEntryFilterPlugin.js +4 -6
- package/plugins/CmsEntryFilterPlugin.js.map +1 -1
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +14 -1
- package/plugins/index.js.map +1 -1
- package/types.d.ts +13 -15
- package/types.js +6 -5
- package/types.js.map +1 -1
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -53
- package/definitions/settings.js.map +0 -1
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -111
- package/operations/settings/index.js.map +0 -1
package/configurations.js
CHANGED
package/configurations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configurations","es","model","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","index","modelId","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX"],"sources":["configurations.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\ninterface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\ninterface Configurations {\n es: (params: CmsElasticsearchParams) => ElasticsearchConfig;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\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":";;;;;;;AACA;AAcO,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","configurations","es","model","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","index","modelId","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX","exports"],"sources":["configurations.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\ninterface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\ninterface Configurations {\n es: (params: CmsElasticsearchParams) => ElasticsearchConfig;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\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":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAcO,MAAMC,cAA8B,GAAG;EAC1CC,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CAChB,4EAA2E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAChB,4EAA2E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B,KAAK,MAAM;IACvE,MAAMC,KAAK,GAAG,CAACJ,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACS,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAGP,OAAO,CAACC,GAAG,CAACO,2BAA2B,IAAI,EAAE;IAC5D,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL;AACJ,CAAC;AAACM,OAAA,CAAAhB,cAAA,GAAAA,cAAA"}
|
package/definitions/entry.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
|
export interface CreateEntryEntityParams {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
package/definitions/entry.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.createEntryEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createEntryEntity = 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
|
type: "string",
|
|
22
20
|
partitionKey: true
|
|
@@ -43,28 +41,76 @@ const createEntryEntity = params => {
|
|
|
43
41
|
id: {
|
|
44
42
|
type: "string"
|
|
45
43
|
},
|
|
46
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Revision-level meta fields. 👇
|
|
46
|
+
*/
|
|
47
|
+
revisionCreatedOn: {
|
|
48
|
+
type: "string"
|
|
49
|
+
},
|
|
50
|
+
revisionSavedOn: {
|
|
51
|
+
type: "string"
|
|
52
|
+
},
|
|
53
|
+
revisionModifiedOn: {
|
|
54
|
+
type: "string"
|
|
55
|
+
},
|
|
56
|
+
revisionFirstPublishedOn: {
|
|
57
|
+
type: "string"
|
|
58
|
+
},
|
|
59
|
+
revisionLastPublishedOn: {
|
|
60
|
+
type: "string"
|
|
61
|
+
},
|
|
62
|
+
revisionCreatedBy: {
|
|
47
63
|
type: "map"
|
|
48
64
|
},
|
|
49
|
-
|
|
65
|
+
revisionSavedBy: {
|
|
50
66
|
type: "map"
|
|
51
67
|
},
|
|
52
|
-
|
|
68
|
+
revisionModifiedBy: {
|
|
53
69
|
type: "map"
|
|
54
70
|
},
|
|
71
|
+
revisionFirstPublishedBy: {
|
|
72
|
+
type: "map"
|
|
73
|
+
},
|
|
74
|
+
revisionLastPublishedBy: {
|
|
75
|
+
type: "map"
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Entry-level meta fields. 👇
|
|
79
|
+
*/
|
|
55
80
|
createdOn: {
|
|
56
81
|
type: "string"
|
|
57
82
|
},
|
|
58
83
|
savedOn: {
|
|
59
84
|
type: "string"
|
|
60
85
|
},
|
|
61
|
-
|
|
86
|
+
modifiedOn: {
|
|
62
87
|
type: "string"
|
|
63
88
|
},
|
|
64
|
-
|
|
89
|
+
firstPublishedOn: {
|
|
90
|
+
type: "string"
|
|
91
|
+
},
|
|
92
|
+
lastPublishedOn: {
|
|
65
93
|
type: "string"
|
|
66
94
|
},
|
|
67
|
-
|
|
95
|
+
createdBy: {
|
|
96
|
+
type: "map"
|
|
97
|
+
},
|
|
98
|
+
savedBy: {
|
|
99
|
+
type: "map"
|
|
100
|
+
},
|
|
101
|
+
modifiedBy: {
|
|
102
|
+
type: "map"
|
|
103
|
+
},
|
|
104
|
+
firstPublishedBy: {
|
|
105
|
+
type: "map"
|
|
106
|
+
},
|
|
107
|
+
lastPublishedBy: {
|
|
108
|
+
type: "map"
|
|
109
|
+
},
|
|
110
|
+
modelId: {
|
|
111
|
+
type: "string"
|
|
112
|
+
},
|
|
113
|
+
locale: {
|
|
68
114
|
type: "string"
|
|
69
115
|
},
|
|
70
116
|
version: {
|
|
@@ -84,8 +130,11 @@ const createEntryEntity = params => {
|
|
|
84
130
|
},
|
|
85
131
|
meta: {
|
|
86
132
|
type: "map"
|
|
87
|
-
}
|
|
88
|
-
|
|
133
|
+
},
|
|
134
|
+
...(attributes || {})
|
|
135
|
+
}
|
|
89
136
|
});
|
|
90
137
|
};
|
|
91
|
-
exports.createEntryEntity = createEntryEntity;
|
|
138
|
+
exports.createEntryEntity = createEntryEntity;
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=entry.js.map
|
package/definitions/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","firstPublishedBy","lastPublishedBy","modelId","locale","version","locked","status","location","values","meta","exports"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: { type: \"string\" },\n revisionSavedOn: { type: \"string\" },\n revisionModifiedOn: { type: \"string\" },\n revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { type: \"map\" },\n revisionFirstPublishedBy: { type: \"map\" },\n revisionLastPublishedBy: { type: \"map\" },\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: { type: \"string\" },\n savedOn: { type: \"string\" },\n modifiedOn: { type: \"string\" },\n firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\n\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n location: {\n type: \"map\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,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,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,MAAM,EAAE;QACJL,IAAI,EAAE;MACV,CAAC;MACDM,aAAa,EAAE;QACXN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV,CAAC;MACDQ,OAAO,EAAE;QACLR,IAAI,EAAE;MACV,CAAC;MACDS,EAAE,EAAE;QACAT,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYU,iBAAiB,EAAE;QAAEV,IAAI,EAAE;MAAS,CAAC;MACrCW,eAAe,EAAE;QAAEX,IAAI,EAAE;MAAS,CAAC;MACnCY,kBAAkB,EAAE;QAAEZ,IAAI,EAAE;MAAS,CAAC;MACtCa,wBAAwB,EAAE;QAAEb,IAAI,EAAE;MAAS,CAAC;MAC5Cc,uBAAuB,EAAE;QAAEd,IAAI,EAAE;MAAS,CAAC;MAC3Ce,iBAAiB,EAAE;QAAEf,IAAI,EAAE;MAAM,CAAC;MAClCgB,eAAe,EAAE;QAAEhB,IAAI,EAAE;MAAM,CAAC;MAChCiB,kBAAkB,EAAE;QAAEjB,IAAI,EAAE;MAAM,CAAC;MACnCkB,wBAAwB,EAAE;QAAElB,IAAI,EAAE;MAAM,CAAC;MACzCmB,uBAAuB,EAAE;QAAEnB,IAAI,EAAE;MAAM,CAAC;MAExC;AACZ;AACA;MACYoB,SAAS,EAAE;QAAEpB,IAAI,EAAE;MAAS,CAAC;MAC7BqB,OAAO,EAAE;QAAErB,IAAI,EAAE;MAAS,CAAC;MAC3BsB,UAAU,EAAE;QAAEtB,IAAI,EAAE;MAAS,CAAC;MAC9BuB,gBAAgB,EAAE;QAAEvB,IAAI,EAAE;MAAS,CAAC;MACpCwB,eAAe,EAAE;QAAExB,IAAI,EAAE;MAAS,CAAC;MACnCyB,SAAS,EAAE;QAAEzB,IAAI,EAAE;MAAM,CAAC;MAC1B0B,OAAO,EAAE;QAAE1B,IAAI,EAAE;MAAM,CAAC;MACxB2B,UAAU,EAAE;QAAE3B,IAAI,EAAE;MAAM,CAAC;MAC3B4B,gBAAgB,EAAE;QAAE5B,IAAI,EAAE;MAAM,CAAC;MACjC6B,eAAe,EAAE;QAAE7B,IAAI,EAAE;MAAM,CAAC;MAEhC8B,OAAO,EAAE;QACL9B,IAAI,EAAE;MACV,CAAC;MACD+B,MAAM,EAAE;QACJ/B,IAAI,EAAE;MACV,CAAC;MACDgC,OAAO,EAAE;QACLhC,IAAI,EAAE;MACV,CAAC;MACDiC,MAAM,EAAE;QACJjC,IAAI,EAAE;MACV,CAAC;MACDkC,MAAM,EAAE;QACJlC,IAAI,EAAE;MACV,CAAC;MACDmC,QAAQ,EAAE;QACNnC,IAAI,EAAE;MACV,CAAC;MACDoC,MAAM,EAAE;QACJpC,IAAI,EAAE;MACV,CAAC;MACDqC,IAAI,EAAE;QACFrC,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC0C,OAAA,CAAA9C,iBAAA,GAAAA,iBAAA"}
|
|
@@ -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
|
export interface CreateEntryElasticsearchEntityParams {
|
|
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.createEntryElasticsearchEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createEntryElasticsearchEntity = 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
|
type: "string",
|
|
22
20
|
partitionKey: true
|
|
@@ -30,8 +28,11 @@ const createEntryElasticsearchEntity = params => {
|
|
|
30
28
|
},
|
|
31
29
|
data: {
|
|
32
30
|
type: "map"
|
|
33
|
-
}
|
|
34
|
-
|
|
31
|
+
},
|
|
32
|
+
...(attributes || {})
|
|
33
|
+
}
|
|
35
34
|
});
|
|
36
35
|
};
|
|
37
|
-
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
|
|
36
|
+
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=entryElasticsearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,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,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACU,OAAA,CAAAd,8BAAA,GAAAA,8BAAA"}
|
package/definitions/group.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
|
export interface CreateGroupEntityParams {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
package/definitions/group.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.createGroupEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createGroupEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
table,
|
|
13
11
|
attributes,
|
|
14
12
|
entityName
|
|
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
|
},
|
|
@@ -58,8 +56,11 @@ const createGroupEntity = params => {
|
|
|
58
56
|
},
|
|
59
57
|
tenant: {
|
|
60
58
|
type: "string"
|
|
61
|
-
}
|
|
62
|
-
|
|
59
|
+
},
|
|
60
|
+
...(attributes || {})
|
|
61
|
+
}
|
|
63
62
|
});
|
|
64
63
|
};
|
|
65
|
-
exports.createGroupEntity = createGroupEntity;
|
|
64
|
+
exports.createGroupEntity = createGroupEntity;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=group.js.map
|
package/definitions/group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant","exports"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: CreateGroupEntityParams): Entity<any> => {\n const { table, attributes, entityName } = 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 webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,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,aAAa,EAAE;QACXD,IAAI,EAAE;MACV,CAAC;MACDE,EAAE,EAAE;QACAF,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,WAAW,EAAE;QACTL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MAEDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDS,OAAO,EAAE;QACLT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACoB,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA"}
|
package/definitions/model.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
|
export interface CreateModelEntityParams {
|
|
4
|
-
table: Table
|
|
4
|
+
table: Table<string, string, string>;
|
|
5
5
|
entityName: string;
|
|
6
6
|
attributes: Attributes;
|
|
7
7
|
}
|
package/definitions/model.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.createModelEntity = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
7
|
+
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
10
8
|
const createModelEntity = params => {
|
|
11
9
|
const {
|
|
12
10
|
table,
|
|
13
11
|
attributes,
|
|
14
12
|
entityName
|
|
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
|
},
|
|
@@ -102,8 +100,11 @@ const createModelEntity = params => {
|
|
|
102
100
|
tenant: {
|
|
103
101
|
type: "string",
|
|
104
102
|
required: true
|
|
105
|
-
}
|
|
106
|
-
|
|
103
|
+
},
|
|
104
|
+
...(attributes || {})
|
|
105
|
+
}
|
|
107
106
|
});
|
|
108
107
|
};
|
|
109
|
-
exports.createModelEntity = createModelEntity;
|
|
108
|
+
exports.createModelEntity = createModelEntity;
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=model.js.map
|
package/definitions/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","tenant"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","tenant","exports"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: CreateModelEntityParams): Entity<any> => {\n const { table, attributes, entityName } = 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 required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n singularApiName: {\n type: \"string\",\n required: true\n },\n pluralApiName: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n icon: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n tags: {\n type: \"list\",\n required: false,\n default: []\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n descriptionFieldId: {\n type: \"string\"\n },\n imageFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDC,aAAa,EAAE;QACXF,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDP,IAAI,EAAE;QACFM,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDE,OAAO,EAAE;QACLH,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDG,eAAe,EAAE;QACbJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,aAAa,EAAE;QACXL,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDK,MAAM,EAAE;QACJN,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDM,KAAK,EAAE;QACHP,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDO,IAAI,EAAE;QACFR,IAAI,EAAE;MACV,CAAC;MACDS,WAAW,EAAE;QACTT,IAAI,EAAE;MACV,CAAC;MACDU,SAAS,EAAE;QACPV,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDU,OAAO,EAAE;QACLX,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDW,SAAS,EAAE;QACPZ,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDY,MAAM,EAAE;QACJb,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDa,MAAM,EAAE;QACJd,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDc,IAAI,EAAE;QACFf,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,KAAK;QACfe,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVjB,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDiB,YAAY,EAAE;QACVlB,IAAI,EAAE;MACV,CAAC;MACDmB,kBAAkB,EAAE;QAChBnB,IAAI,EAAE;MACV,CAAC;MACDoB,YAAY,EAAE;QACVpB,IAAI,EAAE;MACV,CAAC;MACDqB,MAAM,EAAE;QACJrB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACD,IAAIV,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC+B,OAAA,CAAAlC,iBAAA,GAAAA,iBAAA"}
|
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
|
export interface CreateSystemEntityParams {
|
|
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
|
},
|
|
@@ -34,8 +32,11 @@ const createSystemEntity = params => {
|
|
|
34
32
|
},
|
|
35
33
|
readAPIKey: {
|
|
36
34
|
type: "string"
|
|
37
|
-
}
|
|
38
|
-
|
|
35
|
+
},
|
|
36
|
+
...(attributes || {})
|
|
37
|
+
}
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
|
-
exports.createSystemEntity = createSystemEntity;
|
|
40
|
+
exports.createSystemEntity = createSystemEntity;
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey"],"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","locale","tenant","readAPIKey","exports"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): 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 locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,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;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TableModifier } from "../types";
|
|
2
|
-
import {
|
|
3
|
-
import { Table } from "dynamodb
|
|
2
|
+
import { DynamoDBClient } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
4
4
|
export interface CreateTableParams {
|
|
5
5
|
table?: TableModifier;
|
|
6
|
-
documentClient:
|
|
6
|
+
documentClient: DynamoDBClient;
|
|
7
7
|
}
|
|
8
|
-
export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table
|
|
8
|
+
export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table<string, string, string>;
|
package/definitions/table.js
CHANGED
|
@@ -4,7 +4,7 @@ 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 = ({
|
|
9
9
|
table,
|
|
10
10
|
documentClient
|
|
@@ -13,9 +13,13 @@ const createTable = ({
|
|
|
13
13
|
name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
|
|
14
14
|
partitionKey: "PK",
|
|
15
15
|
sortKey: "SK",
|
|
16
|
-
DocumentClient: documentClient
|
|
16
|
+
DocumentClient: documentClient,
|
|
17
|
+
autoExecute: true,
|
|
18
|
+
autoParse: true
|
|
17
19
|
};
|
|
18
20
|
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
19
|
-
return new
|
|
21
|
+
return new _toolbox.Table(config);
|
|
20
22
|
};
|
|
21
|
-
exports.createTable = createTable;
|
|
23
|
+
exports.createTable = createTable;
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=table.js.map
|
package/definitions/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","config","Table"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport {
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DynamoDBClient } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table, TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DynamoDBClient;\n}\nexport const createTable = ({\n table,\n documentClient\n}: CreateTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAMO,MAAMC,WAAW,GAAGA,CAAC;EACxBC,KAAK;EACLC;AACe,CAAC,KAAoC;EACpD,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC3EC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOb,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIY,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAhB,WAAA,GAAAA,WAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TableModifier } from "../types";
|
|
2
|
-
import {
|
|
3
|
-
import { Table } from "dynamodb
|
|
2
|
+
import { DynamoDBClient } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
4
4
|
export interface CreateElasticsearchTableParams {
|
|
5
5
|
table?: TableModifier;
|
|
6
|
-
documentClient:
|
|
6
|
+
documentClient: DynamoDBClient;
|
|
7
7
|
}
|
|
8
|
-
export declare const createElasticsearchTable: ({ table, documentClient }: CreateElasticsearchTableParams) => Table
|
|
8
|
+
export declare const createElasticsearchTable: ({ table, documentClient }: CreateElasticsearchTableParams) => Table<string, string, string>;
|
|
@@ -4,7 +4,7 @@ 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 = ({
|
|
9
9
|
table,
|
|
10
10
|
documentClient
|
|
@@ -13,9 +13,13 @@ const createElasticsearchTable = ({
|
|
|
13
13
|
name: process.env.DB_TABLE_ELASTICSEARCH,
|
|
14
14
|
partitionKey: "PK",
|
|
15
15
|
sortKey: "SK",
|
|
16
|
-
DocumentClient: documentClient
|
|
16
|
+
DocumentClient: documentClient,
|
|
17
|
+
autoExecute: true,
|
|
18
|
+
autoParse: true
|
|
17
19
|
};
|
|
18
20
|
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
19
|
-
return new
|
|
21
|
+
return new _toolbox.Table(config);
|
|
20
22
|
};
|
|
21
|
-
exports.createElasticsearchTable = createElasticsearchTable;
|
|
23
|
+
exports.createElasticsearchTable = createElasticsearchTable;
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=tableElasticsearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","config","Table"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport {
|
|
1
|
+
{"version":3,"names":["_toolbox","require","createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DynamoDBClient } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DynamoDBClient;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: CreateElasticsearchTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: 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 const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAGA,CAAC;EACrCC,KAAK;EACLC;AAC4B,CAAC,KAAoC;EACjE,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,sBAAgC;IAClDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOZ,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIW,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAf,wBAAA,GAAAA,wBAAA"}
|
package/dynamoDb/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
declare const _default: () => import("@webiny/api-headless-cms").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>[];
|
|
2
2
|
export default _default;
|
|
3
|
+
export declare const createDynamoDbPlugins: () => import("@webiny/api-headless-cms").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>[];
|
package/dynamoDb/index.js
CHANGED
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.createDynamoDbPlugins = void 0;
|
|
7
7
|
var _richText = require("./storage/richText");
|
|
8
8
|
var _longText = require("./storage/longText");
|
|
9
9
|
var _date = require("./storage/date");
|
|
10
|
-
var _default = () =>
|
|
11
|
-
exports.default = _default;
|
|
10
|
+
var _default = () => createDynamoDbPlugins();
|
|
11
|
+
exports.default = _default;
|
|
12
|
+
const createDynamoDbPlugins = () => {
|
|
13
|
+
return [(0, _richText.createRichTextStorageTransformPlugin)(), (0, _longText.createLongTextStorageTransformPlugin)(), (0, _date.createDateStorageTransformPlugin)()];
|
|
14
|
+
};
|
|
15
|
+
exports.createDynamoDbPlugins = createDynamoDbPlugins;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
package/dynamoDb/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\n\nexport default () => [\n
|
|
1
|
+
{"version":3,"names":["_richText","require","_longText","_date","_default","createDynamoDbPlugins","exports","default","createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\n\nexport default () => createDynamoDbPlugins();\n\nexport const createDynamoDbPlugins = () => {\n return [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createDateStorageTransformPlugin()\n ];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAAkE,IAAAG,QAAA,GAEnDA,CAAA,KAAMC,qBAAqB,CAAC,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA;AAErC,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,CACH,IAAAG,8CAAoC,EAAC,CAAC,EACtC,IAAAC,8CAAoC,EAAC,CAAC,EACtC,IAAAC,sCAAgC,EAAC,CAAC,CACrC;AACL,CAAC;AAACJ,OAAA,CAAAD,qBAAA,GAAAA,qBAAA"}
|