@nodaro/sdk 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2543,7 +2543,7 @@ var RecastResource = class {
2543
2543
  }
2544
2544
  };
2545
2545
 
2546
- // src/resources/studio.ts
2546
+ // src/resources/studio-productions.ts
2547
2547
  function isStudioGenerateEstimate(result) {
2548
2548
  return result.dryRun === true;
2549
2549
  }
@@ -2775,11 +2775,80 @@ var StudioProductionsResource = class {
2775
2775
  return res.data.production;
2776
2776
  }
2777
2777
  };
2778
+
2779
+ // src/resources/studio.ts
2780
+ var root = "/v1/studio/productions";
2781
+ var path = (id) => `${root}/${encodeURIComponent(id)}`;
2778
2782
  var StudioResource = class {
2779
- productions;
2780
2783
  constructor(client) {
2784
+ this.client = client;
2781
2785
  this.productions = new StudioProductionsResource(client);
2782
2786
  }
2787
+ client;
2788
+ productions;
2789
+ capabilities() {
2790
+ return this.client.request("GET", `${root}/capabilities`);
2791
+ }
2792
+ skill() {
2793
+ return this.client.request("GET", `${root}/skill`);
2794
+ }
2795
+ list(options = {}) {
2796
+ return this.client.request("GET", root, { query: options });
2797
+ }
2798
+ get(id, options = {}) {
2799
+ return this.client.request("GET", path(id), { query: { detail: options.detail, shot_id: options.shotId } });
2800
+ }
2801
+ validatePlan(plan) {
2802
+ return this.client.request("POST", `${root}/validate`, { body: { plan } });
2803
+ }
2804
+ create(input) {
2805
+ return this.client.request("POST", root, { body: input });
2806
+ }
2807
+ /** Import a portable document through the compatible server writer.
2808
+ * Retained frame media requires an authorized source; acceptance never transfers. */
2809
+ importBundle(input) {
2810
+ return this.client.request("POST", `${root}/import-bundle`, { body: input });
2811
+ }
2812
+ /** Append a bundle's scenes and frame closure under an exact destination revision. */
2813
+ appendBundle(id, input) {
2814
+ return this.client.request("POST", `${path(id)}/import-bundle`, { body: input });
2815
+ }
2816
+ /** Copy a saved production. Linked copies retain verified inputs, remap
2817
+ * dependencies and require fresh frame acceptance; they start no media jobs. */
2818
+ clone(id, input = {}) {
2819
+ return this.client.request("POST", `${path(id)}/clone`, { body: input });
2820
+ }
2821
+ edit(id, input) {
2822
+ return this.client.request("POST", `${path(id)}/ops`, { body: input });
2823
+ }
2824
+ /** Audience-authorized sharing; an expected revision prevents publication
2825
+ * of concurrent edits the caller has not reviewed. */
2826
+ setShared(id, input) {
2827
+ return this.client.request("POST", `${path(id)}/share`, { body: input });
2828
+ }
2829
+ /** Save ordinary editor fields against the loaded revision. Protected frame
2830
+ * and job state can only change through their dedicated semantic actions. */
2831
+ saveEditorState(id, input) {
2832
+ return this.edit(id, {
2833
+ baseVersion: input.expectedVersion,
2834
+ strict: true,
2835
+ ...input.clientRequestId ? { clientRequestId: input.clientRequestId } : {},
2836
+ ops: [{ op: "save_editor_state", expectedVersion: input.expectedVersion, graph: input.graph }]
2837
+ });
2838
+ }
2839
+ generateKeyframe(id, input) {
2840
+ return this.client.request("POST", `${path(id)}/generate`, { body: { ...input, kind: "keyframe" } });
2841
+ }
2842
+ generateShot(id, input) {
2843
+ return this.client.request("POST", `${path(id)}/generate`, { body: input });
2844
+ }
2845
+ /** A separate explicit review action; generation never calls this method. */
2846
+ acceptKeyframe(id, input, concurrency = {}) {
2847
+ return this.edit(id, { ...concurrency, ops: [{ ...input, op: "accept_keyframe_result" }] });
2848
+ }
2849
+ reconcile(id) {
2850
+ return this.client.request("POST", `${path(id)}/reconcile`, { body: {} });
2851
+ }
2783
2852
  };
