@datocms/cma-client 5.4.14 → 5.4.16

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 (42) hide show
  1. package/dist/cjs/generated/Client.js +1 -1
  2. package/dist/esm/fieldTypes/appearance/color_picker.d.ts +4 -4
  3. package/dist/esm/fieldTypes/appearance/framed_single_block.d.ts +1 -1
  4. package/dist/esm/fieldTypes/appearance/markdown.d.ts +2 -2
  5. package/dist/esm/fieldTypes/appearance/rich_text.d.ts +1 -1
  6. package/dist/esm/fieldTypes/appearance/seo.d.ts +4 -4
  7. package/dist/esm/fieldTypes/appearance/single_line.d.ts +2 -2
  8. package/dist/esm/fieldTypes/appearance/structured_text.d.ts +9 -9
  9. package/dist/esm/fieldTypes/appearance/wysiwyg.d.ts +2 -2
  10. package/dist/esm/fieldTypes/single_block.d.ts +1 -1
  11. package/dist/esm/fieldTypes/validators/sanitized_html.d.ts +1 -1
  12. package/dist/esm/generated/ApiTypes.d.ts +4 -4
  13. package/dist/esm/generated/Client.js +1 -1
  14. package/dist/esm/generated/RawApiTypes.d.ts +4 -4
  15. package/dist/esm/generated/resources/ItemVersion.d.ts +10 -3
  16. package/dist/types/fieldTypes/appearance/color_picker.d.ts +4 -4
  17. package/dist/types/fieldTypes/appearance/framed_single_block.d.ts +1 -1
  18. package/dist/types/fieldTypes/appearance/markdown.d.ts +2 -2
  19. package/dist/types/fieldTypes/appearance/rich_text.d.ts +1 -1
  20. package/dist/types/fieldTypes/appearance/seo.d.ts +4 -4
  21. package/dist/types/fieldTypes/appearance/single_line.d.ts +2 -2
  22. package/dist/types/fieldTypes/appearance/structured_text.d.ts +9 -9
  23. package/dist/types/fieldTypes/appearance/wysiwyg.d.ts +2 -2
  24. package/dist/types/fieldTypes/single_block.d.ts +1 -1
  25. package/dist/types/fieldTypes/validators/sanitized_html.d.ts +1 -1
  26. package/dist/types/generated/ApiTypes.d.ts +4 -4
  27. package/dist/types/generated/RawApiTypes.d.ts +4 -4
  28. package/dist/types/generated/resources/ItemVersion.d.ts +10 -3
  29. package/package.json +2 -2
  30. package/src/fieldTypes/appearance/color_picker.ts +4 -4
  31. package/src/fieldTypes/appearance/framed_single_block.ts +1 -1
  32. package/src/fieldTypes/appearance/markdown.ts +2 -2
  33. package/src/fieldTypes/appearance/rich_text.ts +1 -1
  34. package/src/fieldTypes/appearance/seo.ts +4 -4
  35. package/src/fieldTypes/appearance/single_line.ts +2 -2
  36. package/src/fieldTypes/appearance/structured_text.ts +9 -9
  37. package/src/fieldTypes/appearance/wysiwyg.ts +2 -2
  38. package/src/fieldTypes/single_block.ts +1 -1
  39. package/src/fieldTypes/validators/sanitized_html.ts +1 -1
  40. package/src/generated/ApiTypes.ts +31 -26
  41. package/src/generated/Client.ts +1 -1
  42. package/src/generated/RawApiTypes.ts +21 -16
@@ -90,7 +90,7 @@ class Client {
90
90
  return this.config.baseUrl || Client.defaultBaseUrl;
91
91
  }
