@webiny/api-headless-cms-ddb-es 0.0.0-mt-2 → 0.0.0-unstable.0156a4c312
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/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
- package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsModelEntity.js +5 -0
- package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
- package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsOsTable.js +5 -0
- package/abstractions/CmsDdbEsOsTable.js.map +1 -0
- package/abstractions/CmsDdbEsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsTable.js +5 -0
- package/abstractions/CmsDdbEsTable.js.map +1 -0
- package/debuggerNamespaces.d.ts +12 -0
- package/debuggerNamespaces.js +0 -0
- package/definitions/entry.d.ts +5 -6
- package/definitions/entry.js +9 -89
- package/definitions/entry.js.map +1 -0
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +9 -72
- package/definitions/group.js.map +1 -0
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +9 -94
- package/definitions/model.js.map +1 -0
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/feature.d.ts +10 -0
- package/feature.js +69 -0
- package/feature.js.map +1 -0
- package/index.d.ts +1 -2
- package/index.js +1 -171
- package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntry.js +134 -0
- package/operations/entry/DdbEsCreateEntry.js.map +1 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
- package/operations/entry/DdbEsDeleteEntry.js +79 -0
- package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetEntry.d.ts +14 -0
- package/operations/entry/DdbEsGetEntry.js +27 -0
- package/operations/entry/DdbEsGetEntry.js.map +1 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
- package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisionById.js +34 -0
- package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
- package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisions.js +33 -0
- package/operations/entry/DdbEsGetRevisions.js.map +1 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js +77 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +28 -0
- package/operations/entry/DdbEsListEntries.js +110 -0
- package/operations/entry/DdbEsListEntries.js.map +1 -0
- package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
- package/operations/entry/DdbEsMoveEntry.js +113 -0
- package/operations/entry/DdbEsMoveEntry.js.map +1 -0
- package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
- package/operations/entry/DdbEsMoveToBin.js +137 -0
- package/operations/entry/DdbEsMoveToBin.js.map +1 -0
- package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsPublishEntry.js +231 -0
- package/operations/entry/DdbEsPublishEntry.js.map +1 -0
- package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
- package/operations/entry/DdbEsRestoreFromBin.js +137 -0
- package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsUnpublishEntry.js +127 -0
- package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
- package/operations/entry/DdbEsUpdateEntry.js +175 -0
- package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +5 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +34 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +40 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +18 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +0 -0
- package/operations/entry/dataLoaders.d.ts +22 -39
- package/operations/entry/dataLoaders.js +90 -339
- package/operations/entry/dataLoaders.js.map +1 -0
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +45 -35
- package/operations/entry/keys.js.map +1 -0
- package/operations/entry/recordType.d.ts +3 -0
- package/operations/entry/recordType.js +6 -0
- package/operations/entry/recordType.js.map +1 -0
- package/operations/entry/storageEntryUtils.d.ts +7 -0
- package/operations/entry/storageEntryUtils.js +14 -0
- package/operations/entry/storageEntryUtils.js.map +1 -0
- package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
- package/operations/entry/transformations/convertEntryKeys.js +25 -0
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +32 -0
- package/operations/entry/transformations/index.js +91 -0
- package/operations/entry/transformations/index.js.map +1 -0
- package/operations/entry/transformations/modifyEntryValues.d.ts +53 -0
- package/operations/entry/transformations/modifyEntryValues.js +16 -0
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
- package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
- package/operations/entry/transformations/transformEntryKeys.js +17 -0
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
- package/operations/group/DdbEsCreateGroup.d.ts +12 -0
- package/operations/group/DdbEsCreateGroup.js +35 -0
- package/operations/group/DdbEsCreateGroup.js.map +1 -0
- package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
- package/operations/group/DdbEsDeleteGroup.js +31 -0
- package/operations/group/DdbEsDeleteGroup.js.map +1 -0
- package/operations/group/DdbEsGetGroup.d.ts +12 -0
- package/operations/group/DdbEsGetGroup.js +31 -0
- package/operations/group/DdbEsGetGroup.js.map +1 -0
- package/operations/group/DdbEsListGroups.d.ts +14 -0
- package/operations/group/DdbEsListGroups.js +52 -0
- package/operations/group/DdbEsListGroups.js.map +1 -0
- package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
- package/operations/group/DdbEsUpdateGroup.js +35 -0
- package/operations/group/DdbEsUpdateGroup.js.map +1 -0
- package/operations/group/feature.d.ts +4 -0
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbEsCreateModel.d.ts +16 -0
- package/operations/model/DdbEsCreateModel.js +56 -0
- package/operations/model/DdbEsCreateModel.js.map +1 -0
- package/operations/model/DdbEsDeleteModel.d.ts +12 -0
- package/operations/model/DdbEsDeleteModel.js +31 -0
- package/operations/model/DdbEsDeleteModel.js.map +1 -0
- package/operations/model/DdbEsGetModel.d.ts +12 -0
- package/operations/model/DdbEsGetModel.js +30 -0
- package/operations/model/DdbEsGetModel.js.map +1 -0
- package/operations/model/DdbEsListModels.d.ts +12 -0
- package/operations/model/DdbEsListModels.js +36 -0
- package/operations/model/DdbEsListModels.js.map +1 -0
- package/operations/model/DdbEsUpdateModel.d.ts +12 -0
- package/operations/model/DdbEsUpdateModel.js +36 -0
- package/operations/model/DdbEsUpdateModel.js.map +1 -0
- package/operations/model/feature.d.ts +4 -0
- package/operations/model/feature.js +19 -0
- package/operations/model/feature.js.map +1 -0
- package/operations/model/keys.d.ts +15 -0
- package/operations/model/keys.js +17 -0
- package/operations/model/keys.js.map +1 -0
- package/package.json +49 -46
- package/registry/CmsEntitiesDbRegistryDecorator.d.ts +27 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js +46 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js.map +1 -0
- package/tasks/CreateElasticsearchIndexTask.d.ts +15 -0
- package/tasks/CreateElasticsearchIndexTask.js +49 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +13 -182
- package/types.js +10 -60
- package/types.js.map +1 -0
- package/configurations.d.ts +0 -12
- package/configurations.js +0 -32
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -46
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -62
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -50
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -24
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -24
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -18
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -65
- package/dynamoDb/storage/longText.d.ts +0 -7
- package/dynamoDb/storage/longText.js +0 -83
- package/dynamoDb/storage/richText.d.ts +0 -8
- package/dynamoDb/storage/richText.js +0 -110
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -16
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -89
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -24
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/longTextIndexing.js +0 -36
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -48
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -3
- package/elasticsearch/indexing/objectIndexing.js +0 -200
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -34
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -16
- package/elasticsearch/search/refSearch.d.ts +0 -3
- package/elasticsearch/search/refSearch.js +0 -24
- package/elasticsearch/search/timeSearch.d.ts +0 -3
- package/elasticsearch/search/timeSearch.js +0 -25
- package/helpers/createElasticsearchQueryBody.d.ts +0 -11
- package/helpers/createElasticsearchQueryBody.js +0 -375
- package/helpers/entryIndexHelpers.d.ts +0 -18
- package/helpers/entryIndexHelpers.js +0 -189
- package/helpers/fields.d.ts +0 -77
- package/helpers/fields.js +0 -174
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -31
- package/helpers/operatorPluginsList.d.ts +0 -7
- package/helpers/operatorPluginsList.js +0 -30
- package/helpers/searchPluginsList.d.ts +0 -6
- package/helpers/searchPluginsList.js +0 -26
- package/helpers/transformValueForSearch.d.ts +0 -9
- package/helpers/transformValueForSearch.js +0 -26
- package/operations/entry/elasticsearchFields.d.ts +0 -2
- package/operations/entry/elasticsearchFields.js +0 -32
- package/operations/entry/fields.d.ts +0 -3
- package/operations/entry/fields.js +0 -60
- package/operations/entry/index.d.ts +0 -13
- package/operations/entry/index.js +0 -1152
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -202
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -205
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -141
- package/operations/system/createElasticsearchTemplate.d.ts +0 -5
- package/operations/system/createElasticsearchTemplate.js +0 -62
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -105
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -24
- package/upgrades/index.d.ts +0 -2
- package/upgrades/index.js +0 -16
- package/upgrades/utils.d.ts +0 -1
- package/upgrades/utils.js +0 -16
- package/upgrades/v5.0.0/cleanDatabaseRecord.d.ts +0 -6
- package/upgrades/v5.0.0/cleanDatabaseRecord.js +0 -16
- package/upgrades/v5.0.0/createOldVersionIndiceName.d.ts +0 -2
- package/upgrades/v5.0.0/createOldVersionIndiceName.js +0 -12
- package/upgrades/v5.0.0/entryValueFixer.d.ts +0 -4
- package/upgrades/v5.0.0/entryValueFixer.js +0 -124
- package/upgrades/v5.0.0/fieldFinder.d.ts +0 -6
- package/upgrades/v5.0.0/fieldFinder.js +0 -42
- package/upgrades/v5.0.0/helpers.d.ts +0 -4
- package/upgrades/v5.0.0/helpers.js +0 -57
- package/upgrades/v5.0.0/index.d.ts +0 -4
- package/upgrades/v5.0.0/index.js +0 -232
- package/upgrades/v5.8.0/index.d.ts +0 -4
- package/upgrades/v5.8.0/index.js +0 -426
package/helpers/fields.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.systemFields = exports.createModelFields = void 0;
|
|
9
|
-
|
|
10
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
const createSystemField = field => {
|
|
13
|
-
if (!field.fieldId) {
|
|
14
|
-
throw new _error.default(`When creating system field it must have a "entryId".`, "SYSTEM_FIELD_ERROR", {
|
|
15
|
-
field
|
|
16
|
-
});
|
|
17
|
-
} else if (!field.type) {
|
|
18
|
-
throw new _error.default(`When creating system field it must have a "type".`, "SYSTEM_FIELD_ERROR", {
|
|
19
|
-
field
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return field;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const systemFields = {
|
|
27
|
-
id: {
|
|
28
|
-
type: "text",
|
|
29
|
-
isSystemField: true,
|
|
30
|
-
isSearchable: true,
|
|
31
|
-
isSortable: true,
|
|
32
|
-
field: createSystemField({
|
|
33
|
-
fieldId: "id",
|
|
34
|
-
type: "text"
|
|
35
|
-
})
|
|
36
|
-
},
|
|
37
|
-
entryId: {
|
|
38
|
-
type: "text",
|
|
39
|
-
isSystemField: true,
|
|
40
|
-
isSearchable: true,
|
|
41
|
-
isSortable: true,
|
|
42
|
-
field: createSystemField({
|
|
43
|
-
fieldId: "entryId",
|
|
44
|
-
type: "text"
|
|
45
|
-
})
|
|
46
|
-
},
|
|
47
|
-
savedOn: {
|
|
48
|
-
type: "date",
|
|
49
|
-
unmappedType: "date",
|
|
50
|
-
keyword: false,
|
|
51
|
-
isSystemField: true,
|
|
52
|
-
isSearchable: true,
|
|
53
|
-
isSortable: true,
|
|
54
|
-
field: createSystemField({
|
|
55
|
-
fieldId: "savedOn",
|
|
56
|
-
type: "date",
|
|
57
|
-
settings: {
|
|
58
|
-
type: "dateTimeWithoutTimezone"
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
},
|
|
62
|
-
createdOn: {
|
|
63
|
-
type: "date",
|
|
64
|
-
unmappedType: "date",
|
|
65
|
-
keyword: false,
|
|
66
|
-
isSystemField: true,
|
|
67
|
-
isSearchable: true,
|
|
68
|
-
isSortable: true,
|
|
69
|
-
field: createSystemField({
|
|
70
|
-
fieldId: "createdOn",
|
|
71
|
-
type: "text",
|
|
72
|
-
settings: {
|
|
73
|
-
type: "dateTimeWithoutTimezone"
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
},
|
|
77
|
-
createdBy: {
|
|
78
|
-
type: "text",
|
|
79
|
-
unmappedType: undefined,
|
|
80
|
-
isSystemField: true,
|
|
81
|
-
isSearchable: true,
|
|
82
|
-
isSortable: false,
|
|
83
|
-
path: "createdBy.id",
|
|
84
|
-
field: createSystemField({
|
|
85
|
-
fieldId: "createdBy",
|
|
86
|
-
type: "text"
|
|
87
|
-
})
|
|
88
|
-
},
|
|
89
|
-
ownedBy: {
|
|
90
|
-
type: "text",
|
|
91
|
-
unmappedType: undefined,
|
|
92
|
-
isSystemField: true,
|
|
93
|
-
isSearchable: true,
|
|
94
|
-
isSortable: false,
|
|
95
|
-
path: "ownedBy.id",
|
|
96
|
-
field: createSystemField({
|
|
97
|
-
fieldId: "ownedBy",
|
|
98
|
-
type: "text"
|
|
99
|
-
})
|
|
100
|
-
},
|
|
101
|
-
version: {
|
|
102
|
-
type: "number",
|
|
103
|
-
unmappedType: undefined,
|
|
104
|
-
keyword: false,
|
|
105
|
-
isSystemField: true,
|
|
106
|
-
isSearchable: true,
|
|
107
|
-
isSortable: true,
|
|
108
|
-
field: createSystemField({
|
|
109
|
-
fieldId: "version",
|
|
110
|
-
type: "number"
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
/*
|
|
115
|
-
* Create an object with key fieldType and options for that field
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
exports.systemFields = systemFields;
|
|
119
|
-
|
|
120
|
-
const createModelFields = (plugins, model) => {
|
|
121
|
-
// collect all unmappedType from elastic plugins
|
|
122
|
-
const unmappedTypes = plugins.byType("cms-model-field-to-elastic-search").reduce((acc, plugin) => {
|
|
123
|
-
if (!plugin.unmappedType) {
|
|
124
|
-
return acc;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
acc[plugin.fieldType] = plugin.unmappedType;
|
|
128
|
-
return acc;
|
|
129
|
-
}, {});
|
|
130
|
-
/**
|
|
131
|
-
* collect all field types from the plugins
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
const fieldTypePlugins = plugins.byType("cms-model-field-to-graphql").reduce((types, plugin) => {
|
|
135
|
-
const {
|
|
136
|
-
fieldType,
|
|
137
|
-
isSearchable,
|
|
138
|
-
isSortable
|
|
139
|
-
} = plugin;
|
|
140
|
-
types[fieldType] = {
|
|
141
|
-
unmappedType: unmappedTypes[fieldType],
|
|
142
|
-
isSearchable: isSearchable === true,
|
|
143
|
-
isSortable: isSortable === true
|
|
144
|
-
};
|
|
145
|
-
return types;
|
|
146
|
-
}, {});
|
|
147
|
-
return model.fields.reduce((fields, field) => {
|
|
148
|
-
const {
|
|
149
|
-
fieldId,
|
|
150
|
-
type
|
|
151
|
-
} = field;
|
|
152
|
-
|
|
153
|
-
if (!fieldTypePlugins[type]) {
|
|
154
|
-
throw new _error.default(`There is no plugin for field type "${type}".`);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const {
|
|
158
|
-
isSearchable,
|
|
159
|
-
isSortable,
|
|
160
|
-
unmappedType
|
|
161
|
-
} = fieldTypePlugins[type];
|
|
162
|
-
fields[fieldId] = {
|
|
163
|
-
type,
|
|
164
|
-
isSearchable,
|
|
165
|
-
isSortable,
|
|
166
|
-
unmappedType: typeof unmappedType === "function" ? unmappedType(field) : undefined,
|
|
167
|
-
isSystemField: false,
|
|
168
|
-
field
|
|
169
|
-
};
|
|
170
|
-
return fields;
|
|
171
|
-
}, systemFields);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
exports.createModelFields = createModelFields;
|
package/helpers/index.d.ts
DELETED
package/helpers/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _createElasticsearchQueryBody = require("./createElasticsearchQueryBody");
|
|
8
|
-
|
|
9
|
-
Object.keys(_createElasticsearchQueryBody).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _createElasticsearchQueryBody[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _createElasticsearchQueryBody[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _entryIndexHelpers = require("./entryIndexHelpers");
|
|
21
|
-
|
|
22
|
-
Object.keys(_entryIndexHelpers).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _entryIndexHelpers[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _entryIndexHelpers[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchQueryBuilderOperatorPlugin } from "@webiny/api-elasticsearch/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin";
|
|
2
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
interface OperatorPlugins {
|
|
4
|
-
[operator: string]: ElasticsearchQueryBuilderOperatorPlugin;
|
|
5
|
-
}
|
|
6
|
-
export declare const operatorPluginsList: (plugins: PluginsContainer) => OperatorPlugins;
|
|
7
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.operatorPluginsList = void 0;
|
|
9
|
-
|
|
10
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
var _ElasticsearchQueryBuilderOperatorPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin");
|
|
13
|
-
|
|
14
|
-
const operatorPluginsList = plugins => {
|
|
15
|
-
return plugins.byType(_ElasticsearchQueryBuilderOperatorPlugin.ElasticsearchQueryBuilderOperatorPlugin.type).reduce((plugins, plugin) => {
|
|
16
|
-
const operator = plugin.getOperator();
|
|
17
|
-
|
|
18
|
-
if (plugins[operator]) {
|
|
19
|
-
throw new _error.default("There is a ElasticsearchQueryBuilderOperatorPlugin defined for the operator.", "PLUGIN_ALREADY_EXISTS", {
|
|
20
|
-
operator: operator,
|
|
21
|
-
name: plugin.name || "unknown"
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
plugins[operator] = plugin;
|
|
26
|
-
return plugins;
|
|
27
|
-
}, {});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.operatorPluginsList = operatorPluginsList;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchQueryBuilderValueSearchPlugin } from "../types";
|
|
2
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
export interface ElasticsearchQuerySearchValuePlugins {
|
|
4
|
-
[fieldType: string]: ElasticsearchQueryBuilderValueSearchPlugin;
|
|
5
|
-
}
|
|
6
|
-
export declare const searchPluginsList: (plugins: PluginsContainer) => ElasticsearchQuerySearchValuePlugins;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.searchPluginsList = void 0;
|
|
9
|
-
|
|
10
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
const searchPluginsList = plugins => {
|
|
13
|
-
return plugins.byType("cms-elastic-search-query-builder-value-search").reduce((plugins, plugin) => {
|
|
14
|
-
if (plugins[plugin.fieldType]) {
|
|
15
|
-
throw new _error.default("There is a ElasticsearchQueryBuilderValueSearchPlugin defined for the field type.", "PLUGIN_ALREADY_EXISTS", {
|
|
16
|
-
fieldType: plugin.fieldType,
|
|
17
|
-
name: plugin.name || "unknown"
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
plugins[plugin.fieldType] = plugin;
|
|
22
|
-
return plugins;
|
|
23
|
-
}, {});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.searchPluginsList = searchPluginsList;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchQuerySearchValuePlugins } from "./searchPluginsList";
|
|
2
|
-
import { CmsModelField } from "@webiny/api-headless-cms/types";
|
|
3
|
-
interface Params {
|
|
4
|
-
plugins: ElasticsearchQuerySearchValuePlugins;
|
|
5
|
-
field: CmsModelField;
|
|
6
|
-
value: any;
|
|
7
|
-
}
|
|
8
|
-
export declare const transformValueForSearch: (args: Params) => any;
|
|
9
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.transformValueForSearch = void 0;
|
|
7
|
-
|
|
8
|
-
const transformValueForSearch = args => {
|
|
9
|
-
const {
|
|
10
|
-
field,
|
|
11
|
-
plugins,
|
|
12
|
-
value
|
|
13
|
-
} = args;
|
|
14
|
-
const plugin = plugins[field.type];
|
|
15
|
-
|
|
16
|
-
if (!plugin) {
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return plugin.transform({
|
|
21
|
-
field,
|
|
22
|
-
value
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.transformValueForSearch = transformValueForSearch;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.elasticsearchFields = void 0;
|
|
7
|
-
|
|
8
|
-
var _CmsEntryElasticsearchFieldPlugin = require("../../plugins/CmsEntryElasticsearchFieldPlugin");
|
|
9
|
-
|
|
10
|
-
const elasticsearchFields = [new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
11
|
-
field: "createdOn",
|
|
12
|
-
unmappedType: "date"
|
|
13
|
-
}), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
14
|
-
field: "savedOn",
|
|
15
|
-
unmappedType: "date"
|
|
16
|
-
}), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
17
|
-
field: "publishedOn",
|
|
18
|
-
unmappedType: "date"
|
|
19
|
-
}), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
20
|
-
field: "ownedBy",
|
|
21
|
-
path: "ownedBy.id"
|
|
22
|
-
}), new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
23
|
-
field: "createdBy",
|
|
24
|
-
path: "createdBy.id"
|
|
25
|
-
}),
|
|
26
|
-
/**
|
|
27
|
-
* Always add the ALL fields plugin because of the keyword/path build.
|
|
28
|
-
*/
|
|
29
|
-
new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
30
|
-
field: _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin.ALL
|
|
31
|
-
})];
|
|
32
|
-
exports.elasticsearchFields = elasticsearchFields;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { CmsEntryElasticsearchFieldPlugin } from "../../plugins/CmsEntryElasticsearchFieldPlugin";
|
|
3
|
-
export declare const createElasticsearchFields: (model: CmsModel) => Record<string, CmsEntryElasticsearchFieldPlugin>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createElasticsearchFields = void 0;
|
|
7
|
-
|
|
8
|
-
var _CmsEntryElasticsearchFieldPlugin = require("../../plugins/CmsEntryElasticsearchFieldPlugin");
|
|
9
|
-
|
|
10
|
-
const fieldsWithKeywords = ["text", "long-text", "rich-text", "id", "ref"];
|
|
11
|
-
/**
|
|
12
|
-
* We need to map entry system fields that have different paths, no keyword or not sortable.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const systemFields = {
|
|
16
|
-
createdBy: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
17
|
-
field: "createdBy",
|
|
18
|
-
path: "createdBy.id",
|
|
19
|
-
searchable: true,
|
|
20
|
-
keyword: true,
|
|
21
|
-
sortable: false
|
|
22
|
-
}),
|
|
23
|
-
ownedBy: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
24
|
-
field: "ownedBy",
|
|
25
|
-
path: "ownedBy.id",
|
|
26
|
-
searchable: true,
|
|
27
|
-
keyword: true,
|
|
28
|
-
sortable: false
|
|
29
|
-
}),
|
|
30
|
-
createdOn: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
31
|
-
field: "createdOn",
|
|
32
|
-
path: "createdOn",
|
|
33
|
-
searchable: true,
|
|
34
|
-
keyword: false,
|
|
35
|
-
sortable: false,
|
|
36
|
-
unmappedType: "date"
|
|
37
|
-
}),
|
|
38
|
-
savedOn: new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
39
|
-
field: "savedOn",
|
|
40
|
-
path: "savedOn",
|
|
41
|
-
searchable: true,
|
|
42
|
-
keyword: false,
|
|
43
|
-
sortable: false,
|
|
44
|
-
unmappedType: "date"
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const createElasticsearchFields = model => {
|
|
49
|
-
return model.fields.reduce((fields, field) => {
|
|
50
|
-
fields[field.fieldId] = new _CmsEntryElasticsearchFieldPlugin.CmsEntryElasticsearchFieldPlugin({
|
|
51
|
-
field: field.fieldId,
|
|
52
|
-
path: `values.${field.fieldId}`,
|
|
53
|
-
searchable: true,
|
|
54
|
-
keyword: fieldsWithKeywords.includes(field.type)
|
|
55
|
-
});
|
|
56
|
-
return fields;
|
|
57
|
-
}, systemFields);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
exports.createElasticsearchFields = createElasticsearchFields;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CmsEntryStorageOperations } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { Entity } from "dynamodb-toolbox";
|
|
3
|
-
import { Client } from "@elastic/elasticsearch";
|
|
4
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
5
|
-
export declare const createLatestType: () => string;
|
|
6
|
-
export declare const createPublishedType: () => string;
|
|
7
|
-
export interface Params {
|
|
8
|
-
entity: Entity<any>;
|
|
9
|
-
esEntity: Entity<any>;
|
|
10
|
-
elasticsearch: Client;
|
|
11
|
-
plugins: PluginsContainer;
|
|
12
|
-
}
|
|
13
|
-
export declare const createEntriesStorageOperations: (params: Params) => CmsEntryStorageOperations;
|