@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,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": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.a85ef555b2",
|
|
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": "0.0.0-unstable.
|
|
34
|
-
"@webiny/api-
|
|
35
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
36
|
-
"@webiny/api-
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/
|
|
40
|
-
"@webiny/
|
|
41
|
-
"@webiny/
|
|
42
|
-
"@webiny/
|
|
43
|
-
"@webiny/
|
|
33
|
+
"@webiny/api": "0.0.0-unstable.a85ef555b2",
|
|
34
|
+
"@webiny/api-core": "0.0.0-unstable.a85ef555b2",
|
|
35
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.a85ef555b2",
|
|
36
|
+
"@webiny/api-headless-cms-storage": "0.0.0-unstable.a85ef555b2",
|
|
37
|
+
"@webiny/api-headless-cms-utils-os": "0.0.0-unstable.a85ef555b2",
|
|
38
|
+
"@webiny/api-opensearch": "0.0.0-unstable.a85ef555b2",
|
|
39
|
+
"@webiny/api-opensearch-aws": "0.0.0-unstable.a85ef555b2",
|
|
40
|
+
"@webiny/api-search-index-tasks": "0.0.0-unstable.a85ef555b2",
|
|
41
|
+
"@webiny/db": "0.0.0-unstable.a85ef555b2",
|
|
42
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.a85ef555b2",
|
|
43
|
+
"@webiny/error": "0.0.0-unstable.a85ef555b2",
|
|
44
|
+
"@webiny/feature": "0.0.0-unstable.a85ef555b2",
|
|
45
|
+
"@webiny/plugins": "0.0.0-unstable.a85ef555b2",
|
|
46
|
+
"@webiny/stdlib": "0.0.21",
|
|
47
|
+
"@webiny/utils": "0.0.0-unstable.a85ef555b2",
|
|
44
48
|
"dataloader": "2.2.3",
|
|
45
49
|
"lodash": "4.18.1"
|
|
46
50
|
},
|
|
47
51
|
"devDependencies": {
|
|
48
52
|
"@types/jsonpack": "1.1.6",
|
|
49
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
50
|
-
"@webiny/api-
|
|
51
|
-
"@webiny/
|
|
52
|
-
"@webiny/
|
|
53
|
-
"@webiny/
|
|
54
|
-
"@webiny/
|
|
55
|
-
"@webiny/
|
|
56
|
-
"@webiny/handler-
|
|
57
|
-
"@webiny/
|
|
58
|
-
"@webiny/wcp": "0.0.0-unstable.
|
|
53
|
+
"@webiny/api-core-testing": "0.0.0-unstable.a85ef555b2",
|
|
54
|
+
"@webiny/api-graphql": "0.0.0-unstable.a85ef555b2",
|
|
55
|
+
"@webiny/api-search-index-tasks-ddb-os": "0.0.0-unstable.a85ef555b2",
|
|
56
|
+
"@webiny/api-sync-ddb-to-opensearch": "0.0.0-unstable.a85ef555b2",
|
|
57
|
+
"@webiny/background-tasks": "0.0.0-unstable.a85ef555b2",
|
|
58
|
+
"@webiny/build-tools": "0.0.0-unstable.a85ef555b2",
|
|
59
|
+
"@webiny/di": "2.0.0",
|
|
60
|
+
"@webiny/event-handler-core": "0.0.0-unstable.a85ef555b2",
|
|
61
|
+
"@webiny/handler": "0.0.0-unstable.a85ef555b2",
|
|
62
|
+
"@webiny/wcp": "0.0.0-unstable.a85ef555b2",
|
|
59
63
|
"jest-dynalite": "3.6.1",
|
|
60
64
|
"rimraf": "6.1.3",
|
|
61
65
|
"typescript": "7.0.2",
|
|
62
|
-
"vitest": "4.1.
|
|
66
|
+
"vitest": "4.1.11"
|
|
63
67
|
},
|
|
64
68
|
"publishConfig": {
|
|
65
69
|
"access": "public"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DbRegistry } from "@webiny/db/exports/api/db.js";
|
|
2
|
+
import { CmsDdbEsEntryEntity } from "../abstractions/CmsDdbEsEntryEntity.js";
|
|
3
|
+
import { CmsDdbEsEntriesEsEntity } from "../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
4
|
+
/**
|
|
5
|
+
* Adds the CMS entities to every request's DbRegistry.
|
|
6
|
+
*
|
|
7
|
+
* DbRegistry is container scoped: each request (child) container builds its own, empty registry. The
|
|
8
|
+
* DDB to OpenSearch sync looks up two CMS entities in it (the DynamoDB entries entity and the
|
|
9
|
+
* OpenSearch entries entity), so every one of those registries needs them.
|
|
10
|
+
*
|
|
11
|
+
* The CMS storage feature runs once, in the root, before any request exists, so it can't register into
|
|
12
|
+
* per-request registries directly. Instead it registers this decorator in the root. Decorators on a
|
|
13
|
+
* container-scoped registration apply to every instance as it is built, so this constructor runs once
|
|
14
|
+
* per request registry and adds the two entities. Every other call passes through to the registry.
|
|
15
|
+
*/
|
|
16
|
+
declare class CmsEntitiesDbRegistryDecoratorImpl implements DbRegistry.Interface {
|
|
17
|
+
private readonly decoratee;
|
|
18
|
+
constructor(entryEntity: CmsDdbEsEntryEntity.Interface, entriesEsEntity: CmsDdbEsEntriesEsEntity.Interface, decoratee: DbRegistry.Interface);
|
|
19
|
+
register<T = unknown>(params: DbRegistry.RegisterParams<T>): void;
|
|
20
|
+
getOneItem<T = unknown>(cb: (item: DbRegistry.RegistryItem<T>) => boolean): DbRegistry.RegistryItem<T>;
|
|
21
|
+
getItem<T = unknown>(cb: (item: DbRegistry.RegistryItem<T>) => boolean): DbRegistry.RegistryItem<T> | null;
|
|
22
|
+
getItems<T = unknown>(cb: (item: DbRegistry.RegistryItem<T>) => boolean): DbRegistry.RegistryItem<T>[];
|
|
23
|
+
}
|
|
24
|
+
export declare const CmsEntitiesDbRegistryDecorator: typeof CmsEntitiesDbRegistryDecoratorImpl & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/db/features/DbRegistry/abstractions").IRegistry>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DbRegistry } from "@webiny/db/exports/api/db.js";
|
|
2
|
+
import { CmsDdbEsEntryEntity } from "../abstractions/CmsDdbEsEntryEntity.js";
|
|
3
|
+
import { CmsDdbEsEntriesEsEntity } from "../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
4
|
+
class CmsEntitiesDbRegistryDecoratorImpl {
|
|
5
|
+
constructor(entryEntity, entriesEsEntity, decoratee){
|
|
6
|
+
this.decoratee = decoratee;
|
|
7
|
+
decoratee.register({
|
|
8
|
+
item: entryEntity,
|
|
9
|
+
app: "cms",
|
|
10
|
+
tags: [
|
|
11
|
+
"regular",
|
|
12
|
+
entryEntity.name
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
decoratee.register({
|
|
16
|
+
item: entriesEsEntity,
|
|
17
|
+
app: "cms",
|
|
18
|
+
tags: [
|
|
19
|
+
"es",
|
|
20
|
+
entriesEsEntity.name
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
register(params) {
|
|
25
|
+
this.decoratee.register(params);
|
|
26
|
+
}
|
|
27
|
+
getOneItem(cb) {
|
|
28
|
+
return this.decoratee.getOneItem(cb);
|
|
29
|
+
}
|
|
30
|
+
getItem(cb) {
|
|
31
|
+
return this.decoratee.getItem(cb);
|
|
32
|
+
}
|
|
33
|
+
getItems(cb) {
|
|
34
|
+
return this.decoratee.getItems(cb);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const CmsEntitiesDbRegistryDecorator = DbRegistry.createDecorator({
|
|
38
|
+
decorator: CmsEntitiesDbRegistryDecoratorImpl,
|
|
39
|
+
dependencies: [
|
|
40
|
+
CmsDdbEsEntryEntity,
|
|
41
|
+
CmsDdbEsEntriesEsEntity
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
export { CmsEntitiesDbRegistryDecorator };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=CmsEntitiesDbRegistryDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry/CmsEntitiesDbRegistryDecorator.js","sources":["../../src/registry/CmsEntitiesDbRegistryDecorator.ts"],"sourcesContent":["import { DbRegistry } from \"@webiny/db/exports/api/db.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\n\n/**\n * Adds the CMS entities to every request's DbRegistry.\n *\n * DbRegistry is container scoped: each request (child) container builds its own, empty registry. The\n * DDB to OpenSearch sync looks up two CMS entities in it (the DynamoDB entries entity and the\n * OpenSearch entries entity), so every one of those registries needs them.\n *\n * The CMS storage feature runs once, in the root, before any request exists, so it can't register into\n * per-request registries directly. Instead it registers this decorator in the root. Decorators on a\n * container-scoped registration apply to every instance as it is built, so this constructor runs once\n * per request registry and adds the two entities. Every other call passes through to the registry.\n */\nclass CmsEntitiesDbRegistryDecoratorImpl implements DbRegistry.Interface {\n public constructor(\n entryEntity: CmsDdbEsEntryEntity.Interface,\n entriesEsEntity: CmsDdbEsEntriesEsEntity.Interface,\n private readonly decoratee: DbRegistry.Interface\n ) {\n decoratee.register({\n item: entryEntity,\n app: \"cms\",\n tags: [\"regular\", entryEntity.name]\n });\n decoratee.register({\n item: entriesEsEntity,\n app: \"cms\",\n tags: [\"es\", entriesEsEntity.name]\n });\n }\n\n public register<T = unknown>(params: DbRegistry.RegisterParams<T>): void {\n this.decoratee.register(params);\n }\n\n public getOneItem<T = unknown>(\n cb: (item: DbRegistry.RegistryItem<T>) => boolean\n ): DbRegistry.RegistryItem<T> {\n return this.decoratee.getOneItem(cb);\n }\n\n public getItem<T = unknown>(\n cb: (item: DbRegistry.RegistryItem<T>) => boolean\n ): DbRegistry.RegistryItem<T> | null {\n return this.decoratee.getItem(cb);\n }\n\n public getItems<T = unknown>(\n cb: (item: DbRegistry.RegistryItem<T>) => boolean\n ): DbRegistry.RegistryItem<T>[] {\n return this.decoratee.getItems(cb);\n }\n}\n\nexport const CmsEntitiesDbRegistryDecorator = DbRegistry.createDecorator({\n decorator: CmsEntitiesDbRegistryDecoratorImpl,\n dependencies: [CmsDdbEsEntryEntity, CmsDdbEsEntriesEsEntity]\n});\n"],"names":["CmsEntitiesDbRegistryDecoratorImpl","entryEntity","entriesEsEntity","decoratee","params","cb","CmsEntitiesDbRegistryDecorator","DbRegistry","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity"],"mappings":";;;AAgBA,MAAMA;IACF,YACIC,WAA0C,EAC1CC,eAAkD,EACjCC,SAA+B,CAClD;aADmBA,SAAS,GAATA;QAEjBA,UAAU,QAAQ,CAAC;YACf,MAAMF;YACN,KAAK;YACL,MAAM;gBAAC;gBAAWA,YAAY,IAAI;aAAC;QACvC;QACAE,UAAU,QAAQ,CAAC;YACf,MAAMD;YACN,KAAK;YACL,MAAM;gBAAC;gBAAMA,gBAAgB,IAAI;aAAC;QACtC;IACJ;IAEO,SAAsBE,MAAoC,EAAQ;QACrE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACA;IAC5B;IAEO,WACHC,EAAiD,EACvB;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAACA;IACrC;IAEO,QACHA,EAAiD,EAChB;QACjC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACA;IAClC;IAEO,SACHA,EAAiD,EACrB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACA;IACnC;AACJ;AAEO,MAAMC,iCAAiCC,WAAW,eAAe,CAAC;IACrE,WAAWP;IACX,cAAc;QAACQ;QAAqBC;KAAwB;AAChE"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Tenant } from "@webiny/api-core/types/tenancy.js";
|
|
1
|
+
import { TenantIndexFactory } from "@webiny/api-search-index-tasks";
|
|
3
2
|
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
4
|
-
import { CmsModelOpenSearchIndexProvider } from "
|
|
5
|
-
import { Logger } from "@webiny/api-core/
|
|
6
|
-
declare class CreateElasticsearchIndexTaskImpl implements
|
|
3
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
4
|
+
import { Logger } from "@webiny/api-core/features/logger/index.js";
|
|
5
|
+
declare class CreateElasticsearchIndexTaskImpl implements TenantIndexFactory.Interface {
|
|
7
6
|
private readonly indexProvider;
|
|
8
7
|
private listModels;
|
|
9
8
|
private readonly logger;
|
|
10
9
|
constructor(indexProvider: CmsModelOpenSearchIndexProvider.Interface, listModels: ListModelsUseCase.Interface, logger: Logger.Interface);
|
|
11
|
-
getIndexList(tenant: Tenant): Promise<
|
|
10
|
+
getIndexList(tenant: TenantIndexFactory.Tenant): Promise<TenantIndexFactory.IndexConfig[]>;
|
|
12
11
|
}
|
|
13
12
|
export declare const CreateElasticsearchIndexTask: typeof CreateElasticsearchIndexTaskImpl & {
|
|
14
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-search-index-tasks/abstractions/TenantIndexFactory").ITenantIndexFactory>;
|
|
15
14
|
};
|
|
16
15
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TenantIndexFactory } from "@webiny/api-search-index-tasks";
|
|
2
2
|
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Logger } from "@webiny/api-core/
|
|
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
|
+
import { Logger } from "@webiny/api-core/features/logger/index.js";
|
|
6
6
|
class CreateElasticsearchIndexTaskImpl {
|
|
7
7
|
constructor(indexProvider, listModels, logger){
|
|
8
8
|
this.indexProvider = indexProvider;
|
|
@@ -12,29 +12,31 @@ class CreateElasticsearchIndexTaskImpl {
|
|
|
12
12
|
async getIndexList(tenant) {
|
|
13
13
|
const result = await this.listModels.execute();
|
|
14
14
|
if (result.isFail()) {
|
|
15
|
-
this.logger.error(
|
|
15
|
+
this.logger.error({
|
|
16
|
+
error: result.error
|
|
17
|
+
}, "Failed to list models for index creation.");
|
|
16
18
|
return [];
|
|
17
19
|
}
|
|
18
20
|
const models = result.value;
|
|
19
21
|
if (0 === models.length) return [];
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
+
const configurations = createConfigurations(this.indexProvider);
|
|
23
|
+
const indices = [];
|
|
22
24
|
for (const model of models){
|
|
23
|
-
const { index, settings } = await
|
|
25
|
+
const { index, settings } = await configurations.es({
|
|
24
26
|
model: {
|
|
25
27
|
...model,
|
|
26
28
|
tenant: tenant.id
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
|
-
|
|
30
|
-
index
|
|
31
|
+
indices.push({
|
|
32
|
+
index,
|
|
31
33
|
settings
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
return
|
|
36
|
+
return indices;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
|
-
const CreateElasticsearchIndexTask =
|
|
39
|
+
const CreateElasticsearchIndexTask = TenantIndexFactory.createImplementation({
|
|
38
40
|
implementation: CreateElasticsearchIndexTaskImpl,
|
|
39
41
|
dependencies: [
|
|
40
42
|
CmsModelOpenSearchIndexProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks/CreateElasticsearchIndexTask.js","sources":["../../src/tasks/CreateElasticsearchIndexTask.ts"],"sourcesContent":["import {
|
|
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\";\nimport { Logger } from \"@webiny/api-core/features/logger/index.js\";\n\nclass CreateElasticsearchIndexTaskImpl implements TenantIndexFactory.Interface {\n constructor(\n private readonly indexProvider: CmsModelOpenSearchIndexProvider.Interface,\n private listModels: ListModelsUseCase.Interface,\n private readonly logger: Logger.Interface\n ) {}\n\n async getIndexList(\n tenant: TenantIndexFactory.Tenant\n ): Promise<TenantIndexFactory.IndexConfig[]> {\n const result = await this.listModels.execute();\n if (result.isFail()) {\n this.logger.error({ error: result.error }, \"Failed to list models for index creation.\");\n return [];\n }\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, Logger]\n});\n"],"names":["CreateElasticsearchIndexTaskImpl","indexProvider","listModels","logger","tenant","result","models","configurations","createConfigurations","indices","model","index","settings","CreateElasticsearchIndexTask","TenantIndexFactory","CmsModelOpenSearchIndexProvider","ListModelsUseCase","Logger"],"mappings":";;;;;AAMA,MAAMA;IACF,YACqBC,aAAwD,EACjEC,UAAuC,EAC9BC,MAAwB,CAC3C;aAHmBF,aAAa,GAAbA;aACTC,UAAU,GAAVA;aACSC,MAAM,GAANA;IAClB;IAEH,MAAM,aACFC,MAAiC,EACQ;QACzC,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO;QAC5C,IAAIA,OAAO,MAAM,IAAI;YACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;gBAAE,OAAOA,OAAO,KAAK;YAAC,GAAG;YAC3C,OAAO,EAAE;QACb;QACA,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,gBAAgBd;IAChB,cAAc;QAACe;QAAiCC;QAAmBC;KAAO;AAC9E"}
|
package/types.d.ts
CHANGED
|
@@ -1,58 +1,22 @@
|
|
|
1
|
-
import type { CmsContext,
|
|
2
|
-
import type { Client, IOpenSearchEntity as IElasticsearchEntity } from "@webiny/api-opensearch";
|
|
3
|
-
import type { IEntryEntity, IGroupEntity, IModelEntity } from "./definitions/types.js";
|
|
4
|
-
import type { ITable } from "@webiny/db-dynamodb";
|
|
5
|
-
import type { PluginsContainer } from "@webiny/plugins";
|
|
1
|
+
import type { CmsContext, CmsEntryValues, CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
6
2
|
export { CmsContext };
|
|
7
|
-
/**
|
|
8
|
-
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
9
|
-
*
|
|
10
|
-
* @category Elasticsearch
|
|
11
|
-
* @category CmsEntry
|
|
12
|
-
*/
|
|
13
|
-
export interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {
|
|
14
|
-
/**
|
|
15
|
-
* Values that are not going to be indexed.
|
|
16
|
-
*/
|
|
17
|
-
rawValues: Partial<T>;
|
|
18
|
-
/**
|
|
19
|
-
* Dev can add whatever keys they want and need. Just need to be careful not to break the entry.
|
|
20
|
-
*/
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}
|
|
23
3
|
export declare enum ENTITIES {
|
|
24
4
|
GROUPS = "CmsGroups",
|
|
25
5
|
MODELS = "CmsModels",
|
|
26
6
|
ENTRIES = "CmsEntries",
|
|
27
7
|
ENTRIES_ES = "CmsEntriesElasticsearch"
|
|
28
8
|
}
|
|
29
|
-
export interface StorageOperationsFactoryParams {
|
|
30
|
-
elasticsearch: Client;
|
|
31
|
-
table?: string;
|
|
32
|
-
esTable?: string;
|
|
33
|
-
plugins: PluginsContainer;
|
|
34
|
-
container: CmsContext["container"];
|
|
35
|
-
}
|
|
36
|
-
export interface IGetEntitiesResponse {
|
|
37
|
-
groups: IGroupEntity;
|
|
38
|
-
models: IModelEntity;
|
|
39
|
-
entries: IEntryEntity;
|
|
40
|
-
entriesEs: IElasticsearchEntity;
|
|
41
|
-
}
|
|
42
|
-
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {
|
|
43
|
-
getTable: () => ITable;
|
|
44
|
-
getEsTable: () => ITable;
|
|
45
|
-
getEntities: () => IGetEntitiesResponse;
|
|
46
|
-
}
|
|
47
|
-
export interface StorageOperationsFactory {
|
|
48
|
-
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
49
|
-
}
|
|
50
|
-
export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
|
|
51
|
-
dataLoaders: IDataLoadersHandler;
|
|
52
|
-
}
|
|
53
9
|
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
54
10
|
tenant: string;
|
|
55
11
|
}
|
|
12
|
+
export interface DataLoadersHandlerDataLoaderParams {
|
|
13
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
14
|
+
ids: readonly string[];
|
|
15
|
+
}
|
|
56
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>[]>;
|
|
57
21
|
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
58
22
|
}
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsContext,\n
|
|
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, CmsModelOpenSearchIndexProvider } 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, CmsModelOpenSearchIndexProvider } from "../../../features/CmsModelOpenSearchIndex/index.js";
|
|
9
|
-
export { CmsEntryOpenSearchValuesModifier } from "../../../features/CmsEntryOpenSearchValuesModifier/index.js";
|