92
92
  request(options) {
93
- return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.14', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
93
+ return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.16', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
94
94
  ? { 'X-Environment': this.config.environment }
95
95
  : {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
96
96
  return this.jobResultsFetcher
@@ -2,8 +2,8 @@
2
2
  * Built-in editor for Color fields.
3
3
  */
4
4
  export type ColorPickerEditorConfiguration = {
5
- /** Should the color picker allow to specify the alpha value? */
6
- enable_alpha: boolean;
7
- /** List of preset colors to offer to the user (hex color strings) */
8
- preset_colors: Array<string>;
5
+ /** Should the color picker allow to specify the alpha value? (default: false) */
6
+ enable_alpha?: boolean;
7
+ /** List of preset colors to offer to the user (hex color strings) (default: []) */
8
+ preset_colors?: Array<string>;
9
9
  };
@@ -2,6 +2,6 @@
2
2
  * Built-in editor for Single block fields.
3
3
  */
4
4
  export type FramedSingleBlockEditorConfiguration = {
5
- /** Whether you want block record collapsed by default or not */
5
+ /** Whether you want block record collapsed by default or not (default: false) */
6
6
  start_collapsed?: boolean;
7
7
  };
@@ -2,6 +2,6 @@
2
2
  * Markdown editor for Multiple-paragraph text fields.
3
3
  */
4
4
  export type MarkdownEditorConfiguration = {
5
- /** Specify which buttons the toolbar should have */
6
- toolbar: Array<'heading' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'unordered_list' | 'ordered_list' | 'quote' | 'link' | 'image' | 'fullscreen'>;
5
+ /** Specify which buttons the toolbar should have (default: all allowed values) */
6
+ toolbar?: Array<'heading' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'unordered_list' | 'ordered_list' | 'quote' | 'link' | 'image' | 'fullscreen'>;
7
7
  };
@@ -2,6 +2,6 @@
2
2
  * Built-in editor for Modular content fields.
3
3
  */
4
4
  export type RichTextEditorConfiguration = {
5
- /** Whether you want block records collapsed by default or not */
5
+ /** Whether you want block records collapsed by default or not (default: false) */
6
6
  start_collapsed?: boolean;
7
7
  };
@@ -2,8 +2,8 @@
2
2
  * Built-in editor for SEO fields.
3
3
  */
4
4
  export type SeoEditorConfiguration = {
5
- /** Specify which fields of the SEO input should be visible to editors */
6
- fields: Array<'title' | 'description' | 'image' | 'no_index' | 'twitter_card'>;
7
- /** Specify which previews should be visible to editors */
8
- previews: Array<'google' | 'twitter' | 'slack' | 'whatsapp' | 'telegram' | 'facebook' | 'linkedin'>;
5
+ /** Specify which fields of the SEO input should be visible to editors (default: all allowed values) */
6
+ fields?: Array<'title' | 'description' | 'image' | 'no_index' | 'twitter_card'>;
7
+ /** Specify which previews should be visible to editors (default: all allowed values) */
8
+ previews?: Array<'google' | 'twitter' | 'slack' | 'whatsapp' | 'telegram' | 'facebook' | 'linkedin'>;
9
9
  };
@@ -2,8 +2,8 @@
2
2
  * Simple textual input for Single-line string fields.
3
3
  */
4
4
  export type SingleLineEditorConfiguration = {
5
- /** Indicates if the field should be shown bigger, as a field representing a heading */
6
- heading: boolean;
5
+ /** Indicates if the field should be shown bigger, as a field representing a heading (default: false) */
6
+ heading?: boolean;
7
7
  /** A placeholder that will be shown in the editor's input to provide editors with an example */
8
8
  placeholder?: string;
9
9
  };
@@ -2,16 +2,16 @@
2
2
  * Built-in editor for Structured text fields.
3
3
  */
4
4
  export type StructuredTextEditorConfiguration = {
5
- /** Specify which nodes the field should allow */
6
- nodes: Array<'blockquote' | 'code' | 'heading' | 'link' | 'list' | 'thematicBreak'>;
7
- /** Specify which marks the field should allow */
8
- marks: Array<'strong' | 'emphasis' | 'underline' | 'strikethrough' | 'code' | 'highlight'>;
9
- /** If nodes includes "heading", specify which heading levels the field should allow (numbers between 1 and 6) */
10
- heading_levels: Array<1 | 2 | 3 | 4 | 5 | 6>;
11
- /** Whether you want block nodes collapsed by default or not */
5
+ /** Specify which nodes the field should allow (default: all allowed values) */
6
+ nodes?: Array<'blockquote' | 'code' | 'heading' | 'link' | 'list' | 'thematicBreak'>;
7
+ /** Specify which marks the field should allow (default: all allowed values) */
8
+ marks?: Array<'strong' | 'emphasis' | 'underline' | 'strikethrough' | 'code' | 'highlight'>;
9
+ /** If nodes includes "heading", specify which heading levels the field should allow (numbers between 1 and 6) (default: all allowed values) */
10
+ heading_levels?: Array<1 | 2 | 3 | 4 | 5 | 6>;
11
+ /** Whether you want block nodes collapsed by default or not (default: false) */
12
12
  blocks_start_collapsed?: boolean;
13
- /** Whether you want to show the "Open this link in a new tab?" checkbox, that fills in the target: "_blank" meta attribute for links */
13
+ /** Whether you want to show the "Open this link in a new tab?" checkbox, that fills in the target: "_blank" meta attribute for links (default: true) */
14
14
  show_links_target_blank?: boolean;
15
- /** Whether you want to show the complete meta editor for links */
15
+ /** Whether you want to show the complete meta editor for links (default: false) */
16
16
  show_links_meta_editor?: boolean;
17
17
  };
@@ -2,6 +2,6 @@
2
2
  * HTML editor for Multiple-paragraph text fields.
3
3
  */
4
4
  export type WysiwygEditorConfiguration = {
5
- /** Specify which buttons the toolbar should have */
6
- toolbar: Array<'format' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'ordered_list' | 'unordered_list' | 'quote' | 'table' | 'link' | 'image' | 'show_source' | 'undo' | 'redo' | 'align_left' | 'align_center' | 'align_right' | 'align_justify' | 'outdent' | 'indent' | 'fullscreen'>;
5
+ /** Specify which buttons the toolbar should have (default: ['format', 'bold', 'italic', 'strikethrough', 'ordered_list', 'unordered_list', 'quote', 'table', 'link', 'image', 'show_source', 'fullscreen']) */
6
+ toolbar?: Array<'format' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'ordered_list' | 'unordered_list' | 'quote' | 'table' | 'link' | 'image' | 'show_source' | 'undo' | 'redo' | 'align_left' | 'align_center' | 'align_right' | 'align_justify' | 'outdent' | 'indent' | 'fullscreen'>;
7
7
  };
@@ -75,7 +75,7 @@ export type NewBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>
75
75
  export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = [
76
76
  D
77
77
  ] extends [never] ? UnchangedBlockInRequest : D extends unknown ? UnchangedBlockInRequest | UpdatedBlockInRequest<D> | NewBlockInRequest<D> : never;
78
- export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
78
+ export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = RawApiTypes.ItemInNestedResponse<D>;
79
79
  /**
80
80
  * Single Block field value for API requests - allows flexible block representations:
81
81
  * - string: Just the block ID (to keep existing blocks unchanged)
@@ -3,5 +3,5 @@
3
3
  */
4
4
  export type SanitizedHtmlValidator = {
5
5
  /** Content is actively sanitized before applying the validation */
6
- sanitize_before_validation: boolean;
6
+ sanitize_before_validation?: boolean;
7
7
  };
@@ -8,22 +8,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
8
8
  type: ItemTypeType;
9
9
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
10
10
  };
11
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
11
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
12
12
  __itemTypeId?: D['itemTypeId'];
13
13
  id: ItemIdentity;
14
14
  type: ItemType1;
15
15
  item_type: ItemTypeData<D>;
16
16
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
17
17
  meta: ItemMeta;
18
- } & ToItemAttributes<D>;
19
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
18
+ } & ToItemAttributes<D> : never;
19
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  id: ItemIdentity;
22
22
  type: ItemType1;
