@datocms/cma-client 3.3.8 → 3.3.9

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 (46) hide show
  1. package/dist/cjs/generated/Client.js +1 -1
  2. package/dist/cjs/generated/resources/ItemType.js +17 -0
  3. package/dist/cjs/generated/resources/ItemType.js.map +1 -1
  4. package/dist/cjs/generated/resources/MenuItem.js +36 -0
  5. package/dist/cjs/generated/resources/MenuItem.js.map +1 -1
  6. package/dist/cjs/generated/resources/SchemaMenuItem.js +36 -0
  7. package/dist/cjs/generated/resources/SchemaMenuItem.js.map +1 -1
  8. package/dist/cjs/generated/resources/UploadCollection.js +36 -0
  9. package/dist/cjs/generated/resources/UploadCollection.js.map +1 -1
  10. package/dist/cjs/generated/resources/WebhookCall.js +4 -4
  11. package/dist/cjs/generated/resources/WebhookCall.js.map +1 -1
  12. package/dist/esm/generated/Client.js +1 -1
  13. package/dist/esm/generated/SchemaTypes.d.ts +212 -36
  14. package/dist/esm/generated/SimpleSchemaTypes.d.ts +243 -148
  15. package/dist/esm/generated/resources/ItemType.d.ts +11 -0
  16. package/dist/esm/generated/resources/ItemType.js +17 -0
  17. package/dist/esm/generated/resources/ItemType.js.map +1 -1
  18. package/dist/esm/generated/resources/MenuItem.d.ts +22 -0
  19. package/dist/esm/generated/resources/MenuItem.js +36 -0
  20. package/dist/esm/generated/resources/MenuItem.js.map +1 -1
  21. package/dist/esm/generated/resources/SchemaMenuItem.d.ts +22 -0
  22. package/dist/esm/generated/resources/SchemaMenuItem.js +36 -0
  23. package/dist/esm/generated/resources/SchemaMenuItem.js.map +1 -1
  24. package/dist/esm/generated/resources/UploadCollection.d.ts +22 -0
  25. package/dist/esm/generated/resources/UploadCollection.js +36 -0
  26. package/dist/esm/generated/resources/UploadCollection.js.map +1 -1
  27. package/dist/esm/generated/resources/WebhookCall.d.ts +2 -2
  28. package/dist/esm/generated/resources/WebhookCall.js +4 -4
  29. package/dist/esm/generated/resources/WebhookCall.js.map +1 -1
  30. package/dist/types/generated/SchemaTypes.d.ts +212 -36
  31. package/dist/types/generated/SimpleSchemaTypes.d.ts +243 -148
  32. package/dist/types/generated/resources/ItemType.d.ts +11 -0
  33. package/dist/types/generated/resources/MenuItem.d.ts +22 -0
  34. package/dist/types/generated/resources/SchemaMenuItem.d.ts +22 -0
  35. package/dist/types/generated/resources/UploadCollection.d.ts +22 -0
  36. package/dist/types/generated/resources/WebhookCall.d.ts +2 -2
  37. package/package.json +2 -2
  38. package/resources.json +92 -4
  39. package/src/generated/Client.ts +1 -1
  40. package/src/generated/SchemaTypes.ts +229 -38
  41. package/src/generated/SimpleSchemaTypes.ts +247 -149
  42. package/src/generated/resources/ItemType.ts +22 -0
  43. package/src/generated/resources/MenuItem.ts +44 -0
  44. package/src/generated/resources/SchemaMenuItem.ts +47 -0
  45. package/src/generated/resources/UploadCollection.ts +47 -0
  46. package/src/generated/resources/WebhookCall.ts +4 -4
package/resources.json CHANGED
@@ -528,6 +528,27 @@
528
528
  "responseType": "MenuItemDestroyTargetSchema",
529
529
  "name": "destroy",
530
530
  "rawName": "rawDestroy"
531
+ },
532
+ {
533
+ "returnsCollection": false,
534
+ "docUrl": "https://www.datocms.com/docs/content-management-api/resources/menu-item/reorder",
535
+ "rel": "reorder",
536
+ "urlTemplate": "/menu-items/reorder",
537
+ "method": "POST",
538
+ "comment": "Reorders a set of menu items",
539
+ "urlPlaceholders": [],
540
+ "requestBodyType": "MenuItemReorderSchema",
541
+ "optionalRequestBody": false,
542
+ "requestStructure": {
543
+ "type": "menu_item",
544
+ "attributes": [],
545
+ "relationships": []
546
+ },
547
+ "queryParamsRequired": false,
548
+ "responseType": "MenuItemReorderJobSchema",
549
+ "deprecated": "This API call is to be considered private and might change without notice",
550
+ "name": "reorder",
551
+ "rawName": "rawReorder"
531
552
  }
