@inneropen/marvin-sdk 1.3.0 → 1.4.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 +56 -0
- package/dist/platform.d.cts +52 -1
- package/dist/platform.d.ts +52 -1
- package/dist/platform.js +55 -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);
|
|
@@ -306,6 +307,12 @@ var CollectionsModule = class {
|
|
|
306
307
|
async delete(id) {
|
|
307
308
|
return this.http.delete(`/api/platform/collections/${id}`);
|
|
308
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Get entries in a collection
|
|
312
|
+
*/
|
|
313
|
+
async getEntries(id) {
|
|
314
|
+
return this.http.get(`/api/platform/collections/${id}/entries`);
|
|
315
|
+
}
|
|
309
316
|
};
|
|
310
317
|
|
|
311
318
|
// src/platform/resources.ts
|
|
@@ -344,6 +351,12 @@ var ResourcesModule = class {
|
|
|
344
351
|
async delete(id) {
|
|
345
352
|
return this.http.delete(`/api/platform/resources/${id}`);
|
|
346
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* Get entries that reference this resource
|
|
356
|
+
*/
|
|
357
|
+
async getEntries(id) {
|
|
358
|
+
return this.http.get(`/api/platform/resources/${id}/entries`);
|
|
359
|
+
}
|
|
347
360
|
};
|
|
348
361
|
|
|
349
362
|
// src/platform/assets.ts
|
|
@@ -505,6 +518,46 @@ var WorkspaceMembersModule = class {
|
|
|
505
518
|
}
|
|
506
519
|
};
|
|
507
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 ID
|
|
541
|
+
*/
|
|
542
|
+
async setActive(workspaceId) {
|
|
543
|
+
return this.http.put("/api/self/workspaces/current", {
|
|
544
|
+
workspace_id: workspaceId
|
|
545
|
+
});
|
|
546
|
+
}
|
|
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
|
+
};
|
|
560
|
+
|
|
508
561
|
// src/platform/client.ts
|
|
509
562
|
var PlatformClient = class extends HttpClient {
|
|
510
563
|
entries;
|
|
@@ -514,6 +567,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
514
567
|
apiClients;
|
|
515
568
|
entryTypes;
|
|
516
569
|
workspaceMembers;
|
|
570
|
+
workspaces;
|
|
517
571
|
constructor(config) {
|
|
518
572
|
const httpConfig = {
|
|
519
573
|
baseUrl: config.apiUrl,
|
|
@@ -528,6 +582,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
528
582
|
this.apiClients = new APIClientsModule(this);
|
|
529
583
|
this.entryTypes = new EntryTypesModule(this);
|
|
530
584
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
585
|
+
this.workspaces = new WorkspacesModule(this);
|
|
531
586
|
}
|
|
532
587
|
};
|
|
533
588
|
function createPlatformClient(config) {
|
|
@@ -543,5 +598,6 @@ function createPlatformClient(config) {
|
|
|
543
598
|
PlatformClient,
|
|
544
599
|
ResourcesModule,
|
|
545
600
|
WorkspaceMembersModule,
|
|
601
|
+
WorkspacesModule,
|
|
546
602
|
createPlatformClient
|
|
547
603
|
});
|
package/dist/platform.d.cts
CHANGED
|
@@ -2516,6 +2516,10 @@ declare class CollectionsModule {
|
|
|
2516
2516
|
* Delete a collection
|
|
2517
2517
|
*/
|
|
2518
2518
|
delete(id: string): Promise<void>;
|
|
2519
|
+
/**
|
|
2520
|
+
* Get entries in a collection
|
|
2521
|
+
*/
|
|
2522
|
+
getEntries(id: string): Promise<PlatformEntry[]>;
|
|
2519
2523
|
}
|
|
2520
2524
|
|
|
2521
2525
|
/**
|
|
@@ -2547,6 +2551,10 @@ declare class ResourcesModule {
|
|
|
2547
2551
|
* Delete a resource
|
|
2548
2552
|
*/
|
|
2549
2553
|
delete(id: string): Promise<void>;
|
|
2554
|
+
/**
|
|
2555
|
+
* Get entries that reference this resource
|
|
2556
|
+
*/
|
|
2557
|
+
getEntries(id: string): Promise<PlatformEntry[]>;
|
|
2550
2558
|
}
|
|
2551
2559
|
|
|
2552
2560
|
/**
|
|
@@ -2669,6 +2677,48 @@ declare class WorkspaceMembersModule {
|
|
|
2669
2677
|
remove(workspaceId: string, userId: string): Promise<void>;
|
|
2670
2678
|
}
|
|
2671
2679
|
|
|
2680
|
+
/**
|
|
2681
|
+
* Workspaces Module - Platform API
|
|
2682
|
+
*
|
|
2683
|
+
* Workspace activation and listing operations
|
|
2684
|
+
*/
|
|
2685
|
+
|
|
2686
|
+
interface Workspace {
|
|
2687
|
+
id: string;
|
|
2688
|
+
slug: string;
|
|
2689
|
+
name: string;
|
|
2690
|
+
description?: string | null;
|
|
2691
|
+
}
|
|
2692
|
+
interface WorkspaceWithMembership {
|
|
2693
|
+
workspace: Workspace;
|
|
2694
|
+
role: string;
|
|
2695
|
+
is_active: boolean;
|
|
2696
|
+
}
|
|
2697
|
+
interface WorkspaceActivationRequest {
|
|
2698
|
+
workspace_id: string;
|
|
2699
|
+
}
|
|
2700
|
+
declare class WorkspacesModule {
|
|
2701
|
+
private http;
|
|
2702
|
+
constructor(http: HttpClient);
|
|
2703
|
+
/**
|
|
2704
|
+
* Get the current active workspace
|
|
2705
|
+
*/
|
|
2706
|
+
getCurrent(): Promise<Workspace>;
|
|
2707
|
+
/**
|
|
2708
|
+
* List all accessible workspaces
|
|
2709
|
+
*/
|
|
2710
|
+
list(): Promise<WorkspaceWithMembership[]>;
|
|
2711
|
+
/**
|
|
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
|
|
2718
|
+
*/
|
|
2719
|
+
setActiveBySlug(slug: string): Promise<Workspace>;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2672
2722
|
/**
|
|
2673
2723
|
* Platform API Client
|
|
2674
2724
|
*
|
|
@@ -2688,6 +2738,7 @@ declare class PlatformClient extends HttpClient {
|
|
|
2688
2738
|
apiClients: APIClientsModule;
|
|
2689
2739
|
entryTypes: EntryTypesModule;
|
|
2690
2740
|
workspaceMembers: WorkspaceMembersModule;
|
|
2741
|
+
workspaces: WorkspacesModule;
|
|
2691
2742
|
constructor(config: PlatformClientConfig);
|
|
2692
2743
|
}
|
|
2693
2744
|
/**
|
|
@@ -2695,4 +2746,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
2695
2746
|
*/
|
|
2696
2747
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
2697
2748
|
|
|
2698
|
-
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 };
|
|
2749
|
+
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
|
@@ -2516,6 +2516,10 @@ declare class CollectionsModule {
|
|
|
2516
2516
|
* Delete a collection
|
|
2517
2517
|
*/
|
|
2518
2518
|
delete(id: string): Promise<void>;
|
|
2519
|
+
/**
|
|
2520
|
+
* Get entries in a collection
|
|
2521
|
+
*/
|
|
2522
|
+
getEntries(id: string): Promise<PlatformEntry[]>;
|
|
2519
2523
|
}
|
|
2520
2524
|
|
|
2521
2525
|
/**
|
|
@@ -2547,6 +2551,10 @@ declare class ResourcesModule {
|
|
|
2547
2551
|
* Delete a resource
|
|
2548
2552
|
*/
|
|
2549
2553
|
delete(id: string): Promise<void>;
|
|
2554
|
+
/**
|
|
2555
|
+
* Get entries that reference this resource
|
|
2556
|
+
*/
|
|
2557
|
+
getEntries(id: string): Promise<PlatformEntry[]>;
|
|
2550
2558
|
}
|
|
2551
2559
|
|
|
2552
2560
|
/**
|
|
@@ -2669,6 +2677,48 @@ declare class WorkspaceMembersModule {
|
|
|
2669
2677
|
remove(workspaceId: string, userId: string): Promise<void>;
|
|
2670
2678
|
}
|
|
2671
2679
|
|
|
2680
|
+
/**
|
|
2681
|
+
* Workspaces Module - Platform API
|
|
2682
|
+
*
|
|
2683
|
+
* Workspace activation and listing operations
|
|
2684
|
+
*/
|
|
2685
|
+
|
|
2686
|
+
interface Workspace {
|
|
2687
|
+
id: string;
|
|
2688
|
+
slug: string;
|
|
2689
|
+
name: string;
|
|
2690
|
+
description?: string | null;
|
|
2691
|
+
}
|
|
2692
|
+
interface WorkspaceWithMembership {
|
|
2693
|
+
workspace: Workspace;
|
|
2694
|
+
role: string;
|
|
2695
|
+
is_active: boolean;
|
|
2696
|
+
}
|
|
2697
|
+
interface WorkspaceActivationRequest {
|
|
2698
|
+
workspace_id: string;
|
|
2699
|
+
}
|
|
2700
|
+
declare class WorkspacesModule {
|
|
2701
|
+
private http;
|
|
2702
|
+
constructor(http: HttpClient);
|
|
2703
|
+
/**
|
|
2704
|
+
* Get the current active workspace
|
|
2705
|
+
*/
|
|
2706
|
+
getCurrent(): Promise<Workspace>;
|
|
2707
|
+
/**
|
|
2708
|
+
* List all accessible workspaces
|
|
2709
|
+
*/
|
|
2710
|
+
list(): Promise<WorkspaceWithMembership[]>;
|
|
2711
|
+
/**
|
|
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
|
|
2718
|
+
*/
|
|
2719
|
+
setActiveBySlug(slug: string): Promise<Workspace>;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2672
2722
|
/**
|
|
2673
2723
|
* Platform API Client
|
|
2674
2724
|
*
|
|
@@ -2688,6 +2738,7 @@ declare class PlatformClient extends HttpClient {
|
|
|
2688
2738
|
apiClients: APIClientsModule;
|
|
2689
2739
|
entryTypes: EntryTypesModule;
|
|
2690
2740
|
workspaceMembers: WorkspaceMembersModule;
|
|
2741
|
+
workspaces: WorkspacesModule;
|
|
2691
2742
|
constructor(config: PlatformClientConfig);
|
|
2692
2743
|
}
|
|
2693
2744
|
/**
|
|
@@ -2695,4 +2746,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
2695
2746
|
*/
|
|
2696
2747
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
2697
2748
|
|
|
2698
|
-
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 };
|
|
2749
|
+
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
|
@@ -102,6 +102,12 @@ var CollectionsModule = class {
|
|
|
102
102
|
async delete(id) {
|
|
103
103
|
return this.http.delete(`/api/platform/collections/${id}`);
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Get entries in a collection
|
|
107
|
+
*/
|
|
108
|
+
async getEntries(id) {
|
|
109
|
+
return this.http.get(`/api/platform/collections/${id}/entries`);
|
|
110
|
+
}
|
|
105
111
|
};
|
|
106
112
|
|
|
107
113
|
// src/platform/resources.ts
|
|
@@ -140,6 +146,12 @@ var ResourcesModule = class {
|
|
|
140
146
|
async delete(id) {
|
|
141
147
|
return this.http.delete(`/api/platform/resources/${id}`);
|
|
142
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Get entries that reference this resource
|
|
151
|
+
*/
|
|
152
|
+
async getEntries(id) {
|
|
153
|
+
return this.http.get(`/api/platform/resources/${id}/entries`);
|
|
154
|
+
}
|
|
143
155
|
};
|
|
144
156
|
|
|
145
157
|
// src/platform/assets.ts
|
|
@@ -301,6 +313,46 @@ var WorkspaceMembersModule = class {
|
|
|
301
313
|
}
|
|
302
314
|
};
|
|
303
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 ID
|
|
336
|
+
*/
|
|
337
|
+
async setActive(workspaceId) {
|
|
338
|
+
return this.http.put("/api/self/workspaces/current", {
|
|
339
|
+
workspace_id: workspaceId
|
|
340
|
+
});
|
|
341
|
+
}
|
|
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
|
+
};
|
|
355
|
+
|
|
304
356
|
// src/platform/client.ts
|
|
305
357
|
var PlatformClient = class extends HttpClient {
|
|
306
358
|
entries;
|
|
@@ -310,6 +362,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
310
362
|
apiClients;
|
|
311
363
|
entryTypes;
|
|
312
364
|
workspaceMembers;
|
|
365
|
+
workspaces;
|
|
313
366
|
constructor(config) {
|
|
314
367
|
const httpConfig = {
|
|
315
368
|
baseUrl: config.apiUrl,
|
|
@@ -324,6 +377,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
324
377
|
this.apiClients = new APIClientsModule(this);
|
|
325
378
|
this.entryTypes = new EntryTypesModule(this);
|
|
326
379
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
380
|
+
this.workspaces = new WorkspacesModule(this);
|
|
327
381
|
}
|
|
328
382
|
};
|
|
329
383
|
function createPlatformClient(config) {
|
|
@@ -338,5 +392,6 @@ export {
|
|
|
338
392
|
PlatformClient,
|
|
339
393
|
ResourcesModule,
|
|
340
394
|
WorkspaceMembersModule,
|
|
395
|
+
WorkspacesModule,
|
|
341
396
|
createPlatformClient
|
|
342
397
|
};
|