@webiny/api-headless-cms 5.40.1 → 5.40.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/crud/contentEntry/referenceFieldsMapping.js +8 -8
  2. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
  3. package/crud/contentModel/validation.d.ts +21 -21
  4. package/crud/contentModel/validation.js +1 -1
  5. package/crud/contentModel/validation.js.map +1 -1
  6. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +22 -54
  7. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
  8. package/graphql/schema/createManageResolvers.js +21 -48
  9. package/graphql/schema/createManageResolvers.js.map +1 -1
  10. package/graphql/schema/createPreviewResolvers.js +4 -2
  11. package/graphql/schema/createPreviewResolvers.js.map +1 -1
  12. package/graphql/schema/createReadResolvers.js +4 -2
  13. package/graphql/schema/createReadResolvers.js.map +1 -1
  14. package/graphql/schema/resolvers/manage/normalizeGraphQlInput.d.ts +7 -0
  15. package/graphql/schema/resolvers/manage/normalizeGraphQlInput.js +59 -0
  16. package/graphql/schema/resolvers/manage/normalizeGraphQlInput.js.map +1 -0
  17. package/graphqlFields/dynamicZone/dynamicZoneField.js +43 -15
  18. package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
  19. package/graphqlFields/dynamicZone/index.d.ts +0 -1
  20. package/graphqlFields/dynamicZone/index.js +0 -7
  21. package/graphqlFields/dynamicZone/index.js.map +1 -1
  22. package/index.d.ts +2 -1
  23. package/index.js +13 -2
  24. package/index.js.map +1 -1
  25. package/package.json +20 -20
  26. package/types/modelAst.d.ts +1 -1
  27. package/types/modelAst.js.map +1 -1
  28. package/types/modelField.d.ts +3 -2
  29. package/types/modelField.js.map +1 -1
  30. package/types/plugins.d.ts +2 -1
  31. package/types/plugins.js.map +1 -1
  32. package/types/types.d.ts +6 -0
  33. package/types/types.js.map +1 -1
  34. package/utils/contentEntryTraverser/ContentEntryTraverser.d.ts +1 -1
  35. package/utils/contentEntryTraverser/ContentEntryTraverser.js +28 -15
  36. package/utils/contentEntryTraverser/ContentEntryTraverser.js.map +1 -1
  37. package/graphqlFields/dynamicZone/dynamicZoneStorage.d.ts +0 -3
  38. package/graphqlFields/dynamicZone/dynamicZoneStorage.js +0 -111
  39. package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms",
3
- "version": "5.40.1",
3
+ "version": "5.40.2-beta.0",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "cms:base"
@@ -20,20 +20,20 @@
20
20
  "dependencies": {
21
21
  "@babel/runtime": "7.24.1",
22
22
  "@graphql-tools/schema": "7.1.5",
23
- "@webiny/api": "5.40.1",
24
- "@webiny/api-i18n": "5.40.1",
25
- "@webiny/api-security": "5.40.1",
26
- "@webiny/api-tenancy": "5.40.1",
27
- "@webiny/error": "5.40.1",
28
- "@webiny/handler": "5.40.1",
29
- "@webiny/handler-aws": "5.40.1",
30
- "@webiny/handler-db": "5.40.1",
31
- "@webiny/handler-graphql": "5.40.1",
32
- "@webiny/lexical-converter": "5.40.1",
33
- "@webiny/plugins": "5.40.1",
34
- "@webiny/pubsub": "5.40.1",
35
- "@webiny/utils": "5.40.1",
36
- "@webiny/validation": "5.40.1",
23
+ "@webiny/api": "5.40.2-beta.0",
24
+ "@webiny/api-i18n": "5.40.2-beta.0",
25
+ "@webiny/api-security": "5.40.2-beta.0",
26
+ "@webiny/api-tenancy": "5.40.2-beta.0",
27
+ "@webiny/error": "5.40.2-beta.0",
28
+ "@webiny/handler": "5.40.2-beta.0",
29
+ "@webiny/handler-aws": "5.40.2-beta.0",
30
+ "@webiny/handler-db": "5.40.2-beta.0",
31
+ "@webiny/handler-graphql": "5.40.2-beta.0",
32
+ "@webiny/lexical-converter": "5.40.2-beta.0",
33
+ "@webiny/plugins": "5.40.2-beta.0",
34
+ "@webiny/pubsub": "5.40.2-beta.0",
35
+ "@webiny/utils": "5.40.2-beta.0",
36
+ "@webiny/validation": "5.40.2-beta.0",
37
37
  "code-frame": "5.0.0",
38
38
  "dot-prop": "6.0.1",
39
39
  "graphql": "15.8.0",
@@ -51,10 +51,10 @@
51
51
  "@babel/cli": "7.24.1",
52
52
  "@babel/core": "7.24.3",
53
53
  "@babel/preset-env": "7.24.3",
54
- "@webiny/api-wcp": "5.40.1",
55
- "@webiny/aws-sdk": "5.40.1",
56
- "@webiny/cli": "5.40.1",
57
- "@webiny/project-utils": "5.40.1",
54
+ "@webiny/api-wcp": "5.40.2-beta.0",
55
+ "@webiny/aws-sdk": "5.40.2-beta.0",
56
+ "@webiny/cli": "5.40.2-beta.0",
57
+ "@webiny/project-utils": "5.40.2-beta.0",
58
58
  "apollo-graphql": "0.9.7",
59
59
  "get-yarn-workspaces": "1.0.2",
60
60
  "graphql": "15.8.0",
@@ -74,5 +74,5 @@
74
74
  "build": "yarn webiny run build",
75
75
  "watch": "yarn webiny run watch"
76
76
  },
77
- "gitHead": "2529e55b41115db851027610c99496ef2a40e37a"
77
+ "gitHead": "cf2c1929dbb2f75bc25ed37ea9b411acd2409f6f"
78
78
  }