532
553
  ],
533
554
  "namespace": "menuItems",
@@ -652,6 +673,27 @@
652
673
  "responseType": "SchemaMenuItemDestroyTargetSchema",
653
674
  "name": "destroy",
654
675
  "rawName": "rawDestroy"
676
+ },
677
+ {
678
+ "returnsCollection": false,
679
+ "docUrl": "https://www.datocms.com/docs/content-management-api/resources/schema-menu_item/reorder",
680
+ "rel": "reorder",
681
+ "urlTemplate": "/schema-menu-items/reorder",
682
+ "method": "POST",
683
+ "comment": "Reorders a set of schema menu items",
684
+ "urlPlaceholders": [],
685
+ "requestBodyType": "SchemaMenuItemReorderSchema",
686
+ "optionalRequestBody": false,
687
+ "requestStructure": {
688
+ "type": "schema_menu_item",
689
+ "attributes": [],
690
+ "relationships": []
691
+ },
692
+ "queryParamsRequired": false,
693
+ "responseType": "SchemaMenuItemReorderJobSchema",
694
+ "deprecated": "This API call is to be considered private and might change without notice",
695
+ "name": "reorder",
696
+ "rawName": "rawReorder"
655
697
  }
656
698
  ],
657
699
  "namespace": "schemaMenuItems",
@@ -776,6 +818,27 @@
776
818
  "responseType": "UploadCollectionDestroyTargetSchema",
777
819
  "name": "destroy",
778
820
  "rawName": "rawDestroy"
821
+ },
822
+ {
823
+ "returnsCollection": false,
824
+ "docUrl": "https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder",
825
+ "rel": "reorder",
826
+ "urlTemplate": "/upload-collections/reorder",
827
+ "method": "POST",
828
+ "comment": "Reorders a set of upload collections",
829
+ "urlPlaceholders": [],
830
+ "requestBodyType": "UploadCollectionReorderSchema",
831
+ "optionalRequestBody": false,
832
+ "requestStructure": {
833
+ "type": "upload_collection",
834
+ "attributes": [],
835
+ "relationships": []
836
+ },
837
+ "queryParamsRequired": false,
838
+ "responseType": "UploadCollectionReorderJobSchema",
839
+ "deprecated": "This API call is to be considered private and might change without notice",
840
+ "name": "reorder",
841
+ "rawName": "rawReorder"
779
842
  }
780
843
  ],
781
844
  "namespace": "uploadCollections",
@@ -969,6 +1032,26 @@
969
1032
  "responseType": "ItemTypeDestroyJobSchema",
970
1033
  "name": "destroy",
971
1034
  "rawName": "rawDestroy"
1035
+ },
1036
+ {
1037
+ "returnsCollection": false,
1038
+ "docUrl": "https://www.datocms.com/docs/content-management-api/resources/item-type/reorder_fields_and_fieldsets",
1039
+ "rel": "reorder_fields_and_fieldsets",
1040
+ "urlTemplate": "/item-types/reorder-fields-and-fieldsets",
1041
+ "method": "POST",
1042
+ "comment": "Reorders a set of fields and fieldsets within the model",
1043
+ "urlPlaceholders": [],
1044
+ "requestBodyType": "ItemTypeReorderFieldsAndFieldsetsSchema",
1045
+ "optionalRequestBody": false,
1046
+ "requestStructure": {
1047
+ "type": "*",
1048
+ "attributes": [],
1049
+ "relationships": []
1050
+ },
1051
+ "queryParamsRequired": false,
1052
+ "responseType": "ItemTypeReorderFieldsAndFieldsetsJobSchema",
1053
+ "deprecated": "This API call is to be considered private and might change without notice",
1054
+ "rawName": "rawReorderFieldsAndFieldsets"
972
1055
  }
973
1056
  ],
974
1057
  "namespace": "itemTypes",
@@ -3327,16 +3410,21 @@
3327
3410
  "returnsCollection": false,
3328
3411
  "docUrl": "https://www.datocms.com/docs/content-management-api/resources/webhook-call/resend_webhook",
3329
3412
  "rel": "resend_webhook",
3330
- "urlTemplate": "/webhook_calls/${userId}/resend_webhook",
3413
+ "urlTemplate": "/webhook_calls/${webhookCallId}/resend_webhook",
3331
3414
  "method": "POST",
