@webiny/api-headless-cms-ddb-es 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e
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/definitions/entry.js +7 -9
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js +7 -9
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +7 -9
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +4 -0
- package/definitions/types.js +0 -3
- package/feature.d.ts +9 -1
- package/feature.js +46 -179
- package/feature.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -3
- 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 +76 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +25 -0
- package/operations/entry/DdbEsListEntries.js +91 -0
- package/operations/entry/DdbEsListEntries.js.map +1 -0
- package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
- package/operations/entry/DdbEsMoveEntry.js +113 -0
- package/operations/entry/DdbEsMoveEntry.js.map +1 -0
- package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
- package/operations/entry/DdbEsMoveToBin.js +137 -0
- package/operations/entry/DdbEsMoveToBin.js.map +1 -0
- package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsPublishEntry.js +231 -0
- package/operations/entry/DdbEsPublishEntry.js.map +1 -0
- package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
- package/operations/entry/DdbEsRestoreFromBin.js +137 -0
- package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsUnpublishEntry.js +127 -0
- package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
- package/operations/entry/DdbEsUpdateEntry.js +175 -0
- package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +22 -26
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +2 -1
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -29
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +27 -37
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +27 -37
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.js +32 -46
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.js +8 -9
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.js +0 -3
- package/operations/entry/dataLoaders.d.ts +5 -5
- package/operations/entry/dataLoaders.js +89 -99
- package/operations/entry/dataLoaders.js.map +1 -1
- package/{features/CmsEntryOpenSearchIndex → operations/entry}/feature.d.ts +1 -1
- package/operations/entry/feature.js +53 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.js +43 -63
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +4 -9
- package/operations/entry/recordType.js.map +1 -1
- 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/convertEntryKeys.js +21 -26
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +2 -5
- package/operations/entry/transformations/index.js +85 -115
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +3 -3
- package/operations/entry/transformations/modifyEntryValues.js +12 -17
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.js +13 -16
- package/operations/entry/transformations/transformEntryKeys.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 +33 -27
- package/requestFeature.d.ts +20 -0
- package/requestFeature.js +54 -0
- package/requestFeature.js.map +1 -0
- package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
- package/tasks/CreateElasticsearchIndexTask.js +40 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +11 -50
- package/types.js +7 -13
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -19
- package/configurations.js +0 -39
- package/configurations.js.map +0 -1
- package/definitions/types.js.map +0 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -74
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
- package/elasticsearch/deleteElasticsearchIndex.js +0 -31
- package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
- package/exports/api/cms/opensearch.d.ts +0 -9
- package/exports/api/cms/opensearch.js +0 -11
- package/exports/api/cms/opensearch.js.map +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +0 -16
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +0 -4
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -3
- package/features/CmsEntryOpenSearchBodyModifier/index.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -13
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +0 -36
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +0 -35
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +0 -4
- 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 -4
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +0 -3
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +0 -24
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +0 -11
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +0 -77
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +0 -39
- 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 -22
- 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 -25
- 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 -37
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +0 -10
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +0 -158
- 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 -22
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -5
- package/features/CmsEntryOpenSearchFieldIndex/index.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +0 -11
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +0 -38
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +0 -37
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +0 -4
- 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 -4
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +0 -1
- package/features/CmsEntryOpenSearchFilter/constants.js +0 -3
- package/features/CmsEntryOpenSearchFilter/constants.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/feature.js +0 -16
- package/features/CmsEntryOpenSearchFilter/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +0 -9
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +0 -23
- 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 -61
- 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 -49
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +0 -1
- package/features/CmsEntryOpenSearchFilter/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchFilter/index.js +0 -5
- package/features/CmsEntryOpenSearchFilter/index.js.map +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +0 -20
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +0 -4
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -3
- package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +0 -1
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +0 -11
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +0 -16
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +0 -1
- package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +0 -14
- package/features/CmsEntryOpenSearchIndex/abstractions.js +0 -4
- package/features/CmsEntryOpenSearchIndex/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchIndex/feature.js +0 -10
- package/features/CmsEntryOpenSearchIndex/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchIndex/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchIndex/index.js +0 -5
- package/features/CmsEntryOpenSearchIndex/index.js.map +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +0 -16
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +0 -4
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -3
- package/features/CmsEntryOpenSearchQueryModifier/index.js.map +0 -1
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +0 -15
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +0 -4
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchSortModifier/index.js +0 -3
- package/features/CmsEntryOpenSearchSortModifier/index.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -12
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +0 -27
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +0 -22
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +0 -4
- 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 -4
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +0 -4
- package/features/CmsEntryOpenSearchValueSearch/feature.js +0 -16
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +0 -10
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +0 -23
- 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 -55
- 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 -24
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +0 -1
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +0 -3
- package/features/CmsEntryOpenSearchValueSearch/index.js +0 -5
- package/features/CmsEntryOpenSearchValueSearch/index.js.map +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +0 -23
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +0 -4
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +0 -1
- package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -3
- package/features/CmsEntryOpenSearchValuesModifier/index.js.map +0 -1
- package/helpers/entryIndexHelpers.d.ts +0 -20
- package/helpers/entryIndexHelpers.js +0 -134
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/fieldIdentifier.d.ts +0 -6
- package/helpers/fieldIdentifier.js +0 -35
- package/helpers/fieldIdentifier.js.map +0 -1
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -4
- package/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/dataLoader/types.js.map +0 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -27
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
- package/operations/entry/elasticsearch/body.d.ts +0 -29
- package/operations/entry/elasticsearch/body.js +0 -138
- 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 -10
- 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 -45
- 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 -45
- 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 -93
- 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 -231
- 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 -52
- 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 -125
- 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 -3
- package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -17
- package/operations/entry/elasticsearch/filtering/path.js +0 -36
- 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 -18
- 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 -16
- 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 -88
- 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 -20
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
- package/operations/entry/elasticsearch/initialQuery.js +0 -88
- 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 -31
- 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 -24
- 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 -6
- 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 -103
- 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 -17
- 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 -3
- package/operations/entry/elasticsearch/types.js.map +0 -1
- package/operations/entry/index.d.ts +0 -32
- package/operations/entry/index.js +0 -1761
- package/operations/entry/index.js.map +0 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -12
- package/operations/entry/transformations/transformEntryToIndex.js +0 -26
- package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
- package/operations/group/index.d.ts +0 -9
- package/operations/group/index.js +0 -142
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -163
- package/operations/model/index.js.map +0 -1
- package/tasks/createIndexTaskPlugin.d.ts +0 -2
- package/tasks/createIndexTaskPlugin.js +0 -48
- package/tasks/createIndexTaskPlugin.js.map +0 -1
- package/values/NoValueContainer.d.ts +0 -5
- package/values/NoValueContainer.js +0 -13
- package/values/NoValueContainer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["transformEntryKeys","transformEntryToIndex","modifyEntryValues","modifyEntryValuesCallable","createLatestRecordType","createPublishedRecordType","WebinyError","createTransformer","params","model","fieldRegistry","fieldIndexRegistry","entry","baseEntry","storageEntry","baseStorageEntry","transformedToIndex","initialTransformedEntryToIndex","undefined","compressionHandler","valuesModifiers","transformedEntryKeys","transformedEntryToIndex","modifiedEntryValues","elasticsearchLatestEntry","elasticsearchPublishedEntry","applicableModifiers","filter","m","canModify","modelId","modifiedEntry","modifiers","modifiedStorageEntry","transformToIndex","length","result","getElasticsearchLatestEntryData","compress","latest","TYPE","__type","getElasticsearchPublishedEntryData","published"],"sources":["index.ts"],"sourcesContent":["import type {\n CmsEntry,\n CmsEntryValues,\n CmsStorageEntry,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { transformEntryKeys } from \"./transformEntryKeys.js\";\nimport type { CmsIndexEntry } from \"~/types.js\";\nimport { transformEntryToIndex } from \"~/operations/entry/transformations/transformEntryToIndex.js\";\nimport type { CmsEntryOpenSearchValuesModifier } from \"~/features/CmsEntryOpenSearchValuesModifier/index.js\";\nimport { modifyEntryValues as modifyEntryValuesCallable } from \"~/operations/entry/transformations/modifyEntryValues.js\";\nimport {\n createLatestRecordType,\n createPublishedRecordType\n} from \"~/operations/entry/recordType.js\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/features/graphql/index.js\";\nimport { CompressionHandler } from \"@webiny/utils/features/compression/abstractions/CompressionHandler.js\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\n\ninterface BaseTransformerParams<T extends CmsEntryValues = CmsEntryValues> {\n model: StorageOperationsCmsModel<T>;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;\n compressionHandler: Pick<CompressionHandler.Interface, \"compress\">;\n valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[];\n}\n\ninterface EntryTransformerParams<\n T extends CmsEntryValues = CmsEntryValues\n> extends BaseTransformerParams<T> {\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n transformedToIndex?: never;\n}\n\ninterface TransformedEntryTransformerParams<\n T extends CmsEntryValues = CmsEntryValues\n> extends BaseTransformerParams<T> {\n entry?: never;\n storageEntry?: never;\n transformedToIndex: CmsIndexEntry<T>;\n}\n\ninterface TransformedKeysEntry<T extends CmsEntryValues = CmsEntryValues> {\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n}\n\ninterface ModifiedEntryValues<T extends CmsEntryValues = CmsEntryValues> {\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n}\n\ninterface TransformerResult<T extends CmsEntryValues = CmsEntryValues> {\n transformEntryKeys: () => TransformedKeysEntry<T>;\n transformToIndex: () => CmsIndexEntry<T>;\n getElasticsearchLatestEntryData: () => Promise<Record<string, any>>;\n getElasticsearchPublishedEntryData: () => Promise<Record<string, any>>;\n}\n\nexport const createTransformer = <T extends CmsEntryValues = CmsEntryValues>(\n params: EntryTransformerParams<T> | TransformedEntryTransformerParams<T>\n): TransformerResult<T> => {\n const {\n model,\n fieldRegistry,\n fieldIndexRegistry,\n entry: baseEntry,\n storageEntry: baseStorageEntry,\n transformedToIndex: initialTransformedEntryToIndex = undefined,\n compressionHandler,\n valuesModifiers\n } = params;\n\n let transformedEntryKeys: TransformedKeysEntry<T> | undefined = undefined;\n let transformedEntryToIndex: CmsIndexEntry<T> | undefined = initialTransformedEntryToIndex;\n let modifiedEntryValues: ModifiedEntryValues<T> | undefined = undefined;\n let elasticsearchLatestEntry: any = undefined;\n let elasticsearchPublishedEntry: any = undefined;\n\n const applicableModifiers = valuesModifiers.filter(m => m.canModify(model.modelId));\n\n const modifyEntryValues = () => {\n if (initialTransformedEntryToIndex || !baseEntry) {\n throw new WebinyError(\n `Should not call the \"modifyEntryValues\" when \"transformedToIndex\" is provided.`,\n \"METHOD_NOT_ALLOWED\",\n {\n entry: initialTransformedEntryToIndex\n }\n );\n }\n if (modifiedEntryValues) {\n return modifiedEntryValues;\n }\n const modifiedEntry = modifyEntryValuesCallable<T>({\n modifiers: applicableModifiers,\n model,\n entry: baseEntry\n });\n const modifiedStorageEntry = modifyEntryValuesCallable<T>({\n modifiers: applicableModifiers,\n model,\n entry: baseStorageEntry\n });\n\n return (modifiedEntryValues = transformEntryKeys<T>({\n model,\n entry: modifiedEntry,\n storageEntry: modifiedStorageEntry\n }));\n };\n\n return {\n transformEntryKeys: function () {\n if (initialTransformedEntryToIndex || !baseEntry) {\n throw new WebinyError(\n `Should not call the \"modifyEntryValues\" when \"transformedToIndex\" is provided.`,\n \"METHOD_NOT_ALLOWED\",\n {\n entry: initialTransformedEntryToIndex\n }\n );\n }\n if (transformedEntryKeys) {\n return transformedEntryKeys;\n }\n return (transformedEntryKeys = transformEntryKeys({\n model,\n entry: baseEntry,\n storageEntry: baseStorageEntry\n }));\n },\n transformToIndex: function () {\n if (transformedEntryToIndex) {\n return transformedEntryToIndex;\n }\n let entry: CmsEntry<T>;\n let storageEntry: CmsStorageEntry<T>;\n /**\n * In case there are value modifier plugins, we need to\n * - run modifiers\n * - transform keys\n */\n if (applicableModifiers.length > 0) {\n const result = modifyEntryValues();\n entry = result.entry;\n storageEntry = result.storageEntry;\n }\n // In case there are no modifier plugins, just transform the keys - or used already transformed.\n else {\n const result = this.transformEntryKeys();\n entry = result.entry;\n storageEntry = result.storageEntry;\n }\n return (transformedEntryToIndex = transformEntryToIndex<T>({\n model,\n entry,\n storageEntry,\n fieldRegistry,\n fieldIndexRegistry\n }));\n },\n getElasticsearchLatestEntryData: async function () {\n if (elasticsearchLatestEntry) {\n return elasticsearchLatestEntry;\n }\n const entry = this.transformToIndex();\n\n return (elasticsearchLatestEntry = await compressionHandler.compress({\n ...entry,\n latest: true,\n TYPE: createLatestRecordType(),\n __type: createLatestRecordType()\n }));\n },\n getElasticsearchPublishedEntryData: async function () {\n if (elasticsearchPublishedEntry) {\n return elasticsearchPublishedEntry;\n }\n const entry = this.transformToIndex();\n\n return (elasticsearchPublishedEntry = await compressionHandler.compress({\n ...entry,\n published: true,\n TYPE: createPublishedRecordType(),\n __type: createPublishedRecordType()\n }));\n }\n };\n};\n"],"mappings":"AAMA,SAASA,kBAAkB;AAE3B,SAASC,qBAAqB;AAE9B,SAASC,iBAAiB,IAAIC,yBAAyB;AACvD,SACIC,sBAAsB,EACtBC,yBAAyB;AAE7B,OAAOC,WAAW,MAAM,eAAe;AA8CvC,OAAO,MAAMC,iBAAiB,GAC1BC,MAAwE,IACjD;EACvB,MAAM;IACFC,KAAK;IACLC,aAAa;IACbC,kBAAkB;IAClBC,KAAK,EAAEC,SAAS;IAChBC,YAAY,EAAEC,gBAAgB;IAC9BC,kBAAkB,EAAEC,8BAA8B,GAAGC,SAAS;IAC9DC,kBAAkB;IAClBC;EACJ,CAAC,GAAGZ,MAAM;EAEV,IAAIa,oBAAyD,GAAGH,SAAS;EACzE,IAAII,uBAAqD,GAAGL,8BAA8B;EAC1F,IAAIM,mBAAuD,GAAGL,SAAS;EACvE,IAAIM,wBAA6B,GAAGN,SAAS;EAC7C,IAAIO,2BAAgC,GAAGP,SAAS;EAEhD,MAAMQ,mBAAmB,GAAGN,eAAe,CAACO,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,SAAS,CAACpB,KAAK,CAACqB,OAAO,CAAC,CAAC;EAEnF,MAAM5B,iBAAiB,GAAGA,CAAA,KAAM;IAC5B,IAAIe,8BAA8B,IAAI,CAACJ,SAAS,EAAE;MAC9C,MAAM,IAAIP,WAAW,CACjB,gFAAgF,EAChF,oBAAoB,EACpB;QACIM,KAAK,EAAEK;MACX,CACJ,CAAC;IACL;IACA,IAAIM,mBAAmB,EAAE;MACrB,OAAOA,mBAAmB;IAC9B;IACA,MAAMQ,aAAa,GAAG5B,yBAAyB,CAAI;MAC/C6B,SAAS,EAAEN,mBAAmB;MAC9BjB,KAAK;MACLG,KAAK,EAAEC;IACX,CAAC,CAAC;IACF,MAAMoB,oBAAoB,GAAG9B,yBAAyB,CAAI;MACtD6B,SAAS,EAAEN,mBAAmB;MAC9BjB,KAAK;MACLG,KAAK,EAAEG;IACX,CAAC,CAAC;IAEF,OAAQQ,mBAAmB,GAAGvB,kBAAkB,CAAI;MAChDS,KAAK;MACLG,KAAK,EAAEmB,aAAa;MACpBjB,YAAY,EAAEmB;IAClB,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHjC,kBAAkB,EAAE,SAAAA,CAAA,EAAY;MAC5B,IAAIiB,8BAA8B,IAAI,CAACJ,SAAS,EAAE;QAC9C,MAAM,IAAIP,WAAW,CACjB,gFAAgF,EAChF,oBAAoB,EACpB;UACIM,KAAK,EAAEK;QACX,CACJ,CAAC;MACL;MACA,IAAII,oBAAoB,EAAE;QACtB,OAAOA,oBAAoB;MAC/B;MACA,OAAQA,oBAAoB,GAAGrB,kBAAkB,CAAC;QAC9CS,KAAK;QACLG,KAAK,EAAEC,SAAS;QAChBC,YAAY,EAAEC;MAClB,CAAC,CAAC;IACN,CAAC;IACDmB,gBAAgB,EAAE,SAAAA,CAAA,EAAY;MAC1B,IAAIZ,uBAAuB,EAAE;QACzB,OAAOA,uBAAuB;MAClC;MACA,IAAIV,KAAkB;MACtB,IAAIE,YAAgC;MACpC;AACZ;AACA;AACA;AACA;MACY,IAAIY,mBAAmB,CAACS,MAAM,GAAG,CAAC,EAAE;QAChC,MAAMC,MAAM,GAAGlC,iBAAiB,CAAC,CAAC;QAClCU,KAAK,GAAGwB,MAAM,CAACxB,KAAK;QACpBE,YAAY,GAAGsB,MAAM,CAACtB,YAAY;MACtC;MACA;MAAA,KACK;QACD,MAAMsB,MAAM,GAAG,IAAI,CAACpC,kBAAkB,CAAC,CAAC;QACxCY,KAAK,GAAGwB,MAAM,CAACxB,KAAK;QACpBE,YAAY,GAAGsB,MAAM,CAACtB,YAAY;MACtC;MACA,OAAQQ,uBAAuB,GAAGrB,qBAAqB,CAAI;QACvDQ,KAAK;QACLG,KAAK;QACLE,YAAY;QACZJ,aAAa;QACbC;MACJ,CAAC,CAAC;IACN,CAAC;IACD0B,+BAA+B,EAAE,eAAAA,CAAA,EAAkB;MAC/C,IAAIb,wBAAwB,EAAE;QAC1B,OAAOA,wBAAwB;MACnC;MACA,MAAMZ,KAAK,GAAG,IAAI,CAACsB,gBAAgB,CAAC,CAAC;MAErC,OAAQV,wBAAwB,GAAG,MAAML,kBAAkB,CAACmB,QAAQ,CAAC;QACjE,GAAG1B,KAAK;QACR2B,MAAM,EAAE,IAAI;QACZC,IAAI,EAAEpC,sBAAsB,CAAC,CAAC;QAC9BqC,MAAM,EAAErC,sBAAsB,CAAC;MACnC,CAAC,CAAC;IACN,CAAC;IACDsC,kCAAkC,EAAE,eAAAA,CAAA,EAAkB;MAClD,IAAIjB,2BAA2B,EAAE;QAC7B,OAAOA,2BAA2B;MACtC;MACA,MAAMb,KAAK,GAAG,IAAI,CAACsB,gBAAgB,CAAC,CAAC;MAErC,OAAQT,2BAA2B,GAAG,MAAMN,kBAAkB,CAACmB,QAAQ,CAAC;QACpE,GAAG1B,KAAK;QACR+B,SAAS,EAAE,IAAI;QACfH,IAAI,EAAEnC,yBAAyB,CAAC,CAAC;QACjCoC,MAAM,EAAEpC,yBAAyB,CAAC;MACtC,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"operations/entry/transformations/index.js","sources":["../../../../src/operations/entry/transformations/index.ts"],"sourcesContent":["import type {\n CmsEntry,\n CmsEntryValues,\n CmsStorageEntry,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { transformEntryKeys } from \"./transformEntryKeys.js\";\nimport type { CmsIndexEntry } from \"@webiny/api-headless-cms-utils-os/types.js\";\nimport { transformEntryToIndex } from \"@webiny/api-headless-cms-utils-os/operations/entry/transformations/transformEntryToIndex.js\";\nimport {\n CmsEntryOpenSearchFieldIndexRegistry,\n type CmsEntryOpenSearchValuesModifier\n} from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\nimport { modifyEntryValues as modifyEntryValuesCallable } from \"~/operations/entry/transformations/modifyEntryValues.js\";\nimport {\n createLatestRecordType,\n createPublishedRecordType\n} from \"~/operations/entry/recordType.js\";\nimport WebinyError from \"@webiny/error\";\nimport { CompressionHandler } from \"@webiny/utils/features/compression/abstractions/CompressionHandler.js\";\n\ninterface BaseTransformerParams<T extends CmsEntryValues = CmsEntryValues> {\n model: StorageOperationsCmsModel<T>;\n fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;\n compressionHandler: Pick<CompressionHandler.Interface, \"compress\">;\n valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[];\n}\n\ninterface EntryTransformerParams<\n T extends CmsEntryValues = CmsEntryValues\n> extends BaseTransformerParams<T> {\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n transformedToIndex?: never;\n}\n\ninterface TransformedEntryTransformerParams<\n T extends CmsEntryValues = CmsEntryValues\n> extends BaseTransformerParams<T> {\n entry?: never;\n storageEntry?: never;\n transformedToIndex: CmsIndexEntry<T>;\n}\n\ninterface TransformedKeysEntry<T extends CmsEntryValues = CmsEntryValues> {\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n}\n\ninterface ModifiedEntryValues<T extends CmsEntryValues = CmsEntryValues> {\n entry: CmsEntry<T>;\n storageEntry: CmsEntry<T>;\n}\n\ninterface TransformerResult<T extends CmsEntryValues = CmsEntryValues> {\n transformEntryKeys: () => TransformedKeysEntry<T>;\n transformToIndex: () => CmsIndexEntry<T>;\n getElasticsearchLatestEntryData: () => Promise<Record<string, any>>;\n getElasticsearchPublishedEntryData: () => Promise<Record<string, any>>;\n}\n\nexport const createTransformer = <T extends CmsEntryValues = CmsEntryValues>(\n params: EntryTransformerParams<T> | TransformedEntryTransformerParams<T>\n): TransformerResult<T> => {\n const {\n model,\n fieldIndexRegistry,\n entry: baseEntry,\n storageEntry: baseStorageEntry,\n transformedToIndex: initialTransformedEntryToIndex = undefined,\n compressionHandler,\n valuesModifiers\n } = params;\n\n let transformedEntryKeys: TransformedKeysEntry<T> | undefined = undefined;\n let transformedEntryToIndex: CmsIndexEntry<T> | undefined = initialTransformedEntryToIndex;\n let modifiedEntryValues: ModifiedEntryValues<T> | undefined = undefined;\n let elasticsearchLatestEntry: any = undefined;\n let elasticsearchPublishedEntry: any = undefined;\n\n const applicableModifiers = valuesModifiers.filter(m => m.canModify(model.modelId));\n\n const modifyEntryValues = () => {\n if (initialTransformedEntryToIndex || !baseEntry) {\n throw new WebinyError(\n `Should not call the \"modifyEntryValues\" when \"transformedToIndex\" is provided.`,\n \"METHOD_NOT_ALLOWED\",\n {\n entry: initialTransformedEntryToIndex\n }\n );\n }\n if (modifiedEntryValues) {\n return modifiedEntryValues;\n }\n const modifiedEntry = modifyEntryValuesCallable<T>({\n modifiers: applicableModifiers,\n model,\n entry: baseEntry\n });\n const modifiedStorageEntry = modifyEntryValuesCallable<T>({\n modifiers: applicableModifiers,\n model,\n entry: baseStorageEntry\n });\n\n return (modifiedEntryValues = transformEntryKeys<T>({\n model,\n entry: modifiedEntry,\n storageEntry: modifiedStorageEntry\n }));\n };\n\n return {\n transformEntryKeys: function () {\n if (initialTransformedEntryToIndex || !baseEntry) {\n throw new WebinyError(\n `Should not call the \"modifyEntryValues\" when \"transformedToIndex\" is provided.`,\n \"METHOD_NOT_ALLOWED\",\n {\n entry: initialTransformedEntryToIndex\n }\n );\n }\n if (transformedEntryKeys) {\n return transformedEntryKeys;\n }\n return (transformedEntryKeys = transformEntryKeys({\n model,\n entry: baseEntry,\n storageEntry: baseStorageEntry\n }));\n },\n transformToIndex: function () {\n if (transformedEntryToIndex) {\n return transformedEntryToIndex;\n }\n let entry: CmsEntry<T>;\n let storageEntry: CmsStorageEntry<T>;\n /**\n * In case there are value modifier plugins, we need to\n * - run modifiers\n * - transform keys\n */\n if (applicableModifiers.length > 0) {\n const result = modifyEntryValues();\n entry = result.entry;\n storageEntry = result.storageEntry;\n }\n // In case there are no modifier plugins, just transform the keys - or used already transformed.\n else {\n const result = this.transformEntryKeys();\n entry = result.entry;\n storageEntry = result.storageEntry;\n }\n return (transformedEntryToIndex = transformEntryToIndex<T>({\n model,\n entry,\n storageEntry,\n fieldIndexRegistry\n }));\n },\n getElasticsearchLatestEntryData: async function () {\n if (elasticsearchLatestEntry) {\n return elasticsearchLatestEntry;\n }\n const entry = this.transformToIndex();\n\n return (elasticsearchLatestEntry = await compressionHandler.compress({\n ...entry,\n latest: true,\n TYPE: createLatestRecordType(),\n __type: createLatestRecordType()\n }));\n },\n getElasticsearchPublishedEntryData: async function () {\n if (elasticsearchPublishedEntry) {\n return elasticsearchPublishedEntry;\n }\n const entry = this.transformToIndex();\n\n return (elasticsearchPublishedEntry = await compressionHandler.compress({\n ...entry,\n published: true,\n TYPE: createPublishedRecordType(),\n __type: createPublishedRecordType()\n }));\n }\n };\n};\n"],"names":["createTransformer","params","model","fieldIndexRegistry","baseEntry","baseStorageEntry","initialTransformedEntryToIndex","compressionHandler","valuesModifiers","transformedEntryKeys","transformedEntryToIndex","modifiedEntryValues","elasticsearchLatestEntry","elasticsearchPublishedEntry","applicableModifiers","m","modifyEntryValues","WebinyError","modifiedEntry","modifyEntryValuesCallable","modifiedStorageEntry","transformEntryKeys","entry","storageEntry","result","transformEntryToIndex","createLatestRecordType","createPublishedRecordType"],"mappings":";;;;;AA6DO,MAAMA,oBAAoB,CAC7BC;IAEA,MAAM,EACFC,KAAK,EACLC,kBAAkB,EAClB,OAAOC,SAAS,EAChB,cAAcC,gBAAgB,EAC9B,oBAAoBC,8BAA8B,EAClDC,kBAAkB,EAClBC,eAAe,EAClB,GAAGP;IAEJ,IAAIQ;IACJ,IAAIC,0BAAwDJ;IAC5D,IAAIK;IACJ,IAAIC;IACJ,IAAIC;IAEJ,MAAMC,sBAAsBN,gBAAgB,MAAM,CAACO,CAAAA,IAAKA,EAAE,SAAS,CAACb,MAAM,OAAO;IAEjF,MAAMc,oBAAoB;QACtB,IAAIV,kCAAkC,CAACF,WACnC,MAAM,IAAIa,MACN,kFACA,sBACA;YACI,OAAOX;QACX;QAGR,IAAIK,qBACA,OAAOA;QAEX,MAAMO,gBAAgBC,gDAA6B;YAC/C,WAAWL;YACXZ;YACA,OAAOE;QACX;QACA,MAAMgB,uBAAuBD,gDAA6B;YACtD,WAAWL;YACXZ;YACA,OAAOG;QACX;QAEA,OAAQM,sBAAsBU,mBAAsB;YAChDnB;YACA,OAAOgB;YACP,cAAcE;QAClB;IACJ;IAEA,OAAO;QACH,oBAAoB;YAChB,IAAId,kCAAkC,CAACF,WACnC,MAAM,IAAIa,MACN,kFACA,sBACA;gBACI,OAAOX;YACX;YAGR,IAAIG,sBACA,OAAOA;YAEX,OAAQA,uBAAuBY,mBAAmB;gBAC9CnB;gBACA,OAAOE;gBACP,cAAcC;YAClB;QACJ;QACA,kBAAkB;YACd,IAAIK,yBACA,OAAOA;YAEX,IAAIY;YACJ,IAAIC;YAMJ,IAAIT,oBAAoB,MAAM,GAAG,GAAG;gBAChC,MAAMU,SAASR;gBACfM,QAAQE,OAAO,KAAK;gBACpBD,eAAeC,OAAO,YAAY;YACtC,OAEK;gBACD,MAAMA,SAAS,IAAI,CAAC,kBAAkB;gBACtCF,QAAQE,OAAO,KAAK;gBACpBD,eAAeC,OAAO,YAAY;YACtC;YACA,OAAQd,0BAA0Be,sBAAyB;gBACvDvB;gBACAoB;gBACAC;gBACApB;YACJ;QACJ;QACA,iCAAiC;YAC7B,IAAIS,0BACA,OAAOA;YAEX,MAAMU,QAAQ,IAAI,CAAC,gBAAgB;YAEnC,OAAQV,2BAA2B,MAAML,mBAAmB,QAAQ,CAAC;gBACjE,GAAGe,KAAK;gBACR,QAAQ;gBACR,MAAMI;gBACN,QAAQA;YACZ;QACJ;QACA,oCAAoC;YAChC,IAAIb,6BACA,OAAOA;YAEX,MAAMS,QAAQ,IAAI,CAAC,gBAAgB;YAEnC,OAAQT,8BAA8B,MAAMN,mBAAmB,QAAQ,CAAC;gBACpE,GAAGe,KAAK;gBACR,WAAW;gBACX,MAAMK;gBACN,QAAQA;YACZ;QACJ;IACJ;AACJ"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { CmsEntry, CmsEntryValues, StorageOperationsCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
-
import type { CmsEntryOpenSearchValuesModifier } from "
|
|
2
|
+
import type { CmsEntryOpenSearchValuesModifier } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
3
3
|
interface Params<T extends CmsEntryValues = CmsEntryValues> {
|
|
4
4
|
model: StorageOperationsCmsModel<T>;
|
|
5
5
|
modifiers: CmsEntryOpenSearchValuesModifier.Interface[];
|
|
6
6
|
entry: CmsEntry<T>;
|
|
7
7
|
}
|
|
8
8
|
export declare const modifyEntryValues: <T extends CmsEntryValues = CmsEntryValues>(params: Params<T>) => {
|
|
9
|
-
values: T;
|
|
10
9
|
tenant: string;
|
|
11
10
|
entryId: string;
|
|
12
11
|
id: string;
|
|
@@ -43,11 +42,12 @@ export declare const modifyEntryValues: <T extends CmsEntryValues = CmsEntryValu
|
|
|
43
42
|
locked: boolean;
|
|
44
43
|
status: import("@webiny/api-headless-cms/types/types").CmsEntryStatus;
|
|
45
44
|
location?: import("@webiny/api-headless-cms/types/types").ICmsEntryLocation;
|
|
46
|
-
meta?: import("@webiny/api/types").GenericRecord;
|
|
47
45
|
wbyDeleted?: boolean | null;
|
|
48
46
|
binOriginalFolderId?: string;
|
|
49
47
|
system?: import("@webiny/api-headless-cms/types/types").ICmsEntrySystem;
|
|
50
48
|
live: import("@webiny/api-headless-cms/types/types").ICmsEntryLive | null;
|
|
51
49
|
revisionDescription: string | undefined;
|
|
50
|
+
expiresAt: number | null;
|
|
51
|
+
values: T;
|
|
52
52
|
};
|
|
53
53
|
export {};
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (const modifier of modifiers) {
|
|
9
|
-
values = modifier.modify({
|
|
10
|
-
model,
|
|
11
|
-
entry,
|
|
12
|
-
values
|
|
1
|
+
const modifyEntryValues = (params)=>{
|
|
2
|
+
const { modifiers, model, entry } = params;
|
|
3
|
+
let values = entry.values;
|
|
4
|
+
for (const modifier of modifiers)values = modifier.modify({
|
|
5
|
+
model,
|
|
6
|
+
entry,
|
|
7
|
+
values
|
|
13
8
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
9
|
+
return {
|
|
10
|
+
...entry,
|
|
11
|
+
values
|
|
12
|
+
};
|
|
19
13
|
};
|
|
14
|
+
export { modifyEntryValues };
|
|
20
15
|
|
|
21
16
|
//# sourceMappingURL=modifyEntryValues.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/transformations/modifyEntryValues.js","sources":["../../../../src/operations/entry/transformations/modifyEntryValues.ts"],"sourcesContent":["import type {\n CmsEntry,\n CmsEntryValues,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsEntryOpenSearchValuesModifier } from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\n\ninterface Params<T extends CmsEntryValues = CmsEntryValues> {\n model: StorageOperationsCmsModel<T>;\n modifiers: CmsEntryOpenSearchValuesModifier.Interface[];\n entry: CmsEntry<T>;\n}\n\nexport const modifyEntryValues = <T extends CmsEntryValues = CmsEntryValues>(params: Params<T>) => {\n const { modifiers, model, entry } = params;\n let values = entry.values;\n for (const modifier of modifiers) {\n values = modifier.modify<T>({\n model,\n entry,\n values\n });\n }\n return {\n ...entry,\n values\n };\n};\n"],"names":["modifyEntryValues","params","modifiers","model","entry","values","modifier"],"mappings":"AAaO,MAAMA,oBAAoB,CAA4CC;IACzE,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH;IACpC,IAAII,SAASD,MAAM,MAAM;IACzB,KAAK,MAAME,YAAYJ,UACnBG,SAASC,SAAS,MAAM,CAAI;QACxBH;QACAC;QACAC;IACJ;IAEJ,OAAO;QACH,GAAGD,KAAK;QACRC;IACJ;AACJ"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { convertEntryKeysToStorage } from "./convertEntryKeys.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
model,
|
|
15
|
-
entry: storageEntry
|
|
16
|
-
})
|
|
17
|
-
};
|
|
2
|
+
const transformEntryKeys = (params)=>{
|
|
3
|
+
const { model, entry, storageEntry } = params;
|
|
4
|
+
return {
|
|
5
|
+
entry: convertEntryKeysToStorage({
|
|
6
|
+
model,
|
|
7
|
+
entry
|
|
8
|
+
}),
|
|
9
|
+
storageEntry: convertEntryKeysToStorage({
|
|
10
|
+
model,
|
|
11
|
+
entry: storageEntry
|
|
12
|
+
})
|
|
13
|
+
};
|
|
18
14
|
};
|
|
15
|
+
export { transformEntryKeys };
|
|
19
16
|
|
|
20
17
|
//# sourceMappingURL=transformEntryKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/transformations/transformEntryKeys.js","sources":["../../../../src/operations/entry/transformations/transformEntryKeys.ts"],"sourcesContent":["import type {\n CmsEntry,\n CmsEntryValues,\n CmsStorageEntry,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { convertEntryKeysToStorage } from \"./convertEntryKeys.js\";\n\ninterface TransformKeysParams<T extends CmsEntryValues = CmsEntryValues> {\n model: StorageOperationsCmsModel<T>;\n entry: CmsEntry<T>;\n storageEntry: CmsStorageEntry<T>;\n}\n\nexport const transformEntryKeys = <T extends CmsEntryValues = CmsEntryValues>(\n params: TransformKeysParams<T>\n) => {\n const { model, entry, storageEntry } = params;\n return {\n entry: convertEntryKeysToStorage<T>({\n model,\n entry\n }),\n storageEntry: convertEntryKeysToStorage<T>({\n model,\n entry: storageEntry\n })\n };\n};\n"],"names":["transformEntryKeys","params","model","entry","storageEntry","convertEntryKeysToStorage"],"mappings":";AAcO,MAAMA,qBAAqB,CAC9BC;IAEA,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,YAAY,EAAE,GAAGH;IACvC,OAAO;QACH,OAAOI,0BAA6B;YAChCH;YACAC;QACJ;QACA,cAAcE,0BAA6B;YACvCH;YACA,OAAOE;QACX;IACJ;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsGroupStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/CreateGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
declare class DdbEsCreateGroupImpl implements CreateGroupStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsGroupEntity.Interface);
|
|
7
|
+
execute(params: CmsGroupStorageOperationsCreateParams): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsCreateGroup: typeof DdbEsCreateGroupImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/group/CreateGroupStorageOperation.js").ICreateGroupStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { CreateGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/CreateGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
import { createKeys, createType } from "./keys.js";
|
|
5
|
+
class DdbEsCreateGroupImpl {
|
|
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 create group.", ex.code || "CREATE_GROUP_ERROR", {
|
|
20
|
+
error: ex,
|
|
21
|
+
group,
|
|
22
|
+
keys
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const DdbEsCreateGroup = CreateGroupStorageOperation.createImplementation({
|
|
28
|
+
implementation: DdbEsCreateGroupImpl,
|
|
29
|
+
dependencies: [
|
|
30
|
+
CmsDdbEsGroupEntity
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export { DdbEsCreateGroup };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=DdbEsCreateGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/group/DdbEsCreateGroup.js","sources":["../../../src/operations/group/DdbEsCreateGroup.ts"],"sourcesContent":["import type { CmsGroupStorageOperationsCreateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { CreateGroupStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/CreateGroupStorageOperation.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbEsCreateGroupImpl implements CreateGroupStorageOperation.Interface {\n constructor(private entity: CmsDdbEsGroupEntity.Interface) {}\n\n async execute(params: CmsGroupStorageOperationsCreateParams) {\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 create group.\",\n ex.code || \"CREATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n }\n}\n\nexport const DdbEsCreateGroup = CreateGroupStorageOperation.createImplementation({\n implementation: DdbEsCreateGroupImpl,\n dependencies: [CmsDdbEsGroupEntity]\n});\n"],"names":["DdbEsCreateGroupImpl","entity","params","group","keys","createKeys","createType","ex","WebinyError","DdbEsCreateGroup","CreateGroupStorageOperation","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,12 @@
|
|
|
1
|
+
import type { CmsGroupStorageOperationsDeleteParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { DeleteGroupStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/group/DeleteGroupStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsGroupEntity } from "../../abstractions/CmsDdbEsGroupEntity.js";
|
|
4
|
+
declare class DdbEsDeleteGroupImpl implements DeleteGroupStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbEsGroupEntity.Interface);
|
|
7
|
+
execute(params: CmsGroupStorageOperationsDeleteParams): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbEsDeleteGroup: typeof DdbEsDeleteGroupImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/group/DeleteGroupStorageOperation.js").IDeleteGroupStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -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,16 @@
|
|
|
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
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
6
|
+
declare class DdbEsCreateModelImpl implements CreateModelStorageOperation.Interface {
|
|
7
|
+
private entity;
|
|
8
|
+
private indexProvider;
|
|
9
|
+
private elasticsearch;
|
|
10
|
+
constructor(entity: CmsDdbEsModelEntity.Interface, openSearchClient: OpenSearchClient.Interface, indexProvider: CmsModelOpenSearchIndexProvider.Interface);
|
|
11
|
+
execute(params: CmsModelStorageOperationsCreateParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel>;
|
|
12
|
+
}
|
|
13
|
+
export declare const DdbEsCreateModel: typeof DdbEsCreateModelImpl & {
|
|
14
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js").ICreateModelStorageOperation>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { createConfigurations } 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
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
8
|
+
class DdbEsCreateModelImpl {
|
|
9
|
+
constructor(entity, openSearchClient, indexProvider){
|
|
10
|
+
this.entity = entity;
|
|
11
|
+
this.indexProvider = indexProvider;
|
|
12
|
+
this.elasticsearch = openSearchClient.use();
|
|
13
|
+
}
|
|
14
|
+
async execute(params) {
|
|
15
|
+
const { model } = params;
|
|
16
|
+
const configurations = createConfigurations(this.indexProvider);
|
|
17
|
+
const { index } = await configurations.es({
|
|
18
|
+
model
|
|
19
|
+
});
|
|
20
|
+
const keys = createKeys(model);
|
|
21
|
+
let error;
|
|
22
|
+
try {
|
|
23
|
+
await this.entity.put({
|
|
24
|
+
data: model,
|
|
25
|
+
...keys,
|
|
26
|
+
TYPE: createType()
|
|
27
|
+
});
|
|
28
|
+
return model;
|
|
29
|
+
} catch (ex) {
|
|
30
|
+
error = ex;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
await this.elasticsearch.indices.delete({
|
|
34
|
+
index,
|
|
35
|
+
ignore_unavailable: true
|
|
36
|
+
});
|
|
37
|
+
} catch (ex) {
|
|
38
|
+
throw new _webiny_error(`Could not delete elasticsearch index "${index}" after model record failed to be created.`, "DELETE_MODEL_INDEX_ERROR", {
|
|
39
|
+
dynamodbError: error,
|
|
40
|
+
elasticsearchError: ex
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const DdbEsCreateModel = CreateModelStorageOperation.createImplementation({
|
|
47
|
+
implementation: DdbEsCreateModelImpl,
|
|
48
|
+
dependencies: [
|
|
49
|
+
CmsDdbEsModelEntity,
|
|
50
|
+
OpenSearchClient,
|
|
51
|
+
CmsModelOpenSearchIndexProvider
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
export { DdbEsCreateModel };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=DdbEsCreateModel.js.map
|