@nodaro/sdk 1.19.0 → 1.20.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 +94 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +183 -3
- package/dist/index.d.ts +183 -3
- package/dist/index.js +94 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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
|
/**
|
|
@@ -2051,6 +2127,20 @@ var PickerCatalogsResource = class {
|
|
|
2051
2127
|
}
|
|
2052
2128
|
};
|
|
2053
2129
|
|
|
2130
|
+
// src/resources/catalogs.ts
|
|
2131
|
+
var CatalogsResource = class {
|
|
2132
|
+
constructor(client) {
|
|
2133
|
+
this.client = client;
|
|
2134
|
+
}
|
|
2135
|
+
client;
|
|
2136
|
+
/** Every catalog, projected & pack-composed (honors the deployment's
|
|
2137
|
+
* registered vendored packs). Cached publicly 5 min. */
|
|
2138
|
+
list(opts = {}) {
|
|
2139
|
+
const qs = opts.detail ? `?detail=${opts.detail}` : "";
|
|
2140
|
+
return this.client.request("GET", `/v1/catalogs${qs}`);
|
|
2141
|
+
}
|
|
2142
|
+
};
|
|
2143
|
+
|
|
2054
2144
|
// src/resources/models.ts
|
|
2055
2145
|
var ModelsResource = class {
|
|
2056
2146
|
constructor(client) {
|
|
@@ -2518,7 +2608,7 @@ var WorkspacesResource = class {
|
|
|
2518
2608
|
return this.client.request("POST", "/v1/workspaces/join", { body: { code } });
|
|
2519
2609
|
}
|
|
2520
2610
|
};
|
|
2521
|
-
var SDK_VERSION = "1.
|
|
2611
|
+
var SDK_VERSION = "1.20.0" ;
|
|
2522
2612
|
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
2523
2613
|
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
2524
2614
|
var NodaroClient = class _NodaroClient {
|
|
@@ -2563,6 +2653,7 @@ var NodaroClient = class _NodaroClient {
|
|
|
2563
2653
|
library;
|
|
2564
2654
|
presets;
|
|
2565
2655
|
pickerCatalogs;
|
|
2656
|
+
catalogs;
|
|
2566
2657
|
models;
|
|
2567
2658
|
shots;
|
|
2568
2659
|
recast;
|
|
@@ -2605,6 +2696,7 @@ var NodaroClient = class _NodaroClient {
|
|
|
2605
2696
|
this.library = new LibraryResource(this);
|
|
2606
2697
|
this.presets = new PresetsResource(this);
|
|
2607
2698
|
this.pickerCatalogs = new PickerCatalogsResource(this);
|
|
2699
|
+
this.catalogs = new CatalogsResource(this);
|
|
2608
2700
|
this.models = new ModelsResource(this);
|
|
2609
2701
|
this.shots = new ShotsResource(this);
|
|
2610
2702
|
this.recast = new RecastResource(this);
|
|
@@ -2813,6 +2905,7 @@ exports.AppsResource = AppsResource;
|
|
|
2813
2905
|
exports.AudioResource = AudioResource;
|
|
2814
2906
|
exports.CREATURE_ASSET_TYPES = CREATURE_ASSET_TYPES;
|
|
2815
2907
|
exports.CallbackAuth = CallbackAuth;
|
|
2908
|
+
exports.CatalogsResource = CatalogsResource;
|
|
2816
2909
|
exports.CharactersResource = CharactersResource;
|
|
2817
2910
|
exports.CommunityResource = CommunityResource;
|
|
2818
2911
|
exports.CreaturesResource = CreaturesResource;
|