@nodaro/sdk 1.19.0 → 1.22.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
@@ -124,11 +124,50 @@ function throwFromResponse(status, body) {
124
124
  }
125
125
 
126
126
  // src/resources/workflows.ts
127
+ var WorkflowCollaboratorsResource = class {
128
+ constructor(client) {
129
+ this.client = client;
130
+ }
131
+ client;
132
+ /** List a workflow's collaborators (id, name, avatar, role — never email). */
133
+ list(workflowId) {
134
+ return this.client.request(
135
+ "GET",
136
+ `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators`
137
+ );
138
+ }
139
+ /** Add a collaborator by `userId` OR `email` (exactly one), at the given role. */
140
+ add(workflowId, input) {
141
+ return this.client.request(
142
+ "POST",
143
+ `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators`,
144
+ { body: input }
145
+ );
146
+ }
147
+ /** Change a collaborator's role. */
148
+ update(workflowId, userId, input) {
149
+ return this.client.request(
150
+ "PATCH",
151
+ `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators/${encodeURIComponent(userId)}`,
152
+ { body: input }
153
+ );
154
+ }
155
+ /** Remove a collaborator — or yourself. Returns `{ success: true }`. */
156
+ remove(workflowId, userId) {
157
+ return this.client.request(
158
+ "DELETE",
159
+ `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators/${encodeURIComponent(userId)}`
160
+ );
161
+ }
162
+ };
127
163
  var WorkflowsResource = class {
128
164
  constructor(client) {
129
165
  this.client = client;
166
+ this.collaborators = new WorkflowCollaboratorsResource(client);
130
167
  }
131
168
  client;
169
+ /** The people this workflow is shared with. See {@link WorkflowCollaboratorsResource}. */
170
+ collaborators;
132
171
  /** List workflows for a project. Returns metadata only — `nodes`/`edges` are not included. */
133
172
  list(params) {
134
173
  return this.client.request(
@@ -210,6 +249,37 @@ var WorkflowsResource = class {
210
249
  body: { projectId, workflow_json: workflowJson }
211
250
  });
212
251
  }
252
+ /**
253
+ * Set a workflow's visibility — `"private"` (creator + explicit collaborators)
254
+ * or `"workspace"` (everyone in its workspace). Only the creator or a workspace
255
+ * admin may change it; anyone else gets HTTP 403. Thin wrapper over `update()`:
256
+ * the visibility lever lives on `PATCH /v1/workflows/:id`.
257
+ */
258
+ setVisibility(id, visibility) {
259
+ return this.client.request("PATCH", `/v1/workflows/${encodeURIComponent(id)}`, {
260
+ body: { visibility }
261
+ });
262
+ }
263
+ /**
264
+ * Move a workflow to another project (`POST /v1/workflows/:id/move`); its folder
265
+ * is cleared. When the move takes the workflow out of a workspace, collaborator
266
+ * grants that came from that workspace are dropped and returned as
267
+ * `droppedCollaborators`.
268
+ */
269
+ move(id, params) {
270
+ return this.client.request("POST", `/v1/workflows/${encodeURIComponent(id)}/move`, {
271
+ body: params
272
+ });
273
+ }
274
+ /**
275
+ * Workflows other people shared with you (`GET /v1/workflows/shared-with-me`) —
276
+ * grants on work that is NOT in a workspace you belong to (workspace work already
277
+ * shows in that workspace's own lists). Each carries the `grantedRole` you hold.
278
+ * Empty when the organizations feature is off server-side.
279
+ */
280
+ sharedWithMe() {
281
+ return this.client.request("GET", "/v1/workflows/shared-with-me");
282
+ }
213
283
  };
214
284
 
215
285
  // src/resources/projects.ts