23
23
  item_type: ItemTypeData<D>;
24
24
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
25
25
  meta: ItemMeta;
26
- } & ToItemAttributesInNestedResponse<D>;
26
+ } & ToItemAttributesInNestedResponse<D> : never;
27
27
  /**
28
28
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
29
29
  */
@@ -64,7 +64,7 @@ export class Client {
64
64
  return this.config.baseUrl || Client.defaultBaseUrl;
65
65
  }
66
66
  request(options) {
67
- return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.14', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
67
+ return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.4.16', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
68
68
  ? { 'X-Environment': this.config.environment }
69
69
  : {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
70
70
  return this.jobResultsFetcher
@@ -16,22 +16,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
16
16
  type: ItemTypeType;
17
17
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
18
18
  };
19
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
19
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  type: ItemType1;
22
22
  id: ItemIdentity;
23
23
  relationships: ItemRelationships<D>;
24
24
  meta: ItemMeta;
25
25
  attributes: ToItemAttributes<D>;
26
- };
27
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
26
+ } : never;
27
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
28
28
  __itemTypeId?: D['itemTypeId'];
29
29
  type: ItemType1;
30
30
  id: ItemIdentity;
31
31
  relationships: ItemRelationships<D>;
32
32
  meta: ItemMeta;
33
33
  attributes: ToItemAttributesInNestedResponse<D>;
34
- };
34
+ } : never;
35
35
  /**
36
36
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
37
37
  */
