@nodaro/sdk 2.56.0 → 2.57.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.
Files changed (71) hide show
  1. package/dist/{chunk-3CVWTUK5.cjs → chunk-3Y5TDB5K.cjs} +4 -4
  2. package/dist/{chunk-3CVWTUK5.cjs.map → chunk-3Y5TDB5K.cjs.map} +1 -1
  3. package/dist/{chunk-2LOTDOUV.cjs → chunk-7PYZCNLH.cjs} +5 -5
  4. package/dist/{chunk-2LOTDOUV.cjs.map → chunk-7PYZCNLH.cjs.map} +1 -1
  5. package/dist/{chunk-FTCAT2LK.js → chunk-ALDXFMD7.js} +3 -3
  6. package/dist/{chunk-FTCAT2LK.js.map → chunk-ALDXFMD7.js.map} +1 -1
  7. package/dist/{chunk-OMJ45CW4.cjs → chunk-DOMNKVKA.cjs} +9 -9
  8. package/dist/{chunk-OMJ45CW4.cjs.map → chunk-DOMNKVKA.cjs.map} +1 -1
  9. package/dist/{chunk-WY4QRJZW.js → chunk-DTYN7QAZ.js} +25 -2
  10. package/dist/chunk-DTYN7QAZ.js.map +1 -0
  11. package/dist/{chunk-PQ6G5EM7.js → chunk-EDSODRRY.js} +9 -9
  12. package/dist/{chunk-PQ6G5EM7.js.map → chunk-EDSODRRY.js.map} +1 -1
  13. package/dist/{chunk-DFT4LD2H.cjs → chunk-GDUEOKBF.cjs} +4 -4
  14. package/dist/{chunk-DFT4LD2H.cjs.map → chunk-GDUEOKBF.cjs.map} +1 -1
  15. package/dist/{chunk-Z4B4SZ33.cjs → chunk-GSE7SB3I.cjs} +6 -4
  16. package/dist/chunk-GSE7SB3I.cjs.map +1 -0
  17. package/dist/{chunk-Q7W4QNE5.cjs → chunk-GWTKYJJO.cjs} +22 -22
  18. package/dist/{chunk-Q7W4QNE5.cjs.map → chunk-GWTKYJJO.cjs.map} +1 -1
  19. package/dist/{chunk-4VP2GFIZ.js → chunk-JJMQ2EVL.js} +6 -4
  20. package/dist/chunk-JJMQ2EVL.js.map +1 -0
  21. package/dist/{chunk-RIMDKJSQ.cjs → chunk-JX3GYLV3.cjs} +16 -16
  22. package/dist/{chunk-RIMDKJSQ.cjs.map → chunk-JX3GYLV3.cjs.map} +1 -1
  23. package/dist/{chunk-Q4MFQC2J.cjs → chunk-KU3UITCU.cjs} +5 -5
  24. package/dist/{chunk-Q4MFQC2J.cjs.map → chunk-KU3UITCU.cjs.map} +1 -1
  25. package/dist/{chunk-E6X6BGRO.js → chunk-MUHRK4OI.js} +3 -3
  26. package/dist/{chunk-E6X6BGRO.js.map → chunk-MUHRK4OI.js.map} +1 -1
  27. package/dist/{chunk-VEQLP5TA.js → chunk-ND7JMM5H.js} +3 -3
  28. package/dist/{chunk-VEQLP5TA.js.map → chunk-ND7JMM5H.js.map} +1 -1
  29. package/dist/{chunk-JTOEHQQJ.cjs → chunk-NOZWIS7M.cjs} +25 -2
  30. package/dist/chunk-NOZWIS7M.cjs.map +1 -0
  31. package/dist/{chunk-HK6XP5EN.js → chunk-RCD4HDBI.js} +3 -3
  32. package/dist/{chunk-HK6XP5EN.js.map → chunk-RCD4HDBI.js.map} +1 -1
  33. package/dist/{chunk-37LL6BPM.js → chunk-SOR6K3XZ.js} +4 -4
  34. package/dist/{chunk-37LL6BPM.js.map → chunk-SOR6K3XZ.js.map} +1 -1
  35. package/dist/{chunk-4WOT5OAY.cjs → chunk-TSM3S2QS.cjs} +5 -5
  36. package/dist/{chunk-4WOT5OAY.cjs.map → chunk-TSM3S2QS.cjs.map} +1 -1
  37. package/dist/{chunk-BGOZRZHY.js → chunk-VTL4DBX4.js} +3 -3
  38. package/dist/{chunk-BGOZRZHY.js.map → chunk-VTL4DBX4.js.map} +1 -1
  39. package/dist/{chunk-4FSWJTRS.js → chunk-YYMX3VN7.js} +3 -3
  40. package/dist/{chunk-4FSWJTRS.js.map → chunk-YYMX3VN7.js.map} +1 -1
  41. package/dist/entries/client.cjs +15 -15
  42. package/dist/entries/client.js +10 -10
  43. package/dist/entries/copilot.cjs +4 -4
  44. package/dist/entries/copilot.js +3 -3
  45. package/dist/entries/core.cjs +6 -6
  46. package/dist/entries/core.js +2 -2
  47. package/dist/entries/edit.cjs +7 -7
  48. package/dist/entries/edit.js +2 -2
  49. package/dist/entries/errors.cjs +26 -26
  50. package/dist/entries/errors.d.cts +12 -1
  51. package/dist/entries/errors.d.ts +12 -1
  52. package/dist/entries/errors.js +1 -1
  53. package/dist/entries/media.cjs +4 -4
  54. package/dist/entries/media.js +3 -3
  55. package/dist/entries/nodes.cjs +3 -3
  56. package/dist/entries/nodes.js +2 -2
  57. package/dist/entries/studio.cjs +5 -5
  58. package/dist/entries/studio.js +2 -2
  59. package/dist/entries/uploads.cjs +2 -2
  60. package/dist/entries/uploads.d.cts +41 -1
  61. package/dist/entries/uploads.d.ts +41 -1
  62. package/dist/entries/uploads.js +1 -1
  63. package/dist/index.cjs +53 -53
  64. package/dist/index.d.cts +1 -1
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +10 -10
  67. package/package.json +1 -1
  68. package/dist/chunk-4VP2GFIZ.js.map +0 -1
  69. package/dist/chunk-JTOEHQQJ.cjs.map +0 -1
  70. package/dist/chunk-WY4QRJZW.js.map +0 -1
  71. package/dist/chunk-Z4B4SZ33.cjs.map +0 -1
@@ -39,6 +39,24 @@ declare class UploadsResource {
39
39
  * errors on the usual statuses.
40
40
  */
41
41
  upload(file: File): Promise<UploadResult>;
42
+ /**
43
+ * Copy a picture from a web address into your storage
44
+ * (`POST /v1/media/import-url`, body `{ url }`). The platform fetches it
45
+ * (http(s) only, never a private address, up to 20 MB), keeps it only if it
46
+ * decodes as an image (JPEG, PNG, WebP, GIF; HEIC/HEIF and AVIF are
47
+ * converted to JPEG or PNG), and stores it as an upload of yours, so its address serves
48
+ * the pixels to the browser (a canvas can read it). Returns the stored
49
+ * picture (unwraps the `{ data }` envelope).
50
+ *
51
+ * Throws `StorageExceededError` on a 413, its `reason` telling the two
52
+ * apart: `storage_limit_exceeded` is a full storage (the quota is in
53
+ * `details` — `usedBytes`, `quotaBytes`, `remainingBytes`, `tier`), and
54
+ * `file_too_large` a picture over 20 MB. Throws a `NodaroError` with `code`
55
+ * `validation_error` (400: not an http(s) address, or not an image) or
56
+ * `fetch_failed` (422: the address could not be reached or answered with an
57
+ * error).
58
+ */
59
+ importUrl(url: string): Promise<ImportUrlResult>;
42
60
  /**
43
61
  * Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its
44
62
  * public URL — e.g. an image editor's design state, passed to
@@ -53,5 +71,27 @@ interface UploadJsonResult {
53
71
  /** Public URL of the stored JSON document. */
54
72
  readonly url: string;
55
73
  }
74
+ /**
75
+ * Result of {@link UploadsResource.importUrl}. Mirrors the route's `data`:
76
+ * the fields of {@link UploadResult} it shares, plus the picture's size.
77
+ */
78
+ interface ImportUrlResult {
79
+ /** Public URL of the stored picture. */
80
+ readonly url: string;
81
+ /** Generated thumbnail URL; `null` when it could not be made. */
82
+ readonly thumbnailUrl: string | null;
83
+ /** Storage row id; `null` when no asset row was written. */
84
+ readonly assetId: string | null;
85
+ /** Final MIME type (a HEIC/HEIF or AVIF source is stored as JPEG or PNG). */
86
+ readonly mimeType: string;
87
+ /** Stored byte size. */
88
+ readonly sizeBytes: number;
89
+ /** Display filename: the address's last path segment, else `imported-<id>.<ext>`. */
90
+ readonly filename: string;
91
+ /** Width in pixels; 0 when it could not be read. */
92
+ readonly width: number;
93
+ /** Height in pixels; 0 when it could not be read. */
94
+ readonly height: number;
95
+ }
56
96
 
57
- export { type UploadJsonResult, type UploadResult, UploadsResource };
97
+ export { type ImportUrlResult, type UploadJsonResult, type UploadResult, UploadsResource };
@@ -1,4 +1,4 @@
1
1
  import '../chunk-CGNVHN4V.js';
