@storyblok/management-api-client 0.2.4 → 1.0.0-alpha.1

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 (74) hide show
  1. package/dist/client.cjs +190 -0
  2. package/dist/client.cjs.map +1 -0
  3. package/dist/client.d.cts +624 -0
  4. package/dist/client.d.mts +624 -0
  5. package/dist/client.mjs +189 -0
  6. package/dist/client.mjs.map +1 -0
  7. package/dist/error.cjs.map +1 -1
  8. package/dist/error.d.cts +12 -2
  9. package/dist/error.d.mts +12 -2
  10. package/dist/error.mjs.map +1 -1
  11. package/dist/generated/asset_folders/types.gen.d.cts +5 -31
  12. package/dist/generated/asset_folders/types.gen.d.mts +5 -31
  13. package/dist/generated/assets/types.gen.d.cts +1 -73
  14. package/dist/generated/assets/types.gen.d.mts +1 -73
  15. package/dist/generated/component_folders/types.gen.d.cts +29 -45
  16. package/dist/generated/component_folders/types.gen.d.mts +29 -45
  17. package/dist/generated/components/types.gen.d.cts +636 -465
  18. package/dist/generated/components/types.gen.d.mts +636 -465
  19. package/dist/generated/datasource_entries/types.gen.d.cts +6 -32
  20. package/dist/generated/datasource_entries/types.gen.d.mts +6 -32
  21. package/dist/generated/datasources/types.gen.d.cts +18 -39
  22. package/dist/generated/datasources/types.gen.d.mts +18 -39
  23. package/dist/generated/internal_tags/types.gen.d.cts +28 -32
  24. package/dist/generated/internal_tags/types.gen.d.mts +28 -32
  25. package/dist/generated/presets/types.gen.d.cts +53 -58
  26. package/dist/generated/presets/types.gen.d.mts +53 -58
  27. package/dist/generated/spaces/types.gen.d.cts +1 -41
  28. package/dist/generated/spaces/types.gen.d.mts +1 -41
  29. package/dist/generated/stories/types.gen.d.cts +206 -198
  30. package/dist/generated/stories/types.gen.d.mts +206 -198
  31. package/dist/generated/users/types.gen.d.cts +13 -112
  32. package/dist/generated/users/types.gen.d.mts +13 -112
  33. package/dist/index.cjs +3 -178
  34. package/dist/index.d.cts +8 -425
  35. package/dist/index.d.mts +8 -425
  36. package/dist/index.mjs +2 -176
  37. package/dist/resources/asset-folders.cjs.map +1 -1
  38. package/dist/resources/asset-folders.mjs.map +1 -1
  39. package/dist/resources/assets.cjs +11 -2
  40. package/dist/resources/assets.cjs.map +1 -1
  41. package/dist/resources/assets.d.cts +3 -2
  42. package/dist/resources/assets.d.mts +3 -2
  43. package/dist/resources/assets.mjs +11 -2
  44. package/dist/resources/assets.mjs.map +1 -1
  45. package/dist/resources/component-folders.cjs.map +1 -1
  46. package/dist/resources/component-folders.mjs.map +1 -1
  47. package/dist/resources/components.cjs.map +1 -1
  48. package/dist/resources/components.mjs.map +1 -1
  49. package/dist/resources/datasource-entries.cjs.map +1 -1
  50. package/dist/resources/datasource-entries.mjs.map +1 -1
  51. package/dist/resources/datasources.cjs.map +1 -1
  52. package/dist/resources/datasources.mjs.map +1 -1
  53. package/dist/resources/internal-tags.cjs.map +1 -1
  54. package/dist/resources/internal-tags.mjs.map +1 -1
  55. package/dist/resources/presets.cjs.map +1 -1
  56. package/dist/resources/presets.mjs.map +1 -1
  57. package/dist/resources/spaces.cjs.map +1 -1
  58. package/dist/resources/spaces.mjs.map +1 -1
  59. package/dist/resources/stories.cjs.map +1 -1
  60. package/dist/resources/stories.d.cts +105 -0
  61. package/dist/resources/stories.d.mts +105 -0
  62. package/dist/resources/stories.mjs.map +1 -1
  63. package/dist/resources/users.cjs.map +1 -1
  64. package/dist/resources/users.mjs.map +1 -1
  65. package/package.json +13 -10
  66. package/test/GUIDE.md +59 -0
  67. package/test/setup.e2e.ts +11 -0
  68. package/test/specs/mapi-round-trip.spec.e2e.ts +520 -0
  69. package/vitest.config.e2e.ts +26 -0
  70. package/vitest.config.ts +3 -0
  71. package/dist/index.cjs.map +0 -1
  72. package/dist/index.mjs.map +0 -1
  73. package/dist/types.d.cts +0 -130
  74. package/dist/types.d.mts +0 -130
@@ -1,21 +1,302 @@
1
1
  //#region src/generated/components/types.gen.d.ts
