storyblok 4.22.0 → 4.22.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.
package/dist/index.d.mts CHANGED
@@ -1,121 +1,627 @@
1
-
2
- type StoryblokPropertyType = 'asset' | 'multiasset' | 'multilink' | 'table' | 'richtext';
3
- interface StoryblokAsset {
1
+ import "./constants-FGOZXcwP.mjs";
2
+ import "dotenv/config";
3
+ import { Command } from "commander";
4
+ //#region src/generated/overlay/types.gen.d.ts
5
+ type RichTextDoc = RichTextFieldValueRoot;
6
+ /**
7
+ * Rich text field type - structured rich text document (ProseMirror/Tiptap format)
8
+ */
9
+ type RichTextFieldValueRoot = {
10
+ /**
11
+ * Root node type — always "doc"
12
+ */
13
+ type: 'doc';
14
+ /**
15
+ * Top-level rich text nodes
16
+ */
17
+ content: Array<RichTextFieldValueRichTextNode>;
18
+ };
19
+ /**
20
+ * A rich text document node
21
+ */
22
+ type RichTextFieldValueRichTextNode = RichTextFieldValueParagraphNode | RichTextFieldValueTextNode | RichTextFieldValueHeadingNode | RichTextFieldValueBlockquoteNode | RichTextFieldValueBulletListNode | RichTextFieldValueOrderedListNode | RichTextFieldValueListItemNode | RichTextFieldValueCodeBlockNode | RichTextFieldValueHardBreakNode | RichTextFieldValueHorizontalRuleNode | RichTextFieldValueImageNode | RichTextFieldValueEmojiNode | RichTextFieldValueTableNode | RichTextFieldValueTableRowNode | RichTextFieldValueTableCellNode | RichTextFieldValueTableHeaderNode | RichTextFieldValueBlockNode;
23
+ /**
24
+ * Inline formatting mark applied to a text node
25
+ */
26
+ type RichTextFieldValueRichTextMark = RichTextFieldValueLinkMark | RichTextFieldValueBoldMark | RichTextFieldValueItalicMark | RichTextFieldValueStrikeMark | RichTextFieldValueUnderlineMark | RichTextFieldValueCodeMark | RichTextFieldValueSuperscriptMark | RichTextFieldValueSubscriptMark | RichTextFieldValueHighlightMark | RichTextFieldValueTextStyleMark | RichTextFieldValueAnchorMark | RichTextFieldValueStyledMark;
27
+ type RichTextFieldValueParagraphNode = {
28
+ type: 'paragraph';
29
+ attrs?: {
30
+ /**
31
+ * Text alignment
32
+ */
33
+ textAlign: 'left' | 'center' | 'right' | 'justify' | null;
34
+ /**
35
+ * Text direction
36
+ */
37
+ dir?: 'ltr' | 'rtl' | null;
38
+ };
39
+ content?: Array<RichTextFieldValueRichTextNode>;
40
+ marks?: Array<RichTextFieldValueRichTextMark>;
41
+ };
42
+ type RichTextFieldValueTextNode = {
43
+ type: 'text';
44
+ /**
45
+ * The text content
46
+ */
47
+ text: string;
48
+ marks?: Array<RichTextFieldValueRichTextMark>;
49
+ };
50
+ type RichTextFieldValueHeadingNode = {
51
+ type: 'heading';
52
+ attrs: {
53
+ /**
54
+ * Heading level (h1–h6)
55
+ */
56
+ level: 1 | 2 | 3 | 4 | 5 | 6 | null;
57
+ /**
58
+ * Text alignment
59
+ */
60
+ textAlign: 'left' | 'center' | 'right' | 'justify' | null;
61
+ /**
62
+ * Text direction
63
+ */
64
+ dir?: 'ltr' | 'rtl' | null;
65
+ };
66
+ content?: Array<RichTextFieldValueRichTextNode>;
67
+ marks?: Array<RichTextFieldValueRichTextMark>;
68
+ };
69
+ type RichTextFieldValueBlockquoteNode = {
70
+ type: 'blockquote';
71
+ attrs?: {
72
+ /**
73
+ * Text direction
74
+ */
75
+ dir?: 'ltr' | 'rtl' | null;
76
+ };
77
+ content?: Array<RichTextFieldValueRichTextNode>;
78
+ marks?: Array<RichTextFieldValueRichTextMark>;
79
+ };
80
+ type RichTextFieldValueBulletListNode = {
81
+ type: 'bullet_list';
82
+ content?: Array<RichTextFieldValueRichTextNode>;
83
+ marks?: Array<RichTextFieldValueRichTextMark>;
84
+ };
85
+ type RichTextFieldValueOrderedListNode = {
86
+ type: 'ordered_list';
87
+ attrs: {
88
+ /**
89
+ * Starting number for the ordered list
90
+ */
91
+ order?: number;
92
+ };
93
+ content?: Array<RichTextFieldValueRichTextNode>;
94
+ marks?: Array<RichTextFieldValueRichTextMark>;
95
+ };
96
+ type RichTextFieldValueListItemNode = {
97
+ type: 'list_item';
98
+ attrs?: {
99
+ /**
100
+ * Text direction
101
+ */
102
+ dir?: 'ltr' | 'rtl' | null;
103
+ };
104
+ content?: Array<RichTextFieldValueRichTextNode>;
105
+ marks?: Array<RichTextFieldValueRichTextMark>;
106
+ };
107
+ type RichTextFieldValueCodeBlockNode = {
108
+ type: 'code_block';
109
+ attrs: {
110
+ /**
111
+ * Language class (e.g. "language-typescript")
112
+ */
113
+ class: string | null;
114
+ /**
115
+ * Text direction
116
+ */
117
+ dir?: 'ltr' | 'rtl' | null;
118
+ };
119
+ content?: Array<RichTextFieldValueRichTextNode>;
120
+ marks?: Array<RichTextFieldValueRichTextMark>;
121
+ };
122
+ type RichTextFieldValueHardBreakNode = {
123
+ type: 'hard_break';
124
+ };
125
+ type RichTextFieldValueHorizontalRuleNode = {
126
+ type: 'horizontal_rule';
127
+ };
128
+ type RichTextFieldValueImageNode = {
129
+ type: 'image';
130
+ attrs: {
131
+ /**
132
+ * Storyblok asset ID
133
+ */
134
+ id: number | null;
135
+ /**
136
+ * Image URL
137
+ */
138
+ src: string | null;
139
+ /**
140
+ * Alternative text
141
+ */
4
142
  alt: string | null;
5
- fieldtype: 'asset';
6
- id: number;
7
- filename: string | null;
8
- name: string;
9
143
  title: string | null;
10
- focus: string | null;
11
- copyright?: string | null;
12
- meta_data?: Record<string, any>;
13
- source?: string | null;
14
- is_external_url?: boolean;
15
- is_private?: boolean;
16
- src?: string;
17
- updated_at?: string;
18
- width?: number | null;
19
- height?: number | null;
20
- aspect_ratio?: number | null;
21
- public_id?: string | null;
22
- content_type?: string;
23
- }
24
- interface StoryblokMultiasset extends Array<StoryblokAsset> {
144
+ source: string | null;
145
+ copyright: string | null;
146
+ /**
147
+ * Asset metadata
148
+ */
149
+ meta_data: {
150
+ alt?: string | null;
151
+ title?: string | null;
152
+ source?: string | null;
153
+ copyright?: string | null;
154
+ [key: string]: string | null | string | null | string | null | string | null | string | null | undefined;
155
+ } | null;
156
+ };
157
+ };
158
+ type RichTextFieldValueEmojiNode = {
159
+ type: 'emoji';
160
+ attrs: {
161
+ /**
162
+ * Emoji name/slug
163
+ */
164
+ name: string;
165
+ /**
166
+ * Emoji character
167
+ */
168
+ emoji: string;
169
+ /**
170
+ * URL to a fallback image for unsupported environments
171
+ */
172
+ fallbackImage: string;
173
+ };
174
+ };
175
+ type RichTextFieldValueTableNode = {
176
+ type: 'table';
177
+ content?: Array<RichTextFieldValueRichTextNode>;
178
+ };
179
+ type RichTextFieldValueTableRowNode = {
180
+ type: 'tableRow';
181
+ content?: Array<RichTextFieldValueRichTextNode>;
182
+ };
183
+ type RichTextFieldValueTableCellNode = {
184
+ type: 'tableCell';
185
+ attrs: {
186
+ colspan?: number;
187
+ rowspan?: number;
188
+ /**
189
+ * Column widths in pixels
190
+ */
191
+ colwidth?: Array<number> | null;
192
+ backgroundColor?: string | null;
193
+ };
194
+ content?: Array<RichTextFieldValueRichTextNode>;
195
+ };
196
+ type RichTextFieldValueTableHeaderNode = {
197
+ type: 'tableHeader';
198
+ attrs: {
199
+ colspan?: number;
200
+ rowspan?: number;
201
+ /**
202
+ * Column widths in pixels
203
+ */
204
+ colwidth?: Array<number> | null;
205
+ };
206
+ content?: Array<RichTextFieldValueRichTextNode>;
207
+ };
208
+ type RichTextFieldValueBlockNode = {
209
+ type: 'blok';
210
+ attrs: {
211
+ /**
212
+ * Block instance ID
213
+ */
214
+ id: string | null;
215
+ /**
216
+ * Array of embedded component instances
217
+ */
218
+ body: Array<BlockContentInputRoot> | null;
219
+ };
220
+ };
221
+ type RichTextFieldValueLinkMark = {
222
+ type: 'link';
223
+ /**
224
+ * Link attributes
225
+ */
226
+ attrs: {
227
+ /**
228
+ * Link URL
229
+ */
230
+ href: string | null;
231
+ /**
232
+ * UUID of the linked story (for internal links)
233
+ */
234
+ uuid: string | null;
235
+ /**
236
+ * Anchor/fragment identifier
237
+ */
238
+ anchor: string | null;
239
+ /**
240
+ * Link target attribute
241
+ */
242
+ target: '_self' | '_blank' | '_parent' | '_top' | null;
243
+ /**
244
+ * Type of link
245
+ */
246
+ linktype: 'story' | 'url' | 'email' | 'asset' | null;
247
+ /**
248
+ * Custom link attributes
249
+ */
250
+ custom?: {
251
+ [key: string]: unknown;
252
+ } | null;
253
+ };
254
+ };
255
+ type RichTextFieldValueBoldMark = {
256
+ type: 'bold';
257
+ };
258
+ type RichTextFieldValueItalicMark = {
259
+ type: 'italic';
260
+ };
261
+ type RichTextFieldValueStrikeMark = {
262
+ type: 'strike';
263
+ };
264
+ type RichTextFieldValueUnderlineMark = {
265
+ type: 'underline';
266
+ };
267
+ type RichTextFieldValueCodeMark = {
268
+ type: 'code';
269
+ };
270
+ type RichTextFieldValueSuperscriptMark = {
271
+ type: 'superscript';
272
+ };
273
+ type RichTextFieldValueSubscriptMark = {
274
+ type: 'subscript';
275
+ };
276
+ type RichTextFieldValueHighlightMark = {
277
+ type: 'highlight';
278
+ attrs: {
279
+ /**
280
+ * Highlight color (CSS color value)
281
+ */
282
+ color: string | null;
283
+ };
284
+ };
285
+ type RichTextFieldValueTextStyleMark = {
286
+ type: 'textStyle';
287
+ attrs: {
288
+ color?: string | null;
289
+ id?: string | null;
290
+ class?: string | null;
291
+ };
292
+ };
293
+ type RichTextFieldValueAnchorMark = {
294
+ type: 'anchor';
295
+ attrs: {
296
+ /**
297
+ * Anchor identifier
298
+ */
299
+ id: string;
300
+ };
301
+ };
302
+ type RichTextFieldValueStyledMark = {
303
+ type: 'styled';
304
+ attrs: {
305
+ /**
306
+ * CSS class name
307
+ */
308
+ class: string | null;
309
+ };
310
+ };
311
+ /**
312
+ * Content object for creating or updating a component instance. Contains a component technical name and dynamic fields whose values depend on the component's schema field types. The _uid is optional — Storyblok will auto-generate one if not provided.
313
+ */
314
+ type BlockContentInputRoot = {
315
+ /**
316
+ * Unique identifier for this component instance (auto-generated when omitted)
317
+ */
318
+ _uid?: string;
319
+ /**
320
+ * Technical name of the component (content type or nestable block)
321
+ */
322
+ component: string;
323
+ /**
324
+ * Storyblok editor markup string for inline editing (present in draft/preview mode)
325
+ */
326
+ _editable?: string;
327
+ [key: string]: null | string | number | boolean | Array<string | AssetFieldValueRoot | BlockContentInputRoot> | AssetFieldValueRoot | MultilinkFieldValueRoot | TableFieldValueRoot | RichTextFieldValueRoot | PluginFieldValueRoot | string | undefined;
328
+ };
329
+ /**
330
+ * Asset field type - single asset (image, video, audio, or document)
331
+ */
332
+ type AssetFieldValueRoot = {
333
+ /**
334
+ * Identifies this as an asset field
335
+ */
336
+ fieldtype: 'asset';
337
+ /**
338
+ * Numeric ID of the asset
339
+ */
340
+ id: number | null;
341
+ /**
342
+ * Alternative text for the asset
343
+ */
344
+ alt: string | null;
345
+ /**
346
+ * Name of the asset
347
+ */
348
+ name?: string;
349
+ /**
350
+ * Focal point coordinates for cropping (format "123x456:789x1011")
351
+ */
352
+ focus?: string | null;
353
+ /**
354
+ * Title of the asset
355
+ */
356
+ title?: string | null;
357
+ /**
358
+ * Source attribution for the asset
359
+ */
360
+ source?: string | null;
361
+ /**
362
+ * URL to the asset file
363
+ */
364
+ filename: string;
365
+ /**
366
+ * Copyright information
367
+ */
368
+ copyright?: string | null;
369
+ /**
370
+ * Additional metadata for the asset
371
+ */
372
+ meta_data?: {
373
+ [key: string]: unknown;
374
+ };
375
+ /**
376
+ * Whether the asset is hosted externally
377
+ */
378
+ is_external_url?: boolean;
379
+ };
380
+ /**
381
+ * Multilink field type - link to internal stories, external URLs, emails, or assets.
382
+ */
383
+ type MultilinkFieldValueRoot = MultilinkFieldValueStoryLink | MultilinkFieldValueUrlLink | MultilinkFieldValueEmailLink | MultilinkFieldValueAssetLink;
384
+ /**
385
+ * Table field type - structured table data
386
+ */
387
+ type TableFieldValueRoot = {
388
+ /**
389
+ * Table header cells
390
+ */
391
+ thead: Array<{
392
+ _uid?: string;
393
+ component?: '_table_head';
394
+ /**
395
+ * Header cell content
396
+ */
397
+ value?: string;
398
+ }>;
399
+ /**
400
+ * Table body rows
401
+ */
402
+ tbody: Array<{
403
+ _uid?: string;
404
+ component?: '_table_row';
405
+ /**
406
+ * Cells in this row
407
+ */
408
+ body?: Array<{
409
+ _uid?: string;
410
+ component?: '_table_col';
411
+ /**
412
+ * Cell content
413
+ */
414
+ value?: string;
415
+ }>;
416
+ }>;
417
+ };
418
+ /**
419
+ * Plugin/Custom field type - field plugin with custom structure
420
+ */
421
+ type PluginFieldValueRoot = {
422
+ /**
423
+ * Technical name of the field plugin
424
+ */
425
+ plugin: string;
426
+ /**
427
+ * Unique identifier for this plugin field instance
428
+ */
429
+ _uid?: string;
430
+ [key: string]: unknown | string | undefined;
431
+ };
432
+ /**
433
+ * Link to an internal Storyblok story.
434
+ */
435
+ type MultilinkFieldValueStoryLink = MultilinkFieldValueSharedLink & {
436
+ linktype: 'story';
437
+ /**
438
+ * Anchor/fragment identifier for the story link
439
+ */
440
+ anchor?: string | null;
441
+ /**
442
+ * Link relationship attribute
443
+ */
444
+ rel?: string;
445
+ /**
446
+ * Link title attribute
447
+ */
448
+ title?: string;
449
+ } & {
450
+ [key: string]: string | null;
451
+ };
452
+ /**
453
+ * Link to an external URL.
454
+ */
455
+ type MultilinkFieldValueUrlLink = MultilinkFieldValueSharedLink & {
456
+ linktype: 'url';
457
+ /**
458
+ * Link relationship attribute
459
+ */
460
+ rel?: string;
461
+ /**
462
+ * Link title attribute
463
+ */
464
+ title?: string;
465
+ } & {
466
+ [key: string]: string;
467
+ };
468
+ /**
469
+ * Link to an email address.
470
+ */
471
+ type MultilinkFieldValueEmailLink = MultilinkFieldValueSharedLink & {
472
+ linktype: 'email';
473
+ /**
474
+ * Email address
475
+ */
476
+ email?: string;
477
+ };
478
+ /**
479
+ * Link to a Storyblok asset.
480
+ */
481
+ type MultilinkFieldValueAssetLink = MultilinkFieldValueSharedLink & {
482
+ linktype: 'asset';
483
+ };
484
+ type MultilinkFieldValueSharedLink = {
485
+ /**
486
+ * Identifies this as a multilink field
487
+ */
488
+ fieldtype: 'multilink';
489
+ /**
490
+ * Type of link
491
+ */
492
+ linktype: string;
493
+ /**
494
+ * UUID of the linked story for internal links
495
+ */
496
+ id: string;
497
+ /**
498
+ * URL for external links
499
+ */
500
+ url: string;
501
+ /**
502
+ * Cached URL path for the linked story
503
+ */
504
+ cached_url: string;
505
+ /**
506
+ * Link target attribute
507
+ */
508
+ target?: '_self' | '_blank';
509
+ };
510
+ //#endregion
511
+ //#region src/types/storyblok.d.ts
512
+ type StoryblokRichTextDoc = RichTextDoc;
513
+ /** @deprecated Use StoryblokRichTextDoc instead */
514
+ type StoryblokRichtext = StoryblokRichTextDoc;
515
+ type StoryblokPropertyType = "asset" | "multiasset" | "multilink" | "table" | "richtext";
516
+ interface StoryblokAsset {
517
+ alt: string | null;
518
+ fieldtype: "asset";
519
+ id: number | null;
520
+ filename: string | null;
521
+ name: string;
522
+ title: string | null;
523
+ focus: string | null;
524
+ copyright?: string | null;
525
+ meta_data?: Record<string, any>;
526
+ source?: string | null;
527
+ is_external_url?: boolean;
528
+ is_private?: boolean;
529
+ src?: string;
530
+ updated_at?: string;
531
+ width?: number | null;
532
+ height?: number | null;
533
+ aspect_ratio?: number | null;
534
+ public_id?: string | null;
535
+ content_type?: string;
25
536
  }
537
+ interface StoryblokMultiasset extends Array<StoryblokAsset> {}
26
538
  interface StoryblokMultilinkStory {
27
- name: string;
28
- created_at: string;
29
- published_at: string;
30
- id: number;
31
- uuid: string;
32
- content: Record<string, any>;
33
- slug: string;
34
- full_slug: string;
35
- sort_by_date?: string;
36
- position?: number;
37
- tag_list?: string[];
38
- is_startpage?: boolean;
39
- parent_id?: number | null;
40
- meta_data?: Record<string, any> | null;
41
- group_id?: string;
42
- first_published_at?: string;
43
- release_id?: number | null;
44
- lang?: string;
45
- path?: string | null;
46
- alternates?: any[];
47
- default_full_slug?: string | null;
48
- translated_slugs?: any[] | null;
539
+ name: string;
540
+ created_at: string;
541
+ published_at: string;
542
+ id: number;
543
+ uuid: string;
544
+ content: Record<string, any>;
545
+ slug: string;
546
+ full_slug: string;
547
+ sort_by_date?: string;
548
+ position?: number;
549
+ tag_list?: string[];
550
+ is_startpage?: boolean;
551
+ parent_id?: number | null;
552
+ meta_data?: Record<string, any> | null;
553
+ group_id?: string;
554
+ first_published_at?: string;
555
+ release_id?: number | null;
556
+ lang?: string;
557
+ path?: string | null;
558
+ alternates?: any[];
559
+ default_full_slug?: string | null;
560
+ translated_slugs?: any[] | null;
49
561
  }
50
562
  interface StoryblokMultilinkLink {
51
- id: number;
52
- uuid: string;
53
- slug: string;
54
- path: string | null;
55
- parent_id: number;
56
- name: string;
57
- is_folder: boolean;
58
- published: boolean;
59
- is_startpage: boolean;
60
- position: number;
61
- real_path: string;
563
+ id: number;
564
+ uuid: string;
565
+ slug: string;
566
+ path: string | null;
567
+ parent_id: number;
568
+ name: string;
569
+ is_folder: boolean;
570
+ published: boolean;
571
+ is_startpage: boolean;
572
+ position: number;
573
+ real_path: string;
62
574
  }
63
575
  interface StoryblokMultilinkUrl {
64
- name: string;
65
- id: number;
66
- uuid: string;
67
- slug: string;
68
- url: string;
69
- full_slug: string;
576
+ name: string;
577
+ id: number;
578
+ uuid: string;
579
+ slug: string;
580
+ url: string;
581
+ full_slug: string;
70
582
  }
71
583
  interface StoryblokMultilinkBase {
72
- fieldtype: 'multilink';
73
- id: string;
74
- url: string;
75
- cached_url: string;
76
- target?: '_blank' | '_self';
77
- anchor?: string;
78
- rel?: string;
79
- title?: string;
80
- prep?: string;
584
+ fieldtype: "multilink";
585
+ id: string;
586
+ url: string;
587
+ cached_url: string;
588
+ target?: "_blank" | "_self";
589
+ anchor?: string;
590
+ rel?: string;
591
+ title?: string;
592
+ prep?: string;
81
593
  }
82
594
  type StoryblokMultilink = (StoryblokMultilinkBase & {
83
- linktype: 'story';
84
- story?: StoryblokMultilinkStory | StoryblokMultilinkLink | StoryblokMultilinkUrl;
595
+ linktype: "story";
596
+ story?: StoryblokMultilinkStory | StoryblokMultilinkLink | StoryblokMultilinkUrl;
85
597
  }) | (StoryblokMultilinkBase & {
86
- linktype: 'url';
598
+ linktype: "url";
87
599
  }) | (StoryblokMultilinkBase & {
88
- linktype: 'email';
89
- email: string;
600
+ linktype: "email";
601
+ email: string;
90
602
  }) | (StoryblokMultilinkBase & {
91
- linktype: 'asset';
603
+ linktype: "asset";
92
604
  });
93
605
  interface StoryblokTable {
94
- fieldtype: 'table';
95
- thead: Array<{
96
- _uid: string;
97
- value: string;
98
- component: '_table_head';
99
- _editable?: string;
100
- }>;
101
- tbody: Array<{
102
- _uid: string;
103
- component: '_table_row';
104
- _editable?: string;
105
- body: Array<{
106
- _uid: string;
107
- value: string;
108
- component: '_table_col';
109
- _editable?: string;
110
- }>;
606
+ fieldtype: "table";
607
+ thead: Array<{
608
+ _uid: string;
609
+ value: string;
610
+ component: "_table_head";
611
+ _editable?: string;
612
+ }>;
613
+ tbody: Array<{
614
+ _uid: string;
615
+ component: "_table_row";
616
+ _editable?: string;
617
+ body: Array<{
618
+ _uid: string;
619
+ value: string;
620
+ component: "_table_col";
621
+ _editable?: string;
111
622
  }>;
623
+ }>;
112
624
  }
113
- interface StoryblokRichtext {
114
- type: string;
115
- content?: StoryblokRichtext[];
116
- marks?: StoryblokRichtext[];
117
- attrs?: Record<string, any>;
118
- text?: string;
119
- }
120
-
121
- export type { StoryblokAsset, StoryblokMultiasset, StoryblokMultilink, StoryblokMultilinkLink, StoryblokMultilinkStory, StoryblokMultilinkUrl, StoryblokPropertyType, StoryblokRichtext, StoryblokTable };
625
+ //#endregion
626
+ export { StoryblokAsset, StoryblokMultiasset, StoryblokMultilink, StoryblokMultilinkLink, StoryblokMultilinkStory, StoryblokMultilinkUrl, StoryblokPropertyType, StoryblokRichTextDoc, StoryblokRichtext, StoryblokTable };
627
+ //# sourceMappingURL=index.d.mts.map