@webiny/api-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.5e7233243f
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 +64 -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 +26 -10
- 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 +6 -6
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
- package/crud/contentEntry/referenceFieldsMapping.js +294 -0
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -7
- package/{content/plugins/crud → crud}/contentEntry.crud.js +585 -219
- package/crud/contentEntry.crud.js.map +1 -0
- package/crud/contentModel/afterCreate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreate.js +2 -2
- 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/{content/plugins/crud → crud}/contentModel/afterDelete.js +2 -2
- package/crud/contentModel/afterDelete.js.map +1 -0
- package/crud/contentModel/afterUpdate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.js +2 -2
- package/crud/contentModel/afterUpdate.js.map +1 -0
- package/crud/contentModel/beforeCreate.d.ts +15 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +58 -10
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.d.ts +5 -4
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +10 -6
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeUpdate.d.ts +5 -4
- 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 +363 -0
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
- package/{content/plugins/crud → crud}/contentModel.crud.js +251 -95
- package/crud/contentModel.crud.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.d.ts +4 -3
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +6 -6
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.d.ts +4 -3
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +1 -1
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +1 -1
- 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 +54 -59
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/crud/index.d.ts +6 -0
- package/{content/plugins/crud → crud}/index.js +15 -26
- package/crud/index.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
- package/crud/settings.crud.js +88 -0
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +6 -3
- package/{plugins/crud → crud}/system.crud.js +43 -16
- 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 +306 -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/{content/plugins/schema/baseSchema.js → graphql/schema/baseContentSchema.js} +10 -28
- 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 +47 -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 -17
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.js +35 -19
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/graphql/schema/createManageSDL.d.ts +10 -0
- package/{content/plugins → graphql}/schema/createManageSDL.js +20 -9
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/graphql/schema/createPreviewResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createPreviewResolvers.js +16 -9
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/graphql/schema/createReadResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createReadResolvers.js +16 -9
- 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 +83 -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/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js +2 -2
- 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/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js +2 -2
- 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 +279 -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 +11 -9
- 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 +37 -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 +45 -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 +8 -2
- 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 +41 -0
- package/plugins/CmsModelPlugin.js +189 -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 +1 -0
- 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 +128 -0
- package/storage/object.js.map +1 -0
- package/types.d.ts +413 -246
- package/types.js +52 -0
- package/types.js.map +1 -0
- package/upgrades/5.33.0/index.d.ts +3 -0
- package/upgrades/5.33.0/index.js +186 -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 +24 -0
- package/utils/converters/ConverterCollection.js +115 -0
- package/utils/converters/ConverterCollection.js.map +1 -0
- package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
- package/utils/converters/valueKeyStorageConverter.js +152 -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 +0 -0
- package/utils/createTypeName.js.map +1 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
- package/{content/plugins/utils → utils}/entryStorage.js +3 -7
- 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 +81 -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 +110 -0
- package/utils/permissions.js.map +1 -0
- package/utils/pluralizedTypeName.d.ts +1 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +0 -0
- 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 +30 -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/contentModel/afterCreate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
- package/content/plugins/crud/contentModel/beforeCreate.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/contentModelGroup/beforeUpdate.d.ts +0 -8
- package/content/plugins/crud/index.d.ts +0 -6
- 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/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/createReadResolvers.d.ts +0 -10
- 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/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +0 -2
- 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/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,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _upperFirst = _interopRequireDefault(require("lodash/upperFirst"));
|
|
11
|
-
|
|
12
|
-
var _renderFields = require("../utils/renderFields");
|
|
13
|
-
|
|
14
|
-
var _renderInputFields = require("../utils/renderInputFields");
|
|
15
|
-
|
|
16
|
-
var _createTypeName = require("../utils/createTypeName");
|
|
17
|
-
|
|
18
|
-
const typeFromField = ({
|
|
19
|
-
typeOfType,
|
|
20
|
-
model,
|
|
21
|
-
type,
|
|
22
|
-
field,
|
|
23
|
-
fieldTypePlugins
|
|
24
|
-
}) => {
|
|
25
|
-
const typeSuffix = typeOfType === "input" ? "Input" : "";
|
|
26
|
-
const typeName = (0, _createTypeName.createTypeName)(model.modelId);
|
|
27
|
-
const mTypeName = (0, _createTypeName.createManageTypeName)(typeName); // `field` is an "object" field
|
|
28
|
-
|
|
29
|
-
const fields = field.settings.fields;
|
|
30
|
-
const fieldTypeName = `${mTypeName}_${(0, _upperFirst.default)(field.fieldId)}`;
|
|
31
|
-
const typeFields = [];
|
|
32
|
-
const nestedTypes = []; // Once the loop below starts, we'll be executing a recursive "object" type generation.
|
|
33
|
-
// The main trick here is that nested objects don't know who the parent is, and will generate
|
|
34
|
-
// type names using the "model", as if they're at the top level:
|
|
35
|
-
// Every time the types are returned, we need to replace the model name in the generated type name
|
|
36
|
-
// with the actual prefix which includes parent field name type.
|
|
37
|
-
|
|
38
|
-
const replace = new RegExp(`${mTypeName}_`, "g");
|
|
39
|
-
|
|
40
|
-
for (const f of fields) {
|
|
41
|
-
const {
|
|
42
|
-
fields,
|
|
43
|
-
typeDefs
|
|
44
|
-
} = typeOfType === "type" ? (0, _renderFields.renderField)({
|
|
45
|
-
field: f,
|
|
46
|
-
type,
|
|
47
|
-
model,
|
|
48
|
-
fieldTypePlugins
|
|
49
|
-
}) : (0, _renderInputFields.renderInputField)({
|
|
50
|
-
field: f,
|
|
51
|
-
model,
|
|
52
|
-
fieldTypePlugins
|
|
53
|
-
});
|
|
54
|
-
typeFields.push(fields.replace(replace, `${fieldTypeName}_`));
|
|
55
|
-
|
|
56
|
-
if (typeDefs) {
|
|
57
|
-
nestedTypes.push(typeDefs.replace(replace, `${fieldTypeName}_`));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
fieldType: `${fieldTypeName}${typeSuffix}`,
|
|
63
|
-
typeDefs:
|
|
64
|
-
/* GraphQL */
|
|
65
|
-
`
|
|
66
|
-
${nestedTypes.join("\n")}
|
|
67
|
-
|
|
68
|
-
${typeOfType} ${fieldTypeName}${typeSuffix} {
|
|
69
|
-
${typeFields.join("\n")}
|
|
70
|
-
}
|
|
71
|
-
`
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const plugin = {
|
|
76
|
-
name: "cms-model-field-to-graphql-object",
|
|
77
|
-
type: "cms-model-field-to-graphql",
|
|
78
|
-
fieldType: "object",
|
|
79
|
-
isSortable: false,
|
|
80
|
-
isSearchable: false,
|
|
81
|
-
read: {
|
|
82
|
-
createTypeField({
|
|
83
|
-
field,
|
|
84
|
-
model,
|
|
85
|
-
fieldTypePlugins
|
|
86
|
-
}) {
|
|
87
|
-
const {
|
|
88
|
-
fieldType,
|
|
89
|
-
typeDefs
|
|
90
|
-
} = typeFromField({
|
|
91
|
-
typeOfType: "type",
|
|
92
|
-
model,
|
|
93
|
-
type: "read",
|
|
94
|
-
field,
|
|
95
|
-
fieldTypePlugins
|
|
96
|
-
});
|
|
97
|
-
return {
|
|
98
|
-
fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,
|
|
99
|
-
typeDefs
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
createResolver({
|
|
104
|
-
field,
|
|
105
|
-
createFieldResolvers,
|
|
106
|
-
graphQLType
|
|
107
|
-
}) {
|
|
108
|
-
const fieldType = `${graphQLType}_${(0, _upperFirst.default)(field.fieldId)}`;
|
|
109
|
-
return {
|
|
110
|
-
resolver: null,
|
|
111
|
-
typeResolvers: createFieldResolvers({
|
|
112
|
-
graphQLType: fieldType,
|
|
113
|
-
fields: field.settings.fields
|
|
114
|
-
})
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
manage: {
|
|
120
|
-
createTypeField({
|
|
121
|
-
model,
|
|
122
|
-
field,
|
|
123
|
-
fieldTypePlugins
|
|
124
|
-
}) {
|
|
125
|
-
const {
|
|
126
|
-
fieldType,
|
|
127
|
-
typeDefs
|
|
128
|
-
} = typeFromField({
|
|
129
|
-
typeOfType: "type",
|
|
130
|
-
model,
|
|
131
|
-
type: "manage",
|
|
132
|
-
field,
|
|
133
|
-
fieldTypePlugins
|
|
134
|
-
});
|
|
135
|
-
return {
|
|
136
|
-
fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,
|
|
137
|
-
typeDefs
|
|
138
|
-
};
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
createInputField({
|
|
142
|
-
model,
|
|
143
|
-
field,
|
|
144
|
-
fieldTypePlugins
|
|
145
|
-
}) {
|
|
146
|
-
const {
|
|
147
|
-
fieldType,
|
|
148
|
-
typeDefs
|
|
149
|
-
} = typeFromField({
|
|
150
|
-
typeOfType: "input",
|
|
151
|
-
model,
|
|
152
|
-
type: "manage",
|
|
153
|
-
field,
|
|
154
|
-
fieldTypePlugins
|
|
155
|
-
});
|
|
156
|
-
return {
|
|
157
|
-
fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,
|
|
158
|
-
typeDefs
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
createResolver({
|
|
163
|
-
graphQLType,
|
|
164
|
-
field,
|
|
165
|
-
createFieldResolvers
|
|
166
|
-
}) {
|
|
167
|
-
const fieldType = `${graphQLType}_${(0, _upperFirst.default)(field.fieldId)}`;
|
|
168
|
-
return {
|
|
169
|
-
resolver: null,
|
|
170
|
-
typeResolvers: createFieldResolvers({
|
|
171
|
-
graphQLType: fieldType,
|
|
172
|
-
fields: field.settings.fields
|
|
173
|
-
})
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
var _default = plugin;
|
|
180
|
-
exports.default = _default;
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _createTypeName = require("../utils/createTypeName");
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
const createUnionTypeName = (model, field) => {
|
|
19
|
-
return `${(0, _createTypeName.createReadTypeName)(model.modelId)}${(0, _createTypeName.createReadTypeName)(field.fieldId)}`;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const createListFilters = ({
|
|
23
|
-
field
|
|
24
|
-
}) => {
|
|
25
|
-
return `
|
|
26
|
-
${field.fieldId}: String
|
|
27
|
-
${field.fieldId}_in: [String!]
|
|
28
|
-
${field.fieldId}_not: String
|
|
29
|
-
${field.fieldId}_not_in: [String!]
|
|
30
|
-
`;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const appendTypename = (entries, typename) => {
|
|
34
|
-
return entries.map(item => {
|
|
35
|
-
item["__typename"] = typename;
|
|
36
|
-
return item;
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const modelIdToTypeName = new Map();
|
|
41
|
-
const plugin = {
|
|
42
|
-
name: "cms-model-field-to-graphql-ref",
|
|
43
|
-
type: "cms-model-field-to-graphql",
|
|
44
|
-
fieldType: "ref",
|
|
45
|
-
isSortable: false,
|
|
46
|
-
isSearchable: true,
|
|
47
|
-
read: {
|
|
48
|
-
createTypeField({
|
|
49
|
-
model,
|
|
50
|
-
field
|
|
51
|
-
}) {
|
|
52
|
-
const gqlType = field.settings.models.length > 1 ? createUnionTypeName(model, field) : (0, _createTypeName.createReadTypeName)(field.settings.models[0].modelId);
|
|
53
|
-
return field.fieldId + `: ${field.multipleValues ? `[${gqlType}]` : gqlType}`;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
createResolver({
|
|
57
|
-
field
|
|
58
|
-
}) {
|
|
59
|
-
// Create a map of model types and corresponding modelIds so resolvers don't need to perform the lookup.
|
|
60
|
-
for (const item of field.settings.models) {
|
|
61
|
-
modelIdToTypeName.set(item.modelId, (0, _createTypeName.createReadTypeName)(item.modelId));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return async (parent, _, context) => {
|
|
65
|
-
const {
|
|
66
|
-
cms
|
|
67
|
-
} = context; // Get field value for this entry
|
|
68
|
-
|
|
69
|
-
const value = parent[field.fieldId];
|
|
70
|
-
|
|
71
|
-
if (!value) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (field.multipleValues) {
|
|
76
|
-
if (!value.length) {
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const entriesByModel = value.map((ref, index) => {
|
|
81
|
-
return {
|
|
82
|
-
entryId: ref.entryId,
|
|
83
|
-
modelId: ref.modelId,
|
|
84
|
-
index
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
const getters = entriesByModel.map(async ({
|
|
88
|
-
modelId,
|
|
89
|
-
entryId
|
|
90
|
-
}) => {
|
|
91
|
-
// Get model manager, to get access to CRUD methods
|
|
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
|
-
|
|
102
|
-
return appendTypename(entries, modelIdToTypeName.get(modelId));
|
|
103
|
-
});
|
|
104
|
-
return await Promise.all(getters).then(results => results.reduce((result, item) => result.concat(item), []));
|
|
105
|
-
} // Get model manager, to get access to CRUD methods
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* If there are no revisions we must return null.
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (!revisions || revisions.length === 0) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return _objectSpread(_objectSpread({}, revisions[0]), {}, {
|
|
127
|
-
__typename: modelIdToTypeName.get(value.modelId)
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
createSchema({
|
|
133
|
-
models
|
|
134
|
-
}) {
|
|
135
|
-
const unionFields = [];
|
|
136
|
-
|
|
137
|
-
for (const model of models) {
|
|
138
|
-
// Generate a dedicated union type for every `ref` field which has more than 1 content model assigned.
|
|
139
|
-
model.fields.filter(field => field.type === "ref" && field.settings.models.length > 1).forEach(field => unionFields.push({
|
|
140
|
-
model,
|
|
141
|
-
field,
|
|
142
|
-
typeName: createUnionTypeName(model, field)
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (!unionFields.length) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return {
|
|
151
|
-
typeDefs: unionFields.map(({
|
|
152
|
-
field,
|
|
153
|
-
typeName
|
|
154
|
-
}) => `union ${typeName} = ${field.settings.models.map(({
|
|
155
|
-
modelId
|
|
156
|
-
}) => (0, _createTypeName.createReadTypeName)(modelId)).join(" | ")}`).join("\n"),
|
|
157
|
-
resolvers: {}
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
createListFilters
|
|
162
|
-
},
|
|
163
|
-
manage: {
|
|
164
|
-
createSchema() {
|
|
165
|
-
return {
|
|
166
|
-
typeDefs: `
|
|
167
|
-
type RefField {
|
|
168
|
-
modelId: String!
|
|
169
|
-
entryId: ID!
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
input RefFieldInput {
|
|
173
|
-
modelId: String!
|
|
174
|
-
entryId: ID!
|
|
175
|
-
}
|
|
176
|
-
`,
|
|
177
|
-
resolvers: {}
|
|
178
|
-
};
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
createTypeField({
|
|
182
|
-
field
|
|
183
|
-
}) {
|
|
184
|
-
if (field.multipleValues) {
|
|
185
|
-
return `${field.fieldId}: [RefField]`;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return `${field.fieldId}: RefField`;
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
createInputField({
|
|
192
|
-
field
|
|
193
|
-
}) {
|
|
194
|
-
if (field.multipleValues) {
|
|
195
|
-
return field.fieldId + ": [RefFieldInput]";
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return field.fieldId + ": RefFieldInput";
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
createListFilters
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
var _default = plugin;
|
|
205
|
-
exports.default = _default;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
const plugin = {
|
|
8
|
-
name: "cms-model-field-to-graphql-rich-text",
|
|
9
|
-
type: "cms-model-field-to-graphql",
|
|
10
|
-
fieldType: "rich-text",
|
|
11
|
-
isSortable: false,
|
|
12
|
-
isSearchable: false,
|
|
13
|
-
read: {
|
|
14
|
-
createTypeField({
|
|
15
|
-
field
|
|
16
|
-
}) {
|
|
17
|
-
if (field.multipleValues) {
|
|
18
|
-
return `${field.fieldId}: [JSON]`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return `${field.fieldId}: JSON`;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
createGetFilters({
|
|
25
|
-
field
|
|
26
|
-
}) {
|
|
27
|
-
return `${field.fieldId}: JSON`;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
manage: {
|
|
32
|
-
createTypeField({
|
|
33
|
-
field
|
|
34
|
-
}) {
|
|
35
|
-
if (field.multipleValues) {
|
|
36
|
-
return `${field.fieldId}: [JSON]`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return `${field.fieldId}: JSON`;
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
createInputField({
|
|
43
|
-
field
|
|
44
|
-
}) {
|
|
45
|
-
if (field.multipleValues) {
|
|
46
|
-
return field.fieldId + ": [JSON]";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return field.fieldId + ": JSON";
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var _default = plugin;
|
|
55
|
-
exports.default = _default;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
const createListFilters = ({
|
|
9
|
-
field
|
|
10
|
-
}) => {
|
|
11
|
-
return `
|
|
12
|
-
${field.fieldId}: String
|
|
13
|
-
${field.fieldId}_not: String
|
|
14
|
-
${field.fieldId}_in: [String]
|
|
15
|
-
${field.fieldId}_not_in: [String]
|
|
16
|
-
${field.fieldId}_contains: String
|
|
17
|
-
${field.fieldId}_not_contains: String
|
|
18
|
-
`;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const plugin = {
|
|
22
|
-
name: "cms-model-field-to-graphql-text",
|
|
23
|
-
type: "cms-model-field-to-graphql",
|
|
24
|
-
fieldType: "text",
|
|
25
|
-
isSortable: true,
|
|
26
|
-
isSearchable: true,
|
|
27
|
-
read: {
|
|
28
|
-
createTypeField({
|
|
29
|
-
field
|
|
30
|
-
}) {
|
|
31
|
-
if (field.multipleValues) {
|
|
32
|
-
return `${field.fieldId}: [String]`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return `${field.fieldId}: String`;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
createGetFilters({
|
|
39
|
-
field
|
|
40
|
-
}) {
|
|
41
|
-
return `${field.fieldId}: String`;
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
createListFilters
|
|
45
|
-
},
|
|
46
|
-
manage: {
|
|
47
|
-
createListFilters,
|
|
48
|
-
|
|
49
|
-
createTypeField({
|
|
50
|
-
field
|
|
51
|
-
}) {
|
|
52
|
-
if (field.multipleValues) {
|
|
53
|
-
return `${field.fieldId}: [String]`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return `${field.fieldId}: String`;
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
createInputField({
|
|
60
|
-
field
|
|
61
|
-
}) {
|
|
62
|
-
if (field.multipleValues) {
|
|
63
|
-
return field.fieldId + ": [String]";
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return field.fieldId + ": String";
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var _default = plugin;
|
|
72
|
-
exports.default = _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AuthenticationPlugin } from "@webiny/api-security/plugins/AuthenticationPlugin";
|
|
2
|
-
import { SecurityIdentity } from "@webiny/api-security/types";
|
|
3
|
-
import { CmsContext } from "../../../types";
|
|
4
|
-
export declare class InternalAuthenticationPlugin extends AuthenticationPlugin {
|
|
5
|
-
private _identityType;
|
|
6
|
-
constructor(identityType: string);
|
|
7
|
-
authenticate(context: CmsContext): Promise<undefined | SecurityIdentity>;
|
|
8
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.InternalAuthenticationPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _AuthenticationPlugin = require("@webiny/api-security/plugins/AuthenticationPlugin");
|
|
13
|
-
|
|
14
|
-
// @ts-nocheck
|
|
15
|
-
class InternalAuthenticationPlugin extends _AuthenticationPlugin.AuthenticationPlugin {
|
|
16
|
-
constructor(identityType) {
|
|
17
|
-
super();
|
|
18
|
-
(0, _defineProperty2.default)(this, "_identityType", void 0);
|
|
19
|
-
this._identityType = identityType;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async authenticate(context) {
|
|
23
|
-
const {
|
|
24
|
-
headers
|
|
25
|
-
} = context.http.request;
|
|
26
|
-
const header = headers["Authorization"] || headers["authorization"];
|
|
27
|
-
const apiKey = header ? header.split(" ").pop() : null;
|
|
28
|
-
|
|
29
|
-
if (!apiKey || apiKey !== (await context.cms.getReadAPIKey())) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* This is an internal identity, which has access to `read` endpoint, all content models,
|
|
34
|
-
* content entries, and all content locales.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
id: "read-api-key",
|
|
40
|
-
displayName: "Read API key",
|
|
41
|
-
type: this._identityType,
|
|
42
|
-
permissions: [{
|
|
43
|
-
name: "cms.endpoint.read"
|
|
44
|
-
}, {
|
|
45
|
-
name: "cms.content*"
|
|
46
|
-
}, {
|
|
47
|
-
name: "content.i18n"
|
|
48
|
-
}]
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
exports.InternalAuthenticationPlugin = InternalAuthenticationPlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AuthorizationPlugin } from "@webiny/api-security/plugins/AuthorizationPlugin";
|
|
2
|
-
import { CmsContext } from "../../../types";
|
|
3
|
-
export declare class InternalAuthorizationPlugin extends AuthorizationPlugin {
|
|
4
|
-
private _identityType;
|
|
5
|
-
constructor(identityType: string);
|
|
6
|
-
getPermissions(context: CmsContext): any;
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.InternalAuthorizationPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _AuthorizationPlugin = require("@webiny/api-security/plugins/AuthorizationPlugin");
|
|
13
|
-
|
|
14
|
-
// @ts-nocheck
|
|
15
|
-
class InternalAuthorizationPlugin extends _AuthorizationPlugin.AuthorizationPlugin {
|
|
16
|
-
constructor(identityType) {
|
|
17
|
-
super();
|
|
18
|
-
(0, _defineProperty2.default)(this, "_identityType", void 0);
|
|
19
|
-
this._identityType = identityType;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
getPermissions(context) {
|
|
23
|
-
const identity = context.security.getIdentity();
|
|
24
|
-
|
|
25
|
-
if (!identity || identity.type !== this._identityType) {
|
|
26
|
-
return;
|
|
27
|
-
} // Return permissions we defined in the authentication plugin.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return identity.permissions;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exports.InternalAuthorizationPlugin = InternalAuthorizationPlugin;
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|