@nodaro/sdk 2.27.0 → 2.28.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.cjs CHANGED
@@ -447,6 +447,65 @@ var ProjectsResource = class {
447
447
  }
448
448
  };
449
449
 
450
+ // src/resources/sessions.ts
451
+ var SessionsResource = class {
452
+ constructor(client) {
453
+ this.client = client;
454
+ }
455
+ client;
456
+ /**
457
+ * Create a session. Send its `id` as `sessionId` on a generation request
458
+ * (`nodes.run("generate-image", { sessionId, … })`, video, speech, music) and
459
+ * the job is born in it.
460
+ */
461
+ create(input) {
462
+ return this.client.request("POST", "/v1/sessions", { body: input });
463
+ }
464
+ /** Your sessions, newest first. */
465
+ list(params = {}) {
466
+ const query = {};
467
+ if (params.projectId) query.projectId = params.projectId;
468
+ if (params.tool) query.tool = params.tool;
469
+ if (params.includeArchived) query.includeArchived = "true";
470
+ if (params.limit !== void 0) query.limit = String(params.limit);
471
+ if (params.cursor) query.cursor = params.cursor;
472
+ return this.client.request("GET", "/v1/sessions", { query });
473
+ }
474
+ get(id) {
475
+ return this.client.request("GET", `/v1/sessions/${encodeURIComponent(id)}`);
476
+ }
477
+ /** Rename or archive a session. Its project cannot change. */
478
+ update(id, input) {
479
+ return this.client.request("PATCH", `/v1/sessions/${encodeURIComponent(id)}`, { body: input });
480
+ }
481
+ /** Delete a session and its links. Its jobs are kept, and stay in every other session holding them. */
482
+ delete(id) {
483
+ return this.client.request("DELETE", `/v1/sessions/${encodeURIComponent(id)}`);
484
+ }
485
+ /** The session's items, born-in and imported, newest first. */
486
+ items(id, params = {}) {
487
+ const query = {};
488
+ if (params.limit !== void 0) query.limit = String(params.limit);
489
+ if (params.cursor) query.cursor = params.cursor;
490
+ return this.client.request("GET", `/v1/sessions/${encodeURIComponent(id)}/items`, { query });
491
+ }
492
+ /**
493
+ * Import some of your own jobs into a session — a link, not a copy (up to 100
494
+ * a call). All-or-nothing: if any id is not one of your jobs, nothing is
495
+ * imported and the call fails with 404. Items already there are left as they are.
496
+ */
497
+ importItems(id, input) {
498
+ return this.client.request("POST", `/v1/sessions/${encodeURIComponent(id)}/items`, { body: input });
499
+ }
500
+ /** Remove one item from a session. Only the link goes: the job, and every other session holding it, stay. */
501
+ removeItem(id, jobId) {
502
+ return this.client.request(
503
+ "DELETE",
504
+ `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`
505
+ );
506
+ }
507
+ };
508
+
450
509
  // src/resources/jobs.ts
451
510
  var JobsResource = class {
452
511
  constructor(client) {
@@ -4175,7 +4234,7 @@ var EditResource = class {
4175
4234
  return edl.remapTranscriptThroughEdl(edl$1, transcript);
4176
4235
  }
4177
4236
  };
4178
- var SDK_VERSION = "2.27.0" ;
4237
+ var SDK_VERSION = "2.28.0" ;
4179
4238
  var CLIENT_HEADER = "X-Nodaro-Client";
4180
4239
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
4181
4240
  var NodaroClient = class _NodaroClient {
@@ -4198,6 +4257,8 @@ var NodaroClient = class _NodaroClient {
4198
4257
  }
4199
4258
  workflows;
4200
4259
  projects;
4260
+ /** Generation sessions inside projects (Create Image / Video / Music). */
4261
+ sessions;
4201
4262
  jobs;
4202
4263
  videoPro;
4203
4264
  executions;
@@ -4249,6 +4310,7 @@ var NodaroClient = class _NodaroClient {
4249
4310
  this.sendClientHeader = opts.clientLabel !== void 0 || !isBrowser();
4250
4311
  this.workflows = new WorkflowsResource(this);
4251
4312
  this.projects = new ProjectsResource(this);
4313
+ this.sessions = new SessionsResource(this);
4252
4314
  this.jobs = new JobsResource(this);
4253
4315
  this.videoPro = new VideoProResource(this);
4254
4316
  this.executions = new ExecutionsResource(this);
@@ -4591,6 +4653,7 @@ exports.ReduceResource = ReduceResource;
4591
4653
  exports.SCENE3D_DELIVERY_ASSET_USAGE = SCENE3D_DELIVERY_ASSET_USAGE;
4592
4654
  exports.SavedPostsResource = SavedPostsResource;
4593
4655
  exports.Scene3DResource = Scene3DResource;
4656
+ exports.SessionsResource = SessionsResource;
4594
4657
  exports.ShotsResource = ShotsResource;
4595
4658
  exports.StaticTokenAuth = StaticTokenAuth;
4596
4659
  exports.StorageExceededError = StorageExceededError;