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