@webiny/api-headless-cms 0.0.0-unstable.7f63ea0744 → 0.0.0-unstable.8acc9e8892

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/context.js +47 -43
  2. package/context.js.map +1 -1
  3. package/crud/contentEntry/markLockedFields.d.ts +1 -1
  4. package/crud/contentEntry/markLockedFields.js +13 -2
  5. package/crud/contentEntry/markLockedFields.js.map +1 -1
  6. package/crud/contentEntry/referenceFieldsMapping.js +34 -5
  7. package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
  8. package/crud/contentEntry.crud.d.ts +5 -2
  9. package/crud/contentEntry.crud.js +848 -830
  10. package/crud/contentEntry.crud.js.map +1 -1
  11. package/crud/contentModel/beforeCreate.js +39 -76
  12. package/crud/contentModel/beforeCreate.js.map +1 -1
  13. package/crud/contentModel/beforeDelete.d.ts +1 -1
  14. package/crud/contentModel/beforeDelete.js +1 -5
  15. package/crud/contentModel/beforeDelete.js.map +1 -1
  16. package/crud/contentModel/beforeUpdate.js +31 -3
  17. package/crud/contentModel/beforeUpdate.js.map +1 -1
  18. package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
  19. package/crud/contentModel/compatibility/modelApiName.js +24 -0
  20. package/crud/contentModel/compatibility/modelApiName.js.map +1 -0
  21. package/crud/contentModel/createFieldModels.d.ts +2 -0
  22. package/crud/contentModel/createFieldModels.js +26 -0
  23. package/crud/contentModel/createFieldModels.js.map +1 -0
  24. package/crud/contentModel/defaultFields.d.ts +5 -0
  25. package/crud/contentModel/defaultFields.js +58 -0
  26. package/crud/contentModel/defaultFields.js.map +1 -0
  27. package/crud/contentModel/fieldIdValidation.d.ts +1 -0
  28. package/crud/contentModel/fieldIdValidation.js +25 -0
  29. package/crud/contentModel/fieldIdValidation.js.map +1 -0
  30. package/crud/contentModel/fields/descriptionField.d.ts +2 -0
  31. package/crud/contentModel/fields/descriptionField.js +42 -0
  32. package/crud/contentModel/fields/descriptionField.js.map +1 -0
  33. package/crud/contentModel/fields/imageField.d.ts +2 -0
  34. package/crud/contentModel/fields/imageField.js +46 -0
  35. package/crud/contentModel/fields/imageField.js.map +1 -0
  36. package/crud/contentModel/fields/titleField.d.ts +2 -0
  37. package/crud/contentModel/fields/titleField.js +58 -0
  38. package/crud/contentModel/fields/titleField.js.map +1 -0
  39. package/crud/contentModel/idValidation.d.ts +1 -0
  40. package/crud/contentModel/idValidation.js +22 -0
  41. package/crud/contentModel/idValidation.js.map +1 -0
  42. package/crud/contentModel/models.d.ts +4 -0
  43. package/crud/contentModel/models.js +192 -0
  44. package/crud/contentModel/models.js.map +1 -0
  45. package/crud/contentModel/systemFields.js.map +1 -1
  46. package/crud/contentModel/validate/endingAllowed.d.ts +6 -0
  47. package/crud/contentModel/validate/endingAllowed.js +26 -0
  48. package/crud/contentModel/validate/endingAllowed.js.map +1 -0
  49. package/crud/contentModel/validate/isModelEndingAllowed.d.ts +6 -0
  50. package/crud/contentModel/validate/isModelEndingAllowed.js +24 -0
  51. package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -0
  52. package/crud/contentModel/validate/modelId.d.ts +11 -0
  53. package/crud/contentModel/validate/modelId.js +36 -0
  54. package/crud/contentModel/validate/modelId.js.map +1 -0
  55. package/crud/contentModel/validate/pluralApiName.d.ts +7 -0
  56. package/crud/contentModel/validate/pluralApiName.js +24 -0
  57. package/crud/contentModel/validate/pluralApiName.js.map +1 -0
  58. package/crud/contentModel/validate/singularApiName.d.ts +7 -0
  59. package/crud/contentModel/validate/singularApiName.js +24 -0
  60. package/crud/contentModel/validate/singularApiName.js.map +1 -0
  61. package/crud/contentModel/validateModel.d.ts +1 -0
  62. package/crud/contentModel/validateModel.js.map +1 -1
  63. package/crud/contentModel/validateModelFields.d.ts +2 -1
  64. package/crud/contentModel/validateModelFields.js +29 -56
  65. package/crud/contentModel/validateModelFields.js.map +1 -1
  66. package/crud/contentModel/validation.d.ts +195 -121
  67. package/crud/contentModel/validation.js +61 -13
  68. package/crud/contentModel/validation.js.map +1 -1
  69. package/crud/contentModel.crud.js +346 -285
  70. package/crud/contentModel.crud.js.map +1 -1
  71. package/crud/contentModelGroup/validation.d.ts +4 -4
  72. package/crud/contentModelGroup.crud.js +170 -142
  73. package/crud/contentModelGroup.crud.js.map +1 -1
  74. package/crud/settings.crud.d.ts +1 -1
  75. package/crud/settings.crud.js +5 -10
  76. package/crud/settings.crud.js.map +1 -1
  77. package/crud/system.crud.js +0 -60
  78. package/crud/system.crud.js.map +1 -1
  79. package/graphql/checkEndpointAccess.d.ts +2 -0
  80. package/graphql/checkEndpointAccess.js +18 -0
  81. package/graphql/checkEndpointAccess.js.map +1 -0
  82. package/graphql/createExecutableSchema.d.ts +2 -3
  83. package/graphql/createExecutableSchema.js.map +1 -1
  84. package/graphql/createRequestBody.d.ts +2 -0
  85. package/graphql/createRequestBody.js +14 -0
  86. package/graphql/createRequestBody.js.map +1 -0
  87. package/graphql/formatErrorPayload.d.ts +1 -0
  88. package/graphql/formatErrorPayload.js +25 -0
  89. package/graphql/formatErrorPayload.js.map +1 -0
  90. package/graphql/generateSchema.js.map +1 -1
  91. package/graphql/getSchema.d.ts +17 -0
  92. package/graphql/getSchema.js +102 -0
  93. package/graphql/getSchema.js.map +1 -0
  94. package/graphql/graphQLHandlerFactory.js +6 -145
  95. package/graphql/graphQLHandlerFactory.js.map +1 -1
  96. package/graphql/handleRequest.d.ts +11 -0
  97. package/graphql/handleRequest.js +81 -0
  98. package/graphql/handleRequest.js.map +1 -0
  99. package/graphql/index.d.ts +1 -1
  100. package/graphql/schema/baseContentSchema.js +4 -8
  101. package/graphql/schema/baseContentSchema.js.map +1 -1
  102. package/graphql/schema/contentEntries.js +90 -53
  103. package/graphql/schema/contentEntries.js.map +1 -1
  104. package/graphql/schema/contentModelGroups.js +7 -7
  105. package/graphql/schema/contentModelGroups.js.map +1 -1
  106. package/graphql/schema/contentModels.js +23 -4
  107. package/graphql/schema/contentModels.js.map +1 -1
  108. package/graphql/schema/createFieldResolvers.js +2 -1
  109. package/graphql/schema/createFieldResolvers.js.map +1 -1
  110. package/graphql/schema/createManageResolvers.d.ts +1 -1
  111. package/graphql/schema/createManageResolvers.js +33 -17
  112. package/graphql/schema/createManageResolvers.js.map +1 -1
  113. package/graphql/schema/createManageSDL.d.ts +1 -0
  114. package/graphql/schema/createManageSDL.js +55 -49
  115. package/graphql/schema/createManageSDL.js.map +1 -1
  116. package/graphql/schema/createPreviewResolvers.js +3 -7
  117. package/graphql/schema/createPreviewResolvers.js.map +1 -1
  118. package/graphql/schema/createReadResolvers.js +4 -8
  119. package/graphql/schema/createReadResolvers.js.map +1 -1
  120. package/graphql/schema/createReadSDL.d.ts +1 -0
  121. package/graphql/schema/createReadSDL.js +24 -22
  122. package/graphql/schema/createReadSDL.js.map +1 -1
  123. package/graphql/schema/resolvers/commonFieldResolvers.d.ts +3 -2
  124. package/graphql/schema/resolvers/commonFieldResolvers.js +2 -1
  125. package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -1
  126. package/graphql/schema/schemaPlugins.js +12 -12
  127. package/graphql/schema/schemaPlugins.js.map +1 -1
  128. package/graphql/system.js +0 -16
  129. package/graphql/system.js.map +1 -1
  130. package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +1 -1
  131. package/graphqlFields/dynamicZone/dynamicZoneField.js +54 -19
  132. package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
  133. package/graphqlFields/object.js +21 -2
  134. package/graphqlFields/object.js.map +1 -1
  135. package/graphqlFields/ref.js +42 -14
  136. package/graphqlFields/ref.js.map +1 -1
  137. package/index.d.ts +4 -2
  138. package/index.js +25 -2
  139. package/index.js.map +1 -1
  140. package/package.json +22 -23
  141. package/plugins/CmsModelPlugin.d.ts +21 -3
  142. package/plugins/CmsModelPlugin.js +28 -2
  143. package/plugins/CmsModelPlugin.js.map +1 -1
  144. package/plugins/StorageOperationsCmsModelPlugin.d.ts +23 -0
  145. package/plugins/StorageOperationsCmsModelPlugin.js +42 -0
  146. package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -0
  147. package/plugins/index.d.ts +1 -0
  148. package/plugins/index.js +11 -0
  149. package/plugins/index.js.map +1 -1
  150. package/types.d.ts +121 -67
  151. package/types.js +1 -1
  152. package/types.js.map +1 -1
  153. package/upgrades/5.33.0/index.js +26 -3
  154. package/upgrades/5.33.0/index.js.map +1 -1
  155. package/upgrades/index.js +3 -0
  156. package/upgrades/index.js.map +1 -1
  157. package/utils/converters/valueKeyStorageConverter.d.ts +1 -5
  158. package/utils/converters/valueKeyStorageConverter.js +21 -18
  159. package/utils/converters/valueKeyStorageConverter.js.map +1 -1
  160. package/utils/createTypeFromFields.d.ts +1 -0
  161. package/utils/createTypeFromFields.js +7 -5
  162. package/utils/createTypeFromFields.js.map +1 -1
  163. package/utils/createTypeName.d.ts +0 -2
  164. package/utils/createTypeName.js +2 -10
  165. package/utils/createTypeName.js.map +1 -1
  166. package/utils/getEntryDescription.d.ts +2 -0
  167. package/utils/getEntryDescription.js +17 -0
  168. package/utils/getEntryDescription.js.map +1 -0
  169. package/utils/getEntryImage.d.ts +2 -0
  170. package/utils/getEntryImage.js +17 -0
  171. package/utils/getEntryImage.js.map +1 -0
  172. package/utils/incrementEntryIdVersion.d.ts +5 -0
  173. package/utils/incrementEntryIdVersion.js +29 -0
  174. package/utils/incrementEntryIdVersion.js.map +1 -0
  175. package/utils/ownership.d.ts +3 -3
  176. package/utils/ownership.js.map +1 -1
  177. package/utils/pluralizedTypeName.js +6 -0
  178. package/utils/pluralizedTypeName.js.map +1 -1
  179. package/utils/renderFields.d.ts +2 -1
  180. package/utils/renderFields.js +8 -1
  181. package/utils/renderFields.js.map +1 -1
  182. package/utils/renderInputFields.d.ts +2 -1
  183. package/utils/renderInputFields.js +4 -0
  184. package/utils/renderInputFields.js.map +1 -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: "boolean" | "datetime" | "file" | "long-text" | "number" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
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@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
- * Cms Model defining an entry.
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?: 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 | {
@@ -619,6 +654,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
619
654
  * ```
620
655
  */
621
656
  createTypeField(params: {
657
+ models: CmsModel[];
622
658
  model: CmsModel;
623
659
  field: TField;
624
660
  fieldTypePlugins: CmsFieldTypePlugins;
@@ -719,6 +755,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
719
755
  * ```
720
756
  */
721
757
  createTypeField: (params: {
758
+ models: CmsModel[];
722
759
  model: CmsModel;
723
760
  field: TField;
724
761
  fieldTypePlugins: CmsFieldTypePlugins;
@@ -739,6 +776,7 @@ export interface CmsModelFieldToGraphQLPlugin<TField extends CmsModelField = Cms
739
776
  * ```
740
777
  */
741
778
  createInputField: (params: {
779
+ models: CmsModel[];
742
780
  model: CmsModel;
743
781
  field: TField;
744
782
  fieldTypePlugins: CmsFieldTypePlugins;
@@ -806,7 +844,7 @@ export interface CmsFieldTypePlugins {
806
844
  *
807
845
  * @category General
808
846
  */
809
- export interface CreatedBy {
847
+ export interface CmsIdentity {
810
848
  /**
811
849
  * ID if the user.
812
850
  */
@@ -856,7 +894,7 @@ export interface CmsSettingsContext {
856
894
  /**
857
895
  * Get the datetime when content model last changed.
858
896
  */
859
- getModelLastChange: () => Promise<Date>;
897
+ getModelLastChange: () => Promise<Date | null>;
860
898
  }
861
899
  export interface OnSystemBeforeInstallTopicParams {
862
900
  tenant: string;
@@ -874,9 +912,7 @@ export interface OnSystemInstallErrorTopicParams {
874
912
  export declare type CmsSystemContext = {
875
913
  getSystemVersion: () => Promise<string | null>;
876
914
  setSystemVersion: (version: string) => Promise<void>;
877
- getReadAPIKey(): Promise<string | null>;
878
915
  installSystem: () => Promise<void>;
879
- upgradeSystem: (version: string) => Promise<boolean>;
880
916
  /**
881
917
  * Lifecycle events - deprecated
882
918
  */
@@ -957,7 +993,7 @@ export interface CmsGroup {
957
993
  /**
958
994
  * CreatedBy reference object.
959
995
  */
960
- createdBy?: CreatedBy;
996
+ createdBy?: CmsIdentity;
961
997
  /**
962
998
  * Date group was created on.
963
999
  */
@@ -1159,6 +1195,14 @@ export interface CmsModelCreateInput {
1159
1195
  * Name of the content model.
1160
1196
  */
1161
1197
  name: string;
1198
+ /**
1199
+ * Singular name of the content model to be used in the API.
1200
+ */
1201
+ singularApiName: string;
1202
+ /**
1203
+ * Plural name of the content model to be used in the API.
1204
+ */
1205
+ pluralApiName: string;
1162
1206
  /**
1163
1207
  * Unique ID of the content model. Created from name if not sent by the user. Cannot be changed.
1164
1208
  */
@@ -1191,10 +1235,11 @@ export interface CmsModelCreateInput {
1191
1235
  */
1192
1236
  tags?: string[];
1193
1237
  /**
1194
- * The field that is being displayed as entry title.
1195
- * It is picked as first available text field. Or user can select own field.
1238
+ * Fields fieldId which are picked to represent the CMS entry.
1196
1239
  */
1197
- titleFieldId?: string;
1240
+ titleFieldId?: string | null;
1241
+ descriptionFieldId?: string | null;
1242
+ imageFieldId?: string | null;
1198
1243
  }
1199
1244
  /**
1200
1245
  * A GraphQL `params.data` parameter received when creating content model from existing model.
@@ -1266,7 +1311,7 @@ export interface CmsModelFieldInput {
1266
1311
  /**
1267
1312
  * @see CmsModelField.listValidation
1268
1313
  */
1269
- listValidation: CmsModelFieldValidation[];
1314
+ listValidation?: CmsModelFieldValidation[];
1270
1315
  /**
1271
1316
  * User defined settings.
1272
1317
  */
@@ -1283,6 +1328,14 @@ export interface CmsModelUpdateInput {
1283
1328
  * A new content model name.
1284
1329
  */
1285
1330
  name?: string;
1331
+ /**
1332
+ * A new singular name of the content model to be used in the API.
1333
+ */
1334
+ singularApiName?: string;
1335
+ /**
1336
+ * A new plural name of the content model to be used in the API.
1337
+ */
1338
+ pluralApiName?: string;
1286
1339
  /**
1287
1340
  * A group we want to move the model to.
1288
1341
  */
@@ -1307,10 +1360,11 @@ export interface CmsModelUpdateInput {
1307
1360
  */
1308
1361
  layout: string[][];
1309
1362
  /**
1310
- * The field that is being displayed as entry title.
1311
- * It is picked as first available text field. Or user can select own field.
1363
+ * Fields fieldId which are picked to represent the CMS entry.
1312
1364
  */
1313
- titleFieldId?: string;
1365
+ titleFieldId?: string | null;
1366
+ descriptionFieldId?: string | null;
1367
+ imageFieldId?: string | null;
1314
1368
  }
1315
1369
  /**
1316
1370
  * A plugin to load a CmsModelManager.
@@ -1374,11 +1428,15 @@ export interface CmsEntry<T = CmsEntryValues> {
1374
1428
  /**
1375
1429
  * CreatedBy object reference.
1376
1430
  */
1377
- createdBy: CreatedBy;
1431
+ createdBy: CmsIdentity;
1378
1432
  /**
1379
1433
  * OwnedBy object reference. Can be different from CreatedBy.
1380
1434
  */
1381
- ownedBy: CreatedBy;
1435
+ ownedBy: CmsIdentity;
1436
+ /**
1437
+ * ModifiedBy object reference. Last person who modified the entry.
1438
+ */
1439
+ modifiedBy?: CmsIdentity | null;
1382
1440
  /**
1383
1441
  * A string of Date.toISOString() type.
1384
1442
  * Populated on creation.
@@ -1824,12 +1882,12 @@ export interface CmsEntryMeta {
1824
1882
  export interface OnEntryBeforeCreateTopicParams {
1825
1883
  input: CreateCmsEntryInput;
1826
1884
  entry: CmsEntry;
1827
- model: StorageOperationsCmsModel;
1885
+ model: CmsModel;
1828
1886
  }
1829
1887
  export interface OnEntryAfterCreateTopicParams {
1830
1888
  input: CreateCmsEntryInput;
1831
1889
  entry: CmsEntry;
1832
- model: StorageOperationsCmsModel;
1890
+ model: CmsModel;
1833
1891
  storageEntry: CmsEntry;
1834
1892
  }
1835
1893
  export interface OnEntryCreateErrorTopicParams {
@@ -1845,13 +1903,13 @@ export interface OnEntryRevisionBeforeCreateTopicParams {
1845
1903
  input: CreateFromCmsEntryInput;
1846
1904
  entry: CmsEntry;
1847
1905
  original: CmsEntry;
1848
- model: StorageOperationsCmsModel;
1906
+ model: CmsModel;
1849
1907
  }
1850
1908
  export interface OnEntryRevisionAfterCreateTopicParams {
1851
1909
  input: CreateFromCmsEntryInput;
1852
1910
  entry: CmsEntry;
1853
1911
  original: CmsEntry;
1854
- model: StorageOperationsCmsModel;
1912
+ model: CmsModel;
1855
1913
  storageEntry: CmsEntry;
1856
1914
  }
1857
1915
  export interface OnEntryCreateRevisionErrorTopicParams {
@@ -1868,13 +1926,13 @@ export interface OnEntryBeforeUpdateTopicParams {
1868
1926
  input: UpdateCmsEntryInput;
1869
1927
  original: CmsEntry;
1870
1928
  entry: CmsEntry;
1871
- model: StorageOperationsCmsModel;
1929
+ model: CmsModel;
1872
1930
  }
1873
1931
  export interface OnEntryAfterUpdateTopicParams {
1874
1932
  input: UpdateCmsEntryInput;
1875
1933
  original: CmsEntry;
1876
1934
  entry: CmsEntry;
1877
- model: StorageOperationsCmsModel;
1935
+ model: CmsModel;
1878
1936
  storageEntry: CmsEntry;
1879
1937
  }
1880
1938
  export interface OnEntryUpdateErrorTopicParams {
@@ -1888,45 +1946,45 @@ export interface OnEntryUpdateErrorTopicParams {
1888
1946
  */
1889
1947
  export interface OnEntryBeforePublishTopicParams {
1890
1948
  entry: CmsEntry;
1891
- model: StorageOperationsCmsModel;
1949
+ model: CmsModel;
1892
1950
  }
1893
1951
  export interface OnEntryAfterPublishTopicParams {
1894
1952
  entry: CmsEntry;
1895
- model: StorageOperationsCmsModel;
1953
+ model: CmsModel;
1896
1954
  storageEntry: CmsEntry;
1897
1955
  }
1898
1956
  export interface OnEntryPublishErrorTopicParams {
1899
1957
  error: Error;
1900
1958
  entry: CmsEntry;
1901
- model: StorageOperationsCmsModel;
1959
+ model: CmsModel;
1902
1960
  }
1903
1961
  /**
1904
1962
  * Republish
1905
1963
  */
1906
1964
  export interface OnEntryBeforeRepublishTopicParams {
1907
1965
  entry: CmsEntry;
1908
- model: StorageOperationsCmsModel;
1966
+ model: CmsModel;
1909
1967
  }
1910
1968
  export interface OnEntryAfterRepublishTopicParams {
1911
1969
  entry: CmsEntry;
1912
- model: StorageOperationsCmsModel;
1970
+ model: CmsModel;
1913
1971
  storageEntry: CmsEntry;
1914
1972
  }
1915
1973
  export interface OnEntryRepublishErrorTopicParams {
1916
1974
  error: Error;
1917
1975
  entry: CmsEntry;
1918
- model: StorageOperationsCmsModel;
1976
+ model: CmsModel;
1919
1977
  }
1920
1978
  /**
1921
1979
  * Unpublish
1922
1980
  */
1923
1981
  export interface OnEntryBeforeUnpublishTopicParams {
1924
1982
  entry: CmsEntry;
1925
- model: StorageOperationsCmsModel;
1983
+ model: CmsModel;
1926
1984
  }
1927
1985
  export interface OnEntryAfterUnpublishTopicParams {
1928
1986
  entry: CmsEntry;
1929
- model: StorageOperationsCmsModel;
1987
+ model: CmsModel;
1930
1988
  storageEntry: CmsEntry;
1931
1989
  }
1932
1990
  export interface OnEntryUnpublishErrorTopicParams {
@@ -1936,37 +1994,37 @@ export interface OnEntryUnpublishErrorTopicParams {
1936
1994
  }
1937
1995
  export interface OnEntryBeforeDeleteTopicParams {
1938
1996
  entry: CmsEntry;
1939
- model: StorageOperationsCmsModel;
1997
+ model: CmsModel;
1940
1998
  }
1941
1999
  export interface OnEntryAfterDeleteTopicParams {
1942
2000
  entry: CmsEntry;
1943
- model: StorageOperationsCmsModel;
2001
+ model: CmsModel;
1944
2002
  }
1945
2003
  export interface OnEntryDeleteErrorTopicParams {
1946
2004
  error: Error;
1947
2005
  entry: CmsEntry;
1948
- model: StorageOperationsCmsModel;
2006
+ model: CmsModel;
1949
2007
  }
1950
2008
  export interface OnEntryRevisionBeforeDeleteTopicParams {
1951
2009
  entry: CmsEntry;
1952
- model: StorageOperationsCmsModel;
2010
+ model: CmsModel;
1953
2011
  }
1954
2012
  export interface OnEntryRevisionAfterDeleteTopicParams {
1955
2013
  entry: CmsEntry;
1956
- model: StorageOperationsCmsModel;
2014
+ model: CmsModel;
1957
2015
  }
1958
2016
  export interface OnEntryRevisionDeleteErrorTopicParams {
1959
2017
  error: Error;
1960
2018
  entry: CmsEntry;
1961
- model: StorageOperationsCmsModel;
2019
+ model: CmsModel;
1962
2020
  }
1963
2021
  export interface OnEntryBeforeGetTopicParams {
1964
- model: StorageOperationsCmsModel;
2022
+ model: CmsModel;
1965
2023
  where: CmsEntryListWhere;
1966
2024
  }
1967
2025
  export interface EntryBeforeListTopicParams {
1968
2026
  where: CmsEntryListWhere;
1969
- model: StorageOperationsCmsModel;
2027
+ model: CmsModel;
1970
2028
  }
1971
2029
  /**
1972
2030
  * @category Context
@@ -2495,71 +2553,71 @@ export interface CmsEntryStorageOperations<T extends CmsStorageEntry = CmsStorag
2495
2553
  /**
2496
2554
  * Get all the entries of the ids.
2497
2555
  */
2498
- getByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2556
+ getByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetByIdsParams) => Promise<T[]>;
2499
2557
  /**
2500
2558
  * Get all the published entries of the ids.
2501
2559
  */
2502
- getPublishedByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2560
+ getPublishedByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedByIdsParams) => Promise<T[]>;
2503
2561
  /**
2504
2562
  * Get all the latest entries of the ids.
2505
2563
  */
2506
- getLatestByIds: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2564
+ getLatestByIds: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestByIdsParams) => Promise<T[]>;
2507
2565
  /**
2508
2566
  * Get all revisions of the given entry id.
2509
2567
  */
2510
- getRevisions: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2568
+ getRevisions: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionsParams) => Promise<T[]>;
2511
2569
  /**
2512
2570
  * Get the entry by the given revision id.
2513
2571
  */
2514
- getRevisionById: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2572
+ getRevisionById: (model: CmsModel, params: CmsEntryStorageOperationsGetRevisionParams) => Promise<T | null>;
2515
2573
  /**
2516
2574
  * Get the published entry by given entryId.
2517
2575
  */
2518
- getPublishedRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2576
+ getPublishedRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetPublishedRevisionParams) => Promise<T | null>;
2519
2577
  /**
2520
2578
  * Get the latest entry by given entryId.
2521
2579
  */
2522
- getLatestRevisionByEntryId: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2580
+ getLatestRevisionByEntryId: (model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams) => Promise<T | null>;
2523
2581
  /**
2524
2582
  * Get the revision of the entry before given one.
2525
2583
  */
2526
- getPreviousRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2584
+ getPreviousRevision: (model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams) => Promise<T | null>;
2527
2585
  /**
2528
2586
  * Gets entry by given params.
2529
2587
  */
2530
- get: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2588
+ get: (model: CmsModel, params: CmsEntryStorageOperationsGetParams) => Promise<T | null>;
2531
2589
  /**
2532
2590
  * List all entries. Filterable via params.
2533
2591
  */
2534
- list: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2592
+ list: (model: CmsModel, params: CmsEntryStorageOperationsListParams) => Promise<CmsEntryStorageOperationsListResponse<T>>;
2535
2593
  /**
2536
2594
  * Create a new entry.
2537
2595
  */
2538
- create: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2596
+ create: (model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>) => Promise<T>;
2539
2597
  /**
2540
2598
  * Create a new entry from existing one.
2541
2599
  */
2542
- createRevisionFrom: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2600
+ createRevisionFrom: (model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>) => Promise<T>;
2543
2601
  /**
2544
2602
  * Update existing entry.
2545
2603
  */
2546
- update: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2604
+ update: (model: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>) => Promise<T>;
2547
2605
  /**
2548
2606
  * Delete the entry revision.
2549
2607
  */
2550
- deleteRevision: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2608
+ deleteRevision: (model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>) => Promise<void>;
2551
2609
  /**
2552
2610
  * Delete the entry.
2553
2611
  */
2554
- delete: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2612
+ delete: (model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) => Promise<void>;
2555
2613
  /**
2556
2614
  * Publish the entry.
2557
2615
  */
2558
- publish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2616
+ publish: (model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>) => Promise<T>;
2559
2617
  /**
2560
2618
  * Unpublish the entry.
2561
2619
  */
2562
- unpublish: (model: StorageOperationsCmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2620
+ unpublish: (model: CmsModel, params: CmsEntryStorageOperationsUnpublishParams<T>) => Promise<T>;
2563
2621
  }
2564
2622
  export declare enum CONTENT_ENTRY_STATUS {
2565
2623
  DRAFT = "draft",
@@ -2631,11 +2689,7 @@ export interface HeadlessCmsStorageOperations<C = CmsContext> {
2631
2689
  /**
2632
2690
  * Either attach something from the storage operations or run something in it.
2633
2691
  */
2634
- beforeInit?: (context: C) => Promise<void>;
2692
+ beforeInit: (context: C) => Promise<void>;
2635
2693
  init?: (context: C) => Promise<void>;
2636
- /**
2637
- * An upgrade to run if necessary.
2638
- */
2639
- upgrade?: UpgradePlugin | null;
2640
2694
  }
2641
2695
  export {};
package/types.js CHANGED
@@ -72,7 +72,7 @@ exports.CONTENT_ENTRY_STATUS = void 0;
72
72
  * @category CmsModel
73
73
  */
74
74
  /**
75
- * Cms Model defining an entry.
75
+ * Base CMS Model. Should not be exported and used outside of this package.
76
76
  *
77
77
  * @category Database model
78
78
  * @category CmsModel