@webiny/api-headless-cms 0.0.0-unstable.990c3ab1b6 → 0.0.0-unstable.99666aeb00
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constants.d.ts +1 -0
- package/constants.js +8 -0
- package/constants.js.map +1 -0
- package/context.d.ts +5 -2
- package/context.js +94 -9
- package/context.js.map +1 -1
- package/crud/contentEntry/markLockedFields.d.ts +1 -1
- package/crud/contentEntry/markLockedFields.js +17 -4
- package/crud/contentEntry/markLockedFields.js.map +1 -1
- package/crud/contentEntry/referenceFieldsMapping.js +40 -9
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
- package/crud/contentEntry/searchableFields.d.ts +9 -0
- package/crud/contentEntry/searchableFields.js +72 -0
- package/crud/contentEntry/searchableFields.js.map +1 -0
- package/crud/contentEntry.crud.d.ts +12 -5
- package/crud/contentEntry.crud.js +1195 -855
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/beforeCreate.d.ts +2 -3
- package/crud/contentModel/beforeCreate.js +43 -81
- package/crud/contentModel/beforeCreate.js.map +1 -1
- package/crud/contentModel/beforeDelete.d.ts +1 -1
- package/crud/contentModel/beforeDelete.js +1 -5
- package/crud/contentModel/beforeDelete.js.map +1 -1
- package/crud/contentModel/beforeUpdate.d.ts +2 -4
- package/crud/contentModel/beforeUpdate.js +33 -5
- package/crud/contentModel/beforeUpdate.js.map +1 -1
- package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
- package/crud/contentModel/compatibility/modelApiName.js +24 -0
- package/crud/contentModel/compatibility/modelApiName.js.map +1 -0
- package/crud/contentModel/createFieldStorageId.js +4 -1
- package/crud/contentModel/createFieldStorageId.js.map +1 -1
- package/crud/contentModel/defaultFields.d.ts +5 -0
- package/crud/contentModel/defaultFields.js +58 -0
- package/crud/contentModel/defaultFields.js.map +1 -0
- package/crud/contentModel/fields/descriptionField.d.ts +2 -0
- package/crud/contentModel/fields/descriptionField.js +42 -0
- package/crud/contentModel/fields/descriptionField.js.map +1 -0
- package/crud/contentModel/fields/imageField.d.ts +2 -0
- package/crud/contentModel/fields/imageField.js +46 -0
- package/crud/contentModel/fields/imageField.js.map +1 -0
- package/crud/contentModel/fields/titleField.d.ts +2 -0
- package/crud/contentModel/fields/titleField.js +58 -0
- package/crud/contentModel/fields/titleField.js.map +1 -0
- package/crud/contentModel/validate/endingAllowed.d.ts +6 -0
- package/crud/contentModel/validate/endingAllowed.js +26 -0
- package/crud/contentModel/validate/endingAllowed.js.map +1 -0
- package/crud/contentModel/validate/isModelEndingAllowed.d.ts +6 -0
- package/crud/contentModel/validate/isModelEndingAllowed.js +24 -0
- package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -0
- package/crud/contentModel/validate/modelId.d.ts +11 -0
- package/crud/contentModel/validate/modelId.js +36 -0
- package/crud/contentModel/validate/modelId.js.map +1 -0
- package/crud/contentModel/validate/pluralApiName.d.ts +7 -0
- package/crud/contentModel/validate/pluralApiName.js +24 -0
- package/crud/contentModel/validate/pluralApiName.js.map +1 -0
- package/crud/contentModel/validate/singularApiName.d.ts +7 -0
- package/crud/contentModel/validate/singularApiName.js +24 -0
- package/crud/contentModel/validate/singularApiName.js.map +1 -0
- package/crud/contentModel/validateModel.d.ts +4 -4
- package/crud/contentModel/validateModel.js +6 -3
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.d.ts +4 -4
- package/crud/contentModel/validateModelFields.js +124 -89
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel/validation.d.ts +551 -0
- package/crud/contentModel/validation.js +145 -0
- package/crud/contentModel/validation.js.map +1 -0
- package/crud/contentModel.crud.d.ts +2 -0
- package/crud/contentModel.crud.js +385 -279
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/validation.d.ts +30 -0
- package/crud/contentModelGroup/validation.js +34 -0
- package/crud/contentModelGroup/validation.js.map +1 -0
- package/crud/contentModelGroup.crud.d.ts +2 -0
- package/crud/contentModelGroup.crud.js +218 -180
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/crud/settings.crud.d.ts +3 -1
- package/crud/settings.crud.js +7 -16
- package/crud/settings.crud.js.map +1 -1
- package/crud/system.crud.js +0 -60
- package/crud/system.crud.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +11 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +203 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/index.d.ts +2 -1
- package/fieldConverters/index.js +2 -1
- package/fieldConverters/index.js.map +1 -1
- package/graphql/buildSchemaPlugins.d.ts +8 -3
- package/graphql/buildSchemaPlugins.js +3 -7
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/checkEndpointAccess.d.ts +2 -0
- package/graphql/checkEndpointAccess.js +18 -0
- package/graphql/checkEndpointAccess.js.map +1 -0
- package/graphql/createExecutableSchema.d.ts +6 -0
- package/graphql/createExecutableSchema.js +29 -0
- package/graphql/createExecutableSchema.js.map +1 -0
- package/graphql/createRequestBody.d.ts +2 -0
- package/graphql/createRequestBody.js +14 -0
- package/graphql/createRequestBody.js.map +1 -0
- package/graphql/formatErrorPayload.d.ts +1 -0
- package/graphql/formatErrorPayload.js +25 -0
- package/graphql/formatErrorPayload.js.map +1 -0
- package/graphql/generateSchema.d.ts +8 -0
- package/graphql/generateSchema.js +31 -0
- package/graphql/generateSchema.js.map +1 -0
- package/graphql/getSchema.d.ts +17 -0
- package/graphql/getSchema.js +102 -0
- package/graphql/getSchema.js.map +1 -0
- package/graphql/graphQLHandlerFactory.js +6 -104
- package/graphql/graphQLHandlerFactory.js.map +1 -1
- package/graphql/handleRequest.d.ts +11 -0
- package/graphql/handleRequest.js +81 -0
- package/graphql/handleRequest.js.map +1 -0
- package/graphql/index.d.ts +1 -3
- package/graphql/index.js +2 -39
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseContentSchema.d.ts +6 -2
- package/graphql/schema/baseContentSchema.js +9 -11
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.d.ts +3 -0
- package/graphql/schema/baseSchema.js +84 -0
- package/graphql/schema/baseSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +6 -2
- package/graphql/schema/contentEntries.js +121 -65
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.d.ts +6 -2
- package/graphql/schema/contentModelGroups.js +14 -10
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.d.ts +6 -2
- package/graphql/schema/contentModels.js +60 -8
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.d.ts +2 -2
- package/graphql/schema/createFieldResolvers.js +18 -13
- package/graphql/schema/createFieldResolvers.js.map +1 -1
- package/graphql/schema/createFieldTypePluginRecords.d.ts +3 -0
- package/graphql/schema/createFieldTypePluginRecords.js +13 -0
- package/graphql/schema/createFieldTypePluginRecords.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +1 -1
- package/graphql/schema/createManageResolvers.js +47 -17
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.d.ts +3 -0
- package/graphql/schema/createManageSDL.js +96 -63
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/createPreviewResolvers.js +3 -7
- package/graphql/schema/createPreviewResolvers.js.map +1 -1
- package/graphql/schema/createReadResolvers.js +8 -7
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.d.ts +3 -0
- package/graphql/schema/createReadSDL.js +48 -36
- package/graphql/schema/createReadSDL.js.map +1 -1
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +3 -2
- package/graphql/schema/resolvers/commonFieldResolvers.js +2 -1
- package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.d.ts +2 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js +13 -3
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.d.ts +7 -0
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +20 -0
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.d.ts +4 -0
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +18 -0
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveMove.d.ts +8 -0
- package/graphql/schema/resolvers/manage/resolveMove.js +30 -0
- package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -0
- package/graphql/schema/schemaPlugins.d.ts +8 -3
- package/graphql/schema/schemaPlugins.js +55 -52
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/graphql/system.d.ts +2 -5
- package/graphql/system.js +56 -85
- package/graphql/system.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +2 -0
- package/graphqlFields/dynamicZone/dynamicZoneField.js +243 -0
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -0
- package/graphqlFields/dynamicZone/dynamicZoneStorage.d.ts +3 -0
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js +63 -0
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -0
- package/graphqlFields/dynamicZone/index.d.ts +2 -0
- package/graphqlFields/dynamicZone/index.js +19 -0
- package/graphqlFields/dynamicZone/index.js.map +1 -0
- package/graphqlFields/index.d.ts +1 -1
- package/graphqlFields/index.js +2 -1
- package/graphqlFields/index.js.map +1 -1
- package/graphqlFields/number.js +5 -0
- package/graphqlFields/number.js.map +1 -1
- package/graphqlFields/object.js +131 -68
- package/graphqlFields/object.js.map +1 -1
- package/graphqlFields/ref.js +70 -56
- package/graphqlFields/ref.js.map +1 -1
- package/graphqlFields/text.js +2 -0
- package/graphqlFields/text.js.map +1 -1
- package/index.d.ts +5 -3
- package/index.js +27 -8
- package/index.js.map +1 -1
- package/package.json +36 -41
- package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
- package/plugins/CmsGraphQLSchemaPlugin.js +12 -0
- package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +20 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js +28 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -0
- package/plugins/CmsModelFieldConverterPlugin.d.ts +2 -2
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
- package/plugins/CmsModelPlugin.d.ts +21 -3
- package/plugins/CmsModelPlugin.js +28 -2
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/plugins/StorageOperationsCmsModelPlugin.d.ts +23 -0
- package/plugins/StorageOperationsCmsModelPlugin.js +42 -0
- package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -0
- package/plugins/StorageTransformPlugin.d.ts +11 -11
- package/plugins/StorageTransformPlugin.js.map +1 -1
- package/plugins/index.d.ts +3 -0
- package/plugins/index.js +33 -0
- package/plugins/index.js.map +1 -1
- package/storage/object.js +4 -2
- package/storage/object.js.map +1 -1
- package/types.d.ts +455 -135
- package/types.js +74 -8
- package/types.js.map +1 -1
- package/utils/converters/ConverterCollection.js +5 -2
- package/utils/converters/ConverterCollection.js.map +1 -1
- package/utils/converters/valueKeyStorageConverter.d.ts +1 -5
- package/utils/converters/valueKeyStorageConverter.js +26 -20
- package/utils/converters/valueKeyStorageConverter.js.map +1 -1
- package/utils/createTypeFromFields.d.ts +16 -0
- package/utils/createTypeFromFields.js +66 -0
- package/utils/createTypeFromFields.js.map +1 -0
- package/utils/createTypeName.d.ts +0 -2
- package/utils/createTypeName.js +4 -11
- package/utils/createTypeName.js.map +1 -1
- package/utils/entryStorage.js +14 -11
- package/utils/entryStorage.js.map +1 -1
- package/utils/getBaseFieldType.d.ts +2 -0
- package/utils/getBaseFieldType.js +10 -0
- package/utils/getBaseFieldType.js.map +1 -0
- package/utils/getEntryDescription.d.ts +2 -0
- package/utils/getEntryDescription.js +17 -0
- package/utils/getEntryDescription.js.map +1 -0
- package/utils/getEntryImage.d.ts +2 -0
- package/utils/getEntryImage.js +17 -0
- package/utils/getEntryImage.js.map +1 -0
- package/utils/getEntryTitle.d.ts +1 -1
- package/utils/getEntryTitle.js.map +1 -1
- package/utils/getSchemaFromFieldPlugins.d.ts +4 -7
- package/utils/getSchemaFromFieldPlugins.js +22 -14
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/incrementEntryIdVersion.d.ts +5 -0
- package/utils/incrementEntryIdVersion.js +29 -0
- package/utils/incrementEntryIdVersion.js.map +1 -0
- package/utils/permissions/EntriesPermissions.d.ts +4 -0
- package/utils/permissions/EntriesPermissions.js +9 -0
- package/utils/permissions/EntriesPermissions.js.map +1 -0
- package/utils/permissions/ModelGroupsPermissions.d.ts +11 -0
- package/utils/permissions/ModelGroupsPermissions.js +48 -0
- package/utils/permissions/ModelGroupsPermissions.js.map +1 -0
- package/utils/permissions/ModelsPermissions.d.ts +20 -0
- package/utils/permissions/ModelsPermissions.js +91 -0
- package/utils/permissions/ModelsPermissions.js.map +1 -0
- package/utils/permissions/SettingsPermissions.d.ts +4 -0
- package/utils/permissions/SettingsPermissions.js +9 -0
- package/utils/permissions/SettingsPermissions.js.map +1 -0
- package/utils/renderFields.d.ts +4 -2
- package/utils/renderFields.js +12 -3
- package/utils/renderFields.js.map +1 -1
- package/utils/renderGetFilterFields.d.ts +2 -2
- package/utils/renderGetFilterFields.js +9 -19
- package/utils/renderGetFilterFields.js.map +1 -1
- package/utils/renderInputFields.d.ts +4 -2
- package/utils/renderInputFields.js +19 -6
- package/utils/renderInputFields.js.map +1 -1
- package/utils/renderListFilterFields.d.ts +3 -1
- package/utils/renderListFilterFields.js +19 -22
- package/utils/renderListFilterFields.js.map +1 -1
- package/utils/renderSortEnum.d.ts +9 -5
- package/utils/renderSortEnum.js +26 -5
- package/utils/renderSortEnum.js.map +1 -1
- package/validators/dynamicZone.d.ts +2 -0
- package/validators/dynamicZone.js +20 -0
- package/validators/dynamicZone.js.map +1 -0
- package/validators/index.js +2 -1
- package/validators/index.js.map +1 -1
- package/crud/contentModel/createFieldModels.d.ts +0 -2
- package/crud/contentModel/createFieldModels.js +0 -20
- package/crud/contentModel/createFieldModels.js.map +0 -1
- package/crud/contentModel/fieldIdValidation.d.ts +0 -1
- package/crud/contentModel/fieldIdValidation.js +0 -20
- package/crud/contentModel/fieldIdValidation.js.map +0 -1
- package/crud/contentModel/idValidation.d.ts +0 -1
- package/crud/contentModel/idValidation.js +0 -17
- package/crud/contentModel/idValidation.js.map +0 -1
- package/crud/contentModel/models.d.ts +0 -4
- package/crud/contentModel/models.js +0 -173
- package/crud/contentModel/models.js.map +0 -1
- package/crud/contentModel/systemFields.d.ts +0 -1
- package/crud/contentModel/systemFields.js +0 -8
- package/crud/contentModel/systemFields.js.map +0 -1
- package/crud/index.d.ts +0 -6
- package/crud/index.js +0 -69
- package/crud/index.js.map +0 -1
- package/graphql/schema/resolvers/manage/resolveRequestChanges.d.ts +0 -7
- package/graphql/schema/resolvers/manage/resolveRequestChanges.js +0 -21
- package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
- package/graphql/schema/resolvers/manage/resolveRequestReview.d.ts +0 -7
- package/graphql/schema/resolvers/manage/resolveRequestReview.js +0 -21
- package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
- package/upgrades/5.33.0/index.d.ts +0 -3
- package/upgrades/5.33.0/index.js +0 -159
- package/upgrades/5.33.0/index.js.map +0 -1
- package/upgrades/index.d.ts +0 -1
- package/upgrades/index.js +0 -9
- package/upgrades/index.js.map +0 -1
- package/utils/access.d.ts +0 -8
- package/utils/access.js +0 -76
- package/utils/access.js.map +0 -1
- package/utils/filterModelFields.d.ts +0 -16
- package/utils/filterModelFields.js +0 -71
- package/utils/filterModelFields.js.map +0 -1
- package/utils/ownership.d.ts +0 -8
- package/utils/ownership.js +0 -33
- package/utils/ownership.js.map +0 -1
- package/utils/permissions.d.ts +0 -7
- package/utils/permissions.js +0 -91
- package/utils/permissions.js.map +0 -1
- package/utils/pluralizedTypeName.d.ts +0 -1
- package/utils/pluralizedTypeName.js +0 -20
- package/utils/pluralizedTypeName.js.map +0 -1
package/types.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ import { Context } from "@webiny/api/types";
|
|
|
4
4
|
import { GraphQLFieldResolver, GraphQLSchemaDefinition, Resolvers } from "@webiny/handler-graphql/types";
|
|
5
5
|
import { SecurityPermission } from "@webiny/api-security/types";
|
|
6
6
|
import { DbContext } from "@webiny/handler-db/types";
|
|
7
|
-
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
8
|
-
import { UpgradePlugin } from "@webiny/api-upgrade/types";
|
|
9
7
|
import { Topic } from "@webiny/pubsub/types";
|
|
10
8
|
import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
|
|
11
9
|
export declare type ApiEndpoint = "manage" | "preview" | "read";
|
|
@@ -44,7 +42,7 @@ export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGr
|
|
|
44
42
|
*
|
|
45
43
|
* @category Context
|
|
46
44
|
*/
|
|
47
|
-
export interface CmsContext extends Context, DbContext, I18NContext
|
|
45
|
+
export interface CmsContext extends Context, DbContext, I18NContext {
|
|
48
46
|
cms: HeadlessCms;
|
|
49
47
|
}
|
|
50
48
|
interface CmsModelFieldPredefinedValuesValue {
|
|
@@ -98,6 +96,10 @@ export interface CmsModelFieldSettings {
|
|
|
98
96
|
* Object field has child fields.
|
|
99
97
|
*/
|
|
100
98
|
fields?: CmsModelField[];
|
|
99
|
+
/**
|
|
100
|
+
* Is the file field images only one?
|
|
101
|
+
*/
|
|
102
|
+
imagesOnly?: boolean;
|
|
101
103
|
/**
|
|
102
104
|
* Object field has child fields - so it needs to have a layout.
|
|
103
105
|
*/
|
|
@@ -115,6 +117,7 @@ export interface CmsModelFieldSettings {
|
|
|
115
117
|
*/
|
|
116
118
|
[key: string]: any;
|
|
117
119
|
}
|
|
120
|
+
export declare type CmsModelFieldType = "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
|
|
118
121
|
/**
|
|
119
122
|
* A definition for content model field. This type exists on the app side as well.
|
|
120
123
|
*
|
|
@@ -135,18 +138,16 @@ export interface CmsModelField {
|
|
|
135
138
|
* A type of the field.
|
|
136
139
|
* We are defining our built-in fields, so people know which are available by the default.
|
|
137
140
|
*/
|
|
138
|
-
type:
|
|
141
|
+
type: CmsModelFieldType;
|
|
139
142
|
/**
|
|
140
143
|
* A unique storage ID for storing actual values.
|
|
141
|
-
* Must in form of a-zA-Z0-9@a-zA-Z0-9
|
|
144
|
+
* Must in form of a-zA-Z0-9@a-zA-Z0-9
|
|
142
145
|
*
|
|
143
146
|
* This is an auto-generated value: uses `id` and `type`
|
|
144
147
|
*
|
|
145
148
|
* This is used as path for the entry value.
|
|
146
|
-
*
|
|
147
|
-
* @internal
|
|
148
149
|
*/
|
|
149
|
-
storageId: string;
|
|
150
|
+
storageId: `${string}@${string}` | string;
|
|
150
151
|
/**
|
|
151
152
|
* Field identifier for the model field that will be available to the outside world.
|
|
152
153
|
* `storageId` is used as path (or column) to store the data.
|
|
@@ -195,6 +196,10 @@ export interface CmsModelField {
|
|
|
195
196
|
*
|
|
196
197
|
*/
|
|
197
198
|
multipleValues?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Fields can be tagged to give them contextual meaning.
|
|
201
|
+
*/
|
|
202
|
+
tags?: string[];
|
|
198
203
|
/**
|
|
199
204
|
* Any user defined settings.
|
|
200
205
|
*
|
|
@@ -202,18 +207,42 @@ export interface CmsModelField {
|
|
|
202
207
|
*/
|
|
203
208
|
settings?: CmsModelFieldSettings;
|
|
204
209
|
}
|
|
210
|
+
export interface CmsDynamicZoneTemplate {
|
|
211
|
+
id: string;
|
|
212
|
+
name: string;
|
|
213
|
+
gqlTypeName: string;
|
|
214
|
+
description: string;
|
|
215
|
+
icon: string;
|
|
216
|
+
fields: CmsModelField[];
|
|
217
|
+
layout: string[][];
|
|
218
|
+
validation: CmsModelFieldValidation[];
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* A definition for dynamic-zone field to show possible type of the field in settings.
|
|
222
|
+
*/
|
|
223
|
+
export interface CmsModelDynamicZoneField extends CmsModelField {
|
|
224
|
+
/**
|
|
225
|
+
* Settings object for the field. Contains `templates` property.
|
|
226
|
+
*/
|
|
227
|
+
settings: {
|
|
228
|
+
templates: CmsDynamicZoneTemplate[];
|
|
229
|
+
};
|
|
230
|
+
}
|
|
205
231
|
/**
|
|
206
232
|
* Used for our internal functionality.
|
|
207
233
|
*/
|
|
208
234
|
export interface CmsModelFieldWithParent extends CmsModelField {
|
|
209
235
|
parent?: CmsModelFieldWithParent | null;
|
|
210
236
|
}
|
|
237
|
+
export interface CmsModelDynamicZoneFieldWithParent extends CmsModelDynamicZoneField {
|
|
238
|
+
parent?: CmsModelDynamicZoneFieldWithParent | null;
|
|
239
|
+
}
|
|
211
240
|
/**
|
|
212
241
|
* A definition for dateTime field to show possible type of the field in settings.
|
|
213
242
|
*/
|
|
214
243
|
export interface CmsModelDateTimeField extends CmsModelField {
|
|
215
244
|
/**
|
|
216
|
-
* Settings object for the field. Contains type property.
|
|
245
|
+
* Settings object for the field. Contains `type` property.
|
|
217
246
|
*/
|
|
218
247
|
settings: {
|
|
219
248
|
type: "time" | "date" | "dateTimeWithoutTimezone" | "dateTimeWithTimezone";
|
|
@@ -335,7 +364,21 @@ export interface LockedField {
|
|
|
335
364
|
[key: string]: any;
|
|
336
365
|
}
|
|
337
366
|
/**
|
|
338
|
-
*
|
|
367
|
+
* @category Database model
|
|
368
|
+
* @category CmsModel
|
|
369
|
+
*/
|
|
370
|
+
export interface CmsModelGroup {
|
|
371
|
+
/**
|
|
372
|
+
* Generated ID of the group
|
|
373
|
+
*/
|
|
374
|
+
id: string;
|
|
375
|
+
/**
|
|
376
|
+
* Name of the group
|
|
377
|
+
*/
|
|
378
|
+
name: string;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Base CMS Model. Should not be exported and used outside of this package.
|
|
339
382
|
*
|
|
340
383
|
* @category Database model
|
|
341
384
|
* @category CmsModel
|
|
@@ -349,6 +392,24 @@ export interface CmsModel {
|
|
|
349
392
|
* Unique ID for the content model. Created from name if not defined by user.
|
|
350
393
|
*/
|
|
351
394
|
modelId: string;
|
|
395
|
+
/**
|
|
396
|
+
* Name of the content model in singular form to be used in the API.
|
|
397
|
+
* example:
|
|
398
|
+
* - Article
|
|
399
|
+
* - Fruit
|
|
400
|
+
* - Vegetable
|
|
401
|
+
* - Car
|
|
402
|
+
*/
|
|
403
|
+
singularApiName: string;
|
|
404
|
+
/**
|
|
405
|
+
* Name of the content model in plural form to be used in the API.
|
|
406
|
+
* example:
|
|
407
|
+
* - Articles
|
|
408
|
+
* - Fruits
|
|
409
|
+
* - Vegetables
|
|
410
|
+
* - Cars
|
|
411
|
+
*/
|
|
412
|
+
pluralApiName: string;
|
|
352
413
|
/**
|
|
353
414
|
* Model tenant.
|
|
354
415
|
*/
|
|
@@ -360,20 +421,15 @@ export interface CmsModel {
|
|
|
360
421
|
/**
|
|
361
422
|
* Cms Group reference object.
|
|
362
423
|
*/
|
|
363
|
-
group:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Name of the group
|
|
370
|
-
*/
|
|
371
|
-
name: string;
|
|
372
|
-
};
|
|
424
|
+
group: CmsModelGroup;
|
|
425
|
+
/**
|
|
426
|
+
* Icon for the content model.
|
|
427
|
+
*/
|
|
428
|
+
icon?: string | null;
|
|
373
429
|
/**
|
|
374
430
|
* Description for the content model.
|
|
375
431
|
*/
|
|
376
|
-
description: string;
|
|
432
|
+
description: string | null;
|
|
377
433
|
/**
|
|
378
434
|
* Date created
|
|
379
435
|
*/
|
|
@@ -385,7 +441,7 @@ export interface CmsModel {
|
|
|
385
441
|
/**
|
|
386
442
|
* CreatedBy object wrapper. Contains id, name and type of the user.
|
|
387
443
|
*/
|
|
388
|
-
createdBy?:
|
|
444
|
+
createdBy?: CmsIdentity;
|
|
389
445
|
/**
|
|
390
446
|
* List of fields defining entry values.
|
|
391
447
|
*/
|
|
@@ -401,6 +457,10 @@ export interface CmsModel {
|
|
|
401
457
|
* ```
|
|
402
458
|
*/
|
|
403
459
|
layout: string[][];
|
|
460
|
+
/**
|
|
461
|
+
* Models can be tagged to give them contextual meaning.
|
|
462
|
+
*/
|
|
463
|
+
tags?: string[];
|
|
404
464
|
/**
|
|
405
465
|
* List of locked fields. Updated when entry is saved and a field has been used.
|
|
406
466
|
*/
|
|
@@ -410,6 +470,16 @@ export interface CmsModel {
|
|
|
410
470
|
* It is picked as first available text field. Or user can select own field.
|
|
411
471
|
*/
|
|
412
472
|
titleFieldId: string;
|
|
473
|
+
/**
|
|
474
|
+
* The field which is displayed as the description one.
|
|
475
|
+
* Only way this is null or undefined is that there are no long-text fields to be set as description.
|
|
476
|
+
*/
|
|
477
|
+
descriptionFieldId?: string | null;
|
|
478
|
+
/**
|
|
479
|
+
* The field which is displayed as the image.
|
|
480
|
+
* Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.
|
|
481
|
+
*/
|
|
482
|
+
imageFieldId?: string | null;
|
|
413
483
|
/**
|
|
414
484
|
* The version of Webiny which this record was stored with.
|
|
415
485
|
*/
|
|
@@ -437,25 +507,41 @@ export interface CmsModelFieldDefinition {
|
|
|
437
507
|
fields: string;
|
|
438
508
|
typeDefs?: string;
|
|
439
509
|
}
|
|
440
|
-
interface CmsModelFieldToGraphQLCreateResolverParams {
|
|
510
|
+
interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
|
|
441
511
|
models: CmsModel[];
|
|
442
512
|
model: CmsModel;
|
|
443
513
|
graphQLType: string;
|
|
444
|
-
field:
|
|
514
|
+
field: TField;
|
|
445
515
|
createFieldResolvers: any;
|
|
516
|
+
fieldTypePlugins: CmsFieldTypePlugins;
|
|
446
517
|
}
|
|
447
|
-
export interface CmsModelFieldToGraphQLCreateResolver {
|
|
448
|
-
(params: CmsModelFieldToGraphQLCreateResolverParams): GraphQLFieldResolver | {
|
|
518
|
+
export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
|
|
519
|
+
(params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
|
|
449
520
|
resolver: GraphQLFieldResolver | null;
|
|
450
521
|
typeResolvers: Resolvers<CmsContext>;
|
|
451
522
|
} | false;
|
|
452
523
|
}
|
|
524
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams<TField extends CmsModelField = CmsModelField> {
|
|
525
|
+
fields: TField[];
|
|
526
|
+
originalFields: TField[];
|
|
527
|
+
}
|
|
528
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsValidate {
|
|
529
|
+
(params: CmsModelFieldToGraphQLPluginValidateChildFieldsValidateParams): void;
|
|
530
|
+
}
|
|
531
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField extends CmsModelField = CmsModelField> {
|
|
532
|
+
field: TField;
|
|
533
|
+
originalField?: TField;
|
|
534
|
+
validate: CmsModelFieldToGraphQLPluginValidateChildFieldsValidate;
|
|
535
|
+
}
|
|
536
|
+
export interface CmsModelFieldToGraphQLPluginValidateChildFields<TField extends CmsModelField = CmsModelField> {
|
|
537
|
+
(params: CmsModelFieldToGraphQLPluginValidateChildFieldsParams<TField>): void;
|
|
538
|
+
}
|
|
453
539
|
/**
|
|
454
540
|
* @category Plugin
|
|
455
541
|
* @category ModelField
|
|
456
542
|
* @category GraphQL
|
|
457
543
|
*/
|
|
458
|
-
export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
544
|
+
export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = CmsModelField> extends Plugin {
|
|
459
545
|
/**
|
|
460
546
|
* A plugin type
|
|
461
547
|
*/
|
|
@@ -509,7 +595,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
509
595
|
*/
|
|
510
596
|
createStorageId?: (params: {
|
|
511
597
|
model: CmsModel;
|
|
512
|
-
field:
|
|
598
|
+
field: Omit<TField, "storageId"> & Partial<Pick<TField, "storageId">>;
|
|
513
599
|
}) => string | null | undefined;
|
|
514
600
|
/**
|
|
515
601
|
* Read API methods.
|
|
@@ -527,8 +613,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
527
613
|
* ```
|
|
528
614
|
*/
|
|
529
615
|
createGetFilters?(params: {
|
|
530
|
-
|
|
531
|
-
field: CmsModelField;
|
|
616
|
+
field: TField;
|
|
532
617
|
}): string;
|
|
533
618
|
/**
|
|
534
619
|
* Definition for list filtering for GraphQL.
|
|
@@ -547,8 +632,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
547
632
|
* ```
|
|
548
633
|
*/
|
|
549
634
|
createListFilters?(params: {
|
|
550
|
-
model: CmsModel
|
|
551
|
-
field:
|
|
635
|
+
model: Pick<CmsModel, "singularApiName">;
|
|
636
|
+
field: TField;
|
|
637
|
+
plugins: CmsFieldTypePlugins;
|
|
552
638
|
}): string;
|
|
553
639
|
/**
|
|
554
640
|
* Definition of the field type for GraphQL - be aware if multiple values is selected.
|
|
@@ -566,13 +652,14 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
566
652
|
* ```
|
|
567
653
|
*/
|
|
568
654
|
createTypeField(params: {
|
|
655
|
+
models: CmsModel[];
|
|
569
656
|
model: CmsModel;
|
|
570
|
-
field:
|
|
657
|
+
field: TField;
|
|
571
658
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
572
659
|
}): CmsModelFieldDefinition | string | null;
|
|
573
660
|
/**
|
|
574
661
|
* Definition for field resolver.
|
|
575
|
-
* By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
662
|
+
* By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
576
663
|
*
|
|
577
664
|
* ```ts
|
|
578
665
|
* read: {
|
|
@@ -584,7 +671,7 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
584
671
|
* }
|
|
585
672
|
* ```
|
|
586
673
|
*/
|
|
587
|
-
createResolver?: CmsModelFieldToGraphQLCreateResolver
|
|
674
|
+
createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
|
|
588
675
|
/**
|
|
589
676
|
* Read API schema definitions for the field and resolvers for them.
|
|
590
677
|
*
|
|
@@ -626,8 +713,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
626
713
|
* ```
|
|
627
714
|
*/
|
|
628
715
|
createListFilters?: (params: {
|
|
629
|
-
model: CmsModel
|
|
630
|
-
field:
|
|
716
|
+
model: Pick<CmsModel, "singularApiName">;
|
|
717
|
+
field: TField;
|
|
718
|
+
plugins: CmsFieldTypePlugins;
|
|
631
719
|
}) => string;
|
|
632
720
|
/**
|
|
633
721
|
* Manage API schema definitions for the field and resolvers for them. Probably similar to `read.createSchema`.
|
|
@@ -665,8 +753,9 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
665
753
|
* ```
|
|
666
754
|
*/
|
|
667
755
|
createTypeField: (params: {
|
|
756
|
+
models: CmsModel[];
|
|
668
757
|
model: CmsModel;
|
|
669
|
-
field:
|
|
758
|
+
field: TField;
|
|
670
759
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
671
760
|
}) => CmsModelFieldDefinition | string | null;
|
|
672
761
|
/**
|
|
@@ -685,13 +774,14 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
685
774
|
* ```
|
|
686
775
|
*/
|
|
687
776
|
createInputField: (params: {
|
|
777
|
+
models: CmsModel[];
|
|
688
778
|
model: CmsModel;
|
|
689
|
-
field:
|
|
779
|
+
field: TField;
|
|
690
780
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
691
781
|
}) => CmsModelFieldDefinition | string | null;
|
|
692
782
|
/**
|
|
693
783
|
* Definition for field resolver.
|
|
694
|
-
* By default it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
784
|
+
* By default, it is simple return of the `instance.values[storageId]` but if required, users can define their own.
|
|
695
785
|
*
|
|
696
786
|
* ```ts
|
|
697
787
|
* manage: {
|
|
@@ -703,8 +793,13 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
703
793
|
* }
|
|
704
794
|
* ```
|
|
705
795
|
*/
|
|
706
|
-
createResolver?: CmsModelFieldToGraphQLCreateResolver
|
|
796
|
+
createResolver?: CmsModelFieldToGraphQLCreateResolver<TField>;
|
|
707
797
|
};
|
|
798
|
+
/**
|
|
799
|
+
*
|
|
800
|
+
* @param field
|
|
801
|
+
*/
|
|
802
|
+
validateChildFields?: CmsModelFieldToGraphQLPluginValidateChildFields<TField>;
|
|
708
803
|
}
|
|
709
804
|
/**
|
|
710
805
|
* Check for content model locked field.
|
|
@@ -743,11 +838,11 @@ export interface CmsFieldTypePlugins {
|
|
|
743
838
|
[key: string]: CmsModelFieldToGraphQLPlugin;
|
|
744
839
|
}
|
|
745
840
|
/**
|
|
746
|
-
*
|
|
841
|
+
* An interface describing the reference to a user that created some data in the database.
|
|
747
842
|
*
|
|
748
843
|
* @category General
|
|
749
844
|
*/
|
|
750
|
-
export interface
|
|
845
|
+
export interface CmsIdentity {
|
|
751
846
|
/**
|
|
752
847
|
* ID if the user.
|
|
753
848
|
*/
|
|
@@ -797,7 +892,7 @@ export interface CmsSettingsContext {
|
|
|
797
892
|
/**
|
|
798
893
|
* Get the datetime when content model last changed.
|
|
799
894
|
*/
|
|
800
|
-
getModelLastChange: () => Promise<Date>;
|
|
895
|
+
getModelLastChange: () => Promise<Date | null>;
|
|
801
896
|
}
|
|
802
897
|
export interface OnSystemBeforeInstallTopicParams {
|
|
803
898
|
tenant: string;
|
|
@@ -815,9 +910,7 @@ export interface OnSystemInstallErrorTopicParams {
|
|
|
815
910
|
export declare type CmsSystemContext = {
|
|
816
911
|
getSystemVersion: () => Promise<string | null>;
|
|
817
912
|
setSystemVersion: (version: string) => Promise<void>;
|
|
818
|
-
getReadAPIKey(): Promise<string | null>;
|
|
819
913
|
installSystem: () => Promise<void>;
|
|
820
|
-
upgradeSystem: (version: string) => Promise<boolean>;
|
|
821
914
|
/**
|
|
822
915
|
* Lifecycle events - deprecated
|
|
823
916
|
*/
|
|
@@ -837,7 +930,7 @@ export declare type CmsSystemContext = {
|
|
|
837
930
|
onSystemInstallError: Topic<OnSystemInstallErrorTopicParams>;
|
|
838
931
|
};
|
|
839
932
|
/**
|
|
840
|
-
* A GraphQL params.data parameter received when creating content model group.
|
|
933
|
+
* A GraphQL `params.data` parameter received when creating content model group.
|
|
841
934
|
*
|
|
842
935
|
* @category CmsGroup
|
|
843
936
|
* @category GraphQL params
|
|
@@ -849,7 +942,7 @@ export interface CmsGroupCreateInput {
|
|
|
849
942
|
icon: string;
|
|
850
943
|
}
|
|
851
944
|
/**
|
|
852
|
-
* A GraphQL params.data parameter received when updating content model group.
|
|
945
|
+
* A GraphQL `params.data` parameter received when updating content model group.
|
|
853
946
|
*
|
|
854
947
|
* @category CmsGroup
|
|
855
948
|
* @category GraphQL params
|
|
@@ -898,7 +991,7 @@ export interface CmsGroup {
|
|
|
898
991
|
/**
|
|
899
992
|
* CreatedBy reference object.
|
|
900
993
|
*/
|
|
901
|
-
createdBy?:
|
|
994
|
+
createdBy?: CmsIdentity;
|
|
902
995
|
/**
|
|
903
996
|
* Date group was created on.
|
|
904
997
|
*/
|
|
@@ -919,7 +1012,7 @@ export interface CmsGroup {
|
|
|
919
1012
|
isPrivate?: boolean;
|
|
920
1013
|
}
|
|
921
1014
|
/**
|
|
922
|
-
* A data.where parameter received when listing content model groups.
|
|
1015
|
+
* A `data.where` parameter received when listing content model groups.
|
|
923
1016
|
*
|
|
924
1017
|
* @category CmsGroup
|
|
925
1018
|
* @category GraphQL params
|
|
@@ -945,6 +1038,15 @@ export interface OnGroupBeforeCreateTopicParams {
|
|
|
945
1038
|
export interface OnGroupAfterCreateTopicParams {
|
|
946
1039
|
group: CmsGroup;
|
|
947
1040
|
}
|
|
1041
|
+
/**
|
|
1042
|
+
* @category CmsGroup
|
|
1043
|
+
* @category Topic
|
|
1044
|
+
*/
|
|
1045
|
+
export interface OnGroupCreateErrorTopicParams {
|
|
1046
|
+
input: CmsGroupCreateInput;
|
|
1047
|
+
group: CmsGroup;
|
|
1048
|
+
error: Error;
|
|
1049
|
+
}
|
|
948
1050
|
/**
|
|
949
1051
|
* @category CmsGroup
|
|
950
1052
|
* @category Topic
|
|
@@ -961,6 +1063,16 @@ export interface OnGroupAfterUpdateTopicParams {
|
|
|
961
1063
|
original: CmsGroup;
|
|
962
1064
|
group: CmsGroup;
|
|
963
1065
|
}
|
|
1066
|
+
/**
|
|
1067
|
+
* @category CmsGroup
|
|
1068
|
+
* @category Topic
|
|
1069
|
+
*/
|
|
1070
|
+
export interface OnGroupUpdateErrorTopicParams {
|
|
1071
|
+
input: CmsGroupUpdateInput;
|
|
1072
|
+
original: CmsGroup;
|
|
1073
|
+
group: CmsGroup;
|
|
1074
|
+
error: Error;
|
|
1075
|
+
}
|
|
964
1076
|
/**
|
|
965
1077
|
* @category CmsGroup
|
|
966
1078
|
* @category Topic
|
|
@@ -975,6 +1087,14 @@ export interface OnGroupBeforeDeleteTopicParams {
|
|
|
975
1087
|
export interface OnGroupAfterDeleteTopicParams {
|
|
976
1088
|
group: CmsGroup;
|
|
977
1089
|
}
|
|
1090
|
+
/**
|
|
1091
|
+
* @category CmsGroup
|
|
1092
|
+
* @category Topic
|
|
1093
|
+
*/
|
|
1094
|
+
export interface OnGroupDeleteErrorTopicParams {
|
|
1095
|
+
group: CmsGroup;
|
|
1096
|
+
error: Error;
|
|
1097
|
+
}
|
|
978
1098
|
/**
|
|
979
1099
|
* Cms Group in context.
|
|
980
1100
|
*
|
|
@@ -1038,10 +1158,13 @@ export interface CmsGroupContext {
|
|
|
1038
1158
|
*/
|
|
1039
1159
|
onGroupBeforeCreate: Topic<OnGroupBeforeCreateTopicParams>;
|
|
1040
1160
|
onGroupAfterCreate: Topic<OnGroupAfterCreateTopicParams>;
|
|
1161
|
+
onGroupCreateError: Topic<OnGroupCreateErrorTopicParams>;
|
|
1041
1162
|
onGroupBeforeUpdate: Topic<OnGroupBeforeUpdateTopicParams>;
|
|
1042
1163
|
onGroupAfterUpdate: Topic<OnGroupAfterUpdateTopicParams>;
|
|
1164
|
+
onGroupUpdateError: Topic<OnGroupUpdateErrorTopicParams>;
|
|
1043
1165
|
onGroupBeforeDelete: Topic<OnGroupBeforeDeleteTopicParams>;
|
|
1044
1166
|
onGroupAfterDelete: Topic<OnGroupAfterDeleteTopicParams>;
|
|
1167
|
+
onGroupDeleteError: Topic<OnGroupDeleteErrorTopicParams>;
|
|
1045
1168
|
}
|
|
1046
1169
|
/**
|
|
1047
1170
|
* Definition for content model field validator.
|
|
@@ -1060,7 +1183,7 @@ export interface CmsModelFieldValidation {
|
|
|
1060
1183
|
};
|
|
1061
1184
|
}
|
|
1062
1185
|
/**
|
|
1063
|
-
* A GraphQL params.data parameter received when creating content model.
|
|
1186
|
+
* A GraphQL `params.data` parameter received when creating content model.
|
|
1064
1187
|
*
|
|
1065
1188
|
* @category GraphQL params
|
|
1066
1189
|
* @category CmsModel
|
|
@@ -1070,6 +1193,14 @@ export interface CmsModelCreateInput {
|
|
|
1070
1193
|
* Name of the content model.
|
|
1071
1194
|
*/
|
|
1072
1195
|
name: string;
|
|
1196
|
+
/**
|
|
1197
|
+
* Singular name of the content model to be used in the API.
|
|
1198
|
+
*/
|
|
1199
|
+
singularApiName: string;
|
|
1200
|
+
/**
|
|
1201
|
+
* Plural name of the content model to be used in the API.
|
|
1202
|
+
*/
|
|
1203
|
+
pluralApiName: string;
|
|
1073
1204
|
/**
|
|
1074
1205
|
* Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.
|
|
1075
1206
|
*/
|
|
@@ -1077,7 +1208,7 @@ export interface CmsModelCreateInput {
|
|
|
1077
1208
|
/**
|
|
1078
1209
|
* Description of the content model.
|
|
1079
1210
|
*/
|
|
1080
|
-
description?: string;
|
|
1211
|
+
description?: string | null;
|
|
1081
1212
|
/**
|
|
1082
1213
|
* Group where to put the content model in.
|
|
1083
1214
|
*/
|
|
@@ -1098,13 +1229,18 @@ export interface CmsModelCreateInput {
|
|
|
1098
1229
|
*/
|
|
1099
1230
|
layout?: string[][];
|
|
1100
1231
|
/**
|
|
1101
|
-
*
|
|
1102
|
-
|
|
1232
|
+
* Models can be tagged to give them contextual meaning.
|
|
1233
|
+
*/
|
|
1234
|
+
tags?: string[];
|
|
1235
|
+
/**
|
|
1236
|
+
* Fields fieldId which are picked to represent the CMS entry.
|
|
1103
1237
|
*/
|
|
1104
|
-
titleFieldId?: string;
|
|
1238
|
+
titleFieldId?: string | null;
|
|
1239
|
+
descriptionFieldId?: string | null;
|
|
1240
|
+
imageFieldId?: string | null;
|
|
1105
1241
|
}
|
|
1106
1242
|
/**
|
|
1107
|
-
* A GraphQL params.data parameter received when creating content model from existing model.
|
|
1243
|
+
* A GraphQL `params.data` parameter received when creating content model from existing model.
|
|
1108
1244
|
*
|
|
1109
1245
|
* @category GraphQL params
|
|
1110
1246
|
* @category CmsModel
|
|
@@ -1145,11 +1281,15 @@ export interface CmsModelFieldInput {
|
|
|
1145
1281
|
/**
|
|
1146
1282
|
* Text to display below the field to help user what to write in the field.
|
|
1147
1283
|
*/
|
|
1148
|
-
helpText?: string;
|
|
1284
|
+
helpText?: string | null;
|
|
1149
1285
|
/**
|
|
1150
1286
|
* Text to display in the field.
|
|
1151
1287
|
*/
|
|
1152
|
-
placeholderText?: string;
|
|
1288
|
+
placeholderText?: string | null;
|
|
1289
|
+
/**
|
|
1290
|
+
* Fields can be tagged to give them contextual meaning.
|
|
1291
|
+
*/
|
|
1292
|
+
tags?: string[];
|
|
1153
1293
|
/**
|
|
1154
1294
|
* Are multiple values allowed?
|
|
1155
1295
|
*/
|
|
@@ -1169,14 +1309,14 @@ export interface CmsModelFieldInput {
|
|
|
1169
1309
|
/**
|
|
1170
1310
|
* @see CmsModelField.listValidation
|
|
1171
1311
|
*/
|
|
1172
|
-
listValidation
|
|
1312
|
+
listValidation?: CmsModelFieldValidation[];
|
|
1173
1313
|
/**
|
|
1174
1314
|
* User defined settings.
|
|
1175
1315
|
*/
|
|
1176
1316
|
settings?: Record<string, any>;
|
|
1177
1317
|
}
|
|
1178
1318
|
/**
|
|
1179
|
-
* A GraphQL params.data parameter received when updating content model.
|
|
1319
|
+
* A GraphQL `params.data` parameter received when updating content model.
|
|
1180
1320
|
*
|
|
1181
1321
|
* @category GraphQL params
|
|
1182
1322
|
* @category CmsModel
|
|
@@ -1186,6 +1326,14 @@ export interface CmsModelUpdateInput {
|
|
|
1186
1326
|
* A new content model name.
|
|
1187
1327
|
*/
|
|
1188
1328
|
name?: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* A new singular name of the content model to be used in the API.
|
|
1331
|
+
*/
|
|
1332
|
+
singularApiName?: string;
|
|
1333
|
+
/**
|
|
1334
|
+
* A new plural name of the content model to be used in the API.
|
|
1335
|
+
*/
|
|
1336
|
+
pluralApiName?: string;
|
|
1189
1337
|
/**
|
|
1190
1338
|
* A group we want to move the model to.
|
|
1191
1339
|
*/
|
|
@@ -1193,7 +1341,7 @@ export interface CmsModelUpdateInput {
|
|
|
1193
1341
|
/**
|
|
1194
1342
|
* A new description of the content model.
|
|
1195
1343
|
*/
|
|
1196
|
-
description?: string;
|
|
1344
|
+
description?: string | null;
|
|
1197
1345
|
/**
|
|
1198
1346
|
* A list of content model fields to define the entry values.
|
|
1199
1347
|
*/
|
|
@@ -1210,10 +1358,11 @@ export interface CmsModelUpdateInput {
|
|
|
1210
1358
|
*/
|
|
1211
1359
|
layout: string[][];
|
|
1212
1360
|
/**
|
|
1213
|
-
*
|
|
1214
|
-
* It is picked as first available text field. Or user can select own field.
|
|
1361
|
+
* Fields fieldId which are picked to represent the CMS entry.
|
|
1215
1362
|
*/
|
|
1216
|
-
titleFieldId?: string;
|
|
1363
|
+
titleFieldId?: string | null;
|
|
1364
|
+
descriptionFieldId?: string | null;
|
|
1365
|
+
imageFieldId?: string | null;
|
|
1217
1366
|
}
|
|
1218
1367
|
/**
|
|
1219
1368
|
* A plugin to load a CmsModelManager.
|
|
@@ -1258,7 +1407,7 @@ export interface CmsEntryValues {
|
|
|
1258
1407
|
export interface CmsEntry<T = CmsEntryValues> {
|
|
1259
1408
|
/**
|
|
1260
1409
|
* A version of the webiny this entry was created with.
|
|
1261
|
-
* This can be used when upgrading the system so we know which entries to update.
|
|
1410
|
+
* This can be used when upgrading the system, so we know which entries to update.
|
|
1262
1411
|
*/
|
|
1263
1412
|
webinyVersion: string;
|
|
1264
1413
|
/**
|
|
@@ -1277,11 +1426,15 @@ export interface CmsEntry<T = CmsEntryValues> {
|
|
|
1277
1426
|
/**
|
|
1278
1427
|
* CreatedBy object reference.
|
|
1279
1428
|
*/
|
|
1280
|
-
createdBy:
|
|
1429
|
+
createdBy: CmsIdentity;
|
|
1281
1430
|
/**
|
|
1282
1431
|
* OwnedBy object reference. Can be different from CreatedBy.
|
|
1283
1432
|
*/
|
|
1284
|
-
ownedBy:
|
|
1433
|
+
ownedBy: CmsIdentity;
|
|
1434
|
+
/**
|
|
1435
|
+
* ModifiedBy object reference. Last person who modified the entry.
|
|
1436
|
+
*/
|
|
1437
|
+
modifiedBy?: CmsIdentity | null;
|
|
1285
1438
|
/**
|
|
1286
1439
|
* A string of Date.toISOString() type.
|
|
1287
1440
|
* Populated on creation.
|
|
@@ -1325,13 +1478,19 @@ export interface CmsEntry<T = CmsEntryValues> {
|
|
|
1325
1478
|
* @see CmsModelField
|
|
1326
1479
|
*/
|
|
1327
1480
|
values: T;
|
|
1481
|
+
/**
|
|
1482
|
+
* Advanced Content Organization
|
|
1483
|
+
*/
|
|
1484
|
+
location?: {
|
|
1485
|
+
folderId?: string | null;
|
|
1486
|
+
};
|
|
1328
1487
|
/**
|
|
1329
1488
|
* Settings for the given entry.
|
|
1330
1489
|
*
|
|
1331
|
-
* Introduced with Advanced Publishing Workflow
|
|
1332
|
-
* Be aware that when accessing properties in it on old systems
|
|
1490
|
+
* Introduced with Advanced Publishing Workflow. Will always be inserted once this PR is merged.
|
|
1491
|
+
* Be aware that when accessing properties in it on old systems, it will break if not checked first.
|
|
1333
1492
|
*
|
|
1334
|
-
* Available only on the Manage API in entry GraphQL type meta.data property.
|
|
1493
|
+
* Available only on the Manage API in entry GraphQL type `meta.data` property.
|
|
1335
1494
|
*/
|
|
1336
1495
|
meta?: {
|
|
1337
1496
|
[key: string]: any;
|
|
@@ -1340,6 +1499,10 @@ export interface CmsEntry<T = CmsEntryValues> {
|
|
|
1340
1499
|
export interface CmsStorageEntry extends CmsEntry {
|
|
1341
1500
|
[key: string]: any;
|
|
1342
1501
|
}
|
|
1502
|
+
export interface CmsEntryUniqueValue {
|
|
1503
|
+
value: string;
|
|
1504
|
+
count: number;
|
|
1505
|
+
}
|
|
1343
1506
|
/**
|
|
1344
1507
|
* A definition for content model manager to be used in the code.
|
|
1345
1508
|
* The default one uses `CmsEntryContext` methods internally, but devs can change to what every they want.
|
|
@@ -1364,7 +1527,7 @@ export interface CmsModelManager {
|
|
|
1364
1527
|
*/
|
|
1365
1528
|
getPublishedByIds: (ids: string[]) => Promise<CmsEntry[]>;
|
|
1366
1529
|
/**
|
|
1367
|
-
* Get a list of latest entries by the ID list.
|
|
1530
|
+
* Get a list of the latest entries by the ID list.
|
|
1368
1531
|
*/
|
|
1369
1532
|
getLatestByIds: (ids: string[]) => Promise<CmsEntry[]>;
|
|
1370
1533
|
/**
|
|
@@ -1372,18 +1535,21 @@ export interface CmsModelManager {
|
|
|
1372
1535
|
*/
|
|
1373
1536
|
get: (id: string) => Promise<CmsEntry>;
|
|
1374
1537
|
/**
|
|
1375
|
-
* Create
|
|
1538
|
+
* Create an entry.
|
|
1376
1539
|
*/
|
|
1377
1540
|
create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1378
1541
|
/**
|
|
1379
|
-
* Update
|
|
1542
|
+
* Update an entry.
|
|
1380
1543
|
*/
|
|
1381
1544
|
update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1382
1545
|
/**
|
|
1383
|
-
* Delete
|
|
1546
|
+
* Delete an entry.
|
|
1384
1547
|
*/
|
|
1385
1548
|
delete: (id: string) => Promise<void>;
|
|
1386
1549
|
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Create
|
|
1552
|
+
*/
|
|
1387
1553
|
export interface OnModelBeforeCreateTopicParams {
|
|
1388
1554
|
input: CmsModelCreateInput;
|
|
1389
1555
|
model: CmsModel;
|
|
@@ -1392,6 +1558,14 @@ export interface OnModelAfterCreateTopicParams {
|
|
|
1392
1558
|
input: CmsModelCreateInput;
|
|
1393
1559
|
model: CmsModel;
|
|
1394
1560
|
}
|
|
1561
|
+
export interface OnModelCreateErrorTopicParams {
|
|
1562
|
+
input: CmsModelCreateInput;
|
|
1563
|
+
model: CmsModel;
|
|
1564
|
+
error: Error;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Create From / Clone
|
|
1568
|
+
*/
|
|
1395
1569
|
export interface OnModelBeforeCreateFromTopicParams {
|
|
1396
1570
|
input: CmsModelCreateInput;
|
|
1397
1571
|
original: CmsModel;
|
|
@@ -1402,6 +1576,15 @@ export interface OnModelAfterCreateFromTopicParams {
|
|
|
1402
1576
|
original: CmsModel;
|
|
1403
1577
|
model: CmsModel;
|
|
1404
1578
|
}
|
|
1579
|
+
export interface OnModelCreateFromErrorParams {
|
|
1580
|
+
input: CmsModelCreateInput;
|
|
1581
|
+
original: CmsModel;
|
|
1582
|
+
model: CmsModel;
|
|
1583
|
+
error: Error;
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Update
|
|
1587
|
+
*/
|
|
1405
1588
|
export interface OnModelBeforeUpdateTopicParams {
|
|
1406
1589
|
input: CmsModelUpdateInput;
|
|
1407
1590
|
original: CmsModel;
|
|
@@ -1412,15 +1595,35 @@ export interface OnModelAfterUpdateTopicParams {
|
|
|
1412
1595
|
original: CmsModel;
|
|
1413
1596
|
model: CmsModel;
|
|
1414
1597
|
}
|
|
1598
|
+
export interface OnModelUpdateErrorTopicParams {
|
|
1599
|
+
input: CmsModelUpdateInput;
|
|
1600
|
+
original: CmsModel;
|
|
1601
|
+
model: CmsModel;
|
|
1602
|
+
error: Error;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Delete
|
|
1606
|
+
*/
|
|
1415
1607
|
export interface OnModelBeforeDeleteTopicParams {
|
|
1416
1608
|
model: CmsModel;
|
|
1417
1609
|
}
|
|
1418
1610
|
export interface OnModelAfterDeleteTopicParams {
|
|
1419
1611
|
model: CmsModel;
|
|
1420
1612
|
}
|
|
1613
|
+
export interface OnModelDeleteErrorTopicParams {
|
|
1614
|
+
model: CmsModel;
|
|
1615
|
+
error: Error;
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Initialize
|
|
1619
|
+
*/
|
|
1421
1620
|
export interface OnModelInitializeParams {
|
|
1422
1621
|
model: CmsModel;
|
|
1622
|
+
data: Record<string, any>;
|
|
1423
1623
|
}
|
|
1624
|
+
/**
|
|
1625
|
+
*
|
|
1626
|
+
*/
|
|
1424
1627
|
export interface CmsModelUpdateDirectParams {
|
|
1425
1628
|
model: CmsModel;
|
|
1426
1629
|
original: CmsModel;
|
|
@@ -1467,9 +1670,9 @@ export interface CmsModelContext {
|
|
|
1467
1670
|
*
|
|
1468
1671
|
* Primary idea behind this is creating the index, for the code models, in the ES.
|
|
1469
1672
|
*/
|
|
1470
|
-
initializeModel: (modelId: string) => Promise<boolean>;
|
|
1673
|
+
initializeModel: (modelId: string, data: Record<string, any>) => Promise<boolean>;
|
|
1471
1674
|
/**
|
|
1472
|
-
* Get
|
|
1675
|
+
* Get an instance of CmsModelManager for given content modelId.
|
|
1473
1676
|
*
|
|
1474
1677
|
* @see CmsModelManager
|
|
1475
1678
|
*
|
|
@@ -1528,12 +1731,16 @@ export interface CmsModelContext {
|
|
|
1528
1731
|
*/
|
|
1529
1732
|
onModelBeforeCreate: Topic<OnModelBeforeCreateTopicParams>;
|
|
1530
1733
|
onModelAfterCreate: Topic<OnModelAfterCreateTopicParams>;
|
|
1734
|
+
onModelCreateError: Topic<OnModelCreateErrorTopicParams>;
|
|
1531
1735
|
onModelBeforeCreateFrom: Topic<OnModelBeforeCreateFromTopicParams>;
|
|
1532
1736
|
onModelAfterCreateFrom: Topic<OnModelAfterCreateFromTopicParams>;
|
|
1737
|
+
onModelCreateFromError: Topic<OnModelCreateFromErrorParams>;
|
|
1533
1738
|
onModelBeforeUpdate: Topic<OnModelBeforeUpdateTopicParams>;
|
|
1534
1739
|
onModelAfterUpdate: Topic<OnModelAfterUpdateTopicParams>;
|
|
1740
|
+
onModelUpdateError: Topic<OnModelUpdateErrorTopicParams>;
|
|
1535
1741
|
onModelBeforeDelete: Topic<OnModelBeforeDeleteTopicParams>;
|
|
1536
1742
|
onModelAfterDelete: Topic<OnModelAfterDeleteTopicParams>;
|
|
1743
|
+
onModelDeleteError: Topic<OnModelDeleteErrorTopicParams>;
|
|
1537
1744
|
onModelInitialize: Topic<OnModelInitializeParams>;
|
|
1538
1745
|
}
|
|
1539
1746
|
/**
|
|
@@ -1619,7 +1826,12 @@ export interface CmsEntryListWhere {
|
|
|
1619
1826
|
/**
|
|
1620
1827
|
* This is to allow querying by any content model field defined by the user.
|
|
1621
1828
|
*/
|
|
1622
|
-
[key: string]:
|
|
1829
|
+
[key: string]: string | number | boolean | undefined | string[] | number[] | null | CmsEntryListWhere[] | CmsEntryListWhere | CmsEntryListWhereRef;
|
|
1830
|
+
/**
|
|
1831
|
+
* To allow querying via nested queries, we added the AND / OR properties.
|
|
1832
|
+
*/
|
|
1833
|
+
AND?: CmsEntryListWhere[];
|
|
1834
|
+
OR?: CmsEntryListWhere[];
|
|
1623
1835
|
}
|
|
1624
1836
|
/**
|
|
1625
1837
|
* Entry listing sort.
|
|
@@ -1672,15 +1884,18 @@ export interface CmsEntryMeta {
|
|
|
1672
1884
|
*/
|
|
1673
1885
|
totalCount: number;
|
|
1674
1886
|
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Create
|
|
1889
|
+
*/
|
|
1675
1890
|
export interface OnEntryBeforeCreateTopicParams {
|
|
1676
1891
|
input: CreateCmsEntryInput;
|
|
1677
1892
|
entry: CmsEntry;
|
|
1678
|
-
model:
|
|
1893
|
+
model: CmsModel;
|
|
1679
1894
|
}
|
|
1680
1895
|
export interface OnEntryAfterCreateTopicParams {
|
|
1681
1896
|
input: CreateCmsEntryInput;
|
|
1682
1897
|
entry: CmsEntry;
|
|
1683
|
-
model:
|
|
1898
|
+
model: CmsModel;
|
|
1684
1899
|
storageEntry: CmsEntry;
|
|
1685
1900
|
}
|
|
1686
1901
|
export interface OnEntryCreateErrorTopicParams {
|
|
@@ -1689,65 +1904,95 @@ export interface OnEntryCreateErrorTopicParams {
|
|
|
1689
1904
|
entry: CmsEntry;
|
|
1690
1905
|
model: CmsModel;
|
|
1691
1906
|
}
|
|
1907
|
+
/**
|
|
1908
|
+
* Revision Create
|
|
1909
|
+
*/
|
|
1692
1910
|
export interface OnEntryRevisionBeforeCreateTopicParams {
|
|
1693
1911
|
input: CreateFromCmsEntryInput;
|
|
1694
1912
|
entry: CmsEntry;
|
|
1695
1913
|
original: CmsEntry;
|
|
1696
|
-
model:
|
|
1914
|
+
model: CmsModel;
|
|
1697
1915
|
}
|
|
1698
1916
|
export interface OnEntryRevisionAfterCreateTopicParams {
|
|
1699
1917
|
input: CreateFromCmsEntryInput;
|
|
1700
1918
|
entry: CmsEntry;
|
|
1701
1919
|
original: CmsEntry;
|
|
1702
|
-
model:
|
|
1920
|
+
model: CmsModel;
|
|
1703
1921
|
storageEntry: CmsEntry;
|
|
1704
1922
|
}
|
|
1705
1923
|
export interface OnEntryCreateRevisionErrorTopicParams {
|
|
1706
1924
|
error: Error;
|
|
1707
1925
|
input: CreateFromCmsEntryInput;
|
|
1926
|
+
original: CmsEntry;
|
|
1708
1927
|
entry: CmsEntry;
|
|
1709
1928
|
model: CmsModel;
|
|
1710
1929
|
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Update
|
|
1932
|
+
*/
|
|
1711
1933
|
export interface OnEntryBeforeUpdateTopicParams {
|
|
1712
1934
|
input: UpdateCmsEntryInput;
|
|
1713
1935
|
original: CmsEntry;
|
|
1714
1936
|
entry: CmsEntry;
|
|
1715
|
-
model:
|
|
1937
|
+
model: CmsModel;
|
|
1716
1938
|
}
|
|
1717
1939
|
export interface OnEntryAfterUpdateTopicParams {
|
|
1718
1940
|
input: UpdateCmsEntryInput;
|
|
1719
1941
|
original: CmsEntry;
|
|
1720
1942
|
entry: CmsEntry;
|
|
1721
|
-
model:
|
|
1943
|
+
model: CmsModel;
|
|
1722
1944
|
storageEntry: CmsEntry;
|
|
1723
1945
|
}
|
|
1724
1946
|
export interface OnEntryUpdateErrorTopicParams {
|
|
1725
1947
|
error: Error;
|
|
1726
|
-
input:
|
|
1948
|
+
input: UpdateCmsEntryInput;
|
|
1727
1949
|
entry: CmsEntry;
|
|
1728
1950
|
model: CmsModel;
|
|
1729
1951
|
}
|
|
1952
|
+
/**
|
|
1953
|
+
* Publish
|
|
1954
|
+
*/
|
|
1730
1955
|
export interface OnEntryBeforePublishTopicParams {
|
|
1731
1956
|
entry: CmsEntry;
|
|
1732
|
-
model:
|
|
1957
|
+
model: CmsModel;
|
|
1733
1958
|
}
|
|
1734
1959
|
export interface OnEntryAfterPublishTopicParams {
|
|
1735
1960
|
entry: CmsEntry;
|
|
1736
|
-
model:
|
|
1961
|
+
model: CmsModel;
|
|
1737
1962
|
storageEntry: CmsEntry;
|
|
1738
1963
|
}
|
|
1739
1964
|
export interface OnEntryPublishErrorTopicParams {
|
|
1740
1965
|
error: Error;
|
|
1741
1966
|
entry: CmsEntry;
|
|
1742
|
-
model:
|
|
1967
|
+
model: CmsModel;
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Republish
|
|
1971
|
+
*/
|
|
1972
|
+
export interface OnEntryBeforeRepublishTopicParams {
|
|
1973
|
+
entry: CmsEntry;
|
|
1974
|
+
model: CmsModel;
|
|
1975
|
+
}
|
|
1976
|
+
export interface OnEntryAfterRepublishTopicParams {
|
|
1977
|
+
entry: CmsEntry;
|
|
1978
|
+
model: CmsModel;
|
|
1979
|
+
storageEntry: CmsEntry;
|
|
1980
|
+
}
|
|
1981
|
+
export interface OnEntryRepublishErrorTopicParams {
|
|
1982
|
+
error: Error;
|
|
1983
|
+
entry: CmsEntry;
|
|
1984
|
+
model: CmsModel;
|
|
1743
1985
|
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Unpublish
|
|
1988
|
+
*/
|
|
1744
1989
|
export interface OnEntryBeforeUnpublishTopicParams {
|
|
1745
1990
|
entry: CmsEntry;
|
|
1746
|
-
model:
|
|
1991
|
+
model: CmsModel;
|
|
1747
1992
|
}
|
|
1748
1993
|
export interface OnEntryAfterUnpublishTopicParams {
|
|
1749
1994
|
entry: CmsEntry;
|
|
1750
|
-
model:
|
|
1995
|
+
model: CmsModel;
|
|
1751
1996
|
storageEntry: CmsEntry;
|
|
1752
1997
|
}
|
|
1753
1998
|
export interface OnEntryUnpublishErrorTopicParams {
|
|
@@ -1757,43 +2002,63 @@ export interface OnEntryUnpublishErrorTopicParams {
|
|
|
1757
2002
|
}
|
|
1758
2003
|
export interface OnEntryBeforeDeleteTopicParams {
|
|
1759
2004
|
entry: CmsEntry;
|
|
1760
|
-
model:
|
|
2005
|
+
model: CmsModel;
|
|
1761
2006
|
}
|
|
1762
2007
|
export interface OnEntryAfterDeleteTopicParams {
|
|
1763
2008
|
entry: CmsEntry;
|
|
1764
|
-
model:
|
|
2009
|
+
model: CmsModel;
|
|
1765
2010
|
}
|
|
1766
2011
|
export interface OnEntryDeleteErrorTopicParams {
|
|
1767
2012
|
error: Error;
|
|
1768
2013
|
entry: CmsEntry;
|
|
1769
|
-
model:
|
|
2014
|
+
model: CmsModel;
|
|
1770
2015
|
}
|
|
1771
2016
|
export interface OnEntryRevisionBeforeDeleteTopicParams {
|
|
1772
2017
|
entry: CmsEntry;
|
|
1773
|
-
model:
|
|
2018
|
+
model: CmsModel;
|
|
1774
2019
|
}
|
|
1775
2020
|
export interface OnEntryRevisionAfterDeleteTopicParams {
|
|
1776
2021
|
entry: CmsEntry;
|
|
1777
|
-
model:
|
|
2022
|
+
model: CmsModel;
|
|
1778
2023
|
}
|
|
1779
2024
|
export interface OnEntryRevisionDeleteErrorTopicParams {
|
|
1780
2025
|
error: Error;
|
|
1781
2026
|
entry: CmsEntry;
|
|
1782
|
-
model:
|
|
2027
|
+
model: CmsModel;
|
|
2028
|
+
}
|
|
2029
|
+
export interface OnEntryBeforeDeleteMultipleTopicParams {
|
|
2030
|
+
model: CmsModel;
|
|
2031
|
+
entries: CmsEntry[];
|
|
2032
|
+
ids: string[];
|
|
2033
|
+
}
|
|
2034
|
+
export interface OnEntryAfterDeleteMultipleTopicParams {
|
|
2035
|
+
model: CmsModel;
|
|
2036
|
+
entries: CmsEntry[];
|
|
2037
|
+
ids: string[];
|
|
2038
|
+
}
|
|
2039
|
+
export interface OnEntryDeleteMultipleErrorTopicParams {
|
|
2040
|
+
model: CmsModel;
|
|
2041
|
+
entries: CmsEntry[];
|
|
2042
|
+
ids: string[];
|
|
2043
|
+
error: Error;
|
|
1783
2044
|
}
|
|
1784
2045
|
export interface OnEntryBeforeGetTopicParams {
|
|
1785
|
-
model:
|
|
2046
|
+
model: CmsModel;
|
|
1786
2047
|
where: CmsEntryListWhere;
|
|
1787
2048
|
}
|
|
1788
2049
|
export interface EntryBeforeListTopicParams {
|
|
1789
2050
|
where: CmsEntryListWhere;
|
|
1790
|
-
model:
|
|
2051
|
+
model: CmsModel;
|
|
1791
2052
|
}
|
|
1792
2053
|
/**
|
|
1793
2054
|
* @category Context
|
|
1794
2055
|
* @category CmsEntry
|
|
1795
2056
|
*/
|
|
1796
2057
|
export interface CreateCmsEntryInput {
|
|
2058
|
+
id?: string;
|
|
2059
|
+
wbyAco_location?: {
|
|
2060
|
+
folderId?: string | null;
|
|
2061
|
+
};
|
|
1797
2062
|
[key: string]: any;
|
|
1798
2063
|
}
|
|
1799
2064
|
/**
|
|
@@ -1808,8 +2073,39 @@ export interface CreateFromCmsEntryInput {
|
|
|
1808
2073
|
* @category CmsEntry
|
|
1809
2074
|
*/
|
|
1810
2075
|
export interface UpdateCmsEntryInput {
|
|
2076
|
+
wbyAco_location?: {
|
|
2077
|
+
folderId?: string | null;
|
|
2078
|
+
};
|
|
1811
2079
|
[key: string]: any;
|
|
1812
2080
|
}
|
|
2081
|
+
/**
|
|
2082
|
+
* @category Context
|
|
2083
|
+
* @category CmsEntry
|
|
2084
|
+
*/
|
|
2085
|
+
export interface GetUniqueFieldValuesParams {
|
|
2086
|
+
where: CmsEntryListWhere;
|
|
2087
|
+
fieldId: string;
|
|
2088
|
+
}
|
|
2089
|
+
/**
|
|
2090
|
+
* @category CmsEntry
|
|
2091
|
+
*/
|
|
2092
|
+
export interface CmsDeleteEntryOptions {
|
|
2093
|
+
/**
|
|
2094
|
+
* Runs the delete commands even if the entry is not found in the DynamoDB.
|
|
2095
|
+
* This is to force clean the entry records that might have been left behind a failed delete.
|
|
2096
|
+
*/
|
|
2097
|
+
force?: boolean;
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* @category Context
|
|
2101
|
+
* @category CmsEntry
|
|
2102
|
+
*/
|
|
2103
|
+
export interface DeleteMultipleEntriesParams {
|
|
2104
|
+
entries: string[];
|
|
2105
|
+
}
|
|
2106
|
+
export declare type DeleteMultipleEntriesResponse = {
|
|
2107
|
+
id: string;
|
|
2108
|
+
}[];
|
|
1813
2109
|
/**
|
|
1814
2110
|
* Cms Entry CRUD methods in the context.
|
|
1815
2111
|
*
|
|
@@ -1820,7 +2116,7 @@ export interface CmsEntryContext {
|
|
|
1820
2116
|
/**
|
|
1821
2117
|
* Get a single content entry for a model.
|
|
1822
2118
|
*/
|
|
1823
|
-
getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry
|
|
2119
|
+
getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry>;
|
|
1824
2120
|
/**
|
|
1825
2121
|
* Get a list of entries for a model by a given ID (revision).
|
|
1826
2122
|
*/
|
|
@@ -1832,15 +2128,15 @@ export interface CmsEntryContext {
|
|
|
1832
2128
|
/**
|
|
1833
2129
|
* List entries for a model. Internal method used by get, listLatest and listPublished.
|
|
1834
2130
|
*/
|
|
1835
|
-
listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
2131
|
+
listEntries: <T = CmsEntryValues>(model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
1836
2132
|
/**
|
|
1837
|
-
* Lists latest entries. Used for manage API.
|
|
2133
|
+
* Lists the latest entries. Used for manage API.
|
|
1838
2134
|
*/
|
|
1839
|
-
listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
2135
|
+
listLatestEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
1840
2136
|
/**
|
|
1841
2137
|
* List published entries. Used for read API.
|
|
1842
2138
|
*/
|
|
1843
|
-
listPublishedEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
2139
|
+
listPublishedEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
1844
2140
|
/**
|
|
1845
2141
|
* List published entries by IDs.
|
|
1846
2142
|
*/
|
|
@@ -1873,7 +2169,11 @@ export interface CmsEntryContext {
|
|
|
1873
2169
|
/**
|
|
1874
2170
|
* Delete entry with all its revisions.
|
|
1875
2171
|
*/
|
|
1876
|
-
deleteEntry: (model: CmsModel, id: string) => Promise<void>;
|
|
2172
|
+
deleteEntry: (model: CmsModel, id: string, options?: CmsDeleteEntryOptions) => Promise<void>;
|
|
2173
|
+
/**
|
|
2174
|
+
* Delete multiple entries
|
|
2175
|
+
*/
|
|
2176
|
+
deleteMultipleEntries: (model: CmsModel, params: DeleteMultipleEntriesParams) => Promise<DeleteMultipleEntriesResponse>;
|
|
1877
2177
|
/**
|
|
1878
2178
|
* Publish entry.
|
|
1879
2179
|
*/
|
|
@@ -1887,7 +2187,13 @@ export interface CmsEntryContext {
|
|
|
1887
2187
|
*/
|
|
1888
2188
|
getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
|
|
1889
2189
|
/**
|
|
1890
|
-
*
|
|
2190
|
+
* List all unique values for a given field.
|
|
2191
|
+
*
|
|
2192
|
+
* @internal
|
|
2193
|
+
*/
|
|
2194
|
+
getUniqueFieldValues: (model: CmsModel, params: GetUniqueFieldValuesParams) => Promise<CmsEntryUniqueValue[]>;
|
|
2195
|
+
/**
|
|
2196
|
+
* Lifecycle events - deprecated.
|
|
1891
2197
|
*/
|
|
1892
2198
|
/**
|
|
1893
2199
|
* @deprecated
|
|
@@ -1974,6 +2280,9 @@ export interface CmsEntryContext {
|
|
|
1974
2280
|
onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;
|
|
1975
2281
|
onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;
|
|
1976
2282
|
onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;
|
|
2283
|
+
onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;
|
|
2284
|
+
onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;
|
|
2285
|
+
onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;
|
|
1977
2286
|
onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;
|
|
1978
2287
|
onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;
|
|
1979
2288
|
onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;
|
|
@@ -2022,13 +2331,13 @@ export interface BaseCmsSecurityPermission extends SecurityPermission {
|
|
|
2022
2331
|
*/
|
|
2023
2332
|
export interface CmsModelPermission extends BaseCmsSecurityPermission {
|
|
2024
2333
|
/**
|
|
2025
|
-
*
|
|
2334
|
+
* An object representing `key: model.modelId` values where key is locale code.
|
|
2026
2335
|
*/
|
|
2027
2336
|
models?: {
|
|
2028
2337
|
[key: string]: string[];
|
|
2029
2338
|
};
|
|
2030
2339
|
/**
|
|
2031
|
-
*
|
|
2340
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
2032
2341
|
*/
|
|
2033
2342
|
groups?: {
|
|
2034
2343
|
[key: string]: string[];
|
|
@@ -2042,7 +2351,7 @@ export interface CmsModelPermission extends BaseCmsSecurityPermission {
|
|
|
2042
2351
|
*/
|
|
2043
2352
|
export interface CmsGroupPermission extends BaseCmsSecurityPermission {
|
|
2044
2353
|
/**
|
|
2045
|
-
*
|
|
2354
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
2046
2355
|
*/
|
|
2047
2356
|
groups?: {
|
|
2048
2357
|
[key: string]: string[];
|
|
@@ -2057,13 +2366,13 @@ export interface CmsGroupPermission extends BaseCmsSecurityPermission {
|
|
|
2057
2366
|
export interface CmsEntryPermission extends BaseCmsSecurityPermission {
|
|
2058
2367
|
pw?: string;
|
|
2059
2368
|
/**
|
|
2060
|
-
*
|
|
2369
|
+
* An object representing `key: model.modelId` values where key is locale code.
|
|
2061
2370
|
*/
|
|
2062
2371
|
models?: {
|
|
2063
2372
|
[key: string]: string[];
|
|
2064
2373
|
};
|
|
2065
2374
|
/**
|
|
2066
|
-
*
|
|
2375
|
+
* {locale: groupId[]} map, where key is a locale code.
|
|
2067
2376
|
*/
|
|
2068
2377
|
groups?: {
|
|
2069
2378
|
[key: string]: string[];
|
|
@@ -2178,7 +2487,7 @@ export interface CmsEntryStorageOperationsListParams {
|
|
|
2178
2487
|
sort?: CmsEntryListSort;
|
|
2179
2488
|
search?: string;
|
|
2180
2489
|
fields?: string[];
|
|
2181
|
-
limit
|
|
2490
|
+
limit: number;
|
|
2182
2491
|
after?: string | null;
|
|
2183
2492
|
}
|
|
2184
2493
|
export interface CmsEntryStorageOperationsCreateParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
@@ -2230,11 +2539,11 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
|
|
|
2230
2539
|
latestStorageEntry: T | null;
|
|
2231
2540
|
}
|
|
2232
2541
|
export interface CmsEntryStorageOperationsDeleteParams {
|
|
2233
|
-
/**
|
|
2234
|
-
* Entry that is going to be deleted.
|
|
2235
|
-
*/
|
|
2236
2542
|
entry: CmsEntry;
|
|
2237
2543
|
}
|
|
2544
|
+
export interface CmsEntryStorageOperationsDeleteEntriesParams {
|
|
2545
|
+
entries: string[];
|
|
2546
|
+
}
|
|
2238
2547
|
export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
2239
2548
|
/**
|
|
2240
2549
|
* The modified entry that is going to be saved as published.
|
|
@@ -2256,6 +2565,10 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
|
|
|
2256
2565
|
*/
|
|
2257
2566
|
storageEntry: T;
|
|
2258
2567
|
}
|
|
2568
|
+
export interface CmsEntryStorageOperationsGetUniqueFieldValuesParams {
|
|
2569
|
+
where: CmsEntryListWhere;
|
|
2570
|
+
fieldId: string;
|
|
2571
|
+
}
|
|
2259
2572
|
export interface CmsEntryStorageOperationsGetByIdsParams {
|
|
2260
2573
|
ids: readonly string[];
|
|
2261
2574
|
}
|
|
@@ -2312,71 +2625,81 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
|
|
|
2312
2625
|
/**
|
|
2313
2626
|
* Get all the entries of the ids.
|
|
2314
2627
|
*/
|
|
2315
|
-
getByIds: (model:
|
|
2628
|
+
getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
|
|
2316
2629
|
/**
|
|
2317
2630
|
* Get all the published entries of the ids.
|
|
2318
2631
|
*/
|
|
2319
|
-
getPublishedByIds: (model:
|
|
2632
|
+
getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
|
|
2320
2633
|
/**
|
|
2321
2634
|
* Get all the latest entries of the ids.
|
|
2322
2635
|
*/
|
|
2323
|
-
getLatestByIds: (model:
|
|
2636
|
+
getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
|
|
2324
2637
|
/**
|
|
2325
2638
|
* Get all revisions of the given entry id.
|
|
2326
2639
|
*/
|
|
2327
|
-
getRevisions: (model:
|
|
2640
|
+
getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
|
|
2328
2641
|
/**
|
|
2329
2642
|
* Get the entry by the given revision id.
|
|
2330
2643
|
*/
|
|
2331
|
-
getRevisionById: (model:
|
|
2644
|
+
getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
|
|
2332
2645
|
/**
|
|
2333
2646
|
* Get the published entry by given entryId.
|
|
2334
2647
|
*/
|
|
2335
|
-
getPublishedRevisionByEntryId: (model:
|
|
2648
|
+
getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
|
|
2336
2649
|
/**
|
|
2337
2650
|
* Get the latest entry by given entryId.
|
|
2338
2651
|
*/
|
|
2339
|
-
getLatestRevisionByEntryId: (model:
|
|
2652
|
+
getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
|
|
2340
2653
|
/**
|
|
2341
2654
|
* Get the revision of the entry before given one.
|
|
2342
2655
|
*/
|
|
2343
|
-
getPreviousRevision: (model:
|
|
2656
|
+
getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
|
|
2344
2657
|
/**
|
|
2345
2658
|
* Gets entry by given params.
|
|
2346
2659
|
*/
|
|
2347
|
-
get: (model:
|
|
2660
|
+
get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
|
|
2348
2661
|
/**
|
|
2349
2662
|
* List all entries. Filterable via params.
|
|
2350
2663
|
*/
|
|
2351
|
-
list: (model:
|
|
2664
|
+
list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
|
|
2352
2665
|
/**
|
|
2353
2666
|
* Create a new entry.
|
|
2354
2667
|
*/
|
|
2355
|
-
create: (model:
|
|
2668
|
+
create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
|
|
2356
2669
|
/**
|
|
2357
2670
|
* Create a new entry from existing one.
|
|
2358
2671
|
*/
|
|
2359
|
-
createRevisionFrom: (model:
|
|
2672
|
+
createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
|
|
2360
2673
|
/**
|
|
2361
2674
|
* Update existing entry.
|
|
2362
2675
|
*/
|
|
2363
|
-
update: (model:
|
|
2676
|
+
update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
|
|
2364
2677
|
/**
|
|
2365
2678
|
* Delete the entry revision.
|
|
2366
2679
|
*/
|
|
2367
|
-
deleteRevision: (model:
|
|
2680
|
+
deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
|
|
2368
2681
|
/**
|
|
2369
2682
|
* Delete the entry.
|
|
2370
2683
|
*/
|
|
2371
|
-
delete: (model:
|
|
2684
|
+
delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
|
|
2685
|
+
/**
|
|
2686
|
+
* Delete multiple entries, with a limit on how much can be deleted in one call.
|
|
2687
|
+
*/
|
|
2688
|
+
deleteMultipleEntries: (model: CmsModel, params: CmsEntryStorageOperationsDeleteEntriesParams) => Promise<void>;
|
|
2372
2689
|
/**
|
|
2373
2690
|
* Publish the entry.
|
|
2374
2691
|
*/
|
|
2375
|
-
publish: (model:
|
|
2692
|
+
publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
|
|
2376
2693
|
/**
|
|
2377
2694
|
* Unpublish the entry.
|
|
2378
2695
|
*/
|
|
2379
|
-
unpublish: (model:
|
|
2696
|
+
unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
|
|
2697
|
+
/**
|
|
2698
|
+
* Method to list all the unique values for the given field id.
|
|
2699
|
+
* Simplest use case would be to aggregate tags for some content.
|
|
2700
|
+
* @internal
|
|
2701
|
+
*/
|
|
2702
|
+
getUniqueFieldValues: (model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams) => Promise<CmsEntryUniqueValue[]>;
|
|
2380
2703
|
}
|
|
2381
2704
|
export declare enum CONTENT_ENTRY_STATUS {
|
|
2382
2705
|
DRAFT = "draft",
|
|
@@ -2439,6 +2762,7 @@ export interface CmsSystemStorageOperations {
|
|
|
2439
2762
|
update: (params: CmsSystemStorageOperationsUpdateParams) => Promise<CmsSystem>;
|
|
2440
2763
|
}
|
|
2441
2764
|
export interface HeadlessCmsStorageOperations<C = CmsContext> {
|
|
2765
|
+
name: string;
|
|
2442
2766
|
system: CmsSystemStorageOperations;
|
|
2443
2767
|
settings: CmsSettingsStorageOperations;
|
|
2444
2768
|
groups: CmsGroupStorageOperations;
|
|
@@ -2447,11 +2771,7 @@ export interface HeadlessCmsStorageOperations<C = CmsContext> {
|
|
|
2447
2771
|
/**
|
|
2448
2772
|
* Either attach something from the storage operations or run something in it.
|
|
2449
2773
|
*/
|
|
2450
|
-
beforeInit
|
|
2774
|
+
beforeInit: (context: C) => Promise<void>;
|
|
2451
2775
|
init?: (context: C) => Promise<void>;
|
|
2452
|
-
/**
|
|
2453
|
-
* An upgrade to run if necessary.
|
|
2454
|
-
*/
|
|
2455
|
-
upgrade?: UpgradePlugin | null;
|
|
2456
2776
|
}
|
|
2457
2777
|
export {};
|