2
- type Component = Component2;
3
2
  /**
4
- * A component schema field object
3
+ * A Storyblok component object representing a content type
4
+ */
5
+ type Component = {
6
+ /**
7
+ * The numeric ID
8
+ */
9
+ readonly id: number;
10
+ /**
11
+ * Technical name used for component property in entries
12
+ */
13
+ name: string;
14
+ /**
15
+ * Name that will be used in the editor interface
16
+ */
17
+ display_name?: string | null;
18
+ /**
19
+ * Creation date
20
+ */
21
+ readonly created_at: string;
22
+ /**
23
+ * Latest update date
24
+ */
25
+ readonly updated_at: string;
26
+ /**
27
+ * Component schema definition containing fields and their configurations
28
+ */
29
+ schema: {
30
+ [key: string]: ComponentSchemaField;
31
+ };
32
+ /**
33
+ * URL to the preview image
34
+ */
35
+ image?: string | null;
36
+ /**
37
+ * The field that is for preview in the interface (Preview Field)
38
+ */
39
+ preview_field?: string | null;
40
+ /**
41
+ * Whether the component can be used as a root component
42
+ */
43
+ is_root?: boolean;
44
+ /**
45
+ * Preview template for the component
46
+ */
47
+ preview_tmpl?: string | null;
48
+ /**
49
+ * True if the component is nestable (insertable) in block field types
50
+ */
51
+ is_nestable?: boolean;
52
+ /**
53
+ * An array of presets for this component
54
+ */
55
+ all_presets?: Array<{
56
+ /**
57
+ * The numeric ID of the preset
58
+ */
59
+ id?: number;
60
+ /**
61
+ * Name of the preset
62
+ */
63
+ name?: string;
64
+ /**
65
+ * The ID of the component the preset is for
66
+ */
67
+ component_id?: number;
68
+ /**
69
+ * Link to the preview image of the preset
70
+ */
71
+ image?: string | null;
72
+ /**
73
+ * Icon selected for the preset
74
+ */
75
+ icon?: string | null;
76
+ /**
77
+ * Color of the icon selected for the preset
78
+ */
79
+ color?: string | null;
80
+ /**
81
+ * The description of the preset
82
+ */
83
+ description?: string;
84
+ }>;
85
+ /**
86
+ * ID of the preset currently selected for this component
87
+ */
88
+ preset_id?: number | null;
89
+ /**
90
+ * Duplicated technical name or display name, used for internal tasks
91
+ */
92
+ real_name?: string;
93
+ /**
94
+ * The component folder ID of the component
95
+ */
96
+ component_group_uuid?: string;
97
+ /**
98
+ * The color of the icon selected for the component
99
+ */
100
+ color?: string | null;
101
+ /**
102
+ * Icon selected for the component
103
+ */
104
+ icon?: string | null;
105
+ /**
106
+ * List of internal tags assigned to the component
107
+ */
108
+ internal_tags_list?: Array<{
109
+ /**
110
+ * Tag ID
111
+ */
112
+ id?: number;
113
+ /**
114
+ * Tag name
115
+ */
116
+ name?: string;
117
+ }>;
118
+ /**
119
+ * List of IDs of the tags assigned to the component
120
+ */
121
+ internal_tag_ids?: Array<string>;
122
+ /**
123
+ * Asset preview field (Preview Card) for a content type component
124
+ */
125
+ content_type_asset_preview?: string | null;
126
+ };
127
+ /**
128
+ * A component schema field — discriminated union on `type`.
129
+ */
130
+ type ComponentSchemaField = ({
131
+ type: 'text';
132
+ } & TextField) | ({
133
+ type: 'textarea';
134
+ } & TextareaField) | ({
135
+ type: 'richtext';
136
+ } & RichtextField) | ({
137
+ type: 'markdown';
138
+ } & MarkdownField) | ({
139
+ type: 'number';
140
+ } & NumberField) | ({
141
+ type: 'datetime';
142
+ } & DatetimeField) | ({
143
+ type: 'boolean';
144
+ } & BooleanField) | ({
145
+ type: 'option';
146
+ } & OptionField) | ({
147
+ type: 'options';
148
+ } & OptionsField) | ({
149
+ type: 'asset';
150
+ } & AssetField) | ({
151
+ type: 'multiasset';
152
+ } & MultiassetField) | ({
153
+ type: 'multilink';
154
+ } & MultilinkField) | ({
155
+ type: 'bloks';
156
+ } & BloksField) | ({
157
+ type: 'table';
158
+ } & TableField) | ({
159
+ type: 'section';
160
+ } & SectionField) | ({
161
+ type: 'tab';
162
+ } & TabField) | ({
163
+ type: 'custom';
164
+ } & CustomField);
165
+ /**
166
+ * Input for creating a component.
5
167
  */
