@webiny/api-headless-cms 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HeadlessCmsEndpointConfig.d.ts +10 -0
- package/HeadlessCmsEndpointConfig.js +5 -0
- package/HeadlessCmsEndpointConfig.js.map +1 -0
- package/HeadlessCmsFeature.d.ts +10 -0
- package/HeadlessCmsFeature.js +168 -0
- package/HeadlessCmsFeature.js.map +1 -0
- package/createCmsRoute.d.ts +24 -0
- package/createCmsRoute.js +47 -0
- package/createCmsRoute.js.map +1 -0
- package/crud/contentEntry/entryDataValidation.js +14 -7
- package/crud/contentEntry/entryDataValidation.js.map +1 -1
- package/crud/contentEntry/references/validateEntries.d.ts +1 -1
- package/crud/contentEntry/references/validateEntries.js +17 -7
- package/crud/contentEntry/references/validateEntries.js.map +1 -1
- package/domain/contentModel/schemas.d.ts +2 -0
- package/domain/contentModel/schemas.js +1 -0
- package/domain/contentModel/schemas.js.map +1 -1
- package/domain/contentModel/validation/dateExpressions.d.ts +6 -0
- package/domain/contentModel/validation/dateExpressions.js +27 -0
- package/domain/contentModel/validation/dateExpressions.js.map +1 -0
- package/domain/contentModel/validation/modelFields.js +23 -15
- package/domain/contentModel/validation/modelFields.js.map +1 -1
- package/export/abstractions.d.ts +9 -0
- package/export/abstractions.js +6 -0
- package/export/abstractions.js.map +1 -0
- package/export/crud/exporting.js +8 -2
- package/export/crud/exporting.js.map +1 -1
- package/export/crud/importing.js +13 -4
- package/export/crud/importing.js.map +1 -1
- package/export/crud/imports/importGroups.js +23 -23
- package/export/crud/imports/importGroups.js.map +1 -1
- package/export/crud/imports/importModels.js +25 -22
- package/export/crud/imports/importModels.js.map +1 -1
- package/export/graphql/index.d.ts +2 -3
- package/export/graphql/index.js +6 -10
- package/export/graphql/index.js.map +1 -1
- package/exports/api/cms/entry.d.ts +5 -0
- package/exports/api/cms/entry.js +5 -0
- package/exports/api/cms/storage.d.ts +0 -1
- package/exports/api/cms/storage.js +0 -1
- package/features/ai/DescribeContentModelTool.d.ts +60 -0
- package/features/ai/DescribeContentModelTool.js +69 -0
- package/features/ai/DescribeContentModelTool.js.map +1 -0
- package/features/ai/ListContentModelsTool.d.ts +46 -0
- package/features/ai/ListContentModelsTool.js +53 -0
- package/features/ai/ListContentModelsTool.js.map +1 -0
- package/features/ai/QueryEntriesTool.d.ts +80 -0
- package/features/ai/QueryEntriesTool.js +99 -0
- package/features/ai/QueryEntriesTool.js.map +1 -0
- package/features/ai/feature.d.ts +8 -0
- package/features/ai/feature.js +15 -0
- package/features/ai/feature.js.map +1 -0
- package/features/ai/index.d.ts +4 -0
- package/features/ai/index.js +4 -0
- package/features/contentEntry/ContentEntriesFeature.js +8 -4
- package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
- package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +6 -4
- package/features/contentEntry/CreateEntry/CreateEntryRepository.js +7 -8
- package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +5 -3
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +4 -5
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +6 -4
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +7 -8
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +5 -5
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +8 -17
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
- package/features/contentEntry/CreateEntryRevisionFrom/abstractions.d.ts +2 -0
- package/features/contentEntry/CreateEntryRevisionFrom/abstractions.js.map +1 -1
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +6 -4
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +7 -8
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
- package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +5 -3
- package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +4 -5
- package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -4
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +9 -11
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
- package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +5 -3
- package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +4 -5
- package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
- package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
- package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
- package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -4
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +7 -8
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +5 -3
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +4 -5
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +6 -4
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +8 -9
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +5 -3
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +13 -13
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
- package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.d.ts +17 -0
- package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js +83 -0
- package/features/contentEntry/DuplicateEntry/DuplicateEntryUseCase.js.map +1 -0
- package/features/contentEntry/DuplicateEntry/abstractions.d.ts +47 -0
- package/features/contentEntry/DuplicateEntry/abstractions.js +5 -0
- package/features/contentEntry/DuplicateEntry/abstractions.js.map +1 -0
- package/features/contentEntry/DuplicateEntry/events.d.ts +41 -0
- package/features/contentEntry/DuplicateEntry/events.js +32 -0
- package/features/contentEntry/DuplicateEntry/events.js.map +1 -0
- package/features/contentEntry/{UpdateRevision → DuplicateEntry}/feature.d.ts +1 -1
- package/features/contentEntry/DuplicateEntry/feature.js +11 -0
- package/features/contentEntry/DuplicateEntry/feature.js.map +1 -0
- package/features/contentEntry/DuplicateEntry/index.d.ts +2 -0
- package/features/contentEntry/DuplicateEntry/index.js +2 -0
- package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.d.ts +7 -0
- package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js +12 -0
- package/features/contentEntry/DuplicateEntry/prepareDuplicateValues.js.map +1 -0
- package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.d.ts +10 -0
- package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js +25 -0
- package/features/contentEntry/EntryEventPublisher/EntryEventPublisher.js.map +1 -0
- package/features/contentEntry/EntryEventPublisher/abstractions.d.ts +16 -0
- package/features/contentEntry/EntryEventPublisher/abstractions.js +5 -0
- package/features/contentEntry/EntryEventPublisher/abstractions.js.map +1 -0
- package/features/contentEntry/EntryEventPublisher/feature.d.ts +4 -0
- package/features/contentEntry/EntryEventPublisher/feature.js +11 -0
- package/features/contentEntry/EntryEventPublisher/feature.js.map +1 -0
- package/features/contentEntry/EntryEventPublisher/index.d.ts +2 -0
- package/features/contentEntry/EntryEventPublisher/index.js +2 -0
- package/features/contentEntry/EntrySystemField/abstractions.d.ts +14 -0
- package/features/contentEntry/EntrySystemField/abstractions.js +5 -0
- package/features/contentEntry/EntrySystemField/abstractions.js.map +1 -0
- package/features/contentEntry/EntrySystemField/index.d.ts +1 -0
- package/features/contentEntry/EntrySystemField/index.js +1 -0
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +6 -4
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +7 -8
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js.map +1 -1
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.d.ts +3 -1
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js +2 -3
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsUseCase.js.map +1 -1
- package/features/contentEntry/GetEntry/GetEntryUseCase.d.ts +3 -1
- package/features/contentEntry/GetEntry/GetEntryUseCase.js +2 -3
- package/features/contentEntry/GetEntry/GetEntryUseCase.js.map +1 -1
- package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js +2 -3
- package/features/contentEntry/GetEntryById/GetEntryByIdUseCase.js.map +1 -1
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.d.ts +6 -4
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +8 -9
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js.map +1 -1
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.d.ts +3 -1
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js +2 -3
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsUseCase.js.map +1 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.d.ts +3 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js +2 -3
- package/features/contentEntry/GetLatestRevisionByEntryId/BaseUseCase.js.map +1 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.d.ts +6 -4
- package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +8 -9
- package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js.map +1 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js +2 -3
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestDeletedRevisionByEntryIdUseCase.js.map +1 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.d.ts +3 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js +1 -3
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdIncludingDeletedUseCase.js.map +1 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js +2 -3
- package/features/contentEntry/GetLatestRevisionByEntryId/variations/GetLatestRevisionByEntryIdUseCase.js.map +1 -1
- package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.d.ts +3 -1
- package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js +2 -3
- package/features/contentEntry/GetPreviousRevisionByEntryId/BaseUseCase.js.map +1 -1
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.d.ts +6 -4
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +7 -8
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js.map +1 -1
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js +2 -3
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdUseCase.js.map +1 -1
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.d.ts +6 -4
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +8 -9
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js.map +1 -1
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.d.ts +3 -1
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js +2 -3
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsUseCase.js.map +1 -1
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.d.ts +6 -4
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +8 -9
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js.map +1 -1
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js +2 -3
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdUseCase.js.map +1 -1
- package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.d.ts +6 -4
- package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +7 -8
- package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js.map +1 -1
- package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js +1 -3
- package/features/contentEntry/GetRevisionById/GetRevisionByIdUseCase.js.map +1 -1
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.d.ts +6 -4
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +8 -9
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js.map +1 -1
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.d.ts +3 -1
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js +2 -3
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdUseCase.js.map +1 -1
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +6 -4
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +7 -8
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js.map +1 -1
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +6 -2
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +8 -6
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
- package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.d.ts +3 -1
- package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js +1 -3
- package/features/contentEntry/ListEntries/ListDeletedEntriesUseCase.js.map +1 -1
- package/features/contentEntry/ListEntries/ListEntriesRepository.d.ts +6 -4
- package/features/contentEntry/ListEntries/ListEntriesRepository.js +8 -9
- package/features/contentEntry/ListEntries/ListEntriesRepository.js.map +1 -1
- package/features/contentEntry/ListEntries/ListEntriesUseCase.d.ts +3 -1
- package/features/contentEntry/ListEntries/ListEntriesUseCase.js +2 -3
- package/features/contentEntry/ListEntries/ListEntriesUseCase.js.map +1 -1
- package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.d.ts +3 -1
- package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js +1 -3
- package/features/contentEntry/ListEntries/ListLatestEntriesUseCase.js.map +1 -1
- package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.d.ts +3 -1
- package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js +1 -3
- package/features/contentEntry/ListEntries/ListPublishedEntriesUseCase.js.map +1 -1
- package/features/contentEntry/MoveEntry/MoveEntryRepository.d.ts +6 -4
- package/features/contentEntry/MoveEntry/MoveEntryRepository.js +7 -8
- package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +5 -3
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +13 -7
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
- package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +7 -5
- package/features/contentEntry/PublishEntry/PublishEntryRepository.js +8 -9
- package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
- package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +7 -7
- package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +13 -16
- package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
- package/features/contentEntry/PublishEntry/abstractions.d.ts +8 -1
- package/features/contentEntry/PublishEntry/abstractions.js.map +1 -1
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +8 -4
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +11 -9
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
- package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +5 -3
- package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +7 -6
- package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +6 -4
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +7 -8
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +5 -3
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +4 -5
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +6 -4
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +7 -8
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
- package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +5 -3
- package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +7 -6
- package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +7 -5
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +7 -8
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
- package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +5 -3
- package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +7 -6
- package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
- package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.d.ts +19 -0
- package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.js +70 -0
- package/features/contentEntry/UpdateEntrySystem/UpdateEntrySystemUseCase.js.map +1 -0
- package/features/contentEntry/UpdateEntrySystem/abstractions.d.ts +24 -0
- package/features/contentEntry/UpdateEntrySystem/abstractions.js +5 -0
- package/features/contentEntry/UpdateEntrySystem/abstractions.js.map +1 -0
- package/features/contentEntry/UpdateEntrySystem/events.d.ts +29 -0
- package/features/contentEntry/UpdateEntrySystem/events.js +23 -0
- package/features/contentEntry/UpdateEntrySystem/events.js.map +1 -0
- package/features/contentEntry/UpdateEntrySystem/feature.d.ts +4 -0
- package/features/contentEntry/UpdateEntrySystem/feature.js +11 -0
- package/features/contentEntry/UpdateEntrySystem/feature.js.map +1 -0
- package/features/contentEntry/UpdateEntrySystem/index.d.ts +2 -0
- package/features/contentEntry/UpdateEntrySystem/index.js +2 -0
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +6 -4
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +6 -7
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
- package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
- package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
- package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +1 -3
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +8 -4
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +41 -16
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.d.ts +17 -1
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/abstractions.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +8 -4
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +23 -18
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.d.ts +15 -1
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/abstractions.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +8 -4
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +18 -15
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.d.ts +13 -1
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/abstractions.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +9 -7
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +18 -20
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.d.ts +14 -2
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/abstractions.js.map +1 -1
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +8 -4
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +67 -31
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.d.ts +15 -1
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/abstractions.js.map +1 -1
- package/features/contentEntry/entryDataFactories/hasEntryContentChanged.d.ts +24 -0
- package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js +13 -0
- package/features/contentEntry/entryDataFactories/hasEntryContentChanged.js.map +1 -0
- package/features/contentModel/CreateModel/CreateModelRepository.d.ts +5 -6
- package/features/contentModel/CreateModel/CreateModelRepository.js +9 -12
- package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
- package/features/contentModel/CreateModel/CreateModelUseCase.js +2 -2
- package/features/contentModel/CreateModel/CreateModelUseCase.js.map +1 -1
- package/features/contentModel/CreateModel/abstractions.d.ts +1 -1
- package/features/contentModel/CreateModel/abstractions.js.map +1 -1
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +5 -6
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +9 -12
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
- package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js +2 -2
- package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js.map +1 -1
- package/features/contentModel/CreateModelFrom/abstractions.d.ts +1 -1
- package/features/contentModel/CreateModelFrom/abstractions.js.map +1 -1
- package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +3 -3
- package/features/contentModel/DeleteModel/DeleteModelRepository.js +5 -5
- package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
- package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +9 -3
- package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +36 -18
- package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js.map +1 -1
- package/features/contentModel/ModelToAstConverter/ModelToAstConverter.d.ts +1 -1
- package/features/contentModel/ModelToAstConverter/ModelToAstConverter.js.map +1 -1
- package/features/contentModel/ModelToAstConverter/abstractions.d.ts +1 -1
- package/features/contentModel/ModelToAstConverter/abstractions.js.map +1 -1
- package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +7 -4
- package/features/contentModel/UpdateModel/UpdateModelRepository.js +10 -6
- package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
- package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
- package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +1 -1
- package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -1
- package/features/contentModel/shared/ModelsFetcher.d.ts +9 -8
- package/features/contentModel/shared/ModelsFetcher.js +5 -5
- package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
- package/features/contentModel/shared/PluginModelsProvider.d.ts +9 -5
- package/features/contentModel/shared/PluginModelsProvider.js +11 -15
- package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
- package/features/contentModel/shared/abstractions.d.ts +10 -0
- package/features/contentModel/shared/abstractions.js +2 -1
- package/features/contentModel/shared/abstractions.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +11 -7
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +19 -19
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +6 -2
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +9 -8
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/abstractions.d.ts +1 -1
- package/features/contentModelGroup/CreateGroup/abstractions.js.map +1 -1
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +8 -4
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +11 -9
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js.map +1 -1
- package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.d.ts +3 -1
- package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js +2 -3
- package/features/contentModelGroup/DeleteGroup/DeleteGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/GetGroup/GetGroupRepository.d.ts +6 -4
- package/features/contentModelGroup/GetGroup/GetGroupRepository.js +9 -9
- package/features/contentModelGroup/GetGroup/GetGroupRepository.js.map +1 -1
- package/features/contentModelGroup/GetGroup/GetGroupUseCase.d.ts +3 -1
- package/features/contentModelGroup/GetGroup/GetGroupUseCase.js +2 -3
- package/features/contentModelGroup/GetGroup/GetGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/ListGroups/ListGroupsRepository.d.ts +6 -4
- package/features/contentModelGroup/ListGroups/ListGroupsRepository.js +9 -9
- package/features/contentModelGroup/ListGroups/ListGroupsRepository.js.map +1 -1
- package/features/contentModelGroup/ListGroups/ListGroupsUseCase.d.ts +3 -1
- package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js +2 -3
- package/features/contentModelGroup/ListGroups/ListGroupsUseCase.js.map +1 -1
- package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.d.ts +6 -4
- package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +7 -8
- package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
- package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
- package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +2 -3
- package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/shared/PluginGroupsProvider.d.ts +6 -4
- package/features/contentModelGroup/shared/PluginGroupsProvider.js +13 -11
- package/features/contentModelGroup/shared/PluginGroupsProvider.js.map +1 -1
- package/features/contentModelGroup/shared/abstractions.d.ts +10 -0
- package/features/contentModelGroup/shared/abstractions.js +2 -1
- package/features/contentModelGroup/shared/abstractions.js.map +1 -1
- package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.d.ts +2 -2
- package/features/graphql/fields/abstractions/CmsModelFieldToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/AssetToGraphQL.d.ts +1 -1
- package/features/graphql/fields/base/AssetToGraphQL.js +7 -2
- package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
- package/features/graphql/fields/base/RefToGraphQL.js +14 -8
- package/features/graphql/fields/base/RefToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/richText/richTextResolver.d.ts +1 -1
- package/features/graphql/fields/base/richText/richTextResolver.js.map +1 -1
- package/features/modelBuilder/abstractions.d.ts +4 -0
- package/features/modelBuilder/abstractions.js.map +1 -1
- package/features/modelBuilder/feature.js +1 -8
- package/features/modelBuilder/feature.js.map +1 -1
- package/features/modelBuilder/fields/DataFieldBuilder.d.ts +17 -0
- package/features/modelBuilder/fields/DataFieldBuilder.js +6 -0
- package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
- package/features/modelBuilder/fields/DateTimeFieldType.js +27 -12
- package/features/modelBuilder/fields/DateTimeFieldType.js.map +1 -1
- package/features/modelBuilder/fields/TextFieldType.d.ts +3 -1
- package/features/modelBuilder/fields/TextFieldType.js +1 -3
- package/features/modelBuilder/fields/TextFieldType.js.map +1 -1
- package/features/modelBuilder/fields/fieldTypeValidator.d.ts +5 -3
- package/features/modelBuilder/models/ModelBuilder.d.ts +8 -0
- package/features/modelBuilder/models/ModelBuilder.js +1 -0
- package/features/modelBuilder/models/ModelBuilder.js.map +1 -1
- package/features/modelBuilder/models/ModelsProvider.d.ts +1 -3
- package/features/modelBuilder/models/ModelsProvider.js +2 -7
- package/features/modelBuilder/models/ModelsProvider.js.map +1 -1
- package/features/modelBuilder/models/PrivateModelBuilder.d.ts +5 -0
- package/features/modelBuilder/models/PrivateModelBuilder.js +12 -1
- package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
- package/features/shared/abstractions.d.ts +8 -16
- package/features/shared/abstractions.js +2 -3
- package/features/shared/abstractions.js.map +1 -1
- package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/CreateEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/CreateEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetEntriesByIdsStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetLatestEntriesByIdsStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetLatestRevisionByEntryIdStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetPreviousRevisionStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetPublishedEntriesByIdsStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetPublishedRevisionByEntryIdStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetRevisionByIdStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetRevisionsStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/ListEntriesStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/ListEntriesStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/MoveEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/MoveEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/MoveToBinStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/MoveToBinStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/PublishEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/PublishEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/RestoreFromBinStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js +5 -0
- package/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/group/CreateGroupStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/group/CreateGroupStorageOperation.js +5 -0
- package/features/shared/storageOperations/group/CreateGroupStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/group/DeleteGroupStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js +5 -0
- package/features/shared/storageOperations/group/DeleteGroupStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/group/GetGroupStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/group/GetGroupStorageOperation.js +5 -0
- package/features/shared/storageOperations/group/GetGroupStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/group/ListGroupsStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/group/ListGroupsStorageOperation.js +5 -0
- package/features/shared/storageOperations/group/ListGroupsStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/group/UpdateGroupStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js +5 -0
- package/features/shared/storageOperations/group/UpdateGroupStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/index.d.ts +32 -0
- package/features/shared/storageOperations/index.js +32 -0
- package/features/shared/storageOperations/model/CreateModelStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/model/CreateModelStorageOperation.js +5 -0
- package/features/shared/storageOperations/model/CreateModelStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/model/DeleteModelStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/model/DeleteModelStorageOperation.js +5 -0
- package/features/shared/storageOperations/model/DeleteModelStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/model/GetModelStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/model/GetModelStorageOperation.js +5 -0
- package/features/shared/storageOperations/model/GetModelStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/model/ListModelsStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/model/ListModelsStorageOperation.js +5 -0
- package/features/shared/storageOperations/model/ListModelsStorageOperation.js.map +1 -0
- package/features/shared/storageOperations/model/UpdateModelStorageOperation.d.ts +8 -0
- package/features/shared/storageOperations/model/UpdateModelStorageOperation.js +5 -0
- package/features/shared/storageOperations/model/UpdateModelStorageOperation.js.map +1 -0
- package/features/validation/abstractions/CmsModelFieldValidator.d.ts +5 -0
- package/features/validation/abstractions/CmsModelFieldValidator.js.map +1 -1
- package/features/validation/validators/DateGteValidator.d.ts +2 -0
- package/features/validation/validators/DateGteValidator.js +12 -2
- package/features/validation/validators/DateGteValidator.js.map +1 -1
- package/features/validation/validators/DateLteValidator.d.ts +2 -0
- package/features/validation/validators/DateLteValidator.js +12 -2
- package/features/validation/validators/DateLteValidator.js.map +1 -1
- package/features/validation/validators/dateLimit.d.ts +9 -0
- package/features/validation/validators/dateLimit.js +18 -0
- package/features/validation/validators/dateLimit.js.map +1 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/abstractions.d.ts +14 -0
- package/fieldConverters/abstractions.js +13 -0
- package/fieldConverters/abstractions.js.map +1 -0
- package/graphql/CmsGraphQLSchemaFactory.d.ts +8 -0
- package/graphql/CmsGraphQLSchemaFactory.js +5 -0
- package/graphql/CmsGraphQLSchemaFactory.js.map +1 -0
- package/graphql/CmsSchemaExecutor.d.ts +10 -0
- package/graphql/CmsSchemaExecutor.js +5 -0
- package/graphql/CmsSchemaExecutor.js.map +1 -0
- package/graphql/buildSchemaPlugins.d.ts +2 -1
- package/graphql/buildSchemaPlugins.js +1 -3
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/checkEndpointAccess.js +5 -2
- package/graphql/checkEndpointAccess.js.map +1 -1
- package/graphql/createExecutableSchema.d.ts +1 -1
- package/graphql/createExecutableSchema.js +1 -1
- package/graphql/createExecutableSchema.js.map +1 -1
- package/graphql/generateSchema.d.ts +2 -1
- package/graphql/generateSchema.js +14 -5
- package/graphql/generateSchema.js.map +1 -1
- package/graphql/getSchema.js +7 -2
- package/graphql/getSchema.js.map +1 -1
- package/graphql/scalars/RevisionIdScalarPlugin.d.ts +1 -1
- package/graphql/scalars/RevisionIdScalarPlugin.js.map +1 -1
- package/graphql/schema/baseContentSchema.d.ts +1 -6
- package/graphql/schema/baseContentSchema.js +5 -8
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.d.ts +2 -2
- package/graphql/schema/baseSchema.js +3 -18
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/cms/CmsBaseErrorTypeFactory.d.ts +15 -0
- package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +25 -0
- package/graphql/schema/cms/CmsBaseErrorTypeFactory.js.map +1 -0
- package/graphql/schema/cms/createEntryResolver.js +2 -2
- package/graphql/schema/cms/createEntryResolver.js.map +1 -1
- package/graphql/schema/cms/deleteEntryResolver.js +2 -2
- package/graphql/schema/cms/deleteEntryResolver.js.map +1 -1
- package/graphql/schema/cms/getEntryResolver.js +2 -2
- package/graphql/schema/cms/getEntryResolver.js.map +1 -1
- package/graphql/schema/cms/helpers/getModel.d.ts +0 -3
- package/graphql/schema/cms/helpers/getModel.js +5 -3
- package/graphql/schema/cms/helpers/getModel.js.map +1 -1
- package/graphql/schema/cms/listEntriesResolver.js +2 -2
- package/graphql/schema/cms/listEntriesResolver.js.map +1 -1
- package/graphql/schema/cms/publishEntryResolver.js +2 -2
- package/graphql/schema/cms/publishEntryResolver.js.map +1 -1
- package/graphql/schema/cms/resolvers/createEntry.d.ts +3 -2
- package/graphql/schema/cms/resolvers/createEntry.js +5 -1
- package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
- package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +3 -2
- package/graphql/schema/cms/resolvers/deleteEntryRevision.js +5 -1
- package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
- package/graphql/schema/cms/resolvers/getEntry.d.ts +3 -2
- package/graphql/schema/cms/resolvers/getEntry.js +5 -1
- package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
- package/graphql/schema/cms/resolvers/getModel.d.ts +3 -2
- package/graphql/schema/cms/resolvers/getModel.js +5 -1
- package/graphql/schema/cms/resolvers/getModel.js.map +1 -1
- package/graphql/schema/cms/resolvers/listEntries.d.ts +3 -2
- package/graphql/schema/cms/resolvers/listEntries.js +5 -1
- package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
- package/graphql/schema/cms/resolvers/mutationCms.d.ts +3 -2
- package/graphql/schema/cms/resolvers/mutationCms.js +5 -1
- package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
- package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +3 -2
- package/graphql/schema/cms/resolvers/publishEntryRevision.js +5 -1
- package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
- package/graphql/schema/cms/resolvers/queryCms.d.ts +3 -2
- package/graphql/schema/cms/resolvers/queryCms.js +5 -1
- package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +3 -2
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +5 -1
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
- package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +3 -2
- package/graphql/schema/cms/resolvers/updateEntryRevision.js +5 -1
- package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
- package/graphql/schema/cms/typeDefs/mutation.d.ts +3 -2
- package/graphql/schema/cms/typeDefs/mutation.js +5 -1
- package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
- package/graphql/schema/cms/typeDefs/query.d.ts +3 -2
- package/graphql/schema/cms/typeDefs/query.js +5 -1
- package/graphql/schema/cms/typeDefs/query.js.map +1 -1
- package/graphql/schema/cms/typeDefs/responses.d.ts +3 -2
- package/graphql/schema/cms/typeDefs/responses.js +5 -1
- package/graphql/schema/cms/typeDefs/responses.js.map +1 -1
- package/graphql/schema/cms/unpublishEntryResolver.js +2 -2
- package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -1
- package/graphql/schema/cms/updateEntryResolver.js +2 -2
- package/graphql/schema/cms/updateEntryResolver.js.map +1 -1
- package/graphql/schema/contentEntries.js +60 -34
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.js +39 -18
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.js +32 -15
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.d.ts +1 -1
- package/graphql/schema/createFieldResolvers.js.map +1 -1
- package/graphql/schema/createManageResolvers.js +7 -3
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.js +2 -0
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreate.js +5 -3
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js +5 -3
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js +9 -4
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +5 -3
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDuplicate.d.ts +7 -0
- package/graphql/schema/resolvers/manage/resolveDuplicate.js +11 -0
- package/graphql/schema/resolvers/manage/resolveDuplicate.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGet.js +11 -6
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.js +5 -3
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js +5 -3
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +5 -3
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveList.js +5 -3
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveListDeleted.js +5 -3
- package/graphql/schema/resolvers/manage/resolveListDeleted.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveMove.js +4 -2
- package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js +5 -3
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.js +5 -3
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js +5 -3
- package/graphql/schema/resolvers/manage/resolveRestoreFromBin.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUnpublish.js +5 -3
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.js +5 -3
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js +5 -3
- package/graphql/schema/resolvers/manage/resolveUpdateRevisionDescription.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveValidate.js +5 -3
- package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveGet.js +6 -3
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveList.js +5 -3
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveGet.js +5 -2
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveList.js +5 -3
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/singular/resolveGet.js +1 -1
- package/graphql/schema/resolvers/singular/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/singular/resolveUpdate.js +1 -1
- package/graphql/schema/resolvers/singular/resolveUpdate.js.map +1 -1
- package/graphql/schema/schemaPlugins.d.ts +2 -1
- package/graphql/schema/schemaPlugins.js +2 -4
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/index.d.ts +7 -3
- package/index.js +4 -2
- package/legacy/abstractions.js.map +1 -1
- package/package.json +21 -24
- package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
- package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js +1 -1
- package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.js.map +1 -1
- package/plugins/index.d.ts +0 -1
- package/plugins/index.js +0 -1
- package/types/index.d.ts +0 -1
- package/types/modelField.d.ts +11 -0
- package/types/types.d.ts +19 -291
- package/types/types.js.map +1 -1
- package/utils/converters/ConverterCollection.d.ts +2 -2
- package/utils/converters/ConverterCollection.js +1 -3
- package/utils/converters/ConverterCollection.js.map +1 -1
- package/utils/converters/valueKeyFromStorageConverter.d.ts +2 -2
- package/utils/converters/valueKeyFromStorageConverter.js +2 -2
- package/utils/converters/valueKeyFromStorageConverter.js.map +1 -1
- package/utils/converters/valueKeyStorageConverter.js +4 -2
- package/utils/converters/valueKeyStorageConverter.js.map +1 -1
- package/utils/converters/valueKeyToStorageConverter.d.ts +2 -2
- package/utils/converters/valueKeyToStorageConverter.js +2 -2
- package/utils/converters/valueKeyToStorageConverter.js.map +1 -1
- package/utils/createModelField.js +2 -1
- package/utils/createModelField.js.map +1 -1
- package/utils/createModelSchemaKey.d.ts +8 -0
- package/utils/createModelSchemaKey.js +18 -0
- package/utils/createModelSchemaKey.js.map +1 -0
- package/utils/getSchemaFromFieldPlugins.d.ts +2 -2
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/isHeadlessCmsReady.d.ts +1 -1
- package/utils/isHeadlessCmsReady.js +3 -2
- package/utils/isHeadlessCmsReady.js.map +1 -1
- package/abstractions/entryHooks/OnEntryBeforeCreate.d.ts +0 -8
- package/abstractions/entryHooks/OnEntryBeforeCreate.js +0 -5
- package/abstractions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
- package/abstractions/entryHooks/index.d.ts +0 -1
- package/abstractions/entryHooks/index.js +0 -1
- package/abstractions/index.d.ts +0 -1
- package/abstractions/index.js +0 -1
- package/context.d.ts +0 -3
- package/context.js +0 -131
- package/context.js.map +0 -1
- package/crud/contentEntry.crud.d.ts +0 -6
- package/crud/contentEntry.crud.js +0 -307
- package/crud/contentEntry.crud.js.map +0 -1
- package/crud/contentModel.crud.d.ts +0 -5
- package/crud/contentModel.crud.js +0 -77
- package/crud/contentModel.crud.js.map +0 -1
- package/crud/contentModelGroup.crud.d.ts +0 -5
- package/crud/contentModelGroup.crud.js +0 -74
- package/crud/contentModelGroup.crud.js.map +0 -1
- package/extension.d.ts +0 -3
- package/extension.js +0 -19
- package/extension.js.map +0 -1
- package/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
- package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
- package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
- package/extensions/entryHooks/index.d.ts +0 -1
- package/extensions/entryHooks/index.js +0 -1
- package/extensions/index.d.ts +0 -5
- package/extensions/index.js +0 -7
- package/extensions/index.js.map +0 -1
- package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.d.ts +0 -14
- package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.js +0 -34
- package/features/contentEntry/UpdateRevision/UpdateRevisionRepository.js.map +0 -1
- package/features/contentEntry/UpdateRevision/abstractions.d.ts +0 -10
- package/features/contentEntry/UpdateRevision/abstractions.js +0 -5
- package/features/contentEntry/UpdateRevision/abstractions.js.map +0 -1
- package/features/contentEntry/UpdateRevision/feature.js +0 -11
- package/features/contentEntry/UpdateRevision/feature.js.map +0 -1
- package/features/contentEntry/UpdateRevision/index.d.ts +0 -1
- package/features/contentEntry/UpdateRevision/index.js +0 -1
- package/graphql/graphQLHandlerFactory.d.ts +0 -5
- package/graphql/graphQLHandlerFactory.js +0 -22
- package/graphql/graphQLHandlerFactory.js.map +0 -1
- package/graphql/handleRequest.d.ts +0 -11
- package/graphql/handleRequest.js +0 -62
- package/graphql/handleRequest.js.map +0 -1
- package/graphql/index.d.ts +0 -4
- package/graphql/index.js +0 -11
- package/graphql/index.js.map +0 -1
- package/graphql/schema/cms/index.d.ts +0 -2
- package/graphql/schema/cms/index.js +0 -25
- package/graphql/schema/cms/index.js.map +0 -1
- package/parameters/context.d.ts +0 -2
- package/parameters/context.js +0 -7
- package/parameters/context.js.map +0 -1
- package/parameters/header.d.ts +0 -2
- package/parameters/header.js +0 -13
- package/parameters/header.js.map +0 -1
- package/parameters/index.d.ts +0 -3
- package/parameters/index.js +0 -3
- package/parameters/path.d.ts +0 -2
- package/parameters/path.js +0 -12
- package/parameters/path.js.map +0 -1
- package/plugins/CmsParametersPlugin.d.ts +0 -18
- package/plugins/CmsParametersPlugin.js +0 -16
- package/plugins/CmsParametersPlugin.js.map +0 -1
- package/types/context.d.ts +0 -110
- package/types/context.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/contentModel/shared/ModelsFetcher.js","sources":["../../../../src/features/contentModel/shared/ModelsFetcher.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n ModelCache,\n ModelsFetcher as FetcherAbstraction\n} from \"~/features/contentModel/shared/abstractions.js\";\nimport { PluginModelsProvider } from \"~/features/contentModel/shared/abstractions.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/contentModel/shared/ModelsFetcher.js","sources":["../../../../src/features/contentModel/shared/ModelsFetcher.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n ModelCache,\n ModelsFetcher as FetcherAbstraction\n} from \"~/features/contentModel/shared/abstractions.js\";\nimport { PluginModelsProvider } from \"~/features/contentModel/shared/abstractions.js\";\nimport { ListModelsStorageOperation } from \"~/features/shared/storageOperations/model/ListModelsStorageOperation.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { ModelNotFoundError, ModelPersistenceError } from \"~/domain/contentModel/errors.js\";\nimport { createCacheKey } from \"~/utils/index.js\";\nimport { ensureTypeTag } from \"~/domain/contentModel/ensureTypeTag.js\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport { ModelFieldCompression } from \"~/features/contentModel/ModelFieldCompression/index.js\";\n\n/**\n * ModelsFetcherImpl - Implementation with multi-level caching.\n *\n * Caching strategy (per request, see ModelCache):\n * 1. Database models are cached per tenant (raw from DB).\n * 2. The merged list of plugin and database models is cached per tenant.\n *\n * Neither list is filtered by access control, so the cache is the same whoever reads it first.\n * GetModelUseCase and ListModelsUseCase apply access control to what they return.\n */\nclass ModelsFetcherImpl implements FetcherAbstraction.Interface {\n public constructor(\n private readonly modelCache: ModelCache.Interface,\n private readonly pluginModelsProvider: PluginModelsProvider.Interface,\n private readonly listModels: ListModelsStorageOperation.Interface,\n private readonly tenantContext: TenantContext.Interface,\n private readonly modelFieldCompression: ModelFieldCompression.Interface\n ) {}\n\n async fetchAll(): Promise<Result<CmsModel[], FetcherAbstraction.Error>> {\n try {\n const tenant = this.tenantContext.getTenant();\n\n const cacheKey = createCacheKey({\n tenant: tenant.id\n });\n\n // Try to get from cache first\n const cached = await this.modelCache.getOrSet(cacheKey, async () => {\n // Fetch plugin models (with caching and access control)\n const pluginModels = await this.pluginModelsProvider.list(tenant.id);\n\n const databaseModels = await this.fetchAndMergeModels(tenant.id);\n\n return [...pluginModels, ...databaseModels];\n });\n\n return Result.ok(cached);\n } catch (error) {\n return Result.fail(new ModelPersistenceError(error as Error));\n }\n }\n\n async fetchById(modelId: string): Promise<Result<CmsModel, FetcherAbstraction.Error>> {\n const result = await this.fetchAll();\n if (result.isFail()) {\n return Result.fail(new ModelPersistenceError(result.error));\n }\n\n const model = result.value.find(m => m.modelId === modelId);\n if (!model) {\n return Result.fail(new ModelNotFoundError(modelId));\n }\n\n return Result.ok(model);\n }\n\n private async fetchAndMergeModels(tenant: string): Promise<CmsModel[]> {\n // 1. Fetch database models (with caching)\n const dbCacheKey = createCacheKey({ tenant, id: \"storage\" });\n const databaseModels = await this.modelCache.getOrSet(dbCacheKey, async () => {\n const models = await this.listModels.execute({ where: { tenant } });\n\n return Promise.all(\n models.map(async model => {\n const fields = await this.modelFieldCompression.decompress(model.fields);\n\n return {\n ...model,\n fields\n };\n })\n );\n });\n\n // 2. Ensure type tags on database models\n const taggedDatabaseModels = databaseModels.map(model => {\n model.tags = ensureTypeTag(model);\n return model;\n });\n\n // 3. Return merged models.\n return taggedDatabaseModels;\n }\n}\n\nexport const ModelsFetcher = FetcherAbstraction.createImplementation({\n implementation: ModelsFetcherImpl,\n dependencies: [\n ModelCache,\n PluginModelsProvider,\n ListModelsStorageOperation,\n TenantContext,\n ModelFieldCompression\n ]\n});\n"],"names":["ModelsFetcherImpl","modelCache","pluginModelsProvider","listModels","tenantContext","modelFieldCompression","tenant","cacheKey","createCacheKey","cached","pluginModels","databaseModels","Result","error","ModelPersistenceError","modelId","result","model","m","ModelNotFoundError","dbCacheKey","models","Promise","fields","taggedDatabaseModels","ensureTypeTag","ModelsFetcher","FetcherAbstraction","ModelCache","PluginModelsProvider","ListModelsStorageOperation","TenantContext","ModelFieldCompression"],"mappings":";;;;;;;;AAwBA,MAAMA;IACF,YACqBC,UAAgC,EAChCC,oBAAoD,EACpDC,UAAgD,EAChDC,aAAsC,EACtCC,qBAAsD,CACzE;aALmBJ,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,qBAAqB,GAArBA;IAClB;IAEH,MAAM,WAAkE;QACpE,IAAI;YACA,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;YAE3C,MAAMC,WAAWC,eAAe;gBAC5B,QAAQF,OAAO,EAAE;YACrB;YAGA,MAAMG,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAACF,UAAU;gBAEpD,MAAMG,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAACJ,OAAO,EAAE;gBAEnE,MAAMK,iBAAiB,MAAM,IAAI,CAAC,mBAAmB,CAACL,OAAO,EAAE;gBAE/D,OAAO;uBAAII;uBAAiBC;iBAAe;YAC/C;YAEA,OAAOC,OAAO,EAAE,CAACH;QACrB,EAAE,OAAOI,OAAO;YACZ,OAAOD,OAAO,IAAI,CAAC,IAAIE,sBAAsBD;QACjD;IACJ;IAEA,MAAM,UAAUE,OAAe,EAAuD;QAClF,MAAMC,SAAS,MAAM,IAAI,CAAC,QAAQ;QAClC,IAAIA,OAAO,MAAM,IACb,OAAOJ,OAAO,IAAI,CAAC,IAAIE,sBAAsBE,OAAO,KAAK;QAG7D,MAAMC,QAAQD,OAAO,KAAK,CAAC,IAAI,CAACE,CAAAA,IAAKA,EAAE,OAAO,KAAKH;QACnD,IAAI,CAACE,OACD,OAAOL,OAAO,IAAI,CAAC,IAAIO,mBAAmBJ;QAG9C,OAAOH,OAAO,EAAE,CAACK;IACrB;IAEA,MAAc,oBAAoBX,MAAc,EAAuB;QAEnE,MAAMc,aAAaZ,eAAe;YAAEF;YAAQ,IAAI;QAAU;QAC1D,MAAMK,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAACS,YAAY;YAC9D,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBAAE,OAAO;oBAAEf;gBAAO;YAAE;YAEjE,OAAOgB,QAAQ,GAAG,CACdD,OAAO,GAAG,CAAC,OAAMJ;gBACb,MAAMM,SAAS,MAAM,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAACN,MAAM,MAAM;gBAEvE,OAAO;oBACH,GAAGA,KAAK;oBACRM;gBACJ;YACJ;QAER;QAGA,MAAMC,uBAAuBb,eAAe,GAAG,CAACM,CAAAA;YAC5CA,MAAM,IAAI,GAAGQ,cAAcR;YAC3B,OAAOA;QACX;QAGA,OAAOO;IACX;AACJ;AAEO,MAAME,8BAAgBC,cAAAA,oBAAuC,CAAC;IACjE,gBAAgB3B;IAChB,cAAc;QACV4B;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { AccessControl, CmsContext } from "../../../features/shared/abstractions.js";
|
|
2
1
|
import { PluginModelsProvider as ProviderAbstraction } from "./abstractions.js";
|
|
3
2
|
import type { CmsModel } from "../../../types/index.js";
|
|
3
|
+
import type { CmsModelPlugin } from "../../../plugins/CmsModelPlugin.js";
|
|
4
4
|
import { type IModelsProvider } from "../../../features/modelBuilder/models/abstractions.js";
|
|
5
5
|
/**
|
|
6
6
|
* PluginModelsProvider implementation that fetches models from:
|
|
7
|
-
* 1. Legacy CmsModelPlugin instances
|
|
7
|
+
* 1. Legacy CmsModelPlugin instances (resolved from the DI container)
|
|
8
8
|
* 2. New ModelBuilder providers (public and private)
|
|
9
|
+
*
|
|
10
|
+
* Returns every model of the tenant, without access control. ModelsFetcher caches this list for the
|
|
11
|
+
* whole request, so filtering it by the current identity would leak that identity's view into every
|
|
12
|
+
* later read, including reads that run without authorization. GetModelUseCase and ListModelsUseCase
|
|
13
|
+
* apply access control to what they return.
|
|
9
14
|
*/
|
|
10
15
|
declare class PluginModelsProviderImpl implements ProviderAbstraction.Interface {
|
|
11
|
-
private
|
|
12
|
-
private accessControl;
|
|
16
|
+
private modelPlugins;
|
|
13
17
|
private modelsProvider;
|
|
14
|
-
constructor(
|
|
18
|
+
constructor(modelPlugins: CmsModelPlugin[], modelsProvider: IModelsProvider);
|
|
15
19
|
list(tenant: string): Promise<CmsModel[]>;
|
|
16
20
|
private ensureTypeTag;
|
|
17
21
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PluginModelsProvider } from "./abstractions.js";
|
|
3
|
-
import { CmsModelPlugin } from "../../../plugins/CmsModelPlugin.js";
|
|
4
|
-
import { filterAsync } from "../../../utils/filterAsync.js";
|
|
1
|
+
import { CmsModelPluginInstance, PluginModelsProvider } from "./abstractions.js";
|
|
5
2
|
import { ModelsProvider } from "../../modelBuilder/models/abstractions.js";
|
|
6
3
|
class PluginModelsProviderImpl {
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
9
|
-
this.accessControl = accessControl;
|
|
4
|
+
constructor(modelPlugins, modelsProvider){
|
|
5
|
+
this.modelPlugins = modelPlugins;
|
|
10
6
|
this.modelsProvider = modelsProvider;
|
|
11
7
|
}
|
|
12
8
|
async list(tenant) {
|
|
13
|
-
const
|
|
14
|
-
const legacyModels = modelPlugins.filter((plugin)=>{
|
|
9
|
+
const legacyModels = this.modelPlugins.filter((plugin)=>{
|
|
15
10
|
const { tenant: modelTenant } = plugin.contentModel;
|
|
16
11
|
if (modelTenant && modelTenant !== tenant) return false;
|
|
17
12
|
return true;
|
|
@@ -20,12 +15,9 @@ class PluginModelsProviderImpl {
|
|
|
20
15
|
tags: this.ensureTypeTag(plugin.contentModel),
|
|
21
16
|
tenant
|
|
22
17
|
}));
|
|
23
|
-
const allowedLegacyModels = await filterAsync(legacyModels, (model)=>this.accessControl.canAccessModel({
|
|
24
|
-
model
|
|
25
|
-
}));
|
|
26
18
|
const builderModels = await this.modelsProvider.list(tenant);
|
|
27
19
|
return [
|
|
28
|
-
...
|
|
20
|
+
...legacyModels,
|
|
29
21
|
...builderModels
|
|
30
22
|
];
|
|
31
23
|
}
|
|
@@ -38,8 +30,12 @@ class PluginModelsProviderImpl {
|
|
|
38
30
|
const PluginModelsProvider_PluginModelsProvider = PluginModelsProvider.createImplementation({
|
|
39
31
|
implementation: PluginModelsProviderImpl,
|
|
40
32
|
dependencies: [
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
[
|
|
34
|
+
CmsModelPluginInstance,
|
|
35
|
+
{
|
|
36
|
+
multiple: true
|
|
37
|
+
}
|
|
38
|
+
],
|
|
43
39
|
ModelsProvider
|
|
44
40
|
]
|
|
45
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/contentModel/shared/PluginModelsProvider.js","sources":["../../../../src/features/contentModel/shared/PluginModelsProvider.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"features/contentModel/shared/PluginModelsProvider.js","sources":["../../../../src/features/contentModel/shared/PluginModelsProvider.ts"],"sourcesContent":["import {\n CmsModelPluginInstance,\n PluginModelsProvider as ProviderAbstraction\n} from \"./abstractions.js\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport type { CmsModelPlugin } from \"~/plugins/CmsModelPlugin.js\";\nimport {\n ModelsProvider,\n type IModelsProvider\n} from \"~/features/modelBuilder/models/abstractions.js\";\n\n/**\n * PluginModelsProvider implementation that fetches models from:\n * 1. Legacy CmsModelPlugin instances (resolved from the DI container)\n * 2. New ModelBuilder providers (public and private)\n *\n * Returns every model of the tenant, without access control. ModelsFetcher caches this list for the\n * whole request, so filtering it by the current identity would leak that identity's view into every\n * later read, including reads that run without authorization. GetModelUseCase and ListModelsUseCase\n * apply access control to what they return.\n */\nclass PluginModelsProviderImpl implements ProviderAbstraction.Interface {\n public constructor(\n private modelPlugins: CmsModelPlugin[],\n private modelsProvider: IModelsProvider\n ) {}\n\n async list(tenant: string): Promise<CmsModel[]> {\n // Get models from code-defined plugins\n const legacyModels = this.modelPlugins\n .filter(plugin => {\n const { tenant: modelTenant } = plugin.contentModel;\n // Filter by tenant if specified in plugin\n if (modelTenant && modelTenant !== tenant) {\n return false;\n }\n\n return true;\n })\n .map(plugin => {\n return {\n ...plugin.contentModel,\n tags: this.ensureTypeTag(plugin.contentModel),\n tenant\n };\n }) as unknown as CmsModel[];\n\n // Get models from new builder providers.\n const builderModels = await this.modelsProvider.list(tenant);\n\n // Combine both sources\n return [...legacyModels, ...builderModels];\n }\n\n private ensureTypeTag(model: Pick<CmsModel, \"tags\">) {\n // Let's make sure we have a `type` tag assigned.\n // If `type` tag is not set, set it to a default one (`model`).\n const tags = model.tags || [];\n if (!tags.some(tag => tag.startsWith(\"type:\"))) {\n tags.push(\"type:model\");\n }\n\n return tags;\n }\n}\n\nexport const PluginModelsProvider = ProviderAbstraction.createImplementation({\n implementation: PluginModelsProviderImpl,\n dependencies: [[CmsModelPluginInstance, { multiple: true }], ModelsProvider]\n});\n"],"names":["PluginModelsProviderImpl","modelPlugins","modelsProvider","tenant","legacyModels","plugin","modelTenant","builderModels","model","tags","tag","PluginModelsProvider","ProviderAbstraction","CmsModelPluginInstance","ModelsProvider"],"mappings":";;AAqBA,MAAMA;IACF,YACYC,YAA8B,EAC9BC,cAA+B,CACzC;aAFUD,YAAY,GAAZA;aACAC,cAAc,GAAdA;IACT;IAEH,MAAM,KAAKC,MAAc,EAAuB;QAE5C,MAAMC,eAAe,IAAI,CAAC,YAAY,CACjC,MAAM,CAACC,CAAAA;YACJ,MAAM,EAAE,QAAQC,WAAW,EAAE,GAAGD,OAAO,YAAY;YAEnD,IAAIC,eAAeA,gBAAgBH,QAC/B,OAAO;YAGX,OAAO;QACX,GACC,GAAG,CAACE,CAAAA,SACM;gBACH,GAAGA,OAAO,YAAY;gBACtB,MAAM,IAAI,CAAC,aAAa,CAACA,OAAO,YAAY;gBAC5CF;YACJ;QAIR,MAAMI,gBAAgB,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAACJ;QAGrD,OAAO;eAAIC;eAAiBG;SAAc;IAC9C;IAEQ,cAAcC,KAA6B,EAAE;QAGjD,MAAMC,OAAOD,MAAM,IAAI,IAAI,EAAE;QAC7B,IAAI,CAACC,KAAK,IAAI,CAACC,CAAAA,MAAOA,IAAI,UAAU,CAAC,WACjCD,KAAK,IAAI,CAAC;QAGd,OAAOA;IACX;AACJ;AAEO,MAAME,4CAAuBC,qBAAAA,oBAAwC,CAAC;IACzE,gBAAgBZ;IAChB,cAAc;QAAC;YAACa;YAAwB;gBAAE,UAAU;YAAK;SAAE;QAAEC;KAAe;AAChF"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import type { CmsModel } from "../../../types/index.js";
|
|
3
3
|
import type { ICache } from "../../../utils/caching/types.js";
|
|
4
|
+
import type { CmsModelPlugin } from "../../../plugins/CmsModelPlugin.js";
|
|
4
5
|
import { ModelNotFoundError, ModelPersistenceError } from "../../../domain/contentModel/errors.js";
|
|
6
|
+
/**
|
|
7
|
+
* Multi-instance DI token holding the code-defined CmsModelPlugin instances
|
|
8
|
+
* (previously read from the plugins container via byType). PluginModelsProvider
|
|
9
|
+
* resolves all of these to expose plugin-defined models.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CmsModelPluginInstance: import("@webiny/di").Abstraction<CmsModelPlugin>;
|
|
12
|
+
export declare namespace CmsModelPluginInstance {
|
|
13
|
+
type Interface = CmsModelPlugin;
|
|
14
|
+
}
|
|
5
15
|
/**
|
|
6
16
|
* PluginModelsProvider provides access to plugin-defined (code) models.
|
|
7
17
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const CmsModelPluginInstance = createAbstraction("CmsModelPluginInstance");
|
|
2
3
|
const PluginModelsProvider = createAbstraction("PluginModelsProvider");
|
|
3
4
|
const ModelCache = createAbstraction("ModelCache");
|
|
4
5
|
const ModelsFetcher = createAbstraction("ModelsFetcher");
|
|
5
|
-
export { ModelCache, ModelsFetcher, PluginModelsProvider };
|
|
6
|
+
export { CmsModelPluginInstance, ModelCache, ModelsFetcher, PluginModelsProvider };
|
|
6
7
|
|
|
7
8
|
//# sourceMappingURL=abstractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/contentModel/shared/abstractions.js","sources":["../../../../src/features/contentModel/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport type { ICache } from \"~/utils/caching/types.js\";\nimport { ModelNotFoundError, ModelPersistenceError } from \"~/domain/contentModel/errors.js\";\n\n/**\n * PluginModelsProvider provides access to plugin-defined (code) models.\n */\nexport interface IPluginModelsProvider {\n list(tenant: string): Promise<CmsModel[]>;\n}\n\nexport const PluginModelsProvider =\n createAbstraction<IPluginModelsProvider>(\"PluginModelsProvider\");\n\nexport namespace PluginModelsProvider {\n export type Interface = IPluginModelsProvider;\n}\n\nexport const ModelCache = createAbstraction<ICache<Promise<CmsModel[]>>>(\"ModelCache\");\n\nexport namespace ModelCache {\n export type Interface = ICache<Promise<CmsModel[]>>;\n}\n\n/**\n * ModelsFetcher - Centralized model fetching with caching.\n *\n * This abstraction handles fetching models from both plugins and database,\n * applies access control filtering, and caches the results for optimal performance.\n */\nexport interface IModelsFetcher {\n /**\n * Fetch all accessible models for the current tenant and identity.\n * Results are cached based on tenant + identity.\n */\n fetchAll(): Promise<Result<CmsModel[], ModelsFetcherError>>;\n\n /**\n * Fetch a single model by modelId.\n * Uses the cached fetchAll result.\n */\n fetchById(modelId: string): Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n\nexport interface IModelsFetcherErrors {\n notFound: ModelNotFoundError;\n persistence: ModelPersistenceError;\n}\n\ntype ModelsFetcherError = IModelsFetcherErrors[keyof IModelsFetcherErrors];\n\nexport const ModelsFetcher = createAbstraction<IModelsFetcher>(\"ModelsFetcher\");\n\nexport namespace ModelsFetcher {\n export type Interface = IModelsFetcher;\n export type Error = ModelsFetcherError;\n\n export type FetchAllReturn = Promise<Result<CmsModel[], ModelsFetcherError>>;\n export type FetchByIdReturn = Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"features/contentModel/shared/abstractions.js","sources":["../../../../src/features/contentModel/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"~/types/index.js\";\nimport type { ICache } from \"~/utils/caching/types.js\";\nimport type { CmsModelPlugin } from \"~/plugins/CmsModelPlugin.js\";\nimport { ModelNotFoundError, ModelPersistenceError } from \"~/domain/contentModel/errors.js\";\n\n/**\n * Multi-instance DI token holding the code-defined CmsModelPlugin instances\n * (previously read from the plugins container via byType). PluginModelsProvider\n * resolves all of these to expose plugin-defined models.\n */\nexport const CmsModelPluginInstance = createAbstraction<CmsModelPlugin>(\"CmsModelPluginInstance\");\n\nexport namespace CmsModelPluginInstance {\n export type Interface = CmsModelPlugin;\n}\n\n/**\n * PluginModelsProvider provides access to plugin-defined (code) models.\n */\nexport interface IPluginModelsProvider {\n list(tenant: string): Promise<CmsModel[]>;\n}\n\nexport const PluginModelsProvider =\n createAbstraction<IPluginModelsProvider>(\"PluginModelsProvider\");\n\nexport namespace PluginModelsProvider {\n export type Interface = IPluginModelsProvider;\n}\n\nexport const ModelCache = createAbstraction<ICache<Promise<CmsModel[]>>>(\"ModelCache\");\n\nexport namespace ModelCache {\n export type Interface = ICache<Promise<CmsModel[]>>;\n}\n\n/**\n * ModelsFetcher - Centralized model fetching with caching.\n *\n * This abstraction handles fetching models from both plugins and database,\n * applies access control filtering, and caches the results for optimal performance.\n */\nexport interface IModelsFetcher {\n /**\n * Fetch all accessible models for the current tenant and identity.\n * Results are cached based on tenant + identity.\n */\n fetchAll(): Promise<Result<CmsModel[], ModelsFetcherError>>;\n\n /**\n * Fetch a single model by modelId.\n * Uses the cached fetchAll result.\n */\n fetchById(modelId: string): Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n\nexport interface IModelsFetcherErrors {\n notFound: ModelNotFoundError;\n persistence: ModelPersistenceError;\n}\n\ntype ModelsFetcherError = IModelsFetcherErrors[keyof IModelsFetcherErrors];\n\nexport const ModelsFetcher = createAbstraction<IModelsFetcher>(\"ModelsFetcher\");\n\nexport namespace ModelsFetcher {\n export type Interface = IModelsFetcher;\n export type Error = ModelsFetcherError;\n\n export type FetchAllReturn = Promise<Result<CmsModel[], ModelsFetcherError>>;\n export type FetchByIdReturn = Promise<Result<CmsModel, ModelsFetcherError>>;\n}\n"],"names":["CmsModelPluginInstance","createAbstraction","PluginModelsProvider","ModelCache","ModelsFetcher"],"mappings":";AAWO,MAAMA,yBAAyBC,kBAAkC;AAajE,MAAMC,uBACTD,kBAAyC;AAMtC,MAAME,aAAaF,kBAA+C;AAiClE,MAAMG,gBAAgBH,kBAAkC"}
|
|
@@ -2,10 +2,11 @@ import { Result } from "@webiny/feature/api";
|
|
|
2
2
|
import { CreateGroupRepository as RepositoryAbstraction } from "./abstractions.js";
|
|
3
3
|
import { GroupCache } from "../../../features/contentModelGroup/shared/abstractions.js";
|
|
4
4
|
import { PluginGroupsProvider } from "../../../features/contentModelGroup/shared/abstractions.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ListGroupsStorageOperation } from "../../../features/shared/storageOperations/group/ListGroupsStorageOperation.js";
|
|
6
|
+
import { CreateGroupStorageOperation } from "../../../features/shared/storageOperations/group/CreateGroupStorageOperation.js";
|
|
6
7
|
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
8
|
+
import { StringFormatter } from "@webiny/api-core/features/stringFormatter/index.js";
|
|
7
9
|
import type { CmsGroup } from "../../../types/index.js";
|
|
8
|
-
import { RuntimeTenant } from "../../../features/runtimeTenant/abstractions.js";
|
|
9
10
|
/**
|
|
10
11
|
* CreateGroupRepository - Validates and persists a new group.
|
|
11
12
|
*
|
|
@@ -19,12 +20,15 @@ import { RuntimeTenant } from "../../../features/runtimeTenant/abstractions.js";
|
|
|
19
20
|
declare class CreateGroupRepositoryImpl implements RepositoryAbstraction.Interface {
|
|
20
21
|
private groupCache;
|
|
21
22
|
private pluginGroupsProvider;
|
|
22
|
-
private
|
|
23
|
+
private listGroups;
|
|
24
|
+
private createGroup;
|
|
23
25
|
private tenantContext;
|
|
24
|
-
private
|
|
25
|
-
constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface,
|
|
26
|
-
execute(
|
|
26
|
+
private stringFormatter;
|
|
27
|
+
constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, listGroups: ListGroupsStorageOperation.Interface, createGroup: CreateGroupStorageOperation.Interface, tenantContext: TenantContext.Interface, stringFormatter: StringFormatter.Interface);
|
|
28
|
+
execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>>;
|
|
27
29
|
private isSlugTaken;
|
|
28
30
|
}
|
|
29
|
-
export declare const CreateGroupRepository:
|
|
31
|
+
export declare const CreateGroupRepository: typeof CreateGroupRepositoryImpl & {
|
|
32
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateGroupRepository>;
|
|
33
|
+
};
|
|
30
34
|
export {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Result
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { CreateGroupRepository } from "./abstractions.js";
|
|
3
3
|
import { GroupCache, PluginGroupsProvider } from "../shared/abstractions.js";
|
|
4
4
|
import { GroupPersistenceError, GroupSlugTakenError } from "../../../domain/contentModelGroup/errors.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ListGroupsStorageOperation } from "../../shared/storageOperations/group/ListGroupsStorageOperation.js";
|
|
6
|
+
import { CreateGroupStorageOperation } from "../../shared/storageOperations/group/CreateGroupStorageOperation.js";
|
|
6
7
|
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
7
|
-
import {
|
|
8
|
+
import { StringFormatter } from "@webiny/api-core/features/stringFormatter/index.js";
|
|
8
9
|
import { generateAlphaNumericId } from "@webiny/utils";
|
|
9
|
-
import { RuntimeTenant } from "../../runtimeTenant/abstractions.js";
|
|
10
10
|
class CreateGroupRepositoryImpl {
|
|
11
|
-
constructor(groupCache, pluginGroupsProvider,
|
|
11
|
+
constructor(groupCache, pluginGroupsProvider, listGroups, createGroup, tenantContext, stringFormatter){
|
|
12
12
|
this.groupCache = groupCache;
|
|
13
13
|
this.pluginGroupsProvider = pluginGroupsProvider;
|
|
14
|
-
this.
|
|
14
|
+
this.listGroups = listGroups;
|
|
15
|
+
this.createGroup = createGroup;
|
|
15
16
|
this.tenantContext = tenantContext;
|
|
16
|
-
this.
|
|
17
|
+
this.stringFormatter = stringFormatter;
|
|
17
18
|
}
|
|
18
|
-
async execute(
|
|
19
|
-
const group = this.runtimeTenant.assign(initialGroup);
|
|
19
|
+
async execute(group) {
|
|
20
20
|
try {
|
|
21
21
|
const tenant = this.tenantContext.getTenant();
|
|
22
22
|
if (group.id) {
|
|
23
|
-
const existingById = await this.
|
|
23
|
+
const existingById = await this.listGroups.execute({
|
|
24
24
|
where: {
|
|
25
25
|
tenant: tenant.id,
|
|
26
26
|
id: group.id
|
|
@@ -33,18 +33,18 @@ class CreateGroupRepositoryImpl {
|
|
|
33
33
|
const pluginGroups = await this.pluginGroupsProvider.getGroups();
|
|
34
34
|
const pluginGroupConflict = pluginGroups.find((pg)=>pg.slug === group.slug);
|
|
35
35
|
if (pluginGroupConflict) return Result.fail(new GroupSlugTakenError(group.slug));
|
|
36
|
-
await this.
|
|
36
|
+
await this.createGroup.execute({
|
|
37
37
|
group
|
|
38
38
|
});
|
|
39
39
|
this.groupCache.clear();
|
|
40
|
-
return Result.ok(
|
|
40
|
+
return Result.ok();
|
|
41
41
|
} catch (error) {
|
|
42
42
|
return Result.fail(new GroupPersistenceError(error));
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
async isSlugTaken(group, tenant) {
|
|
46
46
|
if (group.slug && group.slug.trim()) {
|
|
47
|
-
const existingBySlug = await this.
|
|
47
|
+
const existingBySlug = await this.listGroups.execute({
|
|
48
48
|
where: {
|
|
49
49
|
tenant,
|
|
50
50
|
slug: group.slug
|
|
@@ -52,8 +52,8 @@ class CreateGroupRepositoryImpl {
|
|
|
52
52
|
});
|
|
53
53
|
return existingBySlug.length > 0;
|
|
54
54
|
}
|
|
55
|
-
const baseSlug =
|
|
56
|
-
const existingBySlug = await this.
|
|
55
|
+
const baseSlug = this.stringFormatter.slugify(group.name);
|
|
56
|
+
const existingBySlug = await this.listGroups.execute({
|
|
57
57
|
where: {
|
|
58
58
|
tenant,
|
|
59
59
|
slug: baseSlug
|
|
@@ -64,15 +64,15 @@ class CreateGroupRepositoryImpl {
|
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const CreateGroupRepository_CreateGroupRepository = createImplementation({
|
|
68
|
-
abstraction: CreateGroupRepository,
|
|
67
|
+
const CreateGroupRepository_CreateGroupRepository = CreateGroupRepository.createImplementation({
|
|
69
68
|
implementation: CreateGroupRepositoryImpl,
|
|
70
69
|
dependencies: [
|
|
71
70
|
GroupCache,
|
|
72
71
|
PluginGroupsProvider,
|
|
73
|
-
|
|
72
|
+
ListGroupsStorageOperation,
|
|
73
|
+
CreateGroupStorageOperation,
|
|
74
74
|
TenantContext,
|
|
75
|
-
|
|
75
|
+
StringFormatter
|
|
76
76
|
]
|
|
77
77
|
});
|
|
78
78
|
export { CreateGroupRepository_CreateGroupRepository as CreateGroupRepository };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupRepository.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupRepository.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { CreateGroupRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { GroupCache } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { PluginGroupsProvider } from \"~/features/contentModelGroup/shared/abstractions.js\";\nimport { GroupSlugTakenError } from \"~/domain/contentModelGroup/errors.js\";\nimport { GroupPersistenceError } from \"~/domain/contentModelGroup/errors.js\";\nimport { ListGroupsStorageOperation } from \"~/features/shared/storageOperations/group/ListGroupsStorageOperation.js\";\nimport { CreateGroupStorageOperation } from \"~/features/shared/storageOperations/group/CreateGroupStorageOperation.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { StringFormatter } from \"@webiny/api-core/features/stringFormatter/index.js\";\nimport { generateAlphaNumericId } from \"@webiny/utils\";\nimport type { CmsGroup } from \"~/types/index.js\";\n\n/**\n * CreateGroupRepository - Validates and persists a new group.\n *\n * Responsibilities:\n * - Validate ID uniqueness (if provided)\n * - Validate slug uniqueness (or generate unique slug)\n * - Check for plugin group conflicts\n * - Persist to storage\n * - Clear GroupCache after successful create\n */\nclass CreateGroupRepositoryImpl implements RepositoryAbstraction.Interface {\n public constructor(\n private groupCache: GroupCache.Interface,\n private pluginGroupsProvider: PluginGroupsProvider.Interface,\n private listGroups: ListGroupsStorageOperation.Interface,\n private createGroup: CreateGroupStorageOperation.Interface,\n private tenantContext: TenantContext.Interface,\n private stringFormatter: StringFormatter.Interface\n ) {}\n\n async execute(group: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>> {\n try {\n const tenant = this.tenantContext.getTenant();\n\n // 1. Validate ID uniqueness (if provided)\n if (group.id) {\n const existingById = await this.listGroups.execute({\n where: {\n tenant: tenant.id,\n id: group.id\n }\n });\n\n if (existingById.length > 0) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n }\n\n // 2. Generate or validate slug\n const slugTaken = await this.isSlugTaken(group, tenant.id);\n if (slugTaken) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n\n // 3. Check for plugin group conflicts\n const pluginGroups = await this.pluginGroupsProvider.getGroups();\n const pluginGroupConflict = pluginGroups.find(pg => pg.slug === group.slug);\n if (pluginGroupConflict) {\n return Result.fail(new GroupSlugTakenError(group.slug));\n }\n\n // 4. Persist to storage\n await this.createGroup.execute({ group });\n\n // 5. Clear cache\n this.groupCache.clear();\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new GroupPersistenceError(error as Error));\n }\n }\n\n private async isSlugTaken(group: CmsGroup, tenant: string): Promise<boolean> {\n // If slug is provided and not empty, validate it\n if (group.slug && group.slug.trim()) {\n const existingBySlug = await this.listGroups.execute({\n where: {\n tenant,\n slug: group.slug\n }\n });\n\n return existingBySlug.length > 0;\n }\n\n // Generate slug from name\n const baseSlug = this.stringFormatter.slugify(group.name);\n const existingBySlug = await this.listGroups.execute({\n where: {\n tenant,\n slug: baseSlug\n }\n });\n\n if (existingBySlug.length === 0) {\n // No conflict, use base slug\n group.slug = baseSlug;\n } else {\n // Conflict, append random suffix\n group.slug = `${baseSlug}-${generateAlphaNumericId(8)}`;\n }\n\n return false;\n }\n}\n\nexport const CreateGroupRepository = RepositoryAbstraction.createImplementation({\n implementation: CreateGroupRepositoryImpl,\n dependencies: [\n GroupCache,\n PluginGroupsProvider,\n ListGroupsStorageOperation,\n CreateGroupStorageOperation,\n TenantContext,\n StringFormatter\n ]\n});\n"],"names":["CreateGroupRepositoryImpl","groupCache","pluginGroupsProvider","listGroups","createGroup","tenantContext","stringFormatter","group","tenant","existingById","Result","GroupSlugTakenError","slugTaken","pluginGroups","pluginGroupConflict","pg","error","GroupPersistenceError","existingBySlug","baseSlug","generateAlphaNumericId","CreateGroupRepository","RepositoryAbstraction","GroupCache","PluginGroupsProvider","ListGroupsStorageOperation","CreateGroupStorageOperation","TenantContext","StringFormatter"],"mappings":";;;;;;;;;AAuBA,MAAMA;IACF,YACYC,UAAgC,EAChCC,oBAAoD,EACpDC,UAAgD,EAChDC,WAAkD,EAClDC,aAAsC,EACtCC,eAA0C,CACpD;aANUL,UAAU,GAAVA;aACAC,oBAAoB,GAApBA;aACAC,UAAU,GAAVA;aACAC,WAAW,GAAXA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAsD;QAC/E,IAAI;YACA,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;YAG3C,IAAID,MAAM,EAAE,EAAE;gBACV,MAAME,eAAe,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;oBAC/C,OAAO;wBACH,QAAQD,OAAO,EAAE;wBACjB,IAAID,MAAM,EAAE;oBAChB;gBACJ;gBAEA,IAAIE,aAAa,MAAM,GAAG,GACtB,OAAOC,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAE7D;YAGA,MAAMK,YAAY,MAAM,IAAI,CAAC,WAAW,CAACL,OAAOC,OAAO,EAAE;YACzD,IAAII,WACA,OAAOF,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAIzD,MAAMM,eAAe,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS;YAC9D,MAAMC,sBAAsBD,aAAa,IAAI,CAACE,CAAAA,KAAMA,GAAG,IAAI,KAAKR,MAAM,IAAI;YAC1E,IAAIO,qBACA,OAAOJ,OAAO,IAAI,CAAC,IAAIC,oBAAoBJ,MAAM,IAAI;YAIzD,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBAAEA;YAAM;YAGvC,IAAI,CAAC,UAAU,CAAC,KAAK;YAErB,OAAOG,OAAO,EAAE;QACpB,EAAE,OAAOM,OAAO;YACZ,OAAON,OAAO,IAAI,CAAC,IAAIO,sBAAsBD;QACjD;IACJ;IAEA,MAAc,YAAYT,KAAe,EAAEC,MAAc,EAAoB;QAEzE,IAAID,MAAM,IAAI,IAAIA,MAAM,IAAI,CAAC,IAAI,IAAI;YACjC,MAAMW,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBACjD,OAAO;oBACHV;oBACA,MAAMD,MAAM,IAAI;gBACpB;YACJ;YAEA,OAAOW,eAAe,MAAM,GAAG;QACnC;QAGA,MAAMC,WAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAACZ,MAAM,IAAI;QACxD,MAAMW,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACjD,OAAO;gBACHV;gBACA,MAAMW;YACV;QACJ;QAEA,IAAID,AAA0B,MAA1BA,eAAe,MAAM,EAErBX,MAAM,IAAI,GAAGY;aAGbZ,MAAM,IAAI,GAAG,GAAGY,SAAS,CAAC,EAAEC,uBAAuB,IAAI;QAG3D,OAAO;IACX;AACJ;AAEO,MAAMC,8CAAwBC,sBAAAA,oBAA0C,CAAC;IAC5E,gBAAgBtB;IAChB,cAAc;QACVuB;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -5,6 +5,7 @@ import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.j
|
|
|
5
5
|
import { AccessControl } from "../../../features/shared/abstractions.js";
|
|
6
6
|
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
7
7
|
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
8
|
+
import { CmsContext } from "../../../features/shared/abstractions.js";
|
|
8
9
|
import type { CmsGroup } from "../../../types/index.js";
|
|
9
10
|
import type { CmsGroupCreateInput } from "../../../types/index.js";
|
|
10
11
|
/**
|
|
@@ -24,8 +25,11 @@ declare class CreateGroupUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
|
24
25
|
private accessControl;
|
|
25
26
|
private tenantContext;
|
|
26
27
|
private identityContext;
|
|
27
|
-
|
|
28
|
+
private cmsContext;
|
|
29
|
+
constructor(eventPublisher: EventPublisher.Interface, repository: CreateGroupRepository.Interface, accessControl: AccessControl.Interface, tenantContext: TenantContext.Interface, identityContext: IdentityContext.Interface, cmsContext: CmsContext.Interface);
|
|
28
30
|
execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseAbstraction.Error>>;
|
|
29
31
|
}
|
|
30
|
-
export declare const CreateGroupUseCase:
|
|
32
|
+
export declare const CreateGroupUseCase: typeof CreateGroupUseCaseImpl & {
|
|
33
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICreateGroupUseCase>;
|
|
34
|
+
};
|
|
31
35
|
export {};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { Result
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { CreateGroupRepository, CreateGroupUseCase } from "./abstractions.js";
|
|
3
3
|
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
4
4
|
import { GroupAfterCreateEvent, GroupBeforeCreateEventEvent, GroupCreateErrorEvent } from "./events.js";
|
|
5
|
-
import { AccessControl } from "../../shared/abstractions.js";
|
|
5
|
+
import { AccessControl, CmsContext } from "../../shared/abstractions.js";
|
|
6
6
|
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
7
7
|
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
8
8
|
import { GroupNotAuthorizedError, GroupValidationError } from "../../../domain/contentModelGroup/errors.js";
|
|
9
9
|
import { createZodError, mdbid } from "@webiny/utils";
|
|
10
10
|
import { createGroupCreateValidation } from "../../../domain/contentModelGroup/validation.js";
|
|
11
11
|
class CreateGroupUseCaseImpl {
|
|
12
|
-
constructor(eventPublisher, repository, accessControl, tenantContext, identityContext){
|
|
12
|
+
constructor(eventPublisher, repository, accessControl, tenantContext, identityContext, cmsContext){
|
|
13
13
|
this.eventPublisher = eventPublisher;
|
|
14
14
|
this.repository = repository;
|
|
15
15
|
this.accessControl = accessControl;
|
|
16
16
|
this.tenantContext = tenantContext;
|
|
17
17
|
this.identityContext = identityContext;
|
|
18
|
+
this.cmsContext = cmsContext;
|
|
18
19
|
}
|
|
19
20
|
async execute(input) {
|
|
20
21
|
const canAccess = await this.accessControl.canAccessGroup({
|
|
@@ -61,9 +62,9 @@ class CreateGroupUseCaseImpl {
|
|
|
61
62
|
return Result.fail(result.error);
|
|
62
63
|
}
|
|
63
64
|
await this.eventPublisher.publish(new GroupAfterCreateEvent({
|
|
64
|
-
group
|
|
65
|
+
group
|
|
65
66
|
}));
|
|
66
|
-
return Result.ok(
|
|
67
|
+
return Result.ok(group);
|
|
67
68
|
} catch (error) {
|
|
68
69
|
await this.eventPublisher.publish(new GroupCreateErrorEvent({
|
|
69
70
|
input,
|
|
@@ -74,15 +75,15 @@ class CreateGroupUseCaseImpl {
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
const CreateGroupUseCase_CreateGroupUseCase = createImplementation({
|
|
78
|
-
abstraction: CreateGroupUseCase,
|
|
78
|
+
const CreateGroupUseCase_CreateGroupUseCase = CreateGroupUseCase.createImplementation({
|
|
79
79
|
implementation: CreateGroupUseCaseImpl,
|
|
80
80
|
dependencies: [
|
|
81
81
|
EventPublisher,
|
|
82
82
|
CreateGroupRepository,
|
|
83
83
|
AccessControl,
|
|
84
84
|
TenantContext,
|
|
85
|
-
IdentityContext
|
|
85
|
+
IdentityContext,
|
|
86
|
+
CmsContext
|
|
86
87
|
]
|
|
87
88
|
});
|
|
88
89
|
export { CreateGroupUseCase_CreateGroupUseCase as CreateGroupUseCase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/contentModelGroup/CreateGroup/CreateGroupUseCase.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/CreateGroupUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { CreateGroupUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { CreateGroupRepository } from \"./abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { GroupBeforeCreateEventEvent } from \"./events.js\";\nimport { GroupAfterCreateEvent } from \"./events.js\";\nimport { GroupCreateErrorEvent } from \"./events.js\";\nimport { AccessControl } from \"~/features/shared/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { CmsContext } from \"~/features/shared/abstractions.js\";\nimport {\n GroupNotAuthorizedError,\n GroupValidationError\n} from \"~/domain/contentModelGroup/errors.js\";\nimport { createZodError } from \"@webiny/utils\";\nimport { mdbid } from \"@webiny/utils\";\nimport { createGroupCreateValidation } from \"~/domain/contentModelGroup/validation.js\";\nimport type { CmsGroup } from \"~/types/index.js\";\nimport type { CmsGroupCreateInput } from \"~/types/index.js\";\n\n/**\n * CreateGroupUseCase - Orchestrates group creation.\n *\n * Responsibilities:\n * - Validate input (Zod)\n * - Create domain group object\n * - Access control checks\n * - Publish before event\n * - Delegate to repository\n * - Publish after event or error event\n */\nclass CreateGroupUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private eventPublisher: EventPublisher.Interface,\n private repository: CreateGroupRepository.Interface,\n private accessControl: AccessControl.Interface,\n private tenantContext: TenantContext.Interface,\n private identityContext: IdentityContext.Interface,\n private cmsContext: CmsContext.Interface\n ) {}\n\n async execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseAbstraction.Error>> {\n // Initial access control check\n const canAccess = await this.accessControl.canAccessGroup({ rwd: \"w\" });\n if (!canAccess) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n // Validate input\n const validationResult = await createGroupCreateValidation().safeParseAsync(input);\n if (!validationResult.success) {\n const zodError = createZodError(validationResult.error);\n return Result.fail(\n new GroupValidationError(zodError.message, zodError.data!.invalidFields)\n );\n }\n const data = validationResult.data;\n\n // Create domain group object\n const identity = this.identityContext.getIdentity();\n const tenant = this.tenantContext.getTenant();\n\n const id = data.id || mdbid();\n const group: CmsGroup = {\n ...data,\n id,\n tenant: tenant.id,\n createdOn: new Date().toISOString(),\n savedOn: new Date().toISOString(),\n createdBy: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n }\n };\n\n // Access control check on created group\n const canAccessGroup = await this.accessControl.canAccessGroup({ group, rwd: \"w\" });\n if (!canAccessGroup) {\n return Result.fail(new GroupNotAuthorizedError());\n }\n\n try {\n // Publish before event\n await this.eventPublisher.publish(new GroupBeforeCreateEventEvent({ group }));\n\n // Persist via repository\n const result = await this.repository.execute(group);\n if (result.isFail()) {\n // Publish error event\n await this.eventPublisher.publish(\n new GroupCreateErrorEvent({\n input,\n group,\n error: result.error\n })\n );\n return Result.fail(result.error);\n }\n\n // Publish after event\n await this.eventPublisher.publish(new GroupAfterCreateEvent({ group }));\n\n return Result.ok(group);\n } catch (error) {\n // Publish error event for unexpected errors\n await this.eventPublisher.publish(\n new GroupCreateErrorEvent({\n input,\n group,\n error: error as Error\n })\n );\n return Result.fail(error as UseCaseAbstraction.Error);\n }\n }\n}\n\nexport const CreateGroupUseCase = UseCaseAbstraction.createImplementation({\n implementation: CreateGroupUseCaseImpl,\n dependencies: [\n EventPublisher,\n CreateGroupRepository,\n AccessControl,\n TenantContext,\n IdentityContext,\n CmsContext\n ]\n});\n"],"names":["CreateGroupUseCaseImpl","eventPublisher","repository","accessControl","tenantContext","identityContext","cmsContext","input","canAccess","Result","GroupNotAuthorizedError","validationResult","createGroupCreateValidation","zodError","createZodError","GroupValidationError","data","identity","tenant","id","mdbid","group","Date","canAccessGroup","GroupBeforeCreateEventEvent","result","GroupCreateErrorEvent","GroupAfterCreateEvent","error","CreateGroupUseCase","UseCaseAbstraction","EventPublisher","CreateGroupRepository","AccessControl","TenantContext","IdentityContext","CmsContext"],"mappings":";;;;;;;;;;AAgCA,MAAMA;IACF,YACYC,cAAwC,EACxCC,UAA2C,EAC3CC,aAAsC,EACtCC,aAAsC,EACtCC,eAA0C,EAC1CC,UAAgC,CAC1C;aANUL,cAAc,GAAdA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,KAA0B,EAAuD;QAE3F,MAAMC,YAAY,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAE,KAAK;QAAI;QACrE,IAAI,CAACA,WACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,mBAAmB,MAAMC,8BAA8B,cAAc,CAACL;QAC5E,IAAI,CAACI,iBAAiB,OAAO,EAAE;YAC3B,MAAME,WAAWC,eAAeH,iBAAiB,KAAK;YACtD,OAAOF,OAAO,IAAI,CACd,IAAIM,qBAAqBF,SAAS,OAAO,EAAEA,SAAS,IAAI,CAAE,aAAa;QAE/E;QACA,MAAMG,OAAOL,iBAAiB,IAAI;QAGlC,MAAMM,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QACjD,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;QAE3C,MAAMC,KAAKH,KAAK,EAAE,IAAII;QACtB,MAAMC,QAAkB;YACpB,GAAGL,IAAI;YACPG;YACA,QAAQD,OAAO,EAAE;YACjB,WAAW,IAAII,OAAO,WAAW;YACjC,SAAS,IAAIA,OAAO,WAAW;YAC/B,WAAW;gBACP,IAAIL,SAAS,EAAE;gBACf,aAAaA,SAAS,WAAW;gBACjC,MAAMA,SAAS,IAAI;YACvB;QACJ;QAGA,MAAMM,iBAAiB,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;YAAEF;YAAO,KAAK;QAAI;QACjF,IAAI,CAACE,gBACD,OAAOd,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIc,4BAA4B;gBAAEH;YAAM;YAG1E,MAAMI,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACJ;YAC7C,IAAII,OAAO,MAAM,IAAI;gBAEjB,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,sBAAsB;oBACtBnB;oBACAc;oBACA,OAAOI,OAAO,KAAK;gBACvB;gBAEJ,OAAOhB,OAAO,IAAI,CAACgB,OAAO,KAAK;YACnC;YAGA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIE,sBAAsB;gBAAEN;YAAM;YAEpE,OAAOZ,OAAO,EAAE,CAACY;QACrB,EAAE,OAAOO,OAAO;YAEZ,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIF,sBAAsB;gBACtBnB;gBACAc;gBACA,OAAOO;YACX;YAEJ,OAAOnB,OAAO,IAAI,CAACmB;QACvB;IACJ;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgB9B;IAChB,cAAc;QACV+B;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -26,7 +26,7 @@ export declare namespace CreateGroupUseCase {
|
|
|
26
26
|
* CreateGroupRepository - Persists a new group to storage.
|
|
27
27
|
*/
|
|
28
28
|
export interface ICreateGroupRepository {
|
|
29
|
-
execute(group: CmsGroup): Promise<Result<
|
|
29
|
+
execute(group: CmsGroup): Promise<Result<void, RepositoryError>>;
|
|
30
30
|
}
|
|
31
31
|
export interface ICreateGroupRepositoryErrors {
|
|
32
32
|
alreadyExists: GroupSlugTakenError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/contentModelGroup/CreateGroup/abstractions.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { CmsGroup, CmsGroupCreateInput } from \"~/types/index.js\";\nimport type {\n GroupPersistenceError,\n GroupValidationError\n} from \"~/domain/contentModelGroup/errors.js\";\nimport {\n GroupNotAuthorizedError,\n type GroupSlugTakenError\n} from \"~/domain/contentModelGroup/errors.js\";\n\n/**\n * CreateGroup Use Case\n */\nexport interface ICreateGroupUseCase {\n execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseError>>;\n}\n\nexport interface ICreateGroupUseCaseErrors {\n notAuthorized: GroupNotAuthorizedError;\n validation: GroupValidationError;\n repository: RepositoryError;\n}\n\ntype UseCaseError = ICreateGroupUseCaseErrors[keyof ICreateGroupUseCaseErrors];\n\n/** Create a new content model group. */\nexport const CreateGroupUseCase = createAbstraction<ICreateGroupUseCase>(\"CreateGroupUseCase\");\n\nexport namespace CreateGroupUseCase {\n export type Interface = ICreateGroupUseCase;\n export type Input = CmsGroupCreateInput;\n\n export type Error = UseCaseError;\n export type Return = Promise<Result<CmsGroup, UseCaseError>>;\n}\n\n/**\n * CreateGroupRepository - Persists a new group to storage.\n */\nexport interface ICreateGroupRepository {\n execute(group: CmsGroup): Promise<Result<
|
|
1
|
+
{"version":3,"file":"features/contentModelGroup/CreateGroup/abstractions.js","sources":["../../../../src/features/contentModelGroup/CreateGroup/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { CmsGroup, CmsGroupCreateInput } from \"~/types/index.js\";\nimport type {\n GroupPersistenceError,\n GroupValidationError\n} from \"~/domain/contentModelGroup/errors.js\";\nimport {\n GroupNotAuthorizedError,\n type GroupSlugTakenError\n} from \"~/domain/contentModelGroup/errors.js\";\n\n/**\n * CreateGroup Use Case\n */\nexport interface ICreateGroupUseCase {\n execute(input: CmsGroupCreateInput): Promise<Result<CmsGroup, UseCaseError>>;\n}\n\nexport interface ICreateGroupUseCaseErrors {\n notAuthorized: GroupNotAuthorizedError;\n validation: GroupValidationError;\n repository: RepositoryError;\n}\n\ntype UseCaseError = ICreateGroupUseCaseErrors[keyof ICreateGroupUseCaseErrors];\n\n/** Create a new content model group. */\nexport const CreateGroupUseCase = createAbstraction<ICreateGroupUseCase>(\"CreateGroupUseCase\");\n\nexport namespace CreateGroupUseCase {\n export type Interface = ICreateGroupUseCase;\n export type Input = CmsGroupCreateInput;\n\n export type Error = UseCaseError;\n export type Return = Promise<Result<CmsGroup, UseCaseError>>;\n}\n\n/**\n * CreateGroupRepository - Persists a new group to storage.\n */\nexport interface ICreateGroupRepository {\n execute(group: CmsGroup): Promise<Result<void, RepositoryError>>;\n}\n\nexport interface ICreateGroupRepositoryErrors {\n alreadyExists: GroupSlugTakenError;\n storage: GroupPersistenceError;\n}\n\ntype RepositoryError = ICreateGroupRepositoryErrors[keyof ICreateGroupRepositoryErrors];\n\nexport const CreateGroupRepository =\n createAbstraction<ICreateGroupRepository>(\"CreateGroupRepository\");\n\nexport namespace CreateGroupRepository {\n export type Interface = ICreateGroupRepository;\n export type Error = RepositoryError;\n}\n"],"names":["CreateGroupUseCase","createAbstraction","CreateGroupRepository"],"mappings":";AA2BO,MAAMA,qBAAqBC,kBAAuC;AAwBlE,MAAMC,wBACTD,kBAA0C"}
|
|
@@ -2,7 +2,8 @@ import { Result } from "@webiny/feature/api";
|
|
|
2
2
|
import { DeleteGroupRepository as RepositoryAbstraction } from "./abstractions.js";
|
|
3
3
|
import { GroupCache } from "../../../features/contentModelGroup/shared/abstractions.js";
|
|
4
4
|
import { PluginGroupsProvider } from "../../../features/contentModelGroup/shared/abstractions.js";
|
|
5
|
-
import {
|
|
5
|
+
import { DeleteGroupStorageOperation } from "../../../features/shared/storageOperations/group/DeleteGroupStorageOperation.js";
|
|
6
|
+
import { ListModelsStorageOperation } from "../../../features/shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
6
7
|
import type { CmsGroup } from "../../../types/index.js";
|
|
7
8
|
import { RuntimeTenant } from "../../../features/runtimeTenant/abstractions.js";
|
|
8
9
|
/**
|
|
@@ -17,10 +18,13 @@ import { RuntimeTenant } from "../../../features/runtimeTenant/abstractions.js";
|
|
|
17
18
|
declare class DeleteGroupRepositoryImpl implements RepositoryAbstraction.Interface {
|
|
18
19
|
private groupCache;
|
|
19
20
|
private pluginGroupsProvider;
|
|
20
|
-
private
|
|
21
|
+
private deleteGroup;
|
|
22
|
+
private listModels;
|
|
21
23
|
private runtimeTenant;
|
|
22
|
-
constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface,
|
|
24
|
+
constructor(groupCache: GroupCache.Interface, pluginGroupsProvider: PluginGroupsProvider.Interface, deleteGroup: DeleteGroupStorageOperation.Interface, listModels: ListModelsStorageOperation.Interface, runtimeTenant: RuntimeTenant.Interface);
|
|
23
25
|
execute(initialGroup: CmsGroup): Promise<Result<void, RepositoryAbstraction.Error>>;
|
|
24
26
|
}
|
|
25
|
-
export declare const DeleteGroupRepository:
|
|
27
|
+
export declare const DeleteGroupRepository: typeof DeleteGroupRepositoryImpl & {
|
|
28
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IDeleteGroupRepository>;
|
|
29
|
+
};
|
|
26
30
|
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { Result
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { DeleteGroupRepository } from "./abstractions.js";
|
|
3
3
|
import { GroupCache, PluginGroupsProvider } from "../shared/abstractions.js";
|
|
4
4
|
import { GroupCannotDeleteCodeDefinedError, GroupHasModelsError, GroupPersistenceError } from "../../../domain/contentModelGroup/errors.js";
|
|
5
|
-
import {
|
|
5
|
+
import { DeleteGroupStorageOperation } from "../../shared/storageOperations/group/DeleteGroupStorageOperation.js";
|
|
6
|
+
import { ListModelsStorageOperation } from "../../shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
6
7
|
import { RuntimeTenant } from "../../runtimeTenant/abstractions.js";
|
|
7
8
|
class DeleteGroupRepositoryImpl {
|
|
8
|
-
constructor(groupCache, pluginGroupsProvider,
|
|
9
|
+
constructor(groupCache, pluginGroupsProvider, deleteGroup, listModels, runtimeTenant){
|
|
9
10
|
this.groupCache = groupCache;
|
|
10
11
|
this.pluginGroupsProvider = pluginGroupsProvider;
|
|
11
|
-
this.
|
|
12
|
+
this.deleteGroup = deleteGroup;
|
|
13
|
+
this.listModels = listModels;
|
|
12
14
|
this.runtimeTenant = runtimeTenant;
|
|
13
15
|
}
|
|
14
16
|
async execute(initialGroup) {
|
|
@@ -17,14 +19,14 @@ class DeleteGroupRepositoryImpl {
|
|
|
17
19
|
const pluginGroups = await this.pluginGroupsProvider.getGroups();
|
|
18
20
|
const isPluginGroup = pluginGroups.some((pg)=>pg.slug === group.slug);
|
|
19
21
|
if (isPluginGroup) return Result.fail(new GroupCannotDeleteCodeDefinedError(group.id));
|
|
20
|
-
const models = await this.
|
|
22
|
+
const models = await this.listModels.execute({
|
|
21
23
|
where: {
|
|
22
24
|
tenant: group.tenant
|
|
23
25
|
}
|
|
24
26
|
});
|
|
25
27
|
const items = models.filter((model)=>model.group === group.slug);
|
|
26
28
|
if (items.length > 0) return Result.fail(new GroupHasModelsError());
|
|
27
|
-
await this.
|
|
29
|
+
await this.deleteGroup.execute({
|
|
28
30
|
group
|
|
29
31
|
});
|
|
30
32
|
this.groupCache.clear();
|
|
@@ -34,13 +36,13 @@ class DeleteGroupRepositoryImpl {
|
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
|
-
const DeleteGroupRepository_DeleteGroupRepository = createImplementation({
|
|
38
|
-
abstraction: DeleteGroupRepository,
|
|
39
|
+
const DeleteGroupRepository_DeleteGroupRepository = DeleteGroupRepository.createImplementation({
|
|
39
40
|
implementation: DeleteGroupRepositoryImpl,
|
|
40
41
|
dependencies: [
|
|
41
42
|
GroupCache,
|
|
42
43
|
PluginGroupsProvider,
|
|
43
|
-
|
|
44
|
+
DeleteGroupStorageOperation,
|
|
45
|
+
ListModelsStorageOperation,
|
|
44
46
|
RuntimeTenant
|
|
45
47
|
]
|
|
46
48
|
});
|