@webiny/api-headless-cms 5.35.0 → 5.35.1

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.
Files changed (48) hide show
  1. package/crud/contentEntry.crud.js +110 -4
  2. package/crud/contentEntry.crud.js.map +1 -1
  3. package/crud/contentModel/validation.d.ts +87 -87
  4. package/crud/contentModelGroup/validation.d.ts +4 -4
  5. package/graphql/index.d.ts +1 -1
  6. package/graphql/schema/baseSchema.js +15 -0
  7. package/graphql/schema/baseSchema.js.map +1 -1
  8. package/graphql/schema/createManageResolvers.js +4 -0
  9. package/graphql/schema/createManageResolvers.js.map +1 -1
  10. package/graphql/schema/createManageSDL.js +4 -2
  11. package/graphql/schema/createManageSDL.js.map +1 -1
  12. package/graphql/schema/resolvers/manage/resolveDelete.d.ts +2 -1
  13. package/graphql/schema/resolvers/manage/resolveDelete.js +13 -3
  14. package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
  15. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.d.ts +7 -0
  16. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +20 -0
  17. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -0
  18. package/graphql/schema/schemaPlugins.js +0 -7
  19. package/graphql/schema/schemaPlugins.js.map +1 -1
  20. package/index.d.ts +1 -1
  21. package/package.json +36 -35
  22. package/types.d.ts +52 -8
  23. package/types.js +7 -0
  24. package/types.js.map +1 -1
  25. package/crud/contentModel/createFieldModels.d.ts +0 -2
  26. package/crud/contentModel/createFieldModels.js +0 -26
  27. package/crud/contentModel/createFieldModels.js.map +0 -1
  28. package/crud/contentModel/fieldIdValidation.d.ts +0 -1
  29. package/crud/contentModel/fieldIdValidation.js +0 -25
  30. package/crud/contentModel/fieldIdValidation.js.map +0 -1
  31. package/crud/contentModel/idValidation.d.ts +0 -1
  32. package/crud/contentModel/idValidation.js +0 -22
  33. package/crud/contentModel/idValidation.js.map +0 -1
  34. package/crud/contentModel/models.d.ts +0 -4
  35. package/crud/contentModel/models.js +0 -192
  36. package/crud/contentModel/models.js.map +0 -1
  37. package/crud/contentModel/systemFields.d.ts +0 -1
  38. package/crud/contentModel/systemFields.js +0 -8
  39. package/crud/contentModel/systemFields.js.map +0 -1
  40. package/upgrades/5.33.0/index.d.ts +0 -3
  41. package/upgrades/5.33.0/index.js +0 -182
  42. package/upgrades/5.33.0/index.js.map +0 -1
  43. package/upgrades/index.d.ts +0 -1
  44. package/upgrades/index.js +0 -12
  45. package/upgrades/index.js.map +0 -1
  46. package/utils/pluralizedTypeName.d.ts +0 -1
  47. package/utils/pluralizedTypeName.js +0 -26
  48. package/utils/pluralizedTypeName.js.map +0 -1
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["CONTENT_ENTRY_STATUS"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Context } from \"@webiny/api/types\";\nimport {\n GraphQLFieldResolver,\n GraphQLSchemaDefinition,\n Resolvers\n} from \"@webiny/handler-graphql/types\";\nimport { SecurityPermission } from \"@webiny/api-security/types\";\nimport { DbContext } from \"@webiny/handler-db/types\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { CmsModelConverterCallable } from \"~/utils/converters/ConverterCollection\";\n\nexport type ApiEndpoint = \"manage\" | \"preview\" | \"read\";\n\nexport interface HeadlessCms\n extends CmsSettingsContext,\n CmsSystemContext,\n CmsGroupContext,\n CmsModelContext,\n CmsEntryContext {\n /**\n * API type\n */\n type: ApiEndpoint | null;\n /**\n * Requested locale\n */\n locale: string;\n /**\n * returns an instance of current locale\n */\n getLocale: () => I18NLocale;\n /**\n * Means this request is a READ API\n */\n READ: boolean;\n /**\n * Means this request is a MANAGE API\n */\n MANAGE: boolean;\n /**\n * Means this request is a PREVIEW API\n */\n PREVIEW: boolean;\n /**\n * The storage operations loaded for current context.\n */\n storageOperations: HeadlessCmsStorageOperations;\n}\n\n/**\n * @description This combines all contexts used in the CMS into a single one.\n *\n * @category Context\n */\nexport interface CmsContext\n extends Context,\n DbContext,\n // HttpContext,\n I18NContext,\n FileManagerContext {\n cms: HeadlessCms;\n}\n\ninterface CmsModelFieldPredefinedValuesValue {\n value: string;\n label: string;\n /**\n * Default selected predefined value.\n */\n selected?: boolean;\n}\n\n/**\n * Object containing content model field predefined options and values.\n *\n * @category CmsModelField\n */\nexport interface CmsModelFieldPredefinedValues {\n /**\n * Are predefined field values enabled?\n */\n enabled: boolean;\n /**\n * Predefined values array.\n */\n values: CmsModelFieldPredefinedValuesValue[];\n}\n\n/**\n * Object containing content model field renderer options.\n *\n * @category CmsModelField\n */\ninterface CmsModelFieldRenderer {\n /**\n * Name of the field renderer. Must have one in field renderer plugins.\n * Can be blank to let automatically determine the renderer.\n */\n name: string;\n}\n\n/**\n * A definition for content model field settings.\n *\n * @category ModelField\n * @category Database model\n */\nexport interface CmsModelFieldSettings {\n /**\n * Predefined values (text, number)\n * The default value for the field in case it is not predefined values field.\n */\n defaultValue?: string | number | null | undefined;\n /**\n * Object field has child fields.\n */\n fields?: CmsModelField[];\n /**\n * Is the file field images only one?\n */\n imagesOnly?: boolean;\n /**\n * Object field has child fields - so it needs to have a layout.\n */\n layout?: string[][];\n /**\n * Ref field.\n */\n models?: Pick<CmsModel, \"modelId\">[];\n /**\n * Date field.\n */\n type?: string;\n /**\n * There are a lot of other settings that are possible to add, so we keep the type opened.\n */\n [key: string]: any;\n}\n\nexport type CmsModelFieldType =\n | \"boolean\"\n | \"datetime\"\n | \"file\"\n | \"long-text\"\n | \"number\"\n | \"object\"\n | \"ref\"\n | \"rich-text\"\n | \"text\"\n | \"dynamicZone\"\n | string;\n/**\n * A definition for content model field. This type exists on the app side as well.\n *\n * @category ModelField\n * @category Database model\n */\nexport interface CmsModelField {\n /**\n * A generated unique ID for the model field.\n * MUST be absolute unique throughout the models.\n * Must be in form of a-zA-Z0-9.\n *\n * We generate a unique id value when you're building a model via UI,\n * but when user is creating a model via a plugin it is up to them to be careful about this.\n */\n id: string;\n /**\n * A type of the field.\n * We are defining our built-in fields, so people know which are available by the default.\n */\n type: CmsModelFieldType;\n /**\n * A unique storage ID for storing actual values.\n * Must in form of a-zA-Z0-9@a-zA-Z0-9\n *\n * This is an auto-generated value: uses `id` and `type`\n *\n * This is used as path for the entry value.\n */\n storageId: `${string}@${string}` | string;\n /**\n * Field identifier for the model field that will be available to the outside world.\n * `storageId` is used as path (or column) to store the data.\n *\n * Must in form of a-zA-Z0-9.\n *\n * This value MUST be unique in the CmsModel.\n */\n fieldId: string;\n /**\n * A label for the field\n */\n label: string;\n /**\n * Text below the field to clarify what is it meant to be in the field value\n */\n helpText?: string | null;\n /**\n * Text to be displayed in the field\n */\n placeholderText?: string | null;\n /**\n * Are predefined values enabled? And list of them\n */\n predefinedValues?: CmsModelFieldPredefinedValues;\n /**\n * Field renderer. Blank if determined automatically.\n */\n renderer?: CmsModelFieldRenderer;\n /**\n * List of validations for the field\n *\n * @default []\n */\n validation?: CmsModelFieldValidation[];\n /**\n * List of validations for the list of values, when a field is set to accept a list of values.\n * These validations will be applied to the entire list, and `validation` (see above) will be applied\n * to each individual value in the list.\n *\n * @default []\n */\n listValidation?: CmsModelFieldValidation[];\n /**\n * Is this a multiple values field?\n *\n */\n multipleValues?: boolean;\n /**\n * Fields can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * Any user defined settings.\n *\n * @default {}\n */\n settings?: CmsModelFieldSettings;\n}\n\nexport interface CmsDynamicZoneTemplate {\n id: string;\n name: string;\n gqlTypeName: string;\n description: string;\n icon: string;\n fields: CmsModelField[];\n layout: string[][];\n validation: CmsModelFieldValidation[];\n}\n\n/**\n * A definition for dynamic-zone field to show possible type of the field in settings.\n */\nexport interface CmsModelDynamicZoneField extends CmsModelField {\n /**\n * Settings object for the field. Contains `templates` property.\n */\n settings: {\n templates: CmsDynamicZoneTemplate[];\n };\n}\n\n/**\n * Used for our internal functionality.\n */\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | null;\n}\n\nexport interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {\n parent?: CmsModelDynamicZoneFieldWithParent | null;\n}\n\n/**\n * A definition for dateTime field to show possible type of the field in settings.\n */\nexport interface CmsModelDateTimeField extends CmsModelField {\n /**\n * Settings object for the field. Contains `type` property.\n */\n settings: {\n type: \"time\" | \"date\" | \"dateTimeWithoutTimezone\" | \"dateTimeWithTimezone\";\n };\n}\n\n/**\n * Arguments for the field validator validate method.\n *\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorValidateParams<T = any> {\n /**\n * A value to be validated.\n */\n value: T;\n /**\n * Options from the CmsModelField validations.\n *\n * @see CmsModelField.validation\n * @see CmsModelField.listValidation\n */\n validator: CmsModelFieldValidation;\n /**\n * An instance of the current context.\n */\n context: CmsContext;\n /**\n * Field being validated.\n */\n field: CmsModelField;\n /**\n * An instance of the content model being validated.\n */\n model: CmsModel;\n /**\n * If entry is sent it means it is an update operation.\n * First usage is for the unique field value.\n */\n entry?: CmsEntry;\n}\n\n/**\n * Definition for the field validator.\n *\n * @category Plugin\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-model-field-validator\";\n /**\n * Actual validator definition.\n */\n validator: {\n /**\n * Name of the validator.\n */\n name: string;\n /**\n * Validation method.\n */\n validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;\n };\n}\n\n/**\n * A pattern validator for the content entry field value.\n *\n * @category Plugin\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldPatternValidatorPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-validator-pattern\";\n /**\n * A pattern object for the validator.\n */\n pattern: {\n /**\n * name of the pattern.\n */\n name: string;\n /**\n * RegExp of the validator.\n */\n regex: string;\n /**\n * RegExp flags\n */\n flags: string;\n };\n}\n\n/**\n * Locked field in the content model\n *\n * @see CmsModel.lockedFields\n *\n * @category ModelField\n */\nexport interface LockedField {\n /**\n * Locked field storage ID - one used to store values.\n * We cannot change this due to old systems.\n */\n fieldId: string;\n /**\n * Is the field multiple values field?\n */\n multipleValues: boolean;\n /**\n * Field type.\n */\n type: string;\n [key: string]: any;\n}\n\n/**\n * @category Database model\n * @category CmsModel\n */\nexport interface CmsModelGroup {\n /**\n * Generated ID of the group\n */\n id: string;\n /**\n * Name of the group\n */\n name: string;\n}\n\n/**\n * Base CMS Model. Should not be exported and used outside of this package.\n *\n * @category Database model\n * @category CmsModel\n */\nexport interface CmsModel {\n /**\n * Name of the content model.\n */\n name: string;\n /**\n * Unique ID for the content model. Created from name if not defined by user.\n */\n modelId: string;\n /**\n * Name of the content model in singular form to be used in the API.\n * example:\n * - Article\n * - Fruit\n * - Vegetable\n * - Car\n */\n singularApiName: string;\n /**\n * Name of the content model in plural form to be used in the API.\n * example:\n * - Articles\n * - Fruits\n * - Vegetables\n * - Cars\n */\n pluralApiName: string;\n /**\n * Model tenant.\n */\n tenant: string;\n /**\n * Locale this model belongs to.\n */\n locale: string;\n /**\n * Cms Group reference object.\n */\n group: CmsModelGroup;\n /**\n * Icon for the content model.\n */\n icon?: string | null;\n /**\n * Description for the content model.\n */\n description: string | null;\n /**\n * Date created\n */\n createdOn?: string;\n /**\n * Date saved. Changes on both save and create.\n */\n savedOn?: string;\n /**\n * CreatedBy object wrapper. Contains id, name and type of the user.\n */\n createdBy?: CmsIdentity;\n /**\n * List of fields defining entry values.\n */\n fields: CmsModelField[];\n /**\n * Admin UI field layout\n *\n * ```ts\n * layout: [\n * [field1id, field2id],\n * [field3id]\n * ]\n * ```\n */\n layout: string[][];\n /**\n * Models can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * List of locked fields. Updated when entry is saved and a field has been used.\n */\n lockedFields?: LockedField[];\n /**\n * The field that is being displayed as entry title.\n * It is picked as first available text field. Or user can select own field.\n */\n titleFieldId: string;\n /**\n * The field which is displayed as the description one.\n * Only way this is null or undefined is that there are no long-text fields to be set as description.\n */\n descriptionFieldId?: string | null;\n /**\n * The field which is displayed as the image.\n * Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.\n */\n imageFieldId?: string | null;\n /**\n * The version of Webiny which this record was stored with.\n */\n webinyVersion: string;\n\n /**\n * Is model private?\n * This is meant to be used for some internal models - will not be visible in the schema.\n * Only available for the plugin constructed models.\n */\n isPrivate?: boolean;\n}\n\n/**\n * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter\n *\n * @category CmsModel\n */\nexport interface StorageOperationsCmsModel extends CmsModel {\n convertValueKeyToStorage: CmsModelConverterCallable;\n convertValueKeyFromStorage: CmsModelConverterCallable;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsModelFieldDefinition {\n fields: string;\n typeDefs?: string;\n}\n\ninterface CmsModelFieldToGraphQLCreateResolverParams<TField> {\n models: CmsModel[];\n model: CmsModel;\n graphQLType: string;\n field: TField;\n createFieldResolvers: any;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\n\nexport interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {\n (params: CmsModelFieldToGraphQLCreateResolverParams<TField>):\n | GraphQLFieldResolver\n | { resolver: GraphQLFieldResolver | null; typeResolvers: Resolvers<CmsContext> }\n | false;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<\n TField extends CmsModelField = CmsModelField\n> {\n fields: TField[];\n originalFields: TField[];\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<\n TField extends CmsModelField = CmsModelField\n> {\n field: TField;\n originalField?: TField;\n validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFields<\n TField extends CmsModelField = CmsModelField\n> {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;\n}\n\n/**\n * @category Plugin\n * @category ModelField\n * @category GraphQL\n */\nexport interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField>\n extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-graphql\";\n /**\n * Field type name which must be exact as the one in `CmsEditorFieldTypePlugin` plugin.\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: string;\n /**\n * Is the field searchable via the GraphQL?\n *\n * ```ts\n * isSearchable: false\n * ```\n */\n isSearchable: boolean;\n /**\n * Is the field searchable via full text search?\n *\n * Field is not full text searchable by default.\n * ```ts\n * fullTextSearch: false\n * ```\n */\n fullTextSearch?: boolean;\n /**\n * Is the field sortable via the GraphQL?\n *\n * ```ts\n * isSortable: true\n * ```\n */\n isSortable: boolean;\n /**\n * Optional method which creates the storageId.\n * Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.\n *\n * ```ts\n * createStorageId: ({field}) => {\n * if (field.settings.type === \"time) {\n * return `${field.type}_time@${field.id}`\n * }\n * // use default method\n * return undefined;\n * }\n * ```\n */\n createStorageId?: (params: { model: CmsModel; field: TField }) => string | null | undefined;\n /**\n * Read API methods.\n */\n read: {\n /**\n * Definition for get filtering for GraphQL.\n *\n * ```ts\n * read: {\n * createGetFilters({ field }) {\n * return `${field.fieldId}: MyField`;\n * }\n * }\n * ```\n */\n createGetFilters?(params: { model: CmsModel; field: TField }): string;\n /**\n * Definition for list filtering for GraphQL.\n *\n * ```ts\n * read: {\n * createListFilters({ field }) {\n * return `\n * ${field.fieldId}: MyType\n * ${field.fieldId}_not: MyType\n * ${field.fieldId}_in: [MyType]\n * ${field.fieldId}_not_in: [MyType]\n * `;\n * }\n * }\n * ```\n */\n createListFilters?(params: {\n model: CmsModel;\n field: TField;\n plugins: CmsFieldTypePlugins;\n }): string;\n /**\n * Definition of the field type for GraphQL - be aware if multiple values is selected.\n *\n * ```ts\n * read: {\n * createTypeField({ field }) {\n * if (field.multipleValues) {\n * return `${field.fieldId}: [MyFieldType]`;\n * }\n *\n * return `${field.fieldId}: MyField`;\n * }\n * }\n * ```\n */\n createTypeField(params: {\n models: CmsModel[];\n model: CmsModel;\n field: TField;\n fieldTypePlugins: CmsFieldTypePlugins;\n }): CmsModelFieldDefinition | string | null;\n /**\n * Definition for field resolver.\n * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.\n *\n * ```ts\n * read: {\n * createResolver({ field }) {\n * return instance => {\n * return instance.values[field.storageId];\n * };\n * }\n * }\n * ```\n */\n createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;\n /**\n * Read API schema definitions for the field and resolvers for them.\n *\n * ```ts\n * read: {\n * createSchema() {\n * return {\n * typeDefs: `\n * myField {\n * id\n * date\n * }\n * `,\n * resolvers: {}\n * }\n * }\n * }\n * ```\n */\n createSchema?: (params: { models: CmsModel[] }) => GraphQLSchemaDefinition<CmsContext>;\n };\n manage: {\n /**\n * Definition for list filtering for GraphQL.\n *\n * ```ts\n * manage: {\n * createListFilters({ field }) {\n * return `\n * ${field.fieldId}: MyType\n * ${field.fieldId}_not: MyType\n * ${field.fieldId}_in: [MyType]\n * ${field.fieldId}_not_in: [MyType]\n * `;\n * }\n * }\n * ```\n */\n createListFilters?: (params: {\n model: CmsModel;\n field: TField;\n plugins: CmsFieldTypePlugins;\n }) => string;\n /**\n * Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.\n *\n * ```ts\n * createSchema() {\n * return {\n * typeDefs: `\n * myField {\n * id\n * date\n * }\n * `,\n * resolvers: {}\n * }\n * }\n * ```\n */\n createSchema?: (params: { models: CmsModel[] }) => GraphQLSchemaDefinition<CmsContext>;\n /**\n * Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.\n *\n * ```ts\n * manage: {\n * createTypeField({ field }) {\n * if (field.multipleValues) {\n * return field.fieldId + \": [MyType]\";\n * }\n *\n * return field.fieldId + \": MyType\";\n * }\n * }\n * ```\n */\n createTypeField: (params: {\n models: CmsModel[];\n model: CmsModel;\n field: TField;\n fieldTypePlugins: CmsFieldTypePlugins;\n }) => CmsModelFieldDefinition | string | null;\n /**\n * Definition for input GraphQL field type.\n *\n * ```ts\n * manage: {\n * createInputField({ field }) {\n * if (field.multipleValues) {\n * return field.fieldId + \": [MyField]\";\n * }\n *\n * return field.fieldId + \": MyField\";\n * }\n * }\n * ```\n */\n createInputField: (params: {\n models: CmsModel[];\n model: CmsModel;\n field: TField;\n fieldTypePlugins: CmsFieldTypePlugins;\n }) => CmsModelFieldDefinition | string | null;\n /**\n * Definition for field resolver.\n * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.\n *\n * ```ts\n * manage: {\n * createResolver({ field }) {\n * return instance => {\n * return instance.values[field.storageId];\n * };\n * }\n * }\n * ```\n */\n createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;\n };\n /**\n *\n * @param field\n */\n validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;\n}\n\n/**\n * Check for content model locked field.\n * A custom plugin definable by the user.\n *\n * @category CmsModel\n * @category Plugin\n */\nexport interface CmsModelLockedFieldPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-locked-field\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n */\n fieldType: string;\n /**\n * A method to check if field really is locked.\n */\n checkLockedField?: (params: { lockedField: LockedField; field: CmsModelField }) => void;\n /**\n * A method to get the locked field data.\n */\n getLockedFieldData?: (params: { field: CmsModelField }) => Record<string, any>;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsFieldTypePlugins {\n [key: string]: CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * An interface describing the reference to a user that created some data in the database.\n *\n * @category General\n */\nexport interface CmsIdentity {\n /**\n * ID if the user.\n */\n id: string;\n /**\n * Full name of the user.\n */\n displayName: string | null;\n /**\n * Type of the user (admin, user)\n */\n type: string;\n}\n\n/**\n * Representation of settings database model.\n *\n * @category Database model\n */\nexport interface CmsSettings {\n /**\n * Last content model change. Used to cache GraphQL schema.\n */\n contentModelLastChange: Date;\n /**\n * Settings tenant.\n */\n tenant: string;\n /**\n * Settings locale.\n */\n locale: string;\n}\n\n/**\n * Settings CRUD in context.\n *\n * @category Context\n */\nexport interface CmsSettingsContext {\n /**\n * Gets settings model from the database.\n */\n getSettings: () => Promise<CmsSettings | null>;\n /**\n * Updates settings model with a new date.\n */\n updateModelLastChange: () => Promise<void>;\n /**\n * Get the datetime when content model last changed.\n */\n getModelLastChange: () => Promise<Date | null>;\n}\n\nexport interface OnSystemBeforeInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemAfterInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemInstallErrorTopicParams {\n error: Error;\n tenant: string;\n locale: string;\n}\n\nexport type CmsSystemContext = {\n getSystemVersion: () => Promise<string | null>;\n setSystemVersion: (version: string) => Promise<void>;\n installSystem: () => Promise<void>;\n /**\n * Lifecycle events - deprecated\n */\n /**\n * @deprecated\n */\n onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;\n /**\n * @deprecated\n */\n onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;\n /**\n * Released in 5.34.0\n */\n onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;\n onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;\n onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;\n};\n\n/**\n * A GraphQL `params.data` parameter received when creating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupCreateInput {\n name: string;\n slug?: string;\n description?: string;\n icon: string;\n}\n\n/**\n * A GraphQL `params.data` parameter received when updating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupUpdateInput {\n name?: string;\n slug?: string;\n description?: string;\n icon?: string;\n}\n\n/**\n * A representation of content model group in the database.\n *\n * @category CmsGroup\n * @category Database model\n */\nexport interface CmsGroup {\n /**\n * Generated ID.\n */\n id: string;\n /**\n * Name of the group.\n */\n name: string;\n /**\n * Slug for the group. Must be unique.\n */\n slug: string;\n /**\n * Group tenant.\n */\n tenant: string;\n /**\n * Locale this group belongs to.\n */\n locale: string;\n /**\n * Description for the group.\n */\n description: string;\n /**\n * Icon for the group. In a form of \"ico/ico\".\n */\n icon: string;\n /**\n * CreatedBy reference object.\n */\n createdBy?: CmsIdentity;\n /**\n * Date group was created on.\n */\n createdOn?: string;\n /**\n * Date group was created or changed on.\n */\n savedOn?: string;\n /**\n * Which Webiny version was this record stored with.\n */\n webinyVersion: string;\n /**\n * Is group private?\n * This is meant to be used for some internal groups - will not be visible in the schema.\n * Only available for the plugin constructed groups.\n */\n isPrivate?: boolean;\n}\n\n/**\n * A `data.where` parameter received when listing content model groups.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupListParams {\n where: {\n tenant: string;\n locale: string;\n [key: string]: any;\n };\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupCreateErrorTopicParams {\n input: CmsGroupCreateInput;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupUpdateErrorTopicParams {\n input: CmsGroupUpdateInput;\n original: CmsGroup;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupDeleteErrorTopicParams {\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * Cms Group in context.\n *\n * @category Context\n * @category CmsGroup\n */\nexport interface CmsGroupContext {\n /**\n * Gets content model group by given id.\n */\n getGroup: (id: string) => Promise<CmsGroup | null>;\n /**\n * List all content model groups. Filterable via params.\n */\n listGroups: (params?: CmsGroupListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n createGroup: (data: CmsGroupCreateInput) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n updateGroup: (id: string, data: CmsGroupUpdateInput) => Promise<CmsGroup>;\n /**\n * Delete content model group by given id.\n */\n deleteGroup: (id: string) => Promise<boolean>;\n /**\n * Clear the cached groups.\n */\n clearGroupsCache: () => void;\n /**\n * Lifecycle events - deprecated\n */\n /**\n * @deprecated\n */\n onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;\n /**\n * @deprecated\n */\n onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;\n /**\n * Lifecycle events released in 5.33.0\n */\n onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;\n onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;\n onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;\n onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;\n onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;\n onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;\n onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;\n onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;\n onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;\n}\n\n/**\n * Definition for content model field validator.\n *\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidation {\n name: string;\n message: string;\n settings?: {\n value?: string | number;\n values?: string[];\n preset?: string;\n [key: string]: any;\n };\n}\n\n/**\n * A GraphQL `params.data` parameter received when creating content model.\n *\n * @category GraphQL params\n * @category CmsModel\n */\nexport interface CmsModelCreateInput {\n /**\n * Name of the content model.\n */\n name: string;\n /**\n * Singular name of the content model to be used in the API.\n */\n singularApiName: string;\n /**\n * Plural name of the content model to be used in the API.\n */\n pluralApiName: string;\n /**\n * Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.\n */\n modelId?: string;\n /**\n * Description of the content model.\n */\n description?: string | null;\n /**\n * Group where to put the content model in.\n */\n group: string;\n /**\n * A list of content model fields to define the entry values.\n */\n fields?: CmsModelFieldInput[];\n /**\n * Admin UI field layout\n *\n * ```ts\n * layout: [\n * [field1id, field2id],\n * [field3id]\n * ]\n * ```\n */\n layout?: string[][];\n /**\n * Models can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * Fields fieldId which are picked to represent the CMS entry.\n */\n titleFieldId?: string | null;\n descriptionFieldId?: string | null;\n imageFieldId?: string | null;\n}\n\n/**\n * A GraphQL `params.data` parameter received when creating content model from existing model.\n *\n * @category GraphQL params\n * @category CmsModel\n */\nexport interface CmsModelCreateFromInput extends CmsModelCreateInput {\n /**\n * Locale into which we want to clone the model into.\n */\n locale?: string;\n}\n\n/**\n * A definition for content model field received from the user.\n *\n * Input type for `CmsModelField`.\n * @see CmsModelField\n *\n * @category GraphQL params\n * @category ModelField\n */\nexport interface CmsModelFieldInput {\n /**\n * Generated ID.\n */\n id: string;\n /**\n * Type of the field. A plugin for the field must be defined.\n * @see CmsModelFieldToGraphQLPlugin\n */\n type: string;\n /**\n * Field outside world identifier for the field. Must be unique in the model.\n */\n fieldId: string;\n /**\n * Label for the field.\n */\n label: string;\n /**\n * Text to display below the field to help user what to write in the field.\n */\n helpText?: string | null;\n /**\n * Text to display in the field.\n */\n placeholderText?: string | null;\n /**\n * Fields can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * Are multiple values allowed?\n */\n multipleValues?: boolean;\n /**\n * Predefined values options for the field. Check the reference for more information.\n */\n predefinedValues?: CmsModelFieldPredefinedValues;\n /**\n * Renderer options for the field. Check the reference for more information.\n */\n renderer?: CmsModelFieldRenderer;\n /**\n * List of validations for the field.\n */\n validation?: CmsModelFieldValidation[];\n /**\n * @see CmsModelField.listValidation\n */\n listValidation?: CmsModelFieldValidation[];\n /**\n * User defined settings.\n */\n settings?: Record<string, any>;\n}\n\n/**\n * A GraphQL `params.data` parameter received when updating content model.\n *\n * @category GraphQL params\n * @category CmsModel\n */\nexport interface CmsModelUpdateInput {\n /**\n * A new content model name.\n */\n name?: string;\n /**\n * A new singular name of the content model to be used in the API.\n */\n singularApiName?: string;\n /**\n * A new plural name of the content model to be used in the API.\n */\n pluralApiName?: string;\n /**\n * A group we want to move the model to.\n */\n group?: string;\n /**\n * A new description of the content model.\n */\n description?: string | null;\n /**\n * A list of content model fields to define the entry values.\n */\n fields: CmsModelFieldInput[];\n /**\n * Admin UI field layout\n *\n * ```ts\n * layout: [\n * [field1id, field2id],\n * [field3id]\n * ]\n * ```\n */\n layout: string[][];\n /**\n * Fields fieldId which are picked to represent the CMS entry.\n */\n titleFieldId?: string | null;\n descriptionFieldId?: string | null;\n imageFieldId?: string | null;\n}\n\n/**\n * A plugin to load a CmsModelManager.\n *\n * @see CmsModelManager\n *\n * @category Plugin\n * @category CmsModel\n * @category CmsEntry\n */\nexport interface ModelManagerPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-content-model-manager\";\n /**\n * Specific model CmsModelManager loader. Can target exact modelId(s).\n * Be aware that if you define multiple plugins without `modelId`, last one will run.\n */\n modelId?: string[] | string;\n /**\n * Create a CmsModelManager for specific type - or new default one.\n * For reference in how is this plugin run check [contentModelManagerFactory](https://github.com/webiny/webiny-js/blob/f15676/packages/api-headless-cms/src/content/plugins/CRUD/contentModel/contentModelManagerFactory.ts)\n */\n create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;\n}\n\n/**\n * A content entry values definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntryValues {\n [key: string]: any;\n}\n\n/**\n * A content entry definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntry<T = CmsEntryValues> {\n /**\n * A version of the webiny this entry was created with.\n * This can be used when upgrading the system, so we know which entries to update.\n */\n webinyVersion: string;\n /**\n * Tenant id which is this entry for. Can be used in case of shared storage.\n */\n tenant: string;\n /**\n * Generated ID of the entry. It is shared across all the records in the database that represent a single entry.\n * So version 1, 2, ..., 2371 will have the same value in this field to link them together.\n */\n entryId: string;\n /**\n * Generated ID + version of the entry.\n */\n id: string;\n /**\n * CreatedBy object reference.\n */\n createdBy: CmsIdentity;\n /**\n * OwnedBy object reference. Can be different from CreatedBy.\n */\n ownedBy: CmsIdentity;\n /**\n * ModifiedBy object reference. Last person who modified the entry.\n */\n modifiedBy?: CmsIdentity | null;\n /**\n * A string of Date.toISOString() type.\n * Populated on creation.\n */\n createdOn: string;\n /**\n * A string of Date.toISOString() type.\n * Populated every time entry is saved.\n */\n savedOn: string;\n /**\n * Model ID of the definition for the entry.\n * @see CmsModel\n */\n modelId: string;\n /**\n * A locale of the entry.\n * @see I18NLocale.code\n */\n locale: string;\n /**\n * A string of Date.toISOString() type - if published.\n * Populated when entry is published.\n */\n publishedOn?: string;\n /**\n * A revision version of the entry.\n */\n version: number;\n /**\n * Is the entry locked?\n */\n locked: boolean;\n /**\n * Status type of the entry.\n */\n status: CmsEntryStatus;\n /**\n * A mapped storageId -> value object.\n *\n * @see CmsModelField\n */\n values: T;\n /**\n * Settings for the given entry.\n *\n * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.\n * Be aware that when accessing properties in it on old systems, it will break if not checked first.\n *\n * Available only on the Manage API in entry GraphQL type `meta.data` property.\n */\n meta?: {\n [key: string]: any;\n };\n}\n\nexport interface CmsStorageEntry extends CmsEntry {\n [key: string]: any;\n}\n\n/**\n * A definition for content model manager to be used in the code.\n * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.\n *\n * @see CmsEntryContext\n *\n * @category Context\n * @category CmsEntry\n * @category CmsModel\n */\nexport interface CmsModelManager {\n /**\n * List only published entries in the content model.\n */\n listPublished: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * List latest entries in the content model. Used for administration.\n */\n listLatest: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * Get a list of published entries by the ID list.\n */\n getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Get a list of the latest entries by the ID list.\n */\n getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Get an entry filtered by given params. Will always get one.\n */\n get: (id: string) => Promise<CmsEntry>;\n /**\n * Create an entry.\n */\n create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;\n /**\n * Update an entry.\n */\n update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;\n /**\n * Delete an entry.\n */\n delete: (id: string) => Promise<void>;\n}\n\n/**\n * Create\n */\nexport interface OnModelBeforeCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelCreateErrorTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Create From / Clone\n */\nexport interface OnModelBeforeCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelCreateFromErrorParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Update\n */\nexport interface OnModelBeforeUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelUpdateErrorTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Delete\n */\nexport interface OnModelBeforeDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelAfterDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelDeleteErrorTopicParams {\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Initialize\n */\nexport interface OnModelInitializeParams {\n model: CmsModel;\n data: Record<string, any>;\n}\n\n/**\n *\n */\nexport interface CmsModelUpdateDirectParams {\n model: CmsModel;\n original: CmsModel;\n}\n\n/**\n * Cms Model in the context.\n *\n * @category Context\n * @category CmsModel\n */\nexport interface CmsModelContext {\n /**\n * Get a single content model.\n */\n getModel: (modelId: string) => Promise<CmsModel | null>;\n /**\n * Get all content models.\n */\n listModels: () => Promise<CmsModel[]>;\n /**\n * Create a content model.\n */\n createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;\n /**\n * Create a content model from the given model - clone.\n */\n createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;\n /**\n * Update content model without data validation. Used internally.\n * @hidden\n */\n updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;\n /**\n * Update content model.\n */\n updateModel: (modelId: string, data: CmsModelUpdateInput) => Promise<CmsModel>;\n /**\n * Delete content model. Should not allow deletion if there are entries connected to it.\n */\n deleteModel: (modelId: string) => Promise<void>;\n /**\n * Possibility for users to trigger the model initialization.\n * They can hook into it and do what ever they want to.\n *\n * Primary idea behind this is creating the index, for the code models, in the ES.\n */\n initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;\n /**\n * Get an instance of CmsModelManager for given content modelId.\n *\n * @see CmsModelManager\n *\n * @deprecated use the getEntryManager() method instead\n */\n getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;\n getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;\n /**\n * Get all content model managers mapped by modelId.\n * @see CmsModelManager\n * @deprecated use getEntryManagers instead\n */\n getManagers: () => Map<string, CmsModelManager>;\n getEntryManagers: () => Map<string, CmsModelManager>;\n /**\n * Clear all the model caches.\n */\n clearModelsCache: () => void;\n /**\n * Lifecycle events - deprecated.\n */\n /**\n * @deprecated\n */\n onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;\n /**\n * @deprecated\n */\n onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;\n /**\n * Lifecycle events - released in 5.33.0\n */\n onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;\n onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;\n onModelCreateError: Topic<OnModelCreateErrorTopicParams>;\n onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;\n onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;\n onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;\n onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;\n onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;\n onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;\n onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;\n onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;\n onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;\n onModelInitialize: Topic<OnModelInitializeParams>;\n}\n\n/**\n * Available statuses for content entry.\n *\n * @category CmsEntry\n */\nexport type CmsEntryStatus = \"published\" | \"unpublished\" | \"draft\";\n\nexport interface CmsEntryListWhereRef {\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n}\n\n/**\n * Entry listing where params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Generated ID without the version.\n */\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n /**\n * Contains the owner of the entry. An \"owner\" is the identity who originally created the entry.\n * Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,\n * but the `owner` is always the original author of the entry.\n *\n * Can be sent via the API or set internal if user can see only their own entries.\n */\n ownedBy?: string;\n ownedBy_not?: string;\n ownedBy_in?: string[];\n ownedBy_not_in?: string[];\n /**\n * Who created the entry?\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n /**\n * Version of the entry.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n version?: number;\n version_lt?: number;\n version_gt?: number;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `published` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n published?: boolean;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n latest?: boolean;\n /**\n * This is to allow querying by any content model field defined by the user.\n */\n [key: string]:\n | string\n | number\n | boolean\n | undefined\n | string[]\n | number[]\n | null\n | CmsEntryListWhere[]\n | CmsEntryListWhere\n | CmsEntryListWhereRef;\n /**\n * To allow querying via nested queries, we added the AND / OR properties.\n */\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n}\n\n/**\n * Entry listing sort.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport type CmsEntryListSort = string[];\n\n/**\n * Get entry GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n}\n\n/**\n * List entries GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListParams {\n where?: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit?: number;\n after?: string | null;\n}\n\n/**\n * Meta information for GraphQL output.\n *\n * @category CmsEntry\n * @category GraphQL output\n */\nexport interface CmsEntryMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\n/**\n * Create\n */\nexport interface OnEntryBeforeCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateErrorTopicParams {\n error: Error;\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Revision Create\n */\nexport interface OnEntryRevisionBeforeCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateRevisionErrorTopicParams {\n error: Error;\n input: CreateFromCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Update\n */\nexport interface OnEntryBeforeUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUpdateErrorTopicParams {\n error: Error;\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Publish\n */\n\nexport interface OnEntryBeforePublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterPublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryPublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Republish\n */\nexport interface OnEntryBeforeRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRepublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Unpublish\n */\n\nexport interface OnEntryBeforeUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUnpublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryBeforeGetTopicParams {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n\nexport interface EntryBeforeListTopicParams {\n where: CmsEntryListWhere;\n model: CmsModel;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateCmsEntryInput {\n id?: string;\n [key: string]: any;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateFromCmsEntryInput {\n [key: string]: any;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface UpdateCmsEntryInput {\n [key: string]: any;\n}\n\n/**\n * Cms Entry CRUD methods in the context.\n *\n * @category Context\n * @category CmsEntry\n */\nexport interface CmsEntryContext {\n /**\n * Get a single content entry for a model.\n */\n getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry | null>;\n /**\n * Get a list of entries for a model by a given ID (revision).\n */\n getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;\n /**\n * Get the entry for a model by a given ID.\n */\n getEntryById: (model: CmsModel, revision: string) => Promise<CmsEntry>;\n /**\n * List entries for a model. Internal method used by get, listLatest and listPublished.\n */\n listEntries: (\n model: CmsModel,\n params: CmsEntryListParams\n ) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * Lists the latest entries. Used for manage API.\n */\n listLatestEntries: (\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * List published entries. Used for read API.\n */\n listPublishedEntries: (\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * List published entries by IDs.\n */\n getPublishedEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;\n /**\n * List latest entries by IDs.\n */\n getLatestEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Create a new content entry.\n */\n createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;\n /**\n * Create a new entry from already existing entry.\n */\n createEntryRevisionFrom: (\n model: CmsModel,\n id: string,\n input: CreateFromCmsEntryInput\n ) => Promise<CmsEntry>;\n /**\n * Update existing entry.\n */\n updateEntry: (\n model: CmsModel,\n id: string,\n input: UpdateCmsEntryInput,\n meta?: Record<string, any>\n ) => Promise<CmsEntry>;\n /**\n * Method that republishes entry with given identifier.\n * @internal\n */\n republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Delete only a certain revision of the entry.\n */\n deleteEntryRevision: (model: CmsModel, id: string) => Promise<void>;\n /**\n * Delete entry with all its revisions.\n */\n deleteEntry: (model: CmsModel, id: string) => Promise<void>;\n /**\n * Publish entry.\n */\n publishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Unpublish entry.\n */\n unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Get all entry revisions.\n */\n getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;\n /**\n * Lifecyle events - deprecated.\n */\n /**\n * @deprecated\n */\n onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryList: Topic<EntryBeforeListTopicParams>;\n /**\n * Lifecycle events released in 5.33.0\n */\n onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;\n onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;\n onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;\n\n onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;\n onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;\n onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;\n\n onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;\n onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;\n onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;\n\n onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;\n onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;\n onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;\n\n onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;\n onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;\n onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;\n\n onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;\n onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;\n onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;\n\n onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;\n onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;\n onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;\n\n onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;\n onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;\n onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;\n\n onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;\n onEntryBeforeList: Topic<EntryBeforeListTopicParams>;\n}\n\n/**\n * Parameters for CmsEntryResolverFactory.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\ninterface CmsEntryResolverFactoryParams {\n model: CmsModel;\n}\n\n/**\n * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\nexport type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {\n (params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;\n};\n\n/**\n * Settings security permission.\n *\n * @category SecurityPermission\n */\nexport interface CmsSettingsPermission extends SecurityPermission {} // eslint-disable-line\n\n/**\n * A base security permission for CMS.\n *\n * @category SecurityPermission\n */\nexport interface BaseCmsSecurityPermission extends SecurityPermission {\n own?: boolean;\n rwd: string | number;\n}\n\n/**\n * A security permission for content model.\n *\n * @category SecurityPermission\n * @category CmsModel\n */\nexport interface CmsModelPermission extends BaseCmsSecurityPermission {\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content model groups.\n *\n * @category SecurityPermission\n * @category CmsGroup\n */\nexport interface CmsGroupPermission extends BaseCmsSecurityPermission {\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content entry.\n *\n * @category SecurityPermission\n * @category CmsEntry\n */\nexport interface CmsEntryPermission extends BaseCmsSecurityPermission {\n pw?: string;\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\nexport interface CmsGroupStorageOperationsGetParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport interface CmsGroupStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n [key: string]: any;\n}\n\nexport interface CmsGroupStorageOperationsListParams {\n where: CmsGroupStorageOperationsListWhereParams;\n sort?: string[];\n}\n\nexport interface CmsGroupStorageOperationsCreateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsUpdateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsDeleteParams {\n group: CmsGroup;\n}\n\n/**\n * Description of the CmsGroup CRUD operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsGroupStorageOperations {\n /**\n * Gets content model group by given id.\n */\n get: (params: CmsGroupStorageOperationsGetParams) => Promise<CmsGroup | null>;\n /**\n * List all content model groups. Filterable via params.\n */\n list: (params: CmsGroupStorageOperationsListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n create: (params: CmsGroupStorageOperationsCreateParams) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n update: (params: CmsGroupStorageOperationsUpdateParams) => Promise<CmsGroup>;\n /**\n * Delete the content model group.\n */\n delete: (params: CmsGroupStorageOperationsDeleteParams) => Promise<CmsGroup>;\n}\n\nexport interface CmsModelStorageOperationsGetParams {\n tenant: string;\n locale: string;\n modelId: string;\n}\n\nexport interface CmsModelStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n [key: string]: string;\n}\n\nexport interface CmsModelStorageOperationsListParams {\n where: CmsModelStorageOperationsListWhereParams;\n}\n\nexport interface CmsModelStorageOperationsCreateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsUpdateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsDeleteParams {\n model: CmsModel;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsModelStorageOperations {\n /**\n * Gets content model by given id.\n */\n get: (params: CmsModelStorageOperationsGetParams) => Promise<CmsModel | null>;\n /**\n * List all content models. Filterable via params.\n */\n list: (params: CmsModelStorageOperationsListParams) => Promise<CmsModel[]>;\n /**\n * Create a new content model.\n */\n create: (params: CmsModelStorageOperationsCreateParams) => Promise<CmsModel>;\n /**\n * Update existing content model.\n */\n update: (params: CmsModelStorageOperationsUpdateParams) => Promise<CmsModel>;\n /**\n * Delete the content model.\n */\n delete: (params: CmsModelStorageOperationsDeleteParams) => Promise<CmsModel>;\n}\n\nexport interface CmsEntryStorageOperationsGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n limit?: number;\n}\n\nexport interface CmsEntryStorageOperationsListParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit: number;\n after?: string | null;\n}\n\nexport interface CmsEntryStorageOperationsCreateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsCreateRevisionFromParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUpdateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsDeleteRevisionParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Entry that was deleted.\n */\n entry: CmsEntry;\n /**\n * Entry that was deleted, directly from storage, with transformations.\n */\n storageEntry: T;\n /**\n * Entry that was set as latest.\n */\n latestEntry: CmsEntry | null;\n /**\n * Entry that was set as latest, directly from storage, with transformations.\n */\n latestStorageEntry: T | null;\n}\n\nexport interface CmsEntryStorageOperationsDeleteParams {\n /**\n * Entry that is going to be deleted.\n */\n entry: CmsEntry;\n}\n\nexport interface CmsEntryStorageOperationsPublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as published.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUnpublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as unpublished.\n */\n entry: CmsEntry;\n /**\n * The modified entry that is going to be saved as unpublished, with transformations on it.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsGetByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetLatestByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionsParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetLatestRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPreviousRevisionParams {\n entryId: string;\n version: number;\n}\n\nexport interface CmsEntryStorageOperationsListResponse<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Has more items to load with the current filtering?\n */\n hasMoreItems: boolean;\n /**\n * Items loaded with current filtering.\n */\n items: T[];\n /**\n * Pointer for where to start the new item set.\n */\n cursor: string | null;\n /**\n * Total amount of items with the current filter.\n */\n totalCount: number;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n *\n *\n * @category StorageOperations\n * @category CmsEntry\n */\nexport interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorageEntry> {\n /**\n * Get all the entries of the ids.\n */\n getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;\n /**\n * Get all the published entries of the ids.\n */\n getPublishedByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all the latest entries of the ids.\n */\n getLatestByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all revisions of the given entry id.\n */\n getRevisions: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionsParams\n ) => Promise<T[]>;\n /**\n * Get the entry by the given revision id.\n */\n getRevisionById: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the published entry by given entryId.\n */\n getPublishedRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the latest entry by given entryId.\n */\n getLatestRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the revision of the entry before given one.\n */\n getPreviousRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPreviousRevisionParams\n ) => Promise<T | null>;\n /**\n * Gets entry by given params.\n */\n get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;\n /**\n * List all entries. Filterable via params.\n */\n list: (\n model: CmsModel,\n params: CmsEntryStorageOperationsListParams\n ) => Promise<CmsEntryStorageOperationsListResponse<T>>;\n /**\n * Create a new entry.\n */\n create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;\n /**\n * Create a new entry from existing one.\n */\n createRevisionFrom: (\n model: CmsModel,\n params: CmsEntryStorageOperationsCreateRevisionFromParams<T>\n ) => Promise<T>;\n /**\n * Update existing entry.\n */\n update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;\n /**\n * Delete the entry revision.\n */\n deleteRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteRevisionParams<T>\n ) => Promise<void>;\n /**\n * Delete the entry.\n */\n delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;\n /**\n * Publish the entry.\n */\n publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;\n /**\n * Unpublish the entry.\n */\n unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;\n}\n\nexport enum CONTENT_ENTRY_STATUS {\n DRAFT = \"draft\",\n PUBLISHED = \"published\",\n UNPUBLISHED = \"unpublished\"\n}\n\nexport interface CmsSettingsStorageOperationsGetParams {\n locale: string;\n tenant: string;\n}\n\nexport interface CmsSettingsStorageOperationsCreateParams {\n settings: CmsSettings;\n}\n\nexport interface CmsSettingsStorageOperationsUpdateParams {\n settings: CmsSettings;\n}\n\nexport interface CmsSettingsStorageOperations {\n /**\n * Get the settings from the storage.\n */\n get: (params: CmsSettingsStorageOperationsGetParams) => Promise<CmsSettings | null>;\n /**\n * Create settings in the storage.\n */\n create: (params: CmsSettingsStorageOperationsCreateParams) => Promise<CmsSettings>;\n /**\n * Update the settings in the storage.\n */\n update: (params: CmsSettingsStorageOperationsUpdateParams) => Promise<CmsSettings>;\n}\n\nexport interface CmsSystem {\n version?: string;\n readAPIKey?: string;\n /**\n * System tenant.\n */\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsGetParams {\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsCreateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperationsUpdateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperations {\n /**\n * Get the system data.\n */\n get: (params: CmsSystemStorageOperationsGetParams) => Promise<CmsSystem | null>;\n /**\n * Create the system info in the storage.\n */\n create: (params: CmsSystemStorageOperationsCreateParams) => Promise<CmsSystem>;\n /**\n * Update the system info in the storage.\n */\n update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;\n}\n\nexport interface HeadlessCmsStorageOperations<C = CmsContext> {\n name: string;\n system: CmsSystemStorageOperations;\n settings: CmsSettingsStorageOperations;\n groups: CmsGroupStorageOperations;\n models: CmsModelStorageOperations;\n entries: CmsEntryStorageOperations;\n /**\n * Either attach something from the storage operations or run something in it.\n */\n beforeInit: (context: C) => Promise<void>;\n init?: (context: C) => Promise<void>;\n}\n"],"mappings":";;;;;;AAoDA;AACA;AACA;AACA;AACA;AAmBA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AA6CA;AACA;AACA;AACA;AACA;AACA;AAgGA;AACA;AACA;AAUA;AACA;AACA;AASA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AA+GA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AA8PA;AACA;AACA;AACA;AACA;AACA;AACA;AAoBA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AAuDA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAsDA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAmEA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyDA;AACA;AACA;AACA;AACA;AACA;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AA4FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoCA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAoBA;AACA;AACA;AAcA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AA+GA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AAgFA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AAqBA;AACA;AACA;AAwBA;AACA;AACA;AAuBA;AACA;AACA;AAmBA;AACA;AACA;AAkBA;AACA;AACA;AA6DA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAmMA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACqE;AAErE;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AA8CA;AACA;AACA;AACA;AACA;AAoDA;AACA;AACA;AACA;AACA;AA2LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IA8GYA,oBAAoB;AAAA;AAAA,WAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,oCAApBA,oBAAoB"}
1
+ {"version":3,"names":["CONTENT_ENTRY_STATUS"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Context } from \"@webiny/api/types\";\nimport {\n GraphQLFieldResolver,\n GraphQLSchemaDefinition,\n Resolvers\n} from \"@webiny/handler-graphql/types\";\nimport { SecurityPermission } from \"@webiny/api-security/types\";\nimport { DbContext } from \"@webiny/handler-db/types\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { CmsModelConverterCallable } from \"~/utils/converters/ConverterCollection\";\n\nexport type ApiEndpoint = \"manage\" | \"preview\" | \"read\";\n\nexport interface HeadlessCms\n extends CmsSettingsContext,\n CmsSystemContext,\n CmsGroupContext,\n CmsModelContext,\n CmsEntryContext {\n /**\n * API type\n */\n type: ApiEndpoint | null;\n /**\n * Requested locale\n */\n locale: string;\n /**\n * returns an instance of current locale\n */\n getLocale: () => I18NLocale;\n /**\n * Means this request is a READ API\n */\n READ: boolean;\n /**\n * Means this request is a MANAGE API\n */\n MANAGE: boolean;\n /**\n * Means this request is a PREVIEW API\n */\n PREVIEW: boolean;\n /**\n * The storage operations loaded for current context.\n */\n storageOperations: HeadlessCmsStorageOperations;\n}\n\n/**\n * @description This combines all contexts used in the CMS into a single one.\n *\n * @category Context\n */\nexport interface CmsContext\n extends Context,\n DbContext,\n // HttpContext,\n I18NContext,\n FileManagerContext {\n cms: HeadlessCms;\n}\n\ninterface CmsModelFieldPredefinedValuesValue {\n value: string;\n label: string;\n /**\n * Default selected predefined value.\n */\n selected?: boolean;\n}\n\n/**\n * Object containing content model field predefined options and values.\n *\n * @category CmsModelField\n */\nexport interface CmsModelFieldPredefinedValues {\n /**\n * Are predefined field values enabled?\n */\n enabled: boolean;\n /**\n * Predefined values array.\n */\n values: CmsModelFieldPredefinedValuesValue[];\n}\n\n/**\n * Object containing content model field renderer options.\n *\n * @category CmsModelField\n */\ninterface CmsModelFieldRenderer {\n /**\n * Name of the field renderer. Must have one in field renderer plugins.\n * Can be blank to let automatically determine the renderer.\n */\n name: string;\n}\n\n/**\n * A definition for content model field settings.\n *\n * @category ModelField\n * @category Database model\n */\nexport interface CmsModelFieldSettings {\n /**\n * Predefined values (text, number)\n * The default value for the field in case it is not predefined values field.\n */\n defaultValue?: string | number | null | undefined;\n /**\n * Object field has child fields.\n */\n fields?: CmsModelField[];\n /**\n * Is the file field images only one?\n */\n imagesOnly?: boolean;\n /**\n * Object field has child fields - so it needs to have a layout.\n */\n layout?: string[][];\n /**\n * Ref field.\n */\n models?: Pick<CmsModel, \"modelId\">[];\n /**\n * Date field.\n */\n type?: string;\n /**\n * There are a lot of other settings that are possible to add, so we keep the type opened.\n */\n [key: string]: any;\n}\n\nexport type CmsModelFieldType =\n | \"boolean\"\n | \"datetime\"\n | \"file\"\n | \"long-text\"\n | \"number\"\n | \"object\"\n | \"ref\"\n | \"rich-text\"\n | \"text\"\n | \"dynamicZone\"\n | string;\n/**\n * A definition for content model field. This type exists on the app side as well.\n *\n * @category ModelField\n * @category Database model\n */\nexport interface CmsModelField {\n /**\n * A generated unique ID for the model field.\n * MUST be absolute unique throughout the models.\n * Must be in form of a-zA-Z0-9.\n *\n * We generate a unique id value when you're building a model via UI,\n * but when user is creating a model via a plugin it is up to them to be careful about this.\n */\n id: string;\n /**\n * A type of the field.\n * We are defining our built-in fields, so people know which are available by the default.\n */\n type: CmsModelFieldType;\n /**\n * A unique storage ID for storing actual values.\n * Must in form of a-zA-Z0-9@a-zA-Z0-9\n *\n * This is an auto-generated value: uses `id` and `type`\n *\n * This is used as path for the entry value.\n */\n storageId: `${string}@${string}` | string;\n /**\n * Field identifier for the model field that will be available to the outside world.\n * `storageId` is used as path (or column) to store the data.\n *\n * Must in form of a-zA-Z0-9.\n *\n * This value MUST be unique in the CmsModel.\n */\n fieldId: string;\n /**\n * A label for the field\n */\n label: string;\n /**\n * Text below the field to clarify what is it meant to be in the field value\n */\n helpText?: string | null;\n /**\n * Text to be displayed in the field\n */\n placeholderText?: string | null;\n /**\n * Are predefined values enabled? And list of them\n */\n predefinedValues?: CmsModelFieldPredefinedValues;\n /**\n * Field renderer. Blank if determined automatically.\n */\n renderer?: CmsModelFieldRenderer;\n /**\n * List of validations for the field\n *\n * @default []\n */\n validation?: CmsModelFieldValidation[];\n /**\n * List of validations for the list of values, when a field is set to accept a list of values.\n * These validations will be applied to the entire list, and `validation` (see above) will be applied\n * to each individual value in the list.\n *\n * @default []\n */\n listValidation?: CmsModelFieldValidation[];\n /**\n * Is this a multiple values field?\n *\n */\n multipleValues?: boolean;\n /**\n * Fields can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * Any user defined settings.\n *\n * @default {}\n */\n settings?: CmsModelFieldSettings;\n}\n\nexport interface CmsDynamicZoneTemplate {\n id: string;\n name: string;\n gqlTypeName: string;\n description: string;\n icon: string;\n fields: CmsModelField[];\n layout: string[][];\n validation: CmsModelFieldValidation[];\n}\n\n/**\n * A definition for dynamic-zone field to show possible type of the field in settings.\n */\nexport interface CmsModelDynamicZoneField extends CmsModelField {\n /**\n * Settings object for the field. Contains `templates` property.\n */\n settings: {\n templates: CmsDynamicZoneTemplate[];\n };\n}\n\n/**\n * Used for our internal functionality.\n */\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | null;\n}\n\nexport interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {\n parent?: CmsModelDynamicZoneFieldWithParent | null;\n}\n\n/**\n * A definition for dateTime field to show possible type of the field in settings.\n */\nexport interface CmsModelDateTimeField extends CmsModelField {\n /**\n * Settings object for the field. Contains `type` property.\n */\n settings: {\n type: \"time\" | \"date\" | \"dateTimeWithoutTimezone\" | \"dateTimeWithTimezone\";\n };\n}\n\n/**\n * Arguments for the field validator validate method.\n *\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorValidateParams<T = any> {\n /**\n * A value to be validated.\n */\n value: T;\n /**\n * Options from the CmsModelField validations.\n *\n * @see CmsModelField.validation\n * @see CmsModelField.listValidation\n */\n validator: CmsModelFieldValidation;\n /**\n * An instance of the current context.\n */\n context: CmsContext;\n /**\n * Field being validated.\n */\n field: CmsModelField;\n /**\n * An instance of the content model being validated.\n */\n model: CmsModel;\n /**\n * If entry is sent it means it is an update operation.\n * First usage is for the unique field value.\n */\n entry?: CmsEntry;\n}\n\n/**\n * Definition for the field validator.\n *\n * @category Plugin\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-model-field-validator\";\n /**\n * Actual validator definition.\n */\n validator: {\n /**\n * Name of the validator.\n */\n name: string;\n /**\n * Validation method.\n */\n validate(params: CmsModelFieldValidatorValidateParams): Promise<boolean>;\n };\n}\n\n/**\n * A pattern validator for the content entry field value.\n *\n * @category Plugin\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldPatternValidatorPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-validator-pattern\";\n /**\n * A pattern object for the validator.\n */\n pattern: {\n /**\n * name of the pattern.\n */\n name: string;\n /**\n * RegExp of the validator.\n */\n regex: string;\n /**\n * RegExp flags\n */\n flags: string;\n };\n}\n\n/**\n * Locked field in the content model\n *\n * @see CmsModel.lockedFields\n *\n * @category ModelField\n */\nexport interface LockedField {\n /**\n * Locked field storage ID - one used to store values.\n * We cannot change this due to old systems.\n */\n fieldId: string;\n /**\n * Is the field multiple values field?\n */\n multipleValues: boolean;\n /**\n * Field type.\n */\n type: string;\n [key: string]: any;\n}\n\n/**\n * @category Database model\n * @category CmsModel\n */\nexport interface CmsModelGroup {\n /**\n * Generated ID of the group\n */\n id: string;\n /**\n * Name of the group\n */\n name: string;\n}\n\n/**\n * Base CMS Model. Should not be exported and used outside of this package.\n *\n * @category Database model\n * @category CmsModel\n */\nexport interface CmsModel {\n /**\n * Name of the content model.\n */\n name: string;\n /**\n * Unique ID for the content model. Created from name if not defined by user.\n */\n modelId: string;\n /**\n * Name of the content model in singular form to be used in the API.\n * example:\n * - Article\n * - Fruit\n * - Vegetable\n * - Car\n */\n singularApiName: string;\n /**\n * Name of the content model in plural form to be used in the API.\n * example:\n * - Articles\n * - Fruits\n * - Vegetables\n * - Cars\n */\n pluralApiName: string;\n /**\n * Model tenant.\n */\n tenant: string;\n /**\n * Locale this model belongs to.\n */\n locale: string;\n /**\n * Cms Group reference object.\n */\n group: CmsModelGroup;\n /**\n * Icon for the content model.\n */\n icon?: string | null;\n /**\n * Description for the content model.\n */\n description: string | null;\n /**\n * Date created\n */\n createdOn?: string;\n /**\n * Date saved. Changes on both save and create.\n */\n savedOn?: string;\n /**\n * CreatedBy object wrapper. Contains id, name and type of the user.\n */\n createdBy?: CmsIdentity;\n /**\n * List of fields defining entry values.\n */\n fields: CmsModelField[];\n /**\n * Admin UI field layout\n *\n * ```ts\n * layout: [\n * [field1id, field2id],\n * [field3id]\n * ]\n * ```\n */\n layout: string[][];\n /**\n * Models can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * List of locked fields. Updated when entry is saved and a field has been used.\n */\n lockedFields?: LockedField[];\n /**\n * The field that is being displayed as entry title.\n * It is picked as first available text field. Or user can select own field.\n */\n titleFieldId: string;\n /**\n * The field which is displayed as the description one.\n * Only way this is null or undefined is that there are no long-text fields to be set as description.\n */\n descriptionFieldId?: string | null;\n /**\n * The field which is displayed as the image.\n * Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.\n */\n imageFieldId?: string | null;\n /**\n * The version of Webiny which this record was stored with.\n */\n webinyVersion: string;\n\n /**\n * Is model private?\n * This is meant to be used for some internal models - will not be visible in the schema.\n * Only available for the plugin constructed models.\n */\n isPrivate?: boolean;\n}\n\n/**\n * When sending model to the storage operations, it must contain createValueKeyToStorageConverter and createValueKeyFromStorageConverter\n *\n * @category CmsModel\n */\nexport interface StorageOperationsCmsModel extends CmsModel {\n convertValueKeyToStorage: CmsModelConverterCallable;\n convertValueKeyFromStorage: CmsModelConverterCallable;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsModelFieldDefinition {\n fields: string;\n typeDefs?: string;\n}\n\ninterface CmsModelFieldToGraphQLCreateResolverParams<TField> {\n models: CmsModel[];\n model: CmsModel;\n graphQLType: string;\n field: TField;\n createFieldResolvers: any;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\n\nexport interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {\n (params: CmsModelFieldToGraphQLCreateResolverParams<TField>):\n | GraphQLFieldResolver\n | { resolver: GraphQLFieldResolver | null; typeResolvers: Resolvers<CmsContext> }\n | false;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<\n TField extends CmsModelField = CmsModelField\n> {\n fields: TField[];\n originalFields: TField[];\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<\n TField extends CmsModelField = CmsModelField\n> {\n field: TField;\n originalField?: TField;\n validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;\n}\n\nexport interface CmsModelFieldToGraphQLPluginValidateChildFields<\n TField extends CmsModelField = CmsModelField\n> {\n (params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;\n}\n\n/**\n * @category Plugin\n * @category ModelField\n * @category GraphQL\n */\nexport interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField>\n extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-graphql\";\n /**\n * Field type name which must be exact as the one in `CmsEditorFieldTypePlugin` plugin.\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: string;\n /**\n * Is the field searchable via the GraphQL?\n *\n * ```ts\n * isSearchable: false\n * ```\n */\n isSearchable: boolean;\n /**\n * Is the field searchable via full text search?\n *\n * Field is not full text searchable by default.\n * ```ts\n * fullTextSearch: false\n * ```\n */\n fullTextSearch?: boolean;\n /**\n * Is the field sortable via the GraphQL?\n *\n * ```ts\n * isSortable: true\n * ```\n */\n isSortable: boolean;\n /**\n * Optional method which creates the storageId.\n * Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.\n *\n * ```ts\n * createStorageId: ({field}) => {\n * if (field.settings.type === \"time) {\n * return `${field.type}_time@${field.id}`\n * }\n * // use default method\n * return undefined;\n * }\n * ```\n */\n createStorageId?: (params: { model: CmsModel; field: TField }) => string | null | undefined;\n /**\n * Read API methods.\n */\n read: {\n /**\n * Definition for get filtering for GraphQL.\n *\n * ```ts\n * read: {\n * createGetFilters({ field }) {\n * return `${field.fieldId}: MyField`;\n * }\n * }\n * ```\n */\n createGetFilters?(params: { model: CmsModel; field: TField }): string;\n /**\n * Definition for list filtering for GraphQL.\n *\n * ```ts\n * read: {\n * createListFilters({ field }) {\n * return `\n * ${field.fieldId}: MyType\n * ${field.fieldId}_not: MyType\n * ${field.fieldId}_in: [MyType]\n * ${field.fieldId}_not_in: [MyType]\n * `;\n * }\n * }\n * ```\n */\n createListFilters?(params: {\n model: CmsModel;\n field: TField;\n plugins: CmsFieldTypePlugins;\n }): string;\n /**\n * Definition of the field type for GraphQL - be aware if multiple values is selected.\n *\n * ```ts\n * read: {\n * createTypeField({ field }) {\n * if (field.multipleValues) {\n * return `${field.fieldId}: [MyFieldType]`;\n * }\n *\n * return `${field.fieldId}: MyField`;\n * }\n * }\n * ```\n */\n createTypeField(params: {\n models: CmsModel[];\n model: CmsModel;\n field: TField;\n fieldTypePlugins: CmsFieldTypePlugins;\n }): CmsModelFieldDefinition | string | null;\n /**\n * Definition for field resolver.\n * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.\n *\n * ```ts\n * read: {\n * createResolver({ field }) {\n * return instance => {\n * return instance.values[field.storageId];\n * };\n * }\n * }\n * ```\n */\n createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;\n /**\n * Read API schema definitions for the field and resolvers for them.\n *\n * ```ts\n * read: {\n * createSchema() {\n * return {\n * typeDefs: `\n * myField {\n * id\n * date\n * }\n * `,\n * resolvers: {}\n * }\n * }\n * }\n * ```\n */\n createSchema?: (params: { models: CmsModel[] }) => GraphQLSchemaDefinition<CmsContext>;\n };\n manage: {\n /**\n * Definition for list filtering for GraphQL.\n *\n * ```ts\n * manage: {\n * createListFilters({ field }) {\n * return `\n * ${field.fieldId}: MyType\n * ${field.fieldId}_not: MyType\n * ${field.fieldId}_in: [MyType]\n * ${field.fieldId}_not_in: [MyType]\n * `;\n * }\n * }\n * ```\n */\n createListFilters?: (params: {\n model: CmsModel;\n field: TField;\n plugins: CmsFieldTypePlugins;\n }) => string;\n /**\n * Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.\n *\n * ```ts\n * createSchema() {\n * return {\n * typeDefs: `\n * myField {\n * id\n * date\n * }\n * `,\n * resolvers: {}\n * }\n * }\n * ```\n */\n createSchema?: (params: { models: CmsModel[] }) => GraphQLSchemaDefinition<CmsContext>;\n /**\n * Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.\n *\n * ```ts\n * manage: {\n * createTypeField({ field }) {\n * if (field.multipleValues) {\n * return field.fieldId + \": [MyType]\";\n * }\n *\n * return field.fieldId + \": MyType\";\n * }\n * }\n * ```\n */\n createTypeField: (params: {\n models: CmsModel[];\n model: CmsModel;\n field: TField;\n fieldTypePlugins: CmsFieldTypePlugins;\n }) => CmsModelFieldDefinition | string | null;\n /**\n * Definition for input GraphQL field type.\n *\n * ```ts\n * manage: {\n * createInputField({ field }) {\n * if (field.multipleValues) {\n * return field.fieldId + \": [MyField]\";\n * }\n *\n * return field.fieldId + \": MyField\";\n * }\n * }\n * ```\n */\n createInputField: (params: {\n models: CmsModel[];\n model: CmsModel;\n field: TField;\n fieldTypePlugins: CmsFieldTypePlugins;\n }) => CmsModelFieldDefinition | string | null;\n /**\n * Definition for field resolver.\n * By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.\n *\n * ```ts\n * manage: {\n * createResolver({ field }) {\n * return instance => {\n * return instance.values[field.storageId];\n * };\n * }\n * }\n * ```\n */\n createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;\n };\n /**\n *\n * @param field\n */\n validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;\n}\n\n/**\n * Check for content model locked field.\n * A custom plugin definable by the user.\n *\n * @category CmsModel\n * @category Plugin\n */\nexport interface CmsModelLockedFieldPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-locked-field\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n */\n fieldType: string;\n /**\n * A method to check if field really is locked.\n */\n checkLockedField?: (params: { lockedField: LockedField; field: CmsModelField }) => void;\n /**\n * A method to get the locked field data.\n */\n getLockedFieldData?: (params: { field: CmsModelField }) => Record<string, any>;\n}\n\n/**\n * @category ModelField\n */\nexport interface CmsFieldTypePlugins {\n [key: string]: CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * An interface describing the reference to a user that created some data in the database.\n *\n * @category General\n */\nexport interface CmsIdentity {\n /**\n * ID if the user.\n */\n id: string;\n /**\n * Full name of the user.\n */\n displayName: string | null;\n /**\n * Type of the user (admin, user)\n */\n type: string;\n}\n\n/**\n * Representation of settings database model.\n *\n * @category Database model\n */\nexport interface CmsSettings {\n /**\n * Last content model change. Used to cache GraphQL schema.\n */\n contentModelLastChange: Date;\n /**\n * Settings tenant.\n */\n tenant: string;\n /**\n * Settings locale.\n */\n locale: string;\n}\n\n/**\n * Settings CRUD in context.\n *\n * @category Context\n */\nexport interface CmsSettingsContext {\n /**\n * Gets settings model from the database.\n */\n getSettings: () => Promise<CmsSettings | null>;\n /**\n * Updates settings model with a new date.\n */\n updateModelLastChange: () => Promise<void>;\n /**\n * Get the datetime when content model last changed.\n */\n getModelLastChange: () => Promise<Date | null>;\n}\n\nexport interface OnSystemBeforeInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemAfterInstallTopicParams {\n tenant: string;\n locale: string;\n}\n\nexport interface OnSystemInstallErrorTopicParams {\n error: Error;\n tenant: string;\n locale: string;\n}\n\nexport type CmsSystemContext = {\n getSystemVersion: () => Promise<string | null>;\n setSystemVersion: (version: string) => Promise<void>;\n installSystem: () => Promise<void>;\n /**\n * Lifecycle events - deprecated\n */\n /**\n * @deprecated\n */\n onBeforeSystemInstall: Topic<OnSystemBeforeInstallTopicParams>;\n /**\n * @deprecated\n */\n onAfterSystemInstall: Topic<OnSystemAfterInstallTopicParams>;\n /**\n * Released in 5.34.0\n */\n onSystemBeforeInstall: Topic<OnSystemBeforeInstallTopicParams>;\n onSystemAfterInstall: Topic<OnSystemAfterInstallTopicParams>;\n onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;\n};\n\n/**\n * A GraphQL `params.data` parameter received when creating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupCreateInput {\n name: string;\n slug?: string;\n description?: string;\n icon: string;\n}\n\n/**\n * A GraphQL `params.data` parameter received when updating content model group.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupUpdateInput {\n name?: string;\n slug?: string;\n description?: string;\n icon?: string;\n}\n\n/**\n * A representation of content model group in the database.\n *\n * @category CmsGroup\n * @category Database model\n */\nexport interface CmsGroup {\n /**\n * Generated ID.\n */\n id: string;\n /**\n * Name of the group.\n */\n name: string;\n /**\n * Slug for the group. Must be unique.\n */\n slug: string;\n /**\n * Group tenant.\n */\n tenant: string;\n /**\n * Locale this group belongs to.\n */\n locale: string;\n /**\n * Description for the group.\n */\n description: string;\n /**\n * Icon for the group. In a form of \"ico/ico\".\n */\n icon: string;\n /**\n * CreatedBy reference object.\n */\n createdBy?: CmsIdentity;\n /**\n * Date group was created on.\n */\n createdOn?: string;\n /**\n * Date group was created or changed on.\n */\n savedOn?: string;\n /**\n * Which Webiny version was this record stored with.\n */\n webinyVersion: string;\n /**\n * Is group private?\n * This is meant to be used for some internal groups - will not be visible in the schema.\n * Only available for the plugin constructed groups.\n */\n isPrivate?: boolean;\n}\n\n/**\n * A `data.where` parameter received when listing content model groups.\n *\n * @category CmsGroup\n * @category GraphQL params\n */\nexport interface CmsGroupListParams {\n where: {\n tenant: string;\n locale: string;\n [key: string]: any;\n };\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterCreateTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupCreateErrorTopicParams {\n input: CmsGroupCreateInput;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterUpdateTopicParams {\n original: CmsGroup;\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupUpdateErrorTopicParams {\n input: CmsGroupUpdateInput;\n original: CmsGroup;\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupBeforeDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupAfterDeleteTopicParams {\n group: CmsGroup;\n}\n\n/**\n * @category CmsGroup\n * @category Topic\n */\nexport interface OnGroupDeleteErrorTopicParams {\n group: CmsGroup;\n error: Error;\n}\n\n/**\n * Cms Group in context.\n *\n * @category Context\n * @category CmsGroup\n */\nexport interface CmsGroupContext {\n /**\n * Gets content model group by given id.\n */\n getGroup: (id: string) => Promise<CmsGroup | null>;\n /**\n * List all content model groups. Filterable via params.\n */\n listGroups: (params?: CmsGroupListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n createGroup: (data: CmsGroupCreateInput) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n updateGroup: (id: string, data: CmsGroupUpdateInput) => Promise<CmsGroup>;\n /**\n * Delete content model group by given id.\n */\n deleteGroup: (id: string) => Promise<boolean>;\n /**\n * Clear the cached groups.\n */\n clearGroupsCache: () => void;\n /**\n * Lifecycle events - deprecated\n */\n /**\n * @deprecated\n */\n onBeforeGroupCreate: Topic<OnGroupBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterGroupCreate: Topic<OnGroupAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeGroupUpdate: Topic<OnGroupBeforeUpdateTopicParams>;\n /**\n * @deprecated\n */\n onAfterGroupUpdate: Topic<OnGroupAfterUpdateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeGroupDelete: Topic<OnGroupBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterGroupDelete: Topic<OnGroupAfterDeleteTopicParams>;\n /**\n * Lifecycle events released in 5.33.0\n */\n onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;\n onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;\n onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;\n onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;\n onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;\n onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;\n onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;\n onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;\n onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;\n}\n\n/**\n * Definition for content model field validator.\n *\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidation {\n name: string;\n message: string;\n settings?: {\n value?: string | number;\n values?: string[];\n preset?: string;\n [key: string]: any;\n };\n}\n\n/**\n * A GraphQL `params.data` parameter received when creating content model.\n *\n * @category GraphQL params\n * @category CmsModel\n */\nexport interface CmsModelCreateInput {\n /**\n * Name of the content model.\n */\n name: string;\n /**\n * Singular name of the content model to be used in the API.\n */\n singularApiName: string;\n /**\n * Plural name of the content model to be used in the API.\n */\n pluralApiName: string;\n /**\n * Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.\n */\n modelId?: string;\n /**\n * Description of the content model.\n */\n description?: string | null;\n /**\n * Group where to put the content model in.\n */\n group: string;\n /**\n * A list of content model fields to define the entry values.\n */\n fields?: CmsModelFieldInput[];\n /**\n * Admin UI field layout\n *\n * ```ts\n * layout: [\n * [field1id, field2id],\n * [field3id]\n * ]\n * ```\n */\n layout?: string[][];\n /**\n * Models can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * Fields fieldId which are picked to represent the CMS entry.\n */\n titleFieldId?: string | null;\n descriptionFieldId?: string | null;\n imageFieldId?: string | null;\n}\n\n/**\n * A GraphQL `params.data` parameter received when creating content model from existing model.\n *\n * @category GraphQL params\n * @category CmsModel\n */\nexport interface CmsModelCreateFromInput extends CmsModelCreateInput {\n /**\n * Locale into which we want to clone the model into.\n */\n locale?: string;\n}\n\n/**\n * A definition for content model field received from the user.\n *\n * Input type for `CmsModelField`.\n * @see CmsModelField\n *\n * @category GraphQL params\n * @category ModelField\n */\nexport interface CmsModelFieldInput {\n /**\n * Generated ID.\n */\n id: string;\n /**\n * Type of the field. A plugin for the field must be defined.\n * @see CmsModelFieldToGraphQLPlugin\n */\n type: string;\n /**\n * Field outside world identifier for the field. Must be unique in the model.\n */\n fieldId: string;\n /**\n * Label for the field.\n */\n label: string;\n /**\n * Text to display below the field to help user what to write in the field.\n */\n helpText?: string | null;\n /**\n * Text to display in the field.\n */\n placeholderText?: string | null;\n /**\n * Fields can be tagged to give them contextual meaning.\n */\n tags?: string[];\n /**\n * Are multiple values allowed?\n */\n multipleValues?: boolean;\n /**\n * Predefined values options for the field. Check the reference for more information.\n */\n predefinedValues?: CmsModelFieldPredefinedValues;\n /**\n * Renderer options for the field. Check the reference for more information.\n */\n renderer?: CmsModelFieldRenderer;\n /**\n * List of validations for the field.\n */\n validation?: CmsModelFieldValidation[];\n /**\n * @see CmsModelField.listValidation\n */\n listValidation?: CmsModelFieldValidation[];\n /**\n * User defined settings.\n */\n settings?: Record<string, any>;\n}\n\n/**\n * A GraphQL `params.data` parameter received when updating content model.\n *\n * @category GraphQL params\n * @category CmsModel\n */\nexport interface CmsModelUpdateInput {\n /**\n * A new content model name.\n */\n name?: string;\n /**\n * A new singular name of the content model to be used in the API.\n */\n singularApiName?: string;\n /**\n * A new plural name of the content model to be used in the API.\n */\n pluralApiName?: string;\n /**\n * A group we want to move the model to.\n */\n group?: string;\n /**\n * A new description of the content model.\n */\n description?: string | null;\n /**\n * A list of content model fields to define the entry values.\n */\n fields: CmsModelFieldInput[];\n /**\n * Admin UI field layout\n *\n * ```ts\n * layout: [\n * [field1id, field2id],\n * [field3id]\n * ]\n * ```\n */\n layout: string[][];\n /**\n * Fields fieldId which are picked to represent the CMS entry.\n */\n titleFieldId?: string | null;\n descriptionFieldId?: string | null;\n imageFieldId?: string | null;\n}\n\n/**\n * A plugin to load a CmsModelManager.\n *\n * @see CmsModelManager\n *\n * @category Plugin\n * @category CmsModel\n * @category CmsEntry\n */\nexport interface ModelManagerPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-content-model-manager\";\n /**\n * Specific model CmsModelManager loader. Can target exact modelId(s).\n * Be aware that if you define multiple plugins without `modelId`, last one will run.\n */\n modelId?: string[] | string;\n /**\n * Create a CmsModelManager for specific type - or new default one.\n * For reference in how is this plugin run check [contentModelManagerFactory](https://github.com/webiny/webiny-js/blob/f15676/packages/api-headless-cms/src/content/plugins/CRUD/contentModel/contentModelManagerFactory.ts)\n */\n create: (context: CmsContext, model: CmsModel) => Promise<CmsModelManager>;\n}\n\n/**\n * A content entry values definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntryValues {\n [key: string]: any;\n}\n\n/**\n * A content entry definition for and from the database.\n *\n * @category Database model\n * @category CmsEntry\n */\nexport interface CmsEntry<T = CmsEntryValues> {\n /**\n * A version of the webiny this entry was created with.\n * This can be used when upgrading the system, so we know which entries to update.\n */\n webinyVersion: string;\n /**\n * Tenant id which is this entry for. Can be used in case of shared storage.\n */\n tenant: string;\n /**\n * Generated ID of the entry. It is shared across all the records in the database that represent a single entry.\n * So version 1, 2, ..., 2371 will have the same value in this field to link them together.\n */\n entryId: string;\n /**\n * Generated ID + version of the entry.\n */\n id: string;\n /**\n * CreatedBy object reference.\n */\n createdBy: CmsIdentity;\n /**\n * OwnedBy object reference. Can be different from CreatedBy.\n */\n ownedBy: CmsIdentity;\n /**\n * ModifiedBy object reference. Last person who modified the entry.\n */\n modifiedBy?: CmsIdentity | null;\n /**\n * A string of Date.toISOString() type.\n * Populated on creation.\n */\n createdOn: string;\n /**\n * A string of Date.toISOString() type.\n * Populated every time entry is saved.\n */\n savedOn: string;\n /**\n * Model ID of the definition for the entry.\n * @see CmsModel\n */\n modelId: string;\n /**\n * A locale of the entry.\n * @see I18NLocale.code\n */\n locale: string;\n /**\n * A string of Date.toISOString() type - if published.\n * Populated when entry is published.\n */\n publishedOn?: string;\n /**\n * A revision version of the entry.\n */\n version: number;\n /**\n * Is the entry locked?\n */\n locked: boolean;\n /**\n * Status type of the entry.\n */\n status: CmsEntryStatus;\n /**\n * A mapped storageId -> value object.\n *\n * @see CmsModelField\n */\n values: T;\n /**\n * Settings for the given entry.\n *\n * Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.\n * Be aware that when accessing properties in it on old systems, it will break if not checked first.\n *\n * Available only on the Manage API in entry GraphQL type `meta.data` property.\n */\n meta?: {\n [key: string]: any;\n };\n}\n\nexport interface CmsStorageEntry extends CmsEntry {\n [key: string]: any;\n}\n\n/**\n * A definition for content model manager to be used in the code.\n * The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.\n *\n * @see CmsEntryContext\n *\n * @category Context\n * @category CmsEntry\n * @category CmsModel\n */\nexport interface CmsModelManager {\n /**\n * List only published entries in the content model.\n */\n listPublished: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * List latest entries in the content model. Used for administration.\n */\n listLatest: (params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;\n /**\n * Get a list of published entries by the ID list.\n */\n getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Get a list of the latest entries by the ID list.\n */\n getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Get an entry filtered by given params. Will always get one.\n */\n get: (id: string) => Promise<CmsEntry>;\n /**\n * Create an entry.\n */\n create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;\n /**\n * Update an entry.\n */\n update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;\n /**\n * Delete an entry.\n */\n delete: (id: string) => Promise<void>;\n}\n\n/**\n * Create\n */\nexport interface OnModelBeforeCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n}\n\nexport interface OnModelCreateErrorTopicParams {\n input: CmsModelCreateInput;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Create From / Clone\n */\nexport interface OnModelBeforeCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterCreateFromTopicParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelCreateFromErrorParams {\n input: CmsModelCreateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Update\n */\nexport interface OnModelBeforeUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelAfterUpdateTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n}\n\nexport interface OnModelUpdateErrorTopicParams {\n input: CmsModelUpdateInput;\n original: CmsModel;\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Delete\n */\nexport interface OnModelBeforeDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelAfterDeleteTopicParams {\n model: CmsModel;\n}\n\nexport interface OnModelDeleteErrorTopicParams {\n model: CmsModel;\n error: Error;\n}\n\n/**\n * Initialize\n */\nexport interface OnModelInitializeParams {\n model: CmsModel;\n data: Record<string, any>;\n}\n\n/**\n *\n */\nexport interface CmsModelUpdateDirectParams {\n model: CmsModel;\n original: CmsModel;\n}\n\n/**\n * Cms Model in the context.\n *\n * @category Context\n * @category CmsModel\n */\nexport interface CmsModelContext {\n /**\n * Get a single content model.\n */\n getModel: (modelId: string) => Promise<CmsModel | null>;\n /**\n * Get all content models.\n */\n listModels: () => Promise<CmsModel[]>;\n /**\n * Create a content model.\n */\n createModel: (data: CmsModelCreateInput) => Promise<CmsModel>;\n /**\n * Create a content model from the given model - clone.\n */\n createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;\n /**\n * Update content model without data validation. Used internally.\n * @hidden\n */\n updateModelDirect: (params: CmsModelUpdateDirectParams) => Promise<CmsModel>;\n /**\n * Update content model.\n */\n updateModel: (modelId: string, data: CmsModelUpdateInput) => Promise<CmsModel>;\n /**\n * Delete content model. Should not allow deletion if there are entries connected to it.\n */\n deleteModel: (modelId: string) => Promise<void>;\n /**\n * Possibility for users to trigger the model initialization.\n * They can hook into it and do what ever they want to.\n *\n * Primary idea behind this is creating the index, for the code models, in the ES.\n */\n initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;\n /**\n * Get an instance of CmsModelManager for given content modelId.\n *\n * @see CmsModelManager\n *\n * @deprecated use the getEntryManager() method instead\n */\n getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;\n getEntryManager: (model: CmsModel | string) => Promise<CmsModelManager>;\n /**\n * Get all content model managers mapped by modelId.\n * @see CmsModelManager\n * @deprecated use getEntryManagers instead\n */\n getManagers: () => Map<string, CmsModelManager>;\n getEntryManagers: () => Map<string, CmsModelManager>;\n /**\n * Clear all the model caches.\n */\n clearModelsCache: () => void;\n /**\n * Lifecycle events - deprecated.\n */\n /**\n * @deprecated\n */\n onBeforeModelCreate: Topic<OnModelBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelCreate: Topic<OnModelAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeModelCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;\n /**\n * @deprecated\n */\n onBeforeModelUpdate: Topic<OnModelBeforeUpdateTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelUpdate: Topic<OnModelAfterUpdateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeModelDelete: Topic<OnModelBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterModelDelete: Topic<OnModelAfterDeleteTopicParams>;\n /**\n * Lifecycle events - released in 5.33.0\n */\n onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;\n onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;\n onModelCreateError: Topic<OnModelCreateErrorTopicParams>;\n onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;\n onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;\n onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;\n onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;\n onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;\n onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;\n onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;\n onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;\n onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;\n onModelInitialize: Topic<OnModelInitializeParams>;\n}\n\n/**\n * Available statuses for content entry.\n *\n * @category CmsEntry\n */\nexport type CmsEntryStatus = \"published\" | \"unpublished\" | \"draft\";\n\nexport interface CmsEntryListWhereRef {\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n}\n\n/**\n * Entry listing where params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Generated ID without the version.\n */\n entryId?: string;\n entryId_not?: string;\n entryId_in?: string[];\n entryId_not_in?: string[];\n /**\n * Contains the owner of the entry. An \"owner\" is the identity who originally created the entry.\n * Subsequent revisions can be created by other identities, and those will be stored in `createdBy`,\n * but the `owner` is always the original author of the entry.\n *\n * Can be sent via the API or set internal if user can see only their own entries.\n */\n ownedBy?: string;\n ownedBy_not?: string;\n ownedBy_in?: string[];\n ownedBy_not_in?: string[];\n /**\n * Who created the entry?\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n /**\n * Version of the entry.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n version?: number;\n version_lt?: number;\n version_gt?: number;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `published` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n published?: boolean;\n /**\n * Each storage operations implementation MUST determine how to use this field.\n * In SQL, it can be a `latest` field, and in DynamoDB it can be an SK.\n *\n * It is not meant to be used via the API.\n * @internal\n */\n latest?: boolean;\n /**\n * This is to allow querying by any content model field defined by the user.\n */\n [key: string]:\n | string\n | number\n | boolean\n | undefined\n | string[]\n | number[]\n | null\n | CmsEntryListWhere[]\n | CmsEntryListWhere\n | CmsEntryListWhereRef;\n /**\n * To allow querying via nested queries, we added the AND / OR properties.\n */\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n}\n\n/**\n * Entry listing sort.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport type CmsEntryListSort = string[];\n\n/**\n * Get entry GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n}\n\n/**\n * List entries GraphQL resolver params.\n *\n * @category CmsEntry\n * @category GraphQL params\n */\nexport interface CmsEntryListParams {\n where?: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit?: number;\n after?: string | null;\n}\n\n/**\n * Meta information for GraphQL output.\n *\n * @category CmsEntry\n * @category GraphQL output\n */\nexport interface CmsEntryMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\n/**\n * Create\n */\nexport interface OnEntryBeforeCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterCreateTopicParams {\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateErrorTopicParams {\n error: Error;\n input: CreateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Revision Create\n */\nexport interface OnEntryRevisionBeforeCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterCreateTopicParams {\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n original: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryCreateRevisionErrorTopicParams {\n error: Error;\n input: CreateFromCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Update\n */\nexport interface OnEntryBeforeUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUpdateTopicParams {\n input: UpdateCmsEntryInput;\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUpdateErrorTopicParams {\n error: Error;\n input: CreateFromCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Publish\n */\n\nexport interface OnEntryBeforePublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterPublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryPublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Republish\n */\nexport interface OnEntryBeforeRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRepublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRepublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Unpublish\n */\n\nexport interface OnEntryBeforeUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterUnpublishTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryUnpublishErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryRevisionDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryBeforeDeleteMultipleTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n}\n\nexport interface OnEntryAfterDeleteMultipleTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n}\n\nexport interface OnEntryDeleteMultipleErrorTopicParams {\n model: CmsModel;\n entries: CmsEntry[];\n ids: string[];\n error: Error;\n}\n\nexport interface OnEntryBeforeGetTopicParams {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n\nexport interface EntryBeforeListTopicParams {\n where: CmsEntryListWhere;\n model: CmsModel;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateCmsEntryInput {\n id?: string;\n [key: string]: any;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateFromCmsEntryInput {\n [key: string]: any;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface UpdateCmsEntryInput {\n [key: string]: any;\n}\n\n/**\n * @category CmsEntry\n */\nexport interface CmsDeleteEntryOptions {\n /**\n * Runs the delete commands even if the entry is not found in the DynamoDB.\n * This is to force clean the entry records that might have been left behind a failed delete.\n */\n force?: boolean;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface DeleteMultipleEntriesParams {\n entries: string[];\n}\n\nexport type DeleteMultipleEntriesResponse = { id: string }[];\n\n/**\n * Cms Entry CRUD methods in the context.\n *\n * @category Context\n * @category CmsEntry\n */\nexport interface CmsEntryContext {\n /**\n * Get a single content entry for a model.\n */\n getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry>;\n /**\n * Get a list of entries for a model by a given ID (revision).\n */\n getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;\n /**\n * Get the entry for a model by a given ID.\n */\n getEntryById: (model: CmsModel, revision: string) => Promise<CmsEntry>;\n /**\n * List entries for a model. Internal method used by get, listLatest and listPublished.\n */\n listEntries: <T = CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Lists the latest entries. Used for manage API.\n */\n listLatestEntries: <T = CmsEntryValues>(\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List published entries. Used for read API.\n */\n listPublishedEntries: <T = CmsEntryValues>(\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List published entries by IDs.\n */\n getPublishedEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;\n /**\n * List latest entries by IDs.\n */\n getLatestEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Create a new content entry.\n */\n createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;\n /**\n * Create a new entry from already existing entry.\n */\n createEntryRevisionFrom: (\n model: CmsModel,\n id: string,\n input: CreateFromCmsEntryInput\n ) => Promise<CmsEntry>;\n /**\n * Update existing entry.\n */\n updateEntry: (\n model: CmsModel,\n id: string,\n input: UpdateCmsEntryInput,\n meta?: Record<string, any>\n ) => Promise<CmsEntry>;\n /**\n * Method that republishes entry with given identifier.\n * @internal\n */\n republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Delete only a certain revision of the entry.\n */\n deleteEntryRevision: (model: CmsModel, id: string) => Promise<void>;\n /**\n * Delete entry with all its revisions.\n */\n deleteEntry: (model: CmsModel, id: string, options?: CmsDeleteEntryOptions) => Promise<void>;\n /**\n * Delete multiple entries\n */\n deleteMultipleEntries: (\n model: CmsModel,\n params: DeleteMultipleEntriesParams\n ) => Promise<DeleteMultipleEntriesResponse>;\n /**\n * Publish entry.\n */\n publishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Unpublish entry.\n */\n unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Get all entry revisions.\n */\n getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;\n /**\n * Lifecyle events - deprecated.\n */\n /**\n * @deprecated\n */\n onBeforeEntryCreate: Topic<OnEntryBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryCreate: Topic<OnEntryAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryCreateRevision: Topic<OnEntryRevisionBeforeCreateTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryCreateRevision: Topic<OnEntryRevisionAfterCreateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryUpdate: Topic<OnEntryBeforeUpdateTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryUpdate: Topic<OnEntryAfterUpdateTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryDelete: Topic<OnEntryBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryDelete: Topic<OnEntryAfterDeleteTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryDeleteRevision: Topic<OnEntryRevisionBeforeDeleteTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryDeleteRevision: Topic<OnEntryRevisionAfterDeleteTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryPublish: Topic<OnEntryBeforePublishTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryPublish: Topic<OnEntryAfterPublishTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;\n /**\n * @deprecated\n */\n onAfterEntryUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryGet: Topic<OnEntryBeforeGetTopicParams>;\n /**\n * @deprecated\n */\n onBeforeEntryList: Topic<EntryBeforeListTopicParams>;\n /**\n * Lifecycle events released in 5.33.0\n */\n onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;\n onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;\n onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;\n\n onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;\n onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;\n onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;\n\n onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;\n onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;\n onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;\n\n onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;\n onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;\n onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;\n\n onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;\n onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;\n onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;\n\n onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;\n onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;\n onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;\n\n onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;\n onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;\n onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;\n\n onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;\n onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;\n onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;\n\n onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;\n onEntryBeforeList: Topic<EntryBeforeListTopicParams>;\n}\n\n/**\n * Parameters for CmsEntryResolverFactory.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\ninterface CmsEntryResolverFactoryParams {\n model: CmsModel;\n}\n\n/**\n * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\nexport type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {\n (params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;\n};\n\n/**\n * Settings security permission.\n *\n * @category SecurityPermission\n */\nexport interface CmsSettingsPermission extends SecurityPermission {} // eslint-disable-line\n\n/**\n * A base security permission for CMS.\n *\n * @category SecurityPermission\n */\nexport interface BaseCmsSecurityPermission extends SecurityPermission {\n own?: boolean;\n rwd: string | number;\n}\n\n/**\n * A security permission for content model.\n *\n * @category SecurityPermission\n * @category CmsModel\n */\nexport interface CmsModelPermission extends BaseCmsSecurityPermission {\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content model groups.\n *\n * @category SecurityPermission\n * @category CmsGroup\n */\nexport interface CmsGroupPermission extends BaseCmsSecurityPermission {\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\n/**\n * The security permission for content entry.\n *\n * @category SecurityPermission\n * @category CmsEntry\n */\nexport interface CmsEntryPermission extends BaseCmsSecurityPermission {\n pw?: string;\n /**\n * An object representing `key: model.modelId` values where key is locale code.\n */\n models?: {\n [key: string]: string[];\n };\n /**\n * {locale: groupId[]} map, where key is a locale code.\n */\n groups?: {\n [key: string]: string[];\n };\n}\n\nexport interface CmsGroupStorageOperationsGetParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport interface CmsGroupStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n [key: string]: any;\n}\n\nexport interface CmsGroupStorageOperationsListParams {\n where: CmsGroupStorageOperationsListWhereParams;\n sort?: string[];\n}\n\nexport interface CmsGroupStorageOperationsCreateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsUpdateParams {\n group: CmsGroup;\n}\n\nexport interface CmsGroupStorageOperationsDeleteParams {\n group: CmsGroup;\n}\n\n/**\n * Description of the CmsGroup CRUD operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsGroupStorageOperations {\n /**\n * Gets content model group by given id.\n */\n get: (params: CmsGroupStorageOperationsGetParams) => Promise<CmsGroup | null>;\n /**\n * List all content model groups. Filterable via params.\n */\n list: (params: CmsGroupStorageOperationsListParams) => Promise<CmsGroup[]>;\n /**\n * Create a new content model group.\n */\n create: (params: CmsGroupStorageOperationsCreateParams) => Promise<CmsGroup>;\n /**\n * Update existing content model group.\n */\n update: (params: CmsGroupStorageOperationsUpdateParams) => Promise<CmsGroup>;\n /**\n * Delete the content model group.\n */\n delete: (params: CmsGroupStorageOperationsDeleteParams) => Promise<CmsGroup>;\n}\n\nexport interface CmsModelStorageOperationsGetParams {\n tenant: string;\n locale: string;\n modelId: string;\n}\n\nexport interface CmsModelStorageOperationsListWhereParams {\n tenant: string;\n locale: string;\n [key: string]: string;\n}\n\nexport interface CmsModelStorageOperationsListParams {\n where: CmsModelStorageOperationsListWhereParams;\n}\n\nexport interface CmsModelStorageOperationsCreateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsUpdateParams {\n model: CmsModel;\n}\n\nexport interface CmsModelStorageOperationsDeleteParams {\n model: CmsModel;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n */\nexport interface CmsModelStorageOperations {\n /**\n * Gets content model by given id.\n */\n get: (params: CmsModelStorageOperationsGetParams) => Promise<CmsModel | null>;\n /**\n * List all content models. Filterable via params.\n */\n list: (params: CmsModelStorageOperationsListParams) => Promise<CmsModel[]>;\n /**\n * Create a new content model.\n */\n create: (params: CmsModelStorageOperationsCreateParams) => Promise<CmsModel>;\n /**\n * Update existing content model.\n */\n update: (params: CmsModelStorageOperationsUpdateParams) => Promise<CmsModel>;\n /**\n * Delete the content model.\n */\n delete: (params: CmsModelStorageOperationsDeleteParams) => Promise<CmsModel>;\n}\n\nexport interface CmsEntryStorageOperationsGetParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n limit?: number;\n}\n\nexport interface CmsEntryStorageOperationsListParams {\n where: CmsEntryListWhere;\n sort?: CmsEntryListSort;\n search?: string;\n fields?: string[];\n limit: number;\n after?: string | null;\n}\n\nexport interface CmsEntryStorageOperationsCreateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsCreateRevisionFromParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUpdateParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Real entry, with no transformations on it.\n */\n entry: CmsEntry;\n /**\n * Entry prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsDeleteRevisionParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Entry that was deleted.\n */\n entry: CmsEntry;\n /**\n * Entry that was deleted, directly from storage, with transformations.\n */\n storageEntry: T;\n /**\n * Entry that was set as latest.\n */\n latestEntry: CmsEntry | null;\n /**\n * Entry that was set as latest, directly from storage, with transformations.\n */\n latestStorageEntry: T | null;\n}\n\nexport interface CmsEntryStorageOperationsDeleteParams {\n entry: CmsEntry;\n}\n\nexport interface CmsEntryStorageOperationsDeleteEntriesParams {\n entries: string[];\n}\n\nexport interface CmsEntryStorageOperationsPublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as published.\n * Entry is in its original form.\n */\n entry: CmsEntry;\n /**\n * The modified entry and prepared for the storage.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsUnpublishParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as unpublished.\n */\n entry: CmsEntry;\n /**\n * The modified entry that is going to be saved as unpublished, with transformations on it.\n */\n storageEntry: T;\n}\n\nexport interface CmsEntryStorageOperationsGetByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetLatestByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedByIdsParams {\n ids: readonly string[];\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionsParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPublishedRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetLatestRevisionParams {\n id: string;\n}\n\nexport interface CmsEntryStorageOperationsGetPreviousRevisionParams {\n entryId: string;\n version: number;\n}\n\nexport interface CmsEntryStorageOperationsListResponse<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * Has more items to load with the current filtering?\n */\n hasMoreItems: boolean;\n /**\n * Items loaded with current filtering.\n */\n items: T[];\n /**\n * Pointer for where to start the new item set.\n */\n cursor: string | null;\n /**\n * Total amount of items with the current filter.\n */\n totalCount: number;\n}\n\n/**\n * Description of the CmsModel storage operations.\n * If user wants to add another database to the application, this is how it is done.\n * This is just plain read, update, write, delete and list - no authentication or permission checks.\n *\n *\n * @category StorageOperations\n * @category CmsEntry\n */\nexport interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorageEntry> {\n /**\n * Get all the entries of the ids.\n */\n getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;\n /**\n * Get all the published entries of the ids.\n */\n getPublishedByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all the latest entries of the ids.\n */\n getLatestByIds: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestByIdsParams\n ) => Promise<T[]>;\n /**\n * Get all revisions of the given entry id.\n */\n getRevisions: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionsParams\n ) => Promise<T[]>;\n /**\n * Get the entry by the given revision id.\n */\n getRevisionById: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the published entry by given entryId.\n */\n getPublishedRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPublishedRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the latest entry by given entryId.\n */\n getLatestRevisionByEntryId: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetLatestRevisionParams\n ) => Promise<T | null>;\n /**\n * Get the revision of the entry before given one.\n */\n getPreviousRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetPreviousRevisionParams\n ) => Promise<T | null>;\n /**\n * Gets entry by given params.\n */\n get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;\n /**\n * List all entries. Filterable via params.\n */\n list: (\n model: CmsModel,\n params: CmsEntryStorageOperationsListParams\n ) => Promise<CmsEntryStorageOperationsListResponse<T>>;\n /**\n * Create a new entry.\n */\n create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;\n /**\n * Create a new entry from existing one.\n */\n createRevisionFrom: (\n model: CmsModel,\n params: CmsEntryStorageOperationsCreateRevisionFromParams<T>\n ) => Promise<T>;\n /**\n * Update existing entry.\n */\n update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;\n /**\n * Delete the entry revision.\n */\n deleteRevision: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteRevisionParams<T>\n ) => Promise<void>;\n /**\n * Delete the entry.\n */\n delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;\n /**\n * Delete multiple entries, with a limit on how much can be deleted in one call.\n */\n deleteMultipleEntries: (\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteEntriesParams\n ) => Promise<void>;\n /**\n * Publish the entry.\n */\n publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;\n /**\n * Unpublish the entry.\n */\n unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;\n}\n\nexport enum CONTENT_ENTRY_STATUS {\n DRAFT = \"draft\",\n PUBLISHED = \"published\",\n UNPUBLISHED = \"unpublished\"\n}\n\nexport interface CmsSettingsStorageOperationsGetParams {\n locale: string;\n tenant: string;\n}\n\nexport interface CmsSettingsStorageOperationsCreateParams {\n settings: CmsSettings;\n}\n\nexport interface CmsSettingsStorageOperationsUpdateParams {\n settings: CmsSettings;\n}\n\nexport interface CmsSettingsStorageOperations {\n /**\n * Get the settings from the storage.\n */\n get: (params: CmsSettingsStorageOperationsGetParams) => Promise<CmsSettings | null>;\n /**\n * Create settings in the storage.\n */\n create: (params: CmsSettingsStorageOperationsCreateParams) => Promise<CmsSettings>;\n /**\n * Update the settings in the storage.\n */\n update: (params: CmsSettingsStorageOperationsUpdateParams) => Promise<CmsSettings>;\n}\n\nexport interface CmsSystem {\n version?: string;\n readAPIKey?: string;\n /**\n * System tenant.\n */\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsGetParams {\n tenant: string;\n}\n\nexport interface CmsSystemStorageOperationsCreateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperationsUpdateParams {\n system: CmsSystem;\n}\n\nexport interface CmsSystemStorageOperations {\n /**\n * Get the system data.\n */\n get: (params: CmsSystemStorageOperationsGetParams) => Promise<CmsSystem | null>;\n /**\n * Create the system info in the storage.\n */\n create: (params: CmsSystemStorageOperationsCreateParams) => Promise<CmsSystem>;\n /**\n * Update the system info in the storage.\n */\n update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;\n}\n\nexport interface HeadlessCmsStorageOperations<C = CmsContext> {\n name: string;\n system: CmsSystemStorageOperations;\n settings: CmsSettingsStorageOperations;\n groups: CmsGroupStorageOperations;\n models: CmsModelStorageOperations;\n entries: CmsEntryStorageOperations;\n /**\n * Either attach something from the storage operations or run something in it.\n */\n beforeInit: (context: C) => Promise<void>;\n init?: (context: C) => Promise<void>;\n}\n"],"mappings":";;;;;;AAoDA;AACA;AACA;AACA;AACA;AAmBA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AA6CA;AACA;AACA;AACA;AACA;AACA;AAgGA;AACA;AACA;AAUA;AACA;AACA;AASA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AA+GA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AA8PA;AACA;AACA;AACA;AACA;AACA;AACA;AAoBA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AAuDA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAsDA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAmEA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyDA;AACA;AACA;AACA;AACA;AACA;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AA4FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoCA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAoBA;AACA;AACA;AAcA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AA+GA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AAgFA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AAqBA;AACA;AACA;AAwBA;AACA;AACA;AAuBA;AACA;AACA;AAmBA;AACA;AACA;AAkBA;AACA;AACA;AAgFA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAKA;AACA;AACA;AASA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AA0MA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACqE;AAErE;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AA8CA;AACA;AACA;AACA;AACA;AAoDA;AACA;AACA;AACA;AACA;AA4LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IAqHYA,oBAAoB;AAAA;AAAA,WAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,oCAApBA,oBAAoB"}
@@ -1,2 +0,0 @@
1
- import { CmsModelField, CmsModelFieldInput } from "../../types";
2
- export declare const createFieldModels: (input?: CmsModelFieldInput[]) => Promise<CmsModelField[]>;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFieldModels = void 0;
7
-
8
- var _models = require("./models");
9
-
10
- const createFieldModels = async input => {
11
- if (!input || input.length === 0) {
12
- return [];
13
- }
14
-
15
- const fields = [];
16
-
17
- for (const field of input) {
18
- const fieldData = new _models.ContentModelFieldModel().populate(field);
19
- await fieldData.validate();
20
- fields.push(await fieldData.toJSON());
21
- }
22
-
23
- return fields;
24
- };
25
-
26
- exports.createFieldModels = createFieldModels;
@@ -1 +0,0 @@
1
- {"version":3,"names":["createFieldModels","input","length","fields","field","fieldData","ContentModelFieldModel","populate","validate","push","toJSON"],"sources":["createFieldModels.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldInput } from \"~/types\";\nimport { ContentModelFieldModel } from \"./models\";\n\nexport const createFieldModels = async (input?: CmsModelFieldInput[]): Promise<CmsModelField[]> => {\n if (!input || input.length === 0) {\n return [];\n }\n const fields: CmsModelField[] = [];\n for (const field of input) {\n const fieldData = new ContentModelFieldModel().populate(field);\n await fieldData.validate();\n fields.push(await fieldData.toJSON());\n }\n return fields;\n};\n"],"mappings":";;;;;;;AACA;;AAEO,MAAMA,iBAAiB,GAAG,MAAOC,KAAP,IAAkE;EAC/F,IAAI,CAACA,KAAD,IAAUA,KAAK,CAACC,MAAN,KAAiB,CAA/B,EAAkC;IAC9B,OAAO,EAAP;EACH;;EACD,MAAMC,MAAuB,GAAG,EAAhC;;EACA,KAAK,MAAMC,KAAX,IAAoBH,KAApB,EAA2B;IACvB,MAAMI,SAAS,GAAG,IAAIC,8BAAJ,GAA6BC,QAA7B,CAAsCH,KAAtC,CAAlB;IACA,MAAMC,SAAS,CAACG,QAAV,EAAN;IACAL,MAAM,CAACM,IAAP,CAAY,MAAMJ,SAAS,CAACK,MAAV,EAAlB;EACH;;EACD,OAAOP,MAAP;AACH,CAXM"}
@@ -1 +0,0 @@
1
- export declare const validateFieldId: (input: string) => Promise<void>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.validateFieldId = void 0;
7
-
8
- var _validation = require("@webiny/validation");
9
-
10
- var _systemFields = require("./systemFields");
11
-
12
- const validateFieldId = async input => {
13
- await _validation.validation.validate(input, "required,maxLength:100");
14
- const value = String(input || "").trim();
15
-
16
- if (!value.charAt(0).match(/^[a-zA-Z]/)) {
17
- throw new Error(`Provided ${value} is not valid - must not start with a number.`);
18
- } else if (value.match(/^([a-zA-Z0-9]+)$/) === null) {
19
- throw new Error(`Provided ${value} is not valid - must be alphanumeric string.`);
20
- } else if (_systemFields.fieldSystemFields.includes(value)) {
21
- throw new Error(`Provided ${value} is not valid - "${value}" is an auto-generated field.`);
22
- }
23
- };
24
-
25
- exports.validateFieldId = validateFieldId;
@@ -1 +0,0 @@
1
- {"version":3,"names":["validateFieldId","input","validation","validate","value","String","trim","charAt","match","Error","fieldSystemFields","includes"],"sources":["fieldIdValidation.ts"],"sourcesContent":["import { validation } from \"@webiny/validation\";\nimport { fieldSystemFields } from \"~/crud/contentModel/systemFields\";\n\nexport const validateFieldId = async (input: string): Promise<void> => {\n await validation.validate(input, \"required,maxLength:100\");\n\n const value = String(input || \"\").trim();\n\n if (!value.charAt(0).match(/^[a-zA-Z]/)) {\n throw new Error(`Provided ${value} is not valid - must not start with a number.`);\n } else if (value.match(/^([a-zA-Z0-9]+)$/) === null) {\n throw new Error(`Provided ${value} is not valid - must be alphanumeric string.`);\n } else if (fieldSystemFields.includes(value)) {\n throw new Error(`Provided ${value} is not valid - \"${value}\" is an auto-generated field.`);\n }\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,eAAe,GAAG,MAAOC,KAAP,IAAwC;EACnE,MAAMC,sBAAA,CAAWC,QAAX,CAAoBF,KAApB,EAA2B,wBAA3B,CAAN;EAEA,MAAMG,KAAK,GAAGC,MAAM,CAACJ,KAAK,IAAI,EAAV,CAAN,CAAoBK,IAApB,EAAd;;EAEA,IAAI,CAACF,KAAK,CAACG,MAAN,CAAa,CAAb,EAAgBC,KAAhB,CAAsB,WAAtB,CAAL,EAAyC;IACrC,MAAM,IAAIC,KAAJ,CAAW,YAAWL,KAAM,+CAA5B,CAAN;EACH,CAFD,MAEO,IAAIA,KAAK,CAACI,KAAN,CAAY,kBAAZ,MAAoC,IAAxC,EAA8C;IACjD,MAAM,IAAIC,KAAJ,CAAW,YAAWL,KAAM,8CAA5B,CAAN;EACH,CAFM,MAEA,IAAIM,+BAAA,CAAkBC,QAAlB,CAA2BP,KAA3B,CAAJ,EAAuC;IAC1C,MAAM,IAAIK,KAAJ,CAAW,YAAWL,KAAM,oBAAmBA,KAAM,+BAArD,CAAN;EACH;AACJ,CAZM"}
@@ -1 +0,0 @@
1
- export declare const validateId: (value: string) => Promise<void>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.validateId = void 0;
7
-
8
- var _validation = require("@webiny/validation");
9
-
10
- const validateId = async value => {
11
- await _validation.validation.validate(value, "required,maxLength:100");
12
-
13
- if (!value.charAt(0).match(/[a-zA-Z]/)) {
14
- throw new Error(`Provided ID ${value} is not valid - must not start with a number.`);
15
- }
16
-
17
- if (value.trim().toLowerCase() === "id") {
18
- throw new Error(`Provided ID ${value} is not valid - "id" is an auto-generated field.`);
19
- }
20
- };
21
-
22
- exports.validateId = validateId;
@@ -1 +0,0 @@
1
- {"version":3,"names":["validateId","value","validation","validate","charAt","match","Error","trim","toLowerCase"],"sources":["idValidation.ts"],"sourcesContent":["import { validation } from \"@webiny/validation\";\n\nexport const validateId = async (value: string): Promise<void> => {\n await validation.validate(value, \"required,maxLength:100\");\n if (!value.charAt(0).match(/[a-zA-Z]/)) {\n throw new Error(`Provided ID ${value} is not valid - must not start with a number.`);\n }\n if (value.trim().toLowerCase() === \"id\") {\n throw new Error(`Provided ID ${value} is not valid - \"id\" is an auto-generated field.`);\n }\n};\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,UAAU,GAAG,MAAOC,KAAP,IAAwC;EAC9D,MAAMC,sBAAA,CAAWC,QAAX,CAAoBF,KAApB,EAA2B,wBAA3B,CAAN;;EACA,IAAI,CAACA,KAAK,CAACG,MAAN,CAAa,CAAb,EAAgBC,KAAhB,CAAsB,UAAtB,CAAL,EAAwC;IACpC,MAAM,IAAIC,KAAJ,CAAW,eAAcL,KAAM,+CAA/B,CAAN;EACH;;EACD,IAAIA,KAAK,CAACM,IAAN,GAAaC,WAAb,OAA+B,IAAnC,EAAyC;IACrC,MAAM,IAAIF,KAAJ,CAAW,eAAcL,KAAM,kDAA/B,CAAN;EACH;AACJ,CARM"}
@@ -1,4 +0,0 @@
1
- export declare const ContentModelFieldModel: any;
2
- export declare const CreateContentModelModel: any;
3
- export declare const CreateContentModelModelFrom: any;
4
- export declare const UpdateContentModelModel: any;