@webiny/api-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e
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 +6 -0
- package/context.js +94 -0
- package/context.js.map +1 -0
- package/crud/contentEntry/afterDelete.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +2 -7
- 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 -5
- 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 -5
- package/crud/contentEntry/beforeUpdate.js.map +1 -0
- package/crud/contentEntry/entryDataValidation.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +22 -49
- 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 +26 -43
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
- package/crud/contentEntry/referenceFieldsMapping.js +236 -0
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
- package/crud/contentEntry/searchableFields.d.ts +9 -0
- package/crud/contentEntry/searchableFields.js +72 -0
- package/crud/contentEntry/searchableFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -9
- package/crud/contentEntry.crud.js +1194 -0
- package/crud/contentEntry.crud.js.map +1 -0
- package/crud/contentModel/afterCreate.d.ts +8 -0
- package/crud/contentModel/afterCreate.js +16 -0
- package/crud/contentModel/afterCreate.js.map +1 -0
- package/crud/contentModel/afterCreateFrom.d.ts +8 -0
- package/crud/contentModel/afterCreateFrom.js +16 -0
- package/crud/contentModel/afterCreateFrom.js.map +1 -0
- package/crud/contentModel/afterDelete.d.ts +8 -0
- package/crud/contentModel/afterDelete.js +16 -0
- package/crud/contentModel/afterDelete.js.map +1 -0
- package/crud/contentModel/afterUpdate.d.ts +8 -0
- package/crud/contentModel/afterUpdate.js +16 -0
- package/crud/contentModel/afterUpdate.js.map +1 -0
- package/crud/contentModel/beforeCreate.d.ts +14 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +58 -39
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/crud/contentModel/beforeDelete.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +13 -19
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/crud/contentModel/beforeUpdate.d.ts +8 -0
- package/crud/contentModel/beforeUpdate.js +32 -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 -7
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -0
- package/crud/contentModel/createFieldStorageId.d.ts +2 -0
- package/crud/contentModel/createFieldStorageId.js +17 -0
- package/crud/contentModel/createFieldStorageId.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 -11
- package/crud/contentModel/validateLayout.js.map +1 -0
- package/crud/contentModel/validateModel.d.ts +8 -0
- package/crud/contentModel/validateModel.js +27 -0
- package/crud/contentModel/validateModel.js.map +1 -0
- package/crud/contentModel/validateModelFields.d.ts +8 -0
- package/crud/contentModel/validateModelFields.js +380 -0
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/crud/contentModel/validation.d.ts +477 -0
- package/crud/contentModel/validation.js +97 -0
- package/crud/contentModel/validation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
- package/crud/contentModel.crud.js +555 -0
- package/crud/contentModel.crud.js.map +1 -0
- package/crud/contentModelGroup/beforeCreate.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +8 -20
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/crud/contentModelGroup/beforeDelete.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +4 -12
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +3 -8
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -0
- package/crud/contentModelGroup/validation.d.ts +30 -0
- package/crud/contentModelGroup/validation.js +34 -0
- package/crud/contentModelGroup/validation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup.crud.d.ts +3 -3
- package/crud/contentModelGroup.crud.js +324 -0
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
- package/crud/settings.crud.js +71 -0
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +6 -3
- package/crud/system.crud.js +186 -0
- package/crud/system.crud.js.map +1 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.d.ts +7 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +53 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +11 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +203 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.d.ts +11 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +251 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/index.d.ts +4 -0
- package/fieldConverters/index.js +13 -0
- package/fieldConverters/index.js.map +1 -0
- package/graphql/buildSchemaPlugins.d.ts +11 -0
- package/graphql/buildSchemaPlugins.js +19 -0
- package/graphql/buildSchemaPlugins.js.map +1 -0
- package/graphql/createExecutableSchema.d.ts +7 -0
- package/graphql/createExecutableSchema.js +29 -0
- package/graphql/createExecutableSchema.js.map +1 -0
- package/graphql/generateSchema.d.ts +8 -0
- package/graphql/generateSchema.js +31 -0
- package/graphql/generateSchema.js.map +1 -0
- package/graphql/graphQLHandlerFactory.d.ts +5 -0
- package/graphql/graphQLHandlerFactory.js +174 -0
- package/graphql/graphQLHandlerFactory.js.map +1 -0
- package/graphql/index.d.ts +3 -0
- package/graphql/index.js +13 -0
- package/graphql/index.js.map +1 -0
- package/graphql/schema/baseContentSchema.d.ts +7 -0
- package/graphql/schema/baseContentSchema.js +72 -0
- package/graphql/schema/baseContentSchema.js.map +1 -0
- package/graphql/schema/baseSchema.d.ts +3 -0
- package/graphql/schema/baseSchema.js +53 -0
- package/graphql/schema/baseSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +7 -0
- package/graphql/schema/contentEntries.js +325 -0
- package/graphql/schema/contentEntries.js.map +1 -0
- package/graphql/schema/contentModelGroups.d.ts +7 -0
- package/{content/plugins → graphql}/schema/contentModelGroups.js +38 -32
- package/graphql/schema/contentModelGroups.js.map +1 -0
- package/graphql/schema/contentModels.d.ts +7 -0
- package/{content/plugins → graphql}/schema/contentModels.js +101 -28
- package/graphql/schema/contentModels.js.map +1 -0
- package/graphql/schema/createFieldResolvers.d.ts +20 -0
- package/graphql/schema/createFieldResolvers.js +110 -0
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.js +32 -56
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/graphql/schema/createManageSDL.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createManageSDL.js +31 -33
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/graphql/schema/createPreviewResolvers.d.ts +12 -0
- package/graphql/schema/createPreviewResolvers.js +48 -0
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/graphql/schema/createReadResolvers.d.ts +12 -0
- package/graphql/schema/createReadResolvers.js +53 -0
- package/graphql/schema/createReadResolvers.js.map +1 -0
- package/graphql/schema/createReadSDL.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createReadSDL.js +23 -21
- 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 -2
- 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 -7
- 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 -7
- 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 +8 -12
- 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 +63 -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 -7
- 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 -7
- 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/preview → graphql/schema/resolvers/manage}/resolveList.js +2 -7
- 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 -3
- 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 -7
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -3
- 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 -7
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveGet.d.ts +4 -0
- package/graphql/schema/resolvers/preview/resolveGet.js +26 -0
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveList.d.ts +4 -0
- package/{content/plugins/schema/resolvers/manage → graphql/schema/resolvers/preview}/resolveList.js +2 -7
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -0
- package/graphql/schema/resolvers/read/resolveGet.d.ts +4 -0
- package/graphql/schema/resolvers/read/resolveGet.js +26 -0
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/read/resolveList.d.ts +4 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js +2 -7
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -0
- package/graphql/schema/schemaPlugins.d.ts +8 -0
- package/graphql/schema/schemaPlugins.js +109 -0
- package/graphql/schema/schemaPlugins.js.map +1 -0
- package/graphql/system.d.ts +6 -0
- package/{plugins/graphql → graphql}/system.js +43 -12
- package/graphql/system.js.map +1 -0
- package/graphqlFields/boolean.d.ts +2 -0
- package/graphqlFields/boolean.js +57 -0
- package/graphqlFields/boolean.js.map +1 -0
- package/graphqlFields/datetime.d.ts +2 -0
- package/graphqlFields/datetime.js +78 -0
- package/graphqlFields/datetime.js.map +1 -0
- package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +2 -0
- package/graphqlFields/dynamicZone/dynamicZoneField.js +208 -0
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -0
- package/graphqlFields/dynamicZone/dynamicZoneStorage.d.ts +3 -0
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js +63 -0
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -0
- package/graphqlFields/dynamicZone/index.d.ts +2 -0
- package/graphqlFields/dynamicZone/index.js +19 -0
- package/graphqlFields/dynamicZone/index.js.map +1 -0
- package/graphqlFields/file.d.ts +2 -0
- package/graphqlFields/file.js +42 -0
- package/graphqlFields/file.js.map +1 -0
- package/graphqlFields/helpers.d.ts +6 -0
- package/graphqlFields/helpers.js +39 -0
- package/graphqlFields/helpers.js.map +1 -0
- package/graphqlFields/index.d.ts +2 -0
- package/graphqlFields/index.js +18 -0
- package/graphqlFields/index.js.map +1 -0
- package/graphqlFields/longText.d.ts +2 -0
- package/graphqlFields/longText.js +53 -0
- package/graphqlFields/longText.js.map +1 -0
- package/graphqlFields/number.d.ts +2 -0
- package/graphqlFields/number.js +67 -0
- package/graphqlFields/number.js.map +1 -0
- package/graphqlFields/object.d.ts +2 -0
- package/graphqlFields/object.js +239 -0
- package/graphqlFields/object.js.map +1 -0
- package/graphqlFields/ref.d.ts +2 -0
- package/graphqlFields/ref.js +227 -0
- package/graphqlFields/ref.js.map +1 -0
- package/graphqlFields/richText.d.ts +2 -0
- package/graphqlFields/richText.js +47 -0
- package/graphqlFields/richText.js.map +1 -0
- package/graphqlFields/text.d.ts +2 -0
- package/graphqlFields/text.js +62 -0
- package/graphqlFields/text.js.map +1 -0
- package/index.d.ts +10 -12
- package/index.js +75 -55
- package/index.js.map +1 -0
- package/modelManager/DefaultCmsModelManager.d.ts +14 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +10 -24
- package/modelManager/DefaultCmsModelManager.js.map +1 -0
- package/modelManager/index.d.ts +2 -0
- package/{content/plugins/modelManager → modelManager}/index.js +3 -7
- package/modelManager/index.js.map +1 -0
- package/package.json +38 -38
- package/parameters/context.d.ts +2 -0
- package/parameters/context.js +18 -0
- package/parameters/context.js.map +1 -0
- package/parameters/header.d.ts +2 -0
- package/parameters/header.js +44 -0
- package/parameters/header.js.map +1 -0
- package/parameters/index.d.ts +4 -0
- package/parameters/index.js +49 -0
- package/parameters/index.js.map +1 -0
- package/parameters/manual.d.ts +6 -0
- package/parameters/manual.js +37 -0
- package/parameters/manual.js.map +1 -0
- package/parameters/path.d.ts +2 -0
- package/parameters/path.js +40 -0
- package/parameters/path.js.map +1 -0
- package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
- package/plugins/CmsGraphQLSchemaPlugin.js +12 -0
- package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +20 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js +28 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -0
- package/plugins/CmsGroupPlugin.d.ts +13 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.js +7 -9
- package/plugins/CmsGroupPlugin.js.map +1 -0
- package/plugins/CmsModelFieldConverterPlugin.d.ts +14 -0
- package/plugins/CmsModelFieldConverterPlugin.js +12 -0
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -0
- package/plugins/CmsModelPlugin.d.ts +45 -0
- package/plugins/CmsModelPlugin.js +158 -0
- package/plugins/CmsModelPlugin.js.map +1 -0
- package/plugins/CmsParametersPlugin.d.ts +20 -0
- package/plugins/CmsParametersPlugin.js +21 -0
- package/plugins/CmsParametersPlugin.js.map +1 -0
- package/plugins/StorageTransformPlugin.d.ts +31 -0
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +2 -10
- package/plugins/StorageTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +7 -0
- package/plugins/index.js +82 -0
- package/plugins/index.js.map +1 -0
- package/storage/default.d.ts +2 -0
- package/storage/default.js +24 -0
- package/storage/default.js.map +1 -0
- package/storage/object.d.ts +2 -0
- package/storage/object.js +108 -0
- package/storage/object.js.map +1 -0
- package/types.d.ts +881 -389
- package/types.js +104 -61
- package/types.js.map +1 -0
- package/upgrades/5.33.0/index.d.ts +3 -0
- package/upgrades/5.33.0/index.js +159 -0
- package/upgrades/5.33.0/index.js.map +1 -0
- package/upgrades/index.d.ts +1 -0
- package/upgrades/index.js +9 -0
- package/upgrades/index.js.map +1 -0
- package/utils/access.d.ts +8 -0
- package/utils/access.js +76 -0
- package/utils/access.js.map +1 -0
- package/utils/converters/Converter.d.ts +27 -0
- package/utils/converters/Converter.js +58 -0
- package/utils/converters/Converter.js.map +1 -0
- package/utils/converters/ConverterCollection.d.ts +31 -0
- package/utils/converters/ConverterCollection.js +119 -0
- package/utils/converters/ConverterCollection.js.map +1 -0
- package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
- package/utils/converters/valueKeyStorageConverter.js +122 -0
- package/utils/converters/valueKeyStorageConverter.js.map +1 -0
- package/utils/createTypeFromFields.d.ts +15 -0
- package/utils/createTypeFromFields.js +64 -0
- package/utils/createTypeFromFields.js.map +1 -0
- package/{content/plugins/utils → utils}/createTypeName.d.ts +3 -3
- package/{content/plugins/utils → utils}/createTypeName.js +3 -10
- package/utils/createTypeName.js.map +1 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
- package/{content/plugins/utils → utils}/entryStorage.js +26 -47
- package/utils/entryStorage.js.map +1 -0
- package/utils/filterAsync.d.ts +1 -0
- package/utils/filterAsync.js +18 -0
- package/utils/filterAsync.js.map +1 -0
- package/utils/getBaseFieldType.d.ts +4 -0
- package/utils/getBaseFieldType.js +10 -0
- package/utils/getBaseFieldType.js.map +1 -0
- package/utils/getEntryTitle.d.ts +2 -0
- package/{content/plugins/utils → utils}/getEntryTitle.js +7 -15
- package/utils/getEntryTitle.js.map +1 -0
- package/utils/getSchemaFromFieldPlugins.d.ts +9 -0
- package/utils/getSchemaFromFieldPlugins.js +39 -0
- package/utils/getSchemaFromFieldPlugins.js.map +1 -0
- package/utils/ownership.d.ts +8 -0
- package/utils/ownership.js +33 -0
- package/utils/ownership.js.map +1 -0
- package/utils/permissions.d.ts +7 -0
- package/utils/permissions.js +91 -0
- package/utils/permissions.js.map +1 -0
- package/utils/pluralizedTypeName.d.ts +1 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +1 -7
- package/utils/pluralizedTypeName.js.map +1 -0
- package/utils/renderFields.d.ts +15 -0
- package/{content/plugins/utils → utils}/renderFields.js +6 -11
- package/utils/renderFields.js.map +1 -0
- package/utils/renderGetFilterFields.d.ts +10 -0
- package/utils/renderGetFilterFields.js +48 -0
- package/utils/renderGetFilterFields.js.map +1 -0
- package/utils/renderInputFields.d.ts +14 -0
- package/{content/plugins/utils → utils}/renderInputFields.js +3 -10
- package/utils/renderInputFields.js.map +1 -0
- package/utils/renderListFilterFields.d.ts +11 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.js +36 -22
- package/utils/renderListFilterFields.js.map +1 -0
- package/utils/renderSortEnum.d.ts +12 -0
- package/utils/renderSortEnum.js +42 -0
- package/utils/renderSortEnum.js.map +1 -0
- package/utils/toSlug.d.ts +1 -0
- package/utils/toSlug.js +16 -0
- package/utils/toSlug.js.map +1 -0
- package/validators/dateGte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateGte.js +4 -11
- package/validators/dateGte.js.map +1 -0
- package/validators/dateLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateLte.js +4 -11
- package/validators/dateLte.js.map +1 -0
- package/validators/dynamicZone.d.ts +2 -0
- package/validators/dynamicZone.js +20 -0
- package/validators/dynamicZone.js.map +1 -0
- package/validators/gte.d.ts +2 -0
- package/validators/gte.js +28 -0
- package/validators/gte.js.map +1 -0
- package/validators/in.d.ts +2 -0
- package/validators/in.js +28 -0
- package/validators/in.js.map +1 -0
- package/validators/index.d.ts +1 -0
- package/validators/index.js +22 -0
- package/validators/index.js.map +1 -0
- package/validators/lte.d.ts +2 -0
- package/validators/lte.js +28 -0
- package/validators/lte.js.map +1 -0
- package/validators/maxLength.d.ts +2 -0
- package/validators/maxLength.js +28 -0
- package/validators/maxLength.js.map +1 -0
- package/validators/minLength.d.ts +2 -0
- package/validators/minLength.js +28 -0
- package/validators/minLength.js.map +1 -0
- package/validators/pattern.d.ts +2 -0
- package/validators/pattern.js +41 -0
- package/validators/pattern.js.map +1 -0
- package/validators/patternPlugins/email.d.ts +2 -0
- package/validators/patternPlugins/email.js +18 -0
- package/validators/patternPlugins/email.js.map +1 -0
- package/validators/patternPlugins/index.d.ts +2 -0
- package/validators/patternPlugins/index.js +16 -0
- package/validators/patternPlugins/index.js.map +1 -0
- package/validators/patternPlugins/lowerCase.d.ts +2 -0
- package/validators/patternPlugins/lowerCase.js +18 -0
- package/validators/patternPlugins/lowerCase.js.map +1 -0
- package/validators/patternPlugins/lowerCaseSpace.d.ts +2 -0
- package/validators/patternPlugins/lowerCaseSpace.js +18 -0
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -0
- package/validators/patternPlugins/upperCase.d.ts +2 -0
- package/validators/patternPlugins/upperCase.js +18 -0
- package/validators/patternPlugins/upperCase.js.map +1 -0
- package/validators/patternPlugins/upperCaseSpace.d.ts +2 -0
- package/validators/patternPlugins/upperCaseSpace.js +18 -0
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -0
- package/validators/patternPlugins/url.d.ts +2 -0
- package/validators/patternPlugins/url.js +18 -0
- package/validators/patternPlugins/url.js.map +1 -0
- package/validators/required.d.ts +2 -0
- package/validators/required.js +22 -0
- package/validators/required.js.map +1 -0
- package/validators/timeGte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeGte.js +5 -11
- package/validators/timeGte.js.map +1 -0
- package/validators/timeLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeLte.js +5 -11
- package/validators/timeLte.js.map +1 -0
- package/validators/unique.d.ts +6 -0
- package/validators/unique.js +56 -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.d.ts +0 -7
- package/content/plugins/buildSchemaPlugins.js +0 -29
- package/content/plugins/crud/contentEntry/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +0 -7
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +0 -7
- package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +0 -4
- package/content/plugins/crud/contentEntry.crud.js +0 -931
- package/content/plugins/crud/contentModel/afterCreate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterCreate.js +0 -18
- package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterDelete.js +0 -18
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterUpdate.js +0 -18
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeUpdate.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeUpdate.js +0 -128
- package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +0 -2
- package/content/plugins/crud/contentModel/createFieldModels.d.ts +0 -2
- package/content/plugins/crud/contentModel/createFieldModels.js +0 -22
- package/content/plugins/crud/contentModel/idValidation.d.ts +0 -2
- package/content/plugins/crud/contentModel/idValidation.js +0 -22
- package/content/plugins/crud/contentModel/models.d.ts +0 -3
- package/content/plugins/crud/contentModel/models.js +0 -141
- package/content/plugins/crud/contentModel/validateLayout.d.ts +0 -2
- package/content/plugins/crud/contentModel.crud.js +0 -425
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
- package/content/plugins/crud/contentModelGroup.crud.js +0 -351
- package/content/plugins/crud/index.d.ts +0 -6
- package/content/plugins/crud/index.js +0 -100
- package/content/plugins/graphqlFields/boolean.d.ts +0 -3
- package/content/plugins/graphqlFields/boolean.js +0 -69
- package/content/plugins/graphqlFields/datetime.d.ts +0 -3
- package/content/plugins/graphqlFields/datetime.js +0 -83
- package/content/plugins/graphqlFields/file.d.ts +0 -3
- package/content/plugins/graphqlFields/file.js +0 -49
- package/content/plugins/graphqlFields/index.d.ts +0 -2
- package/content/plugins/graphqlFields/index.js +0 -30
- package/content/plugins/graphqlFields/longText.d.ts +0 -3
- package/content/plugins/graphqlFields/longText.js +0 -62
- package/content/plugins/graphqlFields/number.d.ts +0 -3
- package/content/plugins/graphqlFields/number.js +0 -75
- package/content/plugins/graphqlFields/object.d.ts +0 -3
- package/content/plugins/graphqlFields/object.js +0 -180
- package/content/plugins/graphqlFields/ref.d.ts +0 -3
- package/content/plugins/graphqlFields/ref.js +0 -205
- package/content/plugins/graphqlFields/richText.d.ts +0 -3
- package/content/plugins/graphqlFields/richText.js +0 -55
- package/content/plugins/graphqlFields/text.d.ts +0 -3
- package/content/plugins/graphqlFields/text.js +0 -72
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -54
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -35
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -15
- package/content/plugins/modelManager/index.d.ts +0 -3
- package/content/plugins/schema/baseSchema.d.ts +0 -4
- package/content/plugins/schema/baseSchema.js +0 -98
- package/content/plugins/schema/contentEntries.d.ts +0 -4
- package/content/plugins/schema/contentEntries.js +0 -166
- package/content/plugins/schema/contentModelGroups.d.ts +0 -4
- package/content/plugins/schema/contentModels.d.ts +0 -4
- package/content/plugins/schema/createFieldResolvers.d.ts +0 -19
- package/content/plugins/schema/createFieldResolvers.js +0 -92
- package/content/plugins/schema/createManageResolvers.d.ts +0 -11
- package/content/plugins/schema/createManageSDL.d.ts +0 -9
- package/content/plugins/schema/createPreviewResolvers.d.ts +0 -10
- package/content/plugins/schema/createPreviewResolvers.js +0 -55
- package/content/plugins/schema/createReadResolvers.d.ts +0 -10
- package/content/plugins/schema/createReadResolvers.js +0 -55
- package/content/plugins/schema/createReadSDL.d.ts +0 -9
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +0 -7
- package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +0 -23
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +0 -23
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +0 -7
- package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/preview/resolveGet.js +0 -38
- package/content/plugins/schema/resolvers/preview/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveGet.js +0 -38
- package/content/plugins/schema/resolvers/read/resolveList.d.ts +0 -2
- package/content/plugins/schema/schemaPlugins.d.ts +0 -3
- package/content/plugins/schema/schemaPlugins.js +0 -92
- package/content/plugins/storage/StorageTransformPlugin.d.ts +0 -30
- 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/renderGetFilterFields.js +0 -41
- package/content/plugins/utils/renderInputFields.d.ts +0 -14
- package/content/plugins/utils/renderListFilterFields.d.ts +0 -10
- package/content/plugins/utils/renderSortEnum.d.ts +0 -9
- package/content/plugins/utils/renderSortEnum.js +0 -32
- package/content/plugins/validators/dateGte.d.ts +0 -3
- package/content/plugins/validators/dateLte.d.ts +0 -3
- package/content/plugins/validators/gte.d.ts +0 -3
- package/content/plugins/validators/gte.js +0 -32
- package/content/plugins/validators/in.d.ts +0 -3
- package/content/plugins/validators/in.js +0 -32
- package/content/plugins/validators/index.d.ts +0 -2
- package/content/plugins/validators/index.js +0 -36
- package/content/plugins/validators/lte.d.ts +0 -3
- package/content/plugins/validators/lte.js +0 -32
- package/content/plugins/validators/maxLength.d.ts +0 -3
- package/content/plugins/validators/maxLength.js +0 -32
- package/content/plugins/validators/minLength.d.ts +0 -3
- package/content/plugins/validators/minLength.js +0 -32
- package/content/plugins/validators/pattern.d.ts +0 -3
- package/content/plugins/validators/pattern.js +0 -47
- package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/email.js +0 -17
- package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
- package/content/plugins/validators/patternPlugins/index.js +0 -19
- package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
- package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/url.js +0 -17
- package/content/plugins/validators/required.d.ts +0 -3
- package/content/plugins/validators/required.js +0 -25
- package/content/plugins/validators/timeGte.d.ts +0 -3
- package/content/plugins/validators/timeLte.d.ts +0 -3
- package/migrateCMSPermissions.d.ts +0 -17
- package/migrateCMSPermissions.js +0 -193
- package/plugins/context.d.ts +0 -4
- package/plugins/context.js +0 -34
- package/plugins/crud/index.d.ts +0 -6
- package/plugins/crud/index.js +0 -100
- package/plugins/crud/settings.crud.js +0 -93
- package/plugins/crud/system.crud.js +0 -182
- package/plugins/graphql/system.d.ts +0 -17
- package/plugins/graphql.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
package/types.d.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins/types";
|
|
2
2
|
import { I18NContext, I18NLocale } from "@webiny/api-i18n/types";
|
|
3
|
-
import {
|
|
4
|
-
import { TenancyContext } from "@webiny/api-tenancy/types";
|
|
3
|
+
import { Context } from "@webiny/api/types";
|
|
5
4
|
import { GraphQLFieldResolver, GraphQLSchemaDefinition, Resolvers } from "@webiny/handler-graphql/types";
|
|
6
|
-
import { BaseI18NContentContext } from "@webiny/api-i18n-content/types";
|
|
7
5
|
import { SecurityPermission } from "@webiny/api-security/types";
|
|
8
|
-
import { HttpContext } from "@webiny/handler-http/types";
|
|
9
6
|
import { DbContext } from "@webiny/handler-db/types";
|
|
10
7
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
11
8
|
import { UpgradePlugin } from "@webiny/api-upgrade/types";
|
|
12
9
|
import { Topic } from "@webiny/pubsub/types";
|
|
10
|
+
import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
|
|
11
|
+
export declare type ApiEndpoint = "manage" | "preview" | "read";
|
|
13
12
|
export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
|
|
14
13
|
/**
|
|
15
14
|
* API type
|
|
16
15
|
*/
|
|
17
|
-
type:
|
|
16
|
+
type: ApiEndpoint | null;
|
|
18
17
|
/**
|
|
19
18
|
* Requested locale
|
|
20
19
|
*/
|
|
@@ -45,12 +44,16 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
|
|
|
45
44
|
*
|
|
46
45
|
* @category Context
|
|
47
46
|
*/
|
|
48
|
-
export interface CmsContext extends
|
|
47
|
+
export interface CmsContext extends Context, DbContext, I18NContext, FileManagerContext {
|
|
49
48
|
cms: HeadlessCms;
|
|
50
49
|
}
|
|
51
50
|
interface CmsModelFieldPredefinedValuesValue {
|
|
52
51
|
value: string;
|
|
53
52
|
label: string;
|
|
53
|
+
/**
|
|
54
|
+
* Default selected predefined value.
|
|
55
|
+
*/
|
|
56
|
+
selected?: boolean;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Object containing content model field predefined options and values.
|
|
@@ -79,6 +82,39 @@ interface CmsModelFieldRenderer {
|
|
|
79
82
|
*/
|
|
80
83
|
name: string;
|
|
81
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* A definition for content model field settings.
|
|
87
|
+
*
|
|
88
|
+
* @category ModelField
|
|
89
|
+
* @category Database model
|
|
90
|
+
*/
|
|
91
|
+
export interface CmsModelFieldSettings {
|
|
92
|
+
/**
|
|
93
|
+
* Predefined values (text, number)
|
|
94
|
+
* The default value for the field in case it is not predefined values field.
|
|
95
|
+
*/
|
|
96
|
+
defaultValue?: string | number | null | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Object field has child fields.
|
|
99
|
+
*/
|
|
100
|
+
fields?: CmsModelField[];
|
|
101
|
+
/**
|
|
102
|
+
* Object field has child fields - so it needs to have a layout.
|
|
103
|
+
*/
|
|
104
|
+
layout?: string[][];
|
|
105
|
+
/**
|
|
106
|
+
* Ref field.
|
|
107
|
+
*/
|
|
108
|
+
models?: Pick<CmsModel, "modelId">[];
|
|
109
|
+
/**
|
|
110
|
+
* Date field.
|
|
111
|
+
*/
|
|
112
|
+
type?: string;
|
|
113
|
+
/**
|
|
114
|
+
* There are a lot of other settings that are possible to add, so we keep the type opened.
|
|
115
|
+
*/
|
|
116
|
+
[key: string]: any;
|
|
117
|
+
}
|
|
82
118
|
/**
|
|
83
119
|
* A definition for content model field. This type exists on the app side as well.
|
|
84
120
|
*
|
|
@@ -87,15 +123,37 @@ interface CmsModelFieldRenderer {
|
|
|
87
123
|
*/
|
|
88
124
|
export interface CmsModelField {
|
|
89
125
|
/**
|
|
90
|
-
* A generated ID for the model field
|
|
126
|
+
* A generated unique ID for the model field.
|
|
127
|
+
* MUST be absolute unique throughout the models.
|
|
128
|
+
* Must be in form of a-zA-Z0-9.
|
|
129
|
+
*
|
|
130
|
+
* We generate a unique id value when you're building a model via UI,
|
|
131
|
+
* but when user is creating a model via a plugin it is up to them to be careful about this.
|
|
91
132
|
*/
|
|
92
133
|
id: string;
|
|
93
134
|
/**
|
|
94
|
-
* A type of the field
|
|
135
|
+
* A type of the field.
|
|
136
|
+
* We are defining our built-in fields, so people know which are available by the default.
|
|
95
137
|
*/
|
|
96
|
-
type: string;
|
|
138
|
+
type: "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
|
|
97
139
|
/**
|
|
98
|
-
* A unique
|
|
140
|
+
* A unique storage ID for storing actual values.
|
|
141
|
+
* Must in form of a-zA-Z0-9@a-zA-Z0-9@a-zA-Z0-9.
|
|
142
|
+
*
|
|
143
|
+
* This is an auto-generated value: uses `id` and `type`
|
|
144
|
+
*
|
|
145
|
+
* This is used as path for the entry value.
|
|
146
|
+
*
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
storageId: string;
|
|
150
|
+
/**
|
|
151
|
+
* Field identifier for the model field that will be available to the outside world.
|
|
152
|
+
* `storageId` is used as path (or column) to store the data.
|
|
153
|
+
*
|
|
154
|
+
* Must in form of a-zA-Z0-9.
|
|
155
|
+
*
|
|
156
|
+
* This value MUST be unique in the CmsModel.
|
|
99
157
|
*/
|
|
100
158
|
fieldId: string;
|
|
101
159
|
/**
|
|
@@ -105,11 +163,11 @@ export interface CmsModelField {
|
|
|
105
163
|
/**
|
|
106
164
|
* Text below the field to clarify what is it meant to be in the field value
|
|
107
165
|
*/
|
|
108
|
-
helpText?: string;
|
|
166
|
+
helpText?: string | null;
|
|
109
167
|
/**
|
|
110
168
|
* Text to be displayed in the field
|
|
111
169
|
*/
|
|
112
|
-
placeholderText?: string;
|
|
170
|
+
placeholderText?: string | null;
|
|
113
171
|
/**
|
|
114
172
|
* Are predefined values enabled? And list of them
|
|
115
173
|
*/
|
|
@@ -137,21 +195,53 @@ export interface CmsModelField {
|
|
|
137
195
|
*
|
|
138
196
|
*/
|
|
139
197
|
multipleValues?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Fields can be tagged to give them contextual meaning.
|
|
200
|
+
*/
|
|
201
|
+
tags?: string[];
|
|
140
202
|
/**
|
|
141
203
|
* Any user defined settings.
|
|
142
204
|
*
|
|
143
205
|
* @default {}
|
|
144
206
|
*/
|
|
145
|
-
settings?:
|
|
146
|
-
|
|
207
|
+
settings?: CmsModelFieldSettings;
|
|
208
|
+
}
|
|
209
|
+
export interface CmsDynamicZoneTemplate {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
gqlTypeName: string;
|
|
213
|
+
description: string;
|
|
214
|
+
icon: string;
|
|
215
|
+
fields: CmsModelField[];
|
|
216
|
+
layout: string[][];
|
|
217
|
+
validation: CmsModelFieldValidation[];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* A definition for dynamic-zone field to show possible type of the field in settings.
|
|
221
|
+
*/
|
|
222
|
+
export interface CmsModelDynamicZoneField extends CmsModelField {
|
|
223
|
+
/**
|
|
224
|
+
* Settings object for the field. Contains `templates` property.
|
|
225
|
+
*/
|
|
226
|
+
settings: {
|
|
227
|
+
templates: CmsDynamicZoneTemplate[];
|
|
147
228
|
};
|
|
148
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Used for our internal functionality.
|
|
232
|
+
*/
|
|
233
|
+
export interface CmsModelFieldWithParent extends CmsModelField {
|
|
234
|
+
parent?: CmsModelFieldWithParent | null;
|
|
235
|
+
}
|
|
236
|
+
export interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {
|
|
237
|
+
parent?: CmsModelDynamicZoneFieldWithParent | null;
|
|
238
|
+
}
|
|
149
239
|
/**
|
|
150
240
|
* A definition for dateTime field to show possible type of the field in settings.
|
|
151
241
|
*/
|
|
152
242
|
export interface CmsModelDateTimeField extends CmsModelField {
|
|
153
243
|
/**
|
|
154
|
-
* Settings object for the field. Contains type property.
|
|
244
|
+
* Settings object for the field. Contains `type` property.
|
|
155
245
|
*/
|
|
156
246
|
settings: {
|
|
157
247
|
type: "time" | "date" | "dateTimeWithoutTimezone" | "dateTimeWithTimezone";
|
|
@@ -163,11 +253,11 @@ export interface CmsModelDateTimeField extends CmsModelField {
|
|
|
163
253
|
* @category ModelField
|
|
164
254
|
* @category FieldValidation
|
|
165
255
|
*/
|
|
166
|
-
export interface CmsModelFieldValidatorValidateParams {
|
|
256
|
+
export interface CmsModelFieldValidatorValidateParams<T = any> {
|
|
167
257
|
/**
|
|
168
258
|
* A value to be validated.
|
|
169
259
|
*/
|
|
170
|
-
value:
|
|
260
|
+
value: T;
|
|
171
261
|
/**
|
|
172
262
|
* Options from the CmsModelField validations.
|
|
173
263
|
*
|
|
@@ -186,7 +276,12 @@ export interface CmsModelFieldValidatorValidateParams {
|
|
|
186
276
|
/**
|
|
187
277
|
* An instance of the content model being validated.
|
|
188
278
|
*/
|
|
189
|
-
|
|
279
|
+
model: CmsModel;
|
|
280
|
+
/**
|
|
281
|
+
* If entry is sent it means it is an update operation.
|
|
282
|
+
* First usage is for the unique field value.
|
|
283
|
+
*/
|
|
284
|
+
entry?: CmsEntry;
|
|
190
285
|
}
|
|
191
286
|
/**
|
|
192
287
|
* Definition for the field validator.
|
|
@@ -253,7 +348,8 @@ export interface CmsModelFieldPatternValidatorPlugin extends Plugin {
|
|
|
253
348
|
*/
|
|
254
349
|
export interface LockedField {
|
|
255
350
|
/**
|
|
256
|
-
* Locked field ID - one used
|
|
351
|
+
* Locked field storage ID - one used to store values.
|
|
352
|
+
* We cannot change this due to old systems.
|
|
257
353
|
*/
|
|
258
354
|
fieldId: string;
|
|
259
355
|
/**
|
|
@@ -266,6 +362,20 @@ export interface LockedField {
|
|
|
266
362
|
type: string;
|
|
267
363
|
[key: string]: any;
|
|
268
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* @category Database model
|
|
367
|
+
* @category CmsModel
|
|
368
|
+
*/
|
|
369
|
+
export interface CmsModelGroup {
|
|
370
|
+
/**
|
|
371
|
+
* Generated ID of the group
|
|
372
|
+
*/
|
|
373
|
+
id: string;
|
|
374
|
+
/**
|
|
375
|
+
* Name of the group
|
|
376
|
+
*/
|
|
377
|
+
name: string;
|
|
378
|
+
}
|
|
269
379
|
/**
|
|
270
380
|
* Cms Model defining an entry.
|
|
271
381
|
*
|
|
@@ -281,6 +391,10 @@ export interface CmsModel {
|
|
|
281
391
|
* Unique ID for the content model. Created from name if not defined by user.
|
|
282
392
|
*/
|
|
283
393
|
modelId: string;
|
|
394
|
+
/**
|
|
395
|
+
* Model tenant.
|
|
396
|
+
*/
|
|
397
|
+
tenant: string;
|
|
284
398
|
/**
|
|
285
399
|
* Locale this model belongs to.
|
|
286
400
|
*/
|
|
@@ -288,28 +402,19 @@ export interface CmsModel {
|
|
|
288
402
|
/**
|
|
289
403
|
* Cms Group reference object.
|
|
290
404
|
*/
|
|
291
|
-
group:
|
|
292
|
-
/**
|
|
293
|
-
* Generated ID of the group
|
|
294
|
-
*/
|
|
295
|
-
id: string;
|
|
296
|
-
/**
|
|
297
|
-
* Name of the group
|
|
298
|
-
*/
|
|
299
|
-
name: string;
|
|
300
|
-
};
|
|
405
|
+
group: CmsModelGroup;
|
|
301
406
|
/**
|
|
302
407
|
* Description for the content model.
|
|
303
408
|
*/
|
|
304
|
-
description
|
|
409
|
+
description: string;
|
|
305
410
|
/**
|
|
306
411
|
* Date created
|
|
307
412
|
*/
|
|
308
|
-
createdOn?:
|
|
413
|
+
createdOn?: string;
|
|
309
414
|
/**
|
|
310
415
|
* Date saved. Changes on both save and create.
|
|
311
416
|
*/
|
|
312
|
-
savedOn?:
|
|
417
|
+
savedOn?: string;
|
|
313
418
|
/**
|
|
314
419
|
* CreatedBy object wrapper. Contains id, name and type of the user.
|
|
315
420
|
*/
|
|
@@ -329,6 +434,10 @@ export interface CmsModel {
|
|
|
329
434
|
* ```
|
|
330
435
|
*/
|
|
331
436
|
layout: string[][];
|
|
437
|
+
/**
|
|
438
|
+
* Models can be tagged to give them contextual meaning.
|
|
439
|
+
*/
|
|
440
|
+
tags?: string[];
|
|
332
441
|
/**
|
|
333
442
|
* List of locked fields. Updated when entry is saved and a field has been used.
|
|
334
443
|
*/
|
|
@@ -343,9 +452,20 @@ export interface CmsModel {
|
|
|
343
452
|
*/
|
|
344
453
|
webinyVersion: string;
|
|
345
454
|
/**
|
|
346
|
-
*
|
|
455
|
+
* Is model private?
|
|
456
|
+
* This is meant to be used for some internal models - will not be visible in the schema.
|
|
457
|
+
* Only available for the plugin constructed models.
|
|
347
458
|
*/
|
|
348
|
-
|
|
459
|
+
isPrivate?: boolean;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter
|
|
463
|
+
*
|
|
464
|
+
* @category CmsModel
|
|
465
|
+
*/
|
|
466
|
+
export interface StorageOperationsCmsModel extends CmsModel {
|
|
467
|
+
convertValueKeyToStorage: CmsModelConverterCallable;
|
|
468
|
+
convertValueKeyFromStorage: CmsModelConverterCallable;
|
|
349
469
|
}
|
|
350
470
|
/**
|
|
351
471
|
* @category ModelField
|
|
@@ -354,24 +474,40 @@ export interface CmsModelFieldDefinition {
|
|
|
354
474
|
fields: string;
|
|
355
475
|
typeDefs?: string;
|
|
356
476
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
477
|
+
interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
|
|
478
|
+
models: CmsModel[];
|
|
479
|
+
model: CmsModel;
|
|
480
|
+
graphQLType: string;
|
|
481
|
+
field: TField;
|
|
482
|
+
createFieldResolvers: any;
|
|
483
|
+
}
|
|
484
|
+
export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
|
|
485
|
+
(params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
|
|
486
|
+
resolver: GraphQLFieldResolver | null;
|
|
366
487
|
typeResolvers: Resolvers<CmsContext>;
|
|
367
|
-
};
|
|
488
|
+
} | false;
|
|
489
|
+
}
|
|
490
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<TField extends CmsModelField = CmsModelField> {
|
|
491
|
+
fields: TField[];
|
|
492
|
+
originalFields: TField[];
|
|
493
|
+
}
|
|
494
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {
|
|
495
|
+
(params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;
|
|
496
|
+
}
|
|
497
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField extends CmsModelField = CmsModelField> {
|
|
498
|
+
field: TField;
|
|
499
|
+
originalField?: TField;
|
|
500
|
+
validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;
|
|
501
|
+
}
|
|
502
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFields<TField extends CmsModelField = CmsModelField> {
|
|
503
|
+
(params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;
|
|
368
504
|
}
|
|
369
505
|
/**
|
|
370
506
|
* @category Plugin
|
|
371
507
|
* @category ModelField
|
|
372
508
|
* @category GraphQL
|
|
373
509
|
*/
|
|
374
|
-
export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
510
|
+
export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField> extends Plugin {
|
|
375
511
|
/**
|
|
376
512
|
* A plugin type
|
|
377
513
|
*/
|
|
@@ -392,6 +528,15 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
392
528
|
* ```
|
|
393
529
|
*/
|
|
394
530
|
isSearchable: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* Is the field searchable via full text search?
|
|
533
|
+
*
|
|
534
|
+
* Field is not full text searchable by default.
|
|
535
|
+
* ```ts
|
|
536
|
+
* fullTextSearch: false
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
fullTextSearch?: boolean;
|
|
395
540
|
/**
|
|
396
541
|
* Is the field sortable via the GraphQL?
|
|
397
542
|
*
|
|
@@ -400,6 +545,27 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
400
545
|
* ```
|
|
401
546
|
*/
|
|
402
547
|
isSortable: boolean;
|
|
548
|
+
/**
|
|
549
|
+
* Optional method which creates the storageId.
|
|
550
|
+
* Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.
|
|
551
|
+
*
|
|
552
|
+
* ```ts
|
|
553
|
+
* createStorageId: ({field}) => {
|
|
554
|
+
* if (field.settings.type === "time) {
|
|
555
|
+
* return `${field.type}_time@${field.id}`
|
|
556
|
+
* }
|
|
557
|
+
* // use default method
|
|
558
|
+
* return undefined;
|
|
559
|
+
* }
|
|
560
|
+
* ```
|
|
561
|
+
*/
|
|
562
|
+
createStorageId?: (params: {
|
|
563
|
+
model: CmsModel;
|
|
564
|
+
field: TField;
|
|
565
|
+
}) => string | null | undefined;
|
|
566
|
+
/**
|
|
567
|
+
* Read API methods.
|
|
568
|
+
*/
|
|
403
569
|
read: {
|
|
404
570
|
/**
|
|
405
571
|
* Definition for get filtering for GraphQL.
|
|
@@ -414,7 +580,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
414
580
|
*/
|
|
415
581
|
createGetFilters?(params: {
|
|
416
582
|
model: CmsModel;
|
|
417
|
-
field:
|
|
583
|
+
field: TField;
|
|
418
584
|
}): string;
|
|
419
585
|
/**
|
|
420
586
|
* Definition for list filtering for GraphQL.
|
|
@@ -434,7 +600,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
434
600
|
*/
|
|
435
601
|
createListFilters?(params: {
|
|
436
602
|
model: CmsModel;
|
|
437
|
-
field:
|
|
603
|
+
field: TField;
|
|
604
|
+
plugins: CmsFieldTypePlugins;
|
|
438
605
|
}): string;
|
|
439
606
|
/**
|
|
440
607
|
* Definition of the field type for GraphQL - be aware if multiple values is selected.
|
|
@@ -453,24 +620,24 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
453
620
|
*/
|
|
454
621
|
createTypeField(params: {
|
|
455
622
|
model: CmsModel;
|
|
456
|
-
field:
|
|
623
|
+
field: TField;
|
|
457
624
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
458
|
-
}): CmsModelFieldDefinition | string;
|
|
625
|
+
}): CmsModelFieldDefinition | string | null;
|
|
459
626
|
/**
|
|
460
627
|
* Definition for field resolver.
|
|
461
|
-
* By default it is simple return of the `instance.values[
|
|
628
|
+
* By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
462
629
|
*
|
|
463
630
|
* ```ts
|
|
464
631
|
* read: {
|
|
465
632
|
* createResolver({ field }) {
|
|
466
633
|
* return instance => {
|
|
467
|
-
* return instance.values[field.
|
|
634
|
+
* return instance.values[field.storageId];
|
|
468
635
|
* };
|
|
469
636
|
* }
|
|
470
637
|
* }
|
|
471
638
|
* ```
|
|
472
639
|
*/
|
|
473
|
-
createResolver?: CmsModelFieldToGraphQLCreateResolver
|
|
640
|
+
createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
|
|
474
641
|
/**
|
|
475
642
|
* Read API schema definitions for the field and resolvers for them.
|
|
476
643
|
*
|
|
@@ -492,7 +659,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
492
659
|
*/
|
|
493
660
|
createSchema?: (params: {
|
|
494
661
|
models: CmsModel[];
|
|
495
|
-
model: CmsModel;
|
|
496
662
|
}) => GraphQLSchemaDefinition<CmsContext>;
|
|
497
663
|
};
|
|
498
664
|
manage: {
|
|
@@ -514,7 +680,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
514
680
|
*/
|
|
515
681
|
createListFilters?: (params: {
|
|
516
682
|
model: CmsModel;
|
|
517
|
-
field:
|
|
683
|
+
field: TField;
|
|
684
|
+
plugins: CmsFieldTypePlugins;
|
|
518
685
|
}) => string;
|
|
519
686
|
/**
|
|
520
687
|
* Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
|
|
@@ -535,7 +702,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
535
702
|
*/
|
|
536
703
|
createSchema?: (params: {
|
|
537
704
|
models: CmsModel[];
|
|
538
|
-
model: CmsModel;
|
|
539
705
|
}) => GraphQLSchemaDefinition<CmsContext>;
|
|
540
706
|
/**
|
|
541
707
|
* Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.
|
|
@@ -554,9 +720,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
554
720
|
*/
|
|
555
721
|
createTypeField: (params: {
|
|
556
722
|
model: CmsModel;
|
|
557
|
-
field:
|
|
723
|
+
field: TField;
|
|
558
724
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
559
|
-
}) => CmsModelFieldDefinition | string;
|
|
725
|
+
}) => CmsModelFieldDefinition | string | null;
|
|
560
726
|
/**
|
|
561
727
|
* Definition for input GraphQL field type.
|
|
562
728
|
*
|
|
@@ -574,25 +740,30 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
574
740
|
*/
|
|
575
741
|
createInputField: (params: {
|
|
576
742
|
model: CmsModel;
|
|
577
|
-
field:
|
|
743
|
+
field: TField;
|
|
578
744
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
579
|
-
}) => CmsModelFieldDefinition | string;
|
|
745
|
+
}) => CmsModelFieldDefinition | string | null;
|
|
580
746
|
/**
|
|
581
747
|
* Definition for field resolver.
|
|
582
|
-
* By default it is simple return of the `instance.values[
|
|
748
|
+
* By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
583
749
|
*
|
|
584
750
|
* ```ts
|
|
585
751
|
* manage: {
|
|
586
752
|
* createResolver({ field }) {
|
|
587
753
|
* return instance => {
|
|
588
|
-
* return instance.values[field.
|
|
754
|
+
* return instance.values[field.storageId];
|
|
589
755
|
* };
|
|
590
756
|
* }
|
|
591
757
|
* }
|
|
592
758
|
* ```
|
|
593
759
|
*/
|
|
594
|
-
createResolver?: CmsModelFieldToGraphQLCreateResolver
|
|
760
|
+
createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
|
|
595
761
|
};
|
|
762
|
+
/**
|
|
763
|
+
*
|
|
764
|
+
* @param field
|
|
765
|
+
*/
|
|
766
|
+
validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;
|
|
596
767
|
}
|
|
597
768
|
/**
|
|
598
769
|
* Check for content model locked field.
|
|
@@ -631,7 +802,7 @@ export interface CmsFieldTypePlugins {
|
|
|
631
802
|
[key: string]: CmsModelFieldToGraphQLPlugin;
|
|
632
803
|
}
|
|
633
804
|
/**
|
|
634
|
-
*
|
|
805
|
+
* An interface describing the reference to a user that created some data in the database.
|
|
635
806
|
*
|
|
636
807
|
* @category General
|
|
637
808
|
*/
|
|
@@ -643,7 +814,7 @@ export interface CreatedBy {
|
|
|
643
814
|
/**
|
|
644
815
|
* Full name of the user.
|
|
645
816
|
*/
|
|
646
|
-
displayName: string;
|
|
817
|
+
displayName: string | null;
|
|
647
818
|
/**
|
|
648
819
|
* Type of the user (admin, user)
|
|
649
820
|
*/
|
|
@@ -687,26 +858,45 @@ export interface CmsSettingsContext {
|
|
|
687
858
|
*/
|
|
688
859
|
getModelLastChange: () => Promise<Date>;
|
|
689
860
|
}
|
|
690
|
-
export interface
|
|
861
|
+
export interface OnSystemBeforeInstallTopicParams {
|
|
691
862
|
tenant: string;
|
|
863
|
+
locale: string;
|
|
692
864
|
}
|
|
693
|
-
export interface
|
|
865
|
+
export interface OnSystemAfterInstallTopicParams {
|
|
694
866
|
tenant: string;
|
|
867
|
+
locale: string;
|
|
868
|
+
}
|
|
869
|
+
export interface OnSystemInstallErrorTopicParams {
|
|
870
|
+
error: Error;
|
|
871
|
+
tenant: string;
|
|
872
|
+
locale: string;
|
|
695
873
|
}
|
|
696
874
|
export declare type CmsSystemContext = {
|
|
697
|
-
getSystemVersion: () => Promise<string>;
|
|
875
|
+
getSystemVersion: () => Promise<string | null>;
|
|
698
876
|
setSystemVersion: (version: string) => Promise<void>;
|
|
699
|
-
getReadAPIKey(): Promise<string>;
|
|
877
|
+
getReadAPIKey(): Promise<string | null>;
|
|
700
878
|
installSystem: () => Promise<void>;
|
|
701
879
|
upgradeSystem: (version: string) => Promise<boolean>;
|
|
702
880
|
/**
|
|
703
|
-
*
|
|
881
|
+
* Lifecycle events - deprecated
|
|
882
|
+
*/
|
|
883
|
+
/**
|
|
884
|
+
* @deprecated
|
|
885
|
+
*/
|
|
886
|
+
onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;
|
|
887
|
+
/**
|
|
888
|
+
* @deprecated
|
|
889
|
+
*/
|
|
890
|
+
onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;
|
|
891
|
+
/**
|
|
892
|
+
* Released in 5.34.0
|
|
704
893
|
*/
|
|
705
|
-
|
|
706
|
-
|
|
894
|
+
onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;
|
|
895
|
+
onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;
|
|
896
|
+
onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
|
|
707
897
|
};
|
|
708
898
|
/**
|
|
709
|
-
* A GraphQL params.data parameter received when creating content model group.
|
|
899
|
+
* A GraphQL `params.data` parameter received when creating content model group.
|
|
710
900
|
*
|
|
711
901
|
* @category CmsGroup
|
|
712
902
|
* @category GraphQL params
|
|
@@ -718,7 +908,7 @@ export interface CmsGroupCreateInput {
|
|
|
718
908
|
icon: string;
|
|
719
909
|
}
|
|
720
910
|
/**
|
|
721
|
-
* A GraphQL params.data parameter received when updating content model group.
|
|
911
|
+
* A GraphQL `params.data` parameter received when updating content model group.
|
|
722
912
|
*
|
|
723
913
|
* @category CmsGroup
|
|
724
914
|
* @category GraphQL params
|
|
@@ -748,6 +938,10 @@ export interface CmsGroup {
|
|
|
748
938
|
* Slug for the group. Must be unique.
|
|
749
939
|
*/
|
|
750
940
|
slug: string;
|
|
941
|
+
/**
|
|
942
|
+
* Group tenant.
|
|
943
|
+
*/
|
|
944
|
+
tenant: string;
|
|
751
945
|
/**
|
|
752
946
|
* Locale this group belongs to.
|
|
753
947
|
*/
|
|
@@ -755,11 +949,11 @@ export interface CmsGroup {
|
|
|
755
949
|
/**
|
|
756
950
|
* Description for the group.
|
|
757
951
|
*/
|
|
758
|
-
description
|
|
952
|
+
description: string;
|
|
759
953
|
/**
|
|
760
954
|
* Icon for the group. In a form of "ico/ico".
|
|
761
955
|
*/
|
|
762
|
-
icon
|
|
956
|
+
icon: string;
|
|
763
957
|
/**
|
|
764
958
|
* CreatedBy reference object.
|
|
765
959
|
*/
|
|
@@ -777,12 +971,14 @@ export interface CmsGroup {
|
|
|
777
971
|
*/
|
|
778
972
|
webinyVersion: string;
|
|
779
973
|
/**
|
|
780
|
-
*
|
|
974
|
+
* Is group private?
|
|
975
|
+
* This is meant to be used for some internal groups - will not be visible in the schema.
|
|
976
|
+
* Only available for the plugin constructed groups.
|
|
781
977
|
*/
|
|
782
|
-
|
|
978
|
+
isPrivate?: boolean;
|
|
783
979
|
}
|
|
784
980
|
/**
|
|
785
|
-
* A data.where parameter received when listing content model groups.
|
|
981
|
+
* A `data.where` parameter received when listing content model groups.
|
|
786
982
|
*
|
|
787
983
|
* @category CmsGroup
|
|
788
984
|
* @category GraphQL params
|
|
@@ -798,21 +994,30 @@ export interface CmsGroupListParams {
|
|
|
798
994
|
* @category CmsGroup
|
|
799
995
|
* @category Topic
|
|
800
996
|
*/
|
|
801
|
-
export interface
|
|
997
|
+
export interface OnGroupBeforeCreateTopicParams {
|
|
802
998
|
group: CmsGroup;
|
|
803
999
|
}
|
|
804
1000
|
/**
|
|
805
1001
|
* @category CmsGroup
|
|
806
1002
|
* @category Topic
|
|
807
1003
|
*/
|
|
808
|
-
export interface
|
|
1004
|
+
export interface OnGroupAfterCreateTopicParams {
|
|
809
1005
|
group: CmsGroup;
|
|
810
1006
|
}
|
|
811
1007
|
/**
|
|
812
1008
|
* @category CmsGroup
|
|
813
1009
|
* @category Topic
|
|
814
1010
|
*/
|
|
815
|
-
export interface
|
|
1011
|
+
export interface OnGroupCreateErrorTopicParams {
|
|
1012
|
+
input: CmsGroupCreateInput;
|
|
1013
|
+
group: CmsGroup;
|
|
1014
|
+
error: Error;
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* @category CmsGroup
|
|
1018
|
+
* @category Topic
|
|
1019
|
+
*/
|
|
1020
|
+
export interface OnGroupBeforeUpdateTopicParams {
|
|
816
1021
|
original: CmsGroup;
|
|
817
1022
|
group: CmsGroup;
|
|
818
1023
|
}
|
|
@@ -820,7 +1025,7 @@ export interface BeforeGroupUpdateTopicParams {
|
|
|
820
1025
|
* @category CmsGroup
|
|
821
1026
|
* @category Topic
|
|
822
1027
|
*/
|
|
823
|
-
export interface
|
|
1028
|
+
export interface OnGroupAfterUpdateTopicParams {
|
|
824
1029
|
original: CmsGroup;
|
|
825
1030
|
group: CmsGroup;
|
|
826
1031
|
}
|
|
@@ -828,16 +1033,34 @@ export interface AfterGroupUpdateTopicParams {
|
|
|
828
1033
|
* @category CmsGroup
|
|
829
1034
|
* @category Topic
|
|
830
1035
|
*/
|
|
831
|
-
export interface
|
|
1036
|
+
export interface OnGroupUpdateErrorTopicParams {
|
|
1037
|
+
input: CmsGroupUpdateInput;
|
|
1038
|
+
original: CmsGroup;
|
|
832
1039
|
group: CmsGroup;
|
|
1040
|
+
error: Error;
|
|
833
1041
|
}
|
|
834
1042
|
/**
|
|
835
1043
|
* @category CmsGroup
|
|
836
1044
|
* @category Topic
|
|
837
1045
|
*/
|
|
838
|
-
export interface
|
|
1046
|
+
export interface OnGroupBeforeDeleteTopicParams {
|
|
839
1047
|
group: CmsGroup;
|
|
840
1048
|
}
|
|
1049
|
+
/**
|
|
1050
|
+
* @category CmsGroup
|
|
1051
|
+
* @category Topic
|
|
1052
|
+
*/
|
|
1053
|
+
export interface OnGroupAfterDeleteTopicParams {
|
|
1054
|
+
group: CmsGroup;
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* @category CmsGroup
|
|
1058
|
+
* @category Topic
|
|
1059
|
+
*/
|
|
1060
|
+
export interface OnGroupDeleteErrorTopicParams {
|
|
1061
|
+
group: CmsGroup;
|
|
1062
|
+
error: Error;
|
|
1063
|
+
}
|
|
841
1064
|
/**
|
|
842
1065
|
* Cms Group in context.
|
|
843
1066
|
*
|
|
@@ -866,14 +1089,48 @@ export interface CmsGroupContext {
|
|
|
866
1089
|
*/
|
|
867
1090
|
deleteGroup: (id: string) => Promise<boolean>;
|
|
868
1091
|
/**
|
|
869
|
-
*
|
|
1092
|
+
* Clear the cached groups.
|
|
1093
|
+
*/
|
|
1094
|
+
clearGroupsCache: () => void;
|
|
1095
|
+
/**
|
|
1096
|
+
* Lifecycle events - deprecated
|
|
1097
|
+
*/
|
|
1098
|
+
/**
|
|
1099
|
+
* @deprecated
|
|
1100
|
+
*/
|
|
1101
|
+
onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;
|
|
1102
|
+
/**
|
|
1103
|
+
* @deprecated
|
|
1104
|
+
*/
|
|
1105
|
+
onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;
|
|
1106
|
+
/**
|
|
1107
|
+
* @deprecated
|
|
1108
|
+
*/
|
|
1109
|
+
onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
|
|
1110
|
+
/**
|
|
1111
|
+
* @deprecated
|
|
1112
|
+
*/
|
|
1113
|
+
onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;
|
|
1114
|
+
/**
|
|
1115
|
+
* @deprecated
|
|
1116
|
+
*/
|
|
1117
|
+
onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;
|
|
1118
|
+
/**
|
|
1119
|
+
* @deprecated
|
|
1120
|
+
*/
|
|
1121
|
+
onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;
|
|
1122
|
+
/**
|
|
1123
|
+
* Lifecycle events released in 5.33.0
|
|
870
1124
|
*/
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
1125
|
+
onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
|
|
1126
|
+
onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
|
|
1127
|
+
onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;
|
|
1128
|
+
onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
|
|
1129
|
+
onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
|
|
1130
|
+
onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;
|
|
1131
|
+
onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
|
|
1132
|
+
onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
|
|
1133
|
+
onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;
|
|
877
1134
|
}
|
|
878
1135
|
/**
|
|
879
1136
|
* Definition for content model field validator.
|
|
@@ -884,10 +1141,15 @@ export interface CmsGroupContext {
|
|
|
884
1141
|
export interface CmsModelFieldValidation {
|
|
885
1142
|
name: string;
|
|
886
1143
|
message: string;
|
|
887
|
-
settings?:
|
|
1144
|
+
settings?: {
|
|
1145
|
+
value?: string | number;
|
|
1146
|
+
values?: string[];
|
|
1147
|
+
preset?: string;
|
|
1148
|
+
[key: string]: any;
|
|
1149
|
+
};
|
|
888
1150
|
}
|
|
889
1151
|
/**
|
|
890
|
-
* A GraphQL params.data parameter received when creating content model.
|
|
1152
|
+
* A GraphQL `params.data` parameter received when creating content model.
|
|
891
1153
|
*
|
|
892
1154
|
* @category GraphQL params
|
|
893
1155
|
* @category CmsModel
|
|
@@ -904,7 +1166,47 @@ export interface CmsModelCreateInput {
|
|
|
904
1166
|
/**
|
|
905
1167
|
* Description of the content model.
|
|
906
1168
|
*/
|
|
907
|
-
description?: string;
|
|
1169
|
+
description?: string | null;
|
|
1170
|
+
/**
|
|
1171
|
+
* Group where to put the content model in.
|
|
1172
|
+
*/
|
|
1173
|
+
group: string;
|
|
1174
|
+
/**
|
|
1175
|
+
* A list of content model fields to define the entry values.
|
|
1176
|
+
*/
|
|
1177
|
+
fields?: CmsModelFieldInput[];
|
|
1178
|
+
/**
|
|
1179
|
+
* Admin UI field layout
|
|
1180
|
+
*
|
|
1181
|
+
* ```ts
|
|
1182
|
+
* layout: [
|
|
1183
|
+
* [field1id, field2id],
|
|
1184
|
+
* [field3id]
|
|
1185
|
+
* ]
|
|
1186
|
+
* ```
|
|
1187
|
+
*/
|
|
1188
|
+
layout?: string[][];
|
|
1189
|
+
/**
|
|
1190
|
+
* Models can be tagged to give them contextual meaning.
|
|
1191
|
+
*/
|
|
1192
|
+
tags?: string[];
|
|
1193
|
+
/**
|
|
1194
|
+
* The field that is being displayed as entry title.
|
|
1195
|
+
* It is picked as first available text field. Or user can select own field.
|
|
1196
|
+
*/
|
|
1197
|
+
titleFieldId?: string;
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* A GraphQL `params.data` parameter received when creating content model from existing model.
|
|
1201
|
+
*
|
|
1202
|
+
* @category GraphQL params
|
|
1203
|
+
* @category CmsModel
|
|
1204
|
+
*/
|
|
1205
|
+
export interface CmsModelCreateFromInput extends CmsModelCreateInput {
|
|
1206
|
+
/**
|
|
1207
|
+
* Locale into which we want to clone the model into.
|
|
1208
|
+
*/
|
|
1209
|
+
locale?: string;
|
|
908
1210
|
}
|
|
909
1211
|
/**
|
|
910
1212
|
* A definition for content model field received from the user.
|
|
@@ -926,7 +1228,7 @@ export interface CmsModelFieldInput {
|
|
|
926
1228
|
*/
|
|
927
1229
|
type: string;
|
|
928
1230
|
/**
|
|
929
|
-
*
|
|
1231
|
+
* Field outside world identifier for the field. Must be unique in the model.
|
|
930
1232
|
*/
|
|
931
1233
|
fieldId: string;
|
|
932
1234
|
/**
|
|
@@ -936,11 +1238,15 @@ export interface CmsModelFieldInput {
|
|
|
936
1238
|
/**
|
|
937
1239
|
* Text to display below the field to help user what to write in the field.
|
|
938
1240
|
*/
|
|
939
|
-
helpText?: string;
|
|
1241
|
+
helpText?: string | null;
|
|
940
1242
|
/**
|
|
941
1243
|
* Text to display in the field.
|
|
942
1244
|
*/
|
|
943
|
-
placeholderText?: string;
|
|
1245
|
+
placeholderText?: string | null;
|
|
1246
|
+
/**
|
|
1247
|
+
* Fields can be tagged to give them contextual meaning.
|
|
1248
|
+
*/
|
|
1249
|
+
tags?: string[];
|
|
944
1250
|
/**
|
|
945
1251
|
* Are multiple values allowed?
|
|
946
1252
|
*/
|
|
@@ -967,7 +1273,7 @@ export interface CmsModelFieldInput {
|
|
|
967
1273
|
settings?: Record<string, any>;
|
|
968
1274
|
}
|
|
969
1275
|
/**
|
|
970
|
-
* A GraphQL params.data parameter received when updating content model.
|
|
1276
|
+
* A GraphQL `params.data` parameter received when updating content model.
|
|
971
1277
|
*
|
|
972
1278
|
* @category GraphQL params
|
|
973
1279
|
* @category CmsModel
|
|
@@ -977,10 +1283,14 @@ export interface CmsModelUpdateInput {
|
|
|
977
1283
|
* A new content model name.
|
|
978
1284
|
*/
|
|
979
1285
|
name?: string;
|
|
1286
|
+
/**
|
|
1287
|
+
* A group we want to move the model to.
|
|
1288
|
+
*/
|
|
1289
|
+
group?: string;
|
|
980
1290
|
/**
|
|
981
1291
|
* A new description of the content model.
|
|
982
1292
|
*/
|
|
983
|
-
description?: string;
|
|
1293
|
+
description?: string | null;
|
|
984
1294
|
/**
|
|
985
1295
|
* A list of content model fields to define the entry values.
|
|
986
1296
|
*/
|
|
@@ -1027,16 +1337,25 @@ export interface ModelManagerPlugin extends Plugin {
|
|
|
1027
1337
|
*/
|
|
1028
1338
|
create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;
|
|
1029
1339
|
}
|
|
1340
|
+
/**
|
|
1341
|
+
* A content entry values definition for and from the database.
|
|
1342
|
+
*
|
|
1343
|
+
* @category Database model
|
|
1344
|
+
* @category CmsEntry
|
|
1345
|
+
*/
|
|
1346
|
+
export interface CmsEntryValues {
|
|
1347
|
+
[key: string]: any;
|
|
1348
|
+
}
|
|
1030
1349
|
/**
|
|
1031
1350
|
* A content entry definition for and from the database.
|
|
1032
1351
|
*
|
|
1033
1352
|
* @category Database model
|
|
1034
1353
|
* @category CmsEntry
|
|
1035
1354
|
*/
|
|
1036
|
-
export interface CmsEntry {
|
|
1355
|
+
export interface CmsEntry<T = CmsEntryValues> {
|
|
1037
1356
|
/**
|
|
1038
1357
|
* A version of the webiny this entry was created with.
|
|
1039
|
-
* This can be used when upgrading the system so we know which entries to update.
|
|
1358
|
+
* This can be used when upgrading the system, so we know which entries to update.
|
|
1040
1359
|
*/
|
|
1041
1360
|
webinyVersion: string;
|
|
1042
1361
|
/**
|
|
@@ -1098,11 +1417,22 @@ export interface CmsEntry {
|
|
|
1098
1417
|
*/
|
|
1099
1418
|
status: CmsEntryStatus;
|
|
1100
1419
|
/**
|
|
1101
|
-
* A mapped
|
|
1420
|
+
* A mapped storageId -> value object.
|
|
1102
1421
|
*
|
|
1103
1422
|
* @see CmsModelField
|
|
1104
1423
|
*/
|
|
1105
|
-
values:
|
|
1424
|
+
values: T;
|
|
1425
|
+
/**
|
|
1426
|
+
* Settings for the given entry.
|
|
1427
|
+
*
|
|
1428
|
+
* Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.
|
|
1429
|
+
* Be aware that when accessing properties in it on old systems, it will break if not checked first.
|
|
1430
|
+
*
|
|
1431
|
+
* Available only on the Manage API in entry GraphQL type `meta.data` property.
|
|
1432
|
+
*/
|
|
1433
|
+
meta?: {
|
|
1434
|
+
[key: string]: any;
|
|
1435
|
+
};
|
|
1106
1436
|
}
|
|
1107
1437
|
export interface CmsStorageEntry extends CmsEntry {
|
|
1108
1438
|
[key: string]: any;
|
|
@@ -1118,24 +1448,20 @@ export interface CmsStorageEntry extends CmsEntry {
|
|
|
1118
1448
|
* @category CmsModel
|
|
1119
1449
|
*/
|
|
1120
1450
|
export interface CmsModelManager {
|
|
1121
|
-
/**
|
|
1122
|
-
* List entries in this content model.
|
|
1123
|
-
*/
|
|
1124
|
-
list: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1125
1451
|
/**
|
|
1126
1452
|
* List only published entries in the content model.
|
|
1127
1453
|
*/
|
|
1128
|
-
listPublished: (params
|
|
1454
|
+
listPublished: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1129
1455
|
/**
|
|
1130
1456
|
* List latest entries in the content model. Used for administration.
|
|
1131
1457
|
*/
|
|
1132
|
-
listLatest: (params
|
|
1458
|
+
listLatest: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1133
1459
|
/**
|
|
1134
1460
|
* Get a list of published entries by the ID list.
|
|
1135
1461
|
*/
|
|
1136
1462
|
getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
|
|
1137
1463
|
/**
|
|
1138
|
-
* Get a list of latest entries by the ID list.
|
|
1464
|
+
* Get a list of the latest entries by the ID list.
|
|
1139
1465
|
*/
|
|
1140
1466
|
getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
|
|
1141
1467
|
/**
|
|
@@ -1143,42 +1469,95 @@ export interface CmsModelManager {
|
|
|
1143
1469
|
*/
|
|
1144
1470
|
get: (id: string) => Promise<CmsEntry>;
|
|
1145
1471
|
/**
|
|
1146
|
-
* Create
|
|
1472
|
+
* Create an entry.
|
|
1147
1473
|
*/
|
|
1148
|
-
create: (data:
|
|
1474
|
+
create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1149
1475
|
/**
|
|
1150
|
-
* Update
|
|
1476
|
+
* Update an entry.
|
|
1151
1477
|
*/
|
|
1152
|
-
update: (id: string, data:
|
|
1478
|
+
update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1153
1479
|
/**
|
|
1154
|
-
* Delete
|
|
1480
|
+
* Delete an entry.
|
|
1155
1481
|
*/
|
|
1156
1482
|
delete: (id: string) => Promise<void>;
|
|
1157
1483
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1484
|
+
/**
|
|
1485
|
+
* Create
|
|
1486
|
+
*/
|
|
1487
|
+
export interface OnModelBeforeCreateTopicParams {
|
|
1488
|
+
input: CmsModelCreateInput;
|
|
1489
|
+
model: CmsModel;
|
|
1490
|
+
}
|
|
1491
|
+
export interface OnModelAfterCreateTopicParams {
|
|
1492
|
+
input: CmsModelCreateInput;
|
|
1493
|
+
model: CmsModel;
|
|
1494
|
+
}
|
|
1495
|
+
export interface OnModelCreateErrorTopicParams {
|
|
1496
|
+
input: CmsModelCreateInput;
|
|
1497
|
+
model: CmsModel;
|
|
1498
|
+
error: Error;
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* Create From / Clone
|
|
1502
|
+
*/
|
|
1503
|
+
export interface OnModelBeforeCreateFromTopicParams {
|
|
1504
|
+
input: CmsModelCreateInput;
|
|
1505
|
+
original: CmsModel;
|
|
1506
|
+
model: CmsModel;
|
|
1507
|
+
}
|
|
1508
|
+
export interface OnModelAfterCreateFromTopicParams {
|
|
1509
|
+
input: CmsModelCreateInput;
|
|
1510
|
+
original: CmsModel;
|
|
1511
|
+
model: CmsModel;
|
|
1512
|
+
}
|
|
1513
|
+
export interface OnModelCreateFromErrorParams {
|
|
1514
|
+
input: CmsModelCreateInput;
|
|
1515
|
+
original: CmsModel;
|
|
1160
1516
|
model: CmsModel;
|
|
1517
|
+
error: Error;
|
|
1161
1518
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1519
|
+
/**
|
|
1520
|
+
* Update
|
|
1521
|
+
*/
|
|
1522
|
+
export interface OnModelBeforeUpdateTopicParams {
|
|
1523
|
+
input: CmsModelUpdateInput;
|
|
1524
|
+
original: CmsModel;
|
|
1164
1525
|
model: CmsModel;
|
|
1165
1526
|
}
|
|
1166
|
-
export interface
|
|
1167
|
-
input:
|
|
1527
|
+
export interface OnModelAfterUpdateTopicParams {
|
|
1528
|
+
input: CmsModelUpdateInput;
|
|
1168
1529
|
original: CmsModel;
|
|
1169
1530
|
model: CmsModel;
|
|
1170
1531
|
}
|
|
1171
|
-
export interface
|
|
1172
|
-
input:
|
|
1532
|
+
export interface OnModelUpdateErrorTopicParams {
|
|
1533
|
+
input: CmsModelUpdateInput;
|
|
1173
1534
|
original: CmsModel;
|
|
1174
1535
|
model: CmsModel;
|
|
1536
|
+
error: Error;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Delete
|
|
1540
|
+
*/
|
|
1541
|
+
export interface OnModelBeforeDeleteTopicParams {
|
|
1542
|
+
model: CmsModel;
|
|
1175
1543
|
}
|
|
1176
|
-
export interface
|
|
1544
|
+
export interface OnModelAfterDeleteTopicParams {
|
|
1177
1545
|
model: CmsModel;
|
|
1178
1546
|
}
|
|
1179
|
-
export interface
|
|
1547
|
+
export interface OnModelDeleteErrorTopicParams {
|
|
1180
1548
|
model: CmsModel;
|
|
1549
|
+
error: Error;
|
|
1181
1550
|
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Initialize
|
|
1553
|
+
*/
|
|
1554
|
+
export interface OnModelInitializeParams {
|
|
1555
|
+
model: CmsModel;
|
|
1556
|
+
data: Record<string, any>;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
*
|
|
1560
|
+
*/
|
|
1182
1561
|
export interface CmsModelUpdateDirectParams {
|
|
1183
1562
|
model: CmsModel;
|
|
1184
1563
|
original: CmsModel;
|
|
@@ -1190,15 +1569,6 @@ export interface CmsModelUpdateDirectParams {
|
|
|
1190
1569
|
* @category CmsModel
|
|
1191
1570
|
*/
|
|
1192
1571
|
export interface CmsModelContext {
|
|
1193
|
-
/**
|
|
1194
|
-
* A function defining usage of a method with authenticating the user but not throwing an error.
|
|
1195
|
-
*/
|
|
1196
|
-
silentAuthModel: () => {
|
|
1197
|
-
/**
|
|
1198
|
-
* Get all content models.
|
|
1199
|
-
*/
|
|
1200
|
-
list: () => Promise<CmsModel[]>;
|
|
1201
|
-
};
|
|
1202
1572
|
/**
|
|
1203
1573
|
* Get a single content model.
|
|
1204
1574
|
*/
|
|
@@ -1211,12 +1581,12 @@ export interface CmsModelContext {
|
|
|
1211
1581
|
* Create a content model.
|
|
1212
1582
|
*/
|
|
1213
1583
|
createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;
|
|
1584
|
+
/**
|
|
1585
|
+
* Create a content model from the given model - clone.
|
|
1586
|
+
*/
|
|
1587
|
+
createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;
|
|
1214
1588
|
/**
|
|
1215
1589
|
* Update content model without data validation. Used internally.
|
|
1216
|
-
*
|
|
1217
|
-
* @param model - existing content model
|
|
1218
|
-
* @param data - data to be updated
|
|
1219
|
-
*
|
|
1220
1590
|
* @hidden
|
|
1221
1591
|
*/
|
|
1222
1592
|
updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;
|
|
@@ -1229,32 +1599,100 @@ export interface CmsModelContext {
|
|
|
1229
1599
|
*/
|
|
1230
1600
|
deleteModel: (modelId: string) => Promise<void>;
|
|
1231
1601
|
/**
|
|
1232
|
-
*
|
|
1602
|
+
* Possibility for users to trigger the model initialization.
|
|
1603
|
+
* They can hook into it and do what ever they want to.
|
|
1604
|
+
*
|
|
1605
|
+
* Primary idea behind this is creating the index, for the code models, in the ES.
|
|
1606
|
+
*/
|
|
1607
|
+
initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;
|
|
1608
|
+
/**
|
|
1609
|
+
* Get an instance of CmsModelManager for given content modelId.
|
|
1233
1610
|
*
|
|
1234
1611
|
* @see CmsModelManager
|
|
1612
|
+
*
|
|
1613
|
+
* @deprecated use the getEntryManager() method instead
|
|
1235
1614
|
*/
|
|
1236
|
-
getModelManager: (
|
|
1615
|
+
getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
|
|
1616
|
+
getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;
|
|
1237
1617
|
/**
|
|
1238
1618
|
* Get all content model managers mapped by modelId.
|
|
1239
1619
|
* @see CmsModelManager
|
|
1620
|
+
* @deprecated use getEntryManagers instead
|
|
1240
1621
|
*/
|
|
1241
1622
|
getManagers: () => Map<string, CmsModelManager>;
|
|
1623
|
+
getEntryManagers: () => Map<string, CmsModelManager>;
|
|
1624
|
+
/**
|
|
1625
|
+
* Clear all the model caches.
|
|
1626
|
+
*/
|
|
1627
|
+
clearModelsCache: () => void;
|
|
1628
|
+
/**
|
|
1629
|
+
* Lifecycle events - deprecated.
|
|
1630
|
+
*/
|
|
1631
|
+
/**
|
|
1632
|
+
* @deprecated
|
|
1633
|
+
*/
|
|
1634
|
+
onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;
|
|
1635
|
+
/**
|
|
1636
|
+
* @deprecated
|
|
1637
|
+
*/
|
|
1638
|
+
onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;
|
|
1639
|
+
/**
|
|
1640
|
+
* @deprecated
|
|
1641
|
+
*/
|
|
1642
|
+
onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
|
|
1643
|
+
/**
|
|
1644
|
+
* @deprecated
|
|
1645
|
+
*/
|
|
1646
|
+
onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
|
|
1647
|
+
/**
|
|
1648
|
+
* @deprecated
|
|
1649
|
+
*/
|
|
1650
|
+
onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;
|
|
1651
|
+
/**
|
|
1652
|
+
* @deprecated
|
|
1653
|
+
*/
|
|
1654
|
+
onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;
|
|
1655
|
+
/**
|
|
1656
|
+
* @deprecated
|
|
1657
|
+
*/
|
|
1658
|
+
onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;
|
|
1242
1659
|
/**
|
|
1243
|
-
*
|
|
1660
|
+
* @deprecated
|
|
1244
1661
|
*/
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1662
|
+
onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;
|
|
1663
|
+
/**
|
|
1664
|
+
* Lifecycle events - released in 5.33.0
|
|
1665
|
+
*/
|
|
1666
|
+
onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
|
|
1667
|
+
onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
|
|
1668
|
+
onModelCreateError: Topic<OnModelCreateErrorTopicParams>;
|
|
1669
|
+
onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
|
|
1670
|
+
onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
|
|
1671
|
+
onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;
|
|
1672
|
+
onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
|
|
1673
|
+
onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
|
|
1674
|
+
onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;
|
|
1675
|
+
onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
|
|
1676
|
+
onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
|
|
1677
|
+
onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;
|
|
1678
|
+
onModelInitialize: Topic<OnModelInitializeParams>;
|
|
1251
1679
|
}
|
|
1252
1680
|
/**
|
|
1253
1681
|
* Available statuses for content entry.
|
|
1254
1682
|
*
|
|
1255
1683
|
* @category CmsEntry
|
|
1256
1684
|
*/
|
|
1257
|
-
declare type CmsEntryStatus = "published" | "unpublished" | "
|
|
1685
|
+
export declare type CmsEntryStatus = "published" | "unpublished" | "draft";
|
|
1686
|
+
export interface CmsEntryListWhereRef {
|
|
1687
|
+
id?: string;
|
|
1688
|
+
id_in?: string[];
|
|
1689
|
+
id_not?: string;
|
|
1690
|
+
id_not_in?: string[];
|
|
1691
|
+
entryId?: string;
|
|
1692
|
+
entryId_not?: string;
|
|
1693
|
+
entryId_in?: string[];
|
|
1694
|
+
entryId_not_in?: string[];
|
|
1695
|
+
}
|
|
1258
1696
|
/**
|
|
1259
1697
|
* Entry listing where params.
|
|
1260
1698
|
*
|
|
@@ -1277,7 +1715,9 @@ export interface CmsEntryListWhere {
|
|
|
1277
1715
|
entryId_in?: string[];
|
|
1278
1716
|
entryId_not_in?: string[];
|
|
1279
1717
|
/**
|
|
1280
|
-
*
|
|
1718
|
+
* Contains the owner of the entry. An "owner" is the identity who originally created the entry.
|
|
1719
|
+
* Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,
|
|
1720
|
+
* but the `owner` is always the original author of the entry.
|
|
1281
1721
|
*
|
|
1282
1722
|
* Can be sent via the API or set internal if user can see only their own entries.
|
|
1283
1723
|
*/
|
|
@@ -1302,22 +1742,30 @@ export interface CmsEntryListWhere {
|
|
|
1302
1742
|
version_lt?: number;
|
|
1303
1743
|
version_gt?: number;
|
|
1304
1744
|
/**
|
|
1305
|
-
* Each operations implementation MUST determine how to use this field.
|
|
1306
|
-
* In SQL it can be published field and in DynamoDB can be
|
|
1745
|
+
* Each storage operations implementation MUST determine how to use this field.
|
|
1746
|
+
* In SQL, it can be a `published` field, and in DynamoDB it can be an SK.
|
|
1307
1747
|
*
|
|
1308
1748
|
* It is not meant to be used via the API.
|
|
1309
1749
|
* @internal
|
|
1310
1750
|
*/
|
|
1311
1751
|
published?: boolean;
|
|
1312
1752
|
/**
|
|
1313
|
-
* Each operations implementation MUST determine how to use this field.
|
|
1314
|
-
* In SQL it can be
|
|
1753
|
+
* Each storage operations implementation MUST determine how to use this field.
|
|
1754
|
+
* In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.
|
|
1315
1755
|
*
|
|
1316
1756
|
* It is not meant to be used via the API.
|
|
1317
1757
|
* @internal
|
|
1318
1758
|
*/
|
|
1319
1759
|
latest?: boolean;
|
|
1320
|
-
|
|
1760
|
+
/**
|
|
1761
|
+
* This is to allow querying by any content model field defined by the user.
|
|
1762
|
+
*/
|
|
1763
|
+
[key: string]: string | number | boolean | undefined | string[] | number[] | null | CmsEntryListWhere[] | CmsEntryListWhere | CmsEntryListWhereRef;
|
|
1764
|
+
/**
|
|
1765
|
+
* To allow querying via nested queries, we added the AND / OR properties.
|
|
1766
|
+
*/
|
|
1767
|
+
AND?: CmsEntryListWhere[];
|
|
1768
|
+
OR?: CmsEntryListWhere[];
|
|
1321
1769
|
}
|
|
1322
1770
|
/**
|
|
1323
1771
|
* Entry listing sort.
|
|
@@ -1343,10 +1791,12 @@ export interface CmsEntryGetParams {
|
|
|
1343
1791
|
* @category GraphQL params
|
|
1344
1792
|
*/
|
|
1345
1793
|
export interface CmsEntryListParams {
|
|
1346
|
-
where
|
|
1794
|
+
where?: CmsEntryListWhere;
|
|
1347
1795
|
sort?: CmsEntryListSort;
|
|
1796
|
+
search?: string;
|
|
1797
|
+
fields?: string[];
|
|
1348
1798
|
limit?: number;
|
|
1349
|
-
after?: string;
|
|
1799
|
+
after?: string | null;
|
|
1350
1800
|
}
|
|
1351
1801
|
/**
|
|
1352
1802
|
* Meta information for GraphQL output.
|
|
@@ -1358,7 +1808,7 @@ export interface CmsEntryMeta {
|
|
|
1358
1808
|
/**
|
|
1359
1809
|
* A cursor for pagination.
|
|
1360
1810
|
*/
|
|
1361
|
-
cursor: string;
|
|
1811
|
+
cursor: string | null;
|
|
1362
1812
|
/**
|
|
1363
1813
|
* Is there more items to load?
|
|
1364
1814
|
*/
|
|
@@ -1368,98 +1818,177 @@ export interface CmsEntryMeta {
|
|
|
1368
1818
|
*/
|
|
1369
1819
|
totalCount: number;
|
|
1370
1820
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1821
|
+
/**
|
|
1822
|
+
* Create
|
|
1823
|
+
*/
|
|
1824
|
+
export interface OnEntryBeforeCreateTopicParams {
|
|
1825
|
+
input: CreateCmsEntryInput;
|
|
1373
1826
|
entry: CmsEntry;
|
|
1374
|
-
model:
|
|
1827
|
+
model: StorageOperationsCmsModel;
|
|
1375
1828
|
}
|
|
1376
|
-
export interface
|
|
1377
|
-
input:
|
|
1829
|
+
export interface OnEntryAfterCreateTopicParams {
|
|
1830
|
+
input: CreateCmsEntryInput;
|
|
1378
1831
|
entry: CmsEntry;
|
|
1379
|
-
model:
|
|
1832
|
+
model: StorageOperationsCmsModel;
|
|
1380
1833
|
storageEntry: CmsEntry;
|
|
1381
1834
|
}
|
|
1382
|
-
export interface
|
|
1835
|
+
export interface OnEntryCreateErrorTopicParams {
|
|
1836
|
+
error: Error;
|
|
1837
|
+
input: CreateCmsEntryInput;
|
|
1383
1838
|
entry: CmsEntry;
|
|
1384
1839
|
model: CmsModel;
|
|
1385
1840
|
}
|
|
1386
|
-
|
|
1841
|
+
/**
|
|
1842
|
+
* Revision Create
|
|
1843
|
+
*/
|
|
1844
|
+
export interface OnEntryRevisionBeforeCreateTopicParams {
|
|
1845
|
+
input: CreateFromCmsEntryInput;
|
|
1387
1846
|
entry: CmsEntry;
|
|
1388
|
-
|
|
1847
|
+
original: CmsEntry;
|
|
1848
|
+
model: StorageOperationsCmsModel;
|
|
1849
|
+
}
|
|
1850
|
+
export interface OnEntryRevisionAfterCreateTopicParams {
|
|
1851
|
+
input: CreateFromCmsEntryInput;
|
|
1852
|
+
entry: CmsEntry;
|
|
1853
|
+
original: CmsEntry;
|
|
1854
|
+
model: StorageOperationsCmsModel;
|
|
1389
1855
|
storageEntry: CmsEntry;
|
|
1390
1856
|
}
|
|
1391
|
-
export interface
|
|
1392
|
-
|
|
1857
|
+
export interface OnEntryCreateRevisionErrorTopicParams {
|
|
1858
|
+
error: Error;
|
|
1859
|
+
input: CreateFromCmsEntryInput;
|
|
1393
1860
|
original: CmsEntry;
|
|
1394
1861
|
entry: CmsEntry;
|
|
1395
1862
|
model: CmsModel;
|
|
1396
1863
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1864
|
+
/**
|
|
1865
|
+
* Update
|
|
1866
|
+
*/
|
|
1867
|
+
export interface OnEntryBeforeUpdateTopicParams {
|
|
1868
|
+
input: UpdateCmsEntryInput;
|
|
1399
1869
|
original: CmsEntry;
|
|
1400
1870
|
entry: CmsEntry;
|
|
1401
|
-
model:
|
|
1871
|
+
model: StorageOperationsCmsModel;
|
|
1872
|
+
}
|
|
1873
|
+
export interface OnEntryAfterUpdateTopicParams {
|
|
1874
|
+
input: UpdateCmsEntryInput;
|
|
1875
|
+
original: CmsEntry;
|
|
1876
|
+
entry: CmsEntry;
|
|
1877
|
+
model: StorageOperationsCmsModel;
|
|
1402
1878
|
storageEntry: CmsEntry;
|
|
1403
1879
|
}
|
|
1404
|
-
export interface
|
|
1880
|
+
export interface OnEntryUpdateErrorTopicParams {
|
|
1881
|
+
error: Error;
|
|
1882
|
+
input: CreateFromCmsEntryInput;
|
|
1405
1883
|
entry: CmsEntry;
|
|
1406
1884
|
model: CmsModel;
|
|
1407
1885
|
}
|
|
1408
|
-
|
|
1886
|
+
/**
|
|
1887
|
+
* Publish
|
|
1888
|
+
*/
|
|
1889
|
+
export interface OnEntryBeforePublishTopicParams {
|
|
1409
1890
|
entry: CmsEntry;
|
|
1410
|
-
model:
|
|
1891
|
+
model: StorageOperationsCmsModel;
|
|
1892
|
+
}
|
|
1893
|
+
export interface OnEntryAfterPublishTopicParams {
|
|
1894
|
+
entry: CmsEntry;
|
|
1895
|
+
model: StorageOperationsCmsModel;
|
|
1411
1896
|
storageEntry: CmsEntry;
|
|
1412
1897
|
}
|
|
1413
|
-
export interface
|
|
1898
|
+
export interface OnEntryPublishErrorTopicParams {
|
|
1899
|
+
error: Error;
|
|
1414
1900
|
entry: CmsEntry;
|
|
1415
|
-
model:
|
|
1901
|
+
model: StorageOperationsCmsModel;
|
|
1902
|
+
}
|
|
1903
|
+
/**
|
|
1904
|
+
* Republish
|
|
1905
|
+
*/
|
|
1906
|
+
export interface OnEntryBeforeRepublishTopicParams {
|
|
1907
|
+
entry: CmsEntry;
|
|
1908
|
+
model: StorageOperationsCmsModel;
|
|
1416
1909
|
}
|
|
1417
|
-
export interface
|
|
1910
|
+
export interface OnEntryAfterRepublishTopicParams {
|
|
1418
1911
|
entry: CmsEntry;
|
|
1419
|
-
model:
|
|
1912
|
+
model: StorageOperationsCmsModel;
|
|
1420
1913
|
storageEntry: CmsEntry;
|
|
1421
1914
|
}
|
|
1422
|
-
export interface
|
|
1915
|
+
export interface OnEntryRepublishErrorTopicParams {
|
|
1916
|
+
error: Error;
|
|
1423
1917
|
entry: CmsEntry;
|
|
1424
|
-
model:
|
|
1918
|
+
model: StorageOperationsCmsModel;
|
|
1425
1919
|
}
|
|
1426
|
-
|
|
1920
|
+
/**
|
|
1921
|
+
* Unpublish
|
|
1922
|
+
*/
|
|
1923
|
+
export interface OnEntryBeforeUnpublishTopicParams {
|
|
1427
1924
|
entry: CmsEntry;
|
|
1428
|
-
model:
|
|
1925
|
+
model: StorageOperationsCmsModel;
|
|
1926
|
+
}
|
|
1927
|
+
export interface OnEntryAfterUnpublishTopicParams {
|
|
1928
|
+
entry: CmsEntry;
|
|
1929
|
+
model: StorageOperationsCmsModel;
|
|
1429
1930
|
storageEntry: CmsEntry;
|
|
1430
1931
|
}
|
|
1431
|
-
export interface
|
|
1932
|
+
export interface OnEntryUnpublishErrorTopicParams {
|
|
1933
|
+
error: Error;
|
|
1432
1934
|
entry: CmsEntry;
|
|
1433
1935
|
model: CmsModel;
|
|
1434
1936
|
}
|
|
1435
|
-
export interface
|
|
1937
|
+
export interface OnEntryBeforeDeleteTopicParams {
|
|
1436
1938
|
entry: CmsEntry;
|
|
1437
|
-
model:
|
|
1438
|
-
storageEntry: CmsEntry;
|
|
1939
|
+
model: StorageOperationsCmsModel;
|
|
1439
1940
|
}
|
|
1440
|
-
export interface
|
|
1941
|
+
export interface OnEntryAfterDeleteTopicParams {
|
|
1441
1942
|
entry: CmsEntry;
|
|
1442
|
-
model:
|
|
1943
|
+
model: StorageOperationsCmsModel;
|
|
1443
1944
|
}
|
|
1444
|
-
export interface
|
|
1945
|
+
export interface OnEntryDeleteErrorTopicParams {
|
|
1946
|
+
error: Error;
|
|
1445
1947
|
entry: CmsEntry;
|
|
1446
|
-
model:
|
|
1948
|
+
model: StorageOperationsCmsModel;
|
|
1447
1949
|
}
|
|
1448
|
-
export interface
|
|
1950
|
+
export interface OnEntryRevisionBeforeDeleteTopicParams {
|
|
1449
1951
|
entry: CmsEntry;
|
|
1450
|
-
model:
|
|
1952
|
+
model: StorageOperationsCmsModel;
|
|
1451
1953
|
}
|
|
1452
|
-
export interface
|
|
1954
|
+
export interface OnEntryRevisionAfterDeleteTopicParams {
|
|
1453
1955
|
entry: CmsEntry;
|
|
1454
|
-
model:
|
|
1956
|
+
model: StorageOperationsCmsModel;
|
|
1455
1957
|
}
|
|
1456
|
-
export interface
|
|
1457
|
-
|
|
1958
|
+
export interface OnEntryRevisionDeleteErrorTopicParams {
|
|
1959
|
+
error: Error;
|
|
1960
|
+
entry: CmsEntry;
|
|
1961
|
+
model: StorageOperationsCmsModel;
|
|
1962
|
+
}
|
|
1963
|
+
export interface OnEntryBeforeGetTopicParams {
|
|
1964
|
+
model: StorageOperationsCmsModel;
|
|
1458
1965
|
where: CmsEntryListWhere;
|
|
1459
1966
|
}
|
|
1460
|
-
export interface
|
|
1967
|
+
export interface EntryBeforeListTopicParams {
|
|
1461
1968
|
where: CmsEntryListWhere;
|
|
1462
|
-
model:
|
|
1969
|
+
model: StorageOperationsCmsModel;
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* @category Context
|
|
1973
|
+
* @category CmsEntry
|
|
1974
|
+
*/
|
|
1975
|
+
export interface CreateCmsEntryInput {
|
|
1976
|
+
id?: string;
|
|
1977
|
+
[key: string]: any;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* @category Context
|
|
1981
|
+
* @category CmsEntry
|
|
1982
|
+
*/
|
|
1983
|
+
export interface CreateFromCmsEntryInput {
|
|
1984
|
+
[key: string]: any;
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* @category Context
|
|
1988
|
+
* @category CmsEntry
|
|
1989
|
+
*/
|
|
1990
|
+
export interface UpdateCmsEntryInput {
|
|
1991
|
+
[key: string]: any;
|
|
1463
1992
|
}
|
|
1464
1993
|
/**
|
|
1465
1994
|
* Cms Entry CRUD methods in the context.
|
|
@@ -1475,7 +2004,7 @@ export interface CmsEntryContext {
|
|
|
1475
2004
|
/**
|
|
1476
2005
|
* Get a list of entries for a model by a given ID (revision).
|
|
1477
2006
|
*/
|
|
1478
|
-
getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]
|
|
2007
|
+
getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;
|
|
1479
2008
|
/**
|
|
1480
2009
|
* Get the entry for a model by a given ID.
|
|
1481
2010
|
*/
|
|
@@ -1483,9 +2012,9 @@ export interface CmsEntryContext {
|
|
|
1483
2012
|
/**
|
|
1484
2013
|
* List entries for a model. Internal method used by get, listLatest and listPublished.
|
|
1485
2014
|
*/
|
|
1486
|
-
listEntries: (model: CmsModel, params
|
|
2015
|
+
listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1487
2016
|
/**
|
|
1488
|
-
* Lists latest entries. Used for manage API.
|
|
2017
|
+
* Lists the latest entries. Used for manage API.
|
|
1489
2018
|
*/
|
|
1490
2019
|
listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1491
2020
|
/**
|
|
@@ -1503,15 +2032,20 @@ export interface CmsEntryContext {
|
|
|
1503
2032
|
/**
|
|
1504
2033
|
* Create a new content entry.
|
|
1505
2034
|
*/
|
|
1506
|
-
createEntry: (model: CmsModel,
|
|
2035
|
+
createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1507
2036
|
/**
|
|
1508
2037
|
* Create a new entry from already existing entry.
|
|
1509
2038
|
*/
|
|
1510
|
-
createEntryRevisionFrom: (model: CmsModel, id: string,
|
|
2039
|
+
createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
|
|
1511
2040
|
/**
|
|
1512
2041
|
* Update existing entry.
|
|
1513
2042
|
*/
|
|
1514
|
-
updateEntry: (model: CmsModel, id: string,
|
|
2043
|
+
updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
|
|
2044
|
+
/**
|
|
2045
|
+
* Method that republishes entry with given identifier.
|
|
2046
|
+
* @internal
|
|
2047
|
+
*/
|
|
2048
|
+
republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
1515
2049
|
/**
|
|
1516
2050
|
* Delete only a certain revision of the entry.
|
|
1517
2051
|
*/
|
|
@@ -1529,40 +2063,105 @@ export interface CmsEntryContext {
|
|
|
1529
2063
|
*/
|
|
1530
2064
|
unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
1531
2065
|
/**
|
|
1532
|
-
*
|
|
2066
|
+
* Get all entry revisions.
|
|
1533
2067
|
*/
|
|
1534
|
-
|
|
2068
|
+
getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
|
|
1535
2069
|
/**
|
|
1536
|
-
*
|
|
2070
|
+
* Lifecyle events - deprecated.
|
|
1537
2071
|
*/
|
|
1538
|
-
requestEntryChanges: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
1539
2072
|
/**
|
|
1540
|
-
*
|
|
2073
|
+
* @deprecated
|
|
1541
2074
|
*/
|
|
1542
|
-
|
|
2075
|
+
onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;
|
|
2076
|
+
/**
|
|
2077
|
+
* @deprecated
|
|
2078
|
+
*/
|
|
2079
|
+
onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;
|
|
2080
|
+
/**
|
|
2081
|
+
* @deprecated
|
|
2082
|
+
*/
|
|
2083
|
+
onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;
|
|
2084
|
+
/**
|
|
2085
|
+
* @deprecated
|
|
2086
|
+
*/
|
|
2087
|
+
onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;
|
|
2088
|
+
/**
|
|
2089
|
+
* @deprecated
|
|
2090
|
+
*/
|
|
2091
|
+
onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
|
|
2092
|
+
/**
|
|
2093
|
+
* @deprecated
|
|
2094
|
+
*/
|
|
2095
|
+
onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;
|
|
2096
|
+
/**
|
|
2097
|
+
* @deprecated
|
|
2098
|
+
*/
|
|
2099
|
+
onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;
|
|
1543
2100
|
/**
|
|
1544
|
-
*
|
|
1545
|
-
*/
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
2101
|
+
* @deprecated
|
|
2102
|
+
*/
|
|
2103
|
+
onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;
|
|
2104
|
+
/**
|
|
2105
|
+
* @deprecated
|
|
2106
|
+
*/
|
|
2107
|
+
onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
|
|
2108
|
+
/**
|
|
2109
|
+
* @deprecated
|
|
2110
|
+
*/
|
|
2111
|
+
onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;
|
|
2112
|
+
/**
|
|
2113
|
+
* @deprecated
|
|
2114
|
+
*/
|
|
2115
|
+
onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;
|
|
2116
|
+
/**
|
|
2117
|
+
* @deprecated
|
|
2118
|
+
*/
|
|
2119
|
+
onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;
|
|
2120
|
+
/**
|
|
2121
|
+
* @deprecated
|
|
2122
|
+
*/
|
|
2123
|
+
onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
|
|
2124
|
+
/**
|
|
2125
|
+
* @deprecated
|
|
2126
|
+
*/
|
|
2127
|
+
onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
|
|
2128
|
+
/**
|
|
2129
|
+
* @deprecated
|
|
2130
|
+
*/
|
|
2131
|
+
onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;
|
|
2132
|
+
/**
|
|
2133
|
+
* @deprecated
|
|
2134
|
+
*/
|
|
2135
|
+
onBeforeEntryList: Topic<EntryBeforeListTopicParams>;
|
|
2136
|
+
/**
|
|
2137
|
+
* Lifecycle events released in 5.33.0
|
|
2138
|
+
*/
|
|
2139
|
+
onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;
|
|
2140
|
+
onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;
|
|
2141
|
+
onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;
|
|
2142
|
+
onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;
|
|
2143
|
+
onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;
|
|
2144
|
+
onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;
|
|
2145
|
+
onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
|
|
2146
|
+
onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;
|
|
2147
|
+
onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;
|
|
2148
|
+
onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;
|
|
2149
|
+
onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;
|
|
2150
|
+
onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;
|
|
2151
|
+
onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
|
|
2152
|
+
onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;
|
|
2153
|
+
onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;
|
|
2154
|
+
onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
|
|
2155
|
+
onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
|
|
2156
|
+
onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
|
|
2157
|
+
onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;
|
|
2158
|
+
onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;
|
|
2159
|
+
onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;
|
|
2160
|
+
onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
|
|
2161
|
+
onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
|
|
2162
|
+
onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
|
|
2163
|
+
onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;
|
|
2164
|
+
onEntryBeforeList: Topic<EntryBeforeListTopicParams>;
|
|
1566
2165
|
}
|
|
1567
2166
|
/**
|
|
1568
2167
|
* Parameters for CmsEntryResolverFactory.
|
|
@@ -1589,23 +2188,30 @@ export declare type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext
|
|
|
1589
2188
|
*/
|
|
1590
2189
|
export interface CmsSettingsPermission extends SecurityPermission {
|
|
1591
2190
|
}
|
|
2191
|
+
/**
|
|
2192
|
+
* A base security permission for CMS.
|
|
2193
|
+
*
|
|
2194
|
+
* @category SecurityPermission
|
|
2195
|
+
*/
|
|
2196
|
+
export interface BaseCmsSecurityPermission extends SecurityPermission {
|
|
2197
|
+
own?: boolean;
|
|
2198
|
+
rwd: string | number;
|
|
2199
|
+
}
|
|
1592
2200
|
/**
|
|
1593
2201
|
* A security permission for content model.
|
|
1594
2202
|
*
|
|
1595
2203
|
* @category SecurityPermission
|
|
1596
2204
|
* @category CmsModel
|
|
1597
2205
|
*/
|
|
1598
|
-
export interface CmsModelPermission extends
|
|
1599
|
-
own: boolean;
|
|
1600
|
-
rwd: string;
|
|
2206
|
+
export interface CmsModelPermission extends BaseCmsSecurityPermission {
|
|
1601
2207
|
/**
|
|
1602
|
-
*
|
|
2208
|
+
* An object representing `key: model.modelId` values where key is locale code.
|
|
1603
2209
|
*/
|
|
1604
2210
|
models?: {
|
|
1605
2211
|
[key: string]: string[];
|
|
1606
2212
|
};
|
|
1607
2213
|
/**
|
|
1608
|
-
*
|
|
2214
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
1609
2215
|
*/
|
|
1610
2216
|
groups?: {
|
|
1611
2217
|
[key: string]: string[];
|
|
@@ -1617,11 +2223,9 @@ export interface CmsModelPermission extends SecurityPermission {
|
|
|
1617
2223
|
* @category SecurityPermission
|
|
1618
2224
|
* @category CmsGroup
|
|
1619
2225
|
*/
|
|
1620
|
-
export interface CmsGroupPermission extends
|
|
1621
|
-
own: boolean;
|
|
1622
|
-
rwd: string;
|
|
2226
|
+
export interface CmsGroupPermission extends BaseCmsSecurityPermission {
|
|
1623
2227
|
/**
|
|
1624
|
-
*
|
|
2228
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
1625
2229
|
*/
|
|
1626
2230
|
groups?: {
|
|
1627
2231
|
[key: string]: string[];
|
|
@@ -1633,18 +2237,16 @@ export interface CmsGroupPermission extends SecurityPermission {
|
|
|
1633
2237
|
* @category SecurityPermission
|
|
1634
2238
|
* @category CmsEntry
|
|
1635
2239
|
*/
|
|
1636
|
-
export interface CmsEntryPermission extends
|
|
1637
|
-
|
|
1638
|
-
rwd: string;
|
|
1639
|
-
pw: string;
|
|
2240
|
+
export interface CmsEntryPermission extends BaseCmsSecurityPermission {
|
|
2241
|
+
pw?: string;
|
|
1640
2242
|
/**
|
|
1641
|
-
*
|
|
2243
|
+
* An object representing `key: model.modelId` values where key is locale code.
|
|
1642
2244
|
*/
|
|
1643
2245
|
models?: {
|
|
1644
2246
|
[key: string]: string[];
|
|
1645
2247
|
};
|
|
1646
2248
|
/**
|
|
1647
|
-
*
|
|
2249
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
1648
2250
|
*/
|
|
1649
2251
|
groups?: {
|
|
1650
2252
|
[key: string]: string[];
|
|
@@ -1665,13 +2267,10 @@ export interface CmsGroupStorageOperationsListParams {
|
|
|
1665
2267
|
sort?: string[];
|
|
1666
2268
|
}
|
|
1667
2269
|
export interface CmsGroupStorageOperationsCreateParams {
|
|
1668
|
-
input: CmsGroupCreateInput;
|
|
1669
2270
|
group: CmsGroup;
|
|
1670
2271
|
}
|
|
1671
2272
|
export interface CmsGroupStorageOperationsUpdateParams {
|
|
1672
|
-
original: CmsGroup;
|
|
1673
2273
|
group: CmsGroup;
|
|
1674
|
-
input: CmsGroupUpdateInput;
|
|
1675
2274
|
}
|
|
1676
2275
|
export interface CmsGroupStorageOperationsDeleteParams {
|
|
1677
2276
|
group: CmsGroup;
|
|
@@ -1717,13 +2316,10 @@ export interface CmsModelStorageOperationsListParams {
|
|
|
1717
2316
|
where: CmsModelStorageOperationsListWhereParams;
|
|
1718
2317
|
}
|
|
1719
2318
|
export interface CmsModelStorageOperationsCreateParams {
|
|
1720
|
-
input: CmsModelCreateInput;
|
|
1721
2319
|
model: CmsModel;
|
|
1722
2320
|
}
|
|
1723
2321
|
export interface CmsModelStorageOperationsUpdateParams {
|
|
1724
|
-
original: CmsModel;
|
|
1725
2322
|
model: CmsModel;
|
|
1726
|
-
input: CmsModelUpdateInput;
|
|
1727
2323
|
}
|
|
1728
2324
|
export interface CmsModelStorageOperationsDeleteParams {
|
|
1729
2325
|
model: CmsModel;
|
|
@@ -1763,14 +2359,12 @@ export interface CmsEntryStorageOperationsGetParams {
|
|
|
1763
2359
|
export interface CmsEntryStorageOperationsListParams {
|
|
1764
2360
|
where: CmsEntryListWhere;
|
|
1765
2361
|
sort?: CmsEntryListSort;
|
|
1766
|
-
|
|
1767
|
-
|
|
2362
|
+
search?: string;
|
|
2363
|
+
fields?: string[];
|
|
2364
|
+
limit: number;
|
|
2365
|
+
after?: string | null;
|
|
1768
2366
|
}
|
|
1769
2367
|
export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1770
|
-
/**
|
|
1771
|
-
* Input received from the user.
|
|
1772
|
-
*/
|
|
1773
|
-
input: Record<string, any>;
|
|
1774
2368
|
/**
|
|
1775
2369
|
* Real entry, with no transformations on it.
|
|
1776
2370
|
*/
|
|
@@ -1781,22 +2375,6 @@ export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry
|
|
|
1781
2375
|
storageEntry: T;
|
|
1782
2376
|
}
|
|
1783
2377
|
export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1784
|
-
/**
|
|
1785
|
-
* The entry we are creating new one from.
|
|
1786
|
-
*/
|
|
1787
|
-
originalEntry: CmsEntry;
|
|
1788
|
-
/**
|
|
1789
|
-
* The entry we are creating new one from, directly from storage, with transformations on it.
|
|
1790
|
-
*/
|
|
1791
|
-
originalStorageEntry: T;
|
|
1792
|
-
/**
|
|
1793
|
-
* Latest entry, used to calculate the new version.
|
|
1794
|
-
*/
|
|
1795
|
-
latestEntry: CmsEntry;
|
|
1796
|
-
/**
|
|
1797
|
-
* Latest entry, used to calculate the new version, directly from storage, with transformations.
|
|
1798
|
-
*/
|
|
1799
|
-
latestStorageEntry: T;
|
|
1800
2378
|
/**
|
|
1801
2379
|
* Real entry, with no transformations on it.
|
|
1802
2380
|
*/
|
|
@@ -1807,18 +2385,6 @@ export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends Cms
|
|
|
1807
2385
|
storageEntry: T;
|
|
1808
2386
|
}
|
|
1809
2387
|
export interface CmsEntryStorageOperationsUpdateParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1810
|
-
/**
|
|
1811
|
-
* Input received from the user.
|
|
1812
|
-
*/
|
|
1813
|
-
input: Record<string, any>;
|
|
1814
|
-
/**
|
|
1815
|
-
* Used to compare IDs, versions and passed into storage operations to be used if required.
|
|
1816
|
-
*/
|
|
1817
|
-
originalEntry: CmsEntry;
|
|
1818
|
-
/**
|
|
1819
|
-
* Directly from storage, with transformations on it.
|
|
1820
|
-
*/
|
|
1821
|
-
originalStorageEntry: T;
|
|
1822
2388
|
/**
|
|
1823
2389
|
* Real entry, with no transformations on it.
|
|
1824
2390
|
*/
|
|
@@ -1832,39 +2398,27 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
|
|
|
1832
2398
|
/**
|
|
1833
2399
|
* Entry that was deleted.
|
|
1834
2400
|
*/
|
|
1835
|
-
|
|
2401
|
+
entry: CmsEntry;
|
|
1836
2402
|
/**
|
|
1837
2403
|
* Entry that was deleted, directly from storage, with transformations.
|
|
1838
2404
|
*/
|
|
1839
|
-
|
|
2405
|
+
storageEntry: T;
|
|
1840
2406
|
/**
|
|
1841
2407
|
* Entry that was set as latest.
|
|
1842
2408
|
*/
|
|
1843
|
-
|
|
2409
|
+
latestEntry: CmsEntry | null;
|
|
1844
2410
|
/**
|
|
1845
2411
|
* Entry that was set as latest, directly from storage, with transformations.
|
|
1846
2412
|
*/
|
|
1847
|
-
|
|
2413
|
+
latestStorageEntry: T | null;
|
|
1848
2414
|
}
|
|
1849
|
-
export interface CmsEntryStorageOperationsDeleteParams
|
|
2415
|
+
export interface CmsEntryStorageOperationsDeleteParams {
|
|
1850
2416
|
/**
|
|
1851
2417
|
* Entry that is going to be deleted.
|
|
1852
2418
|
*/
|
|
1853
2419
|
entry: CmsEntry;
|
|
1854
|
-
/**
|
|
1855
|
-
* Entry that is going to be deleted, directly from storage.
|
|
1856
|
-
*/
|
|
1857
|
-
storageEntry: T;
|
|
1858
2420
|
}
|
|
1859
2421
|
export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1860
|
-
/**
|
|
1861
|
-
* The entry record before it was published.
|
|
1862
|
-
*/
|
|
1863
|
-
originalEntry: CmsEntry;
|
|
1864
|
-
/**
|
|
1865
|
-
* Directly from storage, with transformations on it.
|
|
1866
|
-
*/
|
|
1867
|
-
originalStorageEntry: T;
|
|
1868
2422
|
/**
|
|
1869
2423
|
* The modified entry that is going to be saved as published.
|
|
1870
2424
|
* Entry is in its original form.
|
|
@@ -1876,14 +2430,6 @@ export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntr
|
|
|
1876
2430
|
storageEntry: T;
|
|
1877
2431
|
}
|
|
1878
2432
|
export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1879
|
-
/**
|
|
1880
|
-
* The entry record before it was unpublished.
|
|
1881
|
-
*/
|
|
1882
|
-
originalEntry: CmsEntry;
|
|
1883
|
-
/**
|
|
1884
|
-
* The entry record before it was unpublished, with transformations on it.
|
|
1885
|
-
*/
|
|
1886
|
-
originalStorageEntry: T;
|
|
1887
2433
|
/**
|
|
1888
2434
|
* The modified entry that is going to be saved as unpublished.
|
|
1889
2435
|
*/
|
|
@@ -1893,45 +2439,6 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
|
|
|
1893
2439
|
*/
|
|
1894
2440
|
storageEntry: T;
|
|
1895
2441
|
}
|
|
1896
|
-
export interface CmsEntryStorageOperationsRequestChangesParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1897
|
-
/**
|
|
1898
|
-
* Entry data updated with the required properties.
|
|
1899
|
-
*/
|
|
1900
|
-
entry: CmsEntry;
|
|
1901
|
-
/**
|
|
1902
|
-
* Entry that is prepared for the storageOperations, with the transformations.
|
|
1903
|
-
*/
|
|
1904
|
-
storageEntry: T;
|
|
1905
|
-
/**
|
|
1906
|
-
* Original entry from the storage.
|
|
1907
|
-
*/
|
|
1908
|
-
originalEntry: CmsEntry;
|
|
1909
|
-
/**
|
|
1910
|
-
* Original entry to be updated, directly from storage, with the transformations.
|
|
1911
|
-
*/
|
|
1912
|
-
originalStorageEntry: T;
|
|
1913
|
-
}
|
|
1914
|
-
export interface CmsEntryStorageOperationsRequestReviewParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1915
|
-
/**
|
|
1916
|
-
* Entry that is prepared for the storageOperations.
|
|
1917
|
-
*/
|
|
1918
|
-
entry: CmsEntry;
|
|
1919
|
-
/**
|
|
1920
|
-
* Entry that is prepared for the storageOperations, with the transformations.
|
|
1921
|
-
*/
|
|
1922
|
-
storageEntry: T;
|
|
1923
|
-
/**
|
|
1924
|
-
* Original entry from the storage.
|
|
1925
|
-
*/
|
|
1926
|
-
originalEntry: CmsEntry;
|
|
1927
|
-
/**
|
|
1928
|
-
* Original entry to be updated, directly from storage, with the transformations.
|
|
1929
|
-
*/
|
|
1930
|
-
originalStorageEntry: T;
|
|
1931
|
-
}
|
|
1932
|
-
export interface CmsEntryStorageOperationsGetAllRevisionsParams {
|
|
1933
|
-
ids: readonly string[];
|
|
1934
|
-
}
|
|
1935
2442
|
export interface CmsEntryStorageOperationsGetByIdsParams {
|
|
1936
2443
|
ids: readonly string[];
|
|
1937
2444
|
}
|
|
@@ -1988,90 +2495,76 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
|
|
|
1988
2495
|
/**
|
|
1989
2496
|
* Get all the entries of the ids.
|
|
1990
2497
|
*/
|
|
1991
|
-
getByIds: (model:
|
|
2498
|
+
getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
|
|
1992
2499
|
/**
|
|
1993
2500
|
* Get all the published entries of the ids.
|
|
1994
2501
|
*/
|
|
1995
|
-
getPublishedByIds: (model:
|
|
2502
|
+
getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
|
|
1996
2503
|
/**
|
|
1997
2504
|
* Get all the latest entries of the ids.
|
|
1998
2505
|
*/
|
|
1999
|
-
getLatestByIds: (model:
|
|
2506
|
+
getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
|
|
2000
2507
|
/**
|
|
2001
2508
|
* Get all revisions of the given entry id.
|
|
2002
2509
|
*/
|
|
2003
|
-
getRevisions: (model:
|
|
2004
|
-
/**
|
|
2005
|
-
* Get all revisions of all of the given IDs.
|
|
2006
|
-
*/
|
|
2007
|
-
getAllRevisionsByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetAllRevisionsParams) => Promise<T[]>;
|
|
2510
|
+
getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
|
|
2008
2511
|
/**
|
|
2009
2512
|
* Get the entry by the given revision id.
|
|
2010
2513
|
*/
|
|
2011
|
-
getRevisionById: (model:
|
|
2514
|
+
getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
|
|
2012
2515
|
/**
|
|
2013
2516
|
* Get the published entry by given entryId.
|
|
2014
2517
|
*/
|
|
2015
|
-
getPublishedRevisionByEntryId: (model:
|
|
2518
|
+
getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
|
|
2016
2519
|
/**
|
|
2017
2520
|
* Get the latest entry by given entryId.
|
|
2018
2521
|
*/
|
|
2019
|
-
getLatestRevisionByEntryId: (model:
|
|
2522
|
+
getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
|
|
2020
2523
|
/**
|
|
2021
2524
|
* Get the revision of the entry before given one.
|
|
2022
2525
|
*/
|
|
2023
|
-
getPreviousRevision: (model:
|
|
2526
|
+
getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
|
|
2024
2527
|
/**
|
|
2025
2528
|
* Gets entry by given params.
|
|
2026
2529
|
*/
|
|
2027
|
-
get: (model:
|
|
2530
|
+
get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
|
|
2028
2531
|
/**
|
|
2029
2532
|
* List all entries. Filterable via params.
|
|
2030
2533
|
*/
|
|
2031
|
-
list: (model:
|
|
2534
|
+
list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
|
|
2032
2535
|
/**
|
|
2033
2536
|
* Create a new entry.
|
|
2034
2537
|
*/
|
|
2035
|
-
create: (model:
|
|
2538
|
+
create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
|
|
2036
2539
|
/**
|
|
2037
2540
|
* Create a new entry from existing one.
|
|
2038
2541
|
*/
|
|
2039
|
-
createRevisionFrom: (model:
|
|
2542
|
+
createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
|
|
2040
2543
|
/**
|
|
2041
2544
|
* Update existing entry.
|
|
2042
2545
|
*/
|
|
2043
|
-
update: (model:
|
|
2546
|
+
update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
|
|
2044
2547
|
/**
|
|
2045
2548
|
* Delete the entry revision.
|
|
2046
2549
|
*/
|
|
2047
|
-
deleteRevision: (model:
|
|
2550
|
+
deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
|
|
2048
2551
|
/**
|
|
2049
2552
|
* Delete the entry.
|
|
2050
2553
|
*/
|
|
2051
|
-
delete: (model:
|
|
2554
|
+
delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
|
|
2052
2555
|
/**
|
|
2053
2556
|
* Publish the entry.
|
|
2054
2557
|
*/
|
|
2055
|
-
publish: (model:
|
|
2558
|
+
publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
|
|
2056
2559
|
/**
|
|
2057
2560
|
* Unpublish the entry.
|
|
2058
2561
|
*/
|
|
2059
|
-
unpublish: (model:
|
|
2060
|
-
/**
|
|
2061
|
-
* Request changes the entry.
|
|
2062
|
-
*/
|
|
2063
|
-
requestChanges: (model: CmsModel, params: CmsEntryStorageOperationsRequestChangesParams<T>) => Promise<T>;
|
|
2064
|
-
/**
|
|
2065
|
-
* Request review the entry.
|
|
2066
|
-
*/
|
|
2067
|
-
requestReview: (model: CmsModel, params: CmsEntryStorageOperationsRequestReviewParams<T>) => Promise<CmsEntry>;
|
|
2562
|
+
unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
|
|
2068
2563
|
}
|
|
2069
2564
|
export declare enum CONTENT_ENTRY_STATUS {
|
|
2070
2565
|
DRAFT = "draft",
|
|
2071
2566
|
PUBLISHED = "published",
|
|
2072
|
-
UNPUBLISHED = "unpublished"
|
|
2073
|
-
CHANGES_REQUESTED = "changesRequested",
|
|
2074
|
-
REVIEW_REQUESTED = "reviewRequested"
|
|
2567
|
+
UNPUBLISHED = "unpublished"
|
|
2075
2568
|
}
|
|
2076
2569
|
export interface CmsSettingsStorageOperationsGetParams {
|
|
2077
2570
|
locale: string;
|
|
@@ -2081,7 +2574,6 @@ export interface CmsSettingsStorageOperationsCreateParams {
|
|
|
2081
2574
|
settings: CmsSettings;
|
|
2082
2575
|
}
|
|
2083
2576
|
export interface CmsSettingsStorageOperationsUpdateParams {
|
|
2084
|
-
original: CmsSettings;
|
|
2085
2577
|
settings: CmsSettings;
|
|
2086
2578
|
}
|
|
2087
2579
|
export interface CmsSettingsStorageOperations {
|
|
@@ -2114,7 +2606,6 @@ export interface CmsSystemStorageOperationsCreateParams {
|
|
|
2114
2606
|
}
|
|
2115
2607
|
export interface CmsSystemStorageOperationsUpdateParams {
|
|
2116
2608
|
system: CmsSystem;
|
|
2117
|
-
original: CmsSystem;
|
|
2118
2609
|
}
|
|
2119
2610
|
export interface CmsSystemStorageOperations {
|
|
2120
2611
|
/**
|
|
@@ -2130,17 +2621,18 @@ export interface CmsSystemStorageOperations {
|
|
|
2130
2621
|
*/
|
|
2131
2622
|
update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
|
|
2132
2623
|
}
|
|
2133
|
-
export interface HeadlessCmsStorageOperations {
|
|
2624
|
+
export interface HeadlessCmsStorageOperations<C = CmsContext> {
|
|
2625
|
+
name: string;
|
|
2134
2626
|
system: CmsSystemStorageOperations;
|
|
2135
2627
|
settings: CmsSettingsStorageOperations;
|
|
2136
2628
|
groups: CmsGroupStorageOperations;
|
|
2137
2629
|
models: CmsModelStorageOperations;
|
|
2138
2630
|
entries: CmsEntryStorageOperations;
|
|
2139
|
-
init?: (cms: HeadlessCms) => Promise<void>;
|
|
2140
2631
|
/**
|
|
2141
|
-
*
|
|
2632
|
+
* Either attach something from the storage operations or run something in it.
|
|
2142
2633
|
*/
|
|
2143
|
-
|
|
2634
|
+
beforeInit?: (context: C) => Promise<void>;
|
|
2635
|
+
init?: (context: C) => Promise<void>;
|
|
2144
2636
|
/**
|
|
2145
2637
|
* An upgrade to run if necessary.
|
|
2146
2638
|
*/
|