@inneropen/marvin-sdk 1.4.0 → 1.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/dist/platform.cjs CHANGED
@@ -537,25 +537,14 @@ var WorkspacesModule = class {
537
537
  return this.http.get("/api/self/workspaces");
538
538
  }
539
539
  /**
540
- * Set active workspace by ID
540
+ * Set active workspace by slug or ID
541
+ * Backend accepts both, so no lookup needed
541
542
  */
542
- async setActive(workspaceId) {
543
+ async setActive(workspace) {
543
544
  return this.http.put("/api/self/workspaces/current", {
544
- workspace_id: workspaceId
545
+ workspace
545
546
  });
546
547
  }
547
- /**
548
- * Set active workspace by slug (convenience method)
549
- * Internally looks up the workspace by slug and calls setActive with the ID
550
- */
551
- async setActiveBySlug(slug) {
552
- const workspaces = await this.list();
553
- const workspace = workspaces.find((w) => w.workspace.slug === slug);
554
- if (!workspace) {
555
- throw new Error(`Workspace with slug "${slug}" not found`);
556
- }
557
- return this.setActive(workspace.workspace.id);
558
- }
559
548
  };
560
549
 
561
550
  // src/platform/client.ts
@@ -2279,11 +2279,8 @@ interface components {
2279
2279
  * @description Request to change active workspace.
2280
2280
  */
2281
2281
  WorkspaceActivationRequest: {
2282
- /**
2283
- * Workspaceid
2284
- * Format: uuid4
2285
- */
2286
- workspaceId: string;
2282
+ /** Workspace */
2283
+ workspace: string;
2287
2284
  };
2288
2285
  /**
2289
2286
  * WorkspaceInfo
@@ -2695,7 +2692,7 @@ interface WorkspaceWithMembership {
2695
2692
  is_active: boolean;
2696
2693
  }
2697
2694
  interface WorkspaceActivationRequest {
2698
- workspace_id: string;
2695
+ workspace: string;
2699
2696
  }
2700
2697
  declare class WorkspacesModule {
2701
2698
  private http;
@@ -2709,14 +2706,10 @@ declare class WorkspacesModule {
2709
2706
  */
2710
2707
  list(): Promise<WorkspaceWithMembership[]>;
2711
2708
  /**
2712
- * Set active workspace by ID
2713
- */
2714
- setActive(workspaceId: string): Promise<Workspace>;
2715
- /**
2716
- * Set active workspace by slug (convenience method)
2717
- * Internally looks up the workspace by slug and calls setActive with the ID
2709
+ * Set active workspace by slug or ID
2710
+ * Backend accepts both, so no lookup needed
2718
2711
  */
2719
- setActiveBySlug(slug: string): Promise<Workspace>;
2712
+ setActive(workspace: string): Promise<Workspace>;
2720
2713
  }
2721
2714
 
2722
2715
  /**
@@ -2279,11 +2279,8 @@ interface components {
2279
2279
  * @description Request to change active workspace.
2280
2280
  */
2281
2281
  WorkspaceActivationRequest: {
2282
- /**
2283
- * Workspaceid
2284
- * Format: uuid4
2285
- */
2286
- workspaceId: string;
2282
+ /** Workspace */
2283
+ workspace: string;
2287
2284
  };
2288
2285
  /**
2289
2286
  * WorkspaceInfo
@@ -2695,7 +2692,7 @@ interface WorkspaceWithMembership {
2695
2692
  is_active: boolean;
2696
2693
  }
2697
2694
  interface WorkspaceActivationRequest {
2698
- workspace_id: string;
2695
+ workspace: string;
2699
2696
  }
2700
2697
  declare class WorkspacesModule {
2701
2698
  private http;
@@ -2709,14 +2706,10 @@ declare class WorkspacesModule {
2709
2706
  */
2710
2707
  list(): Promise<WorkspaceWithMembership[]>;
2711
2708
  /**
2712
- * Set active workspace by ID
2713
- */
2714
- setActive(workspaceId: string): Promise<Workspace>;
2715
- /**
2716
- * Set active workspace by slug (convenience method)
2717
- * Internally looks up the workspace by slug and calls setActive with the ID
2709
+ * Set active workspace by slug or ID
2710
+ * Backend accepts both, so no lookup needed
2718
2711
  */
2719
- setActiveBySlug(slug: string): Promise<Workspace>;
2712
+ setActive(workspace: string): Promise<Workspace>;
2720
2713
  }
2721
2714
 
2722
2715
  /**
package/dist/platform.js CHANGED
@@ -332,25 +332,14 @@ var WorkspacesModule = class {
332
332
  return this.http.get("/api/self/workspaces");
333
333
  }
334
334
  /**
335
- * Set active workspace by ID
335
+ * Set active workspace by slug or ID
336
+ * Backend accepts both, so no lookup needed
336
337
  */
337
- async setActive(workspaceId) {
338
+ async setActive(workspace) {
338
339
  return this.http.put("/api/self/workspaces/current", {
339
- workspace_id: workspaceId
340
+ workspace
340
341
  });
341
342
  }
342
- /**
343
- * Set active workspace by slug (convenience method)
344
- * Internally looks up the workspace by slug and calls setActive with the ID
345
- */
346
- async setActiveBySlug(slug) {
347
- const workspaces = await this.list();
348
- const workspace = workspaces.find((w) => w.workspace.slug === slug);
349
- if (!workspace) {
350
- throw new Error(`Workspace with slug "${slug}" not found`);
351
- }
352
- return this.setActive(workspace.workspace.id);
353
- }
354
343
  };
355
344
 
356
345
  // src/platform/client.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",