@inneropen/marvin-sdk 1.3.1 → 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 +33 -0
- package/dist/platform.d.cts +42 -6
- package/dist/platform.d.ts +42 -6
- package/dist/platform.js +32 -0
- package/package.json +1 -1
package/dist/platform.cjs
CHANGED
|
@@ -28,6 +28,7 @@ __export(platform_exports, {
|
|
|
28
28
|
PlatformClient: () => PlatformClient,
|
|
29
29
|
ResourcesModule: () => ResourcesModule,
|
|
30
30
|
WorkspaceMembersModule: () => WorkspaceMembersModule,
|
|
31
|
+
WorkspacesModule: () => WorkspacesModule,
|
|
31
32
|
createPlatformClient: () => createPlatformClient
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(platform_exports);
|
|
@@ -517,6 +518,35 @@ var WorkspaceMembersModule = class {
|
|
|
517
518
|
}
|
|
518
519
|
};
|
|
519
520
|
|
|
521
|
+
// src/platform/workspaces.ts
|
|
522
|
+
var WorkspacesModule = class {
|
|
523
|
+
constructor(http) {
|
|
524
|
+
this.http = http;
|
|
525
|
+
}
|
|
526
|
+
http;
|
|
527
|
+
/**
|
|
528
|
+
* Get the current active workspace
|
|
529
|
+
*/
|
|
530
|
+
async getCurrent() {
|
|
531
|
+
return this.http.get("/api/self/workspaces/current");
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* List all accessible workspaces
|
|
535
|
+
*/
|
|
536
|
+
async list() {
|
|
537
|
+
return this.http.get("/api/self/workspaces");
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Set active workspace by slug or ID
|
|
541
|
+
* Backend accepts both, so no lookup needed
|
|
542
|
+
*/
|
|
543
|
+
async setActive(workspace) {
|
|
544
|
+
return this.http.put("/api/self/workspaces/current", {
|
|
545
|
+
workspace
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
|
|
520
550
|
// src/platform/client.ts
|
|
521
551
|
var PlatformClient = class extends HttpClient {
|
|
522
552
|
entries;
|
|
@@ -526,6 +556,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
526
556
|
apiClients;
|
|
527
557
|
entryTypes;
|
|
528
558
|
workspaceMembers;
|
|
559
|
+
workspaces;
|
|
529
560
|
constructor(config) {
|
|
530
561
|
const httpConfig = {
|
|
531
562
|
baseUrl: config.apiUrl,
|
|
@@ -540,6 +571,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
540
571
|
this.apiClients = new APIClientsModule(this);
|
|
541
572
|
this.entryTypes = new EntryTypesModule(this);
|
|
542
573
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
574
|
+
this.workspaces = new WorkspacesModule(this);
|
|
543
575
|
}
|
|
544
576
|
};
|
|
545
577
|
function createPlatformClient(config) {
|
|
@@ -555,5 +587,6 @@ function createPlatformClient(config) {
|
|
|
555
587
|
PlatformClient,
|
|
556
588
|
ResourcesModule,
|
|
557
589
|
WorkspaceMembersModule,
|
|
590
|
+
WorkspacesModule,
|
|
558
591
|
createPlatformClient
|
|
559
592
|
});
|
package/dist/platform.d.cts
CHANGED
|
@@ -2279,11 +2279,8 @@ interface components {
|
|
|
2279
2279
|
* @description Request to change active workspace.
|
|
2280
2280
|
*/
|
|
2281
2281
|
WorkspaceActivationRequest: {
|
|
2282
|
-
/**
|
|
2283
|
-
|
|
2284
|
-
* Format: uuid4
|
|
2285
|
-
*/
|
|
2286
|
-
workspaceId: string;
|
|
2282
|
+
/** Workspace */
|
|
2283
|
+
workspace: string;
|
|
2287
2284
|
};
|
|
2288
2285
|
/**
|
|
2289
2286
|
* WorkspaceInfo
|
|
@@ -2677,6 +2674,44 @@ declare class WorkspaceMembersModule {
|
|
|
2677
2674
|
remove(workspaceId: string, userId: string): Promise<void>;
|
|
2678
2675
|
}
|
|
2679
2676
|
|
|
2677
|
+
/**
|
|
2678
|
+
* Workspaces Module - Platform API
|
|
2679
|
+
*
|
|
2680
|
+
* Workspace activation and listing operations
|
|
2681
|
+
*/
|
|
2682
|
+
|
|
2683
|
+
interface Workspace {
|
|
2684
|
+
id: string;
|
|
2685
|
+
slug: string;
|
|
2686
|
+
name: string;
|
|
2687
|
+
description?: string | null;
|
|
2688
|
+
}
|
|
2689
|
+
interface WorkspaceWithMembership {
|
|
2690
|
+
workspace: Workspace;
|
|
2691
|
+
role: string;
|
|
2692
|
+
is_active: boolean;
|
|
2693
|
+
}
|
|
2694
|
+
interface WorkspaceActivationRequest {
|
|
2695
|
+
workspace: string;
|
|
2696
|
+
}
|
|
2697
|
+
declare class WorkspacesModule {
|
|
2698
|
+
private http;
|
|
2699
|
+
constructor(http: HttpClient);
|
|
2700
|
+
/**
|
|
2701
|
+
* Get the current active workspace
|
|
2702
|
+
*/
|
|
2703
|
+
getCurrent(): Promise<Workspace>;
|
|
2704
|
+
/**
|
|
2705
|
+
* List all accessible workspaces
|
|
2706
|
+
*/
|
|
2707
|
+
list(): Promise<WorkspaceWithMembership[]>;
|
|
2708
|
+
/**
|
|
2709
|
+
* Set active workspace by slug or ID
|
|
2710
|
+
* Backend accepts both, so no lookup needed
|
|
2711
|
+
*/
|
|
2712
|
+
setActive(workspace: string): Promise<Workspace>;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2680
2715
|
/**
|
|
2681
2716
|
* Platform API Client
|
|
2682
2717
|
*
|
|
@@ -2696,6 +2731,7 @@ declare class PlatformClient extends HttpClient {
|
|
|
2696
2731
|
apiClients: APIClientsModule;
|
|
2697
2732
|
entryTypes: EntryTypesModule;
|
|
2698
2733
|
workspaceMembers: WorkspaceMembersModule;
|
|
2734
|
+
workspaces: WorkspacesModule;
|
|
2699
2735
|
constructor(config: PlatformClientConfig);
|
|
2700
2736
|
}
|
|
2701
2737
|
/**
|
|
@@ -2703,4 +2739,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
2703
2739
|
*/
|
|
2704
2740
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
2705
2741
|
|
|
2706
|
-
export { APIClientsModule, AssetsModule, CollectionsModule, EntriesModule, EntryTypesModule, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, WorkspaceMembersModule, createPlatformClient };
|
|
2742
|
+
export { APIClientsModule, AssetsModule, CollectionsModule, EntriesModule, EntryTypesModule, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type Workspace, type WorkspaceActivationRequest, WorkspaceMembersModule, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
|
package/dist/platform.d.ts
CHANGED
|
@@ -2279,11 +2279,8 @@ interface components {
|
|
|
2279
2279
|
* @description Request to change active workspace.
|
|
2280
2280
|
*/
|
|
2281
2281
|
WorkspaceActivationRequest: {
|
|
2282
|
-
/**
|
|
2283
|
-
|
|
2284
|
-
* Format: uuid4
|
|
2285
|
-
*/
|
|
2286
|
-
workspaceId: string;
|
|
2282
|
+
/** Workspace */
|
|
2283
|
+
workspace: string;
|
|
2287
2284
|
};
|
|
2288
2285
|
/**
|
|
2289
2286
|
* WorkspaceInfo
|
|
@@ -2677,6 +2674,44 @@ declare class WorkspaceMembersModule {
|
|
|
2677
2674
|
remove(workspaceId: string, userId: string): Promise<void>;
|
|
2678
2675
|
}
|
|
2679
2676
|
|
|
2677
|
+
/**
|
|
2678
|
+
* Workspaces Module - Platform API
|
|
2679
|
+
*
|
|
2680
|
+
* Workspace activation and listing operations
|
|
2681
|
+
*/
|
|
2682
|
+
|
|
2683
|
+
interface Workspace {
|
|
2684
|
+
id: string;
|
|
2685
|
+
slug: string;
|
|
2686
|
+
name: string;
|
|
2687
|
+
description?: string | null;
|
|
2688
|
+
}
|
|
2689
|
+
interface WorkspaceWithMembership {
|
|
2690
|
+
workspace: Workspace;
|
|
2691
|
+
role: string;
|
|
2692
|
+
is_active: boolean;
|
|
2693
|
+
}
|
|
2694
|
+
interface WorkspaceActivationRequest {
|
|
2695
|
+
workspace: string;
|
|
2696
|
+
}
|
|
2697
|
+
declare class WorkspacesModule {
|
|
2698
|
+
private http;
|
|
2699
|
+
constructor(http: HttpClient);
|
|
2700
|
+
/**
|
|
2701
|
+
* Get the current active workspace
|
|
2702
|
+
*/
|
|
2703
|
+
getCurrent(): Promise<Workspace>;
|
|
2704
|
+
/**
|
|
2705
|
+
* List all accessible workspaces
|
|
2706
|
+
*/
|
|
2707
|
+
list(): Promise<WorkspaceWithMembership[]>;
|
|
2708
|
+
/**
|
|
2709
|
+
* Set active workspace by slug or ID
|
|
2710
|
+
* Backend accepts both, so no lookup needed
|
|
2711
|
+
*/
|
|
2712
|
+
setActive(workspace: string): Promise<Workspace>;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2680
2715
|
/**
|
|
2681
2716
|
* Platform API Client
|
|
2682
2717
|
*
|
|
@@ -2696,6 +2731,7 @@ declare class PlatformClient extends HttpClient {
|
|
|
2696
2731
|
apiClients: APIClientsModule;
|
|
2697
2732
|
entryTypes: EntryTypesModule;
|
|
2698
2733
|
workspaceMembers: WorkspaceMembersModule;
|
|
2734
|
+
workspaces: WorkspacesModule;
|
|
2699
2735
|
constructor(config: PlatformClientConfig);
|
|
2700
2736
|
}
|
|
2701
2737
|
/**
|
|
@@ -2703,4 +2739,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
2703
2739
|
*/
|
|
2704
2740
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
2705
2741
|
|
|
2706
|
-
export { APIClientsModule, AssetsModule, CollectionsModule, EntriesModule, EntryTypesModule, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, WorkspaceMembersModule, createPlatformClient };
|
|
2742
|
+
export { APIClientsModule, AssetsModule, CollectionsModule, EntriesModule, EntryTypesModule, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetCreate, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, ResourcesModule, type Workspace, type WorkspaceActivationRequest, WorkspaceMembersModule, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
|
package/dist/platform.js
CHANGED
|
@@ -313,6 +313,35 @@ var WorkspaceMembersModule = class {
|
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
+
// src/platform/workspaces.ts
|
|
317
|
+
var WorkspacesModule = class {
|
|
318
|
+
constructor(http) {
|
|
319
|
+
this.http = http;
|
|
320
|
+
}
|
|
321
|
+
http;
|
|
322
|
+
/**
|
|
323
|
+
* Get the current active workspace
|
|
324
|
+
*/
|
|
325
|
+
async getCurrent() {
|
|
326
|
+
return this.http.get("/api/self/workspaces/current");
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* List all accessible workspaces
|
|
330
|
+
*/
|
|
331
|
+
async list() {
|
|
332
|
+
return this.http.get("/api/self/workspaces");
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Set active workspace by slug or ID
|
|
336
|
+
* Backend accepts both, so no lookup needed
|
|
337
|
+
*/
|
|
338
|
+
async setActive(workspace) {
|
|
339
|
+
return this.http.put("/api/self/workspaces/current", {
|
|
340
|
+
workspace
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
|
|
316
345
|
// src/platform/client.ts
|
|
317
346
|
var PlatformClient = class extends HttpClient {
|
|
318
347
|
entries;
|
|
@@ -322,6 +351,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
322
351
|
apiClients;
|
|
323
352
|
entryTypes;
|
|
324
353
|
workspaceMembers;
|
|
354
|
+
workspaces;
|
|
325
355
|
constructor(config) {
|
|
326
356
|
const httpConfig = {
|
|
327
357
|
baseUrl: config.apiUrl,
|
|
@@ -336,6 +366,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
336
366
|
this.apiClients = new APIClientsModule(this);
|
|
337
367
|
this.entryTypes = new EntryTypesModule(this);
|
|
338
368
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
369
|
+
this.workspaces = new WorkspacesModule(this);
|
|
339
370
|
}
|
|
340
371
|
};
|
|
341
372
|
function createPlatformClient(config) {
|
|
@@ -350,5 +381,6 @@ export {
|
|
|
350
381
|
PlatformClient,
|
|
351
382
|
ResourcesModule,
|
|
352
383
|
WorkspaceMembersModule,
|
|
384
|
+
WorkspacesModule,
|
|
353
385
|
createPlatformClient
|
|
354
386
|
};
|