@webiny/api-headless-cms-ddb-es 6.4.11 → 6.6.0-alpha.1
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/feature.d.ts +4 -1
- package/feature.js +60 -158
- 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 +77 -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 +76 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +25 -0
- package/operations/entry/DdbEsListEntries.js +91 -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 +2 -2
- 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 +28 -24
- package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
- package/tasks/CreateElasticsearchIndexTask.js +40 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +10 -49
- 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 -107
- 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 -30
- package/operations/entry/elasticsearch/body.js +0 -88
- 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 -13
- 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 -12
- 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 -34
- package/operations/entry/elasticsearch/types.js +0 -0
- package/operations/entry/index.d.ts +0 -34
- package/operations/entry/index.js +0 -1366
- 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/tasks/createIndexTaskPlugin.d.ts +0 -2
- package/tasks/createIndexTaskPlugin.js +0 -42
- package/tasks/createIndexTaskPlugin.js.map +0 -1
- package/values/NoValueContainer.d.ts +0 -5
- package/values/NoValueContainer.js +0 -11
- package/values/NoValueContainer.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { DdbEsGetModel } from "./DdbEsGetModel.js";
|
|
3
|
+
import { DdbEsListModels } from "./DdbEsListModels.js";
|
|
4
|
+
import { DdbEsCreateModel } from "./DdbEsCreateModel.js";
|
|
5
|
+
import { DdbEsUpdateModel } from "./DdbEsUpdateModel.js";
|
|
6
|
+
import { DdbEsDeleteModel } from "./DdbEsDeleteModel.js";
|
|
7
|
+
const DdbEsModelStorageOpsFeature = createFeature({
|
|
8
|
+
name: "cms.ddbEs.modelStorageOps",
|
|
9
|
+
register: (container)=>{
|
|
10
|
+
container.register(DdbEsGetModel);
|
|
11
|
+
container.register(DdbEsListModels);
|
|
12
|
+
container.register(DdbEsCreateModel);
|
|
13
|
+
container.register(DdbEsUpdateModel);
|
|
14
|
+
container.register(DdbEsDeleteModel);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { DdbEsModelStorageOpsFeature };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/feature.js","sources":["../../../src/operations/model/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { DdbEsGetModel } from \"./DdbEsGetModel.js\";\nimport { DdbEsListModels } from \"./DdbEsListModels.js\";\nimport { DdbEsCreateModel } from \"./DdbEsCreateModel.js\";\nimport { DdbEsUpdateModel } from \"./DdbEsUpdateModel.js\";\nimport { DdbEsDeleteModel } from \"./DdbEsDeleteModel.js\";\n\nexport const DdbEsModelStorageOpsFeature = createFeature({\n name: \"cms.ddbEs.modelStorageOps\",\n register: container => {\n container.register(DdbEsGetModel);\n container.register(DdbEsListModels);\n container.register(DdbEsCreateModel);\n container.register(DdbEsUpdateModel);\n container.register(DdbEsDeleteModel);\n }\n});\n"],"names":["DdbEsModelStorageOpsFeature","createFeature","container","DdbEsGetModel","DdbEsListModels","DdbEsCreateModel","DdbEsUpdateModel","DdbEsDeleteModel"],"mappings":";;;;;;AAOO,MAAMA,8BAA8BC,cAAc;IACrD,MAAM;IACN,UAAUC,CAAAA;QACNA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;IACvB;AACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface PartitionKeysParams {
|
|
2
|
+
tenant: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const createPartitionKey: (params: PartitionKeysParams) => string;
|
|
5
|
+
interface SortKeyParams {
|
|
6
|
+
modelId: string;
|
|
7
|
+
}
|
|
8
|
+
interface Keys {
|
|
9
|
+
PK: string;
|
|
10
|
+
SK: string;
|
|
11
|
+
GSI_TENANT: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const createKeys: (params: PartitionKeysParams & SortKeyParams) => Keys;
|
|
14
|
+
export declare const createType: () => string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const createPartitionKey = (params)=>{
|
|
2
|
+
const { tenant } = params;
|
|
3
|
+
return `T#${tenant}#CMS#CM`;
|
|
4
|
+
};
|
|
5
|
+
const createSortKey = (params)=>params.modelId;
|
|
6
|
+
const createKeys = (params)=>{
|
|
7
|
+
if (!params.tenant) throw new Error("Missing tenant when creating model keys!");
|
|
8
|
+
return {
|
|
9
|
+
PK: createPartitionKey(params),
|
|
10
|
+
SK: createSortKey(params),
|
|
11
|
+
GSI_TENANT: params.tenant
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const createType = ()=>"cms.model";
|
|
15
|
+
export { createKeys, createPartitionKey, createType };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/keys.js","sources":["../../../src/operations/model/keys.ts"],"sourcesContent":["interface PartitionKeysParams {\n tenant: string;\n}\n\nexport const createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant } = params;\n return `T#${tenant}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\n\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\n\nexport const createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n if (!params.tenant) {\n throw new Error(\"Missing tenant when creating model keys!\");\n }\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params),\n GSI_TENANT: params.tenant\n };\n};\n\nexport const createType = (): string => {\n return \"cms.model\";\n};\n"],"names":["createPartitionKey","params","tenant","createSortKey","createKeys","Error","createType"],"mappings":"AAIO,MAAMA,qBAAqB,CAACC;IAC/B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO,CAAC,EAAE,EAAEC,OAAO,OAAO,CAAC;AAC/B;AAMA,MAAMC,gBAAgB,CAACF,SACZA,OAAO,OAAO;AASlB,MAAMG,aAAa,CAACH;IACvB,IAAI,CAACA,OAAO,MAAM,EACd,MAAM,IAAII,MAAM;IAEpB,OAAO;QACH,IAAIL,mBAAmBC;QACvB,IAAIE,cAAcF;QAClB,YAAYA,OAAO,MAAM;IAC7B;AACJ;AAEO,MAAMK,aAAa,IACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb-es",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -30,36 +30,40 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@webiny/api": "6.
|
|
34
|
-
"@webiny/api-
|
|
35
|
-
"@webiny/api-headless-cms": "6.
|
|
36
|
-
"@webiny/api-
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/
|
|
40
|
-
"@webiny/
|
|
41
|
-
"@webiny/
|
|
42
|
-
"@webiny/
|
|
43
|
-
"@webiny/
|
|
33
|
+
"@webiny/api": "6.6.0-alpha.1",
|
|
34
|
+
"@webiny/api-headless-cms": "6.6.0-alpha.1",
|
|
35
|
+
"@webiny/api-headless-cms-storage": "6.6.0-alpha.1",
|
|
36
|
+
"@webiny/api-headless-cms-utils-os": "6.6.0-alpha.1",
|
|
37
|
+
"@webiny/api-opensearch": "6.6.0-alpha.1",
|
|
38
|
+
"@webiny/api-opensearch-aws": "6.6.0-alpha.1",
|
|
39
|
+
"@webiny/api-search-index-tasks": "6.6.0-alpha.1",
|
|
40
|
+
"@webiny/db": "6.6.0-alpha.1",
|
|
41
|
+
"@webiny/db-dynamodb": "6.6.0-alpha.1",
|
|
42
|
+
"@webiny/error": "6.6.0-alpha.1",
|
|
43
|
+
"@webiny/feature": "6.6.0-alpha.1",
|
|
44
|
+
"@webiny/plugins": "6.6.0-alpha.1",
|
|
45
|
+
"@webiny/stdlib": "0.0.17",
|
|
46
|
+
"@webiny/utils": "6.6.0-alpha.1",
|
|
44
47
|
"dataloader": "2.2.3",
|
|
45
48
|
"lodash": "4.18.1"
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
48
51
|
"@types/jsonpack": "1.1.6",
|
|
49
|
-
"@webiny/api-core": "6.
|
|
50
|
-
"@webiny/api-
|
|
51
|
-
"@webiny/
|
|
52
|
-
"@webiny/
|
|
53
|
-
"@webiny/
|
|
54
|
-
"@webiny/
|
|
55
|
-
"@webiny/
|
|
56
|
-
"@webiny/
|
|
57
|
-
"@webiny/
|
|
58
|
-
"@webiny/
|
|
52
|
+
"@webiny/api-core": "6.6.0-alpha.1",
|
|
53
|
+
"@webiny/api-core-testing": "6.6.0-alpha.1",
|
|
54
|
+
"@webiny/api-graphql": "6.6.0-alpha.1",
|
|
55
|
+
"@webiny/api-search-index-tasks-ddb-os": "6.6.0-alpha.1",
|
|
56
|
+
"@webiny/api-sync-ddb-to-opensearch": "6.6.0-alpha.1",
|
|
57
|
+
"@webiny/background-tasks": "6.6.0-alpha.1",
|
|
58
|
+
"@webiny/build-tools": "6.6.0-alpha.1",
|
|
59
|
+
"@webiny/di": "1.1.0",
|
|
60
|
+
"@webiny/event-handler-core": "6.6.0-alpha.1",
|
|
61
|
+
"@webiny/handler": "6.6.0-alpha.1",
|
|
62
|
+
"@webiny/wcp": "6.6.0-alpha.1",
|
|
59
63
|
"jest-dynalite": "3.6.1",
|
|
60
64
|
"rimraf": "6.1.3",
|
|
61
|
-
"typescript": "
|
|
62
|
-
"vitest": "4.1.
|
|
65
|
+
"typescript": "7.0.2",
|
|
66
|
+
"vitest": "4.1.11"
|
|
63
67
|
},
|
|
64
68
|
"publishConfig": {
|
|
65
69
|
"access": "public"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TenantIndexFactory } from "@webiny/api-search-index-tasks";
|
|
2
|
+
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
3
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
4
|
+
declare class CreateElasticsearchIndexTaskImpl implements TenantIndexFactory.Interface {
|
|
5
|
+
private readonly indexProvider;
|
|
6
|
+
private listModels;
|
|
7
|
+
constructor(indexProvider: CmsModelOpenSearchIndexProvider.Interface, listModels: ListModelsUseCase.Interface);
|
|
8
|
+
getIndexList(tenant: TenantIndexFactory.Tenant): Promise<TenantIndexFactory.IndexConfig[]>;
|
|
9
|
+
}
|
|
10
|
+
export declare const CreateElasticsearchIndexTask: typeof CreateElasticsearchIndexTaskImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-search-index-tasks/abstractions/TenantIndexFactory").ITenantIndexFactory>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TenantIndexFactory } from "@webiny/api-search-index-tasks";
|
|
2
|
+
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
3
|
+
import { createConfigurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
|
|
4
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
5
|
+
class CreateElasticsearchIndexTaskImpl {
|
|
6
|
+
constructor(indexProvider, listModels){
|
|
7
|
+
this.indexProvider = indexProvider;
|
|
8
|
+
this.listModels = listModels;
|
|
9
|
+
}
|
|
10
|
+
async getIndexList(tenant) {
|
|
11
|
+
const result = await this.listModels.execute();
|
|
12
|
+
const models = result.value;
|
|
13
|
+
if (0 === models.length) return [];
|
|
14
|
+
const configurations = createConfigurations(this.indexProvider);
|
|
15
|
+
const indices = [];
|
|
16
|
+
for (const model of models){
|
|
17
|
+
const { index, settings } = await configurations.es({
|
|
18
|
+
model: {
|
|
19
|
+
...model,
|
|
20
|
+
tenant: tenant.id
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
indices.push({
|
|
24
|
+
index,
|
|
25
|
+
settings
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return indices;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const CreateElasticsearchIndexTask = TenantIndexFactory.createImplementation({
|
|
32
|
+
implementation: CreateElasticsearchIndexTaskImpl,
|
|
33
|
+
dependencies: [
|
|
34
|
+
CmsModelOpenSearchIndexProvider,
|
|
35
|
+
ListModelsUseCase
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
export { CreateElasticsearchIndexTask };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=CreateElasticsearchIndexTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks/CreateElasticsearchIndexTask.js","sources":["../../src/tasks/CreateElasticsearchIndexTask.ts"],"sourcesContent":["import { TenantIndexFactory } from \"@webiny/api-search-index-tasks\";\nimport { ListModelsUseCase } from \"@webiny/api-headless-cms/features/contentModel/ListModels/index.js\";\nimport { createConfigurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { CmsModelOpenSearchIndexProvider } from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\n\nclass CreateElasticsearchIndexTaskImpl implements TenantIndexFactory.Interface {\n constructor(\n private readonly indexProvider: CmsModelOpenSearchIndexProvider.Interface,\n private listModels: ListModelsUseCase.Interface\n ) {}\n\n async getIndexList(\n tenant: TenantIndexFactory.Tenant\n ): Promise<TenantIndexFactory.IndexConfig[]> {\n const result = await this.listModels.execute();\n const models = result.value;\n\n if (models.length === 0) {\n return [];\n }\n\n const configurations = createConfigurations(this.indexProvider);\n\n const indices: TenantIndexFactory.IndexConfig[] = [];\n for (const model of models) {\n const { index, settings } = await configurations.es({\n model: {\n ...model,\n tenant: tenant.id\n }\n });\n indices.push({ index, settings });\n }\n return indices;\n }\n}\n\nexport const CreateElasticsearchIndexTask = TenantIndexFactory.createImplementation({\n implementation: CreateElasticsearchIndexTaskImpl,\n dependencies: [CmsModelOpenSearchIndexProvider, ListModelsUseCase]\n});\n"],"names":["CreateElasticsearchIndexTaskImpl","indexProvider","listModels","tenant","result","models","configurations","createConfigurations","indices","model","index","settings","CreateElasticsearchIndexTask","TenantIndexFactory","CmsModelOpenSearchIndexProvider","ListModelsUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YACqBC,aAAwD,EACjEC,UAAuC,CACjD;aAFmBD,aAAa,GAAbA;aACTC,UAAU,GAAVA;IACT;IAEH,MAAM,aACFC,MAAiC,EACQ;QACzC,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO;QAC5C,MAAMC,SAASD,OAAO,KAAK;QAE3B,IAAIC,AAAkB,MAAlBA,OAAO,MAAM,EACb,OAAO,EAAE;QAGb,MAAMC,iBAAiBC,qBAAqB,IAAI,CAAC,aAAa;QAE9D,MAAMC,UAA4C,EAAE;QACpD,KAAK,MAAMC,SAASJ,OAAQ;YACxB,MAAM,EAAEK,KAAK,EAAEC,QAAQ,EAAE,GAAG,MAAML,eAAe,EAAE,CAAC;gBAChD,OAAO;oBACH,GAAGG,KAAK;oBACR,QAAQN,OAAO,EAAE;gBACrB;YACJ;YACAK,QAAQ,IAAI,CAAC;gBAAEE;gBAAOC;YAAS;QACnC;QACA,OAAOH;IACX;AACJ;AAEO,MAAMI,+BAA+BC,mBAAmB,oBAAoB,CAAC;IAChF,gBAAgBb;IAChB,cAAc;QAACc;QAAiCC;KAAkB;AACtE"}
|
package/types.d.ts
CHANGED
|
@@ -1,61 +1,22 @@
|
|
|
1
|
-
import type { CmsContext
|
|
2
|
-
|
|
3
|
-
import type { Client, IOpenSearchEntity as IElasticsearchEntity, OpenSearchContext } from "@webiny/api-opensearch";
|
|
4
|
-
import type { PluginsContainer } from "@webiny/plugins";
|
|
5
|
-
import type { IEntryEntity, IGroupEntity, IModelEntity } from "./definitions/types.js";
|
|
6
|
-
import type { ITable } from "@webiny/db-dynamodb";
|
|
7
|
-
export interface CmsContext extends BaseCmsContext, OpenSearchContext {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
11
|
-
*
|
|
12
|
-
* @category Elasticsearch
|
|
13
|
-
* @category CmsEntry
|
|
14
|
-
*/
|
|
15
|
-
export interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {
|
|
16
|
-
/**
|
|
17
|
-
* Values that are not going to be indexed.
|
|
18
|
-
*/
|
|
19
|
-
rawValues: Partial<T>;
|
|
20
|
-
/**
|
|
21
|
-
* Dev can add whatever keys they want and need. Just need to be careful not to break the entry.
|
|
22
|
-
*/
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}
|
|
1
|
+
import type { CmsContext, CmsEntryValues, CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
export { CmsContext };
|
|
25
3
|
export declare enum ENTITIES {
|
|
26
4
|
GROUPS = "CmsGroups",
|
|
27
5
|
MODELS = "CmsModels",
|
|
28
6
|
ENTRIES = "CmsEntries",
|
|
29
7
|
ENTRIES_ES = "CmsEntriesElasticsearch"
|
|
30
8
|
}
|
|
31
|
-
export interface StorageOperationsFactoryParams {
|
|
32
|
-
documentClient: DynamoDBDocument;
|
|
33
|
-
elasticsearch: Client;
|
|
34
|
-
table?: string;
|
|
35
|
-
esTable?: string;
|
|
36
|
-
plugins: PluginsContainer;
|
|
37
|
-
container: CmsContext["container"];
|
|
38
|
-
}
|
|
39
|
-
export interface IGetEntitiesResponse {
|
|
40
|
-
groups: IGroupEntity;
|
|
41
|
-
models: IModelEntity;
|
|
42
|
-
entries: IEntryEntity;
|
|
43
|
-
entriesEs: IElasticsearchEntity;
|
|
44
|
-
}
|
|
45
|
-
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {
|
|
46
|
-
getTable: () => ITable;
|
|
47
|
-
getEsTable: () => ITable;
|
|
48
|
-
getEntities: () => IGetEntitiesResponse;
|
|
49
|
-
}
|
|
50
|
-
export interface StorageOperationsFactory {
|
|
51
|
-
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
52
|
-
}
|
|
53
|
-
export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
|
|
54
|
-
dataLoaders: IDataLoadersHandler;
|
|
55
|
-
}
|
|
56
9
|
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
57
10
|
tenant: string;
|
|
58
11
|
}
|
|
12
|
+
export interface DataLoadersHandlerDataLoaderParams {
|
|
13
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
14
|
+
ids: readonly string[];
|
|
15
|
+
}
|
|
59
16
|
export interface IDataLoadersHandler {
|
|
17
|
+
getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
18
|
+
getRevisionById<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
19
|
+
getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
20
|
+
getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
60
21
|
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
61
22
|
}
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsContext
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsContext,\n CmsEntryValues,\n CmsModel,\n CmsStorageEntry\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport { CmsContext };\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n tenant: string;\n}\n\nexport interface DataLoadersHandlerDataLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n ids: readonly string[];\n}\n\nexport interface IDataLoadersHandler {\n getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getRevisionById<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"names":["ENTITIES"],"mappings":"AASO,IAAKA,iBAAQA,WAAAA,GAAAA,SAARA,QAAQ;;;;;WAARA"}
|
package/configurations.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
-
import type { CmsModelOpenSearchIndexProvider, ICmsModelOpenSearchIndexProviderResult } from "./features/CmsModelOpenSearchIndex/index.js";
|
|
3
|
-
export interface CmsElasticsearchParams {
|
|
4
|
-
model: StorageCmsModel;
|
|
5
|
-
}
|
|
6
|
-
export interface Configurations {
|
|
7
|
-
es: (params: CmsElasticsearchParams) => Promise<ICmsModelOpenSearchIndexProviderResult>;
|
|
8
|
-
}
|
|
9
|
-
export declare const createConfigurations: (provider: CmsModelOpenSearchIndexProvider.Interface) => Configurations;
|
|
10
|
-
/**
|
|
11
|
-
* Static configurations using the default index name formula.
|
|
12
|
-
* Used by tests and code that does not need DI-based customization.
|
|
13
|
-
*/
|
|
14
|
-
export declare const configurations: {
|
|
15
|
-
es(params: {
|
|
16
|
-
model: StorageCmsModel;
|
|
17
|
-
}): {
|
|
18
|
-
index: string;
|
|
19
|
-
settings: import("@opensearch-project/opensearch/api/index.js").Indices_Create_RequestBody;
|
|
20
|
-
shared: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
package/configurations.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import error from "@webiny/error";
|
|
2
|
-
import { getBaseConfiguration, getOpenSearchIndexPrefix, isSharedOpenSearchIndex } from "@webiny/api-opensearch";
|
|
3
|
-
const createConfigurations = (provider)=>({
|
|
4
|
-
async es ({ model }) {
|
|
5
|
-
const result = await provider.execute({
|
|
6
|
-
model
|
|
7
|
-
});
|
|
8
|
-
const prefix = getOpenSearchIndexPrefix();
|
|
9
|
-
if (!prefix) return result;
|
|
10
|
-
return {
|
|
11
|
-
...result,
|
|
12
|
-
index: prefix + result.index
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
const configurations = {
|
|
17
|
-
es (params) {
|
|
18
|
-
const { model } = params;
|
|
19
|
-
const { tenant } = model;
|
|
20
|
-
if (!tenant) throw new error('Missing "tenant" parameter when trying to create Elasticsearch index name.', "TENANT_ERROR");
|
|
21
|
-
const shared = isSharedOpenSearchIndex();
|
|
22
|
-
const index = [
|
|
23
|
-
shared ? "root" : tenant,
|
|
24
|
-
"headless-cms",
|
|
25
|
-
model.modelId
|
|
26
|
-
].join("-").toLowerCase();
|
|
27
|
-
const prefix = getOpenSearchIndexPrefix();
|
|
28
|
-
return {
|
|
29
|
-
index: prefix ? prefix + index : index,
|
|
30
|
-
settings: getBaseConfiguration(),
|
|
31
|
-
shared
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
export { configurations, createConfigurations };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=configurations.js.map
|
package/configurations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurations.js","sources":["../src/configurations.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n getBaseConfiguration,\n getOpenSearchIndexPrefix,\n isSharedOpenSearchIndex\n} from \"@webiny/api-opensearch\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type {\n CmsModelOpenSearchIndexProvider,\n ICmsModelOpenSearchIndexProviderResult\n} from \"~/features/CmsModelOpenSearchIndex/index.js\";\n\nexport interface CmsElasticsearchParams {\n model: StorageCmsModel;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => Promise<ICmsModelOpenSearchIndexProviderResult>;\n}\n\nexport const createConfigurations = (\n provider: CmsModelOpenSearchIndexProvider.Interface\n): Configurations => ({\n async es({ model }) {\n const result = await provider.execute({ model });\n\n const prefix = getOpenSearchIndexPrefix();\n\n if (!prefix) {\n return result;\n }\n return {\n ...result,\n index: prefix + result.index\n };\n }\n});\n\n/**\n * Static configurations using the default index name formula.\n * Used by tests and code that does not need DI-based customization.\n */\nexport const configurations = {\n es(params: { model: StorageCmsModel }) {\n const { model } = params;\n const { tenant } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const shared = isSharedOpenSearchIndex();\n const index = [shared ? \"root\" : tenant, \"headless-cms\", model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getOpenSearchIndexPrefix();\n\n return {\n index: prefix ? prefix + index : index,\n settings: getBaseConfiguration(),\n shared\n };\n }\n};\n"],"names":["createConfigurations","provider","model","result","prefix","getOpenSearchIndexPrefix","configurations","params","tenant","WebinyError","shared","isSharedOpenSearchIndex","index","getBaseConfiguration"],"mappings":";;AAoBO,MAAMA,uBAAuB,CAChCC,WACkB;QAClB,MAAM,IAAG,EAAEC,KAAK,EAAE;YACd,MAAMC,SAAS,MAAMF,SAAS,OAAO,CAAC;gBAAEC;YAAM;YAE9C,MAAME,SAASC;YAEf,IAAI,CAACD,QACD,OAAOD;YAEX,OAAO;gBACH,GAAGA,MAAM;gBACT,OAAOC,SAASD,OAAO,KAAK;YAChC;QACJ;IACJ;AAMO,MAAMG,iBAAiB;IAC1B,IAAGC,MAAkC;QACjC,MAAM,EAAEL,KAAK,EAAE,GAAGK;QAClB,MAAM,EAAEC,MAAM,EAAE,GAAGN;QAEnB,IAAI,CAACM,QACD,MAAM,IAAIC,MACN,8EACA;QAIR,MAAMC,SAASC;QACf,MAAMC,QAAQ;YAACF,SAAS,SAASF;YAAQ;YAAgBN,MAAM,OAAO;SAAC,CAClE,IAAI,CAAC,KACL,WAAW;QAEhB,MAAME,SAASC;QAEf,OAAO;YACH,OAAOD,SAASA,SAASQ,QAAQA;YACjC,UAAUC;YACVH;QACJ;IACJ;AACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Client } from "@webiny/api-opensearch";
|
|
2
|
-
import type { StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
3
|
-
import type { Configurations } from "../configurations.js";
|
|
4
|
-
export interface CreateElasticsearchIndexParams {
|
|
5
|
-
client: Client;
|
|
6
|
-
configurations: Configurations;
|
|
7
|
-
model: StorageCmsModel;
|
|
8
|
-
}
|
|
9
|
-
export declare const createElasticsearchIndex: (params: CreateElasticsearchIndexParams) => Promise<void>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import error from "@webiny/error";
|
|
2
|
-
const createElasticsearchIndex = async (params)=>{
|
|
3
|
-
const { client, configurations, model } = params;
|
|
4
|
-
const { index, settings } = await configurations.es({
|
|
5
|
-
model
|
|
6
|
-
});
|
|
7
|
-
try {
|
|
8
|
-
const response = await client.indices.exists({
|
|
9
|
-
index,
|
|
10
|
-
ignore_unavailable: false,
|
|
11
|
-
allow_no_indices: true,
|
|
12
|
-
include_defaults: true,
|
|
13
|
-
flat_settings: false,
|
|
14
|
-
local: false
|
|
15
|
-
});
|
|
16
|
-
if (response.body) return void console.log(`Elasticsearch index "${index}" for the CMS model "${model.name}" already exists.`);
|
|
17
|
-
} catch {
|
|
18
|
-
console.error(`Could not determine if the index "${index}" exists.`);
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
await client.indices.create({
|
|
22
|
-
index,
|
|
23
|
-
body: {
|
|
24
|
-
...settings
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
} catch (ex) {
|
|
28
|
-
console.error(`Could not create Elasticsearch index "${index}" for the CMS model "${model.name}".`);
|
|
29
|
-
console.error(ex);
|
|
30
|
-
throw new error(ex.message || "Could not create OpenSearch index for the CMS entry.", ex.code || "CREATE_OPENSEARCH_INDEX_ERROR", {
|
|
31
|
-
error: {
|
|
32
|
-
...ex,
|
|
33
|
-
message: ex.message,
|
|
34
|
-
code: ex.code,
|
|
35
|
-
data: ex.data
|
|
36
|
-
},
|
|
37
|
-
tenant: model.tenant,
|
|
38
|
-
index,
|
|
39
|
-
body: settings
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
export { createElasticsearchIndex };
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=createElasticsearchIndex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elasticsearch/createElasticsearchIndex.js","sources":["../../src/elasticsearch/createElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@webiny/api-opensearch\";\nimport WebinyError from \"@webiny/error\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { Configurations } from \"~/configurations.js\";\n\nexport interface CreateElasticsearchIndexParams {\n client: Client;\n configurations: Configurations;\n model: StorageCmsModel;\n}\n\nexport const createElasticsearchIndex = async (params: CreateElasticsearchIndexParams) => {\n const { client, configurations, model } = params;\n\n const { index, settings } = await configurations.es({ model });\n\n try {\n const response = await client.indices.exists({\n index,\n ignore_unavailable: false,\n allow_no_indices: true,\n include_defaults: true,\n flat_settings: false,\n local: false\n });\n if (response.body) {\n console.log(\n `Elasticsearch index \"${index}\" for the CMS model \"${model.name}\" already exists.`\n );\n return;\n }\n } catch {\n console.error(`Could not determine if the index \"${index}\" exists.`);\n }\n\n try {\n await client.indices.create({\n index,\n body: {\n ...settings\n }\n });\n } catch (ex) {\n console.error(\n `Could not create Elasticsearch index \"${index}\" for the CMS model \"${model.name}\".`\n );\n console.error(ex);\n throw new WebinyError(\n ex.message || \"Could not create OpenSearch index for the CMS entry.\",\n ex.code || \"CREATE_OPENSEARCH_INDEX_ERROR\",\n {\n error: {\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n },\n tenant: model.tenant,\n index,\n body: settings\n }\n );\n }\n};\n"],"names":["createElasticsearchIndex","params","client","configurations","model","index","settings","response","console","ex","WebinyError"],"mappings":";AAWO,MAAMA,2BAA2B,OAAOC;IAC3C,MAAM,EAAEC,MAAM,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGH;IAE1C,MAAM,EAAEI,KAAK,EAAEC,QAAQ,EAAE,GAAG,MAAMH,eAAe,EAAE,CAAC;QAAEC;IAAM;IAE5D,IAAI;QACA,MAAMG,WAAW,MAAML,OAAO,OAAO,CAAC,MAAM,CAAC;YACzCG;YACA,oBAAoB;YACpB,kBAAkB;YAClB,kBAAkB;YAClB,eAAe;YACf,OAAO;QACX;QACA,IAAIE,SAAS,IAAI,EAAE,YACfC,QAAQ,GAAG,CACP,CAAC,qBAAqB,EAAEH,MAAM,qBAAqB,EAAED,MAAM,IAAI,CAAC,iBAAiB,CAAC;IAI9F,EAAE,OAAM;QACJI,QAAQ,KAAK,CAAC,CAAC,kCAAkC,EAAEH,MAAM,SAAS,CAAC;IACvE;IAEA,IAAI;QACA,MAAMH,OAAO,OAAO,CAAC,MAAM,CAAC;YACxBG;YACA,MAAM;gBACF,GAAGC,QAAQ;YACf;QACJ;IACJ,EAAE,OAAOG,IAAI;QACTD,QAAQ,KAAK,CACT,CAAC,sCAAsC,EAAEH,MAAM,qBAAqB,EAAED,MAAM,IAAI,CAAC,EAAE,CAAC;QAExFI,QAAQ,KAAK,CAACC;QACd,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,wDACdA,GAAG,IAAI,IAAI,iCACX;YACI,OAAO;gBACH,GAAGA,EAAE;gBACL,SAASA,GAAG,OAAO;gBACnB,MAAMA,GAAG,IAAI;gBACb,MAAMA,GAAG,IAAI;YACjB;YACA,QAAQL,MAAM,MAAM;YACpBC;YACA,MAAMC;QACV;IAER;AACJ"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Client } from "@webiny/api-opensearch";
|
|
2
|
-
import type { StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
3
|
-
import type { Configurations } from "../configurations.js";
|
|
4
|
-
interface DeleteElasticsearchIndexParams {
|
|
5
|
-
client: Client;
|
|
6
|
-
configurations: Configurations;
|
|
7
|
-
model: StorageCmsModel;
|
|
8
|
-
}
|
|
9
|
-
export declare const deleteElasticsearchIndex: (params: DeleteElasticsearchIndexParams) => Promise<void>;
|
|
10
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const deleteElasticsearchIndex = async (params)=>{
|
|
2
|
-
const { client, model } = params;
|
|
3
|
-
const { index, shared } = await params.configurations.es({
|
|
4
|
-
model
|
|
5
|
-
});
|
|
6
|
-
if (shared) return;
|
|
7
|
-
const { body: exists } = await client.indices.exists({
|
|
8
|
-
index
|
|
9
|
-
});
|
|
10
|
-
if (!exists) return;
|
|
11
|
-
try {
|
|
12
|
-
await client.indices.delete({
|
|
13
|
-
index,
|
|
14
|
-
ignore_unavailable: true
|
|
15
|
-
});
|
|
16
|
-
} catch (ex) {
|
|
17
|
-
console.log(`Could not delete Elasticsearch index "${index}". Please do it manually.`);
|
|
18
|
-
console.log(ex.message);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export { deleteElasticsearchIndex };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=deleteElasticsearchIndex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elasticsearch/deleteElasticsearchIndex.js","sources":["../../src/elasticsearch/deleteElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@webiny/api-opensearch\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { Configurations } from \"~/configurations.js\";\n\ninterface DeleteElasticsearchIndexParams {\n client: Client;\n configurations: Configurations;\n model: StorageCmsModel;\n}\n\nexport const deleteElasticsearchIndex = async (\n params: DeleteElasticsearchIndexParams\n): Promise<void> => {\n const { client, model } = params;\n\n const { index, shared } = await params.configurations.es({ model });\n\n if (shared) {\n return;\n }\n\n const { body: exists } = await client.indices.exists({\n index\n });\n if (!exists) {\n return;\n }\n\n try {\n await client.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n console.log(`Could not delete Elasticsearch index \"${index}\". Please do it manually.`);\n console.log(ex.message);\n }\n};\n"],"names":["deleteElasticsearchIndex","params","client","model","index","shared","exists","ex","console"],"mappings":"AAUO,MAAMA,2BAA2B,OACpCC;IAEA,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGF;IAE1B,MAAM,EAAEG,KAAK,EAAEC,MAAM,EAAE,GAAG,MAAMJ,OAAO,cAAc,CAAC,EAAE,CAAC;QAAEE;IAAM;IAEjE,IAAIE,QACA;IAGJ,MAAM,EAAE,MAAMC,MAAM,EAAE,GAAG,MAAMJ,OAAO,OAAO,CAAC,MAAM,CAAC;QACjDE;IACJ;IACA,IAAI,CAACE,QACD;IAGJ,IAAI;QACA,MAAMJ,OAAO,OAAO,CAAC,MAAM,CAAC;YACxBE;YACA,oBAAoB;QACxB;IACJ,EAAE,OAAOG,IAAI;QACTC,QAAQ,GAAG,CAAC,CAAC,sCAAsC,EAAEJ,MAAM,yBAAyB,CAAC;QACrFI,QAAQ,GAAG,CAACD,GAAG,OAAO;IAC1B;AACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchFieldIndex } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
2
|
-
export { CmsEntryOpenSearchFilterRegistry, CmsEntryOpenSearchFilter } from "../../../features/CmsEntryOpenSearchFilter/index.js";
|
|
3
|
-
export { CmsEntryOpenSearchBodyModifier } from "../../../features/CmsEntryOpenSearchBodyModifier/index.js";
|
|
4
|
-
export { CmsEntryOpenSearchSortModifier } from "../../../features/CmsEntryOpenSearchSortModifier/index.js";
|
|
5
|
-
export { CmsEntryOpenSearchQueryModifier } from "../../../features/CmsEntryOpenSearchQueryModifier/index.js";
|
|
6
|
-
export { CmsEntryOpenSearchValueSearch, CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
7
|
-
export { CmsEntryOpenSearchFullTextSearch } from "../../../features/CmsEntryOpenSearchFullTextSearch/index.js";
|
|
8
|
-
export { CmsModelOpenSearchIndex } from "../../../features/CmsModelOpenSearchIndex/index.js";
|
|
9
|
-
export { CmsEntryOpenSearchValuesModifier } from "../../../features/CmsEntryOpenSearchValuesModifier/index.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { CmsEntryOpenSearchFieldIndex, CmsEntryOpenSearchFieldIndexRegistry } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
2
|
-
export { CmsEntryOpenSearchFilter, CmsEntryOpenSearchFilterRegistry } from "../../../features/CmsEntryOpenSearchFilter/index.js";
|
|
3
|
-
export { CmsEntryOpenSearchBodyModifier } from "../../../features/CmsEntryOpenSearchBodyModifier/index.js";
|
|
4
|
-
export { CmsEntryOpenSearchSortModifier } from "../../../features/CmsEntryOpenSearchSortModifier/index.js";
|
|
5
|
-
export { CmsEntryOpenSearchQueryModifier } from "../../../features/CmsEntryOpenSearchQueryModifier/index.js";
|
|
6
|
-
export { CmsEntryOpenSearchValueSearch, CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
7
|
-
export { CmsEntryOpenSearchFullTextSearch } from "../../../features/CmsEntryOpenSearchFullTextSearch/index.js";
|
|
8
|
-
export { CmsModelOpenSearchIndex } from "../../../features/CmsModelOpenSearchIndex/index.js";
|
|
9
|
-
export { CmsEntryOpenSearchValuesModifier } from "../../../features/CmsEntryOpenSearchValuesModifier/index.js";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
-
import type { SearchBody } from "@webiny/api-opensearch";
|
|
3
|
-
export interface ModifyBodyParams {
|
|
4
|
-
body: SearchBody;
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
where: Record<string, any>;
|
|
7
|
-
}
|
|
8
|
-
export interface ICmsEntryOpenSearchBodyModifier {
|
|
9
|
-
readonly modelId?: string;
|
|
10
|
-
modifyBody(params: ModifyBodyParams): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const CmsEntryOpenSearchBodyModifier: import("@webiny/di").Abstraction<ICmsEntryOpenSearchBodyModifier>;
|
|
13
|
-
export declare namespace CmsEntryOpenSearchBodyModifier {
|
|
14
|
-
type Interface = ICmsEntryOpenSearchBodyModifier;
|
|
15
|
-
type Params = ModifyBodyParams;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/CmsEntryOpenSearchBodyModifier/abstractions.js","sources":["../../../src/features/CmsEntryOpenSearchBodyModifier/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { SearchBody } from \"@webiny/api-opensearch\";\n\nexport interface ModifyBodyParams {\n body: SearchBody;\n model: CmsModel;\n where: Record<string, any>;\n}\n\nexport interface ICmsEntryOpenSearchBodyModifier {\n readonly modelId?: string;\n modifyBody(params: ModifyBodyParams): void;\n}\n\nexport const CmsEntryOpenSearchBodyModifier = createAbstraction<ICmsEntryOpenSearchBodyModifier>(\n \"Cms/Entry/OpenSearch/BodyModifier\"\n);\n\nexport namespace CmsEntryOpenSearchBodyModifier {\n export type Interface = ICmsEntryOpenSearchBodyModifier;\n export type Params = ModifyBodyParams;\n}\n"],"names":["CmsEntryOpenSearchBodyModifier","createAbstraction"],"mappings":";AAeO,MAAMA,iCAAiCC,kBAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CmsEntryOpenSearchBodyModifier } from "./abstractions.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CmsEntryOpenSearchBodyModifier } from "./abstractions.js";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from "./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js";
|
|
2
|
-
import { CmsEntryOpenSearchFieldIndex } from "./abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
3
|
-
declare class CmsEntryOpenSearchFieldIndexRegistryImpl implements Abstraction.Interface {
|
|
4
|
-
private readonly fieldIndexing;
|
|
5
|
-
private readonly cache;
|
|
6
|
-
constructor(fieldIndexing: CmsEntryOpenSearchFieldIndex.Interface[]);
|
|
7
|
-
get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;
|
|
8
|
-
getDefault(): CmsEntryOpenSearchFieldIndex.Interface;
|
|
9
|
-
getAll(): CmsEntryOpenSearchFieldIndex.Interface[];
|
|
10
|
-
}
|
|
11
|
-
export declare const CmsEntryOpenSearchFieldIndexRegistry: typeof CmsEntryOpenSearchFieldIndexRegistryImpl & {
|
|
12
|
-
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js").ICmsEntryOpenSearchFieldIndexRegistry>;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { CmsEntryOpenSearchFieldIndexRegistry } from "./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js";
|
|
2
|
-
import { CmsEntryOpenSearchFieldIndex } from "./abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
3
|
-
import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
|
|
4
|
-
import { FIELD_INDEXING_DEFAULT } from "./constants.js";
|
|
5
|
-
class CmsEntryOpenSearchFieldIndexRegistryImpl {
|
|
6
|
-
constructor(fieldIndexing){
|
|
7
|
-
this.fieldIndexing = fieldIndexing;
|
|
8
|
-
this.cache = new Map();
|
|
9
|
-
}
|
|
10
|
-
get(fieldType) {
|
|
11
|
-
if (this.cache.has(fieldType)) return this.cache.get(fieldType);
|
|
12
|
-
let indexing = this.fieldIndexing.find((field)=>field.fieldType === fieldType);
|
|
13
|
-
const baseType = getBaseFieldType({
|
|
14
|
-
type: fieldType
|
|
15
|
-
});
|
|
16
|
-
if (!indexing && baseType !== fieldType) indexing = this.fieldIndexing.find((field)=>field.fieldType === baseType);
|
|
17
|
-
this.cache.set(fieldType, indexing);
|
|
18
|
-
return indexing;
|
|
19
|
-
}
|
|
20
|
-
getDefault() {
|
|
21
|
-
const fieldIndex = this.fieldIndexing.find((field)=>field.fieldType === FIELD_INDEXING_DEFAULT);
|
|
22
|
-
if (fieldIndex) return fieldIndex;
|
|
23
|
-
throw new Error(`Missing default field index plugin. Please make sure to register a plugin with "${FIELD_INDEXING_DEFAULT}" field type.`);
|
|
24
|
-
}
|
|
25
|
-
getAll() {
|
|
26
|
-
return this.fieldIndexing;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const CmsEntryOpenSearchFieldIndexRegistry_CmsEntryOpenSearchFieldIndexRegistry = CmsEntryOpenSearchFieldIndexRegistry.createImplementation({
|
|
30
|
-
implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,
|
|
31
|
-
dependencies: [
|
|
32
|
-
[
|
|
33
|
-
CmsEntryOpenSearchFieldIndex,
|
|
34
|
-
{
|
|
35
|
-
multiple: true
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
export { CmsEntryOpenSearchFieldIndexRegistry_CmsEntryOpenSearchFieldIndexRegistry as CmsEntryOpenSearchFieldIndexRegistry };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=CmsEntryOpenSearchFieldIndexRegistry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js","sources":["../../../src/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from \"./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"./abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\nimport { FIELD_INDEXING_DEFAULT } from \"./constants.js\";\n\nclass CmsEntryOpenSearchFieldIndexRegistryImpl implements Abstraction.Interface {\n private readonly cache: Map<string, CmsEntryOpenSearchFieldIndex.Interface | undefined> =\n new Map();\n\n public constructor(private readonly fieldIndexing: CmsEntryOpenSearchFieldIndex.Interface[]) {}\n\n public get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined {\n if (this.cache.has(fieldType)) {\n return this.cache.get(fieldType);\n }\n\n let indexing = this.fieldIndexing.find(field => {\n return field.fieldType === fieldType;\n });\n const baseType = getBaseFieldType({\n type: fieldType\n });\n if (!indexing && baseType !== fieldType) {\n indexing = this.fieldIndexing.find(field => {\n return field.fieldType === baseType;\n });\n }\n this.cache.set(fieldType, indexing);\n return indexing;\n }\n\n public getDefault(): CmsEntryOpenSearchFieldIndex.Interface {\n const fieldIndex = this.fieldIndexing.find(\n field => field.fieldType === FIELD_INDEXING_DEFAULT\n );\n if (fieldIndex) {\n return fieldIndex;\n }\n /**\n * This should never happen, as the default field index plugin exists in our code. This can fail during testing.\n */\n throw new Error(\n `Missing default field index plugin. Please make sure to register a plugin with \"${FIELD_INDEXING_DEFAULT}\" field type.`\n );\n }\n\n public getAll(): CmsEntryOpenSearchFieldIndex.Interface[] {\n return this.fieldIndexing;\n }\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry = Abstraction.createImplementation({\n implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,\n dependencies: [[CmsEntryOpenSearchFieldIndex, { multiple: true }]]\n});\n"],"names":["CmsEntryOpenSearchFieldIndexRegistryImpl","fieldIndexing","Map","fieldType","indexing","field","baseType","getBaseFieldType","fieldIndex","FIELD_INDEXING_DEFAULT","Error","CmsEntryOpenSearchFieldIndexRegistry","Abstraction","CmsEntryOpenSearchFieldIndex"],"mappings":";;;;AAKA,MAAMA;IAIF,YAAoCC,aAAuD,CAAE;aAAzDA,aAAa,GAAbA;aAHnB,KAAK,GAClB,IAAIC;IAEsF;IAEvF,IAAIC,SAAiB,EAAsD;QAC9E,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,YACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA;QAG1B,IAAIC,WAAW,IAAI,CAAC,aAAa,CAAC,IAAI,CAACC,CAAAA,QAC5BA,MAAM,SAAS,KAAKF;QAE/B,MAAMG,WAAWC,iBAAiB;YAC9B,MAAMJ;QACV;QACA,IAAI,CAACC,YAAYE,aAAaH,WAC1BC,WAAW,IAAI,CAAC,aAAa,CAAC,IAAI,CAACC,CAAAA,QACxBA,MAAM,SAAS,KAAKC;QAGnC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACH,WAAWC;QAC1B,OAAOA;IACX;IAEO,aAAqD;QACxD,MAAMI,aAAa,IAAI,CAAC,aAAa,CAAC,IAAI,CACtCH,CAAAA,QAASA,MAAM,SAAS,KAAKI;QAEjC,IAAID,YACA,OAAOA;QAKX,MAAM,IAAIE,MACN,CAAC,gFAAgF,EAAED,uBAAuB,aAAa,CAAC;IAEhI;IAEO,SAAmD;QACtD,OAAO,IAAI,CAAC,aAAa;IAC7B;AACJ;AAEO,MAAME,4EAAuCC,qCAAAA,oBAAgC,CAAC;IACjF,gBAAgBZ;IAChB,cAAc;QAAC;YAACa;YAA8B;gBAAE,UAAU;YAAK;SAAE;KAAC;AACtE"}
|