@@ -12,9 +12,16 @@ export default class ItemVersion extends BaseResource {
12
12
  * @throws {ApiError}
13
13
  * @throws {TimeoutError}
14
14
  */
15
- restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[ApiTypes.Item<import("../../index.js").ItemTypeDefinition<{
16
- locales: string;
17
- }, string, {}>>, ApiTypes.ItemVersion]>;
15
+ restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[{
16
+ __itemTypeId?: string | undefined;
17
+ id: string;
18
+ type: "item";
19
+ item_type: ApiTypes.ItemTypeData<import("../../index.js").ItemTypeDefinition<{
20
+ locales: string;
21
+ }, string, {}>>;
22
+ creator?: ApiTypes.UserData | ApiTypes.AccessTokenData | ApiTypes.AccountData | ApiTypes.SsoUserData | ApiTypes.OrganizationData | undefined;
23
+ meta: ApiTypes.ItemMeta;
24
+ } & Record<string, unknown>, ApiTypes.ItemVersion]>;
18
25
  /**
19
26
  * Restore an old record version
20
27
  *
@@ -2,8 +2,8 @@
2
2
  * Built-in editor for Color fields.
3
3
  */
4
4
  export type ColorPickerEditorConfiguration = {
5
- /** Should the color picker allow to specify the alpha value? */
6
- enable_alpha: boolean;
7
- /** List of preset colors to offer to the user (hex color strings) */
8
- preset_colors: Array<string>;
5
+ /** Should the color picker allow to specify the alpha value? (default: false) */
6
+ enable_alpha?: boolean;
7
+ /** List of preset colors to offer to the user (hex color strings) (default: []) */
8
+ preset_colors?: Array<string>;
9
9
  };
@@ -2,6 +2,6 @@
2
2
  * Built-in editor for Single block fields.
3
3
  */
4
4
  export type FramedSingleBlockEditorConfiguration = {
5
- /** Whether you want block record collapsed by default or not */
5
+ /** Whether you want block record collapsed by default or not (default: false) */
6
6
  start_collapsed?: boolean;
7
7
  };
@@ -2,6 +2,6 @@
2
2
  * Markdown editor for Multiple-paragraph text fields.
3
3
  */
4
4
  export type MarkdownEditorConfiguration = {
5
- /** Specify which buttons the toolbar should have */
6
- toolbar: Array<'heading' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'unordered_list' | 'ordered_list' | 'quote' | 'link' | 'image' | 'fullscreen'>;
5
+ /** Specify which buttons the toolbar should have (default: all allowed values) */
6
+ toolbar?: Array<'heading' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'unordered_list' | 'ordered_list' | 'quote' | 'link' | 'image' | 'fullscreen'>;
7
7
  };
@@ -2,6 +2,6 @@
2
2
  * Built-in editor for Modular content fields.
3
3
  */
4
4
  export type RichTextEditorConfiguration = {
5
- /** Whether you want block records collapsed by default or not */
5
+ /** Whether you want block records collapsed by default or not (default: false) */
6
6
  start_collapsed?: boolean;
7
7
  };
@@ -2,8 +2,8 @@
2
2
  * Built-in editor for SEO fields.
3
3
  */
4
4
  export type SeoEditorConfiguration = {
5
- /** Specify which fields of the SEO input should be visible to editors */
6
- fields: Array<'title' | 'description' | 'image' | 'no_index' | 'twitter_card'>;
7
- /** Specify which previews should be visible to editors */
8
- previews: Array<'google' | 'twitter' | 'slack' | 'whatsapp' | 'telegram' | 'facebook' | 'linkedin'>;
5
+ /** Specify which fields of the SEO input should be visible to editors (default: all allowed values) */
6
+ fields?: Array<'title' | 'description' | 'image' | 'no_index' | 'twitter_card'>;
7
+ /** Specify which previews should be visible to editors (default: all allowed values) */
8
+ previews?: Array<'google' | 'twitter' | 'slack' | 'whatsapp' | 'telegram' | 'facebook' | 'linkedin'>;
9
9
  };
@@ -2,8 +2,8 @@
2
2
  * Simple textual input for Single-line string fields.
3
3
  */
4
4
  export type SingleLineEditorConfiguration = {
5
- /** Indicates if the field should be shown bigger, as a field representing a heading */
6
- heading: boolean;
5
+ /** Indicates if the field should be shown bigger, as a field representing a heading (default: false) */
6
+ heading?: boolean;
7
7
  /** A placeholder that will be shown in the editor's input to provide editors with an example */
8
8
  placeholder?: string;
9
9
  };
@@ -2,16 +2,16 @@
2
2
  * Built-in editor for Structured text fields.
3
3
  */
4
4
  export type StructuredTextEditorConfiguration = {
5
- /** Specify which nodes the field should allow */
6
- nodes: Array<'blockquote' | 'code' | 'heading' | 'link' | 'list' | 'thematicBreak'>;
7
- /** Specify which marks the field should allow */
8
- marks: Array<'strong' | 'emphasis' | 'underline' | 'strikethrough' | 'code' | 'highlight'>;
9
- /** If nodes includes "heading", specify which heading levels the field should allow (numbers between 1 and 6) */
10
- heading_levels: Array<1 | 2 | 3 | 4 | 5 | 6>;
11
- /** Whether you want block nodes collapsed by default or not */
5
+ /** Specify which nodes the field should allow (default: all allowed values) */
6
+ nodes?: Array<'blockquote' | 'code' | 'heading' | 'link' | 'list' | 'thematicBreak'>;
7
+ /** Specify which marks the field should allow (default: all allowed values) */
8
+ marks?: Array<'strong' | 'emphasis' | 'underline' | 'strikethrough' | 'code' | 'highlight'>;
9
+ /** If nodes includes "heading", specify which heading levels the field should allow (numbers between 1 and 6) (default: all allowed values) */
10
+ heading_levels?: Array<1 | 2 | 3 | 4 | 5 | 6>;
11
+ /** Whether you want block nodes collapsed by default or not (default: false) */
12
12
  blocks_start_collapsed?: boolean;
13
- /** Whether you want to show the "Open this link in a new tab?" checkbox, that fills in the target: "_blank" meta attribute for links */
13
+ /** Whether you want to show the "Open this link in a new tab?" checkbox, that fills in the target: "_blank" meta attribute for links (default: true) */
14
14
  show_links_target_blank?: boolean;
15
- /** Whether you want to show the complete meta editor for links */
15
+ /** Whether you want to show the complete meta editor for links (default: false) */
16
16
  show_links_meta_editor?: boolean;
17
17
  };
@@ -2,6 +2,6 @@
2
2
  * HTML editor for Multiple-paragraph text fields.
3
3
  */
4
4
  export type WysiwygEditorConfiguration = {
5
- /** Specify which buttons the toolbar should have */
6
- toolbar: Array<'format' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'ordered_list' | 'unordered_list' | 'quote' | 'table' | 'link' | 'image' | 'show_source' | 'undo' | 'redo' | 'align_left' | 'align_center' | 'align_right' | 'align_justify' | 'outdent' | 'indent' | 'fullscreen'>;
5
+ /** Specify which buttons the toolbar should have (default: ['format', 'bold', 'italic', 'strikethrough', 'ordered_list', 'unordered_list', 'quote', 'table', 'link', 'image', 'show_source', 'fullscreen']) */
6
+ toolbar?: Array<'format' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'ordered_list' | 'unordered_list' | 'quote' | 'table' | 'link' | 'image' | 'show_source' | 'undo' | 'redo' | 'align_left' | 'align_center' | 'align_right' | 'align_justify' | 'outdent' | 'indent' | 'fullscreen'>;
7
7
  };
@@ -75,7 +75,7 @@ export type NewBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>
75
75
  export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = [
76
76
  D
77
77
  ] extends [never] ? UnchangedBlockInRequest : D extends unknown ? UnchangedBlockInRequest | UpdatedBlockInRequest<D> | NewBlockInRequest<D> : never;
78
- export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
78
+ export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = RawApiTypes.ItemInNestedResponse<D>;
79
79
  /**
80
80
  * Single Block field value for API requests - allows flexible block representations:
81
81
  * - string: Just the block ID (to keep existing blocks unchanged)
@@ -3,5 +3,5 @@
3
3
  */
4
4
  export type SanitizedHtmlValidator = {
5
5
  /** Content is actively sanitized before applying the validation */
6
- sanitize_before_validation: boolean;
6
+ sanitize_before_validation?: boolean;
7
7
  };
@@ -8,22 +8,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
8
8
  type: ItemTypeType;
9
9
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
10
10
  };
