@webiny/api-headless-cms 0.0.0-unstable.7be00a75a9 → 0.0.0-unstable.7c2def32a7
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.d.ts +1 -1
- package/crud/contentEntry/entryDataValidation.js +43 -22
- 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/crud/contentModel/defaultFields.js +3 -2
- package/crud/contentModel/defaultFields.js.map +1 -1
- package/domain/contentModel/schemas.d.ts +10 -6
- package/domain/contentModel/schemas.js +6 -3
- 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 +2 -0
- package/exports/api/cms/entry.js +2 -0
- package/exports/api/cms/model.d.ts +4 -1
- package/exports/api/cms/model.js +2 -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 +6 -0
- package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
- package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +9 -5
- package/features/contentEntry/CreateEntry/CreateEntryRepository.js +13 -9
- package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +5 -3
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +5 -7
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +9 -5
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +13 -9
- 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 +9 -5
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +13 -9
- 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 +8 -4
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +12 -9
- 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 +8 -4
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +14 -9
- 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 +9 -5
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +12 -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 +4 -5
- 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/DuplicateEntry/feature.d.ts +4 -0
- 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/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +9 -7
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +12 -16
- 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 +9 -5
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +12 -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 +9 -5
- package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +12 -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 +9 -5
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +12 -9
- 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 +9 -5
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +12 -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 +9 -5
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +12 -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 +9 -5
- package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +12 -9
- 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 +9 -5
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +12 -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/GetSingletonEntry/GetSingletonEntryUseCase.js +1 -3
- package/features/contentEntry/GetSingletonEntry/GetSingletonEntryUseCase.js.map +1 -1
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.d.ts +9 -5
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +12 -9
- 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 +9 -5
- package/features/contentEntry/ListEntries/ListEntriesRepository.js +12 -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 +9 -5
- package/features/contentEntry/MoveEntry/MoveEntryRepository.js +12 -9
- package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +5 -3
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +4 -5
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
- package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +9 -5
- package/features/contentEntry/PublishEntry/PublishEntryRepository.js +13 -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 +11 -5
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +17 -10
- 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 +9 -5
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +13 -9
- 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 +9 -5
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +13 -9
- 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 +9 -5
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +13 -9
- 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/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +6 -9
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +7 -17
- 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/ensureItemIds.d.ts +13 -0
- package/features/contentEntry/ensureItemIds.js +22 -0
- package/features/contentEntry/ensureItemIds.js.map +1 -0
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +6 -2
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +10 -6
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +10 -6
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +49 -20
- 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 +10 -4
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +74 -32
- 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/ComponentMapGenerator/ComponentMapGenerator.d.ts +14 -0
- package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js +32 -0
- package/features/contentModel/ComponentMapGenerator/ComponentMapGenerator.js.map +1 -0
- package/features/contentModel/ComponentMapGenerator/abstractions.d.ts +8 -0
- package/features/contentModel/ComponentMapGenerator/abstractions.js +5 -0
- package/features/contentModel/ComponentMapGenerator/abstractions.js.map +1 -0
- package/features/contentModel/ComponentMapGenerator/feature.d.ts +4 -0
- package/features/contentModel/ComponentMapGenerator/feature.js +11 -0
- package/features/contentModel/ComponentMapGenerator/feature.js.map +1 -0
- package/features/contentModel/ComponentMapGenerator/index.d.ts +2 -0
- package/features/contentModel/ComponentMapGenerator/index.js +2 -0
- package/features/contentModel/ContentModelFeature.js +6 -0
- package/features/contentModel/ContentModelFeature.js.map +1 -1
- package/features/contentModel/CreateModel/CreateModelRepository.d.ts +4 -3
- package/features/contentModel/CreateModel/CreateModelRepository.js +6 -5
- package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +4 -3
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +6 -5
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
- package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +6 -4
- package/features/contentModel/DeleteModel/DeleteModelRepository.js +10 -6
- 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/RefModelsGenerator/RefModelsGenerator.d.ts +19 -0
- package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js +56 -0
- package/features/contentModel/RefModelsGenerator/RefModelsGenerator.js.map +1 -0
- package/features/contentModel/RefModelsGenerator/abstractions.d.ts +11 -0
- package/features/contentModel/RefModelsGenerator/abstractions.js +5 -0
- package/features/contentModel/RefModelsGenerator/abstractions.js.map +1 -0
- package/features/contentModel/RefModelsGenerator/feature.d.ts +4 -0
- package/features/contentModel/RefModelsGenerator/feature.js +11 -0
- package/features/contentModel/RefModelsGenerator/feature.js.map +1 -0
- package/features/contentModel/RefModelsGenerator/index.d.ts +2 -0
- package/features/contentModel/RefModelsGenerator/index.js +2 -0
- package/features/contentModel/UpdateModel/UpdateModelRepository.d.ts +9 -4
- package/features/contentModel/UpdateModel/UpdateModelRepository.js +17 -9
- package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
- package/features/contentModel/UpdateModel/UpdateModelUseCase.js +2 -2
- package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
- package/features/contentModel/UpdateModel/abstractions.d.ts +1 -1
- package/features/contentModel/UpdateModel/abstractions.js.map +1 -1
- package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.d.ts +16 -0
- package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js +54 -0
- package/features/contentModel/ValuesSelectionGenerator/ValuesSelectionGenerator.js.map +1 -0
- package/features/contentModel/ValuesSelectionGenerator/abstractions.d.ts +8 -0
- package/features/contentModel/ValuesSelectionGenerator/abstractions.js +5 -0
- package/features/contentModel/ValuesSelectionGenerator/abstractions.js.map +1 -0
- package/features/contentModel/ValuesSelectionGenerator/feature.d.ts +4 -0
- package/features/contentModel/ValuesSelectionGenerator/feature.js +11 -0
- package/features/contentModel/ValuesSelectionGenerator/feature.js.map +1 -0
- package/features/contentModel/ValuesSelectionGenerator/index.d.ts +1 -0
- package/features/contentModel/ValuesSelectionGenerator/index.js +1 -0
- 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 +10 -4
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +18 -14
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +3 -1
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +2 -3
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +11 -5
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +16 -10
- 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 +9 -5
- package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +13 -10
- package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js.map +1 -1
- package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.d.ts +3 -1
- package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js +4 -5
- package/features/contentModelGroup/UpdateGroup/UpdateGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/UpdateGroup/abstractions.d.ts +1 -1
- package/features/contentModelGroup/UpdateGroup/abstractions.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/feature.js +2 -0
- package/features/graphql/feature.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 +26 -0
- package/features/graphql/fields/base/AssetToGraphQL.js +153 -0
- package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -0
- package/features/graphql/fields/base/DynamicZoneToGraphQL.js +12 -2
- package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/ObjectToGraphQL.js +8 -5
- package/features/graphql/fields/base/ObjectToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/RefToGraphQL.d.ts +1 -1
- package/features/graphql/fields/base/RefToGraphQL.js +25 -9
- 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 +13 -0
- package/features/modelBuilder/abstractions.js.map +1 -1
- package/features/modelBuilder/feature.js +3 -8
- package/features/modelBuilder/feature.js.map +1 -1
- package/features/modelBuilder/fields/AssetFieldType.d.ts +20 -0
- package/features/modelBuilder/fields/AssetFieldType.js +46 -0
- package/features/modelBuilder/fields/AssetFieldType.js.map +1 -0
- package/features/modelBuilder/fields/BaseFieldBuilder.d.ts +3 -1
- package/features/modelBuilder/fields/BaseFieldBuilder.js +4 -0
- package/features/modelBuilder/fields/BaseFieldBuilder.js.map +1 -1
- package/features/modelBuilder/fields/DataFieldBuilder.d.ts +71 -18
- package/features/modelBuilder/fields/DataFieldBuilder.js +11 -1
- 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/DynamicZoneFieldType.d.ts +1 -0
- package/features/modelBuilder/fields/DynamicZoneFieldType.js +10 -9
- package/features/modelBuilder/fields/DynamicZoneFieldType.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/UiAlertFieldType.js +2 -1
- package/features/modelBuilder/fields/UiAlertFieldType.js.map +1 -1
- package/features/modelBuilder/fields/UiSeparatorFieldType.js +2 -1
- package/features/modelBuilder/fields/UiSeparatorFieldType.js.map +1 -1
- package/features/modelBuilder/fields/UiTabsFieldType.d.ts +2 -1
- package/features/modelBuilder/fields/UiTabsFieldType.js +6 -3
- package/features/modelBuilder/fields/UiTabsFieldType.js.map +1 -1
- package/features/modelBuilder/fields/fieldTypeValidator.d.ts +5 -3
- package/features/modelBuilder/fields/resolveAssetUrl.d.ts +35 -0
- package/features/modelBuilder/fields/resolveAssetUrl.js +26 -0
- package/features/modelBuilder/fields/resolveAssetUrl.js.map +1 -0
- package/features/modelBuilder/index.d.ts +1 -1
- package/features/modelBuilder/models/BaseModelBuilder.d.ts +3 -1
- package/features/modelBuilder/models/BaseModelBuilder.js +7 -0
- package/features/modelBuilder/models/BaseModelBuilder.js.map +1 -1
- 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 +13 -1
- package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
- package/features/modelBuilder/models/PublicModelBuilder.js +2 -1
- package/features/modelBuilder/models/PublicModelBuilder.js.map +1 -1
- package/features/runtimeTenant/RuntimeTenant.d.ts +13 -0
- package/features/runtimeTenant/RuntimeTenant.js +22 -0
- package/features/runtimeTenant/RuntimeTenant.js.map +1 -0
- package/features/runtimeTenant/abstractions.d.ts +11 -0
- package/features/runtimeTenant/abstractions.js +5 -0
- package/features/runtimeTenant/abstractions.js.map +1 -0
- package/features/runtimeTenant/index.d.ts +2 -0
- package/features/runtimeTenant/index.js +2 -0
- 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/sortMapper/SortMapper.js +2 -5
- package/features/sortMapper/SortMapper.js.map +1 -1
- package/features/storage/fields/ObjectStorageTransform.js +27 -7
- package/features/storage/fields/ObjectStorageTransform.js.map +1 -1
- 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/PatternValidator.js +1 -1
- package/features/validation/validators/PatternValidator.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/features/whereMapper/WhereMapper.js +7 -5
- package/features/whereMapper/WhereMapper.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +15 -5
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +8 -2
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.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/fieldConverters/index.d.ts +1 -1
- 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 +6 -41
- 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 +5 -4
- package/graphql/schema/cms/getEntryResolver.js.map +1 -1
- package/graphql/schema/cms/getModelResolver.d.ts +35 -0
- package/graphql/schema/cms/getModelResolver.js +49 -0
- package/graphql/schema/cms/getModelResolver.js.map +1 -0
- package/graphql/schema/cms/helpers/buildFieldsSelection.js +9 -2
- package/graphql/schema/cms/helpers/buildFieldsSelection.js.map +1 -1
- package/graphql/schema/cms/helpers/expandFieldWildcards.d.ts +2 -0
- package/graphql/schema/cms/helpers/expandFieldWildcards.js +13 -0
- package/graphql/schema/cms/helpers/expandFieldWildcards.js.map +1 -0
- 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/helpers/index.d.ts +1 -0
- package/graphql/schema/cms/helpers/index.js +1 -0
- package/graphql/schema/cms/helpers/transformWhereToNested.js +39 -17
- package/graphql/schema/cms/helpers/transformWhereToNested.js.map +1 -1
- package/graphql/schema/cms/helpers.d.ts +1 -0
- package/graphql/schema/cms/helpers.js +1 -0
- package/graphql/schema/cms/listEntriesResolver.js +5 -4
- 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 +9 -0
- package/graphql/schema/cms/resolvers/getModel.js +22 -0
- package/graphql/schema/cms/resolvers/getModel.js.map +1 -0
- package/graphql/schema/cms/resolvers/index.d.ts +1 -0
- package/graphql/schema/cms/resolvers/index.js +1 -0
- 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 +6 -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 +10 -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 +70 -16
- 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/createSingularSDL.js +2 -0
- package/graphql/schema/createSingularSDL.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 -6
- package/index.js +4 -22
- package/legacy/abstractions.js.map +1 -1
- package/package.json +27 -33
- 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/CmsModelPlugin.js +2 -1
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/plugins/index.d.ts +0 -1
- package/plugins/index.js +0 -1
- package/types/fields/dynamicZoneField.d.ts +3 -2
- package/types/index.d.ts +0 -1
- package/types/model.d.ts +6 -0
- package/types/modelField.d.ts +14 -1
- package/types/types.d.ts +11 -290
- package/types/types.js.map +1 -1
- package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.d.ts +28 -0
- package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js +324 -0
- package/utils/contentModelToJsonSchema/CmsModelToJsonSchemaConverter.js.map +1 -0
- package/utils/contentModelToJsonSchema/index.d.ts +2 -0
- package/utils/contentModelToJsonSchema/index.js +1 -0
- package/utils/contentModelToJsonSchema/types.d.ts +24 -0
- 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/index.d.ts +1 -0
- package/utils/index.js +1 -0
- 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 -334
- 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/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/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 -24
- package/graphql/schema/cms/index.js.map +0 -1
- package/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 → utils/contentModelToJsonSchema/types.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/graphql/fields/base/RefToGraphQL.js","sources":["../../../../../src/features/graphql/fields/base/RefToGraphQL.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsModelFieldToGraphQL } from \"../abstractions/CmsModelFieldToGraphQL.js\";\nimport type {\n CmsContext,\n CmsEntry,\n CmsModel,\n CmsModelField,\n CmsModelFieldType,\n CmsModelFieldDefinition\n} from \"~/types/index.js\";\nimport type { GraphQLSchemaDefinition } from \"@webiny/handler-graphql/types.js\";\nimport { createTypeName } from \"~/utils/createTypeName.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createGraphQLInputField } from \"./utils/createGraphQLInputField.js\";\nimport { GetModelUseCase } from \"~/features/contentModel/GetModel/index.js\";\nimport { GetPublishedEntriesByIdsUseCase } from \"~/features/contentEntry/GetPublishedEntriesByIds/index.js\";\nimport { GetLatestEntriesByIdsUseCase } from \"~/features/contentEntry/GetLatestEntriesByIds/index.js\";\n\ninterface RefFieldValue {\n /**\n * `id` is optional for backwards compatibility with records created before this property was introduced.\n */\n id?: string;\n entryId: string;\n modelId: string;\n}\n\nconst createUnionTypeName = (model: CmsModel, field: CmsModelField) => {\n return `${model.singularApiName}_${createTypeName(field.fieldId)}`;\n};\n\nconst createListFilters = (fieldId: string): string => {\n return `\n ${fieldId}: RefFieldWhereInput\n `;\n};\n\nconst createFilteringTypeDef = () => {\n return `\n input RefFieldWhereInput {\n id: String\n id_not: String\n id_in: [String!]\n id_not_in: [String]\n entryId: String\n entryId_not: String\n entryId_in: [String!]\n entryId_not_in: [String!]\n modelId: String\n modelId_not: String\n modelId_in: [String!]\n modelId_not_in: [String!]\n }\n `;\n};\n\nconst appendTypename = (entries: CmsEntry[], typename: string): CmsEntry[] => {\n return entries.map(item => {\n return {\n ...item,\n __typename: typename\n };\n });\n};\n\nconst getFieldModels = (field: CmsModelField): Pick<CmsModel, \"modelId\">[] => {\n if (!field.settings || Array.isArray(field.settings.models) === false) {\n return [];\n }\n return field.settings.models as Pick<CmsModel, \"modelId\">[];\n};\n\nconst modelIdToTypeName = new Map<string, string>();\n\ninterface GetModelParams {\n models: CmsModel[];\n modelId: string;\n}\n\nconst getModel = (params: GetModelParams): CmsModel => {\n const { models, modelId } = params;\n const model = models.find(item => item.modelId === modelId);\n if (model) {\n return model;\n }\n throw new WebinyError(\n `Could not find model with ID \"${modelId}\" in the list of models.`,\n \"MODEL_NOT_FOUND\",\n { modelId }\n );\n};\n\nconst getModelSingularApiName = (params: GetModelParams): string => {\n return getModel(params).singularApiName;\n};\n\nclass ReadApi implements CmsModelFieldToGraphQL.ReadApi {\n public createTypeField({\n model,\n field,\n models\n }: CmsModelFieldToGraphQL.TypeFieldParams): CmsModelFieldDefinition {\n const fieldModels = field.settings?.models || [];\n const gqlType =\n fieldModels.length > 1\n ? createUnionTypeName(model, field)\n : getModelSingularApiName({ models, modelId: fieldModels[0].modelId });\n const typeDefs =\n fieldModels.length > 1\n ? `union ${gqlType} = ${getFieldModels(field)\n .map(({ modelId }) => getModelSingularApiName({ models, modelId }))\n .join(\" | \")}`\n : \"\";\n\n return {\n fields:\n field.fieldId +\n `(populate: Boolean = true): ${field.list ? `[${gqlType}!]` : gqlType}`,\n typeDefs\n };\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createResolver({\n field,\n models\n }: CmsModelFieldToGraphQL.ResolverParams): CmsModelFieldToGraphQL.Resolver {\n const fieldModels = field.settings?.models || [];\n for (const item of fieldModels) {\n modelIdToTypeName.set(\n item.modelId,\n getModelSingularApiName({ models, modelId: item.modelId })\n );\n }\n\n const getValue = (parent: any): RefFieldValue | RefFieldValue[] => {\n if (parent.values) {\n return parent.values[field.fieldId];\n }\n return parent[field.fieldId];\n };\n\n /* @ts-expect-error Mixed return types for createResolver. */\n return async (parent: CmsEntry, args: any, context: CmsContext) => {\n const { cms, container } = context;\n\n const getModel = container.resolve(GetModelUseCase);\n const getPublishedByIds = container.resolve(GetPublishedEntriesByIdsUseCase);\n const getLatestByIds = container.resolve(GetLatestEntriesByIdsUseCase);\n\n const initialValue = getValue(parent);\n\n if (!initialValue) {\n return null;\n }\n if (args.populate === false) {\n return initialValue;\n }\n\n if (field.list) {\n const referenceFieldValues = initialValue as RefFieldValue[];\n if (\n Array.isArray(referenceFieldValues) === false ||\n referenceFieldValues.length === 0\n ) {\n return [];\n }\n\n const entriesByModel = referenceFieldValues.reduce(\n (collection, ref) => {\n if (!collection[ref.modelId]) {\n collection[ref.modelId] = [];\n } else if (collection[ref.modelId].includes(ref.entryId) === true) {\n return collection;\n }\n collection[ref.modelId].push(ref.entryId);\n return collection;\n },\n {} as Record<string, string[]>\n );\n\n const getters = Object.keys(entriesByModel).map(async modelId => {\n const idList = entriesByModel[modelId];\n const modelResult = await getModel.execute(modelId);\n const model = modelResult.value;\n\n let entries: CmsEntry[];\n if (cms.READ) {\n const getPublishedResult = await getPublishedByIds.execute(model, idList);\n entries = getPublishedResult.value;\n } else {\n const latestByIsResult = await getLatestByIds.execute(model, idList);\n entries = latestByIsResult.value;\n }\n return appendTypename(entries, modelIdToTypeName.get(modelId)!);\n });\n\n const references = await Promise.all(getters).then((results: CmsEntry[][]) => {\n return results.reduce((result, item) => {\n return result.concat(item);\n }, []);\n });\n\n return referenceFieldValues\n .map(v => {\n return references.find(ref => ref.entryId === v.entryId);\n })\n .filter(Boolean);\n }\n\n const value = initialValue as RefFieldValue;\n const modelResult = await getModel.execute(value.modelId);\n const model = modelResult.value;\n\n let revisions: CmsEntry[];\n if (cms.READ) {\n const publishedByIdsResult = await getPublishedByIds.execute(model, [\n value.entryId\n ]);\n revisions = publishedByIdsResult.value;\n } else {\n const latestByIdsResult = await getLatestByIds.execute(model, [value.entryId]);\n revisions = latestByIdsResult.value;\n }\n\n if (!revisions || revisions.length === 0) {\n return null;\n }\n return {\n ...revisions[0],\n __typename: modelIdToTypeName.get(value.modelId)\n };\n };\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: createFilteringTypeDef(),\n resolvers: {}\n };\n }\n}\n\nclass ManageApi implements CmsModelFieldToGraphQL.ManageApi {\n public createTypeField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n if (field.list) {\n return `${field.fieldId}: [RefField!]`;\n }\n return `${field.fieldId}: RefField`;\n }\n\n public createInputField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n return createGraphQLInputField(field, \"RefFieldInput\");\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: /* GraphQL */ `\n type RefField {\n modelId: String!\n entryId: ID!\n id: ID!\n }\n\n input RefFieldInput {\n modelId: String!\n id: RevisionId!\n }\n\n ${createFilteringTypeDef()}\n `,\n resolvers: {\n RefField: {\n entryId: (parent: RefFieldValue) => {\n const { id } = parseIdentifier(parent.entryId || parent.id);\n return id;\n },\n id: (parent: RefFieldValue) => {\n return parent.id || parent.entryId;\n }\n }\n }\n };\n }\n}\n\nclass RefToGraphQL implements CmsModelFieldToGraphQL.Interface {\n public readonly read = new ReadApi();\n public readonly manage = new ManageApi();\n\n public readonly fieldType: CmsModelFieldType = \"ref\";\n public readonly isSearchable: boolean = true;\n public readonly isSortable: boolean = false;\n public readonly isFullTextSearchable: boolean = false;\n\n public getReadApi(): CmsModelFieldToGraphQL.ReadApi {\n return this.read;\n }\n\n public getManageApi(): CmsModelFieldToGraphQL.ManageApi {\n return this.manage;\n }\n}\n\nexport const RefFieldToGraphQL = CmsModelFieldToGraphQL.createImplementation({\n implementation: RefToGraphQL,\n dependencies: []\n});\n"],"names":["createUnionTypeName","model","field","createTypeName","createListFilters","fieldId","createFilteringTypeDef","appendTypename","entries","typename","item","getFieldModels","Array","modelIdToTypeName","Map","getModel","params","models","modelId","WebinyError","getModelSingularApiName","ReadApi","fieldModels","gqlType","typeDefs","getValue","parent","args","context","cms","container","GetModelUseCase","getPublishedByIds","GetPublishedEntriesByIdsUseCase","getLatestByIds","GetLatestEntriesByIdsUseCase","initialValue","referenceFieldValues","entriesByModel","collection","ref","getters","Object","idList","modelResult","getPublishedResult","latestByIsResult","references","Promise","results","result","v","Boolean","value","revisions","publishedByIdsResult","latestByIdsResult","ManageApi","createGraphQLInputField","id","parseIdentifier","RefToGraphQL","RefFieldToGraphQL","CmsModelFieldToGraphQL"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"features/graphql/fields/base/RefToGraphQL.js","sources":["../../../../../src/features/graphql/fields/base/RefToGraphQL.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsModelFieldToGraphQL } from \"../abstractions/CmsModelFieldToGraphQL.js\";\nimport type {\n CmsContext,\n CmsEntry,\n CmsModel,\n CmsModelField,\n CmsModelFieldType,\n CmsModelFieldDefinition\n} from \"~/types/index.js\";\nimport type { GraphQLSchemaDefinition } from \"@webiny/api-graphql/types.js\";\nimport { createTypeName } from \"~/utils/createTypeName.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createGraphQLInputField } from \"./utils/createGraphQLInputField.js\";\nimport { HeadlessCmsEndpointConfig } from \"~/HeadlessCmsEndpointConfig.js\";\nimport { GetModelUseCase } from \"~/features/contentModel/GetModel/index.js\";\nimport { GetPublishedEntriesByIdsUseCase } from \"~/features/contentEntry/GetPublishedEntriesByIds/index.js\";\nimport { GetLatestEntriesByIdsUseCase } from \"~/features/contentEntry/GetLatestEntriesByIds/index.js\";\nimport { Logger } from \"@webiny/api-core/features/logger/index.js\";\n\ninterface RefFieldValue {\n /**\n * `id` is optional for backwards compatibility with records created before this property was introduced.\n */\n id?: string;\n entryId: string;\n modelId: string;\n}\n\nconst createUnionTypeName = (model: CmsModel, field: CmsModelField) => {\n return `${model.singularApiName}_${createTypeName(field.fieldId)}`;\n};\n\nconst createListFilters = (fieldId: string): string => {\n return `\n ${fieldId}: RefFieldWhereInput\n `;\n};\n\nconst createFilteringTypeDef = () => {\n return `\n input RefFieldWhereInput {\n id: String\n id_not: String\n id_in: [String!]\n id_not_in: [String]\n entryId: String\n entryId_not: String\n entryId_in: [String!]\n entryId_not_in: [String!]\n modelId: String\n modelId_not: String\n modelId_in: [String!]\n modelId_not_in: [String!]\n }\n `;\n};\n\nconst appendTypename = (entries: CmsEntry[], typename: string): CmsEntry[] => {\n return entries.map(item => {\n return {\n ...item,\n __typename: typename\n };\n });\n};\n\nconst getFieldModels = (field: CmsModelField): Pick<CmsModel, \"modelId\">[] => {\n if (!field.settings || Array.isArray(field.settings.models) === false) {\n return [];\n }\n return field.settings.models as Pick<CmsModel, \"modelId\">[];\n};\n\nconst modelIdToTypeName = new Map<string, string>();\n\ninterface GetModelParams {\n models: CmsModel[];\n modelId: string;\n}\n\nconst getModel = (params: GetModelParams): CmsModel => {\n const { models, modelId } = params;\n const model = models.find(item => item.modelId === modelId);\n if (model) {\n return model;\n }\n throw new WebinyError(\n `Could not find model with ID \"${modelId}\" in the list of models.`,\n \"MODEL_NOT_FOUND\",\n { modelId }\n );\n};\n\nconst getModelSingularApiName = (params: GetModelParams): string => {\n return getModel(params).singularApiName;\n};\n\nclass ReadApi implements CmsModelFieldToGraphQL.ReadApi {\n public createTypeField({\n model,\n field,\n models\n }: CmsModelFieldToGraphQL.TypeFieldParams): CmsModelFieldDefinition {\n const fieldModels = field.settings?.models || [];\n const gqlType =\n fieldModels.length > 1\n ? createUnionTypeName(model, field)\n : getModelSingularApiName({ models, modelId: fieldModels[0].modelId });\n const typeDefs =\n fieldModels.length > 1\n ? `union ${gqlType} = ${getFieldModels(field)\n .map(({ modelId }) => getModelSingularApiName({ models, modelId }))\n .join(\" | \")}`\n : \"\";\n\n return {\n fields:\n field.fieldId +\n `(populate: Boolean = true): ${field.list ? `[${gqlType}!]` : gqlType}`,\n typeDefs\n };\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createResolver({\n field,\n models\n }: CmsModelFieldToGraphQL.ResolverParams): CmsModelFieldToGraphQL.Resolver {\n const fieldModels = field.settings?.models || [];\n for (const item of fieldModels) {\n modelIdToTypeName.set(\n item.modelId,\n getModelSingularApiName({ models, modelId: item.modelId })\n );\n }\n\n const getValue = (parent: any): RefFieldValue | RefFieldValue[] => {\n if (parent.values) {\n return parent.values[field.fieldId];\n }\n return parent[field.fieldId];\n };\n\n return async (parent: CmsEntry, args: any, context: CmsContext) => {\n const { container } = context;\n const isReadEndpoint = container.resolve(HeadlessCmsEndpointConfig).type === \"read\";\n\n const getModel = container.resolve(GetModelUseCase);\n const getPublishedByIds = container.resolve(GetPublishedEntriesByIdsUseCase);\n const getLatestByIds = container.resolve(GetLatestEntriesByIdsUseCase);\n const logger = container.resolve(Logger);\n\n const initialValue = getValue(parent);\n\n if (!initialValue) {\n return null;\n }\n if (args.populate === false) {\n return initialValue;\n }\n\n if (field.list) {\n const referenceFieldValues = initialValue as RefFieldValue[];\n if (\n Array.isArray(referenceFieldValues) === false ||\n referenceFieldValues.length === 0\n ) {\n return [];\n }\n\n const entriesByModel = referenceFieldValues.reduce(\n (collection, ref) => {\n if (!collection[ref.modelId]) {\n collection[ref.modelId] = [];\n } else if (collection[ref.modelId].includes(ref.entryId) === true) {\n return collection;\n }\n collection[ref.modelId].push(ref.entryId);\n return collection;\n },\n {} as Record<string, string[]>\n );\n\n const getters = Object.keys(entriesByModel).map(async modelId => {\n const idList = entriesByModel[modelId];\n const modelResult = await getModel.execute(modelId);\n if (modelResult.isFail()) {\n logger.error(\n { error: modelResult.error },\n \"Could not load the referenced model.\"\n );\n return [];\n }\n const model = modelResult.value;\n\n let entries: CmsEntry[] = [];\n if (isReadEndpoint) {\n const getPublishedResult = await getPublishedByIds.execute(model, idList);\n if (getPublishedResult.isOk()) {\n entries = getPublishedResult.value;\n }\n } else {\n const latestByIsResult = await getLatestByIds.execute(model, idList);\n if (latestByIsResult.isOk()) {\n entries = latestByIsResult.value;\n }\n }\n return appendTypename(entries, modelIdToTypeName.get(modelId)!);\n });\n\n const references = await Promise.all(getters).then((results: CmsEntry[][]) => {\n return results.reduce((result, item) => {\n return result.concat(item);\n }, []);\n });\n\n return referenceFieldValues\n .map(v => {\n return references.find(ref => ref.entryId === v.entryId);\n })\n .filter(Boolean);\n }\n\n const value = initialValue as RefFieldValue;\n const modelResult = await getModel.execute(value.modelId);\n if (modelResult.isFail()) {\n logger.error({ error: modelResult.error }, \"Could not load the referenced model.\");\n return null;\n }\n const model = modelResult.value;\n\n let revisions: CmsEntry[] = [];\n if (isReadEndpoint) {\n const publishedByIdsResult = await getPublishedByIds.execute(model, [\n value.entryId\n ]);\n if (publishedByIdsResult.isOk()) {\n revisions = publishedByIdsResult.value;\n }\n } else {\n const latestByIdsResult = await getLatestByIds.execute(model, [value.entryId]);\n if (latestByIdsResult.isOk()) {\n revisions = latestByIdsResult.value;\n }\n }\n\n if (!revisions || revisions.length === 0) {\n return null;\n }\n return {\n ...revisions[0],\n __typename: modelIdToTypeName.get(value.modelId)\n };\n };\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: createFilteringTypeDef(),\n resolvers: {}\n };\n }\n}\n\nclass ManageApi implements CmsModelFieldToGraphQL.ManageApi {\n public createTypeField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n if (field.list) {\n return `${field.fieldId}: [RefField!]`;\n }\n return `${field.fieldId}: RefField`;\n }\n\n public createInputField({ field }: CmsModelFieldToGraphQL.TypeFieldParams): string {\n return createGraphQLInputField(field, \"RefFieldInput\");\n }\n\n public createListFilters({ field }: CmsModelFieldToGraphQL.ListFiltersParams): string {\n return createListFilters(field.fieldId);\n }\n\n public createSchema(): GraphQLSchemaDefinition<CmsContext> {\n return {\n typeDefs: /* GraphQL */ `\n type RefField {\n modelId: String!\n entryId: ID!\n id: ID!\n }\n\n input RefFieldInput {\n modelId: String!\n id: RevisionId!\n }\n\n ${createFilteringTypeDef()}\n `,\n resolvers: {\n RefField: {\n entryId: (parent: RefFieldValue) => {\n const { id } = parseIdentifier(parent.entryId || parent.id);\n return id;\n },\n id: (parent: RefFieldValue) => {\n return parent.id || parent.entryId;\n }\n }\n }\n };\n }\n}\n\nclass RefToGraphQL implements CmsModelFieldToGraphQL.Interface {\n public readonly read = new ReadApi();\n public readonly manage = new ManageApi();\n\n public readonly fieldType: CmsModelFieldType = \"ref\";\n public readonly isSearchable: boolean = true;\n public readonly isSortable: boolean = false;\n public readonly isFullTextSearchable: boolean = false;\n\n public getReadApi(): CmsModelFieldToGraphQL.ReadApi {\n return this.read;\n }\n\n public getManageApi(): CmsModelFieldToGraphQL.ManageApi {\n return this.manage;\n }\n}\n\nexport const RefFieldToGraphQL = CmsModelFieldToGraphQL.createImplementation({\n implementation: RefToGraphQL,\n dependencies: []\n});\n"],"names":["createUnionTypeName","model","field","createTypeName","createListFilters","fieldId","createFilteringTypeDef","appendTypename","entries","typename","item","getFieldModels","Array","modelIdToTypeName","Map","getModel","params","models","modelId","WebinyError","getModelSingularApiName","ReadApi","fieldModels","gqlType","typeDefs","getValue","parent","args","context","container","isReadEndpoint","HeadlessCmsEndpointConfig","GetModelUseCase","getPublishedByIds","GetPublishedEntriesByIdsUseCase","getLatestByIds","GetLatestEntriesByIdsUseCase","logger","Logger","initialValue","referenceFieldValues","entriesByModel","collection","ref","getters","Object","idList","modelResult","getPublishedResult","latestByIsResult","references","Promise","results","result","v","Boolean","value","revisions","publishedByIdsResult","latestByIdsResult","ManageApi","createGraphQLInputField","id","parseIdentifier","RefToGraphQL","RefFieldToGraphQL","CmsModelFieldToGraphQL"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/graphql/fields/base/richText/richTextResolver.js","sources":["../../../../../../src/features/graphql/fields/base/richText/richTextResolver.ts"],"sourcesContent":["import type { GraphQLFieldResolver } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"features/graphql/fields/base/richText/richTextResolver.js","sources":["../../../../../../src/features/graphql/fields/base/richText/richTextResolver.ts"],"sourcesContent":["import type { GraphQLFieldResolver } from \"@webiny/api-graphql/types.js\";\nimport type { CmsModelField } from \"~/types/index.js\";\n\ninterface ResolverArgs {\n format?: string;\n}\n\ninterface RichTextContents {\n state: string;\n html: string;\n}\n\nexport const createRichTextResolver = (\n field: CmsModelField\n): GraphQLFieldResolver<any, ResolverArgs> => {\n return async (entry, args) => {\n const rawValue = entry[field.fieldId] as RichTextContents;\n const outputFormat = args.format;\n\n /* If `lexical` state is requested explicitly. */\n if (outputFormat === \"lexical\") {\n if (field.list) {\n return (rawValue as unknown as RichTextContents[]).map(value => value.state);\n }\n return rawValue?.state ?? null;\n }\n\n /* Otherwise return HTML. */\n if (field.list) {\n return (rawValue as unknown as RichTextContents[]).map(value => value?.html ?? null);\n }\n\n return rawValue?.html ?? null;\n };\n};\n"],"names":["createRichTextResolver","field","entry","args","rawValue","outputFormat","value"],"mappings":"AAYO,MAAMA,yBAAyB,CAClCC,QAEO,OAAOC,OAAOC;QACjB,MAAMC,WAAWF,KAAK,CAACD,MAAM,OAAO,CAAC;QACrC,MAAMI,eAAeF,KAAK,MAAM;QAGhC,IAAIE,AAAiB,cAAjBA,cAA4B;YAC5B,IAAIJ,MAAM,IAAI,EACV,OAAQG,SAA2C,GAAG,CAACE,CAAAA,QAASA,MAAM,KAAK;YAE/E,OAAOF,UAAU,SAAS;QAC9B;QAGA,IAAIH,MAAM,IAAI,EACV,OAAQG,SAA2C,GAAG,CAACE,CAAAA,QAASA,OAAO,QAAQ;QAGnF,OAAOF,UAAU,QAAQ;IAC7B"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { PrivateModelBuilder } from "./models/PrivateModelBuilder.js";
|
|
2
2
|
import type { PublicModelBuilder } from "./models/PublicModelBuilder.js";
|
|
3
3
|
import type { IModelBuilderPrivateInput, IModelBuilderPublicInput } from "./models/ModelBuilder.js";
|
|
4
|
+
/**
|
|
5
|
+
* Augmentable model settings interface.
|
|
6
|
+
* External packages can extend this via module augmentation.
|
|
7
|
+
*/
|
|
8
|
+
export interface IModelSettings {
|
|
9
|
+
aiEntryWizard?: boolean;
|
|
10
|
+
previewPath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Set via `builder.private({ lifecycleEvents: false })`. Only honored for private models.
|
|
13
|
+
*/
|
|
14
|
+
lifecycleEvents?: boolean;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* Augmentable field builder registry. Provides access to all registered field types.
|
|
6
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/modelBuilder/abstractions.js","sources":["../../../src/features/modelBuilder/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { PrivateModelBuilder } from \"./models/PrivateModelBuilder.js\";\nimport type { PublicModelBuilder } from \"./models/PublicModelBuilder.js\";\nimport type { IModelBuilderPrivateInput, IModelBuilderPublicInput } from \"./models/ModelBuilder.js\";\n\n/**\n * Augmentable field builder registry. Provides access to all registered field types.\n */\nexport interface IFieldBuilderRegistry {\n /**\n * Mark the next field creation as an extension.\n * When extending, the registry will create a temporary builder marked with _extendMode,\n * and BaseModelBuilder will merge its operations into the existing field.\n */\n extend(): this;\n\n // Field types will be added via module augmentation by field type implementations\n // Example: text(): ITextFieldBuilder;\n}\n\n/**\n * @internal Do not export this abstraction. We don't want external developers to use it.\n */\nexport const FieldBuilderRegistry =\n createAbstraction<FieldBuilderRegistry.Interface>(\"FieldBuilderRegistry\");\n\nexport namespace FieldBuilderRegistry {\n export interface Interface extends IFieldBuilderRegistry {}\n}\n\n/**\n * Unified Model abstraction\n * External developers implement this to provide both public and private models\n */\n\nexport interface IModelBuilder {\n private(input: IModelBuilderPrivateInput): PrivateModelBuilder;\n public(input: IModelBuilderPublicInput): PublicModelBuilder;\n}\n\nexport interface IModelFactory {\n execute(builder: IModelBuilder): Promise<PrivateModelBuilder[] | PublicModelBuilder[]>;\n}\n\n/** Provide code-defined content models. */\nexport const ModelFactory = createAbstraction<IModelFactory>(\"Cms/ModelFactory\");\nexport namespace ModelFactory {\n export type Interface = IModelFactory;\n export type Return = Promise<PrivateModelBuilder[] | PublicModelBuilder[]>;\n export type Builder = IModelBuilder;\n export type FieldBuilder = FieldBuilderRegistry.Interface;\n}\n"],"names":["FieldBuilderRegistry","createAbstraction","ModelFactory"],"mappings":";
|
|
1
|
+
{"version":3,"file":"features/modelBuilder/abstractions.js","sources":["../../../src/features/modelBuilder/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { PrivateModelBuilder } from \"./models/PrivateModelBuilder.js\";\nimport type { PublicModelBuilder } from \"./models/PublicModelBuilder.js\";\nimport type { IModelBuilderPrivateInput, IModelBuilderPublicInput } from \"./models/ModelBuilder.js\";\n\n/**\n * Augmentable model settings interface.\n * External packages can extend this via module augmentation.\n */\nexport interface IModelSettings {\n aiEntryWizard?: boolean;\n previewPath?: string;\n /**\n * Set via `builder.private({ lifecycleEvents: false })`. Only honored for private models.\n */\n lifecycleEvents?: boolean;\n [key: string]: any;\n}\n\n/**\n * Augmentable field builder registry. Provides access to all registered field types.\n */\nexport interface IFieldBuilderRegistry {\n /**\n * Mark the next field creation as an extension.\n * When extending, the registry will create a temporary builder marked with _extendMode,\n * and BaseModelBuilder will merge its operations into the existing field.\n */\n extend(): this;\n\n // Field types will be added via module augmentation by field type implementations\n // Example: text(): ITextFieldBuilder;\n}\n\n/**\n * @internal Do not export this abstraction. We don't want external developers to use it.\n */\nexport const FieldBuilderRegistry =\n createAbstraction<FieldBuilderRegistry.Interface>(\"FieldBuilderRegistry\");\n\nexport namespace FieldBuilderRegistry {\n export interface Interface extends IFieldBuilderRegistry {}\n}\n\n/**\n * Unified Model abstraction\n * External developers implement this to provide both public and private models\n */\n\nexport interface IModelBuilder {\n private(input: IModelBuilderPrivateInput): PrivateModelBuilder;\n public(input: IModelBuilderPublicInput): PublicModelBuilder;\n}\n\nexport interface IModelFactory {\n execute(builder: IModelBuilder): Promise<PrivateModelBuilder[] | PublicModelBuilder[]>;\n}\n\n/** Provide code-defined content models. */\nexport const ModelFactory = createAbstraction<IModelFactory>(\"Cms/ModelFactory\");\nexport namespace ModelFactory {\n export type Interface = IModelFactory;\n export type Return = Promise<PrivateModelBuilder[] | PublicModelBuilder[]>;\n export type Builder = IModelBuilder;\n export type FieldBuilder = FieldBuilderRegistry.Interface;\n}\n"],"names":["FieldBuilderRegistry","createAbstraction","ModelFactory"],"mappings":";AAqCO,MAAMA,uBACTC,kBAAkD;AAqB/C,MAAMC,eAAeD,kBAAiC"}
|
|
@@ -9,11 +9,11 @@ import { DynamicZoneFieldType } from "./fields/DynamicZoneFieldType.js";
|
|
|
9
9
|
import { NumberFieldType } from "./fields/NumberFieldType.js";
|
|
10
10
|
import { BooleanFieldType } from "./fields/BooleanFieldType.js";
|
|
11
11
|
import { FileFieldType } from "./fields/FileFieldType.js";
|
|
12
|
+
import { AssetFieldType } from "./fields/AssetFieldType.js";
|
|
12
13
|
import { DateTimeFieldType } from "./fields/DateTimeFieldType.js";
|
|
13
14
|
import { JsonFieldType } from "./fields/JsonFieldType.js";
|
|
14
15
|
import { SearchableJsonFieldType } from "./fields/SearchableJsonFieldType.js";
|
|
15
16
|
import { FieldBuilderRegistry as external_abstractions_js_FieldBuilderRegistry, ModelFactory } from "./abstractions.js";
|
|
16
|
-
import { AccessControl } from "../shared/abstractions.js";
|
|
17
17
|
import { ModelsProvider } from "./models/abstractions.js";
|
|
18
18
|
import { ModelsProvider as ModelsProvider_js_ModelsProvider } from "./models/ModelsProvider.js";
|
|
19
19
|
import { UiSeparatorFieldType } from "./fields/UiSeparatorFieldType.js";
|
|
@@ -31,6 +31,7 @@ const ModelBuilderFeature = createFeature({
|
|
|
31
31
|
container.register(NumberFieldType);
|
|
32
32
|
container.register(BooleanFieldType);
|
|
33
33
|
container.register(FileFieldType);
|
|
34
|
+
container.register(AssetFieldType);
|
|
34
35
|
container.register(DateTimeFieldType);
|
|
35
36
|
container.register(JsonFieldType);
|
|
36
37
|
container.register(SearchableJsonFieldType);
|
|
@@ -38,13 +39,7 @@ const ModelBuilderFeature = createFeature({
|
|
|
38
39
|
container.register(UiAlertFieldType);
|
|
39
40
|
container.register(UiTabsFieldType);
|
|
40
41
|
container.register(FieldBuilderRegistry).inSingletonScope();
|
|
41
|
-
container.registerFactory(ModelsProvider, ()=>
|
|
42
|
-
let accessControl;
|
|
43
|
-
try {
|
|
44
|
-
accessControl = container.resolve(AccessControl);
|
|
45
|
-
} catch {}
|
|
46
|
-
return new ModelsProvider_js_ModelsProvider(()=>container.resolveAll(ModelFactory), container.resolve(external_abstractions_js_FieldBuilderRegistry), accessControl);
|
|
47
|
-
});
|
|
42
|
+
container.registerFactory(ModelsProvider, ()=>new ModelsProvider_js_ModelsProvider(()=>container.resolveAll(ModelFactory), container.resolve(external_abstractions_js_FieldBuilderRegistry)));
|
|
48
43
|
}
|
|
49
44
|
});
|
|
50
45
|
export { ModelBuilderFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/modelBuilder/feature.js","sources":["../../../src/features/modelBuilder/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { FieldBuilderRegistry } from \"./fields/FieldBuilderRegistry.js\";\nimport { TextFieldType } from \"./fields/TextFieldType.js\";\nimport { LongTextFieldType } from \"./fields/LongTextFieldType.js\";\nimport { RichTextFieldType } from \"./fields/RichTextFieldType.js\";\nimport { ObjectFieldType } from \"./fields/ObjectFieldType.js\";\nimport { RefFieldType } from \"./fields/RefFieldType.js\";\nimport { DynamicZoneFieldType } from \"./fields/DynamicZoneFieldType.js\";\nimport { NumberFieldType } from \"./fields/NumberFieldType.js\";\nimport { BooleanFieldType } from \"./fields/BooleanFieldType.js\";\nimport { FileFieldType } from \"./fields/FileFieldType.js\";\nimport { DateTimeFieldType } from \"./fields/DateTimeFieldType.js\";\nimport { JsonFieldType } from \"./fields/JsonFieldType.js\";\nimport { SearchableJsonFieldType } from \"./fields/SearchableJsonFieldType.js\";\n// import { LocationFieldType } from \"./fields/LocationFieldType.js\";\nimport { FieldBuilderRegistry as FieldsRegistryAbstraction, ModelFactory } from \"./abstractions.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/modelBuilder/feature.js","sources":["../../../src/features/modelBuilder/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { FieldBuilderRegistry } from \"./fields/FieldBuilderRegistry.js\";\nimport { TextFieldType } from \"./fields/TextFieldType.js\";\nimport { LongTextFieldType } from \"./fields/LongTextFieldType.js\";\nimport { RichTextFieldType } from \"./fields/RichTextFieldType.js\";\nimport { ObjectFieldType } from \"./fields/ObjectFieldType.js\";\nimport { RefFieldType } from \"./fields/RefFieldType.js\";\nimport { DynamicZoneFieldType } from \"./fields/DynamicZoneFieldType.js\";\nimport { NumberFieldType } from \"./fields/NumberFieldType.js\";\nimport { BooleanFieldType } from \"./fields/BooleanFieldType.js\";\nimport { FileFieldType } from \"./fields/FileFieldType.js\";\nimport { AssetFieldType } from \"./fields/AssetFieldType.js\";\nimport { DateTimeFieldType } from \"./fields/DateTimeFieldType.js\";\nimport { JsonFieldType } from \"./fields/JsonFieldType.js\";\nimport { SearchableJsonFieldType } from \"./fields/SearchableJsonFieldType.js\";\n// import { LocationFieldType } from \"./fields/LocationFieldType.js\";\nimport { FieldBuilderRegistry as FieldsRegistryAbstraction, ModelFactory } from \"./abstractions.js\";\nimport { ModelsProvider as ModelsProviderAbstraction } from \"./models/abstractions.js\";\nimport { ModelsProvider } from \"./models/ModelsProvider.js\";\nimport { UiSeparatorFieldType } from \"./fields/UiSeparatorFieldType.js\";\nimport { UiAlertFieldType } from \"./fields/UiAlertFieldType.js\";\nimport { UiTabsFieldType } from \"./fields/UiTabsFieldType.js\";\n\nexport const ModelBuilderFeature = createFeature({\n name: \"ModelBuilder\",\n register(container) {\n // Register core field types\n container.register(TextFieldType);\n container.register(LongTextFieldType);\n container.register(RichTextFieldType);\n container.register(ObjectFieldType);\n container.register(RefFieldType);\n container.register(DynamicZoneFieldType);\n container.register(NumberFieldType);\n container.register(BooleanFieldType);\n container.register(FileFieldType);\n container.register(AssetFieldType);\n container.register(DateTimeFieldType);\n container.register(JsonFieldType);\n container.register(SearchableJsonFieldType);\n container.register(UiSeparatorFieldType);\n container.register(UiAlertFieldType);\n container.register(UiTabsFieldType);\n // container.register(LocationFieldType);\n\n // Register field builder registry (will automatically get all FieldType implementations)\n container.register(FieldBuilderRegistry).inSingletonScope();\n\n // Register unified models provider\n container.registerFactory(ModelsProviderAbstraction, () => {\n return new ModelsProvider(\n // TODO: introduce a `lazy: true` dependency modifier, which will inject a getter.\n () => container.resolveAll(ModelFactory),\n container.resolve(FieldsRegistryAbstraction)\n );\n });\n }\n});\n"],"names":["ModelBuilderFeature","createFeature","container","TextFieldType","LongTextFieldType","RichTextFieldType","ObjectFieldType","RefFieldType","DynamicZoneFieldType","NumberFieldType","BooleanFieldType","FileFieldType","AssetFieldType","DateTimeFieldType","JsonFieldType","SearchableJsonFieldType","UiSeparatorFieldType","UiAlertFieldType","UiTabsFieldType","FieldBuilderRegistry","ModelsProviderAbstraction","ModelsProvider","ModelFactory","FieldsRegistryAbstraction"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QAEdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;QACnBR,UAAU,QAAQ,CAACS;QACnBT,UAAU,QAAQ,CAACU;QACnBV,UAAU,QAAQ,CAACW;QACnBX,UAAU,QAAQ,CAACY;QACnBZ,UAAU,QAAQ,CAACa;QACnBb,UAAU,QAAQ,CAACc;QACnBd,UAAU,QAAQ,CAACe;QACnBf,UAAU,QAAQ,CAACgB;QAInBhB,UAAU,QAAQ,CAACiB,sBAAsB,gBAAgB;QAGzDjB,UAAU,eAAe,CAACkB,gBAA2B,IAC1C,IAAIC,iCAEP,IAAMnB,UAAU,UAAU,CAACoB,eAC3BpB,UAAU,OAAO,CAACqB;IAG9B;AACJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type IFieldTypeFactory } from "./abstractions.js";
|
|
2
|
+
import { DataFieldBuilder } from "./FieldBuilder.js";
|
|
3
|
+
import { RequiredValidator } from "./fieldTypeValidator.js";
|
|
4
|
+
export interface IAssetFieldBuilder extends DataFieldBuilder<"asset">, RequiredValidator {
|
|
5
|
+
accept(mimeTypes: string[]): this;
|
|
6
|
+
imagesOnly(): this;
|
|
7
|
+
}
|
|
8
|
+
declare class AssetFieldTypeFactory implements IFieldTypeFactory {
|
|
9
|
+
readonly type = "asset";
|
|
10
|
+
create(): IAssetFieldBuilder;
|
|
11
|
+
}
|
|
12
|
+
export declare const AssetFieldType: typeof AssetFieldTypeFactory & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<IFieldTypeFactory>;
|
|
14
|
+
};
|
|
15
|
+
declare module "../abstractions.js" {
|
|
16
|
+
interface IFieldBuilderRegistry {
|
|
17
|
+
asset(): IAssetFieldBuilder;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FieldType } from "./abstractions.js";
|
|
2
|
+
import { DataFieldBuilder } from "./FieldBuilder.js";
|
|
3
|
+
class AssetFieldBuilder extends DataFieldBuilder {
|
|
4
|
+
constructor(){
|
|
5
|
+
super("asset");
|
|
6
|
+
this.label("Asset");
|
|
7
|
+
this.renderer("assetField");
|
|
8
|
+
}
|
|
9
|
+
required(message) {
|
|
10
|
+
return this.validation({
|
|
11
|
+
name: "required",
|
|
12
|
+
message: message || "Value is required.",
|
|
13
|
+
settings: {}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
list() {
|
|
17
|
+
super.list();
|
|
18
|
+
this.renderer("assetFields");
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
accept(mimeTypes) {
|
|
22
|
+
this.config.settings = this.config.settings || {};
|
|
23
|
+
this.config.settings.accept = mimeTypes;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
imagesOnly() {
|
|
27
|
+
this.config.settings = this.config.settings || {};
|
|
28
|
+
this.config.settings.imagesOnly = true;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class AssetFieldTypeFactory {
|
|
33
|
+
create() {
|
|
34
|
+
return new AssetFieldBuilder();
|
|
35
|
+
}
|
|
36
|
+
constructor(){
|
|
37
|
+
this.type = "asset";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const AssetFieldType = FieldType.createImplementation({
|
|
41
|
+
implementation: AssetFieldTypeFactory,
|
|
42
|
+
dependencies: []
|
|
43
|
+
});
|
|
44
|
+
export { AssetFieldType };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=AssetFieldType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/modelBuilder/fields/AssetFieldType.js","sources":["../../../../src/features/modelBuilder/fields/AssetFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory } from \"./abstractions.js\";\nimport { DataFieldBuilder } from \"./FieldBuilder.js\";\nimport { RequiredValidator } from \"./fieldTypeValidator.js\";\n\nexport interface IAssetFieldBuilder extends DataFieldBuilder<\"asset\">, RequiredValidator {\n accept(mimeTypes: string[]): this;\n imagesOnly(): this;\n}\n\nclass AssetFieldBuilder extends DataFieldBuilder<\"asset\"> implements IAssetFieldBuilder {\n public constructor() {\n super(\"asset\");\n this.label(\"Asset\");\n this.renderer(\"assetField\");\n }\n\n required(message?: string): this {\n return this.validation({\n name: \"required\",\n message: message || \"Value is required.\",\n settings: {}\n });\n }\n\n override list(): this {\n super.list();\n this.renderer(\"assetFields\");\n return this;\n }\n\n accept(mimeTypes: string[]): this {\n this.config.settings = this.config.settings || {};\n this.config.settings.accept = mimeTypes;\n return this;\n }\n\n imagesOnly(): this {\n this.config.settings = this.config.settings || {};\n this.config.settings.imagesOnly = true;\n return this;\n }\n}\n\nclass AssetFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"asset\";\n\n create(): IAssetFieldBuilder {\n return new AssetFieldBuilder();\n }\n}\n\nexport const AssetFieldType = FieldType.createImplementation({\n implementation: AssetFieldTypeFactory,\n dependencies: []\n});\n\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n asset(): IAssetFieldBuilder;\n }\n}\n"],"names":["AssetFieldBuilder","DataFieldBuilder","message","mimeTypes","AssetFieldTypeFactory","AssetFieldType","FieldType"],"mappings":";;AASA,MAAMA,0BAA0BC;IAC5B,aAAqB;QACjB,KAAK,CAAC;QACN,IAAI,CAAC,KAAK,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC;IAClB;IAEA,SAASC,OAAgB,EAAQ;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,MAAM;YACN,SAASA,WAAW;YACpB,UAAU,CAAC;QACf;IACJ;IAES,OAAa;QAClB,KAAK,CAAC;QACN,IAAI,CAAC,QAAQ,CAAC;QACd,OAAO,IAAI;IACf;IAEA,OAAOC,SAAmB,EAAQ;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAGA;QAC9B,OAAO,IAAI;IACf;IAEA,aAAmB;QACf,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG;QAClC,OAAO,IAAI;IACf;AACJ;AAEA,MAAMC;IAGF,SAA6B;QACzB,OAAO,IAAIJ;IACf;;aAJS,IAAI,GAAG;;AAKpB;AAEO,MAAMK,iBAAiBC,UAAU,oBAAoB,CAAC;IACzD,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CmsModelField, CmsModelLayoutCell } from "../../../types/index.js";
|
|
1
|
+
import type { CmsModelField, CmsModelLayoutCell, FieldRule } from "../../../types/index.js";
|
|
2
2
|
export interface DataFieldBuildResult {
|
|
3
3
|
type: "data";
|
|
4
4
|
field: CmsModelField;
|
|
@@ -15,6 +15,7 @@ export interface BaseFieldBuilderConfig {
|
|
|
15
15
|
description?: string | null;
|
|
16
16
|
note?: string | null;
|
|
17
17
|
_fieldId?: string;
|
|
18
|
+
rules?: FieldRule[];
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Minimal shared base class for all field builders (data and layout).
|
|
@@ -30,6 +31,7 @@ export declare abstract class BaseFieldBuilder<TType extends string = string> {
|
|
|
30
31
|
description(text: string): this;
|
|
31
32
|
note(text: string): this;
|
|
32
33
|
fieldId(id: string): this;
|
|
34
|
+
rules(rules: FieldRule[]): this;
|
|
33
35
|
protected setSubType(subType: string): this;
|
|
34
36
|
/**
|
|
35
37
|
* Build the final field result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/modelBuilder/fields/BaseFieldBuilder.js","sources":["../../../../src/features/modelBuilder/fields/BaseFieldBuilder.ts"],"sourcesContent":["import type { CmsModelField, CmsModelLayoutCell } from \"~/types/index.js\";\n\nexport interface DataFieldBuildResult {\n type: \"data\";\n field: CmsModelField;\n}\n\nexport interface LayoutFieldBuildResult {\n type: \"layout\";\n layoutCell: CmsModelLayoutCell;\n fields?: CmsModelField[];\n}\n\nexport type FieldBuildResult = DataFieldBuildResult | LayoutFieldBuildResult;\n\nexport interface BaseFieldBuilderConfig {\n label: string;\n help?: string | null;\n description?: string | null;\n note?: string | null;\n _fieldId?: string;\n}\n\n/**\n * Minimal shared base class for all field builders (data and layout).\n */\nexport abstract class BaseFieldBuilder<TType extends string = string> {\n public readonly type: TType;\n private _fieldSubType?: string;\n protected config: BaseFieldBuilderConfig;\n\n public get subType(): string | undefined {\n return this._fieldSubType;\n }\n\n public constructor(type: TType, label?: string) {\n this.type = type;\n this.config = {\n label: label || \"\",\n help: null,\n description: null,\n note: null\n };\n }\n\n public label(text: string): this {\n this.config.label = text;\n return this;\n }\n\n public help(text: string): this {\n this.config.help = text;\n return this;\n }\n\n public description(text: string): this {\n this.config.description = text;\n return this;\n }\n\n public note(text: string): this {\n this.config.note = text;\n return this;\n }\n\n public fieldId(id: string): this {\n this.config._fieldId = id;\n return this;\n }\n\n protected setSubType(subType: string): this {\n this._fieldSubType = subType;\n return this;\n }\n\n /**\n * Build the final field result.\n * @internal\n */\n public abstract build(): FieldBuildResult;\n}\n"],"names":["BaseFieldBuilder","type","label","text","id","subType"],"mappings":"
|
|
1
|
+
{"version":3,"file":"features/modelBuilder/fields/BaseFieldBuilder.js","sources":["../../../../src/features/modelBuilder/fields/BaseFieldBuilder.ts"],"sourcesContent":["import type { CmsModelField, CmsModelLayoutCell, FieldRule } from \"~/types/index.js\";\n\nexport interface DataFieldBuildResult {\n type: \"data\";\n field: CmsModelField;\n}\n\nexport interface LayoutFieldBuildResult {\n type: \"layout\";\n layoutCell: CmsModelLayoutCell;\n fields?: CmsModelField[];\n}\n\nexport type FieldBuildResult = DataFieldBuildResult | LayoutFieldBuildResult;\n\nexport interface BaseFieldBuilderConfig {\n label: string;\n help?: string | null;\n description?: string | null;\n note?: string | null;\n _fieldId?: string;\n rules?: FieldRule[];\n}\n\n/**\n * Minimal shared base class for all field builders (data and layout).\n */\nexport abstract class BaseFieldBuilder<TType extends string = string> {\n public readonly type: TType;\n private _fieldSubType?: string;\n protected config: BaseFieldBuilderConfig;\n\n public get subType(): string | undefined {\n return this._fieldSubType;\n }\n\n public constructor(type: TType, label?: string) {\n this.type = type;\n this.config = {\n label: label || \"\",\n help: null,\n description: null,\n note: null\n };\n }\n\n public label(text: string): this {\n this.config.label = text;\n return this;\n }\n\n public help(text: string): this {\n this.config.help = text;\n return this;\n }\n\n public description(text: string): this {\n this.config.description = text;\n return this;\n }\n\n public note(text: string): this {\n this.config.note = text;\n return this;\n }\n\n public fieldId(id: string): this {\n this.config._fieldId = id;\n return this;\n }\n\n public rules(rules: FieldRule[]): this {\n this.config.rules = rules;\n return this;\n }\n\n protected setSubType(subType: string): this {\n this._fieldSubType = subType;\n return this;\n }\n\n /**\n * Build the final field result.\n * @internal\n */\n public abstract build(): FieldBuildResult;\n}\n"],"names":["BaseFieldBuilder","type","label","text","id","rules","subType"],"mappings":"AA2BO,MAAeA;IAKlB,IAAW,UAA8B;QACrC,OAAO,IAAI,CAAC,aAAa;IAC7B;IAEA,YAAmBC,IAAW,EAAEC,KAAc,CAAE;QAC5C,IAAI,CAAC,IAAI,GAAGD;QACZ,IAAI,CAAC,MAAM,GAAG;YACV,OAAOC,SAAS;YAChB,MAAM;YACN,aAAa;YACb,MAAM;QACV;IACJ;IAEO,MAAMC,IAAY,EAAQ;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,GAAGA;QACpB,OAAO,IAAI;IACf;IAEO,KAAKA,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,GAAGA;QACnB,OAAO,IAAI;IACf;IAEO,YAAYA,IAAY,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,WAAW,GAAGA;QAC1B,OAAO,IAAI;IACf;IAEO,KAAKA,IAAY,EAAQ;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,GAAGA;QACnB,OAAO,IAAI;IACf;IAEO,QAAQC,EAAU,EAAQ;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAGA;QACvB,OAAO,IAAI;IACf;IAEO,MAAMC,KAAkB,EAAQ;QACnC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAGA;QACpB,OAAO,IAAI;IACf;IAEU,WAAWC,OAAe,EAAQ;QACxC,IAAI,CAAC,aAAa,GAAGA;QACrB,OAAO,IAAI;IACf;AAOJ"}
|
|
@@ -22,18 +22,30 @@ export interface IFieldRendererRegistry {
|
|
|
22
22
|
fieldType: "datetime";
|
|
23
23
|
settings: undefined;
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Picks a day, then a month, then a year. For date-only fields (`dateOnly()`); single-value
|
|
27
|
+
* only, not for `.list()`. It offers only the dates the field's `dateGte`/`dateLte` limits
|
|
28
|
+
* allow; without limits, years run from this year back 120 years.
|
|
29
|
+
*/
|
|
30
|
+
birthdayInput: {
|
|
31
|
+
fieldType: "datetime";
|
|
32
|
+
settings: undefined;
|
|
33
|
+
};
|
|
25
34
|
dateTimeInputs: {
|
|
26
35
|
fieldType: "datetime";
|
|
27
36
|
settings?: {
|
|
28
|
-
|
|
29
|
-
addValueButtonLabel?: string;
|
|
30
|
-
};
|
|
37
|
+
addItemLabel?: string;
|
|
31
38
|
};
|
|
32
39
|
};
|
|
33
40
|
dynamicZone: {
|
|
34
41
|
fieldType: "dynamicZone";
|
|
35
42
|
settings?: {
|
|
43
|
+
/** Whether the accordion is expanded by default. */
|
|
36
44
|
open?: boolean;
|
|
45
|
+
/** Wrap the zone in a container panel. Set to `false` for a flat inline layout. */
|
|
46
|
+
container?: boolean;
|
|
47
|
+
/** Label for the "add item" button (defaults to "Add Item"). */
|
|
48
|
+
addItemLabel?: string;
|
|
37
49
|
};
|
|
38
50
|
};
|
|
39
51
|
hidden: {
|
|
@@ -47,9 +59,7 @@ export interface IFieldRendererRegistry {
|
|
|
47
59
|
lexicalEditors: {
|
|
48
60
|
fieldType: "rich-text";
|
|
49
61
|
settings?: {
|
|
50
|
-
|
|
51
|
-
addValueButtonLabel?: string;
|
|
52
|
-
};
|
|
62
|
+
addItemLabel?: string;
|
|
53
63
|
};
|
|
54
64
|
};
|
|
55
65
|
textarea: {
|
|
@@ -59,9 +69,7 @@ export interface IFieldRendererRegistry {
|
|
|
59
69
|
textareas: {
|
|
60
70
|
fieldType: "long-text";
|
|
61
71
|
settings: {
|
|
62
|
-
|
|
63
|
-
addValueButtonLabel?: string;
|
|
64
|
-
};
|
|
72
|
+
addItemLabel?: string;
|
|
65
73
|
};
|
|
66
74
|
};
|
|
67
75
|
numberInput: {
|
|
@@ -71,24 +79,35 @@ export interface IFieldRendererRegistry {
|
|
|
71
79
|
numberInputs: {
|
|
72
80
|
fieldType: "number";
|
|
73
81
|
settings?: {
|
|
74
|
-
|
|
75
|
-
addValueButtonLabel?: string;
|
|
76
|
-
};
|
|
82
|
+
addItemLabel?: string;
|
|
77
83
|
};
|
|
78
84
|
};
|
|
79
85
|
objectAccordionSingle: {
|
|
80
86
|
fieldType: "object";
|
|
81
87
|
settings?: {
|
|
88
|
+
/** Whether the accordion is expanded by default. */
|
|
82
89
|
open?: boolean;
|
|
90
|
+
/** Wrap the object in a container panel. Set to `false` for a flat inline layout. */
|
|
91
|
+
container?: boolean;
|
|
92
|
+
/** Field ID whose value is used as the accordion title, or a function receiving the object data. */
|
|
93
|
+
itemTitle?: string;
|
|
94
|
+
/** Field ID whose value is used as the accordion description, or a function receiving the object data. */
|
|
95
|
+
itemDescription?: string;
|
|
83
96
|
};
|
|
84
97
|
};
|
|
85
98
|
objectAccordionMultiple: {
|
|
86
99
|
fieldType: "object";
|
|
87
100
|
settings?: {
|
|
101
|
+
/** Whether each accordion item is expanded by default. */
|
|
88
102
|
open?: boolean;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
/** Wrap the list in a container panel. Set to `false` for a flat inline layout. */
|
|
104
|
+
container?: boolean;
|
|
105
|
+
/** Field ID whose value is used as each item's accordion title. */
|
|
106
|
+
itemTitle?: string;
|
|
107
|
+
/** Field ID whose value is used as each item's accordion description. */
|
|
108
|
+
itemDescription?: string;
|
|
109
|
+
/** Label for the "add item" button (defaults to "Add {fieldLabel}"). */
|
|
110
|
+
addItemLabel?: string;
|
|
92
111
|
};
|
|
93
112
|
};
|
|
94
113
|
passthrough: {
|
|
@@ -106,6 +125,7 @@ export interface IFieldRendererRegistry {
|
|
|
106
125
|
refDialogMultiple: {
|
|
107
126
|
fieldType: "ref";
|
|
108
127
|
settings?: {
|
|
128
|
+
/** Where newly picked references are inserted: `"first"` (top) or `"last"` (bottom, default). */
|
|
109
129
|
newItemPosition?: "first" | "last";
|
|
110
130
|
};
|
|
111
131
|
};
|
|
@@ -125,6 +145,11 @@ export interface IFieldRendererRegistry {
|
|
|
125
145
|
fieldType: "ref";
|
|
126
146
|
settings: undefined;
|
|
127
147
|
};
|
|
148
|
+
select: {
|
|
149
|
+
fieldType: "text" | "number";
|
|
150
|
+
settings: undefined;
|
|
151
|
+
};
|
|
152
|
+
/** @deprecated Use "select" instead. */
|
|
128
153
|
dropdown: {
|
|
129
154
|
fieldType: "text" | "number";
|
|
130
155
|
settings: undefined;
|
|
@@ -140,21 +165,41 @@ export interface IFieldRendererRegistry {
|
|
|
140
165
|
textInputs: {
|
|
141
166
|
fieldType: "text";
|
|
142
167
|
settings?: {
|
|
143
|
-
|
|
144
|
-
addValueButtonLabel?: string;
|
|
145
|
-
};
|
|
168
|
+
addItemLabel?: string;
|
|
146
169
|
};
|
|
147
170
|
};
|
|
171
|
+
/** @deprecated Use `assetField` instead. */
|
|
148
172
|
file: {
|
|
149
173
|
fieldType: "file";
|
|
150
174
|
settings?: {
|
|
175
|
+
/** Only allow image files to be selected. */
|
|
151
176
|
imagesOnly?: boolean;
|
|
152
177
|
};
|
|
153
178
|
};
|
|
179
|
+
/** @deprecated Use `assetFields` instead. */
|
|
154
180
|
files: {
|
|
155
181
|
fieldType: "file";
|
|
156
182
|
settings?: {
|
|
183
|
+
/** Only allow image files to be selected. */
|
|
184
|
+
imagesOnly?: boolean;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
assetField: {
|
|
188
|
+
fieldType: "asset";
|
|
189
|
+
settings?: {
|
|
190
|
+
/** Only allow image files to be selected. */
|
|
157
191
|
imagesOnly?: boolean;
|
|
192
|
+
/** MIME types or extensions to allow (e.g. `["image/png", "application/pdf"]`). Leave empty to allow all. */
|
|
193
|
+
accept?: string[];
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
assetFields: {
|
|
197
|
+
fieldType: "asset";
|
|
198
|
+
settings?: {
|
|
199
|
+
/** Only allow image files to be selected. */
|
|
200
|
+
imagesOnly?: boolean;
|
|
201
|
+
/** MIME types or extensions to allow (e.g. `["image/png", "application/pdf"]`). Leave empty to allow all. */
|
|
202
|
+
accept?: string[];
|
|
158
203
|
};
|
|
159
204
|
};
|
|
160
205
|
uiSeparator: {
|
|
@@ -191,6 +236,14 @@ export declare class DataFieldBuilder<TType extends string = string> extends Bas
|
|
|
191
236
|
storageId(id: string): this;
|
|
192
237
|
defaultValue(value: any): this;
|
|
193
238
|
list(): this;
|
|
239
|
+
/**
|
|
240
|
+
* Renders the field in the admin app, but doesn't let anyone edit its value.
|
|
241
|
+
* Handy for values your own code owns, like an external ID or a generated slug.
|
|
242
|
+
*
|
|
243
|
+
* Only the admin app honours this. The API doesn't check it, so the field can
|
|
244
|
+
* still be written to over GraphQL.
|
|
245
|
+
*/
|
|
246
|
+
disabled(value?: boolean): this;
|
|
194
247
|
tags(tags: string[]): this;
|
|
195
248
|
/**
|
|
196
249
|
* List validators - these methods are available after calling list()
|
|
@@ -6,6 +6,7 @@ const rendererNameMap = {
|
|
|
6
6
|
checkboxes: "checkboxes",
|
|
7
7
|
dateTimeInput: "date-time-input",
|
|
8
8
|
dateTimeInputs: "date-time-inputs",
|
|
9
|
+
birthdayInput: "birthday-input",
|
|
9
10
|
dynamicZone: "dynamicZone",
|
|
10
11
|
hidden: "hidden",
|
|
11
12
|
lexicalEditor: "lexical-text-input",
|
|
@@ -24,12 +25,15 @@ const rendererNameMap = {
|
|
|
24
25
|
refAutocompleteMultiple: "ref-inputs",
|
|
25
26
|
refCheckboxes: "ref-simple-multiple",
|
|
26
27
|
refRadioButtons: "ref-simple-single",
|
|
28
|
+
select: "select-box",
|
|
27
29
|
dropdown: "select-box",
|
|
28
30
|
tags: "tags",
|
|
29
31
|
textInput: "text-input",
|
|
30
32
|
textInputs: "text-inputs",
|
|
31
33
|
file: "file-input",
|
|
32
34
|
files: "file-inputs",
|
|
35
|
+
assetField: "asset-input",
|
|
36
|
+
assetFields: "asset-inputs",
|
|
33
37
|
uiSeparator: "uiSeparator",
|
|
34
38
|
uiAlert: "uiAlert",
|
|
35
39
|
uiTabs: "uiTabs"
|
|
@@ -77,6 +81,10 @@ class DataFieldBuilder extends BaseFieldBuilder {
|
|
|
77
81
|
this.config.list = true;
|
|
78
82
|
return this;
|
|
79
83
|
}
|
|
84
|
+
disabled(value = true) {
|
|
85
|
+
this.config.disabled = value;
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
80
88
|
tags(tags) {
|
|
81
89
|
this.config.tags = tags;
|
|
82
90
|
return this;
|
|
@@ -147,6 +155,7 @@ class DataFieldBuilder extends BaseFieldBuilder {
|
|
|
147
155
|
validation: this.config.validation || [],
|
|
148
156
|
listValidation: this.config.listValidation || [],
|
|
149
157
|
list: this.config.list || false,
|
|
158
|
+
disabled: this.config.disabled || false,
|
|
150
159
|
predefinedValues: this.config.predefinedValues || {
|
|
151
160
|
enabled: false,
|
|
152
161
|
values: []
|
|
@@ -157,7 +166,8 @@ class DataFieldBuilder extends BaseFieldBuilder {
|
|
|
157
166
|
note: this.config.note || null,
|
|
158
167
|
renderer: this.config.renderer || null,
|
|
159
168
|
settings: this.config.settings || {},
|
|
160
|
-
tags: this.config.tags || []
|
|
169
|
+
tags: this.config.tags || [],
|
|
170
|
+
rules: this.config.rules
|
|
161
171
|
}
|
|
162
172
|
};
|
|
163
173
|
}
|