@webiny/api-headless-cms-ddb-es 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configurations.d.ts +5 -4
- package/configurations.js +27 -33
- package/configurations.js.map +1 -1
- package/definitions/entry.js +7 -9
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js +7 -9
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +7 -9
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +9 -3
- package/definitions/types.js +0 -3
- package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/createElasticsearchIndex.js +52 -27
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
- package/elasticsearch/deleteElasticsearchIndex.js +18 -26
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/exports/api/cms/opensearch.d.ts +9 -0
- package/exports/api/cms/opensearch.js +9 -0
- package/feature.d.ts +1 -0
- package/feature.js +179 -0
- package/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.js +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +14 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +42 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +32 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +5 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +5 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +29 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +60 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +13 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +33 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +21 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +22 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +32 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +12 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +107 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +21 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +15 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +40 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +15 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +40 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.js +3 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +36 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +5 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +5 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.js +4 -0
- package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchFilter/feature.js +17 -0
- package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +26 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +43 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +36 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFilter/index.js +3 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +1 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchIndex/feature.js +11 -0
- package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchIndex/index.js +3 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.js +1 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.js +1 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +31 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +5 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +5 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js +17 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +21 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +44 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +22 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchValueSearch/index.js +3 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.js +1 -0
- package/helpers/entryIndexHelpers.d.ts +6 -4
- package/helpers/entryIndexHelpers.js +70 -186
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.js +18 -30
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.js +0 -2
- package/index.d.ts +1 -3
- package/index.js +1 -190
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +2 -1
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +28 -34
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +28 -34
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.js +33 -43
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.js +8 -9
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +1 -0
- package/operations/entry/dataLoader/types.js +0 -3
- package/operations/entry/dataLoaders.js +81 -97
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +6 -24
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +19 -3
- package/operations/entry/elasticsearch/body.js +74 -122
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
- package/operations/entry/elasticsearch/fields/createSystemField.js +9 -0
- package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
- package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/live.js +50 -0
- package/operations/entry/elasticsearch/fields/live.js.map +1 -0
- package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/location.js +50 -0
- package/operations/entry/elasticsearch/fields/location.js.map +1 -0
- package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/state.js +104 -0
- package/operations/entry/elasticsearch/fields/state.js.map +1 -0
- package/operations/entry/elasticsearch/fields.d.ts +6 -4
- package/operations/entry/elasticsearch/fields.js +194 -388
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +6 -5
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +32 -45
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -2
- package/operations/entry/elasticsearch/filtering/exec.js +84 -166
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +0 -2
- package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
- package/operations/entry/elasticsearch/filtering/path.js +24 -35
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -2
- package/operations/entry/elasticsearch/filtering/populated.js +8 -14
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +11 -12
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +7 -6
- package/operations/entry/elasticsearch/fullTextSearch.js +45 -79
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +4 -4
- package/operations/entry/elasticsearch/fullTextSearchFields.js +7 -17
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +3 -3
- package/operations/entry/elasticsearch/initialQuery.js +37 -80
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.js +13 -27
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
- package/operations/entry/elasticsearch/plugins/operator.js +10 -21
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -4
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
- package/operations/entry/elasticsearch/sort.d.ts +4 -4
- package/operations/entry/elasticsearch/sort.js +69 -96
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js +9 -24
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +3 -10
- package/operations/entry/elasticsearch/types.js +0 -3
- package/operations/entry/index.d.ts +22 -2
- package/operations/entry/index.js +1316 -1650
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +43 -63
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +4 -9
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.js +21 -26
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +6 -2
- package/operations/entry/transformations/index.js +84 -112
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +6 -4
- package/operations/entry/transformations/modifyEntryValues.js +12 -17
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.js +13 -16
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +2 -2
- package/operations/entry/transformations/transformEntryToIndex.js +16 -20
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +2 -2
- package/operations/group/index.js +115 -139
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +1 -1
- package/operations/model/index.js +128 -157
- package/operations/model/index.js.map +1 -1
- package/package.json +35 -30
- package/tasks/createIndexTaskPlugin.js +36 -32
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +7 -112
- package/types.js +7 -36
- package/types.js.map +1 -1
- package/values/NoValueContainer.js +8 -10
- package/values/NoValueContainer.js.map +1 -1
- package/definitions/types.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -3
- package/dynamoDb/index.js +0 -8
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -88
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -2
- package/dynamoDb/storage/richText.js +0 -51
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -5
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -81
- package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -10
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
- package/elasticsearch/indexing/jsonIndexing.js +0 -21
- package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
- package/elasticsearch/indexing/longTextIndexing.js +0 -35
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -34
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -194
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -24
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -7
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -6
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -6
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -24
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/searchableJson.d.ts +0 -2
- package/elasticsearch/search/searchableJson.js +0 -53
- package/elasticsearch/search/searchableJson.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -20
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/dataLoader/types.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
- package/operations/entry/elasticsearch/plugins/search.js +0 -18
- package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
- package/operations/entry/elasticsearch/types.js.map +0 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
- package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
- package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
- package/plugins/CmsEntryFilterPlugin.js +0 -15
- package/plugins/CmsEntryFilterPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -8
- package/plugins/index.js +0 -10
- package/plugins/index.js.map +0 -1
|
@@ -1,31 +1,17 @@
|
|
|
1
1
|
import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
|
|
2
|
-
const noKeywordFields = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
else if (field.unmappedType) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* And if specifically defined that field has no keyword, do not add it.
|
|
20
|
-
*/
|
|
21
|
-
//
|
|
22
|
-
else if (field.keyword === false) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* All other fields have keyword added.
|
|
27
|
-
*/
|
|
28
|
-
return true;
|
|
2
|
+
const noKeywordFields = [
|
|
3
|
+
"date",
|
|
4
|
+
"datetime",
|
|
5
|
+
"number",
|
|
6
|
+
"boolean"
|
|
7
|
+
];
|
|
8
|
+
const hasKeyword = (field)=>{
|
|
9
|
+
const fieldType = getBaseFieldType(field);
|
|
10
|
+
if (noKeywordFields.includes(fieldType)) return false;
|
|
11
|
+
if (field.unmappedType) return false;
|
|
12
|
+
if (false === field.keyword) return false;
|
|
13
|
+
return true;
|
|
29
14
|
};
|
|
15
|
+
export { hasKeyword };
|
|
30
16
|
|
|
31
17
|
//# sourceMappingURL=keyword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/elasticsearch/keyword.js","sources":["../../../../src/operations/entry/elasticsearch/keyword.ts"],"sourcesContent":["import type { ModelField } from \"./types.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\n\nconst noKeywordFields: string[] = [\"date\", \"datetime\", \"number\", \"boolean\"];\nexport const hasKeyword = (field: ModelField): boolean => {\n const fieldType = getBaseFieldType(field);\n /**\n * We defined some field types that MUST have no keyword added to the field path\n */\n if (noKeywordFields.includes(fieldType)) {\n return false;\n }\n /**\n * If field has unmapped type defined, do not add keyword.\n */\n //\n else if (field.unmappedType) {\n return false;\n }\n /**\n * And if specifically defined that field has no keyword, do not add it.\n */\n //\n else if (field.keyword === false) {\n return false;\n }\n /**\n * All other fields have keyword added.\n */\n return true;\n};\n"],"names":["noKeywordFields","hasKeyword","field","fieldType","getBaseFieldType"],"mappings":";AAGA,MAAMA,kBAA4B;IAAC;IAAQ;IAAY;IAAU;CAAU;AACpE,MAAMC,aAAa,CAACC;IACvB,MAAMC,YAAYC,iBAAiBF;IAInC,IAAIF,gBAAgB,QAAQ,CAACG,YACzB,OAAO;IAMN,IAAID,MAAM,YAAY,EACvB,OAAO;IAMN,IAAIA,AAAkB,UAAlBA,MAAM,OAAO,EAClB,OAAO;IAKX,OAAO;AACX"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PluginsContainer } from "@webiny/plugins";
|
|
2
|
-
import type {
|
|
2
|
+
import type { OpenSearchQueryBuilderOperatorPlugins } from "../types.js";
|
|
3
3
|
interface Params {
|
|
4
4
|
plugins: PluginsContainer;
|
|
5
5
|
}
|
|
6
|
-
export declare const createOperatorPluginList: (params: Params) =>
|
|
6
|
+
export declare const createOperatorPluginList: (params: Params) => OpenSearchQueryBuilderOperatorPlugins;
|
|
7
7
|
export {};
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
plugins
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return plugins.byType(ElasticsearchQueryBuilderOperatorPlugin.type).reduce((acc, plugin) => {
|
|
11
|
-
const operator = plugin.getOperator();
|
|
12
|
-
/**
|
|
13
|
-
* We also only allow the override of the plugins if the new plugin is NOT a default one.
|
|
14
|
-
* If a user sets the plugin name ending with .default, we cannot do anything about it.
|
|
15
|
-
*/
|
|
16
|
-
if (!!acc[operator] && (plugin.name || "").match(/\.default$/)) {
|
|
17
|
-
return acc;
|
|
18
|
-
}
|
|
19
|
-
acc[operator] = plugin;
|
|
20
|
-
return acc;
|
|
21
|
-
}, {});
|
|
1
|
+
import { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
|
|
2
|
+
const createOperatorPluginList = (params)=>{
|
|
3
|
+
const { plugins } = params;
|
|
4
|
+
return plugins.byType(OpenSearchQueryBuilderOperatorPlugin.type).reduce((acc, plugin)=>{
|
|
5
|
+
const operator = plugin.getOperator();
|
|
6
|
+
if (!!acc[operator] && (plugin.name || "").match(/\.default$/)) return acc;
|
|
7
|
+
acc[operator] = plugin;
|
|
8
|
+
return acc;
|
|
9
|
+
}, {});
|
|
22
10
|
};
|
|
11
|
+
export { createOperatorPluginList };
|
|
23
12
|
|
|
24
13
|
//# sourceMappingURL=operator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/elasticsearch/plugins/operator.js","sources":["../../../../../src/operations/entry/elasticsearch/plugins/operator.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport { OpenSearchQueryBuilderOperatorPlugin } from \"@webiny/api-opensearch\";\nimport type { OpenSearchQueryBuilderOperatorPlugins } from \"../types.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n}\nexport const createOperatorPluginList = (params: Params): OpenSearchQueryBuilderOperatorPlugins => {\n const { plugins } = params;\n /**\n * We always set the last one operator plugin added.\n * This way user can override the plugins.\n */\n return plugins\n .byType<OpenSearchQueryBuilderOperatorPlugin>(OpenSearchQueryBuilderOperatorPlugin.type)\n .reduce<OpenSearchQueryBuilderOperatorPlugins>((acc, plugin) => {\n const operator = plugin.getOperator();\n /**\n * We also only allow the override of the plugins if the new plugin is NOT a default one.\n * If a user sets the plugin name ending with .default, we cannot do anything about it.\n */\n if (!!acc[operator] && (plugin.name || \"\").match(/\\.default$/)) {\n return acc;\n }\n acc[operator] = plugin;\n return acc;\n }, {});\n};\n"],"names":["createOperatorPluginList","params","plugins","OpenSearchQueryBuilderOperatorPlugin","acc","plugin","operator"],"mappings":";AAOO,MAAMA,2BAA2B,CAACC;IACrC,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAKpB,OAAOC,QACF,MAAM,CAAuCC,qCAAqC,IAAI,EACtF,MAAM,CAAwC,CAACC,KAAKC;QACjD,MAAMC,WAAWD,OAAO,WAAW;QAKnC,IAAI,CAAC,CAACD,GAAG,CAACE,SAAS,IAAKD,AAAAA,CAAAA,OAAO,IAAI,IAAI,EAAC,EAAG,KAAK,CAAC,eAC7C,OAAOD;QAEXA,GAAG,CAACE,SAAS,GAAGD;QAChB,OAAOD;IACX,GAAG,CAAC;AACZ"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
const IGNORED_ES_SEARCH_EXCEPTIONS = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const IGNORED_ES_SEARCH_EXCEPTIONS = [
|
|
2
|
+
"index_not_found_exception",
|
|
3
|
+
"search_phase_execution_exception"
|
|
4
|
+
];
|
|
5
|
+
const shouldIgnoreEsResponseError = (error)=>IGNORED_ES_SEARCH_EXCEPTIONS.some((ignoredMessage)=>error.message.includes(ignoredMessage));
|
|
6
|
+
export { shouldIgnoreEsResponseError };
|
|
5
7
|
|
|
6
8
|
//# sourceMappingURL=shouldIgnoreEsResponseError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/elasticsearch/shouldIgnoreEsResponseError.js","sources":["../../../../src/operations/entry/elasticsearch/shouldIgnoreEsResponseError.ts"],"sourcesContent":["import type WebinyError from \"@webiny/error\";\n\nconst IGNORED_ES_SEARCH_EXCEPTIONS = [\n \"index_not_found_exception\",\n \"search_phase_execution_exception\"\n];\n\nexport const shouldIgnoreEsResponseError = (error: WebinyError) => {\n return IGNORED_ES_SEARCH_EXCEPTIONS.some(ignoredMessage =>\n error.message.includes(ignoredMessage)\n );\n};\n"],"names":["IGNORED_ES_SEARCH_EXCEPTIONS","shouldIgnoreEsResponseError","error","ignoredMessage"],"mappings":"AAEA,MAAMA,+BAA+B;IACjC;IACA;CACH;AAEM,MAAMC,8BAA8B,CAACC,QACjCF,6BAA6B,IAAI,CAACG,CAAAA,iBACrCD,MAAM,OAAO,CAAC,QAAQ,CAACC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Sort as
|
|
2
|
-
import type { PluginsContainer } from "@webiny/plugins";
|
|
1
|
+
import type { Sort as OpenSearchSort } from "@webiny/api-opensearch/types.js";
|
|
3
2
|
import type { CmsEntryListSort, CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
3
|
import type { ModelFields } from "./types.js";
|
|
4
|
+
import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
5
5
|
interface Params {
|
|
6
|
-
plugins: PluginsContainer;
|
|
7
6
|
sort?: CmsEntryListSort;
|
|
8
7
|
modelFields: ModelFields;
|
|
9
8
|
model: CmsModel;
|
|
9
|
+
valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
|
|
10
10
|
}
|
|
11
|
-
export declare const createElasticsearchSort: (params: Params) =>
|
|
11
|
+
export declare const createElasticsearchSort: (params: Params) => OpenSearchSort;
|
|
12
12
|
export {};
|
|
@@ -1,107 +1,80 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenSearchFieldPlugin, createSort } from "@webiny/api-opensearch";
|
|
2
2
|
import { hasKeyword } from "./keyword.js";
|
|
3
|
-
import { createSearchPluginList } from "./plugins/search.js";
|
|
4
3
|
import { createFieldPathFactory } from "./filtering/path.js";
|
|
5
4
|
import { NoValueContainer } from "../../../values/NoValueContainer.js";
|
|
6
|
-
const matchField = input
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const matchField = (input)=>{
|
|
6
|
+
const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
|
|
7
|
+
if (valuesMatch) {
|
|
8
|
+
const [, fieldId, order] = valuesMatch;
|
|
9
|
+
return {
|
|
10
|
+
fieldId,
|
|
11
|
+
isValues: true,
|
|
12
|
+
order: order
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
|
|
16
|
+
if (!nonValues) return null;
|
|
17
|
+
const [, fieldId, order] = nonValues;
|
|
10
18
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
fieldId,
|
|
20
|
+
isValues: false,
|
|
21
|
+
order: order
|
|
14
22
|
};
|
|
15
|
-
}
|
|
16
|
-
const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);
|
|
17
|
-
if (!nonValues) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const [, fieldId, order] = nonValues;
|
|
21
|
-
return {
|
|
22
|
-
fieldId,
|
|
23
|
-
isValues: false,
|
|
24
|
-
order: order
|
|
25
|
-
};
|
|
26
23
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
sort
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}];
|
|
39
|
-
}
|
|
40
|
-
const searchPlugins = createSearchPluginList({
|
|
41
|
-
plugins
|
|
42
|
-
});
|
|
43
|
-
const createFieldPath = createFieldPathFactory({
|
|
44
|
-
plugins: searchPlugins
|
|
45
|
-
});
|
|
46
|
-
const fieldIdToStorageIdIdMap = {};
|
|
47
|
-
const sortPlugins = Object.values(modelFields).reduce((plugins, field) => {
|
|
48
|
-
/**
|
|
49
|
-
* We do not support sorting by nested fields.
|
|
50
|
-
*/
|
|
51
|
-
const isValues = field.parents.length === 1 && field.parents[0].fieldId === "values";
|
|
52
|
-
if (field.parents.length > 0 && !isValues) {
|
|
53
|
-
return plugins;
|
|
54
|
-
}
|
|
55
|
-
const fieldId = field.field.fieldId;
|
|
56
|
-
const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;
|
|
57
|
-
fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;
|
|
58
|
-
const {
|
|
59
|
-
path
|
|
60
|
-
} = createFieldPath({
|
|
61
|
-
key: field.field.storageId,
|
|
62
|
-
field,
|
|
63
|
-
value: NoValueContainer.create(),
|
|
64
|
-
keyword: false,
|
|
65
|
-
originalValue: NoValueContainer.create()
|
|
24
|
+
const createElasticsearchSort = (params)=>{
|
|
25
|
+
const { sort, modelFields, valueSearchRegistry } = params;
|
|
26
|
+
if (!sort || 0 === sort.length) return [
|
|
27
|
+
{
|
|
28
|
+
["id.keyword"]: {
|
|
29
|
+
order: "asc"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
const createFieldPath = createFieldPathFactory({
|
|
34
|
+
valueSearchRegistry
|
|
66
35
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
36
|
+
const fieldIdToStorageIdIdMap = {};
|
|
37
|
+
const sortPlugins = Object.values(modelFields).reduce((plugins, field)=>{
|
|
38
|
+
const isValues = 1 === field.parents.length && "values" === field.parents[0].fieldId;
|
|
39
|
+
if (field.parents.length > 0 && !isValues) return plugins;
|
|
40
|
+
const fieldId = field.field.fieldId;
|
|
41
|
+
const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;
|
|
42
|
+
fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;
|
|
43
|
+
const { path } = createFieldPath({
|
|
44
|
+
key: field.field.storageId,
|
|
45
|
+
field,
|
|
46
|
+
value: NoValueContainer.create(),
|
|
47
|
+
keyword: false,
|
|
48
|
+
originalValue: NoValueContainer.create()
|
|
49
|
+
});
|
|
50
|
+
plugins[fieldIdPath] = new OpenSearchFieldPlugin({
|
|
51
|
+
unmappedType: field.unmappedType,
|
|
52
|
+
keyword: hasKeyword(field),
|
|
53
|
+
sortable: field.sortable,
|
|
54
|
+
searchable: field.searchable,
|
|
55
|
+
field: fieldId,
|
|
56
|
+
path
|
|
57
|
+
});
|
|
58
|
+
return plugins;
|
|
59
|
+
}, {
|
|
60
|
+
["*"]: new OpenSearchFieldPlugin({
|
|
61
|
+
field: OpenSearchFieldPlugin.ALL,
|
|
62
|
+
keyword: false
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
const transformedSort = sort.map((value)=>{
|
|
66
|
+
const matched = matchField(value);
|
|
67
|
+
if (!matched) return null;
|
|
68
|
+
const { fieldId, order, isValues } = matched;
|
|
69
|
+
const key = isValues ? `values.${fieldId}` : fieldId;
|
|
70
|
+
if (fieldIdToStorageIdIdMap[key]) return `${fieldIdToStorageIdIdMap[key]}_${order}`;
|
|
71
|
+
return value;
|
|
72
|
+
}).filter(Boolean);
|
|
73
|
+
return createSort({
|
|
74
|
+
fieldPlugins: sortPlugins,
|
|
75
|
+
sort: transformedSort
|
|
77
76
|
});
|
|
78
|
-
return plugins;
|
|
79
|
-
}, {
|
|
80
|
-
["*"]: new ElasticsearchFieldPlugin({
|
|
81
|
-
field: ElasticsearchFieldPlugin.ALL,
|
|
82
|
-
keyword: false
|
|
83
|
-
})
|
|
84
|
-
});
|
|
85
|
-
const transformedSort = sort.map(value => {
|
|
86
|
-
const matched = matchField(value);
|
|
87
|
-
if (!matched) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
const {
|
|
91
|
-
fieldId,
|
|
92
|
-
order,
|
|
93
|
-
isValues
|
|
94
|
-
} = matched;
|
|
95
|
-
const key = isValues ? `values.${fieldId}` : fieldId;
|
|
96
|
-
if (fieldIdToStorageIdIdMap[key]) {
|
|
97
|
-
return `${fieldIdToStorageIdIdMap[key]}_${order}`;
|
|
98
|
-
}
|
|
99
|
-
return value;
|
|
100
|
-
}).filter(Boolean);
|
|
101
|
-
return createSort({
|
|
102
|
-
fieldPlugins: sortPlugins,
|
|
103
|
-
sort: transformedSort
|
|
104
|
-
});
|
|
105
77
|
};
|
|
78
|
+
export { createElasticsearchSort };
|
|
106
79
|
|
|
107
80
|
//# sourceMappingURL=sort.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/elasticsearch/sort.js","sources":["../../../../src/operations/entry/elasticsearch/sort.ts"],"sourcesContent":["import type { Sort as OpenSearchSort } from \"@webiny/api-opensearch/types.js\";\nimport { createSort, OpenSearchFieldPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsEntryListSort, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { ModelFields } from \"./types.js\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword.js\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path.js\";\nimport { NoValueContainer } from \"~/values/NoValueContainer.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\n\ninterface IMatchFieldResponse {\n fieldId: string;\n isValues: boolean;\n order: \"ASC\" | \"DESC\";\n}\n\nconst matchField = (input: string): IMatchFieldResponse | null => {\n const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (valuesMatch) {\n const [, fieldId, order] = valuesMatch;\n return {\n fieldId,\n isValues: true,\n order: order as \"ASC\" | \"DESC\"\n };\n }\n const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (!nonValues) {\n return null;\n }\n const [, fieldId, order] = nonValues;\n return {\n fieldId,\n isValues: false,\n order: order as \"ASC\" | \"DESC\"\n };\n};\n\ninterface Params {\n sort?: CmsEntryListSort;\n modelFields: ModelFields;\n model: CmsModel;\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n}\n\nexport const createElasticsearchSort = (params: Params): OpenSearchSort => {\n const { sort, modelFields, valueSearchRegistry } = params;\n\n if (!sort || sort.length === 0) {\n return [\n {\n [\"id.keyword\"]: {\n order: \"asc\"\n }\n }\n ];\n }\n\n const createFieldPath = createFieldPathFactory({\n valueSearchRegistry\n });\n\n const fieldIdToStorageIdIdMap: Record<string, string> = {};\n\n const sortPlugins = Object.values(modelFields).reduce<Record<string, OpenSearchFieldPlugin>>(\n (plugins, field) => {\n /**\n * We do not support sorting by nested fields.\n */\n const isValues = field.parents.length === 1 && field.parents[0].fieldId === \"values\";\n if (field.parents.length > 0 && !isValues) {\n return plugins;\n }\n\n const fieldId = field.field.fieldId;\n const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;\n\n fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;\n\n const { path } = createFieldPath({\n key: field.field.storageId,\n field,\n value: NoValueContainer.create(),\n keyword: false,\n originalValue: NoValueContainer.create()\n });\n /**\n * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.\n */\n plugins[fieldIdPath] = new OpenSearchFieldPlugin({\n unmappedType: field.unmappedType,\n keyword: hasKeyword(field),\n sortable: field.sortable,\n searchable: field.searchable,\n field: fieldId,\n path\n });\n return plugins;\n },\n {\n [\"*\"]: new OpenSearchFieldPlugin({\n field: OpenSearchFieldPlugin.ALL,\n keyword: false\n })\n }\n );\n\n const transformedSort = sort\n .map(value => {\n const matched = matchField(value);\n if (!matched) {\n return null;\n }\n const { fieldId, order, isValues } = matched;\n const key = isValues ? `values.${fieldId}` : fieldId;\n if (fieldIdToStorageIdIdMap[key]) {\n return `${fieldIdToStorageIdIdMap[key]}_${order}`;\n }\n\n return value;\n })\n .filter(Boolean) as string[];\n return createSort({\n fieldPlugins: sortPlugins,\n sort: transformedSort\n });\n};\n"],"names":["matchField","input","valuesMatch","fieldId","order","nonValues","createElasticsearchSort","params","sort","modelFields","valueSearchRegistry","createFieldPath","createFieldPathFactory","fieldIdToStorageIdIdMap","sortPlugins","Object","plugins","field","isValues","fieldIdPath","path","NoValueContainer","OpenSearchFieldPlugin","hasKeyword","transformedSort","value","matched","key","Boolean","createSort"],"mappings":";;;;AAeA,MAAMA,aAAa,CAACC;IAChB,MAAMC,cAAcD,MAAM,KAAK,CAAC;IAChC,IAAIC,aAAa;QACb,MAAM,GAAGC,SAASC,MAAM,GAAGF;QAC3B,OAAO;YACHC;YACA,UAAU;YACV,OAAOC;QACX;IACJ;IACA,MAAMC,YAAYJ,MAAM,KAAK,CAAC;IAC9B,IAAI,CAACI,WACD,OAAO;IAEX,MAAM,GAAGF,SAASC,MAAM,GAAGC;IAC3B,OAAO;QACHF;QACA,UAAU;QACV,OAAOC;IACX;AACJ;AASO,MAAME,0BAA0B,CAACC;IACpC,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,mBAAmB,EAAE,GAAGH;IAEnD,IAAI,CAACC,QAAQA,AAAgB,MAAhBA,KAAK,MAAM,EACpB,OAAO;QACH;YACI,CAAC,aAAa,EAAE;gBACZ,OAAO;YACX;QACJ;KACH;IAGL,MAAMG,kBAAkBC,uBAAuB;QAC3CF;IACJ;IAEA,MAAMG,0BAAkD,CAAC;IAEzD,MAAMC,cAAcC,OAAO,MAAM,CAACN,aAAa,MAAM,CACjD,CAACO,SAASC;QAIN,MAAMC,WAAWD,AAAyB,MAAzBA,MAAM,OAAO,CAAC,MAAM,IAAUA,AAA6B,aAA7BA,MAAM,OAAO,CAAC,EAAE,CAAC,OAAO;QACvE,IAAIA,MAAM,OAAO,CAAC,MAAM,GAAG,KAAK,CAACC,UAC7B,OAAOF;QAGX,MAAMb,UAAUc,MAAM,KAAK,CAAC,OAAO;QACnC,MAAME,cAAcD,WAAW,CAAC,OAAO,EAAEf,SAAS,GAAGA;QAErDU,uBAAuB,CAACM,YAAY,GAAGA;QAEvC,MAAM,EAAEC,IAAI,EAAE,GAAGT,gBAAgB;YAC7B,KAAKM,MAAM,KAAK,CAAC,SAAS;YAC1BA;YACA,OAAOI,iBAAiB,MAAM;YAC9B,SAAS;YACT,eAAeA,iBAAiB,MAAM;QAC1C;QAIAL,OAAO,CAACG,YAAY,GAAG,IAAIG,sBAAsB;YAC7C,cAAcL,MAAM,YAAY;YAChC,SAASM,WAAWN;YACpB,UAAUA,MAAM,QAAQ;YACxB,YAAYA,MAAM,UAAU;YAC5B,OAAOd;YACPiB;QACJ;QACA,OAAOJ;IACX,GACA;QACI,CAAC,IAAI,EAAE,IAAIM,sBAAsB;YAC7B,OAAOA,sBAAsB,GAAG;YAChC,SAAS;QACb;IACJ;IAGJ,MAAME,kBAAkBhB,KACnB,GAAG,CAACiB,CAAAA;QACD,MAAMC,UAAU1B,WAAWyB;QAC3B,IAAI,CAACC,SACD,OAAO;QAEX,MAAM,EAAEvB,OAAO,EAAEC,KAAK,EAAEc,QAAQ,EAAE,GAAGQ;QACrC,MAAMC,MAAMT,WAAW,CAAC,OAAO,EAAEf,SAAS,GAAGA;QAC7C,IAAIU,uBAAuB,CAACc,IAAI,EAC5B,OAAO,GAAGd,uBAAuB,CAACc,IAAI,CAAC,CAAC,EAAEvB,OAAO;QAGrD,OAAOqB;IACX,GACC,MAAM,CAACG;IACZ,OAAOC,WAAW;QACd,cAAcf;QACd,MAAMU;IACV;AACJ"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We use any for input and output because they really can be anything.
|
|
3
|
-
* Plugin, if exists, makes sure that response value is correct.
|
|
4
|
-
*/
|
|
5
1
|
import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
6
|
-
import type {
|
|
2
|
+
import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
7
3
|
interface Params {
|
|
8
|
-
|
|
4
|
+
valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
|
|
9
5
|
field: CmsModelField;
|
|
10
6
|
value: any;
|
|
11
7
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Transformed value can be anything.
|
|
14
|
-
*/
|
|
15
8
|
export declare const transformValueForSearch: (params: Params) => any;
|
|
16
9
|
export {};
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export const transformValueForSearch = params => {
|
|
11
|
-
const {
|
|
12
|
-
field,
|
|
13
|
-
plugins,
|
|
14
|
-
value
|
|
15
|
-
} = params;
|
|
16
|
-
const fieldType = getBaseFieldType(field);
|
|
17
|
-
const plugin = plugins[fieldType];
|
|
18
|
-
if (!plugin) {
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
return plugin.transform({
|
|
22
|
-
field,
|
|
23
|
-
value
|
|
24
|
-
});
|
|
1
|
+
const transformValueForSearch = (params)=>{
|
|
2
|
+
const { field, valueSearchRegistry, value } = params;
|
|
3
|
+
const search = valueSearchRegistry.get(field.type);
|
|
4
|
+
if (!search) return value;
|
|
5
|
+
return search.transform({
|
|
6
|
+
field,
|
|
7
|
+
value
|
|
8
|
+
});
|
|
25
9
|
};
|
|
10
|
+
export { transformValueForSearch };
|
|
26
11
|
|
|
27
12
|
//# sourceMappingURL=transformValueForSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/elasticsearch/transformValueForSearch.js","sources":["../../../../src/operations/entry/elasticsearch/transformValueForSearch.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\n\ninterface Params {\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n field: CmsModelField;\n value: any;\n}\n\nexport const transformValueForSearch = (params: Params): any => {\n const { field, valueSearchRegistry, value } = params;\n const search = valueSearchRegistry.get(field.type);\n if (!search) {\n return value;\n }\n return search.transform({ field, value });\n};\n"],"names":["transformValueForSearch","params","field","valueSearchRegistry","value","search"],"mappings":"AASO,MAAMA,0BAA0B,CAACC;IACpC,MAAM,EAAEC,KAAK,EAAEC,mBAAmB,EAAEC,KAAK,EAAE,GAAGH;IAC9C,MAAMI,SAASF,oBAAoB,GAAG,CAACD,MAAM,IAAI;IACjD,IAAI,CAACG,QACD,OAAOD;IAEX,OAAOC,OAAO,SAAS,CAAC;QAAEH;QAAOE;IAAM;AAC3C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ElasticsearchQueryBuilderOperatorPlugin } from "@webiny/api-elasticsearch";
|
|
1
|
+
import type { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
|
|
3
2
|
import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
4
3
|
/**
|
|
5
4
|
* ./fields
|
|
@@ -29,13 +28,7 @@ export interface ModelFields {
|
|
|
29
28
|
/**
|
|
30
29
|
* ./plugins/operator
|
|
31
30
|
*/
|
|
32
|
-
export interface
|
|
33
|
-
[key: string]:
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* ./plugins/search
|
|
37
|
-
*/
|
|
38
|
-
export interface ElasticsearchQuerySearchValuePlugins {
|
|
39
|
-
[fieldType: string]: CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
|
|
31
|
+
export interface OpenSearchQueryBuilderOperatorPlugins {
|
|
32
|
+
[key: string]: OpenSearchQueryBuilderOperatorPlugin;
|
|
40
33
|
}
|
|
41
34
|
export {};
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
import type { Client } from "@
|
|
1
|
+
import type { Client } from "@webiny/api-opensearch";
|
|
2
|
+
import { type IOpenSearchEntity as IElasticsearchEntity } from "@webiny/api-opensearch";
|
|
2
3
|
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
import { type IElasticsearchEntity } from "@webiny/api-elasticsearch";
|
|
4
4
|
import type { CmsEntryStorageOperations } from "../../types.js";
|
|
5
5
|
import type { IEntryEntity } from "../../definitions/types.js";
|
|
6
|
+
import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
|
|
7
|
+
import { CompressionHandler } from "@webiny/utils/features/compression/abstractions/CompressionHandler.js";
|
|
8
|
+
import type { CmsEntryOpenSearchBodyModifier } from "../../features/CmsEntryOpenSearchBodyModifier/index.js";
|
|
9
|
+
import type { CmsEntryOpenSearchSortModifier } from "../../features/CmsEntryOpenSearchSortModifier/index.js";
|
|
10
|
+
import type { CmsEntryOpenSearchValuesModifier } from "../../features/CmsEntryOpenSearchValuesModifier/index.js";
|
|
11
|
+
import type { CmsEntryOpenSearchQueryModifier } from "../../features/CmsEntryOpenSearchQueryModifier/index.js";
|
|
12
|
+
import type { CmsEntryOpenSearchValueSearchRegistry } from "../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
13
|
+
import type { CmsEntryOpenSearchFullTextSearch } from "../../features/CmsEntryOpenSearchFullTextSearch/index.js";
|
|
14
|
+
import type { CmsEntryOpenSearchFieldIndexRegistry } from "../../features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
15
|
+
import type { CmsEntryOpenSearchFilterRegistry } from "../../features/CmsEntryOpenSearchFilter/index.js";
|
|
6
16
|
export interface CreateEntriesStorageOperationsParams {
|
|
7
17
|
entity: IEntryEntity;
|
|
8
18
|
esEntity: IElasticsearchEntity;
|
|
9
19
|
elasticsearch: Client;
|
|
10
20
|
plugins: PluginsContainer;
|
|
21
|
+
fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
|
|
22
|
+
fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;
|
|
23
|
+
compressionHandler: CompressionHandler.Interface;
|
|
24
|
+
bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[];
|
|
25
|
+
sortModifiers: CmsEntryOpenSearchSortModifier.Interface[];
|
|
26
|
+
queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[];
|
|
27
|
+
valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
|
|
28
|
+
fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[];
|
|
29
|
+
valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[];
|
|
30
|
+
filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface;
|
|
11
31
|
}
|
|
12
32
|
export declare const createEntriesStorageOperations: (params: CreateEntriesStorageOperationsParams) => CmsEntryStorageOperations;
|