@webiny/api-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.40876133bb
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/context.d.ts +3 -0
- package/context.js +60 -0
- package/context.js.map +1 -0
- package/crud/contentEntry/afterDelete.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +2 -2
- package/crud/contentEntry/afterDelete.js.map +1 -0
- package/crud/contentEntry/beforeCreate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js +2 -2
- package/crud/contentEntry/beforeCreate.js.map +1 -0
- package/crud/contentEntry/beforeUpdate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js +2 -2
- package/crud/contentEntry/beforeUpdate.js.map +1 -0
- package/crud/contentEntry/entryDataValidation.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +23 -11
- package/crud/contentEntry/entryDataValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.d.ts +3 -2
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.js +10 -14
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
- package/crud/contentEntry/referenceFieldsMapping.js +288 -0
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -9
- package/crud/contentEntry.crud.js +1255 -0
- package/crud/contentEntry.crud.js.map +1 -0
- package/crud/contentModel/afterCreate.d.ts +8 -0
- package/crud/contentModel/afterCreate.js +18 -0
- package/crud/contentModel/afterCreate.js.map +1 -0
- package/crud/contentModel/afterCreateFrom.d.ts +8 -0
- package/crud/contentModel/afterCreateFrom.js +18 -0
- package/crud/contentModel/afterCreateFrom.js.map +1 -0
- package/crud/contentModel/afterDelete.d.ts +8 -0
- package/crud/contentModel/afterDelete.js +18 -0
- package/crud/contentModel/afterDelete.js.map +1 -0
- package/crud/contentModel/afterUpdate.d.ts +8 -0
- package/crud/contentModel/afterUpdate.js +18 -0
- package/crud/contentModel/afterUpdate.js.map +1 -0
- package/crud/contentModel/beforeCreate.d.ts +15 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +61 -13
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/crud/contentModel/beforeDelete.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +14 -10
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/crud/contentModel/beforeUpdate.d.ts +10 -0
- package/crud/contentModel/beforeUpdate.js +37 -0
- package/crud/contentModel/beforeUpdate.js.map +1 -0
- package/crud/contentModel/contentModelManagerFactory.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -0
- package/crud/contentModel/createFieldModels.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +6 -2
- package/crud/contentModel/createFieldModels.js.map +1 -0
- package/crud/contentModel/createFieldStorageId.d.ts +2 -0
- package/crud/contentModel/createFieldStorageId.js +16 -0
- package/crud/contentModel/createFieldStorageId.js.map +1 -0
- package/crud/contentModel/fieldIdValidation.d.ts +1 -0
- package/crud/contentModel/fieldIdValidation.js +25 -0
- package/crud/contentModel/fieldIdValidation.js.map +1 -0
- package/crud/contentModel/idValidation.d.ts +1 -0
- package/{content/plugins/crud → crud}/contentModel/idValidation.js +3 -3
- package/crud/contentModel/idValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/models.d.ts +2 -1
- package/{content/plugins/crud → crud}/contentModel/models.js +64 -25
- package/crud/contentModel/models.js.map +1 -0
- package/crud/contentModel/systemFields.d.ts +1 -0
- package/crud/contentModel/systemFields.js +8 -0
- package/crud/contentModel/systemFields.js.map +1 -0
- package/crud/contentModel/validateLayout.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js +1 -3
- package/crud/contentModel/validateLayout.js.map +1 -0
- package/crud/contentModel/validateModel.d.ts +9 -0
- package/crud/contentModel/validateModel.js +32 -0
- package/crud/contentModel/validateModel.js.map +1 -0
- package/crud/contentModel/validateModelFields.d.ts +9 -0
- package/crud/contentModel/validateModelFields.js +359 -0
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
- package/crud/contentModel.crud.js +605 -0
- package/crud/contentModel.crud.js.map +1 -0
- package/crud/contentModelGroup/beforeCreate.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +9 -9
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/crud/contentModelGroup/beforeDelete.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +4 -4
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +3 -3
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup.crud.d.ts +3 -3
- package/{content/plugins/crud → crud}/contentModelGroup.crud.js +108 -93
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/crud/index.d.ts +6 -0
- package/crud/index.js +85 -0
- package/crud/index.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
- package/crud/settings.crud.js +83 -0
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +6 -3
- package/crud/system.crud.js +221 -0
- package/crud/system.crud.js.map +1 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.d.ts +7 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +66 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.d.ts +11 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +304 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/index.d.ts +3 -0
- package/fieldConverters/index.js +16 -0
- package/fieldConverters/index.js.map +1 -0
- package/{content/plugins → graphql}/buildSchemaPlugins.d.ts +2 -3
- package/graphql/buildSchemaPlugins.js +27 -0
- package/graphql/buildSchemaPlugins.js.map +1 -0
- package/graphql/graphQLHandlerFactory.d.ts +5 -0
- package/graphql/graphQLHandlerFactory.js +158 -0
- package/graphql/graphQLHandlerFactory.js.map +1 -0
- package/graphql/index.d.ts +5 -0
- package/graphql/index.js +57 -0
- package/graphql/index.js.map +1 -0
- package/graphql/schema/baseContentSchema.d.ts +3 -0
- package/graphql/schema/baseContentSchema.js +76 -0
- package/graphql/schema/baseContentSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +3 -0
- package/graphql/schema/contentEntries.js +351 -0
- package/graphql/schema/contentEntries.js.map +1 -0
- package/graphql/schema/contentModelGroups.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModelGroups.js +34 -15
- package/graphql/schema/contentModelGroups.js.map +1 -0
- package/graphql/schema/contentModels.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModels.js +66 -10
- package/graphql/schema/contentModels.js.map +1 -0
- package/graphql/schema/createFieldResolvers.d.ts +20 -0
- package/{content/plugins → graphql}/schema/createFieldResolvers.js +48 -23
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.js +36 -34
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/graphql/schema/createManageSDL.d.ts +10 -0
- package/{content/plugins → graphql}/schema/createManageSDL.js +23 -16
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/graphql/schema/createPreviewResolvers.d.ts +12 -0
- package/graphql/schema/createPreviewResolvers.js +58 -0
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/graphql/schema/createReadResolvers.d.ts +12 -0
- package/graphql/schema/createReadResolvers.js +58 -0
- package/graphql/schema/createReadResolvers.js.map +1 -0
- package/graphql/schema/createReadSDL.d.ts +10 -0
- package/{content/plugins → graphql}/schema/createReadSDL.js +14 -8
- package/graphql/schema/createReadSDL.js.map +1 -0
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +6 -0
- package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js +0 -0
- package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveCreate.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +2 -4
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +8 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +2 -4
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveDelete.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +10 -8
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGet.d.ts +7 -0
- package/graphql/schema/resolvers/manage/resolveGet.js +79 -0
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGetByIds.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +2 -4
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGetRevisions.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +2 -4
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveList.d.ts +4 -0
- package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/manage}/resolveList.js +2 -4
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolvePublish.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveRepublish.d.ts +7 -0
- package/{content/plugins/schema/resolvers/manage/resolveGet.js → graphql/schema/resolvers/manage/resolveRepublish.js} +4 -4
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.d.ts +4 -3
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js +2 -4
- package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +1 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.d.ts +4 -3
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js +2 -4
- package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +8 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +2 -4
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveGet.d.ts +4 -0
- package/graphql/schema/resolvers/preview/resolveGet.js +34 -0
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveList.d.ts +4 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +2 -4
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -0
- package/graphql/schema/resolvers/read/resolveGet.d.ts +4 -0
- package/graphql/schema/resolvers/read/resolveGet.js +34 -0
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/read/resolveList.d.ts +4 -0
- package/{content/plugins/schema/resolvers/manage → graphql/schema/resolvers/read}/resolveList.js +2 -4
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -0
- package/{content/plugins → graphql}/schema/schemaPlugins.d.ts +1 -1
- package/{content/plugins → graphql}/schema/schemaPlugins.js +25 -6
- package/graphql/schema/schemaPlugins.js.map +1 -0
- package/graphql/system.d.ts +6 -0
- package/graphql/system.js +119 -0
- package/graphql/system.js.map +1 -0
- package/graphqlFields/boolean.d.ts +2 -0
- package/graphqlFields/boolean.js +69 -0
- package/graphqlFields/boolean.js.map +1 -0
- package/graphqlFields/datetime.d.ts +2 -0
- package/graphqlFields/datetime.js +95 -0
- package/graphqlFields/datetime.js.map +1 -0
- package/graphqlFields/file.d.ts +2 -0
- package/graphqlFields/file.js +50 -0
- package/graphqlFields/file.js.map +1 -0
- package/graphqlFields/helpers.d.ts +6 -0
- package/graphqlFields/helpers.js +49 -0
- package/graphqlFields/helpers.js.map +1 -0
- package/graphqlFields/index.d.ts +2 -0
- package/graphqlFields/index.js +28 -0
- package/graphqlFields/index.js.map +1 -0
- package/graphqlFields/longText.d.ts +2 -0
- package/graphqlFields/longText.js +63 -0
- package/graphqlFields/longText.js.map +1 -0
- package/graphqlFields/number.d.ts +2 -0
- package/graphqlFields/number.js +75 -0
- package/graphqlFields/number.js.map +1 -0
- package/graphqlFields/object.d.ts +2 -0
- package/graphqlFields/object.js +225 -0
- package/graphqlFields/object.js.map +1 -0
- package/graphqlFields/ref.d.ts +2 -0
- package/graphqlFields/ref.js +275 -0
- package/graphqlFields/ref.js.map +1 -0
- package/graphqlFields/richText.d.ts +2 -0
- package/graphqlFields/richText.js +56 -0
- package/graphqlFields/richText.js.map +1 -0
- package/graphqlFields/text.d.ts +2 -0
- package/graphqlFields/text.js +73 -0
- package/graphqlFields/text.js.map +1 -0
- package/index.d.ts +10 -12
- package/index.js +80 -37
- package/index.js.map +1 -0
- package/modelManager/DefaultCmsModelManager.d.ts +14 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +12 -10
- package/modelManager/DefaultCmsModelManager.js.map +1 -0
- package/modelManager/index.d.ts +2 -0
- package/{content/plugins/modelManager → modelManager}/index.js +3 -3
- package/modelManager/index.js.map +1 -0
- package/package.json +36 -36
- package/parameters/context.d.ts +2 -0
- package/parameters/context.js +22 -0
- package/parameters/context.js.map +1 -0
- package/parameters/header.d.ts +2 -0
- package/parameters/header.js +55 -0
- package/parameters/header.js.map +1 -0
- package/parameters/index.d.ts +4 -0
- package/parameters/index.js +57 -0
- package/parameters/index.js.map +1 -0
- package/parameters/manual.d.ts +6 -0
- package/parameters/manual.js +44 -0
- package/parameters/manual.js.map +1 -0
- package/parameters/path.d.ts +2 -0
- package/parameters/path.js +51 -0
- package/parameters/path.js.map +1 -0
- package/plugins/CmsGroupPlugin.d.ts +13 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.js +9 -3
- package/plugins/CmsGroupPlugin.js.map +1 -0
- package/plugins/CmsModelFieldConverterPlugin.d.ts +14 -0
- package/plugins/CmsModelFieldConverterPlugin.js +17 -0
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -0
- package/plugins/CmsModelPlugin.d.ts +45 -0
- package/plugins/CmsModelPlugin.js +194 -0
- package/plugins/CmsModelPlugin.js.map +1 -0
- package/plugins/CmsParametersPlugin.d.ts +20 -0
- package/plugins/CmsParametersPlugin.js +28 -0
- package/plugins/CmsParametersPlugin.js.map +1 -0
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.d.ts +4 -3
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +2 -1
- package/plugins/StorageTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +5 -0
- package/plugins/index.js +70 -0
- package/plugins/index.js.map +1 -0
- package/storage/default.d.ts +2 -0
- package/storage/default.js +27 -0
- package/storage/default.js.map +1 -0
- package/storage/object.d.ts +2 -0
- package/storage/object.js +124 -0
- package/storage/object.js.map +1 -0
- package/types.d.ts +657 -349
- package/types.js +52 -2
- package/types.js.map +1 -0
- package/upgrades/5.33.0/index.d.ts +3 -0
- package/upgrades/5.33.0/index.js +182 -0
- package/upgrades/5.33.0/index.js.map +1 -0
- package/upgrades/index.d.ts +1 -0
- package/upgrades/index.js +12 -0
- package/upgrades/index.js.map +1 -0
- package/utils/access.d.ts +8 -0
- package/utils/access.js +90 -0
- package/utils/access.js.map +1 -0
- package/utils/converters/Converter.d.ts +27 -0
- package/utils/converters/Converter.js +71 -0
- package/utils/converters/Converter.js.map +1 -0
- package/utils/converters/ConverterCollection.d.ts +31 -0
- package/utils/converters/ConverterCollection.js +139 -0
- package/utils/converters/ConverterCollection.js.map +1 -0
- package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
- package/utils/converters/valueKeyStorageConverter.js +148 -0
- package/utils/converters/valueKeyStorageConverter.js.map +1 -0
- package/{content/plugins/utils → utils}/createTypeName.d.ts +3 -3
- package/{content/plugins/utils → utils}/createTypeName.js +1 -1
- package/utils/createTypeName.js.map +1 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
- package/{content/plugins/utils → utils}/entryStorage.js +4 -12
- package/utils/entryStorage.js.map +1 -0
- package/utils/filterAsync.d.ts +1 -0
- package/utils/filterAsync.js +23 -0
- package/utils/filterAsync.js.map +1 -0
- package/utils/filterModelFields.d.ts +16 -0
- package/utils/filterModelFields.js +77 -0
- package/utils/filterModelFields.js.map +1 -0
- package/utils/getEntryTitle.d.ts +2 -0
- package/{content/plugins/utils → utils}/getEntryTitle.js +7 -6
- package/utils/getEntryTitle.js.map +1 -0
- package/utils/getSchemaFromFieldPlugins.d.ts +12 -0
- package/utils/getSchemaFromFieldPlugins.js +35 -0
- package/utils/getSchemaFromFieldPlugins.js.map +1 -0
- package/utils/ownership.d.ts +8 -0
- package/utils/ownership.js +41 -0
- package/utils/ownership.js.map +1 -0
- package/utils/permissions.d.ts +7 -0
- package/utils/permissions.js +106 -0
- package/utils/permissions.js.map +1 -0
- package/utils/pluralizedTypeName.d.ts +1 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +1 -1
- package/utils/pluralizedTypeName.js.map +1 -0
- package/utils/renderFields.d.ts +15 -0
- package/{content/plugins/utils → utils}/renderFields.js +4 -2
- package/utils/renderFields.js.map +1 -0
- package/utils/renderGetFilterFields.d.ts +10 -0
- package/{content/plugins/utils → utils}/renderGetFilterFields.js +28 -13
- package/utils/renderGetFilterFields.js.map +1 -0
- package/utils/renderInputFields.d.ts +14 -0
- package/{content/plugins/utils → utils}/renderInputFields.js +1 -1
- package/utils/renderInputFields.js.map +1 -0
- package/utils/renderListFilterFields.d.ts +11 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.js +37 -17
- package/utils/renderListFilterFields.js.map +1 -0
- package/{content/plugins/utils → utils}/renderSortEnum.d.ts +1 -1
- package/utils/renderSortEnum.js +32 -0
- package/utils/renderSortEnum.js.map +1 -0
- package/utils/toSlug.d.ts +1 -0
- package/utils/toSlug.js +20 -0
- package/utils/toSlug.js.map +1 -0
- package/validators/dateGte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateGte.js +4 -4
- package/validators/dateGte.js.map +1 -0
- package/validators/dateLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateLte.js +4 -4
- package/validators/dateLte.js.map +1 -0
- package/validators/gte.d.ts +2 -0
- package/validators/gte.js +36 -0
- package/validators/gte.js.map +1 -0
- package/validators/in.d.ts +2 -0
- package/validators/in.js +36 -0
- package/validators/in.js.map +1 -0
- package/validators/index.d.ts +1 -0
- package/validators/index.js +36 -0
- package/validators/index.js.map +1 -0
- package/validators/lte.d.ts +2 -0
- package/validators/lte.js +36 -0
- package/validators/lte.js.map +1 -0
- package/validators/maxLength.d.ts +2 -0
- package/validators/maxLength.js +36 -0
- package/validators/maxLength.js.map +1 -0
- package/validators/minLength.d.ts +2 -0
- package/validators/minLength.js +36 -0
- package/validators/minLength.js.map +1 -0
- package/validators/pattern.d.ts +2 -0
- package/validators/pattern.js +50 -0
- package/validators/pattern.js.map +1 -0
- package/validators/patternPlugins/email.d.ts +2 -0
- package/validators/patternPlugins/email.js +20 -0
- package/validators/patternPlugins/email.js.map +1 -0
- package/validators/patternPlugins/index.d.ts +2 -0
- package/validators/patternPlugins/index.js +24 -0
- package/validators/patternPlugins/index.js.map +1 -0
- package/validators/patternPlugins/lowerCase.d.ts +2 -0
- package/validators/patternPlugins/lowerCase.js +20 -0
- package/validators/patternPlugins/lowerCase.js.map +1 -0
- package/validators/patternPlugins/lowerCaseSpace.d.ts +2 -0
- package/validators/patternPlugins/lowerCaseSpace.js +20 -0
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -0
- package/validators/patternPlugins/upperCase.d.ts +2 -0
- package/validators/patternPlugins/upperCase.js +20 -0
- package/validators/patternPlugins/upperCase.js.map +1 -0
- package/validators/patternPlugins/upperCaseSpace.d.ts +2 -0
- package/validators/patternPlugins/upperCaseSpace.js +20 -0
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -0
- package/validators/patternPlugins/url.d.ts +2 -0
- package/validators/patternPlugins/url.js +20 -0
- package/validators/patternPlugins/url.js.map +1 -0
- package/validators/required.d.ts +2 -0
- package/validators/required.js +27 -0
- package/validators/required.js.map +1 -0
- package/validators/timeGte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeGte.js +6 -4
- package/validators/timeGte.js.map +1 -0
- package/validators/timeLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeLte.js +6 -4
- package/validators/timeLte.js.map +1 -0
- package/validators/unique.d.ts +6 -0
- package/validators/unique.js +63 -0
- package/validators/unique.js.map +1 -0
- package/content/contextSetup.d.ts +0 -4
- package/content/contextSetup.js +0 -65
- package/content/graphQLHandlerFactory.d.ts +0 -5
- package/content/graphQLHandlerFactory.js +0 -173
- package/content/plugins/CmsGroupPlugin.d.ts +0 -11
- package/content/plugins/CmsModelPlugin.d.ts +0 -11
- package/content/plugins/CmsModelPlugin.js +0 -24
- package/content/plugins/buildSchemaPlugins.js +0 -29
- package/content/plugins/crud/contentEntry/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +0 -7
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +0 -7
- package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +0 -4
- package/content/plugins/crud/contentEntry.crud.js +0 -931
- package/content/plugins/crud/contentModel/afterCreate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterCreate.js +0 -18
- package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterDelete.js +0 -18
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterUpdate.js +0 -18
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeUpdate.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeUpdate.js +0 -128
- package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +0 -2
- package/content/plugins/crud/contentModel/createFieldModels.d.ts +0 -2
- package/content/plugins/crud/contentModel/idValidation.d.ts +0 -2
- package/content/plugins/crud/contentModel/validateLayout.d.ts +0 -2
- package/content/plugins/crud/contentModel.crud.js +0 -425
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
- package/content/plugins/crud/index.d.ts +0 -6
- package/content/plugins/crud/index.js +0 -100
- package/content/plugins/graphqlFields/boolean.d.ts +0 -3
- package/content/plugins/graphqlFields/boolean.js +0 -69
- package/content/plugins/graphqlFields/datetime.d.ts +0 -3
- package/content/plugins/graphqlFields/datetime.js +0 -83
- package/content/plugins/graphqlFields/file.d.ts +0 -3
- package/content/plugins/graphqlFields/file.js +0 -49
- package/content/plugins/graphqlFields/index.d.ts +0 -2
- package/content/plugins/graphqlFields/index.js +0 -30
- package/content/plugins/graphqlFields/longText.d.ts +0 -3
- package/content/plugins/graphqlFields/longText.js +0 -62
- package/content/plugins/graphqlFields/number.d.ts +0 -3
- package/content/plugins/graphqlFields/number.js +0 -75
- package/content/plugins/graphqlFields/object.d.ts +0 -3
- package/content/plugins/graphqlFields/object.js +0 -180
- package/content/plugins/graphqlFields/ref.d.ts +0 -3
- package/content/plugins/graphqlFields/ref.js +0 -205
- package/content/plugins/graphqlFields/richText.d.ts +0 -3
- package/content/plugins/graphqlFields/richText.js +0 -55
- package/content/plugins/graphqlFields/text.d.ts +0 -3
- package/content/plugins/graphqlFields/text.js +0 -72
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -54
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -35
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -15
- package/content/plugins/modelManager/index.d.ts +0 -3
- package/content/plugins/schema/baseSchema.d.ts +0 -4
- package/content/plugins/schema/baseSchema.js +0 -98
- package/content/plugins/schema/contentEntries.d.ts +0 -4
- package/content/plugins/schema/contentEntries.js +0 -166
- package/content/plugins/schema/contentModelGroups.d.ts +0 -4
- package/content/plugins/schema/contentModels.d.ts +0 -4
- package/content/plugins/schema/createFieldResolvers.d.ts +0 -19
- package/content/plugins/schema/createManageResolvers.d.ts +0 -11
- package/content/plugins/schema/createManageSDL.d.ts +0 -9
- package/content/plugins/schema/createPreviewResolvers.d.ts +0 -10
- package/content/plugins/schema/createPreviewResolvers.js +0 -55
- package/content/plugins/schema/createReadResolvers.d.ts +0 -10
- package/content/plugins/schema/createReadResolvers.js +0 -55
- package/content/plugins/schema/createReadSDL.d.ts +0 -9
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +0 -7
- package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +0 -7
- package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/preview/resolveGet.js +0 -38
- package/content/plugins/schema/resolvers/preview/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveGet.js +0 -38
- package/content/plugins/schema/resolvers/read/resolveList.d.ts +0 -2
- package/content/plugins/storage/default.d.ts +0 -3
- package/content/plugins/storage/default.js +0 -28
- package/content/plugins/storage/object.d.ts +0 -3
- package/content/plugins/storage/object.js +0 -119
- package/content/plugins/utils/getEntryTitle.d.ts +0 -2
- package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +0 -11
- package/content/plugins/utils/getSchemaFromFieldPlugins.js +0 -30
- package/content/plugins/utils/pluralizedTypeName.d.ts +0 -1
- package/content/plugins/utils/renderFields.d.ts +0 -16
- package/content/plugins/utils/renderGetFilterFields.d.ts +0 -9
- package/content/plugins/utils/renderInputFields.d.ts +0 -14
- package/content/plugins/utils/renderListFilterFields.d.ts +0 -10
- package/content/plugins/utils/renderSortEnum.js +0 -32
- package/content/plugins/validators/dateGte.d.ts +0 -3
- package/content/plugins/validators/dateLte.d.ts +0 -3
- package/content/plugins/validators/gte.d.ts +0 -3
- package/content/plugins/validators/gte.js +0 -32
- package/content/plugins/validators/in.d.ts +0 -3
- package/content/plugins/validators/in.js +0 -32
- package/content/plugins/validators/index.d.ts +0 -2
- package/content/plugins/validators/index.js +0 -36
- package/content/plugins/validators/lte.d.ts +0 -3
- package/content/plugins/validators/lte.js +0 -32
- package/content/plugins/validators/maxLength.d.ts +0 -3
- package/content/plugins/validators/maxLength.js +0 -32
- package/content/plugins/validators/minLength.d.ts +0 -3
- package/content/plugins/validators/minLength.js +0 -32
- package/content/plugins/validators/pattern.d.ts +0 -3
- package/content/plugins/validators/pattern.js +0 -47
- package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/email.js +0 -17
- package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
- package/content/plugins/validators/patternPlugins/index.js +0 -19
- package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
- package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/url.js +0 -17
- package/content/plugins/validators/required.d.ts +0 -3
- package/content/plugins/validators/required.js +0 -25
- package/content/plugins/validators/timeGte.d.ts +0 -3
- package/content/plugins/validators/timeLte.d.ts +0 -3
- package/migrateCMSPermissions.d.ts +0 -17
- package/migrateCMSPermissions.js +0 -193
- package/plugins/context.d.ts +0 -4
- package/plugins/context.js +0 -34
- package/plugins/crud/index.d.ts +0 -6
- package/plugins/crud/index.js +0 -100
- package/plugins/crud/settings.crud.js +0 -93
- package/plugins/crud/system.crud.js +0 -182
- package/plugins/graphql/system.d.ts +0 -17
- package/plugins/graphql/system.js +0 -72
- package/plugins/graphql.d.ts +0 -2
- package/plugins/graphql.js +0 -79
- package/plugins/upgrades/index.d.ts +0 -2
- package/plugins/upgrades/index.js +0 -14
- package/plugins/upgrades/v5.5.0/helpers.d.ts +0 -6
- package/plugins/upgrades/v5.5.0/helpers.js +0 -10
- package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
- package/plugins/upgrades/v5.5.0/index.js +0 -129
- package/transformers.d.ts +0 -2
- package/transformers.js +0 -25
- package/utils.d.ts +0 -25
- package/utils.js +0 -251
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CmsEntryResolverFactory as ResolverFactory } from "
|
|
2
|
-
|
|
1
|
+
import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
2
|
+
interface ResolveRequestChangesArgs {
|
|
3
3
|
revision: string;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
declare type ResolveRequestChanges = ResolverFactory<any, ResolveRequestChangesArgs>;
|
|
5
6
|
export declare const resolveRequestChanges: ResolveRequestChanges;
|
|
6
7
|
export {};
|
|
@@ -9,11 +9,9 @@ var _responses = require("@webiny/handler-graphql/responses");
|
|
|
9
9
|
|
|
10
10
|
const resolveRequestChanges = ({
|
|
11
11
|
model
|
|
12
|
-
}) => async (_, args, {
|
|
13
|
-
cms
|
|
14
|
-
}) => {
|
|
12
|
+
}) => async (_, args, context) => {
|
|
15
13
|
try {
|
|
16
|
-
const entry = await cms.requestEntryChanges(model, args.revision);
|
|
14
|
+
const entry = await context.cms.requestEntryChanges(model, args.revision);
|
|
17
15
|
return new _responses.Response(entry);
|
|
18
16
|
} catch (e) {
|
|
19
17
|
return new _responses.ErrorResponse(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveRequestChanges","model","_","args","context","entry","cms","requestEntryChanges","revision","Response","e","ErrorResponse"],"sources":["resolveRequestChanges.ts"],"sourcesContent":["import { Response, ErrorResponse } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryResolverFactory as ResolverFactory } from \"~/types\";\n\ninterface ResolveRequestChangesArgs {\n revision: string;\n}\ntype ResolveRequestChanges = ResolverFactory<any, ResolveRequestChangesArgs>;\n\nexport const resolveRequestChanges: ResolveRequestChanges =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const entry = await context.cms.requestEntryChanges(model, args.revision);\n\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,qBAA4C,GACrD,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAUC,IAAV,EAAqBC,OAArB,KAAiC;EAC7B,IAAI;IACA,MAAMC,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAR,CAAYC,mBAAZ,CAAgCN,KAAhC,EAAuCE,IAAI,CAACK,QAA5C,CAApB;IAEA,OAAO,IAAIC,mBAAJ,CAAaJ,KAAb,CAAP;EACH,CAJD,CAIE,OAAOK,CAAP,EAAU;IACR,OAAO,IAAIC,wBAAJ,CAAkBD,CAAlB,CAAP;EACH;AACJ,CAVE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CmsEntryResolverFactory as ResolverFactory } from "
|
|
2
|
-
|
|
1
|
+
import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
2
|
+
interface ResolveRequestReviewArgs {
|
|
3
3
|
revision: string;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
declare type ResolveRequestReview = ResolverFactory<any, ResolveRequestReviewArgs>;
|
|
5
6
|
export declare const resolveRequestReview: ResolveRequestReview;
|
|
6
7
|
export {};
|
|
@@ -9,11 +9,9 @@ var _responses = require("@webiny/handler-graphql/responses");
|
|
|
9
9
|
|
|
10
10
|
const resolveRequestReview = ({
|
|
11
11
|
model
|
|
12
|
-
}) => async (_, args, {
|
|
13
|
-
cms
|
|
14
|
-
}) => {
|
|
12
|
+
}) => async (_, args, context) => {
|
|
15
13
|
try {
|
|
16
|
-
const entry = await cms.requestEntryReview(model, args.revision);
|
|
14
|
+
const entry = await context.cms.requestEntryReview(model, args.revision);
|
|
17
15
|
return new _responses.Response(entry);
|
|
18
16
|
} catch (e) {
|
|
19
17
|
return new _responses.ErrorResponse(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveRequestReview","model","_","args","context","entry","cms","requestEntryReview","revision","Response","e","ErrorResponse"],"sources":["resolveRequestReview.ts"],"sourcesContent":["import { Response, ErrorResponse } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryResolverFactory as ResolverFactory } from \"~/types\";\n\ninterface ResolveRequestReviewArgs {\n revision: string;\n}\ntype ResolveRequestReview = ResolverFactory<any, ResolveRequestReviewArgs>;\n\nexport const resolveRequestReview: ResolveRequestReview =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const entry = await context.cms.requestEntryReview(model, args.revision);\n\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,oBAA0C,GACnD,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAUC,IAAV,EAAqBC,OAArB,KAAiC;EAC7B,IAAI;IACA,MAAMC,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAR,CAAYC,kBAAZ,CAA+BN,KAA/B,EAAsCE,IAAI,CAACK,QAA3C,CAApB;IAEA,OAAO,IAAIC,mBAAJ,CAAaJ,KAAb,CAAP;EACH,CAJD,CAIE,OAAOK,CAAP,EAAU;IACR,OAAO,IAAIC,wBAAJ,CAAkBD,CAAlB,CAAP;EACH;AACJ,CAVE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
2
|
+
interface ResolveUnpublishArgs {
|
|
3
|
+
revision: string;
|
|
4
|
+
}
|
|
5
|
+
declare type ResolveUnpublish = ResolverFactory<any, ResolveUnpublishArgs>;
|
|
6
|
+
export declare const resolveUnpublish: ResolveUnpublish;
|
|
7
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveUnpublish","model","_","args","context","entry","cms","unpublishEntry","revision","Response","e","ErrorResponse"],"sources":["resolveUnpublish.ts"],"sourcesContent":["import { Response, ErrorResponse } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryResolverFactory as ResolverFactory } from \"~/types\";\n\ninterface ResolveUnpublishArgs {\n revision: string;\n}\ntype ResolveUnpublish = ResolverFactory<any, ResolveUnpublishArgs>;\n\nexport const resolveUnpublish: ResolveUnpublish =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const entry = await context.cms.unpublishEntry(model, args.revision);\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,gBAAkC,GAC3C,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAUC,IAAV,EAAqBC,OAArB,KAAiC;EAC7B,IAAI;IACA,MAAMC,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAR,CAAYC,cAAZ,CAA2BN,KAA3B,EAAkCE,IAAI,CAACK,QAAvC,CAApB;IACA,OAAO,IAAIC,mBAAJ,CAAaJ,KAAb,CAAP;EACH,CAHD,CAGE,OAAOK,CAAP,EAAU;IACR,OAAO,IAAIC,wBAAJ,CAAkBD,CAAlB,CAAP;EACH;AACJ,CATE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CmsEntryResolverFactory as ResolverFactory, UpdateCmsEntryInput } from "../../../../types";
|
|
2
|
+
interface ResolveUpdateArgs {
|
|
3
|
+
revision: string;
|
|
4
|
+
data: UpdateCmsEntryInput;
|
|
5
|
+
}
|
|
6
|
+
declare type ResolveUpdate = ResolverFactory<any, ResolveUpdateArgs>;
|
|
7
|
+
export declare const resolveUpdate: ResolveUpdate;
|
|
8
|
+
export {};
|
|
@@ -9,11 +9,9 @@ var _responses = require("@webiny/handler-graphql/responses");
|
|
|
9
9
|
|
|
10
10
|
const resolveUpdate = ({
|
|
11
11
|
model
|
|
12
|
-
}) => async (_, args, {
|
|
13
|
-
cms
|
|
14
|
-
}) => {
|
|
12
|
+
}) => async (_, args, context) => {
|
|
15
13
|
try {
|
|
16
|
-
const entry = await cms.updateEntry(model, args.revision, args.data);
|
|
14
|
+
const entry = await context.cms.updateEntry(model, args.revision, args.data);
|
|
17
15
|
return new _responses.Response(entry);
|
|
18
16
|
} catch (e) {
|
|
19
17
|
return new _responses.ErrorResponse(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveUpdate","model","_","args","context","entry","cms","updateEntry","revision","data","Response","e","ErrorResponse"],"sources":["resolveUpdate.ts"],"sourcesContent":["import { Response, ErrorResponse } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryResolverFactory as ResolverFactory, UpdateCmsEntryInput } from \"~/types\";\n\ninterface ResolveUpdateArgs {\n revision: string;\n data: UpdateCmsEntryInput;\n}\ntype ResolveUpdate = ResolverFactory<any, ResolveUpdateArgs>;\n\nexport const resolveUpdate: ResolveUpdate =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const entry = await context.cms.updateEntry(model, args.revision, args.data);\n\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,aAA4B,GACrC,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAUC,IAAV,EAAqBC,OAArB,KAAiC;EAC7B,IAAI;IACA,MAAMC,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAR,CAAYC,WAAZ,CAAwBN,KAAxB,EAA+BE,IAAI,CAACK,QAApC,EAA8CL,IAAI,CAACM,IAAnD,CAApB;IAEA,OAAO,IAAIC,mBAAJ,CAAaL,KAAb,CAAP;EACH,CAJD,CAIE,OAAOM,CAAP,EAAU;IACR,OAAO,IAAIC,wBAAJ,CAAkBD,CAAlB,CAAP;EACH;AACJ,CAVE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.resolveGet = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _responses = require("@webiny/handler-graphql/responses");
|
|
13
|
+
|
|
14
|
+
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
15
|
+
|
|
16
|
+
const resolveGet = ({
|
|
17
|
+
model
|
|
18
|
+
}) => async (_, args, context) => {
|
|
19
|
+
try {
|
|
20
|
+
const [[entry]] = await context.cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
21
|
+
limit: 1
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
if (!entry) {
|
|
25
|
+
throw new _handlerGraphql.NotFoundError(`Entry not found!`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new _responses.Response(entry);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
return new _responses.ErrorResponse(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.resolveGet = resolveGet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveGet","model","_","args","context","entry","cms","listLatestEntries","limit","NotFoundError","Response","e","ErrorResponse"],"sources":["resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryListParams, CmsEntryResolverFactory as ResolverFactory } from \"~/types\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\n\ntype ResolveGet = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const [[entry]] = await context.cms.listLatestEntries(model, {\n ...args,\n limit: 1\n });\n if (!entry) {\n throw new NotFoundError(`Entry not found!`);\n }\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AAIO,MAAMA,UAAsB,GAC/B,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAeC,IAAf,EAA0BC,OAA1B,KAAsC;EAClC,IAAI;IACA,MAAM,CAAC,CAACC,KAAD,CAAD,IAAY,MAAMD,OAAO,CAACE,GAAR,CAAYC,iBAAZ,CAA8BN,KAA9B,8DACjBE,IADiB;MAEpBK,KAAK,EAAE;IAFa,GAAxB;;IAIA,IAAI,CAACH,KAAL,EAAY;MACR,MAAM,IAAII,6BAAJ,CAAmB,kBAAnB,CAAN;IACH;;IACD,OAAO,IAAIC,mBAAJ,CAAaL,KAAb,CAAP;EACH,CATD,CASE,OAAOM,CAAP,EAAU;IACR,OAAO,IAAIC,wBAAJ,CAAkBD,CAAlB,CAAP;EACH;AACJ,CAfE"}
|
|
@@ -9,11 +9,9 @@ var _responses = require("@webiny/handler-graphql/responses");
|
|
|
9
9
|
|
|
10
10
|
const resolveList = ({
|
|
11
11
|
model
|
|
12
|
-
}) => async (_, args, {
|
|
13
|
-
cms
|
|
14
|
-
}) => {
|
|
12
|
+
}) => async (_, args, context) => {
|
|
15
13
|
try {
|
|
16
|
-
const response = await cms.listLatestEntries(model, args);
|
|
14
|
+
const response = await context.cms.listLatestEntries(model, args);
|
|
17
15
|
return new _responses.ListResponse(...response);
|
|
18
16
|
} catch (e) {
|
|
19
17
|
return new _responses.ListErrorResponse(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveList","model","_","args","context","response","cms","listLatestEntries","ListResponse","e","ListErrorResponse"],"sources":["resolveList.ts"],"sourcesContent":["import { ListResponse, ListErrorResponse } from \"@webiny/handler-graphql/responses\";\nimport {\n CmsEntryMeta,\n CmsEntryResolverFactory as ResolverFactory,\n CmsEntry,\n CmsEntryListParams\n} from \"~/types\";\n\ntype ResolveList = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveList: ResolveList =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const response: [CmsEntry[], CmsEntryMeta] = await context.cms.listLatestEntries(\n model,\n args\n );\n\n return new ListResponse(...response);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;AAAA;;AAUO,MAAMA,WAAwB,GACjC,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAeC,IAAf,EAA0BC,OAA1B,KAAsC;EAClC,IAAI;IACA,MAAMC,QAAoC,GAAG,MAAMD,OAAO,CAACE,GAAR,CAAYC,iBAAZ,CAC/CN,KAD+C,EAE/CE,IAF+C,CAAnD;IAKA,OAAO,IAAIK,uBAAJ,CAAiB,GAAGH,QAApB,CAAP;EACH,CAPD,CAOE,OAAOI,CAAP,EAAU;IACR,OAAO,IAAIC,4BAAJ,CAAsBD,CAAtB,CAAP;EACH;AACJ,CAbE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.resolveGet = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _responses = require("@webiny/handler-graphql/responses");
|
|
13
|
+
|
|
14
|
+
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
15
|
+
|
|
16
|
+
const resolveGet = ({
|
|
17
|
+
model
|
|
18
|
+
}) => async (_, args, context) => {
|
|
19
|
+
try {
|
|
20
|
+
const [[entry]] = await context.cms.listPublishedEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, args), {}, {
|
|
21
|
+
limit: 1
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
if (!entry) {
|
|
25
|
+
throw new _handlerGraphql.NotFoundError(`Entry not found!`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new _responses.Response(entry);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
return new _responses.ErrorResponse(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.resolveGet = resolveGet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveGet","model","_","args","context","entry","cms","listPublishedEntries","limit","NotFoundError","Response","e","ErrorResponse"],"sources":["resolveGet.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryListParams, CmsEntryResolverFactory as ResolverFactory } from \"~/types\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\n\ntype ResolveGet = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveGet: ResolveGet =\n ({ model }) =>\n async (_: any, args: any, context) => {\n try {\n const [[entry]] = await context.cms.listPublishedEntries(model, {\n ...args,\n limit: 1\n });\n if (!entry) {\n throw new NotFoundError(`Entry not found!`);\n }\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AAIO,MAAMA,UAAsB,GAC/B,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAeC,IAAf,EAA0BC,OAA1B,KAAsC;EAClC,IAAI;IACA,MAAM,CAAC,CAACC,KAAD,CAAD,IAAY,MAAMD,OAAO,CAACE,GAAR,CAAYC,oBAAZ,CAAiCN,KAAjC,8DACjBE,IADiB;MAEpBK,KAAK,EAAE;IAFa,GAAxB;;IAIA,IAAI,CAACH,KAAL,EAAY;MACR,MAAM,IAAII,6BAAJ,CAAmB,kBAAnB,CAAN;IACH;;IACD,OAAO,IAAIC,mBAAJ,CAAaL,KAAb,CAAP;EACH,CATD,CASE,OAAOM,CAAP,EAAU;IACR,OAAO,IAAIC,wBAAJ,CAAkBD,CAAlB,CAAP;EACH;AACJ,CAfE"}
|
package/{content/plugins/schema/resolvers/manage → graphql/schema/resolvers/read}/resolveList.js
RENAMED
|
@@ -9,11 +9,9 @@ var _responses = require("@webiny/handler-graphql/responses");
|
|
|
9
9
|
|
|
10
10
|
const resolveList = ({
|
|
11
11
|
model
|
|
12
|
-
}) => async (_, args, {
|
|
13
|
-
cms
|
|
14
|
-
}) => {
|
|
12
|
+
}) => async (_, args, context) => {
|
|
15
13
|
try {
|
|
16
|
-
const response = await cms.
|
|
14
|
+
const response = await context.cms.listPublishedEntries(model, args);
|
|
17
15
|
return new _responses.ListResponse(...response);
|
|
18
16
|
} catch (e) {
|
|
19
17
|
return new _responses.ListErrorResponse(e);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveList","model","_","args","context","response","cms","listPublishedEntries","ListResponse","e","ListErrorResponse"],"sources":["resolveList.ts"],"sourcesContent":["import { ListResponse, ListErrorResponse } from \"@webiny/handler-graphql/responses\";\nimport {\n CmsEntryMeta,\n CmsEntryResolverFactory as ResolverFactory,\n CmsEntry,\n CmsEntryListParams\n} from \"~/types\";\n\ntype ResolveList = ResolverFactory<any, CmsEntryListParams>;\n\nexport const resolveList: ResolveList =\n ({ model }) =>\n async (_: any, args: CmsEntryListParams, context) => {\n try {\n const response: [CmsEntry[], CmsEntryMeta] = await context.cms.listPublishedEntries(\n model,\n args\n );\n\n return new ListResponse(...response);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;;AAAA;;AAUO,MAAMA,WAAwB,GACjC,CAAC;EAAEC;AAAF,CAAD,KACA,OAAOC,CAAP,EAAeC,IAAf,EAAyCC,OAAzC,KAAqD;EACjD,IAAI;IACA,MAAMC,QAAoC,GAAG,MAAMD,OAAO,CAACE,GAAR,CAAYC,oBAAZ,CAC/CN,KAD+C,EAE/CE,IAF+C,CAAnD;IAKA,OAAO,IAAIK,uBAAJ,CAAiB,GAAGH,QAApB,CAAP;EACH,CAPD,CAOE,OAAOI,CAAP,EAAU;IACR,OAAO,IAAIC,4BAAJ,CAAsBD,CAAtB,CAAP;EACH;AACJ,CAbE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLSchemaPlugin } from "@webiny/handler-graphql/plugins/GraphQLSchemaPlugin";
|
|
2
|
-
import { CmsContext } from "
|
|
2
|
+
import { CmsContext } from "../../types";
|
|
3
3
|
export declare const generateSchemaPlugins: (context: CmsContext) => Promise<GraphQLSchemaPlugin<CmsContext>[]>;
|
|
@@ -17,13 +17,28 @@ var _createReadResolvers = require("./createReadResolvers");
|
|
|
17
17
|
|
|
18
18
|
var _createPreviewResolvers = require("./createPreviewResolvers");
|
|
19
19
|
|
|
20
|
-
var _getSchemaFromFieldPlugins = require("
|
|
20
|
+
var _getSchemaFromFieldPlugins = require("../../utils/getSchemaFromFieldPlugins");
|
|
21
|
+
|
|
22
|
+
var _filterModelFields = require("../../utils/filterModelFields");
|
|
21
23
|
|
|
22
24
|
const generateSchemaPlugins = async context => {
|
|
23
25
|
const {
|
|
24
26
|
plugins,
|
|
25
27
|
cms
|
|
26
|
-
} = context;
|
|
28
|
+
} = context;
|
|
29
|
+
/**
|
|
30
|
+
* If type does not exist, we are not generating schema plugins for models.
|
|
31
|
+
* It should not come to this point, but we check it anyways.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
type
|
|
36
|
+
} = cms;
|
|
37
|
+
|
|
38
|
+
if (!type) {
|
|
39
|
+
return [];
|
|
40
|
+
} // Structure plugins for faster access
|
|
41
|
+
|
|
27
42
|
|
|
28
43
|
const fieldTypePlugins = plugins.byType("cms-model-field-to-graphql").reduce((acc, pl) => {
|
|
29
44
|
acc[pl.fieldType] = pl;
|
|
@@ -31,12 +46,16 @@ const generateSchemaPlugins = async context => {
|
|
|
31
46
|
}, {}); // Load model data
|
|
32
47
|
|
|
33
48
|
context.security.disableAuthorization();
|
|
34
|
-
const
|
|
49
|
+
const initialModels = (await cms.listModels()).filter(model => model.isPrivate !== true);
|
|
35
50
|
context.security.enableAuthorization();
|
|
51
|
+
const models = (0, _filterModelFields.filterModelsDeletedFields)({
|
|
52
|
+
models: initialModels,
|
|
53
|
+
type
|
|
54
|
+
});
|
|
36
55
|
const schemas = (0, _getSchemaFromFieldPlugins.getSchemaFromFieldPlugins)({
|
|
37
56
|
models,
|
|
38
57
|
fieldTypePlugins,
|
|
39
|
-
type
|
|
58
|
+
type
|
|
40
59
|
});
|
|
41
60
|
const newPlugins = [];
|
|
42
61
|
|
|
@@ -45,7 +64,7 @@ const generateSchemaPlugins = async context => {
|
|
|
45
64
|
}
|
|
46
65
|
|
|
47
66
|
models.filter(model => model.fields.length > 0).forEach(model => {
|
|
48
|
-
switch (
|
|
67
|
+
switch (type) {
|
|
49
68
|
case "manage":
|
|
50
69
|
newPlugins.push(new _GraphQLSchemaPlugin.GraphQLSchemaPlugin({
|
|
51
70
|
typeDefs: (0, _createManageSDL.createManageSDL)({
|
|
@@ -86,7 +105,7 @@ const generateSchemaPlugins = async context => {
|
|
|
86
105
|
return;
|
|
87
106
|
}
|
|
88
107
|
});
|
|
89
|
-
return newPlugins;
|
|
108
|
+
return newPlugins.filter(pl => !!pl.schema.typeDefs);
|
|
90
109
|
};
|
|
91
110
|
|
|
92
111
|
exports.generateSchemaPlugins = generateSchemaPlugins;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["generateSchemaPlugins","context","plugins","cms","type","fieldTypePlugins","byType","reduce","acc","pl","fieldType","security","disableAuthorization","initialModels","listModels","filter","model","isPrivate","enableAuthorization","models","filterModelsDeletedFields","schemas","getSchemaFromFieldPlugins","newPlugins","schema","push","GraphQLSchemaPlugin","fields","length","forEach","typeDefs","createManageSDL","resolvers","createManageResolvers","createReadSDL","READ","createReadResolvers","createPreviewResolvers"],"sources":["schemaPlugins.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins/GraphQLSchemaPlugin\";\nimport { CmsModelFieldToGraphQLPlugin, CmsFieldTypePlugins, CmsContext } from \"~/types\";\nimport { createManageSDL } from \"./createManageSDL\";\nimport { createReadSDL } from \"./createReadSDL\";\nimport { createManageResolvers } from \"./createManageResolvers\";\nimport { createReadResolvers } from \"./createReadResolvers\";\nimport { createPreviewResolvers } from \"./createPreviewResolvers\";\nimport { getSchemaFromFieldPlugins } from \"~/utils/getSchemaFromFieldPlugins\";\nimport { filterModelsDeletedFields } from \"~/utils/filterModelFields\";\n\nexport const generateSchemaPlugins = async (\n context: CmsContext\n): Promise<GraphQLSchemaPlugin<CmsContext>[]> => {\n const { plugins, cms } = context;\n\n /**\n * If type does not exist, we are not generating schema plugins for models.\n * It should not come to this point, but we check it anyways.\n */\n const { type } = cms;\n if (!type) {\n return [];\n }\n\n // Structure plugins for faster access\n const fieldTypePlugins: CmsFieldTypePlugins = plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce((acc, pl) => {\n acc[pl.fieldType] = pl;\n return acc;\n }, {} as Record<string, CmsModelFieldToGraphQLPlugin>);\n\n // Load model data\n context.security.disableAuthorization();\n const initialModels = (await cms.listModels()).filter(model => model.isPrivate !== true);\n context.security.enableAuthorization();\n\n const models = filterModelsDeletedFields({\n models: initialModels,\n type\n });\n\n const schemas = getSchemaFromFieldPlugins({\n models,\n fieldTypePlugins,\n type\n });\n\n const newPlugins: GraphQLSchemaPlugin<CmsContext>[] = [];\n for (const schema of schemas) {\n newPlugins.push(new GraphQLSchemaPlugin(schema));\n }\n\n models\n .filter(model => model.fields.length > 0)\n .forEach(model => {\n switch (type) {\n case \"manage\":\n newPlugins.push(\n new GraphQLSchemaPlugin({\n typeDefs: createManageSDL({ model, fieldTypePlugins }),\n resolvers: createManageResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n })\n );\n\n break;\n case \"preview\":\n case \"read\":\n newPlugins.push(\n new GraphQLSchemaPlugin({\n typeDefs: createReadSDL({ model, fieldTypePlugins }),\n resolvers: cms.READ\n ? createReadResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n : createPreviewResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n })\n );\n break;\n default:\n return;\n }\n });\n\n return newPlugins.filter(pl => !!pl.schema.typeDefs);\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,MAAMA,qBAAqB,GAAG,MACjCC,OADiC,IAEY;EAC7C,MAAM;IAAEC,OAAF;IAAWC;EAAX,IAAmBF,OAAzB;EAEA;AACJ;AACA;AACA;;EACI,MAAM;IAAEG;EAAF,IAAWD,GAAjB;;EACA,IAAI,CAACC,IAAL,EAAW;IACP,OAAO,EAAP;EACH,CAV4C,CAY7C;;;EACA,MAAMC,gBAAqC,GAAGH,OAAO,CAChDI,MADyC,CACJ,4BADI,EAEzCC,MAFyC,CAElC,CAACC,GAAD,EAAMC,EAAN,KAAa;IACjBD,GAAG,CAACC,EAAE,CAACC,SAAJ,CAAH,GAAoBD,EAApB;IACA,OAAOD,GAAP;EACH,CALyC,EAKvC,EALuC,CAA9C,CAb6C,CAoB7C;;EACAP,OAAO,CAACU,QAAR,CAAiBC,oBAAjB;EACA,MAAMC,aAAa,GAAG,CAAC,MAAMV,GAAG,CAACW,UAAJ,EAAP,EAAyBC,MAAzB,CAAgCC,KAAK,IAAIA,KAAK,CAACC,SAAN,KAAoB,IAA7D,CAAtB;EACAhB,OAAO,CAACU,QAAR,CAAiBO,mBAAjB;EAEA,MAAMC,MAAM,GAAG,IAAAC,4CAAA,EAA0B;IACrCD,MAAM,EAAEN,aAD6B;IAErCT;EAFqC,CAA1B,CAAf;EAKA,MAAMiB,OAAO,GAAG,IAAAC,oDAAA,EAA0B;IACtCH,MADsC;IAEtCd,gBAFsC;IAGtCD;EAHsC,CAA1B,CAAhB;EAMA,MAAMmB,UAA6C,GAAG,EAAtD;;EACA,KAAK,MAAMC,MAAX,IAAqBH,OAArB,EAA8B;IAC1BE,UAAU,CAACE,IAAX,CAAgB,IAAIC,wCAAJ,CAAwBF,MAAxB,CAAhB;EACH;;EAEDL,MAAM,CACDJ,MADL,CACYC,KAAK,IAAIA,KAAK,CAACW,MAAN,CAAaC,MAAb,GAAsB,CAD3C,EAEKC,OAFL,CAEab,KAAK,IAAI;IACd,QAAQZ,IAAR;MACI,KAAK,QAAL;QACImB,UAAU,CAACE,IAAX,CACI,IAAIC,wCAAJ,CAAwB;UACpBI,QAAQ,EAAE,IAAAC,gCAAA,EAAgB;YAAEf,KAAF;YAASX;UAAT,CAAhB,CADU;UAEpB2B,SAAS,EAAE,IAAAC,4CAAA,EAAsB;YAC7Bd,MAD6B;YAE7BH,KAF6B;YAG7BX,gBAH6B;YAI7BJ;UAJ6B,CAAtB;QAFS,CAAxB,CADJ;QAYA;;MACJ,KAAK,SAAL;MACA,KAAK,MAAL;QACIsB,UAAU,CAACE,IAAX,CACI,IAAIC,wCAAJ,CAAwB;UACpBI,QAAQ,EAAE,IAAAI,4BAAA,EAAc;YAAElB,KAAF;YAASX;UAAT,CAAd,CADU;UAEpB2B,SAAS,EAAE7B,GAAG,CAACgC,IAAJ,GACL,IAAAC,wCAAA,EAAoB;YAChBjB,MADgB;YAEhBH,KAFgB;YAGhBX,gBAHgB;YAIhBJ;UAJgB,CAApB,CADK,GAOL,IAAAoC,8CAAA,EAAuB;YACnBlB,MADmB;YAEnBH,KAFmB;YAGnBX,gBAHmB;YAInBJ;UAJmB,CAAvB;QATc,CAAxB,CADJ;QAkBA;;MACJ;QACI;IArCR;EAuCH,CA1CL;EA4CA,OAAOsB,UAAU,CAACR,MAAX,CAAkBN,EAAE,IAAI,CAAC,CAACA,EAAE,CAACe,MAAH,CAAUM,QAApC,CAAP;AACH,CAxFM"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createSystemSchemaPlugin = void 0;
|
|
7
|
+
|
|
8
|
+
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
9
|
+
|
|
10
|
+
var _api = require("@webiny/api");
|
|
11
|
+
|
|
12
|
+
const emptyResolver = () => ({});
|
|
13
|
+
|
|
14
|
+
const plugin = {
|
|
15
|
+
name: "cms.graphql.schema.system",
|
|
16
|
+
type: "graphql-schema",
|
|
17
|
+
schema: {
|
|
18
|
+
typeDefs:
|
|
19
|
+
/* GraphQL */
|
|
20
|
+
`
|
|
21
|
+
extend type Query {
|
|
22
|
+
cms: CmsQuery
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
extend type Mutation {
|
|
26
|
+
cms: CmsMutation
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type CmsQuery {
|
|
30
|
+
_empty: String
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type CmsMutation {
|
|
34
|
+
_empty: String
|
|
35
|
+
}
|
|
36
|
+
extend type CmsQuery {
|
|
37
|
+
# Get installed version
|
|
38
|
+
version: String
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
extend type CmsMutation {
|
|
42
|
+
# Install CMS
|
|
43
|
+
install: CmsBooleanResponse
|
|
44
|
+
|
|
45
|
+
# Upgrade CMS
|
|
46
|
+
upgrade(version: String!): CmsBooleanResponse
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
resolvers: {
|
|
50
|
+
Query: {
|
|
51
|
+
cms: emptyResolver
|
|
52
|
+
},
|
|
53
|
+
Mutation: {
|
|
54
|
+
cms: emptyResolver
|
|
55
|
+
},
|
|
56
|
+
CmsQuery: {
|
|
57
|
+
version: async (_, __, context) => {
|
|
58
|
+
try {
|
|
59
|
+
return context.cms.getSystemVersion();
|
|
60
|
+
} catch (e) {
|
|
61
|
+
return new _handlerGraphql.ErrorResponse(e);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
CmsMutation: {
|
|
66
|
+
install: async (_, __, {
|
|
67
|
+
cms
|
|
68
|
+
}) => {
|
|
69
|
+
try {
|
|
70
|
+
const version = await cms.getSystemVersion();
|
|
71
|
+
|
|
72
|
+
if (version) {
|
|
73
|
+
return new _handlerGraphql.ErrorResponse({
|
|
74
|
+
code: "CMS_INSTALLATION_ERROR",
|
|
75
|
+
message: "CMS is already installed."
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
await cms.installSystem();
|
|
80
|
+
return new _handlerGraphql.Response(true);
|
|
81
|
+
} catch (e) {
|
|
82
|
+
return new _handlerGraphql.ErrorResponse(e);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
upgrade: async (_, args, {
|
|
86
|
+
cms
|
|
87
|
+
}) => {
|
|
88
|
+
const {
|
|
89
|
+
version
|
|
90
|
+
} = args;
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
await cms.upgradeSystem(version);
|
|
94
|
+
return new _handlerGraphql.Response(true);
|
|
95
|
+
} catch (e) {
|
|
96
|
+
return new _handlerGraphql.ErrorResponse(e);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* We only register system schema plugin if the endpoint is not manage/preview/read.
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
const createSystemSchemaPlugin = () => {
|
|
108
|
+
return new _api.ContextPlugin(async context => {
|
|
109
|
+
var _context$cms;
|
|
110
|
+
|
|
111
|
+
if ((_context$cms = context.cms) !== null && _context$cms !== void 0 && _context$cms.type) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
context.plugins.register(plugin);
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
exports.createSystemSchemaPlugin = createSystemSchemaPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["emptyResolver","plugin","name","type","schema","typeDefs","resolvers","Query","cms","Mutation","CmsQuery","version","_","__","context","getSystemVersion","e","ErrorResponse","CmsMutation","install","code","message","installSystem","Response","upgrade","args","upgradeSystem","createSystemSchemaPlugin","ContextPlugin","plugins","register"],"sources":["system.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql\";\nimport { CmsContext } from \"~/types\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/types\";\nimport { ContextPlugin } from \"@webiny/api\";\n\nconst emptyResolver = () => ({});\n\nconst plugin: GraphQLSchemaPlugin<CmsContext> = {\n name: \"cms.graphql.schema.system\",\n type: \"graphql-schema\",\n schema: {\n typeDefs: /* GraphQL */ `\n extend type Query {\n cms: CmsQuery\n }\n\n extend type Mutation {\n cms: CmsMutation\n }\n\n type CmsQuery {\n _empty: String\n }\n\n type CmsMutation {\n _empty: String\n }\n extend type CmsQuery {\n # Get installed version\n version: String\n }\n\n extend type CmsMutation {\n # Install CMS\n install: CmsBooleanResponse\n\n # Upgrade CMS\n upgrade(version: String!): CmsBooleanResponse\n }\n `,\n resolvers: {\n Query: {\n cms: emptyResolver\n },\n Mutation: {\n cms: emptyResolver\n },\n CmsQuery: {\n version: async (_: any, __: any, context: CmsContext) => {\n try {\n return context.cms.getSystemVersion();\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n CmsMutation: {\n install: async (_: any, __: any, { cms }: CmsContext) => {\n try {\n const version = await cms.getSystemVersion();\n if (version) {\n return new ErrorResponse({\n code: \"CMS_INSTALLATION_ERROR\",\n message: \"CMS is already installed.\"\n });\n }\n\n await cms.installSystem();\n return new Response(true);\n } catch (e) {\n return new ErrorResponse(e);\n }\n },\n upgrade: async (_: any, args: any, { cms }: CmsContext) => {\n const { version } = args;\n try {\n await cms.upgradeSystem(version);\n return new Response(true);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n }\n }\n }\n};\n/**\n * We only register system schema plugin if the endpoint is not manage/preview/read.\n */\nexport const createSystemSchemaPlugin = (): ContextPlugin<CmsContext> => {\n return new ContextPlugin<CmsContext>(async context => {\n if (context.cms?.type) {\n return;\n }\n context.plugins.register(plugin);\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,aAAa,GAAG,OAAO,EAAP,CAAtB;;AAEA,MAAMC,MAAuC,GAAG;EAC5CC,IAAI,EAAE,2BADsC;EAE5CC,IAAI,EAAE,gBAFsC;EAG5CC,MAAM,EAAE;IACJC,QAAQ;IAAE;IAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SA7BY;IA8BJC,SAAS,EAAE;MACPC,KAAK,EAAE;QACHC,GAAG,EAAER;MADF,CADA;MAIPS,QAAQ,EAAE;QACND,GAAG,EAAER;MADC,CAJH;MAOPU,QAAQ,EAAE;QACNC,OAAO,EAAE,OAAOC,CAAP,EAAeC,EAAf,EAAwBC,OAAxB,KAAgD;UACrD,IAAI;YACA,OAAOA,OAAO,CAACN,GAAR,CAAYO,gBAAZ,EAAP;UACH,CAFD,CAEE,OAAOC,CAAP,EAAU;YACR,OAAO,IAAIC,6BAAJ,CAAkBD,CAAlB,CAAP;UACH;QACJ;MAPK,CAPH;MAgBPE,WAAW,EAAE;QACTC,OAAO,EAAE,OAAOP,CAAP,EAAeC,EAAf,EAAwB;UAAEL;QAAF,CAAxB,KAAgD;UACrD,IAAI;YACA,MAAMG,OAAO,GAAG,MAAMH,GAAG,CAACO,gBAAJ,EAAtB;;YACA,IAAIJ,OAAJ,EAAa;cACT,OAAO,IAAIM,6BAAJ,CAAkB;gBACrBG,IAAI,EAAE,wBADe;gBAErBC,OAAO,EAAE;cAFY,CAAlB,CAAP;YAIH;;YAED,MAAMb,GAAG,CAACc,aAAJ,EAAN;YACA,OAAO,IAAIC,wBAAJ,CAAa,IAAb,CAAP;UACH,CAXD,CAWE,OAAOP,CAAP,EAAU;YACR,OAAO,IAAIC,6BAAJ,CAAkBD,CAAlB,CAAP;UACH;QACJ,CAhBQ;QAiBTQ,OAAO,EAAE,OAAOZ,CAAP,EAAea,IAAf,EAA0B;UAAEjB;QAAF,CAA1B,KAAkD;UACvD,MAAM;YAAEG;UAAF,IAAcc,IAApB;;UACA,IAAI;YACA,MAAMjB,GAAG,CAACkB,aAAJ,CAAkBf,OAAlB,CAAN;YACA,OAAO,IAAIY,wBAAJ,CAAa,IAAb,CAAP;UACH,CAHD,CAGE,OAAOP,CAAP,EAAU;YACR,OAAO,IAAIC,6BAAJ,CAAkBD,CAAlB,CAAP;UACH;QACJ;MAzBQ;IAhBN;EA9BP;AAHoC,CAAhD;AA+EA;AACA;AACA;;AACO,MAAMW,wBAAwB,GAAG,MAAiC;EACrE,OAAO,IAAIC,kBAAJ,CAA8B,MAAMd,OAAN,IAAiB;IAAA;;IAClD,oBAAIA,OAAO,CAACN,GAAZ,yCAAI,aAAaL,IAAjB,EAAuB;MACnB;IACH;;IACDW,OAAO,CAACe,OAAR,CAAgBC,QAAhB,CAAyB7B,MAAzB;EACH,CALM,CAAP;AAMH,CAPM"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createBooleanField = void 0;
|
|
7
|
+
|
|
8
|
+
var _helpers = require("./helpers");
|
|
9
|
+
|
|
10
|
+
const createListFilters = ({
|
|
11
|
+
field
|
|
12
|
+
}) => {
|
|
13
|
+
return `
|
|
14
|
+
${field.fieldId}: Boolean
|
|
15
|
+
${field.fieldId}_not: Boolean
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const createBooleanField = () => {
|
|
20
|
+
return {
|
|
21
|
+
name: "cms-model-field-to-graphql-boolean",
|
|
22
|
+
type: "cms-model-field-to-graphql",
|
|
23
|
+
fieldType: "boolean",
|
|
24
|
+
isSortable: true,
|
|
25
|
+
isSearchable: true,
|
|
26
|
+
read: {
|
|
27
|
+
createListFilters,
|
|
28
|
+
|
|
29
|
+
createGetFilters({
|
|
30
|
+
field
|
|
31
|
+
}) {
|
|
32
|
+
return `${field.fieldId}: Boolean`;
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
createTypeField({
|
|
36
|
+
field
|
|
37
|
+
}) {
|
|
38
|
+
if (field.multipleValues) {
|
|
39
|
+
return `${field.fieldId}: [Boolean]`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return `${field.fieldId}: Boolean`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
},
|
|
46
|
+
manage: {
|
|
47
|
+
createListFilters,
|
|
48
|
+
|
|
49
|
+
createTypeField({
|
|
50
|
+
field
|
|
51
|
+
}) {
|
|
52
|
+
if (field.multipleValues) {
|
|
53
|
+
return field.fieldId + ": [Boolean]";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return field.fieldId + ": Boolean";
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
createInputField({
|
|
60
|
+
field
|
|
61
|
+
}) {
|
|
62
|
+
return (0, _helpers.createGraphQLInputField)(field, "Boolean");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.createBooleanField = createBooleanField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createListFilters","field","fieldId","createBooleanField","name","type","fieldType","isSortable","isSearchable","read","createGetFilters","createTypeField","multipleValues","manage","createInputField","createGraphQLInputField"],"sources":["boolean.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { createGraphQLInputField } from \"./helpers\";\n\ninterface CreateListFiltersParams {\n field: CmsModelField;\n}\nconst createListFilters = ({ field }: CreateListFiltersParams) => {\n return `\n ${field.fieldId}: Boolean\n ${field.fieldId}_not: Boolean\n `;\n};\n\nexport const createBooleanField = (): CmsModelFieldToGraphQLPlugin => {\n return {\n name: \"cms-model-field-to-graphql-boolean\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"boolean\",\n isSortable: true,\n isSearchable: true,\n read: {\n createListFilters,\n createGetFilters({ field }) {\n return `${field.fieldId}: Boolean`;\n },\n createTypeField({ field }) {\n if (field.multipleValues) {\n return `${field.fieldId}: [Boolean]`;\n }\n\n return `${field.fieldId}: Boolean`;\n }\n },\n manage: {\n createListFilters,\n createTypeField({ field }) {\n if (field.multipleValues) {\n return field.fieldId + \": [Boolean]\";\n }\n\n return field.fieldId + \": Boolean\";\n },\n createInputField({ field }) {\n return createGraphQLInputField(field, \"Boolean\");\n }\n }\n };\n};\n"],"mappings":";;;;;;;AACA;;AAKA,MAAMA,iBAAiB,GAAG,CAAC;EAAEC;AAAF,CAAD,KAAwC;EAC9D,OAAQ;AACZ,UAAUA,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,KAHI;AAIH,CALD;;AAOO,MAAMC,kBAAkB,GAAG,MAAoC;EAClE,OAAO;IACHC,IAAI,EAAE,oCADH;IAEHC,IAAI,EAAE,4BAFH;IAGHC,SAAS,EAAE,SAHR;IAIHC,UAAU,EAAE,IAJT;IAKHC,YAAY,EAAE,IALX;IAMHC,IAAI,EAAE;MACFT,iBADE;;MAEFU,gBAAgB,CAAC;QAAET;MAAF,CAAD,EAAY;QACxB,OAAQ,GAAEA,KAAK,CAACC,OAAQ,WAAxB;MACH,CAJC;;MAKFS,eAAe,CAAC;QAAEV;MAAF,CAAD,EAAY;QACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;UACtB,OAAQ,GAAEX,KAAK,CAACC,OAAQ,aAAxB;QACH;;QAED,OAAQ,GAAED,KAAK,CAACC,OAAQ,WAAxB;MACH;;IAXC,CANH;IAmBHW,MAAM,EAAE;MACJb,iBADI;;MAEJW,eAAe,CAAC;QAAEV;MAAF,CAAD,EAAY;QACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;UACtB,OAAOX,KAAK,CAACC,OAAN,GAAgB,aAAvB;QACH;;QAED,OAAOD,KAAK,CAACC,OAAN,GAAgB,WAAvB;MACH,CARG;;MASJY,gBAAgB,CAAC;QAAEb;MAAF,CAAD,EAAY;QACxB,OAAO,IAAAc,gCAAA,EAAwBd,KAAxB,EAA+B,SAA/B,CAAP;MACH;;IAXG;EAnBL,CAAP;AAiCH,CAlCM"}
|