@webiny/api-headless-cms 5.29.0 → 5.30.0-beta.0
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/{content/contextSetup.js → context.js} +13 -8
- package/context.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +7 -1
- package/crud/contentEntry/entryDataValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.js +1 -1
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry.crud.js +68 -42
- package/crud/contentEntry.crud.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterCreate.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterDelete.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterDelete.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +1 -1
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +1 -1
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeUpdate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/beforeUpdate.js +0 -0
- package/crud/contentModel/beforeUpdate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js.map +0 -0
- package/crud/contentModel/createFieldModels.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js.map +0 -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 +0 -0
- package/{content/plugins/crud → crud}/contentModel/models.js +2 -2
- package/crud/contentModel/models.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/validateModelFields.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/validateModelFields.js +2 -2
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel.crud.js +14 -12
- package/crud/contentModel.crud.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +5 -5
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +1 -1
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.d.ts +1 -1
- 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 +1 -1
- package/{content/plugins/crud → crud}/contentModelGroup.crud.js +15 -13
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/crud/index.d.ts +6 -0
- package/{content/plugins/crud → crud}/index.js +5 -17
- package/crud/index.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +1 -1
- package/{plugins/crud → crud}/settings.crud.js +3 -7
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +1 -1
- package/{plugins/crud → crud}/system.crud.js +0 -0
- package/{plugins/crud → crud}/system.crud.js.map +0 -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/{content → graphql}/graphQLHandlerFactory.js +26 -18
- 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} +3 -27
- package/graphql/schema/baseContentSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentEntries.js +5 -58
- package/graphql/schema/contentEntries.js.map +1 -0
- package/graphql/schema/contentModelGroups.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModelGroups.js +27 -11
- package/graphql/schema/contentModelGroups.js.map +1 -0
- package/graphql/schema/contentModels.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModels.js +13 -7
- package/graphql/schema/contentModels.js.map +1 -0
- package/{content/plugins → graphql}/schema/createFieldResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createFieldResolvers.js +1 -1
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createManageResolvers.js +7 -3
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createManageSDL.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createManageSDL.js +11 -7
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/{content/plugins → graphql}/schema/createPreviewResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createPreviewResolvers.js +2 -2
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createReadResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createReadResolvers.js +2 -2
- package/graphql/schema/createReadResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createReadSDL.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createReadSDL.js +6 -6
- 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/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js.map +0 -0
- package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/preview}/resolveGet.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js.map +0 -0
- package/{content/plugins/schema/resolvers/preview → graphql/schema/resolvers/read}/resolveGet.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js.map +0 -0
- package/{content/plugins → graphql}/schema/schemaPlugins.d.ts +1 -1
- package/{content/plugins → graphql}/schema/schemaPlugins.js +18 -5
- 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/{content/plugins/graphqlFields → graphqlFields}/datetime.js +42 -40
- 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/{content/plugins/graphqlFields → graphqlFields}/helpers.d.ts +1 -1
- package/{content/plugins/graphqlFields → graphqlFields}/helpers.js +0 -0
- package/{content/plugins/graphqlFields → graphqlFields}/helpers.js.map +0 -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 -17
- package/index.js +73 -56
- package/index.js.map +1 -1
- package/modelManager/DefaultCmsModelManager.d.ts +14 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +0 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js.map +0 -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 +26 -27
- 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/{plugins/context.js → parameters/manual.js} +27 -27
- package/parameters/manual.js.map +1 -0
- package/parameters/path.d.ts +2 -0
- package/parameters/path.js +54 -0
- package/parameters/path.js.map +1 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.d.ts +1 -1
- package/{content/plugins → plugins}/CmsGroupPlugin.js +0 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.js.map +0 -0
- package/{content/plugins → plugins}/CmsModelPlugin.d.ts +1 -1
- package/{content/plugins → plugins}/CmsModelPlugin.js +0 -0
- package/{content/plugins → plugins}/CmsModelPlugin.js.map +0 -0
- package/{content/plugins → plugins}/CmsParametersPlugin.d.ts +8 -3
- package/{content/plugins → plugins}/CmsParametersPlugin.js +0 -0
- package/plugins/CmsParametersPlugin.js.map +1 -0
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.d.ts +2 -1
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +1 -0
- package/plugins/StorageTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +4 -0
- package/plugins/index.js +57 -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/{content/plugins/storage → storage}/object.js +63 -64
- package/storage/object.js.map +1 -0
- package/types.d.ts +28 -3
- package/types.js.map +1 -1
- package/upgrades/index.d.ts +1 -0
- package/upgrades/index.js +10 -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/{content/plugins/utils → utils}/createTypeName.d.ts +0 -0
- package/{content/plugins/utils → utils}/createTypeName.js +0 -0
- package/{content/plugins/utils → utils}/createTypeName.js.map +0 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +1 -1
- package/{content/plugins/utils → utils}/entryStorage.js +1 -1
- 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/{content/plugins/utils → utils}/getEntryTitle.d.ts +1 -1
- package/{content/plugins/utils → utils}/getEntryTitle.js +0 -0
- package/{content/plugins/utils → utils}/getEntryTitle.js.map +0 -0
- package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.d.ts +1 -1
- package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.js +0 -0
- package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.js.map +0 -0
- package/utils/ownership.d.ts +8 -0
- package/utils/ownership.js +39 -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/{content/plugins/utils → utils}/pluralizedTypeName.d.ts +0 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +0 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js.map +0 -0
- package/{content/plugins/utils → utils}/renderFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderFields.js +0 -0
- package/{content/plugins/utils → utils}/renderFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderGetFilterFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderGetFilterFields.js +0 -0
- package/{content/plugins/utils → utils}/renderGetFilterFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderInputFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderInputFields.js +0 -0
- package/{content/plugins/utils → utils}/renderInputFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderListFilterFields.js +0 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderSortEnum.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderSortEnum.js +0 -0
- package/{content/plugins/utils → utils}/renderSortEnum.js.map +0 -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 +3 -3
- package/validators/dateGte.js.map +1 -0
- package/validators/dateLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateLte.js +3 -3
- 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 +3 -3
- package/validators/timeGte.js.map +1 -0
- package/validators/timeLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeLte.js +3 -3
- package/validators/timeLte.js.map +1 -0
- package/{content/plugins/validators → validators}/unique.d.ts +2 -3
- package/{content/plugins/validators → validators}/unique.js +3 -3
- package/validators/unique.js.map +1 -0
- package/content/contextSetup.d.ts +0 -4
- package/content/contextSetup.js.map +0 -1
- package/content/graphQLHandlerFactory.d.ts +0 -5
- package/content/graphQLHandlerFactory.js.map +0 -1
- package/content/parameterPlugins.d.ts +0 -6
- package/content/parameterPlugins.js +0 -78
- package/content/parameterPlugins.js.map +0 -1
- package/content/plugins/CmsParametersPlugin.js.map +0 -1
- package/content/plugins/buildSchemaPlugins.js +0 -29
- package/content/plugins/buildSchemaPlugins.js.map +0 -1
- package/content/plugins/crud/contentEntry/entryDataValidation.js.map +0 -1
- package/content/plugins/crud/contentEntry/markLockedFields.js.map +0 -1
- package/content/plugins/crud/contentEntry.crud.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeCreate.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeDelete.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeUpdate.js.map +0 -1
- 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/idValidation.js.map +0 -1
- package/content/plugins/crud/contentModel/models.js.map +0 -1
- package/content/plugins/crud/contentModel/validateModelFields.js.map +0 -1
- package/content/plugins/crud/contentModel.crud.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeCreate.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeDelete.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeUpdate.js.map +0 -1
- package/content/plugins/crud/contentModelGroup.crud.js.map +0 -1
- package/content/plugins/crud/index.d.ts +0 -6
- package/content/plugins/crud/index.js.map +0 -1
- package/content/plugins/graphqlFields/boolean.d.ts +0 -3
- package/content/plugins/graphqlFields/boolean.js +0 -67
- package/content/plugins/graphqlFields/boolean.js.map +0 -1
- package/content/plugins/graphqlFields/datetime.d.ts +0 -3
- package/content/plugins/graphqlFields/datetime.js.map +0 -1
- package/content/plugins/graphqlFields/file.d.ts +0 -3
- package/content/plugins/graphqlFields/file.js +0 -48
- package/content/plugins/graphqlFields/file.js.map +0 -1
- package/content/plugins/graphqlFields/index.d.ts +0 -2
- package/content/plugins/graphqlFields/index.js +0 -30
- package/content/plugins/graphqlFields/index.js.map +0 -1
- package/content/plugins/graphqlFields/longText.d.ts +0 -3
- package/content/plugins/graphqlFields/longText.js +0 -61
- package/content/plugins/graphqlFields/longText.js.map +0 -1
- package/content/plugins/graphqlFields/number.d.ts +0 -3
- package/content/plugins/graphqlFields/number.js +0 -73
- package/content/plugins/graphqlFields/number.js.map +0 -1
- package/content/plugins/graphqlFields/object.d.ts +0 -3
- package/content/plugins/graphqlFields/object.js +0 -223
- package/content/plugins/graphqlFields/object.js.map +0 -1
- package/content/plugins/graphqlFields/ref.d.ts +0 -3
- package/content/plugins/graphqlFields/ref.js +0 -276
- package/content/plugins/graphqlFields/ref.js.map +0 -1
- package/content/plugins/graphqlFields/richText.d.ts +0 -3
- package/content/plugins/graphqlFields/richText.js +0 -54
- package/content/plugins/graphqlFields/richText.js.map +0 -1
- package/content/plugins/graphqlFields/text.d.ts +0 -3
- package/content/plugins/graphqlFields/text.js +0 -71
- package/content/plugins/graphqlFields/text.js.map +0 -1
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -55
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js.map +0 -1
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -36
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js.map +0 -1
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -14
- package/content/plugins/modelManager/index.d.ts +0 -3
- package/content/plugins/modelManager/index.js.map +0 -1
- package/content/plugins/schema/baseSchema.d.ts +0 -4
- package/content/plugins/schema/baseSchema.js.map +0 -1
- package/content/plugins/schema/contentEntries.d.ts +0 -4
- package/content/plugins/schema/contentEntries.js.map +0 -1
- package/content/plugins/schema/contentModelGroups.d.ts +0 -4
- package/content/plugins/schema/contentModelGroups.js.map +0 -1
- package/content/plugins/schema/contentModels.d.ts +0 -4
- package/content/plugins/schema/contentModels.js.map +0 -1
- package/content/plugins/schema/createFieldResolvers.js.map +0 -1
- package/content/plugins/schema/createManageResolvers.js.map +0 -1
- package/content/plugins/schema/createManageSDL.js.map +0 -1
- package/content/plugins/schema/createPreviewResolvers.js.map +0 -1
- package/content/plugins/schema/createReadResolvers.js.map +0 -1
- package/content/plugins/schema/createReadSDL.js.map +0 -1
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
- package/content/plugins/schema/schemaPlugins.js.map +0 -1
- package/content/plugins/storage/StorageTransformPlugin.js.map +0 -1
- package/content/plugins/storage/default.d.ts +0 -3
- package/content/plugins/storage/default.js +0 -28
- package/content/plugins/storage/default.js.map +0 -1
- package/content/plugins/storage/object.d.ts +0 -3
- package/content/plugins/storage/object.js.map +0 -1
- package/content/plugins/utils/entryStorage.js.map +0 -1
- package/content/plugins/validators/dateGte.d.ts +0 -3
- package/content/plugins/validators/dateGte.js.map +0 -1
- package/content/plugins/validators/dateLte.d.ts +0 -3
- package/content/plugins/validators/dateLte.js.map +0 -1
- package/content/plugins/validators/gte.d.ts +0 -3
- package/content/plugins/validators/gte.js +0 -34
- package/content/plugins/validators/gte.js.map +0 -1
- package/content/plugins/validators/in.d.ts +0 -3
- package/content/plugins/validators/in.js +0 -34
- package/content/plugins/validators/in.js.map +0 -1
- package/content/plugins/validators/index.d.ts +0 -2
- package/content/plugins/validators/index.js +0 -38
- package/content/plugins/validators/index.js.map +0 -1
- package/content/plugins/validators/lte.d.ts +0 -3
- package/content/plugins/validators/lte.js +0 -34
- package/content/plugins/validators/lte.js.map +0 -1
- package/content/plugins/validators/maxLength.d.ts +0 -3
- package/content/plugins/validators/maxLength.js +0 -34
- package/content/plugins/validators/maxLength.js.map +0 -1
- package/content/plugins/validators/minLength.d.ts +0 -3
- package/content/plugins/validators/minLength.js +0 -34
- package/content/plugins/validators/minLength.js.map +0 -1
- package/content/plugins/validators/pattern.d.ts +0 -3
- package/content/plugins/validators/pattern.js +0 -47
- package/content/plugins/validators/pattern.js.map +0 -1
- package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/email.js +0 -17
- package/content/plugins/validators/patternPlugins/email.js.map +0 -1
- package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
- package/content/plugins/validators/patternPlugins/index.js +0 -23
- package/content/plugins/validators/patternPlugins/index.js.map +0 -1
- package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
- package/content/plugins/validators/patternPlugins/lowerCase.js.map +0 -1
- package/content/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCaseSpace.js +0 -17
- package/content/plugins/validators/patternPlugins/lowerCaseSpace.js.map +0 -1
- package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCase.js.map +0 -1
- package/content/plugins/validators/patternPlugins/upperCaseSpace.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCaseSpace.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCaseSpace.js.map +0 -1
- package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/url.js +0 -17
- package/content/plugins/validators/patternPlugins/url.js.map +0 -1
- package/content/plugins/validators/required.d.ts +0 -3
- package/content/plugins/validators/required.js +0 -25
- package/content/plugins/validators/required.js.map +0 -1
- package/content/plugins/validators/timeGte.d.ts +0 -3
- package/content/plugins/validators/timeGte.js.map +0 -1
- package/content/plugins/validators/timeLte.d.ts +0 -3
- package/content/plugins/validators/timeLte.js.map +0 -1
- package/content/plugins/validators/unique.js.map +0 -1
- package/migrateCMSPermissions.d.ts +0 -17
- package/migrateCMSPermissions.js +0 -199
- package/migrateCMSPermissions.js.map +0 -1
- package/plugins/context.d.ts +0 -4
- package/plugins/context.js.map +0 -1
- package/plugins/crud/index.d.ts +0 -6
- package/plugins/crud/index.js +0 -108
- package/plugins/crud/index.js.map +0 -1
- package/plugins/crud/settings.crud.js.map +0 -1
- package/plugins/graphql/system.d.ts +0 -18
- package/plugins/graphql/system.js +0 -74
- package/plugins/graphql/system.js.map +0 -1
- package/plugins/graphql.d.ts +0 -2
- package/plugins/graphql.js +0 -86
- package/plugins/graphql.js.map +0 -1
- package/plugins/upgrades/index.d.ts +0 -2
- package/plugins/upgrades/index.js +0 -14
- package/plugins/upgrades/index.js.map +0 -1
- 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/helpers.js.map +0 -1
- package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
- package/plugins/upgrades/v5.5.0/index.js +0 -134
- package/plugins/upgrades/v5.5.0/index.js.map +0 -1
- package/transformers.d.ts +0 -2
- package/transformers.js +0 -25
- package/transformers.js.map +0 -1
- package/utils.d.ts +0 -23
- package/utils.js +0 -251
- package/utils.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CmsParametersPlugin, CmsParametersPluginResponseLocale, CmsParametersPluginResponseType } from "../plugins/CmsParametersPlugin";
|
|
2
|
+
export interface ManualPluginParams {
|
|
3
|
+
endpointType?: CmsParametersPluginResponseType;
|
|
4
|
+
locale?: CmsParametersPluginResponseLocale;
|
|
5
|
+
}
|
|
6
|
+
export declare const createManualPlugin: (params: ManualPluginParams) => CmsParametersPlugin;
|
|
@@ -5,41 +5,41 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.createManualPlugin = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
+
|
|
14
|
+
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
15
|
|
|
14
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
17
|
|
|
16
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
19
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
20
|
+
const createManualPlugin = params => {
|
|
21
|
+
return new _CmsParametersPlugin.CmsParametersPlugin(async () => {
|
|
22
|
+
const {
|
|
23
|
+
endpointType: type,
|
|
24
|
+
locale
|
|
25
|
+
} = params;
|
|
26
|
+
/**
|
|
27
|
+
* if both of parameters are not existing, just skip this plugin.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
if (!type && !locale) {
|
|
31
|
+
return null;
|
|
32
|
+
} else if (!type) {
|
|
33
|
+
throw new _error.default(`There is defined "locale" CMS parameter but no "endpointType".`, "MALFORMED_ENDPOINT_TYPE", _objectSpread({}, params));
|
|
34
|
+
} else if (!locale) {
|
|
35
|
+
throw new _error.default(`There is defined "endpointType" CMS parameter but no "locale".`, "MALFORMED_LOCALE_TYPE", _objectSpread({}, params));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
type,
|
|
40
|
+
locale
|
|
41
|
+
};
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
exports.
|
|
45
|
+
exports.createManualPlugin = createManualPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createManualPlugin","params","CmsParametersPlugin","endpointType","type","locale","WebinyError"],"sources":["manual.ts"],"sourcesContent":["/**\n * This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.\n */\nimport WebinyError from \"@webiny/error\";\nimport {\n CmsParametersPlugin,\n CmsParametersPluginResponseLocale,\n CmsParametersPluginResponseType\n} from \"~/plugins/CmsParametersPlugin\";\n\nexport interface ManualPluginParams {\n endpointType?: CmsParametersPluginResponseType;\n locale?: CmsParametersPluginResponseLocale;\n}\n\nexport const createManualPlugin = (params: ManualPluginParams): CmsParametersPlugin => {\n return new CmsParametersPlugin(async () => {\n const { endpointType: type, locale } = params;\n /**\n * if both of parameters are not existing, just skip this plugin.\n */\n if (!type && !locale) {\n return null;\n } else if (!type) {\n throw new WebinyError(\n `There is defined \"locale\" CMS parameter but no \"endpointType\".`,\n \"MALFORMED_ENDPOINT_TYPE\",\n {\n ...params\n }\n );\n } else if (!locale) {\n throw new WebinyError(\n `There is defined \"endpointType\" CMS parameter but no \"locale\".`,\n \"MALFORMED_LOCALE_TYPE\",\n {\n ...params\n }\n );\n }\n\n return {\n type,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;;;AAGA;;AACA;;;;;;AAWO,MAAMA,kBAAkB,GAAIC,MAAD,IAAqD;EACnF,OAAO,IAAIC,wCAAJ,CAAwB,YAAY;IACvC,MAAM;MAAEC,YAAY,EAAEC,IAAhB;MAAsBC;IAAtB,IAAiCJ,MAAvC;IACA;AACR;AACA;;IACQ,IAAI,CAACG,IAAD,IAAS,CAACC,MAAd,EAAsB;MAClB,OAAO,IAAP;IACH,CAFD,MAEO,IAAI,CAACD,IAAL,EAAW;MACd,MAAM,IAAIE,cAAJ,CACD,gEADC,EAEF,yBAFE,oBAIKL,MAJL,EAAN;IAOH,CARM,MAQA,IAAI,CAACI,MAAL,EAAa;MAChB,MAAM,IAAIC,cAAJ,CACD,gEADC,EAEF,uBAFE,oBAIKL,MAJL,EAAN;IAOH;;IAED,OAAO;MACHG,IADG;MAEHC;IAFG,CAAP;EAIH,CA7BM,CAAP;AA8BH,CA/BM"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createPathParameterPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
+
|
|
12
|
+
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
+
|
|
14
|
+
const allowedEndpoints = ["manage", "read", "preview"];
|
|
15
|
+
|
|
16
|
+
const createPathParameterPlugin = () => {
|
|
17
|
+
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
18
|
+
var _context$http, _context$http$request, _context$http$request2;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* If any of the properties is not defined, just ignore this plugin
|
|
22
|
+
*/
|
|
23
|
+
if (!((_context$http = context.http) !== null && _context$http !== void 0 && (_context$http$request = _context$http.request) !== null && _context$http$request !== void 0 && (_context$http$request2 = _context$http$request.path) !== null && _context$http$request2 !== void 0 && _context$http$request2.parameters)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
key
|
|
29
|
+
} = context.http.request.path.parameters;
|
|
30
|
+
|
|
31
|
+
if (typeof key !== "string") {
|
|
32
|
+
throw new _error.default("The key property in context.http.request.path.parameters is not a string.", "MALFORMED_KEY", {
|
|
33
|
+
key
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const [type, locale] = key.split("/");
|
|
38
|
+
|
|
39
|
+
if (!type) {
|
|
40
|
+
throw new _error.default(`Missing context.http.request.path.parameters.key parameter "type".`);
|
|
41
|
+
} else if (!locale) {
|
|
42
|
+
throw new _error.default(`Missing context.http.request.path.parameters.key "locale".`);
|
|
43
|
+
} else if (allowedEndpoints.includes(type) === false) {
|
|
44
|
+
throw new _error.default(`Endpoint "${type}" not allowed!`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
type: type,
|
|
49
|
+
locale
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.createPathParameterPlugin = createPathParameterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["allowedEndpoints","createPathParameterPlugin","CmsParametersPlugin","context","http","request","path","parameters","key","WebinyError","type","locale","split","includes"],"sources":["path.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nconst allowedEndpoints: ApiEndpoint[] = [\"manage\", \"read\", \"preview\"];\n\nexport const createPathParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.http?.request?.path?.parameters) {\n return null;\n }\n\n const { key } = context.http.request.path.parameters;\n if (typeof key !== \"string\") {\n throw new WebinyError(\n \"The key property in context.http.request.path.parameters is not a string.\",\n \"MALFORMED_KEY\",\n {\n key\n }\n );\n }\n const [type, locale] = key.split(\"/\");\n if (!type) {\n throw new WebinyError(\n `Missing context.http.request.path.parameters.key parameter \"type\".`\n );\n } else if (!locale) {\n throw new WebinyError(`Missing context.http.request.path.parameters.key \"locale\".`);\n } else if (allowedEndpoints.includes(type as ApiEndpoint) === false) {\n throw new WebinyError(`Endpoint \"${type}\" not allowed!`);\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAGA,MAAMA,gBAA+B,GAAG,CAAC,QAAD,EAAW,MAAX,EAAmB,SAAnB,CAAxC;;AAEO,MAAMC,yBAAyB,GAAG,MAAM;EAC3C,OAAO,IAAIC,wCAAJ,CAAwB,MAAMC,OAAN,IAAiB;IAAA;;IAC5C;AACR;AACA;IACQ,IAAI,mBAACA,OAAO,CAACC,IAAT,mEAAC,cAAcC,OAAf,4EAAC,sBAAuBC,IAAxB,mDAAC,uBAA6BC,UAA9B,CAAJ,EAA8C;MAC1C,OAAO,IAAP;IACH;;IAED,MAAM;MAAEC;IAAF,IAAUL,OAAO,CAACC,IAAR,CAAaC,OAAb,CAAqBC,IAArB,CAA0BC,UAA1C;;IACA,IAAI,OAAOC,GAAP,KAAe,QAAnB,EAA6B;MACzB,MAAM,IAAIC,cAAJ,CACF,2EADE,EAEF,eAFE,EAGF;QACID;MADJ,CAHE,CAAN;IAOH;;IACD,MAAM,CAACE,IAAD,EAAOC,MAAP,IAAiBH,GAAG,CAACI,KAAJ,CAAU,GAAV,CAAvB;;IACA,IAAI,CAACF,IAAL,EAAW;MACP,MAAM,IAAID,cAAJ,CACD,oEADC,CAAN;IAGH,CAJD,MAIO,IAAI,CAACE,MAAL,EAAa;MAChB,MAAM,IAAIF,cAAJ,CAAiB,4DAAjB,CAAN;IACH,CAFM,MAEA,IAAIT,gBAAgB,CAACa,QAAjB,CAA0BH,IAA1B,MAAmD,KAAvD,EAA8D;MACjE,MAAM,IAAID,cAAJ,CAAiB,aAAYC,IAAK,gBAAlC,CAAN;IACH;;IAED,OAAO;MACHA,IAAI,EAAEA,IADH;MAEHC;IAFG,CAAP;EAIH,CAjCM,CAAP;AAkCH,CAnCM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { CmsGroup as BaseCmsGroup } from "
|
|
2
|
+
import { CmsGroup as BaseCmsGroup } from "../types";
|
|
3
3
|
export interface CmsGroup extends Omit<BaseCmsGroup, "locale" | "tenant" | "webinyVersion"> {
|
|
4
4
|
tenant?: string;
|
|
5
5
|
locale?: string;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { CmsModel as CmsModelBase } from "
|
|
2
|
+
import { CmsModel as CmsModelBase } from "../types";
|
|
3
3
|
export interface CmsModel extends Omit<CmsModelBase, "locale" | "tenant" | "webinyVersion"> {
|
|
4
4
|
locale?: string;
|
|
5
5
|
tenant?: string;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { CmsContext } from "
|
|
2
|
+
import { ApiEndpoint, CmsContext } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Type can be null because it might be that Headless CMS context is loaded on a different Lambda where there is no GraphQL Schema generated.
|
|
5
|
+
*/
|
|
6
|
+
export declare type CmsParametersPluginResponseType = ApiEndpoint | null;
|
|
7
|
+
export declare type CmsParametersPluginResponseLocale = string;
|
|
3
8
|
export interface CmsParametersPluginResponse {
|
|
4
|
-
type:
|
|
5
|
-
locale:
|
|
9
|
+
type: CmsParametersPluginResponseType;
|
|
10
|
+
locale: CmsParametersPluginResponseLocale;
|
|
6
11
|
}
|
|
7
12
|
export interface CmsParametersPluginCallable {
|
|
8
13
|
(context: CmsContext): Promise<CmsParametersPluginResponse | null>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsParametersPlugin","Plugin","constructor","callable","getParameters","context"],"sources":["CmsParametersPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ApiEndpoint, CmsContext } from \"~/types\";\n\n/**\n * Type can be null because it might be that Headless CMS context is loaded on a different Lambda where there is no GraphQL Schema generated.\n */\nexport type CmsParametersPluginResponseType = ApiEndpoint | null;\nexport type CmsParametersPluginResponseLocale = string;\n\nexport interface CmsParametersPluginResponse {\n type: CmsParametersPluginResponseType;\n locale: CmsParametersPluginResponseLocale;\n}\n\nexport interface CmsParametersPluginCallable {\n (context: CmsContext): Promise<CmsParametersPluginResponse | null>;\n}\n\nexport class CmsParametersPlugin extends Plugin {\n public static override readonly type: string = \"cms-parameters-plugin\";\n\n private readonly callable: CmsParametersPluginCallable;\n\n public constructor(callable: CmsParametersPluginCallable) {\n super();\n\n this.callable = callable;\n }\n\n public async getParameters(context: CmsContext): Promise<CmsParametersPluginResponse | null> {\n return this.callable(context);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAkBO,MAAMA,mBAAN,SAAkCC,eAAlC,CAAyC;EAKrCC,WAAW,CAACC,QAAD,EAAwC;IACtD;IADsD;IAGtD,KAAKA,QAAL,GAAgBA,QAAhB;EACH;;EAEyB,MAAbC,aAAa,CAACC,OAAD,EAAmE;IACzF,OAAO,KAAKF,QAAL,CAAcE,OAAd,CAAP;EACH;;AAb2C;;;8BAAnCL,mB,UACsC,uB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins/Plugin";
|
|
2
|
-
import { CmsModel, CmsModelField } from "
|
|
2
|
+
import { CmsModel, CmsModelField } from "../types";
|
|
3
3
|
import { PluginsContainer } from "@webiny/plugins";
|
|
4
4
|
export interface ToStorageParams<T> {
|
|
5
5
|
model: CmsModel;
|
|
@@ -16,6 +16,7 @@ export interface FromStorageParams<T> {
|
|
|
16
16
|
plugins: PluginsContainer;
|
|
17
17
|
}
|
|
18
18
|
export interface StorageTransformPluginParams<T, R> {
|
|
19
|
+
name?: string;
|
|
19
20
|
fieldType: string;
|
|
20
21
|
toStorage: (params: ToStorageParams<T>) => Promise<R>;
|
|
21
22
|
fromStorage: (params: FromStorageParams<R>) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StorageTransformPlugin","Plugin","fieldType","config","constructor","name","toStorage","params","fromStorage"],"sources":["StorageTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModel, CmsModelField } from \"~/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\nexport interface ToStorageParams<T> {\n model: CmsModel;\n field: CmsModelField;\n value: T;\n getStoragePlugin(fieldType: string): StorageTransformPlugin<T>;\n plugins: PluginsContainer;\n}\n\nexport interface FromStorageParams<T> {\n model: CmsModel;\n field: CmsModelField;\n value: T;\n getStoragePlugin(fieldType: string): StorageTransformPlugin<T>;\n plugins: PluginsContainer;\n}\n\nexport interface StorageTransformPluginParams<T, R> {\n name?: string;\n fieldType: string;\n toStorage: (params: ToStorageParams<T>) => Promise<R>;\n fromStorage: (params: FromStorageParams<R>) => Promise<T>;\n}\nexport class StorageTransformPlugin<T = any, R = any> extends Plugin {\n public static override readonly type: string = \"cms.storage.transform.plugin\";\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n private readonly config: StorageTransformPluginParams<T, R>;\n\n public constructor(config: StorageTransformPluginParams<T, R>) {\n super();\n this.name = config.name;\n this.config = config;\n }\n\n public toStorage(params: ToStorageParams<T>): Promise<R> {\n return this.config.toStorage(params);\n }\n\n public fromStorage(params: FromStorageParams<R>): Promise<T> {\n return this.config.fromStorage(params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AA0BO,MAAMA,sBAAN,SAAuDC,cAAvD,CAA8D;EAE7C,IAATC,SAAS,GAAW;IAC3B,OAAO,KAAKC,MAAL,CAAYD,SAAnB;EACH;;EAIME,WAAW,CAACD,MAAD,EAA6C;IAC3D;IAD2D;IAE3D,KAAKE,IAAL,GAAYF,MAAM,CAACE,IAAnB;IACA,KAAKF,MAAL,GAAcA,MAAd;EACH;;EAEMG,SAAS,CAACC,MAAD,EAAyC;IACrD,OAAO,KAAKJ,MAAL,CAAYG,SAAZ,CAAsBC,MAAtB,CAAP;EACH;;EAEMC,WAAW,CAACD,MAAD,EAA2C;IACzD,OAAO,KAAKJ,MAAL,CAAYK,WAAZ,CAAwBD,MAAxB,CAAP;EACH;;AApBgE;;;8BAAxDP,sB,UACsC,8B"}
|
package/plugins/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _CmsGroupPlugin = require("./CmsGroupPlugin");
|
|
8
|
+
|
|
9
|
+
Object.keys(_CmsGroupPlugin).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _CmsGroupPlugin[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _CmsGroupPlugin[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _CmsModelPlugin = require("./CmsModelPlugin");
|
|
21
|
+
|
|
22
|
+
Object.keys(_CmsModelPlugin).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _CmsModelPlugin[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _CmsModelPlugin[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _StorageTransformPlugin = require("./StorageTransformPlugin");
|
|
34
|
+
|
|
35
|
+
Object.keys(_StorageTransformPlugin).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _StorageTransformPlugin[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _StorageTransformPlugin[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _CmsParametersPlugin = require("./CmsParametersPlugin");
|
|
47
|
+
|
|
48
|
+
Object.keys(_CmsParametersPlugin).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _CmsParametersPlugin[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _CmsParametersPlugin[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsGroupPlugin\";\nexport * from \"./CmsModelPlugin\";\nexport * from \"./StorageTransformPlugin\";\nexport * from \"./CmsParametersPlugin\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createDefaultStorageTransform = void 0;
|
|
7
|
+
|
|
8
|
+
var _StorageTransformPlugin = require("../plugins/StorageTransformPlugin");
|
|
9
|
+
|
|
10
|
+
const createDefaultStorageTransform = () => {
|
|
11
|
+
return new _StorageTransformPlugin.StorageTransformPlugin({
|
|
12
|
+
name: "headless-cms.storage-transform.all.default",
|
|
13
|
+
fieldType: "*",
|
|
14
|
+
fromStorage: async ({
|
|
15
|
+
value
|
|
16
|
+
}) => {
|
|
17
|
+
return value;
|
|
18
|
+
},
|
|
19
|
+
toStorage: async ({
|
|
20
|
+
value
|
|
21
|
+
}) => {
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.createDefaultStorageTransform = createDefaultStorageTransform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDefaultStorageTransform","StorageTransformPlugin","name","fieldType","fromStorage","value","toStorage"],"sources":["default.ts"],"sourcesContent":["import { StorageTransformPlugin } from \"~/plugins/StorageTransformPlugin\";\n\nexport const createDefaultStorageTransform = (): StorageTransformPlugin => {\n return new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.all.default\",\n fieldType: \"*\",\n fromStorage: async ({ value }) => {\n return value;\n },\n toStorage: async ({ value }) => {\n return value;\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,6BAA6B,GAAG,MAA8B;EACvE,OAAO,IAAIC,8CAAJ,CAA2B;IAC9BC,IAAI,EAAE,4CADwB;IAE9BC,SAAS,EAAE,GAFmB;IAG9BC,WAAW,EAAE,OAAO;MAAEC;IAAF,CAAP,KAAqB;MAC9B,OAAOA,KAAP;IACH,CAL6B;IAM9BC,SAAS,EAAE,OAAO;MAAED;IAAF,CAAP,KAAqB;MAC5B,OAAOA,KAAP;IACH;EAR6B,CAA3B,CAAP;AAUH,CAXM"}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.createObjectStorageTransform = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ var _pReduce = _interopRequireDefault(require("p-reduce"));
|
|
|
13
13
|
|
|
14
14
|
var _pMap = _interopRequireDefault(require("p-map"));
|
|
15
15
|
|
|
16
|
-
var _StorageTransformPlugin = require("
|
|
16
|
+
var _StorageTransformPlugin = require("../plugins/StorageTransformPlugin");
|
|
17
17
|
|
|
18
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
19
|
|
|
@@ -48,82 +48,81 @@ const processValue = async params => {
|
|
|
48
48
|
}, {});
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
const createObjectStorageTransform = () => {
|
|
52
|
+
return new _StorageTransformPlugin.StorageTransformPlugin({
|
|
53
|
+
name: "headless-cms.storage-transform.object.default",
|
|
54
|
+
fieldType: "object",
|
|
55
|
+
toStorage: async ({
|
|
56
|
+
field,
|
|
57
|
+
value,
|
|
58
|
+
getStoragePlugin,
|
|
59
|
+
model,
|
|
60
|
+
plugins
|
|
61
|
+
}) => {
|
|
62
|
+
var _field$settings;
|
|
63
|
+
|
|
64
|
+
if (!value) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const fields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
|
|
69
|
+
|
|
70
|
+
if (field.multipleValues) {
|
|
71
|
+
return await (0, _pMap.default)(value, value => processValue({
|
|
72
|
+
sourceValue: value,
|
|
73
|
+
getStoragePlugin,
|
|
74
|
+
model,
|
|
75
|
+
plugins,
|
|
76
|
+
operation: "toStorage",
|
|
77
|
+
fields
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return await processValue({
|
|
70
82
|
sourceValue: value,
|
|
71
83
|
getStoragePlugin,
|
|
72
84
|
model,
|
|
73
85
|
plugins,
|
|
74
86
|
operation: "toStorage",
|
|
75
87
|
fields
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
fromStorage: async ({
|
|
91
|
+
field,
|
|
92
|
+
value,
|
|
81
93
|
getStoragePlugin,
|
|
82
|
-
model,
|
|
83
94
|
plugins,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
model
|
|
96
|
+
}) => {
|
|
97
|
+
var _field$settings2;
|
|
98
|
+
|
|
99
|
+
if (!value) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const fields = ((_field$settings2 = field.settings) === null || _field$settings2 === void 0 ? void 0 : _field$settings2.fields) || [];
|
|
104
|
+
|
|
105
|
+
if (field.multipleValues) {
|
|
106
|
+
return (0, _pMap.default)(value, value => processValue({
|
|
107
|
+
sourceValue: value,
|
|
108
|
+
getStoragePlugin,
|
|
109
|
+
model,
|
|
110
|
+
plugins,
|
|
111
|
+
operation: "fromStorage",
|
|
112
|
+
fields
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return processValue({
|
|
105
117
|
sourceValue: value,
|
|
106
118
|
getStoragePlugin,
|
|
107
119
|
model,
|
|
108
120
|
plugins,
|
|
109
121
|
operation: "fromStorage",
|
|
110
122
|
fields
|
|
111
|
-
})
|
|
123
|
+
});
|
|
112
124
|
}
|
|
113
|
-
|
|
114
|
-
return processValue({
|
|
115
|
-
sourceValue: value,
|
|
116
|
-
getStoragePlugin,
|
|
117
|
-
model,
|
|
118
|
-
plugins,
|
|
119
|
-
operation: "fromStorage",
|
|
120
|
-
fields
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
var _default = () => {
|
|
126
|
-
return plugin;
|
|
125
|
+
});
|
|
127
126
|
};
|
|
128
127
|
|
|
129
|
-
exports.
|
|
128
|
+
exports.createObjectStorageTransform = createObjectStorageTransform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["processValue","params","fields","sourceValue","getStoragePlugin","plugins","model","operation","pReduce","values","field","plugin","type","Error","value","fieldId","createObjectStorageTransform","StorageTransformPlugin","name","fieldType","toStorage","settings","multipleValues","pMap","fromStorage"],"sources":["object.ts"],"sourcesContent":["import pReduce from \"p-reduce\";\nimport pMap from \"p-map\";\nimport { CmsModel, CmsModelField } from \"~/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { StorageTransformPlugin } from \"~/plugins/StorageTransformPlugin\";\n\ninterface ProcessValueParams {\n fields: CmsModelField[];\n sourceValue: Record<string, any>;\n getStoragePlugin: (fieldType: string) => StorageTransformPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n operation: \"toStorage\" | \"fromStorage\";\n}\ninterface ProcessValue {\n (params: ProcessValueParams): Promise<Record<string, any>>;\n}\n\nconst processValue: ProcessValue = async params => {\n const { fields, sourceValue, getStoragePlugin, plugins, model, operation } = params;\n return await pReduce(\n fields,\n async (values, field) => {\n const plugin = getStoragePlugin(field.type);\n if (!plugin) {\n throw new Error(`Missing storage plugin for field type \"${field.type}\".`);\n }\n const value = await plugin[operation]({\n plugins,\n model,\n field,\n value: sourceValue[field.fieldId],\n getStoragePlugin\n });\n return { ...values, [field.fieldId]: value };\n },\n {}\n );\n};\n\nexport const createObjectStorageTransform = (): StorageTransformPlugin => {\n return new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.object.default\",\n fieldType: \"object\",\n toStorage: async ({ field, value, getStoragePlugin, model, plugins }) => {\n if (!value) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.multipleValues) {\n return await pMap(value as Record<string, any>[], value =>\n processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"toStorage\",\n fields\n })\n );\n }\n\n return await processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"toStorage\",\n fields\n });\n },\n fromStorage: async ({ field, value, getStoragePlugin, plugins, model }) => {\n if (!value) {\n return null;\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.multipleValues) {\n return pMap(value as Record<string, any>[], value =>\n processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"fromStorage\",\n fields\n })\n );\n }\n\n return processValue({\n sourceValue: value,\n getStoragePlugin,\n model,\n plugins,\n operation: \"fromStorage\",\n fields\n });\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAGA;;;;;;AAcA,MAAMA,YAA0B,GAAG,MAAMC,MAAN,IAAgB;EAC/C,MAAM;IAAEC,MAAF;IAAUC,WAAV;IAAuBC,gBAAvB;IAAyCC,OAAzC;IAAkDC,KAAlD;IAAyDC;EAAzD,IAAuEN,MAA7E;EACA,OAAO,MAAM,IAAAO,gBAAA,EACTN,MADS,EAET,OAAOO,MAAP,EAAeC,KAAf,KAAyB;IACrB,MAAMC,MAAM,GAAGP,gBAAgB,CAACM,KAAK,CAACE,IAAP,CAA/B;;IACA,IAAI,CAACD,MAAL,EAAa;MACT,MAAM,IAAIE,KAAJ,CAAW,0CAAyCH,KAAK,CAACE,IAAK,IAA/D,CAAN;IACH;;IACD,MAAME,KAAK,GAAG,MAAMH,MAAM,CAACJ,SAAD,CAAN,CAAkB;MAClCF,OADkC;MAElCC,KAFkC;MAGlCI,KAHkC;MAIlCI,KAAK,EAAEX,WAAW,CAACO,KAAK,CAACK,OAAP,CAJgB;MAKlCX;IALkC,CAAlB,CAApB;IAOA,uCAAYK,MAAZ;MAAoB,CAACC,KAAK,CAACK,OAAP,GAAiBD;IAArC;EACH,CAfQ,EAgBT,EAhBS,CAAb;AAkBH,CApBD;;AAsBO,MAAME,4BAA4B,GAAG,MAA8B;EACtE,OAAO,IAAIC,8CAAJ,CAA2B;IAC9BC,IAAI,EAAE,+CADwB;IAE9BC,SAAS,EAAE,QAFmB;IAG9BC,SAAS,EAAE,OAAO;MAAEV,KAAF;MAASI,KAAT;MAAgBV,gBAAhB;MAAkCE,KAAlC;MAAyCD;IAAzC,CAAP,KAA8D;MAAA;;MACrE,IAAI,CAACS,KAAL,EAAY;QACR,OAAO,IAAP;MACH;;MAED,MAAMZ,MAAM,GAAI,oBAAAQ,KAAK,CAACW,QAAN,oEAAgBnB,MAAhB,KAA0B,EAA1C;;MAEA,IAAIQ,KAAK,CAACY,cAAV,EAA0B;QACtB,OAAO,MAAM,IAAAC,aAAA,EAAKT,KAAL,EAAqCA,KAAK,IACnDd,YAAY,CAAC;UACTG,WAAW,EAAEW,KADJ;UAETV,gBAFS;UAGTE,KAHS;UAITD,OAJS;UAKTE,SAAS,EAAE,WALF;UAMTL;QANS,CAAD,CADH,CAAb;MAUH;;MAED,OAAO,MAAMF,YAAY,CAAC;QACtBG,WAAW,EAAEW,KADS;QAEtBV,gBAFsB;QAGtBE,KAHsB;QAItBD,OAJsB;QAKtBE,SAAS,EAAE,WALW;QAMtBL;MANsB,CAAD,CAAzB;IAQH,CA/B6B;IAgC9BsB,WAAW,EAAE,OAAO;MAAEd,KAAF;MAASI,KAAT;MAAgBV,gBAAhB;MAAkCC,OAAlC;MAA2CC;IAA3C,CAAP,KAA8D;MAAA;;MACvE,IAAI,CAACQ,KAAL,EAAY;QACR,OAAO,IAAP;MACH;;MAED,MAAMZ,MAAM,GAAI,qBAAAQ,KAAK,CAACW,QAAN,sEAAgBnB,MAAhB,KAA0B,EAA1C;;MAEA,IAAIQ,KAAK,CAACY,cAAV,EAA0B;QACtB,OAAO,IAAAC,aAAA,EAAKT,KAAL,EAAqCA,KAAK,IAC7Cd,YAAY,CAAC;UACTG,WAAW,EAAEW,KADJ;UAETV,gBAFS;UAGTE,KAHS;UAITD,OAJS;UAKTE,SAAS,EAAE,aALF;UAMTL;QANS,CAAD,CADT,CAAP;MAUH;;MAED,OAAOF,YAAY,CAAC;QAChBG,WAAW,EAAEW,KADG;QAEhBV,gBAFgB;QAGhBE,KAHgB;QAIhBD,OAJgB;QAKhBE,SAAS,EAAE,aALK;QAMhBL;MANgB,CAAD,CAAnB;IAQH;EA5D6B,CAA3B,CAAP;AA8DH,CA/DM"}
|
package/types.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
|
|
|
14
14
|
/**
|
|
15
15
|
* API type
|
|
16
16
|
*/
|
|
17
|
-
type: ApiEndpoint;
|
|
17
|
+
type: ApiEndpoint | null;
|
|
18
18
|
/**
|
|
19
19
|
* Requested locale
|
|
20
20
|
*/
|
|
@@ -384,6 +384,12 @@ export interface CmsModel {
|
|
|
384
384
|
* The version of Webiny which this record was stored with.
|
|
385
385
|
*/
|
|
386
386
|
webinyVersion: string;
|
|
387
|
+
/**
|
|
388
|
+
* Is model private?
|
|
389
|
+
* This is meant to be used for some internal models - will not be visible in the schema.
|
|
390
|
+
* Only available for the plugin constructed models.
|
|
391
|
+
*/
|
|
392
|
+
isPrivate?: boolean;
|
|
387
393
|
}
|
|
388
394
|
/**
|
|
389
395
|
* @category ModelField
|
|
@@ -831,6 +837,12 @@ export interface CmsGroup {
|
|
|
831
837
|
* Which Webiny version was this record stored with.
|
|
832
838
|
*/
|
|
833
839
|
webinyVersion: string;
|
|
840
|
+
/**
|
|
841
|
+
* Is group private?
|
|
842
|
+
* This is meant to be used for some internal groups - will not be visible in the schema.
|
|
843
|
+
* Only available for the plugin constructed groups.
|
|
844
|
+
*/
|
|
845
|
+
isPrivate?: boolean;
|
|
834
846
|
}
|
|
835
847
|
/**
|
|
836
848
|
* A data.where parameter received when listing content model groups.
|
|
@@ -1203,7 +1215,20 @@ export interface CmsEntry {
|
|
|
1203
1215
|
*
|
|
1204
1216
|
* @see CmsModelField
|
|
1205
1217
|
*/
|
|
1206
|
-
values:
|
|
1218
|
+
values: {
|
|
1219
|
+
[key: string]: any;
|
|
1220
|
+
};
|
|
1221
|
+
/**
|
|
1222
|
+
* Settings for the given entry.
|
|
1223
|
+
*
|
|
1224
|
+
* Introduced with Advanced Publishing Workflow - will be always inserted after this PR is merged.
|
|
1225
|
+
* Be aware that when accessing properties in it on old systems - it will break if not checked first.
|
|
1226
|
+
*
|
|
1227
|
+
* Available only on the Manage API in entry GraphQL type meta.data property.
|
|
1228
|
+
*/
|
|
1229
|
+
meta?: {
|
|
1230
|
+
[key: string]: any;
|
|
1231
|
+
};
|
|
1207
1232
|
}
|
|
1208
1233
|
export interface CmsStorageEntry extends CmsEntry {
|
|
1209
1234
|
[key: string]: any;
|
|
@@ -1662,7 +1687,7 @@ export interface CmsEntryContext {
|
|
|
1662
1687
|
/**
|
|
1663
1688
|
* Update existing entry.
|
|
1664
1689
|
*/
|
|
1665
|
-
updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1690
|
+
updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
|
|
1666
1691
|
/**
|
|
1667
1692
|
* Method that republishes entry with given identifier.
|
|
1668
1693
|
* @internal
|