@datocms/cma-client 3.1.0 → 3.1.2

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.
@@ -128,7 +128,7 @@ var Client = /** @class */ (function () {
128
128
  });
129
129
  Client.prototype.request = function (options) {
130
130
  var _this = this;
131
- return (0, rest_client_utils_1.request)(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v3.1.0', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
131
+ return (0, rest_client_utils_1.request)(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v3.1.2', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
132
132
  ? { 'X-Environment': this.config.environment }
133
133
  : {})), { 'X-API-Version': '3' }), fetchJobResult: function (jobId) {
134
134
  return _this.jobResultsFetcher
@@ -102,7 +102,7 @@ var Client = /** @class */ (function () {
102
102
  });
103
103
  Client.prototype.request = function (options) {
104
104
  var _this = this;
105
- return request(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v3.1.0', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
105
+ return request(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v3.1.2', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
106
106
  ? { 'X-Environment': this.config.environment }
107
107
  : {})), { 'X-API-Version': '3' }), fetchJobResult: function (jobId) {
108
108
  return _this.jobResultsFetcher
@@ -507,7 +507,7 @@ export declare type BuildTriggerType = 'build_trigger';
507
507
  */
508
508
  export declare type ItemInstancesHrefSchema = {
509
509
  /**
510
- * For Modular Content fields and Structured Text fields. If set, returns full payload for nested blocks instead of IDs
510
+ * For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
511
511
  */
512
512
  nested?: boolean;
513
513
  /**
@@ -572,7 +572,7 @@ export declare type ItemInstancesHrefSchema = {
572
572
  */
573
573
  export declare type ItemReferencesHrefSchema = {
574
574
  /**
575
- * For Modular Content fields and Structured Text fields, return full payload for nested blocks instead of IDs
575
+ * For Modular Content, Structured Text and Single Block fields, return full payload for nested blocks instead of IDs
576
576
  */
577
577
  nested?: boolean;
578
578
  /**
@@ -587,7 +587,7 @@ export declare type ItemReferencesHrefSchema = {
587
587
  */
588
588
  export declare type ItemSelfHrefSchema = {
589
589
  /**
590
- * For Modular Content fields and Structured Text fields. If set, returns full payload for nested blocks instead of IDs
590
+ * For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
591
591
  */
592
592
  nested?: boolean;
593
593
  /**
@@ -662,7 +662,7 @@ export declare type ItemVersionIdentity = string;
662
662
  */
663
663
  export declare type ItemVersionInstancesHrefSchema = {
664
664
  /**
665
- * For Modular Content fields and Structured Text fields. If set, returns full payload for nested blocks instead of IDs
665
+ * For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
666
666
  */
667
667
  nested?: boolean;
668
668
  /**
@@ -862,7 +862,7 @@ export declare type UploadBatchDestroyHrefSchema = {
862
862
  */
863
863
  export declare type UploadReferencesHrefSchema = {
864
864
  /**
865
- * For Modular Content fields and Structured Text fields, return full payload for nested blocks instead of IDs
865
+ * For Modular Content, Structured Text and Single Block fields, return full payload for nested blocks instead of IDs
866
866
  */
867
867
  nested?: boolean;
868
868
  /**
@@ -4367,6 +4367,18 @@ export declare type ItemTypeDestroyJobSchema = {
4367
4367
  * </details>
4368
4368
  *
4369
4369
  * <details>
4370
+ * <summary>Single Block (<code>single_block</code>)</summary>
4371
+ *
4372
+ * | Property | Value |
4373
+ * | ------------------------------ | ----------------------------------------------- |
4374
+ * | Code | `single_block` |
4375
+ * | Built-in editors for the field | `framed_single_block`, `frameless_single_block` |
4376
+ * | Required validators | `single_block_blocks` |
4377
+ * | Other validators available | `required` |
4378
+ *
4379
+ * </details>
4380
+ *
4381
+ * <details>
4370
4382
  * <summary>Structured text (<code>structured_text</code>)</summary>
4371
4383
  *
4372
4384
  * | Property | Value |
@@ -4668,6 +4680,17 @@ export declare type ItemTypeDestroyJobSchema = {
4668
4680
  *
4669
4681
  * Only accept references to block records of the specified block models.
4670
4682
  *
4683
+ * | Parameter | Type | Required | Description |
4684
+ * | ------------ | ----------------------- | -------- | ------------------------------ |
4685
+ * | `item_types` | `Array<Block Model ID>` | ✅ | Set of allowed Block Model IDs |
4686
+ *
4687
+ * </details>
4688
+ *
4689
+ * <details>
4690
+ * <summary><code>single_block_blocks</code></summary>
4691
+ *
4692
+ * Only accept references to block records of the specified block models.
4693
+ *
4671
4694
  * | Parameter | Type | Required | Description |
4672
4695
  * | ------------ | ----------------------- | -------- | ------------------------------ |
4673
4696
  * | `item_types` | `Array<Block Model ID>` | ✅ | Set of allowed Block Model IDs |
@@ -4887,10 +4910,10 @@ export declare type ItemTypeDestroyJobSchema = {
4887
4910
  *
4888
4911
  * Built-in editor for _seo_ fields.
4889
4912
  *
4890
- * | Parameter | Type | Required | Description |
4891
- * | ---------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
4892
- * | `fields` | `Array<String>` | ✅ | Specify which fields of the SEO input should be visible to editors. Valid values: `"title"`, `"description"`, `"image"`, `"no_index"`, `"twitter_card"` |
4893
- * | `previews` | `Array<String>` | ✅ | Specify which previews should be visible to editors. Valid values: `"google_search"`, `"twitter"`, `"slack"`, `"whatsapp"`, `"telegram"`, `"facebook"` |
4913
+ * | Parameter | Type | Required | Description |
4914
+ * | ---------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4915
+ * | `fields` | `Array<String>` | ✅ | Specify which fields of the SEO input should be visible to editors. Valid values: `"title"`, `"description"`, `"image"`, `"no_index"`, `"twitter_card"` |
4916
+ * | `previews` | `Array<String>` | ✅ | Specify which previews should be visible to editors. Valid values: `"google_search"`, `"twitter"`, `"slack"`, `"whatsapp"`, `"telegram"`, `"facebook"`, `"linkedin"` |
4894
4917
  *
4895
4918
  * </details>
4896
4919
  *
@@ -4906,6 +4929,17 @@ export declare type ItemTypeDestroyJobSchema = {
4906
4929
  * </details>
4907
4930
  *
4908
4931
  * <details>
4932
+ * <summary><code>framed_single_block</code></summary>
4933
+ *
4934
+ * Built-in editor for _Single block_ fields.
4935
+ *
4936
+ * | Parameter | Type | Required | Description |
4937
+ * | ----------------- | --------- | -------- | ---------------------------------------------------------- |
4938
+ * | `start_collapsed` | `Boolean` | | Whether you want block record collapsed by default or not |
4939
+ *
4940
+ * </details>
4941
+ *
4942
+ * <details>
4909
4943
  * <summary><code>structured_text</code></summary>
4910
4944
  *
4911
4945
  * Built-in editor for _Structured text_ fields.
@@ -4959,7 +4993,7 @@ export declare type FieldAttributes = {
4959
4993
  /**
4960
4994
  * Type of input
4961
4995
  */
4962
- field_type: 'string' | 'text' | 'boolean' | 'integer' | 'float' | 'date' | 'date_time' | 'color' | 'json' | 'lat_lon' | 'seo' | 'slug' | 'video' | 'file' | 'gallery' | 'link' | 'links' | 'rich_text' | 'structured_text';
4996
+ field_type: 'boolean' | 'color' | 'date' | 'date_time' | 'file' | 'float' | 'gallery' | 'integer' | 'json' | 'lat_lon' | 'link' | 'links' | 'rich_text' | 'seo' | 'single_block' | 'slug' | 'string' | 'structured_text' | 'text' | 'video';
4963
4997
  /**
4964
4998
  * Whether the field needs to be multilanguage or not
4965
4999
  */
@@ -5079,7 +5113,7 @@ export declare type FieldCreateSchema = {
5079
5113
  /**
5080
5114
  * Type of input
5081
5115
  */
5082
- field_type: 'string' | 'text' | 'boolean' | 'integer' | 'float' | 'date' | 'date_time' | 'color' | 'json' | 'lat_lon' | 'seo' | 'slug' | 'video' | 'file' | 'gallery' | 'link' | 'links' | 'rich_text' | 'structured_text';
5116
+ field_type: 'boolean' | 'color' | 'date' | 'date_time' | 'file' | 'float' | 'gallery' | 'integer' | 'json' | 'lat_lon' | 'link' | 'links' | 'rich_text' | 'seo' | 'single_block' | 'slug' | 'string' | 'structured_text' | 'text' | 'video';
5083
5117
  /**
5084
5118
  * Field API key
5085
5119
  */
@@ -5275,7 +5309,7 @@ export declare type FieldUpdateSchema = {
5275
5309
  /**
5276
5310
  * Type of input
5277
5311
  */
5278
- field_type?: 'string' | 'text' | 'boolean' | 'integer' | 'float' | 'date' | 'date_time' | 'color' | 'json' | 'lat_lon' | 'seo' | 'slug' | 'video' | 'file' | 'gallery' | 'link' | 'links' | 'rich_text' | 'structured_text';
5312
+ field_type?: 'boolean' | 'color' | 'date' | 'date_time' | 'file' | 'float' | 'gallery' | 'integer' | 'json' | 'lat_lon' | 'link' | 'links' | 'rich_text' | 'seo' | 'single_block' | 'slug' | 'string' | 'structured_text' | 'text' | 'video';
5279
5313
  /**
5280
5314
  * Field hint
5281
5315
  */
@@ -9420,35 +9454,31 @@ export declare type PublicInfoAttributes = {
9420
9454
  * Specifies the color-scheme for the project
9421
9455
  */
9422
9456
  theme: {
9423
- primary_color?: {
9457
+ primary_color: {
9424
9458
  red: number;
9425
9459
  green: number;
9426
9460
  blue: number;
9427
9461
  alpha: number;
9428
9462
  [k: string]: unknown;
9429
9463
  };
9430
- light_color?: {
9464
+ light_color: {
9431
9465
  red: number;
9432
9466
  green: number;
9433
9467
  blue: number;
9434
9468
  alpha: number;
9435
- [k: string]: unknown;
9436
9469
  };
9437
- accent_color?: {
9470
+ accent_color: {
9438
9471
  red: number;
9439
9472
  green: number;
9440
9473
  blue: number;
9441
9474
  alpha: number;
9442
- [k: string]: unknown;
9443
9475
  };
9444
- dark_color?: {
9476
+ dark_color: {
9445
9477
  red: number;
9446
9478
  green: number;
9447
9479
  blue: number;
9448
9480
  alpha: number;
9449
- [k: string]: unknown;
9450
9481
  };
9451
- [k: string]: unknown;
9452
9482
  };
9453
9483
  /**
9454
9484
  * Additional information (only returned on authenticated requests)
@@ -9767,39 +9797,42 @@ export declare type SiteAttributes = {
9767
9797
  * Specifies the theme to use in administrative area
9768
9798
  */
9769
9799
  theme: {
9800
+ /**
9801
+ * If type is monochromatic, the hue will determine the color palette. Dark color is a legacy property, and it won't be used on the interface
9802
+ */
9803
+ type: 'custom' | 'monochromatic';
9804
+ /**
9805
+ * If the type is monochromatic, the value will fall between 0 and 359. If it's not, the value will be null.
9806
+ */
9807
+ hue: number | null;
9770
9808
  primary_color: {
9771
9809
  red: number;
9772
9810
  green: number;
9773
9811
  blue: number;
9774
9812
  alpha: number;
9775
- [k: string]: unknown;
9776
9813
  };
9777
9814
  light_color: {
9778
9815
  red: number;
9779
9816
  green: number;
9780
9817
  blue: number;
9781
9818
  alpha: number;
9782
- [k: string]: unknown;
9783
9819
  };
9784
9820
  accent_color: {
9785
9821
  red: number;
9786
9822
  green: number;
9787
9823
  blue: number;
9788
9824
  alpha: number;
9789
- [k: string]: unknown;
9790
9825
  };
9791
9826
  dark_color: {
9792
9827
  red: number;
9793
9828
  green: number;
9794
9829
  blue: number;
9795
9830
  alpha: number;
9796
- [k: string]: unknown;
9797
9831
  };
9798
9832
  /**
9799
- * The site logo
9833
+ * The upload ID that is used as the logo for the project
9800
9834
  */
9801
9835
  logo: string | null;
9802
- [k: string]: unknown;
9803
9836
  };
9804
9837
  /**
9805
9838
  * Specifies default global settings
@@ -9959,42 +9992,53 @@ export declare type SiteUpdateSchema = {
9959
9992
  * Site name
9960
9993
  */
9961
9994
  name?: string;
9962
- /**
9963
- * Specifies the theme to use in administrative area
9964
- */
9965
9995
  theme?: {
9996
+ /**
9997
+ * Type of theme color palette
9998
+ */
9999
+ type: 'monochromatic';
10000
+ /**
10001
+ * If the type is monochromatic, the value will fall between 0 and 359. If it's not, the value will be null.
10002
+ */
10003
+ hue: number | null;
10004
+ /**
10005
+ * The upload ID that is used as the logo for the project
10006
+ */
10007
+ logo: string | null;
10008
+ [k: string]: unknown;
10009
+ } | {
10010
+ /**
10011
+ * Type of theme color palette
10012
+ */
10013
+ type?: 'custom';
10014
+ /**
10015
+ * The upload ID that is used as the logo for the project
10016
+ */
10017
+ logo: string | null;
9966
10018
  primary_color: {
9967
10019
  red: number;
9968
10020
  green: number;
9969
10021
  blue: number;
9970
10022
  alpha: number;
9971
- [k: string]: unknown;
9972
10023
  };
9973
10024
  light_color: {
9974
10025
  red: number;
9975
10026
  green: number;
9976
10027
  blue: number;
9977
10028
  alpha: number;
9978
- [k: string]: unknown;
9979
10029
  };
9980
10030
  accent_color: {
9981
10031
  red: number;
9982
10032
  green: number;
9983
10033
  blue: number;
9984
10034
  alpha: number;
9985
- [k: string]: unknown;
9986
10035
  };
9987
- dark_color: {
10036
+ dark_color?: {
9988
10037
  red: number;
9989
10038
  green: number;
9990
10039
  blue: number;
9991
10040
  alpha: number;
9992
- [k: string]: unknown;
9993
10041
  };
9994
- /**
9995
- * The site logo
9996
- */
9997
- logo: string | null;
9998
10042
  [k: string]: unknown;
9999
10043
  };
10000
10044
  /**