@webiny/api-headless-cms 6.4.11 → 6.6.0-alpha.1
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/HeadlessCmsContextualSchema.d.ts +16 -0
- package/HeadlessCmsContextualSchema.js +32 -0
- package/HeadlessCmsContextualSchema.js.map +1 -0
- 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 +195 -0
- package/HeadlessCmsFeature.js.map +1 -0
- package/createCmsRoute.d.ts +26 -0
- package/createCmsRoute.js +59 -0
- package/createCmsRoute.js.map +1 -0
- package/crud/contentEntry/entryDataValidation.d.ts +1 -1
- package/crud/contentEntry/entryDataValidation.js +29 -15
- 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/contentEntry.crud.js +22 -20
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/defaultFields.js +3 -2
- package/crud/contentModel/defaultFields.js.map +1 -1
- package/crud/contentModel.crud.js +8 -6
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup.crud.js +7 -5
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/domain/contentModel/schemas.d.ts +2 -0
- package/domain/contentModel/schemas.js +4 -2
- package/domain/contentModel/schemas.js.map +1 -1
- package/domain/contentModel/validation/modelFields.js +21 -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/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 +55 -0
- package/features/ai/DescribeContentModelTool.js +60 -0
- package/features/ai/DescribeContentModelTool.js.map +1 -0
- package/features/ai/ListContentModelsTool.d.ts +41 -0
- package/features/ai/ListContentModelsTool.js +44 -0
- package/features/ai/ListContentModelsTool.js.map +1 -0
- package/features/ai/QueryEntriesTool.d.ts +75 -0
- package/features/ai/QueryEntriesTool.js +90 -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 +0 -2
- package/features/contentEntry/ContentEntriesFeature.js.map +1 -1
- package/features/contentEntry/CreateEntry/CreateEntryRepository.d.ts +7 -7
- package/features/contentEntry/CreateEntry/CreateEntryRepository.js +8 -14
- package/features/contentEntry/CreateEntry/CreateEntryRepository.js.map +1 -1
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.d.ts +3 -1
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.js +2 -3
- package/features/contentEntry/CreateEntry/CreateEntryUseCase.js.map +1 -1
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.d.ts +7 -7
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js +8 -14
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromRepository.js.map +1 -1
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.d.ts +3 -1
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js +2 -3
- package/features/contentEntry/CreateEntryRevisionFrom/CreateEntryRevisionFromUseCase.js.map +1 -1
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.d.ts +7 -7
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js +8 -14
- package/features/contentEntry/DeleteEntry/DeleteEntryRepository.js.map +1 -1
- package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.d.ts +3 -1
- package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js +2 -3
- package/features/contentEntry/DeleteEntry/DeleteEntryUseCase.js.map +1 -1
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.d.ts +6 -6
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js +8 -14
- package/features/contentEntry/DeleteEntry/MoveEntryToBinRepository.js.map +1 -1
- package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.d.ts +3 -1
- package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js +2 -3
- package/features/contentEntry/DeleteEntry/MoveEntryToBinUseCase.js.map +1 -1
- package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.d.ts +3 -3
- package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js +5 -5
- package/features/contentEntry/DeleteEntry/decorators/ForceDeleteDecorator.js.map +1 -1
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.d.ts +6 -6
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js +8 -14
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionRepository.js.map +1 -1
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.d.ts +3 -1
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js +2 -3
- package/features/contentEntry/DeleteEntryRevision/DeleteEntryRevisionUseCase.js.map +1 -1
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.d.ts +7 -7
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js +8 -13
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesRepository.js.map +1 -1
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.d.ts +3 -1
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js +2 -3
- package/features/contentEntry/DeleteMultipleEntries/DeleteMultipleEntriesUseCase.js.map +1 -1
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.d.ts +9 -7
- package/features/contentEntry/GetEntriesByIds/GetEntriesByIdsRepository.js +15 -13
- 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 +7 -7
- package/features/contentEntry/GetLatestEntriesByIds/GetLatestEntriesByIdsRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetLatestRevisionByEntryId/GetLatestRevisionByEntryIdRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetPreviousRevisionByEntryId/GetPreviousRevisionByEntryIdRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetPublishedEntriesByIds/GetPublishedEntriesByIdsRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetPublishedRevisionByEntryId/GetPublishedRevisionByEntryIdRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetRevisionById/GetRevisionByIdRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetRevisionsByEntryId/GetRevisionsByEntryIdRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/ListEntries/ListEntriesRepository.js +8 -13
- 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 +7 -7
- package/features/contentEntry/MoveEntry/MoveEntryRepository.js +8 -13
- package/features/contentEntry/MoveEntry/MoveEntryRepository.js.map +1 -1
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.d.ts +3 -1
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.js +2 -3
- package/features/contentEntry/MoveEntry/MoveEntryUseCase.js.map +1 -1
- package/features/contentEntry/PublishEntry/PublishEntryRepository.d.ts +7 -7
- package/features/contentEntry/PublishEntry/PublishEntryRepository.js +8 -14
- package/features/contentEntry/PublishEntry/PublishEntryRepository.js.map +1 -1
- package/features/contentEntry/PublishEntry/PublishEntryUseCase.d.ts +3 -1
- package/features/contentEntry/PublishEntry/PublishEntryUseCase.js +2 -3
- package/features/contentEntry/PublishEntry/PublishEntryUseCase.js.map +1 -1
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.d.ts +9 -7
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js +12 -15
- package/features/contentEntry/RepublishEntry/RepublishEntryRepository.js.map +1 -1
- package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.d.ts +3 -1
- package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js +2 -3
- package/features/contentEntry/RepublishEntry/RepublishEntryUseCase.js.map +1 -1
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.d.ts +7 -7
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js +8 -14
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinRepository.js.map +1 -1
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.d.ts +3 -1
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js +2 -3
- package/features/contentEntry/RestoreEntryFromBin/RestoreEntryFromBinUseCase.js.map +1 -1
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.d.ts +7 -7
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js +8 -14
- package/features/contentEntry/UnpublishEntry/UnpublishEntryRepository.js.map +1 -1
- package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.d.ts +3 -1
- package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js +2 -3
- package/features/contentEntry/UnpublishEntry/UnpublishEntryUseCase.js.map +1 -1
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.d.ts +7 -7
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js +8 -14
- package/features/contentEntry/UpdateEntry/UpdateEntryRepository.js.map +1 -1
- package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.d.ts +3 -1
- package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js +2 -3
- package/features/contentEntry/UpdateEntry/UpdateEntryUseCase.js.map +1 -1
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.d.ts +3 -1
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js +2 -3
- package/features/contentEntry/UpdateRevisionDescription/UpdateRevisionDescriptionUseCase.js.map +1 -1
- package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.d.ts +3 -1
- package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js +2 -3
- package/features/contentEntry/ValidateEntry/ValidateEntryUseCase.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.d.ts +3 -1
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js +2 -4
- package/features/contentEntry/entryDataFactories/CreateEntryDataFactory/CreateEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.d.ts +4 -4
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js +4 -8
- package/features/contentEntry/entryDataFactories/CreateEntryRevisionFromDataFactory/CreateEntryRevisionFromDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.d.ts +3 -1
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js +1 -3
- package/features/contentEntry/entryDataFactories/CreatePublishEntryDataFactory/CreatePublishEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.d.ts +3 -1
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js +1 -3
- package/features/contentEntry/entryDataFactories/CreateRepublishEntryDataFactory/CreateRepublishEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.d.ts +3 -1
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js +1 -3
- package/features/contentEntry/entryDataFactories/CreateUnpublishEntryDataFactory/CreateUnpublishEntryDataFactory.js.map +1 -1
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.d.ts +3 -1
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js +2 -4
- package/features/contentEntry/entryDataFactories/UpdateEntryDataFactory/UpdateEntryDataFactory.js.map +1 -1
- 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 +5 -6
- package/features/contentModel/CreateModel/CreateModelRepository.js +9 -12
- package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
- package/features/contentModel/CreateModel/CreateModelUseCase.js +2 -2
- package/features/contentModel/CreateModel/CreateModelUseCase.js.map +1 -1
- package/features/contentModel/CreateModel/abstractions.d.ts +1 -1
- package/features/contentModel/CreateModel/abstractions.js.map +1 -1
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.d.ts +5 -6
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +9 -12
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
- package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js +2 -2
- package/features/contentModel/CreateModelFrom/CreateModelFromUseCase.js.map +1 -1
- package/features/contentModel/CreateModelFrom/abstractions.d.ts +1 -1
- package/features/contentModel/CreateModelFrom/abstractions.js.map +1 -1
- package/features/contentModel/DeleteModel/DeleteModelRepository.d.ts +4 -6
- package/features/contentModel/DeleteModel/DeleteModelRepository.js +6 -10
- package/features/contentModel/DeleteModel/DeleteModelRepository.js.map +1 -1
- package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.d.ts +1 -0
- package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.js +11 -8
- package/features/contentModel/DeleteModel/DeleteModelWithEntryCleanup.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 +7 -6
- package/features/contentModel/UpdateModel/UpdateModelRepository.js +12 -12
- 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 +53 -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 +3 -3
- package/features/contentModel/shared/ModelsFetcher.js +5 -5
- package/features/contentModel/shared/ModelsFetcher.js.map +1 -1
- package/features/contentModel/shared/PluginModelsProvider.d.ts +5 -4
- package/features/contentModel/shared/PluginModelsProvider.js +11 -8
- package/features/contentModel/shared/PluginModelsProvider.js.map +1 -1
- package/features/contentModel/shared/abstractions.d.ts +10 -0
- package/features/contentModel/shared/abstractions.js +2 -1
- package/features/contentModel/shared/abstractions.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.d.ts +11 -7
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js +19 -19
- package/features/contentModelGroup/CreateGroup/CreateGroupRepository.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.d.ts +6 -2
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js +9 -8
- package/features/contentModelGroup/CreateGroup/CreateGroupUseCase.js.map +1 -1
- package/features/contentModelGroup/CreateGroup/abstractions.d.ts +1 -1
- package/features/contentModelGroup/CreateGroup/abstractions.js.map +1 -1
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.d.ts +9 -7
- package/features/contentModelGroup/DeleteGroup/DeleteGroupRepository.js +12 -14
- 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 +7 -7
- package/features/contentModelGroup/UpdateGroup/UpdateGroupRepository.js +9 -14
- 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 +148 -0
- package/features/graphql/fields/base/AssetToGraphQL.js.map +1 -0
- package/features/graphql/fields/base/DynamicZoneToGraphQL.js +5 -1
- package/features/graphql/fields/base/DynamicZoneToGraphQL.js.map +1 -1
- package/features/graphql/fields/base/ObjectToGraphQL.js +2 -2
- 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 +10 -18
- 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 +10 -0
- package/features/modelBuilder/abstractions.js.map +1 -1
- package/features/modelBuilder/feature.js +2 -0
- 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/DataFieldBuilder.d.ts +54 -18
- package/features/modelBuilder/fields/DataFieldBuilder.js +3 -0
- package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -1
- package/features/modelBuilder/fields/DynamicZoneFieldType.d.ts +1 -0
- package/features/modelBuilder/fields/DynamicZoneFieldType.js +2 -6
- 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/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/PrivateModelBuilder.js +2 -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/shared/abstractions.d.ts +11 -15
- package/features/shared/abstractions.js +3 -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/whereMapper/WhereMapper.js +7 -5
- package/features/whereMapper/WhereMapper.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +3 -7
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/abstractions.d.ts +14 -0
- package/fieldConverters/abstractions.js +13 -0
- package/fieldConverters/abstractions.js.map +1 -0
- package/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 +14 -0
- package/graphql/schema/cms/CmsBaseErrorTypeFactory.js +21 -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.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 +2 -2
- package/graphql/schema/cms/resolvers/createEntry.js +1 -1
- package/graphql/schema/cms/resolvers/createEntry.js.map +1 -1
- package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +2 -2
- package/graphql/schema/cms/resolvers/deleteEntryRevision.js +1 -1
- package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -1
- package/graphql/schema/cms/resolvers/getEntry.d.ts +2 -2
- package/graphql/schema/cms/resolvers/getEntry.js +1 -1
- package/graphql/schema/cms/resolvers/getEntry.js.map +1 -1
- package/graphql/schema/cms/resolvers/getModel.d.ts +8 -0
- package/graphql/schema/cms/resolvers/getModel.js +18 -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 +2 -2
- package/graphql/schema/cms/resolvers/listEntries.js +1 -1
- package/graphql/schema/cms/resolvers/listEntries.js.map +1 -1
- package/graphql/schema/cms/resolvers/mutationCms.d.ts +2 -2
- package/graphql/schema/cms/resolvers/mutationCms.js +1 -1
- package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -1
- package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +2 -2
- package/graphql/schema/cms/resolvers/publishEntryRevision.js +1 -1
- package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -1
- package/graphql/schema/cms/resolvers/queryCms.d.ts +2 -2
- package/graphql/schema/cms/resolvers/queryCms.js +1 -1
- package/graphql/schema/cms/resolvers/queryCms.js.map +1 -1
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +2 -2
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +1 -1
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -1
- package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +2 -2
- package/graphql/schema/cms/resolvers/updateEntryRevision.js +1 -1
- package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -1
- package/graphql/schema/cms/typeDefs/mutation.d.ts +2 -2
- package/graphql/schema/cms/typeDefs/mutation.js +1 -1
- package/graphql/schema/cms/typeDefs/mutation.js.map +1 -1
- package/graphql/schema/cms/typeDefs/query.d.ts +2 -2
- package/graphql/schema/cms/typeDefs/query.js +2 -1
- package/graphql/schema/cms/typeDefs/query.js.map +1 -1
- package/graphql/schema/cms/typeDefs/responses.d.ts +2 -2
- package/graphql/schema/cms/typeDefs/responses.js +6 -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 +43 -32
- 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 +68 -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 +4 -2
- package/graphql/schema/createManageResolvers.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/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 +23 -29
- 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 +1 -0
- package/types/model.d.ts +6 -0
- package/types/modelField.d.ts +2 -0
- package/types/types.d.ts +10 -183
- 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/contentModelToJsonSchema/types.js +0 -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/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/extensions/entryHooks/OnEntryBeforeCreate.d.ts +0 -4
- package/extensions/entryHooks/OnEntryBeforeCreate.js +0 -21
- package/extensions/entryHooks/OnEntryBeforeCreate.js.map +0 -1
- package/extensions/entryHooks/index.d.ts +0 -1
- package/extensions/entryHooks/index.js +0 -1
- package/extensions/index.d.ts +0 -5
- package/extensions/index.js +0 -7
- package/extensions/index.js.map +0 -1
- package/features/runtimeTenant/RuntimeTenant.d.ts +0 -13
- package/features/runtimeTenant/RuntimeTenant.js +0 -22
- package/features/runtimeTenant/RuntimeTenant.js.map +0 -1
- package/features/runtimeTenant/abstractions.d.ts +0 -11
- package/features/runtimeTenant/abstractions.js +0 -5
- package/features/runtimeTenant/abstractions.js.map +0 -1
- package/features/runtimeTenant/index.d.ts +0 -2
- package/features/runtimeTenant/index.js +0 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js","sources":["../../src/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { ConvertParams } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport type {\n CmsDynamicZoneTemplate,\n CmsEntryValues,\n CmsModelDynamicZoneField\n} from \"~/types/index.js\";\nimport type { ConverterCollection } from \"~/utils/converters/ConverterCollection.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\ntype DynamicZoneValue = GenericRecord<string>;\n\ninterface ProcessValue {\n templates: CmsDynamicZoneTemplate[];\n value: DynamicZoneValue | null;\n converterCollection: ConverterCollection;\n}\n\nexport class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlugin {\n public override name = \"cms.field.converter.dynamicZone\";\n\n public override getFieldType(): string {\n return \"dynamicZone\";\n }\n\n private getTemplates(field: CmsModelDynamicZoneField): CmsDynamicZoneTemplate[] {\n return field.settings?.templates || [];\n }\n\n public override convertToStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n if (Array.isArray(value)) {\n return {\n [field.storageId]: value.map(item => {\n return this.processToStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n };\n }\n\n // If a multi-value dynamic zone receives anything other than an array, ignore the value.\n return {};\n }\n\n // If a single-value dynamic zone receives an array, ignore the value.\n if (Array.isArray(value)) {\n return {};\n }\n\n const processedValue = this.processToStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.storageId]: processedValue\n };\n }\n\n private processToStorage(params: ProcessValue) {\n const { templates, converterCollection } = params;\n const { value } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const templateId = value._templateId;\n const template = templates.find(t => {\n return templateId === t.id;\n });\n\n if (!template) {\n return undefined;\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertToStorage({\n field,\n value: value ? value[field.fieldId] : undefined\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id\n }\n );\n }\n\n public override convertFromStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n const arrayValue = Array.isArray(value) ? value : [];\n\n return {\n [field.fieldId]: arrayValue
|
|
1
|
+
{"version":3,"file":"fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js","sources":["../../src/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { ConvertParams } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport type {\n CmsDynamicZoneTemplate,\n CmsEntryValues,\n CmsModelDynamicZoneField\n} from \"~/types/index.js\";\nimport type { ConverterCollection } from \"~/utils/converters/ConverterCollection.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\ntype DynamicZoneValue = GenericRecord<string>;\n\ninterface ProcessValue {\n templates: CmsDynamicZoneTemplate[];\n value: DynamicZoneValue | null;\n converterCollection: ConverterCollection;\n}\n\nexport class CmsModelDynamicZoneFieldConverterPlugin extends CmsModelFieldConverterPlugin {\n public override name = \"cms.field.converter.dynamicZone\";\n\n public override getFieldType(): string {\n return \"dynamicZone\";\n }\n\n private getTemplates(field: CmsModelDynamicZoneField): CmsDynamicZoneTemplate[] {\n return field.settings?.templates || [];\n }\n\n public override convertToStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n if (Array.isArray(value)) {\n return {\n [field.storageId]: value.map(item => {\n return this.processToStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n };\n }\n\n // If a multi-value dynamic zone receives anything other than an array, ignore the value.\n return {};\n }\n\n // If a single-value dynamic zone receives an array, ignore the value.\n if (Array.isArray(value)) {\n return {};\n }\n\n const processedValue = this.processToStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.storageId]: processedValue\n };\n }\n\n private processToStorage(params: ProcessValue) {\n const { templates, converterCollection } = params;\n const { value } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const templateId = value._templateId;\n const template = templates.find(t => {\n return templateId === t.id;\n });\n\n if (!template) {\n return undefined;\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertToStorage({\n field,\n value: value ? value[field.fieldId] : undefined\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id\n }\n );\n }\n\n public override convertFromStorage(\n params: ConvertParams<CmsModelDynamicZoneField>\n ): CmsEntryValues {\n const { field, value, converterCollection } = params;\n\n const templates = this.getTemplates(field);\n\n if (templates.length === 0) {\n return {};\n }\n\n if (field.list) {\n const arrayValue = Array.isArray(value) ? value : [];\n\n return {\n [field.fieldId]: arrayValue.map(item => {\n return this.processFromStorage({\n templates,\n converterCollection,\n value: item\n });\n })\n };\n }\n\n if (Array.isArray(value)) {\n throw new WebinyError(\n `Dynamic zone field \"${field.fieldId}\" is expecting a non-array value.`,\n \"DYNAMIC_ZONE_EXPECTING_NON_ARRAY_VALUE\",\n {\n field,\n value\n }\n );\n }\n\n const processedValue = this.processFromStorage({\n templates,\n converterCollection,\n value\n });\n\n return {\n [field.fieldId]: processedValue\n };\n }\n\n private processFromStorage(params: ProcessValue) {\n const { templates, value, converterCollection } = params;\n if (value === null || value === undefined) {\n return undefined;\n }\n\n const { _templateId } = value;\n\n const template = templates.find(t => t.id === _templateId);\n if (!template) {\n throw new WebinyError(\n \"Unknown template - converting from storage.\",\n \"UNKNOWN_TEMPLATE\",\n {\n templateId: _templateId\n }\n );\n }\n\n return template.fields.reduce<GenericRecord<string>>(\n (values, field) => {\n const converter = converterCollection.getConverter(field.type);\n const converted = converter.convertFromStorage({\n field,\n value: value[field.storageId]\n });\n Object.assign(values, converted);\n return values;\n },\n {\n _templateId: template.id\n }\n );\n }\n}\n"],"names":["CmsModelDynamicZoneFieldConverterPlugin","CmsModelFieldConverterPlugin","field","params","value","converterCollection","templates","Array","item","processedValue","templateId","template","t","values","converter","converted","undefined","Object","arrayValue","WebinyError","_templateId"],"mappings":";;AAmBO,MAAMA,gDAAgDC;IAGzC,eAAuB;QACnC,OAAO;IACX;IAEQ,aAAaC,KAA+B,EAA4B;QAC5E,OAAOA,MAAM,QAAQ,EAAE,aAAa,EAAE;IAC1C;IAEgB,iBACZC,MAA+C,EACjC;QACd,MAAM,EAAED,KAAK,EAAEE,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAE9C,MAAMG,YAAY,IAAI,CAAC,YAAY,CAACJ;QAEpC,IAAII,AAAqB,MAArBA,UAAU,MAAM,EAChB,OAAO,CAAC;QAGZ,IAAIJ,MAAM,IAAI,EAAE;YACZ,IAAIK,MAAM,OAAO,CAACH,QACd,OAAO;gBACH,CAACF,MAAM,SAAS,CAAC,EAAEE,MAAM,GAAG,CAACI,CAAAA,OAClB,IAAI,CAAC,gBAAgB,CAAC;wBACzBF;wBACAD;wBACA,OAAOG;oBACX;YAER;YAIJ,OAAO,CAAC;QACZ;QAGA,IAAID,MAAM,OAAO,CAACH,QACd,OAAO,CAAC;QAGZ,MAAMK,iBAAiB,IAAI,CAAC,gBAAgB,CAAC;YACzCH;YACAD;YACAD;QACJ;QAEA,OAAO;YACH,CAACF,MAAM,SAAS,CAAC,EAAEO;QACvB;IACJ;IAEQ,iBAAiBN,MAAoB,EAAE;QAC3C,MAAM,EAAEG,SAAS,EAAED,mBAAmB,EAAE,GAAGF;QAC3C,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,IAAIC,QAAAA,OACA;QAGJ,MAAMM,aAAaN,MAAM,WAAW;QACpC,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IACrBF,eAAeE,EAAE,EAAE;QAG9B,IAAI,CAACD,UACD;QAGJ,OAAOA,SAAS,MAAM,CAAC,MAAM,CACzB,CAACE,QAAQX;YACL,MAAMY,YAAYT,oBAAoB,YAAY,CAACH,MAAM,IAAI;YAC7D,MAAMa,YAAYD,UAAU,gBAAgB,CAAC;gBACzCZ;gBACA,OAAOE,QAAQA,KAAK,CAACF,MAAM,OAAO,CAAC,GAAGc;YAC1C;YACAC,OAAO,MAAM,CAACJ,QAAQE;YACtB,OAAOF;QACX,GACA;YACI,aAAaF,SAAS,EAAE;QAC5B;IAER;IAEgB,mBACZR,MAA+C,EACjC;QACd,MAAM,EAAED,KAAK,EAAEE,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAE9C,MAAMG,YAAY,IAAI,CAAC,YAAY,CAACJ;QAEpC,IAAII,AAAqB,MAArBA,UAAU,MAAM,EAChB,OAAO,CAAC;QAGZ,IAAIJ,MAAM,IAAI,EAAE;YACZ,MAAMgB,aAAaX,MAAM,OAAO,CAACH,SAASA,QAAQ,EAAE;YAEpD,OAAO;gBACH,CAACF,MAAM,OAAO,CAAC,EAAEgB,WAAW,GAAG,CAACV,CAAAA,OACrB,IAAI,CAAC,kBAAkB,CAAC;wBAC3BF;wBACAD;wBACA,OAAOG;oBACX;YAER;QACJ;QAEA,IAAID,MAAM,OAAO,CAACH,QACd,MAAM,IAAIe,MACN,CAAC,oBAAoB,EAAEjB,MAAM,OAAO,CAAC,iCAAiC,CAAC,EACvE,0CACA;YACIA;YACAE;QACJ;QAIR,MAAMK,iBAAiB,IAAI,CAAC,kBAAkB,CAAC;YAC3CH;YACAD;YACAD;QACJ;QAEA,OAAO;YACH,CAACF,MAAM,OAAO,CAAC,EAAEO;QACrB;IACJ;IAEQ,mBAAmBN,MAAoB,EAAE;QAC7C,MAAM,EAAEG,SAAS,EAAEF,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;QAClD,IAAIC,QAAAA,OACA;QAGJ,MAAM,EAAEgB,WAAW,EAAE,GAAGhB;QAExB,MAAMO,WAAWL,UAAU,IAAI,CAACM,CAAAA,IAAKA,EAAE,EAAE,KAAKQ;QAC9C,IAAI,CAACT,UACD,MAAM,IAAIQ,MACN,+CACA,oBACA;YACI,YAAYC;QAChB;QAIR,OAAOT,SAAS,MAAM,CAAC,MAAM,CACzB,CAACE,QAAQX;YACL,MAAMY,YAAYT,oBAAoB,YAAY,CAACH,MAAM,IAAI;YAC7D,MAAMa,YAAYD,UAAU,kBAAkB,CAAC;gBAC3CZ;gBACA,OAAOE,KAAK,CAACF,MAAM,SAAS,CAAC;YACjC;YACAe,OAAO,MAAM,CAACJ,QAAQE;YACtB,OAAOF;QACX,GACA;YACI,aAAaF,SAAS,EAAE;QAC5B;IAER;;QAvKG,qBACa,IAAI,GAAG;;AAuK3B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
import type { CmsModelFieldConverterPlugin } from "../plugins/CmsModelFieldConverterPlugin.js";
|
|
3
|
+
/**
|
|
4
|
+
* Multi-instance DI token for CMS field value converters (fieldId <-> storageId).
|
|
5
|
+
* Replaces reading CmsModelFieldConverterPlugin instances from the plugins container.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CmsFieldConverter: import("@webiny/di").Abstraction<CmsModelFieldConverterPlugin>;
|
|
8
|
+
export declare namespace CmsFieldConverter {
|
|
9
|
+
type Interface = CmsModelFieldConverterPlugin;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Registers the built-in field converters as CmsFieldConverter implementations.
|
|
13
|
+
*/
|
|
14
|
+
export declare const registerFieldConverters: (container: Container) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
import { CmsModelObjectFieldConverterPlugin } from "./CmsModelObjectFieldConverterPlugin.js";
|
|
3
|
+
import { CmsModelDefaultFieldConverterPlugin } from "./CmsModelDefaultFieldConverterPlugin.js";
|
|
4
|
+
import { CmsModelDynamicZoneFieldConverterPlugin } from "./CmsModelDynamicZoneFieldConverterPlugin.js";
|
|
5
|
+
const CmsFieldConverter = createAbstraction("CmsFieldConverter");
|
|
6
|
+
const registerFieldConverters = (container)=>{
|
|
7
|
+
container.registerInstance(CmsFieldConverter, new CmsModelObjectFieldConverterPlugin());
|
|
8
|
+
container.registerInstance(CmsFieldConverter, new CmsModelDynamicZoneFieldConverterPlugin());
|
|
9
|
+
container.registerInstance(CmsFieldConverter, new CmsModelDefaultFieldConverterPlugin());
|
|
10
|
+
};
|
|
11
|
+
export { CmsFieldConverter, registerFieldConverters };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldConverters/abstractions.js","sources":["../../src/fieldConverters/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Container } from \"@webiny/di\";\nimport type { CmsModelFieldConverterPlugin } from \"~/plugins/CmsModelFieldConverterPlugin.js\";\nimport { CmsModelObjectFieldConverterPlugin } from \"~/fieldConverters/CmsModelObjectFieldConverterPlugin.js\";\nimport { CmsModelDefaultFieldConverterPlugin } from \"~/fieldConverters/CmsModelDefaultFieldConverterPlugin.js\";\nimport { CmsModelDynamicZoneFieldConverterPlugin } from \"~/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js\";\n\n/**\n * Multi-instance DI token for CMS field value converters (fieldId <-> storageId).\n * Replaces reading CmsModelFieldConverterPlugin instances from the plugins container.\n */\nexport const CmsFieldConverter =\n createAbstraction<CmsModelFieldConverterPlugin>(\"CmsFieldConverter\");\n\nexport namespace CmsFieldConverter {\n export type Interface = CmsModelFieldConverterPlugin;\n}\n\n/**\n * Registers the built-in field converters as CmsFieldConverter implementations.\n */\nexport const registerFieldConverters = (container: Container): void => {\n container.registerInstance(CmsFieldConverter, new CmsModelObjectFieldConverterPlugin());\n container.registerInstance(CmsFieldConverter, new CmsModelDynamicZoneFieldConverterPlugin());\n container.registerInstance(CmsFieldConverter, new CmsModelDefaultFieldConverterPlugin());\n};\n"],"names":["CmsFieldConverter","createAbstraction","registerFieldConverters","container","CmsModelObjectFieldConverterPlugin","CmsModelDynamicZoneFieldConverterPlugin","CmsModelDefaultFieldConverterPlugin"],"mappings":";;;;AAWO,MAAMA,oBACTC,kBAAgD;AAS7C,MAAMC,0BAA0B,CAACC;IACpCA,UAAU,gBAAgB,CAACH,mBAAmB,IAAII;IAClDD,UAAU,gBAAgB,CAACH,mBAAmB,IAAIK;IAClDF,UAAU,gBAAgB,CAACH,mBAAmB,IAAIM;AACtD"}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
import { CmsModelObjectFieldConverterPlugin } from "../fieldConverters/CmsModelObjectFieldConverterPlugin.js";
|
|
5
5
|
import { CmsModelDefaultFieldConverterPlugin } from "../fieldConverters/CmsModelDefaultFieldConverterPlugin.js";
|
|
6
6
|
import { CmsModelDynamicZoneFieldConverterPlugin } from "../fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js";
|
|
7
|
-
export declare const createFieldConverters: () => (
|
|
7
|
+
export declare const createFieldConverters: () => (CmsModelDefaultFieldConverterPlugin | CmsModelDynamicZoneFieldConverterPlugin | CmsModelObjectFieldConverterPlugin)[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
|
|
2
|
+
export interface ICmsGraphQLSchemaFactory {
|
|
3
|
+
execute(): ICmsGraphQLSchemaPlugin<any>[] | Promise<ICmsGraphQLSchemaPlugin<any>[]>;
|
|
4
|
+
}
|
|
5
|
+
export declare const CmsGraphQLSchemaFactory: import("@webiny/di").Abstraction<ICmsGraphQLSchemaFactory>;
|
|
6
|
+
export declare namespace CmsGraphQLSchemaFactory {
|
|
7
|
+
type Interface = ICmsGraphQLSchemaFactory;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/CmsGraphQLSchemaFactory.js","sources":["../../src/graphql/CmsGraphQLSchemaFactory.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\nexport interface ICmsGraphQLSchemaFactory {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n execute(): ICmsGraphQLSchemaPlugin<any>[] | Promise<ICmsGraphQLSchemaPlugin<any>[]>;\n}\n\nexport const CmsGraphQLSchemaFactory =\n createAbstraction<ICmsGraphQLSchemaFactory>(\"CmsGraphQLSchemaFactory\");\n\nexport namespace CmsGraphQLSchemaFactory {\n export type Interface = ICmsGraphQLSchemaFactory;\n}\n"],"names":["CmsGraphQLSchemaFactory","createAbstraction"],"mappings":";AAQO,MAAMA,0BACTC,kBAA4C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiEndpoint } from "../types/index.js";
|
|
2
|
+
import type { GraphQLRequestBody } from "@webiny/api-graphql/types.js";
|
|
3
|
+
import type { ExecutionResult } from "graphql";
|
|
4
|
+
export interface ICmsSchemaExecutor {
|
|
5
|
+
execute(type: ApiEndpoint, body: GraphQLRequestBody | GraphQLRequestBody[]): Promise<ExecutionResult | ExecutionResult[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare const CmsSchemaExecutor: import("@webiny/di").Abstraction<ICmsSchemaExecutor>;
|
|
8
|
+
export declare namespace CmsSchemaExecutor {
|
|
9
|
+
type Interface = ICmsSchemaExecutor;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/CmsSchemaExecutor.js","sources":["../../src/graphql/CmsSchemaExecutor.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { GraphQLRequestBody } from \"@webiny/api-graphql/types.js\";\nimport type { ExecutionResult } from \"graphql\";\n\nexport interface ICmsSchemaExecutor {\n execute(\n type: ApiEndpoint,\n body: GraphQLRequestBody | GraphQLRequestBody[]\n ): Promise<ExecutionResult | ExecutionResult[]>;\n}\n\nexport const CmsSchemaExecutor = createAbstraction<ICmsSchemaExecutor>(\"CmsSchemaExecutor\");\n\nexport namespace CmsSchemaExecutor {\n export type Interface = ICmsSchemaExecutor;\n}\n"],"names":["CmsSchemaExecutor","createAbstraction"],"mappings":";AAYO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CmsContext, CmsModel } from "../types/index.js";
|
|
1
|
+
import type { ApiEndpoint, CmsContext, CmsModel } from "../types/index.js";
|
|
2
2
|
import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* This factory is called whenever we need to generate graphql-schema plugins using the current context.
|
|
@@ -6,6 +6,7 @@ import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
|
|
|
6
6
|
interface BuildSchemaPluginsParams {
|
|
7
7
|
context: CmsContext;
|
|
8
8
|
models: CmsModel[];
|
|
9
|
+
type: ApiEndpoint | null;
|
|
9
10
|
}
|
|
10
11
|
export declare const buildSchemaPlugins: (params: BuildSchemaPluginsParams) => Promise<ICmsGraphQLSchemaPlugin[]>;
|
|
11
12
|
export {};
|
|
@@ -4,9 +4,7 @@ import { createGroupsSchema } from "./schema/contentModelGroups.js";
|
|
|
4
4
|
import { createBaseContentSchema } from "./schema/baseContentSchema.js";
|
|
5
5
|
import { generateSchemaPlugins } from "./schema/schemaPlugins.js";
|
|
6
6
|
const buildSchemaPlugins = async (params)=>[
|
|
7
|
-
createBaseContentSchema(
|
|
8
|
-
context: params.context
|
|
9
|
-
}),
|
|
7
|
+
createBaseContentSchema(),
|
|
10
8
|
createModelsSchema({
|
|
11
9
|
context: params.context
|
|
12
10
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/buildSchemaPlugins.js","sources":["../../src/graphql/buildSchemaPlugins.ts"],"sourcesContent":["import type { CmsContext, CmsModel } from \"~/types/index.js\";\nimport { createModelsSchema } from \"./schema/contentModels.js\";\nimport { createContentEntriesSchema } from \"./schema/contentEntries.js\";\nimport { createGroupsSchema } from \"./schema/contentModelGroups.js\";\nimport { createBaseContentSchema } from \"./schema/baseContentSchema.js\";\nimport { generateSchemaPlugins } from \"./schema/schemaPlugins.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\n/**\n * This factory is called whenever we need to generate graphql-schema plugins using the current context.\n */\ninterface BuildSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n}\nexport const buildSchemaPlugins = async (\n params: BuildSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n return [\n // Base GQL types and scalars\n createBaseContentSchema(
|
|
1
|
+
{"version":3,"file":"graphql/buildSchemaPlugins.js","sources":["../../src/graphql/buildSchemaPlugins.ts"],"sourcesContent":["import type { ApiEndpoint, CmsContext, CmsModel } from \"~/types/index.js\";\nimport { createModelsSchema } from \"./schema/contentModels.js\";\nimport { createContentEntriesSchema } from \"./schema/contentEntries.js\";\nimport { createGroupsSchema } from \"./schema/contentModelGroups.js\";\nimport { createBaseContentSchema } from \"./schema/baseContentSchema.js\";\nimport { generateSchemaPlugins } from \"./schema/schemaPlugins.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\n/**\n * This factory is called whenever we need to generate graphql-schema plugins using the current context.\n */\ninterface BuildSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n type: ApiEndpoint | null;\n}\nexport const buildSchemaPlugins = async (\n params: BuildSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n return [\n // Base GQL types and scalars\n createBaseContentSchema(),\n createModelsSchema({\n context: params.context\n }),\n createContentEntriesSchema({\n context: params.context\n }),\n createGroupsSchema({\n context: params.context\n }),\n // Dynamic schema\n ...(await generateSchemaPlugins(params))\n ].filter(Boolean);\n};\n"],"names":["buildSchemaPlugins","params","createBaseContentSchema","createModelsSchema","createContentEntriesSchema","createGroupsSchema","generateSchemaPlugins","Boolean"],"mappings":";;;;;AAgBO,MAAMA,qBAAqB,OAC9BC,SAEO;QAEHC;QACAC,mBAAmB;YACf,SAASF,OAAO,OAAO;QAC3B;QACAG,2BAA2B;YACvB,SAASH,OAAO,OAAO;QAC3B;QACAI,mBAAmB;YACf,SAASJ,OAAO,OAAO;QAC3B;WAEI,MAAMK,sBAAsBL;KACnC,CAAC,MAAM,CAACM"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
|
|
1
2
|
import { NotAuthorizedError } from "../utils/errors.js";
|
|
3
|
+
import { HeadlessCmsEndpointConfig } from "../HeadlessCmsEndpointConfig.js";
|
|
2
4
|
const checkEndpointAccess = async (context)=>{
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
+
const endpointType = context.container.resolve(HeadlessCmsEndpointConfig).type;
|
|
6
|
+
const permission = await context.container.resolve(IdentityContext).getPermission(`cms.endpoint.${endpointType}`);
|
|
7
|
+
if (!permission) throw new NotAuthorizedError(`Not allowed to access "${endpointType}" endpoint.`);
|
|
5
8
|
};
|
|
6
9
|
export { checkEndpointAccess };
|
|
7
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/checkEndpointAccess.js","sources":["../../src/graphql/checkEndpointAccess.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport { NotAuthorizedError } from \"~/utils/errors.js\";\n\nexport const checkEndpointAccess = async (context: CmsContext): Promise<void> => {\n const permission = await context.
|
|
1
|
+
{"version":3,"file":"graphql/checkEndpointAccess.js","sources":["../../src/graphql/checkEndpointAccess.ts"],"sourcesContent":["import { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/abstractions.js\";\nimport type { CmsContext } from \"~/types/index.js\";\nimport { NotAuthorizedError } from \"~/utils/errors.js\";\nimport { HeadlessCmsEndpointConfig } from \"~/HeadlessCmsEndpointConfig.js\";\n\nexport const checkEndpointAccess = async (context: CmsContext): Promise<void> => {\n const endpointType = context.container.resolve(HeadlessCmsEndpointConfig).type;\n const permission = await context.container\n .resolve(IdentityContext)\n .getPermission(`cms.endpoint.${endpointType}`);\n if (!permission) {\n throw new NotAuthorizedError(`Not allowed to access \"${endpointType}\" endpoint.`);\n }\n};\n"],"names":["checkEndpointAccess","context","endpointType","HeadlessCmsEndpointConfig","permission","IdentityContext","NotAuthorizedError"],"mappings":";;;AAKO,MAAMA,sBAAsB,OAAOC;IACtC,MAAMC,eAAeD,QAAQ,SAAS,CAAC,OAAO,CAACE,2BAA2B,IAAI;IAC9E,MAAMC,aAAa,MAAMH,QAAQ,SAAS,CACrC,OAAO,CAACI,iBACR,aAAa,CAAC,CAAC,aAAa,EAAEH,cAAc;IACjD,IAAI,CAACE,YACD,MAAM,IAAIE,mBAAmB,CAAC,uBAAuB,EAAEJ,aAAa,WAAW,CAAC;AAExF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ICmsGraphQLSchemaPlugin } from "../plugins/index.js";
|
|
2
2
|
import type { GraphQLSchema } from "graphql";
|
|
3
3
|
interface Params {
|
|
4
|
-
plugins: ICmsGraphQLSchemaPlugin[];
|
|
4
|
+
plugins: ICmsGraphQLSchemaPlugin<any>[];
|
|
5
5
|
}
|
|
6
6
|
export declare const assertFieldDescriptionsAreStrings: (schema: GraphQLSchema) => void;
|
|
7
7
|
export declare const createExecutableSchema: (params: Params) => GraphQLSchema;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeExecutableSchema } from "@graphql-tools/schema";
|
|
2
2
|
import { mergeResolvers } from "@graphql-tools/merge";
|
|
3
|
-
import { ResolverDecoration } from "@webiny/
|
|
3
|
+
import { ResolverDecoration } from "@webiny/api-graphql";
|
|
4
4
|
const assertFieldDescriptionsAreStrings = (schema)=>{
|
|
5
5
|
const typeMap = schema.getTypeMap();
|
|
6
6
|
for (const type of Object.values(typeMap)){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/createExecutableSchema.js","sources":["../../src/graphql/createExecutableSchema.ts"],"sourcesContent":["import { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { mergeResolvers } from \"@graphql-tools/merge\";\nimport { ResolverDecoration } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"graphql/createExecutableSchema.js","sources":["../../src/graphql/createExecutableSchema.ts"],"sourcesContent":["import { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { mergeResolvers } from \"@graphql-tools/merge\";\nimport { ResolverDecoration } from \"@webiny/api-graphql\";\nimport type { Resolvers, TypeDefs } from \"@webiny/api-graphql/types.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport type { GraphQLField, GraphQLSchema } from \"graphql\";\n\ninterface Params {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plugins: ICmsGraphQLSchemaPlugin<any>[];\n}\n\nexport const assertFieldDescriptionsAreStrings = (schema: GraphQLSchema): void => {\n const typeMap = schema.getTypeMap();\n\n for (const type of Object.values(typeMap)) {\n if (typeof (type as any).getFields !== \"function\") {\n continue;\n }\n\n const fields = (type as any).getFields() as Record<string, GraphQLField<any, any>>;\n for (const field of Object.values(fields)) {\n const desc = (field as any).description;\n if (desc !== null && desc !== undefined && typeof desc !== \"string\") {\n const message = `Invalid description type on ${type.name}.${field.name}: ${typeof desc}`;\n console.log(message);\n throw new Error(message);\n }\n }\n }\n};\n\nexport const createExecutableSchema = (params: Params) => {\n const { plugins } = params;\n\n const typeDefs: TypeDefs[] = [];\n const resolvers: Resolvers<any>[] = [];\n\n const resolverDecoration = new ResolverDecoration();\n\n // Get schema definitions from plugins\n for (const plugin of plugins) {\n const schema = plugin.schema;\n if (schema.typeDefs) {\n typeDefs.push(schema.typeDefs);\n }\n if (schema.resolvers) {\n resolvers.push(schema.resolvers);\n }\n if (schema.resolverDecorators) {\n resolverDecoration.addDecorators(schema.resolverDecorators);\n }\n }\n\n const executableSchema = makeExecutableSchema({\n typeDefs,\n resolvers: resolverDecoration.decorateResolvers(mergeResolvers(resolvers))\n });\n assertFieldDescriptionsAreStrings(executableSchema);\n\n return executableSchema;\n};\n"],"names":["assertFieldDescriptionsAreStrings","schema","typeMap","type","Object","fields","field","desc","message","console","Error","createExecutableSchema","params","plugins","typeDefs","resolvers","resolverDecoration","ResolverDecoration","plugin","executableSchema","makeExecutableSchema","mergeResolvers"],"mappings":";;;AAYO,MAAMA,oCAAoC,CAACC;IAC9C,MAAMC,UAAUD,OAAO,UAAU;IAEjC,KAAK,MAAME,QAAQC,OAAO,MAAM,CAACF,SAAU;QACvC,IAAI,AAAmC,cAAnC,OAAQC,KAAa,SAAS,EAC9B;QAGJ,MAAME,SAAUF,KAAa,SAAS;QACtC,KAAK,MAAMG,SAASF,OAAO,MAAM,CAACC,QAAS;YACvC,MAAME,OAAQD,MAAc,WAAW;YACvC,IAAIC,QAAAA,QAAuC,AAAgB,YAAhB,OAAOA,MAAmB;gBACjE,MAAMC,UAAU,CAAC,4BAA4B,EAAEL,KAAK,IAAI,CAAC,CAAC,EAAEG,MAAM,IAAI,CAAC,EAAE,EAAE,OAAOC,MAAM;gBACxFE,QAAQ,GAAG,CAACD;gBACZ,MAAM,IAAIE,MAAMF;YACpB;QACJ;IACJ;AACJ;AAEO,MAAMG,yBAAyB,CAACC;IACnC,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,MAAME,WAAuB,EAAE;IAC/B,MAAMC,YAA8B,EAAE;IAEtC,MAAMC,qBAAqB,IAAIC;IAG/B,KAAK,MAAMC,UAAUL,QAAS;QAC1B,MAAMZ,SAASiB,OAAO,MAAM;QAC5B,IAAIjB,OAAO,QAAQ,EACfa,SAAS,IAAI,CAACb,OAAO,QAAQ;QAEjC,IAAIA,OAAO,SAAS,EAChBc,UAAU,IAAI,CAACd,OAAO,SAAS;QAEnC,IAAIA,OAAO,kBAAkB,EACzBe,mBAAmB,aAAa,CAACf,OAAO,kBAAkB;IAElE;IAEA,MAAMkB,mBAAmBC,qBAAqB;QAC1CN;QACA,WAAWE,mBAAmB,iBAAiB,CAACK,eAAeN;IACnE;IACAf,kCAAkCmB;IAElC,OAAOA;AACX"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CmsContext, CmsModel } from "../types/index.js";
|
|
1
|
+
import type { ApiEndpoint, CmsContext, CmsModel } from "../types/index.js";
|
|
2
2
|
import type { GraphQLSchema } from "graphql/type/index.js";
|
|
3
3
|
interface GenerateSchemaParams {
|
|
4
4
|
context: CmsContext;
|
|
5
5
|
models: CmsModel[];
|
|
6
|
+
type: ApiEndpoint | null;
|
|
6
7
|
}
|
|
7
8
|
export declare const generateSchema: (params: GenerateSchemaParams) => Promise<GraphQLSchema>;
|
|
8
9
|
export {};
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { buildSchemaPlugins } from "./buildSchemaPlugins.js";
|
|
2
2
|
import { createExecutableSchema } from "./createExecutableSchema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CmsGraphQLSchemaFactory } from "./CmsGraphQLSchemaFactory.js";
|
|
4
4
|
const generateSchema = async (params)=>{
|
|
5
|
-
const { context, models } = params;
|
|
5
|
+
const { context, models, type } = params;
|
|
6
6
|
let generatedSchemaPlugins = [];
|
|
7
7
|
try {
|
|
8
8
|
generatedSchemaPlugins = await buildSchemaPlugins({
|
|
9
9
|
context,
|
|
10
|
-
models
|
|
10
|
+
models,
|
|
11
|
+
type
|
|
11
12
|
});
|
|
12
13
|
} catch (ex) {
|
|
13
14
|
console.log("Error while building schema plugins.");
|
|
14
15
|
throw ex;
|
|
15
16
|
}
|
|
16
|
-
context.
|
|
17
|
-
const
|
|
17
|
+
const staticFactories = context.container.resolveAll(CmsGraphQLSchemaFactory);
|
|
18
|
+
const staticPlugins = [];
|
|
19
|
+
for (const factory of staticFactories){
|
|
20
|
+
const plugins = await factory.execute();
|
|
21
|
+
staticPlugins.push(...plugins);
|
|
22
|
+
}
|
|
23
|
+
const schemaPlugins = [
|
|
24
|
+
...staticPlugins,
|
|
25
|
+
...generatedSchemaPlugins
|
|
26
|
+
].filter((pl)=>{
|
|
18
27
|
if ("function" == typeof pl.isApplicable) return pl.isApplicable(context);
|
|
19
28
|
return true;
|
|
20
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/generateSchema.js","sources":["../../src/graphql/generateSchema.ts"],"sourcesContent":["import type { CmsContext, CmsModel } from \"~/types/index.js\";\nimport { buildSchemaPlugins } from \"./buildSchemaPlugins.js\";\nimport { createExecutableSchema } from \"./createExecutableSchema.js\";\nimport type { GraphQLSchema } from \"graphql/type/index.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"graphql/generateSchema.js","sources":["../../src/graphql/generateSchema.ts"],"sourcesContent":["import type { ApiEndpoint, CmsContext, CmsModel } from \"~/types/index.js\";\nimport { buildSchemaPlugins } from \"./buildSchemaPlugins.js\";\nimport { createExecutableSchema } from \"./createExecutableSchema.js\";\nimport type { GraphQLSchema } from \"graphql/type/index.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { CmsGraphQLSchemaFactory } from \"./CmsGraphQLSchemaFactory.js\";\n\ninterface GenerateSchemaParams {\n context: CmsContext;\n models: CmsModel[];\n type: ApiEndpoint | null;\n}\nexport const generateSchema = async (params: GenerateSchemaParams): Promise<GraphQLSchema> => {\n const { context, models, type } = params;\n\n let generatedSchemaPlugins: ICmsGraphQLSchemaPlugin[] = [];\n try {\n generatedSchemaPlugins = await buildSchemaPlugins({ context, models, type });\n } catch (ex) {\n console.log(`Error while building schema plugins.`);\n throw ex;\n }\n\n const staticFactories = context.container.resolveAll(CmsGraphQLSchemaFactory);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const staticPlugins: ICmsGraphQLSchemaPlugin<any>[] = [];\n for (const factory of staticFactories) {\n const plugins = await factory.execute();\n staticPlugins.push(...plugins);\n }\n\n const schemaPlugins = [...staticPlugins, ...generatedSchemaPlugins].filter(pl => {\n if (typeof pl.isApplicable === \"function\") {\n return pl.isApplicable(context);\n }\n return true;\n });\n\n return createExecutableSchema({ plugins: schemaPlugins });\n};\n"],"names":["generateSchema","params","context","models","type","generatedSchemaPlugins","buildSchemaPlugins","ex","console","staticFactories","CmsGraphQLSchemaFactory","staticPlugins","factory","plugins","schemaPlugins","pl","createExecutableSchema"],"mappings":";;;AAYO,MAAMA,iBAAiB,OAAOC;IACjC,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGH;IAElC,IAAII,yBAAoD,EAAE;IAC1D,IAAI;QACAA,yBAAyB,MAAMC,mBAAmB;YAAEJ;YAASC;YAAQC;QAAK;IAC9E,EAAE,OAAOG,IAAI;QACTC,QAAQ,GAAG,CAAC;QACZ,MAAMD;IACV;IAEA,MAAME,kBAAkBP,QAAQ,SAAS,CAAC,UAAU,CAACQ;IAErD,MAAMC,gBAAgD,EAAE;IACxD,KAAK,MAAMC,WAAWH,gBAAiB;QACnC,MAAMI,UAAU,MAAMD,QAAQ,OAAO;QACrCD,cAAc,IAAI,IAAIE;IAC1B;IAEA,MAAMC,gBAAgB;WAAIH;WAAkBN;KAAuB,CAAC,MAAM,CAACU,CAAAA;QACvE,IAAI,AAA2B,cAA3B,OAAOA,GAAG,YAAY,EACtB,OAAOA,GAAG,YAAY,CAACb;QAE3B,OAAO;IACX;IAEA,OAAOc,uBAAuB;QAAE,SAASF;IAAc;AAC3D"}
|
package/graphql/getSchema.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { codeFrameColumns } from "@babel/code-frame";
|
|
2
2
|
import error from "@webiny/error";
|
|
3
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
|
|
3
4
|
import { generateSchema } from "./generateSchema.js";
|
|
4
5
|
import { generateCacheId } from "./getSchema/generateCacheId.js";
|
|
5
6
|
import { generateCacheKey } from "./getSchema/generateCacheKey.js";
|
|
7
|
+
import { ListModelsUseCase } from "../features/contentModel/ListModels/index.js";
|
|
8
|
+
import { HeadlessCmsEndpointConfig } from "../HeadlessCmsEndpointConfig.js";
|
|
6
9
|
const schemaList = new Map();
|
|
7
10
|
const getSchema = async (params)=>{
|
|
8
11
|
const { context } = params;
|
|
9
|
-
const
|
|
12
|
+
const modelsResult = await context.container.resolve(IdentityContext).withoutAuthorization(async ()=>context.container.resolve(ListModelsUseCase).execute({
|
|
10
13
|
includePrivate: false,
|
|
11
14
|
includePlugins: true
|
|
12
15
|
}));
|
|
16
|
+
if (modelsResult.isFail()) throw modelsResult.error;
|
|
17
|
+
const models = modelsResult.value;
|
|
13
18
|
const cacheId = generateCacheId(params);
|
|
14
19
|
const cacheKey = await generateCacheKey({
|
|
15
20
|
...params,
|
|
@@ -33,7 +38,7 @@ const getSchema = async (params)=>{
|
|
|
33
38
|
code: err.code || "INVALID_GRAPHQL_SCHEMA_LOCATIONS",
|
|
34
39
|
data: {
|
|
35
40
|
...err.data || {},
|
|
36
|
-
endpoint: context.
|
|
41
|
+
endpoint: context.container.resolve(HeadlessCmsEndpointConfig).type
|
|
37
42
|
}
|
|
38
43
|
});
|
|
39
44
|
const [location] = err.locations;
|
package/graphql/getSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/getSchema.js","sources":["../../src/graphql/getSchema.ts"],"sourcesContent":["import { codeFrameColumns } from \"@babel/code-frame\";\nimport WebinyError from \"@webiny/error\";\nimport { generateSchema } from \"./generateSchema.js\";\nimport type { ApiEndpoint, CmsContext } from \"~/types/index.js\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { generateCacheId } from \"./getSchema/generateCacheId.js\";\nimport { generateCacheKey } from \"./getSchema/generateCacheKey.js\";\nimport type { Tenant } from \"@webiny/api-core/types/tenancy.js\";\n\ninterface SchemaCache {\n key: string;\n schema: GraphQLSchema;\n}\n\ninterface GetSchemaParams {\n context: CmsContext;\n type: ApiEndpoint;\n getTenant: () => Tenant;\n}\n\nconst schemaList = new Map<string, SchemaCache>();\n\n/**\n * Gets an existing schema or rewrites existing one or creates a completely new one\n * depending on the schemaId created from type\n */\nexport const getSchema = async (params: GetSchemaParams): Promise<GraphQLSchema> => {\n const { context } = params;\n\n /**\n * We need all the API models.\n * Private models are hidden in the GraphQL, so filter them out.\n */\n const
|
|
1
|
+
{"version":3,"file":"graphql/getSchema.js","sources":["../../src/graphql/getSchema.ts"],"sourcesContent":["import { codeFrameColumns } from \"@babel/code-frame\";\nimport WebinyError from \"@webiny/error\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/abstractions.js\";\nimport { generateSchema } from \"./generateSchema.js\";\nimport type { ApiEndpoint, CmsContext } from \"~/types/index.js\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { generateCacheId } from \"./getSchema/generateCacheId.js\";\nimport { generateCacheKey } from \"./getSchema/generateCacheKey.js\";\nimport type { Tenant } from \"@webiny/api-core/types/tenancy.js\";\nimport { ListModelsUseCase } from \"~/features/contentModel/ListModels/index.js\";\nimport { HeadlessCmsEndpointConfig } from \"~/HeadlessCmsEndpointConfig.js\";\n\ninterface SchemaCache {\n key: string;\n schema: GraphQLSchema;\n}\n\ninterface GetSchemaParams {\n context: CmsContext;\n type: ApiEndpoint;\n getTenant: () => Tenant;\n}\n\nconst schemaList = new Map<string, SchemaCache>();\n\n/**\n * Gets an existing schema or rewrites existing one or creates a completely new one\n * depending on the schemaId created from type\n */\nexport const getSchema = async (params: GetSchemaParams): Promise<GraphQLSchema> => {\n const { context } = params;\n\n /**\n * We need all the API models.\n * Private models are hidden in the GraphQL, so filter them out.\n */\n const modelsResult = await context.container\n .resolve(IdentityContext)\n .withoutAuthorization(async () => {\n return context.container.resolve(ListModelsUseCase).execute({\n includePrivate: false,\n includePlugins: true\n });\n });\n if (modelsResult.isFail()) {\n throw modelsResult.error;\n }\n const models = modelsResult.value;\n\n const cacheId = generateCacheId(params);\n\n const cacheKey = await generateCacheKey({ ...params, models });\n const cachedSchema = schemaList.get(cacheId);\n if (cachedSchema?.key === cacheKey) {\n return cachedSchema.schema;\n }\n\n try {\n const schema = await generateSchema({\n ...params,\n models\n });\n schemaList.set(cacheId, {\n key: cacheKey,\n schema\n });\n return schema;\n } catch (err) {\n if (!Array.isArray(err.locations)) {\n throw new WebinyError({\n message: err.message,\n code: err.code || \"INVALID_GRAPHQL_SCHEMA_LOCATIONS\",\n data: {\n ...(err.data || {}),\n endpoint: context.container.resolve(HeadlessCmsEndpointConfig).type\n }\n });\n }\n const [location] = err.locations;\n\n throw new WebinyError({\n code: \"INVALID_GRAPHQL_SCHEMA\",\n message: err.message,\n data: {\n invalidSegment: codeFrameColumns(err.source.body, {\n start: {\n line: location.line,\n column: location.column\n }\n })\n }\n });\n }\n};\n"],"names":["schemaList","Map","getSchema","params","context","modelsResult","IdentityContext","ListModelsUseCase","models","cacheId","generateCacheId","cacheKey","generateCacheKey","cachedSchema","schema","generateSchema","err","Array","WebinyError","HeadlessCmsEndpointConfig","location","codeFrameColumns"],"mappings":";;;;;;;;AAuBA,MAAMA,aAAa,IAAIC;AAMhB,MAAMC,YAAY,OAAOC;IAC5B,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAMpB,MAAME,eAAe,MAAMD,QAAQ,SAAS,CACvC,OAAO,CAACE,iBACR,oBAAoB,CAAC,UACXF,QAAQ,SAAS,CAAC,OAAO,CAACG,mBAAmB,OAAO,CAAC;YACxD,gBAAgB;YAChB,gBAAgB;QACpB;IAER,IAAIF,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;IAE5B,MAAMG,SAASH,aAAa,KAAK;IAEjC,MAAMI,UAAUC,gBAAgBP;IAEhC,MAAMQ,WAAW,MAAMC,iBAAiB;QAAE,GAAGT,MAAM;QAAEK;IAAO;IAC5D,MAAMK,eAAeb,WAAW,GAAG,CAACS;IACpC,IAAII,cAAc,QAAQF,UACtB,OAAOE,aAAa,MAAM;IAG9B,IAAI;QACA,MAAMC,SAAS,MAAMC,eAAe;YAChC,GAAGZ,MAAM;YACTK;QACJ;QACAR,WAAW,GAAG,CAACS,SAAS;YACpB,KAAKE;YACLG;QACJ;QACA,OAAOA;IACX,EAAE,OAAOE,KAAK;QACV,IAAI,CAACC,MAAM,OAAO,CAACD,IAAI,SAAS,GAC5B,MAAM,IAAIE,MAAY;YAClB,SAASF,IAAI,OAAO;YACpB,MAAMA,IAAI,IAAI,IAAI;YAClB,MAAM;gBACF,GAAIA,IAAI,IAAI,IAAI,CAAC,CAAC;gBAClB,UAAUZ,QAAQ,SAAS,CAAC,OAAO,CAACe,2BAA2B,IAAI;YACvE;QACJ;QAEJ,MAAM,CAACC,SAAS,GAAGJ,IAAI,SAAS;QAEhC,MAAM,IAAIE,MAAY;YAClB,MAAM;YACN,SAASF,IAAI,OAAO;YACpB,MAAM;gBACF,gBAAgBK,iBAAiBL,IAAI,MAAM,CAAC,IAAI,EAAE;oBAC9C,OAAO;wBACH,MAAMI,SAAS,IAAI;wBACnB,QAAQA,SAAS,MAAM;oBAC3B;gBACJ;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { GraphQLScalarPlugin } from "@webiny/
|
|
1
|
+
import type { GraphQLScalarPlugin } from "@webiny/api-graphql/types.js";
|
|
2
2
|
export declare const createRevisionIdScalarPlugin: () => GraphQLScalarPlugin[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/scalars/RevisionIdScalarPlugin.js","sources":["../../../src/graphql/scalars/RevisionIdScalarPlugin.ts"],"sourcesContent":["import type { GraphQLScalarPlugin } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"graphql/scalars/RevisionIdScalarPlugin.js","sources":["../../../src/graphql/scalars/RevisionIdScalarPlugin.ts"],"sourcesContent":["import type { GraphQLScalarPlugin } from \"@webiny/api-graphql/types.js\";\nimport { RevisionIdScalar } from \"~/graphql/scalars/RevisionId.js\";\n\nexport const createRevisionIdScalarPlugin = (): GraphQLScalarPlugin[] => {\n const plugin: GraphQLScalarPlugin = {\n name: \"headlessCms.graphql.revisionIdScalar\",\n type: \"graphql-scalar\",\n scalar: RevisionIdScalar\n };\n return [plugin];\n};\n"],"names":["createRevisionIdScalarPlugin","plugin","RevisionIdScalar"],"mappings":";AAGO,MAAMA,+BAA+B;IACxC,MAAMC,SAA8B;QAChC,MAAM;QACN,MAAM;QACN,QAAQC;IACZ;IACA,OAAO;QAACD;KAAO;AACnB"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import type { CmsContext } from "../../types/index.js";
|
|
2
1
|
import type { ICmsGraphQLSchemaPlugin } from "../../plugins/index.js";
|
|
3
|
-
|
|
4
|
-
context: CmsContext;
|
|
5
|
-
}
|
|
6
|
-
export declare const createBaseContentSchema: ({ context }: Params) => ICmsGraphQLSchemaPlugin;
|
|
7
|
-
export {};
|
|
2
|
+
export declare const createBaseContentSchema: () => ICmsGraphQLSchemaPlugin;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnyScalar, DateScalar, DateTimeScalar, DateTimeZScalar, IconScalar, JsonScalar, LongScalar, NumberScalar, RefInputScalar, TimeScalar } from "@webiny/
|
|
1
|
+
import { AnyScalar, DateScalar, DateTimeScalar, DateTimeZScalar, IconScalar, JsonScalar, LongScalar, NumberScalar, RefInputScalar, TimeScalar } from "@webiny/api-graphql/builtInTypes/index.js";
|
|
2
2
|
import { createCmsGraphQLSchemaPlugin } from "../../plugins/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { RevisionIdScalar } from "../scalars/RevisionId.js";
|
|
4
|
+
const createBaseContentSchema = ()=>{
|
|
5
5
|
const plugin = createCmsGraphQLSchemaPlugin({
|
|
6
6
|
typeDefs: `
|
|
7
|
-
|
|
7
|
+
scalar RevisionId
|
|
8
8
|
scalar JSON
|
|
9
9
|
scalar Long
|
|
10
10
|
scalar RefInput
|
|
@@ -28,10 +28,7 @@ const createBaseContentSchema = ({ context })=>{
|
|
|
28
28
|
}
|
|
29
29
|
`,
|
|
30
30
|
resolvers: {
|
|
31
|
-
|
|
32
|
-
acc[s.name] = s;
|
|
33
|
-
return acc;
|
|
34
|
-
}, {}),
|
|
31
|
+
RevisionId: RevisionIdScalar,
|
|
35
32
|
JSON: JsonScalar,
|
|
36
33
|
Long: LongScalar,
|
|
37
34
|
RefInput: RefInputScalar,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/schema/baseContentSchema.js","sources":["../../../src/graphql/schema/baseContentSchema.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"graphql/schema/baseContentSchema.js","sources":["../../../src/graphql/schema/baseContentSchema.ts"],"sourcesContent":["import {\n AnyScalar,\n DateScalar,\n DateTimeScalar,\n DateTimeZScalar,\n JsonScalar,\n LongScalar,\n NumberScalar,\n RefInputScalar,\n TimeScalar,\n IconScalar\n} from \"@webiny/api-graphql/builtInTypes/index.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport { RevisionIdScalar } from \"~/graphql/scalars/RevisionId.js\";\n\nexport const createBaseContentSchema = (): ICmsGraphQLSchemaPlugin => {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n scalar RevisionId\n scalar JSON\n scalar Long\n scalar RefInput\n scalar Number\n scalar Any\n scalar Date\n scalar DateTime\n scalar DateTimeZ\n scalar Time\n scalar Icon\n\n type Query\n\n type Mutation {\n _empty: String\n }\n\n enum CmsEntryStatusType {\n latest\n published\n }\n `,\n resolvers: {\n RevisionId: RevisionIdScalar,\n JSON: JsonScalar,\n Long: LongScalar,\n RefInput: RefInputScalar,\n Number: NumberScalar,\n Any: AnyScalar,\n DateTime: DateTimeScalar,\n DateTimeZ: DateTimeZScalar,\n Date: DateScalar,\n Time: TimeScalar,\n Icon: IconScalar,\n Mutation: {\n _empty: () => \"_empty\"\n }\n }\n });\n plugin.name = `headless-cms.graphql.schema.baseContentSchema`;\n\n return plugin;\n};\n"],"names":["createBaseContentSchema","plugin","createCmsGraphQLSchemaPlugin","RevisionIdScalar","JsonScalar","LongScalar","RefInputScalar","NumberScalar","AnyScalar","DateTimeScalar","DateTimeZScalar","DateScalar","TimeScalar","IconScalar"],"mappings":";;;AAgBO,MAAMA,0BAA0B;IACnC,MAAMC,SAASC,6BAA6B;QACxC,UAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;QAuBzB,CAAC;QACD,WAAW;YACP,YAAYC;YACZ,MAAMC;YACN,MAAMC;YACN,UAAUC;YACV,QAAQC;YACR,KAAKC;YACL,UAAUC;YACV,WAAWC;YACX,MAAMC;YACN,MAAMC;YACN,MAAMC;YACN,UAAU;gBACN,QAAQ,IAAM;YAClB;QACJ;IACJ;IACAZ,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CmsContext } from "../../types/index.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
2
|
+
import type { ICmsGraphQLSchemaPlugin } from "../../plugins/index.js";
|
|
3
|
+
export declare const createBaseSchemaPlugins: (_context: CmsContext) => ICmsGraphQLSchemaPlugin[];
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { createCmsGraphQLSchemaPlugin } from "../../plugins/index.js";
|
|
2
|
-
|
|
3
|
-
import { ContextPlugin } from "@webiny/api";
|
|
4
|
-
import camelCase from "lodash/camelCase.js";
|
|
5
|
-
import { CmsModelFieldValidatorRegistry } from "../../features/validation/index.js";
|
|
6
|
-
const createSkipValidatorEnum = (container)=>{
|
|
7
|
-
const registry = container.resolve(CmsModelFieldValidatorRegistry);
|
|
8
|
-
const names = registry.getAll().reduce((collection, validator)=>{
|
|
9
|
-
const name = camelCase(validator.name);
|
|
10
|
-
if (collection.includes(name)) return collection;
|
|
11
|
-
collection.push(name);
|
|
12
|
-
return collection;
|
|
13
|
-
}, []);
|
|
14
|
-
if (0 === names.length) names.push("_empty");
|
|
15
|
-
return `
|
|
16
|
-
enum SkipValidatorEnum {
|
|
17
|
-
${names.join("\n")}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
};
|
|
21
|
-
const createSchema = (context)=>{
|
|
22
|
-
const skipValidatorEnum = createSkipValidatorEnum(context.container);
|
|
2
|
+
const createBaseSchemaPlugins = (_context)=>{
|
|
23
3
|
const cmsPlugin = createCmsGraphQLSchemaPlugin({
|
|
24
4
|
typeDefs: `
|
|
25
5
|
type CmsIdentity {
|
|
@@ -89,18 +69,16 @@ const createSchema = (context)=>{
|
|
|
89
69
|
folderId_not_in: [ID!]
|
|
90
70
|
}
|
|
91
71
|
|
|
92
|
-
${skipValidatorEnum}
|
|
93
|
-
|
|
94
72
|
input CreateCmsEntryOptionsInput {
|
|
95
|
-
|
|
73
|
+
skipValidation: Boolean
|
|
96
74
|
}
|
|
97
75
|
|
|
98
76
|
input CreateRevisionCmsEntryOptionsInput {
|
|
99
|
-
|
|
77
|
+
skipValidation: Boolean
|
|
100
78
|
}
|
|
101
79
|
|
|
102
80
|
input UpdateCmsEntryOptionsInput {
|
|
103
|
-
|
|
81
|
+
skipValidation: Boolean
|
|
104
82
|
}
|
|
105
83
|
|
|
106
84
|
input CmsIdentityInput {
|
|
@@ -147,23 +125,10 @@ const createSchema = (context)=>{
|
|
|
147
125
|
resolvers: {}
|
|
148
126
|
});
|
|
149
127
|
cmsPlugin.name = "headless-cms.graphql.schema.base";
|
|
150
|
-
const corePlugin = new GraphQLSchemaPlugin({
|
|
151
|
-
typeDefs: cmsPlugin.schema.typeDefs,
|
|
152
|
-
resolvers: cmsPlugin.schema.resolvers
|
|
153
|
-
});
|
|
154
|
-
corePlugin.name = "headless-cms.graphql.core.schema.base";
|
|
155
128
|
return [
|
|
156
|
-
cmsPlugin
|
|
157
|
-
corePlugin
|
|
129
|
+
cmsPlugin
|
|
158
130
|
];
|
|
159
131
|
};
|
|
160
|
-
|
|
161
|
-
const plugin = new ContextPlugin(async (context)=>{
|
|
162
|
-
context.plugins.register(...createSchema(context));
|
|
163
|
-
});
|
|
164
|
-
plugin.name = "headless-cms.graphql.createBaseSchema";
|
|
165
|
-
return plugin;
|
|
166
|
-
};
|
|
167
|
-
export { createBaseSchema };
|
|
132
|
+
export { createBaseSchemaPlugins };
|
|
168
133
|
|
|
169
134
|
//# sourceMappingURL=baseSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql/schema/baseSchema.js","sources":["../../../src/graphql/schema/baseSchema.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"graphql/schema/baseSchema.js","sources":["../../../src/graphql/schema/baseSchema.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport { createCmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\nimport type { ICmsGraphQLSchemaPlugin } from \"~/plugins/index.js\";\n\nexport const createBaseSchemaPlugins = (_context: CmsContext): ICmsGraphQLSchemaPlugin[] => {\n const cmsPlugin = createCmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsIdentity {\n id: String\n displayName: String\n type: String\n }\n\n type CmsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type CmsCursors {\n next: String\n previous: String\n }\n\n type CmsListMeta {\n cursor: String\n hasMoreItems: Boolean\n totalCount: Int\n }\n\n input CmsDeleteEntryOptions {\n # force delete an entry that might have some records left behind in the database\n # see CmsDeleteEntryOptions in types.ts\n force: Boolean\n # permanently delete an entry without moving it to the bin\n permanently: Boolean\n }\n\n type CmsDeleteResponse {\n data: Boolean\n error: CmsError\n }\n\n type CmsDeleteMultipleDataResponse {\n id: ID!\n }\n\n type CmsDeleteMultipleResponse {\n data: [CmsDeleteMultipleDataResponse!]\n error: CmsError\n }\n\n type CmsBooleanResponse {\n data: Boolean\n error: CmsError\n }\n\n # Advanced Content Organization\n type WbyAcoLocation {\n folderId: ID\n }\n\n input WbyAcoLocationInput {\n folderId: ID!\n }\n\n input WbyAcoLocationWhereInput {\n folderId: ID\n folderId_in: [ID!]\n folderId_not: ID\n folderId_not_in: [ID!]\n }\n\n input CreateCmsEntryOptionsInput {\n skipValidation: Boolean\n }\n\n input CreateRevisionCmsEntryOptionsInput {\n skipValidation: Boolean\n }\n\n input UpdateCmsEntryOptionsInput {\n skipValidation: Boolean\n }\n\n input CmsIdentityInput {\n id: String!\n displayName: String!\n type: String!\n }\n\n type CmsEntryValidationResponseData {\n error: String!\n id: String!\n fieldId: String!\n parents: [String!]!\n }\n\n type CmsEntryValidationResponse {\n data: [CmsEntryValidationResponseData!]\n error: CmsError\n }\n\n type CmsEntrySystem {\n _empty: String\n }\n\n type CmsEntryLive {\n version: Int!\n }\n\n input CmsEntryLiveWhereInput {\n version: Int\n version_gt: Int\n version_gte: Int\n version_lt: Int\n version_lte: Int\n version_not: Int\n version_in: [Int!]\n version_not_in: [Int!]\n }\n\n input ListWhereInputCmsEntrySystem {\n _empty: String\n }\n `,\n resolvers: {}\n });\n cmsPlugin.name = \"headless-cms.graphql.schema.base\";\n\n return [cmsPlugin];\n};\n"],"names":["createBaseSchemaPlugins","_context","cmsPlugin","createCmsGraphQLSchemaPlugin"],"mappings":";AAIO,MAAMA,0BAA0B,CAACC;IACpC,MAAMC,YAAYC,6BAA6B;QAC3C,UAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwHzB,CAAC;QACD,WAAW,CAAC;IAChB;IACAD,UAAU,IAAI,GAAG;IAEjB,OAAO;QAACA;KAAU;AACtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.core.js";
|
|
2
|
+
/**
|
|
3
|
+
* Defines the CmsError type in the static schema so that CmsResponseTypeDefsImpl
|
|
4
|
+
* (which references CmsError) can be safely included at schema construction time.
|
|
5
|
+
* CmsError is also defined in the dynamic schema via createBaseSchema() — mergeSchemas
|
|
6
|
+
* handles the duplicate gracefully.
|
|
7
|
+
*/
|
|
8
|
+
declare class CmsBaseErrorTypeDefs implements CoreGraphQLSchemaFactory.Interface {
|
|
9
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
10
|
+
}
|
|
11
|
+
export declare const CmsBaseErrorTypeFactory: typeof CmsBaseErrorTypeDefs & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core.js").ICoreGraphQLSchemaFactory>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.core.js";
|
|
2
|
+
class CmsBaseErrorTypeDefs {
|
|
3
|
+
async execute(builder) {
|
|
4
|
+
builder.addTypeDefs(`
|
|
5
|
+
type CmsError {
|
|
6
|
+
message: String!
|
|
7
|
+
code: String
|
|
8
|
+
data: JSON
|
|
9
|
+
stack: String
|
|
10
|
+
}
|
|
11
|
+
`);
|
|
12
|
+
return builder;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const CmsBaseErrorTypeFactory = CoreGraphQLSchemaFactory.createImplementation({
|
|
16
|
+
implementation: CmsBaseErrorTypeDefs,
|
|
17
|
+
dependencies: []
|
|
18
|
+
});
|
|
19
|
+
export { CmsBaseErrorTypeFactory };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=CmsBaseErrorTypeFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/schema/cms/CmsBaseErrorTypeFactory.js","sources":["../../../../src/graphql/schema/cms/CmsBaseErrorTypeFactory.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.core.js\";\n\n/**\n * Defines the CmsError type in the static schema so that CmsResponseTypeDefsImpl\n * (which references CmsError) can be safely included at schema construction time.\n * CmsError is also defined in the dynamic schema via createBaseSchema() — mergeSchemas\n * handles the duplicate gracefully.\n */\nclass CmsBaseErrorTypeDefs implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n type CmsError {\n message: String!\n code: String\n data: JSON\n stack: String\n }\n `);\n return builder;\n }\n}\n\nexport const CmsBaseErrorTypeFactory = CoreGraphQLSchemaFactory.createImplementation({\n implementation: CmsBaseErrorTypeDefs,\n dependencies: []\n});\n"],"names":["CmsBaseErrorTypeDefs","builder","CmsBaseErrorTypeFactory","CoreGraphQLSchemaFactory"],"mappings":";AAQA,MAAMA;IACF,MAAM,QACFC,OAA+C,EAChB;QAC/BA,QAAQ,WAAW,CAAe,CAAC;;;;;;;QAOnC,CAAC;QACD,OAAOA;IACX;AACJ;AAEO,MAAMC,0BAA0BC,yBAAyB,oBAAoB,CAAC;IACjF,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
|