@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsDataLoaders.js","sources":["../../src/abstractions/CmsDdbEsDataLoaders.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IDataLoadersHandler } from \"~/types.js\";\n\nexport const CmsDdbEsDataLoaders = createAbstraction<IDataLoadersHandler>(\"Cms/DdbEs/DataLoaders\");\n\nexport namespace CmsDdbEsDataLoaders {\n export type Interface = IDataLoadersHandler;\n}\n"],"names":["CmsDdbEsDataLoaders","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsEntriesEsEntity.js","sources":["../../src/abstractions/CmsDdbEsEntriesEsEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IOpenSearchEntity } from \"@webiny/api-opensearch-aws\";\n\nexport const CmsDdbEsEntriesEsEntity = createAbstraction<IOpenSearchEntity>(\n \"Cms/DdbEs/EntriesEsEntity\"\n);\n\nexport namespace CmsDdbEsEntriesEsEntity {\n export type Interface = IOpenSearchEntity;\n}\n"],"names":["CmsDdbEsEntriesEsEntity","createAbstraction"],"mappings":";AAGO,MAAMA,0BAA0BC,kBACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsEntryEntity.js","sources":["../../src/abstractions/CmsDdbEsEntryEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsEntryEntity = createAbstraction<IEntryEntity>(\"Cms/DdbEs/EntryEntity\");\n\nexport namespace CmsDdbEsEntryEntity {\n export type Interface = IEntryEntity;\n}\n"],"names":["CmsDdbEsEntryEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsGroupEntity.js","sources":["../../src/abstractions/CmsDdbEsGroupEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsGroupEntity = createAbstraction<IGroupEntity>(\"Cms/DdbEs/GroupEntity\");\n\nexport namespace CmsDdbEsGroupEntity {\n export type Interface = IGroupEntity;\n}\n"],"names":["CmsDdbEsGroupEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsModelEntity.js","sources":["../../src/abstractions/CmsDdbEsModelEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsModelEntity = createAbstraction<IModelEntity>(\"Cms/DdbEs/ModelEntity\");\n\nexport namespace CmsDdbEsModelEntity {\n export type Interface = IModelEntity;\n}\n"],"names":["CmsDdbEsModelEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsOsTable.js","sources":["../../src/abstractions/CmsDdbEsOsTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbEsOsTable = createAbstraction<ITable>(\"Cms/DdbEs/OsTable\");\n\nexport namespace CmsDdbEsOsTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbEsOsTable","createAbstraction"],"mappings":";AAGO,MAAMA,kBAAkBC,kBAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/CmsDdbEsTable.js","sources":["../../src/abstractions/CmsDdbEsTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbEsTable = createAbstraction<ITable>(\"Cms/DdbEs/Table\");\n\nexport namespace CmsDdbEsTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbEsTable","createAbstraction"],"mappings":";AAGO,MAAMA,gBAAgBC,kBAA0B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claims the `cms.` debug namespace prefix.
|
|
3
|
+
*
|
|
4
|
+
* The module specifier has to be exactly this one: augmenting a relative path would silently do
|
|
5
|
+
* nothing.
|
|
6
|
+
*/
|
|
7
|
+
declare module "@webiny/api-core/features/debugger/abstractions.js" {
|
|
8
|
+
interface DebugNamespaces {
|
|
9
|
+
cms: `cms.${string}`;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/feature.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* DynamoDB+OpenSearch CMS storage. Register it once, in the root container. Tables and entities are
|
|
3
|
+
* built once per process; the storage operations are transient, and per-request state (the entry
|
|
4
|
+
* DataLoaders, the filter registries, the OpenSearch field indexes and model index cache) is
|
|
5
|
+
* container scoped, so each request (child) container gets its own.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HeadlessCmsDdbEsFeature: {
|
|
8
|
+
name: string;
|
|
9
|
+
register(container: import("@webiny/di").Container): void;
|
|
10
|
+
};
|
package/feature.js
CHANGED
|
@@ -1,201 +1,69 @@
|
|
|
1
1
|
import { DynamoDBClient, createTable } from "@webiny/db-dynamodb";
|
|
2
|
-
import { StorageOperationsFactory } from "@webiny/api-headless-cms/exports/api/cms/storage.js";
|
|
3
2
|
import { ENTITIES } from "./types.js";
|
|
4
|
-
import { createRegisterExtensionPlugin } from "@webiny/handler";
|
|
5
3
|
import { createFeature } from "@webiny/feature/api/index.js";
|
|
6
|
-
import { CmsEntryOpenSearchValueSearchFeature, CmsEntryOpenSearchValueSearchRegistry } from "./features/CmsEntryOpenSearchValueSearch/index.js";
|
|
7
|
-
import { CmsModelOpenSearchIndexFeature, CmsModelOpenSearchIndexProvider } from "./features/CmsModelOpenSearchIndex/index.js";
|
|
8
|
-
import { createConfigurations } from "./configurations.js";
|
|
9
|
-
import { createModelsStorageOperations } from "./operations/model/index.js";
|
|
10
|
-
import { createEntriesStorageOperations } from "./operations/entry/index.js";
|
|
11
4
|
import { createGroupEntity } from "./definitions/group.js";
|
|
12
5
|
import { createModelEntity } from "./definitions/model.js";
|
|
13
6
|
import { createEntryEntity } from "./definitions/entry.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { CmsEntryOpenSearchSortModifier } from "./features/CmsEntryOpenSearchSortModifier/index.js";
|
|
25
|
-
import { CmsEntryOpenSearchQueryModifier } from "./features/CmsEntryOpenSearchQueryModifier/index.js";
|
|
26
|
-
import { CmsEntryOpenSearchFullTextSearch } from "./features/CmsEntryOpenSearchFullTextSearch/index.js";
|
|
27
|
-
import { CmsEntryOpenSearchValuesModifier } from "./features/CmsEntryOpenSearchValuesModifier/index.js";
|
|
28
|
-
import { CmsEntryOpenSearchFieldIndexFeature, CmsEntryOpenSearchFieldIndexRegistry } from "./features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
29
|
-
import { CmsEntryOpenSearchFilterFeature, CmsEntryOpenSearchFilterRegistry } from "./features/CmsEntryOpenSearchFilter/index.js";
|
|
30
|
-
import { DbRegistry } from "@webiny/db/exports/api/db.js";
|
|
31
|
-
import { OpenSearchClient, OpenSearchFieldFactory, OpenSearchQueryBuilderOperatorRegistry } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
7
|
+
import { createOpenSearchEntity, createOpenSearchTable } from "@webiny/api-opensearch-aws";
|
|
8
|
+
import { FilterUtilFeature } from "@webiny/db-dynamodb/feature/FilterUtil/feature.js";
|
|
9
|
+
import { CmsDdbEsTable } from "./abstractions/CmsDdbEsTable.js";
|
|
10
|
+
import { CmsDdbEsOsTable } from "./abstractions/CmsDdbEsOsTable.js";
|
|
11
|
+
import { CmsDdbEsGroupEntity } from "./abstractions/CmsDdbEsGroupEntity.js";
|
|
12
|
+
import { CmsDdbEsModelEntity } from "./abstractions/CmsDdbEsModelEntity.js";
|
|
13
|
+
import { CmsDdbEsEntryEntity } from "./abstractions/CmsDdbEsEntryEntity.js";
|
|
14
|
+
import { CmsDdbEsEntriesEsEntity } from "./abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
15
|
+
import { CmsEntryOpenSearchUtilsFeature } from "@webiny/api-headless-cms-utils-os";
|
|
16
|
+
import { FilterRegistriesFeature } from "@webiny/api-headless-cms-storage";
|
|
32
17
|
import { CreateElasticsearchIndexTask } from "./tasks/CreateElasticsearchIndexTask.js";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
18
|
+
import { CmsEntitiesDbRegistryDecorator } from "./registry/CmsEntitiesDbRegistryDecorator.js";
|
|
19
|
+
import { DdbEsGroupStorageOpsFeature } from "./operations/group/feature.js";
|
|
20
|
+
import { DdbEsModelStorageOpsFeature } from "./operations/model/feature.js";
|
|
21
|
+
import { DdbEsEntryStorageOpsFeature } from "./operations/entry/feature.js";
|
|
22
|
+
const HeadlessCmsDdbEsFeature = createFeature({
|
|
23
|
+
name: "cms.storageOperations.openSearch",
|
|
24
|
+
register: (container)=>{
|
|
25
|
+
FilterUtilFeature.register(container);
|
|
26
|
+
const db = container.resolve(DynamoDBClient);
|
|
27
|
+
const documentClient = db.client;
|
|
28
|
+
const tableInstance = createTable({
|
|
29
|
+
name: process.env.DB_TABLE,
|
|
30
|
+
documentClient
|
|
31
|
+
});
|
|
32
|
+
const tableElasticsearchInstance = createOpenSearchTable({
|
|
33
|
+
name: process.env.DB_TABLE_OPENSEARCH,
|
|
34
|
+
documentClient
|
|
35
|
+
});
|
|
36
|
+
const groupEntity = createGroupEntity({
|
|
47
37
|
entityName: ENTITIES.GROUPS,
|
|
48
38
|
table: tableInstance
|
|
49
|
-
})
|
|
50
|
-
|
|
39
|
+
});
|
|
40
|
+
const modelEntity = createModelEntity({
|
|
51
41
|
entityName: ENTITIES.MODELS,
|
|
52
42
|
table: tableInstance
|
|
53
|
-
})
|
|
54
|
-
|
|
43
|
+
});
|
|
44
|
+
const entryEntity = createEntryEntity({
|
|
55
45
|
entityName: ENTITIES.ENTRIES,
|
|
56
46
|
table: tableInstance
|
|
57
|
-
})
|
|
58
|
-
|
|
47
|
+
});
|
|
48
|
+
const entriesEsEntity = createOpenSearchEntity({
|
|
59
49
|
entityName: ENTITIES.ENTRIES_ES,
|
|
60
50
|
table: tableElasticsearchInstance
|
|
61
|
-
})
|
|
62
|
-
};
|
|
63
|
-
const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);
|
|
64
|
-
const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);
|
|
65
|
-
const compressionHandler = container.resolve(CompressionHandler);
|
|
66
|
-
const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);
|
|
67
|
-
const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);
|
|
68
|
-
const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);
|
|
69
|
-
const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);
|
|
70
|
-
const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);
|
|
71
|
-
const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);
|
|
72
|
-
const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);
|
|
73
|
-
const operatorRegistry = container.resolve(OpenSearchQueryBuilderOperatorRegistry);
|
|
74
|
-
const fieldFactory = container.resolve(OpenSearchFieldFactory);
|
|
75
|
-
const indexProvider = container.resolve(CmsModelOpenSearchIndexProvider);
|
|
76
|
-
const configurations = createConfigurations(indexProvider);
|
|
77
|
-
container.registerFactory(ModelAfterCreateEventHandler, ()=>({
|
|
78
|
-
async handle (event) {
|
|
79
|
-
const { model } = event.payload;
|
|
80
|
-
await createElasticsearchIndex({
|
|
81
|
-
client: elasticsearch,
|
|
82
|
-
configurations,
|
|
83
|
-
model
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}));
|
|
87
|
-
container.registerFactory(ModelAfterCreateFromEventHandler, ()=>({
|
|
88
|
-
async handle (event) {
|
|
89
|
-
const { model } = event.payload;
|
|
90
|
-
await createElasticsearchIndex({
|
|
91
|
-
client: elasticsearch,
|
|
92
|
-
configurations,
|
|
93
|
-
model
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}));
|
|
97
|
-
container.registerFactory(ModelAfterDeleteEventHandler, ()=>({
|
|
98
|
-
async handle (event) {
|
|
99
|
-
const { model } = event.payload;
|
|
100
|
-
await deleteElasticsearchIndex({
|
|
101
|
-
client: elasticsearch,
|
|
102
|
-
configurations,
|
|
103
|
-
model
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}));
|
|
107
|
-
const entries = createEntriesStorageOperations({
|
|
108
|
-
entity: entities.entries,
|
|
109
|
-
esEntity: entities.entriesEs,
|
|
110
|
-
plugins,
|
|
111
|
-
configurations,
|
|
112
|
-
operatorRegistry,
|
|
113
|
-
elasticsearch,
|
|
114
|
-
fieldRegistry,
|
|
115
|
-
fieldIndexRegistry,
|
|
116
|
-
compressionHandler,
|
|
117
|
-
bodyModifiers,
|
|
118
|
-
sortModifiers,
|
|
119
|
-
queryModifiers,
|
|
120
|
-
valueSearchRegistry,
|
|
121
|
-
fullTextSearches,
|
|
122
|
-
valuesModifiers,
|
|
123
|
-
filterRegistry,
|
|
124
|
-
fieldFactory
|
|
125
|
-
});
|
|
126
|
-
return {
|
|
127
|
-
name: "dynamodb:opensearch",
|
|
128
|
-
beforeInit: async (context)=>{
|
|
129
|
-
const dbRegistry = context.container.resolve(DbRegistry);
|
|
130
|
-
dbRegistry.register({
|
|
131
|
-
item: entities.entries,
|
|
132
|
-
app: "cms",
|
|
133
|
-
tags: [
|
|
134
|
-
"regular",
|
|
135
|
-
entities.entries.name
|
|
136
|
-
]
|
|
137
|
-
});
|
|
138
|
-
dbRegistry.register({
|
|
139
|
-
item: entities.entriesEs,
|
|
140
|
-
app: "cms",
|
|
141
|
-
tags: [
|
|
142
|
-
"es",
|
|
143
|
-
entities.entriesEs.name
|
|
144
|
-
]
|
|
145
|
-
});
|
|
146
|
-
entries.dataLoaders.clearAll();
|
|
147
|
-
},
|
|
148
|
-
getEntities: ()=>entities,
|
|
149
|
-
getTable: ()=>tableInstance,
|
|
150
|
-
getEsTable: ()=>tableElasticsearchInstance,
|
|
151
|
-
groups: createGroupsStorageOperations({
|
|
152
|
-
entity: entities.groups,
|
|
153
|
-
container
|
|
154
|
-
}),
|
|
155
|
-
models: createModelsStorageOperations({
|
|
156
|
-
entity: entities.models,
|
|
157
|
-
elasticsearch,
|
|
158
|
-
configurations
|
|
159
|
-
}),
|
|
160
|
-
entries
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
class OpenSearchStorageOperationsFactoryImpl {
|
|
164
|
-
constructor(openSearchClient){
|
|
165
|
-
this.openSearchClient = openSearchClient;
|
|
166
|
-
}
|
|
167
|
-
async create(context) {
|
|
168
|
-
return createOpenSearchStorageOperations({
|
|
169
|
-
elasticsearch: this.openSearchClient.use(),
|
|
170
|
-
plugins: context.plugins,
|
|
171
|
-
container: context.container
|
|
172
51
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const storageOperationsFeature = createFeature({
|
|
182
|
-
name: "cms.storageOperations.openSearch",
|
|
183
|
-
register: (container)=>{
|
|
184
|
-
CmsEntryOpenSearchFieldIndexFeature.register(container);
|
|
185
|
-
CmsEntryOpenSearchFilterFeature.register(container);
|
|
186
|
-
CmsModelOpenSearchIndexFeature.register(container);
|
|
187
|
-
CmsEntryOpenSearchValueSearchFeature.register(container);
|
|
52
|
+
container.registerInstance(CmsDdbEsTable, tableInstance);
|
|
53
|
+
container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);
|
|
54
|
+
container.registerInstance(CmsDdbEsGroupEntity, groupEntity);
|
|
55
|
+
container.registerInstance(CmsDdbEsModelEntity, modelEntity);
|
|
56
|
+
container.registerInstance(CmsDdbEsEntryEntity, entryEntity);
|
|
57
|
+
container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);
|
|
58
|
+
CmsEntryOpenSearchUtilsFeature.register(container);
|
|
59
|
+
FilterRegistriesFeature.register(container);
|
|
188
60
|
container.register(CreateElasticsearchIndexTask);
|
|
189
|
-
container.
|
|
61
|
+
container.registerDecorator(CmsEntitiesDbRegistryDecorator);
|
|
62
|
+
DdbEsGroupStorageOpsFeature.register(container);
|
|
63
|
+
DdbEsModelStorageOpsFeature.register(container);
|
|
64
|
+
DdbEsEntryStorageOpsFeature.register(container);
|
|
190
65
|
}
|
|
191
66
|
});
|
|
192
|
-
|
|
193
|
-
const plugin = createRegisterExtensionPlugin((context)=>storageOperationsFeature.register(context.container));
|
|
194
|
-
plugin.name = "cms.registerOpenSearchStorageOperations";
|
|
195
|
-
return [
|
|
196
|
-
plugin
|
|
197
|
-
];
|
|
198
|
-
};
|
|
199
|
-
export { registerCmsOpenSearchStorageOperations };
|
|
67
|
+
export { HeadlessCmsDdbEsFeature };
|
|
200
68
|
|
|
201
69
|
//# sourceMappingURL=feature.js.map
|
package/feature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, DynamoDBClient } from \"@webiny/db-dynamodb\";\nimport { StorageOperationsFactory as StorageOperationsFactoryAbstraction } from \"@webiny/api-headless-cms/exports/api/cms/storage.js\";\nimport type { CmsContext, StorageOperationsFactory as IStorageOperationsFactory } from \"~/types.js\";\nimport { ENTITIES } from \"~/types.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport {\n CmsEntryOpenSearchValueSearchFeature,\n CmsEntryOpenSearchValueSearchRegistry\n} from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport {\n CmsModelOpenSearchIndexFeature,\n CmsModelOpenSearchIndexProvider\n} from \"~/features/CmsModelOpenSearchIndex/index.js\";\nimport { createConfigurations } from \"~/configurations.js\";\nimport { createModelsStorageOperations } from \"./operations/model/index.js\";\nimport { createEntriesStorageOperations } from \"./operations/entry/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createElasticsearchIndex } from \"~/elasticsearch/createElasticsearchIndex.js\";\nimport { createGroupsStorageOperations } from \"~/operations/group/index.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch\";\nimport { deleteElasticsearchIndex } from \"./elasticsearch/deleteElasticsearchIndex.js\";\nimport { ModelAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModel/index.js\";\nimport { ModelAfterCreateFromEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModelFrom/events.js\";\nimport { ModelAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentModel/DeleteModel/events.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\nimport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { CmsEntryOpenSearchValuesModifier } from \"~/features/CmsEntryOpenSearchValuesModifier/index.js\";\nimport {\n CmsEntryOpenSearchFieldIndexFeature,\n CmsEntryOpenSearchFieldIndexRegistry\n} from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport {\n CmsEntryOpenSearchFilterFeature,\n CmsEntryOpenSearchFilterRegistry\n} from \"~/features/CmsEntryOpenSearchFilter/index.js\";\nimport { DbRegistry } from \"@webiny/db/exports/api/db.js\";\nimport {\n OpenSearchClient,\n OpenSearchFieldFactory,\n OpenSearchQueryBuilderOperatorRegistry\n} from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport { CreateElasticsearchIndexTask } from \"~/tasks/CreateElasticsearchIndexTask.js\";\n\nconst createOpenSearchStorageOperations: IStorageOperationsFactory = params => {\n const { table, esTable, elasticsearch, plugins, container } = params;\n\n const db = container.resolve(DynamoDBClient);\n const documentClient = db.client;\n\n const tableInstance = createTable({\n name: table || (process.env.DB_TABLE as string),\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: esTable,\n documentClient\n });\n\n const entities = {\n groups: createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n }),\n models: createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n }),\n entries: createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n }),\n entriesEs: createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n })\n };\n\n const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);\n const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);\n const compressionHandler = container.resolve(CompressionHandler);\n const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);\n const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);\n const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);\n const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);\n const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);\n const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);\n const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);\n const operatorRegistry = container.resolve(OpenSearchQueryBuilderOperatorRegistry);\n const fieldFactory = container.resolve(OpenSearchFieldFactory);\n\n const indexProvider = container.resolve(CmsModelOpenSearchIndexProvider);\n const configurations = createConfigurations(indexProvider);\n\n container.registerFactory(ModelAfterCreateEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n configurations,\n model\n });\n }\n }));\n\n container.registerFactory(ModelAfterCreateFromEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n configurations,\n model\n });\n }\n }));\n\n container.registerFactory(ModelAfterDeleteEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await deleteElasticsearchIndex({\n client: elasticsearch,\n configurations,\n model\n });\n }\n }));\n\n const entries = createEntriesStorageOperations({\n entity: entities.entries,\n esEntity: entities.entriesEs,\n plugins,\n configurations,\n operatorRegistry,\n elasticsearch,\n fieldRegistry,\n fieldIndexRegistry,\n compressionHandler,\n bodyModifiers,\n sortModifiers,\n queryModifiers,\n valueSearchRegistry,\n fullTextSearches,\n valuesModifiers,\n filterRegistry,\n fieldFactory\n });\n\n return {\n name: \"dynamodb:opensearch\",\n beforeInit: async context => {\n const dbRegistry = context.container.resolve(DbRegistry);\n\n dbRegistry.register({\n item: entities.entries,\n app: \"cms\",\n tags: [\"regular\", entities.entries.name]\n });\n dbRegistry.register({\n item: entities.entriesEs,\n app: \"cms\",\n tags: [\"es\", entities.entriesEs.name]\n });\n\n entries.dataLoaders.clearAll();\n },\n getEntities: () => entities,\n getTable: () => tableInstance,\n getEsTable: () => tableElasticsearchInstance,\n groups: createGroupsStorageOperations({\n entity: entities.groups,\n container\n }),\n models: createModelsStorageOperations({\n entity: entities.models,\n elasticsearch,\n configurations\n }),\n entries\n };\n};\n\nclass OpenSearchStorageOperationsFactoryImpl\n implements StorageOperationsFactoryAbstraction.Interface\n{\n public constructor(private readonly openSearchClient: OpenSearchClient.Interface) {}\n\n public async create(context: CmsContext) {\n return createOpenSearchStorageOperations({\n elasticsearch: this.openSearchClient.use(),\n plugins: context.plugins,\n container: context.container\n });\n }\n}\n\nconst OpenSearchStorageOperationsFactory = StorageOperationsFactoryAbstraction.createImplementation(\n {\n implementation: OpenSearchStorageOperationsFactoryImpl,\n dependencies: [OpenSearchClient]\n }\n);\n\nconst storageOperationsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n CmsEntryOpenSearchFieldIndexFeature.register(container);\n CmsEntryOpenSearchFilterFeature.register(container);\n CmsModelOpenSearchIndexFeature.register(container);\n CmsEntryOpenSearchValueSearchFeature.register(container);\n container.register(CreateElasticsearchIndexTask);\n container.register(OpenSearchStorageOperationsFactory).inSingletonScope();\n }\n});\n\nexport const registerCmsOpenSearchStorageOperations = () => {\n const plugin = createRegisterExtensionPlugin(context => {\n return storageOperationsFeature.register(context.container);\n });\n\n plugin.name = \"cms.registerOpenSearchStorageOperations\";\n\n return [plugin];\n};\n"],"names":["createOpenSearchStorageOperations","params","table","esTable","elasticsearch","plugins","container","db","DynamoDBClient","documentClient","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","entities","createGroupEntity","ENTITIES","createModelEntity","createEntryEntity","createOpenSearchEntity","fieldRegistry","CmsModelFieldToGraphQLRegistry","fieldIndexRegistry","CmsEntryOpenSearchFieldIndexRegistry","compressionHandler","CompressionHandler","bodyModifiers","CmsEntryOpenSearchBodyModifier","sortModifiers","CmsEntryOpenSearchSortModifier","queryModifiers","CmsEntryOpenSearchQueryModifier","valueSearchRegistry","CmsEntryOpenSearchValueSearchRegistry","fullTextSearches","CmsEntryOpenSearchFullTextSearch","valuesModifiers","CmsEntryOpenSearchValuesModifier","filterRegistry","CmsEntryOpenSearchFilterRegistry","operatorRegistry","OpenSearchQueryBuilderOperatorRegistry","fieldFactory","OpenSearchFieldFactory","indexProvider","CmsModelOpenSearchIndexProvider","configurations","createConfigurations","ModelAfterCreateEventHandler","event","model","createElasticsearchIndex","ModelAfterCreateFromEventHandler","ModelAfterDeleteEventHandler","deleteElasticsearchIndex","entries","createEntriesStorageOperations","context","dbRegistry","DbRegistry","createGroupsStorageOperations","createModelsStorageOperations","OpenSearchStorageOperationsFactoryImpl","openSearchClient","OpenSearchStorageOperationsFactory","StorageOperationsFactoryAbstraction","OpenSearchClient","storageOperationsFeature","createFeature","CmsEntryOpenSearchFieldIndexFeature","CmsEntryOpenSearchFilterFeature","CmsModelOpenSearchIndexFeature","CmsEntryOpenSearchValueSearchFeature","CreateElasticsearchIndexTask","registerCmsOpenSearchStorageOperations","plugin","createRegisterExtensionPlugin"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, DynamoDBClient } from \"@webiny/db-dynamodb\";\nimport { ENTITIES } from \"~/types.js\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch-aws\";\nimport { FilterUtilFeature } from \"@webiny/db-dynamodb/feature/FilterUtil/feature.js\";\nimport { CmsDdbEsTable } from \"~/abstractions/CmsDdbEsTable.js\";\nimport { CmsDdbEsOsTable } from \"~/abstractions/CmsDdbEsOsTable.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\nimport { CmsEntryOpenSearchUtilsFeature } from \"@webiny/api-headless-cms-utils-os\";\nimport { FilterRegistriesFeature } from \"@webiny/api-headless-cms-storage\";\nimport { CreateElasticsearchIndexTask } from \"~/tasks/CreateElasticsearchIndexTask.js\";\nimport { CmsEntitiesDbRegistryDecorator } from \"~/registry/CmsEntitiesDbRegistryDecorator.js\";\nimport { DdbEsGroupStorageOpsFeature } from \"~/operations/group/feature.js\";\nimport { DdbEsModelStorageOpsFeature } from \"~/operations/model/feature.js\";\nimport { DdbEsEntryStorageOpsFeature } from \"~/operations/entry/feature.js\";\n\n/**\n * DynamoDB+OpenSearch CMS storage. Register it once, in the root container. Tables and entities are\n * built once per process; the storage operations are transient, and per-request state (the entry\n * DataLoaders, the filter registries, the OpenSearch field indexes and model index cache) is\n * container scoped, so each request (child) container gets its own.\n */\nexport const HeadlessCmsDdbEsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n FilterUtilFeature.register(container);\n\n const db = container.resolve(DynamoDBClient);\n const documentClient = db.client;\n\n const tableInstance = createTable({\n name: process.env.DB_TABLE as string,\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: process.env.DB_TABLE_OPENSEARCH as string,\n documentClient\n });\n\n const groupEntity = createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n });\n const modelEntity = createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n });\n const entryEntity = createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n });\n const entriesEsEntity = createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n });\n\n // Register infrastructure instances (app-scoped)\n container.registerInstance(CmsDdbEsTable, tableInstance);\n container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);\n container.registerInstance(CmsDdbEsGroupEntity, groupEntity);\n container.registerInstance(CmsDdbEsModelEntity, modelEntity);\n container.registerInstance(CmsDdbEsEntryEntity, entryEntity);\n container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);\n\n CmsEntryOpenSearchUtilsFeature.register(container);\n FilterRegistriesFeature.register(container);\n\n container.register(CreateElasticsearchIndexTask);\n\n // Adds the CMS entities to every request's DbRegistry, for the DDB to OpenSearch sync.\n container.registerDecorator(CmsEntitiesDbRegistryDecorator);\n\n DdbEsGroupStorageOpsFeature.register(container);\n DdbEsModelStorageOpsFeature.register(container);\n DdbEsEntryStorageOpsFeature.register(container);\n }\n});\n"],"names":["HeadlessCmsDdbEsFeature","createFeature","container","FilterUtilFeature","db","DynamoDBClient","documentClient","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","groupEntity","createGroupEntity","ENTITIES","modelEntity","createModelEntity","entryEntity","createEntryEntity","entriesEsEntity","createOpenSearchEntity","CmsDdbEsTable","CmsDdbEsOsTable","CmsDdbEsGroupEntity","CmsDdbEsModelEntity","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity","CmsEntryOpenSearchUtilsFeature","FilterRegistriesFeature","CreateElasticsearchIndexTask","CmsEntitiesDbRegistryDecorator","DdbEsGroupStorageOpsFeature","DdbEsModelStorageOpsFeature","DdbEsEntryStorageOpsFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAAUC,CAAAA;QACNC,kBAAkB,QAAQ,CAACD;QAE3B,MAAME,KAAKF,UAAU,OAAO,CAACG;QAC7B,MAAMC,iBAAiBF,GAAG,MAAM;QAEhC,MAAMG,gBAAgBC,YAAY;YAC9B,MAAMC,QAAQ,GAAG,CAAC,QAAQ;YAC1BH;QACJ;QACA,MAAMI,6BAA6BC,sBAAsB;YACrD,MAAMF,QAAQ,GAAG,CAAC,mBAAmB;YACrCH;QACJ;QAEA,MAAMM,cAAcC,kBAAkB;YAClC,YAAYC,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,MAAMQ,cAAcC,kBAAkB;YAClC,YAAYF,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,MAAMU,cAAcC,kBAAkB;YAClC,YAAYJ,SAAS,OAAO;YAC5B,OAAOP;QACX;QACA,MAAMY,kBAAkBC,uBAAuB;YAC3C,YAAYN,SAAS,UAAU;YAC/B,OAAOJ;QACX;QAGAR,UAAU,gBAAgB,CAACmB,eAAed;QAC1CL,UAAU,gBAAgB,CAACoB,iBAAiBZ;QAC5CR,UAAU,gBAAgB,CAACqB,qBAAqBX;QAChDV,UAAU,gBAAgB,CAACsB,qBAAqBT;QAChDb,UAAU,gBAAgB,CAACuB,qBAAqBR;QAChDf,UAAU,gBAAgB,CAACwB,yBAAyBP;QAEpDQ,+BAA+B,QAAQ,CAACzB;QACxC0B,wBAAwB,QAAQ,CAAC1B;QAEjCA,UAAU,QAAQ,CAAC2B;QAGnB3B,UAAU,iBAAiB,CAAC4B;QAE5BC,4BAA4B,QAAQ,CAAC7B;QACrC8B,4BAA4B,QAAQ,CAAC9B;QACrC+B,4BAA4B,QAAQ,CAAC/B;IACzC;AACJ"}
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HeadlessCmsDdbEsFeature } from "./feature.js";
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HeadlessCmsDdbEsFeature } from "./feature.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
|
|
4
|
+
import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
5
|
+
import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
|
|
6
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
7
|
+
import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
8
|
+
import { CompressionHandler } from "@webiny/utils/exports/api.js";
|
|
9
|
+
declare class DdbEsCreateEntryImpl implements CreateEntryStorageOperation.Interface {
|
|
10
|
+
private entity;
|
|
11
|
+
private esEntity;
|
|
12
|
+
private dataLoaders;
|
|
13
|
+
private storageModelProvider;
|
|
14
|
+
private fieldIndexRegistry;
|
|
15
|
+
private compressionHandler;
|
|
16
|
+
private indexProvider;
|
|
17
|
+
private valuesModifiers;
|
|
18
|
+
constructor(entity: CmsDdbEsEntryEntity.Interface, esEntity: CmsDdbEsEntriesEsEntity.Interface, dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, compressionHandler: CompressionHandler.Interface, indexProvider: CmsModelOpenSearchIndexProvider.Interface, valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]);
|
|
19
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const DdbEsCreateEntry: typeof DdbEsCreateEntryImpl & {
|
|
22
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js").ICreateEntryStorageOperation>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
|
|
4
|
+
import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
5
|
+
import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
|
|
6
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
7
|
+
import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
8
|
+
import { CompressionHandler } from "@webiny/utils/exports/api.js";
|
|
9
|
+
import { createConfigurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
|
|
10
|
+
import { createTransformer } from "./transformations/index.js";
|
|
11
|
+
import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys } from "./keys.js";
|
|
12
|
+
class DdbEsCreateEntryImpl {
|
|
13
|
+
constructor(entity, esEntity, dataLoaders, storageModelProvider, fieldIndexRegistry, compressionHandler, indexProvider, valuesModifiers){
|
|
14
|
+
this.entity = entity;
|
|
15
|
+
this.esEntity = esEntity;
|
|
16
|
+
this.dataLoaders = dataLoaders;
|
|
17
|
+
this.storageModelProvider = storageModelProvider;
|
|
18
|
+
this.fieldIndexRegistry = fieldIndexRegistry;
|
|
19
|
+
this.compressionHandler = compressionHandler;
|
|
20
|
+
this.indexProvider = indexProvider;
|
|
21
|
+
this.valuesModifiers = valuesModifiers;
|
|
22
|
+
}
|
|
23
|
+
async execute(initialModel, params) {
|
|
24
|
+
const { entry: initialEntry, storageEntry: initialStorageEntry } = params;
|
|
25
|
+
const model = this.storageModelProvider.getModel(initialModel);
|
|
26
|
+
const isPublished = "published" === initialEntry.status;
|
|
27
|
+
const locked = isPublished ? true : initialEntry.locked;
|
|
28
|
+
initialEntry.locked = locked;
|
|
29
|
+
initialStorageEntry.locked = locked;
|
|
30
|
+
const transformer = createTransformer({
|
|
31
|
+
fieldIndexRegistry: this.fieldIndexRegistry,
|
|
32
|
+
model,
|
|
33
|
+
entry: initialEntry,
|
|
34
|
+
storageEntry: initialStorageEntry,
|
|
35
|
+
compressionHandler: this.compressionHandler,
|
|
36
|
+
valuesModifiers: this.valuesModifiers
|
|
37
|
+
});
|
|
38
|
+
const { entry, storageEntry } = transformer.transformEntryKeys();
|
|
39
|
+
const esEntry = transformer.transformToIndex();
|
|
40
|
+
const configurations = createConfigurations(this.indexProvider);
|
|
41
|
+
const { index: esIndex } = await configurations.es({
|
|
42
|
+
model
|
|
43
|
+
});
|
|
44
|
+
const revisionKeys = createEntryRevisionKeys(entry);
|
|
45
|
+
const latestKeys = createEntryLatestKeys(entry);
|
|
46
|
+
const publishedKeys = createEntryPublishedKeys(entry);
|
|
47
|
+
const entityBatch = this.entity.createEntityWriter({
|
|
48
|
+
put: [
|
|
49
|
+
{
|
|
50
|
+
...revisionKeys,
|
|
51
|
+
data: {
|
|
52
|
+
...storageEntry,
|
|
53
|
+
locked
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
...latestKeys,
|
|
58
|
+
data: {
|
|
59
|
+
...storageEntry,
|
|
60
|
+
locked
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
if (isPublished) entityBatch.put({
|
|
66
|
+
...publishedKeys,
|
|
67
|
+
data: {
|
|
68
|
+
...storageEntry,
|
|
69
|
+
locked
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
try {
|
|
73
|
+
await entityBatch.execute();
|
|
74
|
+
this.dataLoaders.clearAll({
|
|
75
|
+
tenant: entry.tenant
|
|
76
|
+
});
|
|
77
|
+
} catch (ex) {
|
|
78
|
+
throw new error(ex.message || "Could not insert entry data into the DynamoDB table.", ex.code || "CREATE_ENTRY_ERROR", {
|
|
79
|
+
error: ex,
|
|
80
|
+
entry,
|
|
81
|
+
storageEntry
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const esLatestData = await transformer.getElasticsearchLatestEntryData();
|
|
85
|
+
const elasticsearchEntityBatch = this.esEntity.createEntityWriter({
|
|
86
|
+
put: [
|
|
87
|
+
{
|
|
88
|
+
...latestKeys,
|
|
89
|
+
index: esIndex,
|
|
90
|
+
data: esLatestData
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
if (isPublished) {
|
|
95
|
+
const esPublishedData = await transformer.getElasticsearchPublishedEntryData();
|
|
96
|
+
elasticsearchEntityBatch.put({
|
|
97
|
+
...publishedKeys,
|
|
98
|
+
index: esIndex,
|
|
99
|
+
data: esPublishedData
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
await elasticsearchEntityBatch.execute();
|
|
104
|
+
} catch (ex) {
|
|
105
|
+
throw new error(ex.message || "Could not insert entry data into the Elasticsearch DynamoDB table.", ex.code || "CREATE_ES_ENTRY_ERROR", {
|
|
106
|
+
error: ex,
|
|
107
|
+
entry,
|
|
108
|
+
esEntry
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return initialStorageEntry;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const DdbEsCreateEntry = CreateEntryStorageOperation.createImplementation({
|
|
115
|
+
implementation: DdbEsCreateEntryImpl,
|
|
116
|
+
dependencies: [
|
|
117
|
+
CmsDdbEsEntryEntity,
|
|
118
|
+
CmsDdbEsEntriesEsEntity,
|
|
119
|
+
CmsDdbEsDataLoaders,
|
|
120
|
+
CmsStorageModelProvider,
|
|
121
|
+
CmsEntryOpenSearchFieldIndexRegistry,
|
|
122
|
+
CompressionHandler,
|
|
123
|
+
CmsModelOpenSearchIndexProvider,
|
|
124
|
+
[
|
|
125
|
+
CmsEntryOpenSearchValuesModifier,
|
|
126
|
+
{
|
|
127
|
+
multiple: true
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
export { DdbEsCreateEntry };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=DdbEsCreateEntry.js.map
|