3332
3415
  "comment": "Re-send the webhook call",
3333
3416
  "urlPlaceholders": [
3334
3417
  {
3335
- "variableName": "userId",
3336
- "isEntityId": false,
3337
- "relType": "UserData"
3418
+ "variableName": "webhookCallId",
3419
+ "isEntityId": true,
3420
+ "relType": "WebhookCallData"
3338
3421
  }
3339
3422
  ],
3423
+ "entityIdPlaceholder": {
3424
+ "variableName": "webhookCallId",
3425
+ "isEntityId": true,
3426
+ "relType": "WebhookCallData"
3427
+ },
3340
3428
  "optionalRequestBody": false,
3341
3429
  "queryParamsRequired": false,
3342
3430
  "name": "resendWebhook",
@@ -147,7 +147,7 @@ export class Client {
147
147
  ...this.config,
148
148
  ...options,
149
149
  logFn: this.config.logFn || console.log,
150
- userAgent: '@datocms/cma-client v3.3.8',
150
+ userAgent: '@datocms/cma-client v3.3.9',
151
151
  baseUrl: this.baseUrl,
152
152
  preCallStack: new Error().stack,
153
153
  extraHeaders: {
@@ -292,6 +292,21 @@ export type MenuItemInstancesHrefSchema = {
292
292
  ids: string;
293
293
  };
294
294
  };
295
+ /**
296
+ * This interface was referenced by `Job`'s JSON-Schema
297
+ * via the `definition` "type".
298
+ */
299
+ export type JobType = 'job';
300
+ /**
301
+ * ID of job
302
+ *
303
+ * This interface was referenced by `Job`'s JSON-Schema
304
+ * via the `definition` "identity".
305
+ *
306
+ * This interface was referenced by `Job`'s JSON-Schema
307
+ * via the `definition` "id".
308
+ */
309
+ export type JobIdentity = string;
295
310
  /**
296
311
  * JSON API type field
297
312
  *
@@ -419,21 +434,6 @@ export type ItemTypeCreateHrefSchema = {
419
434
  schema_menu_item_id?: string;
420
435
  [k: string]: unknown;
421
436
  };
422
- /**
423
- * This interface was referenced by `Job`'s JSON-Schema
424
- * via the `definition` "type".
425
- */
426
- export type JobType = 'job';
427
- /**
428
- * ID of job
429
- *
430
- * This interface was referenced by `Job`'s JSON-Schema
431
- * via the `definition` "identity".
432
- *
433
- * This interface was referenced by `Job`'s JSON-Schema
434
- * via the `definition` "id".
435
- */
436
- export type JobIdentity = string;
437
437
  /**
438
438
  * This interface was referenced by `ItemType`'s JSON-Schema
439
439
  * via the `destroy.hrefSchema` link.
@@ -3790,6 +3790,70 @@ export type MenuItemDestroyTargetSchema = {
3790
3790
  data: MenuItem;
3791
3791
  };
3792
3792
 
3793
+ /**
3794
+ * This interface was referenced by `MenuItem`'s JSON-Schema
3795
+ * via the `reorder.schema` link.
3796
+ */
3797
+ export type MenuItemReorderSchema = {
3798
+ data: {
3799
+ id: MenuItemIdentity;
3800
+ type: MenuItemType;
3801
+ /**
3802
+ * JSON API attributes
3803
+ */
3804
+ attributes: {
3805
+ /**
3806
+ * Ordering index
3807
+ */
3808
+ position: number;
3809
+ };
3810
+ relationships: {
3811
+ /**
3812
+ * Parent menu item
3813
+ */
3814
+ parent: {
3815
+ data: null | MenuItemData;
3816
+ };
3817
+ };
3818
+ }[];
3819
+ };
3820
+
3821
+ /**
3822
+ * This interface was referenced by `MenuItem`'s JSON-Schema
3823
+ * via the `reorder.targetSchema` link.
3824
+ */
3825
+ export type MenuItemReorderTargetSchema = {
3826
+ data: Job;
3827
+ };
3828
+
3829
+ /**
3830
+ * This interface was referenced by `DatoApi`'s JSON-Schema
3831
+ * via the `definition` "job".
3832
+ */
3833
+ export type Job = {
3834
+ type: JobType;
3835
+ id: JobIdentity;
3836
+ };
3837
+
3838
+ /**
3839
+ * JSON API data
3840
+ *
3841
+ * This interface was referenced by `Job`'s JSON-Schema
3842
+ * via the `definition` "data".
3843
+ */
3844
+ export type JobData = {
3845
+ type: JobType;
3846
+ id: JobIdentity;
3847
+ };
3848
+
3849
+ /**
3850
+ * This interface was referenced by `MenuItem`'s JSON-Schema
3851
+ * via the `reorder.jobSchema` link.
3852
+ */
3853
+ export type MenuItemReorderJobSchema = {
3854
+ data: MenuItem[];
3855
+ };
3856
+
3793
3857
  /**
3794
3858
  * In DatoCMS you can organize the different models and blocks present in your administrative area reordering and grouping them, so that their purpose will be more clear to the final editor.
3795
3859
  *
@@ -3992,6 +4056,50 @@ export type SchemaMenuItemDestroyTargetSchema = {
3992
4056
  data: SchemaMenuItem;
3993
4057
  };
3994
4058
 
4059
+ /**
4060
+ * This interface was referenced by `SchemaMenuItem`'s JSON-Schema
4061
+ * via the `reorder.schema` link.
4062
+ */
4063
+ export type SchemaMenuItemReorderSchema = {
4064
+ data: {
4065
+ id: SchemaMenuItemIdentity;
4066
+ type: SchemaMenuItemType;
4067
+ /**
4068
+ * JSON API attributes
4069
+ */
4070
+ attributes: {
4071
+ /**
4072
+ * Ordering index
4073
+ */
4074
+ position: number;
4075
+ };
4076
+ relationships: {
4077
+ /**
4078
+ * Parent schema menu item
4079
+ */
4080
+ parent: {
4081
+ data: null | SchemaMenuItemData;
4082
+ };
4083
+ };
4084
+ }[];
4085
+ };
4086
+
4087
+ /**
4088
+ * This interface was referenced by `SchemaMenuItem`'s JSON-Schema
4089
+ * via the `reorder.targetSchema` link.
4090
+ */
4091
+ export type SchemaMenuItemReorderTargetSchema = {
4092
+ data: Job;
4093
+ };
4094
+
4095
+ /**
4096
+ * This interface was referenced by `SchemaMenuItem`'s JSON-Schema
4097
+ * via the `reorder.jobSchema` link.
4098
+ */
4099
+ export type SchemaMenuItemReorderJobSchema = {
4100
+ data: SchemaMenuItem[];
4101
+ };
4102
+
3995
4103
  /**
3996
4104
  * In DatoCMS you can organize the uploads present in your administrative area in collection, so that the final editors can easily navigate uploads.
3997
4105
  *
@@ -4164,6 +4272,50 @@ export type UploadCollectionDestroyTargetSchema = {
4164
4272
  data: UploadCollection;
4165
4273
  };
4166
4274
 
4275
+ /**
4276
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
4277
+ * via the `reorder.schema` link.
4278
+ */
4279
+ export type UploadCollectionReorderSchema = {
4280
+ data: {
4281
+ id: UploadCollectionIdentity;
4282
+ type: UploadCollectionType;
4283
+ /**
4284
+ * JSON API attributes
4285
+ */
4286
+ attributes: {
4287
+ /**
4288
+ * Ordering index
4289
+ */
4290
+ position: number;
4291
+ };
4292
+ relationships: {
4293
+ /**
4294
+ * Parent upload collection
4295
+ */
4296
+ parent: {
4297
+ data: null | UploadCollectionData;
4298
+ };
4299
+ };
4300
+ }[];
4301
+ };
4302
+
4303
+ /**
4304
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
4305
+ * via the `reorder.targetSchema` link.
4306
+ */
4307
+ export type UploadCollectionReorderTargetSchema = {
4308
+ data: Job;
4309
+ };
4310
+
4311
+ /**
4312
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
4313
+ * via the `reorder.jobSchema` link.
4314
+ */
4315
+ export type UploadCollectionReorderJobSchema = {
4316
+ data: UploadCollection[];
4317
+ };
4318
+
4167
4319
  /**
4168
4320
  * The way you define the kind of content you can edit inside your administrative area passes through the concept of Models, which are much like database tables. For backward-compatibility reasons, the API refers to models as "item types".
4169
4321
  *
@@ -4611,26 +4763,6 @@ export type ItemTypeUpdateTargetSchema = {
4611
4763
  data: Job;
4612
4764
  };
4613
4765
 
4614
- /**
4615
- * This interface was referenced by `DatoApi`'s JSON-Schema
4616
- * via the `definition` "job".
4617
- */
4618
- export type Job = {
4619
- type: JobType;
4620
- id: JobIdentity;
4621
- };
4622
-
4623
- /**
4624
- * JSON API data
4625
- *
4626
- * This interface was referenced by `Job`'s JSON-Schema
4627
- * via the `definition` "data".
4628
- */
4629
- export type JobData = {
4630
- type: JobType;
4631
- id: JobIdentity;
4632
- };
4633
-
4634
4766
  /**
4635
4767
  * This interface was referenced by `ItemType`'s JSON-Schema
4636
4768
  * via the `update.jobSchema` link.
@@ -4679,6 +4811,65 @@ export type ItemTypeDestroyJobSchema = {
4679
4811
  data: ItemType;
4680
4812
  };
4681
4813
 
4814
+ /**
4815
+ * This interface was referenced by `ItemType`'s JSON-Schema
4816
+ * via the `reorder_fields_and_fieldsets.schema` link.
4817
+ */
4818
+ export type ItemTypeReorderFieldsAndFieldsetsSchema = {
4819
+ data: (
4820
+ | {
4821
+ id: FieldIdentity;
4822
+ type: FieldType;
4823
+ /**
4824
+ * JSON API attributes
4825
+ */
4826
+ attributes: {
4827
+ /**
4828
+ * Ordering index
4829
+ */
4830
+ position: number;
4831
+ };
4832
+ relationships: {
4833
+ /**
4834
+ * Fieldset linkage
4835
+ */
4836
+ fieldset: {
4837
+ data: null | FieldsetData;
4838
+ };
4839
+ };
4840
+ }
4841
+ | {
4842
+ id: FieldsetIdentity;
4843
+ type: FieldsetType;
4844
+ /**
4845
+ * JSON API attributes
4846
+ */
4847
+ attributes: {
4848
+ /**
4849
+ * Ordering index
4850
+ */
4851
+ position: number;
4852
+ };
4853
+ }
4854
+ )[];
4855
+ };
4856
+
4857
+ /**
4858
+ * This interface was referenced by `ItemType`'s JSON-Schema
4859
+ * via the `reorder_fields_and_fieldsets.targetSchema` link.
4860
+ */
4861
+ export type ItemTypeReorderFieldsAndFieldsetsTargetSchema = {
4862
+ data: Job;
4863
+ };
4864
+
4865
+ /**
4866
+ * This interface was referenced by `ItemType`'s JSON-Schema
4867
+ * via the `reorder_fields_and_fieldsets.jobSchema` link.
4868
+ */
4869
+ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = {
4870
+ data: (Field | Fieldset)[];
4871
+ };
4872
+
4682
4873
  /**
4683
4874
  * DatoCMS offers a number of different fields that you can combine together to create a [Model](/docs/content-management-api/resources/item-type). Using the database metaphore, fields are like table columns, and when creating them you need to specify their type (`string`, `float`, etc.) and any required validation.
4684
4875
  *
@@ -4735,12 +4926,12 @@ export type ItemTypeDestroyJobSchema = {
4735
4926
  *
4736
4927
  * #### Setting the appearance to a field editor provided by a plugin
4737
4928
  *
4738
- * If the project contains a plugin that exposes [manual field editors](/docs/plugin-sdk/manual-field-extensions), you can also configure the field to be presented with it instead of using one of the build-in editors.
4929
+ * If the project contains a plugin that exposes [manual field editors](/docs/plugin-sdk/manual-field-extensions), you can also configure the field to be presented with it instead of using one of the built-in editors.
4739
4930
  *
4740
4931
  * In this case:
4741
4932
  *
4742
- * - the `editor` property must be the ID of the plugin;
4743
- * - the `field_extension` property must be the ID of the specific manual field editor that the plugin exposes;
4933
+ * - the `editor` property is the plugin's project-specific autogenerated UUID. You can get it from the last part of the plugin's URL within your project's Configuration screen (e.g. `https://your-project.admin.datocms.com/configuration/plugins/PLUGIN_UUID/`), or via API with a [List all plugins](/docs/content-management-api/resources/plugin/instances) call.
4934
+ * - the `field_extension` property must be the ID of the specific manual field editor that the plugin exposes. This is set in the plugin's own source code, within a `manualFieldExtension()` call in its entry point (usually something like `index.tsx`).
4744
4935
  * - the `parameters` property must provide a configuration object compatible with the [config screen of the manual field extension](/docs/plugin-sdk/manual-field-extensions#add-per-field-config-screens-to-manual-field-extensions), or an empty object if it doesn't require any configuration.
4745
4936
  *
4746
4937
  * ```js