@webiny/api-headless-cms 0.0.0-mt-2 → 0.0.0-unstable.13771d80a8
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 +29 -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 +6 -9
- package/crud/contentEntry.crud.js +1202 -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 +62 -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 +36 -0
- package/crud/contentModel/beforeUpdate.js.map +1 -0
- package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
- package/crud/contentModel/compatibility/modelApiName.js +24 -0
- package/crud/contentModel/compatibility/modelApiName.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/createFieldModels.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +6 -2
- package/crud/contentModel/createFieldModels.js.map +1 -0
- package/crud/contentModel/createFieldStorageId.d.ts +2 -0
- package/crud/contentModel/createFieldStorageId.js +17 -0
- package/crud/contentModel/createFieldStorageId.js.map +1 -0
- package/crud/contentModel/defaultFields.d.ts +5 -0
- package/crud/contentModel/defaultFields.js +58 -0
- package/crud/contentModel/defaultFields.js.map +1 -0
- package/crud/contentModel/fieldIdValidation.d.ts +1 -0
- package/crud/contentModel/fieldIdValidation.js +25 -0
- package/crud/contentModel/fieldIdValidation.js.map +1 -0
- package/crud/contentModel/fields/descriptionField.d.ts +2 -0
- package/crud/contentModel/fields/descriptionField.js +42 -0
- package/crud/contentModel/fields/descriptionField.js.map +1 -0
- package/crud/contentModel/fields/imageField.d.ts +2 -0
- package/crud/contentModel/fields/imageField.js +46 -0
- package/crud/contentModel/fields/imageField.js.map +1 -0
- package/crud/contentModel/fields/titleField.d.ts +2 -0
- package/crud/contentModel/fields/titleField.js +58 -0
- package/crud/contentModel/fields/titleField.js.map +1 -0
- package/crud/contentModel/idValidation.d.ts +1 -0
- package/{content/plugins/crud → crud}/contentModel/idValidation.js +3 -3
- package/crud/contentModel/idValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/models.d.ts +2 -1
- package/{content/plugins/crud → crud}/contentModel/models.js +76 -25
- package/crud/contentModel/models.js.map +1 -0
- package/crud/contentModel/systemFields.d.ts +1 -0
- package/crud/contentModel/systemFields.js +8 -0
- package/crud/contentModel/systemFields.js.map +1 -0
- package/crud/contentModel/validateLayout.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js +1 -11
- package/crud/contentModel/validateLayout.js.map +1 -0
- package/crud/contentModel/validateModel.d.ts +9 -0
- package/crud/contentModel/validateModel.js +27 -0
- package/crud/contentModel/validateModel.js.map +1 -0
- package/crud/contentModel/validateModelFields.d.ts +9 -0
- package/crud/contentModel/validateModelFields.js +343 -0
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/crud/contentModel/validation.d.ts +519 -0
- package/crud/contentModel/validation.js +145 -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 +578 -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 +126 -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 +179 -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 +66 -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 +362 -0
- package/graphql/schema/contentEntries.js.map +1 -0
- package/graphql/schema/contentModelGroups.d.ts +7 -0
- package/{content/plugins → graphql}/schema/contentModelGroups.js +39 -33
- package/graphql/schema/contentModelGroups.js.map +1 -0
- package/graphql/schema/contentModels.d.ts +7 -0
- package/{content/plugins → graphql}/schema/contentModels.js +121 -29
- 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/graphql/schema/createManageResolvers.js +127 -0
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/graphql/schema/createManageSDL.d.ts +13 -0
- package/graphql/schema/createManageSDL.js +157 -0
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/graphql/schema/createPreviewResolvers.d.ts +12 -0
- package/graphql/schema/createPreviewResolvers.js +44 -0
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/graphql/schema/createReadResolvers.d.ts +12 -0
- package/graphql/schema/createReadResolvers.js +49 -0
- package/graphql/schema/createReadResolvers.js.map +1 -0
- package/graphql/schema/createReadSDL.d.ts +13 -0
- package/graphql/schema/createReadSDL.js +100 -0
- package/graphql/schema/createReadSDL.js.map +1 -0
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js +2 -3
- 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 +39 -24
- 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 +216 -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 +245 -0
- package/graphqlFields/object.js.map +1 -0
- package/graphqlFields/ref.d.ts +2 -0
- package/graphqlFields/ref.js +255 -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 +74 -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 +37 -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 +55 -0
- package/plugins/CmsModelPlugin.js +169 -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 +951 -405
- package/types.js +105 -62
- package/types.js.map +1 -0
- package/upgrades/5.33.0/index.d.ts +3 -0
- package/upgrades/5.33.0/index.js +182 -0
- package/upgrades/5.33.0/index.js.map +1 -0
- package/upgrades/index.d.ts +1 -0
- package/upgrades/index.js +12 -0
- package/upgrades/index.js.map +1 -0
- package/utils/access.d.ts +8 -0
- package/utils/access.js +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 +123 -0
- package/utils/converters/valueKeyStorageConverter.js.map +1 -0
- package/utils/createTypeFromFields.d.ts +16 -0
- package/utils/createTypeFromFields.js +67 -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/getEntryDescription.d.ts +2 -0
- package/utils/getEntryDescription.js +17 -0
- package/utils/getEntryDescription.js.map +1 -0
- package/utils/getEntryImage.d.ts +2 -0
- package/utils/getEntryImage.js +17 -0
- package/utils/getEntryImage.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 -1
- package/utils/pluralizedTypeName.js.map +1 -0
- package/utils/removeNullValues.d.ts +1 -0
- package/utils/removeNullValues.js +17 -0
- package/utils/removeNullValues.js.map +1 -0
- package/utils/removeUndefinedValues.d.ts +1 -0
- package/utils/removeUndefinedValues.js +17 -0
- package/utils/removeUndefinedValues.js.map +1 -0
- package/utils/renderFields.d.ts +16 -0
- package/{content/plugins/utils → utils}/renderFields.js +14 -12
- 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 +15 -0
- package/{content/plugins/utils → utils}/renderInputFields.js +7 -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/idValidation.d.ts +0 -2
- package/content/plugins/crud/contentModel/validateLayout.d.ts +0 -2
- package/content/plugins/crud/contentModel.crud.js +0 -425
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
- package/content/plugins/crud/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/createManageResolvers.js +0 -135
- package/content/plugins/schema/createManageSDL.d.ts +0 -9
- package/content/plugins/schema/createManageSDL.js +0 -153
- 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/createReadSDL.js +0 -96
- 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,18 @@
|
|
|
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
|
-
import { UpgradePlugin } from "@webiny/api-upgrade/types";
|
|
12
8
|
import { Topic } from "@webiny/pubsub/types";
|
|
9
|
+
import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
|
|
10
|
+
export declare type ApiEndpoint = "manage" | "preview" | "read";
|
|
13
11
|
export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
|
|
14
12
|
/**
|
|
15
13
|
* API type
|
|
16
14
|
*/
|
|
17
|
-
type:
|
|
15
|
+
type: ApiEndpoint | null;
|
|
18
16
|
/**
|
|
19
17
|
* Requested locale
|
|
20
18
|
*/
|
|
@@ -45,12 +43,16 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
|
|
|
45
43
|
*
|
|
46
44
|
* @category Context
|
|
47
45
|
*/
|
|
48
|
-
export interface CmsContext extends
|
|
46
|
+
export interface CmsContext extends Context, DbContext, I18NContext, FileManagerContext {
|
|
49
47
|
cms: HeadlessCms;
|
|
50
48
|
}
|
|
51
49
|
interface CmsModelFieldPredefinedValuesValue {
|
|
52
50
|
value: string;
|
|
53
51
|
label: string;
|
|
52
|
+
/**
|
|
53
|
+
* Default selected predefined value.
|
|
54
|
+
*/
|
|
55
|
+
selected?: boolean;
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Object containing content model field predefined options and values.
|
|
@@ -79,6 +81,43 @@ interface CmsModelFieldRenderer {
|
|
|
79
81
|
*/
|
|
80
82
|
name: string;
|
|
81
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* A definition for content model field settings.
|
|
86
|
+
*
|
|
87
|
+
* @category ModelField
|
|
88
|
+
* @category Database model
|
|
89
|
+
*/
|
|
90
|
+
export interface CmsModelFieldSettings {
|
|
91
|
+
/**
|
|
92
|
+
* Predefined values (text, number)
|
|
93
|
+
* The default value for the field in case it is not predefined values field.
|
|
94
|
+
*/
|
|
95
|
+
defaultValue?: string | number | null | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Object field has child fields.
|
|
98
|
+
*/
|
|
99
|
+
fields?: CmsModelField[];
|
|
100
|
+
/**
|
|
101
|
+
* Is the file field images only one?
|
|
102
|
+
*/
|
|
103
|
+
imagesOnly?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Object field has child fields - so it needs to have a layout.
|
|
106
|
+
*/
|
|
107
|
+
layout?: string[][];
|
|
108
|
+
/**
|
|
109
|
+
* Ref field.
|
|
110
|
+
*/
|
|
111
|
+
models?: Pick<CmsModel, "modelId">[];
|
|
112
|
+
/**
|
|
113
|
+
* Date field.
|
|
114
|
+
*/
|
|
115
|
+
type?: string;
|
|
116
|
+
/**
|
|
117
|
+
* There are a lot of other settings that are possible to add, so we keep the type opened.
|
|
118
|
+
*/
|
|
119
|
+
[key: string]: any;
|
|
120
|
+
}
|
|
82
121
|
/**
|
|
83
122
|
* A definition for content model field. This type exists on the app side as well.
|
|
84
123
|
*
|
|
@@ -87,15 +126,37 @@ interface CmsModelFieldRenderer {
|
|
|
87
126
|
*/
|
|
88
127
|
export interface CmsModelField {
|
|
89
128
|
/**
|
|
90
|
-
* A generated ID for the model field
|
|
129
|
+
* A generated unique ID for the model field.
|
|
130
|
+
* MUST be absolute unique throughout the models.
|
|
131
|
+
* Must be in form of a-zA-Z0-9.
|
|
132
|
+
*
|
|
133
|
+
* We generate a unique id value when you're building a model via UI,
|
|
134
|
+
* but when user is creating a model via a plugin it is up to them to be careful about this.
|
|
91
135
|
*/
|
|
92
136
|
id: string;
|
|
93
137
|
/**
|
|
94
|
-
* A type of the field
|
|
138
|
+
* A type of the field.
|
|
139
|
+
* We are defining our built-in fields, so people know which are available by the default.
|
|
95
140
|
*/
|
|
96
|
-
type: string;
|
|
141
|
+
type: "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
|
|
142
|
+
/**
|
|
143
|
+
* A unique storage ID for storing actual values.
|
|
144
|
+
* Must in form of a-zA-Z0-9@a-zA-Z0-9@a-zA-Z0-9.
|
|
145
|
+
*
|
|
146
|
+
* This is an auto-generated value: uses `id` and `type`
|
|
147
|
+
*
|
|
148
|
+
* This is used as path for the entry value.
|
|
149
|
+
*
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
storageId: string;
|
|
97
153
|
/**
|
|
98
|
-
*
|
|
154
|
+
* Field identifier for the model field that will be available to the outside world.
|
|
155
|
+
* `storageId` is used as path (or column) to store the data.
|
|
156
|
+
*
|
|
157
|
+
* Must in form of a-zA-Z0-9.
|
|
158
|
+
*
|
|
159
|
+
* This value MUST be unique in the CmsModel.
|
|
99
160
|
*/
|
|
100
161
|
fieldId: string;
|
|
101
162
|
/**
|
|
@@ -105,11 +166,11 @@ export interface CmsModelField {
|
|
|
105
166
|
/**
|
|
106
167
|
* Text below the field to clarify what is it meant to be in the field value
|
|
107
168
|
*/
|
|
108
|
-
helpText?: string;
|
|
169
|
+
helpText?: string | null;
|
|
109
170
|
/**
|
|
110
171
|
* Text to be displayed in the field
|
|
111
172
|
*/
|
|
112
|
-
placeholderText?: string;
|
|
173
|
+
placeholderText?: string | null;
|
|
113
174
|
/**
|
|
114
175
|
* Are predefined values enabled? And list of them
|
|
115
176
|
*/
|
|
@@ -137,21 +198,53 @@ export interface CmsModelField {
|
|
|
137
198
|
*
|
|
138
199
|
*/
|
|
139
200
|
multipleValues?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Fields can be tagged to give them contextual meaning.
|
|
203
|
+
*/
|
|
204
|
+
tags?: string[];
|
|
140
205
|
/**
|
|
141
206
|
* Any user defined settings.
|
|
142
207
|
*
|
|
143
208
|
* @default {}
|
|
144
209
|
*/
|
|
145
|
-
settings?:
|
|
146
|
-
|
|
210
|
+
settings?: CmsModelFieldSettings;
|
|
211
|
+
}
|
|
212
|
+
export interface CmsDynamicZoneTemplate {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
gqlTypeName: string;
|
|
216
|
+
description: string;
|
|
217
|
+
icon: string;
|
|
218
|
+
fields: CmsModelField[];
|
|
219
|
+
layout: string[][];
|
|
220
|
+
validation: CmsModelFieldValidation[];
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* A definition for dynamic-zone field to show possible type of the field in settings.
|
|
224
|
+
*/
|
|
225
|
+
export interface CmsModelDynamicZoneField extends CmsModelField {
|
|
226
|
+
/**
|
|
227
|
+
* Settings object for the field. Contains `templates` property.
|
|
228
|
+
*/
|
|
229
|
+
settings: {
|
|
230
|
+
templates: CmsDynamicZoneTemplate[];
|
|
147
231
|
};
|
|
148
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Used for our internal functionality.
|
|
235
|
+
*/
|
|
236
|
+
export interface CmsModelFieldWithParent extends CmsModelField {
|
|
237
|
+
parent?: CmsModelFieldWithParent | null;
|
|
238
|
+
}
|
|
239
|
+
export interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {
|
|
240
|
+
parent?: CmsModelDynamicZoneFieldWithParent | null;
|
|
241
|
+
}
|
|
149
242
|
/**
|
|
150
243
|
* A definition for dateTime field to show possible type of the field in settings.
|
|
151
244
|
*/
|
|
152
245
|
export interface CmsModelDateTimeField extends CmsModelField {
|
|
153
246
|
/**
|
|
154
|
-
* Settings object for the field. Contains type property.
|
|
247
|
+
* Settings object for the field. Contains `type` property.
|
|
155
248
|
*/
|
|
156
249
|
settings: {
|
|
157
250
|
type: "time" | "date" | "dateTimeWithoutTimezone" | "dateTimeWithTimezone";
|
|
@@ -163,11 +256,11 @@ export interface CmsModelDateTimeField extends CmsModelField {
|
|
|
163
256
|
* @category ModelField
|
|
164
257
|
* @category FieldValidation
|
|
165
258
|
*/
|
|
166
|
-
export interface CmsModelFieldValidatorValidateParams {
|
|
259
|
+
export interface CmsModelFieldValidatorValidateParams<T = any> {
|
|
167
260
|
/**
|
|
168
261
|
* A value to be validated.
|
|
169
262
|
*/
|
|
170
|
-
value:
|
|
263
|
+
value: T;
|
|
171
264
|
/**
|
|
172
265
|
* Options from the CmsModelField validations.
|
|
173
266
|
*
|
|
@@ -186,7 +279,12 @@ export interface CmsModelFieldValidatorValidateParams {
|
|
|
186
279
|
/**
|
|
187
280
|
* An instance of the content model being validated.
|
|
188
281
|
*/
|
|
189
|
-
|
|
282
|
+
model: CmsModel;
|
|
283
|
+
/**
|
|
284
|
+
* If entry is sent it means it is an update operation.
|
|
285
|
+
* First usage is for the unique field value.
|
|
286
|
+
*/
|
|
287
|
+
entry?: CmsEntry;
|
|
190
288
|
}
|
|
191
289
|
/**
|
|
192
290
|
* Definition for the field validator.
|
|
@@ -253,7 +351,8 @@ export interface CmsModelFieldPatternValidatorPlugin extends Plugin {
|
|
|
253
351
|
*/
|
|
254
352
|
export interface LockedField {
|
|
255
353
|
/**
|
|
256
|
-
* Locked field ID - one used
|
|
354
|
+
* Locked field storage ID - one used to store values.
|
|
355
|
+
* We cannot change this due to old systems.
|
|
257
356
|
*/
|
|
258
357
|
fieldId: string;
|
|
259
358
|
/**
|
|
@@ -267,7 +366,21 @@ export interface LockedField {
|
|
|
267
366
|
[key: string]: any;
|
|
268
367
|
}
|
|
269
368
|
/**
|
|
270
|
-
*
|
|
369
|
+
* @category Database model
|
|
370
|
+
* @category CmsModel
|
|
371
|
+
*/
|
|
372
|
+
export interface CmsModelGroup {
|
|
373
|
+
/**
|
|
374
|
+
* Generated ID of the group
|
|
375
|
+
*/
|
|
376
|
+
id: string;
|
|
377
|
+
/**
|
|
378
|
+
* Name of the group
|
|
379
|
+
*/
|
|
380
|
+
name: string;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Base CMS Model. Should not be exported and used outside of this package.
|
|
271
384
|
*
|
|
272
385
|
* @category Database model
|
|
273
386
|
* @category CmsModel
|
|
@@ -281,6 +394,28 @@ export interface CmsModel {
|
|
|
281
394
|
* Unique ID for the content model. Created from name if not defined by user.
|
|
282
395
|
*/
|
|
283
396
|
modelId: string;
|
|
397
|
+
/**
|
|
398
|
+
* Name of the content model in singular form to be used in the API.
|
|
399
|
+
* example:
|
|
400
|
+
* - Article
|
|
401
|
+
* - Fruit
|
|
402
|
+
* - Vegetable
|
|
403
|
+
* - Car
|
|
404
|
+
*/
|
|
405
|
+
singularApiName: string;
|
|
406
|
+
/**
|
|
407
|
+
* Name of the content model in plural form to be used in the API.
|
|
408
|
+
* example:
|
|
409
|
+
* - Articles
|
|
410
|
+
* - Fruits
|
|
411
|
+
* - Vegetables
|
|
412
|
+
* - Cars
|
|
413
|
+
*/
|
|
414
|
+
pluralApiName: string;
|
|
415
|
+
/**
|
|
416
|
+
* Model tenant.
|
|
417
|
+
*/
|
|
418
|
+
tenant: string;
|
|
284
419
|
/**
|
|
285
420
|
* Locale this model belongs to.
|
|
286
421
|
*/
|
|
@@ -288,32 +423,27 @@ export interface CmsModel {
|
|
|
288
423
|
/**
|
|
289
424
|
* Cms Group reference object.
|
|
290
425
|
*/
|
|
291
|
-
group:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Name of the group
|
|
298
|
-
*/
|
|
299
|
-
name: string;
|
|
300
|
-
};
|
|
426
|
+
group: CmsModelGroup;
|
|
427
|
+
/**
|
|
428
|
+
* Icon for the content model.
|
|
429
|
+
*/
|
|
430
|
+
icon?: string | null;
|
|
301
431
|
/**
|
|
302
432
|
* Description for the content model.
|
|
303
433
|
*/
|
|
304
|
-
description
|
|
434
|
+
description: string | null;
|
|
305
435
|
/**
|
|
306
436
|
* Date created
|
|
307
437
|
*/
|
|
308
|
-
createdOn?:
|
|
438
|
+
createdOn?: string;
|
|
309
439
|
/**
|
|
310
440
|
* Date saved. Changes on both save and create.
|
|
311
441
|
*/
|
|
312
|
-
savedOn?:
|
|
442
|
+
savedOn?: string;
|
|
313
443
|
/**
|
|
314
444
|
* CreatedBy object wrapper. Contains id, name and type of the user.
|
|
315
445
|
*/
|
|
316
|
-
createdBy?:
|
|
446
|
+
createdBy?: CmsIdentity;
|
|
317
447
|
/**
|
|
318
448
|
* List of fields defining entry values.
|
|
319
449
|
*/
|
|
@@ -329,6 +459,10 @@ export interface CmsModel {
|
|
|
329
459
|
* ```
|
|
330
460
|
*/
|
|
331
461
|
layout: string[][];
|
|
462
|
+
/**
|
|
463
|
+
* Models can be tagged to give them contextual meaning.
|
|
464
|
+
*/
|
|
465
|
+
tags?: string[];
|
|
332
466
|
/**
|
|
333
467
|
* List of locked fields. Updated when entry is saved and a field has been used.
|
|
334
468
|
*/
|
|
@@ -338,14 +472,35 @@ export interface CmsModel {
|
|
|
338
472
|
* It is picked as first available text field. Or user can select own field.
|
|
339
473
|
*/
|
|
340
474
|
titleFieldId: string;
|
|
475
|
+
/**
|
|
476
|
+
* The field which is displayed as the description one.
|
|
477
|
+
* Only way this is null or undefined is that there are no long-text fields to be set as description.
|
|
478
|
+
*/
|
|
479
|
+
descriptionFieldId?: string | null;
|
|
480
|
+
/**
|
|
481
|
+
* The field which is displayed as the image.
|
|
482
|
+
* Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.
|
|
483
|
+
*/
|
|
484
|
+
imageFieldId?: string | null;
|
|
341
485
|
/**
|
|
342
486
|
* The version of Webiny which this record was stored with.
|
|
343
487
|
*/
|
|
344
488
|
webinyVersion: string;
|
|
345
489
|
/**
|
|
346
|
-
*
|
|
490
|
+
* Is model private?
|
|
491
|
+
* This is meant to be used for some internal models - will not be visible in the schema.
|
|
492
|
+
* Only available for the plugin constructed models.
|
|
347
493
|
*/
|
|
348
|
-
|
|
494
|
+
isPrivate?: boolean;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter
|
|
498
|
+
*
|
|
499
|
+
* @category CmsModel
|
|
500
|
+
*/
|
|
501
|
+
export interface StorageOperationsCmsModel extends CmsModel {
|
|
502
|
+
convertValueKeyToStorage: CmsModelConverterCallable;
|
|
503
|
+
convertValueKeyFromStorage: CmsModelConverterCallable;
|
|
349
504
|
}
|
|
350
505
|
/**
|
|
351
506
|
* @category ModelField
|
|
@@ -354,24 +509,40 @@ export interface CmsModelFieldDefinition {
|
|
|
354
509
|
fields: string;
|
|
355
510
|
typeDefs?: string;
|
|
356
511
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
512
|
+
interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
|
|
513
|
+
models: CmsModel[];
|
|
514
|
+
model: CmsModel;
|
|
515
|
+
graphQLType: string;
|
|
516
|
+
field: TField;
|
|
517
|
+
createFieldResolvers: any;
|
|
518
|
+
}
|
|
519
|
+
export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
|
|
520
|
+
(params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
|
|
521
|
+
resolver: GraphQLFieldResolver | null;
|
|
366
522
|
typeResolvers: Resolvers<CmsContext>;
|
|
367
|
-
};
|
|
523
|
+
} | false;
|
|
524
|
+
}
|
|
525
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<TField extends CmsModelField = CmsModelField> {
|
|
526
|
+
fields: TField[];
|
|
527
|
+
originalFields: TField[];
|
|
528
|
+
}
|
|
529
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {
|
|
530
|
+
(params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;
|
|
531
|
+
}
|
|
532
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField extends CmsModelField = CmsModelField> {
|
|
533
|
+
field: TField;
|
|
534
|
+
originalField?: TField;
|
|
535
|
+
validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;
|
|
536
|
+
}
|
|
537
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFields<TField extends CmsModelField = CmsModelField> {
|
|
538
|
+
(params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;
|
|
368
539
|
}
|
|
369
540
|
/**
|
|
370
541
|
* @category Plugin
|
|
371
542
|
* @category ModelField
|
|
372
543
|
* @category GraphQL
|
|
373
544
|
*/
|
|
374
|
-
export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
545
|
+
export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField> extends Plugin {
|
|
375
546
|
/**
|
|
376
547
|
* A plugin type
|
|
377
548
|
*/
|
|
@@ -392,6 +563,15 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
392
563
|
* ```
|
|
393
564
|
*/
|
|
394
565
|
isSearchable: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* Is the field searchable via full text search?
|
|
568
|
+
*
|
|
569
|
+
* Field is not full text searchable by default.
|
|
570
|
+
* ```ts
|
|
571
|
+
* fullTextSearch: false
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
fullTextSearch?: boolean;
|
|
395
575
|
/**
|
|
396
576
|
* Is the field sortable via the GraphQL?
|
|
397
577
|
*
|
|
@@ -400,6 +580,27 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
400
580
|
* ```
|
|
401
581
|
*/
|
|
402
582
|
isSortable: boolean;
|
|
583
|
+
/**
|
|
584
|
+
* Optional method which creates the storageId.
|
|
585
|
+
* Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.
|
|
586
|
+
*
|
|
587
|
+
* ```ts
|
|
588
|
+
* createStorageId: ({field}) => {
|
|
589
|
+
* if (field.settings.type === "time) {
|
|
590
|
+
* return `${field.type}_time@${field.id}`
|
|
591
|
+
* }
|
|
592
|
+
* // use default method
|
|
593
|
+
* return undefined;
|
|
594
|
+
* }
|
|
595
|
+
* ```
|
|
596
|
+
*/
|
|
597
|
+
createStorageId?: (params: {
|
|
598
|
+
model: CmsModel;
|
|
599
|
+
field: TField;
|
|
600
|
+
}) => string | null | undefined;
|
|
601
|
+
/**
|
|
602
|
+
* Read API methods.
|
|
603
|
+
*/
|
|
403
604
|
read: {
|
|
404
605
|
/**
|
|
405
606
|
* Definition for get filtering for GraphQL.
|
|
@@ -414,7 +615,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
414
615
|
*/
|
|
415
616
|
createGetFilters?(params: {
|
|
416
617
|
model: CmsModel;
|
|
417
|
-
field:
|
|
618
|
+
field: TField;
|
|
418
619
|
}): string;
|
|
419
620
|
/**
|
|
420
621
|
* Definition for list filtering for GraphQL.
|
|
@@ -434,7 +635,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
434
635
|
*/
|
|
435
636
|
createListFilters?(params: {
|
|
436
637
|
model: CmsModel;
|
|
437
|
-
field:
|
|
638
|
+
field: TField;
|
|
639
|
+
plugins: CmsFieldTypePlugins;
|
|
438
640
|
}): string;
|
|
439
641
|
/**
|
|
440
642
|
* Definition of the field type for GraphQL - be aware if multiple values is selected.
|
|
@@ -452,25 +654,26 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
452
654
|
* ```
|
|
453
655
|
*/
|
|
454
656
|
createTypeField(params: {
|
|
657
|
+
models: CmsModel[];
|
|
455
658
|
model: CmsModel;
|
|
456
|
-
field:
|
|
659
|
+
field: TField;
|
|
457
660
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
458
|
-
}): CmsModelFieldDefinition | string;
|
|
661
|
+
}): CmsModelFieldDefinition | string | null;
|
|
459
662
|
/**
|
|
460
663
|
* Definition for field resolver.
|
|
461
|
-
* By default it is simple return of the `instance.values[
|
|
664
|
+
* By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
462
665
|
*
|
|
463
666
|
* ```ts
|
|
464
667
|
* read: {
|
|
465
668
|
* createResolver({ field }) {
|
|
466
669
|
* return instance => {
|
|
467
|
-
* return instance.values[field.
|
|
670
|
+
* return instance.values[field.storageId];
|
|
468
671
|
* };
|
|
469
672
|
* }
|
|
470
673
|
* }
|
|
471
674
|
* ```
|
|
472
675
|
*/
|
|
473
|
-
createResolver?: CmsModelFieldToGraphQLCreateResolver
|
|
676
|
+
createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
|
|
474
677
|
/**
|
|
475
678
|
* Read API schema definitions for the field and resolvers for them.
|
|
476
679
|
*
|
|
@@ -492,7 +695,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
492
695
|
*/
|
|
493
696
|
createSchema?: (params: {
|
|
494
697
|
models: CmsModel[];
|
|
495
|
-
model: CmsModel;
|
|
496
698
|
}) => GraphQLSchemaDefinition<CmsContext>;
|
|
497
699
|
};
|
|
498
700
|
manage: {
|
|
@@ -514,7 +716,8 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
514
716
|
*/
|
|
515
717
|
createListFilters?: (params: {
|
|
516
718
|
model: CmsModel;
|
|
517
|
-
field:
|
|
719
|
+
field: TField;
|
|
720
|
+
plugins: CmsFieldTypePlugins;
|
|
518
721
|
}) => string;
|
|
519
722
|
/**
|
|
520
723
|
* Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
|
|
@@ -535,7 +738,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
535
738
|
*/
|
|
536
739
|
createSchema?: (params: {
|
|
537
740
|
models: CmsModel[];
|
|
538
|
-
model: CmsModel;
|
|
539
741
|
}) => GraphQLSchemaDefinition<CmsContext>;
|
|
540
742
|
/**
|
|
541
743
|
* Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.
|
|
@@ -553,10 +755,11 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
553
755
|
* ```
|
|
554
756
|
*/
|
|
555
757
|
createTypeField: (params: {
|
|
758
|
+
models: CmsModel[];
|
|
556
759
|
model: CmsModel;
|
|
557
|
-
field:
|
|
760
|
+
field: TField;
|
|
558
761
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
559
|
-
}) => CmsModelFieldDefinition | string;
|
|
762
|
+
}) => CmsModelFieldDefinition | string | null;
|
|
560
763
|
/**
|
|
561
764
|
* Definition for input GraphQL field type.
|
|
562
765
|
*
|
|
@@ -573,26 +776,32 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
573
776
|
* ```
|
|
574
777
|
*/
|
|
575
778
|
createInputField: (params: {
|
|
779
|
+
models: CmsModel[];
|
|
576
780
|
model: CmsModel;
|
|
577
|
-
field:
|
|
781
|
+
field: TField;
|
|
578
782
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
579
|
-
}) => CmsModelFieldDefinition | string;
|
|
783
|
+
}) => CmsModelFieldDefinition | string | null;
|
|
580
784
|
/**
|
|
581
785
|
* Definition for field resolver.
|
|
582
|
-
* By default it is simple return of the `instance.values[
|
|
786
|
+
* By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
583
787
|
*
|
|
584
788
|
* ```ts
|
|
585
789
|
* manage: {
|
|
586
790
|
* createResolver({ field }) {
|
|
587
791
|
* return instance => {
|
|
588
|
-
* return instance.values[field.
|
|
792
|
+
* return instance.values[field.storageId];
|
|
589
793
|
* };
|
|
590
794
|
* }
|
|
591
795
|
* }
|
|
592
796
|
* ```
|
|
593
797
|
*/
|
|
594
|
-
createResolver?: CmsModelFieldToGraphQLCreateResolver
|
|
798
|
+
createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
|
|
595
799
|
};
|
|
800
|
+
/**
|
|
801
|
+
*
|
|
802
|
+
* @param field
|
|
803
|
+
*/
|
|
804
|
+
validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;
|
|
596
805
|
}
|
|
597
806
|
/**
|
|
598
807
|
* Check for content model locked field.
|
|
@@ -631,11 +840,11 @@ export interface CmsFieldTypePlugins {
|
|
|
631
840
|
[key: string]: CmsModelFieldToGraphQLPlugin;
|
|
632
841
|
}
|
|
633
842
|
/**
|
|
634
|
-
*
|
|
843
|
+
* An interface describing the reference to a user that created some data in the database.
|
|
635
844
|
*
|
|
636
845
|
* @category General
|
|
637
846
|
*/
|
|
638
|
-
export interface
|
|
847
|
+
export interface CmsIdentity {
|
|
639
848
|
/**
|
|
640
849
|
* ID if the user.
|
|
641
850
|
*/
|
|
@@ -643,7 +852,7 @@ export interface CreatedBy {
|
|
|
643
852
|
/**
|
|
644
853
|
* Full name of the user.
|
|
645
854
|
*/
|
|
646
|
-
displayName: string;
|
|
855
|
+
displayName: string | null;
|
|
647
856
|
/**
|
|
648
857
|
* Type of the user (admin, user)
|
|
649
858
|
*/
|
|
@@ -687,26 +896,43 @@ export interface CmsSettingsContext {
|
|
|
687
896
|
*/
|
|
688
897
|
getModelLastChange: () => Promise<Date>;
|
|
689
898
|
}
|
|
690
|
-
export interface
|
|
899
|
+
export interface OnSystemBeforeInstallTopicParams {
|
|
900
|
+
tenant: string;
|
|
901
|
+
locale: string;
|
|
902
|
+
}
|
|
903
|
+
export interface OnSystemAfterInstallTopicParams {
|
|
691
904
|
tenant: string;
|
|
905
|
+
locale: string;
|
|
692
906
|
}
|
|
693
|
-
export interface
|
|
907
|
+
export interface OnSystemInstallErrorTopicParams {
|
|
908
|
+
error: Error;
|
|
694
909
|
tenant: string;
|
|
910
|
+
locale: string;
|
|
695
911
|
}
|
|
696
912
|
export declare type CmsSystemContext = {
|
|
697
|
-
getSystemVersion: () => Promise<string>;
|
|
913
|
+
getSystemVersion: () => Promise<string | null>;
|
|
698
914
|
setSystemVersion: (version: string) => Promise<void>;
|
|
699
|
-
getReadAPIKey(): Promise<string>;
|
|
700
915
|
installSystem: () => Promise<void>;
|
|
701
|
-
upgradeSystem: (version: string) => Promise<boolean>;
|
|
702
916
|
/**
|
|
703
|
-
*
|
|
917
|
+
* Lifecycle events - deprecated
|
|
918
|
+
*/
|
|
919
|
+
/**
|
|
920
|
+
* @deprecated
|
|
704
921
|
*/
|
|
705
|
-
onBeforeSystemInstall: Topic<
|
|
706
|
-
|
|
922
|
+
onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;
|
|
923
|
+
/**
|
|
924
|
+
* @deprecated
|
|
925
|
+
*/
|
|
926
|
+
onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;
|
|
927
|
+
/**
|
|
928
|
+
* Released in 5.34.0
|
|
929
|
+
*/
|
|
930
|
+
onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;
|
|
931
|
+
onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;
|
|
932
|
+
onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
|
|
707
933
|
};
|
|
708
934
|
/**
|
|
709
|
-
* A GraphQL params.data parameter received when creating content model group.
|
|
935
|
+
* A GraphQL `params.data` parameter received when creating content model group.
|
|
710
936
|
*
|
|
711
937
|
* @category CmsGroup
|
|
712
938
|
* @category GraphQL params
|
|
@@ -718,7 +944,7 @@ export interface CmsGroupCreateInput {
|
|
|
718
944
|
icon: string;
|
|
719
945
|
}
|
|
720
946
|
/**
|
|
721
|
-
* A GraphQL params.data parameter received when updating content model group.
|
|
947
|
+
* A GraphQL `params.data` parameter received when updating content model group.
|
|
722
948
|
*
|
|
723
949
|
* @category CmsGroup
|
|
724
950
|
* @category GraphQL params
|
|
@@ -748,6 +974,10 @@ export interface CmsGroup {
|
|
|
748
974
|
* Slug for the group. Must be unique.
|
|
749
975
|
*/
|
|
750
976
|
slug: string;
|
|
977
|
+
/**
|
|
978
|
+
* Group tenant.
|
|
979
|
+
*/
|
|
980
|
+
tenant: string;
|
|
751
981
|
/**
|
|
752
982
|
* Locale this group belongs to.
|
|
753
983
|
*/
|
|
@@ -755,15 +985,15 @@ export interface CmsGroup {
|
|
|
755
985
|
/**
|
|
756
986
|
* Description for the group.
|
|
757
987
|
*/
|
|
758
|
-
description
|
|
988
|
+
description: string;
|
|
759
989
|
/**
|
|
760
990
|
* Icon for the group. In a form of "ico/ico".
|
|
761
991
|
*/
|
|
762
|
-
icon
|
|
992
|
+
icon: string;
|
|
763
993
|
/**
|
|
764
994
|
* CreatedBy reference object.
|
|
765
995
|
*/
|
|
766
|
-
createdBy?:
|
|
996
|
+
createdBy?: CmsIdentity;
|
|
767
997
|
/**
|
|
768
998
|
* Date group was created on.
|
|
769
999
|
*/
|
|
@@ -777,12 +1007,14 @@ export interface CmsGroup {
|
|
|
777
1007
|
*/
|
|
778
1008
|
webinyVersion: string;
|
|
779
1009
|
/**
|
|
780
|
-
*
|
|
1010
|
+
* Is group private?
|
|
1011
|
+
* This is meant to be used for some internal groups - will not be visible in the schema.
|
|
1012
|
+
* Only available for the plugin constructed groups.
|
|
781
1013
|
*/
|
|
782
|
-
|
|
1014
|
+
isPrivate?: boolean;
|
|
783
1015
|
}
|
|
784
1016
|
/**
|
|
785
|
-
* A data.where parameter received when listing content model groups.
|
|
1017
|
+
* A `data.where` parameter received when listing content model groups.
|
|
786
1018
|
*
|
|
787
1019
|
* @category CmsGroup
|
|
788
1020
|
* @category GraphQL params
|
|
@@ -798,21 +1030,38 @@ export interface CmsGroupListParams {
|
|
|
798
1030
|
* @category CmsGroup
|
|
799
1031
|
* @category Topic
|
|
800
1032
|
*/
|
|
801
|
-
export interface
|
|
1033
|
+
export interface OnGroupBeforeCreateTopicParams {
|
|
1034
|
+
group: CmsGroup;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* @category CmsGroup
|
|
1038
|
+
* @category Topic
|
|
1039
|
+
*/
|
|
1040
|
+
export interface OnGroupAfterCreateTopicParams {
|
|
1041
|
+
group: CmsGroup;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* @category CmsGroup
|
|
1045
|
+
* @category Topic
|
|
1046
|
+
*/
|
|
1047
|
+
export interface OnGroupCreateErrorTopicParams {
|
|
1048
|
+
input: CmsGroupCreateInput;
|
|
802
1049
|
group: CmsGroup;
|
|
1050
|
+
error: Error;
|
|
803
1051
|
}
|
|
804
1052
|
/**
|
|
805
1053
|
* @category CmsGroup
|
|
806
1054
|
* @category Topic
|
|
807
1055
|
*/
|
|
808
|
-
export interface
|
|
1056
|
+
export interface OnGroupBeforeUpdateTopicParams {
|
|
1057
|
+
original: CmsGroup;
|
|
809
1058
|
group: CmsGroup;
|
|
810
1059
|
}
|
|
811
1060
|
/**
|
|
812
1061
|
* @category CmsGroup
|
|
813
1062
|
* @category Topic
|
|
814
1063
|
*/
|
|
815
|
-
export interface
|
|
1064
|
+
export interface OnGroupAfterUpdateTopicParams {
|
|
816
1065
|
original: CmsGroup;
|
|
817
1066
|
group: CmsGroup;
|
|
818
1067
|
}
|
|
@@ -820,23 +1069,33 @@ export interface BeforeGroupUpdateTopicParams {
|
|
|
820
1069
|
* @category CmsGroup
|
|
821
1070
|
* @category Topic
|
|
822
1071
|
*/
|
|
823
|
-
export interface
|
|
1072
|
+
export interface OnGroupUpdateErrorTopicParams {
|
|
1073
|
+
input: CmsGroupUpdateInput;
|
|
824
1074
|
original: CmsGroup;
|
|
825
1075
|
group: CmsGroup;
|
|
1076
|
+
error: Error;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* @category CmsGroup
|
|
1080
|
+
* @category Topic
|
|
1081
|
+
*/
|
|
1082
|
+
export interface OnGroupBeforeDeleteTopicParams {
|
|
1083
|
+
group: CmsGroup;
|
|
826
1084
|
}
|
|
827
1085
|
/**
|
|
828
1086
|
* @category CmsGroup
|
|
829
1087
|
* @category Topic
|
|
830
1088
|
*/
|
|
831
|
-
export interface
|
|
1089
|
+
export interface OnGroupAfterDeleteTopicParams {
|
|
832
1090
|
group: CmsGroup;
|
|
833
1091
|
}
|
|
834
1092
|
/**
|
|
835
1093
|
* @category CmsGroup
|
|
836
1094
|
* @category Topic
|
|
837
1095
|
*/
|
|
838
|
-
export interface
|
|
1096
|
+
export interface OnGroupDeleteErrorTopicParams {
|
|
839
1097
|
group: CmsGroup;
|
|
1098
|
+
error: Error;
|
|
840
1099
|
}
|
|
841
1100
|
/**
|
|
842
1101
|
* Cms Group in context.
|
|
@@ -866,14 +1125,48 @@ export interface CmsGroupContext {
|
|
|
866
1125
|
*/
|
|
867
1126
|
deleteGroup: (id: string) => Promise<boolean>;
|
|
868
1127
|
/**
|
|
869
|
-
*
|
|
1128
|
+
* Clear the cached groups.
|
|
1129
|
+
*/
|
|
1130
|
+
clearGroupsCache: () => void;
|
|
1131
|
+
/**
|
|
1132
|
+
* Lifecycle events - deprecated
|
|
1133
|
+
*/
|
|
1134
|
+
/**
|
|
1135
|
+
* @deprecated
|
|
1136
|
+
*/
|
|
1137
|
+
onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;
|
|
1138
|
+
/**
|
|
1139
|
+
* @deprecated
|
|
870
1140
|
*/
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
1141
|
+
onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;
|
|
1142
|
+
/**
|
|
1143
|
+
* @deprecated
|
|
1144
|
+
*/
|
|
1145
|
+
onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
|
|
1146
|
+
/**
|
|
1147
|
+
* @deprecated
|
|
1148
|
+
*/
|
|
1149
|
+
onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;
|
|
1150
|
+
/**
|
|
1151
|
+
* @deprecated
|
|
1152
|
+
*/
|
|
1153
|
+
onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;
|
|
1154
|
+
/**
|
|
1155
|
+
* @deprecated
|
|
1156
|
+
*/
|
|
1157
|
+
onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Lifecycle events released in 5.33.0
|
|
1160
|
+
*/
|
|
1161
|
+
onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
|
|
1162
|
+
onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
|
|
1163
|
+
onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;
|
|
1164
|
+
onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
|
|
1165
|
+
onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
|
|
1166
|
+
onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;
|
|
1167
|
+
onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
|
|
1168
|
+
onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
|
|
1169
|
+
onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;
|
|
877
1170
|
}
|
|
878
1171
|
/**
|
|
879
1172
|
* Definition for content model field validator.
|
|
@@ -884,10 +1177,15 @@ export interface CmsGroupContext {
|
|
|
884
1177
|
export interface CmsModelFieldValidation {
|
|
885
1178
|
name: string;
|
|
886
1179
|
message: string;
|
|
887
|
-
settings?:
|
|
1180
|
+
settings?: {
|
|
1181
|
+
value?: string | number;
|
|
1182
|
+
values?: string[];
|
|
1183
|
+
preset?: string;
|
|
1184
|
+
[key: string]: any;
|
|
1185
|
+
};
|
|
888
1186
|
}
|
|
889
1187
|
/**
|
|
890
|
-
* A GraphQL params.data parameter received when creating content model.
|
|
1188
|
+
* A GraphQL `params.data` parameter received when creating content model.
|
|
891
1189
|
*
|
|
892
1190
|
* @category GraphQL params
|
|
893
1191
|
* @category CmsModel
|
|
@@ -897,6 +1195,14 @@ export interface CmsModelCreateInput {
|
|
|
897
1195
|
* Name of the content model.
|
|
898
1196
|
*/
|
|
899
1197
|
name: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* Singular name of the content model to be used in the API.
|
|
1200
|
+
*/
|
|
1201
|
+
singularApiName: string;
|
|
1202
|
+
/**
|
|
1203
|
+
* Plural name of the content model to be used in the API.
|
|
1204
|
+
*/
|
|
1205
|
+
pluralApiName: string;
|
|
900
1206
|
/**
|
|
901
1207
|
* Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.
|
|
902
1208
|
*/
|
|
@@ -904,7 +1210,48 @@ export interface CmsModelCreateInput {
|
|
|
904
1210
|
/**
|
|
905
1211
|
* Description of the content model.
|
|
906
1212
|
*/
|
|
907
|
-
description?: string;
|
|
1213
|
+
description?: string | null;
|
|
1214
|
+
/**
|
|
1215
|
+
* Group where to put the content model in.
|
|
1216
|
+
*/
|
|
1217
|
+
group: string;
|
|
1218
|
+
/**
|
|
1219
|
+
* A list of content model fields to define the entry values.
|
|
1220
|
+
*/
|
|
1221
|
+
fields?: CmsModelFieldInput[];
|
|
1222
|
+
/**
|
|
1223
|
+
* Admin UI field layout
|
|
1224
|
+
*
|
|
1225
|
+
* ```ts
|
|
1226
|
+
* layout: [
|
|
1227
|
+
* [field1id, field2id],
|
|
1228
|
+
* [field3id]
|
|
1229
|
+
* ]
|
|
1230
|
+
* ```
|
|
1231
|
+
*/
|
|
1232
|
+
layout?: string[][];
|
|
1233
|
+
/**
|
|
1234
|
+
* Models can be tagged to give them contextual meaning.
|
|
1235
|
+
*/
|
|
1236
|
+
tags?: string[];
|
|
1237
|
+
/**
|
|
1238
|
+
* Fields fieldId which are picked to represent the CMS entry.
|
|
1239
|
+
*/
|
|
1240
|
+
titleFieldId?: string | null;
|
|
1241
|
+
descriptionFieldId?: string | null;
|
|
1242
|
+
imageFieldId?: string | null;
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* A GraphQL `params.data` parameter received when creating content model from existing model.
|
|
1246
|
+
*
|
|
1247
|
+
* @category GraphQL params
|
|
1248
|
+
* @category CmsModel
|
|
1249
|
+
*/
|
|
1250
|
+
export interface CmsModelCreateFromInput extends CmsModelCreateInput {
|
|
1251
|
+
/**
|
|
1252
|
+
* Locale into which we want to clone the model into.
|
|
1253
|
+
*/
|
|
1254
|
+
locale?: string;
|
|
908
1255
|
}
|
|
909
1256
|
/**
|
|
910
1257
|
* A definition for content model field received from the user.
|
|
@@ -926,7 +1273,7 @@ export interface CmsModelFieldInput {
|
|
|
926
1273
|
*/
|
|
927
1274
|
type: string;
|
|
928
1275
|
/**
|
|
929
|
-
*
|
|
1276
|
+
* Field outside world identifier for the field. Must be unique in the model.
|
|
930
1277
|
*/
|
|
931
1278
|
fieldId: string;
|
|
932
1279
|
/**
|
|
@@ -936,11 +1283,15 @@ export interface CmsModelFieldInput {
|
|
|
936
1283
|
/**
|
|
937
1284
|
* Text to display below the field to help user what to write in the field.
|
|
938
1285
|
*/
|
|
939
|
-
helpText?: string;
|
|
1286
|
+
helpText?: string | null;
|
|
940
1287
|
/**
|
|
941
1288
|
* Text to display in the field.
|
|
942
1289
|
*/
|
|
943
|
-
placeholderText?: string;
|
|
1290
|
+
placeholderText?: string | null;
|
|
1291
|
+
/**
|
|
1292
|
+
* Fields can be tagged to give them contextual meaning.
|
|
1293
|
+
*/
|
|
1294
|
+
tags?: string[];
|
|
944
1295
|
/**
|
|
945
1296
|
* Are multiple values allowed?
|
|
946
1297
|
*/
|
|
@@ -967,7 +1318,7 @@ export interface CmsModelFieldInput {
|
|
|
967
1318
|
settings?: Record<string, any>;
|
|
968
1319
|
}
|
|
969
1320
|
/**
|
|
970
|
-
* A GraphQL params.data parameter received when updating content model.
|
|
1321
|
+
* A GraphQL `params.data` parameter received when updating content model.
|
|
971
1322
|
*
|
|
972
1323
|
* @category GraphQL params
|
|
973
1324
|
* @category CmsModel
|
|
@@ -977,10 +1328,22 @@ export interface CmsModelUpdateInput {
|
|
|
977
1328
|
* A new content model name.
|
|
978
1329
|
*/
|
|
979
1330
|
name?: string;
|
|
1331
|
+
/**
|
|
1332
|
+
* A new singular name of the content model to be used in the API.
|
|
1333
|
+
*/
|
|
1334
|
+
singularApiName?: string;
|
|
1335
|
+
/**
|
|
1336
|
+
* A new plural name of the content model to be used in the API.
|
|
1337
|
+
*/
|
|
1338
|
+
pluralApiName?: string;
|
|
1339
|
+
/**
|
|
1340
|
+
* A group we want to move the model to.
|
|
1341
|
+
*/
|
|
1342
|
+
group?: string;
|
|
980
1343
|
/**
|
|
981
1344
|
* A new description of the content model.
|
|
982
1345
|
*/
|
|
983
|
-
description?: string;
|
|
1346
|
+
description?: string | null;
|
|
984
1347
|
/**
|
|
985
1348
|
* A list of content model fields to define the entry values.
|
|
986
1349
|
*/
|
|
@@ -997,10 +1360,11 @@ export interface CmsModelUpdateInput {
|
|
|
997
1360
|
*/
|
|
998
1361
|
layout: string[][];
|
|
999
1362
|
/**
|
|
1000
|
-
*
|
|
1001
|
-
* It is picked as first available text field. Or user can select own field.
|
|
1363
|
+
* Fields fieldId which are picked to represent the CMS entry.
|
|
1002
1364
|
*/
|
|
1003
|
-
titleFieldId?: string;
|
|
1365
|
+
titleFieldId?: string | null;
|
|
1366
|
+
descriptionFieldId?: string | null;
|
|
1367
|
+
imageFieldId?: string | null;
|
|
1004
1368
|
}
|
|
1005
1369
|
/**
|
|
1006
1370
|
* A plugin to load a CmsModelManager.
|
|
@@ -1027,16 +1391,25 @@ export interface ModelManagerPlugin extends Plugin {
|
|
|
1027
1391
|
*/
|
|
1028
1392
|
create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;
|
|
1029
1393
|
}
|
|
1394
|
+
/**
|
|
1395
|
+
* A content entry values definition for and from the database.
|
|
1396
|
+
*
|
|
1397
|
+
* @category Database model
|
|
1398
|
+
* @category CmsEntry
|
|
1399
|
+
*/
|
|
1400
|
+
export interface CmsEntryValues {
|
|
1401
|
+
[key: string]: any;
|
|
1402
|
+
}
|
|
1030
1403
|
/**
|
|
1031
1404
|
* A content entry definition for and from the database.
|
|
1032
1405
|
*
|
|
1033
1406
|
* @category Database model
|
|
1034
1407
|
* @category CmsEntry
|
|
1035
1408
|
*/
|
|
1036
|
-
export interface CmsEntry {
|
|
1409
|
+
export interface CmsEntry<T = CmsEntryValues> {
|
|
1037
1410
|
/**
|
|
1038
1411
|
* 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.
|
|
1412
|
+
* This can be used when upgrading the system, so we know which entries to update.
|
|
1040
1413
|
*/
|
|
1041
1414
|
webinyVersion: string;
|
|
1042
1415
|
/**
|
|
@@ -1055,11 +1428,15 @@ export interface CmsEntry {
|
|
|
1055
1428
|
/**
|
|
1056
1429
|
* CreatedBy object reference.
|
|
1057
1430
|
*/
|
|
1058
|
-
createdBy:
|
|
1431
|
+
createdBy: CmsIdentity;
|
|
1059
1432
|
/**
|
|
1060
1433
|
* OwnedBy object reference. Can be different from CreatedBy.
|
|
1061
1434
|
*/
|
|
1062
|
-
ownedBy:
|
|
1435
|
+
ownedBy: CmsIdentity;
|
|
1436
|
+
/**
|
|
1437
|
+
* ModifiedBy object reference. Last person who modified the entry.
|
|
1438
|
+
*/
|
|
1439
|
+
modifiedBy?: CmsIdentity | null;
|
|
1063
1440
|
/**
|
|
1064
1441
|
* A string of Date.toISOString() type.
|
|
1065
1442
|
* Populated on creation.
|
|
@@ -1098,11 +1475,22 @@ export interface CmsEntry {
|
|
|
1098
1475
|
*/
|
|
1099
1476
|
status: CmsEntryStatus;
|
|
1100
1477
|
/**
|
|
1101
|
-
* A mapped
|
|
1478
|
+
* A mapped storageId -> value object.
|
|
1102
1479
|
*
|
|
1103
1480
|
* @see CmsModelField
|
|
1104
1481
|
*/
|
|
1105
|
-
values:
|
|
1482
|
+
values: T;
|
|
1483
|
+
/**
|
|
1484
|
+
* Settings for the given entry.
|
|
1485
|
+
*
|
|
1486
|
+
* Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.
|
|
1487
|
+
* Be aware that when accessing properties in it on old systems, it will break if not checked first.
|
|
1488
|
+
*
|
|
1489
|
+
* Available only on the Manage API in entry GraphQL type `meta.data` property.
|
|
1490
|
+
*/
|
|
1491
|
+
meta?: {
|
|
1492
|
+
[key: string]: any;
|
|
1493
|
+
};
|
|
1106
1494
|
}
|
|
1107
1495
|
export interface CmsStorageEntry extends CmsEntry {
|
|
1108
1496
|
[key: string]: any;
|
|
@@ -1118,24 +1506,20 @@ export interface CmsStorageEntry extends CmsEntry {
|
|
|
1118
1506
|
* @category CmsModel
|
|
1119
1507
|
*/
|
|
1120
1508
|
export interface CmsModelManager {
|
|
1121
|
-
/**
|
|
1122
|
-
* List entries in this content model.
|
|
1123
|
-
*/
|
|
1124
|
-
list: (params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1125
1509
|
/**
|
|
1126
1510
|
* List only published entries in the content model.
|
|
1127
1511
|
*/
|
|
1128
|
-
listPublished: (params
|
|
1512
|
+
listPublished: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1129
1513
|
/**
|
|
1130
1514
|
* List latest entries in the content model. Used for administration.
|
|
1131
1515
|
*/
|
|
1132
|
-
listLatest: (params
|
|
1516
|
+
listLatest: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1133
1517
|
/**
|
|
1134
1518
|
* Get a list of published entries by the ID list.
|
|
1135
1519
|
*/
|
|
1136
1520
|
getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
|
|
1137
1521
|
/**
|
|
1138
|
-
* Get a list of latest entries by the ID list.
|
|
1522
|
+
* Get a list of the latest entries by the ID list.
|
|
1139
1523
|
*/
|
|
1140
1524
|
getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
|
|
1141
1525
|
/**
|
|
@@ -1143,42 +1527,95 @@ export interface CmsModelManager {
|
|
|
1143
1527
|
*/
|
|
1144
1528
|
get: (id: string) => Promise<CmsEntry>;
|
|
1145
1529
|
/**
|
|
1146
|
-
* Create
|
|
1530
|
+
* Create an entry.
|
|
1147
1531
|
*/
|
|
1148
|
-
create: (data:
|
|
1532
|
+
create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1149
1533
|
/**
|
|
1150
|
-
* Update
|
|
1534
|
+
* Update an entry.
|
|
1151
1535
|
*/
|
|
1152
|
-
update: (id: string, data:
|
|
1536
|
+
update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1153
1537
|
/**
|
|
1154
|
-
* Delete
|
|
1538
|
+
* Delete an entry.
|
|
1155
1539
|
*/
|
|
1156
1540
|
delete: (id: string) => Promise<void>;
|
|
1157
1541
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1542
|
+
/**
|
|
1543
|
+
* Create
|
|
1544
|
+
*/
|
|
1545
|
+
export interface OnModelBeforeCreateTopicParams {
|
|
1546
|
+
input: CmsModelCreateInput;
|
|
1160
1547
|
model: CmsModel;
|
|
1161
1548
|
}
|
|
1162
|
-
export interface
|
|
1163
|
-
input:
|
|
1549
|
+
export interface OnModelAfterCreateTopicParams {
|
|
1550
|
+
input: CmsModelCreateInput;
|
|
1164
1551
|
model: CmsModel;
|
|
1165
1552
|
}
|
|
1166
|
-
export interface
|
|
1167
|
-
input:
|
|
1168
|
-
original: CmsModel;
|
|
1553
|
+
export interface OnModelCreateErrorTopicParams {
|
|
1554
|
+
input: CmsModelCreateInput;
|
|
1169
1555
|
model: CmsModel;
|
|
1556
|
+
error: Error;
|
|
1170
1557
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1558
|
+
/**
|
|
1559
|
+
* Create From / Clone
|
|
1560
|
+
*/
|
|
1561
|
+
export interface OnModelBeforeCreateFromTopicParams {
|
|
1562
|
+
input: CmsModelCreateInput;
|
|
1173
1563
|
original: CmsModel;
|
|
1174
1564
|
model: CmsModel;
|
|
1175
1565
|
}
|
|
1176
|
-
export interface
|
|
1566
|
+
export interface OnModelAfterCreateFromTopicParams {
|
|
1567
|
+
input: CmsModelCreateInput;
|
|
1568
|
+
original: CmsModel;
|
|
1569
|
+
model: CmsModel;
|
|
1570
|
+
}
|
|
1571
|
+
export interface OnModelCreateFromErrorParams {
|
|
1572
|
+
input: CmsModelCreateInput;
|
|
1573
|
+
original: CmsModel;
|
|
1177
1574
|
model: CmsModel;
|
|
1575
|
+
error: Error;
|
|
1178
1576
|
}
|
|
1179
|
-
|
|
1577
|
+
/**
|
|
1578
|
+
* Update
|
|
1579
|
+
*/
|
|
1580
|
+
export interface OnModelBeforeUpdateTopicParams {
|
|
1581
|
+
input: CmsModelUpdateInput;
|
|
1582
|
+
original: CmsModel;
|
|
1583
|
+
model: CmsModel;
|
|
1584
|
+
}
|
|
1585
|
+
export interface OnModelAfterUpdateTopicParams {
|
|
1586
|
+
input: CmsModelUpdateInput;
|
|
1587
|
+
original: CmsModel;
|
|
1588
|
+
model: CmsModel;
|
|
1589
|
+
}
|
|
1590
|
+
export interface OnModelUpdateErrorTopicParams {
|
|
1591
|
+
input: CmsModelUpdateInput;
|
|
1592
|
+
original: CmsModel;
|
|
1593
|
+
model: CmsModel;
|
|
1594
|
+
error: Error;
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Delete
|
|
1598
|
+
*/
|
|
1599
|
+
export interface OnModelBeforeDeleteTopicParams {
|
|
1600
|
+
model: CmsModel;
|
|
1601
|
+
}
|
|
1602
|
+
export interface OnModelAfterDeleteTopicParams {
|
|
1603
|
+
model: CmsModel;
|
|
1604
|
+
}
|
|
1605
|
+
export interface OnModelDeleteErrorTopicParams {
|
|
1606
|
+
model: CmsModel;
|
|
1607
|
+
error: Error;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Initialize
|
|
1611
|
+
*/
|
|
1612
|
+
export interface OnModelInitializeParams {
|
|
1180
1613
|
model: CmsModel;
|
|
1614
|
+
data: Record<string, any>;
|
|
1181
1615
|
}
|
|
1616
|
+
/**
|
|
1617
|
+
*
|
|
1618
|
+
*/
|
|
1182
1619
|
export interface CmsModelUpdateDirectParams {
|
|
1183
1620
|
model: CmsModel;
|
|
1184
1621
|
original: CmsModel;
|
|
@@ -1190,15 +1627,6 @@ export interface CmsModelUpdateDirectParams {
|
|
|
1190
1627
|
* @category CmsModel
|
|
1191
1628
|
*/
|
|
1192
1629
|
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
1630
|
/**
|
|
1203
1631
|
* Get a single content model.
|
|
1204
1632
|
*/
|
|
@@ -1211,12 +1639,12 @@ export interface CmsModelContext {
|
|
|
1211
1639
|
* Create a content model.
|
|
1212
1640
|
*/
|
|
1213
1641
|
createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;
|
|
1642
|
+
/**
|
|
1643
|
+
* Create a content model from the given model - clone.
|
|
1644
|
+
*/
|
|
1645
|
+
createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;
|
|
1214
1646
|
/**
|
|
1215
1647
|
* Update content model without data validation. Used internally.
|
|
1216
|
-
*
|
|
1217
|
-
* @param model - existing content model
|
|
1218
|
-
* @param data - data to be updated
|
|
1219
|
-
*
|
|
1220
1648
|
* @hidden
|
|
1221
1649
|
*/
|
|
1222
1650
|
updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;
|
|
@@ -1229,32 +1657,100 @@ export interface CmsModelContext {
|
|
|
1229
1657
|
*/
|
|
1230
1658
|
deleteModel: (modelId: string) => Promise<void>;
|
|
1231
1659
|
/**
|
|
1232
|
-
*
|
|
1660
|
+
* Possibility for users to trigger the model initialization.
|
|
1661
|
+
* They can hook into it and do what ever they want to.
|
|
1662
|
+
*
|
|
1663
|
+
* Primary idea behind this is creating the index, for the code models, in the ES.
|
|
1664
|
+
*/
|
|
1665
|
+
initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Get an instance of CmsModelManager for given content modelId.
|
|
1233
1668
|
*
|
|
1234
1669
|
* @see CmsModelManager
|
|
1670
|
+
*
|
|
1671
|
+
* @deprecated use the getEntryManager() method instead
|
|
1235
1672
|
*/
|
|
1236
|
-
getModelManager: (
|
|
1673
|
+
getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
|
|
1674
|
+
getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;
|
|
1237
1675
|
/**
|
|
1238
1676
|
* Get all content model managers mapped by modelId.
|
|
1239
1677
|
* @see CmsModelManager
|
|
1678
|
+
* @deprecated use getEntryManagers instead
|
|
1240
1679
|
*/
|
|
1241
1680
|
getManagers: () => Map<string, CmsModelManager>;
|
|
1681
|
+
getEntryManagers: () => Map<string, CmsModelManager>;
|
|
1682
|
+
/**
|
|
1683
|
+
* Clear all the model caches.
|
|
1684
|
+
*/
|
|
1685
|
+
clearModelsCache: () => void;
|
|
1686
|
+
/**
|
|
1687
|
+
* Lifecycle events - deprecated.
|
|
1688
|
+
*/
|
|
1689
|
+
/**
|
|
1690
|
+
* @deprecated
|
|
1691
|
+
*/
|
|
1692
|
+
onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;
|
|
1693
|
+
/**
|
|
1694
|
+
* @deprecated
|
|
1695
|
+
*/
|
|
1696
|
+
onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;
|
|
1697
|
+
/**
|
|
1698
|
+
* @deprecated
|
|
1699
|
+
*/
|
|
1700
|
+
onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
|
|
1701
|
+
/**
|
|
1702
|
+
* @deprecated
|
|
1703
|
+
*/
|
|
1704
|
+
onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
|
|
1705
|
+
/**
|
|
1706
|
+
* @deprecated
|
|
1707
|
+
*/
|
|
1708
|
+
onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;
|
|
1709
|
+
/**
|
|
1710
|
+
* @deprecated
|
|
1711
|
+
*/
|
|
1712
|
+
onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;
|
|
1242
1713
|
/**
|
|
1243
|
-
*
|
|
1714
|
+
* @deprecated
|
|
1244
1715
|
*/
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1716
|
+
onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;
|
|
1717
|
+
/**
|
|
1718
|
+
* @deprecated
|
|
1719
|
+
*/
|
|
1720
|
+
onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;
|
|
1721
|
+
/**
|
|
1722
|
+
* Lifecycle events - released in 5.33.0
|
|
1723
|
+
*/
|
|
1724
|
+
onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
|
|
1725
|
+
onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
|
|
1726
|
+
onModelCreateError: Topic<OnModelCreateErrorTopicParams>;
|
|
1727
|
+
onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
|
|
1728
|
+
onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
|
|
1729
|
+
onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;
|
|
1730
|
+
onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
|
|
1731
|
+
onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
|
|
1732
|
+
onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;
|
|
1733
|
+
onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
|
|
1734
|
+
onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
|
|
1735
|
+
onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;
|
|
1736
|
+
onModelInitialize: Topic<OnModelInitializeParams>;
|
|
1251
1737
|
}
|
|
1252
1738
|
/**
|
|
1253
1739
|
* Available statuses for content entry.
|
|
1254
1740
|
*
|
|
1255
1741
|
* @category CmsEntry
|
|
1256
1742
|
*/
|
|
1257
|
-
declare type CmsEntryStatus = "published" | "unpublished" | "
|
|
1743
|
+
export declare type CmsEntryStatus = "published" | "unpublished" | "draft";
|
|
1744
|
+
export interface CmsEntryListWhereRef {
|
|
1745
|
+
id?: string;
|
|
1746
|
+
id_in?: string[];
|
|
1747
|
+
id_not?: string;
|
|
1748
|
+
id_not_in?: string[];
|
|
1749
|
+
entryId?: string;
|
|
1750
|
+
entryId_not?: string;
|
|
1751
|
+
entryId_in?: string[];
|
|
1752
|
+
entryId_not_in?: string[];
|
|
1753
|
+
}
|
|
1258
1754
|
/**
|
|
1259
1755
|
* Entry listing where params.
|
|
1260
1756
|
*
|
|
@@ -1277,7 +1773,9 @@ export interface CmsEntryListWhere {
|
|
|
1277
1773
|
entryId_in?: string[];
|
|
1278
1774
|
entryId_not_in?: string[];
|
|
1279
1775
|
/**
|
|
1280
|
-
*
|
|
1776
|
+
* Contains the owner of the entry. An "owner" is the identity who originally created the entry.
|
|
1777
|
+
* Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,
|
|
1778
|
+
* but the `owner` is always the original author of the entry.
|
|
1281
1779
|
*
|
|
1282
1780
|
* Can be sent via the API or set internal if user can see only their own entries.
|
|
1283
1781
|
*/
|
|
@@ -1302,22 +1800,30 @@ export interface CmsEntryListWhere {
|
|
|
1302
1800
|
version_lt?: number;
|
|
1303
1801
|
version_gt?: number;
|
|
1304
1802
|
/**
|
|
1305
|
-
* Each operations implementation MUST determine how to use this field.
|
|
1306
|
-
* In SQL it can be published field and in DynamoDB can be
|
|
1803
|
+
* Each storage operations implementation MUST determine how to use this field.
|
|
1804
|
+
* In SQL, it can be a `published` field, and in DynamoDB it can be an SK.
|
|
1307
1805
|
*
|
|
1308
1806
|
* It is not meant to be used via the API.
|
|
1309
1807
|
* @internal
|
|
1310
1808
|
*/
|
|
1311
1809
|
published?: boolean;
|
|
1312
1810
|
/**
|
|
1313
|
-
* Each operations implementation MUST determine how to use this field.
|
|
1314
|
-
* In SQL it can be
|
|
1811
|
+
* Each storage operations implementation MUST determine how to use this field.
|
|
1812
|
+
* In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.
|
|
1315
1813
|
*
|
|
1316
1814
|
* It is not meant to be used via the API.
|
|
1317
1815
|
* @internal
|
|
1318
1816
|
*/
|
|
1319
1817
|
latest?: boolean;
|
|
1320
|
-
|
|
1818
|
+
/**
|
|
1819
|
+
* This is to allow querying by any content model field defined by the user.
|
|
1820
|
+
*/
|
|
1821
|
+
[key: string]: string | number | boolean | undefined | string[] | number[] | null | CmsEntryListWhere[] | CmsEntryListWhere | CmsEntryListWhereRef;
|
|
1822
|
+
/**
|
|
1823
|
+
* To allow querying via nested queries, we added the AND / OR properties.
|
|
1824
|
+
*/
|
|
1825
|
+
AND?: CmsEntryListWhere[];
|
|
1826
|
+
OR?: CmsEntryListWhere[];
|
|
1321
1827
|
}
|
|
1322
1828
|
/**
|
|
1323
1829
|
* Entry listing sort.
|
|
@@ -1343,10 +1849,12 @@ export interface CmsEntryGetParams {
|
|
|
1343
1849
|
* @category GraphQL params
|
|
1344
1850
|
*/
|
|
1345
1851
|
export interface CmsEntryListParams {
|
|
1346
|
-
where
|
|
1852
|
+
where?: CmsEntryListWhere;
|
|
1347
1853
|
sort?: CmsEntryListSort;
|
|
1854
|
+
search?: string;
|
|
1855
|
+
fields?: string[];
|
|
1348
1856
|
limit?: number;
|
|
1349
|
-
after?: string;
|
|
1857
|
+
after?: string | null;
|
|
1350
1858
|
}
|
|
1351
1859
|
/**
|
|
1352
1860
|
* Meta information for GraphQL output.
|
|
@@ -1358,7 +1866,7 @@ export interface CmsEntryMeta {
|
|
|
1358
1866
|
/**
|
|
1359
1867
|
* A cursor for pagination.
|
|
1360
1868
|
*/
|
|
1361
|
-
cursor: string;
|
|
1869
|
+
cursor: string | null;
|
|
1362
1870
|
/**
|
|
1363
1871
|
* Is there more items to load?
|
|
1364
1872
|
*/
|
|
@@ -1368,98 +1876,177 @@ export interface CmsEntryMeta {
|
|
|
1368
1876
|
*/
|
|
1369
1877
|
totalCount: number;
|
|
1370
1878
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1879
|
+
/**
|
|
1880
|
+
* Create
|
|
1881
|
+
*/
|
|
1882
|
+
export interface OnEntryBeforeCreateTopicParams {
|
|
1883
|
+
input: CreateCmsEntryInput;
|
|
1373
1884
|
entry: CmsEntry;
|
|
1374
|
-
model:
|
|
1885
|
+
model: StorageOperationsCmsModel;
|
|
1375
1886
|
}
|
|
1376
|
-
export interface
|
|
1377
|
-
input:
|
|
1887
|
+
export interface OnEntryAfterCreateTopicParams {
|
|
1888
|
+
input: CreateCmsEntryInput;
|
|
1378
1889
|
entry: CmsEntry;
|
|
1379
|
-
model:
|
|
1890
|
+
model: StorageOperationsCmsModel;
|
|
1380
1891
|
storageEntry: CmsEntry;
|
|
1381
1892
|
}
|
|
1382
|
-
export interface
|
|
1893
|
+
export interface OnEntryCreateErrorTopicParams {
|
|
1894
|
+
error: Error;
|
|
1895
|
+
input: CreateCmsEntryInput;
|
|
1383
1896
|
entry: CmsEntry;
|
|
1384
1897
|
model: CmsModel;
|
|
1385
1898
|
}
|
|
1386
|
-
|
|
1899
|
+
/**
|
|
1900
|
+
* Revision Create
|
|
1901
|
+
*/
|
|
1902
|
+
export interface OnEntryRevisionBeforeCreateTopicParams {
|
|
1903
|
+
input: CreateFromCmsEntryInput;
|
|
1904
|
+
entry: CmsEntry;
|
|
1905
|
+
original: CmsEntry;
|
|
1906
|
+
model: StorageOperationsCmsModel;
|
|
1907
|
+
}
|
|
1908
|
+
export interface OnEntryRevisionAfterCreateTopicParams {
|
|
1909
|
+
input: CreateFromCmsEntryInput;
|
|
1387
1910
|
entry: CmsEntry;
|
|
1388
|
-
|
|
1911
|
+
original: CmsEntry;
|
|
1912
|
+
model: StorageOperationsCmsModel;
|
|
1389
1913
|
storageEntry: CmsEntry;
|
|
1390
1914
|
}
|
|
1391
|
-
export interface
|
|
1392
|
-
|
|
1915
|
+
export interface OnEntryCreateRevisionErrorTopicParams {
|
|
1916
|
+
error: Error;
|
|
1917
|
+
input: CreateFromCmsEntryInput;
|
|
1393
1918
|
original: CmsEntry;
|
|
1394
1919
|
entry: CmsEntry;
|
|
1395
1920
|
model: CmsModel;
|
|
1396
1921
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1922
|
+
/**
|
|
1923
|
+
* Update
|
|
1924
|
+
*/
|
|
1925
|
+
export interface OnEntryBeforeUpdateTopicParams {
|
|
1926
|
+
input: UpdateCmsEntryInput;
|
|
1399
1927
|
original: CmsEntry;
|
|
1400
1928
|
entry: CmsEntry;
|
|
1401
|
-
model:
|
|
1929
|
+
model: StorageOperationsCmsModel;
|
|
1930
|
+
}
|
|
1931
|
+
export interface OnEntryAfterUpdateTopicParams {
|
|
1932
|
+
input: UpdateCmsEntryInput;
|
|
1933
|
+
original: CmsEntry;
|
|
1934
|
+
entry: CmsEntry;
|
|
1935
|
+
model: StorageOperationsCmsModel;
|
|
1402
1936
|
storageEntry: CmsEntry;
|
|
1403
1937
|
}
|
|
1404
|
-
export interface
|
|
1938
|
+
export interface OnEntryUpdateErrorTopicParams {
|
|
1939
|
+
error: Error;
|
|
1940
|
+
input: CreateFromCmsEntryInput;
|
|
1405
1941
|
entry: CmsEntry;
|
|
1406
1942
|
model: CmsModel;
|
|
1407
1943
|
}
|
|
1408
|
-
|
|
1944
|
+
/**
|
|
1945
|
+
* Publish
|
|
1946
|
+
*/
|
|
1947
|
+
export interface OnEntryBeforePublishTopicParams {
|
|
1409
1948
|
entry: CmsEntry;
|
|
1410
|
-
model:
|
|
1949
|
+
model: StorageOperationsCmsModel;
|
|
1950
|
+
}
|
|
1951
|
+
export interface OnEntryAfterPublishTopicParams {
|
|
1952
|
+
entry: CmsEntry;
|
|
1953
|
+
model: StorageOperationsCmsModel;
|
|
1411
1954
|
storageEntry: CmsEntry;
|
|
1412
1955
|
}
|
|
1413
|
-
export interface
|
|
1956
|
+
export interface OnEntryPublishErrorTopicParams {
|
|
1957
|
+
error: Error;
|
|
1414
1958
|
entry: CmsEntry;
|
|
1415
|
-
model:
|
|
1959
|
+
model: StorageOperationsCmsModel;
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* Republish
|
|
1963
|
+
*/
|
|
1964
|
+
export interface OnEntryBeforeRepublishTopicParams {
|
|
1965
|
+
entry: CmsEntry;
|
|
1966
|
+
model: StorageOperationsCmsModel;
|
|
1416
1967
|
}
|
|
1417
|
-
export interface
|
|
1968
|
+
export interface OnEntryAfterRepublishTopicParams {
|
|
1418
1969
|
entry: CmsEntry;
|
|
1419
|
-
model:
|
|
1970
|
+
model: StorageOperationsCmsModel;
|
|
1420
1971
|
storageEntry: CmsEntry;
|
|
1421
1972
|
}
|
|
1422
|
-
export interface
|
|
1973
|
+
export interface OnEntryRepublishErrorTopicParams {
|
|
1974
|
+
error: Error;
|
|
1423
1975
|
entry: CmsEntry;
|
|
1424
|
-
model:
|
|
1976
|
+
model: StorageOperationsCmsModel;
|
|
1425
1977
|
}
|
|
1426
|
-
|
|
1978
|
+
/**
|
|
1979
|
+
* Unpublish
|
|
1980
|
+
*/
|
|
1981
|
+
export interface OnEntryBeforeUnpublishTopicParams {
|
|
1427
1982
|
entry: CmsEntry;
|
|
1428
|
-
model:
|
|
1983
|
+
model: StorageOperationsCmsModel;
|
|
1984
|
+
}
|
|
1985
|
+
export interface OnEntryAfterUnpublishTopicParams {
|
|
1986
|
+
entry: CmsEntry;
|
|
1987
|
+
model: StorageOperationsCmsModel;
|
|
1429
1988
|
storageEntry: CmsEntry;
|
|
1430
1989
|
}
|
|
1431
|
-
export interface
|
|
1990
|
+
export interface OnEntryUnpublishErrorTopicParams {
|
|
1991
|
+
error: Error;
|
|
1432
1992
|
entry: CmsEntry;
|
|
1433
1993
|
model: CmsModel;
|
|
1434
1994
|
}
|
|
1435
|
-
export interface
|
|
1995
|
+
export interface OnEntryBeforeDeleteTopicParams {
|
|
1436
1996
|
entry: CmsEntry;
|
|
1437
|
-
model:
|
|
1438
|
-
storageEntry: CmsEntry;
|
|
1997
|
+
model: StorageOperationsCmsModel;
|
|
1439
1998
|
}
|
|
1440
|
-
export interface
|
|
1999
|
+
export interface OnEntryAfterDeleteTopicParams {
|
|
1441
2000
|
entry: CmsEntry;
|
|
1442
|
-
model:
|
|
2001
|
+
model: StorageOperationsCmsModel;
|
|
1443
2002
|
}
|
|
1444
|
-
export interface
|
|
2003
|
+
export interface OnEntryDeleteErrorTopicParams {
|
|
2004
|
+
error: Error;
|
|
1445
2005
|
entry: CmsEntry;
|
|
1446
|
-
model:
|
|
2006
|
+
model: StorageOperationsCmsModel;
|
|
1447
2007
|
}
|
|
1448
|
-
export interface
|
|
2008
|
+
export interface OnEntryRevisionBeforeDeleteTopicParams {
|
|
1449
2009
|
entry: CmsEntry;
|
|
1450
|
-
model:
|
|
2010
|
+
model: StorageOperationsCmsModel;
|
|
1451
2011
|
}
|
|
1452
|
-
export interface
|
|
2012
|
+
export interface OnEntryRevisionAfterDeleteTopicParams {
|
|
1453
2013
|
entry: CmsEntry;
|
|
1454
|
-
model:
|
|
2014
|
+
model: StorageOperationsCmsModel;
|
|
1455
2015
|
}
|
|
1456
|
-
export interface
|
|
1457
|
-
|
|
2016
|
+
export interface OnEntryRevisionDeleteErrorTopicParams {
|
|
2017
|
+
error: Error;
|
|
2018
|
+
entry: CmsEntry;
|
|
2019
|
+
model: StorageOperationsCmsModel;
|
|
2020
|
+
}
|
|
2021
|
+
export interface OnEntryBeforeGetTopicParams {
|
|
2022
|
+
model: StorageOperationsCmsModel;
|
|
1458
2023
|
where: CmsEntryListWhere;
|
|
1459
2024
|
}
|
|
1460
|
-
export interface
|
|
2025
|
+
export interface EntryBeforeListTopicParams {
|
|
1461
2026
|
where: CmsEntryListWhere;
|
|
1462
|
-
model:
|
|
2027
|
+
model: StorageOperationsCmsModel;
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* @category Context
|
|
2031
|
+
* @category CmsEntry
|
|
2032
|
+
*/
|
|
2033
|
+
export interface CreateCmsEntryInput {
|
|
2034
|
+
id?: string;
|
|
2035
|
+
[key: string]: any;
|
|
2036
|
+
}
|
|
2037
|
+
/**
|
|
2038
|
+
* @category Context
|
|
2039
|
+
* @category CmsEntry
|
|
2040
|
+
*/
|
|
2041
|
+
export interface CreateFromCmsEntryInput {
|
|
2042
|
+
[key: string]: any;
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* @category Context
|
|
2046
|
+
* @category CmsEntry
|
|
2047
|
+
*/
|
|
2048
|
+
export interface UpdateCmsEntryInput {
|
|
2049
|
+
[key: string]: any;
|
|
1463
2050
|
}
|
|
1464
2051
|
/**
|
|
1465
2052
|
* Cms Entry CRUD methods in the context.
|
|
@@ -1475,7 +2062,7 @@ export interface CmsEntryContext {
|
|
|
1475
2062
|
/**
|
|
1476
2063
|
* Get a list of entries for a model by a given ID (revision).
|
|
1477
2064
|
*/
|
|
1478
|
-
getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]
|
|
2065
|
+
getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;
|
|
1479
2066
|
/**
|
|
1480
2067
|
* Get the entry for a model by a given ID.
|
|
1481
2068
|
*/
|
|
@@ -1483,9 +2070,9 @@ export interface CmsEntryContext {
|
|
|
1483
2070
|
/**
|
|
1484
2071
|
* List entries for a model. Internal method used by get, listLatest and listPublished.
|
|
1485
2072
|
*/
|
|
1486
|
-
listEntries: (model: CmsModel, params
|
|
2073
|
+
listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1487
2074
|
/**
|
|
1488
|
-
* Lists latest entries. Used for manage API.
|
|
2075
|
+
* Lists the latest entries. Used for manage API.
|
|
1489
2076
|
*/
|
|
1490
2077
|
listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
1491
2078
|
/**
|
|
@@ -1503,15 +2090,20 @@ export interface CmsEntryContext {
|
|
|
1503
2090
|
/**
|
|
1504
2091
|
* Create a new content entry.
|
|
1505
2092
|
*/
|
|
1506
|
-
createEntry: (model: CmsModel,
|
|
2093
|
+
createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1507
2094
|
/**
|
|
1508
2095
|
* Create a new entry from already existing entry.
|
|
1509
2096
|
*/
|
|
1510
|
-
createEntryRevisionFrom: (model: CmsModel, id: string,
|
|
2097
|
+
createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
|
|
1511
2098
|
/**
|
|
1512
2099
|
* Update existing entry.
|
|
1513
2100
|
*/
|
|
1514
|
-
updateEntry: (model: CmsModel, id: string,
|
|
2101
|
+
updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput, meta?: Record<string, any>) => Promise<CmsEntry>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Method that republishes entry with given identifier.
|
|
2104
|
+
* @internal
|
|
2105
|
+
*/
|
|
2106
|
+
republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
1515
2107
|
/**
|
|
1516
2108
|
* Delete only a certain revision of the entry.
|
|
1517
2109
|
*/
|
|
@@ -1529,40 +2121,105 @@ export interface CmsEntryContext {
|
|
|
1529
2121
|
*/
|
|
1530
2122
|
unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
1531
2123
|
/**
|
|
1532
|
-
*
|
|
2124
|
+
* Get all entry revisions.
|
|
1533
2125
|
*/
|
|
1534
|
-
|
|
2126
|
+
getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
|
|
1535
2127
|
/**
|
|
1536
|
-
*
|
|
2128
|
+
* Lifecyle events - deprecated.
|
|
1537
2129
|
*/
|
|
1538
|
-
requestEntryChanges: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
1539
2130
|
/**
|
|
1540
|
-
*
|
|
2131
|
+
* @deprecated
|
|
1541
2132
|
*/
|
|
1542
|
-
|
|
2133
|
+
onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;
|
|
2134
|
+
/**
|
|
2135
|
+
* @deprecated
|
|
2136
|
+
*/
|
|
2137
|
+
onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;
|
|
2138
|
+
/**
|
|
2139
|
+
* @deprecated
|
|
2140
|
+
*/
|
|
2141
|
+
onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;
|
|
2142
|
+
/**
|
|
2143
|
+
* @deprecated
|
|
2144
|
+
*/
|
|
2145
|
+
onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;
|
|
2146
|
+
/**
|
|
2147
|
+
* @deprecated
|
|
2148
|
+
*/
|
|
2149
|
+
onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
|
|
1543
2150
|
/**
|
|
1544
|
-
*
|
|
1545
|
-
*/
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
2151
|
+
* @deprecated
|
|
2152
|
+
*/
|
|
2153
|
+
onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;
|
|
2154
|
+
/**
|
|
2155
|
+
* @deprecated
|
|
2156
|
+
*/
|
|
2157
|
+
onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;
|
|
2158
|
+
/**
|
|
2159
|
+
* @deprecated
|
|
2160
|
+
*/
|
|
2161
|
+
onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;
|
|
2162
|
+
/**
|
|
2163
|
+
* @deprecated
|
|
2164
|
+
*/
|
|
2165
|
+
onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
|
|
2166
|
+
/**
|
|
2167
|
+
* @deprecated
|
|
2168
|
+
*/
|
|
2169
|
+
onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;
|
|
2170
|
+
/**
|
|
2171
|
+
* @deprecated
|
|
2172
|
+
*/
|
|
2173
|
+
onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;
|
|
2174
|
+
/**
|
|
2175
|
+
* @deprecated
|
|
2176
|
+
*/
|
|
2177
|
+
onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;
|
|
2178
|
+
/**
|
|
2179
|
+
* @deprecated
|
|
2180
|
+
*/
|
|
2181
|
+
onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
|
|
2182
|
+
/**
|
|
2183
|
+
* @deprecated
|
|
2184
|
+
*/
|
|
2185
|
+
onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
|
|
2186
|
+
/**
|
|
2187
|
+
* @deprecated
|
|
2188
|
+
*/
|
|
2189
|
+
onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;
|
|
2190
|
+
/**
|
|
2191
|
+
* @deprecated
|
|
2192
|
+
*/
|
|
2193
|
+
onBeforeEntryList: Topic<EntryBeforeListTopicParams>;
|
|
2194
|
+
/**
|
|
2195
|
+
* Lifecycle events released in 5.33.0
|
|
2196
|
+
*/
|
|
2197
|
+
onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;
|
|
2198
|
+
onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;
|
|
2199
|
+
onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;
|
|
2200
|
+
onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;
|
|
2201
|
+
onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;
|
|
2202
|
+
onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;
|
|
2203
|
+
onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;
|
|
2204
|
+
onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;
|
|
2205
|
+
onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;
|
|
2206
|
+
onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;
|
|
2207
|
+
onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;
|
|
2208
|
+
onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;
|
|
2209
|
+
onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;
|
|
2210
|
+
onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;
|
|
2211
|
+
onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;
|
|
2212
|
+
onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
|
|
2213
|
+
onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
|
|
2214
|
+
onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
|
|
2215
|
+
onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;
|
|
2216
|
+
onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;
|
|
2217
|
+
onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;
|
|
2218
|
+
onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
|
|
2219
|
+
onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
|
|
2220
|
+
onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
|
|
2221
|
+
onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;
|
|
2222
|
+
onEntryBeforeList: Topic<EntryBeforeListTopicParams>;
|
|
1566
2223
|
}
|
|
1567
2224
|
/**
|
|
1568
2225
|
* Parameters for CmsEntryResolverFactory.
|
|
@@ -1589,23 +2246,30 @@ export declare type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext
|
|
|
1589
2246
|
*/
|
|
1590
2247
|
export interface CmsSettingsPermission extends SecurityPermission {
|
|
1591
2248
|
}
|
|
2249
|
+
/**
|
|
2250
|
+
* A base security permission for CMS.
|
|
2251
|
+
*
|
|
2252
|
+
* @category SecurityPermission
|
|
2253
|
+
*/
|
|
2254
|
+
export interface BaseCmsSecurityPermission extends SecurityPermission {
|
|
2255
|
+
own?: boolean;
|
|
2256
|
+
rwd: string | number;
|
|
2257
|
+
}
|
|
1592
2258
|
/**
|
|
1593
2259
|
* A security permission for content model.
|
|
1594
2260
|
*
|
|
1595
2261
|
* @category SecurityPermission
|
|
1596
2262
|
* @category CmsModel
|
|
1597
2263
|
*/
|
|
1598
|
-
export interface CmsModelPermission extends
|
|
1599
|
-
own: boolean;
|
|
1600
|
-
rwd: string;
|
|
2264
|
+
export interface CmsModelPermission extends BaseCmsSecurityPermission {
|
|
1601
2265
|
/**
|
|
1602
|
-
*
|
|
2266
|
+
* An object representing `key: model.modelId` values where key is locale code.
|
|
1603
2267
|
*/
|
|
1604
2268
|
models?: {
|
|
1605
2269
|
[key: string]: string[];
|
|
1606
2270
|
};
|
|
1607
2271
|
/**
|
|
1608
|
-
*
|
|
2272
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
1609
2273
|
*/
|
|
1610
2274
|
groups?: {
|
|
1611
2275
|
[key: string]: string[];
|
|
@@ -1617,11 +2281,9 @@ export interface CmsModelPermission extends SecurityPermission {
|
|
|
1617
2281
|
* @category SecurityPermission
|
|
1618
2282
|
* @category CmsGroup
|
|
1619
2283
|
*/
|
|
1620
|
-
export interface CmsGroupPermission extends
|
|
1621
|
-
own: boolean;
|
|
1622
|
-
rwd: string;
|
|
2284
|
+
export interface CmsGroupPermission extends BaseCmsSecurityPermission {
|
|
1623
2285
|
/**
|
|
1624
|
-
*
|
|
2286
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
1625
2287
|
*/
|
|
1626
2288
|
groups?: {
|
|
1627
2289
|
[key: string]: string[];
|
|
@@ -1633,18 +2295,16 @@ export interface CmsGroupPermission extends SecurityPermission {
|
|
|
1633
2295
|
* @category SecurityPermission
|
|
1634
2296
|
* @category CmsEntry
|
|
1635
2297
|
*/
|
|
1636
|
-
export interface CmsEntryPermission extends
|
|
1637
|
-
|
|
1638
|
-
rwd: string;
|
|
1639
|
-
pw: string;
|
|
2298
|
+
export interface CmsEntryPermission extends BaseCmsSecurityPermission {
|
|
2299
|
+
pw?: string;
|
|
1640
2300
|
/**
|
|
1641
|
-
*
|
|
2301
|
+
* An object representing `key: model.modelId` values where key is locale code.
|
|
1642
2302
|
*/
|
|
1643
2303
|
models?: {
|
|
1644
2304
|
[key: string]: string[];
|
|
1645
2305
|
};
|
|
1646
2306
|
/**
|
|
1647
|
-
*
|
|
2307
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
1648
2308
|
*/
|
|
1649
2309
|
groups?: {
|
|
1650
2310
|
[key: string]: string[];
|
|
@@ -1665,13 +2325,10 @@ export interface CmsGroupStorageOperationsListParams {
|
|
|
1665
2325
|
sort?: string[];
|
|
1666
2326
|
}
|
|
1667
2327
|
export interface CmsGroupStorageOperationsCreateParams {
|
|
1668
|
-
input: CmsGroupCreateInput;
|
|
1669
2328
|
group: CmsGroup;
|
|
1670
2329
|
}
|
|
1671
2330
|
export interface CmsGroupStorageOperationsUpdateParams {
|
|
1672
|
-
original: CmsGroup;
|
|
1673
2331
|
group: CmsGroup;
|
|
1674
|
-
input: CmsGroupUpdateInput;
|
|
1675
2332
|
}
|
|
1676
2333
|
export interface CmsGroupStorageOperationsDeleteParams {
|
|
1677
2334
|
group: CmsGroup;
|
|
@@ -1717,13 +2374,10 @@ export interface CmsModelStorageOperationsListParams {
|
|
|
1717
2374
|
where: CmsModelStorageOperationsListWhereParams;
|
|
1718
2375
|
}
|
|
1719
2376
|
export interface CmsModelStorageOperationsCreateParams {
|
|
1720
|
-
input: CmsModelCreateInput;
|
|
1721
2377
|
model: CmsModel;
|
|
1722
2378
|
}
|
|
1723
2379
|
export interface CmsModelStorageOperationsUpdateParams {
|
|
1724
|
-
original: CmsModel;
|
|
1725
2380
|
model: CmsModel;
|
|
1726
|
-
input: CmsModelUpdateInput;
|
|
1727
2381
|
}
|
|
1728
2382
|
export interface CmsModelStorageOperationsDeleteParams {
|
|
1729
2383
|
model: CmsModel;
|
|
@@ -1763,14 +2417,12 @@ export interface CmsEntryStorageOperationsGetParams {
|
|
|
1763
2417
|
export interface CmsEntryStorageOperationsListParams {
|
|
1764
2418
|
where: CmsEntryListWhere;
|
|
1765
2419
|
sort?: CmsEntryListSort;
|
|
1766
|
-
|
|
1767
|
-
|
|
2420
|
+
search?: string;
|
|
2421
|
+
fields?: string[];
|
|
2422
|
+
limit: number;
|
|
2423
|
+
after?: string | null;
|
|
1768
2424
|
}
|
|
1769
2425
|
export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
1770
|
-
/**
|
|
1771
|
-
* Input received from the user.
|
|
1772
|
-
*/
|
|
1773
|
-
input: Record<string, any>;
|
|
1774
2426
|
/**
|
|
1775
2427
|
* Real entry, with no transformations on it.
|
|
1776
2428
|
*/
|
|
@@ -1781,22 +2433,6 @@ export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry
|
|
|
1781
2433
|
storageEntry: T;
|
|
1782
2434
|
}
|
|
1783
2435
|
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
2436
|
/**
|
|
1801
2437
|
* Real entry, with no transformations on it.
|
|
1802
2438
|
*/
|
|
@@ -1807,18 +2443,6 @@ export interface CmsEntryStorageOperationsCreateRevisionFromParams<T extends Cms
|
|
|
1807
2443
|
storageEntry: T;
|
|
1808
2444
|
}
|
|
1809
2445
|
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
2446
|
/**
|
|
1823
2447
|
* Real entry, with no transformations on it.
|
|
1824
2448
|
*/
|
|
@@ -1832,39 +2456,27 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
|
|
|
1832
2456
|
/**
|
|
1833
2457
|
* Entry that was deleted.
|
|
1834
2458
|
*/
|
|
1835
|
-
|
|
2459
|
+
entry: CmsEntry;
|
|
1836
2460
|
/**
|
|
1837
2461
|
* Entry that was deleted, directly from storage, with transformations.
|
|
1838
2462
|
*/
|
|
1839
|
-
|
|
2463
|
+
storageEntry: T;
|
|
1840
2464
|
/**
|
|
1841
2465
|
* Entry that was set as latest.
|
|
1842
2466
|
*/
|
|
1843
|
-
|
|
2467
|
+
latestEntry: CmsEntry | null;
|
|
1844
2468
|
/**
|
|
1845
2469
|
* Entry that was set as latest, directly from storage, with transformations.
|
|
1846
2470
|
*/
|
|
1847
|
-
|
|
2471
|
+
latestStorageEntry: T | null;
|
|
1848
2472
|
}
|
|
1849
|
-
export interface CmsEntryStorageOperationsDeleteParams
|
|
2473
|
+
export interface CmsEntryStorageOperationsDeleteParams {
|
|
1850
2474
|
/**
|
|
1851
2475
|
* Entry that is going to be deleted.
|
|
1852
2476
|
*/
|
|
1853
2477
|
entry: CmsEntry;
|
|
1854
|
-
/**
|
|
1855
|
-
* Entry that is going to be deleted, directly from storage.
|
|
1856
|
-
*/
|
|
1857
|
-
storageEntry: T;
|
|
1858
2478
|
}
|
|
1859
2479
|
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
2480
|
/**
|
|
1869
2481
|
* The modified entry that is going to be saved as published.
|
|
1870
2482
|
* Entry is in its original form.
|
|
@@ -1876,14 +2488,6 @@ export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntr
|
|
|
1876
2488
|
storageEntry: T;
|
|
1877
2489
|
}
|
|
1878
2490
|
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
2491
|
/**
|
|
1888
2492
|
* The modified entry that is going to be saved as unpublished.
|
|
1889
2493
|
*/
|
|
@@ -1893,45 +2497,6 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
|
|
|
1893
2497
|
*/
|
|
1894
2498
|
storageEntry: T;
|
|
1895
2499
|
}
|
|
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
2500
|
export interface CmsEntryStorageOperationsGetByIdsParams {
|
|
1936
2501
|
ids: readonly string[];
|
|
1937
2502
|
}
|
|
@@ -1988,90 +2553,76 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
|
|
|
1988
2553
|
/**
|
|
1989
2554
|
* Get all the entries of the ids.
|
|
1990
2555
|
*/
|
|
1991
|
-
getByIds: (model:
|
|
2556
|
+
getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
|
|
1992
2557
|
/**
|
|
1993
2558
|
* Get all the published entries of the ids.
|
|
1994
2559
|
*/
|
|
1995
|
-
getPublishedByIds: (model:
|
|
2560
|
+
getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
|
|
1996
2561
|
/**
|
|
1997
2562
|
* Get all the latest entries of the ids.
|
|
1998
2563
|
*/
|
|
1999
|
-
getLatestByIds: (model:
|
|
2564
|
+
getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
|
|
2000
2565
|
/**
|
|
2001
2566
|
* Get all revisions of the given entry id.
|
|
2002
2567
|
*/
|
|
2003
|
-
getRevisions: (model:
|
|
2004
|
-
/**
|
|
2005
|
-
* Get all revisions of all of the given IDs.
|
|
2006
|
-
*/
|
|
2007
|
-
getAllRevisionsByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetAllRevisionsParams) => Promise<T[]>;
|
|
2568
|
+
getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
|
|
2008
2569
|
/**
|
|
2009
2570
|
* Get the entry by the given revision id.
|
|
2010
2571
|
*/
|
|
2011
|
-
getRevisionById: (model:
|
|
2572
|
+
getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
|
|
2012
2573
|
/**
|
|
2013
2574
|
* Get the published entry by given entryId.
|
|
2014
2575
|
*/
|
|
2015
|
-
getPublishedRevisionByEntryId: (model:
|
|
2576
|
+
getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
|
|
2016
2577
|
/**
|
|
2017
2578
|
* Get the latest entry by given entryId.
|
|
2018
2579
|
*/
|
|
2019
|
-
getLatestRevisionByEntryId: (model:
|
|
2580
|
+
getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
|
|
2020
2581
|
/**
|
|
2021
2582
|
* Get the revision of the entry before given one.
|
|
2022
2583
|
*/
|
|
2023
|
-
getPreviousRevision: (model:
|
|
2584
|
+
getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
|
|
2024
2585
|
/**
|
|
2025
2586
|
* Gets entry by given params.
|
|
2026
2587
|
*/
|
|
2027
|
-
get: (model:
|
|
2588
|
+
get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
|
|
2028
2589
|
/**
|
|
2029
2590
|
* List all entries. Filterable via params.
|
|
2030
2591
|
*/
|
|
2031
|
-
list: (model:
|
|
2592
|
+
list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
|
|
2032
2593
|
/**
|
|
2033
2594
|
* Create a new entry.
|
|
2034
2595
|
*/
|
|
2035
|
-
create: (model:
|
|
2596
|
+
create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
|
|
2036
2597
|
/**
|
|
2037
2598
|
* Create a new entry from existing one.
|
|
2038
2599
|
*/
|
|
2039
|
-
createRevisionFrom: (model:
|
|
2600
|
+
createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
|
|
2040
2601
|
/**
|
|
2041
2602
|
* Update existing entry.
|
|
2042
2603
|
*/
|
|
2043
|
-
update: (model:
|
|
2604
|
+
update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
|
|
2044
2605
|
/**
|
|
2045
2606
|
* Delete the entry revision.
|
|
2046
2607
|
*/
|
|
2047
|
-
deleteRevision: (model:
|
|
2608
|
+
deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
|
|
2048
2609
|
/**
|
|
2049
2610
|
* Delete the entry.
|
|
2050
2611
|
*/
|
|
2051
|
-
delete: (model:
|
|
2612
|
+
delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
|
|
2052
2613
|
/**
|
|
2053
2614
|
* Publish the entry.
|
|
2054
2615
|
*/
|
|
2055
|
-
publish: (model:
|
|
2616
|
+
publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
|
|
2056
2617
|
/**
|
|
2057
2618
|
* Unpublish the entry.
|
|
2058
2619
|
*/
|
|
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>;
|
|
2620
|
+
unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
|
|
2068
2621
|
}
|
|
2069
2622
|
export declare enum CONTENT_ENTRY_STATUS {
|
|
2070
2623
|
DRAFT = "draft",
|
|
2071
2624
|
PUBLISHED = "published",
|
|
2072
|
-
UNPUBLISHED = "unpublished"
|
|
2073
|
-
CHANGES_REQUESTED = "changesRequested",
|
|
2074
|
-
REVIEW_REQUESTED = "reviewRequested"
|
|
2625
|
+
UNPUBLISHED = "unpublished"
|
|
2075
2626
|
}
|
|
2076
2627
|
export interface CmsSettingsStorageOperationsGetParams {
|
|
2077
2628
|
locale: string;
|
|
@@ -2081,7 +2632,6 @@ export interface CmsSettingsStorageOperationsCreateParams {
|
|
|
2081
2632
|
settings: CmsSettings;
|
|
2082
2633
|
}
|
|
2083
2634
|
export interface CmsSettingsStorageOperationsUpdateParams {
|
|
2084
|
-
original: CmsSettings;
|
|
2085
2635
|
settings: CmsSettings;
|
|
2086
2636
|
}
|
|
2087
2637
|
export interface CmsSettingsStorageOperations {
|
|
@@ -2114,7 +2664,6 @@ export interface CmsSystemStorageOperationsCreateParams {
|
|
|
2114
2664
|
}
|
|
2115
2665
|
export interface CmsSystemStorageOperationsUpdateParams {
|
|
2116
2666
|
system: CmsSystem;
|
|
2117
|
-
original: CmsSystem;
|
|
2118
2667
|
}
|
|
2119
2668
|
export interface CmsSystemStorageOperations {
|
|
2120
2669
|
/**
|
|
@@ -2130,20 +2679,17 @@ export interface CmsSystemStorageOperations {
|
|
|
2130
2679
|
*/
|
|
2131
2680
|
update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
|
|
2132
2681
|
}
|
|
2133
|
-
export interface HeadlessCmsStorageOperations {
|
|
2682
|
+
export interface HeadlessCmsStorageOperations<C = CmsContext> {
|
|
2683
|
+
name: string;
|
|
2134
2684
|
system: CmsSystemStorageOperations;
|
|
2135
2685
|
settings: CmsSettingsStorageOperations;
|
|
2136
2686
|
groups: CmsGroupStorageOperations;
|
|
2137
2687
|
models: CmsModelStorageOperations;
|
|
2138
2688
|
entries: CmsEntryStorageOperations;
|
|
2139
|
-
init?: (cms: HeadlessCms) => Promise<void>;
|
|
2140
|
-
/**
|
|
2141
|
-
* Plugins to be attached to the main context.
|
|
2142
|
-
*/
|
|
2143
|
-
plugins?: Plugin[] | Plugin[][];
|
|
2144
2689
|
/**
|
|
2145
|
-
*
|
|
2690
|
+
* Either attach something from the storage operations or run something in it.
|
|
2146
2691
|
*/
|
|
2147
|
-
|
|
2692
|
+
beforeInit?: (context: C) => Promise<void>;
|
|
2693
|
+
init?: (context: C) => Promise<void>;
|
|
2148
2694
|
}
|
|
2149
2695
|
export {};
|