@@ -35,5 +35,5 @@ export interface ContentEntryNodeContext {
35
35
  parent: CmsModelAst | CmsModelFieldAstNode | null;
36
36
  }
37
37
  export interface ContentEntryValueVisitor {
38
- (params: ContentEntryNode, context: ContentEntryNodeContext): Promise<void> | void;
38
+ (params: ContentEntryNode, context: ContentEntryNodeContext): Promise<void | unknown> | void | unknown;
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["modelAst.ts"],"sourcesContent":["/**\n * CMS Model AST\n */\nimport { CmsModelField } from \"./modelField\";\n\nexport interface ICmsModelFieldToAst {\n toAst(field: CmsModelField): CmsModelFieldAstNode;\n}\n\nexport type CmsModelAst = {\n type: \"root\";\n children: CmsModelFieldAstNode[];\n};\n\nexport type CmsModelFieldAstNodeCollection = {\n type: \"collection\";\n collection: { discriminator: string } & Record<string, any>;\n children: CmsModelFieldAstNode[];\n};\n\nexport type CmsModelFieldAstNodeField = {\n type: \"field\";\n field: CmsModelField;\n children: CmsModelFieldAstNode[];\n};\n\nexport type CmsModelFieldAstNode = CmsModelFieldAstNodeCollection | CmsModelFieldAstNodeField;\n\nexport interface GetCmsModelFieldAst<TField> {\n (field: TField, converter: ICmsModelFieldToAst): CmsModelFieldAstNode;\n}\n\nexport interface ContentEntryNode {\n field: CmsModelField;\n value: any;\n path: string;\n // parentField: CmsModelField | undefined;\n // parent => parent object (e.g., entry)\n}\n\nexport interface ContentEntryNodeContext {\n node: CmsModelAst | CmsModelFieldAstNode;\n parent: CmsModelAst | CmsModelFieldAstNode | null;\n}\n\nexport interface ContentEntryValueVisitor {\n (params: ContentEntryNode, context: ContentEntryNodeContext): Promise<void> | void;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["modelAst.ts"],"sourcesContent":["/**\n * CMS Model AST\n */\nimport { CmsModelField } from \"./modelField\";\n\nexport interface ICmsModelFieldToAst {\n toAst(field: CmsModelField): CmsModelFieldAstNode;\n}\n\nexport type CmsModelAst = {\n type: \"root\";\n children: CmsModelFieldAstNode[];\n};\n\nexport type CmsModelFieldAstNodeCollection = {\n type: \"collection\";\n collection: { discriminator: string } & Record<string, any>;\n children: CmsModelFieldAstNode[];\n};\n\nexport type CmsModelFieldAstNodeField = {\n type: \"field\";\n field: CmsModelField;\n children: CmsModelFieldAstNode[];\n};\n\nexport type CmsModelFieldAstNode = CmsModelFieldAstNodeCollection | CmsModelFieldAstNodeField;\n\nexport interface GetCmsModelFieldAst<TField> {\n (field: TField, converter: ICmsModelFieldToAst): CmsModelFieldAstNode;\n}\n\nexport interface ContentEntryNode {\n field: CmsModelField;\n value: any;\n path: string;\n // parentField: CmsModelField | undefined;\n // parent => parent object (e.g., entry)\n}\n\nexport interface ContentEntryNodeContext {\n node: CmsModelAst | CmsModelFieldAstNode;\n parent: CmsModelAst | CmsModelFieldAstNode | null;\n}\n\nexport interface ContentEntryValueVisitor {\n (params: ContentEntryNode, context: ContentEntryNodeContext):\n | Promise<void | unknown>\n | void\n | unknown;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  import { CmsModel } from "./model";
2
+ import { GenericRecord } from "@webiny/api/types";
2
3
  export declare type CmsModelFieldType = "boolean" | "datetime" | "file" | "long-text" | "number" | "json" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
3
4
  /**
4
5
  * A definition for content model field. This type exists on the app side as well.
@@ -239,7 +240,7 @@ interface CmsModelFieldRenderer {
239
240
  /**
240
241
  * Renderer settings allow you to configure field renderer on a field level.
241
242
  */
242
- settings?: Record<string, any>;
243
+ settings?: GenericRecord<string> | null;
243
244
  }
244
245
  /**
245
246
  * A definition for content model field settings.
@@ -252,7 +253,7 @@ export interface CmsModelFieldSettings {
252
253
  * Predefined values (text, number)
253
254
  * The default value for the field in case it is not predefined values field.
254
255
  */
255
- defaultValue?: string | number | null | undefined;
256
+ defaultValue?: string | boolean | number | null | undefined;
256
257
  /**
257
258
  * Object field has child fields.
258
259
  */
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["modelField.ts"],"sourcesContent":["import { CmsModel } from \"./model\";\n\nexport type CmsModelFieldType =\n | \"boolean\"\n | \"datetime\"\n | \"file\"\n | \"long-text\"\n | \"number\"\n | \"json\"\n | \"object\"\n | \"ref\"\n | \"rich-text\"\n | \"text\"\n | \"dynamicZone\"\n | string;\n\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 | null;\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\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 | null;\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 * 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\n [key: string]: any;\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 * Renderer settings allow you to configure field renderer on a field level.\n */\n settings?: Record<string, any>;\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 * Disable full text search explicitly on this field.\n */\n disableFullTextSearch?: boolean;\n\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\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 * 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\ninterface CmsModelFieldPredefinedValuesValue {\n value: string;\n label: string;\n /**\n * Default selected predefined value.\n */\n selected?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["modelField.ts"],"sourcesContent":["import { CmsModel } from \"./model\";\nimport { GenericRecord } from \"@webiny/api/types\";\n\nexport type CmsModelFieldType =\n | \"boolean\"\n | \"datetime\"\n | \"file\"\n | \"long-text\"\n | \"number\"\n | \"json\"\n | \"object\"\n | \"ref\"\n | \"rich-text\"\n | \"text\"\n | \"dynamicZone\"\n | string;\n\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 | null;\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\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 | null;\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 * 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\n [key: string]: any;\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 * Renderer settings allow you to configure field renderer on a field level.\n */\n settings?: GenericRecord<string> | null;\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 | boolean | 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 * Disable full text search explicitly on this field.\n */\n disableFullTextSearch?: boolean;\n\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\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 * 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\ninterface CmsModelFieldPredefinedValuesValue {\n value: string;\n label: string;\n /**\n * Default selected predefined value.\n */\n selected?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from "@webiny/plugins/types";
2
2
  import { GraphQLSchemaDefinition } from "@webiny/handler-graphql/types";
3
- import { CmsContext, CmsFieldTypePlugins, CmsModelFieldDefinition, CmsModelFieldToGraphQLCreateResolver, CmsModelFieldToGraphQLPluginValidateChildFields, CmsModelFieldValidatorValidateParams } from "./types";
3
+ import { CmsContext, CmsFieldTypePlugins, CmsModelFieldDefinition, CmsModelFieldToGraphQLCreateResolver, CmsModelFieldToGraphQLNormalizeInputParams, CmsModelFieldToGraphQLPluginValidateChildFields, CmsModelFieldValidatorValidateParams } from "./types";
4
4
  import { GetCmsModelFieldAst } from "./modelAst";
5
5
  import { CmsModelField, CmsModelFieldType, LockedField } from "./modelField";
6
6
  import { CmsModel } from "./model";
@@ -262,6 +262,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
262
262
  * ```
263
263
  */
264
264
  createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
265
+ normalizeInput?: <T>(params: CmsModelFieldToGraphQLNormalizeInputParams<TField>) => Promise<T>;
265
266
  };
266
267
  /**
267
268
  *
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["plugins.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { GraphQLSchemaDefinition } from \"@webiny/handler-graphql/types\";\nimport {\n CmsContext,\n CmsFieldTypePlugins,\n CmsModelFieldDefinition,\n CmsModelFieldToGraphQLCreateResolver,\n CmsModelFieldToGraphQLPluginValidateChildFields,\n CmsModelFieldValidatorValidateParams\n} from \"./types\";\nimport { GetCmsModelFieldAst } from \"./modelAst\";\nimport { CmsModelField, CmsModelFieldType, LockedField } from \"./modelField\";\nimport { CmsModel } from \"./model\";\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: CmsModelFieldType;\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: {\n model: CmsModel;\n field: Omit<TField, \"storageId\"> & Partial<Pick<TField, \"storageId\">>;\n }) => 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: { 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: Pick<CmsModel, \"singularApiName\">;\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: Pick<CmsModel, \"singularApiName\">;\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 * Get field AST.\n */\n getFieldAst?: GetCmsModelFieldAst<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 * Definition for the field validator.\n *\n * @category Plugin\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorPluginValidateCb {\n (params: CmsModelFieldValidatorValidateParams): Promise<boolean>;\n}\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: CmsModelFieldValidatorPluginValidateCb;\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"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["plugins.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { GraphQLSchemaDefinition } from \"@webiny/handler-graphql/types\";\nimport {\n CmsContext,\n CmsFieldTypePlugins,\n CmsModelFieldDefinition,\n CmsModelFieldToGraphQLCreateResolver,\n CmsModelFieldToGraphQLNormalizeInputParams,\n CmsModelFieldToGraphQLPluginValidateChildFields,\n CmsModelFieldValidatorValidateParams\n} from \"./types\";\nimport { GetCmsModelFieldAst } from \"./modelAst\";\nimport { CmsModelField, CmsModelFieldType, LockedField } from \"./modelField\";\nimport { CmsModel } from \"./model\";\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: CmsModelFieldType;\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: {\n model: CmsModel;\n field: Omit<TField, \"storageId\"> & Partial<Pick<TField, \"storageId\">>;\n }) => 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: { 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: Pick<CmsModel, \"singularApiName\">;\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: Pick<CmsModel, \"singularApiName\">;\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 normalizeInput?: <T>(\n params: CmsModelFieldToGraphQLNormalizeInputParams<TField>\n ) => Promise<T>;\n };\n /**\n *\n * @param field\n */\n validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;\n /**\n * Get field AST.\n */\n getFieldAst?: GetCmsModelFieldAst<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 * Definition for the field validator.\n *\n * @category Plugin\n * @category ModelField\n * @category FieldValidation\n */\nexport interface CmsModelFieldValidatorPluginValidateCb {\n (params: CmsModelFieldValidatorValidateParams): Promise<boolean>;\n}\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: CmsModelFieldValidatorPluginValidateCb;\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"],"mappings":"","ignoreList":[]}
package/types/types.d.ts CHANGED
@@ -147,6 +147,11 @@ export interface CmsModelFieldDefinition {
147
147
  fields: string;
148
148
  typeDefs?: string;
149
149
  }
150
+ export interface CmsModelFieldToGraphQLNormalizeInputParams<TField> {
151
+ model: CmsModel;
152
+ field: TField;
153
+ input: GenericRecord<string> | Array<GenericRecord<string>>;
154
+ }
150
155
  interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
151
156
  models: CmsModel[];
152
157
  model: CmsModel;
@@ -1388,6 +1393,7 @@ export interface CmsEntryValidateResponse {
1388
1393
  */
1389
1394
  interface CmsEntryResolverFactoryParams {
1390
1395
  model: CmsModel;
1396
+ fieldTypePlugins: CmsFieldTypePlugins;
1391
1397
  }
1392
1398
  /**
1393
1399
  * A type for EntryResolvers. Used when creating get, list, update, publish, ...etc.
@@ -1 +1 @@
1
- {"version":3,"names":["CONTENT_ENTRY_STATUS","exports"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Context, GenericRecord } from \"@webiny/api/types\";\nimport { GraphQLFieldResolver, GraphQLRequestBody, Resolvers } from \"@webiny/handler-graphql/types\";\nimport { processRequestBody } from \"@webiny/handler-graphql\";\nimport { SecurityPermission } from \"@webiny/api-security/types\";\nimport { DbContext } from \"@webiny/handler-db/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { CmsModelConverterCallable } from \"~/utils/converters/ConverterCollection\";\nimport { HeadlessCmsExport, HeadlessCmsImport } from \"~/export/types\";\nimport { AccessControl } from \"~/crud/AccessControl/AccessControl\";\nimport { CmsModelToAstConverter } from \"~/utils/contentModelAst/CmsModelToAstConverter\";\nimport { CmsModelFieldToGraphQLPlugin } from \"./plugins\";\nimport { CmsEntryContext } from \"./context\";\nimport { CmsModelField, CmsModelFieldValidation, CmsModelUpdateInput } from \"./modelField\";\nimport { CmsModel, CmsModelCreateFromInput, CmsModelCreateInput } from \"./model\";\nimport { CmsGroup } from \"./modelGroup\";\nimport { CmsIdentity } from \"./identity\";\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport type ApiEndpoint = \"manage\" | \"preview\" | \"read\";\n\nexport interface HeadlessCms\n extends 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 * Use to ensure perform authorization and ensure identities have access to the groups, models and entries.\n */\n accessControl: AccessControl;\n\n /**\n * Export operations.\n */\n export: HeadlessCmsExport;\n importing: HeadlessCmsImport;\n getExecutableSchema: GetExecutableSchema;\n}\n\nexport type GetExecutableSchema = (\n type: ApiEndpoint\n) => Promise<\n <TData = Record<string, any>, TExtensions = Record<string, any>>(\n input: GraphQLRequestBody | GraphQLRequestBody[]\n ) => ReturnType<typeof processRequestBody<TData, TExtensions>>\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 extends Context, DbContext, I18NContext {\n cms: HeadlessCms;\n}\n\n/**\n * Used for our internal functionality.\n */\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | 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 * 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 | {\n resolver: GraphQLFieldResolver | null;\n typeResolvers: Resolvers<CmsContext>;\n }\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 ModelField\n */\nexport interface CmsFieldTypePlugins {\n [key: string]: CmsModelFieldToGraphQLPlugin;\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\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 id?: string;\n name: string;\n slug?: string;\n description?: string | null;\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 `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 };\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>;\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\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 * 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<T = any>(context: CmsContext, model: CmsModel): Promise<CmsModelManager<T>>;\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 /**\n * Revision-level meta fields. 👇\n */\n\n /**\n * An ISO 8601 date/time string.\n */\n revisionCreatedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionSavedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionModifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionDeletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionRestoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionFirstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionLastPublishedOn: string | null;\n\n /**\n * Identity that last ionCreated the entry.\n */\n revisionCreatedBy: CmsIdentity;\n /**\n * Identity that last ionSaved the entry.\n */\n revisionSavedBy: CmsIdentity;\n /**\n * Identity that last ionModified the entry.\n */\n revisionModifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the revision.\n */\n revisionDeletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the revision.\n */\n revisionRestoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n revisionFirstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * An ISO 8601 date/time string.\n */\n createdOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n savedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n modifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n deletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n restoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n firstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n lastPublishedOn: string | null;\n\n /**\n * Identity that last created the entry.\n */\n createdBy: CmsIdentity;\n /**\n * Identity that last saved the entry.\n */\n savedBy: CmsIdentity;\n /**\n * Identity that last modified the entry.\n */\n modifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the entry.\n */\n deletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the entry.\n */\n restoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n firstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * Deprecated fields. 👇\n */\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `createdBy` field instead.\n */\n ownedBy?: CmsIdentity | null;\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `firstPublishedOn` or `lastPublishedOn` field instead.\n */\n publishedOn?: string | null;\n\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 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 * Advanced Content Organization\n */\n location?: {\n folderId?: string | null;\n };\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 * Is the entry in the bin?\n */\n wbyDeleted?: boolean | null;\n /**\n * This field preserves the original folderId value, as the ROOT_FOLDER is set upon deletion.\n * The value is utilized when restoring the entry from the trash bin.\n */\n binOriginalFolderId?: string | null;\n}\n\nexport interface CmsStorageEntry extends CmsEntry {\n [key: string]: any;\n}\n\nexport interface CmsEntryUniqueValue {\n value: string;\n count: number;\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<T = CmsEntryValues> {\n /**\n * List only published entries in the content model.\n */\n listPublished(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List latest entries in the content model. Used for administration.\n */\n listLatest(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Get a list of published entries by the ID list.\n */\n getPublishedByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get a list of the latest entries by the ID list.\n */\n getLatestByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get an entry filtered by given params. Will always get one.\n */\n get(id: string): Promise<CmsEntry<T>>;\n /**\n * Create an entry.\n */\n create<I>(data: CreateCmsEntryInput & I): Promise<CmsEntry<T>>;\n /**\n * Update an entry.\n */\n update(id: string, data: UpdateCmsEntryInput): Promise<CmsEntry<T>>;\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 * @throws NotFoundError\n */\n getModel: (modelId: string) => Promise<CmsModel>;\n /**\n * Get model to AST converter.\n */\n getModelToAstConverter: () => CmsModelToAstConverter;\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 getEntryManager<T = any>(model: CmsModel | string): Promise<CmsModelManager<T>>;\n /**\n * Get all content model managers mapped by modelId.\n * @see CmsModelManager\n */\n getEntryManagers(): Map<string, CmsModelManager>;\n /**\n * Clear all the model caches.\n */\n clearModelsCache(): void;\n /**\n * Lifecycle Events\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 /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedBy?: string;\n revisionCreatedBy_not?: string;\n revisionCreatedBy_in?: string[];\n revisionCreatedBy_not_in?: string[];\n\n revisionModifiedBy?: string;\n revisionModifiedBy_not?: string;\n revisionModifiedBy_in?: string[];\n revisionModifiedBy_not_in?: string[];\n\n revisionSavedBy?: string;\n revisionSavedBy_not?: string;\n revisionSavedBy_in?: string[];\n revisionSavedBy_not_in?: string[];\n\n revisionFirstPublishedBy?: string;\n revisionFirstPublishedBy_not?: string;\n revisionFirstPublishedBy_in?: string[];\n revisionFirstPublishedBy_not_in?: string[];\n\n revisionLastPublishedBy?: string;\n revisionLastPublishedBy_not?: string;\n revisionLastPublishedBy_in?: string[];\n revisionLastPublishedBy_not_in?: string[];\n\n /**\n * Entry-level meta fields. 👇\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n\n modifiedBy?: string;\n modifiedBy_not?: string;\n modifiedBy_in?: string[];\n modifiedBy_not_in?: string[];\n\n savedBy?: string;\n savedBy_not?: string;\n savedBy_in?: string[];\n savedBy_not_in?: string[];\n\n firstPublishedBy?: string;\n firstPublishedBy_not?: string;\n firstPublishedBy_in?: string[];\n firstPublishedBy_not_in?: string[];\n\n lastPublishedBy?: string;\n lastPublishedBy_not?: string;\n lastPublishedBy_in?: string[];\n lastPublishedBy_not_in?: string[];\n\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 * ACO related parameters.\n */\n wbyAco_location?: {\n folderId?: string;\n folderId_not?: string;\n folderId_in?: string[];\n folderId_not_in?: string[];\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n };\n\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 | Date\n | undefined\n | string[]\n | number[]\n | null\n | CmsEntryListWhere[]\n | CmsEntryListWhere\n | CmsEntryListWhereRef;\n\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: UpdateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Move\n */\nexport interface OnEntryBeforeMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryMoveErrorTopicParams {\n error: Error;\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Publish\n */\nexport interface OnEntryBeforePublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterPublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryPublishErrorTopicParams {\n error: Error;\n original: CmsEntry;\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 */\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\n/**\n * Delete\n */\nexport interface OnEntryBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n permanent: boolean;\n model: CmsModel;\n}\n\n/**\n * Restore from bin\n */\nexport interface OnEntryBeforeRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRestoreFromBinErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete Revision\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\n/**\n * Delete multiple\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\n/**\n * Get\n */\nexport interface OnEntryBeforeGetTopicParams {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n\n/**\n * List\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 status?: CmsEntryStatus;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n createdBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n\n [key: string]: any;\n}\n\nexport interface CreateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateFromCmsEntryInput {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date;\n revisionSavedOn?: Date;\n revisionModifiedOn?: Date;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity;\n revisionSavedBy?: CmsIdentity;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date;\n savedOn?: Date;\n modifiedOn?: Date;\n createdBy?: CmsIdentity;\n modifiedBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n [key: string]: any;\n}\n\nexport interface CreateRevisionCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface UpdateCmsEntryInput {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string | null;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string | null;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionFirstPublishedOn?: Date | string | null;\n revisionLastPublishedOn?: Date | string | null;\n revisionModifiedBy?: CmsIdentity | null;\n revisionCreatedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity | null;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedBy?: CmsIdentity | null;\n revisionLastPublishedBy?: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string | null;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string | null;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n firstPublishedOn?: Date | string | null;\n lastPublishedOn?: Date | string | null;\n createdBy?: CmsIdentity | null;\n modifiedBy?: CmsIdentity | null;\n savedBy?: CmsIdentity | null;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedBy?: CmsIdentity | null;\n lastPublishedBy?: CmsIdentity | null;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n\n [key: string]: any;\n}\n\nexport interface UpdateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface GetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\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 * Destroying the entry directly, without moving it to the bin.\n */\n permanently?: boolean;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface DeleteMultipleEntriesParams {\n entries: string[];\n}\n\nexport type DeleteMultipleEntriesResponse = {\n id: string;\n}[];\n\nexport interface CmsEntryValidateResponse {\n [key: string]: any;\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 * A base security permission for CMS.\n *\n * @category SecurityPermission\n */\nexport interface BaseCmsSecurityPermission extends SecurityPermission {\n own?: boolean;\n rwd: string;\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\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\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 CmsEntryStorageOperationsMoveToBinParams<\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 CmsEntryStorageOperationsRestoreFromBinParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as restored.\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 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 CmsEntryStorageOperationsGetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\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 * Move entry and all its entries into a new folder.\n */\n move: (model: CmsModel, id: string, folderId: string) => Promise<void>;\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 * Move the entry to bin.\n */\n moveToBin: (model: CmsModel, params: CmsEntryStorageOperationsMoveToBinParams) => Promise<void>;\n /**\n * Restore the entry from the bin.\n */\n restoreFromBin: (\n model: CmsModel,\n params: CmsEntryStorageOperationsRestoreFromBinParams<T>\n ) => Promise<T>;\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 * Method to list all the unique values for the given field id.\n * Simplest use case would be to aggregate tags for some content.\n * @internal\n */\n getUniqueFieldValues: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetUniqueFieldValuesParams\n ) => Promise<CmsEntryUniqueValue[]>;\n}\n\nexport enum CONTENT_ENTRY_STATUS {\n DRAFT = \"draft\",\n PUBLISHED = \"published\",\n UNPUBLISHED = \"unpublished\"\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 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":";;;;;;AA0FA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AAKA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgCA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAkDA;AACA;AACA;AAiCA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAQA;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;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AA4NA;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;AA6EA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AAqIA;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;AAoBA;AACA;AACA;AAqBA;AACA;AACA;AAkBA;AACA;AACA;AAkBA;AACA;AACA;AAoBA;AACA;AACA;AAkBA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AAmDA;AACA;AACA;AACA;AAqCA;AACA;AACA;AACA;AAiDA;AACA;AACA;AACA;AAMA;AACA;AACA;AAaA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AA6NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IA6IYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["CONTENT_ENTRY_STATUS","exports"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Context, GenericRecord } from \"@webiny/api/types\";\nimport { GraphQLFieldResolver, GraphQLRequestBody, Resolvers } from \"@webiny/handler-graphql/types\";\nimport { processRequestBody } from \"@webiny/handler-graphql\";\nimport { SecurityPermission } from \"@webiny/api-security/types\";\nimport { DbContext } from \"@webiny/handler-db/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { CmsModelConverterCallable } from \"~/utils/converters/ConverterCollection\";\nimport { HeadlessCmsExport, HeadlessCmsImport } from \"~/export/types\";\nimport { AccessControl } from \"~/crud/AccessControl/AccessControl\";\nimport { CmsModelToAstConverter } from \"~/utils/contentModelAst/CmsModelToAstConverter\";\nimport { CmsModelFieldToGraphQLPlugin } from \"./plugins\";\nimport { CmsEntryContext } from \"./context\";\nimport { CmsModelField, CmsModelFieldValidation, CmsModelUpdateInput } from \"./modelField\";\nimport { CmsModel, CmsModelCreateFromInput, CmsModelCreateInput } from \"./model\";\nimport { CmsGroup } from \"./modelGroup\";\nimport { CmsIdentity } from \"./identity\";\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport interface CmsError {\n message: string;\n code: string;\n data: GenericRecord;\n stack?: string;\n}\n\nexport type ApiEndpoint = \"manage\" | \"preview\" | \"read\";\n\nexport interface HeadlessCms\n extends 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 * Use to ensure perform authorization and ensure identities have access to the groups, models and entries.\n */\n accessControl: AccessControl;\n\n /**\n * Export operations.\n */\n export: HeadlessCmsExport;\n importing: HeadlessCmsImport;\n getExecutableSchema: GetExecutableSchema;\n}\n\nexport type GetExecutableSchema = (\n type: ApiEndpoint\n) => Promise<\n <TData = Record<string, any>, TExtensions = Record<string, any>>(\n input: GraphQLRequestBody | GraphQLRequestBody[]\n ) => ReturnType<typeof processRequestBody<TData, TExtensions>>\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 extends Context, DbContext, I18NContext {\n cms: HeadlessCms;\n}\n\n/**\n * Used for our internal functionality.\n */\nexport interface CmsModelFieldWithParent extends CmsModelField {\n parent?: CmsModelFieldWithParent | 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 * 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\nexport interface CmsModelFieldToGraphQLNormalizeInputParams<TField> {\n model: CmsModel;\n field: TField;\n input: GenericRecord<string> | Array<GenericRecord<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 | {\n resolver: GraphQLFieldResolver | null;\n typeResolvers: Resolvers<CmsContext>;\n }\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 ModelField\n */\nexport interface CmsFieldTypePlugins {\n [key: string]: CmsModelFieldToGraphQLPlugin;\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\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 id?: string;\n name: string;\n slug?: string;\n description?: string | null;\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 `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 };\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>;\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\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 * 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<T = any>(context: CmsContext, model: CmsModel): Promise<CmsModelManager<T>>;\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 /**\n * Revision-level meta fields. 👇\n */\n\n /**\n * An ISO 8601 date/time string.\n */\n revisionCreatedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionSavedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n revisionModifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionDeletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionRestoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionFirstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n revisionLastPublishedOn: string | null;\n\n /**\n * Identity that last ionCreated the entry.\n */\n revisionCreatedBy: CmsIdentity;\n /**\n * Identity that last ionSaved the entry.\n */\n revisionSavedBy: CmsIdentity;\n /**\n * Identity that last ionModified the entry.\n */\n revisionModifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the revision.\n */\n revisionDeletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the revision.\n */\n revisionRestoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n revisionFirstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * An ISO 8601 date/time string.\n */\n createdOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n savedOn: string;\n /**\n * An ISO 8601 date/time string.\n */\n modifiedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n deletedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n restoredOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n firstPublishedOn: string | null;\n /**\n * An ISO 8601 date/time string.\n */\n lastPublishedOn: string | null;\n\n /**\n * Identity that last created the entry.\n */\n createdBy: CmsIdentity;\n /**\n * Identity that last saved the entry.\n */\n savedBy: CmsIdentity;\n /**\n * Identity that last modified the entry.\n */\n modifiedBy: CmsIdentity | null;\n /**\n * Identity that last deleted the entry.\n */\n deletedBy: CmsIdentity | null;\n /**\n * Identity that last restored the entry.\n */\n restoredBy: CmsIdentity | null;\n /**\n * Identity that first published the entry.\n */\n firstPublishedBy: CmsIdentity | null;\n /**\n * Identity that last published the entry.\n */\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * Deprecated fields. 👇\n */\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `createdBy` field instead.\n */\n ownedBy?: CmsIdentity | null;\n\n /**\n * @deprecated Will be removed with the 5.41.0 release. Use `firstPublishedOn` or `lastPublishedOn` field instead.\n */\n publishedOn?: string | null;\n\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 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 * Advanced Content Organization\n */\n location?: {\n folderId?: string | null;\n };\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 * Is the entry in the bin?\n */\n wbyDeleted?: boolean | null;\n /**\n * This field preserves the original folderId value, as the ROOT_FOLDER is set upon deletion.\n * The value is utilized when restoring the entry from the trash bin.\n */\n binOriginalFolderId?: string | null;\n}\n\nexport interface CmsStorageEntry extends CmsEntry {\n [key: string]: any;\n}\n\nexport interface CmsEntryUniqueValue {\n value: string;\n count: number;\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<T = CmsEntryValues> {\n /**\n * List only published entries in the content model.\n */\n listPublished(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List latest entries in the content model. Used for administration.\n */\n listLatest(params: CmsEntryListParams): Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Get a list of published entries by the ID list.\n */\n getPublishedByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get a list of the latest entries by the ID list.\n */\n getLatestByIds(ids: string[]): Promise<CmsEntry<T>[]>;\n /**\n * Get an entry filtered by given params. Will always get one.\n */\n get(id: string): Promise<CmsEntry<T>>;\n /**\n * Create an entry.\n */\n create<I>(data: CreateCmsEntryInput & I): Promise<CmsEntry<T>>;\n /**\n * Update an entry.\n */\n update(id: string, data: UpdateCmsEntryInput): Promise<CmsEntry<T>>;\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 * @throws NotFoundError\n */\n getModel: (modelId: string) => Promise<CmsModel>;\n /**\n * Get model to AST converter.\n */\n getModelToAstConverter: () => CmsModelToAstConverter;\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 getEntryManager<T = any>(model: CmsModel | string): Promise<CmsModelManager<T>>;\n /**\n * Get all content model managers mapped by modelId.\n * @see CmsModelManager\n */\n getEntryManagers(): Map<string, CmsModelManager>;\n /**\n * Clear all the model caches.\n */\n clearModelsCache(): void;\n /**\n * Lifecycle Events\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 /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedBy?: string;\n revisionCreatedBy_not?: string;\n revisionCreatedBy_in?: string[];\n revisionCreatedBy_not_in?: string[];\n\n revisionModifiedBy?: string;\n revisionModifiedBy_not?: string;\n revisionModifiedBy_in?: string[];\n revisionModifiedBy_not_in?: string[];\n\n revisionSavedBy?: string;\n revisionSavedBy_not?: string;\n revisionSavedBy_in?: string[];\n revisionSavedBy_not_in?: string[];\n\n revisionFirstPublishedBy?: string;\n revisionFirstPublishedBy_not?: string;\n revisionFirstPublishedBy_in?: string[];\n revisionFirstPublishedBy_not_in?: string[];\n\n revisionLastPublishedBy?: string;\n revisionLastPublishedBy_not?: string;\n revisionLastPublishedBy_in?: string[];\n revisionLastPublishedBy_not_in?: string[];\n\n /**\n * Entry-level meta fields. 👇\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n\n modifiedBy?: string;\n modifiedBy_not?: string;\n modifiedBy_in?: string[];\n modifiedBy_not_in?: string[];\n\n savedBy?: string;\n savedBy_not?: string;\n savedBy_in?: string[];\n savedBy_not_in?: string[];\n\n firstPublishedBy?: string;\n firstPublishedBy_not?: string;\n firstPublishedBy_in?: string[];\n firstPublishedBy_not_in?: string[];\n\n lastPublishedBy?: string;\n lastPublishedBy_not?: string;\n lastPublishedBy_in?: string[];\n lastPublishedBy_not_in?: string[];\n\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 * ACO related parameters.\n */\n wbyAco_location?: {\n folderId?: string;\n folderId_not?: string;\n folderId_in?: string[];\n folderId_not_in?: string[];\n AND?: CmsEntryListWhere[];\n OR?: CmsEntryListWhere[];\n };\n\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 | Date\n | undefined\n | string[]\n | number[]\n | null\n | CmsEntryListWhere[]\n | CmsEntryListWhere\n | CmsEntryListWhereRef;\n\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: UpdateCmsEntryInput;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Move\n */\nexport interface OnEntryBeforeMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterMoveTopicParams {\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryMoveErrorTopicParams {\n error: Error;\n folderId: string;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Publish\n */\nexport interface OnEntryBeforePublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterPublishTopicParams {\n original: CmsEntry;\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryPublishErrorTopicParams {\n error: Error;\n original: CmsEntry;\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 */\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\n/**\n * Delete\n */\nexport interface OnEntryBeforeDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryAfterDeleteTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n permanent: boolean;\n}\n\nexport interface OnEntryDeleteErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n permanent: boolean;\n model: CmsModel;\n}\n\n/**\n * Restore from bin\n */\nexport interface OnEntryBeforeRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n}\n\nexport interface OnEntryAfterRestoreFromBinTopicParams {\n entry: CmsEntry;\n model: CmsModel;\n storageEntry: CmsEntry;\n}\n\nexport interface OnEntryRestoreFromBinErrorTopicParams {\n error: Error;\n entry: CmsEntry;\n model: CmsModel;\n}\n\n/**\n * Delete Revision\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\n/**\n * Delete multiple\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\n/**\n * Get\n */\nexport interface OnEntryBeforeGetTopicParams {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n\n/**\n * List\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 status?: CmsEntryStatus;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n createdBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n\n [key: string]: any;\n}\n\nexport interface CreateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface CreateFromCmsEntryInput {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date;\n revisionSavedOn?: Date;\n revisionModifiedOn?: Date;\n revisionCreatedBy?: CmsIdentity;\n revisionModifiedBy?: CmsIdentity;\n revisionSavedBy?: CmsIdentity;\n revisionFirstPublishedOn?: Date | string;\n revisionLastPublishedOn?: Date | string;\n revisionFirstPublishedBy?: CmsIdentity;\n revisionLastPublishedBy?: CmsIdentity;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date;\n savedOn?: Date;\n modifiedOn?: Date;\n createdBy?: CmsIdentity;\n modifiedBy?: CmsIdentity;\n savedBy?: CmsIdentity;\n firstPublishedOn?: Date | string;\n lastPublishedOn?: Date | string;\n firstPublishedBy?: CmsIdentity;\n lastPublishedBy?: CmsIdentity;\n\n [key: string]: any;\n}\n\nexport interface CreateRevisionCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface UpdateCmsEntryInput {\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn?: Date | string | null;\n revisionModifiedOn?: Date | string | null;\n revisionSavedOn?: Date | string | null;\n revisionDeletedOn?: Date | string | null;\n revisionRestoredOn?: Date | string | null;\n revisionFirstPublishedOn?: Date | string | null;\n revisionLastPublishedOn?: Date | string | null;\n revisionModifiedBy?: CmsIdentity | null;\n revisionCreatedBy?: CmsIdentity | null;\n revisionSavedBy?: CmsIdentity | null;\n revisionDeletedBy?: CmsIdentity | null;\n revisionRestoredBy?: CmsIdentity | null;\n revisionFirstPublishedBy?: CmsIdentity | null;\n revisionLastPublishedBy?: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn?: Date | string | null;\n modifiedOn?: Date | string | null;\n savedOn?: Date | string | null;\n deletedOn?: Date | string | null;\n restoredOn?: Date | string | null;\n firstPublishedOn?: Date | string | null;\n lastPublishedOn?: Date | string | null;\n createdBy?: CmsIdentity | null;\n modifiedBy?: CmsIdentity | null;\n savedBy?: CmsIdentity | null;\n deletedBy?: CmsIdentity | null;\n restoredBy?: CmsIdentity | null;\n firstPublishedBy?: CmsIdentity | null;\n lastPublishedBy?: CmsIdentity | null;\n\n wbyAco_location?: {\n folderId?: string | null;\n };\n\n [key: string]: any;\n}\n\nexport interface UpdateCmsEntryOptionsInput {\n skipValidators?: string[];\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface GetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\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 * Destroying the entry directly, without moving it to the bin.\n */\n permanently?: boolean;\n}\n\n/**\n * @category Context\n * @category CmsEntry\n */\nexport interface DeleteMultipleEntriesParams {\n entries: string[];\n}\n\nexport type DeleteMultipleEntriesResponse = {\n id: string;\n}[];\n\nexport interface CmsEntryValidateResponse {\n [key: string]: any;\n}\n\n/**\n * Parameters for CmsEntryResolverFactory.\n *\n * @category GraphQL resolver\n * @category CmsEntry\n */\ninterface CmsEntryResolverFactoryParams {\n model: CmsModel;\n fieldTypePlugins: CmsFieldTypePlugins;\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 * A base security permission for CMS.\n *\n * @category SecurityPermission\n */\nexport interface BaseCmsSecurityPermission extends SecurityPermission {\n own?: boolean;\n rwd: string;\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\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\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 CmsEntryStorageOperationsMoveToBinParams<\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 CmsEntryStorageOperationsRestoreFromBinParams<\n T extends CmsStorageEntry = CmsStorageEntry\n> {\n /**\n * The modified entry that is going to be saved as restored.\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 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 CmsEntryStorageOperationsGetUniqueFieldValuesParams {\n where: CmsEntryListWhere;\n fieldId: string;\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 * Move entry and all its entries into a new folder.\n */\n move: (model: CmsModel, id: string, folderId: string) => Promise<void>;\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 * Move the entry to bin.\n */\n moveToBin: (model: CmsModel, params: CmsEntryStorageOperationsMoveToBinParams) => Promise<void>;\n /**\n * Restore the entry from the bin.\n */\n restoreFromBin: (\n model: CmsModel,\n params: CmsEntryStorageOperationsRestoreFromBinParams<T>\n ) => Promise<T>;\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 * Method to list all the unique values for the given field id.\n * Simplest use case would be to aggregate tags for some content.\n * @internal\n */\n getUniqueFieldValues: (\n model: CmsModel,\n params: CmsEntryStorageOperationsGetUniqueFieldValuesParams\n ) => Promise<CmsEntryUniqueValue[]>;\n}\n\nexport enum CONTENT_ENTRY_STATUS {\n DRAFT = \"draft\",\n PUBLISHED = \"published\",\n UNPUBLISHED = \"unpublished\"\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 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":";;;;;;AA0FA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AAKA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAgCA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAwDA;AACA;AACA;AAiCA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAQA;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;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AA4NA;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;AA6EA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AAqIA;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;AAoBA;AACA;AACA;AAqBA;AACA;AACA;AAkBA;AACA;AACA;AAkBA;AACA;AACA;AAoBA;AACA;AACA;AAkBA;AACA;AACA;AAiBA;AACA;AACA;AAoBA;AACA;AACA;AAMA;AACA;AACA;AAMA;AACA;AACA;AACA;AAmDA;AACA;AACA;AACA;AAqCA;AACA;AACA;AACA;AAiDA;AACA;AACA;AACA;AAMA;AACA;AACA;AAaA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AA6NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IA6IYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
@@ -2,7 +2,7 @@ import { CmsModelAst, ContentEntryValueVisitor, CmsEntryValues } from "../../typ
2
2
  export declare class ContentEntryTraverser {
3
3
  private readonly modelAst;
4
4
  constructor(modelAst: CmsModelAst);
5
- traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor): void;
5
+ traverse(values: CmsEntryValues, visitor: ContentEntryValueVisitor): Promise<void>;
6
6
  private visitTree;
7
7
  private ensureArray;
8
8
  private findCollectionAndVisit;