@inneropen/marvin-sdk 1.5.0 → 1.7.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 +323 -0
- package/dist/platform.d.cts +351 -2
- package/dist/platform.d.ts +351 -2
- package/dist/platform.js +317 -0
- package/package.json +1 -1
package/dist/platform.cjs
CHANGED
|
@@ -21,12 +21,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var platform_exports = {};
|
|
22
22
|
__export(platform_exports, {
|
|
23
23
|
APIClientsModule: () => APIClientsModule,
|
|
24
|
+
AdminMaintenanceModule: () => AdminMaintenanceModule,
|
|
25
|
+
AdminSystemModule: () => AdminSystemModule,
|
|
26
|
+
AdminUsersModule: () => AdminUsersModule,
|
|
24
27
|
AssetsModule: () => AssetsModule,
|
|
25
28
|
CollectionsModule: () => CollectionsModule,
|
|
26
29
|
EntriesModule: () => EntriesModule,
|
|
27
30
|
EntryTypesModule: () => EntryTypesModule,
|
|
31
|
+
InvitesModule: () => InvitesModule,
|
|
32
|
+
NotificationsModule: () => NotificationsModule,
|
|
28
33
|
PlatformClient: () => PlatformClient,
|
|
29
34
|
ResourcesModule: () => ResourcesModule,
|
|
35
|
+
WebhooksModule: () => WebhooksModule,
|
|
30
36
|
WorkspaceMembersModule: () => WorkspaceMembersModule,
|
|
31
37
|
WorkspacesModule: () => WorkspacesModule,
|
|
32
38
|
createPlatformClient: () => createPlatformClient
|
|
@@ -545,6 +551,304 @@ var WorkspacesModule = class {
|
|
|
545
551
|
workspace
|
|
546
552
|
});
|
|
547
553
|
}
|
|
554
|
+
// Admin operations (require SUPER_ADMIN or appropriate permissions)
|
|
555
|
+
/**
|
|
556
|
+
* Get a workspace by ID (admin)
|
|
557
|
+
*/
|
|
558
|
+
async get(id) {
|
|
559
|
+
return this.http.get(`/api/admin/groups/${id}`);
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Create a new workspace (requires SUPER_ADMIN)
|
|
563
|
+
*/
|
|
564
|
+
async create(data) {
|
|
565
|
+
return this.http.post("/api/admin/groups", data);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Update workspace settings (requires ADMIN or OWNER)
|
|
569
|
+
*/
|
|
570
|
+
async update(id, data) {
|
|
571
|
+
return this.http.put(`/api/admin/groups/${id}`, data);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Delete a workspace (requires SUPER_ADMIN)
|
|
575
|
+
*/
|
|
576
|
+
async delete(id, force = false) {
|
|
577
|
+
const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
|
|
578
|
+
await this.http.delete(url);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Get workspace preferences
|
|
582
|
+
*/
|
|
583
|
+
async getPreferences(workspaceId) {
|
|
584
|
+
return this.http.get(`/api/groups/${workspaceId}/preferences`);
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Update workspace preferences
|
|
588
|
+
*/
|
|
589
|
+
async updatePreferences(workspaceId, data) {
|
|
590
|
+
return this.http.put(`/api/groups/${workspaceId}/preferences`, data);
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
// src/platform/invites.ts
|
|
595
|
+
var InvitesModule = class {
|
|
596
|
+
constructor(http) {
|
|
597
|
+
this.http = http;
|
|
598
|
+
}
|
|
599
|
+
http;
|
|
600
|
+
/**
|
|
601
|
+
* List all invite tokens for the current workspace
|
|
602
|
+
*/
|
|
603
|
+
async list() {
|
|
604
|
+
const response = await this.http.get("/api/groups/invitations");
|
|
605
|
+
return response.items || [];
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Create a new invite token
|
|
609
|
+
*/
|
|
610
|
+
async create(data) {
|
|
611
|
+
return this.http.post("/api/groups/invitations", data);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Send an email invitation
|
|
615
|
+
*/
|
|
616
|
+
async sendEmail(data) {
|
|
617
|
+
await this.http.post("/api/groups/invitations/email", data);
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
// src/platform/notifications.ts
|
|
622
|
+
var NotificationsModule = class {
|
|
623
|
+
constructor(http) {
|
|
624
|
+
this.http = http;
|
|
625
|
+
}
|
|
626
|
+
http;
|
|
627
|
+
/**
|
|
628
|
+
* List all notifications for the current workspace
|
|
629
|
+
*/
|
|
630
|
+
async list() {
|
|
631
|
+
return this.http.get("/api/group/notifications");
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Get a notification by ID
|
|
635
|
+
*/
|
|
636
|
+
async get(id) {
|
|
637
|
+
return this.http.get(`/api/group/notifications/${id}`);
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Create a new notification
|
|
641
|
+
*/
|
|
642
|
+
async create(data) {
|
|
643
|
+
return this.http.post("/api/group/notifications", data);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Update a notification
|
|
647
|
+
*/
|
|
648
|
+
async update(id, data) {
|
|
649
|
+
return this.http.put(`/api/group/notifications/${id}`, data);
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Delete a notification
|
|
653
|
+
*/
|
|
654
|
+
async delete(id) {
|
|
655
|
+
await this.http.delete(`/api/group/notifications/${id}`);
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Test a notification
|
|
659
|
+
*/
|
|
660
|
+
async test(id) {
|
|
661
|
+
return this.http.post(`/api/group/notifications/${id}/test`, {});
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
// src/platform/webhooks.ts
|
|
666
|
+
var WebhooksModule = class {
|
|
667
|
+
constructor(http) {
|
|
668
|
+
this.http = http;
|
|
669
|
+
}
|
|
670
|
+
http;
|
|
671
|
+
/**
|
|
672
|
+
* List all webhooks for the current workspace
|
|
673
|
+
*/
|
|
674
|
+
async list() {
|
|
675
|
+
const response = await this.http.get("/api/groups/webhooks");
|
|
676
|
+
return response.items || [];
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Get a webhook by ID
|
|
680
|
+
*/
|
|
681
|
+
async get(id) {
|
|
682
|
+
return this.http.get(`/api/groups/webhooks/${id}`);
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Create a new webhook
|
|
686
|
+
*/
|
|
687
|
+
async create(data) {
|
|
688
|
+
return this.http.post("/api/groups/webhooks", data);
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Update a webhook
|
|
692
|
+
*/
|
|
693
|
+
async update(id, data) {
|
|
694
|
+
return this.http.put(`/api/groups/webhooks/${id}`, data);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Delete a webhook
|
|
698
|
+
*/
|
|
699
|
+
async delete(id) {
|
|
700
|
+
await this.http.delete(`/api/groups/webhooks/${id}`);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Test a webhook
|
|
704
|
+
*/
|
|
705
|
+
async test(id) {
|
|
706
|
+
return this.http.post(`/api/groups/webhooks/${id}/test`, {});
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Rerun failed webhooks
|
|
710
|
+
*/
|
|
711
|
+
async rerun() {
|
|
712
|
+
return this.http.post("/api/groups/webhooks/rerun", {});
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
// src/platform/admin/users.ts
|
|
717
|
+
var AdminUsersModule = class {
|
|
718
|
+
constructor(http) {
|
|
719
|
+
this.http = http;
|
|
720
|
+
}
|
|
721
|
+
http;
|
|
722
|
+
/**
|
|
723
|
+
* List all users (paginated)
|
|
724
|
+
*/
|
|
725
|
+
async list(page = 1, perPage = 50) {
|
|
726
|
+
return this.http.get(`/api/admin/users?page=${page}&per_page=${perPage}`);
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Get a user by ID
|
|
730
|
+
*/
|
|
731
|
+
async get(id) {
|
|
732
|
+
return this.http.get(`/api/admin/users/${id}`);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Update a user
|
|
736
|
+
*/
|
|
737
|
+
async update(id, data) {
|
|
738
|
+
return this.http.put(`/api/admin/users/${id}`, data);
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Delete a user
|
|
742
|
+
*/
|
|
743
|
+
async delete(id) {
|
|
744
|
+
await this.http.delete(`/api/admin/users/${id}`);
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Generate a password reset token for a user
|
|
748
|
+
*/
|
|
749
|
+
async generatePasswordResetToken(userId) {
|
|
750
|
+
return this.http.post("/api/admin/users/password-reset-token", { userId });
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Unlock a locked user account
|
|
754
|
+
*/
|
|
755
|
+
async unlock(userId) {
|
|
756
|
+
await this.http.post("/api/admin/users/unlock", { userId });
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
// src/platform/admin/system.ts
|
|
761
|
+
var AdminSystemModule = class {
|
|
762
|
+
constructor(http) {
|
|
763
|
+
this.http = http;
|
|
764
|
+
}
|
|
765
|
+
http;
|
|
766
|
+
/**
|
|
767
|
+
* Get system information
|
|
768
|
+
*/
|
|
769
|
+
async getAbout() {
|
|
770
|
+
return this.http.get("/api/admin/about");
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Check system health
|
|
774
|
+
*/
|
|
775
|
+
async check() {
|
|
776
|
+
return this.http.get("/api/admin/about/check");
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Get startup information
|
|
780
|
+
*/
|
|
781
|
+
async getStartupInfo() {
|
|
782
|
+
return this.http.get("/api/admin/about/startup-info");
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Get system statistics
|
|
786
|
+
*/
|
|
787
|
+
async getStatistics() {
|
|
788
|
+
return this.http.get("/api/admin/about/statistics");
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Get email settings
|
|
792
|
+
*/
|
|
793
|
+
async getEmailSettings() {
|
|
794
|
+
return this.http.get("/api/admin/email");
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Update email settings
|
|
798
|
+
*/
|
|
799
|
+
async updateEmailSettings(data) {
|
|
800
|
+
return this.http.put("/api/admin/email", data);
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
// src/platform/admin/maintenance.ts
|
|
805
|
+
var AdminMaintenanceModule = class {
|
|
806
|
+
constructor(http) {
|
|
807
|
+
this.http = http;
|
|
808
|
+
}
|
|
809
|
+
http;
|
|
810
|
+
/**
|
|
811
|
+
* Clean temporary files
|
|
812
|
+
*/
|
|
813
|
+
async cleanTemp() {
|
|
814
|
+
return this.http.post("/api/admin/maintenance/clean/temp", {});
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Clean up old events
|
|
818
|
+
*/
|
|
819
|
+
async cleanupEvents() {
|
|
820
|
+
return this.http.post("/api/admin/maintenance/cleanup-events", {});
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Clean up expired tokens
|
|
824
|
+
*/
|
|
825
|
+
async cleanupTokens() {
|
|
826
|
+
return this.http.post("/api/admin/maintenance/cleanup-tokens", {});
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Clear application cache
|
|
830
|
+
*/
|
|
831
|
+
async clearCache() {
|
|
832
|
+
return this.http.post("/api/admin/maintenance/clear-cache", {});
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Optimize database
|
|
836
|
+
*/
|
|
837
|
+
async optimizeDatabase() {
|
|
838
|
+
return this.http.post("/api/admin/maintenance/optimize-db", {});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Get maintenance statistics
|
|
842
|
+
*/
|
|
843
|
+
async getStats() {
|
|
844
|
+
return this.http.get("/api/admin/maintenance/stats");
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Get storage information
|
|
848
|
+
*/
|
|
849
|
+
async getStorage() {
|
|
850
|
+
return this.http.get("/api/admin/maintenance/storage");
|
|
851
|
+
}
|
|
548
852
|
};
|
|
549
853
|
|
|
550
854
|
// src/platform/client.ts
|
|
@@ -557,6 +861,13 @@ var PlatformClient = class extends HttpClient {
|
|
|
557
861
|
entryTypes;
|
|
558
862
|
workspaceMembers;
|
|
559
863
|
workspaces;
|
|
864
|
+
invites;
|
|
865
|
+
notifications;
|
|
866
|
+
webhooks;
|
|
867
|
+
// Admin modules
|
|
868
|
+
adminUsers;
|
|
869
|
+
adminSystem;
|
|
870
|
+
adminMaintenance;
|
|
560
871
|
constructor(config) {
|
|
561
872
|
const httpConfig = {
|
|
562
873
|
baseUrl: config.apiUrl,
|
|
@@ -572,6 +883,12 @@ var PlatformClient = class extends HttpClient {
|
|
|
572
883
|
this.entryTypes = new EntryTypesModule(this);
|
|
573
884
|
this.workspaceMembers = new WorkspaceMembersModule(this);
|
|
574
885
|
this.workspaces = new WorkspacesModule(this);
|
|
886
|
+
this.invites = new InvitesModule(this);
|
|
887
|
+
this.notifications = new NotificationsModule(this);
|
|
888
|
+
this.webhooks = new WebhooksModule(this);
|
|
889
|
+
this.adminUsers = new AdminUsersModule(this);
|
|
890
|
+
this.adminSystem = new AdminSystemModule(this);
|
|
891
|
+
this.adminMaintenance = new AdminMaintenanceModule(this);
|
|
575
892
|
}
|
|
576
893
|
};
|
|
577
894
|
function createPlatformClient(config) {
|
|
@@ -580,12 +897,18 @@ function createPlatformClient(config) {
|
|
|
580
897
|
// Annotate the CommonJS export names for ESM import in node:
|
|
581
898
|
0 && (module.exports = {
|
|
582
899
|
APIClientsModule,
|
|
900
|
+
AdminMaintenanceModule,
|
|
901
|
+
AdminSystemModule,
|
|
902
|
+
AdminUsersModule,
|
|
583
903
|
AssetsModule,
|
|
584
904
|
CollectionsModule,
|
|
585
905
|
EntriesModule,
|
|
586
906
|
EntryTypesModule,
|
|
907
|
+
InvitesModule,
|
|
908
|
+
NotificationsModule,
|
|
587
909
|
PlatformClient,
|
|
588
910
|
ResourcesModule,
|
|
911
|
+
WebhooksModule,
|
|
589
912
|
WorkspaceMembersModule,
|
|
590
913
|
WorkspacesModule,
|
|
591
914
|
createPlatformClient
|