@webiny/api-headless-cms-ddb-es 6.0.0-beta.0 → 6.0.0-rc.0
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/README.md +6 -30
- package/configurations.d.ts +4 -5
- package/configurations.js +12 -24
- package/configurations.js.map +1 -1
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +5 -174
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +5 -58
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +5 -102
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +59 -0
- package/definitions/types.js +3 -0
- package/definitions/types.js.map +1 -0
- package/dynamoDb/index.d.ts +2 -2
- package/dynamoDb/index.js +5 -14
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/longText.js +11 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.d.ts +0 -5
- package/dynamoDb/storage/richText.js +25 -80
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/createElasticsearchIndex.js +7 -15
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
- package/elasticsearch/deleteElasticsearchIndex.js +3 -10
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.d.ts +1 -1
- package/elasticsearch/index.js +3 -11
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +1 -8
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +1 -8
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.d.ts +1 -1
- package/elasticsearch/indexing/index.js +8 -16
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
- package/elasticsearch/indexing/jsonIndexing.js +1 -8
- package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/longTextIndexing.js +1 -8
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
- package/elasticsearch/indexing/numberIndexing.js +1 -8
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
- package/elasticsearch/indexing/objectIndexing.js +6 -13
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +1 -8
- package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
- package/elasticsearch/indices/base.d.ts +1 -1
- package/elasticsearch/indices/base.js +4 -10
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.d.ts +1 -1
- package/elasticsearch/indices/index.js +3 -11
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/search/index.d.ts +1 -1
- package/elasticsearch/search/index.js +4 -10
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.d.ts +1 -1
- package/elasticsearch/search/refSearch.js +3 -10
- package/elasticsearch/search/refSearch.js.map +1 -1
- package/elasticsearch/search/searchableJson.d.ts +2 -0
- package/elasticsearch/search/searchableJson.js +53 -0
- package/elasticsearch/search/searchableJson.js.map +1 -0
- package/elasticsearch/search/timeSearch.d.ts +1 -1
- package/elasticsearch/search/timeSearch.js +3 -10
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.d.ts +10 -10
- package/helpers/entryIndexHelpers.js +32 -26
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +1 -1
- package/helpers/fieldIdentifier.js +2 -10
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.d.ts +2 -2
- package/helpers/index.js +2 -27
- package/helpers/index.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +108 -134
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -3
- package/operations/entry/dataLoader/DataLoaderCache.js +2 -9
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +1 -7
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
- package/operations/entry/dataLoader/getAllEntryRevisions.js +11 -24
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +18 -30
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +18 -30
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
- package/operations/entry/dataLoader/getRevisionById.js +23 -35
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +5 -5
- package/operations/entry/dataLoader/index.js +10 -31
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +3 -4
- package/operations/entry/dataLoader/types.js +1 -5
- package/operations/entry/dataLoader/types.js.map +1 -1
- package/operations/entry/dataLoaders.d.ts +13 -13
- package/operations/entry/dataLoaders.js +15 -25
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -8
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +3 -3
- package/operations/entry/elasticsearch/body.js +21 -28
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.d.ts +3 -3
- package/operations/entry/elasticsearch/fields.js +110 -24
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +10 -17
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +7 -6
- package/operations/entry/elasticsearch/filtering/exec.js +48 -45
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +1 -16
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
- package/operations/entry/elasticsearch/filtering/path.js +9 -17
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +6 -14
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +5 -12
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +7 -15
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +15 -16
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/populated.js +1 -8
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +4 -12
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +3 -3
- package/operations/entry/elasticsearch/fullTextSearch.js +6 -12
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.js +1 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
- package/operations/entry/elasticsearch/initialQuery.js +9 -26
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.d.ts +1 -1
- package/operations/entry/elasticsearch/keyword.js +4 -9
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -3
- package/operations/entry/elasticsearch/plugins/operator.js +4 -19
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/queryModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
- package/operations/entry/elasticsearch/plugins/search.js +5 -13
- package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
- package/operations/entry/elasticsearch/sort.d.ts +4 -4
- package/operations/entry/elasticsearch/sort.js +57 -33
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
- package/operations/entry/elasticsearch/transformValueForSearch.js +4 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +5 -5
- package/operations/entry/elasticsearch/types.js +1 -5
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +7 -6
- package/operations/entry/index.js +634 -735
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +56 -19
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +3 -12
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
- package/operations/entry/transformations/convertEntryKeys.js +2 -10
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +17 -17
- package/operations/entry/transformations/index.js +22 -30
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +27 -34
- package/operations/entry/transformations/modifyEntryValues.js +1 -8
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
- package/operations/entry/transformations/transformEntryKeys.js +4 -11
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +7 -7
- package/operations/entry/transformations/transformEntryToIndex.js +3 -10
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +6 -5
- package/operations/group/index.js +39 -73
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +4 -4
- package/operations/model/index.js +38 -57
- package/operations/model/index.js.map +1 -1
- package/package.json +29 -41
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.js +2 -8
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +2 -9
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +12 -12
- package/plugins/CmsEntryElasticsearchValuesModifier.js +4 -12
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
- package/plugins/CmsEntryFilterPlugin.js +2 -9
- package/plugins/CmsEntryFilterPlugin.js.map +1 -1
- package/plugins/index.d.ts +8 -8
- package/plugins/index.js +8 -93
- package/plugins/index.js.map +1 -1
- package/tasks/createIndexTaskPlugin.d.ts +2 -2
- package/tasks/createIndexTaskPlugin.js +36 -62
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +28 -33
- package/types.js +5 -8
- package/types.js.map +1 -1
- package/values/NoValueContainer.d.ts +5 -0
- package/values/NoValueContainer.js +13 -0
- package/values/NoValueContainer.js.map +1 -0
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -38
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -42
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -25
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -25
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -84
- package/dynamoDb/storage/date.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -14
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -94
- package/operations/system/index.js.map +0 -1
- package/operations/system/indexes.d.ts +0 -10
- package/operations/system/indexes.js +0 -41
- package/operations/system/indexes.js.map +0 -1
package/plugins/index.js
CHANGED
|
@@ -1,95 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchBodyModifierPlugin[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _CmsEntryElasticsearchBodyModifierPlugin[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _CmsEntryElasticsearchIndexPlugin = require("./CmsEntryElasticsearchIndexPlugin");
|
|
18
|
-
Object.keys(_CmsEntryElasticsearchIndexPlugin).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchIndexPlugin[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _CmsEntryElasticsearchIndexPlugin[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("./CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
29
|
-
Object.keys(_CmsEntryElasticsearchQueryBuilderValueSearchPlugin).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchQueryBuilderValueSearchPlugin[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _CmsEntryElasticsearchQueryBuilderValueSearchPlugin[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _CmsEntryElasticsearchQueryModifierPlugin = require("./CmsEntryElasticsearchQueryModifierPlugin");
|
|
40
|
-
Object.keys(_CmsEntryElasticsearchQueryModifierPlugin).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchQueryModifierPlugin[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _CmsEntryElasticsearchQueryModifierPlugin[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _CmsEntryElasticsearchSortModifierPlugin = require("./CmsEntryElasticsearchSortModifierPlugin");
|
|
51
|
-
Object.keys(_CmsEntryElasticsearchSortModifierPlugin).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchSortModifierPlugin[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _CmsEntryElasticsearchSortModifierPlugin[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _CmsEntryElasticsearchFullTextSearchPlugin = require("./CmsEntryElasticsearchFullTextSearchPlugin");
|
|
62
|
-
Object.keys(_CmsEntryElasticsearchFullTextSearchPlugin).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchFullTextSearchPlugin[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _CmsEntryElasticsearchFullTextSearchPlugin[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
var _CmsElasticsearchModelFieldPlugin = require("./CmsElasticsearchModelFieldPlugin");
|
|
73
|
-
Object.keys(_CmsElasticsearchModelFieldPlugin).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _CmsElasticsearchModelFieldPlugin[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _CmsElasticsearchModelFieldPlugin[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var _CmsEntryElasticsearchValuesModifier = require("./CmsEntryElasticsearchValuesModifier");
|
|
84
|
-
Object.keys(_CmsEntryElasticsearchValuesModifier).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _CmsEntryElasticsearchValuesModifier[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _CmsEntryElasticsearchValuesModifier[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
1
|
+
export * from "./CmsEntryElasticsearchBodyModifierPlugin.js";
|
|
2
|
+
export * from "./CmsEntryElasticsearchIndexPlugin.js";
|
|
3
|
+
export * from "./CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
|
|
4
|
+
export * from "./CmsEntryElasticsearchQueryModifierPlugin.js";
|
|
5
|
+
export * from "./CmsEntryElasticsearchSortModifierPlugin.js";
|
|
6
|
+
export * from "./CmsEntryElasticsearchFullTextSearchPlugin.js";
|
|
7
|
+
export * from "./CmsElasticsearchModelFieldPlugin.js";
|
|
8
|
+
export * from "./CmsEntryElasticsearchValuesModifier.js";
|
|
94
9
|
|
|
95
10
|
//# sourceMappingURL=index.js.map
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryElasticsearchBodyModifierPlugin.js\";\nexport * from \"./CmsEntryElasticsearchIndexPlugin.js\";\nexport * from \"./CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nexport * from \"./CmsEntryElasticsearchQueryModifierPlugin.js\";\nexport * from \"./CmsEntryElasticsearchSortModifierPlugin.js\";\nexport * from \"./CmsEntryElasticsearchFullTextSearchPlugin.js\";\nexport * from \"./CmsElasticsearchModelFieldPlugin.js\";\nexport * from \"./CmsEntryElasticsearchValuesModifier.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CmsContext } from "../types";
|
|
2
|
-
export declare const
|
|
1
|
+
import type { CmsContext } from "../types.js";
|
|
2
|
+
export declare const createCreateIndexTask: (context: CmsContext) => void;
|
|
@@ -1,67 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
locale,
|
|
15
|
-
tenant
|
|
16
|
-
}) => {
|
|
17
|
-
const originalTenant = context.tenancy.getCurrentTenant();
|
|
18
|
-
if (!originalTenant) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
const originalLocale = context.i18n.getCurrentLocale("content");
|
|
22
|
-
if (!originalLocale) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
const selectedTenant = await context.tenancy.getTenantById(tenant);
|
|
26
|
-
if (!selectedTenant) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
const selectedLocale = await context.i18n.getLocale(locale);
|
|
30
|
-
if (!selectedLocale) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
const models = await context.cms.listModels();
|
|
34
|
-
if (models.length === 0) {
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
context.tenancy.setCurrentTenant(selectedTenant);
|
|
38
|
-
context.i18n.setCurrentLocale("content", selectedLocale);
|
|
39
|
-
const indexes = models.map(model => {
|
|
40
|
-
const {
|
|
41
|
-
index
|
|
42
|
-
} = _configurations.configurations.es({
|
|
43
|
-
model: {
|
|
44
|
-
modelId: model.modelId,
|
|
45
|
-
tenant,
|
|
46
|
-
locale
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
index,
|
|
51
|
-
settings: _configurations.configurations.indexSettings({
|
|
52
|
-
context,
|
|
53
|
-
model: {
|
|
54
|
-
locale
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
context.tenancy.setCurrentTenant(originalTenant);
|
|
60
|
-
context.i18n.setCurrentLocale("content", originalLocale);
|
|
61
|
-
return indexes;
|
|
1
|
+
import { OpensearchTenantIndexFactory } from "@webiny/api-elasticsearch-tasks";
|
|
2
|
+
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
3
|
+
import { configurations } from "../configurations.js";
|
|
4
|
+
class CreateElasticsearchIndexTask {
|
|
5
|
+
constructor(context, listModels) {
|
|
6
|
+
this.context = context;
|
|
7
|
+
this.listModels = listModels;
|
|
8
|
+
}
|
|
9
|
+
async getIndexList(tenant) {
|
|
10
|
+
const result = await this.listModels.execute();
|
|
11
|
+
const models = result.value;
|
|
12
|
+
if (models.length === 0) {
|
|
13
|
+
return [];
|
|
62
14
|
}
|
|
15
|
+
const indexes = models.map(model => {
|
|
16
|
+
const {
|
|
17
|
+
index
|
|
18
|
+
} = configurations.es({
|
|
19
|
+
model: {
|
|
20
|
+
modelId: model.modelId,
|
|
21
|
+
tenant: tenant.id
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
index,
|
|
26
|
+
settings: configurations.indexSettings({
|
|
27
|
+
context: this.context
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return indexes;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export const createCreateIndexTask = context => {
|
|
35
|
+
context.container.registerFactory(OpensearchTenantIndexFactory, () => {
|
|
36
|
+
const listModels = context.container.resolve(ListModelsUseCase);
|
|
37
|
+
return new CreateElasticsearchIndexTask(context, listModels);
|
|
63
38
|
});
|
|
64
39
|
};
|
|
65
|
-
exports.createIndexTaskPluginTest = createIndexTaskPluginTest;
|
|
66
40
|
|
|
67
41
|
//# sourceMappingURL=createIndexTaskPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["OpensearchTenantIndexFactory","ListModelsUseCase","configurations","CreateElasticsearchIndexTask","constructor","context","listModels","getIndexList","tenant","result","execute","models","value","length","indexes","map","model","index","es","modelId","id","settings","indexSettings","createCreateIndexTask","container","registerFactory","resolve"],"sources":["createIndexTaskPlugin.ts"],"sourcesContent":["import { OpensearchTenantIndexFactory } from \"@webiny/api-elasticsearch-tasks\";\nimport type { Tenant } from \"@webiny/api-core/types/tenancy.js\";\nimport { ListModelsUseCase } from \"@webiny/api-headless-cms/features/contentModel/ListModels/index.js\";\nimport { configurations } from \"~/configurations.js\";\nimport type { CmsContext } from \"~/types.js\";\n\nclass CreateElasticsearchIndexTask implements OpensearchTenantIndexFactory.Interface {\n constructor(\n private context: CmsContext,\n private listModels: ListModelsUseCase.Interface\n ) {}\n\n async getIndexList(tenant: Tenant): Promise<OpensearchTenantIndexFactory.IndexConfig[]> {\n const result = await this.listModels.execute();\n const models = result.value;\n\n if (models.length === 0) {\n return [];\n }\n\n const indexes = models.map<OpensearchTenantIndexFactory.IndexConfig>(model => {\n const { index } = configurations.es({\n model: {\n modelId: model.modelId,\n tenant: tenant.id\n }\n });\n return {\n index,\n settings: configurations.indexSettings({\n context: this.context\n })\n };\n });\n\n return indexes;\n }\n}\n\nexport const createCreateIndexTask = (context: CmsContext) => {\n context.container.registerFactory(OpensearchTenantIndexFactory, () => {\n const listModels = context.container.resolve(ListModelsUseCase);\n return new CreateElasticsearchIndexTask(context, listModels);\n });\n};\n"],"mappings":"AAAA,SAASA,4BAA4B,QAAQ,iCAAiC;AAE9E,SAASC,iBAAiB,QAAQ,oEAAoE;AACtG,SAASC,cAAc;AAGvB,MAAMC,4BAA4B,CAAmD;EACjFC,WAAWA,CACCC,OAAmB,EACnBC,UAAuC,EACjD;IAAA,KAFUD,OAAmB,GAAnBA,OAAmB;IAAA,KACnBC,UAAuC,GAAvCA,UAAuC;EAChD;EAEH,MAAMC,YAAYA,CAACC,MAAc,EAAuD;IACpF,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,UAAU,CAACI,OAAO,CAAC,CAAC;IAC9C,MAAMC,MAAM,GAAGF,MAAM,CAACG,KAAK;IAE3B,IAAID,MAAM,CAACE,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO,EAAE;IACb;IAEA,MAAMC,OAAO,GAAGH,MAAM,CAACI,GAAG,CAA2CC,KAAK,IAAI;MAC1E,MAAM;QAAEC;MAAM,CAAC,GAAGf,cAAc,CAACgB,EAAE,CAAC;QAChCF,KAAK,EAAE;UACHG,OAAO,EAAEH,KAAK,CAACG,OAAO;UACtBX,MAAM,EAAEA,MAAM,CAACY;QACnB;MACJ,CAAC,CAAC;MACF,OAAO;QACHH,KAAK;QACLI,QAAQ,EAAEnB,cAAc,CAACoB,aAAa,CAAC;UACnCjB,OAAO,EAAE,IAAI,CAACA;QAClB,CAAC;MACL,CAAC;IACL,CAAC,CAAC;IAEF,OAAOS,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMS,qBAAqB,GAAIlB,OAAmB,IAAK;EAC1DA,OAAO,CAACmB,SAAS,CAACC,eAAe,CAACzB,4BAA4B,EAAE,MAAM;IAClE,MAAMM,UAAU,GAAGD,OAAO,CAACmB,SAAS,CAACE,OAAO,CAACzB,iBAAiB,CAAC;IAC/D,OAAO,IAAIE,4BAA4B,CAACE,OAAO,EAAEC,UAAU,CAAC;EAChE,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { Plugin, PluginCollection } from "@webiny/plugins/types";
|
|
2
|
-
import { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import type { Plugin, PluginCollection } from "@webiny/plugins/types.js";
|
|
2
|
+
import type { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsEntryValues, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types/index.js";
|
|
3
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
4
|
+
import type { Client } from "@elastic/elasticsearch";
|
|
5
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
6
|
+
import type { IEntryEntity, IGroupEntity, IModelEntity } from "./definitions/types.js";
|
|
7
|
+
import type { IElasticsearchEntity } from "@webiny/api-elasticsearch";
|
|
8
|
+
import type { ITable } from "@webiny/db-dynamodb";
|
|
9
9
|
/**
|
|
10
10
|
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
11
11
|
*
|
|
12
12
|
* @category Elasticsearch
|
|
13
13
|
* @category CmsEntry
|
|
14
14
|
*/
|
|
15
|
-
export interface CmsIndexEntry extends CmsEntry {
|
|
15
|
+
export interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {
|
|
16
16
|
/**
|
|
17
17
|
* Values that are not going to be indexed.
|
|
18
18
|
*/
|
|
19
|
-
rawValues:
|
|
19
|
+
rawValues: Partial<T>;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* For example, we can search for all the revisions of the given entry.
|
|
23
|
-
*/
|
|
24
|
-
primaryId: string;
|
|
25
|
-
/**
|
|
26
|
-
* Dev can add what ever keys they want and need. Just need to be careful not to break the entry.
|
|
21
|
+
* Dev can add whatever keys they want and need. Just need to be careful not to break the entry.
|
|
27
22
|
*/
|
|
28
23
|
[key: string]: any;
|
|
29
24
|
}
|
|
@@ -129,43 +124,43 @@ export interface CmsModelFieldToElasticsearchPlugin extends Plugin {
|
|
|
129
124
|
*/
|
|
130
125
|
fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;
|
|
131
126
|
}
|
|
132
|
-
export declare type Attributes = Record<string, AttributeDefinition>;
|
|
133
127
|
export declare enum ENTITIES {
|
|
134
|
-
SYSTEM = "CmsSystem",
|
|
135
128
|
GROUPS = "CmsGroups",
|
|
136
129
|
MODELS = "CmsModels",
|
|
137
130
|
ENTRIES = "CmsEntries",
|
|
138
131
|
ENTRIES_ES = "CmsEntriesElasticsearch"
|
|
139
132
|
}
|
|
140
|
-
export interface TableModifier {
|
|
141
|
-
(table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;
|
|
142
|
-
}
|
|
143
133
|
export interface StorageOperationsFactoryParams {
|
|
144
134
|
documentClient: DynamoDBDocument;
|
|
145
135
|
elasticsearch: Client;
|
|
146
|
-
table?:
|
|
147
|
-
esTable?:
|
|
148
|
-
attributes?: Record<ENTITIES, Attributes>;
|
|
136
|
+
table?: string;
|
|
137
|
+
esTable?: string;
|
|
149
138
|
plugins?: PluginCollection;
|
|
150
139
|
}
|
|
140
|
+
export interface CmsContext extends BaseCmsContext {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
}
|
|
143
|
+
export interface IGetEntitiesResponse {
|
|
144
|
+
groups: IGroupEntity;
|
|
145
|
+
models: IModelEntity;
|
|
146
|
+
entries: IEntryEntity;
|
|
147
|
+
entriesEs: IElasticsearchEntity;
|
|
148
|
+
}
|
|
151
149
|
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {
|
|
152
|
-
getTable: () =>
|
|
153
|
-
getEsTable: () =>
|
|
154
|
-
getEntities: () =>
|
|
150
|
+
getTable: () => ITable;
|
|
151
|
+
getEsTable: () => ITable;
|
|
152
|
+
getEntities: () => IGetEntitiesResponse;
|
|
155
153
|
}
|
|
156
154
|
export interface StorageOperationsFactory {
|
|
157
155
|
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
158
156
|
}
|
|
159
|
-
export interface CmsContext extends BaseCmsContext {
|
|
160
|
-
[key: string]: any;
|
|
161
|
-
}
|
|
162
157
|
export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
|
|
163
|
-
dataLoaders:
|
|
158
|
+
dataLoaders: IDataLoadersHandler;
|
|
164
159
|
}
|
|
165
160
|
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
166
|
-
model: Pick<CmsModel, "tenant"
|
|
161
|
+
model: Pick<CmsModel, "tenant">;
|
|
167
162
|
}
|
|
168
|
-
export interface
|
|
163
|
+
export interface IDataLoadersHandler {
|
|
169
164
|
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
170
165
|
}
|
|
171
166
|
export {};
|
package/types.js
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ENTITIES = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
9
3
|
*
|
|
10
4
|
* @category Elasticsearch
|
|
11
5
|
* @category CmsEntry
|
|
12
6
|
*/
|
|
7
|
+
|
|
13
8
|
/**
|
|
14
9
|
* Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
|
|
15
10
|
*
|
|
16
11
|
* @category Elasticsearch
|
|
17
12
|
* @category CmsEntry
|
|
18
13
|
*/
|
|
14
|
+
|
|
19
15
|
/**
|
|
20
16
|
* Arguments for the method that is transforming content entry from Elasticsearch into the original one.
|
|
21
17
|
*
|
|
22
18
|
* @category Elasticsearch
|
|
23
19
|
* @category CmsEntry
|
|
24
20
|
*/
|
|
21
|
+
|
|
25
22
|
/**
|
|
26
23
|
* A plugin defining transformation of entry for Elasticsearch.
|
|
27
24
|
*
|
|
@@ -30,8 +27,8 @@ exports.ENTITIES = void 0;
|
|
|
30
27
|
* @category CmsEntry
|
|
31
28
|
* @category Elasticsearch
|
|
32
29
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
|
|
31
|
+
export let ENTITIES = /*#__PURE__*/function (ENTITIES) {
|
|
35
32
|
ENTITIES["GROUPS"] = "CmsGroups";
|
|
36
33
|
ENTITIES["MODELS"] = "CmsModels";
|
|
37
34
|
ENTITIES["ENTRIES"] = "CmsEntries";
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ENTITIES"
|
|
1
|
+
{"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import type { Plugin, PluginCollection } from \"@webiny/plugins/types.js\";\nimport type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsEntryValues,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n CmsModelFieldType,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { IElasticsearchEntity } from \"@webiny/api-elasticsearch\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Partial<T>;\n /**\n * Dev can add whatever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: CmsModelFieldType;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: string;\n esTable?: string;\n plugins?: PluginCollection;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n\nexport interface IGetEntitiesResponse {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n entriesEs: IElasticsearchEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => ITable;\n getEsTable: () => ITable;\n getEntities: () => IGetEntitiesResponse;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":"AAmBA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkDA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NoValueContainer","constructor","create","is","value"],"sources":["NoValueContainer.ts"],"sourcesContent":["export class NoValueContainer {\n private constructor() {\n //\n }\n\n public static create(): NoValueContainer {\n return new NoValueContainer();\n }\n\n public static is(value: unknown): boolean {\n return value instanceof NoValueContainer;\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,CAAC;EAClBC,WAAWA,CAAA,EAAG;IAClB;EAAA;EAGJ,OAAcC,MAAMA,CAAA,EAAqB;IACrC,OAAO,IAAIF,gBAAgB,CAAC,CAAC;EACjC;EAEA,OAAcG,EAAEA,CAACC,KAAc,EAAW;IACtC,OAAOA,KAAK,YAAYJ,gBAAgB;EAC5C;AACJ","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Attributes } from "../types";
|
|
3
|
-
export interface CreateEntryElasticsearchEntityParams {
|
|
4
|
-
table: Table<string, string, string>;
|
|
5
|
-
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
|
-
}
|
|
8
|
-
export declare const createEntryElasticsearchEntity: (params: CreateEntryElasticsearchEntityParams) => Entity<any>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createEntryElasticsearchEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createEntryElasticsearchEntity = params => {
|
|
9
|
-
const {
|
|
10
|
-
table,
|
|
11
|
-
entityName,
|
|
12
|
-
attributes
|
|
13
|
-
} = params;
|
|
14
|
-
return new _toolbox.Entity({
|
|
15
|
-
name: entityName,
|
|
16
|
-
table,
|
|
17
|
-
attributes: {
|
|
18
|
-
PK: {
|
|
19
|
-
type: "string",
|
|
20
|
-
partitionKey: true
|
|
21
|
-
},
|
|
22
|
-
SK: {
|
|
23
|
-
type: "string",
|
|
24
|
-
sortKey: true
|
|
25
|
-
},
|
|
26
|
-
index: {
|
|
27
|
-
type: "string"
|
|
28
|
-
},
|
|
29
|
-
data: {
|
|
30
|
-
type: "map"
|
|
31
|
-
},
|
|
32
|
-
...(attributes || {})
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=entryElasticsearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","ignoreList":[]}
|
package/definitions/system.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Attributes } from "../types";
|
|
3
|
-
export interface CreateSystemEntityParams {
|
|
4
|
-
table: Table<string, string, string>;
|
|
5
|
-
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
|
-
}
|
|
8
|
-
export declare const createSystemEntity: (params: CreateSystemEntityParams) => Entity<any>;
|
package/definitions/system.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createSystemEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createSystemEntity = params => {
|
|
9
|
-
const {
|
|
10
|
-
entityName,
|
|
11
|
-
attributes,
|
|
12
|
-
table
|
|
13
|
-
} = params;
|
|
14
|
-
return new _toolbox.Entity({
|
|
15
|
-
name: entityName,
|
|
16
|
-
table,
|
|
17
|
-
attributes: {
|
|
18
|
-
PK: {
|
|
19
|
-
partitionKey: true
|
|
20
|
-
},
|
|
21
|
-
SK: {
|
|
22
|
-
sortKey: true
|
|
23
|
-
},
|
|
24
|
-
version: {
|
|
25
|
-
type: "string"
|
|
26
|
-
},
|
|
27
|
-
locale: {
|
|
28
|
-
type: "string"
|
|
29
|
-
},
|
|
30
|
-
tenant: {
|
|
31
|
-
type: "string"
|
|
32
|
-
},
|
|
33
|
-
readAPIKey: {
|
|
34
|
-
type: "string"
|
|
35
|
-
},
|
|
36
|
-
...(attributes || {})
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
exports.createSystemEntity = createSystemEntity;
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=system.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","ignoreList":[]}
|
package/definitions/table.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TableModifier } from "../types";
|
|
2
|
-
import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
4
|
-
export interface CreateTableParams {
|
|
5
|
-
table?: TableModifier;
|
|
6
|
-
documentClient: DynamoDBDocument;
|
|
7
|
-
}
|
|
8
|
-
export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table<string, string, string>;
|
package/definitions/table.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTable = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createTable = ({
|
|
9
|
-
table,
|
|
10
|
-
documentClient
|
|
11
|
-
}) => {
|
|
12
|
-
const tableConfig = {
|
|
13
|
-
name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
|
|
14
|
-
partitionKey: "PK",
|
|
15
|
-
sortKey: "SK",
|
|
16
|
-
DocumentClient: documentClient,
|
|
17
|
-
autoExecute: true,
|
|
18
|
-
autoParse: true
|
|
19
|
-
};
|
|
20
|
-
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
|
|
21
|
-
return new _toolbox.Table(config);
|
|
22
|
-
};
|
|
23
|
-
exports.createTable = createTable;
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=table.js.map
|
package/definitions/table.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table, TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\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","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TableModifier } from "../types";
|
|
2
|
-
import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
3
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
4
|
-
export interface CreateElasticsearchTableParams {
|
|
5
|
-
table?: TableModifier;
|
|
6
|
-
documentClient: DynamoDBDocument;
|
|
7
|
-
}
|
|
8
|
-
export declare const createElasticsearchTable: ({ table, documentClient }: CreateElasticsearchTableParams) => Table<string, string, string>;
|