@webiny/api-headless-cms-ddb-es 0.0.0-unstable.eb196ccd2f → 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/README.md +6 -30
- 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.d.ts +4 -6
- package/definitions/entry.js +8 -179
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -7
- package/definitions/group.js +8 -63
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -7
- package/definitions/model.js +8 -107
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/feature.d.ts +9 -0
- package/feature.js +55 -0
- package/feature.js.map +1 -0
- package/index.d.ts +2 -3
- package/index.js +2 -225
- 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.d.ts +1 -2
- package/operations/entry/dataLoader/DataLoaderCache.js +21 -35
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +2 -7
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +7 -22
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
- package/operations/entry/dataLoader/getAllEntryRevisions.js +20 -41
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +30 -48
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +30 -48
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
- package/operations/entry/dataLoader/getRevisionById.js +36 -58
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +3 -3
- package/operations/entry/dataLoader/index.js +13 -35
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +4 -4
- package/operations/entry/dataLoader/types.js +0 -7
- package/operations/entry/dataLoaders.d.ts +14 -14
- package/operations/entry/dataLoaders.js +92 -110
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +53 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +44 -27
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +4 -18
- 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.d.ts +6 -6
- package/operations/entry/transformations/convertEntryKeys.js +21 -34
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +21 -18
- package/operations/entry/transformations/index.js +87 -123
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
- package/operations/entry/transformations/modifyEntryValues.js +12 -24
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
- package/operations/entry/transformations/transformEntryKeys.js +14 -24
- 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/operations/group/feature.d.ts +4 -0
- 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/operations/model/feature.d.ts +4 -0
- 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 +40 -36
- 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 +12 -159
- package/types.js +7 -39
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -19
- package/configurations.js +0 -49
- package/configurations.js.map +0 -1
- package/definitions/entryElasticsearch.d.ts +0 -9
- package/definitions/entryElasticsearch.js +0 -41
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/system.d.ts +0 -9
- package/definitions/system.js +0 -42
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -25
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -25
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -3
- package/dynamoDb/index.js +0 -16
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -96
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -2
- package/dynamoDb/storage/richText.js +0 -59
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -40
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
- package/elasticsearch/deleteElasticsearchIndex.js +0 -38
- package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -13
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -88
- package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -54
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -18
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
- package/elasticsearch/indexing/jsonIndexing.js +0 -28
- package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
- package/elasticsearch/indexing/longTextIndexing.js +0 -42
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -41
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -201
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -31
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -13
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -14
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -14
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -13
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -31
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/searchableJson.d.ts +0 -2
- package/elasticsearch/search/searchableJson.js +0 -60
- package/elasticsearch/search/searchableJson.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -27
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/helpers/entryIndexHelpers.d.ts +0 -18
- package/helpers/entryIndexHelpers.js +0 -190
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/fieldIdentifier.d.ts +0 -6
- package/helpers/fieldIdentifier.js +0 -43
- package/helpers/fieldIdentifier.js.map +0 -1
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -29
- 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 -34
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
- package/operations/entry/elasticsearch/body.d.ts +0 -13
- package/operations/entry/elasticsearch/body.js +0 -142
- package/operations/entry/elasticsearch/body.js.map +0 -1
- package/operations/entry/elasticsearch/fields.d.ts +0 -10
- package/operations/entry/elasticsearch/fields.js +0 -315
- package/operations/entry/elasticsearch/fields.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -60
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -17
- package/operations/entry/elasticsearch/filtering/exec.js +0 -175
- 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 -18
- package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -16
- package/operations/entry/elasticsearch/filtering/path.js +0 -48
- package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -30
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -15
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -69
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -57
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/populated.js +0 -25
- 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 -24
- package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
- package/operations/entry/elasticsearch/fullTextSearch.js +0 -91
- 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 -27
- 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 -106
- 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 -36
- package/operations/entry/elasticsearch/keyword.js.map +0 -1
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -18
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -8
- package/operations/entry/elasticsearch/plugins/operator.js +0 -39
- package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -18
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
- package/operations/entry/elasticsearch/plugins/search.js +0 -26
- package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -18
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -13
- 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 -89
- package/operations/entry/elasticsearch/sort.js.map +0 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
- package/operations/entry/elasticsearch/transformValueForSearch.js +0 -32
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearch/types.d.ts +0 -41
- package/operations/entry/elasticsearch/types.js +0 -7
- package/operations/entry/elasticsearch/types.js.map +0 -1
- package/operations/entry/index.d.ts +0 -11
- package/operations/entry/index.js +0 -1881
- package/operations/entry/index.js.map +0 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
- package/operations/entry/transformations/transformEntryToIndex.js +0 -31
- package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -179
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -183
- package/operations/model/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -94
- package/operations/system/index.js.map +0 -1
- package/operations/system/indexes.d.ts +0 -10
- package/operations/system/indexes.js +0 -41
- package/operations/system/indexes.js.map +0 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
- package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -52
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -21
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -27
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -40
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -21
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -21
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
- package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -50
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
- package/plugins/CmsEntryFilterPlugin.js +0 -22
- package/plugins/CmsEntryFilterPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -8
- package/plugins/index.js +0 -95
- package/plugins/index.js.map +0 -1
- package/tasks/createIndexTaskPlugin.d.ts +0 -2
- package/tasks/createIndexTaskPlugin.js +0 -67
- package/tasks/createIndexTaskPlugin.js.map +0 -1
- package/values/NoValueContainer.d.ts +0 -5
- package/values/NoValueContainer.js +0 -20
- package/values/NoValueContainer.js.map +0 -1
|
@@ -1,127 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (modifiedEntryValues) {
|
|
36
|
-
return modifiedEntryValues;
|
|
37
|
-
}
|
|
38
|
-
const modifiedEntry = (0, _modifyEntryValues.modifyEntryValues)({
|
|
39
|
-
plugins: modifierPlugins,
|
|
40
|
-
model,
|
|
41
|
-
entry: baseEntry
|
|
42
|
-
});
|
|
43
|
-
const modifiedStorageEntry = (0, _modifyEntryValues.modifyEntryValues)({
|
|
44
|
-
plugins: modifierPlugins,
|
|
45
|
-
model,
|
|
46
|
-
entry: baseStorageEntry
|
|
47
|
-
});
|
|
48
|
-
return modifiedEntryValues = (0, _transformEntryKeys.transformEntryKeys)({
|
|
49
|
-
model,
|
|
50
|
-
entry: modifiedEntry,
|
|
51
|
-
storageEntry: modifiedStorageEntry
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
return {
|
|
55
|
-
transformEntryKeys: function () {
|
|
56
|
-
if (initialTransformedEntryToIndex || !baseEntry) {
|
|
57
|
-
throw new _error.default(`Should not call the "modifyEntryValues" when "transformedToIndex" is provided.`, "METHOD_NOT_ALLOWED", {
|
|
58
|
-
entry: initialTransformedEntryToIndex
|
|
1
|
+
import { transformEntryKeys } from "./transformEntryKeys.js";
|
|
2
|
+
import { transformEntryToIndex } from "@webiny/api-headless-cms-utils-os/operations/entry/transformations/transformEntryToIndex.js";
|
|
3
|
+
import { modifyEntryValues as external_modifyEntryValues_js_modifyEntryValues } from "./modifyEntryValues.js";
|
|
4
|
+
import { createLatestRecordType, createPublishedRecordType } from "../recordType.js";
|
|
5
|
+
import error from "@webiny/error";
|
|
6
|
+
const createTransformer = (params)=>{
|
|
7
|
+
const { model, fieldIndexRegistry, entry: baseEntry, storageEntry: baseStorageEntry, transformedToIndex: initialTransformedEntryToIndex, compressionHandler, valuesModifiers } = params;
|
|
8
|
+
let transformedEntryKeys;
|
|
9
|
+
let transformedEntryToIndex = initialTransformedEntryToIndex;
|
|
10
|
+
let modifiedEntryValues;
|
|
11
|
+
let elasticsearchLatestEntry;
|
|
12
|
+
let elasticsearchPublishedEntry;
|
|
13
|
+
const applicableModifiers = valuesModifiers.filter((m)=>m.canModify(model.modelId));
|
|
14
|
+
const modifyEntryValues = ()=>{
|
|
15
|
+
if (initialTransformedEntryToIndex || !baseEntry) throw new error('Should not call the "modifyEntryValues" when "transformedToIndex" is provided.', "METHOD_NOT_ALLOWED", {
|
|
16
|
+
entry: initialTransformedEntryToIndex
|
|
17
|
+
});
|
|
18
|
+
if (modifiedEntryValues) return modifiedEntryValues;
|
|
19
|
+
const modifiedEntry = external_modifyEntryValues_js_modifyEntryValues({
|
|
20
|
+
modifiers: applicableModifiers,
|
|
21
|
+
model,
|
|
22
|
+
entry: baseEntry
|
|
23
|
+
});
|
|
24
|
+
const modifiedStorageEntry = external_modifyEntryValues_js_modifyEntryValues({
|
|
25
|
+
modifiers: applicableModifiers,
|
|
26
|
+
model,
|
|
27
|
+
entry: baseStorageEntry
|
|
28
|
+
});
|
|
29
|
+
return modifiedEntryValues = transformEntryKeys({
|
|
30
|
+
model,
|
|
31
|
+
entry: modifiedEntry,
|
|
32
|
+
storageEntry: modifiedStorageEntry
|
|
59
33
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
const entry = this.transformToIndex();
|
|
116
|
-
return elasticsearchPublishedEntry = await (0, _apiElasticsearch.compress)(plugins, {
|
|
117
|
-
...entry,
|
|
118
|
-
published: true,
|
|
119
|
-
TYPE: (0, _recordType.createPublishedRecordType)(),
|
|
120
|
-
__type: (0, _recordType.createPublishedRecordType)()
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
};
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
transformEntryKeys: function() {
|
|
37
|
+
if (initialTransformedEntryToIndex || !baseEntry) throw new error('Should not call the "modifyEntryValues" when "transformedToIndex" is provided.', "METHOD_NOT_ALLOWED", {
|
|
38
|
+
entry: initialTransformedEntryToIndex
|
|
39
|
+
});
|
|
40
|
+
if (transformedEntryKeys) return transformedEntryKeys;
|
|
41
|
+
return transformedEntryKeys = transformEntryKeys({
|
|
42
|
+
model,
|
|
43
|
+
entry: baseEntry,
|
|
44
|
+
storageEntry: baseStorageEntry
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
transformToIndex: function() {
|
|
48
|
+
if (transformedEntryToIndex) return transformedEntryToIndex;
|
|
49
|
+
let entry;
|
|
50
|
+
let storageEntry;
|
|
51
|
+
if (applicableModifiers.length > 0) {
|
|
52
|
+
const result = modifyEntryValues();
|
|
53
|
+
entry = result.entry;
|
|
54
|
+
storageEntry = result.storageEntry;
|
|
55
|
+
} else {
|
|
56
|
+
const result = this.transformEntryKeys();
|
|
57
|
+
entry = result.entry;
|
|
58
|
+
storageEntry = result.storageEntry;
|
|
59
|
+
}
|
|
60
|
+
return transformedEntryToIndex = transformEntryToIndex({
|
|
61
|
+
model,
|
|
62
|
+
entry,
|
|
63
|
+
storageEntry,
|
|
64
|
+
fieldIndexRegistry
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
getElasticsearchLatestEntryData: async function() {
|
|
68
|
+
if (elasticsearchLatestEntry) return elasticsearchLatestEntry;
|
|
69
|
+
const entry = this.transformToIndex();
|
|
70
|
+
return elasticsearchLatestEntry = await compressionHandler.compress({
|
|
71
|
+
...entry,
|
|
72
|
+
latest: true,
|
|
73
|
+
TYPE: createLatestRecordType(),
|
|
74
|
+
__type: createLatestRecordType()
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
getElasticsearchPublishedEntryData: async function() {
|
|
78
|
+
if (elasticsearchPublishedEntry) return elasticsearchPublishedEntry;
|
|
79
|
+
const entry = this.transformToIndex();
|
|
80
|
+
return elasticsearchPublishedEntry = await compressionHandler.compress({
|
|
81
|
+
...entry,
|
|
82
|
+
published: true,
|
|
83
|
+
TYPE: createPublishedRecordType(),
|
|
84
|
+
__type: createPublishedRecordType()
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
124
88
|
};
|
|
125
|
-
|
|
89
|
+
export { createTransformer };
|
|
126
90
|
|
|
127
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_transformEntryKeys","require","_transformEntryToIndex","_plugins","_modifyEntryValues","_apiElasticsearch","_recordType","_error","_interopRequireDefault","createTransformer","params","plugins","model","entry","baseEntry","storageEntry","baseStorageEntry","transformedToIndex","initialTransformedEntryToIndex","undefined","transformedEntryKeys","transformedEntryToIndex","modifiedEntryValues","elasticsearchLatestEntry","elasticsearchPublishedEntry","modifierPlugins","byType","CmsEntryElasticsearchValuesModifier","type","filter","pl","canModify","modelId","modifyEntryValues","WebinyError","modifiedEntry","modifyEntryValuesCallable","modifiedStorageEntry","transformEntryKeys","transformToIndex","length","result","transformEntryToIndex","getElasticsearchLatestEntryData","compress","latest","TYPE","createLatestRecordType","__type","getElasticsearchPublishedEntryData","published","createPublishedRecordType","exports"],"sources":["index.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport type {\n CmsEntry,\n CmsStorageEntry,\n StorageOperationsCmsModel\n} from \"@webiny/api-headless-cms/types\";\nimport { transformEntryKeys } from \"./transformEntryKeys\";\nimport type { CmsIndexEntry } from \"~/types\";\nimport { transformEntryToIndex } from \"~/operations/entry/transformations/transformEntryToIndex\";\nimport { CmsEntryElasticsearchValuesModifier } from \"~/plugins\";\nimport { modifyEntryValues as modifyEntryValuesCallable } from \"~/operations/entry/transformations/modifyEntryValues\";\nimport { compress } from \"@webiny/api-elasticsearch\";\nimport { createLatestRecordType, createPublishedRecordType } from \"~/operations/entry/recordType\";\nimport WebinyError from \"@webiny/error\";\n\ninterface BaseTransformerParams {\n plugins: PluginsContainer;\n model: StorageOperationsCmsModel;\n}\n\ninterface EntryTransformerParams extends BaseTransformerParams {\n entry: CmsEntry;\n storageEntry: CmsEntry;\n transformedToIndex?: never;\n}\n\ninterface TransformedEntryTransformerParams extends BaseTransformerParams {\n entry?: never;\n storageEntry?: never;\n transformedToIndex: CmsIndexEntry;\n}\n\ninterface TransformedKeysEntry {\n entry: CmsEntry;\n storageEntry: CmsEntry;\n}\n\ninterface ModifiedEntryValues {\n entry: CmsEntry;\n storageEntry: CmsEntry;\n}\n\ninterface TransformerResult {\n transformEntryKeys: () => TransformedKeysEntry;\n transformToIndex: () => CmsIndexEntry;\n getElasticsearchLatestEntryData: () => Promise<Record<string, any>>;\n getElasticsearchPublishedEntryData: () => Promise<Record<string, any>>;\n}\n\nexport const createTransformer = (\n params: EntryTransformerParams | TransformedEntryTransformerParams\n): TransformerResult => {\n const {\n plugins,\n model,\n entry: baseEntry,\n storageEntry: baseStorageEntry,\n transformedToIndex: initialTransformedEntryToIndex = undefined\n } = params;\n\n let transformedEntryKeys: TransformedKeysEntry | undefined = undefined;\n let transformedEntryToIndex: CmsIndexEntry | undefined = initialTransformedEntryToIndex;\n let modifiedEntryValues: ModifiedEntryValues | undefined = undefined;\n let elasticsearchLatestEntry: any = undefined;\n let elasticsearchPublishedEntry: any = undefined;\n\n const modifierPlugins = plugins\n .byType<CmsEntryElasticsearchValuesModifier>(CmsEntryElasticsearchValuesModifier.type)\n .filter(pl => pl.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({\n plugins: modifierPlugins,\n model,\n entry: baseEntry\n });\n const modifiedStorageEntry = modifyEntryValuesCallable({\n plugins: modifierPlugins,\n model,\n entry: baseStorageEntry\n });\n\n return (modifiedEntryValues = transformEntryKeys({\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;\n let storageEntry: CmsStorageEntry;\n /**\n * In case there are value modifier plugins, we need to\n * - run modifiers\n * - transform keys\n */\n if (modifierPlugins.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({\n plugins,\n model,\n entry,\n storageEntry\n }));\n },\n getElasticsearchLatestEntryData: async function () {\n if (elasticsearchLatestEntry) {\n return elasticsearchLatestEntry;\n }\n const entry = this.transformToIndex();\n\n return (elasticsearchLatestEntry = await compress(plugins, {\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 compress(plugins, {\n ...entry,\n published: true,\n TYPE: createPublishedRecordType(),\n __type: createPublishedRecordType()\n }));\n }\n };\n};\n"],"mappings":"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","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,13 +1,11 @@
|
|
|
1
|
-
import type { CmsEntry, StorageOperationsCmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import type {
|
|
3
|
-
interface Params {
|
|
4
|
-
model: StorageOperationsCmsModel
|
|
5
|
-
|
|
6
|
-
entry: CmsEntry
|
|
1
|
+
import type { CmsEntry, CmsEntryValues, StorageOperationsCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import type { CmsEntryOpenSearchValuesModifier } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
3
|
+
interface Params<T extends CmsEntryValues = CmsEntryValues> {
|
|
4
|
+
model: StorageOperationsCmsModel<T>;
|
|
5
|
+
modifiers: CmsEntryOpenSearchValuesModifier.Interface[];
|
|
6
|
+
entry: CmsEntry<T>;
|
|
7
7
|
}
|
|
8
|
-
export declare const modifyEntryValues: (params: Params) => {
|
|
9
|
-
values: import("@webiny/api-headless-cms/types").CmsEntryValues;
|
|
10
|
-
webinyVersion: string;
|
|
8
|
+
export declare const modifyEntryValues: <T extends CmsEntryValues = CmsEntryValues>(params: Params<T>) => {
|
|
11
9
|
tenant: string;
|
|
12
10
|
entryId: string;
|
|
13
11
|
id: string;
|
|
@@ -18,13 +16,13 @@ export declare const modifyEntryValues: (params: Params) => {
|
|
|
18
16
|
revisionRestoredOn: string | null;
|
|
19
17
|
revisionFirstPublishedOn: string | null;
|
|
20
18
|
revisionLastPublishedOn: string | null;
|
|
21
|
-
revisionCreatedBy: import("@webiny/api-headless-cms/types").CmsIdentity;
|
|
22
|
-
revisionSavedBy: import("@webiny/api-headless-cms/types").CmsIdentity;
|
|
23
|
-
revisionModifiedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
24
|
-
revisionDeletedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
25
|
-
revisionRestoredBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
26
|
-
revisionFirstPublishedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
27
|
-
revisionLastPublishedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
19
|
+
revisionCreatedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity;
|
|
20
|
+
revisionSavedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity;
|
|
21
|
+
revisionModifiedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
22
|
+
revisionDeletedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
23
|
+
revisionRestoredBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
24
|
+
revisionFirstPublishedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
25
|
+
revisionLastPublishedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
28
26
|
createdOn: string;
|
|
29
27
|
savedOn: string;
|
|
30
28
|
modifiedOn: string | null;
|
|
@@ -32,27 +30,24 @@ export declare const modifyEntryValues: (params: Params) => {
|
|
|
32
30
|
restoredOn: string | null;
|
|
33
31
|
firstPublishedOn: string | null;
|
|
34
32
|
lastPublishedOn: string | null;
|
|
35
|
-
createdBy: import("@webiny/api-headless-cms/types").CmsIdentity;
|
|
36
|
-
savedBy: import("@webiny/api-headless-cms/types").CmsIdentity;
|
|
37
|
-
modifiedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
38
|
-
deletedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
39
|
-
restoredBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
40
|
-
firstPublishedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
41
|
-
lastPublishedBy: import("@webiny/api-headless-cms/types").CmsIdentity | null;
|
|
42
|
-
ownedBy?: import("@webiny/api-headless-cms/types").CmsIdentity | null | undefined;
|
|
43
|
-
publishedOn?: string | null | undefined;
|
|
33
|
+
createdBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity;
|
|
34
|
+
savedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity;
|
|
35
|
+
modifiedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
36
|
+
deletedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
37
|
+
restoredBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
38
|
+
firstPublishedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
39
|
+
lastPublishedBy: import("@webiny/api-headless-cms/types/identity").CmsIdentity | null;
|
|
44
40
|
modelId: string;
|
|
45
|
-
locale: string;
|
|
46
41
|
version: number;
|
|
47
42
|
locked: boolean;
|
|
48
|
-
status: import("@webiny/api-headless-cms/types").CmsEntryStatus;
|
|
49
|
-
location?:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
status: import("@webiny/api-headless-cms/types/types").CmsEntryStatus;
|
|
44
|
+
location?: import("@webiny/api-headless-cms/types/types").ICmsEntryLocation;
|
|
45
|
+
wbyDeleted?: boolean | null;
|
|
46
|
+
binOriginalFolderId?: string;
|
|
47
|
+
system?: import("@webiny/api-headless-cms/types/types").ICmsEntrySystem;
|
|
48
|
+
live: import("@webiny/api-headless-cms/types/types").ICmsEntryLive | null;
|
|
49
|
+
revisionDescription: string | undefined;
|
|
50
|
+
expiresAt: number | null;
|
|
51
|
+
values: T;
|
|
57
52
|
};
|
|
58
53
|
export {};
|
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
plugins,
|
|
10
|
-
model,
|
|
11
|
-
entry
|
|
12
|
-
} = params;
|
|
13
|
-
let values = entry.values;
|
|
14
|
-
for (const plugin of plugins) {
|
|
15
|
-
values = plugin.modify({
|
|
16
|
-
model,
|
|
17
|
-
entry,
|
|
18
|
-
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
|
|
19
8
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
9
|
+
return {
|
|
10
|
+
...entry,
|
|
11
|
+
values
|
|
12
|
+
};
|
|
25
13
|
};
|
|
26
|
-
|
|
14
|
+
export { modifyEntryValues };
|
|
27
15
|
|
|
28
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,11 +1,11 @@
|
|
|
1
|
-
import type { CmsEntry, CmsStorageEntry, StorageOperationsCmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
interface TransformKeysParams {
|
|
3
|
-
model: StorageOperationsCmsModel
|
|
4
|
-
entry: CmsEntry
|
|
5
|
-
storageEntry: CmsStorageEntry
|
|
1
|
+
import type { CmsEntry, CmsEntryValues, CmsStorageEntry, StorageOperationsCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
interface TransformKeysParams<T extends CmsEntryValues = CmsEntryValues> {
|
|
3
|
+
model: StorageOperationsCmsModel<T>;
|
|
4
|
+
entry: CmsEntry<T>;
|
|
5
|
+
storageEntry: CmsStorageEntry<T>;
|
|
6
6
|
}
|
|
7
|
-
export declare const transformEntryKeys: (params: TransformKeysParams) => {
|
|
8
|
-
entry: CmsStorageEntry
|
|
9
|
-
storageEntry: CmsStorageEntry
|
|
7
|
+
export declare const transformEntryKeys: <T extends CmsEntryValues = CmsEntryValues>(params: TransformKeysParams<T>) => {
|
|
8
|
+
entry: CmsStorageEntry<T>;
|
|
9
|
+
storageEntry: CmsStorageEntry<T>;
|
|
10
10
|
};
|
|
11
11
|
export {};
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
entry: (0, _convertEntryKeys.convertEntryKeysToStorage)({
|
|
16
|
-
model,
|
|
17
|
-
entry
|
|
18
|
-
}),
|
|
19
|
-
storageEntry: (0, _convertEntryKeys.convertEntryKeysToStorage)({
|
|
20
|
-
model,
|
|
21
|
-
entry: storageEntry
|
|
22
|
-
})
|
|
23
|
-
};
|
|
1
|
+
import { convertEntryKeysToStorage } from "./convertEntryKeys.js";
|
|
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
|
+
};
|
|
24
14
|
};
|
|
25
|
-
|
|
15
|
+
export { transformEntryKeys };
|
|
26
16
|
|
|
27
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 {};
|