@axiom-lattice/client-sdk 2.1.36 → 2.1.37
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.d.ts +5 -5
- package/dist/index.js +35 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -9
- package/dist/index.mjs.map +1 -1
- package/dist/workspace-client.d.ts +5 -5
- package/dist/workspace-client.d.ts.map +1 -1
- package/dist/workspace-client.js +35 -9
- package/dist/workspace-client.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1419,8 +1419,8 @@ declare class WorkspaceClient {
|
|
|
1419
1419
|
getProject(workspaceId: string, projectId: string): Promise<Project>;
|
|
1420
1420
|
updateProject(workspaceId: string, projectId: string, updates: UpdateProjectRequest): Promise<Project>;
|
|
1421
1421
|
deleteProject(workspaceId: string, projectId: string): Promise<void>;
|
|
1422
|
-
listPath(workspaceId: string, projectId: string, path?: string): Promise<FileItem[]>;
|
|
1423
|
-
readFile(workspaceId: string, projectId: string, path: string, offset?: number, limit?: number): Promise<{
|
|
1422
|
+
listPath(workspaceId: string, projectId: string, path?: string, assistantId?: string): Promise<FileItem[]>;
|
|
1423
|
+
readFile(workspaceId: string, projectId: string, path: string, offset?: number, limit?: number, assistantId?: string): Promise<{
|
|
1424
1424
|
content: string;
|
|
1425
1425
|
offset: number;
|
|
1426
1426
|
limit: number;
|
|
@@ -1431,13 +1431,13 @@ declare class WorkspaceClient {
|
|
|
1431
1431
|
* Uses multipart/form-data against:
|
|
1432
1432
|
* POST /api/workspaces/:workspaceId/projects/:projectId/uploadfile
|
|
1433
1433
|
*/
|
|
1434
|
-
uploadFile(workspaceId: string, projectId: string, file: File | Blob, path?: string): Promise<FileItem>;
|
|
1435
|
-
getFileDownloadUrl(workspaceId: string, projectId: string, filePath: string): string;
|
|
1434
|
+
uploadFile(workspaceId: string, projectId: string, file: File | Blob, path?: string, assistantId?: string): Promise<FileItem>;
|
|
1435
|
+
getFileDownloadUrl(workspaceId: string, projectId: string, filePath: string, assistantId?: string): string;
|
|
1436
1436
|
/**
|
|
1437
1437
|
* Get a URL for viewing a file inline in the browser (not download).
|
|
1438
1438
|
* The file will be displayed in the browser rather than downloaded.
|
|
1439
1439
|
*/
|
|
1440
|
-
getFileViewUrl(workspaceId: string, projectId: string, filePath: string): string;
|
|
1440
|
+
getFileViewUrl(workspaceId: string, projectId: string, filePath: string, assistantId?: string): string;
|
|
1441
1441
|
}
|
|
1442
1442
|
|
|
1443
1443
|
/**
|
package/dist/index.js
CHANGED
|
@@ -3500,18 +3500,25 @@ var WorkspaceClient = class {
|
|
|
3500
3500
|
);
|
|
3501
3501
|
}
|
|
3502
3502
|
// ==================== File Operations ====================
|
|
3503
|
-
async listPath(workspaceId, projectId, path = "/") {
|
|
3503
|
+
async listPath(workspaceId, projectId, path = "/", assistantId) {
|
|
3504
|
+
const params = new URLSearchParams({ path });
|
|
3505
|
+
if (assistantId) {
|
|
3506
|
+
params.set("assistantId", assistantId);
|
|
3507
|
+
}
|
|
3504
3508
|
const response = await this.request(
|
|
3505
|
-
`/api/workspaces/${workspaceId}/projects/${projectId}/listpath
|
|
3509
|
+
`/api/workspaces/${workspaceId}/projects/${projectId}/listpath?${params}`
|
|
3506
3510
|
);
|
|
3507
3511
|
return response.data || [];
|
|
3508
3512
|
}
|
|
3509
|
-
async readFile(workspaceId, projectId, path, offset = 0, limit = 1e3) {
|
|
3513
|
+
async readFile(workspaceId, projectId, path, offset = 0, limit = 1e3, assistantId) {
|
|
3510
3514
|
const params = new URLSearchParams({
|
|
3511
3515
|
path,
|
|
3512
3516
|
offset: String(offset),
|
|
3513
3517
|
limit: String(limit)
|
|
3514
3518
|
});
|
|
3519
|
+
if (assistantId) {
|
|
3520
|
+
params.set("assistantId", assistantId);
|
|
3521
|
+
}
|
|
3515
3522
|
const response = await this.request(
|
|
3516
3523
|
`/api/workspaces/${workspaceId}/projects/${projectId}/readfile?${params}`
|
|
3517
3524
|
);
|
|
@@ -3523,8 +3530,13 @@ var WorkspaceClient = class {
|
|
|
3523
3530
|
* Uses multipart/form-data against:
|
|
3524
3531
|
* POST /api/workspaces/:workspaceId/projects/:projectId/uploadfile
|
|
3525
3532
|
*/
|
|
3526
|
-
async uploadFile(workspaceId, projectId, file, path = "/") {
|
|
3527
|
-
const
|
|
3533
|
+
async uploadFile(workspaceId, projectId, file, path = "/", assistantId) {
|
|
3534
|
+
const params = new URLSearchParams();
|
|
3535
|
+
if (assistantId) {
|
|
3536
|
+
params.set("assistantId", assistantId);
|
|
3537
|
+
}
|
|
3538
|
+
const qs = params.toString();
|
|
3539
|
+
const url = `/api/workspaces/${workspaceId}/projects/${projectId}/uploadfile${qs ? `?${qs}` : ""}`;
|
|
3528
3540
|
const fullUrl = `${this.baseURL}${url}`;
|
|
3529
3541
|
const formData = new FormData();
|
|
3530
3542
|
const filename = file.name && typeof file.name === "string" ? file.name : "file";
|
|
@@ -3549,15 +3561,29 @@ var WorkspaceClient = class {
|
|
|
3549
3561
|
}
|
|
3550
3562
|
return json.data;
|
|
3551
3563
|
}
|
|
3552
|
-
getFileDownloadUrl(workspaceId, projectId, filePath) {
|
|
3553
|
-
|
|
3564
|
+
getFileDownloadUrl(workspaceId, projectId, filePath, assistantId) {
|
|
3565
|
+
const params = new URLSearchParams({
|
|
3566
|
+
path: filePath,
|
|
3567
|
+
tenantId: this.tenantId
|
|
3568
|
+
});
|
|
3569
|
+
if (assistantId) {
|
|
3570
|
+
params.set("assistantId", assistantId);
|
|
3571
|
+
}
|
|
3572
|
+
return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/downloadfile?${params}`;
|
|
3554
3573
|
}
|
|
3555
3574
|
/**
|
|
3556
3575
|
* Get a URL for viewing a file inline in the browser (not download).
|
|
3557
3576
|
* The file will be displayed in the browser rather than downloaded.
|
|
3558
3577
|
*/
|
|
3559
|
-
getFileViewUrl(workspaceId, projectId, filePath) {
|
|
3560
|
-
|
|
3578
|
+
getFileViewUrl(workspaceId, projectId, filePath, assistantId) {
|
|
3579
|
+
const params = new URLSearchParams({
|
|
3580
|
+
path: filePath,
|
|
3581
|
+
tenantId: this.tenantId
|
|
3582
|
+
});
|
|
3583
|
+
if (assistantId) {
|
|
3584
|
+
params.set("assistantId", assistantId);
|
|
3585
|
+
}
|
|
3586
|
+
return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/viewfile?${params}`;
|
|
3561
3587
|
}
|
|
3562
3588
|
};
|
|
3563
3589
|
|