11
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
11
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
12
12
  __itemTypeId?: D['itemTypeId'];
13
13
  id: ItemIdentity;
14
14
  type: ItemType1;
15
15
  item_type: ItemTypeData<D>;
16
16
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
17
17
  meta: ItemMeta;
18
- } & ToItemAttributes<D>;
19
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
18
+ } & ToItemAttributes<D> : never;
19
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  id: ItemIdentity;
22
22
  type: ItemType1;
23
23
  item_type: ItemTypeData<D>;
24
24
  creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
25
25
  meta: ItemMeta;
26
- } & ToItemAttributesInNestedResponse<D>;
26
+ } & ToItemAttributesInNestedResponse<D> : never;
27
27
  /**
28
28
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
29
29
  */
@@ -16,22 +16,22 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
16
16
  type: ItemTypeType;
17
17
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
18
18
  };
19
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
19
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
20
20
  __itemTypeId?: D['itemTypeId'];
21
21
  type: ItemType1;
22
22
  id: ItemIdentity;
23
23
  relationships: ItemRelationships<D>;
24
24
  meta: ItemMeta;
25
25
  attributes: ToItemAttributes<D>;
26
- };
27
- export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
26
+ } : never;
27
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends ItemTypeDefinition ? {
28
28
  __itemTypeId?: D['itemTypeId'];
29
29
  type: ItemType1;
30
30
  id: ItemIdentity;
31
31
  relationships: ItemRelationships<D>;
32
32
  meta: ItemMeta;
33
33
  attributes: ToItemAttributesInNestedResponse<D>;
34
- };
34
+ } : never;
35
35
  /**
36
36
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
37
37
  */
