@webiny/api-headless-cms 5.17.4 → 5.18.0-beta.3
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/content/contextSetup.js +1 -2
- package/content/graphQLHandlerFactory.d.ts +1 -2
- package/content/graphQLHandlerFactory.js +12 -4
- package/content/plugins/CmsGroupPlugin.d.ts +11 -0
- package/content/plugins/{ContentModelGroupPlugin.js → CmsGroupPlugin.js} +4 -5
- package/content/plugins/CmsModelPlugin.d.ts +11 -0
- package/content/plugins/{ContentModelPlugin.js → CmsModelPlugin.js} +4 -5
- package/content/plugins/buildSchemaPlugins.js +1 -2
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +7 -0
- package/content/plugins/crud/contentEntry/beforeCreate.js +28 -0
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +7 -0
- package/content/plugins/crud/contentEntry/beforeUpdate.js +28 -0
- package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +2 -2
- package/content/plugins/crud/contentEntry/entryDataValidation.js +1 -2
- package/content/plugins/crud/contentEntry/markLockedFields.d.ts +3 -3
- package/content/plugins/crud/contentEntry/markLockedFields.js +10 -7
- package/content/plugins/crud/contentEntry.crud.d.ts +12 -4
- package/content/plugins/crud/contentEntry.crud.js +807 -757
- package/content/plugins/crud/contentModel/afterCreate.d.ts +7 -0
- package/content/plugins/crud/contentModel/afterCreate.js +18 -0
- package/content/plugins/crud/contentModel/afterDelete.d.ts +7 -0
- package/content/plugins/crud/contentModel/afterDelete.js +18 -0
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +7 -0
- package/content/plugins/crud/contentModel/afterUpdate.js +18 -0
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +9 -0
- package/content/plugins/crud/contentModel/beforeCreate.js +146 -0
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +9 -0
- package/content/plugins/crud/contentModel/beforeDelete.js +56 -0
- package/content/plugins/crud/contentModel/beforeUpdate.d.ts +9 -0
- package/content/plugins/crud/contentModel/beforeUpdate.js +128 -0
- package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +2 -2
- package/content/plugins/crud/contentModel/contentModelManagerFactory.js +2 -3
- package/content/plugins/crud/contentModel/createFieldModels.d.ts +2 -2
- package/content/plugins/crud/contentModel/createFieldModels.js +2 -3
- package/content/plugins/crud/contentModel/idValidation.js +1 -2
- package/content/plugins/crud/contentModel/models.js +1 -2
- package/content/plugins/crud/contentModel/validateLayout.d.ts +2 -2
- package/content/plugins/crud/contentModel/validateLayout.js +1 -2
- package/content/plugins/crud/contentModel.crud.d.ts +12 -4
- package/content/plugins/crud/contentModel.crud.js +351 -279
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +9 -0
- package/content/plugins/crud/contentModelGroup/beforeCreate.js +66 -0
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +9 -0
- package/content/plugins/crud/contentModelGroup/beforeDelete.js +48 -0
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +8 -0
- package/content/plugins/crud/contentModelGroup/beforeUpdate.js +28 -0
- package/content/plugins/crud/contentModelGroup.crud.d.ts +12 -4
- package/content/plugins/crud/contentModelGroup.crud.js +259 -219
- package/content/plugins/crud/index.d.ts +6 -0
- package/content/plugins/crud/index.js +96 -0
- package/content/plugins/graphqlFields/boolean.js +1 -2
- package/content/plugins/graphqlFields/datetime.js +1 -2
- package/content/plugins/graphqlFields/file.js +1 -2
- package/content/plugins/graphqlFields/index.js +1 -2
- package/content/plugins/graphqlFields/longText.js +1 -2
- package/content/plugins/graphqlFields/number.js +1 -2
- package/content/plugins/graphqlFields/object.js +1 -2
- package/content/plugins/graphqlFields/ref.js +22 -11
- package/content/plugins/graphqlFields/richText.js +1 -2
- package/content/plugins/graphqlFields/text.js +1 -2
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +2 -3
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +1 -2
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +15 -0
- package/content/plugins/modelManager/DefaultCmsModelManager.js +62 -0
- package/content/plugins/modelManager/index.d.ts +2 -2
- package/content/plugins/modelManager/index.js +3 -4
- package/content/plugins/schema/baseSchema.js +1 -2
- package/content/plugins/schema/contentEntries.js +9 -10
- package/content/plugins/schema/contentModelGroups.js +13 -14
- package/content/plugins/schema/contentModels.js +9 -10
- package/content/plugins/schema/createFieldResolvers.d.ts +2 -2
- package/content/plugins/schema/createFieldResolvers.js +14 -20
- package/content/plugins/schema/createManageResolvers.d.ts +3 -3
- package/content/plugins/schema/createManageResolvers.js +6 -10
- package/content/plugins/schema/createManageSDL.d.ts +2 -2
- package/content/plugins/schema/createManageSDL.js +5 -6
- package/content/plugins/schema/createPreviewResolvers.d.ts +3 -3
- package/content/plugins/schema/createPreviewResolvers.js +5 -6
- package/content/plugins/schema/createReadResolvers.d.ts +3 -3
- package/content/plugins/schema/createReadResolvers.js +5 -6
- package/content/plugins/schema/createReadSDL.d.ts +2 -2
- package/content/plugins/schema/createReadSDL.js +3 -4
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +4 -4
- package/content/plugins/schema/resolvers/commonFieldResolvers.js +1 -2
- package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveCreate.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveDelete.js +4 -5
- package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveGet.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveList.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveList.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolvePublish.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.js +3 -4
- package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
- package/content/plugins/schema/resolvers/manage/resolveUpdate.js +3 -4
- package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +1 -1
- package/content/plugins/schema/resolvers/preview/resolveGet.js +3 -4
- package/content/plugins/schema/resolvers/preview/resolveList.d.ts +1 -1
- package/content/plugins/schema/resolvers/preview/resolveList.js +3 -4
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +1 -1
- package/content/plugins/schema/resolvers/read/resolveGet.js +3 -4
- package/content/plugins/schema/resolvers/read/resolveList.d.ts +1 -1
- package/content/plugins/schema/resolvers/read/resolveList.js +3 -4
- package/content/plugins/schema/schemaPlugins.js +4 -3
- package/content/plugins/storage/StorageTransformPlugin.d.ts +30 -0
- package/content/plugins/storage/StorageTransformPlugin.js +36 -0
- package/content/plugins/storage/default.d.ts +2 -2
- package/content/plugins/storage/default.js +12 -12
- package/content/plugins/storage/object.d.ts +2 -2
- package/content/plugins/storage/object.js +28 -29
- package/content/plugins/utils/createTypeName.js +1 -2
- package/content/plugins/utils/entryStorage.d.ts +5 -5
- package/content/plugins/utils/entryStorage.js +21 -14
- package/content/plugins/utils/getEntryTitle.d.ts +2 -2
- package/content/plugins/utils/getEntryTitle.js +1 -2
- package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +2 -2
- package/content/plugins/utils/getSchemaFromFieldPlugins.js +1 -2
- package/content/plugins/utils/pluralizedTypeName.js +1 -2
- package/content/plugins/utils/renderFields.d.ts +2 -2
- package/content/plugins/utils/renderFields.js +1 -2
- package/content/plugins/utils/renderGetFilterFields.d.ts +2 -2
- package/content/plugins/utils/renderGetFilterFields.js +1 -2
- package/content/plugins/utils/renderInputFields.d.ts +2 -2
- package/content/plugins/utils/renderInputFields.js +1 -2
- package/content/plugins/utils/renderListFilterFields.d.ts +2 -2
- package/content/plugins/utils/renderListFilterFields.js +1 -2
- package/content/plugins/utils/renderSortEnum.d.ts +2 -2
- package/content/plugins/utils/renderSortEnum.js +1 -2
- package/content/plugins/validators/dateGte.js +1 -2
- package/content/plugins/validators/dateLte.js +1 -2
- package/content/plugins/validators/gte.js +1 -2
- package/content/plugins/validators/in.js +1 -2
- package/content/plugins/validators/index.js +1 -2
- package/content/plugins/validators/lte.js +1 -2
- package/content/plugins/validators/maxLength.js +1 -2
- package/content/plugins/validators/minLength.js +1 -2
- package/content/plugins/validators/pattern.js +1 -2
- package/content/plugins/validators/patternPlugins/email.js +1 -2
- package/content/plugins/validators/patternPlugins/index.js +1 -2
- package/content/plugins/validators/patternPlugins/lowerCase.js +1 -2
- package/content/plugins/validators/patternPlugins/upperCase.js +1 -2
- package/content/plugins/validators/patternPlugins/url.js +1 -2
- package/content/plugins/validators/required.js +1 -2
- package/content/plugins/validators/timeGte.js +1 -2
- package/content/plugins/validators/timeLte.js +1 -2
- package/index.d.ts +12 -0
- package/index.js +66 -0
- package/migrateCMSPermissions.d.ts +2 -2
- package/migrateCMSPermissions.js +1 -2
- package/package.json +23 -21
- package/plugins/context.js +1 -2
- package/plugins/crud/index.d.ts +6 -2
- package/plugins/crud/index.js +69 -6
- package/plugins/crud/settings.crud.d.ts +10 -4
- package/plugins/crud/settings.crud.js +64 -77
- package/plugins/crud/system.crud.d.ts +10 -4
- package/plugins/crud/system.crud.js +139 -126
- package/plugins/graphql/system.js +5 -6
- package/plugins/graphql.d.ts +1 -2
- package/plugins/graphql.js +49 -50
- package/plugins/upgrades/index.js +1 -2
- package/plugins/upgrades/v5.5.0/helpers.js +1 -2
- package/plugins/upgrades/v5.5.0/index.js +3 -4
- package/transformers.js +1 -2
- package/types.d.ts +742 -1232
- package/types.js +104 -254
- package/utils.d.ts +4 -11
- package/utils.js +2 -49
- package/content/contextSetup.js.map +0 -1
- package/content/graphQLHandlerFactory.js.map +0 -1
- package/content/index.d.ts +0 -5
- package/content/index.js +0 -37
- package/content/index.js.map +0 -1
- package/content/plugins/ContentModelGroupPlugin.d.ts +0 -7
- package/content/plugins/ContentModelGroupPlugin.js.map +0 -1
- package/content/plugins/ContentModelPlugin.d.ts +0 -7
- package/content/plugins/ContentModelPlugin.js.map +0 -1
- package/content/plugins/buildSchemaPlugins.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterCreate.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterCreate.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterCreate.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterCreateRevisionFrom.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterDelete.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterDelete.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterDelete.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterDeleteRevision.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterPublish.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterPublish.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterPublish.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterRequestChanges.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterRequestChanges.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterRequestChanges.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterRequestReview.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterRequestReview.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterRequestReview.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterUnpublish.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterUnpublish.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterUnpublish.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/afterUpdate.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/afterUpdate.hook.js +0 -15
- package/content/plugins/crud/contentEntry/afterUpdate.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeCreate.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeCreate.hook.js +0 -18
- package/content/plugins/crud/contentEntry/beforeCreate.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforeCreateRevisionFrom.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeDelete.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeDelete.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforeDelete.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforeDeleteRevision.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforePublish.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforePublish.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforePublish.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforeRequestChanges.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeRequestReview.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeRequestReview.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforeRequestReview.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeUnpublish.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeUnpublish.hook.js +0 -15
- package/content/plugins/crud/contentEntry/beforeUnpublish.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/beforeUpdate.hook.d.ts +0 -2
- package/content/plugins/crud/contentEntry/beforeUpdate.hook.js +0 -18
- package/content/plugins/crud/contentEntry/beforeUpdate.hook.js.map +0 -1
- package/content/plugins/crud/contentEntry/entryDataValidation.js.map +0 -1
- package/content/plugins/crud/contentEntry/hooks.d.ts +0 -18
- package/content/plugins/crud/contentEntry/hooks.js +0 -240
- package/content/plugins/crud/contentEntry/hooks.js.map +0 -1
- package/content/plugins/crud/contentEntry/markLockedFields.js.map +0 -1
- package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.d.ts +0 -4
- package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.js +0 -24
- package/content/plugins/crud/contentEntry/runContentEntryLifecycleHooks.js.map +0 -1
- package/content/plugins/crud/contentEntry.crud.js.map +0 -1
- package/content/plugins/crud/contentModel/afterCreate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterCreate.hook.js +0 -24
- package/content/plugins/crud/contentModel/afterCreate.hook.js.map +0 -1
- package/content/plugins/crud/contentModel/afterDelete.hook.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterDelete.hook.js +0 -24
- package/content/plugins/crud/contentModel/afterDelete.hook.js.map +0 -1
- package/content/plugins/crud/contentModel/afterUpdate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterUpdate.hook.js +0 -24
- package/content/plugins/crud/contentModel/afterUpdate.hook.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeCreate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModel/beforeCreate.hook.js +0 -137
- package/content/plugins/crud/contentModel/beforeCreate.hook.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeDelete.hook.d.ts +0 -7
- package/content/plugins/crud/contentModel/beforeDelete.hook.js +0 -58
- package/content/plugins/crud/contentModel/beforeDelete.hook.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeUpdate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModel/beforeUpdate.hook.js +0 -141
- package/content/plugins/crud/contentModel/beforeUpdate.hook.js.map +0 -1
- package/content/plugins/crud/contentModel/contentModelManagerFactory.js.map +0 -1
- package/content/plugins/crud/contentModel/createFieldModels.js.map +0 -1
- package/content/plugins/crud/contentModel/hooks.d.ts +0 -6
- package/content/plugins/crud/contentModel/hooks.js +0 -84
- package/content/plugins/crud/contentModel/hooks.js.map +0 -1
- package/content/plugins/crud/contentModel/idValidation.js.map +0 -1
- package/content/plugins/crud/contentModel/models.js.map +0 -1
- package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.d.ts +0 -2
- package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.js +0 -24
- package/content/plugins/crud/contentModel/runContentModelLifecycleHooks.js.map +0 -1
- package/content/plugins/crud/contentModel/validateLayout.js.map +0 -1
- package/content/plugins/crud/contentModel.crud.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/afterCreate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModelGroup/afterCreate.hook.js +0 -24
- package/content/plugins/crud/contentModelGroup/afterCreate.hook.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/afterDelete.hook.d.ts +0 -8
- package/content/plugins/crud/contentModelGroup/afterDelete.hook.js +0 -22
- package/content/plugins/crud/contentModelGroup/afterDelete.hook.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/afterUpdate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModelGroup/afterUpdate.hook.js +0 -26
- package/content/plugins/crud/contentModelGroup/afterUpdate.hook.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeCreate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModelGroup/beforeCreate.hook.js +0 -87
- package/content/plugins/crud/contentModelGroup/beforeCreate.hook.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeDelete.hook.d.ts +0 -7
- package/content/plugins/crud/contentModelGroup/beforeDelete.hook.js +0 -46
- package/content/plugins/crud/contentModelGroup/beforeDelete.hook.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.d.ts +0 -7
- package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.js +0 -35
- package/content/plugins/crud/contentModelGroup/beforeUpdate.hook.js.map +0 -1
- package/content/plugins/crud/contentModelGroup.crud.js.map +0 -1
- package/content/plugins/graphqlFields/boolean.js.map +0 -1
- package/content/plugins/graphqlFields/datetime.js.map +0 -1
- package/content/plugins/graphqlFields/file.js.map +0 -1
- package/content/plugins/graphqlFields/index.js.map +0 -1
- package/content/plugins/graphqlFields/longText.js.map +0 -1
- package/content/plugins/graphqlFields/number.js.map +0 -1
- package/content/plugins/graphqlFields/object.js.map +0 -1
- package/content/plugins/graphqlFields/ref.js.map +0 -1
- package/content/plugins/graphqlFields/richText.js.map +0 -1
- package/content/plugins/graphqlFields/text.js.map +0 -1
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js.map +0 -1
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js.map +0 -1
- package/content/plugins/modelManager/DefaultContentModelManager.d.ts +0 -15
- package/content/plugins/modelManager/DefaultContentModelManager.js +0 -63
- package/content/plugins/modelManager/DefaultContentModelManager.js.map +0 -1
- package/content/plugins/modelManager/index.js.map +0 -1
- package/content/plugins/schema/baseSchema.js.map +0 -1
- package/content/plugins/schema/contentEntries.js.map +0 -1
- package/content/plugins/schema/contentModelGroups.js.map +0 -1
- package/content/plugins/schema/contentModels.js.map +0 -1
- package/content/plugins/schema/createFieldResolvers.js.map +0 -1
- package/content/plugins/schema/createManageResolvers.js.map +0 -1
- package/content/plugins/schema/createManageSDL.js.map +0 -1
- package/content/plugins/schema/createPreviewResolvers.js.map +0 -1
- package/content/plugins/schema/createReadResolvers.js.map +0 -1
- package/content/plugins/schema/createReadSDL.js.map +0 -1
- package/content/plugins/schema/resolvers/commonFieldResolvers.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveCreate.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveDelete.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveGet.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveList.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolvePublish.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.js.map +0 -1
- package/content/plugins/schema/resolvers/manage/resolveUpdate.js.map +0 -1
- package/content/plugins/schema/resolvers/preview/resolveGet.js.map +0 -1
- package/content/plugins/schema/resolvers/preview/resolveList.js.map +0 -1
- package/content/plugins/schema/resolvers/read/resolveGet.js.map +0 -1
- package/content/plugins/schema/resolvers/read/resolveList.js.map +0 -1
- package/content/plugins/schema/schemaPlugins.js.map +0 -1
- package/content/plugins/storage/default.js.map +0 -1
- package/content/plugins/storage/object.js.map +0 -1
- package/content/plugins/utils/createTypeName.js.map +0 -1
- package/content/plugins/utils/entryStorage.js.map +0 -1
- package/content/plugins/utils/getEntryTitle.js.map +0 -1
- package/content/plugins/utils/getSchemaFromFieldPlugins.js.map +0 -1
- package/content/plugins/utils/pluralizedTypeName.js.map +0 -1
- package/content/plugins/utils/renderFields.js.map +0 -1
- package/content/plugins/utils/renderGetFilterFields.js.map +0 -1
- package/content/plugins/utils/renderInputFields.js.map +0 -1
- package/content/plugins/utils/renderListFilterFields.js.map +0 -1
- package/content/plugins/utils/renderSortEnum.js.map +0 -1
- package/content/plugins/validators/dateGte.js.map +0 -1
- package/content/plugins/validators/dateLte.js.map +0 -1
- package/content/plugins/validators/gte.js.map +0 -1
- package/content/plugins/validators/in.js.map +0 -1
- package/content/plugins/validators/index.js.map +0 -1
- package/content/plugins/validators/lte.js.map +0 -1
- package/content/plugins/validators/maxLength.js.map +0 -1
- package/content/plugins/validators/minLength.js.map +0 -1
- package/content/plugins/validators/pattern.js.map +0 -1
- package/content/plugins/validators/patternPlugins/email.js.map +0 -1
- package/content/plugins/validators/patternPlugins/index.js.map +0 -1
- package/content/plugins/validators/patternPlugins/lowerCase.js.map +0 -1
- package/content/plugins/validators/patternPlugins/upperCase.js.map +0 -1
- package/content/plugins/validators/patternPlugins/url.js.map +0 -1
- package/content/plugins/validators/required.js.map +0 -1
- package/content/plugins/validators/timeGte.js.map +0 -1
- package/content/plugins/validators/timeLte.js.map +0 -1
- package/migrateCMSPermissions.js.map +0 -1
- package/plugins/InstallationPlugin.d.ts +0 -19
- package/plugins/InstallationPlugin.js +0 -39
- package/plugins/InstallationPlugin.js.map +0 -1
- package/plugins/context.js.map +0 -1
- package/plugins/crud/index.js.map +0 -1
- package/plugins/crud/settings.crud.js.map +0 -1
- package/plugins/crud/system.crud.js.map +0 -1
- package/plugins/graphql/system.js.map +0 -1
- package/plugins/graphql.js.map +0 -1
- package/plugins/index.d.ts +0 -2
- package/plugins/index.js +0 -25
- package/plugins/index.js.map +0 -1
- package/plugins/upgrades/index.js.map +0 -1
- package/plugins/upgrades/v5.5.0/helpers.js.map +0 -1
- package/plugins/upgrades/v5.5.0/index.js.map +0 -1
- package/transformers.js.map +0 -1
- package/types.js.map +0 -1
- package/utils.js.map +0 -1
|
@@ -61,7 +61,7 @@ const plugin = {
|
|
|
61
61
|
modelIdToTypeName.set(item.modelId, (0, _createTypeName.createReadTypeName)(item.modelId));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return async (parent,
|
|
64
|
+
return async (parent, _, context) => {
|
|
65
65
|
const {
|
|
66
66
|
cms
|
|
67
67
|
} = context; // Get field value for this entry
|
|
@@ -89,24 +89,36 @@ const plugin = {
|
|
|
89
89
|
entryId
|
|
90
90
|
}) => {
|
|
91
91
|
// Get model manager, to get access to CRUD methods
|
|
92
|
-
const model = await cms.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const model = await cms.getModelManager(modelId);
|
|
93
|
+
let entries; // `read` API works with `published` data
|
|
94
|
+
|
|
95
|
+
if (cms.READ) {
|
|
96
|
+
entries = await model.getPublishedByIds([entryId]);
|
|
97
|
+
} // `preview` and `manage` with `latest` data
|
|
98
|
+
else {
|
|
99
|
+
entries = await model.getLatestByIds([entryId]);
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
return appendTypename(entries, modelIdToTypeName.get(modelId));
|
|
97
103
|
});
|
|
98
104
|
return await Promise.all(getters).then(results => results.reduce((result, item) => result.concat(item), []));
|
|
99
105
|
} // Get model manager, to get access to CRUD methods
|
|
100
106
|
|
|
101
107
|
|
|
102
|
-
const model = await cms.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
const model = await cms.getModelManager(value.modelId);
|
|
109
|
+
let revisions; // `read` API works with `published` data
|
|
110
|
+
|
|
111
|
+
if (cms.READ) {
|
|
112
|
+
revisions = await model.getPublishedByIds([value.entryId]);
|
|
113
|
+
} // `preview` API works with `latest` data
|
|
114
|
+
else {
|
|
115
|
+
revisions = await model.getLatestByIds([value.entryId]);
|
|
116
|
+
}
|
|
106
117
|
/**
|
|
107
118
|
* If there are no revisions we must return null.
|
|
108
119
|
*/
|
|
109
120
|
|
|
121
|
+
|
|
110
122
|
if (!revisions || revisions.length === 0) {
|
|
111
123
|
return null;
|
|
112
124
|
}
|
|
@@ -190,5 +202,4 @@ const plugin = {
|
|
|
190
202
|
}
|
|
191
203
|
};
|
|
192
204
|
var _default = plugin;
|
|
193
|
-
exports.default = _default;
|
|
194
|
-
//# sourceMappingURL=ref.js.map
|
|
205
|
+
exports.default = _default;
|
|
@@ -26,7 +26,7 @@ class InternalAuthenticationPlugin extends _AuthenticationPlugin.AuthenticationP
|
|
|
26
26
|
const header = headers["Authorization"] || headers["authorization"];
|
|
27
27
|
const apiKey = header ? header.split(" ").pop() : null;
|
|
28
28
|
|
|
29
|
-
if (!apiKey || apiKey !== (await context.cms.
|
|
29
|
+
if (!apiKey || apiKey !== (await context.cms.getReadAPIKey())) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -51,5 +51,4 @@ class InternalAuthenticationPlugin extends _AuthenticationPlugin.AuthenticationP
|
|
|
51
51
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
exports.InternalAuthenticationPlugin = InternalAuthenticationPlugin;
|
|
55
|
-
//# sourceMappingURL=InternalAuthenticationPlugin.js.map
|
|
54
|
+
exports.InternalAuthenticationPlugin = InternalAuthenticationPlugin;
|
|
@@ -32,5 +32,4 @@ class InternalAuthorizationPlugin extends _AuthorizationPlugin.AuthorizationPlug
|
|
|
32
32
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
exports.InternalAuthorizationPlugin = InternalAuthorizationPlugin;
|
|
36
|
-
//# sourceMappingURL=InternalAuthorizationPlugin.js.map
|
|
35
|
+
exports.InternalAuthorizationPlugin = InternalAuthorizationPlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CmsModelManager, CmsModel, CmsContext } from "../../../types";
|
|
2
|
+
export declare class DefaultCmsModelManager implements CmsModelManager {
|
|
3
|
+
private readonly _context;
|
|
4
|
+
private readonly _model;
|
|
5
|
+
constructor(context: CmsContext, model: CmsModel);
|
|
6
|
+
create(data: any): Promise<import("../../../types").CmsEntry>;
|
|
7
|
+
delete(id: string): Promise<void>;
|
|
8
|
+
get(id: string): Promise<import("../../../types").CmsEntry>;
|
|
9
|
+
list(args: any): Promise<[import("../../../types").CmsEntry[], import("../../../types").CmsEntryMeta]>;
|
|
10
|
+
listPublished(args: any): Promise<[import("../../../types").CmsEntry[], import("../../../types").CmsEntryMeta]>;
|
|
11
|
+
listLatest(args: any): Promise<[import("../../../types").CmsEntry[], import("../../../types").CmsEntryMeta]>;
|
|
12
|
+
getPublishedByIds(ids: string[]): Promise<import("../../../types").CmsEntry[]>;
|
|
13
|
+
getLatestByIds(ids: string[]): Promise<import("../../../types").CmsEntry[]>;
|
|
14
|
+
update(id: any, data: any): Promise<import("../../../types").CmsEntry>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.DefaultCmsModelManager = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
class DefaultCmsModelManager {
|
|
13
|
+
constructor(context, model) {
|
|
14
|
+
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
15
|
+
(0, _defineProperty2.default)(this, "_model", void 0);
|
|
16
|
+
this._context = context;
|
|
17
|
+
this._model = model;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async create(data) {
|
|
21
|
+
return this._context.cms.createEntry(this._model, data);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async delete(id) {
|
|
25
|
+
if (id.includes("#")) {
|
|
26
|
+
return this._context.cms.deleteEntryRevision(this._model, id);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return this._context.cms.deleteEntry(this._model, id);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async get(id) {
|
|
33
|
+
return this._context.cms.getEntryById(this._model, id);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async list(args) {
|
|
37
|
+
return this._context.cms.listEntries(this._model, args);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async listPublished(args) {
|
|
41
|
+
return this._context.cms.listPublishedEntries(this._model, args);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async listLatest(args) {
|
|
45
|
+
return this._context.cms.listLatestEntries(this._model, args);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getPublishedByIds(ids) {
|
|
49
|
+
return this._context.cms.getPublishedEntriesByIds(this._model, ids);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async getLatestByIds(ids) {
|
|
53
|
+
return this._context.cms.getLatestEntriesByIds(this._model, ids);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async update(id, data) {
|
|
57
|
+
return this._context.cms.updateEntry(this._model, id, data);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.DefaultCmsModelManager = DefaultCmsModelManager;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: () =>
|
|
1
|
+
import { ModelManagerPlugin } from "../../../types";
|
|
2
|
+
declare const _default: () => ModelManagerPlugin;
|
|
3
3
|
export default _default;
|
|
@@ -5,17 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _DefaultCmsModelManager = require("./DefaultCmsModelManager");
|
|
9
9
|
|
|
10
10
|
const plugin = {
|
|
11
11
|
type: "cms-content-model-manager",
|
|
12
12
|
name: "content-model-manager-default",
|
|
13
13
|
create: async (context, model) => {
|
|
14
|
-
return new
|
|
14
|
+
return new _DefaultCmsModelManager.DefaultCmsModelManager(context, model);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
var _default = () => plugin;
|
|
19
19
|
|
|
20
|
-
exports.default = _default;
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
20
|
+
exports.default = _default;
|
|
@@ -7,12 +7,12 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
9
9
|
|
|
10
|
-
var _getEntryTitle = require("../utils/getEntryTitle");
|
|
11
|
-
|
|
12
10
|
var _apiSecurity = require("@webiny/api-security");
|
|
13
11
|
|
|
14
12
|
var _GraphQLSchemaPlugin = require("@webiny/handler-graphql/plugins/GraphQLSchemaPlugin");
|
|
15
13
|
|
|
14
|
+
var _getEntryTitle = require("../utils/getEntryTitle");
|
|
15
|
+
|
|
16
16
|
const plugin = context => {
|
|
17
17
|
if (!context.cms.MANAGE) {
|
|
18
18
|
return null;
|
|
@@ -72,10 +72,10 @@ const plugin = context => {
|
|
|
72
72
|
query,
|
|
73
73
|
limit = 10
|
|
74
74
|
} = args;
|
|
75
|
-
const models = await context.cms.
|
|
75
|
+
const models = await context.cms.listModels();
|
|
76
76
|
const getters = models.filter(model => modelIds.includes(model.modelId)).map(async model => {
|
|
77
77
|
const latest = query === "__latest__";
|
|
78
|
-
const modelManager = await context.cms.
|
|
78
|
+
const modelManager = await context.cms.getModelManager(model.modelId);
|
|
79
79
|
const [items] = await modelManager.listLatest({
|
|
80
80
|
limit,
|
|
81
81
|
where: latest ? undefined : {
|
|
@@ -103,7 +103,7 @@ const plugin = context => {
|
|
|
103
103
|
modelId,
|
|
104
104
|
entryId
|
|
105
105
|
} = args.entry;
|
|
106
|
-
const models = await context.cms.
|
|
106
|
+
const models = await context.cms.listModels();
|
|
107
107
|
const model = models.find(m => m.modelId === modelId);
|
|
108
108
|
|
|
109
109
|
if (!model) {
|
|
@@ -114,7 +114,7 @@ const plugin = context => {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const [entry] = await context.cms.
|
|
117
|
+
const [entry] = await context.cms.getEntriesByIds(model, [entryId]);
|
|
118
118
|
return new _handlerGraphql.Response({
|
|
119
119
|
id: entry.id,
|
|
120
120
|
model: {
|
|
@@ -127,7 +127,7 @@ const plugin = context => {
|
|
|
127
127
|
},
|
|
128
128
|
|
|
129
129
|
async getContentEntries(_, args, context) {
|
|
130
|
-
const models = await context.cms.
|
|
130
|
+
const models = await context.cms.listModels();
|
|
131
131
|
const entriesByModel = args.entries.map((ref, index) => {
|
|
132
132
|
return {
|
|
133
133
|
entryId: ref.entryId,
|
|
@@ -141,7 +141,7 @@ const plugin = context => {
|
|
|
141
141
|
}) => {
|
|
142
142
|
// Get model manager, to get access to CRUD methods
|
|
143
143
|
const model = models.find(m => m.modelId === modelId);
|
|
144
|
-
const entries = await context.cms.
|
|
144
|
+
const entries = await context.cms.getEntriesByIds(model, [entryId]);
|
|
145
145
|
return entries.map(entry => ({
|
|
146
146
|
id: entry.id,
|
|
147
147
|
model: {
|
|
@@ -163,5 +163,4 @@ const plugin = context => {
|
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
var _default = plugin;
|
|
166
|
-
exports.default = _default;
|
|
167
|
-
//# sourceMappingURL=contentEntries.js.map
|
|
166
|
+
exports.default = _default;
|
|
@@ -9,7 +9,7 @@ var _handlerGraphql = require("@webiny/handler-graphql");
|
|
|
9
9
|
|
|
10
10
|
var _GraphQLSchemaPlugin = require("@webiny/handler-graphql/plugins/GraphQLSchemaPlugin");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _CmsGroupPlugin = require("../CmsGroupPlugin");
|
|
13
13
|
|
|
14
14
|
const plugin = context => {
|
|
15
15
|
let manageSchema = "";
|
|
@@ -61,16 +61,16 @@ const plugin = context => {
|
|
|
61
61
|
if (context.cms.MANAGE) {
|
|
62
62
|
resolvers = {
|
|
63
63
|
CmsContentModelGroup: {
|
|
64
|
-
contentModels: async (group,
|
|
65
|
-
const models = await context.cms.
|
|
64
|
+
contentModels: async (group, _, context) => {
|
|
65
|
+
const models = await context.cms.silentAuthModel().list();
|
|
66
66
|
return models.filter(m => m.group.id === group.id);
|
|
67
67
|
},
|
|
68
|
-
totalContentModels: async (group,
|
|
69
|
-
const models = await context.cms.
|
|
68
|
+
totalContentModels: async (group, _, context) => {
|
|
69
|
+
const models = await context.cms.silentAuthModel().list();
|
|
70
70
|
return models.filter(m => m.group === group.id).length;
|
|
71
71
|
},
|
|
72
|
-
plugin: async (group,
|
|
73
|
-
const groupPlugin = context.plugins.byType(
|
|
72
|
+
plugin: async (group, _, context) => {
|
|
73
|
+
const groupPlugin = context.plugins.byType(_CmsGroupPlugin.CmsGroupPlugin.type).find(item => item.contentModelGroup.id === group.id);
|
|
74
74
|
return Boolean(groupPlugin);
|
|
75
75
|
}
|
|
76
76
|
},
|
|
@@ -80,7 +80,7 @@ const plugin = context => {
|
|
|
80
80
|
const {
|
|
81
81
|
id
|
|
82
82
|
} = args;
|
|
83
|
-
const model = await context.cms.
|
|
83
|
+
const model = await context.cms.getGroup(id);
|
|
84
84
|
return new _handlerGraphql.Response(model);
|
|
85
85
|
} catch (e) {
|
|
86
86
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -88,7 +88,7 @@ const plugin = context => {
|
|
|
88
88
|
},
|
|
89
89
|
listContentModelGroups: async (_, __, context) => {
|
|
90
90
|
try {
|
|
91
|
-
const models = await context.cms.
|
|
91
|
+
const models = await context.cms.listGroups();
|
|
92
92
|
return new _handlerGraphql.Response(models);
|
|
93
93
|
} catch (e) {
|
|
94
94
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -98,7 +98,7 @@ const plugin = context => {
|
|
|
98
98
|
Mutation: {
|
|
99
99
|
createContentModelGroup: async (_, args, context) => {
|
|
100
100
|
try {
|
|
101
|
-
const model = await context.cms.
|
|
101
|
+
const model = await context.cms.createGroup(args.data);
|
|
102
102
|
return new _handlerGraphql.Response(model);
|
|
103
103
|
} catch (e) {
|
|
104
104
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -106,7 +106,7 @@ const plugin = context => {
|
|
|
106
106
|
},
|
|
107
107
|
updateContentModelGroup: async (_, args, context) => {
|
|
108
108
|
try {
|
|
109
|
-
const group = await context.cms.
|
|
109
|
+
const group = await context.cms.updateGroup(args.id, args.data);
|
|
110
110
|
return new _handlerGraphql.Response(group);
|
|
111
111
|
} catch (e) {
|
|
112
112
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -114,7 +114,7 @@ const plugin = context => {
|
|
|
114
114
|
},
|
|
115
115
|
deleteContentModelGroup: async (_, args, context) => {
|
|
116
116
|
try {
|
|
117
|
-
await context.cms.
|
|
117
|
+
await context.cms.deleteGroup(args.id);
|
|
118
118
|
return new _handlerGraphql.Response(true);
|
|
119
119
|
} catch (e) {
|
|
120
120
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -150,5 +150,4 @@ const plugin = context => {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
var _default = plugin;
|
|
153
|
-
exports.default = _default;
|
|
154
|
-
//# sourceMappingURL=contentModelGroups.js.map
|
|
153
|
+
exports.default = _default;
|
|
@@ -9,14 +9,14 @@ var _handlerGraphql = require("@webiny/handler-graphql");
|
|
|
9
9
|
|
|
10
10
|
var _GraphQLSchemaPlugin = require("@webiny/handler-graphql/plugins/GraphQLSchemaPlugin");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _CmsModelPlugin = require("../CmsModelPlugin");
|
|
13
13
|
|
|
14
14
|
const plugin = context => {
|
|
15
15
|
const resolvers = {
|
|
16
16
|
Query: {
|
|
17
17
|
getContentModel: async (_, args, context) => {
|
|
18
18
|
try {
|
|
19
|
-
const model = await context.cms.
|
|
19
|
+
const model = await context.cms.getModel(args.modelId);
|
|
20
20
|
return new _handlerGraphql.Response(model);
|
|
21
21
|
} catch (e) {
|
|
22
22
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -24,7 +24,7 @@ const plugin = context => {
|
|
|
24
24
|
},
|
|
25
25
|
listContentModels: async (_, __, context) => {
|
|
26
26
|
try {
|
|
27
|
-
const model = await context.cms.
|
|
27
|
+
const model = await context.cms.listModels();
|
|
28
28
|
return new _handlerGraphql.Response(model);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -32,8 +32,8 @@ const plugin = context => {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
CmsContentModel: {
|
|
35
|
-
plugin: async (model,
|
|
36
|
-
const modelPlugin = context.plugins.byType(
|
|
35
|
+
plugin: async (model, _, context) => {
|
|
36
|
+
const modelPlugin = context.plugins.byType(_CmsModelPlugin.CmsModelPlugin.type).find(item => item.contentModel.modelId === model.modelId);
|
|
37
37
|
return Boolean(modelPlugin);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -44,7 +44,7 @@ const plugin = context => {
|
|
|
44
44
|
resolvers.Mutation = {
|
|
45
45
|
createContentModel: async (_, args, context) => {
|
|
46
46
|
try {
|
|
47
|
-
const model = await context.cms.
|
|
47
|
+
const model = await context.cms.createModel(args.data);
|
|
48
48
|
return new _handlerGraphql.Response(model);
|
|
49
49
|
} catch (e) {
|
|
50
50
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -57,7 +57,7 @@ const plugin = context => {
|
|
|
57
57
|
} = args;
|
|
58
58
|
|
|
59
59
|
try {
|
|
60
|
-
const model = await context.cms.
|
|
60
|
+
const model = await context.cms.updateModel(modelId, data);
|
|
61
61
|
return new _handlerGraphql.Response(model);
|
|
62
62
|
} catch (e) {
|
|
63
63
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -69,7 +69,7 @@ const plugin = context => {
|
|
|
69
69
|
} = args;
|
|
70
70
|
|
|
71
71
|
try {
|
|
72
|
-
await context.cms.
|
|
72
|
+
await context.cms.deleteModel(modelId);
|
|
73
73
|
return new _handlerGraphql.Response(true);
|
|
74
74
|
} catch (e) {
|
|
75
75
|
return new _handlerGraphql.ErrorResponse(e);
|
|
@@ -222,5 +222,4 @@ const plugin = context => {
|
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
var _default = plugin;
|
|
225
|
-
exports.default = _default;
|
|
226
|
-
//# sourceMappingURL=contentModels.js.map
|
|
225
|
+
exports.default = _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CmsModelField } from "../../../types";
|
|
2
2
|
import { Resolvers } from "@webiny/handler-graphql/types";
|
|
3
3
|
interface CreateFieldResolvers {
|
|
4
4
|
graphQLType: string;
|
|
5
|
-
fields:
|
|
5
|
+
fields: CmsModelField[];
|
|
6
6
|
isRoot: boolean;
|
|
7
7
|
extraResolvers?: Resolvers<any>;
|
|
8
8
|
}
|
|
@@ -68,25 +68,20 @@ function createFieldResolversFactory({
|
|
|
68
68
|
} = field;
|
|
69
69
|
|
|
70
70
|
fieldResolvers[fieldId] = async (parent, args, context, info) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return isRoot ? parent.values[fieldId] : parent[fieldId];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return await resolver(isRoot ? parent.values : parent, args, context, info);
|
|
86
|
-
} catch (err) {
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
88
|
-
const a = err;
|
|
71
|
+
// Get transformed value (eg. data decompression)
|
|
72
|
+
const transformedValue = await (0, _entryStorage.entryFieldFromStorageTransform)({
|
|
73
|
+
context,
|
|
74
|
+
model,
|
|
75
|
+
field,
|
|
76
|
+
value: isRoot ? parent.values[fieldId] : parent[fieldId]
|
|
77
|
+
});
|
|
78
|
+
(0, _set.default)(isRoot ? parent.values : parent, fieldId, transformedValue);
|
|
79
|
+
|
|
80
|
+
if (!resolver) {
|
|
81
|
+
return isRoot ? parent.values[fieldId] : parent[fieldId];
|
|
89
82
|
}
|
|
83
|
+
|
|
84
|
+
return await resolver(isRoot ? parent.values : parent, args, context, info);
|
|
90
85
|
};
|
|
91
86
|
}
|
|
92
87
|
|
|
@@ -94,5 +89,4 @@ function createFieldResolversFactory({
|
|
|
94
89
|
[graphQLType]: fieldResolvers
|
|
95
90
|
}, typeResolvers);
|
|
96
91
|
};
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=createFieldResolvers.js.map
|
|
92
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CmsModel, CmsFieldTypePlugins, CmsContext } from "../../../types";
|
|
2
2
|
interface CreateManageResolvers {
|
|
3
3
|
(params: {
|
|
4
|
-
models:
|
|
5
|
-
model:
|
|
4
|
+
models: CmsModel[];
|
|
5
|
+
model: CmsModel;
|
|
6
6
|
context: CmsContext;
|
|
7
7
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
8
8
|
}): any;
|
|
@@ -35,14 +35,14 @@ var _resolveUnpublish = require("./resolvers/manage/resolveUnpublish");
|
|
|
35
35
|
|
|
36
36
|
var _resolveCreateFrom = require("./resolvers/manage/resolveCreateFrom");
|
|
37
37
|
|
|
38
|
+
var _createFieldResolvers = require("./createFieldResolvers");
|
|
39
|
+
|
|
38
40
|
var _createTypeName = require("../utils/createTypeName");
|
|
39
41
|
|
|
40
42
|
var _pluralizedTypeName = require("../utils/pluralizedTypeName");
|
|
41
43
|
|
|
42
44
|
var _getEntryTitle = require("../utils/getEntryTitle");
|
|
43
45
|
|
|
44
|
-
var _createFieldResolvers = require("./createFieldResolvers");
|
|
45
|
-
|
|
46
46
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
47
47
|
|
|
48
48
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -60,8 +60,7 @@ const createManageResolvers = ({
|
|
|
60
60
|
model,
|
|
61
61
|
fieldTypePlugins
|
|
62
62
|
});
|
|
63
|
-
|
|
64
|
-
const manageResolvers = _objectSpread(_objectSpread({
|
|
63
|
+
return _objectSpread(_objectSpread({
|
|
65
64
|
Query: {
|
|
66
65
|
[`get${typeName}`]: (0, _resolveGet.resolveGet)({
|
|
67
66
|
model
|
|
@@ -123,17 +122,14 @@ const createManageResolvers = ({
|
|
|
123
122
|
return entry.status;
|
|
124
123
|
},
|
|
125
124
|
|
|
126
|
-
async revisions(entry,
|
|
125
|
+
async revisions(entry, _, context) {
|
|
127
126
|
const entryId = entry.id.split("#")[0];
|
|
128
|
-
const revisions = await context.cms.
|
|
127
|
+
const revisions = await context.cms.getEntryRevisions(model, entryId);
|
|
129
128
|
return revisions.sort((a, b) => b.version - a.version);
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
}
|
|
133
132
|
});
|
|
134
|
-
|
|
135
|
-
return manageResolvers;
|
|
136
133
|
};
|
|
137
134
|
|
|
138
|
-
exports.createManageResolvers = createManageResolvers;
|
|
139
|
-
//# sourceMappingURL=createManageResolvers.js.map
|
|
135
|
+
exports.createManageResolvers = createManageResolvers;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CmsFieldTypePlugins,
|
|
1
|
+
import { CmsFieldTypePlugins, CmsModel } from "../../../types";
|
|
2
2
|
interface CreateManageSDL {
|
|
3
3
|
(params: {
|
|
4
|
-
model:
|
|
4
|
+
model: CmsModel;
|
|
5
5
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
6
6
|
}): string;
|
|
7
7
|
}
|
|
@@ -7,15 +7,15 @@ exports.createManageSDL = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _createTypeName = require("../utils/createTypeName");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _renderListFilterFields = require("../utils/renderListFilterFields");
|
|
11
11
|
|
|
12
12
|
var _renderSortEnum = require("../utils/renderSortEnum");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _renderGetFilterFields = require("../utils/renderGetFilterFields");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _renderInputFields = require("../utils/renderInputFields");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _renderFields = require("../utils/renderFields");
|
|
19
19
|
|
|
20
20
|
var _pluralizedTypeName = require("../utils/pluralizedTypeName");
|
|
21
21
|
|
|
@@ -150,5 +150,4 @@ const createManageSDL = ({
|
|
|
150
150
|
);
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
exports.createManageSDL = createManageSDL;
|
|
154
|
-
//# sourceMappingURL=createManageSDL.js.map
|
|
153
|
+
exports.createManageSDL = createManageSDL;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CmsModel, CmsFieldTypePlugins, CmsContext } from "../../../types";
|
|
2
2
|
export interface CreateReadResolvers {
|
|
3
3
|
(params: {
|
|
4
|
-
models:
|
|
5
|
-
model:
|
|
4
|
+
models: CmsModel[];
|
|
5
|
+
model: CmsModel;
|
|
6
6
|
context: CmsContext;
|
|
7
7
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
8
8
|
}): any;
|
|
@@ -9,16 +9,16 @@ exports.createPreviewResolvers = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var _createTypeName = require("../utils/createTypeName");
|
|
13
|
-
|
|
14
12
|
var _resolveGet = require("./resolvers/preview/resolveGet");
|
|
15
13
|
|
|
16
14
|
var _resolveList = require("./resolvers/preview/resolveList");
|
|
17
15
|
|
|
18
|
-
var _pluralizedTypeName = require("../utils/pluralizedTypeName");
|
|
19
|
-
|
|
20
16
|
var _createFieldResolvers = require("./createFieldResolvers");
|
|
21
17
|
|
|
18
|
+
var _createTypeName = require("../utils/createTypeName");
|
|
19
|
+
|
|
20
|
+
var _pluralizedTypeName = require("../utils/pluralizedTypeName");
|
|
21
|
+
|
|
22
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
23
23
|
|
|
24
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -52,5 +52,4 @@ const createPreviewResolvers = ({
|
|
|
52
52
|
}));
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
exports.createPreviewResolvers = createPreviewResolvers;
|
|
56
|
-
//# sourceMappingURL=createPreviewResolvers.js.map
|
|
55
|
+
exports.createPreviewResolvers = createPreviewResolvers;
|