@webiny/api-headless-cms 0.0.0-unstable.bca7b3e350 → 0.0.0-unstable.c59b9cc5b9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/context.js +47 -43
- package/context.js.map +1 -1
- package/crud/contentEntry/markLockedFields.d.ts +1 -1
- package/crud/contentEntry/markLockedFields.js +3 -0
- package/crud/contentEntry/markLockedFields.js.map +1 -1
- package/crud/contentEntry/referenceFieldsMapping.js +34 -5
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
- package/crud/contentEntry.crud.d.ts +8 -5
- package/crud/contentEntry.crud.js +1023 -840
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/beforeCreate.js +39 -76
- 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.js +31 -3
- 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/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 +1 -0
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.d.ts +2 -1
- package/crud/contentModel/validateModelFields.js +19 -57
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel/validation.d.ts +136 -62
- package/crud/contentModel/validation.js +61 -13
- package/crud/contentModel/validation.js.map +1 -1
- package/crud/contentModel.crud.js +346 -285
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup.crud.js +170 -148
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/crud/settings.crud.d.ts +1 -1
- package/crud/settings.crud.js +5 -10
- package/crud/settings.crud.js.map +1 -1
- package/crud/system.crud.js +0 -60
- package/crud/system.crud.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 +2 -3
- package/graphql/createExecutableSchema.js.map +1 -1
- 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.js.map +1 -1
- 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 -145
- 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/schema/baseContentSchema.js +1 -7
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.js +15 -0
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/contentEntries.js +90 -53
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.js +7 -7
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.js +23 -4
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.d.ts +1 -1
- package/graphql/schema/createFieldResolvers.js +6 -12
- 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 +37 -17
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.d.ts +1 -0
- package/graphql/schema/createManageSDL.js +76 -62
- 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 +4 -8
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.d.ts +1 -0
- package/graphql/schema/createReadSDL.js +40 -35
- 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/schemaPlugins.js +7 -16
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/graphql/system.js +0 -16
- package/graphql/system.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.js +54 -19
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
- package/graphqlFields/object.js +21 -2
- package/graphqlFields/object.js.map +1 -1
- package/graphqlFields/ref.js +42 -14
- package/graphqlFields/ref.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +25 -2
- package/index.js.map +1 -1
- package/package.json +35 -36
- 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/index.d.ts +1 -0
- package/plugins/index.js +11 -0
- package/plugins/index.js.map +1 -1
- package/types.d.ts +200 -97
- package/types.js +12 -1
- package/types.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 +1 -0
- package/utils/createTypeFromFields.js +7 -5
- package/utils/createTypeFromFields.js.map +1 -1
- package/utils/createTypeName.d.ts +0 -2
- package/utils/createTypeName.js +2 -10
- package/utils/createTypeName.js.map +1 -1
- package/utils/getBaseFieldType.d.ts +1 -3
- package/utils/getBaseFieldType.js.map +1 -1
- 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/incrementEntryIdVersion.d.ts +5 -0
- package/utils/incrementEntryIdVersion.js +29 -0
- package/utils/incrementEntryIdVersion.js.map +1 -0
- package/utils/ownership.d.ts +3 -3
- package/utils/ownership.js.map +1 -1
- package/utils/renderFields.d.ts +4 -2
- package/utils/renderFields.js +10 -2
- package/utils/renderFields.js.map +1 -1
- package/utils/renderGetFilterFields.d.ts +2 -2
- package/utils/renderGetFilterFields.js +7 -20
- package/utils/renderGetFilterFields.js.map +1 -1
- package/utils/renderInputFields.d.ts +4 -2
- package/utils/renderInputFields.js +17 -5
- package/utils/renderInputFields.js.map +1 -1
- package/utils/renderListFilterFields.d.ts +2 -1
- package/utils/renderListFilterFields.js +9 -20
- package/utils/renderListFilterFields.js.map +1 -1
- package/utils/renderSortEnum.d.ts +2 -1
- package/utils/renderSortEnum.js +2 -1
- package/utils/renderSortEnum.js.map +1 -1
- package/crud/contentModel/createFieldModels.d.ts +0 -2
- package/crud/contentModel/createFieldModels.js +0 -26
- package/crud/contentModel/createFieldModels.js.map +0 -1
- package/crud/contentModel/fieldIdValidation.d.ts +0 -1
- package/crud/contentModel/fieldIdValidation.js +0 -25
- package/crud/contentModel/fieldIdValidation.js.map +0 -1
- package/crud/contentModel/idValidation.d.ts +0 -1
- package/crud/contentModel/idValidation.js +0 -22
- package/crud/contentModel/idValidation.js.map +0 -1
- package/crud/contentModel/models.d.ts +0 -4
- package/crud/contentModel/models.js +0 -192
- 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/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/pluralizedTypeName.d.ts +0 -1
- package/utils/pluralizedTypeName.js +0 -20
- package/utils/pluralizedTypeName.js.map +0 -1
package/types.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { GraphQLFieldResolver, GraphQLSchemaDefinition, Resolvers } from "@webin
|
|
|
5
5
|
import { SecurityPermission } from "@webiny/api-security/types";
|
|
6
6
|
import { DbContext } from "@webiny/handler-db/types";
|
|
7
7
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
8
|
-
import { UpgradePlugin } from "@webiny/api-upgrade/types";
|
|
9
8
|
import { Topic } from "@webiny/pubsub/types";
|
|
10
9
|
import { CmsModelConverterCallable } from "./utils/converters/ConverterCollection";
|
|
11
10
|
export declare type ApiEndpoint = "manage" | "preview" | "read";
|
|
@@ -98,6 +97,10 @@ export interface CmsModelFieldSettings {
|
|
|
98
97
|
* Object field has child fields.
|
|
99
98
|
*/
|
|
100
99
|
fields?: CmsModelField[];
|
|
100
|
+
/**
|
|
101
|
+
* Is the file field images only one?
|
|
102
|
+
*/
|
|
103
|
+
imagesOnly?: boolean;
|
|
101
104
|
/**
|
|
102
105
|
* Object field has child fields - so it needs to have a layout.
|
|
103
106
|
*/
|
|
@@ -115,6 +118,7 @@ export interface CmsModelFieldSettings {
|
|
|
115
118
|
*/
|
|
116
119
|
[key: string]: any;
|
|
117
120
|
}
|
|
121
|
+
export declare type CmsModelFieldType = "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
|
|
118
122
|
/**
|
|
119
123
|
* A definition for content model field. This type exists on the app side as well.
|
|
120
124
|
*
|
|
@@ -135,18 +139,16 @@ export interface CmsModelField {
|
|
|
135
139
|
* A type of the field.
|
|
136
140
|
* We are defining our built-in fields, so people know which are available by the default.
|
|
137
141
|
*/
|
|
138
|
-
type:
|
|
142
|
+
type: CmsModelFieldType;
|
|
139
143
|
/**
|
|
140
144
|
* A unique storage ID for storing actual values.
|
|
141
|
-
* Must in form of a-zA-Z0-9@a-zA-Z0-9
|
|
145
|
+
* Must in form of a-zA-Z0-9@a-zA-Z0-9
|
|
142
146
|
*
|
|
143
147
|
* This is an auto-generated value: uses `id` and `type`
|
|
144
148
|
*
|
|
145
149
|
* This is used as path for the entry value.
|
|
146
|
-
*
|
|
147
|
-
* @internal
|
|
148
150
|
*/
|
|
149
|
-
storageId: string;
|
|
151
|
+
storageId: `${string}@${string}` | string;
|
|
150
152
|
/**
|
|
151
153
|
* Field identifier for the model field that will be available to the outside world.
|
|
152
154
|
* `storageId` is used as path (or column) to store the data.
|
|
@@ -377,7 +379,7 @@ export interface CmsModelGroup {
|
|
|
377
379
|
name: string;
|
|
378
380
|
}
|
|
379
381
|
/**
|
|
380
|
-
*
|
|
382
|
+
* Base CMS Model. Should not be exported and used outside of this package.
|
|
381
383
|
*
|
|
382
384
|
* @category Database model
|
|
383
385
|
* @category CmsModel
|
|
@@ -391,6 +393,24 @@ export interface CmsModel {
|
|
|
391
393
|
* Unique ID for the content model. Created from name if not defined by user.
|
|
392
394
|
*/
|
|
393
395
|
modelId: string;
|
|
396
|
+
/**
|
|
397
|
+
* Name of the content model in singular form to be used in the API.
|
|
398
|
+
* example:
|
|
399
|
+
* - Article
|
|
400
|
+
* - Fruit
|
|
401
|
+
* - Vegetable
|
|
402
|
+
* - Car
|
|
403
|
+
*/
|
|
404
|
+
singularApiName: string;
|
|
405
|
+
/**
|
|
406
|
+
* Name of the content model in plural form to be used in the API.
|
|
407
|
+
* example:
|
|
408
|
+
* - Articles
|
|
409
|
+
* - Fruits
|
|
410
|
+
* - Vegetables
|
|
411
|
+
* - Cars
|
|
412
|
+
*/
|
|
413
|
+
pluralApiName: string;
|
|
394
414
|
/**
|
|
395
415
|
* Model tenant.
|
|
396
416
|
*/
|
|
@@ -403,10 +423,14 @@ export interface CmsModel {
|
|
|
403
423
|
* Cms Group reference object.
|
|
404
424
|
*/
|
|
405
425
|
group: CmsModelGroup;
|
|
426
|
+
/**
|
|
427
|
+
* Icon for the content model.
|
|
428
|
+
*/
|
|
429
|
+
icon?: string | null;
|
|
406
430
|
/**
|
|
407
431
|
* Description for the content model.
|
|
408
432
|
*/
|
|
409
|
-
description: string;
|
|
433
|
+
description: string | null;
|
|
410
434
|
/**
|
|
411
435
|
* Date created
|
|
412
436
|
*/
|
|
@@ -418,7 +442,7 @@ export interface CmsModel {
|
|
|
418
442
|
/**
|
|
419
443
|
* CreatedBy object wrapper. Contains id, name and type of the user.
|
|
420
444
|
*/
|
|
421
|
-
createdBy?:
|
|
445
|
+
createdBy?: CmsIdentity;
|
|
422
446
|
/**
|
|
423
447
|
* List of fields defining entry values.
|
|
424
448
|
*/
|
|
@@ -447,6 +471,16 @@ export interface CmsModel {
|
|
|
447
471
|
* It is picked as first available text field. Or user can select own field.
|
|
448
472
|
*/
|
|
449
473
|
titleFieldId: string;
|
|
474
|
+
/**
|
|
475
|
+
* The field which is displayed as the description one.
|
|
476
|
+
* Only way this is null or undefined is that there are no long-text fields to be set as description.
|
|
477
|
+
*/
|
|
478
|
+
descriptionFieldId?: string | null;
|
|
479
|
+
/**
|
|
480
|
+
* The field which is displayed as the image.
|
|
481
|
+
* Only way this is null or undefined is that there are no file fields, with images only set, to be set as image.
|
|
482
|
+
*/
|
|
483
|
+
imageFieldId?: string | null;
|
|
450
484
|
/**
|
|
451
485
|
* The version of Webiny which this record was stored with.
|
|
452
486
|
*/
|
|
@@ -480,6 +514,7 @@ interface CmsModelFieldToGraphQLCreateResolverParams<TField> {
|
|
|
480
514
|
graphQLType: string;
|
|
481
515
|
field: TField;
|
|
482
516
|
createFieldResolvers: any;
|
|
517
|
+
fieldTypePlugins: CmsFieldTypePlugins;
|
|
483
518
|
}
|
|
484
519
|
export interface CmsModelFieldToGraphQLCreateResolver<TField = CmsModelField> {
|
|
485
520
|
(params: CmsModelFieldToGraphQLCreateResolverParams<TField>): GraphQLFieldResolver | {
|
|
@@ -545,24 +580,6 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
545
580
|
* ```
|
|
546
581
|
*/
|
|
547
582
|
isSortable: boolean;
|
|
548
|
-
/**
|
|
549
|
-
* Optional method which creates the storageId.
|
|
550
|
-
* Primary use is for the datetime field, but if users has some specific fields, they can customize the storageId to their needs.
|
|
551
|
-
*
|
|
552
|
-
* ```ts
|
|
553
|
-
* createStorageId: ({field}) => {
|
|
554
|
-
* if (field.settings.type === "time) {
|
|
555
|
-
* return `${field.type}_time@${field.id}`
|
|
556
|
-
* }
|
|
557
|
-
* // use default method
|
|
558
|
-
* return undefined;
|
|
559
|
-
* }
|
|
560
|
-
* ```
|
|
561
|
-
*/
|
|
562
|
-
createStorageId?: (params: {
|
|
563
|
-
model: CmsModel;
|
|
564
|
-
field: TField;
|
|
565
|
-
}) => string | null | undefined;
|
|
566
583
|
/**
|
|
567
584
|
* Read API methods.
|
|
568
585
|
*/
|
|
@@ -579,7 +596,6 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
579
596
|
* ```
|
|
580
597
|
*/
|
|
581
598
|
createGetFilters?(params: {
|
|
582
|
-
model: CmsModel;
|
|
583
599
|
field: TField;
|
|
584
600
|
}): string;
|
|
585
601
|
/**
|
|
@@ -599,7 +615,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
599
615
|
* ```
|
|
600
616
|
*/
|
|
601
617
|
createListFilters?(params: {
|
|
602
|
-
model: CmsModel
|
|
618
|
+
model: Pick<CmsModel, "singularApiName">;
|
|
603
619
|
field: TField;
|
|
604
620
|
plugins: CmsFieldTypePlugins;
|
|
605
621
|
}): string;
|
|
@@ -619,6 +635,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
619
635
|
* ```
|
|
620
636
|
*/
|
|
621
637
|
createTypeField(params: {
|
|
638
|
+
models: CmsModel[];
|
|
622
639
|
model: CmsModel;
|
|
623
640
|
field: TField;
|
|
624
641
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
@@ -679,7 +696,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
679
696
|
* ```
|
|
680
697
|
*/
|
|
681
698
|
createListFilters?: (params: {
|
|
682
|
-
model: CmsModel
|
|
699
|
+
model: Pick<CmsModel, "singularApiName">;
|
|
683
700
|
field: TField;
|
|
684
701
|
plugins: CmsFieldTypePlugins;
|
|
685
702
|
}) => string;
|
|
@@ -719,6 +736,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
719
736
|
* ```
|
|
720
737
|
*/
|
|
721
738
|
createTypeField: (params: {
|
|
739
|
+
models: CmsModel[];
|
|
722
740
|
model: CmsModel;
|
|
723
741
|
field: TField;
|
|
724
742
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
@@ -739,6 +757,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
|
|
|
739
757
|
* ```
|
|
740
758
|
*/
|
|
741
759
|
createInputField: (params: {
|
|
760
|
+
models: CmsModel[];
|
|
742
761
|
model: CmsModel;
|
|
743
762
|
field: TField;
|
|
744
763
|
fieldTypePlugins: CmsFieldTypePlugins;
|
|
@@ -806,7 +825,7 @@ export interface CmsFieldTypePlugins {
|
|
|
806
825
|
*
|
|
807
826
|
* @category General
|
|
808
827
|
*/
|
|
809
|
-
export interface
|
|
828
|
+
export interface CmsIdentity {
|
|
810
829
|
/**
|
|
811
830
|
* ID if the user.
|
|
812
831
|
*/
|
|
@@ -856,7 +875,7 @@ export interface CmsSettingsContext {
|
|
|
856
875
|
/**
|
|
857
876
|
* Get the datetime when content model last changed.
|
|
858
877
|
*/
|
|
859
|
-
getModelLastChange: () => Promise<Date>;
|
|
878
|
+
getModelLastChange: () => Promise<Date | null>;
|
|
860
879
|
}
|
|
861
880
|
export interface OnSystemBeforeInstallTopicParams {
|
|
862
881
|
tenant: string;
|
|
@@ -874,9 +893,7 @@ export interface OnSystemInstallErrorTopicParams {
|
|
|
874
893
|
export declare type CmsSystemContext = {
|
|
875
894
|
getSystemVersion: () => Promise<string | null>;
|
|
876
895
|
setSystemVersion: (version: string) => Promise<void>;
|
|
877
|
-
getReadAPIKey(): Promise<string | null>;
|
|
878
896
|
installSystem: () => Promise<void>;
|
|
879
|
-
upgradeSystem: (version: string) => Promise<boolean>;
|
|
880
897
|
/**
|
|
881
898
|
* Lifecycle events - deprecated
|
|
882
899
|
*/
|
|
@@ -957,7 +974,7 @@ export interface CmsGroup {
|
|
|
957
974
|
/**
|
|
958
975
|
* CreatedBy reference object.
|
|
959
976
|
*/
|
|
960
|
-
createdBy?:
|
|
977
|
+
createdBy?: CmsIdentity;
|
|
961
978
|
/**
|
|
962
979
|
* Date group was created on.
|
|
963
980
|
*/
|
|
@@ -1159,6 +1176,14 @@ export interface CmsModelCreateInput {
|
|
|
1159
1176
|
* Name of the content model.
|
|
1160
1177
|
*/
|
|
1161
1178
|
name: string;
|
|
1179
|
+
/**
|
|
1180
|
+
* Singular name of the content model to be used in the API.
|
|
1181
|
+
*/
|
|
1182
|
+
singularApiName: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* Plural name of the content model to be used in the API.
|
|
1185
|
+
*/
|
|
1186
|
+
pluralApiName: string;
|
|
1162
1187
|
/**
|
|
1163
1188
|
* Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.
|
|
1164
1189
|
*/
|
|
@@ -1191,10 +1216,11 @@ export interface CmsModelCreateInput {
|
|
|
1191
1216
|
*/
|
|
1192
1217
|
tags?: string[];
|
|
1193
1218
|
/**
|
|
1194
|
-
*
|
|
1195
|
-
* It is picked as first available text field. Or user can select own field.
|
|
1219
|
+
* Fields fieldId which are picked to represent the CMS entry.
|
|
1196
1220
|
*/
|
|
1197
|
-
titleFieldId?: string;
|
|
1221
|
+
titleFieldId?: string | null;
|
|
1222
|
+
descriptionFieldId?: string | null;
|
|
1223
|
+
imageFieldId?: string | null;
|
|
1198
1224
|
}
|
|
1199
1225
|
/**
|
|
1200
1226
|
* A GraphQL `params.data` parameter received when creating content model from existing model.
|
|
@@ -1266,7 +1292,7 @@ export interface CmsModelFieldInput {
|
|
|
1266
1292
|
/**
|
|
1267
1293
|
* @see CmsModelField.listValidation
|
|
1268
1294
|
*/
|
|
1269
|
-
listValidation
|
|
1295
|
+
listValidation?: CmsModelFieldValidation[];
|
|
1270
1296
|
/**
|
|
1271
1297
|
* User defined settings.
|
|
1272
1298
|
*/
|
|
@@ -1283,6 +1309,14 @@ export interface CmsModelUpdateInput {
|
|
|
1283
1309
|
* A new content model name.
|
|
1284
1310
|
*/
|
|
1285
1311
|
name?: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* A new singular name of the content model to be used in the API.
|
|
1314
|
+
*/
|
|
1315
|
+
singularApiName?: string;
|
|
1316
|
+
/**
|
|
1317
|
+
* A new plural name of the content model to be used in the API.
|
|
1318
|
+
*/
|
|
1319
|
+
pluralApiName?: string;
|
|
1286
1320
|
/**
|
|
1287
1321
|
* A group we want to move the model to.
|
|
1288
1322
|
*/
|
|
@@ -1307,10 +1341,11 @@ export interface CmsModelUpdateInput {
|
|
|
1307
1341
|
*/
|
|
1308
1342
|
layout: string[][];
|
|
1309
1343
|
/**
|
|
1310
|
-
*
|
|
1311
|
-
* It is picked as first available text field. Or user can select own field.
|
|
1344
|
+
* Fields fieldId which are picked to represent the CMS entry.
|
|
1312
1345
|
*/
|
|
1313
|
-
titleFieldId?: string;
|
|
1346
|
+
titleFieldId?: string | null;
|
|
1347
|
+
descriptionFieldId?: string | null;
|
|
1348
|
+
imageFieldId?: string | null;
|
|
1314
1349
|
}
|
|
1315
1350
|
/**
|
|
1316
1351
|
* A plugin to load a CmsModelManager.
|
|
@@ -1374,11 +1409,15 @@ export interface CmsEntry<T = CmsEntryValues> {
|
|
|
1374
1409
|
/**
|
|
1375
1410
|
* CreatedBy object reference.
|
|
1376
1411
|
*/
|
|
1377
|
-
createdBy:
|
|
1412
|
+
createdBy: CmsIdentity;
|
|
1378
1413
|
/**
|
|
1379
1414
|
* OwnedBy object reference. Can be different from CreatedBy.
|
|
1380
1415
|
*/
|
|
1381
|
-
ownedBy:
|
|
1416
|
+
ownedBy: CmsIdentity;
|
|
1417
|
+
/**
|
|
1418
|
+
* ModifiedBy object reference. Last person who modified the entry.
|
|
1419
|
+
*/
|
|
1420
|
+
modifiedBy?: CmsIdentity | null;
|
|
1382
1421
|
/**
|
|
1383
1422
|
* A string of Date.toISOString() type.
|
|
1384
1423
|
* Populated on creation.
|
|
@@ -1824,12 +1863,12 @@ export interface CmsEntryMeta {
|
|
|
1824
1863
|
export interface OnEntryBeforeCreateTopicParams {
|
|
1825
1864
|
input: CreateCmsEntryInput;
|
|
1826
1865
|
entry: CmsEntry;
|
|
1827
|
-
model:
|
|
1866
|
+
model: CmsModel;
|
|
1828
1867
|
}
|
|
1829
1868
|
export interface OnEntryAfterCreateTopicParams {
|
|
1830
1869
|
input: CreateCmsEntryInput;
|
|
1831
1870
|
entry: CmsEntry;
|
|
1832
|
-
model:
|
|
1871
|
+
model: CmsModel;
|
|
1833
1872
|
storageEntry: CmsEntry;
|
|
1834
1873
|
}
|
|
1835
1874
|
export interface OnEntryCreateErrorTopicParams {
|
|
@@ -1845,13 +1884,13 @@ export interface OnEntryRevisionBeforeCreateTopicParams {
|
|
|
1845
1884
|
input: CreateFromCmsEntryInput;
|
|
1846
1885
|
entry: CmsEntry;
|
|
1847
1886
|
original: CmsEntry;
|
|
1848
|
-
model:
|
|
1887
|
+
model: CmsModel;
|
|
1849
1888
|
}
|
|
1850
1889
|
export interface OnEntryRevisionAfterCreateTopicParams {
|
|
1851
1890
|
input: CreateFromCmsEntryInput;
|
|
1852
1891
|
entry: CmsEntry;
|
|
1853
1892
|
original: CmsEntry;
|
|
1854
|
-
model:
|
|
1893
|
+
model: CmsModel;
|
|
1855
1894
|
storageEntry: CmsEntry;
|
|
1856
1895
|
}
|
|
1857
1896
|
export interface OnEntryCreateRevisionErrorTopicParams {
|
|
@@ -1868,13 +1907,13 @@ export interface OnEntryBeforeUpdateTopicParams {
|
|
|
1868
1907
|
input: UpdateCmsEntryInput;
|
|
1869
1908
|
original: CmsEntry;
|
|
1870
1909
|
entry: CmsEntry;
|
|
1871
|
-
model:
|
|
1910
|
+
model: CmsModel;
|
|
1872
1911
|
}
|
|
1873
1912
|
export interface OnEntryAfterUpdateTopicParams {
|
|
1874
1913
|
input: UpdateCmsEntryInput;
|
|
1875
1914
|
original: CmsEntry;
|
|
1876
1915
|
entry: CmsEntry;
|
|
1877
|
-
model:
|
|
1916
|
+
model: CmsModel;
|
|
1878
1917
|
storageEntry: CmsEntry;
|
|
1879
1918
|
}
|
|
1880
1919
|
export interface OnEntryUpdateErrorTopicParams {
|
|
@@ -1888,45 +1927,45 @@ export interface OnEntryUpdateErrorTopicParams {
|
|
|
1888
1927
|
*/
|
|
1889
1928
|
export interface OnEntryBeforePublishTopicParams {
|
|
1890
1929
|
entry: CmsEntry;
|
|
1891
|
-
model:
|
|
1930
|
+
model: CmsModel;
|
|
1892
1931
|
}
|
|
1893
1932
|
export interface OnEntryAfterPublishTopicParams {
|
|
1894
1933
|
entry: CmsEntry;
|
|
1895
|
-
model:
|
|
1934
|
+
model: CmsModel;
|
|
1896
1935
|
storageEntry: CmsEntry;
|
|
1897
1936
|
}
|
|
1898
1937
|
export interface OnEntryPublishErrorTopicParams {
|
|
1899
1938
|
error: Error;
|
|
1900
1939
|
entry: CmsEntry;
|
|
1901
|
-
model:
|
|
1940
|
+
model: CmsModel;
|
|
1902
1941
|
}
|
|
1903
1942
|
/**
|
|
1904
1943
|
* Republish
|
|
1905
1944
|
*/
|
|
1906
1945
|
export interface OnEntryBeforeRepublishTopicParams {
|
|
1907
1946
|
entry: CmsEntry;
|
|
1908
|
-
model:
|
|
1947
|
+
model: CmsModel;
|
|
1909
1948
|
}
|
|
1910
1949
|
export interface OnEntryAfterRepublishTopicParams {
|
|
1911
1950
|
entry: CmsEntry;
|
|
1912
|
-
model:
|
|
1951
|
+
model: CmsModel;
|
|
1913
1952
|
storageEntry: CmsEntry;
|
|
1914
1953
|
}
|
|
1915
1954
|
export interface OnEntryRepublishErrorTopicParams {
|
|
1916
1955
|
error: Error;
|
|
1917
1956
|
entry: CmsEntry;
|
|
1918
|
-
model:
|
|
1957
|
+
model: CmsModel;
|
|
1919
1958
|
}
|
|
1920
1959
|
/**
|
|
1921
1960
|
* Unpublish
|
|
1922
1961
|
*/
|
|
1923
1962
|
export interface OnEntryBeforeUnpublishTopicParams {
|
|
1924
1963
|
entry: CmsEntry;
|
|
1925
|
-
model:
|
|
1964
|
+
model: CmsModel;
|
|
1926
1965
|
}
|
|
1927
1966
|
export interface OnEntryAfterUnpublishTopicParams {
|
|
1928
1967
|
entry: CmsEntry;
|
|
1929
|
-
model:
|
|
1968
|
+
model: CmsModel;
|
|
1930
1969
|
storageEntry: CmsEntry;
|
|
1931
1970
|
}
|
|
1932
1971
|
export interface OnEntryUnpublishErrorTopicParams {
|
|
@@ -1936,37 +1975,53 @@ export interface OnEntryUnpublishErrorTopicParams {
|
|
|
1936
1975
|
}
|
|
1937
1976
|
export interface OnEntryBeforeDeleteTopicParams {
|
|
1938
1977
|
entry: CmsEntry;
|
|
1939
|
-
model:
|
|
1978
|
+
model: CmsModel;
|
|
1940
1979
|
}
|
|
1941
1980
|
export interface OnEntryAfterDeleteTopicParams {
|
|
1942
1981
|
entry: CmsEntry;
|
|
1943
|
-
model:
|
|
1982
|
+
model: CmsModel;
|
|
1944
1983
|
}
|
|
1945
1984
|
export interface OnEntryDeleteErrorTopicParams {
|
|
1946
1985
|
error: Error;
|
|
1947
1986
|
entry: CmsEntry;
|
|
1948
|
-
model:
|
|
1987
|
+
model: CmsModel;
|
|
1949
1988
|
}
|
|
1950
1989
|
export interface OnEntryRevisionBeforeDeleteTopicParams {
|
|
1951
1990
|
entry: CmsEntry;
|
|
1952
|
-
model:
|
|
1991
|
+
model: CmsModel;
|
|
1953
1992
|
}
|
|
1954
1993
|
export interface OnEntryRevisionAfterDeleteTopicParams {
|
|
1955
1994
|
entry: CmsEntry;
|
|
1956
|
-
model:
|
|
1995
|
+
model: CmsModel;
|
|
1957
1996
|
}
|
|
1958
1997
|
export interface OnEntryRevisionDeleteErrorTopicParams {
|
|
1959
1998
|
error: Error;
|
|
1960
1999
|
entry: CmsEntry;
|
|
1961
|
-
model:
|
|
2000
|
+
model: CmsModel;
|
|
2001
|
+
}
|
|
2002
|
+
export interface OnEntryBeforeDeleteMultipleTopicParams {
|
|
2003
|
+
model: CmsModel;
|
|
2004
|
+
entries: CmsEntry[];
|
|
2005
|
+
ids: string[];
|
|
2006
|
+
}
|
|
2007
|
+
export interface OnEntryAfterDeleteMultipleTopicParams {
|
|
2008
|
+
model: CmsModel;
|
|
2009
|
+
entries: CmsEntry[];
|
|
2010
|
+
ids: string[];
|
|
2011
|
+
}
|
|
2012
|
+
export interface OnEntryDeleteMultipleErrorTopicParams {
|
|
2013
|
+
model: CmsModel;
|
|
2014
|
+
entries: CmsEntry[];
|
|
2015
|
+
ids: string[];
|
|
2016
|
+
error: Error;
|
|
1962
2017
|
}
|
|
1963
2018
|
export interface OnEntryBeforeGetTopicParams {
|
|
1964
|
-
model:
|
|
2019
|
+
model: CmsModel;
|
|
1965
2020
|
where: CmsEntryListWhere;
|
|
1966
2021
|
}
|
|
1967
2022
|
export interface EntryBeforeListTopicParams {
|
|
1968
2023
|
where: CmsEntryListWhere;
|
|
1969
|
-
model:
|
|
2024
|
+
model: CmsModel;
|
|
1970
2025
|
}
|
|
1971
2026
|
/**
|
|
1972
2027
|
* @category Context
|
|
@@ -1990,6 +2045,34 @@ export interface CreateFromCmsEntryInput {
|
|
|
1990
2045
|
export interface UpdateCmsEntryInput {
|
|
1991
2046
|
[key: string]: any;
|
|
1992
2047
|
}
|
|
2048
|
+
/**
|
|
2049
|
+
* @category Context
|
|
2050
|
+
* @category CmsEntry
|
|
2051
|
+
*/
|
|
2052
|
+
export interface GetUniqueFieldValuesParams {
|
|
2053
|
+
where: CmsEntryListWhere;
|
|
2054
|
+
fieldId: string;
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
* @category CmsEntry
|
|
2058
|
+
*/
|
|
2059
|
+
export interface CmsDeleteEntryOptions {
|
|
2060
|
+
/**
|
|
2061
|
+
* Runs the delete commands even if the entry is not found in the DynamoDB.
|
|
2062
|
+
* This is to force clean the entry records that might have been left behind a failed delete.
|
|
2063
|
+
*/
|
|
2064
|
+
force?: boolean;
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* @category Context
|
|
2068
|
+
* @category CmsEntry
|
|
2069
|
+
*/
|
|
2070
|
+
export interface DeleteMultipleEntriesParams {
|
|
2071
|
+
entries: string[];
|
|
2072
|
+
}
|
|
2073
|
+
export declare type DeleteMultipleEntriesResponse = {
|
|
2074
|
+
id: string;
|
|
2075
|
+
}[];
|
|
1993
2076
|
/**
|
|
1994
2077
|
* Cms Entry CRUD methods in the context.
|
|
1995
2078
|
*
|
|
@@ -2000,7 +2083,7 @@ export interface CmsEntryContext {
|
|
|
2000
2083
|
/**
|
|
2001
2084
|
* Get a single content entry for a model.
|
|
2002
2085
|
*/
|
|
2003
|
-
getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry
|
|
2086
|
+
getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry>;
|
|
2004
2087
|
/**
|
|
2005
2088
|
* Get a list of entries for a model by a given ID (revision).
|
|
2006
2089
|
*/
|
|
@@ -2012,15 +2095,15 @@ export interface CmsEntryContext {
|
|
|
2012
2095
|
/**
|
|
2013
2096
|
* List entries for a model. Internal method used by get, listLatest and listPublished.
|
|
2014
2097
|
*/
|
|
2015
|
-
listEntries: (model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
2098
|
+
listEntries: <T = CmsEntryValues>(model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
2016
2099
|
/**
|
|
2017
2100
|
* Lists the latest entries. Used for manage API.
|
|
2018
2101
|
*/
|
|
2019
|
-
listLatestEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
2102
|
+
listLatestEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
2020
2103
|
/**
|
|
2021
2104
|
* List published entries. Used for read API.
|
|
2022
2105
|
*/
|
|
2023
|
-
listPublishedEntries: (model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry[], CmsEntryMeta]>;
|
|
2106
|
+
listPublishedEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
2024
2107
|
/**
|
|
2025
2108
|
* List published entries by IDs.
|
|
2026
2109
|
*/
|
|
@@ -2053,7 +2136,11 @@ export interface CmsEntryContext {
|
|
|
2053
2136
|
/**
|
|
2054
2137
|
* Delete entry with all its revisions.
|
|
2055
2138
|
*/
|
|
2056
|
-
deleteEntry: (model: CmsModel, id: string) => Promise<void>;
|
|
2139
|
+
deleteEntry: (model: CmsModel, id: string, options?: CmsDeleteEntryOptions) => Promise<void>;
|
|
2140
|
+
/**
|
|
2141
|
+
* Delete multiple entries
|
|
2142
|
+
*/
|
|
2143
|
+
deleteMultipleEntries: (model: CmsModel, params: DeleteMultipleEntriesParams) => Promise<DeleteMultipleEntriesResponse>;
|
|
2057
2144
|
/**
|
|
2058
2145
|
* Publish entry.
|
|
2059
2146
|
*/
|
|
@@ -2067,7 +2154,13 @@ export interface CmsEntryContext {
|
|
|
2067
2154
|
*/
|
|
2068
2155
|
getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;
|
|
2069
2156
|
/**
|
|
2070
|
-
*
|
|
2157
|
+
* List all unique values for a given field.
|
|
2158
|
+
*
|
|
2159
|
+
* @internal
|
|
2160
|
+
*/
|
|
2161
|
+
getUniqueFieldValues: (model: CmsModel, params: GetUniqueFieldValuesParams) => Promise<string[]>;
|
|
2162
|
+
/**
|
|
2163
|
+
* Lifecycle events - deprecated.
|
|
2071
2164
|
*/
|
|
2072
2165
|
/**
|
|
2073
2166
|
* @deprecated
|
|
@@ -2413,11 +2506,11 @@ export interface CmsEntryStorageOperationsDeleteRevisionParams<T extends CmsStor
|
|
|
2413
2506
|
latestStorageEntry: T | null;
|
|
2414
2507
|
}
|
|
2415
2508
|
export interface CmsEntryStorageOperationsDeleteParams {
|
|
2416
|
-
/**
|
|
2417
|
-
* Entry that is going to be deleted.
|
|
2418
|
-
*/
|
|
2419
2509
|
entry: CmsEntry;
|
|
2420
2510
|
}
|
|
2511
|
+
export interface CmsEntryStorageOperationsDeleteEntriesParams {
|
|
2512
|
+
entries: string[];
|
|
2513
|
+
}
|
|
2421
2514
|
export interface CmsEntryStorageOperationsPublishParams<T extends CmsStorageEntry = CmsStorageEntry> {
|
|
2422
2515
|
/**
|
|
2423
2516
|
* The modified entry that is going to be saved as published.
|
|
@@ -2439,6 +2532,10 @@ export interface CmsEntryStorageOperationsUnpublishParams<T extends CmsStorageEn
|
|
|
2439
2532
|
*/
|
|
2440
2533
|
storageEntry: T;
|
|
2441
2534
|
}
|
|
2535
|
+
export interface CmsEntryStorageOperationsGetUniqueFieldValuesParams {
|
|
2536
|
+
where: CmsEntryListWhere;
|
|
2537
|
+
fieldId: string;
|
|
2538
|
+
}
|
|
2442
2539
|
export interface CmsEntryStorageOperationsGetByIdsParams {
|
|
2443
2540
|
ids: readonly string[];
|
|
2444
2541
|
}
|
|
@@ -2495,71 +2592,81 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
|
|
|
2495
2592
|
/**
|
|
2496
2593
|
* Get all the entries of the ids.
|
|
2497
2594
|
*/
|
|
2498
|
-
getByIds: (model:
|
|
2595
|
+
getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
|
|
2499
2596
|
/**
|
|
2500
2597
|
* Get all the published entries of the ids.
|
|
2501
2598
|
*/
|
|
2502
|
-
getPublishedByIds: (model:
|
|
2599
|
+
getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
|
|
2503
2600
|
/**
|
|
2504
2601
|
* Get all the latest entries of the ids.
|
|
2505
2602
|
*/
|
|
2506
|
-
getLatestByIds: (model:
|
|
2603
|
+
getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
|
|
2507
2604
|
/**
|
|
2508
2605
|
* Get all revisions of the given entry id.
|
|
2509
2606
|
*/
|
|
2510
|
-
getRevisions: (model:
|
|
2607
|
+
getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
|
|
2511
2608
|
/**
|
|
2512
2609
|
* Get the entry by the given revision id.
|
|
2513
2610
|
*/
|
|
2514
|
-
getRevisionById: (model:
|
|
2611
|
+
getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
|
|
2515
2612
|
/**
|
|
2516
2613
|
* Get the published entry by given entryId.
|
|
2517
2614
|
*/
|
|
2518
|
-
getPublishedRevisionByEntryId: (model:
|
|
2615
|
+
getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
|
|
2519
2616
|
/**
|
|
2520
2617
|
* Get the latest entry by given entryId.
|
|
2521
2618
|
*/
|
|
2522
|
-
getLatestRevisionByEntryId: (model:
|
|
2619
|
+
getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
|
|
2523
2620
|
/**
|
|
2524
2621
|
* Get the revision of the entry before given one.
|
|
2525
2622
|
*/
|
|
2526
|
-
getPreviousRevision: (model:
|
|
2623
|
+
getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
|
|
2527
2624
|
/**
|
|
2528
2625
|
* Gets entry by given params.
|
|
2529
2626
|
*/
|
|
2530
|
-
get: (model:
|
|
2627
|
+
get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
|
|
2531
2628
|
/**
|
|
2532
2629
|
* List all entries. Filterable via params.
|
|
2533
2630
|
*/
|
|
2534
|
-
list: (model:
|
|
2631
|
+
list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
|
|
2535
2632
|
/**
|
|
2536
2633
|
* Create a new entry.
|
|
2537
2634
|
*/
|
|
2538
|
-
create: (model:
|
|
2635
|
+
create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
|
|
2539
2636
|
/**
|
|
2540
2637
|
* Create a new entry from existing one.
|
|
2541
2638
|
*/
|
|
2542
|
-
createRevisionFrom: (model:
|
|
2639
|
+
createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
|
|
2543
2640
|
/**
|
|
2544
2641
|
* Update existing entry.
|
|
2545
2642
|
*/
|
|
2546
|
-
update: (model:
|
|
2643
|
+
update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
|
|
2547
2644
|
/**
|
|
2548
2645
|
* Delete the entry revision.
|
|
2549
2646
|
*/
|
|
2550
|
-
deleteRevision: (model:
|
|
2647
|
+
deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
|
|
2551
2648
|
/**
|
|
2552
2649
|
* Delete the entry.
|
|
2553
2650
|
*/
|
|
2554
|
-
delete: (model:
|
|
2651
|
+
delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
|
|
2652
|
+
/**
|
|
2653
|
+
* Delete multiple entries, with a limit on how much can be deleted in one call.
|
|
2654
|
+
*/
|
|
2655
|
+
deleteMultipleEntries: (model: CmsModel, params: CmsEntryStorageOperationsDeleteEntriesParams) => Promise<void>;
|
|
2555
2656
|
/**
|
|
2556
2657
|
* Publish the entry.
|
|
2557
2658
|
*/
|
|
2558
|
-
publish: (model:
|
|
2659
|
+
publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
|
|
2559
2660
|
/**
|
|
2560
2661
|
* Unpublish the entry.
|
|
2561
2662
|
*/
|
|
2562
|
-
unpublish: (model:
|
|
2663
|
+
unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
|
|
2664
|
+
/**
|
|
2665
|
+
* Method to list all the unique values for the given field id.
|
|
2666
|
+
* Simplest use case would be to aggregate tags for some content.
|
|
2667
|
+
* @internal
|
|
2668
|
+
*/
|
|
2669
|
+
getUniqueFieldValues: (model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams) => Promise<string[]>;
|
|
2563
2670
|
}
|
|
2564
2671
|
export declare enum CONTENT_ENTRY_STATUS {
|
|
2565
2672
|
DRAFT = "draft",
|
|
@@ -2631,11 +2738,7 @@ export interface HeadlessCmsStorageOperations<C = CmsContext> {
|
|
|
2631
2738
|
/**
|
|
2632
2739
|
* Either attach something from the storage operations or run something in it.
|
|
2633
2740
|
*/
|
|
2634
|
-
beforeInit
|
|
2741
|
+
beforeInit: (context: C) => Promise<void>;
|
|
2635
2742
|
init?: (context: C) => Promise<void>;
|
|
2636
|
-
/**
|
|
2637
|
-
* An upgrade to run if necessary.
|
|
2638
|
-
*/
|
|
2639
|
-
upgrade?: UpgradePlugin | null;
|
|
2640
2743
|
}
|
|
2641
2744
|
export {};
|