@webiny/api-headless-cms 5.40.0-beta.2 → 5.40.0-beta.4
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/constants.d.ts +11 -1
- package/constants.js +15 -9
- package/constants.js.map +1 -1
- package/context.js +47 -31
- package/context.js.map +1 -1
- package/crud/AccessControl/AccessControl.d.ts +3 -3
- package/crud/AccessControl/AccessControl.js.map +1 -1
- package/crud/contentEntry/abstractions/IDeleteEntry.d.ts +4 -0
- package/crud/contentEntry/abstractions/IDeleteEntry.js +7 -0
- package/crud/contentEntry/abstractions/IDeleteEntry.js.map +1 -0
- package/crud/contentEntry/abstractions/IDeleteEntryOperation.d.ts +4 -0
- package/crud/contentEntry/abstractions/IDeleteEntryOperation.js +7 -0
- package/crud/contentEntry/abstractions/IDeleteEntryOperation.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetEntriesByIds.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetEntriesByIds.js +7 -0
- package/crud/contentEntry/abstractions/IGetEntriesByIds.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetEntry.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetEntry.js +7 -0
- package/crud/contentEntry/abstractions/IGetEntry.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetLatestEntriesByIds.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetLatestEntriesByIds.js +7 -0
- package/crud/contentEntry/abstractions/IGetLatestEntriesByIds.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetLatestRevisionByEntryId.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetLatestRevisionByEntryId.js +7 -0
- package/crud/contentEntry/abstractions/IGetLatestRevisionByEntryId.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetPreviousRevisionByEntryId.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetPreviousRevisionByEntryId.js +7 -0
- package/crud/contentEntry/abstractions/IGetPreviousRevisionByEntryId.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetPublishedEntriesByIds.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetPublishedEntriesByIds.js +7 -0
- package/crud/contentEntry/abstractions/IGetPublishedEntriesByIds.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetPublishedRevisionByEntryId.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetPublishedRevisionByEntryId.js +7 -0
- package/crud/contentEntry/abstractions/IGetPublishedRevisionByEntryId.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetRevisionById.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetRevisionById.js +7 -0
- package/crud/contentEntry/abstractions/IGetRevisionById.js.map +1 -0
- package/crud/contentEntry/abstractions/IGetRevisionsByEntryId.d.ts +4 -0
- package/crud/contentEntry/abstractions/IGetRevisionsByEntryId.js +7 -0
- package/crud/contentEntry/abstractions/IGetRevisionsByEntryId.js.map +1 -0
- package/crud/contentEntry/abstractions/IListEntries.d.ts +4 -0
- package/crud/contentEntry/abstractions/IListEntries.js +7 -0
- package/crud/contentEntry/abstractions/IListEntries.js.map +1 -0
- package/crud/contentEntry/abstractions/IListEntriesOperation.d.ts +4 -0
- package/crud/contentEntry/abstractions/IListEntriesOperation.js +7 -0
- package/crud/contentEntry/abstractions/IListEntriesOperation.js.map +1 -0
- package/crud/contentEntry/abstractions/IMoveEntryToBinOperation.d.ts +4 -0
- package/crud/contentEntry/abstractions/IMoveEntryToBinOperation.js +7 -0
- package/crud/contentEntry/abstractions/IMoveEntryToBinOperation.js.map +1 -0
- package/crud/contentEntry/abstractions/IRestoreEntryFromBin.d.ts +4 -0
- package/crud/contentEntry/abstractions/IRestoreEntryFromBin.js +7 -0
- package/crud/contentEntry/abstractions/IRestoreEntryFromBin.js.map +1 -0
- package/crud/contentEntry/abstractions/IRestoreEntryFromBinOperation.d.ts +4 -0
- package/crud/contentEntry/abstractions/IRestoreEntryFromBinOperation.js +7 -0
- package/crud/contentEntry/abstractions/IRestoreEntryFromBinOperation.js.map +1 -0
- package/crud/contentEntry/abstractions/index.d.ts +16 -0
- package/crud/contentEntry/abstractions/index.js +183 -0
- package/crud/contentEntry/abstractions/index.js.map +1 -0
- package/crud/contentEntry/afterDelete.js.map +1 -1
- package/crud/contentEntry/beforeCreate.js.map +1 -1
- package/crud/contentEntry/beforeUpdate.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryData.js +9 -1
- package/crud/contentEntry/entryDataFactories/createEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js +8 -0
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/index.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/statuses.js +3 -6
- package/crud/contentEntry/entryDataFactories/statuses.js.map +1 -1
- package/crud/contentEntry/entryDataValidation.js.map +1 -1
- package/crud/contentEntry/markLockedFields.js.map +1 -1
- package/crud/contentEntry/referenceFieldsMapping.js +1 -1
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
- package/crud/contentEntry/searchableFields.js.map +1 -1
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntry.d.ts +10 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntry.js +58 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntry.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperation.d.ts +7 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperation.js +17 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperation.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperationWithEvents.d.ts +9 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperationWithEvents.js +45 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntryOperationWithEvents.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntrySecure.d.ts +9 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntrySecure.js +22 -0
- package/crud/contentEntry/useCases/DeleteEntry/DeleteEntrySecure.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBin.d.ts +10 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBin.js +33 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBin.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperation.d.ts +7 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperation.js +17 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperation.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperationWithEvents.d.ts +9 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperationWithEvents.js +45 -0
- package/crud/contentEntry/useCases/DeleteEntry/MoveEntryToBinOperationWithEvents.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/TransformEntryDelete.d.ts +6 -0
- package/crud/contentEntry/useCases/DeleteEntry/TransformEntryDelete.js +21 -0
- package/crud/contentEntry/useCases/DeleteEntry/TransformEntryDelete.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/TransformEntryMoveToBin.d.ts +9 -0
- package/crud/contentEntry/useCases/DeleteEntry/TransformEntryMoveToBin.js +62 -0
- package/crud/contentEntry/useCases/DeleteEntry/TransformEntryMoveToBin.js.map +1 -0
- package/crud/contentEntry/useCases/DeleteEntry/index.d.ts +28 -0
- package/crud/contentEntry/useCases/DeleteEntry/index.js +42 -0
- package/crud/contentEntry/useCases/DeleteEntry/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIds.d.ts +7 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIds.js +17 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIds.js.map +1 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsNotDeleted.js +18 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsSecure.d.ts +9 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsSecure.js +28 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/GetEntriesByIdsSecure.js.map +1 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/index.d.ts +11 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/index.js +20 -0
- package/crud/contentEntry/useCases/GetEntriesByIds/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIds.d.ts +7 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIds.js +17 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIds.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsNotDeleted.js +18 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsSecure.d.ts +9 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsSecure.js +28 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/GetLatestEntriesByIdsSecure.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/index.d.ts +11 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/index.js +20 -0
- package/crud/contentEntry/useCases/GetLatestEntriesByIds/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryId.d.ts +7 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryId.js +17 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryId.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdDeleted.js +21 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdNotDeleted.js +21 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/index.d.ts +13 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/index.js +22 -0
- package/crud/contentEntry/useCases/GetLatestRevisionByEntryId/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryId.d.ts +7 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryId.js +17 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryId.js.map +1 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdNotDeleted.js +21 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/index.d.ts +9 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/index.js +18 -0
- package/crud/contentEntry/useCases/GetPreviousRevisionByEntryId/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIds.d.ts +7 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIds.js +17 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIds.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsNotDeleted.js +18 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsSecure.d.ts +9 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsSecure.js +28 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/GetPublishedEntriesByIdsSecure.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/index.d.ts +11 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/index.js +20 -0
- package/crud/contentEntry/useCases/GetPublishedEntriesByIds/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryId.d.ts +7 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryId.js +17 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryId.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdNotDeleted.js +21 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/index.d.ts +9 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/index.js +18 -0
- package/crud/contentEntry/useCases/GetPublishedRevisionByEntryId/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetRevisionById/GetRevisionById.d.ts +7 -0
- package/crud/contentEntry/useCases/GetRevisionById/GetRevisionById.js +17 -0
- package/crud/contentEntry/useCases/GetRevisionById/GetRevisionById.js.map +1 -0
- package/crud/contentEntry/useCases/GetRevisionById/GetRevisionByIdNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetRevisionById/GetRevisionByIdNotDeleted.js +21 -0
- package/crud/contentEntry/useCases/GetRevisionById/GetRevisionByIdNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetRevisionById/index.d.ts +9 -0
- package/crud/contentEntry/useCases/GetRevisionById/index.js +18 -0
- package/crud/contentEntry/useCases/GetRevisionById/index.js.map +1 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryId.d.ts +7 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryId.js +17 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryId.js.map +1 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryIdNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryIdNotDeleted.js +18 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/GetRevisionsByEntryIdNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/index.d.ts +11 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/index.js +18 -0
- package/crud/contentEntry/useCases/GetRevisionsByEntryId/index.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/GetEntry.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/GetEntry.js +29 -0
- package/crud/contentEntry/useCases/ListEntries/GetEntry.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/GetEntrySecure.d.ts +11 -0
- package/crud/contentEntry/useCases/ListEntries/GetEntrySecure.js +38 -0
- package/crud/contentEntry/useCases/ListEntries/GetEntrySecure.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntries.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntries.js +62 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntries.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperation.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperation.js +17 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperation.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationDeleted.js +24 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationLatest.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationLatest.js +25 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationLatest.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationNotDeleted.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationNotDeleted.js +24 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationNotDeleted.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationPublished.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationPublished.js +24 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationPublished.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithEvents.d.ts +9 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithEvents.js +22 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithEvents.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSearchableFields.d.ts +8 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSearchableFields.js +27 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSearchableFields.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSort.d.ts +8 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSort.js +26 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithSort.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithStatusCheck.d.ts +7 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithStatusCheck.js +36 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesOperationWithStatusCheck.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesSecure.d.ts +11 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesSecure.js +41 -0
- package/crud/contentEntry/useCases/ListEntries/ListEntriesSecure.js.map +1 -0
- package/crud/contentEntry/useCases/ListEntries/index.d.ts +24 -0
- package/crud/contentEntry/useCases/ListEntries/index.js +61 -0
- package/crud/contentEntry/useCases/ListEntries/index.js.map +1 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBin.d.ts +10 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBin.js +37 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBin.js.map +1 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperation.d.ts +7 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperation.js +17 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperation.js.map +1 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperationWithEvents.d.ts +9 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperationWithEvents.js +42 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinOperationWithEvents.js.map +1 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinSecure.d.ts +9 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinSecure.js +22 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/RestoreEntryFromBinSecure.js.map +1 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/TransformEntryRestoreFromBin.d.ts +9 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/TransformEntryRestoreFromBin.js +61 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/TransformEntryRestoreFromBin.js.map +1 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/index.d.ts +23 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/index.js +24 -0
- package/crud/contentEntry/useCases/RestoreEntryFromBin/index.js.map +1 -0
- package/crud/contentEntry/useCases/index.d.ts +11 -0
- package/crud/contentEntry/useCases/index.js +128 -0
- package/crud/contentEntry/useCases/index.js.map +1 -0
- package/crud/contentEntry.crud.js +210 -269
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/beforeCreate.js.map +1 -1
- package/crud/contentModel/beforeDelete.js.map +1 -1
- package/crud/contentModel/beforeUpdate.js.map +1 -1
- package/crud/contentModel/compatibility/modelApiName.js.map +1 -1
- package/crud/contentModel/contentModelManagerFactory.d.ts +1 -1
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
- package/crud/contentModel/createFieldStorageId.js.map +1 -1
- package/crud/contentModel/defaultFields.js.map +1 -1
- package/crud/contentModel/ensureTypeTag.js.map +1 -1
- package/crud/contentModel/fields/descriptionField.js.map +1 -1
- package/crud/contentModel/fields/imageField.js.map +1 -1
- package/crud/contentModel/fields/titleField.js.map +1 -1
- package/crud/contentModel/listModelsFromDatabase.js.map +1 -1
- package/crud/contentModel/validate/endingAllowed.js.map +1 -1
- package/crud/contentModel/validate/isModelEndingAllowed.js +1 -2
- package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -1
- package/crud/contentModel/validate/modelId.js.map +1 -1
- package/crud/contentModel/validate/pluralApiName.js.map +1 -1
- package/crud/contentModel/validate/singularApiName.js.map +1 -1
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.d.ts +1 -1
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel/validateStorageId.d.ts +1 -0
- package/crud/contentModel/validateStorageId.js +29 -0
- package/crud/contentModel/validateStorageId.js.map +1 -0
- package/crud/contentModel/validation.d.ts +51 -30
- package/crud/contentModel/validation.js +3 -2
- package/crud/contentModel/validation.js.map +1 -1
- package/crud/contentModel.crud.js +6 -0
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/beforeCreate.js.map +1 -1
- package/crud/contentModelGroup/beforeDelete.js.map +1 -1
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
- package/crud/contentModelGroup/listGroupsFromDatabase.js.map +1 -1
- package/crud/contentModelGroup/validation.js.map +1 -1
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/crud/system.crud.js.map +1 -1
- package/export/crud/exporting.js.map +1 -1
- package/export/crud/importing.js.map +1 -1
- package/export/crud/imports/importData.js.map +1 -1
- package/export/crud/imports/importGroups.js.map +1 -1
- package/export/crud/imports/importModels.js.map +1 -1
- package/export/crud/imports/validateGroups.js.map +1 -1
- package/export/crud/imports/validateInput.js.map +1 -1
- package/export/crud/imports/validateModels.js.map +1 -1
- package/export/crud/index.js.map +1 -1
- package/export/crud/sanitize.js.map +1 -1
- package/export/graphql/index.js +1 -1
- package/export/graphql/index.js.map +1 -1
- package/export/index.js.map +1 -1
- package/export/types.js +1 -2
- package/export/types.js.map +1 -1
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +4 -14
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/index.js.map +1 -1
- package/graphql/buildSchemaPlugins.d.ts +2 -2
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/checkEndpointAccess.js.map +1 -1
- package/graphql/createExecutableSchema.d.ts +2 -2
- package/graphql/createExecutableSchema.js.map +1 -1
- package/graphql/createRequestBody.js.map +1 -1
- package/graphql/formatErrorPayload.js.map +1 -1
- package/graphql/generateSchema.js.map +1 -1
- package/graphql/getSchema.js.map +1 -1
- package/graphql/graphQLHandlerFactory.js.map +1 -1
- package/graphql/handleRequest.js.map +1 -1
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseContentSchema.d.ts +2 -2
- package/graphql/schema/baseContentSchema.js +1 -7
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.js +12 -5
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/contentEntries.d.ts +2 -2
- package/graphql/schema/contentEntries.js +2 -2
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.d.ts +2 -2
- package/graphql/schema/contentModelGroups.js +1 -1
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.d.ts +2 -2
- package/graphql/schema/contentModels.js +3 -1
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.js.map +1 -1
- package/graphql/schema/createFieldTypePluginRecords.js.map +1 -1
- package/graphql/schema/createManageResolvers.js +8 -0
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.js +10 -0
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/createPreviewResolvers.js.map +1 -1
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js +2 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveListDeleted.d.ts +4 -0
- package/graphql/schema/resolvers/manage/resolveListDeleted.js +20 -0
- package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRestoreFromBin.d.ts +7 -0
- package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +20 -0
- package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
- package/graphql/schema/schemaPlugins.d.ts +2 -2
- package/graphql/schema/schemaPlugins.js +2 -2
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/graphql/system.js.map +1 -1
- package/graphqlFields/boolean.js.map +1 -1
- package/graphqlFields/datetime.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.js +27 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -1
- package/graphqlFields/dynamicZone/index.js.map +1 -1
- package/graphqlFields/file.js.map +1 -1
- package/graphqlFields/helpers.js.map +1 -1
- package/graphqlFields/index.js.map +1 -1
- package/graphqlFields/json.js.map +1 -1
- package/graphqlFields/longText.js.map +1 -1
- package/graphqlFields/number.js.map +1 -1
- package/graphqlFields/object.d.ts +2 -2
- package/graphqlFields/object.js +14 -0
- package/graphqlFields/object.js.map +1 -1
- package/graphqlFields/ref.js.map +1 -1
- package/graphqlFields/richText/RichTextPluginsProcessor.js.map +1 -1
- package/graphqlFields/richText/richTextResolver.js.map +1 -1
- package/graphqlFields/richText.js.map +1 -1
- package/graphqlFields/text.js.map +1 -1
- package/htmlRenderer/LexicalRenderer.js.map +1 -1
- package/htmlRenderer/createLexicalHTMLRenderer.js.map +1 -1
- package/index.js.map +1 -1
- package/modelManager/DefaultCmsModelManager.d.ts +1 -0
- package/modelManager/DefaultCmsModelManager.js +3 -0
- package/modelManager/DefaultCmsModelManager.js.map +1 -1
- package/modelManager/index.js +1 -1
- package/modelManager/index.js.map +1 -1
- package/package.json +27 -27
- package/parameters/context.js.map +1 -1
- package/parameters/header.js.map +1 -1
- package/parameters/index.js.map +1 -1
- package/parameters/manual.js.map +1 -1
- package/parameters/path.js.map +1 -1
- package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +8 -0
- package/plugins/{CmsGraphQLSchemaPlugin.js → CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js} +5 -1
- package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -0
- package/plugins/CmsGraphQLSchemaPlugin/index.d.ts +1 -0
- package/plugins/CmsGraphQLSchemaPlugin/index.js +18 -0
- package/plugins/CmsGraphQLSchemaPlugin/index.js.map +1 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -1
- package/plugins/CmsGroupPlugin.d.ts +4 -0
- package/plugins/CmsGroupPlugin.js +9 -1
- package/plugins/CmsGroupPlugin.js.map +1 -1
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
- package/plugins/CmsModelPlugin.d.ts +10 -8
- package/plugins/CmsModelPlugin.js +29 -16
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/plugins/CmsParametersPlugin.js.map +1 -1
- package/plugins/CmsRichTextRendererPlugin.js.map +1 -1
- package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -1
- package/plugins/StorageTransformPlugin.js.map +1 -1
- package/plugins/index.js.map +1 -1
- package/storage/default.js.map +1 -1
- package/storage/index.js.map +1 -1
- package/storage/json.js.map +1 -1
- package/storage/object.js.map +1 -1
- package/types/context.d.ts +146 -0
- package/types/context.js +7 -0
- package/types/context.js.map +1 -0
- package/types/fields/dynamicZoneField.d.ts +23 -0
- package/types/fields/dynamicZoneField.js +7 -0
- package/types/fields/dynamicZoneField.js.map +1 -0
- package/types/fields/objectField.d.ts +13 -0
- package/types/fields/objectField.js +7 -0
- package/types/fields/objectField.js.map +1 -0
- package/types/identity.d.ts +19 -0
- package/types/identity.js +7 -0
- package/types/identity.js.map +1 -0
- package/types/index.d.ts +10 -0
- package/types/index.js +117 -0
- package/types/index.js.map +1 -0
- package/types/model.d.ts +199 -0
- package/types/model.js +7 -0
- package/types/model.js.map +1 -0
- package/types/modelAst.d.ts +39 -0
- package/types/modelAst.js +7 -0
- package/types/modelAst.js.map +1 -0
- package/types/modelField.d.ts +320 -0
- package/types/modelField.js +7 -0
- package/types/modelField.js.map +1 -0
- package/types/modelGroup.d.ts +77 -0
- package/types/modelGroup.js +7 -0
- package/types/modelGroup.js.map +1 -0
- package/types/plugins.d.ts +364 -0
- package/types/plugins.js +7 -0
- package/types/plugins.js.map +1 -0
- package/{types.d.ts → types/types.d.ts} +196 -1171
- package/{types.js → types/types.js} +18 -119
- package/types/types.js.map +1 -0
- package/utils/caching/Cache.js.map +1 -1
- package/utils/caching/CacheKey.js.map +1 -1
- package/utils/caching/index.js.map +1 -1
- package/utils/caching/types.js.map +1 -1
- package/utils/contentEntryTraverser/ContentEntryTraverser.d.ts +10 -0
- package/utils/contentEntryTraverser/ContentEntryTraverser.js +84 -0
- package/utils/contentEntryTraverser/ContentEntryTraverser.js.map +1 -0
- package/utils/contentModelAst/CmsModelFieldToAstConverterFromPlugins.d.ts +6 -0
- package/utils/contentModelAst/CmsModelFieldToAstConverterFromPlugins.js +23 -0
- package/utils/contentModelAst/CmsModelFieldToAstConverterFromPlugins.js.map +1 -0
- package/utils/contentModelAst/CmsModelFieldToAstFromPlugin.d.ts +7 -0
- package/utils/contentModelAst/CmsModelFieldToAstFromPlugin.js +22 -0
- package/utils/contentModelAst/CmsModelFieldToAstFromPlugin.js.map +1 -0
- package/utils/contentModelAst/CmsModelToAstConverter.d.ts +11 -0
- package/utils/contentModelAst/CmsModelToAstConverter.js +28 -0
- package/utils/contentModelAst/CmsModelToAstConverter.js.map +1 -0
- package/utils/contentModelAst/index.d.ts +3 -0
- package/utils/contentModelAst/index.js +40 -0
- package/utils/contentModelAst/index.js.map +1 -0
- package/utils/converters/Converter.js.map +1 -1
- package/utils/converters/ConverterCollection.js.map +1 -1
- package/utils/converters/valueKeyStorageConverter.js.map +1 -1
- package/utils/createModelField.d.ts +2 -0
- package/utils/createModelField.js +14 -4
- package/utils/createModelField.js.map +1 -1
- package/utils/createTypeFromFields.js.map +1 -1
- package/utils/createTypeName.js.map +1 -1
- package/utils/date.js.map +1 -1
- package/utils/entryStorage.js.map +1 -1
- package/utils/filterAsync.js.map +1 -1
- package/utils/getBaseFieldType.js.map +1 -1
- package/utils/getEntryDescription.js.map +1 -1
- package/utils/getEntryImage.js.map +1 -1
- package/utils/getEntryTitle.js.map +1 -1
- package/utils/getSchemaFromFieldPlugins.d.ts +4 -4
- package/utils/getSchemaFromFieldPlugins.js +2 -2
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/identity.js.map +1 -1
- package/utils/incrementEntryIdVersion.js.map +1 -1
- package/utils/index.js.map +1 -1
- package/utils/isHeadlessCmsReady.js.map +1 -1
- package/utils/renderFields.js.map +1 -1
- package/utils/renderGetFilterFields.js.map +1 -1
- package/utils/renderInputFields.js.map +1 -1
- package/utils/renderListFilterFields.js.map +1 -1
- package/utils/renderSortEnum.js.map +1 -1
- package/utils/toSlug.js.map +1 -1
- package/validators/dateGte.js.map +1 -1
- package/validators/dateLte.js.map +1 -1
- package/validators/gte.js.map +1 -1
- package/validators/in.js.map +1 -1
- package/validators/index.js.map +1 -1
- package/validators/lte.js.map +1 -1
- package/validators/maxLength.js.map +1 -1
- package/validators/minLength.js.map +1 -1
- package/validators/pattern.js.map +1 -1
- package/validators/patternPlugins/email.js.map +1 -1
- package/validators/patternPlugins/index.js.map +1 -1
- package/validators/patternPlugins/lowerCase.js.map +1 -1
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
- package/validators/patternPlugins/upperCase.js.map +1 -1
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
- package/validators/patternPlugins/url.js.map +1 -1
- package/validators/required.js.map +1 -1
- package/validators/timeGte.js.map +1 -1
- package/validators/timeLte.js.map +1 -1
- package/validators/unique.js.map +1 -1
- package/plugins/CmsGraphQLSchemaPlugin.d.ts +0 -5
- package/plugins/CmsGraphQLSchemaPlugin.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/permissions/EntriesPermissions.d.ts +0 -4
- package/utils/permissions/EntriesPermissions.js +0 -11
- package/utils/permissions/EntriesPermissions.js.map +0 -1
- package/utils/permissions/ModelGroupsPermissions.d.ts +0 -9
- package/utils/permissions/ModelGroupsPermissions.js +0 -50
- package/utils/permissions/ModelGroupsPermissions.js.map +0 -1
- package/utils/permissions/ModelsPermissions.d.ts +0 -22
- package/utils/permissions/ModelsPermissions.js +0 -90
- package/utils/permissions/ModelsPermissions.js.map +0 -1
|
@@ -18,12 +18,8 @@ var _searchableFields = require("./contentEntry/searchableFields");
|
|
|
18
18
|
var _filterAsync = require("../utils/filterAsync");
|
|
19
19
|
var _constants = require("../constants");
|
|
20
20
|
var _entryDataFactories = require("./contentEntry/entryDataFactories");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return sort;
|
|
24
|
-
}
|
|
25
|
-
return ["revisionCreatedOn_DESC"];
|
|
26
|
-
};
|
|
21
|
+
var _useCases = require("./contentEntry/useCases");
|
|
22
|
+
var _ContentEntryTraverser = require("../utils/contentEntryTraverser/ContentEntryTraverser");
|
|
27
23
|
const createContentEntryCrud = params => {
|
|
28
24
|
const {
|
|
29
25
|
storageOperations,
|
|
@@ -90,6 +86,13 @@ const createContentEntryCrud = params => {
|
|
|
90
86
|
const onEntryAfterDelete = (0, _pubsub.createTopic)("cms.onEntryAfterDelete");
|
|
91
87
|
const onEntryDeleteError = (0, _pubsub.createTopic)("cms.onEntryDeleteError");
|
|
92
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Restore from bin
|
|
91
|
+
*/
|
|
92
|
+
const onEntryBeforeRestoreFromBin = (0, _pubsub.createTopic)("cms.onEntryBeforeRestoreFromBin");
|
|
93
|
+
const onEntryAfterRestoreFromBin = (0, _pubsub.createTopic)("cms.onEntryAfterRestoreFromBin");
|
|
94
|
+
const onEntryRestoreFromBinError = (0, _pubsub.createTopic)("cms.onEntryRestoreFromBinError");
|
|
95
|
+
|
|
93
96
|
/**
|
|
94
97
|
* Delete revision
|
|
95
98
|
*/
|
|
@@ -130,55 +133,141 @@ const createContentEntryCrud = params => {
|
|
|
130
133
|
});
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
|
-
*
|
|
136
|
+
* List entries
|
|
134
137
|
*/
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
});
|
|
152
|
-
} catch (ex) {
|
|
153
|
-
await onEntryDeleteError.publish({
|
|
154
|
-
entry,
|
|
155
|
-
model,
|
|
156
|
-
error: ex
|
|
157
|
-
});
|
|
158
|
-
throw new _error.default(ex.message || "Could not delete entry.", ex.code || "DELETE_ERROR", {
|
|
159
|
-
entry
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
};
|
|
138
|
+
const {
|
|
139
|
+
listEntriesUseCase,
|
|
140
|
+
listLatestUseCase,
|
|
141
|
+
listDeletedUseCase,
|
|
142
|
+
listPublishedUseCase,
|
|
143
|
+
getEntryUseCase
|
|
144
|
+
} = (0, _useCases.listEntriesUseCases)({
|
|
145
|
+
operation: storageOperations.entries["list"],
|
|
146
|
+
accessControl,
|
|
147
|
+
topics: {
|
|
148
|
+
onEntryBeforeList
|
|
149
|
+
},
|
|
150
|
+
context,
|
|
151
|
+
getIdentity: getSecurityIdentity
|
|
152
|
+
});
|
|
153
|
+
|
|
163
154
|
/**
|
|
164
|
-
*
|
|
155
|
+
* Get entries by ids
|
|
165
156
|
*/
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
};
|
|
157
|
+
const {
|
|
158
|
+
getEntriesByIdsUseCase
|
|
159
|
+
} = (0, _useCases.getEntriesByIdsUseCases)({
|
|
160
|
+
operation: storageOperations.entries.getByIds,
|
|
161
|
+
accessControl
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get latest entries by ids
|
|
166
|
+
*/
|
|
167
|
+
const {
|
|
168
|
+
getLatestEntriesByIdsUseCase
|
|
169
|
+
} = (0, _useCases.getLatestEntriesByIdsUseCases)({
|
|
170
|
+
operation: storageOperations.entries.getLatestByIds,
|
|
171
|
+
accessControl
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Get published entries by ids
|
|
176
|
+
*/
|
|
177
|
+
const {
|
|
178
|
+
getPublishedEntriesByIdsUseCase
|
|
179
|
+
} = (0, _useCases.getPublishedEntriesByIdsUseCases)({
|
|
180
|
+
operation: storageOperations.entries.getPublishedByIds,
|
|
181
|
+
accessControl
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Get revisions by entryId
|
|
186
|
+
*/
|
|
187
|
+
const {
|
|
188
|
+
getRevisionsByEntryIdUseCase
|
|
189
|
+
} = (0, _useCases.getRevisionsByEntryIdUseCases)({
|
|
190
|
+
operation: storageOperations.entries.getRevisions,
|
|
191
|
+
accessControl
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Get revision by id
|
|
196
|
+
*/
|
|
197
|
+
const {
|
|
198
|
+
getRevisionByIdUseCase
|
|
199
|
+
} = (0, _useCases.getRevisionByIdUseCases)({
|
|
200
|
+
operation: storageOperations.entries.getRevisionById
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Get latest revision by entryId
|
|
205
|
+
*/
|
|
206
|
+
const {
|
|
207
|
+
getLatestRevisionByEntryIdUseCase,
|
|
208
|
+
getLatestRevisionByEntryIdWithDeletedUseCase,
|
|
209
|
+
getLatestRevisionByEntryIdDeletedUseCase
|
|
210
|
+
} = (0, _useCases.getLatestRevisionByEntryIdUseCases)({
|
|
211
|
+
operation: storageOperations.entries.getLatestRevisionByEntryId
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Get previous revision by entryId
|
|
216
|
+
*/
|
|
217
|
+
const {
|
|
218
|
+
getPreviousRevisionByEntryIdUseCase
|
|
219
|
+
} = (0, _useCases.getPreviousRevisionByEntryIdUseCases)({
|
|
220
|
+
operation: storageOperations.entries.getPreviousRevision
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get published revision by entryId
|
|
225
|
+
*/
|
|
226
|
+
const {
|
|
227
|
+
getPublishedRevisionByEntryIdUseCase
|
|
228
|
+
} = (0, _useCases.getPublishedRevisionByEntryIdUseCases)({
|
|
229
|
+
operation: storageOperations.entries.getPublishedRevisionByEntryId
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Delete entry
|
|
234
|
+
*/
|
|
235
|
+
const {
|
|
236
|
+
deleteEntryUseCase,
|
|
237
|
+
moveEntryToBinUseCase,
|
|
238
|
+
deleteEntryOperation
|
|
239
|
+
} = (0, _useCases.deleteEntryUseCases)({
|
|
240
|
+
deleteOperation: storageOperations.entries.delete,
|
|
241
|
+
moveToBinOperation: storageOperations.entries.moveToBin,
|
|
242
|
+
getEntry: getLatestRevisionByEntryIdUseCase,
|
|
243
|
+
getEntryWithDeleted: getLatestRevisionByEntryIdWithDeletedUseCase,
|
|
244
|
+
getIdentity: getSecurityIdentity,
|
|
245
|
+
topics: {
|
|
246
|
+
onEntryBeforeDelete,
|
|
247
|
+
onEntryAfterDelete,
|
|
248
|
+
onEntryDeleteError
|
|
249
|
+
},
|
|
250
|
+
accessControl,
|
|
251
|
+
context
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Restore entry from bin
|
|
256
|
+
*/
|
|
257
|
+
const {
|
|
258
|
+
restoreEntryFromBinUseCase
|
|
259
|
+
} = (0, _useCases.restoreEntryFromBinUseCases)({
|
|
260
|
+
restoreOperation: storageOperations.entries.restoreFromBin,
|
|
261
|
+
getEntry: getLatestRevisionByEntryIdDeletedUseCase,
|
|
262
|
+
getIdentity: getSecurityIdentity,
|
|
263
|
+
topics: {
|
|
264
|
+
onEntryBeforeRestoreFromBin,
|
|
265
|
+
onEntryAfterRestoreFromBin,
|
|
266
|
+
onEntryRestoreFromBinError
|
|
267
|
+
},
|
|
268
|
+
accessControl,
|
|
269
|
+
context
|
|
270
|
+
});
|
|
182
271
|
const getEntryById = async (model, id) => {
|
|
183
272
|
const where = {
|
|
184
273
|
id
|
|
@@ -187,148 +276,14 @@ const createContentEntryCrud = params => {
|
|
|
187
276
|
where,
|
|
188
277
|
model
|
|
189
278
|
});
|
|
190
|
-
const [entry] = await
|
|
279
|
+
const [entry] = await getEntriesByIdsUseCase.execute(model, {
|
|
280
|
+
ids: [id]
|
|
281
|
+
});
|
|
191
282
|
if (!entry) {
|
|
192
283
|
throw new _handlerGraphql.NotFoundError(`Entry by ID "${id}" not found.`);
|
|
193
284
|
}
|
|
194
285
|
return entry;
|
|
195
286
|
};
|
|
196
|
-
const getPublishedEntriesByIds = async (model, ids) => {
|
|
197
|
-
await accessControl.ensureCanAccessEntry({
|
|
198
|
-
model
|
|
199
|
-
});
|
|
200
|
-
const entries = await storageOperations.entries.getPublishedByIds(model, {
|
|
201
|
-
ids
|
|
202
|
-
});
|
|
203
|
-
return (0, _filterAsync.filterAsync)(entries, async entry => {
|
|
204
|
-
return accessControl.canAccessEntry({
|
|
205
|
-
model,
|
|
206
|
-
entry
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
};
|
|
210
|
-
const getLatestEntriesByIds = async (model, ids) => {
|
|
211
|
-
await accessControl.ensureCanAccessEntry({
|
|
212
|
-
model
|
|
213
|
-
});
|
|
214
|
-
const entries = await storageOperations.entries.getLatestByIds(model, {
|
|
215
|
-
ids
|
|
216
|
-
});
|
|
217
|
-
return (0, _filterAsync.filterAsync)(entries, async entry => {
|
|
218
|
-
return accessControl.canAccessEntry({
|
|
219
|
-
model,
|
|
220
|
-
entry
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
|
-
const getEntry = async (model, params) => {
|
|
225
|
-
await accessControl.ensureCanAccessEntry({
|
|
226
|
-
model
|
|
227
|
-
});
|
|
228
|
-
const {
|
|
229
|
-
where,
|
|
230
|
-
sort
|
|
231
|
-
} = params;
|
|
232
|
-
await onEntryBeforeGet.publish({
|
|
233
|
-
where,
|
|
234
|
-
model
|
|
235
|
-
});
|
|
236
|
-
const [items] = await listEntries(model, {
|
|
237
|
-
where,
|
|
238
|
-
sort,
|
|
239
|
-
limit: 1
|
|
240
|
-
});
|
|
241
|
-
const item = items.shift();
|
|
242
|
-
if (!item) {
|
|
243
|
-
throw new _handlerGraphql.NotFoundError(`Entry not found!`);
|
|
244
|
-
}
|
|
245
|
-
return item;
|
|
246
|
-
};
|
|
247
|
-
const getEntryRevisions = async (model, entryId) => {
|
|
248
|
-
return storageOperations.entries.getRevisions(model, {
|
|
249
|
-
id: entryId
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
const listEntries = async (model, params) => {
|
|
253
|
-
await accessControl.ensureCanAccessEntry({
|
|
254
|
-
model
|
|
255
|
-
});
|
|
256
|
-
const {
|
|
257
|
-
where: initialWhere,
|
|
258
|
-
limit: initialLimit
|
|
259
|
-
} = params;
|
|
260
|
-
const limit = initialLimit && initialLimit > 0 ? initialLimit : 50;
|
|
261
|
-
const where = {
|
|
262
|
-
...initialWhere
|
|
263
|
-
};
|
|
264
|
-
/**
|
|
265
|
-
* Possibly only get records which are owned by current user.
|
|
266
|
-
* Or if searching for the owner set that value - in the case that user can see other entries than their own.
|
|
267
|
-
*/
|
|
268
|
-
if (await accessControl.canAccessOnlyOwnedEntries({
|
|
269
|
-
model
|
|
270
|
-
})) {
|
|
271
|
-
where.createdBy = getSecurityIdentity().id;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Where must contain either latest or published keys.
|
|
276
|
-
* We cannot list entries without one of those
|
|
277
|
-
*/
|
|
278
|
-
if (where.latest && where.published) {
|
|
279
|
-
throw new _error.default("Cannot list entries that are both published and latest.", "LIST_ENTRIES_ERROR", {
|
|
280
|
-
where
|
|
281
|
-
});
|
|
282
|
-
} else if (!where.latest && !where.published) {
|
|
283
|
-
throw new _error.default("Cannot list entries if we do not have latest or published defined.", "LIST_ENTRIES_ERROR", {
|
|
284
|
-
where
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
const fields = (0, _searchableFields.getSearchableFields)({
|
|
288
|
-
fields: model.fields,
|
|
289
|
-
plugins: context.plugins,
|
|
290
|
-
input: params.fields || []
|
|
291
|
-
});
|
|
292
|
-
try {
|
|
293
|
-
await onEntryBeforeList.publish({
|
|
294
|
-
where,
|
|
295
|
-
model
|
|
296
|
-
});
|
|
297
|
-
const {
|
|
298
|
-
hasMoreItems,
|
|
299
|
-
totalCount,
|
|
300
|
-
cursor,
|
|
301
|
-
items
|
|
302
|
-
} = await storageOperations.entries.list(model, {
|
|
303
|
-
...params,
|
|
304
|
-
sort: createSort(params.sort),
|
|
305
|
-
limit,
|
|
306
|
-
where,
|
|
307
|
-
fields
|
|
308
|
-
});
|
|
309
|
-
const meta = {
|
|
310
|
-
hasMoreItems,
|
|
311
|
-
totalCount,
|
|
312
|
-
/**
|
|
313
|
-
* Cursor should be null if there are no more items to load.
|
|
314
|
-
* Just make sure of that, disregarding what is returned from the storageOperations.entries.list method.
|
|
315
|
-
*/
|
|
316
|
-
cursor: hasMoreItems ? cursor : null
|
|
317
|
-
};
|
|
318
|
-
return [items, meta];
|
|
319
|
-
} catch (ex) {
|
|
320
|
-
throw new _error.default("Error while fetching entries from storage.", "LIST_ENTRIES_ERROR", {
|
|
321
|
-
params,
|
|
322
|
-
error: {
|
|
323
|
-
message: ex.message,
|
|
324
|
-
code: ex.code,
|
|
325
|
-
data: ex.data
|
|
326
|
-
},
|
|
327
|
-
model,
|
|
328
|
-
fields
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
287
|
const createEntry = async (model, rawInput, options) => {
|
|
333
288
|
await accessControl.ensureCanAccessEntry({
|
|
334
289
|
model,
|
|
@@ -398,10 +353,10 @@ const createContentEntryCrud = params => {
|
|
|
398
353
|
const {
|
|
399
354
|
id: uniqueId
|
|
400
355
|
} = (0, _utils.parseIdentifier)(sourceId);
|
|
401
|
-
const originalStorageEntry = await
|
|
356
|
+
const originalStorageEntry = await getRevisionByIdUseCase.execute(model, {
|
|
402
357
|
id: sourceId
|
|
403
358
|
});
|
|
404
|
-
const latestStorageEntry = await
|
|
359
|
+
const latestStorageEntry = await getLatestRevisionByEntryIdUseCase.execute(model, {
|
|
405
360
|
id: uniqueId
|
|
406
361
|
});
|
|
407
362
|
if (!originalStorageEntry) {
|
|
@@ -483,7 +438,7 @@ const createContentEntryCrud = params => {
|
|
|
483
438
|
/**
|
|
484
439
|
* The entry we are going to update.
|
|
485
440
|
*/
|
|
486
|
-
const originalStorageEntry = await
|
|
441
|
+
const originalStorageEntry = await getRevisionByIdUseCase.execute(model, {
|
|
487
442
|
id
|
|
488
443
|
});
|
|
489
444
|
if (!originalStorageEntry) {
|
|
@@ -560,7 +515,7 @@ const createContentEntryCrud = params => {
|
|
|
560
515
|
/**
|
|
561
516
|
* The entry we are going to update.
|
|
562
517
|
*/
|
|
563
|
-
const originalStorageEntry = await
|
|
518
|
+
const originalStorageEntry = await getRevisionByIdUseCase.execute(model, {
|
|
564
519
|
id
|
|
565
520
|
});
|
|
566
521
|
if (!originalStorageEntry) {
|
|
@@ -590,7 +545,7 @@ const createContentEntryCrud = params => {
|
|
|
590
545
|
/**
|
|
591
546
|
* The entry we are going to move to another folder.
|
|
592
547
|
*/
|
|
593
|
-
const originalStorageEntry = await
|
|
548
|
+
const originalStorageEntry = await getRevisionByIdUseCase.execute(model, {
|
|
594
549
|
id
|
|
595
550
|
});
|
|
596
551
|
if (!originalStorageEntry) {
|
|
@@ -645,7 +600,7 @@ const createContentEntryCrud = params => {
|
|
|
645
600
|
/**
|
|
646
601
|
* Fetch the entry from the storage.
|
|
647
602
|
*/
|
|
648
|
-
const originalStorageEntry = await
|
|
603
|
+
const originalStorageEntry = await getRevisionByIdUseCase.execute(model, {
|
|
649
604
|
id
|
|
650
605
|
});
|
|
651
606
|
if (!originalStorageEntry) {
|
|
@@ -718,13 +673,13 @@ const createContentEntryCrud = params => {
|
|
|
718
673
|
id: entryId,
|
|
719
674
|
version
|
|
720
675
|
} = (0, _utils.parseIdentifier)(revisionId);
|
|
721
|
-
const storageEntryToDelete = await
|
|
676
|
+
const storageEntryToDelete = await getRevisionByIdUseCase.execute(model, {
|
|
722
677
|
id: revisionId
|
|
723
678
|
});
|
|
724
|
-
const latestStorageEntry = await
|
|
679
|
+
const latestStorageEntry = await getLatestRevisionByEntryIdUseCase.execute(model, {
|
|
725
680
|
id: entryId
|
|
726
681
|
});
|
|
727
|
-
const storagePreviousEntry = await
|
|
682
|
+
const storagePreviousEntry = await getPreviousRevisionByEntryIdUseCase.execute(model, {
|
|
728
683
|
entryId,
|
|
729
684
|
version: version
|
|
730
685
|
});
|
|
@@ -744,8 +699,7 @@ const createContentEntryCrud = params => {
|
|
|
744
699
|
* to run full delete with hooks. In this case, `deleteRevision` hooks are not fired.
|
|
745
700
|
*/
|
|
746
701
|
if (entryToDelete.id === latestEntryRevisionId && !storagePreviousEntry) {
|
|
747
|
-
return await
|
|
748
|
-
model,
|
|
702
|
+
return await deleteEntryOperation.execute(model, {
|
|
749
703
|
entry: entryToDelete
|
|
750
704
|
});
|
|
751
705
|
}
|
|
@@ -877,59 +831,25 @@ const createContentEntryCrud = params => {
|
|
|
877
831
|
});
|
|
878
832
|
}
|
|
879
833
|
};
|
|
880
|
-
const deleteEntry = async (model, id, options) => {
|
|
881
|
-
await accessControl.ensureCanAccessEntry({
|
|
882
|
-
model,
|
|
883
|
-
rwd: "d"
|
|
884
|
-
});
|
|
834
|
+
const deleteEntry = async (model, id, options = {}) => {
|
|
885
835
|
const {
|
|
886
|
-
|
|
887
|
-
} = options
|
|
888
|
-
|
|
889
|
-
id
|
|
890
|
-
});
|
|
836
|
+
permanently = true
|
|
837
|
+
} = options;
|
|
838
|
+
|
|
891
839
|
/**
|
|
892
|
-
* If
|
|
840
|
+
* If the 'permanently' flag is set to false, the entry must be moved to the bin; otherwise, deleted.
|
|
893
841
|
*/
|
|
894
|
-
if (!
|
|
895
|
-
|
|
842
|
+
if (!permanently) {
|
|
843
|
+
return await moveEntryToBinUseCase.execute(model, id, options);
|
|
896
844
|
}
|
|
897
|
-
|
|
898
|
-
* In the case we are forcing the deletion, we do not need the storageEntry to exist as it might be an error when loading single database record.
|
|
899
|
-
*
|
|
900
|
-
* This happens, sometimes, in the Elasticsearch system as the entry might get deleted from the DynamoDB but not from the Elasticsearch.
|
|
901
|
-
* This is due to high load on the Elasticsearch at the time of the deletion.
|
|
902
|
-
*/
|
|
903
|
-
//
|
|
904
|
-
else if (!storageEntry && force) {
|
|
905
|
-
const {
|
|
906
|
-
id: entryId
|
|
907
|
-
} = (0, _utils.parseIdentifier)(id);
|
|
908
|
-
return await deleteEntryHelper({
|
|
909
|
-
model,
|
|
910
|
-
entry: {
|
|
911
|
-
id,
|
|
912
|
-
entryId
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
const entry = await (0, _entryStorage.entryFromStorageTransform)(context, model, storageEntry);
|
|
917
|
-
await accessControl.ensureCanAccessEntry({
|
|
918
|
-
model,
|
|
919
|
-
entry,
|
|
920
|
-
rwd: "d"
|
|
921
|
-
});
|
|
922
|
-
return await deleteEntryHelper({
|
|
923
|
-
model,
|
|
924
|
-
entry
|
|
925
|
-
});
|
|
845
|
+
return await deleteEntryUseCase.execute(model, id, options);
|
|
926
846
|
};
|
|
927
847
|
const publishEntry = async (model, id) => {
|
|
928
848
|
await accessControl.ensureCanAccessEntry({
|
|
929
849
|
model,
|
|
930
850
|
pw: "p"
|
|
931
851
|
});
|
|
932
|
-
const originalStorageEntry = await
|
|
852
|
+
const originalStorageEntry = await getRevisionByIdUseCase.execute(model, {
|
|
933
853
|
id
|
|
934
854
|
});
|
|
935
855
|
if (!originalStorageEntry) {
|
|
@@ -943,7 +863,7 @@ const createContentEntryCrud = params => {
|
|
|
943
863
|
});
|
|
944
864
|
|
|
945
865
|
// We need the latest entry to get the latest entry-level meta fields.
|
|
946
|
-
const latestStorageEntry = await
|
|
866
|
+
const latestStorageEntry = await getLatestRevisionByEntryIdUseCase.execute(model, {
|
|
947
867
|
id: originalEntry.entryId
|
|
948
868
|
});
|
|
949
869
|
if (!latestStorageEntry) {
|
|
@@ -1002,7 +922,7 @@ const createContentEntryCrud = params => {
|
|
|
1002
922
|
const {
|
|
1003
923
|
id: entryId
|
|
1004
924
|
} = (0, _utils.parseIdentifier)(id);
|
|
1005
|
-
const originalStorageEntry = await
|
|
925
|
+
const originalStorageEntry = await getPublishedRevisionByEntryIdUseCase.execute(model, {
|
|
1006
926
|
id: entryId
|
|
1007
927
|
});
|
|
1008
928
|
if (!originalStorageEntry) {
|
|
@@ -1123,7 +1043,17 @@ const createContentEntryCrud = params => {
|
|
|
1123
1043
|
});
|
|
1124
1044
|
}
|
|
1125
1045
|
};
|
|
1046
|
+
const getEntryTraverser = async modelId => {
|
|
1047
|
+
const modelAstConverter = context.cms.getModelToAstConverter();
|
|
1048
|
+
const model = await context.cms.getModel(modelId);
|
|
1049
|
+
if (!model) {
|
|
1050
|
+
throw new Error(`Missing "${modelId}" model!`);
|
|
1051
|
+
}
|
|
1052
|
+
const modelAst = modelAstConverter.toAst(model);
|
|
1053
|
+
return new _ContentEntryTraverser.ContentEntryTraverser(modelAst);
|
|
1054
|
+
};
|
|
1126
1055
|
return {
|
|
1056
|
+
getEntryTraverser,
|
|
1127
1057
|
onEntryBeforeCreate,
|
|
1128
1058
|
onEntryAfterCreate,
|
|
1129
1059
|
onEntryCreateError,
|
|
@@ -1139,6 +1069,9 @@ const createContentEntryCrud = params => {
|
|
|
1139
1069
|
onEntryBeforeDelete,
|
|
1140
1070
|
onEntryAfterDelete,
|
|
1141
1071
|
onEntryDeleteError,
|
|
1072
|
+
onEntryBeforeRestoreFromBin,
|
|
1073
|
+
onEntryAfterRestoreFromBin,
|
|
1074
|
+
onEntryRestoreFromBinError,
|
|
1142
1075
|
onEntryRevisionBeforeDelete,
|
|
1143
1076
|
onEntryRevisionAfterDelete,
|
|
1144
1077
|
onEntryRevisionDeleteError,
|
|
@@ -1156,7 +1089,13 @@ const createContentEntryCrud = params => {
|
|
|
1156
1089
|
/**
|
|
1157
1090
|
* Get entries by exact revision IDs from the database.
|
|
1158
1091
|
*/
|
|
1159
|
-
getEntriesByIds,
|
|
1092
|
+
async getEntriesByIds(model, ids) {
|
|
1093
|
+
return context.benchmark.measure("headlessCms.crud.entries.getEntriesByIds", async () => {
|
|
1094
|
+
return getEntriesByIdsUseCase.execute(model, {
|
|
1095
|
+
ids
|
|
1096
|
+
});
|
|
1097
|
+
});
|
|
1098
|
+
},
|
|
1160
1099
|
/**
|
|
1161
1100
|
* Get a single entry by revision ID from the database.
|
|
1162
1101
|
*/
|
|
@@ -1170,7 +1109,9 @@ const createContentEntryCrud = params => {
|
|
|
1170
1109
|
*/
|
|
1171
1110
|
async getPublishedEntriesByIds(model, ids) {
|
|
1172
1111
|
return context.benchmark.measure("headlessCms.crud.entries.getPublishedEntriesByIds", async () => {
|
|
1173
|
-
return
|
|
1112
|
+
return getPublishedEntriesByIdsUseCase.execute(model, {
|
|
1113
|
+
ids
|
|
1114
|
+
});
|
|
1174
1115
|
});
|
|
1175
1116
|
},
|
|
1176
1117
|
/**
|
|
@@ -1178,22 +1119,24 @@ const createContentEntryCrud = params => {
|
|
|
1178
1119
|
*/
|
|
1179
1120
|
async getLatestEntriesByIds(model, ids) {
|
|
1180
1121
|
return context.benchmark.measure("headlessCms.crud.entries.getLatestEntriesByIds", async () => {
|
|
1181
|
-
return
|
|
1122
|
+
return getLatestEntriesByIdsUseCase.execute(model, {
|
|
1123
|
+
ids
|
|
1124
|
+
});
|
|
1182
1125
|
});
|
|
1183
1126
|
},
|
|
1184
1127
|
async getEntryRevisions(model, entryId) {
|
|
1185
1128
|
return context.benchmark.measure("headlessCms.crud.entries.getEntryRevisions", async () => {
|
|
1186
|
-
return
|
|
1129
|
+
return getRevisionsByEntryIdUseCase.execute(model, {
|
|
1130
|
+
id: entryId
|
|
1131
|
+
});
|
|
1187
1132
|
});
|
|
1188
1133
|
},
|
|
1189
1134
|
/**
|
|
1190
|
-
* TODO determine if this method is required at all.
|
|
1191
|
-
*
|
|
1192
1135
|
* @internal
|
|
1193
1136
|
*/
|
|
1194
1137
|
async getEntry(model, params) {
|
|
1195
1138
|
return context.benchmark.measure("headlessCms.crud.entries.getEntry", async () => {
|
|
1196
|
-
return
|
|
1139
|
+
return await getEntryUseCase.execute(model, params);
|
|
1197
1140
|
});
|
|
1198
1141
|
},
|
|
1199
1142
|
/**
|
|
@@ -1203,29 +1146,22 @@ const createContentEntryCrud = params => {
|
|
|
1203
1146
|
*/
|
|
1204
1147
|
async listEntries(model, params) {
|
|
1205
1148
|
return context.benchmark.measure("headlessCms.crud.entries.listEntries", async () => {
|
|
1206
|
-
return
|
|
1149
|
+
return await listEntriesUseCase.execute(model, params);
|
|
1207
1150
|
});
|
|
1208
1151
|
},
|
|
1209
1152
|
async listLatestEntries(model, params) {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
}
|
|
1153
|
+
return context.benchmark.measure("headlessCms.crud.entries.listLatestEntries", async () => {
|
|
1154
|
+
return await listLatestUseCase.execute(model, params);
|
|
1155
|
+
});
|
|
1156
|
+
},
|
|
1157
|
+
async listDeletedEntries(model, params) {
|
|
1158
|
+
return context.benchmark.measure("headlessCms.crud.entries.listDeletedEntries", async () => {
|
|
1159
|
+
return await listDeletedUseCase.execute(model, params);
|
|
1218
1160
|
});
|
|
1219
1161
|
},
|
|
1220
1162
|
async listPublishedEntries(model, params) {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
sort: ["createdOn_DESC"],
|
|
1224
|
-
...(params || {}),
|
|
1225
|
-
where: {
|
|
1226
|
-
...where,
|
|
1227
|
-
published: true
|
|
1228
|
-
}
|
|
1163
|
+
return context.benchmark.measure("headlessCms.crud.entries.listPublishedEntries", async () => {
|
|
1164
|
+
return await listPublishedUseCase.execute(model, params);
|
|
1229
1165
|
});
|
|
1230
1166
|
},
|
|
1231
1167
|
async createEntry(model, input, options) {
|
|
@@ -1272,6 +1208,11 @@ const createContentEntryCrud = params => {
|
|
|
1272
1208
|
return deleteEntry(model, entryId, options);
|
|
1273
1209
|
});
|
|
1274
1210
|
},
|
|
1211
|
+
async restoreEntryFromBin(model, entryId) {
|
|
1212
|
+
return context.benchmark.measure("headlessCms.crud.entries.restoreEntryFromBin", async () => {
|
|
1213
|
+
return await restoreEntryFromBinUseCase.execute(model, entryId);
|
|
1214
|
+
});
|
|
1215
|
+
},
|
|
1275
1216
|
async deleteMultipleEntries(model, ids) {
|
|
1276
1217
|
return context.benchmark.measure("headlessCms.crud.entries.deleteMultipleEntries", async () => {
|
|
1277
1218
|
return deleteMultipleEntries(model, ids);
|