6
- type ComponentSchemaField = {
168
+ type ComponentCreate = {
7
169
  /**
8
- * Field type (text, textarea, number, boolean, etc.)
170
+ * Technical name used for component property in entries
171
+ */
172
+ name: string;
173
+ /**
174
+ * Name that will be used in the editor interface
175
+ */
176
+ display_name?: string | null;
177
+ /**
178
+ * Component schema definition containing fields and their configurations
179
+ */
180
+ schema?: {
181
+ [key: string]: ComponentSchemaField;
182
+ };
183
+ /**
184
+ * Whether the component can be used as a root component
185
+ */
186
+ is_root?: boolean;
187
+ /**
188
+ * Whether the component is nestable in block field types
189
+ */
190
+ is_nestable?: boolean;
191
+ /**
192
+ * The component folder UUID
193
+ */
194
+ component_group_uuid?: string;
195
+ /**
196
+ * Icon color
197
+ */
198
+ color?: string;
199
+ /**
200
+ * Icon name
201
+ */
202
+ icon?: string;
203
+ /**
204
+ * The field used for preview in the interface
205
+ */
206
+ preview_field?: string;
207
+ /**
208
+ * IDs of internal tags to assign
209
+ */
210
+ internal_tag_ids?: Array<string>;
211
+ };
212
+ /**
213
+ * Input for updating a component.
214
+ */
215
+ type ComponentUpdate = {
216
+ /**
217
+ * Technical name used for component property in entries
218
+ */
219
+ name?: string;
220
+ /**
221
+ * Name that will be used in the editor interface
222
+ */
223
+ display_name?: string | null;
224
+ /**
225
+ * Component schema definition containing fields and their configurations
226
+ */
227
+ schema?: {
228
+ [key: string]: ComponentSchemaField;
229
+ };
230
+ /**
231
+ * Whether the component can be used as a root component
232
+ */
233
+ is_root?: boolean;
234
+ /**
235
+ * Whether the component is nestable in block field types
236
+ */
237
+ is_nestable?: boolean;
238
+ /**
239
+ * The component folder UUID
240
+ */
241
+ component_group_uuid?: string;
242
+ /**
243
+ * Icon color
244
+ */
245
+ color?: string;
246
+ /**
247
+ * Icon name
248
+ */
249
+ icon?: string;
250
+ /**
251
+ * The field used for preview in the interface
252
+ */
253
+ preview_field?: string;
254
+ /**
255
+ * IDs of internal tags to assign
256
+ */
257
+ internal_tag_ids?: Array<string>;
258
+ };
259
+ /**
260
+ * Universal identity and display properties shared by every field type
261
+ */
262
+ type BaseField = {
263
+ /**
264
+ * Field type discriminant
9
265
  */
10
266
  type?: string;
11
267
  /**
12
- * Position of the field
268
+ * The ID of the field
13
269
  */
14
- pos?: number;
270
+ id?: string;
15
271
  /**
16
272
  * Human-readable display name
17
273
  */
18
274
  display_name?: string;
275
+ /**
276
+ * Field description displayed in the editor
277
+ */
278
+ description?: string;
279
+ /**
280
+ * Whether to display the description as a tooltip
281
+ */
282
+ tooltip?: boolean;
283
+ /**
284
+ * Position of the field within the block
285
+ */
286
+ pos?: number;
287
+ /**
288
+ * Conditions set on the field for conditional visibility
289
+ */
290
+ conditional_settings?: Array<{
291
+ [key: string]: unknown;
292
+ }>;
293
+ };
294
+ /**
295
+ * Properties shared by content-bearing fields (i.e. fields that hold a value).
296
+ * Layout-only field types like `section` and `tab` do not include these.
297
+ *
298
+ */
299
+ type ValueField = {
19
300
  /**
20
301
  * Whether the field is required
21
302
  */
@@ -24,48 +305,72 @@ type ComponentSchemaField = {
24
305
  * Regular expression for validation
25
306
  */
26
307
  regex?: string;
308
+ /**
309
+ * Default value for the field (can be escaped JSON)
310
+ */
311
+ default_value?: string;
27
312
  /**
28
313
  * Whether the field is translatable
29
314
  */
30
315
  translatable?: boolean;
31
316
  /**
32
- * Field description
317
+ * Exclude the field from translation exports
33
318
  */
34
- description?: string;
319
+ no_translate?: boolean;
35
320
  /**
36
- * Default value for the field
321
+ * Exclude the field from AI translations
37
322
  */
38
- default_value?: string;
323
+ exclude_from_ai_translation?: boolean;
39
324
  /**
40
- * Array of datasource entries [{name:"", value:""}]; Effects editor only if source=undefined. For field type option.
325
+ * Exclude the field when merging (Dimensions App)
41
326
  */
42
- options?: Array<{
43
- _uid?: string;
44
- name?: string;
45
- value?: string;
46
- }>;
327
+ exclude_from_merge?: boolean;
47
328
  /**
48
- * The source of Single-Option and Multi-Options fields
329
+ * Exclude the field when overwriting (Dimensions App)
49
330
  */
50
- source?: 'internal_stories' | 'internal_languages' | 'external' | 'internal';
331
+ exclude_from_overwrite?: boolean;
51
332
  /**
52
- * When the source is set to internal_stories, set the path of the allowed stories folder
333
+ * Overwrite the field when merging (Dimensions App)
53
334
  */
54
- folder_slug?: string;
335
+ force_merge?: boolean;
336
+ };
337
+ type TextField = BaseField & ValueField & {
55
338
  /**
56
- * Allowed file types for Asset and Multi-Assets fields (e.g. images, videos, audios, texts)
339
+ * Field type discriminant
57
340
  */
58
- filetypes?: Array<string>;
341
+ type: 'text';
59
342
  /**
60
- * The maximal number of components allowed inside a Blocks field
343
+ * Maximum length of the input string
61
344
  */
62
- maximum?: number;
345
+ max_length?: number;
63
346
  /**
64
- * The minimal number of components allowed inside a Blocks field
347
+ * Maximum length for text fields (legacy alias for max_length)
65
348
  */
66
- minimum?: number;
349
+ maxlength?: number;
350
+ /**
351
+ * Minimum length for text fields
352
+ */
353
+ minlength?: number;
354
+ /**
355
+ * Field size (small, medium, large)
356
+ */
357
+ size?: string;
67
358
  /**
68
- * Maximum length for text fields
359
+ * Whether to enable right-to-left text direction
360
+ */
361
+ rtl?: boolean;
362
+ };
363
+ type TextareaField = BaseField & ValueField & {
364
+ /**
365
+ * Field type discriminant
366
+ */
367
+ type: 'textarea';
368
+ /**
369
+ * Maximum length of the input string
370
+ */
371
+ max_length?: number;
372
+ /**
373
+ * Maximum length for text fields (legacy alias for max_length)
69
374
  */
70
375
  maxlength?: number;
71
376
  /**
@@ -73,9 +378,13 @@ type ComponentSchemaField = {
73
378
  */
74
379
  minlength?: number;
75
380
  /**
76
- * Whether rich markdown is enabled
381
+ * Field size (small, medium, large)
382
+ */
383
+ size?: string;
384
+ /**
385
+ * Whether to enable right-to-left text direction
77
386
  */
78
- rich_markdown?: boolean;
387
+ rtl?: boolean;
79
388
  /**
80
389
  * Whether rich text is enabled
81
390
  */
@@ -84,532 +393,520 @@ type ComponentSchemaField = {
84
393
  * Whether markdown is enabled
85
394
  */
86
395
  markdown?: boolean;
396
+ };
397
+ type RichtextField = BaseField & ValueField & {
87
398
  /**
88
- * Field size (small, medium, large)
399
+ * Field type discriminant
89
400
  */
90
- size?: string;
401
+ type: 'richtext';
91
402
  /**
92
- * Field height in pixels
403
+ * Whether to allow toolbar customization
93
404
  */
94
- height?: number;
405
+ customize_toolbar?: boolean;
95
406
  /**
96
- * Field width in pixels
407
+ * Array of enabled toolbar elements
97
408
  */
98
- width?: number;
409
+ toolbar?: Array<'ai-complete' | 'ai-shorten' | 'ai-extend' | 'ai-rephrase' | 'ai-summarize' | 'ai-simplify' | 'ai-tone' | 'ai-emoji' | 'ai-translate' | 'ai-tldr' | 'ai-spelling' | 'blok' | 'ltr' | 'rtl' | 'export' | 'import' | 'bold' | 'list' | 'inlinecode' | 'code' | 'color' | 'copy' | 'cut' | 'emoji' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'highlight' | 'unset' | 'hrule' | 'image' | 'italic' | 'link' | 'anchor' | 'olist' | 'paragraph' | 'paste-action' | 'paste' | 'quote' | 'redo' | 'strike' | 'subscript' | 'superscript' | 'underline' | 'undo' | 'align-left' | 'align-center' | 'align-right' | 'align-justify'>;
99
410
  /**
100
- * When the source is set to internal_stories, displays the UUID of the selected story. Defaults to true.
411
+ * Custom CSS styles for the richtext field
101
412
  */
102
- use_uuid?: boolean;
413
+ style_options?: Array<{
414
+ _uid?: string;
415
+ name?: string;
416
+ value?: string;
417
+ }>;
103
418
  /**
104
- * Whether to restrict content types
419
+ * Restriction type for component selection (groups, tags, or empty for specific blocks)
105
420
  */
106
- restrict_content_types?: boolean;
421
+ restrict_type?: string;
107
422
  /**
108
- * Allow or deny access to nestable blocks inside Blocks and Richtext fields. Defaults to false (allowed).
423
+ * Whether to restrict which components can be inserted
109
424
  */
110
425
  restrict_components?: boolean;
111
426
  /**
112
- * Specify which blocks are allowed or not inside Blocks and Richtext fields. Supported types are groups (blocks in specific folders), tags (blocks assigned to specific tags), or "" for specific blocks (components).
113
- */
114
- restrict_type?: 'groups' | 'tags' | '';
115
- /**
116
- * An array of nestable or universal type block names allowed inside Blocks, Link, and Richtext fields
427
+ * List of allowed component names
117
428
  */
118
429
  component_whitelist?: Array<string>;
119
430
  /**
120
- * An array of block names not allowed inside Blocks, Link, and Richtext fields
431
+ * List of denied component names
121
432
  */
122
433
  component_denylist?: Array<string>;
123
434
  /**
124
- * An array of group (folder) UUIDs that contain blocks allowed inside Blocks and Richtext fields
435
+ * List of allowed tag IDs for component filtering
436
+ */
437
+ component_tag_whitelist?: Array<number>;
438
+ /**
439
+ * List of denied tag IDs for component filtering
440
+ */
441
+ component_tag_denylist?: Array<number>;
442
+ /**
443
+ * List of allowed component group UUIDs
125
444
  */
126
445
  component_group_whitelist?: Array<string>;
127
446
  /**
128
- * An array of group (folder) UUIDs that contain blocks not allowed inside Blocks and Richtext fields
447
+ * List of denied component group UUIDs
129
448
  */
130
449
  component_group_denylist?: Array<string>;
131
450
  /**
132
- * An array of tag IDs assigned to blocks allowed inside Blocks and Richtext fields
451
+ * Whether to allow links to open in a new tab
133
452
  */
134
- component_tag_whitelist?: Array<number>;
453
+ allow_target_blank?: boolean;
135
454
  /**
136
- * An array of tag IDs assigned to blocks not allowed inside Blocks and Richtext fields
455
+ * Whether to allow custom link attributes
137
456
  */
138
- component_tag_denylist?: Array<number>;
457
+ allow_custom_attributes?: boolean;
458
+ };
459
+ type MarkdownField = BaseField & ValueField & {
139
460
  /**
140
- * Maximum number of entries
461
+ * Field type discriminant
141
462
  */
142
- maximum_entries?: number;
463
+ type: 'markdown';
143
464
  /**
144
- * Minimum number of entries
465
+ * Whether to display markdown as rich text
145
466
  */
146
- minimum_entries?: number;
467
+ rich_markdown?: boolean;
147
468
  /**
148
- * Whether to restrict assets
469
+ * Whether to enable right-to-left text direction
149
470
  */
150
- restrict_assets?: boolean;
471
+ rtl?: boolean;
151
472
  /**
152
- * List of allowed asset types
473
+ * Whether to enable a customized toolbar
153
474
  */
154
- asset_whitelist?: Array<string>;
475
+ customize_toolbar?: boolean;
155
476
  /**
156
- * Numeric ID of the asset folder allowed in Asset and Multi-Assets fields
477
+ * Array of enabled toolbar elements
157
478
  */
158
- asset_folder_id?: number;
479
+ toolbar?: Array<'bold' | 'italic' | 'inlinecode' | 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'list' | 'olist' | 'quote' | 'hrule' | 'link' | 'image' | 'paragraph' | 'help' | 'toggle-richtext' | 'auto' | 'ltr' | 'rtl'>;
159
480
  /**
160
- * Allow loading assets from an external URL in Asset and Multi-Assets fields. Defaults to false.
481
+ * Whether to allow empty paragraphs
161
482
  */
162
- allow_external_url?: boolean;
483
+ allow_multiline?: boolean;
163
484
  /**
164
- * Whether to exclude empty option
485
+ * Maximum length of the input string
165
486
  */
166
- exclude_empty_option?: boolean;
487
+ max_length?: number;
488
+ };
489
+ type NumberField = BaseField & ValueField & {
167
490
  /**
168
- * Whether to include empty option
491
+ * Field type discriminant
169
492
  */
170
- include_empty_option?: boolean;
493
+ type: 'number';
171
494
  /**
172
- * When the source is set to internal (Datasource), the selectable datasource slug
495
+ * Minimum value allowed
173
496
  */
174
- datasource_slug?: string;
497
+ min_value?: number;
175
498
  /**
176
- * When the source is set to external, the datasource JSON URL
499
+ * Maximum value allowed
177
500
  */
178
- external_datasource?: string;
501
+ max_value?: number;
179
502
  /**
180
- * When the source is set to internal_stories, allow users to select stories from an array of permitted content type blocks
503
+ * Number of decimal places
181
504
  */
182
- filter_content_type?: Array<string>;
505
+ decimals?: number;
183
506
  /**
184
- * When the source is set to internal_stories, specify if the option appears as a link (default) or a card
507
+ * Step size for the number input
185
508
  */
186
- entry_appearance?: string;
509
+ steps?: number;
510
+ };
511
+ type DatetimeField = BaseField & ValueField & {
187
512
  /**
188
- * When the source is set to internal_stories, allow users to search stories in a modal window. Defaults to false.
513
+ * Field type discriminant
189
514
  */
190
- allow_advanced_search?: boolean;
515
+ type: 'datetime';
191
516
  /**
192
- * Set to true if the Multi-Options field is a References field
517
+ * Whether to disable time selection (date-only mode)
193
518
  */
194
- is_reference_type?: boolean;
519
+ disable_time?: boolean;
520
+ };
521
+ type BooleanField = BaseField & ValueField & {
195
522
  /**
196
- * The maximal number of selectable options in Single-Option, Multi-Options, and References fields
523
+ * Field type discriminant
197
524
  */
198
- max_options?: string;
525
+ type: 'boolean';
199
526
  /**
200
- * The minimal number of selectable options in Single-Option, Multi-Options, and References fields
527
+ * Whether to display the label next to the toggle
201
528
  */
202
- min_options?: string;
529
+ inline_label?: boolean;
530
+ };
531
+ type OptionField = BaseField & ValueField & {
203
532
  /**
204
- * Whether multiple values are allowed
533
+ * Field type discriminant
205
534
  */
206
- multiple?: boolean;
535
+ type: 'option';
207
536
  /**
208
- * Allow specifying an email address in a Link field. Defaults to false.
537
+ * Array of selectable options
209
538
  */
210
- email_link_type?: boolean;
539
+ options?: Array<{
540
+ _uid?: string;
541
+ name?: string;
542
+ value?: string;
543
+ }>;
211
544
  /**
212
- * Allow specifying an asset's URL in a Link field. Defaults to false.
545
+ * Source of the options (undefined=self, internal_stories, internal_languages, external, internal)
213
546
  */
214
- asset_link_type?: boolean;
547
+ source?: string;
215
548
  /**
216
- * When the URL in a Link field is an Internal link, allow users to define an anchor ID. Defaults to false.
549
+ * Datasource slug when source is internal
217
550
  */
218
- show_anchor?: boolean;
551
+ datasource_slug?: string;
219
552
  /**
220
- * Allow links to open in a new tab. Defaults to false.
553
+ * External datasource JSON URL when source is external
221
554
  */
222
- allow_target_blank?: boolean;
555
+ external_datasource?: string;
223
556
  /**
224
- * Allow setting custom attributes in a Link field. Defaults to false.
557
+ * Path of allowed stories folder when source is internal_stories
225
558
  */
226
- allow_custom_attributes?: boolean;
559
+ folder_slug?: string;
227
560
  /**
228
- * When the URL in a Link field is an Internal link, allow users to only select stories from a specific folder. Defaults to false.
561
+ * Allowed content type blocks when source is internal_stories
229
562
  */
230
- force_link_scope?: boolean;
563
+ filter_content_type?: Array<string>;
231
564
  /**
232
- * When force_link_scope is set to true, specify the allowed path
565
+ * Whether to exclude the empty option
233
566
  */
234
- link_scope?: string;
567
+ exclude_empty_option?: boolean;
235
568
  /**
236
- * Exclude Text and number fields from translation exports
569
+ * Whether to include an empty option
237
570
  */
238
- no_translate?: boolean;
571
+ include_empty_option?: boolean;
239
572
  /**
240
- * Enable global right-to-left (RTL) support in Markdown, Text, and Textarea fields
573
+ * Whether to use UUID for the option value
241
574
  */
242
- rtl?: boolean;
575
+ use_uuid?: boolean;
243
576
  /**
244
- * Set to true to display the description as a tooltip. Defaults to false.
577
+ * Display appearance (link or card) when source is internal_stories
245
578
  */
246
- tooltip?: boolean;
579
+ entry_appearance?: string;
247
580
  /**
248
- * The ID of the field
581
+ * Whether to allow advanced search in a modal when source is internal_stories
249
582
  */
250
- id?: string;
583
+ allow_advanced_search?: boolean;
251
584
  /**
252
- * Set the maximum length of the input string in Markdown, Text, and Textarea fields
585
+ * Maximum number of selectable options
253
586
  */
254
- max_length?: number;
587
+ max_options?: string;
255
588
  /**
256
- * Objects containing data about custom CSS set inside the Richtext field
589
+ * Minimum number of selectable options
257
590
  */
258
- style_options?: Array<{
259
- /**
260
- * The unique ID of the style within the story
261
- */
591
+ min_options?: string;
592
+ /**
593
+ * Whether multiple values are allowed
594
+ */
595
+ multiple?: boolean;
596
+ };
597
+ type OptionsField = BaseField & ValueField & {
598
+ /**
599
+ * Field type discriminant
600
+ */
601
+ type: 'options';
602
+ /**
603
+ * Array of selectable options
604
+ */
605
+ options?: Array<{
262
606
  _uid?: string;
263
- /**
264
- * The style's name
265
- */
266
607
  name?: string;
267
- /**
268
- * The style's value
269
- */
270
608
  value?: string;
271
609
  }>;
272
610
  /**
273
- * Set to true to enable a customized toolbar in Markdown and Richtext fields. Defaults to false.
611
+ * Source of the options (undefined=self, internal_stories, internal_languages, external, internal)
274
612
  */
275
- customize_toolbar?: boolean;
613
+ source?: string;
276
614
  /**
277
- * An array of enabled toolbar elements
615
+ * Datasource slug when source is internal
278
616
  */
279
- toolbar?: Array<string>;
617
+ datasource_slug?: string;
280
618
  /**
281
- * Allow empty paragraphs in Markdown fields. Defaults to false.
619
+ * External datasource JSON URL when source is external
282
620
  */
283
- allow_multiline?: boolean;
621
+ external_datasource?: string;
284
622
  /**
285
- * The minimal value allowed in a Number field
623
+ * Path of allowed stories folder when source is internal_stories
286
624
  */
287
- min_value?: number;
625
+ folder_slug?: string;
288
626
  /**
289
- * The maximal value allowed in a Number field
627
+ * Allowed content type blocks when source is internal_stories
290
628
  */
291
- max_value?: number;
629
+ filter_content_type?: Array<string>;
292
630
  /**
293
- * The number of decimal places that appear after the point in a Number field
631
+ * Whether to use UUID for the option values
294
632
  */
295
- decimals?: number;
633
+ use_uuid?: boolean;
296
634
  /**
297
- * The interval between numbers in a Number field
635
+ * Whether this Multi-Options field is a References field
298
636
  */
299
- steps?: number;
637
+ is_reference_type?: boolean;
300
638
  /**
301
- * Disable time selection in the date picker of a Date/Time field. Defaults to false.
639
+ * Display appearance (link or card) when source is internal_stories
302
640
  */
303
- disable_time?: boolean;
641
+ entry_appearance?: string;
304
642
  /**
305
- * Display a Boolean field's label next to the toggle
643
+ * Whether to allow advanced search in a modal when source is internal_stories
306
644
  */
307
- inline_label?: boolean;
645
+ allow_advanced_search?: boolean;
308
646
  /**
309
- * An array of field keys displayed in a Group field
647
+ * Maximum number of selectable options
310
648
  */
311
- keys?: Array<string>;
649
+ max_options?: string;
312
650
  /**
313
- * The name of the field type plugin used in a Plugin field
651
+ * Minimum number of selectable options
314
652
  */
315
- field_type?: string;
653
+ min_options?: string;
316
654
  /**
317
- * A comma-separated list of names of fields the user is required to fill in in a Plugin field
655
+ * Whether multiple values are allowed
318
656
  */
319
- required_fields?: string;
657
+ multiple?: boolean;
658
+ };
659
+ type AssetField = BaseField & ValueField & {
320
660
  /**
321
- * Exclude the field from AI translations
661
+ * Field type discriminant
322
662
  */
323
- exclude_from_ai_translation?: boolean;
663
+ type: 'asset';
324
664
  /**
325
- * Exclude the field when merging
665
+ * Allowed file types (images, videos, audios, texts)
326
666
  */
327
- exclude_from_merge?: boolean;
667
+ filetypes?: Array<string>;
328
668
  /**
329
- * Exclude the field when overwriting
669
+ * Numeric ID of the allowed asset folder
330
670
  */
331
- exclude_from_overwrite?: boolean;
671
+ asset_folder_id?: number;
332
672
  /**
333
- * Overwrite the field when merging
673
+ * Whether to allow external URLs
334
674
  */
335
- force_merge?: boolean;
675
+ allow_external_url?: boolean;
336
676
  /**
337
- * An array that contains an object with information about conditions set on the field
677
+ * Field height in pixels
338
678
  */
339
- conditional_settings?: Array<{
340
- [key: string]: unknown;
341
- }>;
679
+ height?: number;
342
680
  /**
343
- * Custom CSS for the field
681
+ * Field width in pixels
344
682
  */
345
- custom_css?: string;
683
+ width?: number;
346
684
  /**
347
- * Custom JavaScript for the field
685
+ * Whether to restrict assets
348
686
  */
349
- custom_js?: string;
687
+ restrict_assets?: boolean;
350
688
  /**
351
- * API connection configuration
689
+ * List of allowed asset types
352
690
  */
353
- api_connection?: {
354
- /**
355
- * API URL
356
- */
357
- url?: string;
358
- /**
359
- * API headers
360
- */
361
- headers?: {
362
- [key: string]: unknown;
363
- };
364
- /**
365
- * API parameters
366
- */
367
- params?: {
368
- [key: string]: unknown;
369
- };
370
- };
691
+ asset_whitelist?: Array<string>;
692
+ };
693
+ type MultiassetField = BaseField & ValueField & {
371
694
  /**
372
- * Fieldset configuration
695
+ * Field type discriminant
373
696
  */
374
- fieldset?: {
375
- /**
376
- * Fieldset title
377
- */
378
- title?: string;
379
- /**
380
- * Fieldset description
381
- */
382
- description?: string;
383
- /**
384
- * Whether the fieldset is collapsible
385
- */
386
- collapsible?: boolean;
387
- /**
388
- * Whether the fieldset is collapsed by default
389
- */
390
- collapsed?: boolean;
391
- };
392
- };
393
- type ComponentCreate = ComponentCreate2;
394
- type ComponentUpdate = ComponentUpdate2;
395
- /**
396
- * A Storyblok component object representing a content type
397
- */
398
- type Component2 = {
697
+ type: 'multiasset';
399
698
  /**
400
- * The numeric ID
699
+ * Allowed file types (images, videos, audios, texts)
401
700
  */
402
- readonly id: number;
701
+ filetypes?: Array<string>;
403
702
  /**
404
- * Technical name used for component property in entries
703
+ * Numeric ID of the allowed asset folder
405
704
  */
406
- name: string;
705
+ asset_folder_id?: number;
407
706
  /**
408
- * Name that will be used in the editor interface
707
+ * Whether to allow external URLs
708
+ */
709
+ allow_external_url?: boolean;
710
+ /**
711
+ * Field height in pixels
712
+ */
713
+ height?: number;
714
+ /**
715
+ * Field width in pixels
716
+ */
717
+ width?: number;
718
+ /**
719
+ * Whether to restrict assets
409
720
  */
410
- display_name?: string | null;
721
+ restrict_assets?: boolean;
411
722
  /**
412
- * Creation date
723
+ * List of allowed asset types
413
724
  */
414
- readonly created_at: string;
725
+ asset_whitelist?: Array<string>;
415
726
  /**
416
- * Latest update date
727
+ * Maximum number of entries
417
728
  */
418
- readonly updated_at: string;
729
+ maximum_entries?: number;
419
730
  /**
420
- * Component schema definition containing fields and their configurations
731
+ * Minimum number of entries
421
732
  */
422
- schema: {
423
- [key: string]: unknown;
424
- };
733
+ minimum_entries?: number;
734
+ };
735
+ type MultilinkField = BaseField & ValueField & {
425
736
  /**
426
- * URL to the preview image
737
+ * Field type discriminant
427
738
  */
428
- image?: string | null;
739
+ type: 'multilink';
429
740
  /**
430
- * The field that is for preview in the interface (Preview Field)
741
+ * Whether to restrict linkable content types
431
742
  */
432
- preview_field?: string;
743
+ restrict_content_types?: boolean;
433
744
  /**
434
- * Whether the component can be used as a root component
745
+ * List of allowed content type blocks for internal links
435
746
  */
436
- is_root?: boolean;
747
+ component_whitelist?: Array<string>;
437
748
  /**
438
- * Preview template for the component
749
+ * Whether to allow opening links in a new tab
439
750
  */
440
- preview_tmpl?: string | null;
751
+ allow_target_blank?: boolean;
441
752
  /**
442
- * True if the component is nestable (insertable) in block field types
753
+ * Whether to allow setting custom link attributes
443
754
  */
444
- is_nestable?: boolean;
755
+ allow_custom_attributes?: boolean;
445
756
  /**
446
- * An array of presets for this component
757
+ * Whether to restrict to a specific folder
447
758
  */
448
- all_presets?: Array<{
449
- /**
450
- * The numeric ID of the preset
451
- */
452
- id?: number;
453
- /**
454
- * Name of the preset
455
- */
456
- name?: string;
457
- /**
458
- * The ID of the component the preset is for
459
- */
460
- component_id?: number;
461
- /**
462
- * Link to the preview image of the preset
463
- */
464
- image?: string | null;
465
- /**
466
- * Icon selected for the preset
467
- */
468
- icon?: string;
469
- /**
470
- * Color of the icon selected for the preset
471
- */
472
- color?: string;
473
- /**
474
- * The description of the preset
475
- */
476
- description?: string;
477
- }>;
759
+ force_link_scope?: boolean;
478
760
  /**
479
- * ID of the preset currently selected for this component
761
+ * Path of the allowed folder when force_link_scope is true
480
762
  */
481
- preset_id?: number | null;
763
+ link_scope?: string;
482
764
  /**
483
- * Duplicated technical name or display name, used for internal tasks
765
+ * Whether to allow defining an anchor ID for internal links
484
766
  */
485
- real_name?: string;
767
+ show_anchor?: boolean;
486
768
  /**
487
- * The component folder ID of the component
769
+ * Whether to allow specifying an email address
488
770
  */
489
- component_group_uuid?: string;
771
+ email_link_type?: boolean;
490
772
  /**
491
- * The color of the icon selected for the component
773
+ * Whether to allow specifying an asset URL
492
774
  */
493
- color?: string;
775
+ asset_link_type?: boolean;
776
+ };
777
+ type BloksField = BaseField & ValueField & {
494
778
  /**
495
- * Icon selected for the component
779
+ * Field type discriminant
496
780
  */
497
- icon?: string;
781
+ type: 'bloks';
498
782
  /**
499
- * List of internal tags assigned to the component
783
+ * Restriction type for component selection (groups, tags, or empty for specific blocks)
500
784
  */
501
- internal_tags_list?: Array<{
502
- /**
503
- * Tag ID
504
- */
505
- id?: number;
506
- /**
507
- * Tag name
508
- */
509
- name?: string;
510
- }>;
785
+ restrict_type?: string;
511
786
  /**
512
- * List of IDs of the tags assigned to the component
787
+ * Whether to restrict which components can be inserted
513
788
  */
514
- internal_tag_ids?: Array<string>;
789
+ restrict_components?: boolean;
515
790
  /**
516
- * Asset preview field (Preview Card) for a content type component
791
+ * List of allowed component names
517
792
  */
518
- content_type_asset_preview?: string;
519
- };
520
- /**
521
- * Input for creating a component.
522
- */
523
- type ComponentCreate2 = {
793
+ component_whitelist?: Array<string>;
524
794
  /**
525
- * Technical name used for component property in entries
795
+ * List of denied component names
526
796
  */
527
- name: string;
797
+ component_denylist?: Array<string>;
528
798
  /**
529
- * Name that will be used in the editor interface
799
+ * List of allowed tag IDs for component filtering
530
800
  */
531
- display_name?: string | null;
801
+ component_tag_whitelist?: Array<number>;
532
802
  /**
533
- * Component schema definition containing fields and their configurations
803
+ * List of denied tag IDs for component filtering
534
804
  */
535
- schema?: {
536
- [key: string]: unknown;
537
- };
805
+ component_tag_denylist?: Array<number>;
538
806
  /**
539
- * Whether the component can be used as a root component
807
+ * List of allowed component group UUIDs
540
808
  */
541
- is_root?: boolean;
809
+ component_group_whitelist?: Array<string>;
542
810
  /**
543
- * Whether the component is nestable in block field types
811
+ * List of denied component group UUIDs
544
812
  */
545
- is_nestable?: boolean;
813
+ component_group_denylist?: Array<string>;
546
814
  /**
547
- * The component folder UUID
815
+ * Minimum number of bloks
548
816
  */
549
- component_group_uuid?: string;
817
+ minimum?: number;
550
818
  /**
551
- * Icon color
819
+ * Maximum number of bloks
552
820
  */
553
- color?: string;
821
+ maximum?: number;
554
822
  /**
555
- * Icon name
823
+ * Maximum number of entries
556
824
  */
557
- icon?: string;
825
+ maximum_entries?: number;
558
826
  /**
559
- * The field used for preview in the interface
827
+ * Minimum number of entries
560
828
  */
561
- preview_field?: string;
829
+ minimum_entries?: number;
830
+ };
831
+ type TableField = BaseField & ValueField & {
562
832
  /**
563
- * IDs of internal tags to assign
833
+ * Field type discriminant
564
834
  */
565
- internal_tag_ids?: Array<string>;
835
+ type: 'table';
566
836
  };
567
- /**
568
- * Input for updating a component.
569
- */
570
- type ComponentUpdate2 = {
837
+ type SectionField = BaseField & {
571
838
  /**
572
- * Technical name used for component property in entries
839
+ * Field type discriminant
573
840
  */
574
- name?: string;
841
+ type: 'section';
575
842
  /**
576
- * Name that will be used in the editor interface
843
+ * Field keys that belong to this section
577
844
  */
578
- display_name?: string | null;
845
+ keys?: Array<string>;
579
846
  /**
580
- * Component schema definition containing fields and their configurations
847
+ * Fieldset configuration
581
848
  */
582
- schema?: {
583
- [key: string]: unknown;
849
+ fieldset?: {
850
+ /**
851
+ * Fieldset title
852
+ */
853
+ title?: string;
854
+ /**
855
+ * Fieldset description
856
+ */
857
+ description?: string;
858
+ /**
859
+ * Whether the fieldset is collapsible
860
+ */
861
+ collapsible?: boolean;
862
+ /**
863
+ * Whether the fieldset is collapsed by default
864
+ */
865
+ collapsed?: boolean;
584
866
  };
867
+ };
868
+ type TabField = BaseField & {
585
869
  /**
586
- * Whether the component can be used as a root component
870
+ * Field type discriminant
587
871
  */
588
- is_root?: boolean;
872
+ type: 'tab';
589
873
  /**
590
- * Whether the component is nestable in block field types
874
+ * Field keys that belong to this tab
591
875
  */
592
- is_nestable?: boolean;
876
+ keys?: Array<string>;
877
+ };
878
+ type CustomField = BaseField & ValueField & {
593
879
  /**
594
- * The component folder UUID
880
+ * Field type discriminant
595
881
  */
596
- component_group_uuid?: string;
882
+ type: 'custom';
597
883
  /**
598
- * Icon color
884
+ * Technical name of the field plugin
599
885
  */
600
- color?: string;
886
+ field_type?: string;
601
887
  /**
602
- * Icon name
888
+ * Plugin-specific options
603
889
  */
604
- icon?: string;
890
+ options?: Array<{
891
+ name?: string;
892
+ value?: string;
893
+ }>;
605
894
  /**
606
- * The field used for preview in the interface
895
+ * Comma-separated list of required field names in the plugin
607
896
  */
608
- preview_field?: string;
897
+ required_fields?: string;
609
898
  /**
610
- * IDs of internal tags to assign
899
+ * Source for plugin-provided options (`self` or `internal` for datasource)
611
900
  */
612
- internal_tag_ids?: Array<string>;
901
+ source?: 'self' | 'internal';
902
+ /**
903
+ * Slug of the internal datasource when `source` is `internal`
904
+ */
905
+ datasource_slug?: string;
906
+ /**
907
+ * URL to an external datasource when `source` is set accordingly
908
+ */
909
+ external_datasource?: string;
613
910
  };
614
911
  type ListData = {
615
912
  body?: never;
@@ -620,14 +917,6 @@ type ListData = {
620
917
  space_id: number | string;
621
918
  };
622
919
  query?: {
623
- /**
624
- * Page number for pagination. Default is 1.
625
- */
626
- page?: number;
627
- /**
628
- * Number of items per page. Default is 25.
629
- */
630
- per_page?: number;
631
920
  /**
632
921
  * Filter by ids (comma separated)
633
922
  */
@@ -663,88 +952,6 @@ type ListData = {
663
952
  };
664
953
  url: '/v1/spaces/{space_id}/components';
665
954
  };
666
- type ListResponses = {
667
- /**
668
- * List of components
669
- */
670
- 200: {
671
- components?: Array<Component2>;
672
- };
673
- };
674
- type CreateData = {
675
- body: {
676
- component?: ComponentCreate2;
677
- };
678
- path: {
679
- /**
680
- * The ID of the Storyblok space (can be integer or string)
681
- */
682
- space_id: number | string;
683
- };
684
- query?: never;
685
- url: '/v1/spaces/{space_id}/components';
686
- };
687
- type CreateResponses = {
688
- /**
689
- * Component created
690
- */
691
- 201: {
692
- component?: Component2;
693
- };
694
- };
695
- type DeleteResponses = {
696
- /**
697
- * Component deleted
698
- */
699
- 200: {
700
- component?: Component2;
701
- };
702
- };
703
- type GetResponses = {
704
- /**
705
- * Component details
706
- */
707
- 200: {
708
- component?: Component2;
709
- };
710
- };
711
- type UpdateData = {
712
- body: {
713
- component?: ComponentUpdate2;
714
- /**
715
- * Update component name in stories when component name changes
716
- */
717
- update_content?: boolean;
718
- };
719
- path: {
720
- /**
721
- * The ID of the Storyblok space (can be integer or string)
722
- */
723
- space_id: number | string;
724
- /**
725
- * The ID of the component (can be integer or string)
726
- */
727
- component_id: number | string;
728
- };
729
- query?: never;
730
- url: '/v1/spaces/{space_id}/components/{component_id}';
731
- };
732
- type UpdateResponses = {
733
- /**
734
- * Component updated
735
- */
736
- 200: {
737
- component?: Component2;
738
- };
739
- };
740
- type RestoreResponses = {
741
- /**
742
- * Component restored
743
- */
744
- 200: {
745
- component?: Component2;
746
- };
747
- };
748
955
  type VersionsData = {
749
956
  body?: never;
750
957
  path: {
@@ -777,22 +984,6 @@ type VersionsData = {
777
984
  };
778
985
  url: '/v1/spaces/{space_id}/versions';
779
986
  };
780
- type VersionsResponses = {
781
- /**
782
- * Component versions
783
- */
784
- 200: {
785
- versions?: Array<{
786
- id?: number;
787
- event?: string;
788
- created_at?: string;
789
- author_id?: number;
790
- item_id?: number;
791
- author?: string;
792
- is_draft?: boolean;
793
- }>;
794
- };
795
- };
796
987
  type VersionData = {
797
988
  body?: never;
798
989
  path: {
@@ -812,18 +1003,6 @@ type VersionData = {
812
1003
  query?: never;
813
1004
  url: '/v1/spaces/{space_id}/components/{component_id}/component_versions/{version_id}';
814
1005
  };
815
- type VersionResponses = {
816
- /**
817
- * Component version details
818
- */
819
- 200: {
820
- component_version?: {
821
- schema?: {
822
- [key: string]: unknown;
823
- };
824
- };
825
- };
826
- };
827
1006
  type RestoreVersionData = {
828
1007
  body: {
829
1008
  model?: string;
@@ -842,14 +1021,6 @@ type RestoreVersionData = {
842
1021
  query?: never;
843
1022
  url: '/v1/spaces/{space_id}/versions/{version_id}';
844
1023
  };
845
- type RestoreVersionResponses = {
846
- /**
847
- * Component version restored
848
- */
849
- 200: {
850
- component?: Component2;
851
- };
852
- };
853
1024
  //#endregion
854
- export { Component, ComponentCreate, ComponentSchemaField, ComponentUpdate, CreateData, CreateResponses, DeleteResponses, GetResponses, ListData, ListResponses, RestoreResponses, RestoreVersionData, RestoreVersionResponses, UpdateData, UpdateResponses, VersionData, VersionResponses, VersionsData, VersionsResponses };
1025
+ export { Component, ComponentCreate, ComponentSchemaField, ComponentUpdate, ListData, RestoreVersionData, VersionData, VersionsData };
855
1026
  //# sourceMappingURL=types.gen.d.mts.map