@inneropen/marvin-sdk 1.5.0 → 1.6.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 +57 -0
- package/dist/platform.d.cts +58 -2
- package/dist/platform.d.ts +58 -2
- package/dist/platform.js +56 -0
- package/package.json +1 -1
package/dist/platform.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(platform_exports, {
|
|
|
25
25
|
CollectionsModule: () => CollectionsModule,
|
|
26
26
|
EntriesModule: () => EntriesModule,
|
|
27
27
|
EntryTypesModule: () => EntryTypesModule,
|
|
28
|
+
InvitesModule: () => InvitesModule,
|
|
28
29
|
PlatformClient: () => PlatformClient,
|
|
29
30
|
ResourcesModule: () => ResourcesModule,
|
|
30
31
|
WorkspaceMembersModule: () => WorkspaceMembersModule,
|
|
@@ -545,6 +546,59 @@ var WorkspacesModule = class {
|
|
|
545
546
|
workspace
|
|
546
547
|
});
|
|
547
548
|
}
|
|
549
|
+
// Admin operations (require SUPER_ADMIN or appropriate permissions)
|
|
550
|
+
/**
|
|
551
|
+
* Get a workspace by ID (admin)
|
|
552
|
+
*/
|
|
553
|
+
async get(id) {
|
|
554
|
+
return this.http.get(`/api/admin/groups/${id}`);
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Create a new workspace (requires SUPER_ADMIN)
|
|
558
|
+
*/
|
|
559
|
+
async create(data) {
|
|
560
|
+
return this.http.post("/api/admin/groups", data);
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Update workspace settings (requires ADMIN or OWNER)
|
|
564
|
+
*/
|
|
565
|
+
async update(id, data) {
|
|
566
|
+
return this.http.put(`/api/admin/groups/${id}`, data);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Delete a workspace (requires SUPER_ADMIN)
|
|
570
|
+
*/
|
|
571
|
+
async delete(id, force = false) {
|
|
572
|
+
const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
|
|
573
|
+
await this.http.delete(url);
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
// src/platform/invites.ts
|
|
578
|
+
var InvitesModule = class {
|
|
579
|
+
constructor(http) {
|
|
580
|
+
this.http = http;
|
|
581
|
+
}
|
|
582
|
+
http;
|
|
583
|
+
/**
|
|
584
|
+
* List all invite tokens for the current workspace
|
|
585
|
+
*/
|
|
586
|
+
async list() {
|
|
587
|
+
const response = await this.http.get("/api/groups/invitations");
|
|
588
|
+
return response.items || [];
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Create a new invite token
|
|
592
|
+
*/
|
|
593
|
+
async create(data) {
|
|
594
|
+
return this.http.post("/api/groups/invitations", data);
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Send an email invitation
|
|
598
|
+
*/
|
|
599
|
+
async sendEmail(data) {
|
|
600
|
+
await this.http.post("/api/groups/invitations/email", data);
|
|
601
|
+
}
|
|
548
602
|
};
|
|
549
603
|
|
|
550
604
|
// src/platform/client.ts
|
|
@@ -557,6 +611,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
557
611
|
entryTypes;
|
|
558
612
|
workspaceMembers;
|
|
559
613
|
workspaces;
|
|
614
|
+
invites;
|
|
560
615
|
constructor(config) {
|
|
561
616
|
const httpConfig = {
|
|
562
617
|
baseUrl: config.apiUrl,
|
|
@@ -572,6 +627,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
572
627
|
this.entryTypes = new EntryTypesModule(this);
|
|
573
628
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
574
629
|
this.workspaces = new WorkspacesModule(this);
|
|
630
|
+
this.invites = new InvitesModule(this);
|
|
575
631
|
}
|
|
576
632
|
};
|
|
577
633
|
function createPlatformClient(config) {
|
|
@@ -584,6 +640,7 @@ function createPlatformClient(config) {
|
|
|
584
640
|
CollectionsModule,
|
|
585
641
|
EntriesModule,
|
|
586
642
|
EntryTypesModule,
|
|
643
|
+
InvitesModule,
|
|
587
644
|
PlatformClient,
|
|
588
645
|
ResourcesModule,
|
|
589
646
|
WorkspaceMembersModule,
|
package/dist/platform.d.cts
CHANGED
|
@@ -2689,11 +2689,20 @@ interface Workspace {
|
|
|
2689
2689
|
interface WorkspaceWithMembership {
|
|
2690
2690
|
workspace: Workspace;
|
|
2691
2691
|
role: string;
|
|
2692
|
-
|
|
2692
|
+
isActive: boolean;
|
|
2693
2693
|
}
|
|
2694
2694
|
interface WorkspaceActivationRequest {
|
|
2695
2695
|
workspace: string;
|
|
2696
2696
|
}
|
|
2697
|
+
interface WorkspaceCreate {
|
|
2698
|
+
name: string;
|
|
2699
|
+
slug?: string;
|
|
2700
|
+
description?: string | null;
|
|
2701
|
+
}
|
|
2702
|
+
interface WorkspaceUpdate {
|
|
2703
|
+
name?: string;
|
|
2704
|
+
description?: string | null;
|
|
2705
|
+
}
|
|
2697
2706
|
declare class WorkspacesModule {
|
|
2698
2707
|
private http;
|
|
2699
2708
|
constructor(http: HttpClient);
|
|
@@ -2710,6 +2719,52 @@ declare class WorkspacesModule {
|
|
|
2710
2719
|
* Backend accepts both, so no lookup needed
|
|
2711
2720
|
*/
|
|
2712
2721
|
setActive(workspace: string): Promise<Workspace>;
|
|
2722
|
+
/**
|
|
2723
|
+
* Get a workspace by ID (admin)
|
|
2724
|
+
*/
|
|
2725
|
+
get(id: string): Promise<Workspace>;
|
|
2726
|
+
/**
|
|
2727
|
+
* Create a new workspace (requires SUPER_ADMIN)
|
|
2728
|
+
*/
|
|
2729
|
+
create(data: WorkspaceCreate): Promise<Workspace>;
|
|
2730
|
+
/**
|
|
2731
|
+
* Update workspace settings (requires ADMIN or OWNER)
|
|
2732
|
+
*/
|
|
2733
|
+
update(id: string, data: WorkspaceUpdate): Promise<Workspace>;
|
|
2734
|
+
/**
|
|
2735
|
+
* Delete a workspace (requires SUPER_ADMIN)
|
|
2736
|
+
*/
|
|
2737
|
+
delete(id: string, force?: boolean): Promise<void>;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Invites Module - Platform API
|
|
2742
|
+
*
|
|
2743
|
+
* Manage workspace invitation tokens and email invitations
|
|
2744
|
+
*/
|
|
2745
|
+
|
|
2746
|
+
type InviteTokenCreate = components['schemas']['InviteTokenCreate'];
|
|
2747
|
+
type InviteTokenSummary = components['schemas']['InviteTokenSummary'];
|
|
2748
|
+
type InviteTokenPagination = components['schemas']['InviteTokenPagination'];
|
|
2749
|
+
interface EmailInvitationRequest {
|
|
2750
|
+
email: string;
|
|
2751
|
+
usesLeft?: number;
|
|
2752
|
+
}
|
|
2753
|
+
declare class InvitesModule {
|
|
2754
|
+
private http;
|
|
2755
|
+
constructor(http: HttpClient);
|
|
2756
|
+
/**
|
|
2757
|
+
* List all invite tokens for the current workspace
|
|
2758
|
+
*/
|
|
2759
|
+
list(): Promise<InviteTokenSummary[]>;
|
|
2760
|
+
/**
|
|
2761
|
+
* Create a new invite token
|
|
2762
|
+
*/
|
|
2763
|
+
create(data: InviteTokenCreate): Promise<InviteTokenSummary>;
|
|
2764
|
+
/**
|
|
2765
|
+
* Send an email invitation
|
|
2766
|
+
*/
|
|
2767
|
+
sendEmail(data: EmailInvitationRequest): Promise<void>;
|
|
2713
2768
|
}
|
|
2714
2769
|
|
|
2715
2770
|
/**
|
|
@@ -2732,6 +2787,7 @@ declare class PlatformClient extends HttpClient {
|
|
|
2732
2787
|
entryTypes: EntryTypesModule;
|
|
2733
2788
|
workspaceMembers: WorkspaceMembersModule;
|
|
2734
2789
|
workspaces: WorkspacesModule;
|
|
2790
|
+
invites: InvitesModule;
|
|
2735
2791
|
constructor(config: PlatformClientConfig);
|
|
2736
2792
|
}
|
|
2737
2793
|
/**
|
|
@@ -2739,4 +2795,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
2739
2795
|
*/
|
|
2740
2796
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
2741
2797
|
|
|
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 };
|
|
2798
|
+
export { APIClientsModule, AssetsModule, CollectionsModule, type EmailInvitationRequest, EntriesModule, EntryTypesModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, 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, type WorkspaceCreate, WorkspaceMembersModule, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
|
package/dist/platform.d.ts
CHANGED
|
@@ -2689,11 +2689,20 @@ interface Workspace {
|
|
|
2689
2689
|
interface WorkspaceWithMembership {
|
|
2690
2690
|
workspace: Workspace;
|
|
2691
2691
|
role: string;
|
|
2692
|
-
|
|
2692
|
+
isActive: boolean;
|
|
2693
2693
|
}
|
|
2694
2694
|
interface WorkspaceActivationRequest {
|
|
2695
2695
|
workspace: string;
|
|
2696
2696
|
}
|
|
2697
|
+
interface WorkspaceCreate {
|
|
2698
|
+
name: string;
|
|
2699
|
+
slug?: string;
|
|
2700
|
+
description?: string | null;
|
|
2701
|
+
}
|
|
2702
|
+
interface WorkspaceUpdate {
|
|
2703
|
+
name?: string;
|
|
2704
|
+
description?: string | null;
|
|
2705
|
+
}
|
|
2697
2706
|
declare class WorkspacesModule {
|
|
2698
2707
|
private http;
|
|
2699
2708
|
constructor(http: HttpClient);
|
|
@@ -2710,6 +2719,52 @@ declare class WorkspacesModule {
|
|
|
2710
2719
|
* Backend accepts both, so no lookup needed
|
|
2711
2720
|
*/
|
|
2712
2721
|
setActive(workspace: string): Promise<Workspace>;
|
|
2722
|
+
/**
|
|
2723
|
+
* Get a workspace by ID (admin)
|
|
2724
|
+
*/
|
|
2725
|
+
get(id: string): Promise<Workspace>;
|
|
2726
|
+
/**
|
|
2727
|
+
* Create a new workspace (requires SUPER_ADMIN)
|
|
2728
|
+
*/
|
|
2729
|
+
create(data: WorkspaceCreate): Promise<Workspace>;
|
|
2730
|
+
/**
|
|
2731
|
+
* Update workspace settings (requires ADMIN or OWNER)
|
|
2732
|
+
*/
|
|
2733
|
+
update(id: string, data: WorkspaceUpdate): Promise<Workspace>;
|
|
2734
|
+
/**
|
|
2735
|
+
* Delete a workspace (requires SUPER_ADMIN)
|
|
2736
|
+
*/
|
|
2737
|
+
delete(id: string, force?: boolean): Promise<void>;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Invites Module - Platform API
|
|
2742
|
+
*
|
|
2743
|
+
* Manage workspace invitation tokens and email invitations
|
|
2744
|
+
*/
|
|
2745
|
+
|
|
2746
|
+
type InviteTokenCreate = components['schemas']['InviteTokenCreate'];
|
|
2747
|
+
type InviteTokenSummary = components['schemas']['InviteTokenSummary'];
|
|
2748
|
+
type InviteTokenPagination = components['schemas']['InviteTokenPagination'];
|
|
2749
|
+
interface EmailInvitationRequest {
|
|
2750
|
+
email: string;
|
|
2751
|
+
usesLeft?: number;
|
|
2752
|
+
}
|
|
2753
|
+
declare class InvitesModule {
|
|
2754
|
+
private http;
|
|
2755
|
+
constructor(http: HttpClient);
|
|
2756
|
+
/**
|
|
2757
|
+
* List all invite tokens for the current workspace
|
|
2758
|
+
*/
|
|
2759
|
+
list(): Promise<InviteTokenSummary[]>;
|
|
2760
|
+
/**
|
|
2761
|
+
* Create a new invite token
|
|
2762
|
+
*/
|
|
2763
|
+
create(data: InviteTokenCreate): Promise<InviteTokenSummary>;
|
|
2764
|
+
/**
|
|
2765
|
+
* Send an email invitation
|
|
2766
|
+
*/
|
|
2767
|
+
sendEmail(data: EmailInvitationRequest): Promise<void>;
|
|
2713
2768
|
}
|
|
2714
2769
|
|
|
2715
2770
|
/**
|
|
@@ -2732,6 +2787,7 @@ declare class PlatformClient extends HttpClient {
|
|
|
2732
2787
|
entryTypes: EntryTypesModule;
|
|
2733
2788
|
workspaceMembers: WorkspaceMembersModule;
|
|
2734
2789
|
workspaces: WorkspacesModule;
|
|
2790
|
+
invites: InvitesModule;
|
|
2735
2791
|
constructor(config: PlatformClientConfig);
|
|
2736
2792
|
}
|
|
2737
2793
|
/**
|
|
@@ -2739,4 +2795,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
2739
2795
|
*/
|
|
2740
2796
|
declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
|
|
2741
2797
|
|
|
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 };
|
|
2798
|
+
export { APIClientsModule, AssetsModule, CollectionsModule, type EmailInvitationRequest, EntriesModule, EntryTypesModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, 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, type WorkspaceCreate, WorkspaceMembersModule, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
|
package/dist/platform.js
CHANGED
|
@@ -340,6 +340,59 @@ var WorkspacesModule = class {
|
|
|
340
340
|
workspace
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
|
+
// Admin operations (require SUPER_ADMIN or appropriate permissions)
|
|
344
|
+
/**
|
|
345
|
+
* Get a workspace by ID (admin)
|
|
346
|
+
*/
|
|
347
|
+
async get(id) {
|
|
348
|
+
return this.http.get(`/api/admin/groups/${id}`);
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Create a new workspace (requires SUPER_ADMIN)
|
|
352
|
+
*/
|
|
353
|
+
async create(data) {
|
|
354
|
+
return this.http.post("/api/admin/groups", data);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Update workspace settings (requires ADMIN or OWNER)
|
|
358
|
+
*/
|
|
359
|
+
async update(id, data) {
|
|
360
|
+
return this.http.put(`/api/admin/groups/${id}`, data);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Delete a workspace (requires SUPER_ADMIN)
|
|
364
|
+
*/
|
|
365
|
+
async delete(id, force = false) {
|
|
366
|
+
const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
|
|
367
|
+
await this.http.delete(url);
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// src/platform/invites.ts
|
|
372
|
+
var InvitesModule = class {
|
|
373
|
+
constructor(http) {
|
|
374
|
+
this.http = http;
|
|
375
|
+
}
|
|
376
|
+
http;
|
|
377
|
+
/**
|
|
378
|
+
* List all invite tokens for the current workspace
|
|
379
|
+
*/
|
|
380
|
+
async list() {
|
|
381
|
+
const response = await this.http.get("/api/groups/invitations");
|
|
382
|
+
return response.items || [];
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Create a new invite token
|
|
386
|
+
*/
|
|
387
|
+
async create(data) {
|
|
388
|
+
return this.http.post("/api/groups/invitations", data);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Send an email invitation
|
|
392
|
+
*/
|
|
393
|
+
async sendEmail(data) {
|
|
394
|
+
await this.http.post("/api/groups/invitations/email", data);
|
|
395
|
+
}
|
|
343
396
|
};
|
|
344
397
|
|
|
345
398
|
// src/platform/client.ts
|
|
@@ -352,6 +405,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
352
405
|
entryTypes;
|
|
353
406
|
workspaceMembers;
|
|
354
407
|
workspaces;
|
|
408
|
+
invites;
|
|
355
409
|
constructor(config) {
|
|
356
410
|
const httpConfig = {
|
|
357
411
|
baseUrl: config.apiUrl,
|
|
@@ -367,6 +421,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
367
421
|
this.entryTypes = new EntryTypesModule(this);
|
|
368
422
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
369
423
|
this.workspaces = new WorkspacesModule(this);
|
|
424
|
+
this.invites = new InvitesModule(this);
|
|
370
425
|
}
|
|
371
426
|
};
|
|
372
427
|
function createPlatformClient(config) {
|
|
@@ -378,6 +433,7 @@ export {
|
|
|
378
433
|
CollectionsModule,
|
|
379
434
|
EntriesModule,
|
|
380
435
|
EntryTypesModule,
|
|
436
|
+
InvitesModule,
|
|
381
437
|
PlatformClient,
|
|
382
438
|
ResourcesModule,
|
|
383
439
|
WorkspaceMembersModule,
|