@inneropen/marvin-sdk 1.6.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 CHANGED
@@ -21,13 +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,
28
31
  InvitesModule: () => InvitesModule,
32
+ NotificationsModule: () => NotificationsModule,
29
33
  PlatformClient: () => PlatformClient,
30
34
  ResourcesModule: () => ResourcesModule,
35
+ WebhooksModule: () => WebhooksModule,
31
36
  WorkspaceMembersModule: () => WorkspaceMembersModule,
32
37
  WorkspacesModule: () => WorkspacesModule,
33
38
  createPlatformClient: () => createPlatformClient
@@ -572,6 +577,18 @@ var WorkspacesModule = class {
572
577
  const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
573
578
  await this.http.delete(url);
574
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
+ }
575
592
  };
576
593
 
577
594
  // src/platform/invites.ts
@@ -601,6 +618,239 @@ var InvitesModule = class {
601
618
  }
602
619
  };
603
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
+ }
852
+ };
853
+
604
854
  // src/platform/client.ts
605
855
  var PlatformClient = class extends HttpClient {
606
856
  entries;
@@ -612,6 +862,12 @@ var PlatformClient = class extends HttpClient {
612
862
  workspaceMembers;
613
863
  workspaces;
614
864
  invites;
865
+ notifications;
866
+ webhooks;
867
+ // Admin modules
868
+ adminUsers;
869
+ adminSystem;
870
+ adminMaintenance;
615
871
  constructor(config) {
616
872
  const httpConfig = {
617
873
  baseUrl: config.apiUrl,
@@ -628,6 +884,11 @@ var PlatformClient = class extends HttpClient {
628
884
  this.workspaceMembers = new WorkspaceMembersModule(this);
629
885
  this.workspaces = new WorkspacesModule(this);
630
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);
631
892
  }
632
893
  };
633
894
  function createPlatformClient(config) {
@@ -636,13 +897,18 @@ function createPlatformClient(config) {
636
897
  // Annotate the CommonJS export names for ESM import in node:
637
898
  0 && (module.exports = {
638
899
  APIClientsModule,
900
+ AdminMaintenanceModule,
901
+ AdminSystemModule,
902
+ AdminUsersModule,
639
903
  AssetsModule,
640
904
  CollectionsModule,
641
905
  EntriesModule,
642
906
  EntryTypesModule,
643
907
  InvitesModule,
908
+ NotificationsModule,
644
909
  PlatformClient,
645
910
  ResourcesModule,
911
+ WebhooksModule,
646
912
  WorkspaceMembersModule,
647
913
  WorkspacesModule,
648
914
  createPlatformClient
@@ -2703,6 +2703,12 @@ interface WorkspaceUpdate {
2703
2703
  name?: string;
2704
2704
  description?: string | null;
2705
2705
  }
2706
+ interface WorkspacePreferences {
2707
+ [key: string]: any;
2708
+ }
2709
+ interface WorkspacePreferencesUpdate {
2710
+ [key: string]: any;
2711
+ }
2706
2712
  declare class WorkspacesModule {
2707
2713
  private http;
2708
2714
  constructor(http: HttpClient);
@@ -2735,6 +2741,14 @@ declare class WorkspacesModule {
2735
2741
  * Delete a workspace (requires SUPER_ADMIN)
2736
2742
  */
2737
2743
  delete(id: string, force?: boolean): Promise<void>;
2744
+ /**
2745
+ * Get workspace preferences
2746
+ */
2747
+ getPreferences(workspaceId: string): Promise<WorkspacePreferences>;
2748
+ /**
2749
+ * Update workspace preferences
2750
+ */
2751
+ updatePreferences(workspaceId: string, data: WorkspacePreferencesUpdate): Promise<WorkspacePreferences>;
2738
2752
  }
2739
2753
 
2740
2754
  /**
@@ -2767,6 +2781,280 @@ declare class InvitesModule {
2767
2781
  sendEmail(data: EmailInvitationRequest): Promise<void>;
2768
2782
  }
2769
2783
 
2784
+ /**
2785
+ * Notifications Module - Platform API
2786
+ *
2787
+ * Manage workspace notifications
2788
+ */
2789
+
2790
+ interface Notification {
2791
+ id: string;
2792
+ name: string;
2793
+ enabled: boolean;
2794
+ eventType: string;
2795
+ url?: string;
2796
+ config?: Record<string, any>;
2797
+ }
2798
+ interface NotificationCreate {
2799
+ name: string;
2800
+ eventType: string;
2801
+ url?: string;
2802
+ enabled?: boolean;
2803
+ config?: Record<string, any>;
2804
+ }
2805
+ interface NotificationUpdate {
2806
+ name?: string;
2807
+ eventType?: string;
2808
+ url?: string;
2809
+ enabled?: boolean;
2810
+ config?: Record<string, any>;
2811
+ }
2812
+ declare class NotificationsModule {
2813
+ private http;
2814
+ constructor(http: HttpClient);
2815
+ /**
2816
+ * List all notifications for the current workspace
2817
+ */
2818
+ list(): Promise<Notification[]>;
2819
+ /**
2820
+ * Get a notification by ID
2821
+ */
2822
+ get(id: string): Promise<Notification>;
2823
+ /**
2824
+ * Create a new notification
2825
+ */
2826
+ create(data: NotificationCreate): Promise<Notification>;
2827
+ /**
2828
+ * Update a notification
2829
+ */
2830
+ update(id: string, data: NotificationUpdate): Promise<Notification>;
2831
+ /**
2832
+ * Delete a notification
2833
+ */
2834
+ delete(id: string): Promise<void>;
2835
+ /**
2836
+ * Test a notification
2837
+ */
2838
+ test(id: string): Promise<{
2839
+ success: boolean;
2840
+ message?: string;
2841
+ }>;
2842
+ }
2843
+
2844
+ /**
2845
+ * Webhooks Module - Platform API
2846
+ *
2847
+ * Manage workspace webhooks
2848
+ */
2849
+
2850
+ type Webhook = components['schemas']['WebhookRead'];
2851
+ type WebhookCreate = components['schemas']['WebhookCreate'];
2852
+ type WebhookPagination = components['schemas']['WebhookPagination'];
2853
+ type WebhookMethod = components['schemas']['WebhookMethod'];
2854
+ interface WebhookUpdate {
2855
+ name?: string;
2856
+ url?: string;
2857
+ enabled?: boolean;
2858
+ eventTypes?: string[];
2859
+ method?: WebhookMethod;
2860
+ headers?: Record<string, string>;
2861
+ }
2862
+ declare class WebhooksModule {
2863
+ private http;
2864
+ constructor(http: HttpClient);
2865
+ /**
2866
+ * List all webhooks for the current workspace
2867
+ */
2868
+ list(): Promise<Webhook[]>;
2869
+ /**
2870
+ * Get a webhook by ID
2871
+ */
2872
+ get(id: string): Promise<Webhook>;
2873
+ /**
2874
+ * Create a new webhook
2875
+ */
2876
+ create(data: WebhookCreate): Promise<Webhook>;
2877
+ /**
2878
+ * Update a webhook
2879
+ */
2880
+ update(id: string, data: WebhookUpdate): Promise<Webhook>;
2881
+ /**
2882
+ * Delete a webhook
2883
+ */
2884
+ delete(id: string): Promise<void>;
2885
+ /**
2886
+ * Test a webhook
2887
+ */
2888
+ test(id: string): Promise<{
2889
+ success: boolean;
2890
+ message?: string;
2891
+ statusCode?: number;
2892
+ }>;
2893
+ /**
2894
+ * Rerun failed webhooks
2895
+ */
2896
+ rerun(): Promise<{
2897
+ message: string;
2898
+ requeued: number;
2899
+ }>;
2900
+ }
2901
+
2902
+ /**
2903
+ * Admin Users Module - Platform API
2904
+ *
2905
+ * User management for administrators
2906
+ */
2907
+
2908
+ type User = components['schemas']['UserRead'];
2909
+ type UserCreate = components['schemas']['UserCreate'];
2910
+ type UserUpdate = components['schemas']['UserUpdate'];
2911
+ type UserPagination = components['schemas']['UserPagination'];
2912
+ type UserSummary = components['schemas']['UserSummary'];
2913
+ interface PasswordResetTokenRequest {
2914
+ userId: string;
2915
+ }
2916
+ interface PasswordResetTokenResponse {
2917
+ token: string;
2918
+ }
2919
+ interface UnlockUserRequest {
2920
+ userId: string;
2921
+ }
2922
+ declare class AdminUsersModule {
2923
+ private http;
2924
+ constructor(http: HttpClient);
2925
+ /**
2926
+ * List all users (paginated)
2927
+ */
2928
+ list(page?: number, perPage?: number): Promise<UserPagination>;
2929
+ /**
2930
+ * Get a user by ID
2931
+ */
2932
+ get(id: string): Promise<User>;
2933
+ /**
2934
+ * Update a user
2935
+ */
2936
+ update(id: string, data: UserUpdate): Promise<User>;
2937
+ /**
2938
+ * Delete a user
2939
+ */
2940
+ delete(id: string): Promise<void>;
2941
+ /**
2942
+ * Generate a password reset token for a user
2943
+ */
2944
+ generatePasswordResetToken(userId: string): Promise<PasswordResetTokenResponse>;
2945
+ /**
2946
+ * Unlock a locked user account
2947
+ */
2948
+ unlock(userId: string): Promise<void>;
2949
+ }
2950
+
2951
+ /**
2952
+ * Admin System Module - Platform API
2953
+ *
2954
+ * System information and settings for administrators
2955
+ */
2956
+
2957
+ type AdminAboutInfo = components['schemas']['AdminAboutInfo'];
2958
+ interface EmailSettings {
2959
+ host?: string;
2960
+ port?: number;
2961
+ username?: string;
2962
+ password?: string;
2963
+ from?: string;
2964
+ useTls?: boolean;
2965
+ }
2966
+ interface SystemStatistics {
2967
+ users?: number;
2968
+ workspaces?: number;
2969
+ entries?: number;
2970
+ collections?: number;
2971
+ resources?: number;
2972
+ assets?: number;
2973
+ }
2974
+ declare class AdminSystemModule {
2975
+ private http;
2976
+ constructor(http: HttpClient);
2977
+ /**
2978
+ * Get system information
2979
+ */
2980
+ getAbout(): Promise<AdminAboutInfo>;
2981
+ /**
2982
+ * Check system health
2983
+ */
2984
+ check(): Promise<{
2985
+ status: string;
2986
+ }>;
2987
+ /**
2988
+ * Get startup information
2989
+ */
2990
+ getStartupInfo(): Promise<any>;
2991
+ /**
2992
+ * Get system statistics
2993
+ */
2994
+ getStatistics(): Promise<SystemStatistics>;
2995
+ /**
2996
+ * Get email settings
2997
+ */
2998
+ getEmailSettings(): Promise<EmailSettings>;
2999
+ /**
3000
+ * Update email settings
3001
+ */
3002
+ updateEmailSettings(data: EmailSettings): Promise<EmailSettings>;
3003
+ }
3004
+
3005
+ /**
3006
+ * Admin Maintenance Module - Platform API
3007
+ *
3008
+ * System maintenance operations for administrators
3009
+ */
3010
+
3011
+ type MaintenanceSummary = components['schemas']['MaintenanceSummary'];
3012
+ type MaintenanceStorageDetails = components['schemas']['MaintenanceStorageDetails'];
3013
+ declare class AdminMaintenanceModule {
3014
+ private http;
3015
+ constructor(http: HttpClient);
3016
+ /**
3017
+ * Clean temporary files
3018
+ */
3019
+ cleanTemp(): Promise<{
3020
+ message: string;
3021
+ }>;
3022
+ /**
3023
+ * Clean up old events
3024
+ */
3025
+ cleanupEvents(): Promise<{
3026
+ message: string;
3027
+ deleted: number;
3028
+ }>;
3029
+ /**
3030
+ * Clean up expired tokens
3031
+ */
3032
+ cleanupTokens(): Promise<{
3033
+ message: string;
3034
+ deleted: number;
3035
+ }>;
3036
+ /**
3037
+ * Clear application cache
3038
+ */
3039
+ clearCache(): Promise<{
3040
+ message: string;
3041
+ }>;
3042
+ /**
3043
+ * Optimize database
3044
+ */
3045
+ optimizeDatabase(): Promise<{
3046
+ message: string;
3047
+ }>;
3048
+ /**
3049
+ * Get maintenance statistics
3050
+ */
3051
+ getStats(): Promise<MaintenanceSummary>;
3052
+ /**
3053
+ * Get storage information
3054
+ */
3055
+ getStorage(): Promise<MaintenanceStorageDetails>;
3056
+ }
3057
+
2770
3058
  /**
2771
3059
  * Platform API Client
2772
3060
  *
@@ -2788,6 +3076,11 @@ declare class PlatformClient extends HttpClient {
2788
3076
  workspaceMembers: WorkspaceMembersModule;
2789
3077
  workspaces: WorkspacesModule;
2790
3078
  invites: InvitesModule;
3079
+ notifications: NotificationsModule;
3080
+ webhooks: WebhooksModule;
3081
+ adminUsers: AdminUsersModule;
3082
+ adminSystem: AdminSystemModule;
3083
+ adminMaintenance: AdminMaintenanceModule;
2791
3084
  constructor(config: PlatformClientConfig);
2792
3085
  }
2793
3086
  /**
@@ -2795,4 +3088,4 @@ declare class PlatformClient extends HttpClient {
2795
3088
  */
2796
3089
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
2797
3090
 
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 };
3091
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, AssetsModule, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordResetTokenRequest, type PasswordResetTokenResponse, 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 SystemStatistics, type UnlockUserRequest, type User, type UserCreate, type UserPagination, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
@@ -2703,6 +2703,12 @@ interface WorkspaceUpdate {
2703
2703
  name?: string;
2704
2704
  description?: string | null;
2705
2705
  }
2706
+ interface WorkspacePreferences {
2707
+ [key: string]: any;
2708
+ }
2709
+ interface WorkspacePreferencesUpdate {
2710
+ [key: string]: any;
2711
+ }
2706
2712
  declare class WorkspacesModule {
2707
2713
  private http;
2708
2714
  constructor(http: HttpClient);
@@ -2735,6 +2741,14 @@ declare class WorkspacesModule {
2735
2741
  * Delete a workspace (requires SUPER_ADMIN)
2736
2742
  */
2737
2743
  delete(id: string, force?: boolean): Promise<void>;
2744
+ /**
2745
+ * Get workspace preferences
2746
+ */
2747
+ getPreferences(workspaceId: string): Promise<WorkspacePreferences>;
2748
+ /**
2749
+ * Update workspace preferences
2750
+ */
2751
+ updatePreferences(workspaceId: string, data: WorkspacePreferencesUpdate): Promise<WorkspacePreferences>;
2738
2752
  }
2739
2753
 
2740
2754
  /**
@@ -2767,6 +2781,280 @@ declare class InvitesModule {
2767
2781
  sendEmail(data: EmailInvitationRequest): Promise<void>;
2768
2782
  }
2769
2783
 
2784
+ /**
2785
+ * Notifications Module - Platform API
2786
+ *
2787
+ * Manage workspace notifications
2788
+ */
2789
+
2790
+ interface Notification {
2791
+ id: string;
2792
+ name: string;
2793
+ enabled: boolean;
2794
+ eventType: string;
2795
+ url?: string;
2796
+ config?: Record<string, any>;
2797
+ }
2798
+ interface NotificationCreate {
2799
+ name: string;
2800
+ eventType: string;
2801
+ url?: string;
2802
+ enabled?: boolean;
2803
+ config?: Record<string, any>;
2804
+ }
2805
+ interface NotificationUpdate {
2806
+ name?: string;
2807
+ eventType?: string;
2808
+ url?: string;
2809
+ enabled?: boolean;
2810
+ config?: Record<string, any>;
2811
+ }
2812
+ declare class NotificationsModule {
2813
+ private http;
2814
+ constructor(http: HttpClient);
2815
+ /**
2816
+ * List all notifications for the current workspace
2817
+ */
2818
+ list(): Promise<Notification[]>;
2819
+ /**
2820
+ * Get a notification by ID
2821
+ */
2822
+ get(id: string): Promise<Notification>;
2823
+ /**
2824
+ * Create a new notification
2825
+ */
2826
+ create(data: NotificationCreate): Promise<Notification>;
2827
+ /**
2828
+ * Update a notification
2829
+ */
2830
+ update(id: string, data: NotificationUpdate): Promise<Notification>;
2831
+ /**
2832
+ * Delete a notification
2833
+ */
2834
+ delete(id: string): Promise<void>;
2835
+ /**
2836
+ * Test a notification
2837
+ */
2838
+ test(id: string): Promise<{
2839
+ success: boolean;
2840
+ message?: string;
2841
+ }>;
2842
+ }
2843
+
2844
+ /**
2845
+ * Webhooks Module - Platform API
2846
+ *
2847
+ * Manage workspace webhooks
2848
+ */
2849
+
2850
+ type Webhook = components['schemas']['WebhookRead'];
2851
+ type WebhookCreate = components['schemas']['WebhookCreate'];
2852
+ type WebhookPagination = components['schemas']['WebhookPagination'];
2853
+ type WebhookMethod = components['schemas']['WebhookMethod'];
2854
+ interface WebhookUpdate {
2855
+ name?: string;
2856
+ url?: string;
2857
+ enabled?: boolean;
2858
+ eventTypes?: string[];
2859
+ method?: WebhookMethod;
2860
+ headers?: Record<string, string>;
2861
+ }
2862
+ declare class WebhooksModule {
2863
+ private http;
2864
+ constructor(http: HttpClient);
2865
+ /**
2866
+ * List all webhooks for the current workspace
2867
+ */
2868
+ list(): Promise<Webhook[]>;
2869
+ /**
2870
+ * Get a webhook by ID
2871
+ */
2872
+ get(id: string): Promise<Webhook>;
2873
+ /**
2874
+ * Create a new webhook
2875
+ */
2876
+ create(data: WebhookCreate): Promise<Webhook>;
2877
+ /**
2878
+ * Update a webhook
2879
+ */
2880
+ update(id: string, data: WebhookUpdate): Promise<Webhook>;
2881
+ /**
2882
+ * Delete a webhook
2883
+ */
2884
+ delete(id: string): Promise<void>;
2885
+ /**
2886
+ * Test a webhook
2887
+ */
2888
+ test(id: string): Promise<{
2889
+ success: boolean;
2890
+ message?: string;
2891
+ statusCode?: number;
2892
+ }>;
2893
+ /**
2894
+ * Rerun failed webhooks
2895
+ */
2896
+ rerun(): Promise<{
2897
+ message: string;
2898
+ requeued: number;
2899
+ }>;
2900
+ }
2901
+
2902
+ /**
2903
+ * Admin Users Module - Platform API
2904
+ *
2905
+ * User management for administrators
2906
+ */
2907
+
2908
+ type User = components['schemas']['UserRead'];
2909
+ type UserCreate = components['schemas']['UserCreate'];
2910
+ type UserUpdate = components['schemas']['UserUpdate'];
2911
+ type UserPagination = components['schemas']['UserPagination'];
2912
+ type UserSummary = components['schemas']['UserSummary'];
2913
+ interface PasswordResetTokenRequest {
2914
+ userId: string;
2915
+ }
2916
+ interface PasswordResetTokenResponse {
2917
+ token: string;
2918
+ }
2919
+ interface UnlockUserRequest {
2920
+ userId: string;
2921
+ }
2922
+ declare class AdminUsersModule {
2923
+ private http;
2924
+ constructor(http: HttpClient);
2925
+ /**
2926
+ * List all users (paginated)
2927
+ */
2928
+ list(page?: number, perPage?: number): Promise<UserPagination>;
2929
+ /**
2930
+ * Get a user by ID
2931
+ */
2932
+ get(id: string): Promise<User>;
2933
+ /**
2934
+ * Update a user
2935
+ */
2936
+ update(id: string, data: UserUpdate): Promise<User>;
2937
+ /**
2938
+ * Delete a user
2939
+ */
2940
+ delete(id: string): Promise<void>;
2941
+ /**
2942
+ * Generate a password reset token for a user
2943
+ */
2944
+ generatePasswordResetToken(userId: string): Promise<PasswordResetTokenResponse>;
2945
+ /**
2946
+ * Unlock a locked user account
2947
+ */
2948
+ unlock(userId: string): Promise<void>;
2949
+ }
2950
+
2951
+ /**
2952
+ * Admin System Module - Platform API
2953
+ *
2954
+ * System information and settings for administrators
2955
+ */
2956
+
2957
+ type AdminAboutInfo = components['schemas']['AdminAboutInfo'];
2958
+ interface EmailSettings {
2959
+ host?: string;
2960
+ port?: number;
2961
+ username?: string;
2962
+ password?: string;
2963
+ from?: string;
2964
+ useTls?: boolean;
2965
+ }
2966
+ interface SystemStatistics {
2967
+ users?: number;
2968
+ workspaces?: number;
2969
+ entries?: number;
2970
+ collections?: number;
2971
+ resources?: number;
2972
+ assets?: number;
2973
+ }
2974
+ declare class AdminSystemModule {
2975
+ private http;
2976
+ constructor(http: HttpClient);
2977
+ /**
2978
+ * Get system information
2979
+ */
2980
+ getAbout(): Promise<AdminAboutInfo>;
2981
+ /**
2982
+ * Check system health
2983
+ */
2984
+ check(): Promise<{
2985
+ status: string;
2986
+ }>;
2987
+ /**
2988
+ * Get startup information
2989
+ */
2990
+ getStartupInfo(): Promise<any>;
2991
+ /**
2992
+ * Get system statistics
2993
+ */
2994
+ getStatistics(): Promise<SystemStatistics>;
2995
+ /**
2996
+ * Get email settings
2997
+ */
2998
+ getEmailSettings(): Promise<EmailSettings>;
2999
+ /**
3000
+ * Update email settings
3001
+ */
3002
+ updateEmailSettings(data: EmailSettings): Promise<EmailSettings>;
3003
+ }
3004
+
3005
+ /**
3006
+ * Admin Maintenance Module - Platform API
3007
+ *
3008
+ * System maintenance operations for administrators
3009
+ */
3010
+
3011
+ type MaintenanceSummary = components['schemas']['MaintenanceSummary'];
3012
+ type MaintenanceStorageDetails = components['schemas']['MaintenanceStorageDetails'];
3013
+ declare class AdminMaintenanceModule {
3014
+ private http;
3015
+ constructor(http: HttpClient);
3016
+ /**
3017
+ * Clean temporary files
3018
+ */
3019
+ cleanTemp(): Promise<{
3020
+ message: string;
3021
+ }>;
3022
+ /**
3023
+ * Clean up old events
3024
+ */
3025
+ cleanupEvents(): Promise<{
3026
+ message: string;
3027
+ deleted: number;
3028
+ }>;
3029
+ /**
3030
+ * Clean up expired tokens
3031
+ */
3032
+ cleanupTokens(): Promise<{
3033
+ message: string;
3034
+ deleted: number;
3035
+ }>;
3036
+ /**
3037
+ * Clear application cache
3038
+ */
3039
+ clearCache(): Promise<{
3040
+ message: string;
3041
+ }>;
3042
+ /**
3043
+ * Optimize database
3044
+ */
3045
+ optimizeDatabase(): Promise<{
3046
+ message: string;
3047
+ }>;
3048
+ /**
3049
+ * Get maintenance statistics
3050
+ */
3051
+ getStats(): Promise<MaintenanceSummary>;
3052
+ /**
3053
+ * Get storage information
3054
+ */
3055
+ getStorage(): Promise<MaintenanceStorageDetails>;
3056
+ }
3057
+
2770
3058
  /**
2771
3059
  * Platform API Client
2772
3060
  *
@@ -2788,6 +3076,11 @@ declare class PlatformClient extends HttpClient {
2788
3076
  workspaceMembers: WorkspaceMembersModule;
2789
3077
  workspaces: WorkspacesModule;
2790
3078
  invites: InvitesModule;
3079
+ notifications: NotificationsModule;
3080
+ webhooks: WebhooksModule;
3081
+ adminUsers: AdminUsersModule;
3082
+ adminSystem: AdminSystemModule;
3083
+ adminMaintenance: AdminMaintenanceModule;
2791
3084
  constructor(config: PlatformClientConfig);
2792
3085
  }
2793
3086
  /**
@@ -2795,4 +3088,4 @@ declare class PlatformClient extends HttpClient {
2795
3088
  */
2796
3089
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
2797
3090
 
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 };
3091
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, AssetsModule, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordResetTokenRequest, type PasswordResetTokenResponse, 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 SystemStatistics, type UnlockUserRequest, type User, type UserCreate, type UserPagination, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient };
package/dist/platform.js CHANGED
@@ -366,6 +366,18 @@ var WorkspacesModule = class {
366
366
  const url = `/api/admin/groups/${id}${force ? "?force=true" : ""}`;
367
367
  await this.http.delete(url);
368
368
  }
369
+ /**
370
+ * Get workspace preferences
371
+ */
372
+ async getPreferences(workspaceId) {
373
+ return this.http.get(`/api/groups/${workspaceId}/preferences`);
374
+ }
375
+ /**
376
+ * Update workspace preferences
377
+ */
378
+ async updatePreferences(workspaceId, data) {
379
+ return this.http.put(`/api/groups/${workspaceId}/preferences`, data);
380
+ }
369
381
  };
370
382
 
371
383
  // src/platform/invites.ts
@@ -395,6 +407,239 @@ var InvitesModule = class {
395
407
  }
396
408
  };
397
409
 
410
+ // src/platform/notifications.ts
411
+ var NotificationsModule = class {
412
+ constructor(http) {
413
+ this.http = http;
414
+ }
415
+ http;
416
+ /**
417
+ * List all notifications for the current workspace
418
+ */
419
+ async list() {
420
+ return this.http.get("/api/group/notifications");
421
+ }
422
+ /**
423
+ * Get a notification by ID
424
+ */
425
+ async get(id) {
426
+ return this.http.get(`/api/group/notifications/${id}`);
427
+ }
428
+ /**
429
+ * Create a new notification
430
+ */
431
+ async create(data) {
432
+ return this.http.post("/api/group/notifications", data);
433
+ }
434
+ /**
435
+ * Update a notification
436
+ */
437
+ async update(id, data) {
438
+ return this.http.put(`/api/group/notifications/${id}`, data);
439
+ }
440
+ /**
441
+ * Delete a notification
442
+ */
443
+ async delete(id) {
444
+ await this.http.delete(`/api/group/notifications/${id}`);
445
+ }
446
+ /**
447
+ * Test a notification
448
+ */
449
+ async test(id) {
450
+ return this.http.post(`/api/group/notifications/${id}/test`, {});
451
+ }
452
+ };
453
+
454
+ // src/platform/webhooks.ts
455
+ var WebhooksModule = class {
456
+ constructor(http) {
457
+ this.http = http;
458
+ }
459
+ http;
460
+ /**
461
+ * List all webhooks for the current workspace
462
+ */
463
+ async list() {
464
+ const response = await this.http.get("/api/groups/webhooks");
465
+ return response.items || [];
466
+ }
467
+ /**
468
+ * Get a webhook by ID
469
+ */
470
+ async get(id) {
471
+ return this.http.get(`/api/groups/webhooks/${id}`);
472
+ }
473
+ /**
474
+ * Create a new webhook
475
+ */
476
+ async create(data) {
477
+ return this.http.post("/api/groups/webhooks", data);
478
+ }
479
+ /**
480
+ * Update a webhook
481
+ */
482
+ async update(id, data) {
483
+ return this.http.put(`/api/groups/webhooks/${id}`, data);
484
+ }
485
+ /**
486
+ * Delete a webhook
487
+ */
488
+ async delete(id) {
489
+ await this.http.delete(`/api/groups/webhooks/${id}`);
490
+ }
491
+ /**
492
+ * Test a webhook
493
+ */
494
+ async test(id) {
495
+ return this.http.post(`/api/groups/webhooks/${id}/test`, {});
496
+ }
497
+ /**
498
+ * Rerun failed webhooks
499
+ */
500
+ async rerun() {
501
+ return this.http.post("/api/groups/webhooks/rerun", {});
502
+ }
503
+ };
504
+
505
+ // src/platform/admin/users.ts
506
+ var AdminUsersModule = class {
507
+ constructor(http) {
508
+ this.http = http;
509
+ }
510
+ http;
511
+ /**
512
+ * List all users (paginated)
513
+ */
514
+ async list(page = 1, perPage = 50) {
515
+ return this.http.get(`/api/admin/users?page=${page}&per_page=${perPage}`);
516
+ }
517
+ /**
518
+ * Get a user by ID
519
+ */
520
+ async get(id) {
521
+ return this.http.get(`/api/admin/users/${id}`);
522
+ }
523
+ /**
524
+ * Update a user
525
+ */
526
+ async update(id, data) {
527
+ return this.http.put(`/api/admin/users/${id}`, data);
528
+ }
529
+ /**
530
+ * Delete a user
531
+ */
532
+ async delete(id) {
533
+ await this.http.delete(`/api/admin/users/${id}`);
534
+ }
535
+ /**
536
+ * Generate a password reset token for a user
537
+ */
538
+ async generatePasswordResetToken(userId) {
539
+ return this.http.post("/api/admin/users/password-reset-token", { userId });
540
+ }
541
+ /**
542
+ * Unlock a locked user account
543
+ */
544
+ async unlock(userId) {
545
+ await this.http.post("/api/admin/users/unlock", { userId });
546
+ }
547
+ };
548
+
549
+ // src/platform/admin/system.ts
550
+ var AdminSystemModule = class {
551
+ constructor(http) {
552
+ this.http = http;
553
+ }
554
+ http;
555
+ /**
556
+ * Get system information
557
+ */
558
+ async getAbout() {
559
+ return this.http.get("/api/admin/about");
560
+ }
561
+ /**
562
+ * Check system health
563
+ */
564
+ async check() {
565
+ return this.http.get("/api/admin/about/check");
566
+ }
567
+ /**
568
+ * Get startup information
569
+ */
570
+ async getStartupInfo() {
571
+ return this.http.get("/api/admin/about/startup-info");
572
+ }
573
+ /**
574
+ * Get system statistics
575
+ */
576
+ async getStatistics() {
577
+ return this.http.get("/api/admin/about/statistics");
578
+ }
579
+ /**
580
+ * Get email settings
581
+ */
582
+ async getEmailSettings() {
583
+ return this.http.get("/api/admin/email");
584
+ }
585
+ /**
586
+ * Update email settings
587
+ */
588
+ async updateEmailSettings(data) {
589
+ return this.http.put("/api/admin/email", data);
590
+ }
591
+ };
592
+
593
+ // src/platform/admin/maintenance.ts
594
+ var AdminMaintenanceModule = class {
595
+ constructor(http) {
596
+ this.http = http;
597
+ }
598
+ http;
599
+ /**
600
+ * Clean temporary files
601
+ */
602
+ async cleanTemp() {
603
+ return this.http.post("/api/admin/maintenance/clean/temp", {});
604
+ }
605
+ /**
606
+ * Clean up old events
607
+ */
608
+ async cleanupEvents() {
609
+ return this.http.post("/api/admin/maintenance/cleanup-events", {});
610
+ }
611
+ /**
612
+ * Clean up expired tokens
613
+ */
614
+ async cleanupTokens() {
615
+ return this.http.post("/api/admin/maintenance/cleanup-tokens", {});
616
+ }
617
+ /**
618
+ * Clear application cache
619
+ */
620
+ async clearCache() {
621
+ return this.http.post("/api/admin/maintenance/clear-cache", {});
622
+ }
623
+ /**
624
+ * Optimize database
625
+ */
626
+ async optimizeDatabase() {
627
+ return this.http.post("/api/admin/maintenance/optimize-db", {});
628
+ }
629
+ /**
630
+ * Get maintenance statistics
631
+ */
632
+ async getStats() {
633
+ return this.http.get("/api/admin/maintenance/stats");
634
+ }
635
+ /**
636
+ * Get storage information
637
+ */
638
+ async getStorage() {
639
+ return this.http.get("/api/admin/maintenance/storage");
640
+ }
641
+ };
642
+
398
643
  // src/platform/client.ts
399
644
  var PlatformClient = class extends HttpClient {
400
645
  entries;
@@ -406,6 +651,12 @@ var PlatformClient = class extends HttpClient {
406
651
  workspaceMembers;
407
652
  workspaces;
408
653
  invites;
654
+ notifications;
655
+ webhooks;
656
+ // Admin modules
657
+ adminUsers;
658
+ adminSystem;
659
+ adminMaintenance;
409
660
  constructor(config) {
410
661
  const httpConfig = {
411
662
  baseUrl: config.apiUrl,
@@ -422,6 +673,11 @@ var PlatformClient = class extends HttpClient {
422
673
  this.workspaceMembers = new WorkspaceMembersModule(this);
423
674
  this.workspaces = new WorkspacesModule(this);
424
675
  this.invites = new InvitesModule(this);
676
+ this.notifications = new NotificationsModule(this);
677
+ this.webhooks = new WebhooksModule(this);
678
+ this.adminUsers = new AdminUsersModule(this);
679
+ this.adminSystem = new AdminSystemModule(this);
680
+ this.adminMaintenance = new AdminMaintenanceModule(this);
425
681
  }
426
682
  };
427
683
  function createPlatformClient(config) {
@@ -429,13 +685,18 @@ function createPlatformClient(config) {
429
685
  }
430
686
  export {
431
687
  APIClientsModule,
688
+ AdminMaintenanceModule,
689
+ AdminSystemModule,
690
+ AdminUsersModule,
432
691
  AssetsModule,
433
692
  CollectionsModule,
434
693
  EntriesModule,
435
694
  EntryTypesModule,
436
695
  InvitesModule,
696
+ NotificationsModule,
437
697
  PlatformClient,
438
698
  ResourcesModule,
699
+ WebhooksModule,
439
700
  WorkspaceMembersModule,
440
701
  WorkspacesModule,
441
702
  createPlatformClient
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",