2
- export { UploadsResource } from '../chunk-WY4QRJZW.js';
2
+ export { UploadsResource } from '../chunk-DTYN7QAZ.js';
3
3
  //# sourceMappingURL=uploads.js.map
4
4
  //# sourceMappingURL=uploads.js.map
package/dist/index.cjs CHANGED
@@ -54,9 +54,9 @@ require('./chunk-IS26FJO7.cjs');
54
54
  require('./chunk-RQSGS7ZK.cjs');
55
55
  require('./chunk-43NO4SGC.cjs');
56
56
  require('./chunk-JOX5BJ6K.cjs');
57
- var chunkRIMDKJSQ_cjs = require('./chunk-RIMDKJSQ.cjs');
57
+ var chunkJX3GYLV3_cjs = require('./chunk-JX3GYLV3.cjs');
58
58
  var chunkKMNSPC72_cjs = require('./chunk-KMNSPC72.cjs');
59
- var chunkJTOEHQQJ_cjs = require('./chunk-JTOEHQQJ.cjs');
59
+ var chunkNOZWIS7M_cjs = require('./chunk-NOZWIS7M.cjs');
60
60
  var chunkUIDVH3GP_cjs = require('./chunk-UIDVH3GP.cjs');
61
61
  var chunkW5VHATSR_cjs = require('./chunk-W5VHATSR.cjs');
62
62
  var chunkR63TTR35_cjs = require('./chunk-R63TTR35.cjs');
@@ -67,7 +67,7 @@ var chunkSYVNY3AH_cjs = require('./chunk-SYVNY3AH.cjs');
67
67
  var chunkYDRXBRW2_cjs = require('./chunk-YDRXBRW2.cjs');
68
68
  var chunkWMT7HEBZ_cjs = require('./chunk-WMT7HEBZ.cjs');
69
69
  var chunkMBFUMWI5_cjs = require('./chunk-MBFUMWI5.cjs');
70
- var chunk4WOT5OAY_cjs = require('./chunk-4WOT5OAY.cjs');
70
+ var chunkTSM3S2QS_cjs = require('./chunk-TSM3S2QS.cjs');
71
71
  var chunkUIBYZNDR_cjs = require('./chunk-UIBYZNDR.cjs');
72
72
  var chunkLTZKNAXM_cjs = require('./chunk-LTZKNAXM.cjs');
73
73
  var chunkPDX742CC_cjs = require('./chunk-PDX742CC.cjs');
@@ -80,14 +80,14 @@ var chunkTCLNSVYA_cjs = require('./chunk-TCLNSVYA.cjs');
80
80
  var chunkKXEWTYS4_cjs = require('./chunk-KXEWTYS4.cjs');
81
81
  var chunkGB6C5OEZ_cjs = require('./chunk-GB6C5OEZ.cjs');
82
82
  var chunkMIXRL6I2_cjs = require('./chunk-MIXRL6I2.cjs');
83
- var chunk3CVWTUK5_cjs = require('./chunk-3CVWTUK5.cjs');
83
+ var chunk3Y5TDB5K_cjs = require('./chunk-3Y5TDB5K.cjs');
84
84
  var chunk7QOCWJKD_cjs = require('./chunk-7QOCWJKD.cjs');
85
85
  var chunkZCWKX4V6_cjs = require('./chunk-ZCWKX4V6.cjs');
86
86
  var chunkQ45PC4YD_cjs = require('./chunk-Q45PC4YD.cjs');
87
- var chunkQ7W4QNE5_cjs = require('./chunk-Q7W4QNE5.cjs');
87
+ var chunkGWTKYJJO_cjs = require('./chunk-GWTKYJJO.cjs');
88
88
  var chunkGVIFLUYZ_cjs = require('./chunk-GVIFLUYZ.cjs');
89
89
  var chunk57GANTLV_cjs = require('./chunk-57GANTLV.cjs');
90
- var chunkOMJ45CW4_cjs = require('./chunk-OMJ45CW4.cjs');
90
+ var chunkDOMNKVKA_cjs = require('./chunk-DOMNKVKA.cjs');
91
91
  var chunkSBV5MWEL_cjs = require('./chunk-SBV5MWEL.cjs');
92
92
  var chunkWUKIJJG2_cjs = require('./chunk-WUKIJJG2.cjs');
93
93
  var chunk2KX5ZE6M_cjs = require('./chunk-2KX5ZE6M.cjs');
@@ -97,10 +97,10 @@ var chunkSS3B6PHT_cjs = require('./chunk-SS3B6PHT.cjs');
97
97
  var chunkWK4VXPPZ_cjs = require('./chunk-WK4VXPPZ.cjs');
98
98
  var chunk43FVH6LJ_cjs = require('./chunk-43FVH6LJ.cjs');
99
99
  var chunkYFS2LMG4_cjs = require('./chunk-YFS2LMG4.cjs');
100
- var chunkDFT4LD2H_cjs = require('./chunk-DFT4LD2H.cjs');
101
- require('./chunk-Q4MFQC2J.cjs');
102
- var chunk2LOTDOUV_cjs = require('./chunk-2LOTDOUV.cjs');
103
- var chunkZ4B4SZ33_cjs = require('./chunk-Z4B4SZ33.cjs');
100
+ var chunkGDUEOKBF_cjs = require('./chunk-GDUEOKBF.cjs');
101
+ require('./chunk-KU3UITCU.cjs');
102
+ var chunk7PYZCNLH_cjs = require('./chunk-7PYZCNLH.cjs');
103
+ var chunkGSE7SB3I_cjs = require('./chunk-GSE7SB3I.cjs');
104
104
  var chunkA3XA6UNM_cjs = require('./chunk-A3XA6UNM.cjs');
105
105
  var chunk4BAHF762_cjs = require('./chunk-4BAHF762.cjs');
106
106
  var chunkA3S55XGF_cjs = require('./chunk-A3S55XGF.cjs');
@@ -147,11 +147,11 @@ Object.defineProperty(exports, "unwrapEditPlanOutput", {
147
147
  });
148
148
  Object.defineProperty(exports, "NodaroClient", {
149
149
  enumerable: true,
150
- get: function () { return chunkRIMDKJSQ_cjs.NodaroClient; }
150
+ get: function () { return chunkJX3GYLV3_cjs.NodaroClient; }
151
151
  });
152
152
  Object.defineProperty(exports, "createClient", {
153
153
  enumerable: true,
154
- get: function () { return chunkRIMDKJSQ_cjs.createClient; }
154
+ get: function () { return chunkJX3GYLV3_cjs.createClient; }
155
155
  });