@@ -12,9 +12,16 @@ export default class ItemVersion extends BaseResource {
12
12
  * @throws {ApiError}
13
13
  * @throws {TimeoutError}
14
14
  */
15
- restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[ApiTypes.Item<import("../../index.js").ItemTypeDefinition<{
16
- locales: string;
17
- }, string, {}>>, ApiTypes.ItemVersion]>;
15
+ restore(itemVersionId: string | ApiTypes.ItemVersionData): Promise<[{
16
+ __itemTypeId?: string | undefined;
17
+ id: string;
18
+ type: "item";
19
+ item_type: ApiTypes.ItemTypeData<import("../../index.js").ItemTypeDefinition<{
20
+ locales: string;
21
+ }, string, {}>>;
22
+ creator?: ApiTypes.UserData | ApiTypes.AccessTokenData | ApiTypes.AccountData | ApiTypes.SsoUserData | ApiTypes.OrganizationData | undefined;
23
+ meta: ApiTypes.ItemMeta;
24
+ } & Record<string, unknown>, ApiTypes.ItemVersion]>;
18
25
  /**
19
26
  * Restore an old record version
20
27
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/cma-client",
3
- "version": "5.4.14",
3
+ "version": "5.4.16",
4
4
  "description": "JS client for DatoCMS REST Content Management API",
5
5
  "keywords": [
6
6
  "datocms",
@@ -45,5 +45,5 @@
45
45
  "@datocms/dashboard-client": "^5.4.9",
46
46
  "@types/uuid": "^9.0.7"
47
47
  },
48
- "gitHead": "aad77038aa0c91a6439c46f836199d129f88f70f"
48
+ "gitHead": "454acff0c6db2d3dda7f98c831e787e2e0413364"
49
49
  }
@@ -2,8 +2,8 @@
2
2
  * Built-in editor for Color fields.
3
3
  */
4
4
  export type ColorPickerEditorConfiguration = {
5
- /** Should the color picker allow to specify the alpha value? */
6
- enable_alpha: boolean;
7
- /** List of preset colors to offer to the user (hex color strings) */
8
- preset_colors: Array<string>;
5
+ /** Should the color picker allow to specify the alpha value? (default: false) */
6
+ enable_alpha?: boolean;
7
+ /** List of preset colors to offer to the user (hex color strings) (default: []) */
8
+ preset_colors?: Array<string>;
9
9
  };
@@ -2,6 +2,6 @@
2
2
  * Built-in editor for Single block fields.
3
3
  */
4
4
  export type FramedSingleBlockEditorConfiguration = {
5
- /** Whether you want block record collapsed by default or not */
5
+ /** Whether you want block record collapsed by default or not (default: false) */
6
6
  start_collapsed?: boolean;
7
7
  };
@@ -2,8 +2,8 @@
2
2
  * Markdown editor for Multiple-paragraph text fields.
3
3
  */
4
4
  export type MarkdownEditorConfiguration = {
5
- /** Specify which buttons the toolbar should have */
6
- toolbar: Array<
5
+ /** Specify which buttons the toolbar should have (default: all allowed values) */
6
+ toolbar?: Array<
7
7
  | 'heading'
8
8
  | 'bold'
9
9
  | 'italic'
@@ -2,6 +2,6 @@
2
2
  * Built-in editor for Modular content fields.
3
3
  */
4
4
  export type RichTextEditorConfiguration = {
5
- /** Whether you want block records collapsed by default or not */
5
+ /** Whether you want block records collapsed by default or not (default: false) */
6
6
  start_collapsed?: boolean;
7
7
  };
@@ -2,12 +2,12 @@
2
2
  * Built-in editor for SEO fields.
3
3
  */
4
4
  export type SeoEditorConfiguration = {
5
- /** Specify which fields of the SEO input should be visible to editors */
6
- fields: Array<
5
+ /** Specify which fields of the SEO input should be visible to editors (default: all allowed values) */
6
+ fields?: Array<
7
7
  'title' | 'description' | 'image' | 'no_index' | 'twitter_card'
8
8
  >;
9
- /** Specify which previews should be visible to editors */
10
- previews: Array<
9
+ /** Specify which previews should be visible to editors (default: all allowed values) */
10
+ previews?: Array<
11
11
  | 'google'
12
12
  | 'twitter'
13
13
  | 'slack'
@@ -2,8 +2,8 @@
2
2
  * Simple textual input for Single-line string fields.
3
3
  */
4
4
  export type SingleLineEditorConfiguration = {
5
- /** Indicates if the field should be shown bigger, as a field representing a heading */
6
- heading: boolean;
5
+ /** Indicates if the field should be shown bigger, as a field representing a heading (default: false) */
6
+ heading?: boolean;
7
7
  /** A placeholder that will be shown in the editor's input to provide editors with an example */
8
8
  placeholder?: string;
9
9
  };
@@ -2,20 +2,20 @@
2
2
  * Built-in editor for Structured text fields.
3
3
  */
4
4
  export type StructuredTextEditorConfiguration = {
5
- /** Specify which nodes the field should allow */
6
- nodes: Array<
5
+ /** Specify which nodes the field should allow (default: all allowed values) */
6
+ nodes?: Array<
7
7
  'blockquote' | 'code' | 'heading' | 'link' | 'list' | 'thematicBreak'
8
8
  >;
9
- /** Specify which marks the field should allow */
10
- marks: Array<
9
+ /** Specify which marks the field should allow (default: all allowed values) */
10
+ marks?: Array<
11
11
  'strong' | 'emphasis' | 'underline' | 'strikethrough' | 'code' | 'highlight'
12
12
  >;
13
- /** If nodes includes "heading", specify which heading levels the field should allow (numbers between 1 and 6) */
14
- heading_levels: Array<1 | 2 | 3 | 4 | 5 | 6>;
15
- /** Whether you want block nodes collapsed by default or not */
13
+ /** If nodes includes "heading", specify which heading levels the field should allow (numbers between 1 and 6) (default: all allowed values) */
14
+ heading_levels?: Array<1 | 2 | 3 | 4 | 5 | 6>;
15
+ /** Whether you want block nodes collapsed by default or not (default: false) */
16
16
  blocks_start_collapsed?: boolean;
17
- /** Whether you want to show the "Open this link in a new tab?" checkbox, that fills in the target: "_blank" meta attribute for links */
17
+ /** Whether you want to show the "Open this link in a new tab?" checkbox, that fills in the target: "_blank" meta attribute for links (default: true) */
18
18
  show_links_target_blank?: boolean;
19
- /** Whether you want to show the complete meta editor for links */
19
+ /** Whether you want to show the complete meta editor for links (default: false) */
20
20
  show_links_meta_editor?: boolean;
21
21
  };
@@ -2,8 +2,8 @@
2
2
  * HTML editor for Multiple-paragraph text fields.
3
3
  */
4
4
  export type WysiwygEditorConfiguration = {
5
- /** Specify which buttons the toolbar should have */
6
- toolbar: Array<
5
+ /** Specify which buttons the toolbar should have (default: ['format', 'bold', 'italic', 'strikethrough', 'ordered_list', 'unordered_list', 'quote', 'table', 'link', 'image', 'show_source', 'fullscreen']) */
6
+ toolbar?: Array<
7
7
  | 'format'
8
8
  | 'bold'
9
9
  | 'italic'
@@ -107,7 +107,7 @@ export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> =
107
107
 
108
108
  export type BlockInNestedResponse<
109
109
  D extends ItemTypeDefinition = ItemTypeDefinition,
110
- > = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
110
+ > = RawApiTypes.ItemInNestedResponse<D>;
111
111
 
112
112
  /**
113
113
  * Single Block field value for API requests - allows flexible block representations:
@@ -3,5 +3,5 @@
3
3
  */
4
4
  export type SanitizedHtmlValidator = {
5
5
  /** Content is actively sanitized before applying the validation */
6
- sanitize_before_validation: boolean;
6
+ sanitize_before_validation?: boolean;
7
7
  };
@@ -27,35 +27,40 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
27
27
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
28
28
  };
29
29
 
30
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
31
- __itemTypeId?: D['itemTypeId'];
32
- id: ItemIdentity;
33
- type: ItemType1;
34
- item_type: ItemTypeData<D>;
35
- creator?:
36
- | AccountData
37
- | AccessTokenData
38
- | UserData
39
- | SsoUserData
40
- | OrganizationData;
41
- meta: ItemMeta;
42
- } & ToItemAttributes<D>;
30
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> =
31
+ D extends ItemTypeDefinition
32
+ ? {
33
+ __itemTypeId?: D['itemTypeId'];
34
+ id: ItemIdentity;
35
+ type: ItemType1;
36
+ item_type: ItemTypeData<D>;
37
+ creator?:
38
+ | AccountData
39
+ | AccessTokenData
40
+ | UserData
41
+ | SsoUserData
42
+ | OrganizationData;
43
+ meta: ItemMeta;
44
+ } & ToItemAttributes<D>
45
+ : never;
43
46
 
44
47
  export type ItemInNestedResponse<
45
48
  D extends ItemTypeDefinition = ItemTypeDefinition,
46
- > = {
47
- __itemTypeId?: D['itemTypeId'];
48
- id: ItemIdentity;
49
- type: ItemType1;
50
- item_type: ItemTypeData<D>;
51
- creator?:
52
- | AccountData
53
- | AccessTokenData
54
- | UserData
55
- | SsoUserData
56
- | OrganizationData;
57
- meta: ItemMeta;
58
- } & ToItemAttributesInNestedResponse<D>;
49
+ > = D extends ItemTypeDefinition
50
+ ? {
51
+ __itemTypeId?: D['itemTypeId'];
52
+ id: ItemIdentity;
53
+ type: ItemType1;
54
+ item_type: ItemTypeData<D>;
55
+ creator?:
56
+ | AccountData
57
+ | AccessTokenData
58
+ | UserData
59
+ | SsoUserData
60
+ | OrganizationData;
61
+ meta: ItemMeta;
62
+ } & ToItemAttributesInNestedResponse<D>
63
+ : never;
59
64
 
60
65
  /* tslint:disable */
61
66
  /**
@@ -151,7 +151,7 @@ export class Client {
151
151
  ...this.config,
152
152
  ...options,
153
153
  logFn: this.config.logFn || console.log,
154
- userAgent: '@datocms/cma-client v5.4.14',
154
+ userAgent: '@datocms/cma-client v5.4.16',
155
155
  baseUrl: this.baseUrl,
156
156
  preCallStack: new Error().stack,
157
157
  extraHeaders: {
@@ -39,25 +39,30 @@ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
39
39
  id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
40
40
  };
41
41
 
42
- export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
43
- __itemTypeId?: D['itemTypeId'];
44
- type: ItemType1;
45
- id: ItemIdentity;
46
- relationships: ItemRelationships<D>;
47
- meta: ItemMeta;
48
- attributes: ToItemAttributes<D>;
49
- };
42
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> =
43
+ D extends ItemTypeDefinition
44
+ ? {
45
+ __itemTypeId?: D['itemTypeId'];
46
+ type: ItemType1;
47
+ id: ItemIdentity;
48
+ relationships: ItemRelationships<D>;
49
+ meta: ItemMeta;
50
+ attributes: ToItemAttributes<D>;
51
+ }
52
+ : never;
50
53
 
51
54
  export type ItemInNestedResponse<
52
55
  D extends ItemTypeDefinition = ItemTypeDefinition,
53
- > = {
54
- __itemTypeId?: D['itemTypeId'];
55
- type: ItemType1;
56
- id: ItemIdentity;
57
- relationships: ItemRelationships<D>;
58
- meta: ItemMeta;
59
- attributes: ToItemAttributesInNestedResponse<D>;
60
- };
56
+ > = D extends ItemTypeDefinition
57
+ ? {
58
+ __itemTypeId?: D['itemTypeId'];
59
+ type: ItemType1;
60
+ id: ItemIdentity;
61
+ relationships: ItemRelationships<D>;
62
+ meta: ItemMeta;
63
+ attributes: ToItemAttributesInNestedResponse<D>;
64
+ }
65
+ : never;
61
66
 
62
67
  /* tslint:disable */
63
68
  /**