@nodaro/sdk 2.68.0 → 2.68.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/dist/{chunk-I2LCIMEW.cjs → chunk-A7WF66S5.cjs} +3 -3
- package/dist/{chunk-I2LCIMEW.cjs.map → chunk-A7WF66S5.cjs.map} +1 -1
- package/dist/{chunk-S5BOU6JG.cjs → chunk-GU3YOOCK.cjs} +6 -8
- package/dist/chunk-GU3YOOCK.cjs.map +1 -0
- package/dist/{chunk-HVF5DRGQ.cjs → chunk-MQQA2E6J.cjs} +2 -2
- package/dist/chunk-MQQA2E6J.cjs.map +1 -0
- package/dist/{chunk-54FRKEWZ.js → chunk-NWSIWAPR.js} +5 -5
- package/dist/{chunk-54FRKEWZ.js.map → chunk-NWSIWAPR.js.map} +1 -1
- package/dist/{chunk-OVFH7L2T.js → chunk-TKSQCF2X.js} +2 -2
- package/dist/chunk-TKSQCF2X.js.map +1 -0
- package/dist/{chunk-HJYBNUXG.js → chunk-YTERACRD.js} +3 -3
- package/dist/{chunk-HJYBNUXG.js.map → chunk-YTERACRD.js.map} +1 -1
- package/dist/{chunk-LQMJFFST.js → chunk-YUY56PT7.js} +6 -8
- package/dist/chunk-YUY56PT7.js.map +1 -0
- package/dist/{chunk-KYHTS5RF.cjs → chunk-ZXBKFJT5.cjs} +8 -8
- package/dist/{chunk-KYHTS5RF.cjs.map → chunk-ZXBKFJT5.cjs.map} +1 -1
- package/dist/entries/cast-swap.cjs +2 -2
- package/dist/entries/cast-swap.d.cts +28 -27
- package/dist/entries/cast-swap.d.ts +28 -27
- package/dist/entries/cast-swap.js +1 -1
- package/dist/entries/client.cjs +9 -9
- package/dist/entries/client.js +4 -4
- package/dist/entries/core.cjs +5 -5
- package/dist/entries/core.js +1 -1
- package/dist/entries/trends.cjs +2 -2
- package/dist/entries/trends.d.cts +17 -9
- package/dist/entries/trends.d.ts +17 -9
- package/dist/entries/trends.js +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.js +4 -4
- package/package.json +2 -2
- package/dist/chunk-HVF5DRGQ.cjs.map +0 -1
- package/dist/chunk-LQMJFFST.js.map +0 -1
- package/dist/chunk-OVFH7L2T.js.map +0 -1
- package/dist/chunk-S5BOU6JG.cjs.map +0 -1
|
@@ -16,10 +16,10 @@ import '@nodaro/shared/organizations';
|
|
|
16
16
|
* Locations are not prepared.
|
|
17
17
|
*
|
|
18
18
|
* Engines: a run is made on Nodaro Motion Prism (`engine` left out, or
|
|
19
|
-
* `"motion-prism"`) or Nodaro Motion Pulse (`"motion-pulse"`).
|
|
20
|
-
* (
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* `"motion-prism"`) or Nodaro Motion Pulse (`"motion-pulse"`). Prism renders
|
|
20
|
+
* 480p (the default; plain unless `draft: true`), 720p or 1080p. Pulse renders
|
|
21
|
+
* 720p (its default) or 1080p and makes a new take guided by the clip and
|
|
22
|
+
* pictures; it has no draft, so no Full Quality: run it again at 1080p instead.
|
|
23
23
|
*
|
|
24
24
|
* How the clip is prepared for the video model (for one, whether faces are
|
|
25
25
|
* hidden first, and whether a refused clip is retried) is set by Nodaro for
|
|
@@ -62,13 +62,12 @@ import '@nodaro/shared/organizations';
|
|
|
62
62
|
* The engine a Nodaro Motion run is made on, by its public id. Left out =
|
|
63
63
|
* `"motion-prism"`.
|
|
64
64
|
*
|
|
65
|
-
* - `"motion-prism"` (Nodaro Motion Prism): 480p (the default
|
|
66
|
-
* `draft:
|
|
67
|
-
*
|
|
65
|
+
* - `"motion-prism"` (Nodaro Motion Prism): 480p (the default; plain unless
|
|
66
|
+
* `draft: true`), 720p or 1080p; Full Quality finishes a draft's own take at
|
|
67
|
+
* 1080p.
|
|
68
68
|
* - `"motion-pulse"` (Nodaro Motion Pulse): 720p (the default) or 1080p, never a
|
|
69
|
-
* draft (`draft: true` answers 400 `draft_unsupported`)
|
|
70
|
-
*
|
|
71
|
-
* 4 s from `previewStart`.
|
|
69
|
+
* draft (`draft: true` answers 400 `draft_unsupported`), so no Full Quality:
|
|
70
|
+
* run it again at 1080p instead. A preview is still 4 s from `previewStart`.
|
|
72
71
|
*/
|
|
73
72
|
type CastSwapEngine = "motion-prism" | "motion-pulse";
|
|
74
73
|
/**
|
|
@@ -326,10 +325,11 @@ interface CastSwapParams {
|
|
|
326
325
|
*/
|
|
327
326
|
resolution?: "480p" | "720p" | "1080p";
|
|
328
327
|
/**
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* `
|
|
328
|
+
* `true` makes a draft: a 480p run whose same take Full Quality can finish
|
|
329
|
+
* at 1080p (Nodaro Motion Prism only). Default `false`: a plain run, at 480p
|
|
330
|
+
* too, which Full Quality cannot finish. `true` with `"720p"` or `"1080p"`
|
|
331
|
+
* answers 400 (draft is 480p only). Nodaro Motion Pulse has no draft: `true`
|
|
332
|
+
* answers 400 `draft_unsupported`.
|
|
333
333
|
*/
|
|
334
334
|
draft?: boolean;
|
|
335
335
|
/**
|
|
@@ -436,16 +436,17 @@ interface CastSwapRunOptions {
|
|
|
436
436
|
idempotencyKey?: string;
|
|
437
437
|
}
|
|
438
438
|
/**
|
|
439
|
-
* What a Full Quality version would be: `"same-take"`
|
|
440
|
-
*
|
|
441
|
-
* 1080p from a 720p run's inputs
|
|
442
|
-
*
|
|
439
|
+
* What a Full Quality version would be: `"same-take"` finishes a Nodaro Motion
|
|
440
|
+
* Prism draft's own take at 1080p, and the draft stays. `"new-take"` was a new
|
|
441
|
+
* Nodaro Motion Pulse take at 1080p from a 720p run's inputs; Pulse no longer
|
|
442
|
+
* has Full Quality, so a quote no longer answers it (kept so code that reads
|
|
443
|
+
* it still compiles).
|
|
443
444
|
*/
|
|
444
445
|
type CastSwapFullQualityKind = "same-take" | "new-take";
|
|
445
446
|
/**
|
|
446
447
|
* What a Full Quality version of a run would cost
|
|
447
448
|
* (`POST /v1/cast-swap/:jobId/full-quality/estimate`): a Nodaro Motion Prism
|
|
448
|
-
* draft
|
|
449
|
+
* draft (a 480p run made with `draft: true`).
|
|
449
450
|
*/
|
|
450
451
|
interface CastSwapFullQualityEstimate {
|
|
451
452
|
/**
|
|
@@ -490,8 +491,10 @@ interface CastSwapFullQualityResult {
|
|
|
490
491
|
* - `not_found` (404): not your job, or not a Nodaro Motion run; also a
|
|
491
492
|
* `sessionId` you may not use;
|
|
492
493
|
* - `not_completed` (409): the run has not finished;
|
|
493
|
-
* - `not_a_draft` (409): the run is
|
|
494
|
-
*
|
|
494
|
+
* - `not_a_draft` (409): the run is not a Nodaro Motion Prism draft: a plain
|
|
495
|
+
* run (480p made without `draft: true` included; make a draft with
|
|
496
|
+
* `draft: true`), or any Nodaro Motion Pulse run (Pulse makes no drafts: run
|
|
497
|
+
* it again at 1080p);
|
|
495
498
|
* - `draft_expired` (410): more than 7 days after the draft completed, or
|
|
496
499
|
* the draft can no longer be finished at Full Quality;
|
|
497
500
|
* - `full_quality_pending` (409, `details.retryable: true`): not final — an
|
|
@@ -598,10 +601,9 @@ declare class CastSwapResource {
|
|
|
598
601
|
/**
|
|
599
602
|
* Quote finishing a run at Full Quality (`POST
|
|
600
603
|
* /v1/cast-swap/:jobId/full-quality/estimate`); spends nothing. `jobId` is a
|
|
601
|
-
* finished Nodaro Motion Prism DRAFT run
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
* does not look for a Full Quality already running: when one is,
|
|
604
|
+
* finished Nodaro Motion Prism DRAFT run (a Nodaro Motion or trend run made
|
|
605
|
+
* with `draft: true`), whose same take Full Quality finishes at 1080p. The
|
|
606
|
+
* quote does not look for a Full Quality already running: when one is,
|
|
605
607
|
* {@link fullQuality} answers it (`existing: true`) and charges nothing.
|
|
606
608
|
* Refusals: {@link CastSwapFullQualityRefusalCode}.
|
|
607
609
|
*/
|
|
@@ -609,8 +611,7 @@ declare class CastSwapResource {
|
|
|
609
611
|
/**
|
|
610
612
|
* Finish a run at Full Quality (`POST /v1/cast-swap/:jobId/full-quality`):
|
|
611
613
|
* at 1080p, with the clip's audio, as a new job linked to the run — a
|
|
612
|
-
* Nodaro Motion Prism draft's own take re-rendered
|
|
613
|
-
* 720p run's inputs (the quote's `kind`). SPENDS CREDITS: quote it first with
|
|
614
|
+
* Nodaro Motion Prism draft's own take re-rendered. SPENDS CREDITS: quote it first with
|
|
614
615
|
* {@link fullQualityEstimate}. Answers 202 `{ jobId }`, or 200
|
|
615
616
|
* `{ jobId, existing: true }` when this run's Full Quality is already
|
|
616
617
|
* running or done (one per run; a failed one may be asked again). Follow
|
package/dist/entries/client.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZXBKFJT5_cjs = require('../chunk-ZXBKFJT5.cjs');
|
|
4
4
|
require('../chunk-3B47IHB3.cjs');
|
|
5
5
|
require('../chunk-WUM6CWTE.cjs');
|
|
6
6
|
require('../chunk-LKH5M44B.cjs');
|
|
7
7
|
require('../chunk-LTZKNAXM.cjs');
|
|
8
8
|
require('../chunk-RKW3N463.cjs');
|
|
9
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-MQQA2E6J.cjs');
|
|
10
10
|
require('../chunk-KMNSPC72.cjs');
|
|
11
11
|
require('../chunk-F6KAMECM.cjs');
|
|
12
12
|
require('../chunk-REXFEDKI.cjs');
|
|
@@ -49,14 +49,14 @@ require('../chunk-YFS2LMG4.cjs');
|
|
|
49
49
|
require('../chunk-4DCXJ77J.cjs');
|
|
50
50
|
require('../chunk-TQLOD7OL.cjs');
|
|
51
51
|
require('../chunk-EJJIA765.cjs');
|
|
52
|
-
var
|
|
52
|
+
var chunkA7WF66S5_cjs = require('../chunk-A7WF66S5.cjs');
|
|
53
53
|
require('../chunk-4AD3CBDK.cjs');
|
|
54
54
|
require('../chunk-A3XA6UNM.cjs');
|
|
55
55
|
require('../chunk-7FLTDTHR.cjs');
|
|
56
56
|
require('../chunk-7BMKQ36V.cjs');
|
|
57
57
|
require('../chunk-PGT4BXR2.cjs');
|
|
58
58
|
require('../chunk-XSYNVD3X.cjs');
|
|
59
|
-
require('../chunk-
|
|
59
|
+
require('../chunk-GU3YOOCK.cjs');
|
|
60
60
|
require('../chunk-BPWUWUZ3.cjs');
|
|
61
61
|
require('../chunk-XZQ6Z4T6.cjs');
|
|
62
62
|
|
|
@@ -64,23 +64,23 @@ require('../chunk-XZQ6Z4T6.cjs');
|
|
|
64
64
|
|
|
65
65
|
Object.defineProperty(exports, "NodaroClient", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkZXBKFJT5_cjs.NodaroClient; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "createClient", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkZXBKFJT5_cjs.createClient; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "CallbackAuth", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkA7WF66S5_cjs.CallbackAuth; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "StaticTokenAuth", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkA7WF66S5_cjs.StaticTokenAuth; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "supabaseAuth", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkA7WF66S5_cjs.supabaseAuth; }
|
|
84
84
|
});
|
|
85
85
|
//# sourceMappingURL=client.cjs.map
|
|
86
86
|
//# sourceMappingURL=client.cjs.map
|
package/dist/entries/client.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { NodaroClient, createClient } from '../chunk-
|
|
1
|
+
export { NodaroClient, createClient } from '../chunk-NWSIWAPR.js';
|
|
2
2
|
import '../chunk-YN6CBIIB.js';
|
|
3
3
|
import '../chunk-33HT46A3.js';
|
|
4
4
|
import '../chunk-Z5GLY4R3.js';
|
|
5
5
|
import '../chunk-2SQ7V6EX.js';
|
|
6
6
|
import '../chunk-TLTPIS2A.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-TKSQCF2X.js';
|
|
8
8
|
import '../chunk-HPXE3NZW.js';
|
|
9
9
|
import '../chunk-YEOK5A5H.js';
|
|
10
10
|
import '../chunk-J3Y56MYU.js';
|
|
@@ -47,14 +47,14 @@ import '../chunk-BU5A6K4C.js';
|
|
|
47
47
|
import '../chunk-HAS6PMQN.js';
|
|
48
48
|
import '../chunk-CCXY4ZJM.js';
|
|
49
49
|
import '../chunk-SZ67PDKE.js';
|
|
50
|
-
export { CallbackAuth, StaticTokenAuth, supabaseAuth } from '../chunk-
|
|
50
|
+
export { CallbackAuth, StaticTokenAuth, supabaseAuth } from '../chunk-YTERACRD.js';
|
|
51
51
|
import '../chunk-IJAJTVEW.js';
|
|
52
52
|
import '../chunk-HUYI5G3D.js';
|
|
53
53
|
import '../chunk-F3AV3TC7.js';
|
|
54
54
|
import '../chunk-OJHJBNJZ.js';
|
|
55
55
|
import '../chunk-OHC4JIUP.js';
|
|
56
56
|
import '../chunk-MCXZV3CW.js';
|
|
57
|
-
import '../chunk-
|
|
57
|
+
import '../chunk-YUY56PT7.js';
|
|
58
58
|
import '../chunk-KG4R454Z.js';
|
|
59
59
|
import '../chunk-CBDUHYTR.js';
|
|
60
60
|
//# sourceMappingURL=client.js.map
|
package/dist/entries/core.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../chunk-X7XP5WBP.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkA7WF66S5_cjs = require('../chunk-A7WF66S5.cjs');
|
|
5
5
|
require('../chunk-4AD3CBDK.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "CallbackAuth", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkA7WF66S5_cjs.CallbackAuth; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "NodaroClientCore", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkA7WF66S5_cjs.NodaroClientCore; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "StaticTokenAuth", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkA7WF66S5_cjs.StaticTokenAuth; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "supabaseAuth", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkA7WF66S5_cjs.supabaseAuth; }
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=core.cjs.map
|
|
26
26
|
//# sourceMappingURL=core.cjs.map
|
package/dist/entries/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-AUDHV3OE.js';
|
|
2
|
-
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from '../chunk-
|
|
2
|
+
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from '../chunk-YTERACRD.js';
|
|
3
3
|
import '../chunk-IJAJTVEW.js';
|
|
4
4
|
//# sourceMappingURL=core.js.map
|
|
5
5
|
//# sourceMappingURL=core.js.map
|
package/dist/entries/trends.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../chunk-PG2GBS3K.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkMQQA2E6J_cjs = require('../chunk-MQQA2E6J.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "TrendsResource", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkMQQA2E6J_cjs.TrendsResource; }
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=trends.cjs.map
|
|
13
13
|
//# sourceMappingURL=trends.cjs.map
|
|
@@ -157,8 +157,9 @@ interface TrendDetail extends TrendCard {
|
|
|
157
157
|
engineName?: string;
|
|
158
158
|
/**
|
|
159
159
|
* The resolutions a run may ask for, the default first. Nodaro Motion Prism:
|
|
160
|
-
* `["480p", "720p", "1080p"]`, where 480p is
|
|
161
|
-
* Nodaro Motion Pulse: `["720p", "1080p"]`,
|
|
160
|
+
* `["480p", "720p", "1080p"]`, where 480p is plain unless the run asks for a
|
|
161
|
+
* draft ({@link TrendRunRequest.draft}); Nodaro Motion Pulse: `["720p", "1080p"]`,
|
|
162
|
+
* no draft. Offer exactly these.
|
|
162
163
|
*/
|
|
163
164
|
resolutions: TrendResolution[];
|
|
164
165
|
slots: TrendDetailSlot[];
|
|
@@ -203,8 +204,10 @@ interface TrendRunRequest {
|
|
|
203
204
|
*/
|
|
204
205
|
resolution?: TrendResolution;
|
|
205
206
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
207
|
+
* `true` makes a draft: a 480p run whose same take Full Quality can finish at
|
|
208
|
+
* 1080p (Nodaro Motion Prism trends only). Default `false`: a plain run, at
|
|
209
|
+
* 480p too. `true` on a Nodaro Motion Pulse trend answers 400
|
|
210
|
+
* `draft_unsupported`.
|
|
208
211
|
*/
|
|
209
212
|
draft?: boolean;
|
|
210
213
|
/**
|
|
@@ -353,10 +356,15 @@ interface TrendRun {
|
|
|
353
356
|
creditsHeld?: number | null;
|
|
354
357
|
/** What went back from `creditsHeld` once every hold in the run settled; `null` until then. Absent from an older server. */
|
|
355
358
|
creditsReleased?: number | null;
|
|
356
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* A Full Quality version: the job id of the run it was made from (a draft,
|
|
361
|
+
* or a Nodaro Motion Pulse 720p run from when Pulse had Full Quality). `null`
|
|
362
|
+
* for any other run.
|
|
363
|
+
*/
|
|
357
364
|
fullQualityOf: string | null;
|
|
358
365
|
/**
|
|
359
|
-
* A draft's (or Nodaro Motion Pulse 720p run's
|
|
366
|
+
* A draft's newest Full Quality try (or a Nodaro Motion Pulse 720p run's, made
|
|
367
|
+
* when Pulse had Full Quality), if one was started: a pointer only,
|
|
360
368
|
* to know an upgrade exists and how it is going. Its video and charge are on
|
|
361
369
|
* that run, listed on its own (its `fullQualityOf` is this run's `jobId`) —
|
|
362
370
|
* read it there (`getRun(fullQuality.jobId)`). Older tries of the draft (a
|
|
@@ -371,9 +379,9 @@ interface TrendRun {
|
|
|
371
379
|
refused?: true;
|
|
372
380
|
} | null;
|
|
373
381
|
/**
|
|
374
|
-
* Until when a completed run can be
|
|
375
|
-
* Prism draft (the same take at 1080p)
|
|
376
|
-
*
|
|
382
|
+
* Until when a completed run can be finished in Full Quality — a Nodaro
|
|
383
|
+
* Motion Prism draft only (the same take at 1080p); `null` otherwise, a plain
|
|
384
|
+
* run and every Nodaro Motion Pulse run included.
|
|
377
385
|
*/
|
|
378
386
|
fullQualityUntil: string | null;
|
|
379
387
|
}
|
package/dist/entries/trends.d.ts
CHANGED
|
@@ -157,8 +157,9 @@ interface TrendDetail extends TrendCard {
|
|
|
157
157
|
engineName?: string;
|
|
158
158
|
/**
|
|
159
159
|
* The resolutions a run may ask for, the default first. Nodaro Motion Prism:
|
|
160
|
-
* `["480p", "720p", "1080p"]`, where 480p is
|
|
161
|
-
* Nodaro Motion Pulse: `["720p", "1080p"]`,
|
|
160
|
+
* `["480p", "720p", "1080p"]`, where 480p is plain unless the run asks for a
|
|
161
|
+
* draft ({@link TrendRunRequest.draft}); Nodaro Motion Pulse: `["720p", "1080p"]`,
|
|
162
|
+
* no draft. Offer exactly these.
|
|
162
163
|
*/
|
|
163
164
|
resolutions: TrendResolution[];
|
|
164
165
|
slots: TrendDetailSlot[];
|
|
@@ -203,8 +204,10 @@ interface TrendRunRequest {
|
|
|
203
204
|
*/
|
|
204
205
|
resolution?: TrendResolution;
|
|
205
206
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
207
|
+
* `true` makes a draft: a 480p run whose same take Full Quality can finish at
|
|
208
|
+
* 1080p (Nodaro Motion Prism trends only). Default `false`: a plain run, at
|
|
209
|
+
* 480p too. `true` on a Nodaro Motion Pulse trend answers 400
|
|
210
|
+
* `draft_unsupported`.
|
|
208
211
|
*/
|
|
209
212
|
draft?: boolean;
|
|
210
213
|
/**
|
|
@@ -353,10 +356,15 @@ interface TrendRun {
|
|
|
353
356
|
creditsHeld?: number | null;
|
|
354
357
|
/** What went back from `creditsHeld` once every hold in the run settled; `null` until then. Absent from an older server. */
|
|
355
358
|
creditsReleased?: number | null;
|
|
356
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* A Full Quality version: the job id of the run it was made from (a draft,
|
|
361
|
+
* or a Nodaro Motion Pulse 720p run from when Pulse had Full Quality). `null`
|
|
362
|
+
* for any other run.
|
|
363
|
+
*/
|
|
357
364
|
fullQualityOf: string | null;
|
|
358
365
|
/**
|
|
359
|
-
* A draft's (or Nodaro Motion Pulse 720p run's
|
|
366
|
+
* A draft's newest Full Quality try (or a Nodaro Motion Pulse 720p run's, made
|
|
367
|
+
* when Pulse had Full Quality), if one was started: a pointer only,
|
|
360
368
|
* to know an upgrade exists and how it is going. Its video and charge are on
|
|
361
369
|
* that run, listed on its own (its `fullQualityOf` is this run's `jobId`) —
|
|
362
370
|
* read it there (`getRun(fullQuality.jobId)`). Older tries of the draft (a
|
|
@@ -371,9 +379,9 @@ interface TrendRun {
|
|
|
371
379
|
refused?: true;
|
|
372
380
|
} | null;
|
|
373
381
|
/**
|
|
374
|
-
* Until when a completed run can be
|
|
375
|
-
* Prism draft (the same take at 1080p)
|
|
376
|
-
*
|
|
382
|
+
* Until when a completed run can be finished in Full Quality — a Nodaro
|
|
383
|
+
* Motion Prism draft only (the same take at 1080p); `null` otherwise, a plain
|
|
384
|
+
* run and every Nodaro Motion Pulse run included.
|
|
377
385
|
*/
|
|
378
386
|
fullQualityUntil: string | null;
|
|
379
387
|
}
|
package/dist/entries/trends.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -57,13 +57,13 @@ require('./chunk-IS26FJO7.cjs');
|
|
|
57
57
|
require('./chunk-RQSGS7ZK.cjs');
|
|
58
58
|
require('./chunk-43NO4SGC.cjs');
|
|
59
59
|
require('./chunk-JOX5BJ6K.cjs');
|
|
60
|
-
var
|
|
60
|
+
var chunkZXBKFJT5_cjs = require('./chunk-ZXBKFJT5.cjs');
|
|
61
61
|
var chunk3B47IHB3_cjs = require('./chunk-3B47IHB3.cjs');
|
|
62
62
|
var chunkWUM6CWTE_cjs = require('./chunk-WUM6CWTE.cjs');
|
|
63
63
|
var chunkLKH5M44B_cjs = require('./chunk-LKH5M44B.cjs');
|
|
64
64
|
var chunkLTZKNAXM_cjs = require('./chunk-LTZKNAXM.cjs');
|
|
65
65
|
var chunkRKW3N463_cjs = require('./chunk-RKW3N463.cjs');
|
|
66
|
-
var
|
|
66
|
+
var chunkMQQA2E6J_cjs = require('./chunk-MQQA2E6J.cjs');
|
|
67
67
|
var chunkKMNSPC72_cjs = require('./chunk-KMNSPC72.cjs');
|
|
68
68
|
var chunkF6KAMECM_cjs = require('./chunk-F6KAMECM.cjs');
|
|
69
69
|
var chunkREXFEDKI_cjs = require('./chunk-REXFEDKI.cjs');
|
|
@@ -106,14 +106,14 @@ var chunkYFS2LMG4_cjs = require('./chunk-YFS2LMG4.cjs');
|
|
|
106
106
|
var chunk4DCXJ77J_cjs = require('./chunk-4DCXJ77J.cjs');
|
|
107
107
|
var chunkTQLOD7OL_cjs = require('./chunk-TQLOD7OL.cjs');
|
|
108
108
|
require('./chunk-EJJIA765.cjs');
|
|
109
|
-
var
|
|
109
|
+
var chunkA7WF66S5_cjs = require('./chunk-A7WF66S5.cjs');
|
|
110
110
|
var chunk4AD3CBDK_cjs = require('./chunk-4AD3CBDK.cjs');
|
|
111
111
|
var chunkA3XA6UNM_cjs = require('./chunk-A3XA6UNM.cjs');
|
|
112
112
|
var chunk7FLTDTHR_cjs = require('./chunk-7FLTDTHR.cjs');
|
|
113
113
|
var chunk7BMKQ36V_cjs = require('./chunk-7BMKQ36V.cjs');
|
|
114
114
|
var chunkPGT4BXR2_cjs = require('./chunk-PGT4BXR2.cjs');
|
|
115
115
|
var chunkXSYNVD3X_cjs = require('./chunk-XSYNVD3X.cjs');
|
|
116
|
-
var
|
|
116
|
+
var chunkGU3YOOCK_cjs = require('./chunk-GU3YOOCK.cjs');
|
|
117
117
|
var chunkBPWUWUZ3_cjs = require('./chunk-BPWUWUZ3.cjs');
|
|
118
118
|
var chunkXZQ6Z4T6_cjs = require('./chunk-XZQ6Z4T6.cjs');
|
|
119
119
|
|
|
@@ -153,11 +153,11 @@ Object.defineProperty(exports, "unwrapEditPlanOutput", {
|
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "NodaroClient", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkZXBKFJT5_cjs.NodaroClient; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "createClient", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkZXBKFJT5_cjs.createClient; }
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "WebhooksResource", {
|
|
163
163
|
enumerable: true,
|
|
@@ -181,7 +181,7 @@ Object.defineProperty(exports, "TrendRadarResource", {
|
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "TrendsResource", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkMQQA2E6J_cjs.TrendsResource; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "TutorialsResource", {
|
|
187
187
|
enumerable: true,
|
|
@@ -433,19 +433,19 @@ Object.defineProperty(exports, "CopilotResource", {
|
|
|
433
433
|
});
|
|
434
434
|
Object.defineProperty(exports, "CallbackAuth", {
|
|
435
435
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
436
|
+
get: function () { return chunkA7WF66S5_cjs.CallbackAuth; }
|
|
437
437
|
});
|
|
438
438
|
Object.defineProperty(exports, "NodaroClientCore", {
|
|
439
439
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
440
|
+
get: function () { return chunkA7WF66S5_cjs.NodaroClientCore; }
|
|
441
441
|
});
|
|
442
442
|
Object.defineProperty(exports, "StaticTokenAuth", {
|
|
443
443
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
444
|
+
get: function () { return chunkA7WF66S5_cjs.StaticTokenAuth; }
|
|
445
445
|
});
|
|
446
446
|
Object.defineProperty(exports, "supabaseAuth", {
|
|
447
447
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
448
|
+
get: function () { return chunkA7WF66S5_cjs.supabaseAuth; }
|
|
449
449
|
});
|
|
450
450
|
Object.defineProperty(exports, "AlreadyRunningError", {
|
|
451
451
|
enumerable: true,
|
|
@@ -593,7 +593,7 @@ Object.defineProperty(exports, "BillingResource", {
|
|
|
593
593
|
});
|
|
594
594
|
Object.defineProperty(exports, "CastSwapResource", {
|
|
595
595
|
enumerable: true,
|
|
596
|
-
get: function () { return
|
|
596
|
+
get: function () { return chunkGU3YOOCK_cjs.CastSwapResource; }
|
|
597
597
|
});
|
|
598
598
|
Object.defineProperty(exports, "CatalogsResource", {
|
|
599
599
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -55,13 +55,13 @@ import './chunk-M6Y5TOYE.js';
|
|
|
55
55
|
import './chunk-KARJ7P7Y.js';
|
|
56
56
|
import './chunk-SUCHGNYT.js';
|
|
57
57
|
import './chunk-SLPD47SR.js';
|
|
58
|
-
export { NodaroClient, createClient } from './chunk-
|
|
58
|
+
export { NodaroClient, createClient } from './chunk-NWSIWAPR.js';
|
|
59
59
|
export { WebhooksResource } from './chunk-YN6CBIIB.js';
|
|
60
60
|
export { WorkflowsResource } from './chunk-33HT46A3.js';
|
|
61
61
|
export { WorkspacesResource } from './chunk-Z5GLY4R3.js';
|
|
62
62
|
export { TrashResource } from './chunk-2SQ7V6EX.js';
|
|
63
63
|
export { TrendRadarResource } from './chunk-TLTPIS2A.js';
|
|
64
|
-
export { TrendsResource } from './chunk-
|
|
64
|
+
export { TrendsResource } from './chunk-TKSQCF2X.js';
|
|
65
65
|
export { TutorialsResource } from './chunk-HPXE3NZW.js';
|
|
66
66
|
export { UploadsResource } from './chunk-YEOK5A5H.js';
|
|
67
67
|
export { UserSettingsResource } from './chunk-J3Y56MYU.js';
|
|
@@ -104,14 +104,14 @@ export { CompetitorsResource } from './chunk-BU5A6K4C.js';
|
|
|
104
104
|
export { ContentRightsResource } from './chunk-HAS6PMQN.js';
|
|
105
105
|
export { CopilotResource } from './chunk-CCXY4ZJM.js';
|
|
106
106
|
import './chunk-SZ67PDKE.js';
|
|
107
|
-
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from './chunk-
|
|
107
|
+
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from './chunk-YTERACRD.js';
|
|
108
108
|
export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapExceededError, ForbiddenError, IMPORT_REFUSAL_CODES, ImportRefusedError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictError, throwFromResponse } from './chunk-IJAJTVEW.js';
|
|
109
109
|
export { OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ASSET_TYPES, CREATURE_ATTACH_COLUMNS, CreaturesResource } from './chunk-HUYI5G3D.js';
|
|
110
110
|
export { CreditsResource } from './chunk-F3AV3TC7.js';
|
|
111
111
|
export { AppsResource } from './chunk-OJHJBNJZ.js';
|
|
112
112
|
export { AudioResource } from './chunk-OHC4JIUP.js';
|
|
113
113
|
export { BillingResource } from './chunk-MCXZV3CW.js';
|
|
114
|
-
export { CastSwapResource } from './chunk-
|
|
114
|
+
export { CastSwapResource } from './chunk-YUY56PT7.js';
|
|
115
115
|
export { CatalogsResource } from './chunk-KG4R454Z.js';
|
|
116
116
|
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, CharactersResource, PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, buildPersonHints, buildPersonSeedPrompt } from './chunk-CBDUHYTR.js';
|
|
117
117
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodaro/sdk",
|
|
3
|
-
"version": "2.68.
|
|
3
|
+
"version": "2.68.1",
|
|
4
4
|
"description": "Typed REST client for the Nodaro API — workflows, jobs, executions, apps, characters, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
"test:watch": "vitest"
|
|
338
338
|
},
|
|
339
339
|
"dependencies": {
|
|
340
|
-
"@nodaro/shared": "^3.60.
|
|
340
|
+
"@nodaro/shared": "^3.60.1",
|
|
341
341
|
"@nodaro/prompts": "^1.53.2"
|
|
342
342
|
},
|
|
343
343
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resources/trends.ts"],"names":[],"mappings":";;;AAqEA,IAAM,cAAA,GAAmD;AAAA,EACvD,IAAA,EAAM,0BAAA;AAAA,EACN,IAAA,EAAM;AACR,CAAA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k-HVF5DRGQ.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { CastSwapEngine } from \"./cast-swap.js\"\n\n/**\n * Trends — ready-made Nodaro Motion recipes. A trend is a short clip with slots\n * (the people, pets, products and place you can replace); fill its slots with\n * your own pictures and run it to get the clip back with them in it.\n *\n * Cloud edition only: `/v1/trends` 404s on self-hosted installs. Only\n * published trends exist here: a draft, unpublished or unknown slug is a 404\n * on every route. `\"runs\"` and `\"tags\"` are never slugs (`/v1/trends/runs` is\n * the run list, `/v1/trends/tags` the tag list): the slug methods throw a\n * `TypeError` for them before any request. `run()` answers 202 with a job id; follow it with\n * `client.jobs.get(jobId)` / `client.jobs.getStatus(jobId)` like any other\n * job, or read it back as a trend run with `getRun(jobId)` / `runs()`.\n *\n * Signed out: `list()`, `tags()` and `get()` work with no credential (a\n * client whose `Auth` returns no token sends no `Authorization` header), so\n * an app can show the catalog to a visitor and ask them to sign in only to\n * run a trend. A guest gets the same published trends with `isFavorite:\n * false`, text in `locale` else the browser's `Accept-Language` else English,\n * and no `favorites: true` (401). Every other method needs a signed-in caller.\n *\n * Repeats: pass `{ idempotencyKey }` to `run()` and it is sent as the\n * `Idempotency-Key` header. A repeat with the same key answers with the first\n * run's `jobId`; nothing new is started or charged.\n *\n * Refusals (thrown as a `NodaroError` subclass; body `{ error: { code, message } }`):\n * - 400 `validation_error` (the body, a query, or a bad `cursor`);\n * `estimate()` / `run()` only, before anything is charged:\n * `missing_slot` (a required slot without pictures), `unknown_slot`,\n * `invalid_choice` (a chip the slot's kind does not take),\n * `chip_not_offered` (a chip of the kind that the slot's\n * {@link TrendDetailSlot.chips} does not list: the trend fixes it),\n * `example_out_of_range` (`example` names no example of the trend, or is\n * sent at all on a trend with none), `preview_unavailable` (the trend offers no\n * preview), `invalid_slot_mention` (a `{slot:<key>}` in `details` naming no\n * slot), `prompt_too_long` (shorten `details`), `draft_unsupported`\n * (`draft: true` on a trend whose `engine` has no draft: Nodaro Motion Pulse),\n * `resolution_unsupported` (a `resolution` not in the trend's\n * `resolutions`), `too_many_images` (a Nodaro Motion Pulse trend's run would send more\n * than 10 pictures: send fewer per slot). The slot errors carry the\n * slot's key as `slot` (in `NodaroError.details`), and `chip_not_offered`\n * the chip as `chip` too.\n * - 401 `unauthorized`: no signed-in caller, on every method but `list()`,\n * `tags()` and `get()` (and on `list({ favorites: true })`).\n * - 404 `not_found`: the trend is not published (every method), or `run()`'s\n * `sessionId` is not a session you may use.\n * - 409 `trend_unavailable` (`estimate()` / `run()`): the trend's setup is out\n * of date — it cannot run until it is updated, so a retry gets the same answer.\n * - 502 `engine_error` (`estimate()` / `run()`).\n * - 503 `engine_unsupported` (this platform version cannot run trends yet),\n * `trend_unavailable` (`estimate()` / `run()`), `not_available` (this\n * server has no trend catalog yet).\n * - `estimate()` / `run()` answer the video engine's refusals with the trend\n * routes' OWN codes and fixed messages — never the engine's text or\n * `issues`: 400 `trend_run_rejected` (the inputs could not run), or\n * `clip_out_of_range` / `preview_out_of_range` / `video_unreadable` (this\n * trend's clip), `unsafe_url` (a picture is not a public http(s) address),\n * `raw_reference_token` (`details` holds `{image:` / `{video:` /\n * `{audio:`); 402 `insufficient_credits` (or a workspace cap) as given;\n * 413 `storage_limit_exceeded`; 422 `job_blocked` (the job policy\n * blocked it); 429 `rate_limited`; 503 `engine_unsupported`,\n * `estimate_unavailable`; 502 `engine_error` for anything else. `run()`\n * also answers 400 `validation_error` for an `idempotencyKey` outside\n * 8–200 characters.\n */\n\n/** `/v1/trends/runs` is the run list and `/v1/trends/tags` the tag list, so neither can be a trend's slug. */\nconst RESERVED_SLUGS: Readonly<Record<string, string>> = {\n runs: \"the run list; use runs()\",\n tags: \"the tag list; use tags()\",\n}\n\nfunction trendPath(slug: string, rest = \"\"): string {\n if (Object.hasOwn(RESERVED_SLUGS, slug)) {\n throw new TypeError(`\"${slug}\" is not a trend slug (it is reserved for ${RESERVED_SLUGS[slug]})`)\n }\n return `/v1/trends/${encodeURIComponent(slug)}${rest}`\n}\n\n/** What a slot holds. */\nexport type TrendSlotKind = \"person\" | \"location\" | \"product\" | \"pet\"\n\n/** A chip: make this trait anew from your pictures (`\"new\"`), or keep the clip's (`\"original\"`). */\nexport type TrendChoice = \"new\" | \"original\"\n\n/**\n * The chips a slot can take, by its kind: a person `body` / `outfit` / `hair`,\n * a pet `body` / `coat`, a product `shape` / `finish`, a location none.\n */\nexport interface TrendChips {\n body?: TrendChoice\n outfit?: TrendChoice\n hair?: TrendChoice\n coat?: TrendChoice\n shape?: TrendChoice\n finish?: TrendChoice\n}\n\n/** A chip's name: `body`, `outfit`, `hair`, `coat`, `shape` or `finish`. */\nexport type TrendChipKey = keyof TrendChips\n\nexport type TrendResolution = \"480p\" | \"720p\" | \"1080p\"\n\n/**\n * The engine a trend runs on, by its public id ({@link CastSwapEngine}):\n * `\"motion-prism\"` (Nodaro Motion Prism) or `\"motion-pulse\"` (Nodaro Motion Pulse).\n * The trend chooses it, never the person running it.\n */\nexport type TrendEngine = CastSwapEngine\n\n/**\n * One of a trend's videos as a list or page shows it: the card's\n * {@link TrendCard.cover}, {@link TrendCard.original} and\n * {@link TrendCard.examples}, and the fields {@link TrendExample} and\n * {@link TrendOriginal} share.\n */\nexport interface TrendVideo {\n videoUrl: string\n posterUrl?: string\n width: number\n height: number\n /**\n * A light copy made by the platform for playback: H.264 ~2.5 Mbit/s, AAC\n * 160 kbit/s; play it as it is (no CDN transform). Absent on an older\n * version (until it is made) and from an older server: play\n * {@link videoUrl} then.\n */\n webUrl?: string\n /** The size of {@link webUrl}'s file, in bytes; present exactly when {@link webUrl} is. */\n webSizeBytes?: number\n}\n\n/** A trend in the catalog (`list()`). Text is in the resolved locale. */\nexport interface TrendCard {\n id: string\n slug: string\n name: string\n description?: string\n tags: string[]\n /** e.g. `\"trending\"`, `\"new\"`. */\n badges: string[]\n /**\n * The trend's first example, else (a trend with no example) its original's\n * display copy, as {@link TrendDetail.original}.\n */\n cover: TrendVideo\n /**\n * The original's display copy, the same address as {@link TrendDetail.original}\n * (without its length and preview start). Absent on a version without a\n * display copy (and from an older server). On a trend that hides its\n * original, its first example instead (then the same as {@link cover}).\n */\n original?: TrendVideo\n /**\n * Every example's video, in the page's order, so a list can show each clip\n * without reading the trend's page. Empty on a trend with only its original;\n * absent from an older server. The pictures each slot used are on the page\n * ({@link TrendDetail.examples}). On a trend that hides its original, from\n * its second example (the first is {@link original}).\n */\n examples?: TrendVideo[]\n /** How many slots of each kind the trend has. */\n needs: Record<TrendSlotKind, number>\n /** The length of a full run, in seconds. */\n durationSec: number\n /** Whether it is in your favorites; always `false` signed out. */\n isFavorite: boolean\n}\n\n/** One slot of a trend: what it asks you for. */\nexport interface TrendDetailSlot {\n /** The key to fill in {@link TrendRunRequest.slots}, and to mention in `details` as `{slot:<key>}`. */\n key: string\n label: string\n kind: TrendSlotKind\n /**\n * A required slot needs pictures; an optional one left empty takes the\n * chosen example's, or, on a trend with no example (or when that example has\n * none for it), stays as in the original;\n * except in Full depth trends, where it uses the trend's default image for that role if one is set, otherwise the original's look.\n */\n required: boolean\n hint?: string\n /**\n * A picture showing who or what this slot is in the original (e.g. a frame\n * of that actor), when the trend has one. Show it on an empty slot; a run\n * never sends it.\n */\n hintImageUrl?: string\n /**\n * The chips you may set on this slot, in its kind's order; `[]` = none (show\n * no chips row). A chip of the kind that is not listed is fixed by the\n * trend: sending it is refused with `400 chip_not_offered`.\n */\n chips: TrendChipKey[]\n /** The starting value of the chips in {@link chips} (only those). */\n defaults?: TrendChips\n}\n\n/** A finished run shown on a trend's page, with the pictures it used per slot. */\nexport interface TrendExample extends TrendVideo {\n /**\n * Slot key → the pictures this example used for it. An optional slot the\n * example kept as in the original has no key; a run that leaves that slot\n * empty with this example keeps it as in the original too.\n */\n slots: Record<string, string[]>\n}\n\n/**\n * The clip a trend recasts, as you may show it: a browser-safe copy (H.264\n * MP4) of the clip every run starts from. On a trend that hides its original,\n * its first example instead (the original clip is then never sent). Its fields\n * parallel {@link TrendExample}'s.\n */\nexport interface TrendOriginal extends TrendVideo {\n /** The copy's length (on a trend that hides its original, the first example's), in seconds. */\n durationSec: number\n /**\n * Where the 4-second preview starts in the clip, in seconds (`0` included),\n * when the trend offers one ({@link TrendDetail.previewSec} is `4`); absent\n * otherwise.\n */\n previewStartSec?: number\n}\n\n/** A trend's page (`get()`). */\nexport interface TrendDetail extends TrendCard {\n /** The published version this page shows. */\n version: number\n /** `4` when the trend offers a 4-second preview run, else `null`. */\n previewSec: 4 | null\n /**\n * The original clip every run starts from, to show beside the examples.\n * Absent only on a version without a display copy (and from an older server).\n * On a trend that hides its original, its first example (see {@link TrendOriginal}).\n */\n original?: TrendOriginal\n /** The engine every run of this trend uses. Absent (an older server) = `\"motion-prism\"`. */\n engine?: TrendEngine\n /** Its name to show: \"Nodaro Motion Prism\" or \"Nodaro Motion Pulse\". Absent from an older server. */\n engineName?: string\n /**\n * The resolutions a run may ask for, the default first. Nodaro Motion Prism:\n * `[\"480p\", \"720p\", \"1080p\"]`, where 480p is a draft (show it as one);\n * Nodaro Motion Pulse: `[\"720p\", \"1080p\"]`, no draft. Offer exactly these.\n */\n resolutions: TrendResolution[]\n slots: TrendDetailSlot[]\n /**\n * Finished runs to show beside the original; may be empty (a trend with only\n * its original). On a trend that hides its original, from its second example\n * (the first is {@link original}).\n */\n examples: TrendExample[]\n}\n\n/** What you put in one slot of a run: 1–3 pictures, and the chips the slot offers ({@link TrendDetailSlot.chips}). */\nexport interface TrendRunSlot extends TrendChips {\n images?: string[]\n}\n\n/** The body of `estimate()` and `run()`. */\nexport interface TrendRunRequest {\n /**\n * Slot key → what you put in it. Every required slot needs pictures; an\n * optional slot left out takes the chosen example's, or, on a trend with no\n * example (or when that example has none for it), stays as in the original; except in Full depth trends, where it uses the trend's default image for that role if one is set, otherwise the original's look.\n * 1–3 pictures per slot.\n */\n slots: Record<string, TrendRunSlot>\n /**\n * 1-based example whose pictures fill the optional slots you leave empty\n * (never in a Full depth trend, which records `example: 0`), numbering the\n * examples as {@link TrendDetail.examples} lists them. Default 1. Leave it out on a trend with no examples: sending one there\n * answers 400 `example_out_of_range` (and `0` is a `validation_error`). On a\n * trend that hides its original ({@link TrendDetail.original} is its first\n * example), `1` is still the first entry of `examples`, and leaving it out\n * fills the slots from the example shown as the original.\n */\n example?: number\n /** Your own words, at most 1,000 characters. Mention a slot as `{slot:<key>}`. */\n details?: string\n /** `true` runs a 4-second preview (only when the trend's `previewSec` is `4`). */\n preview?: boolean\n /**\n * One of the trend's {@link TrendDetail.resolutions}; default its first\n * (`\"480p\"` on Nodaro Motion Prism, `\"720p\"` on Nodaro Motion Pulse). Another answers 400\n * `resolution_unsupported`.\n */\n resolution?: TrendResolution\n /**\n * A draft run, only at 480p on a Nodaro Motion Prism trend. Default `true` at\n * 480p. `true` on a Nodaro Motion Pulse trend answers 400 `draft_unsupported`.\n */\n draft?: boolean\n /**\n * A generation session of yours. Accepted (and checked: one you may not use\n * is a 404), but not yet applied: trend runs are not filed into sessions yet.\n */\n sessionId?: string\n /** Accepted, but not used by the run today. */\n projectId?: string\n /**\n * A full run's own preview: the `jobId` of a completed preview run of this\n * trend that you started. When that preview needed the trend's retry (the\n * clip refused at first), the full run is made that way from the start (the\n * quote includes it). Any other job is ignored, without an error. Must be a uuid\n * (else 400 `validation_error`).\n */\n previewJobId?: string\n /**\n * `run()`: your client app's slug (e.g. `\"tools\"`: lowercase letters,\n * digits and `-`, 1–40 characters, starting with a letter or digit), as on\n * any job: the run's job carries it as `input_data.origin`, so\n * `client.jobs.list({ origin })` finds it. Not a slug is a 400\n * `validation_error`; without it the run has no origin. `estimate()`\n * ignores it.\n */\n origin?: string\n}\n\n/** What a run would cost, in credits (`estimate()`). */\nexport interface TrendEstimate {\n /** The charge the run is expected to come to. */\n expectedCredits: number\n /** What is reserved when the run starts; the run is charged what it actually costs. */\n holdCredits: number\n /** The engine the run was priced on: the trend's own. Absent from an older server. */\n engine?: TrendEngine\n /** Its name to show: \"Nodaro Motion Prism\" or \"Nodaro Motion Pulse\". Absent from an older server. */\n engineName?: string\n /**\n * The parts of the quote, by name, for display only: some are alternatives\n * or sit outside the totals (`privacy`, the retry's, beside\n * `privacyCredits`), so read `expectedCredits` and `holdCredits`, never\n * their sum.\n */\n breakdown: Record<string, number>\n /**\n * Only on a trend that retries a clip the video model refuses: the extra\n * credits charged if that retry runs. Not included in `expectedCredits` or\n * `holdCredits`. 0 (or absent) when there is nothing extra to charge.\n */\n privacyCredits?: number\n /** @deprecated read {@link privacyCredits} (an older server answered this name). */\n maskingCredits?: number\n}\n\n/** Per-call options for {@link TrendsResource.run}. */\nexport interface TrendRunOptions {\n /**\n * Sent as the `Idempotency-Key` header, unchanged (an empty string sends no\n * header). The server takes 8–200 characters and answers 400 for any other\n * length. Reuse it when retrying the same run.\n */\n idempotencyKey?: string\n}\n\n/** One slot of a past run, as it was run. Labels are English. */\nexport interface TrendRunDisplaySlot extends TrendChips {\n key: string\n label: string\n kind: TrendSlotKind\n images: string[]\n /**\n * `true` when the slot was left empty and the example's pictures filled it.\n * `false` with no `images`: left empty on a trend with no example, or the\n * chosen example has no pictures for it, so it stayed as in the original.\n */\n fromExample: boolean\n /**\n * `true` when the slot was left empty and the trend's own default pictures\n * filled it (`fromExample` is then `false`). Absent otherwise.\n */\n fromDefault?: true\n}\n\n/**\n * One of your trend runs (`runs()`, `getRun()`). Stays readable after the\n * trend moves on or is unpublished.\n *\n * A Full Quality version of a draft is a run of its own, with its own status,\n * result and charge: `fullQualityOf` names the draft it was made from, and it\n * stays listed after that draft is deleted.\n */\nexport interface TrendRun {\n jobId: string\n status: string\n progress: number | null\n /**\n * Why a failed or cancelled run did not finish; `null` otherwise. `code` is\n * `safety-block` or `policy-block` when the job was blocked, `credits` when\n * it ran out of credits partway (it was refunded: ask the person to top up,\n * then run it again), `input-refused` when the video provider refused the\n * trend's own clip, `request-refused` when it refused the run as it was sent\n * (the same run is refused again: change the images or the settings), else\n * `cancelled` or `failed`. `message` is the same\n * fixed sentence for every code — branch on `code`, not on the text.\n * `refused: true` on a Full Quality try another try can't get past (see\n * `fullQuality`): deleting it offers Full Quality again.\n */\n error: { code?: string; message: string; refused?: true } | null\n createdAt: string\n completedAt: string | null\n /** The trend and version it ran (name in English). */\n trend: { id: string; slug: string; version: number; name: string }\n /**\n * The 1-based example used for empty optional slots, numbered as the trend's\n * page listed its examples for the version the run ran on ({@link trend}'s\n * `version`); `0` = none was used (the trend had no example, or is a Full\n * depth trend): never show it as \"Example 0\". Absent when the run used the\n * example a trend that hides its original shows as its original.\n */\n example?: number\n slots: TrendRunDisplaySlot[]\n details?: string\n preview: boolean\n resolution: string\n draft: boolean\n /** The engine the run was made on. Absent (an older server) = `\"motion-prism\"`. */\n engine?: TrendEngine\n /** Its name to show: \"Nodaro Motion Prism\" or \"Nodaro Motion Pulse\". Absent from an older server. */\n engineName?: string\n /** The result, once completed. */\n videoUrl: string | null\n posterUrl: string | null\n /**\n * What the run was charged once settled, every step it ran included (its\n * reference preparation, mask and video); `null` until the run's own hold\n * settles. A step adds its charge once it settles.\n */\n creditsCharged: number | null\n /** The run's hold: its own plus its steps'. Absent from an older server. */\n creditsHeld?: number | null\n /** What went back from `creditsHeld` once every hold in the run settled; `null` until then. Absent from an older server. */\n creditsReleased?: number | null\n /** A Full Quality version: the job id of the run (a draft, or a Nodaro Motion Pulse 720p run) it was made from. `null` for any other run. */\n fullQualityOf: string | null\n /**\n * A draft's (or Nodaro Motion Pulse 720p run's) newest Full Quality try, if one was started: a pointer only,\n * to know an upgrade exists and how it is going. Its video and charge are on\n * that run, listed on its own (its `fullQualityOf` is this run's `jobId`) —\n * read it there (`getRun(fullQuality.jobId)`). Older tries of the draft (a\n * failed or cancelled one tried again) are not listed by `runs()`;\n * `getRun()` still reads one by its id. `refused`: the provider refused that\n * try as it was sent, or its clip, or blocked it for a copyright or a likeness,\n * so another try fails the same way.\n */\n fullQuality: { jobId: string; status: string; refused?: true } | null\n /**\n * Until when a completed run can be redone in Full Quality — a Nodaro Motion\n * Prism draft (the same take at 1080p) or a Nodaro Motion Pulse run at 720p (a new take at\n * 1080p); `null` otherwise.\n */\n fullQualityUntil: string | null\n}\n\nexport interface ListTrendsParams {\n /** Search text. */\n q?: string\n tag?: string\n /** `true` lists only your favorites (signed in only: a guest gets a 401). */\n favorites?: boolean\n /**\n * A platform language for names and descriptions; default your profile's\n * (signed out: the request's `Accept-Language`), then English.\n */\n locale?: string\n /** The previous page's `next`. */\n cursor?: string\n /** Page size, 1–60 (server default 30). */\n limit?: number\n}\n\nexport interface ListTrendRunsParams {\n /** Only runs of this trend (its slug). */\n trend?: string\n /** The previous page's `next`. */\n cursor?: string\n /** Page size, 1–60 (server default 30). */\n limit?: number\n}\n\n/** A tag in use on the published catalog (`tags()`). */\nexport interface TrendTag {\n /** The tag itself: pass it as `list({ tag })`. */\n tag: string\n /** The tag's label in the resolved locale; the tag itself when it has none. */\n label: string\n /** How many published trends carry it. */\n count: number\n}\n\nexport interface TrendPage<T> {\n data: T[]\n /** Pass back as `cursor` for the next page; `null` on the last one. */\n next: string | null\n}\n\nexport class TrendsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** The published catalog in its curated order (`GET /v1/trends`), a page at a time. Works signed out. */\n list(params: ListTrendsParams = {}): Promise<TrendPage<TrendCard>> {\n const query: Record<string, string> = {}\n if (params.q) query.q = params.q\n if (params.tag) query.tag = params.tag\n if (params.favorites) query.favorites = \"1\"\n if (params.locale) query.locale = params.locale\n if (params.cursor) query.cursor = params.cursor\n if (params.limit !== undefined) query.limit = String(params.limit)\n return this.client.request(\"GET\", \"/v1/trends\", { query })\n }\n\n /** A published trend's page (`GET /v1/trends/:slug`). Works signed out. */\n async get(slug: string, params: { locale?: string } = {}): Promise<TrendDetail> {\n const query: Record<string, string> = {}\n if (params.locale) query.locale = params.locale\n const res = await this.client.request<{ data: TrendDetail }>(\"GET\", trendPath(slug), { query })\n return res.data\n }\n\n /** Quote a run before starting it (`POST /v1/trends/:slug/estimate`); spends nothing. */\n async estimate(slug: string, request: TrendRunRequest): Promise<TrendEstimate> {\n const res = await this.client.request<{ data: TrendEstimate }>(\n \"POST\",\n trendPath(slug, \"/estimate\"),\n { body: request },\n )\n return res.data\n }\n\n /**\n * Start a run (`POST /v1/trends/:slug/runs`, 202). Returns the job to follow.\n * With `options.idempotencyKey` (sent as the `Idempotency-Key` header) a\n * repeat with the same key answers with the first run's `jobId`.\n */\n async run(slug: string, request: TrendRunRequest, options?: TrendRunOptions): Promise<{ jobId: string }> {\n const res = await this.client.request<{ data: { jobId: string } }>(\n \"POST\",\n trendPath(slug, \"/runs\"),\n {\n body: request,\n ...(options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n },\n )\n return res.data\n }\n\n /**\n * Your trend runs, newest first (`GET /v1/trends/runs`). A Full Quality\n * version of a draft is listed as its own run (`fullQualityOf`).\n */\n runs(params: ListTrendRunsParams = {}): Promise<TrendPage<TrendRun>> {\n const query: Record<string, string> = {}\n if (params.trend) query.trend = params.trend\n if (params.cursor) query.cursor = params.cursor\n if (params.limit !== undefined) query.limit = String(params.limit)\n return this.client.request(\"GET\", \"/v1/trends/runs\", { query })\n }\n\n /**\n * One of your trend runs by its job id (`GET /v1/trends/runs/:jobId`), in\n * the same shape as `runs()`. A job that is not your own trend run is a\n * `NotFoundError`.\n */\n async getRun(jobId: string): Promise<TrendRun> {\n const res = await this.client.request<{ data: TrendRun }>(\"GET\", `/v1/trends/runs/${encodeURIComponent(jobId)}`)\n return res.data\n }\n\n /**\n * The tags in use on the published catalog, each with its label in the\n * resolved locale (`GET /v1/trends/tags`), most used first. Works signed out.\n */\n async tags(params: { locale?: string } = {}): Promise<TrendTag[]> {\n const query: Record<string, string> = {}\n if (params.locale) query.locale = params.locale\n const res = await this.client.request<{ data: TrendTag[] }>(\"GET\", \"/v1/trends/tags\", { query })\n return res.data\n }\n\n /** Add a trend to your favorites (`PUT /v1/trends/:slug/favorite`). */\n async favorite(slug: string): Promise<void> {\n await this.client.request<void>(\"PUT\", trendPath(slug, \"/favorite\"))\n }\n\n /** Remove a trend from your favorites (`DELETE /v1/trends/:slug/favorite`). */\n async unfavorite(slug: string): Promise<void> {\n await this.client.request<void>(\"DELETE\", trendPath(slug, \"/favorite\"))\n }\n}\n"]}
|