156
156
  Object.defineProperty(exports, "TutorialsResource", {
157
157
  enumerable: true,
@@ -159,7 +159,7 @@ Object.defineProperty(exports, "TutorialsResource", {
159
159
  });
160
160
  Object.defineProperty(exports, "UploadsResource", {
161
161
  enumerable: true,
162
- get: function () { return chunkJTOEHQQJ_cjs.UploadsResource; }
162
+ get: function () { return chunkNOZWIS7M_cjs.UploadsResource; }
163
163
  });
164
164
  Object.defineProperty(exports, "UserSettingsResource", {
165
165
  enumerable: true,
@@ -207,15 +207,15 @@ Object.defineProperty(exports, "ShotsResource", {
207
207
  });
208
208
  Object.defineProperty(exports, "StudioProductionsResource", {
209
209
  enumerable: true,
210
- get: function () { return chunk4WOT5OAY_cjs.StudioProductionsResource; }
210
+ get: function () { return chunkTSM3S2QS_cjs.StudioProductionsResource; }
211
211
  });
212
212
  Object.defineProperty(exports, "StudioResource", {
213
213
  enumerable: true,
214
- get: function () { return chunk4WOT5OAY_cjs.StudioResource; }
214
+ get: function () { return chunkTSM3S2QS_cjs.StudioResource; }
215
215
  });
216
216
  Object.defineProperty(exports, "isStudioGenerateEstimate", {
217
217
  enumerable: true,
218
- get: function () { return chunk4WOT5OAY_cjs.isStudioGenerateEstimate; }
218
+ get: function () { return chunkTSM3S2QS_cjs.isStudioGenerateEstimate; }
219
219
  });
220
220
  Object.defineProperty(exports, "TemplatesResource", {
221
221
  enumerable: true,
@@ -287,7 +287,7 @@ Object.defineProperty(exports, "SURROUND_DIRECTIONS", {
287
287
  });
288
288
  Object.defineProperty(exports, "MediaResource", {
289
289
  enumerable: true,
290
- get: function () { return chunk3CVWTUK5_cjs.MediaResource; }
290
+ get: function () { return chunk3Y5TDB5K_cjs.MediaResource; }
291
291
  });
292
292
  Object.defineProperty(exports, "ModelsResource", {
293
293
  enumerable: true,
@@ -311,7 +311,7 @@ Object.defineProperty(exports, "PresetsResource", {
311
311
  });
312
312
  Object.defineProperty(exports, "NodesResource", {
313
313
  enumerable: true,
314
- get: function () { return chunkQ7W4QNE5_cjs.NodesResource; }
314
+ get: function () { return chunkGWTKYJJO_cjs.NodesResource; }
315
315
  });
316
316
  Object.defineProperty(exports, "OAuthResource", {
317
317
  enumerable: true,
@@ -339,23 +339,23 @@ Object.defineProperty(exports, "ObjectsResource", {
339
339
  });
340
340
  Object.defineProperty(exports, "CLIP_PACK_MAX_TARGET_SEC", {
341
341
  enumerable: true,
342
- get: function () { return chunkOMJ45CW4_cjs.CLIP_PACK_MAX_TARGET_SEC; }
342
+ get: function () { return chunkDOMNKVKA_cjs.CLIP_PACK_MAX_TARGET_SEC; }
343
343
  });
344
344
  Object.defineProperty(exports, "CLIP_PACK_MIN_TARGET_SEC", {
345
345
  enumerable: true,
346
- get: function () { return chunkOMJ45CW4_cjs.CLIP_PACK_MIN_TARGET_SEC; }
346
+ get: function () { return chunkDOMNKVKA_cjs.CLIP_PACK_MIN_TARGET_SEC; }
347
347
  });
348
348
  Object.defineProperty(exports, "EditResource", {
349
349
  enumerable: true,
350
- get: function () { return chunkOMJ45CW4_cjs.EditResource; }
350
+ get: function () { return chunkDOMNKVKA_cjs.EditResource; }
351
351
  });
352
352
  Object.defineProperty(exports, "TRAILER_FORMATS", {
353
353
  enumerable: true,
354
- get: function () { return chunkOMJ45CW4_cjs.TRAILER_FORMATS; }
354
+ get: function () { return chunkDOMNKVKA_cjs.TRAILER_FORMATS; }
355
355
  });
356
356
  Object.defineProperty(exports, "USE_CASE_NODE_TYPES", {
357
357
  enumerable: true,
358
- get: function () { return chunkOMJ45CW4_cjs.USE_CASE_NODE_TYPES; }
358
+ get: function () { return chunkDOMNKVKA_cjs.USE_CASE_NODE_TYPES; }
359
359
  });
360
360
  Object.defineProperty(exports, "ExecutionsResource", {
361
361
  enumerable: true,
@@ -407,123 +407,123 @@ Object.defineProperty(exports, "CompetitorsResource", {
407
407
  });
408
408
  Object.defineProperty(exports, "CopilotResource", {
409
409
  enumerable: true,
410
- get: function () { return chunkDFT4LD2H_cjs.CopilotResource; }
410
+ get: function () { return chunkGDUEOKBF_cjs.CopilotResource; }
411
411
  });
412
412
  Object.defineProperty(exports, "CallbackAuth", {
413
413
  enumerable: true,
414
- get: function () { return chunk2LOTDOUV_cjs.CallbackAuth; }
414
+ get: function () { return chunk7PYZCNLH_cjs.CallbackAuth; }
415
415
  });
416
416
  Object.defineProperty(exports, "NodaroClientCore", {
417
417
  enumerable: true,
418
- get: function () { return chunk2LOTDOUV_cjs.NodaroClientCore; }
418
+ get: function () { return chunk7PYZCNLH_cjs.NodaroClientCore; }
419
419
  });
420
420
  Object.defineProperty(exports, "StaticTokenAuth", {
421
421
  enumerable: true,
422
- get: function () { return chunk2LOTDOUV_cjs.StaticTokenAuth; }
422
+ get: function () { return chunk7PYZCNLH_cjs.StaticTokenAuth; }
423
423
  });
424
424
  Object.defineProperty(exports, "supabaseAuth", {
425
425
  enumerable: true,
426
- get: function () { return chunk2LOTDOUV_cjs.supabaseAuth; }
426
+ get: function () { return chunk7PYZCNLH_cjs.supabaseAuth; }
427
427
  });
428
428
  Object.defineProperty(exports, "AlreadyRunningError", {
429
429
  enumerable: true,
430
- get: function () { return chunkZ4B4SZ33_cjs.AlreadyRunningError; }
430
+ get: function () { return chunkGSE7SB3I_cjs.AlreadyRunningError; }
431
431
  });
432
432
  Object.defineProperty(exports, "AppRunVersionChangedError", {
433
433
  enumerable: true,
434
- get: function () { return chunkZ4B4SZ33_cjs.AppRunVersionChangedError; }
434
+ get: function () { return chunkGSE7SB3I_cjs.AppRunVersionChangedError; }
435
435
  });
436
436
  Object.defineProperty(exports, "CREDIT_CAP_CODES", {
437
437
  enumerable: true,
438
- get: function () { return chunkZ4B4SZ33_cjs.CREDIT_CAP_CODES; }
438
+ get: function () { return chunkGSE7SB3I_cjs.CREDIT_CAP_CODES; }
439
439
  });
440
440
  Object.defineProperty(exports, "ContinuationPreviewPendingError", {
441
441
  enumerable: true,
442
- get: function () { return chunkZ4B4SZ33_cjs.ContinuationPreviewPendingError; }
442
+ get: function () { return chunkGSE7SB3I_cjs.ContinuationPreviewPendingError; }
443
443
  });
444
444
  Object.defineProperty(exports, "ContinuationRefusedError", {
445
445
  enumerable: true,
446
- get: function () { return chunkZ4B4SZ33_cjs.ContinuationRefusedError; }
446
+ get: function () { return chunkGSE7SB3I_cjs.ContinuationRefusedError; }
447
447
  });
448
448
  Object.defineProperty(exports, "CreditCapExceededError", {
449
449
  enumerable: true,
450
- get: function () { return chunkZ4B4SZ33_cjs.CreditCapExceededError; }
450
+ get: function () { return chunkGSE7SB3I_cjs.CreditCapExceededError; }
451
451
  });
452
452
  Object.defineProperty(exports, "ForbiddenError", {
453
453
  enumerable: true,
454
- get: function () { return chunkZ4B4SZ33_cjs.ForbiddenError; }
454
+ get: function () { return chunkGSE7SB3I_cjs.ForbiddenError; }
455
455
  });
456
456
  Object.defineProperty(exports, "InsufficientCreditsError", {
457
457
  enumerable: true,
458
- get: function () { return chunkZ4B4SZ33_cjs.InsufficientCreditsError; }
458
+ get: function () { return chunkGSE7SB3I_cjs.InsufficientCreditsError; }
459
459
  });
460
460
  Object.defineProperty(exports, "JobAbortedError", {
461
461
  enumerable: true,
462
- get: function () { return chunkZ4B4SZ33_cjs.JobAbortedError; }
462
+ get: function () { return chunkGSE7SB3I_cjs.JobAbortedError; }
463
463
  });
464
464
  Object.defineProperty(exports, "JobBlockedError", {
465
465
  enumerable: true,
466
- get: function () { return chunkZ4B4SZ33_cjs.JobBlockedError; }
466
+ get: function () { return chunkGSE7SB3I_cjs.JobBlockedError; }
467
467
  });
468
468
  Object.defineProperty(exports, "JobFailedError", {
469
469
  enumerable: true,
470
- get: function () { return chunkZ4B4SZ33_cjs.JobFailedError; }
470
+ get: function () { return chunkGSE7SB3I_cjs.JobFailedError; }
471
471
  });
472
472
  Object.defineProperty(exports, "JobHeldError", {
473
473
  enumerable: true,
474
- get: function () { return chunkZ4B4SZ33_cjs.JobHeldError; }
474
+ get: function () { return chunkGSE7SB3I_cjs.JobHeldError; }
475
475
  });
476
476
  Object.defineProperty(exports, "JobTimeoutError", {
477
477
  enumerable: true,
478
- get: function () { return chunkZ4B4SZ33_cjs.JobTimeoutError; }
478
+ get: function () { return chunkGSE7SB3I_cjs.JobTimeoutError; }
479
479
  });
480
480
  Object.defineProperty(exports, "MODEL_UNAVAILABLE_CODES", {
481
481
  enumerable: true,
482
- get: function () { return chunkZ4B4SZ33_cjs.MODEL_UNAVAILABLE_CODES; }
482
+ get: function () { return chunkGSE7SB3I_cjs.MODEL_UNAVAILABLE_CODES; }
483
483
  });
484
484
  Object.defineProperty(exports, "ModelUnavailableError", {
485
485
  enumerable: true,
486
- get: function () { return chunkZ4B4SZ33_cjs.ModelUnavailableError; }
486
+ get: function () { return chunkGSE7SB3I_cjs.ModelUnavailableError; }
487
487
  });
488
488
  Object.defineProperty(exports, "NodaroError", {
489
489
  enumerable: true,
490
- get: function () { return chunkZ4B4SZ33_cjs.NodaroError; }
490
+ get: function () { return chunkGSE7SB3I_cjs.NodaroError; }
491
491
  });
492
492
  Object.defineProperty(exports, "NotFoundError", {
493
493
  enumerable: true,
494
- get: function () { return chunkZ4B4SZ33_cjs.NotFoundError; }
494
+ get: function () { return chunkGSE7SB3I_cjs.NotFoundError; }
495
495
  });
496
496
  Object.defineProperty(exports, "RateLimitedError", {
497
497
  enumerable: true,
498
- get: function () { return chunkZ4B4SZ33_cjs.RateLimitedError; }
498
+ get: function () { return chunkGSE7SB3I_cjs.RateLimitedError; }
499
499
  });
500
500
  Object.defineProperty(exports, "StorageExceededError", {
501
501
  enumerable: true,
502
- get: function () { return chunkZ4B4SZ33_cjs.StorageExceededError; }
502
+ get: function () { return chunkGSE7SB3I_cjs.StorageExceededError; }
503
503
  });
504
504
  Object.defineProperty(exports, "StudioOpError", {
505
505
  enumerable: true,
506
- get: function () { return chunkZ4B4SZ33_cjs.StudioOpError; }
506
+ get: function () { return chunkGSE7SB3I_cjs.StudioOpError; }
507
507
  });
508
508
  Object.defineProperty(exports, "StudioPreviewAppliedError", {
509
509
  enumerable: true,
510
- get: function () { return chunkZ4B4SZ33_cjs.StudioPreviewAppliedError; }
510
+ get: function () { return chunkGSE7SB3I_cjs.StudioPreviewAppliedError; }
511
511
  });
512
512
  Object.defineProperty(exports, "StudioPreviewUnavailable", {
513
513
  enumerable: true,
514
- get: function () { return chunkZ4B4SZ33_cjs.StudioPreviewUnavailable; }
514
+ get: function () { return chunkGSE7SB3I_cjs.StudioPreviewUnavailable; }
515
515
  });
516
516
  Object.defineProperty(exports, "UnauthorizedError", {
517
517
  enumerable: true,
518
- get: function () { return chunkZ4B4SZ33_cjs.UnauthorizedError; }
518
+ get: function () { return chunkGSE7SB3I_cjs.UnauthorizedError; }
519
519
  });
520
520
  Object.defineProperty(exports, "WorkflowConflictError", {
521
521
  enumerable: true,
522
- get: function () { return chunkZ4B4SZ33_cjs.WorkflowConflictError; }
522
+ get: function () { return chunkGSE7SB3I_cjs.WorkflowConflictError; }
523
523
  });
524
524
  Object.defineProperty(exports, "throwFromResponse", {
525
525
  enumerable: true,
526
- get: function () { return chunkZ4B4SZ33_cjs.throwFromResponse; }
526
+ get: function () { return chunkGSE7SB3I_cjs.throwFromResponse; }
527
527
  });
528
528
  Object.defineProperty(exports, "CREATURE_ASPECT_DEFAULTS", {
529
529
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -57,7 +57,7 @@ export { BrowseTemplatesParams, BrowseTemplatesResult, CloneTemplateParams, Clon
57
57
  export { ListTrashParams, TrashEntry, TrashPage, TrashResource, TrashSession } from './entries/trash.cjs';
58
58
  export { ListTrendRunsParams, ListTrendsParams, TrendCard, TrendChipKey, TrendChips, TrendChoice, TrendDetail, TrendDetailSlot, TrendEngine, TrendEstimate, TrendExample, TrendOriginal, TrendPage, TrendResolution, TrendRun, TrendRunDisplaySlot, TrendRunOptions, TrendRunRequest, TrendRunSlot, TrendSlotKind, TrendTag, TrendsResource } from './entries/trends.cjs';
59
59
  export { TutorialCategory, TutorialFlowItem, TutorialVideoItem, TutorialsResource } from './entries/tutorials.cjs';
60
- export { UploadJsonResult, UploadResult, UploadsResource } from './entries/uploads.cjs';
60
+ export { ImportUrlResult, UploadJsonResult, UploadResult, UploadsResource } from './entries/uploads.cjs';
61
61
  export { NodeDoubleClickAction, UserMcpPreferences, UserSettings, UserSettingsLocale, UserSettingsPatch, UserSettingsResource, UserSettingsSaved, UserTextTemplate, VariableDisplayMode } from './entries/user-settings.cjs';
62
62
  export { ContinueVideoProResult, StopVideoProResult, VideoProResource } from './entries/video-pro.cjs';
63
63
  export { DubbingInput, VcpAnalysis, VcpAnalysisSpeaker, VcpAnalyzeInput, VcpExportInput, VcpExportTrack, VoiceChangerProInput, VoiceChangerProVoice, VoiceDesignInput, VoiceRemixInput, VoicesResource } from './entries/voices.cjs';
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ export { BrowseTemplatesParams, BrowseTemplatesResult, CloneTemplateParams, Clon
57
57
  export { ListTrashParams, TrashEntry, TrashPage, TrashResource, TrashSession } from './entries/trash.js';
58
58
  export { ListTrendRunsParams, ListTrendsParams, TrendCard, TrendChipKey, TrendChips, TrendChoice, TrendDetail, TrendDetailSlot, TrendEngine, TrendEstimate, TrendExample, TrendOriginal, TrendPage, TrendResolution, TrendRun, TrendRunDisplaySlot, TrendRunOptions, TrendRunRequest, TrendRunSlot, TrendSlotKind, TrendTag, TrendsResource } from './entries/trends.js';
59
59
  export { TutorialCategory, TutorialFlowItem, TutorialVideoItem, TutorialsResource } from './entries/tutorials.js';
60
- export { UploadJsonResult, UploadResult, UploadsResource } from './entries/uploads.js';
60
+ export { ImportUrlResult, UploadJsonResult, UploadResult, UploadsResource } from './entries/uploads.js';
61
61
  export { NodeDoubleClickAction, UserMcpPreferences, UserSettings, UserSettingsLocale, UserSettingsPatch, UserSettingsResource, UserSettingsSaved, UserTextTemplate, VariableDisplayMode } from './entries/user-settings.js';
62
62
  export { ContinueVideoProResult, StopVideoProResult, VideoProResource } from './entries/video-pro.js';
63
63
  export { DubbingInput, VcpAnalysis, VcpAnalysisSpeaker, VcpAnalyzeInput, VcpExportInput, VcpExportTrack, VoiceChangerProInput, VoiceChangerProVoice, VoiceDesignInput, VoiceRemixInput, VoicesResource } from './entries/voices.js';
package/dist/index.js CHANGED
@@ -52,9 +52,9 @@ import './chunk-M6Y5TOYE.js';
52
52
  import './chunk-KARJ7P7Y.js';
53
53
  import './chunk-SUCHGNYT.js';
54
54
  import './chunk-SLPD47SR.js';
55
- export { NodaroClient, createClient } from './chunk-PQ6G5EM7.js';
55
+ export { NodaroClient, createClient } from './chunk-EDSODRRY.js';
56
56
  export { TutorialsResource } from './chunk-HPXE3NZW.js';
57
- export { UploadsResource } from './chunk-WY4QRJZW.js';
57
+ export { UploadsResource } from './chunk-DTYN7QAZ.js';
58
58
  export { UserSettingsResource } from './chunk-LR5TGCJP.js';
59
59
  export { VideoProResource } from './chunk-ERLXU47J.js';
60
60
  export { VoicesResource } from './chunk-T7N7DFQJ.js';
@@ -65,7 +65,7 @@ export { SavedPostsResource } from './chunk-NCCBS6GU.js';
65
65
  export { SCENE3D_DELIVERY_ASSET_USAGE, Scene3DResource } from './chunk-NNHWH7ER.js';
66
66
  export { SessionsResource } from './chunk-WS4ZQ4AA.js';
67
67
  export { ShotsResource } from './chunk-WVFAQBS7.js';
68
- export { StudioProductionsResource, StudioResource, isStudioGenerateEstimate } from './chunk-BGOZRZHY.js';
68
+ export { StudioProductionsResource, StudioResource, isStudioGenerateEstimate } from './chunk-VTL4DBX4.js';
69
69
  export { TemplatesResource } from './chunk-M7VSFZMV.js';
70
70
  export { TrashResource } from './chunk-2SQ7V6EX.js';
71
71
  export { TrendsResource } from './chunk-HFYNZ4SO.js';
@@ -78,14 +78,14 @@ export { PromptHelperResource } from './chunk-OIPPTBW4.js';
78
78
  export { RecastResource } from './chunk-AJVSMNPZ.js';
79
79
  export { ReduceResource } from './chunk-IHKIYVZQ.js';
80
80
  export { LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationsResource, SURROUND_DIRECTIONS } from './chunk-XZPSJG2X.js';
81
- export { MediaResource } from './chunk-VEQLP5TA.js';
81
+ export { MediaResource } from './chunk-ND7JMM5H.js';
82
82
  export { ModelsResource } from './chunk-Y6V6CBY5.js';
83
83
  export { MOODBOARD_DIRECTION_PREFIX, MoodboardsResource, moodboardDirectionId } from './chunk-YVU2M7MI.js';
84
84
  export { PresetsResource } from './chunk-AEUPH7EE.js';
85
- export { NodesResource } from './chunk-FTCAT2LK.js';
85
+ export { NodesResource } from './chunk-ALDXFMD7.js';
86
86
  export { OAuthResource } from './chunk-Z7LGWNI7.js';
87
87
  export { OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectsResource } from './chunk-GIQDM2MH.js';
88
- export { CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, EditResource, TRAILER_FORMATS, USE_CASE_NODE_TYPES } from './chunk-E6X6BGRO.js';
88
+ export { CLIP_PACK_MAX_TARGET_SEC, CLIP_PACK_MIN_TARGET_SEC, EditResource, TRAILER_FORMATS, USE_CASE_NODE_TYPES } from './chunk-MUHRK4OI.js';
89
89
  export { ExecutionsResource, OUTPUT_BEARING_NODE_STATUSES, nodeStateMayCarryOutput } from './chunk-Z3ZKFI2M.js';
90
90
  export { GalleryResource } from './chunk-JDEZHITT.js';
91
91
  export { JobsResource } from './chunk-HJLSOT5C.js';
@@ -95,10 +95,10 @@ export { LlmResource } from './chunk-E37CVHWW.js';
95
95
  export { CollectionsResource } from './chunk-4WRDR4GN.js';
96
96
  export { CommunityResource } from './chunk-SFB4YLCS.js';
97
97
  export { CompetitorsResource } from './chunk-BU5A6K4C.js';
98
- export { CopilotResource } from './chunk-HK6XP5EN.js';
99
- import './chunk-4FSWJTRS.js';
100
- export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from './chunk-37LL6BPM.js';
101
- export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapExceededError, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictError, throwFromResponse } from './chunk-4VP2GFIZ.js';
98
+ export { CopilotResource } from './chunk-RCD4HDBI.js';
99
+ import './chunk-YYMX3VN7.js';
100
+ export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from './chunk-SOR6K3XZ.js';
101
+ export { AlreadyRunningError, AppRunVersionChangedError, CREDIT_CAP_CODES, ContinuationPreviewPendingError, ContinuationRefusedError, CreditCapExceededError, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobBlockedError, JobFailedError, JobHeldError, JobTimeoutError, MODEL_UNAVAILABLE_CODES, ModelUnavailableError, NodaroError, NotFoundError, RateLimitedError, StorageExceededError, StudioOpError, StudioPreviewAppliedError, StudioPreviewUnavailable, UnauthorizedError, WorkflowConflictError, throwFromResponse } from './chunk-JJMQ2EVL.js';
102
102
  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';
103
103
  export { CreditsResource } from './chunk-7QK2NXJA.js';
104
104
  export { DeveloperAppsResource } from './chunk-65E3JBFZ.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodaro/sdk",
3
- "version": "2.56.0",
3
+ "version": "2.57.0",
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",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/errors.ts"],"names":[],"mappings":";AAEO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EAUrC,WAAA,CACE,OAAA,EACgB,IAAA,EACA,MAAA,EAChB,OAAA,EACA;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAJG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAIhB,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AACZ,IAAA,IAAI,OAAA,EAAS,IAAA,CAAK,OAAA,GAAU,EAAE,GAAG,OAAA,EAAQ;AAAA,EAC3C;AAAA,EAPkB,IAAA;AAAA,EACA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EALF,UAA6C,EAAC;AAYhE;AAEO,IAAM,iBAAA,GAAN,cAAgC,WAAA,CAAY;AAAA,EACjD,WAAA,CAAY,UAAU,yBAAA,EAA2B;AAC/C,IAAA,KAAA,CAAM,OAAA,EAAS,gBAAgB,GAAG,CAAA;AAClC,IAAA,IAAA,CAAK,IAAA,GAAO,mBAAA;AAAA,EACd;AACF;AAEO,IAAM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AA,EAAS,SAAS,UAAU,CAAA;AACpF,EAAA,MAAM,IAAI,WAAA,CAAY,OAAA,EAAS,IAAA,EAAM,MAAM,CAAA;AAC7C","file":"chunk-4VP2GFIZ.js","sourcesContent":["import type { StudioOpsResponse } from \"./resources/studio-productions.js\"\n\nexport class NodaroError extends Error {\n /**\n * Every other field of the server's error envelope (`{ error: { code,\n * message, … } }`), as it was sent: for example a trend refusal's `slot`, a\n * publish refusal's `reasons`, a validation error's `issues`. Empty when the\n * envelope had nothing else, or for an error the SDK made itself. A copy —\n * changing it changes nothing else.\n */\n public readonly details: Readonly<Record<string, unknown>> = {}\n\n constructor(\n message: string,\n public readonly code: string,\n public readonly status: number,\n details?: Readonly<Record<string, unknown>>,\n ) {\n super(message)\n this.name = \"NodaroError\"\n if (details) this.details = { ...details }\n }\n}\n\nexport class UnauthorizedError extends NodaroError {\n constructor(message = \"Authentication required\") {\n super(message, \"unauthorized\", 401)\n this.name = \"UnauthorizedError\"\n }\n}\n\nexport class ForbiddenError extends NodaroError {\n /** `code` defaults to `\"forbidden\"`; {@link ModelUnavailableError} passes its own. */\n constructor(message = \"Forbidden\", public readonly missingScope?: string, code = \"forbidden\") {\n super(message, code, 403)\n this.name = \"ForbiddenError\"\n }\n}\n\nexport type ModelUnavailableCode = \"model_not_available\" | \"model_disabled\"\n\n/**\n * The 403 codes {@link ModelUnavailableError} carries: a model this\n * deployment does not offer (`model_not_available` — outside its edition or\n * surface, or hidden by its operator) and a model an admin switched off on\n * the models page (`model_disabled`).\n */\nexport const MODEL_UNAVAILABLE_CODES: ReadonlySet<ModelUnavailableCode> = new Set<ModelUnavailableCode>([\n \"model_not_available\",\n \"model_disabled\",\n])\n\n/**\n * HTTP 403 refusing the MODEL, not the caller: this deployment does not offer\n * it, or an admin switched it off. Answered by the credit guard before any\n * credits are held (the LLM and pipeline lanes still answer a switched-off\n * model with a 402 for now).\n * Choosing another model is the remedy — retrying, topping up or a wider\n * scope changes nothing. A {@link ForbiddenError}, so existing catches keep\n * working; `code` is the server's own code and says which. The envelope\n * names no model: what was refused is the request's own `provider` (or, for\n * a fan-out, one of its `models`).\n */\nexport class ModelUnavailableError extends ForbiddenError {\n declare readonly code: ModelUnavailableCode\n\n constructor(code: ModelUnavailableCode, message = \"This model is not available\") {\n super(message, undefined, code)\n this.name = \"ModelUnavailableError\"\n }\n}\n\nexport class NotFoundError extends NodaroError {\n constructor(message = \"Not found\") {\n super(message, \"not_found\", 404)\n this.name = \"NotFoundError\"\n }\n}\n\nexport class RateLimitedError extends NodaroError {\n constructor(message = \"Rate limited\") {\n super(message, \"rate_limited\", 429)\n this.name = \"RateLimitedError\"\n }\n}\n\n/**\n * HTTP 402: the run costs more than the caller may spend. `code` is the\n * refusal's own code — `insufficient_credits` for the caller's own balance, or\n * another 402 code such as `free_video_limit`. A spending cap someone else set\n * (a workspace budget, a member cap, a per-user allowance) is the subclass\n * {@link CreditCapExceededError}, so `instanceof InsufficientCreditsError`\n * still catches every 402.\n */\nexport class InsufficientCreditsError extends NodaroError {\n constructor(\n message = \"Insufficient credits\",\n public readonly required?: number,\n public readonly available?: number,\n code = \"insufficient_credits\",\n ) {\n super(message, code, 402)\n this.name = \"InsufficientCreditsError\"\n }\n}\n\n/** The 402 codes of a spending cap set by someone other than the caller. */\nexport type CreditCapCode = \"budget_exceeded\" | \"member_cap_exceeded\" | \"user_allowance_exceeded\"\n\n/**\n * The 402 codes {@link CreditCapExceededError} carries: the workspace's budget\n * (`budget_exceeded`), the caller's cap in that workspace\n * (`member_cap_exceeded`), the deployment's per-user allowance\n * (`user_allowance_exceeded`).\n */\nexport const CREDIT_CAP_CODES: ReadonlySet<CreditCapCode> = new Set<CreditCapCode>([\n \"budget_exceeded\",\n \"member_cap_exceeded\",\n \"user_allowance_exceeded\",\n])\n\n/**\n * HTTP 402 from a spending cap, not from the caller's own balance: topping up\n * does not help — whoever set the cap (the workspace's owner, the deployment's\n * operator) has to raise it. An {@link InsufficientCreditsError}, so existing\n * catches keep working; `code` says which cap. `available`, when sent, is what\n * the cap has left.\n */\nexport class CreditCapExceededError extends InsufficientCreditsError {\n declare readonly code: CreditCapCode\n\n constructor(code: CreditCapCode, message = \"A credit cap cannot cover this run\", required?: number, available?: number) {\n super(message, required, available, code)\n this.name = \"CreditCapExceededError\"\n }\n}\n\nexport class StorageExceededError extends NodaroError {\n constructor(message = \"Storage exceeded\", public readonly limitBytes?: number) {\n super(message, \"storage_exceeded\", 413)\n this.name = \"StorageExceededError\"\n }\n}\n\n/**\n * Optimistic-concurrency rejection (HTTP 409 `workflow_conflict`): the workflow\n * was written by another tab/device after the state carried in\n * `expectedUpdatedAt`/`expectedVersion` was read. `currentRecord` — when the\n * server includes it — is the full current workflow: merge your changes onto it\n * and retry with its fresh `updatedAt`, no follow-up GET needed.\n */\nexport class WorkflowConflictError extends NodaroError {\n constructor(\n message = \"Workflow was updated by another writer\",\n public readonly currentUpdatedAt?: string,\n public readonly currentVersion?: number,\n public readonly currentRecord?: Record<string, unknown>,\n /**\n * The wire code this conflict actually arrived with.\n *\n * `production_busy` is the studio production routes' own 409: the row\n * changed under a read-modify-write and the server exhausted its retries.\n * It is the same situation and the same remedy — re-read and apply again —\n * so it is the same ERROR, and a caller catching `WorkflowConflictError`\n * handles both. The code stays truthful because a caller that logs or\n * branches on it should see what the server said, not what the class is\n * usually called.\n */\n code: WorkflowConflictCode = \"workflow_conflict\",\n ) {\n super(message, code, 409)\n this.name = \"WorkflowConflictError\"\n }\n}\n\n/** The 409 codes that mean \"somebody else wrote first; re-read and retry\". */\nexport type WorkflowConflictCode = \"workflow_conflict\" | \"production_busy\"\n\n/**\n * A studio operation batch was refused, and the error names WHICH operation\n * (`opIndex`, zero-based) was wrong. Nothing in the batch was written: a batch\n * applies atomically or not at all, so fix that one operation and send the\n * whole batch again.\n *\n * Selected by SHAPE — any 4xx carrying a numeric `opIndex` — not by a list of\n * codes, so a new refusal reason (`op_invalid`, `op_target_missing`, whatever\n * the server adds next) reaches the caller as this error without an SDK\n * release. `code` is whatever the server sent.\n */\nexport class StudioOpError extends NodaroError {\n constructor(\n message: string,\n code: string,\n status: number,\n /** Zero-based index into the `ops` array that was sent. */\n public readonly opIndex: number,\n ) {\n super(message, code, status)\n this.name = \"StudioOpError\"\n }\n}\n\n/** The 409 codes whose answer names the job to turn to instead (a top-level `jobId`). */\nconst CONTINUATION_REFUSAL_CODES: ReadonlySet<string> = new Set([\n \"already_running\",\n \"continuation_superseded\",\n \"render_final_already_rendered\",\n])\n\n/**\n * A 409 that names the job to turn to instead: continuing a use-case run\n * (`client.edit.continueUseCase`) answers `already_running` (a continuation is\n * under way, or one that already completed — follow `jobId`),\n * `continuation_superseded` (a later continuation failed too — continue\n * `jobId` instead) or `render_final_already_rendered` (a Render final with this\n * very edit already completed — `jobId` holds the result). `code` and `status`\n * are what the server sent. Selected for exactly those three codes when the\n * answer carries a top-level `jobId`; every other 409 stays a plain\n * `NodaroError`.\n */\nexport class ContinuationRefusedError extends NodaroError {\n constructor(\n message: string,\n code: string,\n /** The job the refusal names. */\n public readonly jobId: string,\n ) {\n super(message, code, 409)\n this.name = \"ContinuationRefusedError\"\n }\n}\n\n/**\n * The one run that finishes a continuation held at a Preview review (the\n * `next` of {@link ContinuationPreviewPendingError}): pass these three fields\n * to `client.workflows.run`. It continues that execution, runs each held render\n * at Final and each held Tighten Episode continuing the run that made its\n * Preview, then every node after them.\n */\nexport interface HeldFinalRun {\n continueFromExecutionId: string\n /** The nodes it runs, in canvas order. */\n nodeIds: string[]\n /** For this run only: each held render at Final, each held use-case node's `useCaseContinue`. */\n inputOverrides: Record<string, Record<string, unknown>>\n}\n\n/**\n * HTTP 409 `continuation_preview_pending`: a continue-from-failed\n * (`client.workflows.run` with `continueMode: \"from-failed\"`) whose run's\n * newest later continuation completed by stopping at a Preview review, so\n * continuing again would stop there too. `executionId` is that continuation;\n * `renderNodeIds` the Apply EDL renders and `reviewNodeIds` the Tighten Episode\n * nodes holding it; `next` the run that finishes them — send it first\n * (`client.workflows.run(workflowId, error.next)`), then continue. Absent only\n * when the server could not name it. For a single held render, `next` is that\n * render's `client.workflows.renderFinal`.\n */\nexport class ContinuationPreviewPendingError extends NodaroError {\n constructor(\n message: string,\n public readonly executionId: string,\n public readonly renderNodeIds: readonly string[],\n public readonly reviewNodeIds: readonly string[],\n public readonly next?: HeldFinalRun,\n ) {\n super(message, \"continuation_preview_pending\", 409)\n this.name = \"ContinuationPreviewPendingError\"\n }\n}\n\nconst stringList = (v: unknown): string[] => (Array.isArray(v) ? v.filter((id): id is string => typeof id === \"string\") : [])\n\n/** A `next` as the server sends it, or undefined for anything else. */\nfunction heldFinalRunOf(v: unknown): HeldFinalRun | undefined {\n if (!v || typeof v !== \"object\") return undefined\n const r = v as Record<string, unknown>\n if (typeof r.continueFromExecutionId !== \"string\" || !Array.isArray(r.nodeIds)) return undefined\n if (!r.inputOverrides || typeof r.inputOverrides !== \"object\" || Array.isArray(r.inputOverrides)) return undefined\n return {\n continueFromExecutionId: r.continueFromExecutionId,\n nodeIds: stringList(r.nodeIds),\n inputOverrides: r.inputOverrides as Record<string, Record<string, unknown>>,\n }\n}\n\n/**\n * HTTP 409 `already_running` that names the execution under way (a top-level\n * `executionId`): the run you asked to start or continue is still running —\n * follow `executionId` (`client.executions.get`) instead of starting it again.\n * Sent by the workflow run route and by an app run's Retry\n * (`client.apps.resume`). An `already_running` that names a job instead stays\n * {@link ContinuationRefusedError}; one that names nothing, a plain\n * `NodaroError`.\n */\nexport class AlreadyRunningError extends NodaroError {\n constructor(\n message: string,\n /** The execution under way. */\n public readonly executionId: string,\n ) {\n super(message, \"already_running\", 409)\n this.name = \"AlreadyRunningError\"\n }\n}\n\n/**\n * HTTP 409 `app_run_version_changed`: a Retry of a failed app run\n * (`client.apps.resume`) refused because the app is on another version than\n * the one the run ran — continuing would mix them. `runVersion` is the run's\n * version, `appVersion` the one you are on (the `version` you sent, else the\n * app's latest). Start the run over (`client.apps.run`) to run `appVersion`,\n * or send `{ version: runVersion }` to continue on the run's own version.\n * Nothing was written or billed. Selected by code; the two numbers are\n * `undefined` when the answer does not carry them.\n */\nexport class AppRunVersionChangedError extends NodaroError {\n constructor(\n message: string,\n public readonly runVersion?: number,\n public readonly appVersion?: number,\n ) {\n super(message, \"app_run_version_changed\", 409)\n this.name = \"AppRunVersionChangedError\"\n }\n}\n\n/**\n * HTTP 422 `job_blocked`. A job policy registered by this deployment refused\n * the generation **before it ran** — no job was created, nothing was reserved\n * and nothing was charged. `message` is the policy's user-safe text: show it\n * as-is. Do not retry the identical request; whether the same input would be\n * judged differently is the deployment's policy's business.\n *\n * Only occurs on deployments that register a job policy. Selected by `code`,\n * not by status, the same way `workflow_conflict` narrows a 409 above — any\n * other 422 stays a plain `NodaroError`.\n */\nexport class JobBlockedError extends NodaroError {\n constructor(message = \"Blocked by this deployment's content policy\") {\n super(message, \"job_blocked\", 422)\n this.name = \"JobBlockedError\"\n }\n}\n\n/**\n * A job reached a terminal `failed`/`cancelled` status while being awaited by\n * `nodes.runAndWait` / `nodes.runMany`. Not an HTTP-level error (the polls\n * themselves succeeded), so `status` is 0 — distinguish it by type/`code`.\n * Carries the job's own `error_message` (as the message) and `jobId`.\n */\nexport class JobFailedError extends NodaroError {\n constructor(\n message: string,\n public readonly jobId: string,\n /** The terminal status that triggered the failure (`failed` | `cancelled`). */\n public readonly jobStatus: \"failed\" | \"cancelled\" = \"failed\",\n ) {\n super(message, \"job_failed\", 0)\n this.name = \"JobFailedError\"\n }\n}\n\n/**\n * `nodes.runAndWait` polled past its `maxMs` deadline without the job reaching\n * a terminal status. Not an HTTP error — `status` is 0; catch by type/`code`.\n */\nexport class JobTimeoutError extends NodaroError {\n constructor(\n message: string,\n public readonly jobId: string,\n /** The wall-clock deadline (ms) that was exceeded. */\n public readonly timeoutMs: number,\n ) {\n super(message, \"job_timeout\", 0)\n this.name = \"JobTimeoutError\"\n }\n}\n\n/**\n * The caller's `AbortSignal` fired while `nodes.runAndWait` was polling (or it\n * was already aborted on entry). Polling stops and this rejects. Not an HTTP\n * error — `status` is 0; catch by type/`code`.\n */\nexport class JobAbortedError extends NodaroError {\n constructor(message = \"Aborted\", public readonly jobId?: string) {\n super(message, \"job_aborted\", 0)\n this.name = \"JobAbortedError\"\n }\n}\n\n/**\n * A batch preview was asked for and this deployment cannot give one, so\n * NOTHING was sent: the batch is still unapplied and the production untouched.\n *\n * A preview is two requests because the route's body is parsed in strip mode —\n * a deployment that predates the preview silently DROPS the flag and APPLIES\n * the batch. So the SDK asks with an EMPTY batch first and sends the real one\n * only when that answer carries the `dryRun` marker. This is what it throws\n * when the answer does not: whatever the older deployment made of an empty\n * batch, the caller's batch never left.\n *\n * The remedy is a deployment that serves the preview — there is nothing to\n * retry here. To apply the batch instead, send it without the flag.\n *\n * A deployment that REFUSES the empty batch outright throws its own error\n * instead of this one, which is the right way round: the route's message says\n * more than \"unavailable\" does.\n *\n * Not an HTTP error: the request itself succeeded and answered the older shape.\n * `status` is 0; catch by type/`code`.\n */\nexport class StudioPreviewUnavailable extends NodaroError {\n constructor(\n message = \"This deployment does not preview operation batches; nothing was sent\",\n ) {\n super(message, \"studio_preview_unavailable\", 0)\n this.name = \"StudioPreviewUnavailable\"\n }\n}\n\n/**\n * A batch preview was asked for and the batch was APPLIED instead. The\n * production is written; this is the opposite of {@link\n * StudioPreviewUnavailable}, where nothing was sent.\n *\n * How it happens: the preview's proving ping and the batch are two requests,\n * and a fleet mid-rollout can serve them from different deployments. The ping\n * answers the marker, the batch reaches a deployment that predates the preview,\n * parses in strip mode, drops the flag and writes. The SDK cannot recall that\n * request — by the time the answer comes back the change has landed — so it\n * refuses to call the result a preview, which is the only thing still in its\n * gift. `receipts` and `warnings` are on both shapes, so an unchecked reply\n * would have shown a person what ALREADY happened under the heading of what\n * would.\n *\n * `applied` is what the route answered: the ordinary apply reply, whose\n * `production` and `version` are now the truth. Adopt them the way a plain\n * apply's caller does — do NOT re-send the batch, and do not present it for\n * approval.\n *\n * Not an HTTP error: the request succeeded, at the wrong thing. `status` is 0.\n */\nexport class StudioPreviewAppliedError extends NodaroError {\n constructor(\n /**\n * The apply reply the route sent back, as it sent it. An answer this\n * package does not recognise arrives here unchanged rather than being\n * dressed up: it is what the deployment said about a batch it took.\n *\n * `undefined` when the answer carried no body at all — a 204, an empty\n * envelope. The refusal still fires, because a non-preview answer is never\n * handed back as a preview, but there is nothing to report and the SDK will\n * not invent it: whether the batch was applied is unknown from here, and\n * the caller settles it by re-reading the production.\n */\n public readonly applied: StudioOpsResponse | undefined,\n message = applied\n ? \"Asked for a preview and this deployment APPLIED the batch; the change is written — see `applied`\"\n : \"Asked for a preview and this deployment answered with neither one nor a body to read; the batch may have been applied — re-read the production before deciding anything\",\n ) {\n super(message, \"studio_preview_applied\", 0)\n this.name = \"StudioPreviewAppliedError\"\n }\n}\n\n/**\n * The awaited job entered `pending_review`: a job policy registered by this\n * deployment held its output for a human reviewer. `pending_review` is\n * IN-FLIGHT, not terminal, so `nodes.runAndWait` / `nodes.runMany` end the\n * poll on the first tick they observe it rather than burning `maxMs` on a\n * status that no longer moves on its own.\n *\n * This does NOT cancel the job — the output exists, a human is reviewing it,\n * and the credit reservation stays `reserved` for the whole hold. Do not\n * re-run the request (a duplicate would be held too): re-fetch with\n * `jobs.get(jobId)` later, or surface \"awaiting review\" to your user and poll\n * `jobs.getStatus()` yourself. It resolves to `completed` (approved), `failed`\n * (rejected, with `error_hint.kind === \"policy-block\"`) or `cancelled`.\n *\n * Not an HTTP error — `status` is 0; catch by type/`code`.\n */\nexport class JobHeldError extends NodaroError {\n constructor(\n message: string,\n public readonly jobId: string,\n ) {\n super(message, \"job_held\", 0)\n this.name = \"JobHeldError\"\n }\n}\n\n/** The `{ error: { code, message, … } }` envelope every current route sends. */\ninterface ApiErrorEnvelope {\n code?: string\n message?: string\n missingScope?: string\n required?: number\n available?: number\n limitBytes?: number\n opIndex?: number\n [key: string]: unknown\n}\n\ninterface ApiErrorBody {\n /** The envelope — or, on an older route, a bare string (see {@link readErrorBody}). */\n error?: ApiErrorEnvelope | string\n /** A top-level message: an older route's, a bare validation answer's, or the server framework's own. */\n message?: unknown\n /** OAuth's human text (RFC 6749 §5.2), beside a bare-string `error`. */\n error_description?: unknown\n /** A bare validation answer's per-field issues (`{ message, issues }`). */\n issues?: unknown\n /** A refusal that names another job (see {@link ContinuationRefusedError}). */\n jobId?: unknown\n /** `continuation_preview_pending`: the held continuation, what holds it, and the run that finishes it. */\n executionId?: unknown\n renderNodeIds?: unknown\n reviewNodeIds?: unknown\n next?: unknown\n /** The credit guard's 402 sends its figures beside the envelope: what the run needs… */\n required?: unknown\n /** …and what the caller has (withheld on a deployment-paid instance). */\n balance?: unknown\n /** A per-user allowance's 402: what the allowance has left. */\n remaining?: unknown\n /** `app_run_version_changed`: the version the run ran, and the one the caller is on. */\n runVersion?: unknown\n appVersion?: unknown\n}\n\nconst finite = (v: unknown): number | undefined => (typeof v === \"number\" && Number.isFinite(v) ? v : undefined)\n\n/** A machine code as an older route writes it: lower snake_case, never a sentence or a reason phrase. */\nconst BARE_CODE = /^[a-z][a-z0-9_]*$/\n\nconst nonEmpty = (v: unknown): string | undefined => (typeof v === \"string\" && v.length > 0 ? v : undefined)\n\n/**\n * Where a body keeps its code and its human message. Most routes send the\n * envelope `{ error: { code, message } }`; three other shapes reach the SDK\n * too, and each is read for what it says rather than collapsed into\n * `internal_error` / \"Request failed\":\n *\n * - an older route's bare string, `{ error: \"<code>\", message?, … }` (character\n * training, a few profile and billing routes), and OAuth's\n * `{ error: \"<code>\", error_description }`. A snake_case string is the code;\n * a sentence (`\"Profile not found\"`) is the message.\n * - a bare validation answer, `{ message, issues: [...] }`: `validation_error`.\n * - the server framework's own answer, `{ statusCode, error: \"<reason phrase>\",\n * message }` (a route it does not have): the reason phrase is neither, the\n * message is kept — so \"no such route\" stays distinguishable from \"no such\n * resource\".\n *\n * At HTTP 500 and above only the CODE is read from outside the envelope. Text\n * there can be whatever the server failed with: the framework's own answer to\n * an uncaught throw is `{ statusCode: 500, error: \"Internal Server Error\",\n * message: <the raw error> }`, and the server's sanitizer rewrites only the\n * `internal_error` envelope. The envelope's own message is a route's chosen\n * sentence and is read at every status, as before.\n *\n * `message` is undefined when the body carries no human text it may show, so a\n * typed class keeps its own default (\"Not found\").\n */\nfunction readErrorBody(status: number, body: ApiErrorBody): { code: string | undefined; message: string | undefined; envelope: ApiErrorEnvelope } {\n const raw = body.error\n const envelope: ApiErrorEnvelope = raw && typeof raw === \"object\" ? raw : {}\n const bare = typeof raw === \"string\" ? raw : undefined\n const bareCode = bare !== undefined && BARE_CODE.test(bare) ? bare : undefined\n // Words with a space between them are human text: an older route's sentence,\n // or the framework's reason phrase — which always arrives with a real\n // `message`, read first. A single capitalised word (\"Unauthorized\") is a\n // reason phrase alone and says nothing the status does not.\n const bareSentence = bare !== undefined && bareCode === undefined && /\\s/.test(bare.trim()) ? bare : undefined\n const code =\n nonEmpty(envelope.code) ??\n bareCode ??\n (status === 400 && raw === undefined && Array.isArray(body.issues) ? \"validation_error\" : undefined)\n const outside = status >= 500 ? undefined : (nonEmpty(body.message) ?? nonEmpty(body.error_description) ?? bareSentence)\n const message = nonEmpty(envelope.message) ?? outside\n return { code, message, envelope }\n}\n\n/** The envelope's fields other than `code` and `message` (see {@link NodaroError.details}). */\nfunction envelopeDetails(envelope: ApiErrorEnvelope): Record<string, unknown> {\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(envelope)) {\n if (key !== \"code\" && key !== \"message\") out[key] = value\n }\n return out\n}\n\nexport function throwFromResponse(status: number, body: ApiErrorBody): never {\n try {\n selectError(status, body)\n } catch (err) {\n // Every class carries the envelope's other fields, whichever was chosen.\n if (err instanceof NodaroError) {\n const raw = body && typeof body === \"object\" ? body.error : undefined\n if (raw && typeof raw === \"object\") Object.defineProperty(err, \"details\", { value: envelopeDetails(raw), enumerable: true })\n }\n throw err\n }\n}\n\nfunction selectError(status: number, body: ApiErrorBody): never {\n // A body that is not an object (an empty answer, `null`, a bare string) still\n // throws by its status.\n const parsed: ApiErrorBody = body && typeof body === \"object\" ? body : {}\n const read = readErrorBody(status, parsed)\n const envelope = read.envelope\n const code = read.code ?? \"internal_error\"\n // A typed class falls back to its own default; a generic error to the code\n // it carries, which says more than \"Request failed\" does.\n const message = read.message ?? (read.code ? read.code : \"Request failed\")\n if (status === 401) throw new UnauthorizedError(read.message)\n if (status === 409 && (code === \"workflow_conflict\" || code === \"production_busy\")) {\n throw new WorkflowConflictError(\n read.message,\n envelope.currentUpdatedAt as string | undefined,\n envelope.currentVersion as number | undefined,\n envelope.currentRecord as Record<string, unknown> | undefined,\n code,\n )\n }\n // By shape, not by code — see StudioOpError. Only the studio operations route\n // sends an op index, so this cannot capture anyone else's 400.\n if (status >= 400 && status < 500 && typeof envelope.opIndex === \"number\") {\n throw new StudioOpError(message, code, status, envelope.opIndex)\n }\n if (status === 409 && CONTINUATION_REFUSAL_CODES.has(code) && typeof parsed.jobId === \"string\") {\n throw new ContinuationRefusedError(message, code, parsed.jobId)\n }\n if (status === 409 && code === \"continuation_preview_pending\" && typeof parsed.executionId === \"string\") {\n throw new ContinuationPreviewPendingError(\n message,\n parsed.executionId,\n stringList(parsed.renderNodeIds),\n stringList(parsed.reviewNodeIds),\n heldFinalRunOf(parsed.next),\n )\n }\n if (status === 409 && code === \"already_running\" && typeof parsed.executionId === \"string\") {\n throw new AlreadyRunningError(message, parsed.executionId)\n }\n if (status === 409 && code === \"app_run_version_changed\") {\n throw new AppRunVersionChangedError(message, finite(parsed.runVersion), finite(parsed.appVersion))\n }\n if (status === 422 && code === \"job_blocked\") throw new JobBlockedError(read.message)\n // The model, not the caller — before the scope line, so its own code is\n // kept (a plain ForbiddenError says \"forbidden\" whatever the server sent).\n const modelCode = read.code as ModelUnavailableCode | undefined\n if (status === 403 && modelCode !== undefined && MODEL_UNAVAILABLE_CODES.has(modelCode)) {\n throw new ModelUnavailableError(modelCode, read.message)\n }\n if (status === 403 && code === \"insufficient_scope\") {\n throw new ForbiddenError(read.message, envelope.missingScope)\n }\n if (status === 403) throw new ForbiddenError(read.message)\n // A 404 the framework answered itself (no route at that path) carries its\n // message at the top level, not under `error`; `readErrorBody` keeps it so\n // callers can tell \"no such route\" from \"no such resource\".\n if (status === 404) throw new NotFoundError(read.message)\n if (status === 429) throw new RateLimitedError(read.message)\n if (status === 402) {\n // The credit guard puts `required` / `balance` (an allowance: `remaining`)\n // beside the envelope; an envelope that carries them (`required` /\n // `available`) is read first.\n const required = finite(envelope.required) ?? finite(parsed.required)\n const available = finite(envelope.available) ?? finite(parsed.balance) ?? finite(parsed.remaining)\n const capCode = read.code as CreditCapCode | undefined\n if (capCode !== undefined && CREDIT_CAP_CODES.has(capCode)) {\n throw new CreditCapExceededError(capCode, read.message, required, available)\n }\n throw new InsufficientCreditsError(read.message, required, available, read.code ?? \"insufficient_credits\")\n }\n if (status === 413) throw new StorageExceededError(read.message, envelope.limitBytes)\n throw new NodaroError(message, code, status)\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources/uploads.ts"],"names":[],"mappings":";;;AA4BO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUpB,MAAM,OAAO,IAAA,EAAmC;AAC9C,IAAA,MAAM,IAAA,GAAO,IAAI,QAAA,EAAS;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,QAAQ,IAAI,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA;AAAA,MAC5B,MAAA;AAAA,MACA,YAAA;AAAA,MACA,EAAE,MAAM,IAAA;AAAK,KACf;AACA,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,IAAA,EAA+E;AACxF,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAA0B,MAAA,EAAQ,mBAAmB,EAAE,IAAA,EAAM,MAAM,CAAA;AAAA,EACxF;AACF","file":"chunk-JTOEHQQJ.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Result of a successful `POST /v1/upload`. Mirrors the route's `data` envelope\n * (`backend/src/routes/upload.ts`), the source of truth — keep in sync if that\n * response changes. The route also returns loosely-typed extracted `metadata`;\n * it is omitted here until a consumer needs a typed shape (add it shaped to\n * that need rather than inventing `Record<string, unknown>` surface now).\n */\nexport interface UploadResult {\n /** Public R2 URL of the stored asset (always present on success). */\n readonly url: string\n /** Storage row id; `null` when no asset row was written (e.g. unauthenticated). */\n readonly assetId: string | null\n /** Generated thumbnail URL (images/video); `null` for audio or on failure. */\n readonly thumbnailUrl: string | null\n /** Server-classified asset category (e.g. \"image\" | \"video\" | \"audio\"). */\n readonly category: string\n /** Display filename (server override or the original). */\n readonly filename: string\n /** Final MIME type after server normalization. */\n readonly mimeType: string\n /** Stored byte size. */\n readonly sizeBytes: number\n /** R2 object key. */\n readonly r2Key: string\n}\n\nexport class UploadsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Upload one file (`POST /v1/upload`, multipart — the file rides the `file`\n * field). The SDK's `request` detects the `FormData` body and lets the\n * runtime set the multipart boundary. Returns the persisted asset's public\n * URL + storage metadata (unwraps the `{ data }` envelope). Throws\n * `StorageExceededError` (413) over the storage cap and the SDK's other typed\n * errors on the usual statuses.\n */\n async upload(file: File): Promise<UploadResult> {\n const form = new FormData()\n form.append(\"file\", file)\n const res = await this.client.request<{ data: UploadResult }>(\n \"POST\",\n \"/v1/upload\",\n { body: form },\n )\n return res.data\n }\n\n /**\n * Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its\n * public URL — e.g. an image editor's design state, passed to\n * `client.jobs.fromUpload` as `editStateUrl` so the edit can be reopened.\n * The URL is unguessable but public: never store a secret in it. Creates no\n * library item.\n */\n uploadJson(json: Record<string, unknown> | readonly unknown[]): Promise<UploadJsonResult> {\n return this.client.request<UploadJsonResult>(\"POST\", \"/v1/upload-json\", { body: json })\n }\n}\n\n/** Result of {@link UploadsResource.uploadJson}. */\nexport interface UploadJsonResult {\n /** Public URL of the stored JSON document. */\n readonly url: string\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources/uploads.ts"],"names":[],"mappings":";AA4BO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUpB,MAAM,OAAO,IAAA,EAAmC;AAC9C,IAAA,MAAM,IAAA,GAAO,IAAI,QAAA,EAAS;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,QAAQ,IAAI,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA;AAAA,MAC5B,MAAA;AAAA,MACA,YAAA;AAAA,MACA,EAAE,MAAM,IAAA;AAAK,KACf;AACA,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,IAAA,EAA+E;AACxF,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAA0B,MAAA,EAAQ,mBAAmB,EAAE,IAAA,EAAM,MAAM,CAAA;AAAA,EACxF;AACF","file":"chunk-WY4QRJZW.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Result of a successful `POST /v1/upload`. Mirrors the route's `data` envelope\n * (`backend/src/routes/upload.ts`), the source of truth — keep in sync if that\n * response changes. The route also returns loosely-typed extracted `metadata`;\n * it is omitted here until a consumer needs a typed shape (add it shaped to\n * that need rather than inventing `Record<string, unknown>` surface now).\n */\nexport interface UploadResult {\n /** Public R2 URL of the stored asset (always present on success). */\n readonly url: string\n /** Storage row id; `null` when no asset row was written (e.g. unauthenticated). */\n readonly assetId: string | null\n /** Generated thumbnail URL (images/video); `null` for audio or on failure. */\n readonly thumbnailUrl: string | null\n /** Server-classified asset category (e.g. \"image\" | \"video\" | \"audio\"). */\n readonly category: string\n /** Display filename (server override or the original). */\n readonly filename: string\n /** Final MIME type after server normalization. */\n readonly mimeType: string\n /** Stored byte size. */\n readonly sizeBytes: number\n /** R2 object key. */\n readonly r2Key: string\n}\n\nexport class UploadsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Upload one file (`POST /v1/upload`, multipart — the file rides the `file`\n * field). The SDK's `request` detects the `FormData` body and lets the\n * runtime set the multipart boundary. Returns the persisted asset's public\n * URL + storage metadata (unwraps the `{ data }` envelope). Throws\n * `StorageExceededError` (413) over the storage cap and the SDK's other typed\n * errors on the usual statuses.\n */\n async upload(file: File): Promise<UploadResult> {\n const form = new FormData()\n form.append(\"file\", file)\n const res = await this.client.request<{ data: UploadResult }>(\n \"POST\",\n \"/v1/upload\",\n { body: form },\n )\n return res.data\n }\n\n /**\n * Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its\n * public URL — e.g. an image editor's design state, passed to\n * `client.jobs.fromUpload` as `editStateUrl` so the edit can be reopened.\n * The URL is unguessable but public: never store a secret in it. Creates no\n * library item.\n */\n uploadJson(json: Record<string, unknown> | readonly unknown[]): Promise<UploadJsonResult> {\n return this.client.request<UploadJsonResult>(\"POST\", \"/v1/upload-json\", { body: json })\n }\n}\n\n/** Result of {@link UploadsResource.uploadJson}. */\nexport interface UploadJsonResult {\n /** Public URL of the stored JSON document. */\n readonly url: string\n}\n"]}