@indreamai/client 0.1.1 → 0.2.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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @indreamai/client
2
2
 
3
- Official JavaScript/TypeScript client for the Indream Open API.
3
+ Official JavaScript/TypeScript client for the [Indream](https://indream.ai/) Open API.
4
4
 
5
- - API docs: https://docs.indream.ai
5
+ - API docs: [Video Editor API](https://docs.indream.ai)
6
6
  - Supports Node.js 18+ and Edge runtimes
7
7
 
8
8
  ## Installation
package/dist/index.d.cts CHANGED
@@ -1,7 +1,608 @@
1
+ interface components {
2
+ schemas: {
3
+ Problem: {
4
+ type: string;
5
+ title: string;
6
+ status: number;
7
+ detail: string;
8
+ errorCode?: string;
9
+ };
10
+ CreateExportRequest: {
11
+ clientTaskId?: string;
12
+ editorState: components["schemas"]["editor-state.v1.schema"];
13
+ stateVersion?: string;
14
+ /** @enum {integer} */
15
+ fps: 30 | 60;
16
+ compositionWidth?: number;
17
+ compositionHeight?: number;
18
+ /** @enum {string} */
19
+ ratio: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "custom";
20
+ scale: number;
21
+ /** @enum {string} */
22
+ format: "mp4" | "webm";
23
+ callbackUrl?: string;
24
+ callbackHeaders?: {
25
+ [key: string]: string;
26
+ };
27
+ };
28
+ CreateExportResponseData: {
29
+ taskId: string;
30
+ /** Format: date-time */
31
+ createdAt: string;
32
+ durationSeconds: number;
33
+ billedStandardSeconds: number;
34
+ chargedCredits: string;
35
+ };
36
+ ExportTask: {
37
+ taskId: string;
38
+ createdByApiKeyId: string | null;
39
+ clientTaskId: string | null;
40
+ /** @enum {string} */
41
+ status: "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "PAUSED" | "CANCELED";
42
+ progress: number;
43
+ error: string | null;
44
+ outputUrl: string | null;
45
+ durationSeconds: number;
46
+ billedStandardSeconds: number;
47
+ chargedCredits: string;
48
+ callbackUrl: string | null;
49
+ /** Format: date-time */
50
+ createdAt: string;
51
+ /** Format: date-time */
52
+ completedAt: string | null;
53
+ };
54
+ EditorCapabilities: {
55
+ version: string;
56
+ animations: string[];
57
+ captionAnimations: {
58
+ in: {
59
+ id: string;
60
+ type: string;
61
+ label: string;
62
+ preview: string;
63
+ }[];
64
+ out: {
65
+ id: string;
66
+ type: string;
67
+ label: string;
68
+ preview: string;
69
+ }[];
70
+ loop: {
71
+ id: string;
72
+ type: string;
73
+ label: string;
74
+ preview: string;
75
+ }[];
76
+ };
77
+ transitions: string[];
78
+ transitionPresets: {
79
+ id: string;
80
+ type: string;
81
+ label: string;
82
+ params?: {
83
+ [key: string]: unknown;
84
+ };
85
+ }[];
86
+ effects: string[];
87
+ effectPresets: {
88
+ id: string;
89
+ type: string;
90
+ label: string;
91
+ defaultDurationInSeconds?: number;
92
+ defaultIntensity?: number;
93
+ params?: {
94
+ [key: string]: unknown;
95
+ };
96
+ }[];
97
+ filters: string[];
98
+ filterPresets: {
99
+ id: string;
100
+ type: string;
101
+ label: string;
102
+ defaultDurationInSeconds?: number;
103
+ defaultIntensity?: number;
104
+ params?: {
105
+ [key: string]: unknown;
106
+ };
107
+ }[];
108
+ shapes: string[];
109
+ backgroundPresets: {
110
+ colors: string[];
111
+ gradients: string[];
112
+ images: string[];
113
+ blurLevels: number[];
114
+ };
115
+ illustrations: string[];
116
+ };
117
+ EditorValidationError: {
118
+ code: string;
119
+ path: string;
120
+ message: string;
121
+ };
122
+ EditorValidationResult: {
123
+ valid: boolean;
124
+ errors: components["schemas"]["EditorValidationError"][];
125
+ };
126
+ CreateExportResponseEnvelope: {
127
+ data: components["schemas"]["CreateExportResponseData"];
128
+ meta: {
129
+ [key: string]: unknown;
130
+ };
131
+ };
132
+ GetExportResponseEnvelope: {
133
+ data: components["schemas"]["ExportTask"];
134
+ meta: {
135
+ [key: string]: unknown;
136
+ };
137
+ };
138
+ ListExportsResponseEnvelope: {
139
+ data: components["schemas"]["ExportTask"][];
140
+ meta: {
141
+ nextPageCursor?: string | null;
142
+ } & {
143
+ [key: string]: unknown;
144
+ };
145
+ };
146
+ EditorCapabilitiesResponseEnvelope: {
147
+ data: components["schemas"]["EditorCapabilities"];
148
+ meta: {
149
+ [key: string]: unknown;
150
+ };
151
+ };
152
+ EditorValidateResponseEnvelope: {
153
+ data: components["schemas"]["EditorValidationResult"];
154
+ meta: {
155
+ capabilitiesVersion?: string;
156
+ } & {
157
+ [key: string]: unknown;
158
+ };
159
+ };
160
+ baseAsset: {
161
+ id: string;
162
+ type: string;
163
+ filename: string;
164
+ size: number;
165
+ remoteUrl?: string | null;
166
+ remoteKey?: string | null;
167
+ mimeType: string;
168
+ } & {
169
+ [key: string]: unknown;
170
+ };
171
+ primitive: string | number | boolean;
172
+ animationSpec: {
173
+ /** @enum {string} */
174
+ type: "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "zoom-in" | "zoom-out";
175
+ durationTicks: number;
176
+ /** @enum {string} */
177
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
178
+ params?: {
179
+ [key: string]: components["schemas"]["primitive"];
180
+ };
181
+ } & {
182
+ [key: string]: unknown;
183
+ };
184
+ captionAnimationSpec: {
185
+ /** @enum {string} */
186
+ type: "converge" | "elastic-pop" | "typewriter" | "lay-down" | "center-type-out" | "curtain-close" | "jitter" | "rainbow" | "sweep-shine";
187
+ durationTicks: number;
188
+ /** @enum {string} */
189
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
190
+ params?: {
191
+ [key: string]: components["schemas"]["primitive"];
192
+ };
193
+ } & {
194
+ [key: string]: unknown;
195
+ };
196
+ keyframePoint: {
197
+ timeTicks: number;
198
+ value: number;
199
+ };
200
+ animatedNumberTrack: {
201
+ value: number;
202
+ keyframes: components["schemas"]["keyframePoint"][];
203
+ };
204
+ timelineItemBase: {
205
+ id: string;
206
+ type: string;
207
+ durationTicks: number;
208
+ startTicks: number;
209
+ isDraggingInTimeline: boolean;
210
+ } & {
211
+ [key: string]: unknown;
212
+ };
213
+ geometryItemBase: {
214
+ top: components["schemas"]["animatedNumberTrack"];
215
+ left: components["schemas"]["animatedNumberTrack"];
216
+ width: components["schemas"]["animatedNumberTrack"];
217
+ height: components["schemas"]["animatedNumberTrack"];
218
+ scaleX: components["schemas"]["animatedNumberTrack"];
219
+ scaleY: components["schemas"]["animatedNumberTrack"];
220
+ opacity: components["schemas"]["animatedNumberTrack"];
221
+ } & {
222
+ [key: string]: unknown;
223
+ };
224
+ baseItem: components["schemas"]["timelineItemBase"] & components["schemas"]["geometryItemBase"];
225
+ clipAnimations: {
226
+ in?: components["schemas"]["animationSpec"];
227
+ out?: components["schemas"]["animationSpec"];
228
+ };
229
+ captionClipAnimations: {
230
+ in?: components["schemas"]["captionAnimationSpec"];
231
+ out?: components["schemas"]["captionAnimationSpec"];
232
+ loop?: components["schemas"]["captionAnimationSpec"];
233
+ };
234
+ track: {
235
+ id: string;
236
+ items: string[];
237
+ hidden: boolean;
238
+ muted: boolean;
239
+ } & {
240
+ [key: string]: unknown;
241
+ };
242
+ imageAsset: components["schemas"]["baseAsset"] & {
243
+ /** @constant */
244
+ type: "image";
245
+ width: number;
246
+ height: number;
247
+ };
248
+ videoAsset: components["schemas"]["baseAsset"] & {
249
+ /** @constant */
250
+ type: "video";
251
+ durationInSeconds: number;
252
+ hasAudioTrack: boolean;
253
+ width: number;
254
+ height: number;
255
+ };
256
+ gifAsset: components["schemas"]["baseAsset"] & {
257
+ /** @constant */
258
+ type: "gif";
259
+ durationInSeconds: number;
260
+ width: number;
261
+ height: number;
262
+ /** @enum {string} */
263
+ loopBehavior: "finite" | "loop";
264
+ };
265
+ audioAsset: components["schemas"]["baseAsset"] & {
266
+ /** @constant */
267
+ type: "audio";
268
+ durationInSeconds: number;
269
+ };
270
+ captionAsset: components["schemas"]["baseAsset"] & {
271
+ /** @constant */
272
+ type: "caption";
273
+ captions: {
274
+ [key: string]: unknown;
275
+ }[];
276
+ /** @enum {string} */
277
+ timingGranularity: "word" | "line";
278
+ };
279
+ lottieAsset: components["schemas"]["baseAsset"] & {
280
+ /** @constant */
281
+ type: "lottie";
282
+ durationInSeconds: number;
283
+ width: number;
284
+ height: number;
285
+ /** @enum {string} */
286
+ resourceType: "lottie" | "svg";
287
+ resourceJson?: {
288
+ [key: string]: unknown;
289
+ } | null;
290
+ resourceComponentId?: string | null;
291
+ materialConfig?: {
292
+ [key: string]: unknown;
293
+ } | null;
294
+ };
295
+ imageItem: components["schemas"]["baseItem"] & {
296
+ /** @constant */
297
+ type: "image";
298
+ assetId: string;
299
+ stickerId?: string | null;
300
+ stickerVersion?: number | null;
301
+ keepAspectRatio: boolean;
302
+ borderRadius: components["schemas"]["animatedNumberTrack"];
303
+ rotation: components["schemas"]["animatedNumberTrack"];
304
+ cropLeft?: components["schemas"]["animatedNumberTrack"];
305
+ cropTop?: components["schemas"]["animatedNumberTrack"];
306
+ cropRight?: components["schemas"]["animatedNumberTrack"];
307
+ cropBottom?: components["schemas"]["animatedNumberTrack"];
308
+ animations?: components["schemas"]["clipAnimations"];
309
+ };
310
+ videoItem: components["schemas"]["baseItem"] & {
311
+ /** @constant */
312
+ type: "video";
313
+ assetId: string;
314
+ keepAspectRatio: boolean;
315
+ borderRadius: components["schemas"]["animatedNumberTrack"];
316
+ rotation: components["schemas"]["animatedNumberTrack"];
317
+ videoStartFromInSeconds: number;
318
+ decibelAdjustment: components["schemas"]["animatedNumberTrack"];
319
+ playbackRate: number;
320
+ audioFadeInDurationInSeconds: number;
321
+ audioFadeOutDurationInSeconds: number;
322
+ cropLeft?: components["schemas"]["animatedNumberTrack"];
323
+ cropTop?: components["schemas"]["animatedNumberTrack"];
324
+ cropRight?: components["schemas"]["animatedNumberTrack"];
325
+ cropBottom?: components["schemas"]["animatedNumberTrack"];
326
+ animations?: components["schemas"]["clipAnimations"];
327
+ };
328
+ gifItem: components["schemas"]["baseItem"] & {
329
+ /** @constant */
330
+ type: "gif";
331
+ assetId: string;
332
+ keepAspectRatio: boolean;
333
+ borderRadius: components["schemas"]["animatedNumberTrack"];
334
+ rotation: components["schemas"]["animatedNumberTrack"];
335
+ gifStartFromInSeconds: number;
336
+ playbackRate: number;
337
+ cropLeft?: components["schemas"]["animatedNumberTrack"];
338
+ cropTop?: components["schemas"]["animatedNumberTrack"];
339
+ cropRight?: components["schemas"]["animatedNumberTrack"];
340
+ cropBottom?: components["schemas"]["animatedNumberTrack"];
341
+ animations?: components["schemas"]["clipAnimations"];
342
+ };
343
+ lottieItem: components["schemas"]["baseItem"] & {
344
+ /** @constant */
345
+ type: "lottie";
346
+ assetId: string;
347
+ keepAspectRatio: boolean;
348
+ rotation: components["schemas"]["animatedNumberTrack"];
349
+ lottieStartFromInSeconds: number;
350
+ playbackRate: number;
351
+ animations?: components["schemas"]["clipAnimations"];
352
+ };
353
+ audioItem: components["schemas"]["baseItem"] & {
354
+ /** @constant */
355
+ type: "audio";
356
+ assetId: string;
357
+ audioStartFromInSeconds: number;
358
+ decibelAdjustment: components["schemas"]["animatedNumberTrack"];
359
+ playbackRate: number;
360
+ audioFadeInDurationInSeconds: number;
361
+ audioFadeOutDurationInSeconds: number;
362
+ };
363
+ textItem: components["schemas"]["baseItem"] & {
364
+ /** @constant */
365
+ type: "text";
366
+ text: string;
367
+ color: string;
368
+ /** @enum {string} */
369
+ align: "left" | "center" | "right";
370
+ fontFamily: string;
371
+ fontStyle: {
372
+ variant: string;
373
+ weight: string;
374
+ } & {
375
+ [key: string]: unknown;
376
+ };
377
+ fontSize: number;
378
+ lineHeight: number;
379
+ letterSpacing: number;
380
+ resizeOnEdit: boolean;
381
+ /** @enum {string} */
382
+ direction: "ltr" | "rtl";
383
+ strokeWidth: number;
384
+ strokeColor: string;
385
+ background?: null | ({
386
+ color: string;
387
+ horizontalPadding: number;
388
+ borderRadius: number;
389
+ } & {
390
+ [key: string]: unknown;
391
+ });
392
+ rotation?: components["schemas"]["animatedNumberTrack"];
393
+ animations?: components["schemas"]["clipAnimations"];
394
+ captionAnimations?: components["schemas"]["captionClipAnimations"];
395
+ };
396
+ textTemplateItem: components["schemas"]["baseItem"] & {
397
+ /** @constant */
398
+ type: "text-template";
399
+ /** @constant */
400
+ schemaVersion: 2;
401
+ templateId: string;
402
+ templateCategory: string;
403
+ nodes: ({
404
+ /** @enum {string} */
405
+ type: "image" | "text";
406
+ } & {
407
+ [key: string]: unknown;
408
+ })[];
409
+ rotation?: components["schemas"]["animatedNumberTrack"];
410
+ animations?: components["schemas"]["clipAnimations"];
411
+ };
412
+ captionsItem: components["schemas"]["baseItem"] & {
413
+ /** @constant */
414
+ type: "captions";
415
+ assetId: string;
416
+ fontFamily: string;
417
+ fontStyle: {
418
+ variant: string;
419
+ weight: string;
420
+ } & {
421
+ [key: string]: unknown;
422
+ };
423
+ lineHeight: number;
424
+ letterSpacing: number;
425
+ fontSize: number;
426
+ /** @enum {string} */
427
+ align: "left" | "center" | "right";
428
+ color: string;
429
+ highlightColor: string;
430
+ strokeWidth: number;
431
+ strokeColor: string;
432
+ /** @enum {string} */
433
+ direction: "ltr" | "rtl";
434
+ pageDurationInMilliseconds: number;
435
+ captionStartInSeconds: number;
436
+ maxLines: number;
437
+ /** @enum {string} */
438
+ source: "manual" | "auto" | "upload";
439
+ captionGroupId: string | null;
440
+ background: null | ({
441
+ color: string;
442
+ horizontalPadding: number;
443
+ borderRadius: number;
444
+ } & {
445
+ [key: string]: unknown;
446
+ });
447
+ rotation?: components["schemas"]["animatedNumberTrack"];
448
+ animations?: components["schemas"]["clipAnimations"];
449
+ captionAnimations?: components["schemas"]["captionClipAnimations"];
450
+ };
451
+ solidItem: components["schemas"]["baseItem"] & {
452
+ /** @constant */
453
+ type: "solid";
454
+ color: string;
455
+ /** @enum {string} */
456
+ shape: "rectangle" | "circle" | "triangle" | "star";
457
+ keepAspectRatio: boolean;
458
+ borderRadius: components["schemas"]["animatedNumberTrack"];
459
+ rotation: components["schemas"]["animatedNumberTrack"];
460
+ animations?: components["schemas"]["clipAnimations"];
461
+ };
462
+ illustrationItem: components["schemas"]["baseItem"] & {
463
+ /** @constant */
464
+ type: "illustration";
465
+ illustrationName: string;
466
+ color: string;
467
+ keepAspectRatio: boolean;
468
+ rotation: components["schemas"]["animatedNumberTrack"];
469
+ animations?: components["schemas"]["clipAnimations"];
470
+ };
471
+ effectItem: components["schemas"]["timelineItemBase"] & {
472
+ /** @constant */
473
+ type: "effect";
474
+ /** @enum {string} */
475
+ effectType: "flash-to-black" | "blur" | "blurred-opening" | "fade-in" | "fade-out";
476
+ intensity: number;
477
+ params?: {
478
+ [key: string]: components["schemas"]["primitive"];
479
+ };
480
+ };
481
+ filterItem: components["schemas"]["timelineItemBase"] & {
482
+ /** @constant */
483
+ type: "filter";
484
+ /** @enum {string} */
485
+ filterType: "verdant-glow" | "cyberpunk-neon" | "vaporwave-blue" | "sunset-orange" | "lemon-cyan" | "absolute-red" | "sakura-pink" | "twilight-dusk";
486
+ intensity: number;
487
+ params?: {
488
+ [key: string]: components["schemas"]["primitive"];
489
+ };
490
+ };
491
+ chartItem: components["schemas"]["baseItem"] & {
492
+ /** @constant */
493
+ type: "chart";
494
+ chartType: string;
495
+ themeColor: string;
496
+ data: {
497
+ [key: string]: unknown;
498
+ };
499
+ animationDurationTicks: number;
500
+ keepAspectRatio: boolean;
501
+ rotation: components["schemas"]["animatedNumberTrack"];
502
+ animations?: components["schemas"]["clipAnimations"];
503
+ };
504
+ transition: {
505
+ id: string;
506
+ trackId: string;
507
+ fromClipId: string;
508
+ toClipId: string;
509
+ /** @enum {string} */
510
+ type: "fade" | "slide" | "wipe" | "flip" | "clock-wipe" | "iris";
511
+ durationTicks: number;
512
+ /** @enum {string} */
513
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
514
+ params?: {
515
+ [key: string]: components["schemas"]["primitive"];
516
+ };
517
+ } & {
518
+ [key: string]: unknown;
519
+ };
520
+ globalBackground: {
521
+ /** @constant */
522
+ type: "none";
523
+ } | ({
524
+ /** @constant */
525
+ type: "color";
526
+ color: string;
527
+ gradient: string | null;
528
+ } & {
529
+ [key: string]: unknown;
530
+ }) | {
531
+ /** @constant */
532
+ type: "blur";
533
+ /** @enum {integer} */
534
+ level: 0 | 1 | 2 | 3 | 4;
535
+ } | ({
536
+ /** @constant */
537
+ type: "image";
538
+ imageAssetId: string | null;
539
+ imageUrl: string;
540
+ /** @enum {string} */
541
+ source: "preset" | "custom";
542
+ } & {
543
+ [key: string]: unknown;
544
+ });
545
+ brandRuntime: ({
546
+ brandId?: string | null;
547
+ logoX?: number;
548
+ logoY?: number;
549
+ managedItemIds?: string[];
550
+ managedAssetIds?: string[];
551
+ introShiftInFrames?: number;
552
+ overlayTrackId?: string | null;
553
+ underlayTrackId?: string | null;
554
+ } & {
555
+ [key: string]: unknown;
556
+ }) | null;
557
+ /** IndreamEditorStateV1 */
558
+ "editor-state.v1.schema": {
559
+ compositionWidth: number;
560
+ compositionHeight: number;
561
+ /** @constant */
562
+ timebaseTicksPerSecond: 240000;
563
+ /** @enum {string} */
564
+ outputRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "custom";
565
+ tracks: components["schemas"]["track"][];
566
+ assets: {
567
+ [key: string]: components["schemas"]["imageAsset"] | components["schemas"]["videoAsset"] | components["schemas"]["gifAsset"] | components["schemas"]["audioAsset"] | components["schemas"]["captionAsset"] | components["schemas"]["lottieAsset"];
568
+ };
569
+ items: {
570
+ [key: string]: components["schemas"]["imageItem"] | components["schemas"]["videoItem"] | components["schemas"]["gifItem"] | components["schemas"]["lottieItem"] | components["schemas"]["audioItem"] | components["schemas"]["textItem"] | components["schemas"]["textTemplateItem"] | components["schemas"]["captionsItem"] | components["schemas"]["solidItem"] | components["schemas"]["illustrationItem"] | components["schemas"]["effectItem"] | components["schemas"]["filterItem"] | components["schemas"]["chartItem"];
571
+ };
572
+ transitions: {
573
+ [key: string]: components["schemas"]["transition"];
574
+ };
575
+ globalBackground?: components["schemas"]["globalBackground"];
576
+ brandRuntime?: components["schemas"]["brandRuntime"];
577
+ deletedAssets?: {
578
+ [key: string]: unknown;
579
+ }[];
580
+ } & {
581
+ [key: string]: unknown;
582
+ };
583
+ };
584
+ responses: {
585
+ /** @description Error response */
586
+ Problem: {
587
+ headers: {
588
+ [name: string]: unknown;
589
+ };
590
+ content: {
591
+ "application/json": components["schemas"]["Problem"];
592
+ };
593
+ };
594
+ };
595
+ parameters: never;
596
+ requestBodies: never;
597
+ headers: never;
598
+ pathItems: never;
599
+ }
600
+
1
601
  type TExportRatio = '16:9' | '9:16' | '1:1' | '4:3' | '3:4' | 'custom';
2
602
  type TExportFormat = 'mp4' | 'webm';
3
603
  type TTaskStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PAUSED' | 'CANCELED';
4
604
  type TExportWebhookEventType = 'EXPORT_STARTED' | 'EXPORT_COMPLETED' | 'EXPORT_FAILED';
605
+ type TEditorStateV1 = components['schemas']['editor-state.v1.schema'];
5
606
  interface IApiProblem {
6
607
  type: string;
7
608
  title: string;
@@ -15,7 +616,7 @@ interface IApiEnvelope<T> {
15
616
  }
16
617
  interface ICreateExportRequest {
17
618
  clientTaskId?: string;
18
- editorState: Record<string, unknown>;
619
+ editorState: TEditorStateV1;
19
620
  stateVersion?: string;
20
621
  fps: 30 | 60;
21
622
  compositionWidth?: number;
@@ -57,9 +658,21 @@ interface IExportWebhookEvent {
57
658
  occurredAt: string;
58
659
  task: IExportTask;
59
660
  }
661
+ interface ICaptionAnimationPresetItem {
662
+ id: string;
663
+ type: string;
664
+ label: string;
665
+ preview: string;
666
+ }
667
+ interface ICaptionAnimationPresetGroups {
668
+ in: ICaptionAnimationPresetItem[];
669
+ out: ICaptionAnimationPresetItem[];
670
+ loop: ICaptionAnimationPresetItem[];
671
+ }
60
672
  interface IEditorCapabilities {
61
673
  version: string;
62
674
  animations: string[];
675
+ captionAnimations: ICaptionAnimationPresetGroups;
63
676
  transitions: string[];
64
677
  transitionPresets: Array<{
65
678
  id: string;
@@ -143,7 +756,7 @@ declare class EditorResource {
143
756
  private readonly client;
144
757
  constructor(client: IndreamClient);
145
758
  capabilities(options?: IRequestOptions): Promise<IEditorCapabilities>;
146
- validate(editorState: Record<string, unknown>, options?: IRequestOptions): Promise<IEditorValidationResult>;
759
+ validate(editorState: TEditorStateV1, options?: IRequestOptions): Promise<IEditorValidationResult>;
147
760
  }
148
761
 
149
762
  declare class IndreamClient {
@@ -216,4 +829,4 @@ declare const parseExportWebhookEvent: (value: unknown) => IExportWebhookEvent;
216
829
  declare const verifyExportWebhookSignature: ({ webhookSecret, timestamp, rawBody, signature, }: IVerifyExportWebhookSignatureParams) => Promise<boolean>;
217
830
  declare const verifyExportWebhookRequest: ({ webhookSecret, rawBody, headers, maxSkewSeconds, nowTimestampSeconds, }: IVerifyExportWebhookRequestParams) => Promise<boolean>;
218
831
 
219
- export { APIError, AuthError, type IApiEnvelope, type IApiProblem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateRequestOptions, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListExportsResponse, type IRequestOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IndreamClient, RateLimitError, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TWebhookHeaders, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
832
+ export { APIError, AuthError, type IApiEnvelope, type IApiProblem, type ICaptionAnimationPresetGroups, type ICaptionAnimationPresetItem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateRequestOptions, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListExportsResponse, type IRequestOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IndreamClient, RateLimitError, type TEditorStateV1, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TWebhookHeaders, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,608 @@
1
+ interface components {
2
+ schemas: {
3
+ Problem: {
4
+ type: string;
5
+ title: string;
6
+ status: number;
7
+ detail: string;
8
+ errorCode?: string;
9
+ };
10
+ CreateExportRequest: {
11
+ clientTaskId?: string;
12
+ editorState: components["schemas"]["editor-state.v1.schema"];
13
+ stateVersion?: string;
14
+ /** @enum {integer} */
15
+ fps: 30 | 60;
16
+ compositionWidth?: number;
17
+ compositionHeight?: number;
18
+ /** @enum {string} */
19
+ ratio: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "custom";
20
+ scale: number;
21
+ /** @enum {string} */
22
+ format: "mp4" | "webm";
23
+ callbackUrl?: string;
24
+ callbackHeaders?: {
25
+ [key: string]: string;
26
+ };
27
+ };
28
+ CreateExportResponseData: {
29
+ taskId: string;
30
+ /** Format: date-time */
31
+ createdAt: string;
32
+ durationSeconds: number;
33
+ billedStandardSeconds: number;
34
+ chargedCredits: string;
35
+ };
36
+ ExportTask: {
37
+ taskId: string;
38
+ createdByApiKeyId: string | null;
39
+ clientTaskId: string | null;
40
+ /** @enum {string} */
41
+ status: "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "PAUSED" | "CANCELED";
42
+ progress: number;
43
+ error: string | null;
44
+ outputUrl: string | null;
45
+ durationSeconds: number;
46
+ billedStandardSeconds: number;
47
+ chargedCredits: string;
48
+ callbackUrl: string | null;
49
+ /** Format: date-time */
50
+ createdAt: string;
51
+ /** Format: date-time */
52
+ completedAt: string | null;
53
+ };
54
+ EditorCapabilities: {
55
+ version: string;
56
+ animations: string[];
57
+ captionAnimations: {
58
+ in: {
59
+ id: string;
60
+ type: string;
61
+ label: string;
62
+ preview: string;
63
+ }[];
64
+ out: {
65
+ id: string;
66
+ type: string;
67
+ label: string;
68
+ preview: string;
69
+ }[];
70
+ loop: {
71
+ id: string;
72
+ type: string;
73
+ label: string;
74
+ preview: string;
75
+ }[];
76
+ };
77
+ transitions: string[];
78
+ transitionPresets: {
79
+ id: string;
80
+ type: string;
81
+ label: string;
82
+ params?: {
83
+ [key: string]: unknown;
84
+ };
85
+ }[];
86
+ effects: string[];
87
+ effectPresets: {
88
+ id: string;
89
+ type: string;
90
+ label: string;
91
+ defaultDurationInSeconds?: number;
92
+ defaultIntensity?: number;
93
+ params?: {
94
+ [key: string]: unknown;
95
+ };
96
+ }[];
97
+ filters: string[];
98
+ filterPresets: {
99
+ id: string;
100
+ type: string;
101
+ label: string;
102
+ defaultDurationInSeconds?: number;
103
+ defaultIntensity?: number;
104
+ params?: {
105
+ [key: string]: unknown;
106
+ };
107
+ }[];
108
+ shapes: string[];
109
+ backgroundPresets: {
110
+ colors: string[];
111
+ gradients: string[];
112
+ images: string[];
113
+ blurLevels: number[];
114
+ };
115
+ illustrations: string[];
116
+ };
117
+ EditorValidationError: {
118
+ code: string;
119
+ path: string;
120
+ message: string;
121
+ };
122
+ EditorValidationResult: {
123
+ valid: boolean;
124
+ errors: components["schemas"]["EditorValidationError"][];
125
+ };
126
+ CreateExportResponseEnvelope: {
127
+ data: components["schemas"]["CreateExportResponseData"];
128
+ meta: {
129
+ [key: string]: unknown;
130
+ };
131
+ };
132
+ GetExportResponseEnvelope: {
133
+ data: components["schemas"]["ExportTask"];
134
+ meta: {
135
+ [key: string]: unknown;
136
+ };
137
+ };
138
+ ListExportsResponseEnvelope: {
139
+ data: components["schemas"]["ExportTask"][];
140
+ meta: {
141
+ nextPageCursor?: string | null;
142
+ } & {
143
+ [key: string]: unknown;
144
+ };
145
+ };
146
+ EditorCapabilitiesResponseEnvelope: {
147
+ data: components["schemas"]["EditorCapabilities"];
148
+ meta: {
149
+ [key: string]: unknown;
150
+ };
151
+ };
152
+ EditorValidateResponseEnvelope: {
153
+ data: components["schemas"]["EditorValidationResult"];
154
+ meta: {
155
+ capabilitiesVersion?: string;
156
+ } & {
157
+ [key: string]: unknown;
158
+ };
159
+ };
160
+ baseAsset: {
161
+ id: string;
162
+ type: string;
163
+ filename: string;
164
+ size: number;
165
+ remoteUrl?: string | null;
166
+ remoteKey?: string | null;
167
+ mimeType: string;
168
+ } & {
169
+ [key: string]: unknown;
170
+ };
171
+ primitive: string | number | boolean;
172
+ animationSpec: {
173
+ /** @enum {string} */
174
+ type: "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "zoom-in" | "zoom-out";
175
+ durationTicks: number;
176
+ /** @enum {string} */
177
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
178
+ params?: {
179
+ [key: string]: components["schemas"]["primitive"];
180
+ };
181
+ } & {
182
+ [key: string]: unknown;
183
+ };
184
+ captionAnimationSpec: {
185
+ /** @enum {string} */
186
+ type: "converge" | "elastic-pop" | "typewriter" | "lay-down" | "center-type-out" | "curtain-close" | "jitter" | "rainbow" | "sweep-shine";
187
+ durationTicks: number;
188
+ /** @enum {string} */
189
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
190
+ params?: {
191
+ [key: string]: components["schemas"]["primitive"];
192
+ };
193
+ } & {
194
+ [key: string]: unknown;
195
+ };
196
+ keyframePoint: {
197
+ timeTicks: number;
198
+ value: number;
199
+ };
200
+ animatedNumberTrack: {
201
+ value: number;
202
+ keyframes: components["schemas"]["keyframePoint"][];
203
+ };
204
+ timelineItemBase: {
205
+ id: string;
206
+ type: string;
207
+ durationTicks: number;
208
+ startTicks: number;
209
+ isDraggingInTimeline: boolean;
210
+ } & {
211
+ [key: string]: unknown;
212
+ };
213
+ geometryItemBase: {
214
+ top: components["schemas"]["animatedNumberTrack"];
215
+ left: components["schemas"]["animatedNumberTrack"];
216
+ width: components["schemas"]["animatedNumberTrack"];
217
+ height: components["schemas"]["animatedNumberTrack"];
218
+ scaleX: components["schemas"]["animatedNumberTrack"];
219
+ scaleY: components["schemas"]["animatedNumberTrack"];
220
+ opacity: components["schemas"]["animatedNumberTrack"];
221
+ } & {
222
+ [key: string]: unknown;
223
+ };
224
+ baseItem: components["schemas"]["timelineItemBase"] & components["schemas"]["geometryItemBase"];
225
+ clipAnimations: {
226
+ in?: components["schemas"]["animationSpec"];
227
+ out?: components["schemas"]["animationSpec"];
228
+ };
229
+ captionClipAnimations: {
230
+ in?: components["schemas"]["captionAnimationSpec"];
231
+ out?: components["schemas"]["captionAnimationSpec"];
232
+ loop?: components["schemas"]["captionAnimationSpec"];
233
+ };
234
+ track: {
235
+ id: string;
236
+ items: string[];
237
+ hidden: boolean;
238
+ muted: boolean;
239
+ } & {
240
+ [key: string]: unknown;
241
+ };
242
+ imageAsset: components["schemas"]["baseAsset"] & {
243
+ /** @constant */
244
+ type: "image";
245
+ width: number;
246
+ height: number;
247
+ };
248
+ videoAsset: components["schemas"]["baseAsset"] & {
249
+ /** @constant */
250
+ type: "video";
251
+ durationInSeconds: number;
252
+ hasAudioTrack: boolean;
253
+ width: number;
254
+ height: number;
255
+ };
256
+ gifAsset: components["schemas"]["baseAsset"] & {
257
+ /** @constant */
258
+ type: "gif";
259
+ durationInSeconds: number;
260
+ width: number;
261
+ height: number;
262
+ /** @enum {string} */
263
+ loopBehavior: "finite" | "loop";
264
+ };
265
+ audioAsset: components["schemas"]["baseAsset"] & {
266
+ /** @constant */
267
+ type: "audio";
268
+ durationInSeconds: number;
269
+ };
270
+ captionAsset: components["schemas"]["baseAsset"] & {
271
+ /** @constant */
272
+ type: "caption";
273
+ captions: {
274
+ [key: string]: unknown;
275
+ }[];
276
+ /** @enum {string} */
277
+ timingGranularity: "word" | "line";
278
+ };
279
+ lottieAsset: components["schemas"]["baseAsset"] & {
280
+ /** @constant */
281
+ type: "lottie";
282
+ durationInSeconds: number;
283
+ width: number;
284
+ height: number;
285
+ /** @enum {string} */
286
+ resourceType: "lottie" | "svg";
287
+ resourceJson?: {
288
+ [key: string]: unknown;
289
+ } | null;
290
+ resourceComponentId?: string | null;
291
+ materialConfig?: {
292
+ [key: string]: unknown;
293
+ } | null;
294
+ };
295
+ imageItem: components["schemas"]["baseItem"] & {
296
+ /** @constant */
297
+ type: "image";
298
+ assetId: string;
299
+ stickerId?: string | null;
300
+ stickerVersion?: number | null;
301
+ keepAspectRatio: boolean;
302
+ borderRadius: components["schemas"]["animatedNumberTrack"];
303
+ rotation: components["schemas"]["animatedNumberTrack"];
304
+ cropLeft?: components["schemas"]["animatedNumberTrack"];
305
+ cropTop?: components["schemas"]["animatedNumberTrack"];
306
+ cropRight?: components["schemas"]["animatedNumberTrack"];
307
+ cropBottom?: components["schemas"]["animatedNumberTrack"];
308
+ animations?: components["schemas"]["clipAnimations"];
309
+ };
310
+ videoItem: components["schemas"]["baseItem"] & {
311
+ /** @constant */
312
+ type: "video";
313
+ assetId: string;
314
+ keepAspectRatio: boolean;
315
+ borderRadius: components["schemas"]["animatedNumberTrack"];
316
+ rotation: components["schemas"]["animatedNumberTrack"];
317
+ videoStartFromInSeconds: number;
318
+ decibelAdjustment: components["schemas"]["animatedNumberTrack"];
319
+ playbackRate: number;
320
+ audioFadeInDurationInSeconds: number;
321
+ audioFadeOutDurationInSeconds: number;
322
+ cropLeft?: components["schemas"]["animatedNumberTrack"];
323
+ cropTop?: components["schemas"]["animatedNumberTrack"];
324
+ cropRight?: components["schemas"]["animatedNumberTrack"];
325
+ cropBottom?: components["schemas"]["animatedNumberTrack"];
326
+ animations?: components["schemas"]["clipAnimations"];
327
+ };
328
+ gifItem: components["schemas"]["baseItem"] & {
329
+ /** @constant */
330
+ type: "gif";
331
+ assetId: string;
332
+ keepAspectRatio: boolean;
333
+ borderRadius: components["schemas"]["animatedNumberTrack"];
334
+ rotation: components["schemas"]["animatedNumberTrack"];
335
+ gifStartFromInSeconds: number;
336
+ playbackRate: number;
337
+ cropLeft?: components["schemas"]["animatedNumberTrack"];
338
+ cropTop?: components["schemas"]["animatedNumberTrack"];
339
+ cropRight?: components["schemas"]["animatedNumberTrack"];
340
+ cropBottom?: components["schemas"]["animatedNumberTrack"];
341
+ animations?: components["schemas"]["clipAnimations"];
342
+ };
343
+ lottieItem: components["schemas"]["baseItem"] & {
344
+ /** @constant */
345
+ type: "lottie";
346
+ assetId: string;
347
+ keepAspectRatio: boolean;
348
+ rotation: components["schemas"]["animatedNumberTrack"];
349
+ lottieStartFromInSeconds: number;
350
+ playbackRate: number;
351
+ animations?: components["schemas"]["clipAnimations"];
352
+ };
353
+ audioItem: components["schemas"]["baseItem"] & {
354
+ /** @constant */
355
+ type: "audio";
356
+ assetId: string;
357
+ audioStartFromInSeconds: number;
358
+ decibelAdjustment: components["schemas"]["animatedNumberTrack"];
359
+ playbackRate: number;
360
+ audioFadeInDurationInSeconds: number;
361
+ audioFadeOutDurationInSeconds: number;
362
+ };
363
+ textItem: components["schemas"]["baseItem"] & {
364
+ /** @constant */
365
+ type: "text";
366
+ text: string;
367
+ color: string;
368
+ /** @enum {string} */
369
+ align: "left" | "center" | "right";
370
+ fontFamily: string;
371
+ fontStyle: {
372
+ variant: string;
373
+ weight: string;
374
+ } & {
375
+ [key: string]: unknown;
376
+ };
377
+ fontSize: number;
378
+ lineHeight: number;
379
+ letterSpacing: number;
380
+ resizeOnEdit: boolean;
381
+ /** @enum {string} */
382
+ direction: "ltr" | "rtl";
383
+ strokeWidth: number;
384
+ strokeColor: string;
385
+ background?: null | ({
386
+ color: string;
387
+ horizontalPadding: number;
388
+ borderRadius: number;
389
+ } & {
390
+ [key: string]: unknown;
391
+ });
392
+ rotation?: components["schemas"]["animatedNumberTrack"];
393
+ animations?: components["schemas"]["clipAnimations"];
394
+ captionAnimations?: components["schemas"]["captionClipAnimations"];
395
+ };
396
+ textTemplateItem: components["schemas"]["baseItem"] & {
397
+ /** @constant */
398
+ type: "text-template";
399
+ /** @constant */
400
+ schemaVersion: 2;
401
+ templateId: string;
402
+ templateCategory: string;
403
+ nodes: ({
404
+ /** @enum {string} */
405
+ type: "image" | "text";
406
+ } & {
407
+ [key: string]: unknown;
408
+ })[];
409
+ rotation?: components["schemas"]["animatedNumberTrack"];
410
+ animations?: components["schemas"]["clipAnimations"];
411
+ };
412
+ captionsItem: components["schemas"]["baseItem"] & {
413
+ /** @constant */
414
+ type: "captions";
415
+ assetId: string;
416
+ fontFamily: string;
417
+ fontStyle: {
418
+ variant: string;
419
+ weight: string;
420
+ } & {
421
+ [key: string]: unknown;
422
+ };
423
+ lineHeight: number;
424
+ letterSpacing: number;
425
+ fontSize: number;
426
+ /** @enum {string} */
427
+ align: "left" | "center" | "right";
428
+ color: string;
429
+ highlightColor: string;
430
+ strokeWidth: number;
431
+ strokeColor: string;
432
+ /** @enum {string} */
433
+ direction: "ltr" | "rtl";
434
+ pageDurationInMilliseconds: number;
435
+ captionStartInSeconds: number;
436
+ maxLines: number;
437
+ /** @enum {string} */
438
+ source: "manual" | "auto" | "upload";
439
+ captionGroupId: string | null;
440
+ background: null | ({
441
+ color: string;
442
+ horizontalPadding: number;
443
+ borderRadius: number;
444
+ } & {
445
+ [key: string]: unknown;
446
+ });
447
+ rotation?: components["schemas"]["animatedNumberTrack"];
448
+ animations?: components["schemas"]["clipAnimations"];
449
+ captionAnimations?: components["schemas"]["captionClipAnimations"];
450
+ };
451
+ solidItem: components["schemas"]["baseItem"] & {
452
+ /** @constant */
453
+ type: "solid";
454
+ color: string;
455
+ /** @enum {string} */
456
+ shape: "rectangle" | "circle" | "triangle" | "star";
457
+ keepAspectRatio: boolean;
458
+ borderRadius: components["schemas"]["animatedNumberTrack"];
459
+ rotation: components["schemas"]["animatedNumberTrack"];
460
+ animations?: components["schemas"]["clipAnimations"];
461
+ };
462
+ illustrationItem: components["schemas"]["baseItem"] & {
463
+ /** @constant */
464
+ type: "illustration";
465
+ illustrationName: string;
466
+ color: string;
467
+ keepAspectRatio: boolean;
468
+ rotation: components["schemas"]["animatedNumberTrack"];
469
+ animations?: components["schemas"]["clipAnimations"];
470
+ };
471
+ effectItem: components["schemas"]["timelineItemBase"] & {
472
+ /** @constant */
473
+ type: "effect";
474
+ /** @enum {string} */
475
+ effectType: "flash-to-black" | "blur" | "blurred-opening" | "fade-in" | "fade-out";
476
+ intensity: number;
477
+ params?: {
478
+ [key: string]: components["schemas"]["primitive"];
479
+ };
480
+ };
481
+ filterItem: components["schemas"]["timelineItemBase"] & {
482
+ /** @constant */
483
+ type: "filter";
484
+ /** @enum {string} */
485
+ filterType: "verdant-glow" | "cyberpunk-neon" | "vaporwave-blue" | "sunset-orange" | "lemon-cyan" | "absolute-red" | "sakura-pink" | "twilight-dusk";
486
+ intensity: number;
487
+ params?: {
488
+ [key: string]: components["schemas"]["primitive"];
489
+ };
490
+ };
491
+ chartItem: components["schemas"]["baseItem"] & {
492
+ /** @constant */
493
+ type: "chart";
494
+ chartType: string;
495
+ themeColor: string;
496
+ data: {
497
+ [key: string]: unknown;
498
+ };
499
+ animationDurationTicks: number;
500
+ keepAspectRatio: boolean;
501
+ rotation: components["schemas"]["animatedNumberTrack"];
502
+ animations?: components["schemas"]["clipAnimations"];
503
+ };
504
+ transition: {
505
+ id: string;
506
+ trackId: string;
507
+ fromClipId: string;
508
+ toClipId: string;
509
+ /** @enum {string} */
510
+ type: "fade" | "slide" | "wipe" | "flip" | "clock-wipe" | "iris";
511
+ durationTicks: number;
512
+ /** @enum {string} */
513
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
514
+ params?: {
515
+ [key: string]: components["schemas"]["primitive"];
516
+ };
517
+ } & {
518
+ [key: string]: unknown;
519
+ };
520
+ globalBackground: {
521
+ /** @constant */
522
+ type: "none";
523
+ } | ({
524
+ /** @constant */
525
+ type: "color";
526
+ color: string;
527
+ gradient: string | null;
528
+ } & {
529
+ [key: string]: unknown;
530
+ }) | {
531
+ /** @constant */
532
+ type: "blur";
533
+ /** @enum {integer} */
534
+ level: 0 | 1 | 2 | 3 | 4;
535
+ } | ({
536
+ /** @constant */
537
+ type: "image";
538
+ imageAssetId: string | null;
539
+ imageUrl: string;
540
+ /** @enum {string} */
541
+ source: "preset" | "custom";
542
+ } & {
543
+ [key: string]: unknown;
544
+ });
545
+ brandRuntime: ({
546
+ brandId?: string | null;
547
+ logoX?: number;
548
+ logoY?: number;
549
+ managedItemIds?: string[];
550
+ managedAssetIds?: string[];
551
+ introShiftInFrames?: number;
552
+ overlayTrackId?: string | null;
553
+ underlayTrackId?: string | null;
554
+ } & {
555
+ [key: string]: unknown;
556
+ }) | null;
557
+ /** IndreamEditorStateV1 */
558
+ "editor-state.v1.schema": {
559
+ compositionWidth: number;
560
+ compositionHeight: number;
561
+ /** @constant */
562
+ timebaseTicksPerSecond: 240000;
563
+ /** @enum {string} */
564
+ outputRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "custom";
565
+ tracks: components["schemas"]["track"][];
566
+ assets: {
567
+ [key: string]: components["schemas"]["imageAsset"] | components["schemas"]["videoAsset"] | components["schemas"]["gifAsset"] | components["schemas"]["audioAsset"] | components["schemas"]["captionAsset"] | components["schemas"]["lottieAsset"];
568
+ };
569
+ items: {
570
+ [key: string]: components["schemas"]["imageItem"] | components["schemas"]["videoItem"] | components["schemas"]["gifItem"] | components["schemas"]["lottieItem"] | components["schemas"]["audioItem"] | components["schemas"]["textItem"] | components["schemas"]["textTemplateItem"] | components["schemas"]["captionsItem"] | components["schemas"]["solidItem"] | components["schemas"]["illustrationItem"] | components["schemas"]["effectItem"] | components["schemas"]["filterItem"] | components["schemas"]["chartItem"];
571
+ };
572
+ transitions: {
573
+ [key: string]: components["schemas"]["transition"];
574
+ };
575
+ globalBackground?: components["schemas"]["globalBackground"];
576
+ brandRuntime?: components["schemas"]["brandRuntime"];
577
+ deletedAssets?: {
578
+ [key: string]: unknown;
579
+ }[];
580
+ } & {
581
+ [key: string]: unknown;
582
+ };
583
+ };
584
+ responses: {
585
+ /** @description Error response */
586
+ Problem: {
587
+ headers: {
588
+ [name: string]: unknown;
589
+ };
590
+ content: {
591
+ "application/json": components["schemas"]["Problem"];
592
+ };
593
+ };
594
+ };
595
+ parameters: never;
596
+ requestBodies: never;
597
+ headers: never;
598
+ pathItems: never;
599
+ }
600
+
1
601
  type TExportRatio = '16:9' | '9:16' | '1:1' | '4:3' | '3:4' | 'custom';
2
602
  type TExportFormat = 'mp4' | 'webm';
3
603
  type TTaskStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PAUSED' | 'CANCELED';
4
604
  type TExportWebhookEventType = 'EXPORT_STARTED' | 'EXPORT_COMPLETED' | 'EXPORT_FAILED';
605
+ type TEditorStateV1 = components['schemas']['editor-state.v1.schema'];
5
606
  interface IApiProblem {
6
607
  type: string;
7
608
  title: string;
@@ -15,7 +616,7 @@ interface IApiEnvelope<T> {
15
616
  }
16
617
  interface ICreateExportRequest {
17
618
  clientTaskId?: string;
18
- editorState: Record<string, unknown>;
619
+ editorState: TEditorStateV1;
19
620
  stateVersion?: string;
20
621
  fps: 30 | 60;
21
622
  compositionWidth?: number;
@@ -57,9 +658,21 @@ interface IExportWebhookEvent {
57
658
  occurredAt: string;
58
659
  task: IExportTask;
59
660
  }
661
+ interface ICaptionAnimationPresetItem {
662
+ id: string;
663
+ type: string;
664
+ label: string;
665
+ preview: string;
666
+ }
667
+ interface ICaptionAnimationPresetGroups {
668
+ in: ICaptionAnimationPresetItem[];
669
+ out: ICaptionAnimationPresetItem[];
670
+ loop: ICaptionAnimationPresetItem[];
671
+ }
60
672
  interface IEditorCapabilities {
61
673
  version: string;
62
674
  animations: string[];
675
+ captionAnimations: ICaptionAnimationPresetGroups;
63
676
  transitions: string[];
64
677
  transitionPresets: Array<{
65
678
  id: string;
@@ -143,7 +756,7 @@ declare class EditorResource {
143
756
  private readonly client;
144
757
  constructor(client: IndreamClient);
145
758
  capabilities(options?: IRequestOptions): Promise<IEditorCapabilities>;
146
- validate(editorState: Record<string, unknown>, options?: IRequestOptions): Promise<IEditorValidationResult>;
759
+ validate(editorState: TEditorStateV1, options?: IRequestOptions): Promise<IEditorValidationResult>;
147
760
  }
148
761
 
149
762
  declare class IndreamClient {
@@ -216,4 +829,4 @@ declare const parseExportWebhookEvent: (value: unknown) => IExportWebhookEvent;
216
829
  declare const verifyExportWebhookSignature: ({ webhookSecret, timestamp, rawBody, signature, }: IVerifyExportWebhookSignatureParams) => Promise<boolean>;
217
830
  declare const verifyExportWebhookRequest: ({ webhookSecret, rawBody, headers, maxSkewSeconds, nowTimestampSeconds, }: IVerifyExportWebhookRequestParams) => Promise<boolean>;
218
831
 
219
- export { APIError, AuthError, type IApiEnvelope, type IApiProblem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateRequestOptions, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListExportsResponse, type IRequestOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IndreamClient, RateLimitError, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TWebhookHeaders, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
832
+ export { APIError, AuthError, type IApiEnvelope, type IApiProblem, type ICaptionAnimationPresetGroups, type ICaptionAnimationPresetItem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateRequestOptions, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListExportsResponse, type IRequestOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IndreamClient, RateLimitError, type TEditorStateV1, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TWebhookHeaders, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indreamai/client",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Official JavaScript client for Indream Open API (Node.js and Edge runtimes)",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",