@rendobar/sdk 5.1.0 → 5.2.0
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/LICENSE +21 -0
- package/README.md +155 -223
- package/dist/index.cjs +20 -0
- package/dist/index.d.cts +117 -44
- package/dist/index.d.mts +117 -44
- package/dist/index.mjs +20 -0
- package/package.json +24 -2
package/dist/index.d.mts
CHANGED
|
@@ -2163,13 +2163,13 @@ declare const jobStepSchema: ZodObject<{
|
|
|
2163
2163
|
* treating the file as opaque ("other"). Adding a value here is non-breaking.
|
|
2164
2164
|
*/
|
|
2165
2165
|
declare const fileTypeSchema: ZodEnum<{
|
|
2166
|
-
video: "video";
|
|
2167
|
-
image: "image";
|
|
2168
2166
|
audio: "audio";
|
|
2169
2167
|
captions: "captions";
|
|
2170
|
-
playlist: "playlist";
|
|
2171
2168
|
data: "data";
|
|
2169
|
+
image: "image";
|
|
2172
2170
|
other: "other";
|
|
2171
|
+
playlist: "playlist";
|
|
2172
|
+
video: "video";
|
|
2173
2173
|
}>;
|
|
2174
2174
|
/**
|
|
2175
2175
|
* A single produced file. `url` is a ready-to-fetch, time-limited URL (signed
|
|
@@ -2181,13 +2181,13 @@ declare const fileSchema: ZodObject<{
|
|
|
2181
2181
|
url: ZodString;
|
|
2182
2182
|
path: ZodString;
|
|
2183
2183
|
type: ZodEnum<{
|
|
2184
|
-
video: "video";
|
|
2185
|
-
image: "image";
|
|
2186
2184
|
audio: "audio";
|
|
2187
2185
|
captions: "captions";
|
|
2188
|
-
playlist: "playlist";
|
|
2189
2186
|
data: "data";
|
|
2187
|
+
image: "image";
|
|
2190
2188
|
other: "other";
|
|
2189
|
+
playlist: "playlist";
|
|
2190
|
+
video: "video";
|
|
2191
2191
|
}>;
|
|
2192
2192
|
size: ZodNumber;
|
|
2193
2193
|
meta: ZodOptional<ZodObject<{
|
|
@@ -2195,6 +2195,7 @@ declare const fileSchema: ZodObject<{
|
|
|
2195
2195
|
width: ZodOptional<ZodNumber>;
|
|
2196
2196
|
height: ZodOptional<ZodNumber>;
|
|
2197
2197
|
durationMs: ZodOptional<ZodNumber>;
|
|
2198
|
+
seed: ZodOptional<ZodNumber>;
|
|
2198
2199
|
}, $strip>>;
|
|
2199
2200
|
}, $strip>;
|
|
2200
2201
|
declare const jobOutputSchema: ZodObject<{
|
|
@@ -2203,13 +2204,13 @@ declare const jobOutputSchema: ZodObject<{
|
|
|
2203
2204
|
url: ZodString;
|
|
2204
2205
|
path: ZodString;
|
|
2205
2206
|
type: ZodEnum<{
|
|
2206
|
-
video: "video";
|
|
2207
|
-
image: "image";
|
|
2208
2207
|
audio: "audio";
|
|
2209
2208
|
captions: "captions";
|
|
2210
|
-
playlist: "playlist";
|
|
2211
2209
|
data: "data";
|
|
2210
|
+
image: "image";
|
|
2212
2211
|
other: "other";
|
|
2212
|
+
playlist: "playlist";
|
|
2213
|
+
video: "video";
|
|
2213
2214
|
}>;
|
|
2214
2215
|
size: ZodNumber;
|
|
2215
2216
|
meta: ZodOptional<ZodObject<{
|
|
@@ -2217,19 +2218,20 @@ declare const jobOutputSchema: ZodObject<{
|
|
|
2217
2218
|
width: ZodOptional<ZodNumber>;
|
|
2218
2219
|
height: ZodOptional<ZodNumber>;
|
|
2219
2220
|
durationMs: ZodOptional<ZodNumber>;
|
|
2221
|
+
seed: ZodOptional<ZodNumber>;
|
|
2220
2222
|
}, $strip>>;
|
|
2221
2223
|
}, $strip>>;
|
|
2222
2224
|
files: ZodArray<ZodObject<{
|
|
2223
2225
|
url: ZodString;
|
|
2224
2226
|
path: ZodString;
|
|
2225
2227
|
type: ZodEnum<{
|
|
2226
|
-
video: "video";
|
|
2227
|
-
image: "image";
|
|
2228
2228
|
audio: "audio";
|
|
2229
2229
|
captions: "captions";
|
|
2230
|
-
playlist: "playlist";
|
|
2231
2230
|
data: "data";
|
|
2231
|
+
image: "image";
|
|
2232
2232
|
other: "other";
|
|
2233
|
+
playlist: "playlist";
|
|
2234
|
+
video: "video";
|
|
2233
2235
|
}>;
|
|
2234
2236
|
size: ZodNumber;
|
|
2235
2237
|
meta: ZodOptional<ZodObject<{
|
|
@@ -2237,6 +2239,7 @@ declare const jobOutputSchema: ZodObject<{
|
|
|
2237
2239
|
width: ZodOptional<ZodNumber>;
|
|
2238
2240
|
height: ZodOptional<ZodNumber>;
|
|
2239
2241
|
durationMs: ZodOptional<ZodNumber>;
|
|
2242
|
+
seed: ZodOptional<ZodNumber>;
|
|
2240
2243
|
}, $strip>>;
|
|
2241
2244
|
}, $strip>>;
|
|
2242
2245
|
expiresAt: ZodNullable<ZodNumber>;
|
|
@@ -2247,9 +2250,9 @@ declare const jobErrorSchema: ZodObject<{
|
|
|
2247
2250
|
detail: ZodNullable<ZodString>;
|
|
2248
2251
|
retryable: ZodBoolean;
|
|
2249
2252
|
failedPhase: ZodOptional<ZodEnum<{
|
|
2253
|
+
finalizing: "finalizing";
|
|
2250
2254
|
preparing: "preparing";
|
|
2251
2255
|
processing: "processing";
|
|
2252
|
-
finalizing: "finalizing";
|
|
2253
2256
|
}>>;
|
|
2254
2257
|
}, $strip>;
|
|
2255
2258
|
declare const jobCostSchema: ZodObject<{
|
|
@@ -2274,12 +2277,12 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2274
2277
|
formatted: ZodString;
|
|
2275
2278
|
}, $strip>>;
|
|
2276
2279
|
outputCategory: ZodEnum<{
|
|
2277
|
-
video: "video";
|
|
2278
|
-
image: "image";
|
|
2279
2280
|
audio: "audio";
|
|
2280
2281
|
captions: "captions";
|
|
2282
|
+
image: "image";
|
|
2281
2283
|
json: "json";
|
|
2282
2284
|
raw: "raw";
|
|
2285
|
+
video: "video";
|
|
2283
2286
|
}>;
|
|
2284
2287
|
steps: ZodArray<ZodObject<{
|
|
2285
2288
|
id: ZodString;
|
|
@@ -2301,11 +2304,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2301
2304
|
completedAt: ZodNullable<ZodNumber>;
|
|
2302
2305
|
settledAt: ZodNullable<ZodNumber>;
|
|
2303
2306
|
retentionExpiresAt: ZodNullable<ZodNumber>;
|
|
2307
|
+
webUrl: ZodString;
|
|
2308
|
+
model: ZodNullable<ZodString>;
|
|
2304
2309
|
callback: ZodOptional<ZodNullable<ZodObject<{
|
|
2305
2310
|
status: ZodEnum<{
|
|
2306
|
-
pending: "pending";
|
|
2307
2311
|
delivered: "delivered";
|
|
2308
2312
|
failed: "failed";
|
|
2313
|
+
pending: "pending";
|
|
2309
2314
|
}>;
|
|
2310
2315
|
}, $strip>>>;
|
|
2311
2316
|
status: ZodLiteral<"waiting">;
|
|
@@ -2326,12 +2331,12 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2326
2331
|
formatted: ZodString;
|
|
2327
2332
|
}, $strip>>;
|
|
2328
2333
|
outputCategory: ZodEnum<{
|
|
2329
|
-
video: "video";
|
|
2330
|
-
image: "image";
|
|
2331
2334
|
audio: "audio";
|
|
2332
2335
|
captions: "captions";
|
|
2336
|
+
image: "image";
|
|
2333
2337
|
json: "json";
|
|
2334
2338
|
raw: "raw";
|
|
2339
|
+
video: "video";
|
|
2335
2340
|
}>;
|
|
2336
2341
|
steps: ZodArray<ZodObject<{
|
|
2337
2342
|
id: ZodString;
|
|
@@ -2353,11 +2358,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2353
2358
|
completedAt: ZodNullable<ZodNumber>;
|
|
2354
2359
|
settledAt: ZodNullable<ZodNumber>;
|
|
2355
2360
|
retentionExpiresAt: ZodNullable<ZodNumber>;
|
|
2361
|
+
webUrl: ZodString;
|
|
2362
|
+
model: ZodNullable<ZodString>;
|
|
2356
2363
|
callback: ZodOptional<ZodNullable<ZodObject<{
|
|
2357
2364
|
status: ZodEnum<{
|
|
2358
|
-
pending: "pending";
|
|
2359
2365
|
delivered: "delivered";
|
|
2360
2366
|
failed: "failed";
|
|
2367
|
+
pending: "pending";
|
|
2361
2368
|
}>;
|
|
2362
2369
|
}, $strip>>>;
|
|
2363
2370
|
status: ZodLiteral<"dispatched">;
|
|
@@ -2380,12 +2387,12 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2380
2387
|
formatted: ZodString;
|
|
2381
2388
|
}, $strip>>;
|
|
2382
2389
|
outputCategory: ZodEnum<{
|
|
2383
|
-
video: "video";
|
|
2384
|
-
image: "image";
|
|
2385
2390
|
audio: "audio";
|
|
2386
2391
|
captions: "captions";
|
|
2392
|
+
image: "image";
|
|
2387
2393
|
json: "json";
|
|
2388
2394
|
raw: "raw";
|
|
2395
|
+
video: "video";
|
|
2389
2396
|
}>;
|
|
2390
2397
|
steps: ZodArray<ZodObject<{
|
|
2391
2398
|
id: ZodString;
|
|
@@ -2407,11 +2414,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2407
2414
|
completedAt: ZodNullable<ZodNumber>;
|
|
2408
2415
|
settledAt: ZodNullable<ZodNumber>;
|
|
2409
2416
|
retentionExpiresAt: ZodNullable<ZodNumber>;
|
|
2417
|
+
webUrl: ZodString;
|
|
2418
|
+
model: ZodNullable<ZodString>;
|
|
2410
2419
|
callback: ZodOptional<ZodNullable<ZodObject<{
|
|
2411
2420
|
status: ZodEnum<{
|
|
2412
|
-
pending: "pending";
|
|
2413
2421
|
delivered: "delivered";
|
|
2414
2422
|
failed: "failed";
|
|
2423
|
+
pending: "pending";
|
|
2415
2424
|
}>;
|
|
2416
2425
|
}, $strip>>>;
|
|
2417
2426
|
status: ZodLiteral<"running">;
|
|
@@ -2434,12 +2443,12 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2434
2443
|
formatted: ZodString;
|
|
2435
2444
|
}, $strip>>;
|
|
2436
2445
|
outputCategory: ZodEnum<{
|
|
2437
|
-
video: "video";
|
|
2438
|
-
image: "image";
|
|
2439
2446
|
audio: "audio";
|
|
2440
2447
|
captions: "captions";
|
|
2448
|
+
image: "image";
|
|
2441
2449
|
json: "json";
|
|
2442
2450
|
raw: "raw";
|
|
2451
|
+
video: "video";
|
|
2443
2452
|
}>;
|
|
2444
2453
|
steps: ZodArray<ZodObject<{
|
|
2445
2454
|
id: ZodString;
|
|
@@ -2461,11 +2470,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2461
2470
|
completedAt: ZodNullable<ZodNumber>;
|
|
2462
2471
|
settledAt: ZodNullable<ZodNumber>;
|
|
2463
2472
|
retentionExpiresAt: ZodNullable<ZodNumber>;
|
|
2473
|
+
webUrl: ZodString;
|
|
2474
|
+
model: ZodNullable<ZodString>;
|
|
2464
2475
|
callback: ZodOptional<ZodNullable<ZodObject<{
|
|
2465
2476
|
status: ZodEnum<{
|
|
2466
|
-
pending: "pending";
|
|
2467
2477
|
delivered: "delivered";
|
|
2468
2478
|
failed: "failed";
|
|
2479
|
+
pending: "pending";
|
|
2469
2480
|
}>;
|
|
2470
2481
|
}, $strip>>>;
|
|
2471
2482
|
status: ZodLiteral<"complete">;
|
|
@@ -2475,13 +2486,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2475
2486
|
url: ZodString;
|
|
2476
2487
|
path: ZodString;
|
|
2477
2488
|
type: ZodEnum<{
|
|
2478
|
-
video: "video";
|
|
2479
|
-
image: "image";
|
|
2480
2489
|
audio: "audio";
|
|
2481
2490
|
captions: "captions";
|
|
2482
|
-
playlist: "playlist";
|
|
2483
2491
|
data: "data";
|
|
2492
|
+
image: "image";
|
|
2484
2493
|
other: "other";
|
|
2494
|
+
playlist: "playlist";
|
|
2495
|
+
video: "video";
|
|
2485
2496
|
}>;
|
|
2486
2497
|
size: ZodNumber;
|
|
2487
2498
|
meta: ZodOptional<ZodObject<{
|
|
@@ -2489,19 +2500,20 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2489
2500
|
width: ZodOptional<ZodNumber>;
|
|
2490
2501
|
height: ZodOptional<ZodNumber>;
|
|
2491
2502
|
durationMs: ZodOptional<ZodNumber>;
|
|
2503
|
+
seed: ZodOptional<ZodNumber>;
|
|
2492
2504
|
}, $strip>>;
|
|
2493
2505
|
}, $strip>>;
|
|
2494
2506
|
files: ZodArray<ZodObject<{
|
|
2495
2507
|
url: ZodString;
|
|
2496
2508
|
path: ZodString;
|
|
2497
2509
|
type: ZodEnum<{
|
|
2498
|
-
video: "video";
|
|
2499
|
-
image: "image";
|
|
2500
2510
|
audio: "audio";
|
|
2501
2511
|
captions: "captions";
|
|
2502
|
-
playlist: "playlist";
|
|
2503
2512
|
data: "data";
|
|
2513
|
+
image: "image";
|
|
2504
2514
|
other: "other";
|
|
2515
|
+
playlist: "playlist";
|
|
2516
|
+
video: "video";
|
|
2505
2517
|
}>;
|
|
2506
2518
|
size: ZodNumber;
|
|
2507
2519
|
meta: ZodOptional<ZodObject<{
|
|
@@ -2509,6 +2521,7 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2509
2521
|
width: ZodOptional<ZodNumber>;
|
|
2510
2522
|
height: ZodOptional<ZodNumber>;
|
|
2511
2523
|
durationMs: ZodOptional<ZodNumber>;
|
|
2524
|
+
seed: ZodOptional<ZodNumber>;
|
|
2512
2525
|
}, $strip>>;
|
|
2513
2526
|
}, $strip>>;
|
|
2514
2527
|
expiresAt: ZodNullable<ZodNumber>;
|
|
@@ -2530,12 +2543,12 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2530
2543
|
formatted: ZodString;
|
|
2531
2544
|
}, $strip>>;
|
|
2532
2545
|
outputCategory: ZodEnum<{
|
|
2533
|
-
video: "video";
|
|
2534
|
-
image: "image";
|
|
2535
2546
|
audio: "audio";
|
|
2536
2547
|
captions: "captions";
|
|
2548
|
+
image: "image";
|
|
2537
2549
|
json: "json";
|
|
2538
2550
|
raw: "raw";
|
|
2551
|
+
video: "video";
|
|
2539
2552
|
}>;
|
|
2540
2553
|
steps: ZodArray<ZodObject<{
|
|
2541
2554
|
id: ZodString;
|
|
@@ -2557,11 +2570,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2557
2570
|
completedAt: ZodNullable<ZodNumber>;
|
|
2558
2571
|
settledAt: ZodNullable<ZodNumber>;
|
|
2559
2572
|
retentionExpiresAt: ZodNullable<ZodNumber>;
|
|
2573
|
+
webUrl: ZodString;
|
|
2574
|
+
model: ZodNullable<ZodString>;
|
|
2560
2575
|
callback: ZodOptional<ZodNullable<ZodObject<{
|
|
2561
2576
|
status: ZodEnum<{
|
|
2562
|
-
pending: "pending";
|
|
2563
2577
|
delivered: "delivered";
|
|
2564
2578
|
failed: "failed";
|
|
2579
|
+
pending: "pending";
|
|
2565
2580
|
}>;
|
|
2566
2581
|
}, $strip>>>;
|
|
2567
2582
|
status: ZodLiteral<"failed">;
|
|
@@ -2571,9 +2586,9 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2571
2586
|
detail: ZodNullable<ZodString>;
|
|
2572
2587
|
retryable: ZodBoolean;
|
|
2573
2588
|
failedPhase: ZodOptional<ZodEnum<{
|
|
2589
|
+
finalizing: "finalizing";
|
|
2574
2590
|
preparing: "preparing";
|
|
2575
2591
|
processing: "processing";
|
|
2576
|
-
finalizing: "finalizing";
|
|
2577
2592
|
}>>;
|
|
2578
2593
|
}, $strip>;
|
|
2579
2594
|
}, $strip>, ZodObject<{
|
|
@@ -2593,12 +2608,12 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2593
2608
|
formatted: ZodString;
|
|
2594
2609
|
}, $strip>>;
|
|
2595
2610
|
outputCategory: ZodEnum<{
|
|
2596
|
-
video: "video";
|
|
2597
|
-
image: "image";
|
|
2598
2611
|
audio: "audio";
|
|
2599
2612
|
captions: "captions";
|
|
2613
|
+
image: "image";
|
|
2600
2614
|
json: "json";
|
|
2601
2615
|
raw: "raw";
|
|
2616
|
+
video: "video";
|
|
2602
2617
|
}>;
|
|
2603
2618
|
steps: ZodArray<ZodObject<{
|
|
2604
2619
|
id: ZodString;
|
|
@@ -2620,11 +2635,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2620
2635
|
completedAt: ZodNullable<ZodNumber>;
|
|
2621
2636
|
settledAt: ZodNullable<ZodNumber>;
|
|
2622
2637
|
retentionExpiresAt: ZodNullable<ZodNumber>;
|
|
2638
|
+
webUrl: ZodString;
|
|
2639
|
+
model: ZodNullable<ZodString>;
|
|
2623
2640
|
callback: ZodOptional<ZodNullable<ZodObject<{
|
|
2624
2641
|
status: ZodEnum<{
|
|
2625
|
-
pending: "pending";
|
|
2626
2642
|
delivered: "delivered";
|
|
2627
2643
|
failed: "failed";
|
|
2644
|
+
pending: "pending";
|
|
2628
2645
|
}>;
|
|
2629
2646
|
}, $strip>>>;
|
|
2630
2647
|
status: ZodLiteral<"cancelled">;
|
|
@@ -2764,10 +2781,10 @@ declare const webhookDeliverySchema: ZodObject<{
|
|
|
2764
2781
|
event: ZodString;
|
|
2765
2782
|
payload: ZodString;
|
|
2766
2783
|
status: ZodEnum<{
|
|
2767
|
-
|
|
2784
|
+
cancelled: "cancelled";
|
|
2768
2785
|
delivered: "delivered";
|
|
2769
2786
|
failed: "failed";
|
|
2770
|
-
|
|
2787
|
+
pending: "pending";
|
|
2771
2788
|
}>;
|
|
2772
2789
|
statusCode: ZodNullable<ZodNumber>;
|
|
2773
2790
|
responseBody: ZodNullable<ZodString>;
|
|
@@ -3024,9 +3041,9 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
3024
3041
|
timestamp: ZodNumber;
|
|
3025
3042
|
progress: ZodNullable<ZodNumber>;
|
|
3026
3043
|
phase: ZodOptional<ZodEnum<{
|
|
3044
|
+
finalizing: "finalizing";
|
|
3027
3045
|
preparing: "preparing";
|
|
3028
3046
|
processing: "processing";
|
|
3029
|
-
finalizing: "finalizing";
|
|
3030
3047
|
}>>;
|
|
3031
3048
|
step: ZodString;
|
|
3032
3049
|
stepProgress: ZodOptional<ZodNumber>;
|
|
@@ -3083,10 +3100,10 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
3083
3100
|
jobId: ZodString;
|
|
3084
3101
|
timestamp: ZodOptional<ZodNumber>;
|
|
3085
3102
|
level: ZodEnum<{
|
|
3103
|
+
debug: "debug";
|
|
3086
3104
|
error: "error";
|
|
3087
3105
|
info: "info";
|
|
3088
3106
|
warn: "warn";
|
|
3089
|
-
debug: "debug";
|
|
3090
3107
|
}>;
|
|
3091
3108
|
message: ZodString;
|
|
3092
3109
|
step: ZodOptional<ZodString>;
|
|
@@ -3332,6 +3349,7 @@ declare function createClient(config?: ClientConfig): {
|
|
|
3332
3349
|
}) => Promise<JobListPage>;
|
|
3333
3350
|
listAll: (params?: Omit<ListJobsParams, "offset">) => AsyncGenerator<JobResponse>;
|
|
3334
3351
|
wait: (id: string, options?: WaitOptions) => Promise<JobResponse>;
|
|
3352
|
+
run: (params: CreateJobParams, options?: WaitOptions) => Promise<JobResponse>;
|
|
3335
3353
|
cancel: (id: string, options?: {
|
|
3336
3354
|
signal?: AbortSignal;
|
|
3337
3355
|
}) => Promise<JobResponse>;
|
|
@@ -3500,7 +3518,7 @@ declare function createClient(config?: ClientConfig): {
|
|
|
3500
3518
|
signal?: AbortSignal;
|
|
3501
3519
|
}): Promise<void>;
|
|
3502
3520
|
getSettings(options?: {
|
|
3503
|
-
signal
|
|
3521
|
+
signal?: AbortSignal;
|
|
3504
3522
|
}): Promise<OrgSettings>;
|
|
3505
3523
|
updateSettings(body: Partial<Pick<OrgSettings, "billingEmailsEnabled" | "defaultRegion" | "regionPinned">>, options?: {
|
|
3506
3524
|
signal?: AbortSignal;
|
|
@@ -3678,6 +3696,61 @@ interface FfmpegParams {
|
|
|
3678
3696
|
compute?: "auto" | "cpu" | "gpu";
|
|
3679
3697
|
}
|
|
3680
3698
|
//#endregion
|
|
3699
|
+
//#region src/jobs/image.d.ts
|
|
3700
|
+
/**
|
|
3701
|
+
* Public params types for the `image.generate` and `image.edit` jobs.
|
|
3702
|
+
*
|
|
3703
|
+
* Declared as plain interfaces here (rather than re-exported from
|
|
3704
|
+
* `@rendobar/shared`) for the same reason as `FfmpegParams` in `./ffmpeg.js`:
|
|
3705
|
+
* the SDK's dts bundler must not follow the shared package's job-registry
|
|
3706
|
+
* type graph — that graph pulls the full generation model catalog into the
|
|
3707
|
+
* .d.ts output and causes tsdown to OOM.
|
|
3708
|
+
*
|
|
3709
|
+
* The canonical runtime shape is the discriminated Zod unions in
|
|
3710
|
+
* `packages/shared/src/jobs/definitions/image-generate.job.ts` and
|
|
3711
|
+
* `image-edit.job.ts` (built from `GEN_BASE_PARAMS` in
|
|
3712
|
+
* `packages/shared/src/jobs/gen-registry.ts`) — keep these interfaces in
|
|
3713
|
+
* sync with them. Both jobs share the same base field set. The per-model
|
|
3714
|
+
* extras (`negativePrompt`, `guidance`, `steps`) are offered here as
|
|
3715
|
+
* optional on every model rather than reproduced as the catalog's per-model
|
|
3716
|
+
* discriminated union, so the SDK doesn't have to track which model
|
|
3717
|
+
* supports which knob — the API validates against the real per-model schema
|
|
3718
|
+
* and rejects a field the resolved model doesn't support.
|
|
3719
|
+
*/
|
|
3720
|
+
/**
|
|
3721
|
+
* Tier alias for a generation model. `"economy"` is the default when `model`
|
|
3722
|
+
* is omitted. Pin an exact model id (e.g. `"qwen-image-2512"`) instead of a
|
|
3723
|
+
* tier to reach that model's own controls.
|
|
3724
|
+
*/
|
|
3725
|
+
type GenModelTier = "economy" | "standard" | "premium";
|
|
3726
|
+
interface ImageGenBaseParams {
|
|
3727
|
+
/** Tier alias or exact model id. Defaults to the "economy" tier when omitted. */
|
|
3728
|
+
model?: GenModelTier | string;
|
|
3729
|
+
/** What you want. For image.edit, describe the change to make. Plain language, no special syntax. */
|
|
3730
|
+
prompt: string;
|
|
3731
|
+
/** Requested output width in pixels. Snapped to what the model can render. */
|
|
3732
|
+
width?: number;
|
|
3733
|
+
/** Requested output height in pixels. Snapped to what the model can render. */
|
|
3734
|
+
height?: number;
|
|
3735
|
+
/** Fixed seed for a reproducible result. The seed used is echoed back. */
|
|
3736
|
+
seed?: number;
|
|
3737
|
+
/** What to keep out of the image. Only some models support this. */
|
|
3738
|
+
negativePrompt?: string;
|
|
3739
|
+
/** How strictly to follow the prompt. Higher is stricter. Only some models support this. */
|
|
3740
|
+
guidance?: number;
|
|
3741
|
+
/** Denoise steps. More steps means more detail and more time. Range depends on the resolved model. */
|
|
3742
|
+
steps?: number;
|
|
3743
|
+
/** Rewrite the prompt for the model before generating. Defaults per model; omit to keep the model's default. */
|
|
3744
|
+
enhancePrompt?: boolean;
|
|
3745
|
+
}
|
|
3746
|
+
/** Public params type for the `image.generate` job. */
|
|
3747
|
+
interface ImageGenerateParams extends ImageGenBaseParams {}
|
|
3748
|
+
/**
|
|
3749
|
+
* Public params type for the `image.edit` job. Reference images (1-4) are
|
|
3750
|
+
* passed as job `inputs.images`, not here — see `CreateJobParams.inputs`.
|
|
3751
|
+
*/
|
|
3752
|
+
interface ImageEditParams extends ImageGenBaseParams {}
|
|
3753
|
+
//#endregion
|
|
3681
3754
|
//#region src/resources/jobs.d.ts
|
|
3682
3755
|
type CreateJobParams = {
|
|
3683
3756
|
type: string;
|
|
@@ -3852,4 +3925,4 @@ type AssetListPage = {
|
|
|
3852
3925
|
meta: AssetListMeta;
|
|
3853
3926
|
};
|
|
3854
3927
|
//#endregion
|
|
3855
|
-
export { ApiError, type ApiKey, type AssetResponse as Asset, type AssetDownloadResponse, type AssetInitResponse, type AssetListMeta, type AssetListPage, type BalanceDepletedData, type BalanceLowData, type BillingInvoice, type BillingState, type ClientConfig, type Cost, type CreateJobParams, type CreateUploadOptions, type CreateWebhookParams, type FfmpegParams, type FileType, type JobResponse as Job, type JobCancelledData, type JobCompletedData, type JobCreatedData, type JobCreatedResponse, type JobError, type JobFailedData, JobFailedError, type JobListPage, type JobStartedData, type JobStats, type JobStep, type JobSubscribeOptions, type JobSubscription, type JobTimings, type JobType, type ListAssetsParams, type ListDeliveriesParams, type ListJobsParams, type LogEntryData, type OrgCurrentResponse, type OrgEvent, type OrgSettings, type Organization, type Output, type OutputFile, type PaginationMeta, type PaymentMethod, type RealtimeConnectOptions, type RealtimeConnection, type RendobarClient, type RetryDeliveryResult, type StatsParams, type TestEventData, type Transaction, type TransactionListParams, type UpdateWebhookParams, type UploadProgress, type UsageParams, type UsageSummary, type WaitOptions, WaitTimeoutError, type WebhookDelivery, type WebhookEndpoint, type WebhookEventDataMap, type WebhookPayload, createClient, isApiError, jobData, outputUrl };
|
|
3928
|
+
export { ApiError, type ApiKey, type AssetResponse as Asset, type AssetDownloadResponse, type AssetInitResponse, type AssetListMeta, type AssetListPage, type BalanceDepletedData, type BalanceLowData, type BillingInvoice, type BillingState, type ClientConfig, type Cost, type CreateJobParams, type CreateUploadOptions, type CreateWebhookParams, type FfmpegParams, type FileType, type GenModelTier, type ImageEditParams, type ImageGenerateParams, type JobResponse as Job, type JobCancelledData, type JobCompletedData, type JobCreatedData, type JobCreatedResponse, type JobError, type JobFailedData, JobFailedError, type JobListPage, type JobStartedData, type JobStats, type JobStep, type JobSubscribeOptions, type JobSubscription, type JobTimings, type JobType, type ListAssetsParams, type ListDeliveriesParams, type ListJobsParams, type LogEntryData, type OrgCurrentResponse, type OrgEvent, type OrgSettings, type Organization, type Output, type OutputFile, type PaginationMeta, type PaymentMethod, type RealtimeConnectOptions, type RealtimeConnection, type RendobarClient, type RetryDeliveryResult, type StatsParams, type TestEventData, type Transaction, type TransactionListParams, type UpdateWebhookParams, type UploadProgress, type UsageParams, type UsageSummary, type WaitOptions, WaitTimeoutError, type WebhookDelivery, type WebhookEndpoint, type WebhookEventDataMap, type WebhookPayload, createClient, isApiError, jobData, outputUrl };
|
package/dist/index.mjs
CHANGED
|
@@ -208,6 +208,25 @@ function createJobsResource(request) {
|
|
|
208
208
|
signal: options?.signal
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Create a job and wait for it to reach a terminal state, returning the
|
|
213
|
+
* finished job. A convenience wrapper over `create()` + `wait()` for
|
|
214
|
+
* callers who just want the result without juggling two calls — works for
|
|
215
|
+
* any job type, not just a specific product.
|
|
216
|
+
*
|
|
217
|
+
* Unlike `wait()` (which defaults `throwOnFailure` to `false` to preserve
|
|
218
|
+
* its existing behavior), `run()` defaults `throwOnFailure` to `true`: a
|
|
219
|
+
* job that ends "failed" or "cancelled" throws `JobFailedError` unless the
|
|
220
|
+
* caller explicitly opts out with `throwOnFailure: false`.
|
|
221
|
+
*/
|
|
222
|
+
async function run(params, options = {}) {
|
|
223
|
+
const { signal, throwOnFailure = true, ...waitOptions } = options;
|
|
224
|
+
return wait((await create(params, { signal })).id, {
|
|
225
|
+
...waitOptions,
|
|
226
|
+
signal,
|
|
227
|
+
throwOnFailure
|
|
228
|
+
});
|
|
229
|
+
}
|
|
211
230
|
async function get(id, options) {
|
|
212
231
|
return request(`/jobs/${id}`, { signal: options?.signal });
|
|
213
232
|
}
|
|
@@ -264,6 +283,7 @@ function createJobsResource(request) {
|
|
|
264
283
|
list,
|
|
265
284
|
listAll,
|
|
266
285
|
wait,
|
|
286
|
+
run,
|
|
267
287
|
cancel,
|
|
268
288
|
download,
|
|
269
289
|
logs,
|
package/package.json
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rendobar/sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript client for the Rendobar media processing API",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://rendobar.com/docs/sdk",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/rendobar/rendobar.git",
|
|
11
|
+
"directory": "packages/sdk"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/rendobar/rendobar/issues"
|
|
15
|
+
},
|
|
16
|
+
"author": "Rendobar",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"rendobar",
|
|
19
|
+
"ffmpeg",
|
|
20
|
+
"video",
|
|
21
|
+
"media-processing",
|
|
22
|
+
"transcode",
|
|
23
|
+
"api-client",
|
|
24
|
+
"sdk",
|
|
25
|
+
"typescript"
|
|
26
|
+
],
|
|
6
27
|
"main": "./dist/index.cjs",
|
|
7
28
|
"module": "./dist/index.mjs",
|
|
8
29
|
"types": "./dist/index.d.cts",
|
|
@@ -41,9 +62,10 @@
|
|
|
41
62
|
"partysocket": "^1.1.16"
|
|
42
63
|
},
|
|
43
64
|
"devDependencies": {
|
|
65
|
+
"@types/node": "^25",
|
|
44
66
|
"@rendobar/shared": "workspace:*",
|
|
45
67
|
"tsdown": "^0.22.0",
|
|
46
|
-
"typescript": "^
|
|
68
|
+
"typescript": "^7.0.2",
|
|
47
69
|
"vitest": "^4.0.18"
|
|
48
70
|
}
|
|
49
71
|
}
|