2784
2853
 
2785
2854
  // src/resources/community.ts
@@ -3163,7 +3232,7 @@ var WorkspacesResource = class {
3163
3232
  return this.client.requestText("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, format: "csv" } });
3164
3233
  }
3165
3234
  };
3166
- var SDK_VERSION = "2.2.0" ;
3235
+ var SDK_VERSION = "2.4.0" ;
3167
3236
  var CLIENT_HEADER = "X-Nodaro-Client";
3168
3237
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
3169
3238
  var NodaroClient = class _NodaroClient {
@@ -3295,8 +3364,8 @@ var NodaroClient = class _NodaroClient {
3295
3364
  * stalled CSV stream aborts, it does not hang forever). Both the JSON path
3296
3365
  * ({@link request}) and the text path ({@link requestText}) go through here.
3297
3366
  */
3298
- async send(method, path, options, read) {
3299
- const url = this.buildUrl(path, options.query);
3367
+ async send(method, path2, options, read) {
3368
+ const url = this.buildUrl(path2, options.query);
3300
3369
  const token = await this.auth.getToken();
3301
3370
  const isFormData = typeof FormData !== "undefined" && options.body instanceof FormData;
3302
3371
  const headers = {
@@ -3336,14 +3405,14 @@ var NodaroClient = class _NodaroClient {
3336
3405
  }
3337
3406
  }
3338
3407
  /** Authenticated, bounded binary reads through the normal timeout/error transport. */
3339
- async requestBytes(method, path, options) {
3408
+ async requestBytes(method, path2, options) {
3340
3409
  if (!Number.isSafeInteger(options.maxBytes) || options.maxBytes < 1) throw new Error("maxBytes must be a positive integer");
3341
- return this.send(method, path, options, (response) => readBinaryResponse(response, options.maxBytes));
3410
+ return this.send(method, path2, options, (response) => readBinaryResponse(response, options.maxBytes));
3342
3411
  }
3343
- async request(method, path, options = {}) {
3412
+ async request(method, path2, options = {}) {
3344
3413
  return this.send(
3345
3414
  method,
3346
- path,
3415
+ path2,
3347
3416
  options,
3348
3417
  async (res) => (
3349
3418
  // 204 No Content
@@ -3356,8 +3425,8 @@ var NodaroClient = class _NodaroClient {
3356
3425
  * are still the JSON envelope and throw the same typed errors, and the read is
3357
3426
  * bounded by the same timeout as the request.
3358
3427
  */
3359
- async requestText(method, path, options = {}) {
3360
- return this.send(method, path, options, (res) => res.text());
3428
+ async requestText(method, path2, options = {}) {
3429
+ return this.send(method, path2, options, (res) => res.text());
3361
3430
  }
3362
3431
  /**
3363
3432
  * `GET /v1/me` → the authenticated user's identity (see {@link UserIdentity}).
@@ -3376,9 +3445,9 @@ var NodaroClient = class _NodaroClient {
3376
3445
  const res = await this.request("GET", "/v1/me");
3377
3446
  return res.data;
3378
3447
  }
3379
- buildUrl(path, query) {
3448
+ buildUrl(path2, query) {
3380
3449
  const base = this.baseUrl || (typeof window !== "undefined" ? window.location.origin : "http://placeholder");
3381
- const url = new URL(path, base);
3450
+ const url = new URL(path2, base);
3382
3451
  const fullUrl = this.baseUrl ? url.toString() : url.pathname + url.search;
3383
3452
  if (query) {
3384
3453
  const u = new URL(this.baseUrl ? fullUrl : fullUrl, base);