@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
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
const convertToString = value => {
|
|
9
|
-
if (Array.isArray(value) === false) {
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return value.map(String);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const convertToFloat = value => {
|
|
17
|
-
if (Array.isArray(value) === false) {
|
|
18
|
-
return typeof value === "string" ? parseFloat(value) : value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return value.map(v => parseFloat(v));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var _default = () => ({
|
|
25
|
-
type: "cms-model-field-to-elastic-search",
|
|
26
|
-
name: "cms-model-field-to-elastic-search-number",
|
|
27
|
-
fieldType: "number",
|
|
28
|
-
unmappedType: () => {
|
|
29
|
-
return "float";
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
toIndex({
|
|
33
|
-
value
|
|
34
|
-
}) {
|
|
35
|
-
return {
|
|
36
|
-
value: convertToString(value)
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
fromIndex({
|
|
41
|
-
value
|
|
42
|
-
}) {
|
|
43
|
-
return convertToFloat(value);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
exports.default = _default;
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
const processToIndex = ({
|
|
9
|
-
fields,
|
|
10
|
-
value: sourceValue,
|
|
11
|
-
rawValue: sourceRawValue,
|
|
12
|
-
getFieldIndexPlugin,
|
|
13
|
-
getFieldTypePlugin,
|
|
14
|
-
plugins,
|
|
15
|
-
model
|
|
16
|
-
}) => {
|
|
17
|
-
const reducer = (values, field) => {
|
|
18
|
-
const plugin = getFieldIndexPlugin(field.type);
|
|
19
|
-
const {
|
|
20
|
-
value,
|
|
21
|
-
rawValue
|
|
22
|
-
} = plugin.toIndex({
|
|
23
|
-
model,
|
|
24
|
-
field,
|
|
25
|
-
value: sourceValue[field.fieldId],
|
|
26
|
-
rawValue: sourceRawValue[field.fieldId],
|
|
27
|
-
getFieldIndexPlugin,
|
|
28
|
-
getFieldTypePlugin,
|
|
29
|
-
plugins
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
if (value !== undefined) {
|
|
33
|
-
values.value[field.fieldId] = value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (rawValue !== undefined) {
|
|
37
|
-
values.rawValue[field.fieldId] = rawValue;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return values;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return fields.reduce(reducer, {
|
|
44
|
-
value: {},
|
|
45
|
-
rawValue: {}
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const processFromIndex = ({
|
|
50
|
-
fields,
|
|
51
|
-
value: sourceValue,
|
|
52
|
-
rawValue: sourceRawValue,
|
|
53
|
-
getFieldIndexPlugin,
|
|
54
|
-
getFieldTypePlugin,
|
|
55
|
-
plugins,
|
|
56
|
-
model
|
|
57
|
-
}) => {
|
|
58
|
-
const reducer = (values, field) => {
|
|
59
|
-
const plugin = getFieldIndexPlugin(field.type);
|
|
60
|
-
const value = plugin.fromIndex({
|
|
61
|
-
plugins,
|
|
62
|
-
model,
|
|
63
|
-
field,
|
|
64
|
-
value: sourceValue[field.fieldId],
|
|
65
|
-
rawValue: sourceRawValue[field.fieldId],
|
|
66
|
-
getFieldIndexPlugin,
|
|
67
|
-
getFieldTypePlugin
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
if (value !== undefined) {
|
|
71
|
-
values[field.fieldId] = value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return values;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
return fields.reduce(reducer, {});
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
var _default = () => ({
|
|
81
|
-
type: "cms-model-field-to-elastic-search",
|
|
82
|
-
name: "cms-model-field-to-elastic-search-object",
|
|
83
|
-
fieldType: "object",
|
|
84
|
-
|
|
85
|
-
toIndex({
|
|
86
|
-
plugins,
|
|
87
|
-
model,
|
|
88
|
-
field,
|
|
89
|
-
value: initialValue,
|
|
90
|
-
rawValue: initialRawValue,
|
|
91
|
-
getFieldIndexPlugin,
|
|
92
|
-
getFieldTypePlugin
|
|
93
|
-
}) {
|
|
94
|
-
if (!initialValue) {
|
|
95
|
-
return {
|
|
96
|
-
value: null
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const fields = field.settings.fields;
|
|
101
|
-
/**
|
|
102
|
-
* In "object" field, value is either an object or an array of objects.
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
if (field.multipleValues) {
|
|
106
|
-
const result = {
|
|
107
|
-
value: [],
|
|
108
|
-
rawValue: []
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
for (const key in initialValue) {
|
|
112
|
-
const {
|
|
113
|
-
value,
|
|
114
|
-
rawValue
|
|
115
|
-
} = processToIndex({
|
|
116
|
-
value: initialValue[key],
|
|
117
|
-
rawValue: initialRawValue[key],
|
|
118
|
-
getFieldIndexPlugin,
|
|
119
|
-
getFieldTypePlugin,
|
|
120
|
-
model,
|
|
121
|
-
plugins,
|
|
122
|
-
fields
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
if (Object.keys(value).length > 0) {
|
|
126
|
-
result.value.push(value);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (Object.keys(rawValue).length > 0) {
|
|
130
|
-
result.rawValue.push(rawValue);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return {
|
|
135
|
-
value: result.value.length > 0 ? result.value : undefined,
|
|
136
|
-
rawValue: result.rawValue.length > 0 ? result.rawValue : undefined
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return processToIndex({
|
|
141
|
-
value: initialValue,
|
|
142
|
-
rawValue: initialRawValue,
|
|
143
|
-
getFieldIndexPlugin,
|
|
144
|
-
getFieldTypePlugin,
|
|
145
|
-
model,
|
|
146
|
-
plugins,
|
|
147
|
-
fields
|
|
148
|
-
});
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
fromIndex({
|
|
152
|
-
field,
|
|
153
|
-
value,
|
|
154
|
-
rawValue,
|
|
155
|
-
model,
|
|
156
|
-
plugins,
|
|
157
|
-
getFieldIndexPlugin,
|
|
158
|
-
getFieldTypePlugin
|
|
159
|
-
}) {
|
|
160
|
-
if (!value) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const fields = field.settings.fields;
|
|
165
|
-
/**
|
|
166
|
-
* In "object" field, value is either an object or an array of objects.
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
if (field.multipleValues) {
|
|
170
|
-
/**
|
|
171
|
-
* Why this `value || rawValue || []`?
|
|
172
|
-
* It's possible that an object contains all non-indexable fields, or vice-versa, and so
|
|
173
|
-
* we can never be sure which array we can reliably use as a source of values.
|
|
174
|
-
*/
|
|
175
|
-
const source = value || rawValue || [];
|
|
176
|
-
return source.map((_, index) => processFromIndex({
|
|
177
|
-
value: value ? value[index] || {} : {},
|
|
178
|
-
rawValue: rawValue ? rawValue[index] || {} : {},
|
|
179
|
-
getFieldIndexPlugin,
|
|
180
|
-
getFieldTypePlugin,
|
|
181
|
-
model,
|
|
182
|
-
plugins,
|
|
183
|
-
fields
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return processFromIndex({
|
|
188
|
-
value,
|
|
189
|
-
rawValue,
|
|
190
|
-
getFieldIndexPlugin,
|
|
191
|
-
getFieldTypePlugin,
|
|
192
|
-
model,
|
|
193
|
-
plugins,
|
|
194
|
-
fields
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
exports.default = _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = () => ({
|
|
9
|
-
type: "cms-model-field-to-elastic-search",
|
|
10
|
-
name: "cms-model-field-to-elastic-search-rich-text",
|
|
11
|
-
fieldType: "rich-text",
|
|
12
|
-
|
|
13
|
-
toIndex({
|
|
14
|
-
value
|
|
15
|
-
}) {
|
|
16
|
-
// TODO: convert rich-text object to a searchable string to offer full-text search at some point
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* We want to store rich-text value as a "rawValue", meaning it wont' be indexed by ES.
|
|
20
|
-
*/
|
|
21
|
-
return {
|
|
22
|
-
rawValue: value
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
fromIndex({
|
|
27
|
-
rawValue
|
|
28
|
-
}) {
|
|
29
|
-
return rawValue;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
exports.default = _default;
|
|
@@ -1,16 +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.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _timeSearch = _interopRequireDefault(require("./timeSearch"));
|
|
11
|
-
|
|
12
|
-
var _refSearch = _interopRequireDefault(require("./refSearch"));
|
|
13
|
-
|
|
14
|
-
var _default = () => [(0, _timeSearch.default)(), (0, _refSearch.default)()];
|
|
15
|
-
|
|
16
|
-
exports.default = _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = () => ({
|
|
9
|
-
type: "cms-elastic-search-query-builder-value-search",
|
|
10
|
-
name: "cms-elastic-search-query-builder-value-search-ref-field",
|
|
11
|
-
fieldType: "ref",
|
|
12
|
-
transform: ({
|
|
13
|
-
value
|
|
14
|
-
}) => {
|
|
15
|
-
return value;
|
|
16
|
-
},
|
|
17
|
-
createPath: ({
|
|
18
|
-
field
|
|
19
|
-
}) => {
|
|
20
|
-
return `values.${field.fieldId}.entryId`;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
exports.default = _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = () => ({
|
|
9
|
-
type: "cms-elastic-search-query-builder-value-search",
|
|
10
|
-
name: "elastic-search-query-builder-value-search-time",
|
|
11
|
-
fieldType: "datetime",
|
|
12
|
-
transform: ({
|
|
13
|
-
field,
|
|
14
|
-
value
|
|
15
|
-
}) => {
|
|
16
|
-
if (field.settings.type !== "time") {
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const [hours, minutes, seconds = 0] = value.split(":").map(Number);
|
|
21
|
-
return hours * 60 * 60 + minutes * 60 + seconds;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
exports.default = _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CmsEntryListParams, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { SearchBody as esSearchBody } from "@webiny/api-elasticsearch/types";
|
|
3
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
4
|
-
interface CreateElasticsearchParams {
|
|
5
|
-
plugins: PluginsContainer;
|
|
6
|
-
model: CmsModel;
|
|
7
|
-
args: CmsEntryListParams;
|
|
8
|
-
parentPath?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const createElasticsearchQueryBody: (params: CreateElasticsearchParams) => esSearchBody;
|
|
11
|
-
export {};
|