@webiny/api-headless-cms-ddb-es 6.4.5-beta.0 → 6.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
- package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsModelEntity.js +5 -0
- package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
- package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsOsTable.js +5 -0
- package/abstractions/CmsDdbEsOsTable.js.map +1 -0
- package/abstractions/CmsDdbEsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsTable.js +5 -0
- package/abstractions/CmsDdbEsTable.js.map +1 -0
- package/feature.d.ts +4 -1
- package/feature.js +59 -157
- package/feature.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/operations/entry/DdbEsCreateEntry.d.ts +23 -0
- package/operations/entry/DdbEsCreateEntry.js +131 -0
- package/operations/entry/DdbEsCreateEntry.js.map +1 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +23 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js +136 -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 +23 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js +133 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js +77 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetEntry.d.ts +14 -0
- package/operations/entry/DdbEsGetEntry.js +27 -0
- package/operations/entry/DdbEsGetEntry.js.map +1 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
- package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisionById.js +34 -0
- package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
- package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisions.js +33 -0
- package/operations/entry/DdbEsGetRevisions.js.map +1 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +17 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js +73 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +24 -0
- package/operations/entry/DdbEsListEntries.js +88 -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 +23 -0
- package/operations/entry/DdbEsPublishEntry.js +228 -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 +23 -0
- package/operations/entry/DdbEsUnpublishEntry.js +124 -0
- package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbEsUpdateEntry.d.ts +23 -0
- package/operations/entry/DdbEsUpdateEntry.js +172 -0
- package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +5 -5
- package/operations/entry/dataLoaders.js +11 -3
- package/operations/entry/dataLoaders.js.map +1 -1
- package/{features/CmsModelOpenSearchIndex → operations/entry}/feature.d.ts +1 -1
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/storageEntryUtils.d.ts +7 -0
- package/operations/entry/storageEntryUtils.js +14 -0
- package/operations/entry/storageEntryUtils.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +2 -3
- package/operations/entry/transformations/index.js +1 -1
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/group/DdbEsCreateGroup.d.ts +12 -0
- package/operations/group/DdbEsCreateGroup.js +35 -0
- package/operations/group/DdbEsCreateGroup.js.map +1 -0
- package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
- package/operations/group/DdbEsDeleteGroup.js +31 -0
- package/operations/group/DdbEsDeleteGroup.js.map +1 -0
- package/operations/group/DdbEsGetGroup.d.ts +12 -0
- package/operations/group/DdbEsGetGroup.js +31 -0
- package/operations/group/DdbEsGetGroup.js.map +1 -0
- package/operations/group/DdbEsListGroups.d.ts +14 -0
- package/operations/group/DdbEsListGroups.js +52 -0
- package/operations/group/DdbEsListGroups.js.map +1 -0
- package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
- package/operations/group/DdbEsUpdateGroup.js +35 -0
- package/operations/group/DdbEsUpdateGroup.js.map +1 -0
- package/{features/CmsEntryOpenSearchFilter → operations/group}/feature.d.ts +1 -1
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbEsCreateModel.d.ts +14 -0
- package/operations/model/DdbEsCreateModel.js +52 -0
- package/operations/model/DdbEsCreateModel.js.map +1 -0
- package/operations/model/DdbEsDeleteModel.d.ts +14 -0
- package/operations/model/DdbEsDeleteModel.js +50 -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 +26 -22
- package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
- package/tasks/CreateElasticsearchIndexTask.js +49 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +10 -49
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -22
- package/configurations.js +0 -37
- package/configurations.js.map +0 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -45
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -10
- package/elasticsearch/deleteElasticsearchIndex.js +0 -23
- package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
- package/exports/api/cms/opensearch.d.ts +0 -9
- package/exports/api/cms/opensearch.js +0 -9
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +0 -16
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -14
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +0 -42
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +0 -32
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +0 -5
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +0 -5
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +0 -4
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +0 -29
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +0 -60
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +0 -13
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +0 -33
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +0 -21
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +0 -22
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +0 -32
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +0 -12
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +0 -107
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +0 -21
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +0 -15
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +0 -40
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +0 -15
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +0 -40
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -3
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +0 -11
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +0 -36
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +0 -37
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +0 -5
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +0 -5
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +0 -1
- package/features/CmsEntryOpenSearchFilter/constants.js +0 -4
- package/features/CmsEntryOpenSearchFilter/constants.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/feature.js +0 -17
- package/features/CmsEntryOpenSearchFilter/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +0 -26
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +0 -43
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +0 -36
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchFilter/index.js +0 -3
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +0 -20
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +0 -16
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -1
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +0 -15
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchSortModifier/index.js +0 -1
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -12
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +0 -31
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +0 -22
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +0 -5
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +0 -5
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +0 -4
- package/features/CmsEntryOpenSearchValueSearch/feature.js +0 -17
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +0 -21
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +0 -44
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +0 -22
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchValueSearch/index.js +0 -3
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +0 -23
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +0 -5
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -1
- package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.d.ts +0 -25
- package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js +0 -36
- package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.d.ts +0 -8
- package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js +0 -17
- package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/abstractions.d.ts +0 -20
- package/features/CmsModelOpenSearchIndex/abstractions.js +0 -5
- package/features/CmsModelOpenSearchIndex/abstractions.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/feature.js +0 -13
- package/features/CmsModelOpenSearchIndex/feature.js.map +0 -1
- package/features/CmsModelOpenSearchIndex/index.d.ts +0 -3
- package/features/CmsModelOpenSearchIndex/index.js +0 -3
- package/helpers/entryIndexHelpers.d.ts +0 -20
- package/helpers/entryIndexHelpers.js +0 -80
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/fieldIdentifier.d.ts +0 -6
- package/helpers/fieldIdentifier.js +0 -23
- package/helpers/fieldIdentifier.js.map +0 -1
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -2
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -9
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
- package/operations/entry/elasticsearch/body.d.ts +0 -30
- package/operations/entry/elasticsearch/body.js +0 -88
- package/operations/entry/elasticsearch/body.js.map +0 -1
- package/operations/entry/elasticsearch/fields/createSystemField.d.ts +0 -4
- package/operations/entry/elasticsearch/fields/createSystemField.js +0 -9
- package/operations/entry/elasticsearch/fields/createSystemField.js.map +0 -1
- package/operations/entry/elasticsearch/fields/live.d.ts +0 -2
- package/operations/entry/elasticsearch/fields/live.js +0 -50
- package/operations/entry/elasticsearch/fields/live.js.map +0 -1
- package/operations/entry/elasticsearch/fields/location.d.ts +0 -2
- package/operations/entry/elasticsearch/fields/location.js +0 -50
- package/operations/entry/elasticsearch/fields/location.js.map +0 -1
- package/operations/entry/elasticsearch/fields/state.d.ts +0 -2
- package/operations/entry/elasticsearch/fields/state.js +0 -104
- package/operations/entry/elasticsearch/fields/state.js.map +0 -1
- package/operations/entry/elasticsearch/fields.d.ts +0 -12
- package/operations/entry/elasticsearch/fields.js +0 -207
- package/operations/entry/elasticsearch/fields.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -9
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -39
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -22
- package/operations/entry/elasticsearch/filtering/exec.js +0 -96
- package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/index.js +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -17
- package/operations/entry/elasticsearch/filtering/path.js +0 -27
- package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/populated.js +0 -12
- package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/values.js +0 -15
- package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -13
- package/operations/entry/elasticsearch/fullTextSearch.js +0 -51
- package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -10
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/initialQuery.js +0 -43
- package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
- package/operations/entry/elasticsearch/keyword.d.ts +0 -2
- package/operations/entry/elasticsearch/keyword.js +0 -17
- package/operations/entry/elasticsearch/keyword.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -7
- package/operations/entry/elasticsearch/plugins/operator.js +0 -13
- package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -8
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
- package/operations/entry/elasticsearch/sort.d.ts +0 -12
- package/operations/entry/elasticsearch/sort.js +0 -80
- package/operations/entry/elasticsearch/sort.js.map +0 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js +0 -12
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearch/types.d.ts +0 -34
- package/operations/entry/elasticsearch/types.js +0 -0
- package/operations/entry/index.d.ts +0 -34
- package/operations/entry/index.js +0 -1366
- package/operations/entry/index.js.map +0 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
- package/operations/entry/transformations/transformEntryToIndex.js +0 -20
- package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
- package/operations/group/index.d.ts +0 -9
- package/operations/group/index.js +0 -121
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -10
- package/operations/model/index.js +0 -119
- package/operations/model/index.js.map +0 -1
- package/tasks/createIndexTaskPlugin.d.ts +0 -2
- package/tasks/createIndexTaskPlugin.js +0 -36
- package/tasks/createIndexTaskPlugin.js.map +0 -1
- package/values/NoValueContainer.d.ts +0 -5
- package/values/NoValueContainer.js +0 -11
- package/values/NoValueContainer.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { DeleteGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/DeleteGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
import { createKeys } from "./keys.js";
|
|
5
|
+
class DdbEsDeleteGroupImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const { group } = params;
|
|
11
|
+
const keys = createKeys(group);
|
|
12
|
+
try {
|
|
13
|
+
await this.entity.delete(keys);
|
|
14
|
+
} catch (ex) {
|
|
15
|
+
throw new error(ex.message || "Could not delete group.", ex.code || "DELETE_GROUP_ERROR", {
|
|
16
|
+
error: ex,
|
|
17
|
+
group,
|
|
18
|
+
keys
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const DdbEsDeleteGroup = DeleteGroupStorageOperation.createImplementation({
|
|
24
|
+
implementation: DdbEsDeleteGroupImpl,
|
|
25
|
+
dependencies: [
|
|
26
|
+
CmsDdbEsGroupEntity
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
export { DdbEsDeleteGroup };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=DdbEsDeleteGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/DdbEsDeleteGroup.js","sources":["../../../src/operations/group/DdbEsDeleteGroup.ts"],"sourcesContent":["import type { CmsGroupStorageOperationsDeleteParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { DeleteGroupStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/DeleteGroupStorageOperation.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbEsDeleteGroupImpl implements DeleteGroupStorageOperation.Interface {\n constructor(private entity: CmsDdbEsGroupEntity.Interface) {}\n\n async execute(params: CmsGroupStorageOperationsDeleteParams) {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await this.entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete group.\",\n ex.code || \"DELETE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n }\n}\n\nexport const DdbEsDeleteGroup = DeleteGroupStorageOperation.createImplementation({\n implementation: DdbEsDeleteGroupImpl,\n dependencies: [CmsDdbEsGroupEntity]\n});\n"],"names":["DdbEsDeleteGroupImpl","entity","params","group","keys","createKeys","ex","WebinyError","DdbEsDeleteGroup","DeleteGroupStorageOperation","CmsDdbEsGroupEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAqC,CAAE;aAAvCA,MAAM,GAANA;IAAwC;IAE5D,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,OAAOC,WAAWF;QACxB,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAACC;QAC7B,EAAE,OAAOE,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPH;gBACAC;YACJ;QAER;IACJ;AACJ;AAEO,MAAMI,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBT;IAChB,cAAc;QAACU;KAAoB;AACvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsGroupStorageOperationsGetParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { GetGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/GetGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
declare class DdbEsGetGroupImpl implements GetGroupStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsGroupEntity.Interface);
|
|
7
|
+
execute(params: CmsGroupStorageOperationsGetParams): Promise<import("@webiny/api-headless-cms/types/modelGroup.js").CmsGroup | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsGetGroup: typeof DdbEsGetGroupImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/group/GetGroupStorageOperation.js").IGetGroupStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { GetGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/GetGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
import { createKeys } from "./keys.js";
|
|
5
|
+
class DdbEsGetGroupImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const keys = createKeys(params);
|
|
11
|
+
try {
|
|
12
|
+
const result = await this.entity.get(keys);
|
|
13
|
+
return result?.data || null;
|
|
14
|
+
} catch (ex) {
|
|
15
|
+
throw new error(ex.message || "Could not get group.", ex.code || "GET_GROUP_ERROR", {
|
|
16
|
+
error: ex,
|
|
17
|
+
...params,
|
|
18
|
+
keys
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const DdbEsGetGroup = GetGroupStorageOperation.createImplementation({
|
|
24
|
+
implementation: DdbEsGetGroupImpl,
|
|
25
|
+
dependencies: [
|
|
26
|
+
CmsDdbEsGroupEntity
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
export { DdbEsGetGroup };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=DdbEsGetGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/DdbEsGetGroup.js","sources":["../../../src/operations/group/DdbEsGetGroup.ts"],"sourcesContent":["import type { CmsGroupStorageOperationsGetParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { GetGroupStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/GetGroupStorageOperation.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbEsGetGroupImpl implements GetGroupStorageOperation.Interface {\n constructor(private entity: CmsDdbEsGroupEntity.Interface) {}\n\n async execute(params: CmsGroupStorageOperationsGetParams) {\n const keys = createKeys(params);\n\n try {\n const result = await this.entity.get(keys);\n\n return result?.data || null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get group.\",\n ex.code || \"GET_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n keys\n }\n );\n }\n }\n}\n\nexport const DdbEsGetGroup = GetGroupStorageOperation.createImplementation({\n implementation: DdbEsGetGroupImpl,\n dependencies: [CmsDdbEsGroupEntity]\n});\n"],"names":["DdbEsGetGroupImpl","entity","params","keys","createKeys","result","ex","WebinyError","DdbEsGetGroup","GetGroupStorageOperation","CmsDdbEsGroupEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAqC,CAAE;aAAvCA,MAAM,GAANA;IAAwC;IAE5D,MAAM,QAAQC,MAA0C,EAAE;QACtD,MAAMC,OAAOC,WAAWF;QAExB,IAAI;YACA,MAAMG,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAACF;YAErC,OAAOE,QAAQ,QAAQ;QAC3B,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,wBACdA,GAAG,IAAI,IAAI,mBACX;gBACI,OAAOA;gBACP,GAAGJ,MAAM;gBACTC;YACJ;QAER;IACJ;AACJ;AAEO,MAAMK,gBAAgBC,yBAAyB,oBAAoB,CAAC;IACvE,gBAAgBT;IAChB,cAAc;QAACU;KAAoB;AACvC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CmsGroup, CmsGroupStorageOperationsListParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { ListGroupsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/ListGroupsStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
import { FilterUtil } from "@webiny/db-dynamodb/exports/api/db.js";
|
|
5
|
+
declare class DdbEsListGroupsImpl implements ListGroupsStorageOperation.Interface {
|
|
6
|
+
private entity;
|
|
7
|
+
private filterUtil;
|
|
8
|
+
constructor(entity: CmsDdbEsGroupEntity.Interface, filterUtil: FilterUtil.Interface);
|
|
9
|
+
execute(params: CmsGroupStorageOperationsListParams): Promise<CmsGroup[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare const DdbEsListGroups: typeof DdbEsListGroupsImpl & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/group/ListGroupsStorageOperation.js").IListGroupsStorageOperation>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { sortItems } from "@webiny/db-dynamodb";
|
|
3
|
+
import { ListGroupsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/ListGroupsStorageOperation.js";
|
|
4
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
5
|
+
import { FilterUtil } from "@webiny/db-dynamodb/exports/api/db.js";
|
|
6
|
+
import { createPartitionKey } from "./keys.js";
|
|
7
|
+
class DdbEsListGroupsImpl {
|
|
8
|
+
constructor(entity, filterUtil){
|
|
9
|
+
this.entity = entity;
|
|
10
|
+
this.filterUtil = filterUtil;
|
|
11
|
+
}
|
|
12
|
+
async execute(params) {
|
|
13
|
+
const { sort, where } = params;
|
|
14
|
+
let records = [];
|
|
15
|
+
try {
|
|
16
|
+
const ddbRecords = await this.entity.queryAll({
|
|
17
|
+
partitionKey: createPartitionKey(where),
|
|
18
|
+
options: {
|
|
19
|
+
gte: " "
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
records = ddbRecords.map((item)=>item.data);
|
|
23
|
+
} catch (ex) {
|
|
24
|
+
throw new error(ex.message || "Could not list groups.", ex.code || "LIST_GROUP_ERROR", {
|
|
25
|
+
error: ex,
|
|
26
|
+
...params,
|
|
27
|
+
sort,
|
|
28
|
+
where
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const filteredItems = this.filterUtil.filter({
|
|
32
|
+
items: records,
|
|
33
|
+
where,
|
|
34
|
+
fields: []
|
|
35
|
+
});
|
|
36
|
+
if (!sort || 0 === sort.length) return filteredItems;
|
|
37
|
+
return sortItems({
|
|
38
|
+
items: filteredItems,
|
|
39
|
+
sort
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const DdbEsListGroups = ListGroupsStorageOperation.createImplementation({
|
|
44
|
+
implementation: DdbEsListGroupsImpl,
|
|
45
|
+
dependencies: [
|
|
46
|
+
CmsDdbEsGroupEntity,
|
|
47
|
+
FilterUtil
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
export { DdbEsListGroups };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=DdbEsListGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/DdbEsListGroups.js","sources":["../../../src/operations/group/DdbEsListGroups.ts"],"sourcesContent":["import type {\n CmsGroup,\n CmsGroupStorageOperationsListParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { sortItems } from \"@webiny/db-dynamodb\";\nimport { ListGroupsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/ListGroupsStorageOperation.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { FilterUtil } from \"@webiny/db-dynamodb/exports/api/db.js\";\nimport { createPartitionKey } from \"./keys.js\";\n\nclass DdbEsListGroupsImpl implements ListGroupsStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEsGroupEntity.Interface,\n private filterUtil: FilterUtil.Interface\n ) {}\n\n async execute(params: CmsGroupStorageOperationsListParams) {\n const { sort, where } = params;\n\n let records: CmsGroup[] = [];\n try {\n const ddbRecords = await this.entity.queryAll({\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n });\n records = ddbRecords.map(item => item.data);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list groups.\",\n ex.code || \"LIST_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n sort,\n where\n }\n );\n }\n\n const filteredItems = this.filterUtil.filter({\n items: records,\n where,\n fields: []\n });\n if (!sort || sort.length === 0) {\n return filteredItems;\n }\n\n return sortItems({\n items: filteredItems,\n sort\n });\n }\n}\n\nexport const DdbEsListGroups = ListGroupsStorageOperation.createImplementation({\n implementation: DdbEsListGroupsImpl,\n dependencies: [CmsDdbEsGroupEntity, FilterUtil]\n});\n"],"names":["DdbEsListGroupsImpl","entity","filterUtil","params","sort","where","records","ddbRecords","createPartitionKey","item","ex","WebinyError","filteredItems","sortItems","DdbEsListGroups","ListGroupsStorageOperation","CmsDdbEsGroupEntity","FilterUtil"],"mappings":";;;;;;AAWA,MAAMA;IACF,YACYC,MAAqC,EACrCC,UAAgC,CAC1C;aAFUD,MAAM,GAANA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,MAA2C,EAAE;QACvD,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGF;QAExB,IAAIG,UAAsB,EAAE;QAC5B,IAAI;YACA,MAAMC,aAAa,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAC1C,cAAcC,mBAAmBH;gBACjC,SAAS;oBACL,KAAK;gBACT;YACJ;YACAC,UAAUC,WAAW,GAAG,CAACE,CAAAA,OAAQA,KAAK,IAAI;QAC9C,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,0BACdA,GAAG,IAAI,IAAI,oBACX;gBACI,OAAOA;gBACP,GAAGP,MAAM;gBACTC;gBACAC;YACJ;QAER;QAEA,MAAMO,gBAAgB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YACzC,OAAON;YACPD;YACA,QAAQ,EAAE;QACd;QACA,IAAI,CAACD,QAAQA,AAAgB,MAAhBA,KAAK,MAAM,EACpB,OAAOQ;QAGX,OAAOC,UAAU;YACb,OAAOD;YACPR;QACJ;IACJ;AACJ;AAEO,MAAMU,kBAAkBC,2BAA2B,oBAAoB,CAAC;IAC3E,gBAAgBf;IAChB,cAAc;QAACgB;QAAqBC;KAAW;AACnD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsGroupStorageOperationsUpdateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { UpdateGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/UpdateGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
declare class DdbEsUpdateGroupImpl implements UpdateGroupStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsGroupEntity.Interface);
|
|
7
|
+
execute(params: CmsGroupStorageOperationsUpdateParams): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsUpdateGroup: typeof DdbEsUpdateGroupImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/group/UpdateGroupStorageOperation.js").IUpdateGroupStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { UpdateGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/UpdateGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
import { createKeys, createType } from "./keys.js";
|
|
5
|
+
class DdbEsUpdateGroupImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const { group } = params;
|
|
11
|
+
const keys = createKeys(group);
|
|
12
|
+
try {
|
|
13
|
+
await this.entity.put({
|
|
14
|
+
data: group,
|
|
15
|
+
TYPE: createType(),
|
|
16
|
+
...keys
|
|
17
|
+
});
|
|
18
|
+
} catch (ex) {
|
|
19
|
+
throw new error(ex.message || "Could not update group.", ex.code || "UPDATE_GROUP_ERROR", {
|
|
20
|
+
error: ex,
|
|
21
|
+
group,
|
|
22
|
+
keys
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const DdbEsUpdateGroup = UpdateGroupStorageOperation.createImplementation({
|
|
28
|
+
implementation: DdbEsUpdateGroupImpl,
|
|
29
|
+
dependencies: [
|
|
30
|
+
CmsDdbEsGroupEntity
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export { DdbEsUpdateGroup };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=DdbEsUpdateGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/DdbEsUpdateGroup.js","sources":["../../../src/operations/group/DdbEsUpdateGroup.ts"],"sourcesContent":["import type { CmsGroupStorageOperationsUpdateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { UpdateGroupStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/UpdateGroupStorageOperation.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbEsUpdateGroupImpl implements UpdateGroupStorageOperation.Interface {\n constructor(private entity: CmsDdbEsGroupEntity.Interface) {}\n\n async execute(params: CmsGroupStorageOperationsUpdateParams) {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await this.entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n }\n}\n\nexport const DdbEsUpdateGroup = UpdateGroupStorageOperation.createImplementation({\n implementation: DdbEsUpdateGroupImpl,\n dependencies: [CmsDdbEsGroupEntity]\n});\n"],"names":["DdbEsUpdateGroupImpl","entity","params","group","keys","createKeys","createType","ex","WebinyError","DdbEsUpdateGroup","UpdateGroupStorageOperation","CmsDdbEsGroupEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAqC,CAAE;aAAvCA,MAAM,GAANA;IAAwC;IAE5D,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,OAAOC,WAAWF;QACxB,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAMA;gBACN,MAAMG;gBACN,GAAGF,IAAI;YACX;QACJ,EAAE,OAAOG,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPJ;gBACAC;YACJ;QAER;IACJ;AACJ;AAEO,MAAMK,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBV;IAChB,cAAc;QAACW;KAAoB;AACvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { DdbEsGetGroup } from "./DdbEsGetGroup.js";
|
|
3
|
+
import { DdbEsListGroups } from "./DdbEsListGroups.js";
|
|
4
|
+
import { DdbEsCreateGroup } from "./DdbEsCreateGroup.js";
|
|
5
|
+
import { DdbEsUpdateGroup } from "./DdbEsUpdateGroup.js";
|
|
6
|
+
import { DdbEsDeleteGroup } from "./DdbEsDeleteGroup.js";
|
|
7
|
+
const DdbEsGroupStorageOpsFeature = createFeature({
|
|
8
|
+
name: "cms.ddbEs.groupStorageOps",
|
|
9
|
+
register: (container)=>{
|
|
10
|
+
container.register(DdbEsGetGroup);
|
|
11
|
+
container.register(DdbEsListGroups);
|
|
12
|
+
container.register(DdbEsCreateGroup);
|
|
13
|
+
container.register(DdbEsUpdateGroup);
|
|
14
|
+
container.register(DdbEsDeleteGroup);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { DdbEsGroupStorageOpsFeature };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/feature.js","sources":["../../../src/operations/group/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { DdbEsGetGroup } from \"./DdbEsGetGroup.js\";\nimport { DdbEsListGroups } from \"./DdbEsListGroups.js\";\nimport { DdbEsCreateGroup } from \"./DdbEsCreateGroup.js\";\nimport { DdbEsUpdateGroup } from \"./DdbEsUpdateGroup.js\";\nimport { DdbEsDeleteGroup } from \"./DdbEsDeleteGroup.js\";\n\nexport const DdbEsGroupStorageOpsFeature = createFeature({\n name: \"cms.ddbEs.groupStorageOps\",\n register: container => {\n container.register(DdbEsGetGroup);\n container.register(DdbEsListGroups);\n container.register(DdbEsCreateGroup);\n container.register(DdbEsUpdateGroup);\n container.register(DdbEsDeleteGroup);\n }\n});\n"],"names":["DdbEsGroupStorageOpsFeature","createFeature","container","DdbEsGetGroup","DdbEsListGroups","DdbEsCreateGroup","DdbEsUpdateGroup","DdbEsDeleteGroup"],"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 PartitionKeyParams {
|
|
2
|
+
tenant: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const createPartitionKey: (params: PartitionKeyParams) => string;
|
|
5
|
+
interface SortKeyParams {
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
interface Keys {
|
|
9
|
+
PK: string;
|
|
10
|
+
SK: string;
|
|
11
|
+
GSI_TENANT: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const createKeys: (params: PartitionKeyParams & 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#CMG`;
|
|
4
|
+
};
|
|
5
|
+
const createSortKeys = (params)=>{
|
|
6
|
+
const { id } = params;
|
|
7
|
+
return id;
|
|
8
|
+
};
|
|
9
|
+
const createKeys = (params)=>({
|
|
10
|
+
PK: createPartitionKey(params),
|
|
11
|
+
SK: createSortKeys(params),
|
|
12
|
+
GSI_TENANT: params.tenant
|
|
13
|
+
});
|
|
14
|
+
const createType = ()=>"cms.group";
|
|
15
|
+
export { createKeys, createPartitionKey, createType };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/keys.js","sources":["../../../src/operations/group/keys.ts"],"sourcesContent":["interface PartitionKeyParams {\n tenant: string;\n}\n\nexport const createPartitionKey = (params: PartitionKeyParams): string => {\n const { tenant } = params;\n return `T#${tenant}#CMS#CMG`;\n};\n\ninterface SortKeyParams {\n id: string;\n}\n\nconst createSortKeys = (params: SortKeyParams): string => {\n const { id } = params;\n return id;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\n\nexport const createKeys = (params: PartitionKeyParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKeys(params),\n GSI_TENANT: params.tenant\n };\n};\n\nexport const createType = (): string => {\n return \"cms.group\";\n};\n"],"names":["createPartitionKey","params","tenant","createSortKeys","id","createKeys","createType"],"mappings":"AAIO,MAAMA,qBAAqB,CAACC;IAC/B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO,CAAC,EAAE,EAAEC,OAAO,QAAQ,CAAC;AAChC;AAMA,MAAMC,iBAAiB,CAACF;IACpB,MAAM,EAAEG,EAAE,EAAE,GAAGH;IACf,OAAOG;AACX;AAQO,MAAMC,aAAa,CAACJ,SAChB;QACH,IAAID,mBAAmBC;QACvB,IAAIE,eAAeF;QACnB,YAAYA,OAAO,MAAM;IAC7B;AAGG,MAAMK,aAAa,IACf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CmsModelStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
5
|
+
declare class DdbEsCreateModelImpl implements CreateModelStorageOperation.Interface {
|
|
6
|
+
private entity;
|
|
7
|
+
private elasticsearch;
|
|
8
|
+
constructor(entity: CmsDdbEsModelEntity.Interface, openSearchClient: OpenSearchClient.Interface);
|
|
9
|
+
execute(params: CmsModelStorageOperationsCreateParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel>;
|
|
10
|
+
}
|
|
11
|
+
export declare const DdbEsCreateModel: typeof DdbEsCreateModelImpl & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js").ICreateModelStorageOperation>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { configurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
|
|
3
|
+
import { CreateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js";
|
|
4
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
5
|
+
import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
6
|
+
import { createKeys, createType } from "./keys.js";
|
|
7
|
+
class DdbEsCreateModelImpl {
|
|
8
|
+
constructor(entity, openSearchClient){
|
|
9
|
+
this.entity = entity;
|
|
10
|
+
this.elasticsearch = openSearchClient.use();
|
|
11
|
+
}
|
|
12
|
+
async execute(params) {
|
|
13
|
+
const { model } = params;
|
|
14
|
+
const { index } = configurations.es({
|
|
15
|
+
model
|
|
16
|
+
});
|
|
17
|
+
const keys = createKeys(model);
|
|
18
|
+
let error;
|
|
19
|
+
try {
|
|
20
|
+
await this.entity.put({
|
|
21
|
+
data: model,
|
|
22
|
+
...keys,
|
|
23
|
+
TYPE: createType()
|
|
24
|
+
});
|
|
25
|
+
return model;
|
|
26
|
+
} catch (ex) {
|
|
27
|
+
error = ex;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
await this.elasticsearch.indices.delete({
|
|
31
|
+
index,
|
|
32
|
+
ignore_unavailable: true
|
|
33
|
+
});
|
|
34
|
+
} catch (ex) {
|
|
35
|
+
throw new _webiny_error(`Could not delete elasticsearch index "${index}" after model record failed to be created.`, "DELETE_MODEL_INDEX_ERROR", {
|
|
36
|
+
dynamodbError: error,
|
|
37
|
+
elasticsearchError: ex
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const DdbEsCreateModel = CreateModelStorageOperation.createImplementation({
|
|
44
|
+
implementation: DdbEsCreateModelImpl,
|
|
45
|
+
dependencies: [
|
|
46
|
+
CmsDdbEsModelEntity,
|
|
47
|
+
OpenSearchClient
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
export { DdbEsCreateModel };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=DdbEsCreateModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/DdbEsCreateModel.js","sources":["../../../src/operations/model/DdbEsCreateModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsCreateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { configurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { CreateModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { OpenSearchClient } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbEsCreateModelImpl implements CreateModelStorageOperation.Interface {\n private elasticsearch;\n\n constructor(\n private entity: CmsDdbEsModelEntity.Interface,\n openSearchClient: OpenSearchClient.Interface\n ) {\n this.elasticsearch = openSearchClient.use();\n }\n\n async execute(params: CmsModelStorageOperationsCreateParams) {\n const { model } = params;\n\n const { index } = configurations.es({\n model\n });\n\n const keys = createKeys(model);\n\n let error;\n try {\n await this.entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n error = ex;\n }\n try {\n await this.elasticsearch.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not delete elasticsearch index \"${index}\" after model record failed to be created.`,\n \"DELETE_MODEL_INDEX_ERROR\",\n {\n dynamodbError: error,\n elasticsearchError: ex\n }\n );\n }\n throw error;\n }\n}\n\nexport const DdbEsCreateModel = CreateModelStorageOperation.createImplementation({\n implementation: DdbEsCreateModelImpl,\n dependencies: [CmsDdbEsModelEntity, OpenSearchClient]\n});\n"],"names":["DdbEsCreateModelImpl","entity","openSearchClient","params","model","index","configurations","keys","createKeys","error","createType","ex","WebinyError","DdbEsCreateModel","CreateModelStorageOperation","CmsDdbEsModelEntity","OpenSearchClient"],"mappings":";;;;;;AAQA,MAAMA;IAGF,YACYC,MAAqC,EAC7CC,gBAA4C,CAC9C;aAFUD,MAAM,GAANA;QAGR,IAAI,CAAC,aAAa,GAAGC,iBAAiB,GAAG;IAC7C;IAEA,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAElB,MAAM,EAAEE,KAAK,EAAE,GAAGC,eAAe,EAAE,CAAC;YAChCF;QACJ;QAEA,MAAMG,OAAOC,WAAWJ;QAExB,IAAIK;QACJ,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAML;gBACN,GAAGG,IAAI;gBACP,MAAMG;YACV;YACA,OAAON;QACX,EAAE,OAAOO,IAAI;YACTF,QAAQE;QACZ;QACA,IAAI;YACA,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;gBACpCN;gBACA,oBAAoB;YACxB;QACJ,EAAE,OAAOM,IAAI;YACT,MAAM,IAAIC,cACN,CAAC,sCAAsC,EAAEP,MAAM,0CAA0C,CAAC,EAC1F,4BACA;gBACI,eAAeI;gBACf,oBAAoBE;YACxB;QAER;QACA,MAAMF;IACV;AACJ;AAEO,MAAMI,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBd;IAChB,cAAc;QAACe;QAAqBC;KAAiB;AACzD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CmsModelStorageOperationsDeleteParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { DeleteModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
5
|
+
declare class DdbEsDeleteModelImpl implements DeleteModelStorageOperation.Interface {
|
|
6
|
+
private entity;
|
|
7
|
+
private elasticsearch;
|
|
8
|
+
constructor(entity: CmsDdbEsModelEntity.Interface, openSearchClient: OpenSearchClient.Interface);
|
|
9
|
+
execute(params: CmsModelStorageOperationsDeleteParams): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const DdbEsDeleteModel: typeof DdbEsDeleteModelImpl & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js").IDeleteModelStorageOperation>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { configurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
|
|
3
|
+
import { DeleteModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js";
|
|
4
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
5
|
+
import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
6
|
+
import { createKeys } from "./keys.js";
|
|
7
|
+
class DdbEsDeleteModelImpl {
|
|
8
|
+
constructor(entity, openSearchClient){
|
|
9
|
+
this.entity = entity;
|
|
10
|
+
this.elasticsearch = openSearchClient.use();
|
|
11
|
+
}
|
|
12
|
+
async execute(params) {
|
|
13
|
+
const { model } = params;
|
|
14
|
+
const keys = createKeys(model);
|
|
15
|
+
const { index } = configurations.es({
|
|
16
|
+
model
|
|
17
|
+
});
|
|
18
|
+
try {
|
|
19
|
+
await this.entity.delete(keys);
|
|
20
|
+
} catch (ex) {
|
|
21
|
+
throw new error(ex.message || "Could not delete model.", ex.code || "MODEL_DELETE_ERROR", {
|
|
22
|
+
error: ex,
|
|
23
|
+
model,
|
|
24
|
+
keys
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
await this.elasticsearch.indices.delete({
|
|
29
|
+
index,
|
|
30
|
+
ignore_unavailable: true
|
|
31
|
+
});
|
|
32
|
+
} catch (ex) {
|
|
33
|
+
throw new error(`Could not delete elasticsearch index "${index}" after model record delete.`, "DELETE_MODEL_INDEX_ERROR", {
|
|
34
|
+
error: ex,
|
|
35
|
+
index,
|
|
36
|
+
model
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const DdbEsDeleteModel = DeleteModelStorageOperation.createImplementation({
|
|
42
|
+
implementation: DdbEsDeleteModelImpl,
|
|
43
|
+
dependencies: [
|
|
44
|
+
CmsDdbEsModelEntity,
|
|
45
|
+
OpenSearchClient
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
export { DdbEsDeleteModel };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=DdbEsDeleteModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/DdbEsDeleteModel.js","sources":["../../../src/operations/model/DdbEsDeleteModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsDeleteParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { configurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { DeleteModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { OpenSearchClient } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbEsDeleteModelImpl implements DeleteModelStorageOperation.Interface {\n private elasticsearch;\n\n constructor(\n private entity: CmsDdbEsModelEntity.Interface,\n openSearchClient: OpenSearchClient.Interface\n ) {\n this.elasticsearch = openSearchClient.use();\n }\n\n async execute(params: CmsModelStorageOperationsDeleteParams): Promise<void> {\n const { model } = params;\n const keys = createKeys(model);\n\n const { index } = configurations.es({\n model\n });\n\n try {\n await this.entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n try {\n await this.elasticsearch.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not delete elasticsearch index \"${index}\" after model record delete.`,\n \"DELETE_MODEL_INDEX_ERROR\",\n {\n error: ex,\n index,\n model\n }\n );\n }\n }\n}\n\nexport const DdbEsDeleteModel = DeleteModelStorageOperation.createImplementation({\n implementation: DdbEsDeleteModelImpl,\n dependencies: [CmsDdbEsModelEntity, OpenSearchClient]\n});\n"],"names":["DdbEsDeleteModelImpl","entity","openSearchClient","params","model","keys","createKeys","index","configurations","ex","WebinyError","DdbEsDeleteModel","DeleteModelStorageOperation","CmsDdbEsModelEntity","OpenSearchClient"],"mappings":";;;;;;AAQA,MAAMA;IAGF,YACYC,MAAqC,EAC7CC,gBAA4C,CAC9C;aAFUD,MAAM,GAANA;QAGR,IAAI,CAAC,aAAa,GAAGC,iBAAiB,GAAG;IAC7C;IAEA,MAAM,QAAQC,MAA6C,EAAiB;QACxE,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,OAAOC,WAAWF;QAExB,MAAM,EAAEG,KAAK,EAAE,GAAGC,eAAe,EAAE,CAAC;YAChCJ;QACJ;QAEA,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAACC;QAC7B,EAAE,OAAOI,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPL;gBACAC;YACJ;QAER;QACA,IAAI;YACA,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;gBACpCE;gBACA,oBAAoB;YACxB;QACJ,EAAE,OAAOE,IAAI;YACT,MAAM,IAAIC,MACN,CAAC,sCAAsC,EAAEH,MAAM,4BAA4B,CAAC,EAC5E,4BACA;gBACI,OAAOE;gBACPF;gBACAH;YACJ;QAER;IACJ;AACJ;AAEO,MAAMO,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBZ;IAChB,cAAc;QAACa;QAAqBC;KAAiB;AACzD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModelStorageOperationsGetParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { GetModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
declare class DdbEsGetModelImpl implements GetModelStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsModelEntity.Interface);
|
|
7
|
+
execute(params: CmsModelStorageOperationsGetParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsGetModel: typeof DdbEsGetModelImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js").IGetModelStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { GetModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
import { createKeys } from "./keys.js";
|
|
5
|
+
class DdbEsGetModelImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const keys = createKeys(params);
|
|
11
|
+
try {
|
|
12
|
+
const result = await this.entity.get(keys);
|
|
13
|
+
return result ? result.data : null;
|
|
14
|
+
} catch (ex) {
|
|
15
|
+
throw new error(ex.message || "Could not get model.", ex.code || "MODEL_GET_ERROR", {
|
|
16
|
+
error: ex,
|
|
17
|
+
keys
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const DdbEsGetModel = GetModelStorageOperation.createImplementation({
|
|
23
|
+
implementation: DdbEsGetModelImpl,
|
|
24
|
+
dependencies: [
|
|
25
|
+
CmsDdbEsModelEntity
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
export { DdbEsGetModel };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=DdbEsGetModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/DdbEsGetModel.js","sources":["../../../src/operations/model/DdbEsGetModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsGetParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { GetModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbEsGetModelImpl implements GetModelStorageOperation.Interface {\n constructor(private entity: CmsDdbEsModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsGetParams) {\n const keys = createKeys(params);\n\n try {\n const result = await this.entity.get(keys);\n\n return result ? result.data : null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n }\n}\n\nexport const DdbEsGetModel = GetModelStorageOperation.createImplementation({\n implementation: DdbEsGetModelImpl,\n dependencies: [CmsDdbEsModelEntity]\n});\n"],"names":["DdbEsGetModelImpl","entity","params","keys","createKeys","result","ex","WebinyError","DdbEsGetModel","GetModelStorageOperation","CmsDdbEsModelEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAqC,CAAE;aAAvCA,MAAM,GAANA;IAAwC;IAE5D,MAAM,QAAQC,MAA0C,EAAE;QACtD,MAAMC,OAAOC,WAAWF;QAExB,IAAI;YACA,MAAMG,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAACF;YAErC,OAAOE,SAASA,OAAO,IAAI,GAAG;QAClC,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,wBACdA,GAAG,IAAI,IAAI,mBACX;gBACI,OAAOA;gBACPH;YACJ;QAER;IACJ;AACJ;AAEO,MAAMK,gBAAgBC,yBAAyB,oBAAoB,CAAC;IACvE,gBAAgBT;IAChB,cAAc;QAACU;KAAoB;AACvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModelStorageOperationsListParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { ListModelsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
declare class DdbEsListModelsImpl implements ListModelsStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsModelEntity.Interface);
|
|
7
|
+
execute(params: CmsModelStorageOperationsListParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel[]>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsListModels: typeof DdbEsListModelsImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js").IListModelsStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { ListModelsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
import { createPartitionKey } from "./keys.js";
|
|
5
|
+
class DdbEsListModelsImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const { where } = params;
|
|
11
|
+
const partitionKey = createPartitionKey(where);
|
|
12
|
+
try {
|
|
13
|
+
const result = await this.entity.queryAll({
|
|
14
|
+
partitionKey,
|
|
15
|
+
options: {
|
|
16
|
+
gte: " "
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return result ? result.map((item)=>item.data) : [];
|
|
20
|
+
} catch (ex) {
|
|
21
|
+
throw new error(ex.message || "Could not list models.", ex.code || "MODEL_LIST_ERROR", {
|
|
22
|
+
error: ex,
|
|
23
|
+
partitionKey
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const DdbEsListModels = ListModelsStorageOperation.createImplementation({
|
|
29
|
+
implementation: DdbEsListModelsImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
CmsDdbEsModelEntity
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { DdbEsListModels };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=DdbEsListModels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/DdbEsListModels.js","sources":["../../../src/operations/model/DdbEsListModels.ts"],"sourcesContent":["import type { CmsModelStorageOperationsListParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { ListModelsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { createPartitionKey } from \"./keys.js\";\n\nclass DdbEsListModelsImpl implements ListModelsStorageOperation.Interface {\n constructor(private entity: CmsDdbEsModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsListParams) {\n const { where } = params;\n const partitionKey = createPartitionKey(where);\n try {\n const result = await this.entity.queryAll({\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n return result ? result.map(item => item.data) : [];\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey\n }\n );\n }\n }\n}\n\nexport const DdbEsListModels = ListModelsStorageOperation.createImplementation({\n implementation: DdbEsListModelsImpl,\n dependencies: [CmsDdbEsModelEntity]\n});\n"],"names":["DdbEsListModelsImpl","entity","params","where","partitionKey","createPartitionKey","result","item","ex","WebinyError","DdbEsListModels","ListModelsStorageOperation","CmsDdbEsModelEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAqC,CAAE;aAAvCA,MAAM,GAANA;IAAwC;IAE5D,MAAM,QAAQC,MAA2C,EAAE;QACvD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,eAAeC,mBAAmBF;QACxC,IAAI;YACA,MAAMG,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACtCF;gBACA,SAAS;oBACL,KAAK;gBACT;YACJ;YACA,OAAOE,SAASA,OAAO,GAAG,CAACC,CAAAA,OAAQA,KAAK,IAAI,IAAI,EAAE;QACtD,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,0BACdA,GAAG,IAAI,IAAI,oBACX;gBACI,OAAOA;gBACPJ;YACJ;QAER;IACJ;AACJ;AAEO,MAAMM,kBAAkBC,2BAA2B,oBAAoB,CAAC;IAC3E,gBAAgBX;IAChB,cAAc;QAACY;KAAoB;AACvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModelStorageOperationsUpdateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { UpdateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
declare class DdbEsUpdateModelImpl implements UpdateModelStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsModelEntity.Interface);
|
|
7
|
+
execute(params: CmsModelStorageOperationsUpdateParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsUpdateModel: typeof DdbEsUpdateModelImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js").IUpdateModelStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { UpdateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsModelEntity } from "../../abstractions/CmsDdbEsModelEntity.js";
|
|
4
|
+
import { createKeys, createType } from "./keys.js";
|
|
5
|
+
class DdbEsUpdateModelImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const { model } = params;
|
|
11
|
+
const keys = createKeys(model);
|
|
12
|
+
try {
|
|
13
|
+
await this.entity.put({
|
|
14
|
+
data: model,
|
|
15
|
+
...keys,
|
|
16
|
+
TYPE: createType()
|
|
17
|
+
});
|
|
18
|
+
return model;
|
|
19
|
+
} catch (ex) {
|
|
20
|
+
throw new error(ex.message || "Could not update model.", ex.code || "MODEL_UPDATE_ERROR", {
|
|
21
|
+
error: ex,
|
|
22
|
+
model,
|
|
23
|
+
keys
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const DdbEsUpdateModel = UpdateModelStorageOperation.createImplementation({
|
|
29
|
+
implementation: DdbEsUpdateModelImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
CmsDdbEsModelEntity
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { DdbEsUpdateModel };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=DdbEsUpdateModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/DdbEsUpdateModel.js","sources":["../../../src/operations/model/DdbEsUpdateModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsUpdateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { UpdateModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbEsUpdateModelImpl implements UpdateModelStorageOperation.Interface {\n constructor(private entity: CmsDdbEsModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsUpdateParams) {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await this.entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n }\n}\n\nexport const DdbEsUpdateModel = UpdateModelStorageOperation.createImplementation({\n implementation: DdbEsUpdateModelImpl,\n dependencies: [CmsDdbEsModelEntity]\n});\n"],"names":["DdbEsUpdateModelImpl","entity","params","model","keys","createKeys","createType","ex","WebinyError","DdbEsUpdateModel","UpdateModelStorageOperation","CmsDdbEsModelEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAqC,CAAE;aAAvCA,MAAM,GAANA;IAAwC;IAE5D,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAElB,MAAME,OAAOC,WAAWF;QAExB,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAMA;gBACN,GAAGC,IAAI;gBACP,MAAME;YACV;YACA,OAAOH;QACX,EAAE,OAAOI,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPJ;gBACAC;YACJ;QAER;IACJ;AACJ;AAEO,MAAMK,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBV;IAChB,cAAc;QAACW;KAAoB;AACvC"}
|