@nvisy/sdk 0.4.0 → 0.5.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/CHANGELOG.md +29 -1
- package/README.md +0 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/{client-yLrhST0r.d.ts → client-DAxwkjk3.d.ts} +137 -147
- package/dist/client-DAxwkjk3.d.ts.map +1 -0
- package/dist/datatypes/index.d.ts +2 -2
- package/dist/{index-Cmm2g3SG.d.ts → index-DfNB2LNT.d.ts} +564 -1409
- package/dist/index-DfNB2LNT.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +2 -2
- package/dist/{services-Dh0FMDzU.js → services-DXP-jsLt.js} +298 -251
- package/dist/services-DXP-jsLt.js.map +1 -0
- package/package.json +3 -3
- package/dist/client-yLrhST0r.d.ts.map +0 -1
- package/dist/index-Cmm2g3SG.d.ts.map +0 -1
- package/dist/services-Dh0FMDzU.js.map +0 -1
|
@@ -34,6 +34,16 @@ var Account = class {
|
|
|
34
34
|
async deleteAccount() {
|
|
35
35
|
await this.#api.DELETE("/account/");
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Get a public account profile by username
|
|
39
|
+
* @param username - Account username
|
|
40
|
+
* @returns Promise that resolves with the public account details
|
|
41
|
+
* @throws {ApiError} if the request fails
|
|
42
|
+
*/
|
|
43
|
+
async getPublicAccount(username) {
|
|
44
|
+
const { data } = await this.#api.GET("/accounts/{username}/", { params: { path: { username } } });
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
37
47
|
};
|
|
38
48
|
|
|
39
49
|
//#endregion
|
|
@@ -48,14 +58,14 @@ var Activities = class {
|
|
|
48
58
|
}
|
|
49
59
|
/**
|
|
50
60
|
* List activities for a workspace
|
|
51
|
-
* @param
|
|
61
|
+
* @param workspaceSlug - Workspace slug
|
|
52
62
|
* @param query - Optional pagination parameters (limit, after)
|
|
53
63
|
* @returns Promise that resolves with a paginated list of activities
|
|
54
64
|
* @throws {ApiError} if the request fails
|
|
55
65
|
*/
|
|
56
|
-
async listActivities(
|
|
57
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
58
|
-
path: {
|
|
66
|
+
async listActivities(workspaceSlug, query) {
|
|
67
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/activities/", { params: {
|
|
68
|
+
path: { workspaceSlug },
|
|
59
69
|
query
|
|
60
70
|
} });
|
|
61
71
|
return data;
|
|
@@ -179,137 +189,76 @@ var Connections = class {
|
|
|
179
189
|
}
|
|
180
190
|
/**
|
|
181
191
|
* List connections in a workspace
|
|
182
|
-
* @param
|
|
192
|
+
* @param workspaceSlug - Workspace slug
|
|
183
193
|
* @param query - Optional query parameters (provider, limit, after)
|
|
184
194
|
* @returns Promise that resolves with a paginated list of connections
|
|
185
195
|
* @throws {ApiError} if the request fails
|
|
186
196
|
*/
|
|
187
|
-
async listConnections(
|
|
188
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
189
|
-
path: {
|
|
197
|
+
async listConnections(workspaceSlug, query) {
|
|
198
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/connections/", { params: {
|
|
199
|
+
path: { workspaceSlug },
|
|
190
200
|
query
|
|
191
201
|
} });
|
|
192
202
|
return data;
|
|
193
203
|
}
|
|
194
204
|
/**
|
|
195
205
|
* Create a connection in a workspace
|
|
196
|
-
* @param
|
|
206
|
+
* @param workspaceSlug - Workspace slug
|
|
197
207
|
* @param connection - Connection creation request
|
|
198
208
|
* @returns Promise that resolves with the created connection
|
|
199
209
|
* @throws {ApiError} if the request fails
|
|
200
210
|
*/
|
|
201
|
-
async createConnection(
|
|
202
|
-
const { data } = await this.#api.POST("/workspaces/{
|
|
203
|
-
params: { path: {
|
|
211
|
+
async createConnection(workspaceSlug, connection) {
|
|
212
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/connections/", {
|
|
213
|
+
params: { path: { workspaceSlug } },
|
|
204
214
|
body: connection
|
|
205
215
|
});
|
|
206
216
|
return data;
|
|
207
217
|
}
|
|
208
218
|
/**
|
|
209
219
|
* Get connection details by ID
|
|
220
|
+
* @param workspaceSlug - Workspace slug
|
|
210
221
|
* @param connectionId - Connection ID
|
|
211
222
|
* @returns Promise that resolves with the connection details
|
|
212
223
|
* @throws {ApiError} if the request fails
|
|
213
224
|
*/
|
|
214
|
-
async getConnection(connectionId) {
|
|
215
|
-
const { data } = await this.#api.GET("/connections/{connectionId}/", { params: { path: {
|
|
225
|
+
async getConnection(workspaceSlug, connectionId) {
|
|
226
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/connections/{connectionId}/", { params: { path: {
|
|
227
|
+
workspaceSlug,
|
|
228
|
+
connectionId
|
|
229
|
+
} } });
|
|
216
230
|
return data;
|
|
217
231
|
}
|
|
218
232
|
/**
|
|
219
233
|
* Update a connection
|
|
234
|
+
* @param workspaceSlug - Workspace slug
|
|
220
235
|
* @param connectionId - Connection ID
|
|
221
236
|
* @param updates - Connection update request
|
|
222
237
|
* @returns Promise that resolves with the updated connection
|
|
223
238
|
* @throws {ApiError} if the request fails
|
|
224
239
|
*/
|
|
225
|
-
async updateConnection(connectionId, updates) {
|
|
226
|
-
const { data } = await this.#api.PUT("/connections/{connectionId}/", {
|
|
227
|
-
params: { path: {
|
|
240
|
+
async updateConnection(workspaceSlug, connectionId, updates) {
|
|
241
|
+
const { data } = await this.#api.PUT("/workspaces/{workspaceSlug}/connections/{connectionId}/", {
|
|
242
|
+
params: { path: {
|
|
243
|
+
workspaceSlug,
|
|
244
|
+
connectionId
|
|
245
|
+
} },
|
|
228
246
|
body: updates
|
|
229
247
|
});
|
|
230
248
|
return data;
|
|
231
249
|
}
|
|
232
250
|
/**
|
|
233
251
|
* Delete a connection
|
|
252
|
+
* @param workspaceSlug - Workspace slug
|
|
234
253
|
* @param connectionId - Connection ID
|
|
235
254
|
* @returns Promise that resolves when the connection is deleted
|
|
236
255
|
* @throws {ApiError} if the request fails
|
|
237
256
|
*/
|
|
238
|
-
async deleteConnection(connectionId) {
|
|
239
|
-
await this.#api.DELETE("/connections/{connectionId}/", { params: { path: {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region src/services/contexts.ts
|
|
245
|
-
/**
|
|
246
|
-
* Service for handling context operations
|
|
247
|
-
*/
|
|
248
|
-
var Contexts = class {
|
|
249
|
-
#api;
|
|
250
|
-
constructor(api) {
|
|
251
|
-
this.#api = api;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* List contexts in a workspace
|
|
255
|
-
* @param workspaceId - Workspace ID
|
|
256
|
-
* @param query - Optional pagination parameters (limit, after)
|
|
257
|
-
* @returns Promise that resolves with a paginated list of contexts
|
|
258
|
-
* @throws {ApiError} if the request fails
|
|
259
|
-
*/
|
|
260
|
-
async listContexts(workspaceId, query) {
|
|
261
|
-
const { data } = await this.#api.GET("/workspaces/{workspaceId}/contexts/", { params: {
|
|
262
|
-
path: { workspaceId },
|
|
263
|
-
query
|
|
264
|
-
} });
|
|
265
|
-
return data;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Create a context in a workspace
|
|
269
|
-
* @param workspaceId - Workspace ID
|
|
270
|
-
* @param context - Context creation request
|
|
271
|
-
* @returns Promise that resolves with the created context
|
|
272
|
-
* @throws {ApiError} if the request fails
|
|
273
|
-
*/
|
|
274
|
-
async createContext(workspaceId, context) {
|
|
275
|
-
const { data } = await this.#api.POST("/workspaces/{workspaceId}/contexts/", {
|
|
276
|
-
params: { path: { workspaceId } },
|
|
277
|
-
body: context
|
|
278
|
-
});
|
|
279
|
-
return data;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Get context details by ID
|
|
283
|
-
* @param contextId - Context ID
|
|
284
|
-
* @returns Promise that resolves with the context details
|
|
285
|
-
* @throws {ApiError} if the request fails
|
|
286
|
-
*/
|
|
287
|
-
async getContext(contextId) {
|
|
288
|
-
const { data } = await this.#api.GET("/contexts/{contextId}/", { params: { path: { contextId } } });
|
|
289
|
-
return data;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Update a context
|
|
293
|
-
* @param contextId - Context ID
|
|
294
|
-
* @param updates - Context update request
|
|
295
|
-
* @returns Promise that resolves with the updated context
|
|
296
|
-
* @throws {ApiError} if the request fails
|
|
297
|
-
*/
|
|
298
|
-
async updateContext(contextId, updates) {
|
|
299
|
-
const { data } = await this.#api.PUT("/contexts/{contextId}/", {
|
|
300
|
-
params: { path: { contextId } },
|
|
301
|
-
body: updates
|
|
302
|
-
});
|
|
303
|
-
return data;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Delete a context
|
|
307
|
-
* @param contextId - Context ID
|
|
308
|
-
* @returns Promise that resolves when the context is deleted
|
|
309
|
-
* @throws {ApiError} if the request fails
|
|
310
|
-
*/
|
|
311
|
-
async deleteContext(contextId) {
|
|
312
|
-
await this.#api.DELETE("/contexts/{contextId}/", { params: { path: { contextId } } });
|
|
257
|
+
async deleteConnection(workspaceSlug, connectionId) {
|
|
258
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/connections/{connectionId}/", { params: { path: {
|
|
259
|
+
workspaceSlug,
|
|
260
|
+
connectionId
|
|
261
|
+
} } });
|
|
313
262
|
}
|
|
314
263
|
};
|
|
315
264
|
|
|
@@ -325,20 +274,20 @@ var Files = class {
|
|
|
325
274
|
}
|
|
326
275
|
/**
|
|
327
276
|
* Upload one or more files to a workspace
|
|
328
|
-
* @param
|
|
277
|
+
* @param workspaceSlug - Workspace slug
|
|
329
278
|
* @param files - File or array of files to upload
|
|
330
279
|
* @returns Promise that resolves with the uploaded file metadata
|
|
331
280
|
* @throws {ApiError} if the request fails
|
|
332
281
|
*/
|
|
333
|
-
async uploadFiles(
|
|
282
|
+
async uploadFiles(workspaceSlug, files) {
|
|
334
283
|
const formData = new FormData();
|
|
335
284
|
const fileArray = Array.isArray(files) ? files : [files];
|
|
336
285
|
for (const file of fileArray) {
|
|
337
286
|
const name = file instanceof File ? file.name : "file";
|
|
338
287
|
formData.append("files", file, name);
|
|
339
288
|
}
|
|
340
|
-
const { data } = await this.#api.POST("/workspaces/{
|
|
341
|
-
params: { path: {
|
|
289
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/files/", {
|
|
290
|
+
params: { path: { workspaceSlug } },
|
|
342
291
|
body: formData,
|
|
343
292
|
bodySerializer: (formData) => formData,
|
|
344
293
|
headers: { "Content-Type": null }
|
|
@@ -347,63 +296,79 @@ var Files = class {
|
|
|
347
296
|
}
|
|
348
297
|
/**
|
|
349
298
|
* List files in a workspace
|
|
350
|
-
* @param
|
|
299
|
+
* @param workspaceSlug - Workspace slug
|
|
351
300
|
* @param query - Optional query parameters (formats, search, limit, after)
|
|
352
301
|
* @returns Promise that resolves with a paginated list of files
|
|
353
302
|
* @throws {ApiError} if the request fails
|
|
354
303
|
*/
|
|
355
|
-
async listFiles(
|
|
356
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
357
|
-
path: {
|
|
304
|
+
async listFiles(workspaceSlug, query) {
|
|
305
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/files/", { params: {
|
|
306
|
+
path: { workspaceSlug },
|
|
358
307
|
query
|
|
359
308
|
} });
|
|
360
309
|
return data;
|
|
361
310
|
}
|
|
362
311
|
/**
|
|
363
312
|
* Get file metadata by ID
|
|
313
|
+
* @param workspaceSlug - Workspace slug
|
|
364
314
|
* @param fileId - File ID
|
|
365
315
|
* @returns Promise that resolves with the file metadata
|
|
366
316
|
* @throws {ApiError} if the request fails
|
|
367
317
|
*/
|
|
368
|
-
async getFile(fileId) {
|
|
369
|
-
const { data } = await this.#api.GET("/files/{fileId}/", { params: { path: {
|
|
318
|
+
async getFile(workspaceSlug, fileId) {
|
|
319
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/files/{fileId}/", { params: { path: {
|
|
320
|
+
workspaceSlug,
|
|
321
|
+
fileId
|
|
322
|
+
} } });
|
|
370
323
|
return data;
|
|
371
324
|
}
|
|
372
325
|
/**
|
|
373
326
|
* Download a file by ID
|
|
327
|
+
* @param workspaceSlug - Workspace slug
|
|
374
328
|
* @param fileId - File ID
|
|
375
329
|
* @returns Promise that resolves with the file response
|
|
376
330
|
* @throws {ApiError} if the request fails
|
|
377
331
|
*/
|
|
378
|
-
async downloadFile(fileId) {
|
|
379
|
-
const { response } = await this.#api.GET("/files/{fileId}/content/", {
|
|
380
|
-
params: { path: {
|
|
332
|
+
async downloadFile(workspaceSlug, fileId) {
|
|
333
|
+
const { response } = await this.#api.GET("/workspaces/{workspaceSlug}/files/{fileId}/content/", {
|
|
334
|
+
params: { path: {
|
|
335
|
+
workspaceSlug,
|
|
336
|
+
fileId
|
|
337
|
+
} },
|
|
381
338
|
parseAs: "stream"
|
|
382
339
|
});
|
|
383
340
|
return response;
|
|
384
341
|
}
|
|
385
342
|
/**
|
|
386
343
|
* Update a file's metadata
|
|
344
|
+
* @param workspaceSlug - Workspace slug
|
|
387
345
|
* @param fileId - File ID
|
|
388
346
|
* @param updates - File update request
|
|
389
347
|
* @returns Promise that resolves with the updated file
|
|
390
348
|
* @throws {ApiError} if the request fails
|
|
391
349
|
*/
|
|
392
|
-
async updateFile(fileId, updates) {
|
|
393
|
-
const { data } = await this.#api.PATCH("/files/{fileId}/", {
|
|
394
|
-
params: { path: {
|
|
350
|
+
async updateFile(workspaceSlug, fileId, updates) {
|
|
351
|
+
const { data } = await this.#api.PATCH("/workspaces/{workspaceSlug}/files/{fileId}/", {
|
|
352
|
+
params: { path: {
|
|
353
|
+
workspaceSlug,
|
|
354
|
+
fileId
|
|
355
|
+
} },
|
|
395
356
|
body: updates
|
|
396
357
|
});
|
|
397
358
|
return data;
|
|
398
359
|
}
|
|
399
360
|
/**
|
|
400
361
|
* Delete a file
|
|
362
|
+
* @param workspaceSlug - Workspace slug
|
|
401
363
|
* @param fileId - File ID
|
|
402
364
|
* @returns Promise that resolves when the file is deleted
|
|
403
365
|
* @throws {ApiError} if the request fails
|
|
404
366
|
*/
|
|
405
|
-
async deleteFile(fileId) {
|
|
406
|
-
await this.#api.DELETE("/files/{fileId}/", { params: { path: {
|
|
367
|
+
async deleteFile(workspaceSlug, fileId) {
|
|
368
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/files/{fileId}/", { params: { path: {
|
|
369
|
+
workspaceSlug,
|
|
370
|
+
fileId
|
|
371
|
+
} } });
|
|
407
372
|
}
|
|
408
373
|
};
|
|
409
374
|
|
|
@@ -424,60 +389,68 @@ var Invites = class {
|
|
|
424
389
|
* @returns Promise that resolves with a paginated list of invitations
|
|
425
390
|
* @throws {ApiError} if the request fails
|
|
426
391
|
*/
|
|
427
|
-
async listInvites(
|
|
428
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
429
|
-
path: {
|
|
392
|
+
async listInvites(workspaceSlug, query) {
|
|
393
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/invites/", { params: {
|
|
394
|
+
path: { workspaceSlug },
|
|
430
395
|
query
|
|
431
396
|
} });
|
|
432
397
|
return data;
|
|
433
398
|
}
|
|
434
399
|
/**
|
|
435
400
|
* Send an invitation to join a workspace
|
|
436
|
-
* @param
|
|
401
|
+
* @param workspaceSlug - Workspace slug
|
|
437
402
|
* @param invite - Invitation request
|
|
438
|
-
* @returns Promise that resolves with the
|
|
403
|
+
* @returns Promise that resolves with the sent invitation
|
|
439
404
|
* @throws {ApiError} if the request fails
|
|
440
405
|
*/
|
|
441
|
-
async sendInvite(
|
|
442
|
-
const { data } = await this.#api.POST("/workspaces/{
|
|
443
|
-
params: { path: {
|
|
406
|
+
async sendInvite(workspaceSlug, invite) {
|
|
407
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/invites/", {
|
|
408
|
+
params: { path: { workspaceSlug } },
|
|
444
409
|
body: invite
|
|
445
410
|
});
|
|
446
411
|
return data;
|
|
447
412
|
}
|
|
448
413
|
/**
|
|
449
414
|
* Cancel a pending invitation
|
|
415
|
+
* @param workspaceSlug - Workspace slug
|
|
450
416
|
* @param inviteId - Invite ID
|
|
451
417
|
* @returns Promise that resolves when the invitation is canceled
|
|
452
418
|
* @throws {ApiError} if the request fails
|
|
453
419
|
*/
|
|
454
|
-
async cancelInvite(inviteId) {
|
|
455
|
-
await this.#api.DELETE("/invites/{inviteId}/", { params: { path: {
|
|
420
|
+
async cancelInvite(workspaceSlug, inviteId) {
|
|
421
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/invites/{inviteId}/", { params: { path: {
|
|
422
|
+
workspaceSlug,
|
|
423
|
+
inviteId
|
|
424
|
+
} } });
|
|
456
425
|
}
|
|
457
426
|
/**
|
|
458
427
|
* Reply to an invitation (accept or decline)
|
|
428
|
+
* @param workspaceSlug - Workspace slug
|
|
459
429
|
* @param inviteId - Invite ID
|
|
460
430
|
* @param reply - Reply request
|
|
461
431
|
* @returns Promise that resolves with the updated invitation
|
|
462
432
|
* @throws {ApiError} if the request fails
|
|
463
433
|
*/
|
|
464
|
-
async replyToInvite(inviteId, reply) {
|
|
465
|
-
const { data } = await this.#api.POST("/invites/{inviteId}/", {
|
|
466
|
-
params: { path: {
|
|
434
|
+
async replyToInvite(workspaceSlug, inviteId, reply) {
|
|
435
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/invites/{inviteId}/", {
|
|
436
|
+
params: { path: {
|
|
437
|
+
workspaceSlug,
|
|
438
|
+
inviteId
|
|
439
|
+
} },
|
|
467
440
|
body: reply
|
|
468
441
|
});
|
|
469
442
|
return data;
|
|
470
443
|
}
|
|
471
444
|
/**
|
|
472
445
|
* Generate a shareable invite code for a workspace
|
|
473
|
-
* @param
|
|
446
|
+
* @param workspaceSlug - Workspace slug
|
|
474
447
|
* @param options - Invite code generation options
|
|
475
448
|
* @returns Promise that resolves with the generated invite code
|
|
476
449
|
* @throws {ApiError} if the request fails
|
|
477
450
|
*/
|
|
478
|
-
async generateInviteCode(
|
|
479
|
-
const { data } = await this.#api.POST("/workspaces/{
|
|
480
|
-
params: { path: {
|
|
451
|
+
async generateInviteCode(workspaceSlug, options) {
|
|
452
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/invites/code/", {
|
|
453
|
+
params: { path: { workspaceSlug } },
|
|
481
454
|
body: options
|
|
482
455
|
});
|
|
483
456
|
return data;
|
|
@@ -520,45 +493,45 @@ var Members = class {
|
|
|
520
493
|
}
|
|
521
494
|
/**
|
|
522
495
|
* List members of a workspace
|
|
523
|
-
* @param
|
|
496
|
+
* @param workspaceSlug - Workspace slug
|
|
524
497
|
* @param query - Optional query parameters (role, has2fa, sortBy, order, limit, after)
|
|
525
498
|
* @returns Promise that resolves with a paginated list of members
|
|
526
499
|
* @throws {ApiError} if the request fails
|
|
527
500
|
*/
|
|
528
|
-
async listMembers(
|
|
529
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
530
|
-
path: {
|
|
501
|
+
async listMembers(workspaceSlug, query) {
|
|
502
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/members/", { params: {
|
|
503
|
+
path: { workspaceSlug },
|
|
531
504
|
query
|
|
532
505
|
} });
|
|
533
506
|
return data;
|
|
534
507
|
}
|
|
535
508
|
/**
|
|
536
|
-
* Get member details by
|
|
537
|
-
* @param
|
|
538
|
-
* @param
|
|
509
|
+
* Get member details by username
|
|
510
|
+
* @param workspaceSlug - Workspace slug
|
|
511
|
+
* @param username - Member username
|
|
539
512
|
* @returns Promise that resolves with the member details
|
|
540
513
|
* @throws {ApiError} if the request fails
|
|
541
514
|
*/
|
|
542
|
-
async getMember(
|
|
543
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
544
|
-
|
|
545
|
-
|
|
515
|
+
async getMember(workspaceSlug, username) {
|
|
516
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/members/{username}/", { params: { path: {
|
|
517
|
+
workspaceSlug,
|
|
518
|
+
username
|
|
546
519
|
} } });
|
|
547
520
|
return data;
|
|
548
521
|
}
|
|
549
522
|
/**
|
|
550
523
|
* Update a member's role
|
|
551
|
-
* @param
|
|
552
|
-
* @param
|
|
524
|
+
* @param workspaceSlug - Workspace slug
|
|
525
|
+
* @param username - Member username
|
|
553
526
|
* @param updates - New role for the member
|
|
554
527
|
* @returns Promise that resolves with the updated member
|
|
555
528
|
* @throws {ApiError} if the request fails
|
|
556
529
|
*/
|
|
557
|
-
async updateMember(
|
|
558
|
-
const { data } = await this.#api.PATCH("/workspaces/{
|
|
530
|
+
async updateMember(workspaceSlug, username, updates) {
|
|
531
|
+
const { data } = await this.#api.PATCH("/workspaces/{workspaceSlug}/members/{username}/", {
|
|
559
532
|
params: { path: {
|
|
560
|
-
|
|
561
|
-
|
|
533
|
+
workspaceSlug,
|
|
534
|
+
username
|
|
562
535
|
} },
|
|
563
536
|
body: updates
|
|
564
537
|
});
|
|
@@ -566,25 +539,25 @@ var Members = class {
|
|
|
566
539
|
}
|
|
567
540
|
/**
|
|
568
541
|
* Remove a member from a workspace
|
|
569
|
-
* @param
|
|
570
|
-
* @param
|
|
542
|
+
* @param workspaceSlug - Workspace slug
|
|
543
|
+
* @param username - Member username
|
|
571
544
|
* @returns Promise that resolves when the member is removed
|
|
572
545
|
* @throws {ApiError} if the request fails
|
|
573
546
|
*/
|
|
574
|
-
async removeMember(
|
|
575
|
-
await this.#api.DELETE("/workspaces/{
|
|
576
|
-
|
|
577
|
-
|
|
547
|
+
async removeMember(workspaceSlug, username) {
|
|
548
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/members/{username}/", { params: { path: {
|
|
549
|
+
workspaceSlug,
|
|
550
|
+
username
|
|
578
551
|
} } });
|
|
579
552
|
}
|
|
580
553
|
/**
|
|
581
554
|
* Leave a workspace
|
|
582
|
-
* @param
|
|
555
|
+
* @param workspaceSlug - Workspace slug
|
|
583
556
|
* @returns Promise that resolves when the member has left
|
|
584
557
|
* @throws {ApiError} if the request fails
|
|
585
558
|
*/
|
|
586
|
-
async leaveWorkspace(
|
|
587
|
-
await this.#api.POST("/workspaces/{
|
|
559
|
+
async leaveWorkspace(workspaceSlug) {
|
|
560
|
+
await this.#api.POST("/workspaces/{workspaceSlug}/members/leave/", { params: { path: { workspaceSlug } } });
|
|
588
561
|
}
|
|
589
562
|
};
|
|
590
563
|
|
|
@@ -631,64 +604,76 @@ var Pipelines = class {
|
|
|
631
604
|
}
|
|
632
605
|
/**
|
|
633
606
|
* List pipelines in a workspace
|
|
634
|
-
* @param
|
|
607
|
+
* @param workspaceSlug - Workspace slug
|
|
635
608
|
* @param query - Optional query parameters (search, status, limit, after)
|
|
636
609
|
* @returns Promise that resolves with a paginated list of pipeline summaries
|
|
637
610
|
* @throws {ApiError} if the request fails
|
|
638
611
|
*/
|
|
639
|
-
async listPipelines(
|
|
640
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
641
|
-
path: {
|
|
612
|
+
async listPipelines(workspaceSlug, query) {
|
|
613
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/pipelines/", { params: {
|
|
614
|
+
path: { workspaceSlug },
|
|
642
615
|
query
|
|
643
616
|
} });
|
|
644
617
|
return data;
|
|
645
618
|
}
|
|
646
619
|
/**
|
|
647
620
|
* Create a pipeline in a workspace
|
|
648
|
-
* @param
|
|
621
|
+
* @param workspaceSlug - Workspace slug
|
|
649
622
|
* @param pipeline - Pipeline creation request
|
|
650
623
|
* @returns Promise that resolves with the created pipeline
|
|
651
624
|
* @throws {ApiError} if the request fails
|
|
652
625
|
*/
|
|
653
|
-
async createPipeline(
|
|
654
|
-
const { data } = await this.#api.POST("/workspaces/{
|
|
655
|
-
params: { path: {
|
|
626
|
+
async createPipeline(workspaceSlug, pipeline) {
|
|
627
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/pipelines/", {
|
|
628
|
+
params: { path: { workspaceSlug } },
|
|
656
629
|
body: pipeline
|
|
657
630
|
});
|
|
658
631
|
return data;
|
|
659
632
|
}
|
|
660
633
|
/**
|
|
661
|
-
* Get pipeline details by
|
|
662
|
-
* @param
|
|
634
|
+
* Get pipeline details by slug
|
|
635
|
+
* @param workspaceSlug - Workspace slug
|
|
636
|
+
* @param pipelineSlug - Pipeline slug
|
|
663
637
|
* @returns Promise that resolves with the pipeline details
|
|
664
638
|
* @throws {ApiError} if the request fails
|
|
665
639
|
*/
|
|
666
|
-
async getPipeline(
|
|
667
|
-
const { data } = await this.#api.GET("/pipelines/{
|
|
640
|
+
async getPipeline(workspaceSlug, pipelineSlug) {
|
|
641
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/pipelines/{pipelineSlug}/", { params: { path: {
|
|
642
|
+
workspaceSlug,
|
|
643
|
+
pipelineSlug
|
|
644
|
+
} } });
|
|
668
645
|
return data;
|
|
669
646
|
}
|
|
670
647
|
/**
|
|
671
648
|
* Update a pipeline
|
|
672
|
-
* @param
|
|
649
|
+
* @param workspaceSlug - Workspace slug
|
|
650
|
+
* @param pipelineSlug - Pipeline slug
|
|
673
651
|
* @param updates - Pipeline update request
|
|
674
652
|
* @returns Promise that resolves with the updated pipeline
|
|
675
653
|
* @throws {ApiError} if the request fails
|
|
676
654
|
*/
|
|
677
|
-
async updatePipeline(
|
|
678
|
-
const { data } = await this.#api.PATCH("/pipelines/{
|
|
679
|
-
params: { path: {
|
|
655
|
+
async updatePipeline(workspaceSlug, pipelineSlug, updates) {
|
|
656
|
+
const { data } = await this.#api.PATCH("/workspaces/{workspaceSlug}/pipelines/{pipelineSlug}/", {
|
|
657
|
+
params: { path: {
|
|
658
|
+
workspaceSlug,
|
|
659
|
+
pipelineSlug
|
|
660
|
+
} },
|
|
680
661
|
body: updates
|
|
681
662
|
});
|
|
682
663
|
return data;
|
|
683
664
|
}
|
|
684
665
|
/**
|
|
685
666
|
* Delete a pipeline
|
|
686
|
-
* @param
|
|
667
|
+
* @param workspaceSlug - Workspace slug
|
|
668
|
+
* @param pipelineSlug - Pipeline slug
|
|
687
669
|
* @returns Promise that resolves when the pipeline is deleted
|
|
688
670
|
* @throws {ApiError} if the request fails
|
|
689
671
|
*/
|
|
690
|
-
async deletePipeline(
|
|
691
|
-
await this.#api.DELETE("/pipelines/{
|
|
672
|
+
async deletePipeline(workspaceSlug, pipelineSlug) {
|
|
673
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/pipelines/{pipelineSlug}/", { params: { path: {
|
|
674
|
+
workspaceSlug,
|
|
675
|
+
pipelineSlug
|
|
676
|
+
} } });
|
|
692
677
|
}
|
|
693
678
|
};
|
|
694
679
|
|
|
@@ -704,64 +689,76 @@ var Policies = class {
|
|
|
704
689
|
}
|
|
705
690
|
/**
|
|
706
691
|
* List policies in a workspace
|
|
707
|
-
* @param
|
|
692
|
+
* @param workspaceSlug - Workspace slug
|
|
708
693
|
* @param query - Optional pagination parameters (limit, after)
|
|
709
694
|
* @returns Promise that resolves with a paginated list of policies
|
|
710
695
|
* @throws {ApiError} if the request fails
|
|
711
696
|
*/
|
|
712
|
-
async listPolicies(
|
|
713
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
714
|
-
path: {
|
|
697
|
+
async listPolicies(workspaceSlug, query) {
|
|
698
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/policies/", { params: {
|
|
699
|
+
path: { workspaceSlug },
|
|
715
700
|
query
|
|
716
701
|
} });
|
|
717
702
|
return data;
|
|
718
703
|
}
|
|
719
704
|
/**
|
|
720
705
|
* Create a policy in a workspace
|
|
721
|
-
* @param
|
|
706
|
+
* @param workspaceSlug - Workspace slug
|
|
722
707
|
* @param policy - Policy creation request
|
|
723
708
|
* @returns Promise that resolves with the created policy
|
|
724
709
|
* @throws {ApiError} if the request fails
|
|
725
710
|
*/
|
|
726
|
-
async createPolicy(
|
|
727
|
-
const { data } = await this.#api.POST("/workspaces/{
|
|
728
|
-
params: { path: {
|
|
711
|
+
async createPolicy(workspaceSlug, policy) {
|
|
712
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/policies/", {
|
|
713
|
+
params: { path: { workspaceSlug } },
|
|
729
714
|
body: policy
|
|
730
715
|
});
|
|
731
716
|
return data;
|
|
732
717
|
}
|
|
733
718
|
/**
|
|
734
|
-
* Get policy details by
|
|
735
|
-
* @param
|
|
719
|
+
* Get policy details by slug
|
|
720
|
+
* @param workspaceSlug - Workspace slug
|
|
721
|
+
* @param policySlug - Policy slug
|
|
736
722
|
* @returns Promise that resolves with the policy details
|
|
737
723
|
* @throws {ApiError} if the request fails
|
|
738
724
|
*/
|
|
739
|
-
async getPolicy(
|
|
740
|
-
const { data } = await this.#api.GET("/policies/{
|
|
725
|
+
async getPolicy(workspaceSlug, policySlug) {
|
|
726
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/policies/{policySlug}/", { params: { path: {
|
|
727
|
+
workspaceSlug,
|
|
728
|
+
policySlug
|
|
729
|
+
} } });
|
|
741
730
|
return data;
|
|
742
731
|
}
|
|
743
732
|
/**
|
|
744
733
|
* Update a policy
|
|
745
|
-
* @param
|
|
734
|
+
* @param workspaceSlug - Workspace slug
|
|
735
|
+
* @param policySlug - Policy slug
|
|
746
736
|
* @param updates - Policy update request
|
|
747
737
|
* @returns Promise that resolves with the updated policy
|
|
748
738
|
* @throws {ApiError} if the request fails
|
|
749
739
|
*/
|
|
750
|
-
async updatePolicy(
|
|
751
|
-
const { data } = await this.#api.PUT("/policies/{
|
|
752
|
-
params: { path: {
|
|
740
|
+
async updatePolicy(workspaceSlug, policySlug, updates) {
|
|
741
|
+
const { data } = await this.#api.PUT("/workspaces/{workspaceSlug}/policies/{policySlug}/", {
|
|
742
|
+
params: { path: {
|
|
743
|
+
workspaceSlug,
|
|
744
|
+
policySlug
|
|
745
|
+
} },
|
|
753
746
|
body: updates
|
|
754
747
|
});
|
|
755
748
|
return data;
|
|
756
749
|
}
|
|
757
750
|
/**
|
|
758
751
|
* Delete a policy
|
|
759
|
-
* @param
|
|
752
|
+
* @param workspaceSlug - Workspace slug
|
|
753
|
+
* @param policySlug - Policy slug
|
|
760
754
|
* @returns Promise that resolves when the policy is deleted
|
|
761
755
|
* @throws {ApiError} if the request fails
|
|
762
756
|
*/
|
|
763
|
-
async deletePolicy(
|
|
764
|
-
await this.#api.DELETE("/policies/{
|
|
757
|
+
async deletePolicy(workspaceSlug, policySlug) {
|
|
758
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/policies/{policySlug}/", { params: { path: {
|
|
759
|
+
workspaceSlug,
|
|
760
|
+
policySlug
|
|
761
|
+
} } });
|
|
765
762
|
}
|
|
766
763
|
};
|
|
767
764
|
|
|
@@ -776,61 +773,95 @@ var Runs = class {
|
|
|
776
773
|
this.#api = api;
|
|
777
774
|
}
|
|
778
775
|
/**
|
|
779
|
-
* List runs
|
|
780
|
-
* @param
|
|
776
|
+
* List all pipeline runs in a workspace
|
|
777
|
+
* @param workspaceSlug - Workspace slug
|
|
778
|
+
* @param query - Optional query parameters (status, limit, after)
|
|
779
|
+
* @returns Promise that resolves with a paginated list of pipeline runs
|
|
780
|
+
* @throws {ApiError} if the request fails
|
|
781
|
+
*/
|
|
782
|
+
async listRuns(workspaceSlug, query) {
|
|
783
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/pipelines/runs/", { params: {
|
|
784
|
+
path: { workspaceSlug },
|
|
785
|
+
query
|
|
786
|
+
} });
|
|
787
|
+
return data;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* List runs for a specific pipeline
|
|
791
|
+
* @param workspaceSlug - Workspace slug
|
|
792
|
+
* @param pipelineSlug - Pipeline slug
|
|
781
793
|
* @param query - Optional pagination parameters (limit, after)
|
|
782
794
|
* @returns Promise that resolves with a paginated list of pipeline runs
|
|
783
795
|
* @throws {ApiError} if the request fails
|
|
784
796
|
*/
|
|
785
|
-
async
|
|
786
|
-
const { data } = await this.#api.GET("/pipelines/{
|
|
787
|
-
path: {
|
|
797
|
+
async listPipelineRuns(workspaceSlug, pipelineSlug, query) {
|
|
798
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/pipelines/{pipelineSlug}/runs/", { params: {
|
|
799
|
+
path: {
|
|
800
|
+
workspaceSlug,
|
|
801
|
+
pipelineSlug
|
|
802
|
+
},
|
|
788
803
|
query
|
|
789
804
|
} });
|
|
790
805
|
return data;
|
|
791
806
|
}
|
|
792
807
|
/**
|
|
793
808
|
* Trigger a new run for a pipeline
|
|
794
|
-
* @param
|
|
809
|
+
* @param workspaceSlug - Workspace slug
|
|
810
|
+
* @param pipelineSlug - Pipeline slug
|
|
795
811
|
* @param run - Pipeline run creation request
|
|
796
812
|
* @returns Promise that resolves with the created pipeline run
|
|
797
813
|
* @throws {ApiError} if the request fails
|
|
798
814
|
*/
|
|
799
|
-
async createRun(
|
|
800
|
-
const { data } = await this.#api.POST("/pipelines/{
|
|
801
|
-
params: { path: {
|
|
815
|
+
async createRun(workspaceSlug, pipelineSlug, run) {
|
|
816
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/pipelines/{pipelineSlug}/runs/", {
|
|
817
|
+
params: { path: {
|
|
818
|
+
workspaceSlug,
|
|
819
|
+
pipelineSlug
|
|
820
|
+
} },
|
|
802
821
|
body: run
|
|
803
822
|
});
|
|
804
823
|
return data;
|
|
805
824
|
}
|
|
806
825
|
/**
|
|
807
826
|
* Get pipeline run details by ID
|
|
827
|
+
* @param workspaceSlug - Workspace slug
|
|
808
828
|
* @param runId - Run ID
|
|
809
829
|
* @returns Promise that resolves with the pipeline run details
|
|
810
830
|
* @throws {ApiError} if the request fails
|
|
811
831
|
*/
|
|
812
|
-
async getRun(runId) {
|
|
813
|
-
const { data } = await this.#api.GET("/runs/{runId}/", { params: { path: {
|
|
832
|
+
async getRun(workspaceSlug, runId) {
|
|
833
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/runs/{runId}/", { params: { path: {
|
|
834
|
+
workspaceSlug,
|
|
835
|
+
runId
|
|
836
|
+
} } });
|
|
814
837
|
return data;
|
|
815
838
|
}
|
|
816
839
|
/**
|
|
817
840
|
* Get the detections (analyzed document) for a pipeline run
|
|
841
|
+
* @param workspaceSlug - Workspace slug
|
|
818
842
|
* @param runId - Run ID
|
|
819
843
|
* @returns Promise that resolves with the analyzed document
|
|
820
844
|
* @throws {ApiError} if the request fails
|
|
821
845
|
*/
|
|
822
|
-
async getDetections(runId) {
|
|
823
|
-
const { data } = await this.#api.GET("/runs/{runId}/detections/", { params: { path: {
|
|
846
|
+
async getDetections(workspaceSlug, runId) {
|
|
847
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/runs/{runId}/detections/", { params: { path: {
|
|
848
|
+
workspaceSlug,
|
|
849
|
+
runId
|
|
850
|
+
} } });
|
|
824
851
|
return data;
|
|
825
852
|
}
|
|
826
853
|
/**
|
|
827
854
|
* Apply redactions to a pipeline run
|
|
855
|
+
* @param workspaceSlug - Workspace slug
|
|
828
856
|
* @param runId - Run ID
|
|
829
857
|
* @returns Promise that resolves with the updated pipeline run
|
|
830
858
|
* @throws {ApiError} if the request fails
|
|
831
859
|
*/
|
|
832
|
-
async redact(runId) {
|
|
833
|
-
const { data } = await this.#api.POST("/runs/{runId}/redactions/", { params: { path: {
|
|
860
|
+
async redact(workspaceSlug, runId) {
|
|
861
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/runs/{runId}/redactions/", { params: { path: {
|
|
862
|
+
workspaceSlug,
|
|
863
|
+
runId
|
|
864
|
+
} } });
|
|
834
865
|
return data;
|
|
835
866
|
}
|
|
836
867
|
};
|
|
@@ -871,75 +902,91 @@ var Webhooks = class {
|
|
|
871
902
|
}
|
|
872
903
|
/**
|
|
873
904
|
* List all webhooks in a workspace
|
|
874
|
-
* @param
|
|
905
|
+
* @param workspaceSlug - Workspace slug
|
|
875
906
|
* @param query - Optional pagination parameters (limit, after)
|
|
876
907
|
* @returns Promise that resolves with a paginated list of webhooks
|
|
877
908
|
* @throws {ApiError} if the request fails
|
|
878
909
|
*/
|
|
879
|
-
async listWebhooks(
|
|
880
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
881
|
-
path: {
|
|
910
|
+
async listWebhooks(workspaceSlug, query) {
|
|
911
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/webhooks/", { params: {
|
|
912
|
+
path: { workspaceSlug },
|
|
882
913
|
query
|
|
883
914
|
} });
|
|
884
915
|
return data;
|
|
885
916
|
}
|
|
886
917
|
/**
|
|
887
|
-
*
|
|
888
|
-
* @param
|
|
889
|
-
* @
|
|
918
|
+
* Create a new webhook
|
|
919
|
+
* @param workspaceSlug - Workspace slug
|
|
920
|
+
* @param webhook - Webhook creation request
|
|
921
|
+
* @returns Promise that resolves with the created webhook (including secret)
|
|
890
922
|
* @throws {ApiError} if the request fails
|
|
891
923
|
*/
|
|
892
|
-
async
|
|
893
|
-
const { data } = await this.#api.
|
|
924
|
+
async createWebhook(workspaceSlug, webhook) {
|
|
925
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/webhooks/", {
|
|
926
|
+
params: { path: { workspaceSlug } },
|
|
927
|
+
body: webhook
|
|
928
|
+
});
|
|
894
929
|
return data;
|
|
895
930
|
}
|
|
896
931
|
/**
|
|
897
|
-
*
|
|
898
|
-
* @param
|
|
899
|
-
* @param
|
|
900
|
-
* @returns Promise that resolves with the
|
|
932
|
+
* Get a specific webhook by slug
|
|
933
|
+
* @param workspaceSlug - Workspace slug
|
|
934
|
+
* @param webhookId - Webhook ID
|
|
935
|
+
* @returns Promise that resolves with the webhook details
|
|
901
936
|
* @throws {ApiError} if the request fails
|
|
902
937
|
*/
|
|
903
|
-
async
|
|
904
|
-
const { data } = await this.#api.
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
});
|
|
938
|
+
async getWebhook(workspaceSlug, webhookId) {
|
|
939
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/webhooks/{webhookId}/", { params: { path: {
|
|
940
|
+
workspaceSlug,
|
|
941
|
+
webhookId
|
|
942
|
+
} } });
|
|
908
943
|
return data;
|
|
909
944
|
}
|
|
910
945
|
/**
|
|
911
946
|
* Update an existing webhook
|
|
947
|
+
* @param workspaceSlug - Workspace slug
|
|
912
948
|
* @param webhookId - Webhook ID
|
|
913
949
|
* @param updates - Webhook update request
|
|
914
950
|
* @returns Promise that resolves with the updated webhook
|
|
915
951
|
* @throws {ApiError} if the request fails
|
|
916
952
|
*/
|
|
917
|
-
async updateWebhook(webhookId, updates) {
|
|
918
|
-
const { data } = await this.#api.PUT("/webhooks/{webhookId}/", {
|
|
919
|
-
params: { path: {
|
|
953
|
+
async updateWebhook(workspaceSlug, webhookId, updates) {
|
|
954
|
+
const { data } = await this.#api.PUT("/workspaces/{workspaceSlug}/webhooks/{webhookId}/", {
|
|
955
|
+
params: { path: {
|
|
956
|
+
workspaceSlug,
|
|
957
|
+
webhookId
|
|
958
|
+
} },
|
|
920
959
|
body: updates
|
|
921
960
|
});
|
|
922
961
|
return data;
|
|
923
962
|
}
|
|
924
963
|
/**
|
|
925
964
|
* Delete a webhook
|
|
965
|
+
* @param workspaceSlug - Workspace slug
|
|
926
966
|
* @param webhookId - Webhook ID
|
|
927
967
|
* @returns Promise that resolves when the webhook is deleted
|
|
928
968
|
* @throws {ApiError} if the request fails
|
|
929
969
|
*/
|
|
930
|
-
async deleteWebhook(webhookId) {
|
|
931
|
-
await this.#api.DELETE("/webhooks/{webhookId}/", { params: { path: {
|
|
970
|
+
async deleteWebhook(workspaceSlug, webhookId) {
|
|
971
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/webhooks/{webhookId}/", { params: { path: {
|
|
972
|
+
workspaceSlug,
|
|
973
|
+
webhookId
|
|
974
|
+
} } });
|
|
932
975
|
}
|
|
933
976
|
/**
|
|
934
977
|
* Test a webhook by sending a test payload
|
|
978
|
+
* @param workspaceSlug - Workspace slug
|
|
935
979
|
* @param webhookId - Webhook ID
|
|
936
980
|
* @param options - Test webhook options
|
|
937
981
|
* @returns Promise that resolves with the test result
|
|
938
982
|
* @throws {ApiError} if the request fails
|
|
939
983
|
*/
|
|
940
|
-
async testWebhook(webhookId, options) {
|
|
941
|
-
const { data } = await this.#api.POST("/webhooks/{webhookId}/test/", {
|
|
942
|
-
params: { path: {
|
|
984
|
+
async testWebhook(workspaceSlug, webhookId, options) {
|
|
985
|
+
const { data } = await this.#api.POST("/workspaces/{workspaceSlug}/webhooks/{webhookId}/test/", {
|
|
986
|
+
params: { path: {
|
|
987
|
+
workspaceSlug,
|
|
988
|
+
webhookId
|
|
989
|
+
} },
|
|
943
990
|
body: options ?? {}
|
|
944
991
|
});
|
|
945
992
|
return data;
|
|
@@ -968,12 +1015,12 @@ var Workspaces = class {
|
|
|
968
1015
|
}
|
|
969
1016
|
/**
|
|
970
1017
|
* Get workspace details by ID
|
|
971
|
-
* @param
|
|
1018
|
+
* @param workspaceSlug - Workspace slug
|
|
972
1019
|
* @returns Promise that resolves with the workspace details
|
|
973
1020
|
* @throws {ApiError} if the request fails
|
|
974
1021
|
*/
|
|
975
|
-
async getWorkspace(
|
|
976
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
1022
|
+
async getWorkspace(workspaceSlug) {
|
|
1023
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/", { params: { path: { workspaceSlug } } });
|
|
977
1024
|
return data;
|
|
978
1025
|
}
|
|
979
1026
|
/**
|
|
@@ -988,47 +1035,47 @@ var Workspaces = class {
|
|
|
988
1035
|
}
|
|
989
1036
|
/**
|
|
990
1037
|
* Update an existing workspace
|
|
991
|
-
* @param
|
|
1038
|
+
* @param workspaceSlug - Workspace slug
|
|
992
1039
|
* @param updates - Workspace update request
|
|
993
1040
|
* @returns Promise that resolves with the updated workspace
|
|
994
1041
|
* @throws {ApiError} if the request fails
|
|
995
1042
|
*/
|
|
996
|
-
async updateWorkspace(
|
|
997
|
-
const { data } = await this.#api.PATCH("/workspaces/{
|
|
998
|
-
params: { path: {
|
|
1043
|
+
async updateWorkspace(workspaceSlug, updates) {
|
|
1044
|
+
const { data } = await this.#api.PATCH("/workspaces/{workspaceSlug}/", {
|
|
1045
|
+
params: { path: { workspaceSlug } },
|
|
999
1046
|
body: updates
|
|
1000
1047
|
});
|
|
1001
1048
|
return data;
|
|
1002
1049
|
}
|
|
1003
1050
|
/**
|
|
1004
1051
|
* Delete a workspace
|
|
1005
|
-
* @param
|
|
1052
|
+
* @param workspaceSlug - Workspace slug
|
|
1006
1053
|
* @returns Promise that resolves when the workspace is deleted
|
|
1007
1054
|
* @throws {ApiError} if the request fails
|
|
1008
1055
|
*/
|
|
1009
|
-
async deleteWorkspace(
|
|
1010
|
-
await this.#api.DELETE("/workspaces/{
|
|
1056
|
+
async deleteWorkspace(workspaceSlug) {
|
|
1057
|
+
await this.#api.DELETE("/workspaces/{workspaceSlug}/", { params: { path: { workspaceSlug } } });
|
|
1011
1058
|
}
|
|
1012
1059
|
/**
|
|
1013
1060
|
* Get notification settings for the authenticated user in a workspace
|
|
1014
|
-
* @param
|
|
1061
|
+
* @param workspaceSlug - Workspace slug
|
|
1015
1062
|
* @returns Promise that resolves with the notification settings
|
|
1016
1063
|
* @throws {ApiError} if the request fails
|
|
1017
1064
|
*/
|
|
1018
|
-
async getNotificationSettings(
|
|
1019
|
-
const { data } = await this.#api.GET("/workspaces/{
|
|
1065
|
+
async getNotificationSettings(workspaceSlug) {
|
|
1066
|
+
const { data } = await this.#api.GET("/workspaces/{workspaceSlug}/notifications/", { params: { path: { workspaceSlug } } });
|
|
1020
1067
|
return data;
|
|
1021
1068
|
}
|
|
1022
1069
|
/**
|
|
1023
1070
|
* Update notification settings for the authenticated user in a workspace
|
|
1024
|
-
* @param
|
|
1071
|
+
* @param workspaceSlug - Workspace slug
|
|
1025
1072
|
* @param settings - Notification settings update request
|
|
1026
1073
|
* @returns Promise that resolves with the updated notification settings
|
|
1027
1074
|
* @throws {ApiError} if the request fails
|
|
1028
1075
|
*/
|
|
1029
|
-
async updateNotificationSettings(
|
|
1030
|
-
const { data } = await this.#api.PATCH("/workspaces/{
|
|
1031
|
-
params: { path: {
|
|
1076
|
+
async updateNotificationSettings(workspaceSlug, settings) {
|
|
1077
|
+
const { data } = await this.#api.PATCH("/workspaces/{workspaceSlug}/notifications/", {
|
|
1078
|
+
params: { path: { workspaceSlug } },
|
|
1032
1079
|
body: settings
|
|
1033
1080
|
});
|
|
1034
1081
|
return data;
|
|
@@ -1036,5 +1083,5 @@ var Workspaces = class {
|
|
|
1036
1083
|
};
|
|
1037
1084
|
|
|
1038
1085
|
//#endregion
|
|
1039
|
-
export { Policies as a, Members as c,
|
|
1040
|
-
//# sourceMappingURL=services-
|
|
1086
|
+
export { Policies as a, Members as c, Connections as d, Auth as f, Account as h, Runs as i, Invites as l, Activities as m, Webhooks as n, Pipelines as o, ApiTokens as p, Status as r, Notifications as s, Workspaces as t, Files as u };
|
|
1087
|
+
//# sourceMappingURL=services-DXP-jsLt.js.map
|