@webiny/api-headless-cms 0.0.0-unstable.d65ec29d44 → 0.0.0-unstable.da99e0b846

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