@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":"export/crud/imports/importModels.js","sources":["../../../../src/export/crud/imports/importModels.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { CmsModelImportResult, ValidCmsModelResult } from \"~/export/types.js\";\nimport { CmsImportAction } from \"~/export/types.js\";\n\ninterface Params {\n context: CmsContext;\n models: ValidCmsModelResult[];\n}\n\nexport const importModels = async (params: Params) => {\n const { context, models } = params;\n\n const
|
|
1
|
+
{"version":3,"file":"export/crud/imports/importModels.js","sources":["../../../../src/export/crud/imports/importModels.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { CmsModelImportResult, ValidCmsModelResult } from \"~/export/types.js\";\nimport { CmsImportAction } from \"~/export/types.js\";\nimport { ListGroupsUseCase } from \"~/features/contentModelGroup/ListGroups/index.js\";\nimport { UpdateModelUseCase } from \"~/features/contentModel/UpdateModel/index.js\";\nimport { CreateModelUseCase } from \"~/features/contentModel/CreateModel/index.js\";\n\ninterface Params {\n context: CmsContext;\n models: ValidCmsModelResult[];\n}\n\nexport const importModels = async (params: Params) => {\n const { context, models } = params;\n\n const groupsResult = await context.container.resolve(ListGroupsUseCase).execute();\n if (groupsResult.isFail()) {\n throw groupsResult.error;\n }\n const groups = groupsResult.value;\n\n const results: CmsModelImportResult[] = [];\n\n for (const model of models) {\n /**\n * There is a possibility that group does not exist.\n */\n const group = groups.find(group => {\n return group.slug === model.model.group;\n });\n if (!group) {\n results.push({\n action: model.action,\n model: model.model,\n related: model.related,\n imported: false,\n error: {\n message: `Group \"${model.model.group}\" does not exist.`,\n code: \"GROUP_NOT_FOUND\",\n data: {\n model\n }\n }\n });\n continue;\n }\n /**\n * No update action or there is a validation error.\n */\n if (model.action === CmsImportAction.NONE || model.error) {\n results.push({\n action: model.action,\n model: model.model,\n related: model.related,\n imported: false,\n error: model.error || {\n message: \"No action to be ran on the model.\",\n code: \"NO_ACTION\"\n }\n });\n continue;\n }\n /**\n * Cannot update a model if it is created via plugin.\n */\n if (model.action === CmsImportAction.CODE) {\n results.push({\n action: model.action,\n model: model.model,\n related: model.related,\n imported: true\n });\n continue;\n }\n\n /**\n * Update the model\n */\n //\n if (model.action === CmsImportAction.UPDATE) {\n const updateResult = await context.container\n .resolve(UpdateModelUseCase)\n .execute(model.model.modelId, model.model);\n if (updateResult.isFail()) {\n const ex = updateResult.error;\n results.push({\n action: model.action,\n model: model.model,\n imported: false,\n related: model.related,\n error: {\n message: ex.message,\n code: (ex as any).code || \"UPDATE_MODEL_ERROR\",\n data: { model: model.model, ...(ex as any).data }\n }\n });\n } else {\n results.push({\n action: model.action,\n model: { ...updateResult.value, group: group.slug },\n related: model.related,\n imported: true\n });\n }\n continue;\n }\n /**\n * Create a new model.\n */\n const createResult = await context.container\n .resolve(CreateModelUseCase)\n .execute(model.model);\n if (createResult.isFail()) {\n const ex = createResult.error;\n results.push({\n action: model.action,\n model: model.model,\n imported: false,\n related: model.related,\n error: {\n message: ex.message,\n code: (ex as any).code || \"CREATE_MODEL_ERROR\",\n data: { model: model.model, ...(ex as any).data }\n }\n });\n } else {\n results.push({\n action: model.action,\n model: { ...createResult.value, group: group.slug },\n related: model.related,\n imported: true\n });\n }\n }\n\n return results;\n};\n"],"names":["importModels","params","context","models","groupsResult","ListGroupsUseCase","groups","results","model","group","CmsImportAction","updateResult","UpdateModelUseCase","ex","createResult","CreateModelUseCase"],"mappings":";;;;AAYO,MAAMA,eAAe,OAAOC;IAC/B,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGF;IAE5B,MAAMG,eAAe,MAAMF,QAAQ,SAAS,CAAC,OAAO,CAACG,mBAAmB,OAAO;IAC/E,IAAID,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;IAE5B,MAAME,SAASF,aAAa,KAAK;IAEjC,MAAMG,UAAkC,EAAE;IAE1C,KAAK,MAAMC,SAASL,OAAQ;QAIxB,MAAMM,QAAQH,OAAO,IAAI,CAACG,CAAAA,QACfA,MAAM,IAAI,KAAKD,MAAM,KAAK,CAAC,KAAK;QAE3C,IAAI,CAACC,OAAO;YACRF,QAAQ,IAAI,CAAC;gBACT,QAAQC,MAAM,MAAM;gBACpB,OAAOA,MAAM,KAAK;gBAClB,SAASA,MAAM,OAAO;gBACtB,UAAU;gBACV,OAAO;oBACH,SAAS,CAAC,OAAO,EAAEA,MAAM,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC;oBACvD,MAAM;oBACN,MAAM;wBACFA;oBACJ;gBACJ;YACJ;YACA;QACJ;QAIA,IAAIA,MAAM,MAAM,KAAKE,gBAAgB,IAAI,IAAIF,MAAM,KAAK,EAAE;YACtDD,QAAQ,IAAI,CAAC;gBACT,QAAQC,MAAM,MAAM;gBACpB,OAAOA,MAAM,KAAK;gBAClB,SAASA,MAAM,OAAO;gBACtB,UAAU;gBACV,OAAOA,MAAM,KAAK,IAAI;oBAClB,SAAS;oBACT,MAAM;gBACV;YACJ;YACA;QACJ;QAIA,IAAIA,MAAM,MAAM,KAAKE,gBAAgB,IAAI,EAAE;YACvCH,QAAQ,IAAI,CAAC;gBACT,QAAQC,MAAM,MAAM;gBACpB,OAAOA,MAAM,KAAK;gBAClB,SAASA,MAAM,OAAO;gBACtB,UAAU;YACd;YACA;QACJ;QAMA,IAAIA,MAAM,MAAM,KAAKE,gBAAgB,MAAM,EAAE;YACzC,MAAMC,eAAe,MAAMT,QAAQ,SAAS,CACvC,OAAO,CAACU,oBACR,OAAO,CAACJ,MAAM,KAAK,CAAC,OAAO,EAAEA,MAAM,KAAK;YAC7C,IAAIG,aAAa,MAAM,IAAI;gBACvB,MAAME,KAAKF,aAAa,KAAK;gBAC7BJ,QAAQ,IAAI,CAAC;oBACT,QAAQC,MAAM,MAAM;oBACpB,OAAOA,MAAM,KAAK;oBAClB,UAAU;oBACV,SAASA,MAAM,OAAO;oBACtB,OAAO;wBACH,SAASK,GAAG,OAAO;wBACnB,MAAOA,GAAW,IAAI,IAAI;wBAC1B,MAAM;4BAAE,OAAOL,MAAM,KAAK;4BAAE,GAAIK,GAAW,IAAI;wBAAC;oBACpD;gBACJ;YACJ,OACIN,QAAQ,IAAI,CAAC;gBACT,QAAQC,MAAM,MAAM;gBACpB,OAAO;oBAAE,GAAGG,aAAa,KAAK;oBAAE,OAAOF,MAAM,IAAI;gBAAC;gBAClD,SAASD,MAAM,OAAO;gBACtB,UAAU;YACd;YAEJ;QACJ;QAIA,MAAMM,eAAe,MAAMZ,QAAQ,SAAS,CACvC,OAAO,CAACa,oBACR,OAAO,CAACP,MAAM,KAAK;QACxB,IAAIM,aAAa,MAAM,IAAI;YACvB,MAAMD,KAAKC,aAAa,KAAK;YAC7BP,QAAQ,IAAI,CAAC;gBACT,QAAQC,MAAM,MAAM;gBACpB,OAAOA,MAAM,KAAK;gBAClB,UAAU;gBACV,SAASA,MAAM,OAAO;gBACtB,OAAO;oBACH,SAASK,GAAG,OAAO;oBACnB,MAAOA,GAAW,IAAI,IAAI;oBAC1B,MAAM;wBAAE,OAAOL,MAAM,KAAK;wBAAE,GAAIK,GAAW,IAAI;oBAAC;gBACpD;YACJ;QACJ,OACIN,QAAQ,IAAI,CAAC;YACT,QAAQC,MAAM,MAAM;YACpB,OAAO;gBAAE,GAAGM,aAAa,KAAK;gBAAE,OAAOL,MAAM,IAAI;YAAC;YAClD,SAASD,MAAM,OAAO;YACtB,UAAU;QACd;IAER;IAEA,OAAOD;AACX"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const createExportGraphQL: () => ContextPlugin<CmsContext>;
|
|
1
|
+
declare const plugin: import("~/plugins/index.js").ICmsGraphQLSchemaPlugin<import("@webiny/api/types").Context>;
|
|
2
|
+
export { plugin as exportPlugin };
|
package/export/graphql/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createCmsGraphQLSchemaPlugin } from "../../plugins/index.js";
|
|
2
|
-
import { ErrorResponse, Response } from "@webiny/
|
|
3
|
-
import {
|
|
2
|
+
import { ErrorResponse, Response } from "@webiny/api-graphql";
|
|
3
|
+
import { CmsExport, CmsImport } from "../abstractions.js";
|
|
4
4
|
const graphql_plugin = createCmsGraphQLSchemaPlugin({
|
|
5
5
|
typeDefs: `
|
|
6
6
|
type CmsExportStructureResponse {
|
|
@@ -136,7 +136,7 @@ const graphql_plugin = createCmsGraphQLSchemaPlugin({
|
|
|
136
136
|
Query: {
|
|
137
137
|
exportStructure: async (_, args, context)=>{
|
|
138
138
|
try {
|
|
139
|
-
const result = await context.
|
|
139
|
+
const result = await context.container.resolve(CmsExport).structure({
|
|
140
140
|
models: args.models
|
|
141
141
|
});
|
|
142
142
|
return new Response(JSON.stringify(result));
|
|
@@ -148,7 +148,7 @@ const graphql_plugin = createCmsGraphQLSchemaPlugin({
|
|
|
148
148
|
Mutation: {
|
|
149
149
|
validateImportStructure: async (_, args, context)=>{
|
|
150
150
|
try {
|
|
151
|
-
const result = await context.
|
|
151
|
+
const result = await context.container.resolve(CmsImport).validate({
|
|
152
152
|
data: args.data
|
|
153
153
|
});
|
|
154
154
|
return new Response(result);
|
|
@@ -158,7 +158,7 @@ const graphql_plugin = createCmsGraphQLSchemaPlugin({
|
|
|
158
158
|
},
|
|
159
159
|
importStructure: async (_, args, context)=>{
|
|
160
160
|
try {
|
|
161
|
-
const result = await context.
|
|
161
|
+
const result = await context.container.resolve(CmsImport).structure({
|
|
162
162
|
data: args.data
|
|
163
163
|
});
|
|
164
164
|
return new Response(result);
|
|
@@ -170,10 +170,6 @@ const graphql_plugin = createCmsGraphQLSchemaPlugin({
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
graphql_plugin.name = "headless-cms.graphql.export";
|
|
173
|
-
|
|
174
|
-
if (!context.cms.MANAGE) return;
|
|
175
|
-
context.plugins.register(graphql_plugin);
|
|
176
|
-
});
|
|
177
|
-
export { createExportGraphQL };
|
|
173
|
+
export { graphql_plugin as exportPlugin };
|
|
178
174
|
|
|
179
175
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export/graphql/index.js","sources":["../../../src/export/graphql/index.ts"],"sourcesContent":["import { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { ErrorResponse, Response } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"export/graphql/index.js","sources":["../../../src/export/graphql/index.ts"],"sourcesContent":["import { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { ErrorResponse, Response } from \"@webiny/api-graphql\";\nimport { CmsExport, CmsImport } from \"~/export/abstractions.js\";\n\nconst plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsExportStructureResponse {\n data: String\n error: CmsError\n }\n\n input CmsImportStructureGroupInput {\n id: ID!\n name: String!\n slug: String\n description: String\n icon: Icon!\n }\n\n input CmsImportStructureModelInput {\n name: String!\n singularApiName: String!\n pluralApiName: String!\n modelId: String!\n group: String!\n icon: Icon\n description: String\n layout: JSON!\n fields: [CmsContentModelFieldInput!]!\n titleFieldId: String!\n descriptionFieldId: String\n imageFieldId: String\n tags: [String!]\n }\n\n enum CmsImportGroupStructureAction {\n create\n update\n code\n none\n }\n\n enum CmsImportModelStructureAction {\n create\n update\n code\n none\n }\n\n input CmsImportStructureInput {\n groups: [CmsImportStructureGroupInput!]!\n models: [CmsImportStructureModelInput!]!\n }\n\n type CmsImportValidateResponseDataGroupResultItem {\n id: String\n name: String\n slug: String\n }\n\n type CmsImportValidateResponseDataGroupResult {\n group: CmsImportValidateResponseDataGroupResultItem!\n error: CmsError\n action: CmsImportGroupStructureAction\n }\n\n type CmsImportValidateResponseDataModelResultItem {\n modelId: String\n name: String\n group: String\n }\n\n type CmsImportValidateResponseDataModelResult {\n model: CmsImportValidateResponseDataModelResultItem!\n related: [String!]\n error: CmsError\n action: CmsImportModelStructureAction\n }\n\n type CmsImportValidateResponseData {\n groups: [CmsImportValidateResponseDataGroupResult!]!\n models: [CmsImportValidateResponseDataModelResult!]!\n message: String!\n }\n\n type CmsImportValidateResponse {\n data: CmsImportValidateResponseData\n error: CmsError\n }\n\n type CmsImportStructureResponseDataGroupResultItem {\n id: String!\n name: String!\n }\n type CmsImportStructureResponseDataGroupResult {\n group: CmsImportStructureResponseDataGroupResultItem!\n error: CmsError\n action: CmsImportGroupStructureAction\n imported: Boolean\n }\n\n type CmsImportStructureResponseDataResultItem {\n modelId: String!\n name: String!\n group: String!\n }\n\n type CmsImportStructureResponseDataModelResult {\n model: CmsImportStructureResponseDataResultItem!\n related: [String!]\n error: CmsError\n action: CmsImportModelStructureAction\n imported: Boolean\n }\n\n type CmsImportStructureResponseData {\n groups: [CmsImportStructureResponseDataGroupResult!]!\n models: [CmsImportStructureResponseDataModelResult!]!\n message: String\n }\n\n type CmsImportStructureResponse {\n data: CmsImportStructureResponseData\n error: CmsError\n }\n\n extend type Query {\n exportStructure(models: [String!]): CmsExportStructureResponse!\n }\n\n extend type Mutation {\n validateImportStructure(data: CmsImportStructureInput!): CmsImportValidateResponse!\n importStructure(data: CmsImportStructureInput!): CmsImportStructureResponse!\n }\n `,\n resolvers: {\n Query: {\n exportStructure: async (_, args, context) => {\n try {\n const result = await context.container.resolve(CmsExport).structure({\n models: args.models\n });\n return new Response(JSON.stringify(result));\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n },\n Mutation: {\n validateImportStructure: async (_, args, context) => {\n try {\n const result = await context.container.resolve(CmsImport).validate({\n data: args.data\n });\n return new Response(result);\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n },\n importStructure: async (_, args, context) => {\n try {\n const result = await context.container.resolve(CmsImport).structure({\n data: args.data\n });\n return new Response(result);\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n }\n }\n});\nplugin.name = \"headless-cms.graphql.export\";\n\nexport { plugin as exportPlugin };\n"],"names":["plugin","createCmsGraphQLSchemaPlugin","_","args","context","result","CmsExport","Response","JSON","ex","ErrorResponse","CmsImport"],"mappings":";;;AAIA,MAAMA,iBAASC,6BAA6B;IACxC,UAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiIzB,CAAC;IACD,WAAW;QACP,OAAO;YACH,iBAAiB,OAAOC,GAAGC,MAAMC;gBAC7B,IAAI;oBACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CAAC,OAAO,CAACE,WAAW,SAAS,CAAC;wBAChE,QAAQH,KAAK,MAAM;oBACvB;oBACA,OAAO,IAAII,SAASC,KAAK,SAAS,CAACH;gBACvC,EAAE,OAAOI,IAAI;oBACT,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;QACJ;QACA,UAAU;YACN,yBAAyB,OAAOP,GAAGC,MAAMC;gBACrC,IAAI;oBACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CAAC,OAAO,CAACO,WAAW,QAAQ,CAAC;wBAC/D,MAAMR,KAAK,IAAI;oBACnB;oBACA,OAAO,IAAII,SAASF;gBACxB,EAAE,OAAOI,IAAI;oBACT,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;YACA,iBAAiB,OAAOP,GAAGC,MAAMC;gBAC7B,IAAI;oBACA,MAAMC,SAAS,MAAMD,QAAQ,SAAS,CAAC,OAAO,CAACO,WAAW,SAAS,CAAC;wBAChE,MAAMR,KAAK,IAAI;oBACnB;oBACA,OAAO,IAAII,SAASF;gBACxB,EAAE,OAAOI,IAAI;oBACT,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;QACJ;IACJ;AACJ;AACAT,eAAO,IAAI,GAAG"}
|
|
@@ -4,6 +4,8 @@ export { CreateEntryUseCase } from "../../../features/contentEntry/CreateEntry/a
|
|
|
4
4
|
export { EntryBeforeCreateEventHandler, EntryAfterCreateEventHandler } from "../../../features/contentEntry/CreateEntry/events.js";
|
|
5
5
|
export { CreateEntryRevisionFromUseCase } from "../../../features/contentEntry/CreateEntryRevisionFrom/abstractions.js";
|
|
6
6
|
export { EntryRevisionBeforeCreateEventHandler, EntryRevisionAfterCreateEventHandler } from "../../../features/contentEntry/CreateEntryRevisionFrom/events.js";
|
|
7
|
+
export { DuplicateEntryUseCase } from "../../../features/contentEntry/DuplicateEntry/abstractions.js";
|
|
8
|
+
export { EntryBeforeDuplicateEventHandler, EntryAfterDuplicateEventHandler } from "../../../features/contentEntry/DuplicateEntry/events.js";
|
|
7
9
|
export { DeleteEntryUseCase, MoveEntryToBinUseCase } from "../../../features/contentEntry/DeleteEntry/abstractions.js";
|
|
8
10
|
export { EntryBeforeDeleteEventHandler, EntryAfterDeleteEventHandler } from "../../../features/contentEntry/DeleteEntry/events.js";
|
|
9
11
|
export { DeleteEntryRevisionUseCase } from "../../../features/contentEntry/DeleteEntryRevision/abstractions.js";
|
|
@@ -24,6 +26,9 @@ export { UpdateEntryUseCase } from "../../../features/contentEntry/UpdateEntry/a
|
|
|
24
26
|
export { EntryBeforeUpdateEventHandler, EntryAfterUpdateEventHandler } from "../../../features/contentEntry/UpdateEntry/events.js";
|
|
25
27
|
export { UpdateRevisionDescriptionUseCase } from "../../../features/contentEntry/UpdateRevisionDescription/abstractions.js";
|
|
26
28
|
export { EntryBeforeUpdateRevisionDescriptionEventHandler, EntryAfterUpdateRevisionDescriptionEventHandler } from "../../../features/contentEntry/UpdateRevisionDescription/events.js";
|
|
29
|
+
export { UpdateEntrySystemUseCase } from "../../../features/contentEntry/UpdateEntrySystem/abstractions.js";
|
|
30
|
+
export { EntryBeforeUpdateSystemEventHandler, EntryAfterUpdateSystemEventHandler } from "../../../features/contentEntry/UpdateEntrySystem/events.js";
|
|
31
|
+
export { CmsEntrySystemField } from "../../../features/contentEntry/EntrySystemField/abstractions.js";
|
|
27
32
|
export { UpdateSingletonEntryUseCase } from "../../../features/contentEntry/UpdateSingletonEntry/abstractions.js";
|
|
28
33
|
export { GetEntriesByIdsUseCase } from "../../../features/contentEntry/GetEntriesByIds/abstractions.js";
|
|
29
34
|
export { GetEntryUseCase } from "../../../features/contentEntry/GetEntry/abstractions.js";
|
package/exports/api/cms/entry.js
CHANGED
|
@@ -3,6 +3,8 @@ export { CreateEntryUseCase } from "../../../features/contentEntry/CreateEntry/a
|
|
|
3
3
|
export { EntryAfterCreateEventHandler, EntryBeforeCreateEventHandler } from "../../../features/contentEntry/CreateEntry/events.js";
|
|
4
4
|
export { CreateEntryRevisionFromUseCase } from "../../../features/contentEntry/CreateEntryRevisionFrom/abstractions.js";
|
|
5
5
|
export { EntryRevisionAfterCreateEventHandler, EntryRevisionBeforeCreateEventHandler } from "../../../features/contentEntry/CreateEntryRevisionFrom/events.js";
|
|
6
|
+
export { DuplicateEntryUseCase } from "../../../features/contentEntry/DuplicateEntry/abstractions.js";
|
|
7
|
+
export { EntryAfterDuplicateEventHandler, EntryBeforeDuplicateEventHandler } from "../../../features/contentEntry/DuplicateEntry/events.js";
|
|
6
8
|
export { DeleteEntryUseCase, MoveEntryToBinUseCase } from "../../../features/contentEntry/DeleteEntry/abstractions.js";
|
|
7
9
|
export { EntryAfterDeleteEventHandler, EntryBeforeDeleteEventHandler } from "../../../features/contentEntry/DeleteEntry/events.js";
|
|
8
10
|
export { DeleteEntryRevisionUseCase } from "../../../features/contentEntry/DeleteEntryRevision/abstractions.js";
|
|
@@ -23,6 +25,9 @@ export { UpdateEntryUseCase } from "../../../features/contentEntry/UpdateEntry/a
|
|
|
23
25
|
export { EntryAfterUpdateEventHandler, EntryBeforeUpdateEventHandler } from "../../../features/contentEntry/UpdateEntry/events.js";
|
|
24
26
|
export { UpdateRevisionDescriptionUseCase } from "../../../features/contentEntry/UpdateRevisionDescription/abstractions.js";
|
|
25
27
|
export { EntryAfterUpdateRevisionDescriptionEventHandler, EntryBeforeUpdateRevisionDescriptionEventHandler } from "../../../features/contentEntry/UpdateRevisionDescription/events.js";
|
|
28
|
+
export { UpdateEntrySystemUseCase } from "../../../features/contentEntry/UpdateEntrySystem/abstractions.js";
|
|
29
|
+
export { EntryAfterUpdateSystemEventHandler, EntryBeforeUpdateSystemEventHandler } from "../../../features/contentEntry/UpdateEntrySystem/events.js";
|
|
30
|
+
export { CmsEntrySystemField } from "../../../features/contentEntry/EntrySystemField/abstractions.js";
|
|
26
31
|
export { UpdateSingletonEntryUseCase } from "../../../features/contentEntry/UpdateSingletonEntry/abstractions.js";
|
|
27
32
|
export { GetEntriesByIdsUseCase } from "../../../features/contentEntry/GetEntriesByIds/abstractions.js";
|
|
28
33
|
export { GetEntryUseCase } from "../../../features/contentEntry/GetEntry/abstractions.js";
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { StorageOperationsFactory } from "../../../features/shared/abstractions.js";
|
|
2
1
|
export { StorageTransform } from "../../../features/storage/abstractions/StorageTransform.js";
|
|
3
2
|
export { StorageTransformRegistry } from "../../../features/storage/abstractions/StorageTransformRegistry.js";
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { StorageOperationsFactory } from "../../../features/shared/abstractions.js";
|
|
2
1
|
export { StorageTransform } from "../../../features/storage/abstractions/StorageTransform.js";
|
|
3
2
|
export { StorageTransformRegistry } from "../../../features/storage/abstractions/StorageTransformRegistry.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { GetModelUseCase } from "../../features/contentModel/GetModel/index.js";
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
modelId: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type Input = z.infer<typeof inputSchema>;
|
|
8
|
+
interface FieldDescription {
|
|
9
|
+
fieldId: string;
|
|
10
|
+
type: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** True when the field holds an array of values — affects which `where` operators apply. */
|
|
13
|
+
list: boolean;
|
|
14
|
+
required: boolean;
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Allowed values for enum-like fields, so a filter can be built without guessing. */
|
|
17
|
+
predefinedValues?: string[];
|
|
18
|
+
/** For `ref` fields: which models this field can point at. */
|
|
19
|
+
refModels?: string[];
|
|
20
|
+
/** For `object` fields: the nested field set. */
|
|
21
|
+
fields?: FieldDescription[];
|
|
22
|
+
}
|
|
23
|
+
interface ModelDescription {
|
|
24
|
+
modelId: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description: string | null;
|
|
27
|
+
singularApiName: string;
|
|
28
|
+
pluralApiName: string;
|
|
29
|
+
titleFieldId: string;
|
|
30
|
+
fields: FieldDescription[];
|
|
31
|
+
}
|
|
32
|
+
declare class DescribeContentModelToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
33
|
+
private getModel;
|
|
34
|
+
constructor(getModel: GetModelUseCase.Interface);
|
|
35
|
+
execute(input: Input): Promise<ModelDescription>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Supplies the field detail needed to build a valid `queryEntries` filter. Deliberately a separate
|
|
39
|
+
* call from `listContentModels`: returning full field sets for every model would be large and mostly
|
|
40
|
+
* unread, so the model pays for detail only on the model it actually cares about.
|
|
41
|
+
*/
|
|
42
|
+
declare class DescribeContentModelToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
43
|
+
readonly name = "describeContentModel";
|
|
44
|
+
readonly title = "Describe content model";
|
|
45
|
+
readonly description = "Returns the fields of one content model \u2014 field IDs, types, whether each is a list, required flags, allowed values, and referenced models. Call this before queryEntries so filters use real field IDs.";
|
|
46
|
+
readonly inputSchema: z.ZodObject<{
|
|
47
|
+
modelId: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
readonly annotations: {
|
|
50
|
+
readOnlyHint: boolean;
|
|
51
|
+
idempotentHint: boolean;
|
|
52
|
+
};
|
|
53
|
+
readonly handler: typeof DescribeContentModelToolHandlerImpl & {
|
|
54
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export declare const DescribeContentModelTool: typeof DescribeContentModelToolImpl & {
|
|
58
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { GetModelUseCase } from "../contentModel/GetModel/index.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
modelId: z.string().describe("Model ID as returned by listContentModels (e.g. 'product', not 'Products').")
|
|
6
|
+
});
|
|
7
|
+
const isRequired = (field)=>field.validation.some((validator)=>"required" === validator.name);
|
|
8
|
+
const describeField = (field)=>{
|
|
9
|
+
const described = {
|
|
10
|
+
fieldId: field.fieldId,
|
|
11
|
+
type: field.type,
|
|
12
|
+
label: field.label,
|
|
13
|
+
list: Boolean(field.list),
|
|
14
|
+
required: isRequired(field)
|
|
15
|
+
};
|
|
16
|
+
if (field.description) described.description = field.description;
|
|
17
|
+
const values = field.predefinedValues;
|
|
18
|
+
if (values?.enabled && values.values?.length) described.predefinedValues = values.values.map((entry)=>entry.value);
|
|
19
|
+
const refModels = field.settings?.models;
|
|
20
|
+
if (refModels?.length) described.refModels = refModels.map((model)=>model.modelId);
|
|
21
|
+
const nested = field.settings?.fields;
|
|
22
|
+
if (nested?.length) described.fields = nested.map(describeField);
|
|
23
|
+
return described;
|
|
24
|
+
};
|
|
25
|
+
class DescribeContentModelToolHandlerImpl {
|
|
26
|
+
constructor(getModel){
|
|
27
|
+
this.getModel = getModel;
|
|
28
|
+
}
|
|
29
|
+
async execute(input) {
|
|
30
|
+
const result = await this.getModel.execute(input.modelId);
|
|
31
|
+
if (result.isFail()) throw new Error(`Could not describe model "${input.modelId}": ${result.error.message}. Call listContentModels for valid model IDs.`);
|
|
32
|
+
const model = result.value;
|
|
33
|
+
return {
|
|
34
|
+
modelId: model.modelId,
|
|
35
|
+
name: model.name,
|
|
36
|
+
description: model.description,
|
|
37
|
+
singularApiName: model.singularApiName,
|
|
38
|
+
pluralApiName: model.pluralApiName,
|
|
39
|
+
titleFieldId: model.titleFieldId,
|
|
40
|
+
fields: model.fields.map(describeField)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const DescribeContentModelToolHandler = AiSdkToolHandler.createImplementation({
|
|
45
|
+
implementation: DescribeContentModelToolHandlerImpl,
|
|
46
|
+
dependencies: [
|
|
47
|
+
GetModelUseCase
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
class DescribeContentModelToolImpl {
|
|
51
|
+
constructor(){
|
|
52
|
+
this.name = "describeContentModel";
|
|
53
|
+
this.title = "Describe content model";
|
|
54
|
+
this.description = "Returns the fields of one content model — field IDs, types, whether each is a list, required flags, allowed values, and referenced models. Call this before queryEntries so filters use real field IDs.";
|
|
55
|
+
this.inputSchema = inputSchema;
|
|
56
|
+
this.annotations = {
|
|
57
|
+
readOnlyHint: true,
|
|
58
|
+
idempotentHint: true
|
|
59
|
+
};
|
|
60
|
+
this.handler = DescribeContentModelToolHandler;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const DescribeContentModelTool = AiSdkToolDefinition.createImplementation({
|
|
64
|
+
implementation: DescribeContentModelToolImpl,
|
|
65
|
+
dependencies: []
|
|
66
|
+
});
|
|
67
|
+
export { DescribeContentModelTool };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=DescribeContentModelTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ai/DescribeContentModelTool.js","sources":["../../../src/features/ai/DescribeContentModelTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { GetModelUseCase } from \"~/features/contentModel/GetModel/index.js\";\nimport type { CmsModelField } from \"~/types/index.js\";\n\nconst inputSchema = z.object({\n modelId: z\n .string()\n .describe(\"Model ID as returned by listContentModels (e.g. 'product', not 'Products').\")\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface FieldDescription {\n fieldId: string;\n type: string;\n label: string;\n /** True when the field holds an array of values — affects which `where` operators apply. */\n list: boolean;\n required: boolean;\n description?: string;\n /** Allowed values for enum-like fields, so a filter can be built without guessing. */\n predefinedValues?: string[];\n /** For `ref` fields: which models this field can point at. */\n refModels?: string[];\n /** For `object` fields: the nested field set. */\n fields?: FieldDescription[];\n}\n\ninterface ModelDescription {\n modelId: string;\n name: string;\n description: string | null;\n singularApiName: string;\n pluralApiName: string;\n titleFieldId: string;\n fields: FieldDescription[];\n}\n\nconst isRequired = (field: CmsModelField): boolean =>\n field.validation.some(validator => validator.name === \"required\");\n\nconst describeField = (field: CmsModelField): FieldDescription => {\n const described: FieldDescription = {\n fieldId: field.fieldId,\n type: field.type,\n label: field.label,\n list: Boolean(field.list),\n required: isRequired(field)\n };\n\n if (field.description) {\n described.description = field.description;\n }\n\n const values = field.predefinedValues;\n if (values?.enabled && values.values?.length) {\n described.predefinedValues = values.values.map(entry => entry.value);\n }\n\n const refModels = field.settings?.models;\n if (refModels?.length) {\n described.refModels = refModels.map(model => model.modelId);\n }\n\n const nested = field.settings?.fields;\n if (nested?.length) {\n described.fields = nested.map(describeField);\n }\n\n return described;\n};\n\nclass DescribeContentModelToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(private getModel: GetModelUseCase.Interface) {}\n\n async execute(input: Input): Promise<ModelDescription> {\n const result = await this.getModel.execute(input.modelId);\n\n if (result.isFail()) {\n throw new Error(\n `Could not describe model \"${input.modelId}\": ${result.error.message}. Call listContentModels for valid model IDs.`\n );\n }\n\n const model = result.value;\n\n return {\n modelId: model.modelId,\n name: model.name,\n description: model.description,\n singularApiName: model.singularApiName,\n pluralApiName: model.pluralApiName,\n titleFieldId: model.titleFieldId,\n fields: model.fields.map(describeField)\n };\n }\n}\n\nconst DescribeContentModelToolHandler = AiSdkToolHandler.createImplementation({\n implementation: DescribeContentModelToolHandlerImpl,\n dependencies: [GetModelUseCase]\n});\n\n/**\n * Supplies the field detail needed to build a valid `queryEntries` filter. Deliberately a separate\n * call from `listContentModels`: returning full field sets for every model would be large and mostly\n * unread, so the model pays for detail only on the model it actually cares about.\n */\nclass DescribeContentModelToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"describeContentModel\";\n readonly title = \"Describe content model\";\n readonly description =\n \"Returns the fields of one content model — field IDs, types, whether each is a list, required flags, allowed values, and referenced models. Call this before queryEntries so filters use real field IDs.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: true, idempotentHint: true };\n readonly handler = DescribeContentModelToolHandler;\n}\n\nexport const DescribeContentModelTool = AiSdkToolDefinition.createImplementation({\n implementation: DescribeContentModelToolImpl,\n dependencies: []\n});\n"],"names":["inputSchema","z","isRequired","field","validator","describeField","described","Boolean","values","entry","refModels","model","nested","DescribeContentModelToolHandlerImpl","getModel","input","result","Error","DescribeContentModelToolHandler","AiSdkToolHandler","GetModelUseCase","DescribeContentModelToolImpl","DescribeContentModelTool","AiSdkToolDefinition"],"mappings":";;;AAKA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,SAASA,EAAAA,MACE,GACN,QAAQ,CAAC;AAClB;AA8BA,MAAMC,aAAa,CAACC,QAChBA,MAAM,UAAU,CAAC,IAAI,CAACC,CAAAA,YAAaA,AAAmB,eAAnBA,UAAU,IAAI;AAErD,MAAMC,gBAAgB,CAACF;IACnB,MAAMG,YAA8B;QAChC,SAASH,MAAM,OAAO;QACtB,MAAMA,MAAM,IAAI;QAChB,OAAOA,MAAM,KAAK;QAClB,MAAMI,QAAQJ,MAAM,IAAI;QACxB,UAAUD,WAAWC;IACzB;IAEA,IAAIA,MAAM,WAAW,EACjBG,UAAU,WAAW,GAAGH,MAAM,WAAW;IAG7C,MAAMK,SAASL,MAAM,gBAAgB;IACrC,IAAIK,QAAQ,WAAWA,OAAO,MAAM,EAAE,QAClCF,UAAU,gBAAgB,GAAGE,OAAO,MAAM,CAAC,GAAG,CAACC,CAAAA,QAASA,MAAM,KAAK;IAGvE,MAAMC,YAAYP,MAAM,QAAQ,EAAE;IAClC,IAAIO,WAAW,QACXJ,UAAU,SAAS,GAAGI,UAAU,GAAG,CAACC,CAAAA,QAASA,MAAM,OAAO;IAG9D,MAAMC,SAAST,MAAM,QAAQ,EAAE;IAC/B,IAAIS,QAAQ,QACRN,UAAU,MAAM,GAAGM,OAAO,GAAG,CAACP;IAGlC,OAAOC;AACX;AAEA,MAAMO;IACF,YAAoBC,QAAmC,CAAE;aAArCA,QAAQ,GAARA;IAAsC;IAE1D,MAAM,QAAQC,KAAY,EAA6B;QACnD,MAAMC,SAAS,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACD,MAAM,OAAO;QAExD,IAAIC,OAAO,MAAM,IACb,MAAM,IAAIC,MACN,CAAC,0BAA0B,EAAEF,MAAM,OAAO,CAAC,GAAG,EAAEC,OAAO,KAAK,CAAC,OAAO,CAAC,6CAA6C,CAAC;QAI3H,MAAML,QAAQK,OAAO,KAAK;QAE1B,OAAO;YACH,SAASL,MAAM,OAAO;YACtB,MAAMA,MAAM,IAAI;YAChB,aAAaA,MAAM,WAAW;YAC9B,iBAAiBA,MAAM,eAAe;YACtC,eAAeA,MAAM,aAAa;YAClC,cAAcA,MAAM,YAAY;YAChC,QAAQA,MAAM,MAAM,CAAC,GAAG,CAACN;QAC7B;IACJ;AACJ;AAEA,MAAMa,kCAAkCC,iBAAiB,oBAAoB,CAAC;IAC1E,gBAAgBN;IAChB,cAAc;QAACO;KAAgB;AACnC;AAOA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGrB;aACd,WAAW,GAAG;YAAE,cAAc;YAAM,gBAAgB;QAAK;aACzD,OAAO,GAAGkB;;AACvB;AAEO,MAAMI,2BAA2BC,oBAAoB,oBAAoB,CAAC;IAC7E,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { ListModelsUseCase } from "../../features/contentModel/ListModels/index.js";
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
includeSystem: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type Input = z.infer<typeof inputSchema>;
|
|
8
|
+
interface ModelSummary {
|
|
9
|
+
modelId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
group: string;
|
|
13
|
+
singularApiName: string;
|
|
14
|
+
pluralApiName: string;
|
|
15
|
+
titleFieldId: string;
|
|
16
|
+
fieldCount: number;
|
|
17
|
+
}
|
|
18
|
+
declare class ListContentModelsToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
19
|
+
private listModels;
|
|
20
|
+
constructor(listModels: ListModelsUseCase.Interface);
|
|
21
|
+
execute(input: Input): Promise<ModelSummary[]>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Entry point for any content question. The CMS schema is defined per project (and per tenant), so a
|
|
25
|
+
* model list cannot be baked into a system prompt — it has to be discovered at call time. Returns a
|
|
26
|
+
* summary only; `describeContentModel` supplies the field detail needed to actually build a query.
|
|
27
|
+
*/
|
|
28
|
+
declare class ListContentModelsToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
29
|
+
readonly name = "listContentModels";
|
|
30
|
+
readonly title = "List content models";
|
|
31
|
+
readonly description = "Lists the content models available in this project. Call this first when you need to find content \u2014 model IDs are project-specific and cannot be guessed. Returns a summary per model; use describeContentModel for field details.";
|
|
32
|
+
readonly inputSchema: z.ZodObject<{
|
|
33
|
+
includeSystem: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
readonly annotations: {
|
|
36
|
+
readOnlyHint: boolean;
|
|
37
|
+
idempotentHint: boolean;
|
|
38
|
+
};
|
|
39
|
+
readonly handler: typeof ListContentModelsToolHandlerImpl & {
|
|
40
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare const ListContentModelsTool: typeof ListContentModelsToolImpl & {
|
|
44
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { ListModelsUseCase } from "../contentModel/ListModels/index.js";
|
|
4
|
+
const HIDDEN_MODEL_GROUP = "hidden";
|
|
5
|
+
const inputSchema = z.object({
|
|
6
|
+
includeSystem: z.boolean().optional().describe("Include system models that back Webiny itself (languages, tenants, task settings) and internal models belonging to other apps. Off by default — these are never what a user means by 'content'.")
|
|
7
|
+
});
|
|
8
|
+
const isSystemModel = (model)=>Boolean(model.isPrivate) || model.group === HIDDEN_MODEL_GROUP;
|
|
9
|
+
class ListContentModelsToolHandlerImpl {
|
|
10
|
+
constructor(listModels){
|
|
11
|
+
this.listModels = listModels;
|
|
12
|
+
}
|
|
13
|
+
async execute(input) {
|
|
14
|
+
const result = await this.listModels.execute();
|
|
15
|
+
if (result.isFail()) throw new Error(`Could not list content models: ${result.error.message}`);
|
|
16
|
+
return result.value.filter((model)=>input.includeSystem ? true : !isSystemModel(model)).map((model)=>({
|
|
17
|
+
modelId: model.modelId,
|
|
18
|
+
name: model.name,
|
|
19
|
+
description: model.description,
|
|
20
|
+
group: model.group,
|
|
21
|
+
singularApiName: model.singularApiName,
|
|
22
|
+
pluralApiName: model.pluralApiName,
|
|
23
|
+
titleFieldId: model.titleFieldId,
|
|
24
|
+
fieldCount: model.fields.length
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const ListContentModelsToolHandler = AiSdkToolHandler.createImplementation({
|
|
29
|
+
implementation: ListContentModelsToolHandlerImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
ListModelsUseCase
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
class ListContentModelsToolImpl {
|
|
35
|
+
constructor(){
|
|
36
|
+
this.name = "listContentModels";
|
|
37
|
+
this.title = "List content models";
|
|
38
|
+
this.description = "Lists the content models available in this project. Call this first when you need to find content — model IDs are project-specific and cannot be guessed. Returns a summary per model; use describeContentModel for field details.";
|
|
39
|
+
this.inputSchema = inputSchema;
|
|
40
|
+
this.annotations = {
|
|
41
|
+
readOnlyHint: true,
|
|
42
|
+
idempotentHint: true
|
|
43
|
+
};
|
|
44
|
+
this.handler = ListContentModelsToolHandler;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const ListContentModelsTool = AiSdkToolDefinition.createImplementation({
|
|
48
|
+
implementation: ListContentModelsToolImpl,
|
|
49
|
+
dependencies: []
|
|
50
|
+
});
|
|
51
|
+
export { ListContentModelsTool };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=ListContentModelsTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ai/ListContentModelsTool.js","sources":["../../../src/features/ai/ListContentModelsTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListModelsUseCase } from \"~/features/contentModel/ListModels/index.js\";\nimport type { CmsModel } from \"~/types/index.js\";\n\nconst HIDDEN_MODEL_GROUP = \"hidden\";\n\nconst inputSchema = z.object({\n includeSystem: z\n .boolean()\n .optional()\n .describe(\n \"Include system models that back Webiny itself (languages, tenants, task settings) and internal models belonging to other apps. Off by default — these are never what a user means by 'content'.\"\n )\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface ModelSummary {\n modelId: string;\n name: string;\n description: string | null;\n group: string;\n singularApiName: string;\n pluralApiName: string;\n titleFieldId: string;\n fieldCount: number;\n}\n\n/**\n * Models Webiny itself owns. Two separate markers, both needed:\n * - `group: \"hidden\"` — the convention system models use (languages, tenants, background-task\n * settings). The admin UI filters the same way, see app-headless-cms useCmsData.\n * - `isPrivate` — models another app owns and manages through its own UI (e.g. Website Builder).\n */\nconst isSystemModel = (model: CmsModel): boolean =>\n Boolean(model.isPrivate) || model.group === HIDDEN_MODEL_GROUP;\n\nclass ListContentModelsToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(private listModels: ListModelsUseCase.Interface) {}\n\n async execute(input: Input): Promise<ModelSummary[]> {\n const result = await this.listModels.execute();\n\n if (result.isFail()) {\n throw new Error(`Could not list content models: ${result.error.message}`);\n }\n\n return result.value\n .filter(model => (input.includeSystem ? true : !isSystemModel(model)))\n .map(model => ({\n modelId: model.modelId,\n name: model.name,\n description: model.description,\n group: model.group,\n singularApiName: model.singularApiName,\n pluralApiName: model.pluralApiName,\n titleFieldId: model.titleFieldId,\n fieldCount: model.fields.length\n }));\n }\n}\n\nconst ListContentModelsToolHandler = AiSdkToolHandler.createImplementation({\n implementation: ListContentModelsToolHandlerImpl,\n dependencies: [ListModelsUseCase]\n});\n\n/**\n * Entry point for any content question. The CMS schema is defined per project (and per tenant), so a\n * model list cannot be baked into a system prompt — it has to be discovered at call time. Returns a\n * summary only; `describeContentModel` supplies the field detail needed to actually build a query.\n */\nclass ListContentModelsToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"listContentModels\";\n readonly title = \"List content models\";\n readonly description =\n \"Lists the content models available in this project. Call this first when you need to find content — model IDs are project-specific and cannot be guessed. Returns a summary per model; use describeContentModel for field details.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: true, idempotentHint: true };\n readonly handler = ListContentModelsToolHandler;\n}\n\nexport const ListContentModelsTool = AiSdkToolDefinition.createImplementation({\n implementation: ListContentModelsToolImpl,\n dependencies: []\n});\n"],"names":["HIDDEN_MODEL_GROUP","inputSchema","z","isSystemModel","model","Boolean","ListContentModelsToolHandlerImpl","listModels","input","result","Error","ListContentModelsToolHandler","AiSdkToolHandler","ListModelsUseCase","ListContentModelsToolImpl","ListContentModelsTool","AiSdkToolDefinition"],"mappings":";;;AAKA,MAAMA,qBAAqB;AAE3B,MAAMC,cAAcC,EAAE,MAAM,CAAC;IACzB,eAAeA,EAAAA,OACH,GACP,QAAQ,GACR,QAAQ,CACL;AAEZ;AAqBA,MAAMC,gBAAgB,CAACC,QACnBC,QAAQD,MAAM,SAAS,KAAKA,MAAM,KAAK,KAAKJ;AAEhD,MAAMM;IACF,YAAoBC,UAAuC,CAAE;aAAzCA,UAAU,GAAVA;IAA0C;IAE9D,MAAM,QAAQC,KAAY,EAA2B;QACjD,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO;QAE5C,IAAIA,OAAO,MAAM,IACb,MAAM,IAAIC,MAAM,CAAC,+BAA+B,EAAED,OAAO,KAAK,CAAC,OAAO,EAAE;QAG5E,OAAOA,OAAO,KAAK,CACd,MAAM,CAACL,CAAAA,QAAUI,MAAM,aAAa,GAAG,OAAO,CAACL,cAAcC,QAC7D,GAAG,CAACA,CAAAA,QAAU;gBACX,SAASA,MAAM,OAAO;gBACtB,MAAMA,MAAM,IAAI;gBAChB,aAAaA,MAAM,WAAW;gBAC9B,OAAOA,MAAM,KAAK;gBAClB,iBAAiBA,MAAM,eAAe;gBACtC,eAAeA,MAAM,aAAa;gBAClC,cAAcA,MAAM,YAAY;gBAChC,YAAYA,MAAM,MAAM,CAAC,MAAM;YACnC;IACR;AACJ;AAEA,MAAMO,+BAA+BC,iBAAiB,oBAAoB,CAAC;IACvE,gBAAgBN;IAChB,cAAc;QAACO;KAAkB;AACrC;AAOA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGb;aACd,WAAW,GAAG;YAAE,cAAc;YAAM,gBAAgB;QAAK;aACzD,OAAO,GAAGU;;AACvB;AAEO,MAAMI,wBAAwBC,oBAAoB,oBAAoB,CAAC;IAC1E,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { GetModelUseCase } from "../../features/contentModel/GetModel/index.js";
|
|
4
|
+
import { ListLatestEntriesUseCase } from "../../features/contentEntry/ListEntries/index.js";
|
|
5
|
+
import { CmsWhereMapper } from "../../features/whereMapper/abstractions.js";
|
|
6
|
+
import { CmsSortMapper } from "../../features/sortMapper/abstractions.js";
|
|
7
|
+
declare const inputSchema: z.ZodObject<{
|
|
8
|
+
modelId: z.ZodString;
|
|
9
|
+
where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
10
|
+
sort: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
search: z.ZodOptional<z.ZodString>;
|
|
12
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
after: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
type Input = z.infer<typeof inputSchema>;
|
|
17
|
+
interface EntrySummary {
|
|
18
|
+
id: string;
|
|
19
|
+
entryId: string;
|
|
20
|
+
status: string;
|
|
21
|
+
createdOn: string;
|
|
22
|
+
savedOn: string;
|
|
23
|
+
values: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
interface QueryEntriesResult {
|
|
26
|
+
modelId: string;
|
|
27
|
+
entries: EntrySummary[];
|
|
28
|
+
meta: {
|
|
29
|
+
totalCount: number;
|
|
30
|
+
hasMoreItems: boolean;
|
|
31
|
+
cursor: string | null;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare class QueryEntriesToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
35
|
+
private getModel;
|
|
36
|
+
private listLatestEntries;
|
|
37
|
+
private whereMapper;
|
|
38
|
+
private sortMapper;
|
|
39
|
+
constructor(getModel: GetModelUseCase.Interface, listLatestEntries: ListLatestEntriesUseCase.Interface, whereMapper: CmsWhereMapper.Interface, sortMapper: CmsSortMapper.Interface);
|
|
40
|
+
execute(input: Input): Promise<QueryEntriesResult>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Reads entries for one model.
|
|
44
|
+
*
|
|
45
|
+
* Uses the LATEST revisions (the manage-API view), not published ones — an editor asking "which
|
|
46
|
+
* products are discounted" means the content as it currently stands in the admin app, including
|
|
47
|
+
* unpublished edits. Filter on `status` for a published-only view.
|
|
48
|
+
*
|
|
49
|
+
* `where` is passed through to the CMS rather than re-modelled as a Zod schema: the valid keys depend
|
|
50
|
+
* entirely on the model's fields, which are only known at runtime. An invalid filter surfaces as a
|
|
51
|
+
* tool error the model can correct, which is why `describeContentModel` is named in the description.
|
|
52
|
+
*
|
|
53
|
+
* `where` and `sort` arrive FLAT and go through `CmsWhereMapper`/`CmsSortMapper`, which nest the
|
|
54
|
+
* model's own fields under `values` and leave entry meta at the top. The flat form is what a model
|
|
55
|
+
* writes, because `describeContentModel` hands it a flat list of fieldIds.
|
|
56
|
+
*/
|
|
57
|
+
declare class QueryEntriesToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
58
|
+
readonly name = "queryEntries";
|
|
59
|
+
readonly title = "Query content entries";
|
|
60
|
+
readonly description = "Queries content entries for a model, with filtering, sorting, search and pagination. Returns the latest revision of each entry (including unpublished changes). Call describeContentModel first to learn the field IDs used in `where` and `sort`.";
|
|
61
|
+
readonly inputSchema: z.ZodObject<{
|
|
62
|
+
modelId: z.ZodString;
|
|
63
|
+
where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
64
|
+
sort: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
search: z.ZodOptional<z.ZodString>;
|
|
66
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
after: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
readonly annotations: {
|
|
71
|
+
readOnlyHint: boolean;
|
|
72
|
+
};
|
|
73
|
+
readonly handler: typeof QueryEntriesToolHandlerImpl & {
|
|
74
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export declare const QueryEntriesTool: typeof QueryEntriesToolImpl & {
|
|
78
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
79
|
+
};
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { GetModelUseCase } from "../contentModel/GetModel/index.js";
|
|
4
|
+
import { ListLatestEntriesUseCase } from "../contentEntry/ListEntries/index.js";
|
|
5
|
+
import { CmsWhereMapper } from "../whereMapper/abstractions.js";
|
|
6
|
+
import { CmsSortMapper } from "../sortMapper/abstractions.js";
|
|
7
|
+
const MAX_LIMIT = 50;
|
|
8
|
+
const DEFAULT_LIMIT = 10;
|
|
9
|
+
const inputSchema = z.object({
|
|
10
|
+
modelId: z.string().describe("Model ID as returned by listContentModels."),
|
|
11
|
+
where: z.record(z.string(), z.unknown()).optional().describe("Flat filter object. Keys are `<fieldId>` for an exact match or `<fieldId>_<operator>` otherwise — e.g. { onSale: true, price_gt: 100, name_contains: 'desk', status: 'draft' }. Operators: _not, _in, _not_in, _lt, _lte, _gt, _gte, _contains, _not_contains, _startsWith, _not_startsWith, _between, _not_between. Mix the model's own fields with entry meta fields (id, entryId, status, createdOn, savedOn) freely — they are separated automatically. Use describeContentModel first so field IDs are real."),
|
|
12
|
+
sort: z.array(z.string()).optional().describe("Sort directives as `<fieldId>_ASC` or `<fieldId>_DESC` — e.g. ['price_DESC'] for a model field or ['savedOn_DESC'] for entry meta. Both forms are accepted; the distinction is handled automatically."),
|
|
13
|
+
search: z.string().optional().describe("Full-text search across the model's searchable fields."),
|
|
14
|
+
fields: z.array(z.string()).optional().describe("Restrict returned values to these field IDs. Use it whenever you only need a few fields — entries can be large."),
|
|
15
|
+
limit: z.number().int().positive().optional().describe(`Maximum entries to return. Defaults to ${DEFAULT_LIMIT}, capped at ${MAX_LIMIT}.`),
|
|
16
|
+
after: z.string().optional().describe("Pagination cursor from a previous call's meta.cursor.")
|
|
17
|
+
});
|
|
18
|
+
class QueryEntriesToolHandlerImpl {
|
|
19
|
+
constructor(getModel, listLatestEntries, whereMapper, sortMapper){
|
|
20
|
+
this.getModel = getModel;
|
|
21
|
+
this.listLatestEntries = listLatestEntries;
|
|
22
|
+
this.whereMapper = whereMapper;
|
|
23
|
+
this.sortMapper = sortMapper;
|
|
24
|
+
}
|
|
25
|
+
async execute(input) {
|
|
26
|
+
const modelResult = await this.getModel.execute(input.modelId);
|
|
27
|
+
if (modelResult.isFail()) throw new Error(`Unknown model "${input.modelId}": ${modelResult.error.message}. Call listContentModels for valid model IDs.`);
|
|
28
|
+
const model = modelResult.value;
|
|
29
|
+
const params = {
|
|
30
|
+
limit: Math.min(input.limit ?? DEFAULT_LIMIT, MAX_LIMIT)
|
|
31
|
+
};
|
|
32
|
+
if (input.where) {
|
|
33
|
+
const where = this.whereMapper.map({
|
|
34
|
+
fields: model.fields,
|
|
35
|
+
input: input.where
|
|
36
|
+
});
|
|
37
|
+
if (where) params.where = where;
|
|
38
|
+
}
|
|
39
|
+
if (input.sort?.length) {
|
|
40
|
+
const requested = input.sort;
|
|
41
|
+
const sort = this.sortMapper.map({
|
|
42
|
+
fields: model.fields,
|
|
43
|
+
input: requested
|
|
44
|
+
});
|
|
45
|
+
if (!sort || sort.length !== input.sort.length) throw new Error(`Could not read every sort directive in [${input.sort.join(", ")}]. Each one must be \`<fieldId>_ASC\` or \`<fieldId>_DESC\`, using a field ID from describeContentModel.`);
|
|
46
|
+
params.sort = sort;
|
|
47
|
+
}
|
|
48
|
+
if (input.search) params.search = input.search;
|
|
49
|
+
if (input.fields?.length) params.fields = input.fields;
|
|
50
|
+
if (input.after) params.after = input.after;
|
|
51
|
+
const result = await this.listLatestEntries.execute(model, params);
|
|
52
|
+
if (result.isFail()) throw new Error(`Could not query "${input.modelId}" entries: ${result.error.message}`);
|
|
53
|
+
const { entries, meta } = result.value;
|
|
54
|
+
return {
|
|
55
|
+
modelId: input.modelId,
|
|
56
|
+
entries: entries.map((entry)=>({
|
|
57
|
+
id: entry.id,
|
|
58
|
+
entryId: entry.entryId,
|
|
59
|
+
status: entry.status,
|
|
60
|
+
createdOn: entry.createdOn,
|
|
61
|
+
savedOn: entry.savedOn,
|
|
62
|
+
values: entry.values
|
|
63
|
+
})),
|
|
64
|
+
meta: {
|
|
65
|
+
totalCount: meta.totalCount,
|
|
66
|
+
hasMoreItems: meta.hasMoreItems,
|
|
67
|
+
cursor: meta.cursor
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const QueryEntriesToolHandler = AiSdkToolHandler.createImplementation({
|
|
73
|
+
implementation: QueryEntriesToolHandlerImpl,
|
|
74
|
+
dependencies: [
|
|
75
|
+
GetModelUseCase,
|
|
76
|
+
ListLatestEntriesUseCase,
|
|
77
|
+
CmsWhereMapper,
|
|
78
|
+
CmsSortMapper
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
class QueryEntriesToolImpl {
|
|
82
|
+
constructor(){
|
|
83
|
+
this.name = "queryEntries";
|
|
84
|
+
this.title = "Query content entries";
|
|
85
|
+
this.description = "Queries content entries for a model, with filtering, sorting, search and pagination. Returns the latest revision of each entry (including unpublished changes). Call describeContentModel first to learn the field IDs used in `where` and `sort`.";
|
|
86
|
+
this.inputSchema = inputSchema;
|
|
87
|
+
this.annotations = {
|
|
88
|
+
readOnlyHint: true
|
|
89
|
+
};
|
|
90
|
+
this.handler = QueryEntriesToolHandler;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const QueryEntriesTool = AiSdkToolDefinition.createImplementation({
|
|
94
|
+
implementation: QueryEntriesToolImpl,
|
|
95
|
+
dependencies: []
|
|
96
|
+
});
|
|
97
|
+
export { QueryEntriesTool };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=QueryEntriesTool.js.map
|