@webiny/api-headless-cms-ddb-es 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
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/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/feature.d.ts +10 -1
- package/feature.js +48 -180
- package/feature.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- 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/dataLoaders.d.ts +5 -5
- package/operations/entry/dataLoaders.js +11 -3
- package/operations/entry/dataLoaders.js.map +1 -1
- package/{features/CmsModelOpenSearchIndex → operations/entry}/feature.d.ts +1 -1
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.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/index.d.ts +2 -3
- package/operations/entry/transformations/index.js +1 -1
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +1 -1
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- 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/{features/CmsEntryOpenSearchFilter → operations/group}/feature.d.ts +1 -1
- 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/{features/CmsEntryOpenSearchFieldIndex → operations/model}/feature.d.ts +1 -1
- 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 +27 -23
- 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 +6 -7
- package/tasks/CreateElasticsearchIndexTask.js +14 -12
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -1
- package/types.d.ts +9 -45
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -22
- package/configurations.js +0 -37
- package/configurations.js.map +0 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -45
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -10
- package/elasticsearch/deleteElasticsearchIndex.js +0 -23
- package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
- package/exports/api/cms/opensearch.d.ts +0 -9
- package/exports/api/cms/opensearch.js +0 -9
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +0 -16
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -14
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +0 -42
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +0 -32
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +0 -5
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +0 -5
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +0 -4
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +0 -29
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +0 -60
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +0 -13
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +0 -33
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +0 -21
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +0 -22
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +0 -32
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +0 -12
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +0 -116
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +0 -21
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +0 -15
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +0 -40
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +0 -15
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +0 -40
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -3
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +0 -11
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +0 -36
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +0 -37
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +0 -5
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +0 -5
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +0 -1
- package/features/CmsEntryOpenSearchFilter/constants.js +0 -4
- package/features/CmsEntryOpenSearchFilter/constants.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/feature.js +0 -17
- package/features/CmsEntryOpenSearchFilter/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +0 -26
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +0 -43
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +0 -36
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchFilter/index.js +0 -3
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +0 -20
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +0 -16
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -1
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +0 -15
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchSortModifier/index.js +0 -1
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -12
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +0 -31
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +0 -22
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +0 -5
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +0 -5
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +0 -4
- package/features/CmsEntryOpenSearchValueSearch/feature.js +0 -17
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +0 -21
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +0 -44
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +0 -22
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchValueSearch/index.js +0 -3
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +0 -23
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -1
- package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.d.ts +0 -25
- package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js +0 -36
- package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.d.ts +0 -8
- package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js +0 -17
- package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/abstractions.d.ts +0 -20
- package/features/CmsModelOpenSearchIndex/abstractions.js +0 -5
- package/features/CmsModelOpenSearchIndex/abstractions.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/feature.js +0 -13
- package/features/CmsModelOpenSearchIndex/feature.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/index.d.ts +0 -3
- package/features/CmsModelOpenSearchIndex/index.js +0 -3
- package/helpers/entryIndexHelpers.d.ts +0 -20
- package/helpers/entryIndexHelpers.js +0 -80
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/fieldIdentifier.d.ts +0 -6
- package/helpers/fieldIdentifier.js +0 -23
- package/helpers/fieldIdentifier.js.map +0 -1
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -2
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -9
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
- package/operations/entry/elasticsearch/body.d.ts +0 -32
- package/operations/entry/elasticsearch/body.js +0 -89
- package/operations/entry/elasticsearch/body.js.map +0 -1
- package/operations/entry/elasticsearch/fields/createSystemField.d.ts +0 -4
- package/operations/entry/elasticsearch/fields/createSystemField.js +0 -9
- package/operations/entry/elasticsearch/fields/createSystemField.js.map +0 -1
- package/operations/entry/elasticsearch/fields/live.d.ts +0 -2
- package/operations/entry/elasticsearch/fields/live.js +0 -50
- package/operations/entry/elasticsearch/fields/live.js.map +0 -1
- package/operations/entry/elasticsearch/fields/location.d.ts +0 -2
- package/operations/entry/elasticsearch/fields/location.js +0 -50
- package/operations/entry/elasticsearch/fields/location.js.map +0 -1
- package/operations/entry/elasticsearch/fields/state.d.ts +0 -2
- package/operations/entry/elasticsearch/fields/state.js +0 -104
- package/operations/entry/elasticsearch/fields/state.js.map +0 -1
- package/operations/entry/elasticsearch/fields.d.ts +0 -12
- package/operations/entry/elasticsearch/fields.js +0 -207
- package/operations/entry/elasticsearch/fields.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -9
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -39
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -22
- package/operations/entry/elasticsearch/filtering/exec.js +0 -96
- package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/index.js +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -17
- package/operations/entry/elasticsearch/filtering/path.js +0 -27
- package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/populated.js +0 -12
- package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/values.js +0 -15
- package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -13
- package/operations/entry/elasticsearch/fullTextSearch.js +0 -53
- package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -10
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/initialQuery.js +0 -43
- package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
- package/operations/entry/elasticsearch/keyword.d.ts +0 -2
- package/operations/entry/elasticsearch/keyword.js +0 -17
- package/operations/entry/elasticsearch/keyword.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -7
- package/operations/entry/elasticsearch/plugins/operator.js +0 -10
- package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -8
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
- package/operations/entry/elasticsearch/sort.d.ts +0 -15
- package/operations/entry/elasticsearch/sort.js +0 -80
- package/operations/entry/elasticsearch/sort.js.map +0 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js +0 -12
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearch/types.d.ts +0 -31
- package/operations/entry/index.d.ts +0 -38
- package/operations/entry/index.js +0 -1403
- package/operations/entry/index.js.map +0 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
- package/operations/entry/transformations/transformEntryToIndex.js +0 -20
- package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
- package/operations/group/index.d.ts +0 -9
- package/operations/group/index.js +0 -121
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -10
- package/operations/model/index.js +0 -119
- package/operations/model/index.js.map +0 -1
- package/values/NoValueContainer.d.ts +0 -5
- package/values/NoValueContainer.js +0 -11
- package/values/NoValueContainer.js.map +0 -1
- /package/{operations/entry/elasticsearch/types.js → debuggerNamespaces.js} +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getBaseConfiguration, isSharedOpenSearchIndex } from "@webiny/api-opensearch";
|
|
2
|
-
import { CmsModelOpenSearchIndex } from "./abstractions.js";
|
|
3
|
-
class DefaultCmsModelOpenSearchIndexImpl {
|
|
4
|
-
async execute() {
|
|
5
|
-
return {
|
|
6
|
-
settings: getBaseConfiguration(),
|
|
7
|
-
shared: isSharedOpenSearchIndex()
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const DefaultCmsModelOpenSearchIndex = CmsModelOpenSearchIndex.createImplementation({
|
|
12
|
-
implementation: DefaultCmsModelOpenSearchIndexImpl,
|
|
13
|
-
dependencies: []
|
|
14
|
-
});
|
|
15
|
-
export { DefaultCmsModelOpenSearchIndex };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=DefaultCmsModelOpenSearchIndex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js","sources":["../../../src/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.ts"],"sourcesContent":["import { getBaseConfiguration, isSharedOpenSearchIndex } from \"@webiny/api-opensearch\";\nimport { CmsModelOpenSearchIndex } from \"./abstractions.js\";\n\nclass DefaultCmsModelOpenSearchIndexImpl implements CmsModelOpenSearchIndex.Interface {\n public async execute(): Promise<CmsModelOpenSearchIndex.Result> {\n return {\n settings: getBaseConfiguration(),\n shared: isSharedOpenSearchIndex()\n };\n }\n}\n\nexport const DefaultCmsModelOpenSearchIndex = CmsModelOpenSearchIndex.createImplementation({\n implementation: DefaultCmsModelOpenSearchIndexImpl,\n dependencies: []\n});\n"],"names":["DefaultCmsModelOpenSearchIndexImpl","getBaseConfiguration","isSharedOpenSearchIndex","DefaultCmsModelOpenSearchIndex","CmsModelOpenSearchIndex"],"mappings":";;AAGA,MAAMA;IACF,MAAa,UAAmD;QAC5D,OAAO;YACH,UAAUC;YACV,QAAQC;QACZ;IACJ;AACJ;AAEO,MAAMC,iCAAiCC,wBAAwB,oBAAoB,CAAC;IACvF,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { OpenSearchIndexRequestBody } from "@webiny/api-opensearch/types.js";
|
|
2
|
-
import { type StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
3
|
-
export { type StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
-
export interface ICmsModelOpenSearchIndexParams {
|
|
5
|
-
model: StorageCmsModel;
|
|
6
|
-
}
|
|
7
|
-
export interface ICmsModelOpenSearchIndexResult {
|
|
8
|
-
settings: OpenSearchIndexRequestBody;
|
|
9
|
-
shared: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface ICmsModelOpenSearchIndex {
|
|
12
|
-
execute(params: ICmsModelOpenSearchIndexParams): Promise<ICmsModelOpenSearchIndexResult>;
|
|
13
|
-
}
|
|
14
|
-
export declare const CmsModelOpenSearchIndex: import("@webiny/di").Abstraction<ICmsModelOpenSearchIndex>;
|
|
15
|
-
export declare namespace CmsModelOpenSearchIndex {
|
|
16
|
-
type Interface = ICmsModelOpenSearchIndex;
|
|
17
|
-
type Params = ICmsModelOpenSearchIndexParams;
|
|
18
|
-
type Result = ICmsModelOpenSearchIndexResult;
|
|
19
|
-
type Model = StorageCmsModel;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/CmsModelOpenSearchIndex/abstractions.js","sources":["../../../src/features/CmsModelOpenSearchIndex/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api/index.js\";\nimport type { OpenSearchIndexRequestBody } from \"@webiny/api-opensearch/types.js\";\nimport { type StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nexport { type StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface ICmsModelOpenSearchIndexParams {\n model: StorageCmsModel;\n}\n\nexport interface ICmsModelOpenSearchIndexResult {\n settings: OpenSearchIndexRequestBody;\n shared: boolean;\n}\n\nexport interface ICmsModelOpenSearchIndex {\n execute(params: ICmsModelOpenSearchIndexParams): Promise<ICmsModelOpenSearchIndexResult>;\n}\n\nexport const CmsModelOpenSearchIndex = createAbstraction<ICmsModelOpenSearchIndex>(\n \"Cms/Model/OpenSearch/Index\"\n);\n\nexport namespace CmsModelOpenSearchIndex {\n export type Interface = ICmsModelOpenSearchIndex;\n export type Params = ICmsModelOpenSearchIndexParams;\n export type Result = ICmsModelOpenSearchIndexResult;\n export type Model = StorageCmsModel;\n}\n"],"names":["CmsModelOpenSearchIndex","createAbstraction"],"mappings":";AAkBO,MAAMA,0BAA0BC,kBACnC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
-
import { DefaultCmsModelOpenSearchIndex } from "./DefaultCmsModelOpenSearchIndex.js";
|
|
3
|
-
import { DefaultCmsModelOpenSearchIndexProvider } from "./CmsModelOpenSearchIndexProvider.js";
|
|
4
|
-
const CmsModelOpenSearchIndexFeature = createFeature({
|
|
5
|
-
name: "Cms/Model/OpenSearch/IndexFeature",
|
|
6
|
-
register: (container)=>{
|
|
7
|
-
container.register(DefaultCmsModelOpenSearchIndex);
|
|
8
|
-
container.register(DefaultCmsModelOpenSearchIndexProvider).inSingletonScope();
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
export { CmsModelOpenSearchIndexFeature };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/CmsModelOpenSearchIndex/feature.js","sources":["../../../src/features/CmsModelOpenSearchIndex/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { DefaultCmsModelOpenSearchIndex } from \"./DefaultCmsModelOpenSearchIndex.js\";\nimport { DefaultCmsModelOpenSearchIndexProvider } from \"./CmsModelOpenSearchIndexProvider.js\";\n\nexport const CmsModelOpenSearchIndexFeature = createFeature({\n name: \"Cms/Model/OpenSearch/IndexFeature\",\n register: container => {\n container.register(DefaultCmsModelOpenSearchIndex);\n container.register(DefaultCmsModelOpenSearchIndexProvider).inSingletonScope();\n }\n});\n"],"names":["CmsModelOpenSearchIndexFeature","createFeature","container","DefaultCmsModelOpenSearchIndex","DefaultCmsModelOpenSearchIndexProvider"],"mappings":";;;AAIO,MAAMA,iCAAiCC,cAAc;IACxD,MAAM;IACN,UAAUC,CAAAA;QACNA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,wCAAwC,gBAAgB;IAC/E;AACJ"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { CmsModelOpenSearchIndexFeature } from "./feature.js";
|
|
2
|
-
export { CmsModelOpenSearchIndex } from "./abstractions.js";
|
|
3
|
-
export { CmsModelOpenSearchIndexProvider, DefaultCmsModelOpenSearchIndexProvider, type ICmsModelOpenSearchIndexProviderResult } from "./CmsModelOpenSearchIndexProvider.js";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CmsEntry, CmsEntryValues, CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
-
import type { CmsIndexEntry } from "../types.js";
|
|
3
|
-
import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
|
|
4
|
-
import type { CmsEntryOpenSearchFieldIndexRegistry } from "../features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
5
|
-
interface SetupEntriesIndexHelpersParams {
|
|
6
|
-
fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
|
|
7
|
-
fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;
|
|
8
|
-
}
|
|
9
|
-
interface ExtractEntriesFromIndexParams<T extends CmsEntryValues = CmsEntryValues> extends SetupEntriesIndexHelpersParams {
|
|
10
|
-
model: CmsModel;
|
|
11
|
-
entries: CmsIndexEntry<T>[];
|
|
12
|
-
}
|
|
13
|
-
interface PrepareElasticsearchDataParams<T extends CmsEntryValues = CmsEntryValues> extends Omit<SetupEntriesIndexHelpersParams, "fieldRegistry"> {
|
|
14
|
-
model: CmsModel;
|
|
15
|
-
entry: CmsEntry<T>;
|
|
16
|
-
storageEntry: CmsEntry<T>;
|
|
17
|
-
}
|
|
18
|
-
export declare const prepareEntryToIndex: <T extends CmsEntryValues = CmsEntryValues>(params: PrepareElasticsearchDataParams<T>) => CmsIndexEntry<T>;
|
|
19
|
-
export declare const extractEntriesFromIndex: <T extends CmsEntryValues = CmsEntryValues>({ fieldRegistry, fieldIndexRegistry, entries, model }: ExtractEntriesFromIndexParams<T>) => CmsEntry<T>[];
|
|
20
|
-
export {};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import { getFieldIdentifier, getFieldIdentifiers } from "./fieldIdentifier.js";
|
|
3
|
-
const prepareEntryToIndex = (params)=>{
|
|
4
|
-
const { fieldIndexRegistry, storageEntry, entry, model } = params;
|
|
5
|
-
function getFieldIndex(type) {
|
|
6
|
-
const fieldIndexing = fieldIndexRegistry.get(type);
|
|
7
|
-
if (fieldIndexing) return fieldIndexing;
|
|
8
|
-
return fieldIndexRegistry.getDefault();
|
|
9
|
-
}
|
|
10
|
-
const values = {};
|
|
11
|
-
const rawValues = {};
|
|
12
|
-
for (const field of model.fields){
|
|
13
|
-
const identifier = getFieldIdentifier(storageEntry.values, field);
|
|
14
|
-
if (!identifier) continue;
|
|
15
|
-
const fieldIndex = getFieldIndex(field.type);
|
|
16
|
-
const { value, rawValue } = fieldIndex.toIndex({
|
|
17
|
-
model,
|
|
18
|
-
field,
|
|
19
|
-
rawValue: entry.values[identifier],
|
|
20
|
-
value: storageEntry.values[identifier],
|
|
21
|
-
getFieldIndex
|
|
22
|
-
});
|
|
23
|
-
if (void 0 !== value) values[identifier] = value;
|
|
24
|
-
if (void 0 !== rawValue) rawValues[identifier] = rawValue;
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
...storageEntry,
|
|
28
|
-
values,
|
|
29
|
-
rawValues
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
const extractEntriesFromIndex = ({ fieldRegistry, fieldIndexRegistry, entries, model })=>{
|
|
33
|
-
function getFieldIndex(type) {
|
|
34
|
-
const fieldIndex = fieldIndexRegistry.get(type);
|
|
35
|
-
if (fieldIndex) return fieldIndex;
|
|
36
|
-
return fieldIndexRegistry.getDefault();
|
|
37
|
-
}
|
|
38
|
-
const list = [];
|
|
39
|
-
for (const entry of entries){
|
|
40
|
-
const indexValues = {};
|
|
41
|
-
for (const field of model.fields){
|
|
42
|
-
const fieldType = fieldRegistry.get(field.type);
|
|
43
|
-
if (!fieldType) throw new WebinyError(`Missing field type "${field.type}". Extract entries from index.`);
|
|
44
|
-
const fieldIndex = getFieldIndex(field.type);
|
|
45
|
-
const identifiers = getFieldIdentifiers(entry.values, entry.rawValues, field);
|
|
46
|
-
if (identifiers) try {
|
|
47
|
-
const key = identifiers.valueIdentifier;
|
|
48
|
-
const rawKey = identifiers.rawValueIdentifier;
|
|
49
|
-
indexValues[key] = fieldIndex.fromIndex({
|
|
50
|
-
model,
|
|
51
|
-
field,
|
|
52
|
-
getFieldIndex,
|
|
53
|
-
value: entry.values[key || rawKey],
|
|
54
|
-
rawValue: entry.rawValues ? entry.rawValues[rawKey || key] : null
|
|
55
|
-
});
|
|
56
|
-
} catch (ex) {
|
|
57
|
-
throw new WebinyError(ex.message || "Could not transform entry field from index.", ex.code || "FIELD_FROM_INDEX_ERROR", {
|
|
58
|
-
field,
|
|
59
|
-
entry
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const newEntry = {
|
|
64
|
-
...entry,
|
|
65
|
-
values: indexValues
|
|
66
|
-
};
|
|
67
|
-
delete newEntry["rawValues"];
|
|
68
|
-
delete newEntry["TYPE"];
|
|
69
|
-
delete newEntry["__type"];
|
|
70
|
-
delete newEntry["latest"];
|
|
71
|
-
delete newEntry["published"];
|
|
72
|
-
list.push({
|
|
73
|
-
...newEntry
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return list;
|
|
77
|
-
};
|
|
78
|
-
export { extractEntriesFromIndex, prepareEntryToIndex };
|
|
79
|
-
|
|
80
|
-
//# sourceMappingURL=entryIndexHelpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers/entryIndexHelpers.js","sources":["../../src/helpers/entryIndexHelpers.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport type { CmsEntry, CmsEntryValues, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsIndexEntry } from \"~/types.js\";\nimport { getFieldIdentifier, getFieldIdentifiers } from \"~/helpers/fieldIdentifier.js\";\nimport type { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport type {\n CmsEntryOpenSearchFieldIndex,\n CmsEntryOpenSearchFieldIndexRegistry\n} from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\n\ninterface SetupEntriesIndexHelpersParams {\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;\n}\n\ninterface ExtractEntriesFromIndexParams<\n T extends CmsEntryValues = CmsEntryValues\n> extends SetupEntriesIndexHelpersParams {\n model: CmsModel;\n entries: CmsIndexEntry<T>[];\n}\n\ninterface PrepareElasticsearchDataParams<T extends CmsEntryValues = CmsEntryValues> extends Omit<\n SetupEntriesIndexHelpersParams,\n \"fieldRegistry\"\n> {\n model: CmsModel;\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n}\n\nexport const prepareEntryToIndex = <T extends CmsEntryValues = CmsEntryValues>(\n params: PrepareElasticsearchDataParams<T>\n): CmsIndexEntry<T> => {\n const { fieldIndexRegistry, storageEntry, entry, model } = params;\n\n function getFieldIndex(type: string): CmsEntryOpenSearchFieldIndex.Interface {\n const fieldIndexing = fieldIndexRegistry.get(type);\n if (fieldIndexing) {\n return fieldIndexing;\n }\n return fieldIndexRegistry.getDefault();\n }\n\n // These objects will contain values processed by field index implementations\n const values: T = {} as T;\n const rawValues: T = {} as T;\n\n // We're only interested in current model fields.\n for (const field of model.fields) {\n const identifier = getFieldIdentifier(storageEntry.values, field) as keyof T;\n if (!identifier) {\n continue;\n }\n\n const fieldIndex = getFieldIndex(field.type);\n\n const { value, rawValue } = fieldIndex.toIndex({\n model,\n field,\n rawValue: entry.values[identifier],\n value: storageEntry.values[identifier],\n getFieldIndex\n });\n\n if (typeof value !== \"undefined\") {\n values[identifier] = value;\n }\n\n if (typeof rawValue !== \"undefined\") {\n rawValues[identifier] = rawValue;\n }\n }\n return {\n ...storageEntry,\n values,\n rawValues\n };\n};\n\nexport const extractEntriesFromIndex = <T extends CmsEntryValues = CmsEntryValues>({\n fieldRegistry,\n fieldIndexRegistry,\n entries,\n model\n}: ExtractEntriesFromIndexParams<T>): CmsEntry<T>[] => {\n function getFieldIndex(type: string): CmsEntryOpenSearchFieldIndex.Interface {\n const fieldIndex = fieldIndexRegistry.get(type);\n if (fieldIndex) {\n return fieldIndex;\n }\n return fieldIndexRegistry.getDefault();\n }\n\n const list: CmsEntry<T>[] = [];\n\n for (const entry of entries) {\n // This object will contain values processed by field index plugins\n const indexValues: T = {} as T;\n\n // We only consider fields that are present in the model\n for (const field of model.fields) {\n const fieldType = fieldRegistry.get(field.type);\n if (!fieldType) {\n throw new WebinyError(\n `Missing field type \"${field.type}\". Extract entries from index.`\n );\n }\n\n const fieldIndex = getFieldIndex(field.type);\n /**\n * We can safely cast as the code will not continue in case of no identifiers.\n */\n const identifiers = getFieldIdentifiers(entry.values, entry.rawValues, field);\n if (!identifiers) {\n continue;\n }\n try {\n const key = identifiers.valueIdentifier as keyof T;\n const rawKey = identifiers.rawValueIdentifier as keyof T;\n indexValues[key] = fieldIndex.fromIndex({\n model,\n field,\n getFieldIndex,\n value: entry.values[key || rawKey],\n /**\n * Possibly no rawValues so we must check for the existence of the field.\n */\n rawValue: entry.rawValues ? entry.rawValues[rawKey || key] : null\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not transform entry field from index.\",\n ex.code || \"FIELD_FROM_INDEX_ERROR\",\n {\n field,\n entry\n }\n );\n }\n }\n /**\n * Let's have a new entry so we do not modify the original one.\n */\n const newEntry: CmsEntry<T> = {\n ...entry,\n values: indexValues\n };\n /**\n * If we want to remove the rawValues, TYPE, latest, published and __type, we must make them optional or ignore them.\n */\n // @ts-expect-error\n delete newEntry[\"rawValues\"];\n // @ts-expect-error\n delete newEntry[\"TYPE\"];\n // @ts-expect-error\n delete newEntry[\"__type\"];\n // @ts-expect-error\n delete newEntry[\"latest\"];\n // @ts-expect-error\n delete newEntry[\"published\"];\n list.push({\n ...newEntry\n });\n }\n\n return list;\n};\n"],"names":["prepareEntryToIndex","params","fieldIndexRegistry","storageEntry","entry","model","getFieldIndex","type","fieldIndexing","values","rawValues","field","identifier","getFieldIdentifier","fieldIndex","value","rawValue","extractEntriesFromIndex","fieldRegistry","entries","list","indexValues","fieldType","WebinyError","identifiers","getFieldIdentifiers","key","rawKey","ex","newEntry"],"mappings":";;AA+BO,MAAMA,sBAAsB,CAC/BC;IAEA,MAAM,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGJ;IAE3D,SAASK,cAAcC,IAAY;QAC/B,MAAMC,gBAAgBN,mBAAmB,GAAG,CAACK;QAC7C,IAAIC,eACA,OAAOA;QAEX,OAAON,mBAAmB,UAAU;IACxC;IAGA,MAAMO,SAAY,CAAC;IACnB,MAAMC,YAAe,CAAC;IAGtB,KAAK,MAAMC,SAASN,MAAM,MAAM,CAAE;QAC9B,MAAMO,aAAaC,mBAAmBV,aAAa,MAAM,EAAEQ;QAC3D,IAAI,CAACC,YACD;QAGJ,MAAME,aAAaR,cAAcK,MAAM,IAAI;QAE3C,MAAM,EAAEI,KAAK,EAAEC,QAAQ,EAAE,GAAGF,WAAW,OAAO,CAAC;YAC3CT;YACAM;YACA,UAAUP,MAAM,MAAM,CAACQ,WAAW;YAClC,OAAOT,aAAa,MAAM,CAACS,WAAW;YACtCN;QACJ;QAEA,IAAI,AAAiB,WAAVS,OACPN,MAAM,CAACG,WAAW,GAAGG;QAGzB,IAAI,AAAoB,WAAbC,UACPN,SAAS,CAACE,WAAW,GAAGI;IAEhC;IACA,OAAO;QACH,GAAGb,YAAY;QACfM;QACAC;IACJ;AACJ;AAEO,MAAMO,0BAA0B,CAA4C,EAC/EC,aAAa,EACbhB,kBAAkB,EAClBiB,OAAO,EACPd,KAAK,EAC0B;IAC/B,SAASC,cAAcC,IAAY;QAC/B,MAAMO,aAAaZ,mBAAmB,GAAG,CAACK;QAC1C,IAAIO,YACA,OAAOA;QAEX,OAAOZ,mBAAmB,UAAU;IACxC;IAEA,MAAMkB,OAAsB,EAAE;IAE9B,KAAK,MAAMhB,SAASe,QAAS;QAEzB,MAAME,cAAiB,CAAC;QAGxB,KAAK,MAAMV,SAASN,MAAM,MAAM,CAAE;YAC9B,MAAMiB,YAAYJ,cAAc,GAAG,CAACP,MAAM,IAAI;YAC9C,IAAI,CAACW,WACD,MAAM,IAAIC,YACN,CAAC,oBAAoB,EAAEZ,MAAM,IAAI,CAAC,8BAA8B,CAAC;YAIzE,MAAMG,aAAaR,cAAcK,MAAM,IAAI;YAI3C,MAAMa,cAAcC,oBAAoBrB,MAAM,MAAM,EAAEA,MAAM,SAAS,EAAEO;YACvE,IAAKa,aAGL,IAAI;gBACA,MAAME,MAAMF,YAAY,eAAe;gBACvC,MAAMG,SAASH,YAAY,kBAAkB;gBAC7CH,WAAW,CAACK,IAAI,GAAGZ,WAAW,SAAS,CAAC;oBACpCT;oBACAM;oBACAL;oBACA,OAAOF,MAAM,MAAM,CAACsB,OAAOC,OAAO;oBAIlC,UAAUvB,MAAM,SAAS,GAAGA,MAAM,SAAS,CAACuB,UAAUD,IAAI,GAAG;gBACjE;YACJ,EAAE,OAAOE,IAAI;gBACT,MAAM,IAAIL,YACNK,GAAG,OAAO,IAAI,+CACdA,GAAG,IAAI,IAAI,0BACX;oBACIjB;oBACAP;gBACJ;YAER;QACJ;QAIA,MAAMyB,WAAwB;YAC1B,GAAGzB,KAAK;YACR,QAAQiB;QACZ;QAKA,OAAOQ,QAAQ,CAAC,YAAY;QAE5B,OAAOA,QAAQ,CAAC,OAAO;QAEvB,OAAOA,QAAQ,CAAC,SAAS;QAEzB,OAAOA,QAAQ,CAAC,SAAS;QAEzB,OAAOA,QAAQ,CAAC,YAAY;QAC5BT,KAAK,IAAI,CAAC;YACN,GAAGS,QAAQ;QACf;IACJ;IAEA,OAAOT;AACX"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CmsEntryValues, CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
-
export declare const getFieldIdentifier: (values: CmsEntryValues | null | undefined, field: CmsModelField) => string | undefined;
|
|
3
|
-
export declare const getFieldIdentifiers: (values: CmsEntryValues, rawValues: CmsEntryValues | null | undefined, field: CmsModelField) => {
|
|
4
|
-
valueIdentifier: string;
|
|
5
|
-
rawValueIdentifier: string;
|
|
6
|
-
} | null;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const fieldIdentifier_hasOwnProperty = (values = {}, property)=>{
|
|
2
|
-
if (!values) return false;
|
|
3
|
-
if (values.hasOwnProperty) return values.hasOwnProperty(property);
|
|
4
|
-
return void 0 !== values[property];
|
|
5
|
-
};
|
|
6
|
-
const getFieldIdentifier = (values, field)=>{
|
|
7
|
-
if (field.storageId && fieldIdentifier_hasOwnProperty(values, field.storageId)) return field.storageId;
|
|
8
|
-
if (fieldIdentifier_hasOwnProperty(values, field.fieldId)) return field.fieldId;
|
|
9
|
-
};
|
|
10
|
-
const getFieldIdentifiers = (values, rawValues, field)=>{
|
|
11
|
-
let valueIdentifier = getFieldIdentifier(values, field);
|
|
12
|
-
let rawValueIdentifier = getFieldIdentifier(rawValues, field);
|
|
13
|
-
if (!valueIdentifier && !rawValueIdentifier) return null;
|
|
14
|
-
if (!valueIdentifier) valueIdentifier = rawValueIdentifier;
|
|
15
|
-
if (!rawValueIdentifier) rawValueIdentifier = valueIdentifier;
|
|
16
|
-
return {
|
|
17
|
-
valueIdentifier,
|
|
18
|
-
rawValueIdentifier
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export { getFieldIdentifier, getFieldIdentifiers };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=fieldIdentifier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers/fieldIdentifier.js","sources":["../../src/helpers/fieldIdentifier.ts"],"sourcesContent":["import type { CmsEntryValues, CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\n\nconst hasOwnProperty = (\n values: CmsEntryValues | null | undefined = {},\n property: string\n): boolean => {\n if (!values) {\n return false;\n } else if (values.hasOwnProperty) {\n return values.hasOwnProperty(property);\n }\n return values[property] !== undefined;\n};\n\nexport const getFieldIdentifier = (\n values: CmsEntryValues | null | undefined,\n field: CmsModelField\n): string | undefined => {\n if (field.storageId && hasOwnProperty(values, field.storageId)) {\n return field.storageId;\n } else if (hasOwnProperty(values, field.fieldId)) {\n return field.fieldId;\n }\n return undefined;\n};\n\nexport const getFieldIdentifiers = (\n values: CmsEntryValues,\n rawValues: CmsEntryValues | null | undefined,\n field: CmsModelField\n) => {\n let valueIdentifier = getFieldIdentifier(values, field);\n let rawValueIdentifier = getFieldIdentifier(rawValues, field);\n if (!valueIdentifier && !rawValueIdentifier) {\n return null;\n }\n if (!valueIdentifier) {\n valueIdentifier = rawValueIdentifier as string;\n }\n if (!rawValueIdentifier) {\n rawValueIdentifier = valueIdentifier as string;\n }\n return {\n valueIdentifier,\n rawValueIdentifier\n };\n};\n"],"names":["hasOwnProperty","values","property","undefined","getFieldIdentifier","field","getFieldIdentifiers","rawValues","valueIdentifier","rawValueIdentifier"],"mappings":"AAEA,MAAMA,iCAAiB,CACnBC,SAA4C,CAAC,CAAC,EAC9CC;IAEA,IAAI,CAACD,QACD,OAAO;IACJ,IAAIA,OAAO,cAAc,EAC5B,OAAOA,OAAO,cAAc,CAACC;IAEjC,OAAOD,AAAqBE,WAArBF,MAAM,CAACC,SAAS;AAC3B;AAEO,MAAME,qBAAqB,CAC9BH,QACAI;IAEA,IAAIA,MAAM,SAAS,IAAIL,+BAAeC,QAAQI,MAAM,SAAS,GACzD,OAAOA,MAAM,SAAS;IACnB,IAAIL,+BAAeC,QAAQI,MAAM,OAAO,GAC3C,OAAOA,MAAM,OAAO;AAG5B;AAEO,MAAMC,sBAAsB,CAC/BL,QACAM,WACAF;IAEA,IAAIG,kBAAkBJ,mBAAmBH,QAAQI;IACjD,IAAII,qBAAqBL,mBAAmBG,WAAWF;IACvD,IAAI,CAACG,mBAAmB,CAACC,oBACrB,OAAO;IAEX,IAAI,CAACD,iBACDA,kBAAkBC;IAEtB,IAAI,CAACA,oBACDA,qBAAqBD;IAEzB,OAAO;QACHA;QACAC;IACJ;AACJ"}
|
package/helpers/index.d.ts
DELETED
package/helpers/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { QueryDslBoolQuery as BoolQueryConfig } from "@webiny/api-opensearch/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* This function will assign a minimum_should_match for the query if conditions are met:
|
|
4
|
-
* * should is an array
|
|
5
|
-
* * it is not empty
|
|
6
|
-
* * minimum_should_match is not already set
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* By the default we set it to 1 as we want at least one OR condition to produce results.
|
|
10
|
-
*
|
|
11
|
-
* Users can modify minimum_should_match value via the body or query modification plugins.
|
|
12
|
-
*/
|
|
13
|
-
interface Params {
|
|
14
|
-
query: BoolQueryConfig;
|
|
15
|
-
value?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare const assignMinimumShouldMatchToQuery: ({ query, value }: Params) => void;
|
|
18
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const assignMinimumShouldMatchToQuery = ({ query, value = 1 })=>{
|
|
2
|
-
if (!Array.isArray(query.should)) return;
|
|
3
|
-
if (0 === query.should.length) return;
|
|
4
|
-
if (query.minimum_should_match) return;
|
|
5
|
-
query.minimum_should_match = value > 0 ? value : 1;
|
|
6
|
-
};
|
|
7
|
-
export { assignMinimumShouldMatchToQuery };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=assignMinimumShouldMatchToQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js","sources":["../../../../src/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.ts"],"sourcesContent":["import type { QueryDslBoolQuery as BoolQueryConfig } from \"@webiny/api-opensearch/types.js\";\n\n/**\n * This function will assign a minimum_should_match for the query if conditions are met:\n * * should is an array\n * * it is not empty\n * * minimum_should_match is not already set\n *\n *\n * By the default we set it to 1 as we want at least one OR condition to produce results.\n *\n * Users can modify minimum_should_match value via the body or query modification plugins.\n */\ninterface Params {\n query: BoolQueryConfig;\n value?: number;\n}\nexport const assignMinimumShouldMatchToQuery = ({ query, value = 1 }: Params): void => {\n if (!Array.isArray(query.should)) {\n return;\n } else if (query.should.length === 0) {\n return;\n } else if (query.minimum_should_match) {\n return;\n }\n query.minimum_should_match = value > 0 ? value : 1;\n};\n"],"names":["assignMinimumShouldMatchToQuery","query","value","Array"],"mappings":"AAiBO,MAAMA,kCAAkC,CAAC,EAAEC,KAAK,EAAEC,QAAQ,CAAC,EAAU;IACxE,IAAI,CAACC,MAAM,OAAO,CAACF,MAAM,MAAM,GAC3B;IACG,IAAIA,AAAwB,MAAxBA,MAAM,MAAM,CAAC,MAAM,EAC1B;IACG,IAAIA,MAAM,oBAAoB,EACjC;IAEJA,MAAM,oBAAoB,GAAGC,QAAQ,IAAIA,QAAQ;AACrD"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { OpenSearchQueryBuilderOperatorRegistry } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
2
|
-
import type { OpenSearchFieldFactory } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
3
|
-
import type { CmsEntryListParams, CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
-
import type { CmsEntryOpenSearchBodyModifier } from "../../../features/CmsEntryOpenSearchBodyModifier/index.js";
|
|
5
|
-
import type { CmsEntryOpenSearchSortModifier } from "../../../features/CmsEntryOpenSearchSortModifier/index.js";
|
|
6
|
-
import type { CmsEntryOpenSearchQueryModifier } from "../../../features/CmsEntryOpenSearchQueryModifier/index.js";
|
|
7
|
-
import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
8
|
-
import type { CmsEntryOpenSearchFullTextSearch } from "../../../features/CmsEntryOpenSearchFullTextSearch/index.js";
|
|
9
|
-
import type { PrimitiveValue, SearchBody } from "@webiny/api-opensearch/types.js";
|
|
10
|
-
import { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/features/graphql/index.js";
|
|
11
|
-
import { CmsEntryOpenSearchFieldIndexRegistry } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
12
|
-
import type { CmsEntryOpenSearchFilterRegistry } from "../../../features/CmsEntryOpenSearchFilter/index.js";
|
|
13
|
-
interface ICreateElasticsearchBodyParams {
|
|
14
|
-
operatorRegistry: OpenSearchQueryBuilderOperatorRegistry.Interface;
|
|
15
|
-
model: CmsModel;
|
|
16
|
-
shared: boolean;
|
|
17
|
-
fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
|
|
18
|
-
fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;
|
|
19
|
-
bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[];
|
|
20
|
-
sortModifiers: CmsEntryOpenSearchSortModifier.Interface[];
|
|
21
|
-
queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[];
|
|
22
|
-
valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
|
|
23
|
-
fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[];
|
|
24
|
-
filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface;
|
|
25
|
-
fieldFactory: OpenSearchFieldFactory.Interface;
|
|
26
|
-
params: Omit<CmsEntryListParams, "where" | "after"> & {
|
|
27
|
-
where: CmsEntryListWhere;
|
|
28
|
-
after?: PrimitiveValue[];
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export declare const createElasticsearchBody: ({ operatorRegistry, model, shared, params, fieldRegistry, fieldIndexRegistry, bodyModifiers, sortModifiers, queryModifiers, valueSearchRegistry, fullTextSearches, filterRegistry, fieldFactory }: ICreateElasticsearchBodyParams) => SearchBody;
|
|
32
|
-
export {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { createModelFields } from "./fields.js";
|
|
2
|
-
import { createFullTextSearchFields } from "./fullTextSearchFields.js";
|
|
3
|
-
import { createInitialQuery } from "./initialQuery.js";
|
|
4
|
-
import { applyFullTextSearch } from "./fullTextSearch.js";
|
|
5
|
-
import { createElasticsearchSort } from "./sort.js";
|
|
6
|
-
import { createExecFiltering } from "./filtering/index.js";
|
|
7
|
-
import { assignMinimumShouldMatchToQuery } from "./assignMinimumShouldMatchToQuery.js";
|
|
8
|
-
const createElasticsearchBody = ({ operatorRegistry, model, shared, params, fieldRegistry, fieldIndexRegistry, bodyModifiers, sortModifiers, queryModifiers, valueSearchRegistry, fullTextSearches, filterRegistry, fieldFactory })=>{
|
|
9
|
-
const { fields, search: term, where, sort: initialSort, after, limit } = params;
|
|
10
|
-
const modelFields = createModelFields({
|
|
11
|
-
model,
|
|
12
|
-
fieldRegistry,
|
|
13
|
-
fieldIndexRegistry
|
|
14
|
-
});
|
|
15
|
-
const applicableQueryModifiers = queryModifiers.filter((m)=>!m.modelId || m.modelId === model.modelId);
|
|
16
|
-
const applicableSortModifiers = sortModifiers.filter((m)=>!m.modelId || m.modelId === model.modelId);
|
|
17
|
-
const applicableBodyModifiers = bodyModifiers.filter((m)=>!m.modelId || m.modelId === model.modelId);
|
|
18
|
-
const fullTextSearchFields = createFullTextSearchFields({
|
|
19
|
-
fields: modelFields,
|
|
20
|
-
term,
|
|
21
|
-
targets: fields
|
|
22
|
-
});
|
|
23
|
-
const query = createInitialQuery({
|
|
24
|
-
where,
|
|
25
|
-
model,
|
|
26
|
-
shared
|
|
27
|
-
});
|
|
28
|
-
applyFullTextSearch({
|
|
29
|
-
model,
|
|
30
|
-
fullTextSearches,
|
|
31
|
-
query,
|
|
32
|
-
term,
|
|
33
|
-
fields: fullTextSearchFields
|
|
34
|
-
});
|
|
35
|
-
const execFiltering = createExecFiltering({
|
|
36
|
-
model,
|
|
37
|
-
fields: modelFields,
|
|
38
|
-
operatorRegistry,
|
|
39
|
-
valueSearchRegistry,
|
|
40
|
-
filterRegistry
|
|
41
|
-
});
|
|
42
|
-
execFiltering({
|
|
43
|
-
where,
|
|
44
|
-
query
|
|
45
|
-
});
|
|
46
|
-
for (const modifier of applicableQueryModifiers)modifier.modifyQuery({
|
|
47
|
-
query,
|
|
48
|
-
model,
|
|
49
|
-
where
|
|
50
|
-
});
|
|
51
|
-
const sort = createElasticsearchSort({
|
|
52
|
-
sort: initialSort,
|
|
53
|
-
modelFields,
|
|
54
|
-
model,
|
|
55
|
-
valueSearchRegistry,
|
|
56
|
-
fieldFactory
|
|
57
|
-
});
|
|
58
|
-
for (const modifier of applicableSortModifiers)modifier.modifySort({
|
|
59
|
-
sort,
|
|
60
|
-
model
|
|
61
|
-
});
|
|
62
|
-
const boolQuery = {
|
|
63
|
-
must: query.must.length > 0 ? query.must : void 0,
|
|
64
|
-
must_not: query.must_not.length > 0 ? query.must_not : void 0,
|
|
65
|
-
should: query.should.length > 0 ? query.should : void 0,
|
|
66
|
-
filter: query.filter.length > 0 ? query.filter : void 0
|
|
67
|
-
};
|
|
68
|
-
assignMinimumShouldMatchToQuery({
|
|
69
|
-
query: boolQuery
|
|
70
|
-
});
|
|
71
|
-
const body = {
|
|
72
|
-
query: {
|
|
73
|
-
bool: boolQuery
|
|
74
|
-
},
|
|
75
|
-
sort,
|
|
76
|
-
size: (limit || 0) + 1,
|
|
77
|
-
search_after: after,
|
|
78
|
-
track_total_hits: true
|
|
79
|
-
};
|
|
80
|
-
for (const modifier of applicableBodyModifiers)modifier.modifyBody({
|
|
81
|
-
body,
|
|
82
|
-
model,
|
|
83
|
-
where
|
|
84
|
-
});
|
|
85
|
-
return body;
|
|
86
|
-
};
|
|
87
|
-
export { createElasticsearchBody };
|
|
88
|
-
|
|
89
|
-
//# sourceMappingURL=body.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations/entry/elasticsearch/body.js","sources":["../../../../src/operations/entry/elasticsearch/body.ts"],"sourcesContent":["import type { OpenSearchQueryBuilderOperatorRegistry } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport type { OpenSearchFieldFactory } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport type {\n CmsEntryListParams,\n CmsEntryListWhere,\n CmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { createModelFields } from \"./fields.js\";\nimport { createFullTextSearchFields } from \"./fullTextSearchFields.js\";\nimport { createInitialQuery } from \"./initialQuery.js\";\nimport { applyFullTextSearch } from \"./fullTextSearch.js\";\nimport type { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport type { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport type { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport type { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { createElasticsearchSort } from \"./sort.js\";\nimport type {\n PrimitiveValue,\n QueryDslBoolQuery as BoolQueryConfig,\n SearchBody\n} from \"@webiny/api-opensearch/types.js\";\nimport { createExecFiltering } from \"./filtering/index.js\";\nimport { assignMinimumShouldMatchToQuery } from \"./assignMinimumShouldMatchToQuery.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/features/graphql/index.js\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport type { CmsEntryOpenSearchFilterRegistry } from \"~/features/CmsEntryOpenSearchFilter/index.js\";\n\ninterface ICreateElasticsearchBodyParams {\n operatorRegistry: OpenSearchQueryBuilderOperatorRegistry.Interface;\n model: CmsModel;\n shared: boolean;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;\n bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[];\n sortModifiers: CmsEntryOpenSearchSortModifier.Interface[];\n queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[];\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[];\n filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface;\n fieldFactory: OpenSearchFieldFactory.Interface;\n params: Omit<CmsEntryListParams, \"where\" | \"after\"> & {\n where: CmsEntryListWhere;\n after?: PrimitiveValue[];\n };\n}\nexport const createElasticsearchBody = ({\n operatorRegistry,\n model,\n shared,\n params,\n fieldRegistry,\n fieldIndexRegistry,\n bodyModifiers,\n sortModifiers,\n queryModifiers,\n valueSearchRegistry,\n fullTextSearches,\n filterRegistry,\n fieldFactory\n}: ICreateElasticsearchBodyParams): SearchBody => {\n const { fields, search: term, where, sort: initialSort, after, limit } = params;\n /**\n * We need the model fields constructed as a key -> field value, so we do not need to iterate through array when we require some field.\n */\n const modelFields = createModelFields({\n model,\n fieldRegistry,\n fieldIndexRegistry\n });\n\n /**\n * Filter query modifiers applicable to this model.\n */\n const applicableQueryModifiers = queryModifiers.filter(m => {\n return !m.modelId || m.modelId === model.modelId;\n });\n /**\n * Filter sort modifiers applicable to this model.\n */\n const applicableSortModifiers = sortModifiers.filter(\n m => !m.modelId || m.modelId === model.modelId\n );\n /**\n * Filter body modifiers applicable to this model.\n */\n const applicableBodyModifiers = bodyModifiers.filter(m => {\n return !m.modelId || m.modelId === model.modelId;\n });\n /**\n * We need the fields which we can search through via the full text search.\n *\n */\n const fullTextSearchFields = createFullTextSearchFields({\n fields: modelFields,\n term,\n targets: fields\n });\n /**\n * The initial elasticsearch query where we attach some default conditions we always need.\n */\n const query = createInitialQuery({\n where,\n model,\n shared\n });\n /**\n * Apply the full text search, if term is set.\n */\n applyFullTextSearch({\n model,\n fullTextSearches,\n query,\n term,\n fields: fullTextSearchFields\n });\n\n const execFiltering = createExecFiltering({\n model,\n fields: modelFields,\n operatorRegistry,\n valueSearchRegistry,\n filterRegistry\n });\n\n execFiltering({\n where,\n query\n });\n\n for (const modifier of applicableQueryModifiers) {\n modifier.modifyQuery({ query, model, where });\n }\n\n const sort = createElasticsearchSort({\n sort: initialSort,\n modelFields,\n model,\n valueSearchRegistry,\n fieldFactory\n });\n\n for (const modifier of applicableSortModifiers) {\n modifier.modifySort({\n sort,\n model\n });\n }\n\n const boolQuery: BoolQueryConfig = {\n must: query.must.length > 0 ? query.must : undefined,\n must_not: query.must_not.length > 0 ? query.must_not : undefined,\n should: query.should.length > 0 ? query.should : undefined,\n filter: query.filter.length > 0 ? query.filter : undefined\n };\n\n assignMinimumShouldMatchToQuery({\n query: boolQuery\n });\n\n const body: SearchBody = {\n query: {\n bool: boolQuery\n },\n sort,\n size: (limit || 0) + 1,\n search_after: after,\n track_total_hits: true\n };\n\n for (const modifier of applicableBodyModifiers) {\n modifier.modifyBody({\n body,\n model,\n where\n });\n }\n\n return body;\n};\n"],"names":["createElasticsearchBody","operatorRegistry","model","shared","params","fieldRegistry","fieldIndexRegistry","bodyModifiers","sortModifiers","queryModifiers","valueSearchRegistry","fullTextSearches","filterRegistry","fieldFactory","fields","term","where","initialSort","after","limit","modelFields","createModelFields","applicableQueryModifiers","m","applicableSortModifiers","applicableBodyModifiers","fullTextSearchFields","createFullTextSearchFields","query","createInitialQuery","applyFullTextSearch","execFiltering","createExecFiltering","modifier","sort","createElasticsearchSort","boolQuery","undefined","assignMinimumShouldMatchToQuery","body"],"mappings":";;;;;;;AA8CO,MAAMA,0BAA0B,CAAC,EACpCC,gBAAgB,EAChBC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,aAAa,EACbC,kBAAkB,EAClBC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,mBAAmB,EACnBC,gBAAgB,EAChBC,cAAc,EACdC,YAAY,EACiB;IAC7B,MAAM,EAAEC,MAAM,EAAE,QAAQC,IAAI,EAAEC,KAAK,EAAE,MAAMC,WAAW,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGf;IAIzE,MAAMgB,cAAcC,kBAAkB;QAClCnB;QACAG;QACAC;IACJ;IAKA,MAAMgB,2BAA2Bb,eAAe,MAAM,CAACc,CAAAA,IAC5C,CAACA,EAAE,OAAO,IAAIA,EAAE,OAAO,KAAKrB,MAAM,OAAO;IAKpD,MAAMsB,0BAA0BhB,cAAc,MAAM,CAChDe,CAAAA,IAAK,CAACA,EAAE,OAAO,IAAIA,EAAE,OAAO,KAAKrB,MAAM,OAAO;IAKlD,MAAMuB,0BAA0BlB,cAAc,MAAM,CAACgB,CAAAA,IAC1C,CAACA,EAAE,OAAO,IAAIA,EAAE,OAAO,KAAKrB,MAAM,OAAO;IAMpD,MAAMwB,uBAAuBC,2BAA2B;QACpD,QAAQP;QACRL;QACA,SAASD;IACb;IAIA,MAAMc,QAAQC,mBAAmB;QAC7Bb;QACAd;QACAC;IACJ;IAIA2B,oBAAoB;QAChB5B;QACAS;QACAiB;QACAb;QACA,QAAQW;IACZ;IAEA,MAAMK,gBAAgBC,oBAAoB;QACtC9B;QACA,QAAQkB;QACRnB;QACAS;QACAE;IACJ;IAEAmB,cAAc;QACVf;QACAY;IACJ;IAEA,KAAK,MAAMK,YAAYX,yBACnBW,SAAS,WAAW,CAAC;QAAEL;QAAO1B;QAAOc;IAAM;IAG/C,MAAMkB,OAAOC,wBAAwB;QACjC,MAAMlB;QACNG;QACAlB;QACAQ;QACAG;IACJ;IAEA,KAAK,MAAMoB,YAAYT,wBACnBS,SAAS,UAAU,CAAC;QAChBC;QACAhC;IACJ;IAGJ,MAAMkC,YAA6B;QAC/B,MAAMR,MAAM,IAAI,CAAC,MAAM,GAAG,IAAIA,MAAM,IAAI,GAAGS;QAC3C,UAAUT,MAAM,QAAQ,CAAC,MAAM,GAAG,IAAIA,MAAM,QAAQ,GAAGS;QACvD,QAAQT,MAAM,MAAM,CAAC,MAAM,GAAG,IAAIA,MAAM,MAAM,GAAGS;QACjD,QAAQT,MAAM,MAAM,CAAC,MAAM,GAAG,IAAIA,MAAM,MAAM,GAAGS;IACrD;IAEAC,gCAAgC;QAC5B,OAAOF;IACX;IAEA,MAAMG,OAAmB;QACrB,OAAO;YACH,MAAMH;QACV;QACAF;QACA,MAAOf,AAAAA,CAAAA,SAAS,KAAK;QACrB,cAAcD;QACd,kBAAkB;IACtB;IAEA,KAAK,MAAMe,YAAYR,wBACnBQ,SAAS,UAAU,CAAC;QAChBM;QACArC;QACAc;IACJ;IAGJ,OAAOuB;AACX"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
-
type PartialCmsModelField = Partial<CmsModelField> & Pick<CmsModelField, "storageId" | "fieldId" | "type">;
|
|
3
|
-
export declare const createSystemField: (field: PartialCmsModelField) => CmsModelField;
|
|
4
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations/entry/elasticsearch/fields/createSystemField.js","sources":["../../../../../src/operations/entry/elasticsearch/fields/createSystemField.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createModelField } from \"@webiny/api-headless-cms\";\n\ntype PartialCmsModelField = Partial<CmsModelField> &\n Pick<CmsModelField, \"storageId\" | \"fieldId\" | \"type\">;\nexport const createSystemField = (field: PartialCmsModelField): CmsModelField => {\n return createModelField({\n ...field,\n id: field.fieldId,\n label: field.fieldId\n });\n};\n"],"names":["createSystemField","field","createModelField"],"mappings":";AAKO,MAAMA,oBAAoB,CAACC,QACvBC,iBAAiB;QACpB,GAAGD,KAAK;QACR,IAAIA,MAAM,OAAO;QACjB,OAAOA,MAAM,OAAO;IACxB"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createSystemField } from "./createSystemField.js";
|
|
2
|
-
import { createModelField } from "@webiny/api-headless-cms";
|
|
3
|
-
const liveFields = {
|
|
4
|
-
live: {
|
|
5
|
-
type: "object",
|
|
6
|
-
systemField: true,
|
|
7
|
-
searchable: true,
|
|
8
|
-
sortable: false,
|
|
9
|
-
field: createSystemField({
|
|
10
|
-
storageId: "live",
|
|
11
|
-
fieldId: "live",
|
|
12
|
-
type: "object",
|
|
13
|
-
settings: {
|
|
14
|
-
fields: [
|
|
15
|
-
createModelField({
|
|
16
|
-
id: "version",
|
|
17
|
-
fieldId: "version",
|
|
18
|
-
storageId: "version",
|
|
19
|
-
type: "number",
|
|
20
|
-
label: "Version"
|
|
21
|
-
})
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
parents: []
|
|
26
|
-
},
|
|
27
|
-
"live.version": {
|
|
28
|
-
type: "number",
|
|
29
|
-
systemField: true,
|
|
30
|
-
searchable: true,
|
|
31
|
-
sortable: false,
|
|
32
|
-
parents: [
|
|
33
|
-
{
|
|
34
|
-
fieldId: "live",
|
|
35
|
-
type: "object",
|
|
36
|
-
storageId: "live"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
field: createSystemField({
|
|
40
|
-
id: "version",
|
|
41
|
-
fieldId: "version",
|
|
42
|
-
storageId: "version",
|
|
43
|
-
type: "number",
|
|
44
|
-
label: "Version"
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
export { liveFields };
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=live.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations/entry/elasticsearch/fields/live.js","sources":["../../../../../src/operations/entry/elasticsearch/fields/live.ts"],"sourcesContent":["import type { ModelFields } from \"~/operations/entry/elasticsearch/types.js\";\nimport { createSystemField } from \"./createSystemField.js\";\nimport { createModelField } from \"@webiny/api-headless-cms\";\n\nexport const liveFields: ModelFields = {\n live: {\n type: \"object\",\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"live\",\n fieldId: \"live\",\n type: \"object\",\n settings: {\n fields: [\n createModelField({\n id: \"version\",\n fieldId: \"version\",\n storageId: \"version\",\n type: \"number\",\n label: \"Version\"\n })\n ]\n }\n }),\n parents: []\n },\n \"live.version\": {\n type: \"number\",\n systemField: true,\n searchable: true,\n sortable: false,\n parents: [\n {\n fieldId: \"live\",\n type: \"object\",\n storageId: \"live\"\n }\n ],\n field: createSystemField({\n id: \"version\",\n fieldId: \"version\",\n storageId: \"version\",\n type: \"number\",\n label: \"Version\"\n })\n }\n};\n"],"names":["liveFields","createSystemField","createModelField"],"mappings":";;AAIO,MAAMA,aAA0B;IACnC,MAAM;QACF,MAAM;QACN,aAAa;QACb,YAAY;QACZ,UAAU;QACV,OAAOC,kBAAkB;YACrB,WAAW;YACX,SAAS;YACT,MAAM;YACN,UAAU;gBACN,QAAQ;oBACJC,iBAAiB;wBACb,IAAI;wBACJ,SAAS;wBACT,WAAW;wBACX,MAAM;wBACN,OAAO;oBACX;iBACH;YACL;QACJ;QACA,SAAS,EAAE;IACf;IACA,gBAAgB;QACZ,MAAM;QACN,aAAa;QACb,YAAY;QACZ,UAAU;QACV,SAAS;YACL;gBACI,SAAS;gBACT,MAAM;gBACN,WAAW;YACf;SACH;QACD,OAAOD,kBAAkB;YACrB,IAAI;YACJ,SAAS;YACT,WAAW;YACX,MAAM;YACN,OAAO;QACX;IACJ;AACJ"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createSystemField } from "./createSystemField.js";
|
|
2
|
-
import { createModelField } from "@webiny/api-headless-cms";
|
|
3
|
-
const locationFields = {
|
|
4
|
-
wbyAco_location: {
|
|
5
|
-
type: "object",
|
|
6
|
-
systemField: true,
|
|
7
|
-
searchable: true,
|
|
8
|
-
sortable: true,
|
|
9
|
-
field: createSystemField({
|
|
10
|
-
storageId: "location",
|
|
11
|
-
fieldId: "wbyAco_location",
|
|
12
|
-
type: "object",
|
|
13
|
-
settings: {
|
|
14
|
-
fields: [
|
|
15
|
-
createModelField({
|
|
16
|
-
id: "folderId",
|
|
17
|
-
fieldId: "folderId",
|
|
18
|
-
storageId: "folderId",
|
|
19
|
-
type: "text",
|
|
20
|
-
label: "Folder ID"
|
|
21
|
-
})
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
parents: []
|
|
26
|
-
},
|
|
27
|
-
"wbyAco_location.folderId": {
|
|
28
|
-
type: "text",
|
|
29
|
-
systemField: true,
|
|
30
|
-
searchable: true,
|
|
31
|
-
sortable: true,
|
|
32
|
-
field: createSystemField({
|
|
33
|
-
id: "folderId",
|
|
34
|
-
fieldId: "folderId",
|
|
35
|
-
storageId: "folderId",
|
|
36
|
-
type: "text",
|
|
37
|
-
label: "Folder ID"
|
|
38
|
-
}),
|
|
39
|
-
parents: [
|
|
40
|
-
{
|
|
41
|
-
fieldId: "wbyAco_location",
|
|
42
|
-
type: "object",
|
|
43
|
-
storageId: "location"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
export { locationFields };
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=location.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations/entry/elasticsearch/fields/location.js","sources":["../../../../../src/operations/entry/elasticsearch/fields/location.ts"],"sourcesContent":["import type { ModelFields } from \"~/operations/entry/elasticsearch/types.js\";\nimport { createSystemField } from \"./createSystemField.js\";\nimport { createModelField } from \"@webiny/api-headless-cms\";\n\nexport const locationFields: ModelFields = {\n wbyAco_location: {\n type: \"object\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"location\",\n fieldId: \"wbyAco_location\",\n type: \"object\",\n settings: {\n fields: [\n createModelField({\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n })\n ]\n }\n }),\n parents: []\n },\n \"wbyAco_location.folderId\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n }),\n parents: [\n {\n fieldId: \"wbyAco_location\",\n type: \"object\",\n storageId: \"location\"\n }\n ]\n }\n};\n"],"names":["locationFields","createSystemField","createModelField"],"mappings":";;AAIO,MAAMA,iBAA8B;IACvC,iBAAiB;QACb,MAAM;QACN,aAAa;QACb,YAAY;QACZ,UAAU;QACV,OAAOC,kBAAkB;YACrB,WAAW;YACX,SAAS;YACT,MAAM;YACN,UAAU;gBACN,QAAQ;oBACJC,iBAAiB;wBACb,IAAI;wBACJ,SAAS;wBACT,WAAW;wBACX,MAAM;wBACN,OAAO;oBACX;iBACH;YACL;QACJ;QACA,SAAS,EAAE;IACf;IACA,4BAA4B;QACxB,MAAM;QACN,aAAa;QACb,YAAY;QACZ,UAAU;QACV,OAAOD,kBAAkB;YACrB,IAAI;YACJ,SAAS;YACT,WAAW;YACX,MAAM;YACN,OAAO;QACX;QACA,SAAS;YACL;gBACI,SAAS;gBACT,MAAM;gBACN,WAAW;YACf;SACH;IACL;AACJ"}
|