@inneropen/marvin-sdk 1.7.0 → 1.8.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/index.cjs CHANGED
@@ -1116,6 +1116,7 @@ var init_marvin = __esm({
1116
1116
  // src/index.ts
1117
1117
  var index_exports = {};
1118
1118
  __export(index_exports, {
1119
+ AuthClient: () => AuthClient,
1119
1120
  BearerTokenAuth: () => BearerTokenAuth,
1120
1121
  Collection: () => Collection,
1121
1122
  Entry: () => Entry,
@@ -1131,6 +1132,7 @@ __export(index_exports, {
1131
1132
  Resource: () => Resource,
1132
1133
  SessionAuth: () => SessionAuth,
1133
1134
  Workspace: () => Workspace,
1135
+ createAuthClient: () => createAuthClient,
1134
1136
  createConfigFromEnv: () => createConfigFromEnv,
1135
1137
  createMarvinClient: () => createMarvinClient,
1136
1138
  createPaginatedResponse: () => createPaginatedResponse,
@@ -1147,6 +1149,37 @@ init_workspace();
1147
1149
  init_entry();
1148
1150
  init_collection();
1149
1151
  init_resource();
1152
+
1153
+ // src/auth.ts
1154
+ init_core();
1155
+ var AuthClient = class extends HttpClient {
1156
+ constructor(apiUrl) {
1157
+ super({ baseUrl: apiUrl, auth: new NoAuth() });
1158
+ }
1159
+ /**
1160
+ * Register a new user
1161
+ */
1162
+ async register(data) {
1163
+ return this.post("/api/users/register", data);
1164
+ }
1165
+ /**
1166
+ * Request password reset (sends email with token)
1167
+ */
1168
+ async forgotPassword(data) {
1169
+ return this.post("/api/users/forgot-password", data);
1170
+ }
1171
+ /**
1172
+ * Reset password with token from email
1173
+ */
1174
+ async resetPassword(data) {
1175
+ return this.post("/api/users/reset-password", data);
1176
+ }
1177
+ };
1178
+ function createAuthClient(apiUrl) {
1179
+ return new AuthClient(apiUrl);
1180
+ }
1181
+
1182
+ // src/index.ts
1150
1183
  function createMarvinClient(config) {
1151
1184
  const { MarvinClient: MarvinClient2 } = (init_marvin(), __toCommonJS(marvin_exports));
1152
1185
  const { createConfigFromEnv: createConfigFromEnv2 } = (init_config(), __toCommonJS(config_exports));
@@ -1155,6 +1188,7 @@ function createMarvinClient(config) {
1155
1188
  }
1156
1189
  // Annotate the CommonJS export names for ESM import in node:
1157
1190
  0 && (module.exports = {
1191
+ AuthClient,
1158
1192
  BearerTokenAuth,
1159
1193
  Collection,
1160
1194
  Entry,
@@ -1170,6 +1204,7 @@ function createMarvinClient(config) {
1170
1204
  Resource,
1171
1205
  SessionAuth,
1172
1206
  Workspace,
1207
+ createAuthClient,
1173
1208
  createConfigFromEnv,
1174
1209
  createMarvinClient,
1175
1210
  createPaginatedResponse,
package/dist/index.d.cts CHANGED
@@ -504,6 +504,52 @@ declare class MarvinClient {
504
504
  getResourceEntries(slug: string): Promise<MarvinEntry[]>;
505
505
  }
506
506
 
507
+ /**
508
+ * Authentication & User Registration
509
+ *
510
+ * Public authentication endpoints (no auth required)
511
+ */
512
+
513
+ interface UserRegistration {
514
+ username: string;
515
+ email: string;
516
+ password: string;
517
+ fullName?: string;
518
+ }
519
+ interface ForgotPasswordRequest {
520
+ email: string;
521
+ }
522
+ interface ResetPasswordRequest {
523
+ token: string;
524
+ newPassword: string;
525
+ }
526
+ declare class AuthClient extends HttpClient {
527
+ constructor(apiUrl: string);
528
+ /**
529
+ * Register a new user
530
+ */
531
+ register(data: UserRegistration): Promise<{
532
+ message: string;
533
+ userId: string;
534
+ }>;
535
+ /**
536
+ * Request password reset (sends email with token)
537
+ */
538
+ forgotPassword(data: ForgotPasswordRequest): Promise<{
539
+ message: string;
540
+ }>;
541
+ /**
542
+ * Reset password with token from email
543
+ */
544
+ resetPassword(data: ResetPasswordRequest): Promise<{
545
+ message: string;
546
+ }>;
547
+ }
548
+ /**
549
+ * Create an Auth client for registration and password reset
550
+ */
551
+ declare function createAuthClient(apiUrl: string): AuthClient;
552
+
507
553
  /**
508
554
  * Create a Marvin client instance from environment variables
509
555
  *
@@ -524,4 +570,4 @@ declare class MarvinClient {
524
570
  */
525
571
  declare function createMarvinClient(config?: Partial<MarvinConfig>): MarvinClient;
526
572
 
527
- export { Collection, Entry, GetResourcesOptions$1 as GetResourcesOptions, HttpClient, MarvinApiError, MarvinAsset, MarvinAuthError, MarvinCache, MarvinClient, MarvinCollection, type MarvinConfig, MarvinConfigError, MarvinEntry, MarvinEntryType, MarvinError, MarvinResource, MarvinSite, MarvinValidationError, type PaginatedResponse, type PaginationMeta, type PaginationParams, Resource, Workspace, createConfigFromEnv, createMarvinClient, createPaginatedResponse, extractData, isPaginatedResponse, offsetToPage, pageToOffset };
573
+ export { AuthClient, Collection, Entry, type ForgotPasswordRequest, GetResourcesOptions$1 as GetResourcesOptions, HttpClient, MarvinApiError, MarvinAsset, MarvinAuthError, MarvinCache, MarvinClient, MarvinCollection, type MarvinConfig, MarvinConfigError, MarvinEntry, MarvinEntryType, MarvinError, MarvinResource, MarvinSite, MarvinValidationError, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ResetPasswordRequest, Resource, type UserRegistration, Workspace, createAuthClient, createConfigFromEnv, createMarvinClient, createPaginatedResponse, extractData, isPaginatedResponse, offsetToPage, pageToOffset };
package/dist/index.d.ts CHANGED
@@ -504,6 +504,52 @@ declare class MarvinClient {
504
504
  getResourceEntries(slug: string): Promise<MarvinEntry[]>;
505
505
  }
506
506
 
507
+ /**
508
+ * Authentication & User Registration
509
+ *
510
+ * Public authentication endpoints (no auth required)
511
+ */
512
+
513
+ interface UserRegistration {
514
+ username: string;
515
+ email: string;
516
+ password: string;
517
+ fullName?: string;
518
+ }
519
+ interface ForgotPasswordRequest {
520
+ email: string;
521
+ }
522
+ interface ResetPasswordRequest {
523
+ token: string;
524
+ newPassword: string;
525
+ }
526
+ declare class AuthClient extends HttpClient {
527
+ constructor(apiUrl: string);
528
+ /**
529
+ * Register a new user
530
+ */
531
+ register(data: UserRegistration): Promise<{
532
+ message: string;
533
+ userId: string;
534
+ }>;
535
+ /**
536
+ * Request password reset (sends email with token)
537
+ */
538
+ forgotPassword(data: ForgotPasswordRequest): Promise<{
539
+ message: string;
540
+ }>;
541
+ /**
542
+ * Reset password with token from email
543
+ */
544
+ resetPassword(data: ResetPasswordRequest): Promise<{
545
+ message: string;
546
+ }>;
547
+ }
548
+ /**
549
+ * Create an Auth client for registration and password reset
550
+ */
551
+ declare function createAuthClient(apiUrl: string): AuthClient;
552
+
507
553
  /**
508
554
  * Create a Marvin client instance from environment variables
509
555
  *
@@ -524,4 +570,4 @@ declare class MarvinClient {
524
570
  */
525
571
  declare function createMarvinClient(config?: Partial<MarvinConfig>): MarvinClient;
526
572
 
527
- export { Collection, Entry, GetResourcesOptions$1 as GetResourcesOptions, HttpClient, MarvinApiError, MarvinAsset, MarvinAuthError, MarvinCache, MarvinClient, MarvinCollection, type MarvinConfig, MarvinConfigError, MarvinEntry, MarvinEntryType, MarvinError, MarvinResource, MarvinSite, MarvinValidationError, type PaginatedResponse, type PaginationMeta, type PaginationParams, Resource, Workspace, createConfigFromEnv, createMarvinClient, createPaginatedResponse, extractData, isPaginatedResponse, offsetToPage, pageToOffset };
573
+ export { AuthClient, Collection, Entry, type ForgotPasswordRequest, GetResourcesOptions$1 as GetResourcesOptions, HttpClient, MarvinApiError, MarvinAsset, MarvinAuthError, MarvinCache, MarvinClient, MarvinCollection, type MarvinConfig, MarvinConfigError, MarvinEntry, MarvinEntryType, MarvinError, MarvinResource, MarvinSite, MarvinValidationError, type PaginatedResponse, type PaginationMeta, type PaginationParams, type ResetPasswordRequest, Resource, type UserRegistration, Workspace, createAuthClient, createConfigFromEnv, createMarvinClient, createPaginatedResponse, extractData, isPaginatedResponse, offsetToPage, pageToOffset };
package/dist/index.js CHANGED
@@ -772,6 +772,37 @@ init_workspace();
772
772
  init_entry();
773
773
  init_collection();
774
774
  init_resource();
775
+
776
+ // src/auth.ts
777
+ init_core();
778
+ var AuthClient = class extends HttpClient {
779
+ constructor(apiUrl) {
780
+ super({ baseUrl: apiUrl, auth: new NoAuth() });
781
+ }
782
+ /**
783
+ * Register a new user
784
+ */
785
+ async register(data) {
786
+ return this.post("/api/users/register", data);
787
+ }
788
+ /**
789
+ * Request password reset (sends email with token)
790
+ */
791
+ async forgotPassword(data) {
792
+ return this.post("/api/users/forgot-password", data);
793
+ }
794
+ /**
795
+ * Reset password with token from email
796
+ */
797
+ async resetPassword(data) {
798
+ return this.post("/api/users/reset-password", data);
799
+ }
800
+ };
801
+ function createAuthClient(apiUrl) {
802
+ return new AuthClient(apiUrl);
803
+ }
804
+
805
+ // src/index.ts
775
806
  function createMarvinClient(config) {
776
807
  const { MarvinClient: MarvinClient2 } = (init_marvin(), __toCommonJS(marvin_exports));
777
808
  const { createConfigFromEnv: createConfigFromEnv2 } = (init_config(), __toCommonJS(config_exports));
@@ -779,6 +810,7 @@ function createMarvinClient(config) {
779
810
  return new MarvinClient2(finalConfig);
780
811
  }
781
812
  export {
813
+ AuthClient,
782
814
  BearerTokenAuth,
783
815
  Collection,
784
816
  Entry,
@@ -794,6 +826,7 @@ export {
794
826
  Resource,
795
827
  SessionAuth,
796
828
  Workspace,
829
+ createAuthClient,
797
830
  createConfigFromEnv,
798
831
  createMarvinClient,
799
832
  createPaginatedResponse,
package/dist/platform.cjs CHANGED
@@ -28,10 +28,12 @@ __export(platform_exports, {
28
28
  CollectionsModule: () => CollectionsModule,
29
29
  EntriesModule: () => EntriesModule,
30
30
  EntryTypesModule: () => EntryTypesModule,
31
+ EventsModule: () => EventsModule,
31
32
  InvitesModule: () => InvitesModule,
32
33
  NotificationsModule: () => NotificationsModule,
33
34
  PlatformClient: () => PlatformClient,
34
35
  ResourcesModule: () => ResourcesModule,
36
+ UserModule: () => UserModule,
35
37
  WebhooksModule: () => WebhooksModule,
36
38
  WorkspaceMembersModule: () => WorkspaceMembersModule,
37
39
  WorkspacesModule: () => WorkspacesModule,
@@ -851,6 +853,70 @@ var AdminMaintenanceModule = class {
851
853
  }
852
854
  };
853
855
 
856
+ // src/platform/user.ts
857
+ var UserModule = class {
858
+ constructor(http) {
859
+ this.http = http;
860
+ }
861
+ http;
862
+ /**
863
+ * Get current user profile
864
+ */
865
+ async getProfile() {
866
+ return this.http.get("/api/self");
867
+ }
868
+ /**
869
+ * List personal API tokens
870
+ */
871
+ async listApiTokens() {
872
+ return this.http.get("/api/self/api-tokens");
873
+ }
874
+ /**
875
+ * Create a new personal API token
876
+ */
877
+ async createApiToken(data) {
878
+ return this.http.post("/api/self/api-tokens", data);
879
+ }
880
+ /**
881
+ * Revoke an API token
882
+ */
883
+ async revokeApiToken(tokenId) {
884
+ await this.http.post(`/api/self/api-tokens/${tokenId}/revoke`, {});
885
+ }
886
+ /**
887
+ * Rotate an API token (revoke old, create new)
888
+ */
889
+ async rotateApiToken(tokenId) {
890
+ return this.http.post(`/api/self/api-tokens/${tokenId}/rotate`, {});
891
+ }
892
+ /**
893
+ * Delete an API token
894
+ */
895
+ async deleteApiToken(tokenId) {
896
+ await this.http.delete(`/api/self/api-tokens/${tokenId}`);
897
+ }
898
+ /**
899
+ * Change password
900
+ */
901
+ async changePassword(data) {
902
+ await this.http.put("/api/self/password", data);
903
+ }
904
+ };
905
+
906
+ // src/platform/events.ts
907
+ var EventsModule = class {
908
+ constructor(http) {
909
+ this.http = http;
910
+ }
911
+ http;
912
+ /**
913
+ * Get available event types for webhooks and notifications
914
+ */
915
+ async getOptions() {
916
+ return this.http.get("/api/event/options");
917
+ }
918
+ };
919
+
854
920
  // src/platform/client.ts
855
921
  var PlatformClient = class extends HttpClient {
856
922
  entries;
@@ -864,6 +930,8 @@ var PlatformClient = class extends HttpClient {
864
930
  invites;
865
931
  notifications;
866
932
  webhooks;
933
+ user;
934
+ events;
867
935
  // Admin modules
868
936
  adminUsers;
869
937
  adminSystem;
@@ -886,6 +954,8 @@ var PlatformClient = class extends HttpClient {
886
954
  this.invites = new InvitesModule(this);
887
955
  this.notifications = new NotificationsModule(this);
888
956
  this.webhooks = new WebhooksModule(this);
957
+ this.user = new UserModule(this);
958
+ this.events = new EventsModule(this);
889
959
  this.adminUsers = new AdminUsersModule(this);
890
960
  this.adminSystem = new AdminSystemModule(this);
891
961
  this.adminMaintenance = new AdminMaintenanceModule(this);
@@ -904,10 +974,12 @@ function createPlatformClient(config) {
904
974
  CollectionsModule,
905
975
  EntriesModule,
906
976
  EntryTypesModule,
977
+ EventsModule,
907
978
  InvitesModule,
908
979
  NotificationsModule,
909
980
  PlatformClient,
910
981
  ResourcesModule,
982
+ UserModule,
911
983
  WebhooksModule,
912
984
  WorkspaceMembersModule,
913
985
  WorkspacesModule,
@@ -3055,6 +3055,92 @@ declare class AdminMaintenanceModule {
3055
3055
  getStorage(): Promise<MaintenanceStorageDetails>;
3056
3056
  }
3057
3057
 
3058
+ /**
3059
+ * User Self-Service Module - Platform API
3060
+ *
3061
+ * User profile and personal API token management
3062
+ */
3063
+
3064
+ interface UserProfile {
3065
+ id: string;
3066
+ username: string;
3067
+ email: string;
3068
+ fullName?: string | null;
3069
+ admin: boolean;
3070
+ }
3071
+ interface ApiToken {
3072
+ id: string;
3073
+ name: string;
3074
+ description?: string | null;
3075
+ lastUsedAt?: string | null;
3076
+ createdAt: string;
3077
+ expiresAt?: string | null;
3078
+ }
3079
+ interface ApiTokenCreate {
3080
+ name: string;
3081
+ description?: string | null;
3082
+ expiresAt?: string | null;
3083
+ }
3084
+ interface ApiTokenWithToken extends ApiToken {
3085
+ token: string;
3086
+ }
3087
+ interface PasswordChange {
3088
+ currentPassword: string;
3089
+ newPassword: string;
3090
+ }
3091
+ declare class UserModule {
3092
+ private http;
3093
+ constructor(http: HttpClient);
3094
+ /**
3095
+ * Get current user profile
3096
+ */
3097
+ getProfile(): Promise<UserProfile>;
3098
+ /**
3099
+ * List personal API tokens
3100
+ */
3101
+ listApiTokens(): Promise<ApiToken[]>;
3102
+ /**
3103
+ * Create a new personal API token
3104
+ */
3105
+ createApiToken(data: ApiTokenCreate): Promise<ApiTokenWithToken>;
3106
+ /**
3107
+ * Revoke an API token
3108
+ */
3109
+ revokeApiToken(tokenId: string): Promise<void>;
3110
+ /**
3111
+ * Rotate an API token (revoke old, create new)
3112
+ */
3113
+ rotateApiToken(tokenId: string): Promise<ApiTokenWithToken>;
3114
+ /**
3115
+ * Delete an API token
3116
+ */
3117
+ deleteApiToken(tokenId: string): Promise<void>;
3118
+ /**
3119
+ * Change password
3120
+ */
3121
+ changePassword(data: PasswordChange): Promise<void>;
3122
+ }
3123
+
3124
+ /**
3125
+ * Events Module - Platform API
3126
+ *
3127
+ * Event type information for webhooks and notifications
3128
+ */
3129
+
3130
+ interface EventOption {
3131
+ value: string;
3132
+ label: string;
3133
+ description?: string;
3134
+ }
3135
+ declare class EventsModule {
3136
+ private http;
3137
+ constructor(http: HttpClient);
3138
+ /**
3139
+ * Get available event types for webhooks and notifications
3140
+ */
3141
+ getOptions(): Promise<EventOption[]>;
3142
+ }
3143
+
3058
3144
  /**
3059
3145
  * Platform API Client
3060
3146
  *
@@ -3078,6 +3164,8 @@ declare class PlatformClient extends HttpClient {
3078
3164
  invites: InvitesModule;
3079
3165
  notifications: NotificationsModule;
3080
3166
  webhooks: WebhooksModule;
3167
+ user: UserModule;
3168
+ events: EventsModule;
3081
3169
  adminUsers: AdminUsersModule;
3082
3170
  adminSystem: AdminSystemModule;
3083
3171
  adminMaintenance: AdminMaintenanceModule;
@@ -3088,4 +3176,4 @@ declare class PlatformClient extends HttpClient {
3088
3176
  */
3089
3177
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3090
3178
 
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 };
3179
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, AssetsModule, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventOption, EventsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordChange, 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, UserModule, type UserPagination, type UserProfile, 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 };
@@ -3055,6 +3055,92 @@ declare class AdminMaintenanceModule {
3055
3055
  getStorage(): Promise<MaintenanceStorageDetails>;
3056
3056
  }
3057
3057
 
3058
+ /**
3059
+ * User Self-Service Module - Platform API
3060
+ *
3061
+ * User profile and personal API token management
3062
+ */
3063
+
3064
+ interface UserProfile {
3065
+ id: string;
3066
+ username: string;
3067
+ email: string;
3068
+ fullName?: string | null;
3069
+ admin: boolean;
3070
+ }
3071
+ interface ApiToken {
3072
+ id: string;
3073
+ name: string;
3074
+ description?: string | null;
3075
+ lastUsedAt?: string | null;
3076
+ createdAt: string;
3077
+ expiresAt?: string | null;
3078
+ }
3079
+ interface ApiTokenCreate {
3080
+ name: string;
3081
+ description?: string | null;
3082
+ expiresAt?: string | null;
3083
+ }
3084
+ interface ApiTokenWithToken extends ApiToken {
3085
+ token: string;
3086
+ }
3087
+ interface PasswordChange {
3088
+ currentPassword: string;
3089
+ newPassword: string;
3090
+ }
3091
+ declare class UserModule {
3092
+ private http;
3093
+ constructor(http: HttpClient);
3094
+ /**
3095
+ * Get current user profile
3096
+ */
3097
+ getProfile(): Promise<UserProfile>;
3098
+ /**
3099
+ * List personal API tokens
3100
+ */
3101
+ listApiTokens(): Promise<ApiToken[]>;
3102
+ /**
3103
+ * Create a new personal API token
3104
+ */
3105
+ createApiToken(data: ApiTokenCreate): Promise<ApiTokenWithToken>;
3106
+ /**
3107
+ * Revoke an API token
3108
+ */
3109
+ revokeApiToken(tokenId: string): Promise<void>;
3110
+ /**
3111
+ * Rotate an API token (revoke old, create new)
3112
+ */
3113
+ rotateApiToken(tokenId: string): Promise<ApiTokenWithToken>;
3114
+ /**
3115
+ * Delete an API token
3116
+ */
3117
+ deleteApiToken(tokenId: string): Promise<void>;
3118
+ /**
3119
+ * Change password
3120
+ */
3121
+ changePassword(data: PasswordChange): Promise<void>;
3122
+ }
3123
+
3124
+ /**
3125
+ * Events Module - Platform API
3126
+ *
3127
+ * Event type information for webhooks and notifications
3128
+ */
3129
+
3130
+ interface EventOption {
3131
+ value: string;
3132
+ label: string;
3133
+ description?: string;
3134
+ }
3135
+ declare class EventsModule {
3136
+ private http;
3137
+ constructor(http: HttpClient);
3138
+ /**
3139
+ * Get available event types for webhooks and notifications
3140
+ */
3141
+ getOptions(): Promise<EventOption[]>;
3142
+ }
3143
+
3058
3144
  /**
3059
3145
  * Platform API Client
3060
3146
  *
@@ -3078,6 +3164,8 @@ declare class PlatformClient extends HttpClient {
3078
3164
  invites: InvitesModule;
3079
3165
  notifications: NotificationsModule;
3080
3166
  webhooks: WebhooksModule;
3167
+ user: UserModule;
3168
+ events: EventsModule;
3081
3169
  adminUsers: AdminUsersModule;
3082
3170
  adminSystem: AdminSystemModule;
3083
3171
  adminMaintenance: AdminMaintenanceModule;
@@ -3088,4 +3176,4 @@ declare class PlatformClient extends HttpClient {
3088
3176
  */
3089
3177
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3090
3178
 
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 };
3179
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, AssetsModule, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventOption, EventsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type MaintenanceStorageDetails, type MaintenanceSummary, type Notification, type NotificationCreate, type NotificationUpdate, NotificationsModule, type PasswordChange, 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, UserModule, type UserPagination, type UserProfile, 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
@@ -640,6 +640,70 @@ var AdminMaintenanceModule = class {
640
640
  }
641
641
  };
642
642
 
643
+ // src/platform/user.ts
644
+ var UserModule = class {
645
+ constructor(http) {
646
+ this.http = http;
647
+ }
648
+ http;
649
+ /**
650
+ * Get current user profile
651
+ */
652
+ async getProfile() {
653
+ return this.http.get("/api/self");
654
+ }
655
+ /**
656
+ * List personal API tokens
657
+ */
658
+ async listApiTokens() {
659
+ return this.http.get("/api/self/api-tokens");
660
+ }
661
+ /**
662
+ * Create a new personal API token
663
+ */
664
+ async createApiToken(data) {
665
+ return this.http.post("/api/self/api-tokens", data);
666
+ }
667
+ /**
668
+ * Revoke an API token
669
+ */
670
+ async revokeApiToken(tokenId) {
671
+ await this.http.post(`/api/self/api-tokens/${tokenId}/revoke`, {});
672
+ }
673
+ /**
674
+ * Rotate an API token (revoke old, create new)
675
+ */
676
+ async rotateApiToken(tokenId) {
677
+ return this.http.post(`/api/self/api-tokens/${tokenId}/rotate`, {});
678
+ }
679
+ /**
680
+ * Delete an API token
681
+ */
682
+ async deleteApiToken(tokenId) {
683
+ await this.http.delete(`/api/self/api-tokens/${tokenId}`);
684
+ }
685
+ /**
686
+ * Change password
687
+ */
688
+ async changePassword(data) {
689
+ await this.http.put("/api/self/password", data);
690
+ }
691
+ };
692
+
693
+ // src/platform/events.ts
694
+ var EventsModule = class {
695
+ constructor(http) {
696
+ this.http = http;
697
+ }
698
+ http;
699
+ /**
700
+ * Get available event types for webhooks and notifications
701
+ */
702
+ async getOptions() {
703
+ return this.http.get("/api/event/options");
704
+ }
705
+ };
706
+
643
707
  // src/platform/client.ts
644
708
  var PlatformClient = class extends HttpClient {
645
709
  entries;
@@ -653,6 +717,8 @@ var PlatformClient = class extends HttpClient {
653
717
  invites;
654
718
  notifications;
655
719
  webhooks;
720
+ user;
721
+ events;
656
722
  // Admin modules
657
723
  adminUsers;
658
724
  adminSystem;
@@ -675,6 +741,8 @@ var PlatformClient = class extends HttpClient {
675
741
  this.invites = new InvitesModule(this);
676
742
  this.notifications = new NotificationsModule(this);
677
743
  this.webhooks = new WebhooksModule(this);
744
+ this.user = new UserModule(this);
745
+ this.events = new EventsModule(this);
678
746
  this.adminUsers = new AdminUsersModule(this);
679
747
  this.adminSystem = new AdminSystemModule(this);
680
748
  this.adminMaintenance = new AdminMaintenanceModule(this);
@@ -692,10 +760,12 @@ export {
692
760
  CollectionsModule,
693
761
  EntriesModule,
694
762
  EntryTypesModule,
763
+ EventsModule,
695
764
  InvitesModule,
696
765
  NotificationsModule,
697
766
  PlatformClient,
698
767
  ResourcesModule,
768
+ UserModule,
699
769
  WebhooksModule,
700
770
  WorkspaceMembersModule,
701
771
  WorkspacesModule,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",