@webiny/api-headless-cms-ddb-es 6.0.0-alpha.5 → 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 -6
- package/definitions/entry.js +5 -174
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -7
- package/definitions/group.js +5 -58
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -7
- 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 -13
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/longText.js +10 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +10 -18
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +1 -1
- package/elasticsearch/createElasticsearchIndex.js +7 -15
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
- 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 -11
- 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 +1 -1
- package/elasticsearch/search/searchableJson.js +9 -16
- package/elasticsearch/search/searchableJson.js.map +1 -1
- 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 +9 -9
- 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 +98 -133
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +0 -2
- 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 +3 -3
- 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 +2 -2
- package/operations/entry/elasticsearch/body.js +21 -28
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.d.ts +2 -2
- 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 +9 -17
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -5
- 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 +1 -1
- package/operations/entry/elasticsearch/filtering/path.js +5 -15
- 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 +7 -15
- 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 +2 -2
- 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 -27
- 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 +2 -2
- 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 +1 -2
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +1 -8
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
- package/operations/entry/elasticsearch/sort.d.ts +3 -3
- package/operations/entry/elasticsearch/sort.js +51 -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 +2 -2
- package/operations/entry/elasticsearch/types.js +1 -5
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +5 -4
- package/operations/entry/index.js +333 -515
- 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 +16 -16
- 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 +6 -6
- package/operations/entry/transformations/transformEntryToIndex.js +3 -10
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +5 -4
- package/operations/group/index.js +39 -73
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +3 -3
- package/operations/model/index.js +38 -57
- package/operations/model/index.js.map +1 -1
- package/package.json +27 -32
- 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 +1 -1
- 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 +2 -2
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -1
- 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 +23 -26
- package/types.js +5 -8
- package/types.js.map +1 -1
- package/values/NoValueContainer.js +1 -8
- package/values/NoValueContainer.js.map +1 -1
- package/definitions/entryElasticsearch.d.ts +0 -9
- package/definitions/entryElasticsearch.js +0 -41
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/system.d.ts +0 -9
- 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/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -14
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.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.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 type { 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,27 +1,24 @@
|
|
|
1
|
-
import type { Plugin, PluginCollection } from "@webiny/plugins/types";
|
|
2
|
-
import type { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import type {
|
|
4
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
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";
|
|
5
4
|
import type { Client } from "@elastic/elasticsearch";
|
|
6
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";
|
|
7
9
|
/**
|
|
8
10
|
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
9
11
|
*
|
|
10
12
|
* @category Elasticsearch
|
|
11
13
|
* @category CmsEntry
|
|
12
14
|
*/
|
|
13
|
-
export interface CmsIndexEntry extends CmsEntry {
|
|
15
|
+
export interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {
|
|
14
16
|
/**
|
|
15
17
|
* Values that are not going to be indexed.
|
|
16
18
|
*/
|
|
17
|
-
rawValues:
|
|
19
|
+
rawValues: Partial<T>;
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
20
|
-
* For example, we can search for all the revisions of the given entry.
|
|
21
|
-
*/
|
|
22
|
-
primaryId: string;
|
|
23
|
-
/**
|
|
24
|
-
* 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.
|
|
25
22
|
*/
|
|
26
23
|
[key: string]: any;
|
|
27
24
|
}
|
|
@@ -127,43 +124,43 @@ export interface CmsModelFieldToElasticsearchPlugin extends Plugin {
|
|
|
127
124
|
*/
|
|
128
125
|
fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;
|
|
129
126
|
}
|
|
130
|
-
export type Attributes = Record<string, AttributeDefinition>;
|
|
131
127
|
export declare enum ENTITIES {
|
|
132
|
-
SYSTEM = "CmsSystem",
|
|
133
128
|
GROUPS = "CmsGroups",
|
|
134
129
|
MODELS = "CmsModels",
|
|
135
130
|
ENTRIES = "CmsEntries",
|
|
136
131
|
ENTRIES_ES = "CmsEntriesElasticsearch"
|
|
137
132
|
}
|
|
138
|
-
export interface TableModifier {
|
|
139
|
-
(table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;
|
|
140
|
-
}
|
|
141
133
|
export interface StorageOperationsFactoryParams {
|
|
142
134
|
documentClient: DynamoDBDocument;
|
|
143
135
|
elasticsearch: Client;
|
|
144
|
-
table?:
|
|
145
|
-
esTable?:
|
|
146
|
-
attributes?: Record<ENTITIES, Attributes>;
|
|
136
|
+
table?: string;
|
|
137
|
+
esTable?: string;
|
|
147
138
|
plugins?: PluginCollection;
|
|
148
139
|
}
|
|
149
140
|
export interface CmsContext extends BaseCmsContext {
|
|
150
141
|
[key: string]: any;
|
|
151
142
|
}
|
|
143
|
+
export interface IGetEntitiesResponse {
|
|
144
|
+
groups: IGroupEntity;
|
|
145
|
+
models: IModelEntity;
|
|
146
|
+
entries: IEntryEntity;
|
|
147
|
+
entriesEs: IElasticsearchEntity;
|
|
148
|
+
}
|
|
152
149
|
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {
|
|
153
|
-
getTable: () =>
|
|
154
|
-
getEsTable: () =>
|
|
155
|
-
getEntities: () =>
|
|
150
|
+
getTable: () => ITable;
|
|
151
|
+
getEsTable: () => ITable;
|
|
152
|
+
getEntities: () => IGetEntitiesResponse;
|
|
156
153
|
}
|
|
157
154
|
export interface StorageOperationsFactory {
|
|
158
155
|
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
159
156
|
}
|
|
160
157
|
export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
|
|
161
|
-
dataLoaders:
|
|
158
|
+
dataLoaders: IDataLoadersHandler;
|
|
162
159
|
}
|
|
163
160
|
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
164
|
-
model: Pick<CmsModel, "tenant"
|
|
161
|
+
model: Pick<CmsModel, "tenant">;
|
|
165
162
|
}
|
|
166
|
-
export interface
|
|
163
|
+
export interface IDataLoadersHandler {
|
|
167
164
|
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
168
165
|
}
|
|
169
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":[]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NoValueContainer = void 0;
|
|
7
|
-
class NoValueContainer {
|
|
1
|
+
export class NoValueContainer {
|
|
8
2
|
constructor() {
|
|
9
3
|
//
|
|
10
4
|
}
|
|
@@ -15,6 +9,5 @@ class NoValueContainer {
|
|
|
15
9
|
return value instanceof NoValueContainer;
|
|
16
10
|
}
|
|
17
11
|
}
|
|
18
|
-
exports.NoValueContainer = NoValueContainer;
|
|
19
12
|
|
|
20
13
|
//# sourceMappingURL=NoValueContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NoValueContainer","constructor","create","is","value"
|
|
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,9 +0,0 @@
|
|
|
1
|
-
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
-
import type { Attributes } from "../types";
|
|
4
|
-
export interface CreateEntryElasticsearchEntityParams {
|
|
5
|
-
table: Table<string, string, string>;
|
|
6
|
-
entityName: string;
|
|
7
|
-
attributes: Attributes;
|
|
8
|
-
}
|
|
9
|
-
export declare const createEntryElasticsearchEntity: (params: CreateEntryElasticsearchEntityParams) => Entity<any>;
|
|
@@ -1,41 +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
|
-
TYPE: {
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
...(attributes || {})
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
|
|
40
|
-
|
|
41
|
-
//# 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","TYPE","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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 TYPE: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,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;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
package/definitions/system.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
-
import type { Attributes } from "../types";
|
|
4
|
-
export interface CreateSystemEntityParams {
|
|
5
|
-
table: Table<string, string, string>;
|
|
6
|
-
entityName: string;
|
|
7
|
-
attributes: Attributes;
|
|
8
|
-
}
|
|
9
|
-
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 type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { 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":";;;;;;AACA,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 type { TableModifier } from "../types";
|
|
2
|
-
import type { 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 type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport { Table } 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":";;;;;;AAGA,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 type { TableModifier } from "../types";
|
|
2
|
-
import type { 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>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createElasticsearchTable = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createElasticsearchTable = ({
|
|
9
|
-
table,
|
|
10
|
-
documentClient
|
|
11
|
-
}) => {
|
|
12
|
-
const tableConfig = {
|
|
13
|
-
name: process.env.DB_TABLE_ELASTICSEARCH,
|
|
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.createElasticsearchTable = createElasticsearchTable;
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=tableElasticsearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\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","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.japanese = void 0;
|
|
7
|
-
var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
|
|
8
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
9
|
-
const japanese = exports.japanese = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
|
|
10
|
-
body: (0, _apiElasticsearch.getJapaneseConfiguration)(),
|
|
11
|
-
locales: ["ja", "ja-jp"]
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=japanese.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_CmsEntryElasticsearchIndexPlugin","require","_apiElasticsearch","japanese","exports","CmsEntryElasticsearchIndexPlugin","body","getJapaneseConfiguration","locales"],"sources":["japanese.ts"],"sourcesContent":["import { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\nimport { getJapaneseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const japanese = new CmsEntryElasticsearchIndexPlugin({\n body: getJapaneseConfiguration(),\n locales: [\"ja\", \"ja-jp\"]\n});\n"],"mappings":";;;;;;AAAA,IAAAA,iCAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,MAAME,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAIE,kEAAgC,CAAC;EACzDC,IAAI,EAAE,IAAAC,0CAAwB,EAAC,CAAC;EAChCC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO;AAC3B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type WebinyError from "@webiny/error";
|
|
2
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
interface LogIgnoredElasticsearchExceptionParams {
|
|
4
|
-
error: WebinyError;
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
indexName: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const logIgnoredEsResponseError: (params: LogIgnoredElasticsearchExceptionParams) => void;
|
|
9
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.logIgnoredEsResponseError = void 0;
|
|
7
|
-
const logIgnoredEsResponseError = params => {
|
|
8
|
-
const {
|
|
9
|
-
error,
|
|
10
|
-
indexName,
|
|
11
|
-
model
|
|
12
|
-
} = params;
|
|
13
|
-
console.log(`Ignoring Elasticsearch response error: ${error.message}`, {
|
|
14
|
-
modelId: model.modelId,
|
|
15
|
-
usedIndexName: indexName,
|
|
16
|
-
error: {
|
|
17
|
-
message: error.message,
|
|
18
|
-
code: error.code,
|
|
19
|
-
data: error.data,
|
|
20
|
-
stack: error.stack
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
exports.logIgnoredEsResponseError = logIgnoredEsResponseError;
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=logIgnoredEsResponseError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["logIgnoredEsResponseError","params","error","indexName","model","console","log","message","modelId","usedIndexName","code","data","stack","exports"],"sources":["logIgnoredEsResponseError.ts"],"sourcesContent":["import type WebinyError from \"@webiny/error\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface LogIgnoredElasticsearchExceptionParams {\n error: WebinyError;\n model: CmsModel;\n indexName: string;\n}\n\nexport const logIgnoredEsResponseError = (params: LogIgnoredElasticsearchExceptionParams) => {\n const { error, indexName, model } = params;\n\n console.log(`Ignoring Elasticsearch response error: ${error.message}`, {\n modelId: model.modelId,\n usedIndexName: indexName,\n error: {\n message: error.message,\n code: error.code,\n data: error.data,\n stack: error.stack\n }\n });\n};\n"],"mappings":";;;;;;AASO,MAAMA,yBAAyB,GAAIC,MAA8C,IAAK;EACzF,MAAM;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAE1CI,OAAO,CAACC,GAAG,CAAC,0CAA0CJ,KAAK,CAACK,OAAO,EAAE,EAAE;IACnEC,OAAO,EAAEJ,KAAK,CAACI,OAAO;IACtBC,aAAa,EAAEN,SAAS;IACxBD,KAAK,EAAE;MACHK,OAAO,EAAEL,KAAK,CAACK,OAAO;MACtBG,IAAI,EAAER,KAAK,CAACQ,IAAI;MAChBC,IAAI,EAAET,KAAK,CAACS,IAAI;MAChBC,KAAK,EAAEV,KAAK,CAACU;IACjB;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAb,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|