@@ -762,6 +832,8 @@ var LocationsResource = class {
762
832
  list(params = {}) {
763
833
  const query = {};
764
834
  if (params.archived) query.archived = "true";
835
+ if (params.limit !== void 0) query.limit = String(params.limit);
836
+ if (params.cursor) query.cursor = params.cursor;
765
837
  return this.client.request("GET", "/v1/locations", { query });
766
838
  }
767
839
  /**
@@ -939,6 +1011,8 @@ var ObjectsResource = class {
939
1011
  const query = {};
940
1012
  if (params.archived) query.archived = "true";
941
1013
  if (params.projectId) query.projectId = params.projectId;
1014
+ if (params.limit !== void 0) query.limit = String(params.limit);
1015
+ if (params.cursor) query.cursor = params.cursor;
942
1016
  return this.client.request("GET", "/v1/objects", { query });
943
1017
  }
944
1018
  /**
@@ -1123,6 +1197,8 @@ var CreaturesResource = class {
1123
1197
  const query = {};
1124
1198
  if (params.archived) query.archived = "true";
1125
1199
  if (params.projectId) query.projectId = params.projectId;
1200
+ if (params.limit !== void 0) query.limit = String(params.limit);
1201
+ if (params.cursor) query.cursor = params.cursor;
1126
1202
  return this.client.request("GET", "/v1/creatures", { query });
1127
1203
  }
1128
1204
  /**
@@ -1786,7 +1862,13 @@ var MediaResource = class {
1786
1862
  * gives per-image RELATIVE size hints for the smart layout: `0` auto
1787
1863
  * ("don't care", default), `1` big (~2× linear vs medium), `2` medium,
1788
1864
  * `3` small (~½ linear). All-equal hints change nothing; grid ignores them.
1789
- * Poll `jobs.get(jobId)` for the finished image.
1865
+ * For storyboards, set `numbered` to stamp a 1-based sequence badge at each
1866
+ * image's corner (top-left by default; `badgePosition: "top-right"` moves it;
1867
+ * in `imageUrls` order) and pass `imageLabels`
1868
+ * (index-aligned with `imageUrls`; `null`/`""`/omitted = no caption for that
1869
+ * image) to caption images after the number, e.g. `3 · Close-up`. Badges are
1870
+ * an overlay only — they never change the layout, the output size or the
1871
+ * credit cost. Poll `jobs.get(jobId)` for the finished image.
1790
1872
  */
1791
1873
  imageCollage(input) {
1792
1874
  return this.client.request("POST", "/v1/image-collage", { body: input });
@@ -2051,6 +2133,20 @@ var PickerCatalogsResource = class {
2051
2133
  }
2052
2134
  };
2053
2135
 
2136
+ // src/resources/catalogs.ts
2137
+ var CatalogsResource = class {
2138
+ constructor(client) {
2139
+ this.client = client;
2140
+ }
2141
+ client;
2142
+ /** Every catalog, projected & pack-composed (honors the deployment's
2143
+ * registered vendored packs). Cached publicly 5 min. */
2144
+ list(opts = {}) {
2145
+ const qs = opts.detail ? `?detail=${opts.detail}` : "";
2146
+ return this.client.request("GET", `/v1/catalogs${qs}`);
2147
+ }
2148
+ };
2149
+
2054
2150
  // src/resources/models.ts
2055
2151
  var ModelsResource = class {
2056
2152
  constructor(client) {
@@ -2518,7 +2614,7 @@ var WorkspacesResource = class {
2518
2614
  return this.client.request("POST", "/v1/workspaces/join", { body: { code } });
2519
2615
  }
2520
2616
  };
2521
- var SDK_VERSION = "1.19.0" ;
2617
+ var SDK_VERSION = "1.22.0" ;
2522
2618
  var CLIENT_HEADER = "X-Nodaro-Client";
2523
2619
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
2524
2620
  var NodaroClient = class _NodaroClient {
@@ -2563,6 +2659,7 @@ var NodaroClient = class _NodaroClient {
2563
2659
  library;
2564
2660
  presets;
2565
2661
  pickerCatalogs;
2662
+ catalogs;
2566
2663
  models;
2567
2664
  shots;
2568
2665
  recast;
@@ -2605,6 +2702,7 @@ var NodaroClient = class _NodaroClient {
2605
2702
  this.library = new LibraryResource(this);
2606
2703
  this.presets = new PresetsResource(this);
2607
2704
  this.pickerCatalogs = new PickerCatalogsResource(this);
2705
+ this.catalogs = new CatalogsResource(this);
2608
2706
  this.models = new ModelsResource(this);
2609
2707
  this.shots = new ShotsResource(this);
2610
2708
  this.recast = new RecastResource(this);
@@ -2813,6 +2911,7 @@ exports.AppsResource = AppsResource;
2813
2911
  exports.AudioResource = AudioResource;
2814
2912
  exports.CREATURE_ASSET_TYPES = CREATURE_ASSET_TYPES;
2815
2913
  exports.CallbackAuth = CallbackAuth;
2914
+ exports.CatalogsResource = CatalogsResource;
2816
2915
  exports.CharactersResource = CharactersResource;
2817
2916
  exports.CommunityResource = CommunityResource;
2818
2917
  exports.CreaturesResource = CreaturesResource;