@axiom-lattice/client-sdk 2.1.35 → 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.mjs CHANGED
@@ -3478,18 +3478,25 @@ var WorkspaceClient = class {
3478
3478
  );
3479
3479
  }
3480
3480
  // ==================== File Operations ====================
3481
- async listPath(workspaceId, projectId, path = "/") {
3481
+ async listPath(workspaceId, projectId, path = "/", assistantId) {
3482
+ const params = new URLSearchParams({ path });
3483
+ if (assistantId) {
3484
+ params.set("assistantId", assistantId);
3485
+ }
3482
3486
  const response = await this.request(
3483
- `/api/workspaces/${workspaceId}/projects/${projectId}/listpath?path=${encodeURIComponent(path)}`
3487
+ `/api/workspaces/${workspaceId}/projects/${projectId}/listpath?${params}`
3484
3488
  );
3485
3489
  return response.data || [];
3486
3490
  }
3487
- async readFile(workspaceId, projectId, path, offset = 0, limit = 1e3) {
3491
+ async readFile(workspaceId, projectId, path, offset = 0, limit = 1e3, assistantId) {
3488
3492
  const params = new URLSearchParams({
3489
3493
  path,
3490
3494
  offset: String(offset),
3491
3495
  limit: String(limit)
3492
3496
  });
3497
+ if (assistantId) {
3498
+ params.set("assistantId", assistantId);
3499
+ }
3493
3500
  const response = await this.request(
3494
3501
  `/api/workspaces/${workspaceId}/projects/${projectId}/readfile?${params}`
3495
3502
  );
@@ -3501,8 +3508,13 @@ var WorkspaceClient = class {
3501
3508
  * Uses multipart/form-data against:
3502
3509
  * POST /api/workspaces/:workspaceId/projects/:projectId/uploadfile
3503
3510
  */
3504
- async uploadFile(workspaceId, projectId, file, path = "/") {
3505
- const url = `/api/workspaces/${workspaceId}/projects/${projectId}/uploadfile`;
3511
+ async uploadFile(workspaceId, projectId, file, path = "/", assistantId) {
3512
+ const params = new URLSearchParams();
3513
+ if (assistantId) {
3514
+ params.set("assistantId", assistantId);
3515
+ }
3516
+ const qs = params.toString();
3517
+ const url = `/api/workspaces/${workspaceId}/projects/${projectId}/uploadfile${qs ? `?${qs}` : ""}`;
3506
3518
  const fullUrl = `${this.baseURL}${url}`;
3507
3519
  const formData = new FormData();
3508
3520
  const filename = file.name && typeof file.name === "string" ? file.name : "file";
@@ -3527,15 +3539,29 @@ var WorkspaceClient = class {
3527
3539
  }
3528
3540
  return json.data;
3529
3541
  }
3530
- getFileDownloadUrl(workspaceId, projectId, filePath) {
3531
- return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/downloadfile?path=${encodeURIComponent(filePath)}&tenantId=${encodeURIComponent(this.tenantId)}`;
3542
+ getFileDownloadUrl(workspaceId, projectId, filePath, assistantId) {
3543
+ const params = new URLSearchParams({
3544
+ path: filePath,
3545
+ tenantId: this.tenantId
3546
+ });
3547
+ if (assistantId) {
3548
+ params.set("assistantId", assistantId);
3549
+ }
3550
+ return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/downloadfile?${params}`;
3532
3551
  }
3533
3552
  /**
3534
3553
  * Get a URL for viewing a file inline in the browser (not download).
3535
3554
  * The file will be displayed in the browser rather than downloaded.
3536
3555
  */
3537
- getFileViewUrl(workspaceId, projectId, filePath) {
3538
- return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/viewfile?path=${encodeURIComponent(filePath)}&tenantId=${encodeURIComponent(this.tenantId)}`;
3556
+ getFileViewUrl(workspaceId, projectId, filePath, assistantId) {
3557
+ const params = new URLSearchParams({
3558
+ path: filePath,
3559
+ tenantId: this.tenantId
3560
+ });
3561
+ if (assistantId) {
3562
+ params.set("assistantId", assistantId);
3563
+ }
3564
+ return `${this.baseURL}/api/workspaces/${workspaceId}/projects/${projectId}/viewfile?${params}`;
3539
3565
  }
3540
3566
  };
3541
3567