@inneropen/marvin-sdk 1.11.0-next.1 → 1.11.0-next.2

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
@@ -29,6 +29,7 @@ __export(platform_exports, {
29
29
  CollectionsModule: () => CollectionsModule,
30
30
  EntriesModule: () => EntriesModule,
31
31
  EntryTypesModule: () => EntryTypesModule,
32
+ EventLogModule: () => EventLogModule,
32
33
  EventsModule: () => EventsModule,
33
34
  InvitesModule: () => InvitesModule,
34
35
  NotificationsModule: () => NotificationsModule,
@@ -995,6 +996,117 @@ var EventsModule = class {
995
996
  }
996
997
  };
997
998
 
999
+ // src/platform/eventLog.ts
1000
+ var EventLogModule = class {
1001
+ constructor(http) {
1002
+ this.http = http;
1003
+ }
1004
+ http;
1005
+ /**
1006
+ * List events for the current workspace with optional filtering
1007
+ *
1008
+ * @param params - Query parameters for filtering events
1009
+ * @returns List of event log summaries
1010
+ *
1011
+ * @example
1012
+ * ```typescript
1013
+ * // Get recent published entries
1014
+ * const events = await marvin.platform.eventLog.list({
1015
+ * event_type: 'entry.published',
1016
+ * limit: 50
1017
+ * });
1018
+ *
1019
+ * // Get events by user
1020
+ * const userEvents = await marvin.platform.eventLog.list({
1021
+ * user_id: 'user-uuid',
1022
+ * start_date: '2026-07-01T00:00:00Z'
1023
+ * });
1024
+ * ```
1025
+ */
1026
+ async list(params) {
1027
+ const queryParams = new URLSearchParams();
1028
+ if (params?.event_type) queryParams.append("event_type", params.event_type);
1029
+ if (params?.entity_type) queryParams.append("entity_type", params.entity_type);
1030
+ if (params?.entity_id) queryParams.append("entity_id", params.entity_id);
1031
+ if (params?.user_id) queryParams.append("user_id", params.user_id);
1032
+ if (params?.start_date) queryParams.append("start_date", params.start_date);
1033
+ if (params?.end_date) queryParams.append("end_date", params.end_date);
1034
+ if (params?.limit) queryParams.append("limit", params.limit.toString());
1035
+ if (params?.offset) queryParams.append("offset", params.offset.toString());
1036
+ const query = queryParams.toString();
1037
+ const url = query ? `/api/platform/events?${query}` : "/api/platform/events";
1038
+ return this.http.get(url);
1039
+ }
1040
+ /**
1041
+ * Get a single event by its event_id
1042
+ *
1043
+ * @param eventId - The event_id to retrieve
1044
+ * @returns Complete event log entry with full payload
1045
+ *
1046
+ * @example
1047
+ * ```typescript
1048
+ * const event = await marvin.platform.eventLog.get('event-uuid');
1049
+ * console.log(event.event_data); // Full JSONB payload
1050
+ * ```
1051
+ */
1052
+ async get(eventId) {
1053
+ return this.http.get(`/api/platform/events/${eventId}`);
1054
+ }
1055
+ /**
1056
+ * Get complete event history for a specific entity (entry, asset, etc.)
1057
+ *
1058
+ * @param entityId - The UUID of the entity
1059
+ * @param options - Optional entity type filter and pagination
1060
+ * @returns List of events for this entity ordered by occurred_at descending
1061
+ *
1062
+ * @example
1063
+ * ```typescript
1064
+ * // Get complete timeline for an entry
1065
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
1066
+ * entity_type: 'entry',
1067
+ * limit: 100
1068
+ * });
1069
+ * ```
1070
+ */
1071
+ async getEntityHistory(entityId, options) {
1072
+ const queryParams = new URLSearchParams();
1073
+ if (options?.entity_type) queryParams.append("entity_type", options.entity_type);
1074
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
1075
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
1076
+ const query = queryParams.toString();
1077
+ const url = query ? `/api/platform/events/entity/${entityId}?${query}` : `/api/platform/events/entity/${entityId}`;
1078
+ return this.http.get(url);
1079
+ }
1080
+ /**
1081
+ * Get activity history for a specific user in the current workspace
1082
+ *
1083
+ * @param userId - The UUID of the user
1084
+ * @param options - Optional filters and pagination
1085
+ * @returns List of events triggered by this user ordered by occurred_at descending
1086
+ *
1087
+ * @example
1088
+ * ```typescript
1089
+ * // Get user activity for the last week
1090
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
1091
+ * start_date: '2026-07-01T00:00:00Z',
1092
+ * event_type: 'entry.published',
1093
+ * limit: 50
1094
+ * });
1095
+ * ```
1096
+ */
1097
+ async getUserActivity(userId, options) {
1098
+ const queryParams = new URLSearchParams();
1099
+ if (options?.event_type) queryParams.append("event_type", options.event_type);
1100
+ if (options?.start_date) queryParams.append("start_date", options.start_date);
1101
+ if (options?.end_date) queryParams.append("end_date", options.end_date);
1102
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
1103
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
1104
+ const query = queryParams.toString();
1105
+ const url = query ? `/api/platform/events/user/${userId}?${query}` : `/api/platform/events/user/${userId}`;
1106
+ return this.http.get(url);
1107
+ }
1108
+ };
1109
+
998
1110
  // src/platform/auth.ts
999
1111
  var AuthModule = class {
1000
1112
  constructor(http) {
@@ -1048,6 +1160,7 @@ var PlatformClient = class extends HttpClient {
1048
1160
  webhooks;
1049
1161
  user;
1050
1162
  events;
1163
+ eventLog;
1051
1164
  session;
1052
1165
  theme;
1053
1166
  // Admin modules
@@ -1074,6 +1187,7 @@ var PlatformClient = class extends HttpClient {
1074
1187
  this.webhooks = new WebhooksModule(this);
1075
1188
  this.user = new UserModule(this);
1076
1189
  this.events = new EventsModule(this);
1190
+ this.eventLog = new EventLogModule(this);
1077
1191
  this.session = new AuthModule(this);
1078
1192
  this.theme = new ThemeModule(this);
1079
1193
  this.adminUsers = new AdminUsersModule(this);
@@ -1095,6 +1209,7 @@ function createPlatformClient(config) {
1095
1209
  CollectionsModule,
1096
1210
  EntriesModule,
1097
1211
  EntryTypesModule,
1212
+ EventLogModule,
1098
1213
  EventsModule,
1099
1214
  InvitesModule,
1100
1215
  NotificationsModule,
@@ -859,7 +859,95 @@ interface components {
859
859
  * Helps listeners understand the nature of `EventDocumentDataBase` content.
860
860
  * @enum {string}
861
861
  */
862
- EventDocumentType: "generic" | "user" | "workspace" | "entry" | "collection" | "asset" | "webhook" | "member" | "invitation" | "api_token" | "deployment";
862
+ EventDocumentType: "generic" | "user" | "workspace" | "entry" | "collection" | "asset" | "webhook" | "member" | "invitation" | "api_token" | "api_client" | "entry_type" | "resource" | "deployment";
863
+ /**
864
+ * EventLogRead
865
+ * @description Schema for reading an event log entry.
866
+ */
867
+ EventLogRead: {
868
+ /**
869
+ * Id
870
+ * Format: uuid4
871
+ */
872
+ id: string;
873
+ /**
874
+ * Eventid
875
+ * Format: uuid4
876
+ */
877
+ eventId: string;
878
+ /** Eventtype */
879
+ eventType: string;
880
+ /**
881
+ * Occurredat
882
+ * Format: date-time
883
+ */
884
+ occurredAt: string;
885
+ /**
886
+ * Workspaceid
887
+ * Format: uuid4
888
+ */
889
+ workspaceId: string;
890
+ /** Userid */
891
+ userId?: string | null;
892
+ /** Entityid */
893
+ entityId?: string | null;
894
+ /** Entitytype */
895
+ entityType?: string | null;
896
+ /** Integrationid */
897
+ integrationId: string;
898
+ /** Operation */
899
+ operation?: string | null;
900
+ /** Eventdata */
901
+ eventData: {
902
+ [key: string]: unknown;
903
+ };
904
+ /** Messagetitle */
905
+ messageTitle: string;
906
+ /** Messagebody */
907
+ messageBody?: string | null;
908
+ /** Createdat */
909
+ createdAt?: string | null;
910
+ /** Updateat */
911
+ updateAt?: string | null;
912
+ };
913
+ /**
914
+ * EventLogSummary
915
+ * @description Summary schema for an event log entry (lighter payload).
916
+ */
917
+ EventLogSummary: {
918
+ /**
919
+ * Id
920
+ * Format: uuid4
921
+ */
922
+ id: string;
923
+ /**
924
+ * Eventid
925
+ * Format: uuid4
926
+ */
927
+ eventId: string;
928
+ /** Eventtype */
929
+ eventType: string;
930
+ /**
931
+ * Occurredat
932
+ * Format: date-time
933
+ */
934
+ occurredAt: string;
935
+ /**
936
+ * Workspaceid
937
+ * Format: uuid4
938
+ */
939
+ workspaceId: string;
940
+ /** Userid */
941
+ userId?: string | null;
942
+ /** Entityid */
943
+ entityId?: string | null;
944
+ /** Entitytype */
945
+ entityType?: string | null;
946
+ /** Messagetitle */
947
+ messageTitle: string;
948
+ /** Messagebody */
949
+ messageBody?: string | null;
950
+ };
863
951
  /**
864
952
  * EventNotifierOptionsPagination
865
953
  * @description Schema for paginated responses containing a list of event notifier option summaries.
@@ -2571,6 +2659,11 @@ type PlatformAPIClientWithToken = components['schemas']['APIClientWithToken'];
2571
2659
  type PlatformWorkspaceMember = components['schemas']['WorkspaceMembershipRead'];
2572
2660
  type PlatformWorkspaceMemberCreate = components['schemas']['WorkspaceMemberCreate'];
2573
2661
  type PlatformWorkspaceMemberUpdate = components['schemas']['WorkspaceMemberUpdate'];
2662
+ /**
2663
+ * Event Log (Platform API - audit trail and event history)
2664
+ */
2665
+ type EventLogEntry = components['schemas']['EventLogRead'];
2666
+ type EventLogSummary = components['schemas']['EventLogSummary'];
2574
2667
 
2575
2668
  /**
2576
2669
  * Entries Module - Platform API
@@ -3326,6 +3419,107 @@ declare class EventsModule {
3326
3419
  getOptions(): Promise<EventOption[]>;
3327
3420
  }
3328
3421
 
3422
+ /**
3423
+ * Event Log Module - Platform API
3424
+ *
3425
+ * Query audit trail and event history
3426
+ */
3427
+
3428
+ interface EventLogQueryParams {
3429
+ event_type?: string;
3430
+ entity_type?: string;
3431
+ entity_id?: string;
3432
+ user_id?: string;
3433
+ start_date?: string;
3434
+ end_date?: string;
3435
+ limit?: number;
3436
+ offset?: number;
3437
+ }
3438
+ declare class EventLogModule {
3439
+ private http;
3440
+ constructor(http: HttpClient);
3441
+ /**
3442
+ * List events for the current workspace with optional filtering
3443
+ *
3444
+ * @param params - Query parameters for filtering events
3445
+ * @returns List of event log summaries
3446
+ *
3447
+ * @example
3448
+ * ```typescript
3449
+ * // Get recent published entries
3450
+ * const events = await marvin.platform.eventLog.list({
3451
+ * event_type: 'entry.published',
3452
+ * limit: 50
3453
+ * });
3454
+ *
3455
+ * // Get events by user
3456
+ * const userEvents = await marvin.platform.eventLog.list({
3457
+ * user_id: 'user-uuid',
3458
+ * start_date: '2026-07-01T00:00:00Z'
3459
+ * });
3460
+ * ```
3461
+ */
3462
+ list(params?: EventLogQueryParams): Promise<EventLogSummary[]>;
3463
+ /**
3464
+ * Get a single event by its event_id
3465
+ *
3466
+ * @param eventId - The event_id to retrieve
3467
+ * @returns Complete event log entry with full payload
3468
+ *
3469
+ * @example
3470
+ * ```typescript
3471
+ * const event = await marvin.platform.eventLog.get('event-uuid');
3472
+ * console.log(event.event_data); // Full JSONB payload
3473
+ * ```
3474
+ */
3475
+ get(eventId: string): Promise<EventLogEntry>;
3476
+ /**
3477
+ * Get complete event history for a specific entity (entry, asset, etc.)
3478
+ *
3479
+ * @param entityId - The UUID of the entity
3480
+ * @param options - Optional entity type filter and pagination
3481
+ * @returns List of events for this entity ordered by occurred_at descending
3482
+ *
3483
+ * @example
3484
+ * ```typescript
3485
+ * // Get complete timeline for an entry
3486
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
3487
+ * entity_type: 'entry',
3488
+ * limit: 100
3489
+ * });
3490
+ * ```
3491
+ */
3492
+ getEntityHistory(entityId: string, options?: {
3493
+ entity_type?: string;
3494
+ limit?: number;
3495
+ offset?: number;
3496
+ }): Promise<EventLogSummary[]>;
3497
+ /**
3498
+ * Get activity history for a specific user in the current workspace
3499
+ *
3500
+ * @param userId - The UUID of the user
3501
+ * @param options - Optional filters and pagination
3502
+ * @returns List of events triggered by this user ordered by occurred_at descending
3503
+ *
3504
+ * @example
3505
+ * ```typescript
3506
+ * // Get user activity for the last week
3507
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
3508
+ * start_date: '2026-07-01T00:00:00Z',
3509
+ * event_type: 'entry.published',
3510
+ * limit: 50
3511
+ * });
3512
+ * ```
3513
+ */
3514
+ getUserActivity(userId: string, options?: {
3515
+ event_type?: string;
3516
+ start_date?: string;
3517
+ end_date?: string;
3518
+ limit?: number;
3519
+ offset?: number;
3520
+ }): Promise<EventLogSummary[]>;
3521
+ }
3522
+
3329
3523
  /**
3330
3524
  * Auth Module - Platform API
3331
3525
  *
@@ -3417,6 +3611,7 @@ declare class PlatformClient extends HttpClient {
3417
3611
  webhooks: WebhooksModule;
3418
3612
  user: UserModule;
3419
3613
  events: EventsModule;
3614
+ eventLog: EventLogModule;
3420
3615
  session: AuthModule;
3421
3616
  theme: ThemeModule;
3422
3617
  adminUsers: AdminUsersModule;
@@ -3429,4 +3624,4 @@ declare class PlatformClient extends HttpClient {
3429
3624
  */
3430
3625
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3431
3626
 
3432
- export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, 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 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, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, 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 };
3627
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventLogEntry, EventLogModule, type EventLogQueryParams, type EventLogSummary, 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 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, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, 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 };
@@ -859,7 +859,95 @@ interface components {
859
859
  * Helps listeners understand the nature of `EventDocumentDataBase` content.
860
860
  * @enum {string}
861
861
  */
862
- EventDocumentType: "generic" | "user" | "workspace" | "entry" | "collection" | "asset" | "webhook" | "member" | "invitation" | "api_token" | "deployment";
862
+ EventDocumentType: "generic" | "user" | "workspace" | "entry" | "collection" | "asset" | "webhook" | "member" | "invitation" | "api_token" | "api_client" | "entry_type" | "resource" | "deployment";
863
+ /**
864
+ * EventLogRead
865
+ * @description Schema for reading an event log entry.
866
+ */
867
+ EventLogRead: {
868
+ /**
869
+ * Id
870
+ * Format: uuid4
871
+ */
872
+ id: string;
873
+ /**
874
+ * Eventid
875
+ * Format: uuid4
876
+ */
877
+ eventId: string;
878
+ /** Eventtype */
879
+ eventType: string;
880
+ /**
881
+ * Occurredat
882
+ * Format: date-time
883
+ */
884
+ occurredAt: string;
885
+ /**
886
+ * Workspaceid
887
+ * Format: uuid4
888
+ */
889
+ workspaceId: string;
890
+ /** Userid */
891
+ userId?: string | null;
892
+ /** Entityid */
893
+ entityId?: string | null;
894
+ /** Entitytype */
895
+ entityType?: string | null;
896
+ /** Integrationid */
897
+ integrationId: string;
898
+ /** Operation */
899
+ operation?: string | null;
900
+ /** Eventdata */
901
+ eventData: {
902
+ [key: string]: unknown;
903
+ };
904
+ /** Messagetitle */
905
+ messageTitle: string;
906
+ /** Messagebody */
907
+ messageBody?: string | null;
908
+ /** Createdat */
909
+ createdAt?: string | null;
910
+ /** Updateat */
911
+ updateAt?: string | null;
912
+ };
913
+ /**
914
+ * EventLogSummary
915
+ * @description Summary schema for an event log entry (lighter payload).
916
+ */
917
+ EventLogSummary: {
918
+ /**
919
+ * Id
920
+ * Format: uuid4
921
+ */
922
+ id: string;
923
+ /**
924
+ * Eventid
925
+ * Format: uuid4
926
+ */
927
+ eventId: string;
928
+ /** Eventtype */
929
+ eventType: string;
930
+ /**
931
+ * Occurredat
932
+ * Format: date-time
933
+ */
934
+ occurredAt: string;
935
+ /**
936
+ * Workspaceid
937
+ * Format: uuid4
938
+ */
939
+ workspaceId: string;
940
+ /** Userid */
941
+ userId?: string | null;
942
+ /** Entityid */
943
+ entityId?: string | null;
944
+ /** Entitytype */
945
+ entityType?: string | null;
946
+ /** Messagetitle */
947
+ messageTitle: string;
948
+ /** Messagebody */
949
+ messageBody?: string | null;
950
+ };
863
951
  /**
864
952
  * EventNotifierOptionsPagination
865
953
  * @description Schema for paginated responses containing a list of event notifier option summaries.
@@ -2571,6 +2659,11 @@ type PlatformAPIClientWithToken = components['schemas']['APIClientWithToken'];
2571
2659
  type PlatformWorkspaceMember = components['schemas']['WorkspaceMembershipRead'];
2572
2660
  type PlatformWorkspaceMemberCreate = components['schemas']['WorkspaceMemberCreate'];
2573
2661
  type PlatformWorkspaceMemberUpdate = components['schemas']['WorkspaceMemberUpdate'];
2662
+ /**
2663
+ * Event Log (Platform API - audit trail and event history)
2664
+ */
2665
+ type EventLogEntry = components['schemas']['EventLogRead'];
2666
+ type EventLogSummary = components['schemas']['EventLogSummary'];
2574
2667
 
2575
2668
  /**
2576
2669
  * Entries Module - Platform API
@@ -3326,6 +3419,107 @@ declare class EventsModule {
3326
3419
  getOptions(): Promise<EventOption[]>;
3327
3420
  }
3328
3421
 
3422
+ /**
3423
+ * Event Log Module - Platform API
3424
+ *
3425
+ * Query audit trail and event history
3426
+ */
3427
+
3428
+ interface EventLogQueryParams {
3429
+ event_type?: string;
3430
+ entity_type?: string;
3431
+ entity_id?: string;
3432
+ user_id?: string;
3433
+ start_date?: string;
3434
+ end_date?: string;
3435
+ limit?: number;
3436
+ offset?: number;
3437
+ }
3438
+ declare class EventLogModule {
3439
+ private http;
3440
+ constructor(http: HttpClient);
3441
+ /**
3442
+ * List events for the current workspace with optional filtering
3443
+ *
3444
+ * @param params - Query parameters for filtering events
3445
+ * @returns List of event log summaries
3446
+ *
3447
+ * @example
3448
+ * ```typescript
3449
+ * // Get recent published entries
3450
+ * const events = await marvin.platform.eventLog.list({
3451
+ * event_type: 'entry.published',
3452
+ * limit: 50
3453
+ * });
3454
+ *
3455
+ * // Get events by user
3456
+ * const userEvents = await marvin.platform.eventLog.list({
3457
+ * user_id: 'user-uuid',
3458
+ * start_date: '2026-07-01T00:00:00Z'
3459
+ * });
3460
+ * ```
3461
+ */
3462
+ list(params?: EventLogQueryParams): Promise<EventLogSummary[]>;
3463
+ /**
3464
+ * Get a single event by its event_id
3465
+ *
3466
+ * @param eventId - The event_id to retrieve
3467
+ * @returns Complete event log entry with full payload
3468
+ *
3469
+ * @example
3470
+ * ```typescript
3471
+ * const event = await marvin.platform.eventLog.get('event-uuid');
3472
+ * console.log(event.event_data); // Full JSONB payload
3473
+ * ```
3474
+ */
3475
+ get(eventId: string): Promise<EventLogEntry>;
3476
+ /**
3477
+ * Get complete event history for a specific entity (entry, asset, etc.)
3478
+ *
3479
+ * @param entityId - The UUID of the entity
3480
+ * @param options - Optional entity type filter and pagination
3481
+ * @returns List of events for this entity ordered by occurred_at descending
3482
+ *
3483
+ * @example
3484
+ * ```typescript
3485
+ * // Get complete timeline for an entry
3486
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
3487
+ * entity_type: 'entry',
3488
+ * limit: 100
3489
+ * });
3490
+ * ```
3491
+ */
3492
+ getEntityHistory(entityId: string, options?: {
3493
+ entity_type?: string;
3494
+ limit?: number;
3495
+ offset?: number;
3496
+ }): Promise<EventLogSummary[]>;
3497
+ /**
3498
+ * Get activity history for a specific user in the current workspace
3499
+ *
3500
+ * @param userId - The UUID of the user
3501
+ * @param options - Optional filters and pagination
3502
+ * @returns List of events triggered by this user ordered by occurred_at descending
3503
+ *
3504
+ * @example
3505
+ * ```typescript
3506
+ * // Get user activity for the last week
3507
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
3508
+ * start_date: '2026-07-01T00:00:00Z',
3509
+ * event_type: 'entry.published',
3510
+ * limit: 50
3511
+ * });
3512
+ * ```
3513
+ */
3514
+ getUserActivity(userId: string, options?: {
3515
+ event_type?: string;
3516
+ start_date?: string;
3517
+ end_date?: string;
3518
+ limit?: number;
3519
+ offset?: number;
3520
+ }): Promise<EventLogSummary[]>;
3521
+ }
3522
+
3329
3523
  /**
3330
3524
  * Auth Module - Platform API
3331
3525
  *
@@ -3417,6 +3611,7 @@ declare class PlatformClient extends HttpClient {
3417
3611
  webhooks: WebhooksModule;
3418
3612
  user: UserModule;
3419
3613
  events: EventsModule;
3614
+ eventLog: EventLogModule;
3420
3615
  session: AuthModule;
3421
3616
  theme: ThemeModule;
3422
3617
  adminUsers: AdminUsersModule;
@@ -3429,4 +3624,4 @@ declare class PlatformClient extends HttpClient {
3429
3624
  */
3430
3625
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3431
3626
 
3432
- export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, 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 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, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, 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 };
3627
+ export { APIClientsModule, type AdminAboutInfo, AdminMaintenanceModule, AdminSystemModule, AdminUsersModule, type ApiToken, type ApiTokenCreate, type ApiTokenWithToken, type AppTheme, AssetsModule, AuthModule, type AuthToken, CollectionsModule, type EmailInvitationRequest, type EmailSettings, EntriesModule, EntryTypesModule, type EventLogEntry, EventLogModule, type EventLogQueryParams, type EventLogSummary, 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 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, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, 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
@@ -775,6 +775,117 @@ var EventsModule = class {
775
775
  }
776
776
  };
777
777
 
778
+ // src/platform/eventLog.ts
779
+ var EventLogModule = class {
780
+ constructor(http) {
781
+ this.http = http;
782
+ }
783
+ http;
784
+ /**
785
+ * List events for the current workspace with optional filtering
786
+ *
787
+ * @param params - Query parameters for filtering events
788
+ * @returns List of event log summaries
789
+ *
790
+ * @example
791
+ * ```typescript
792
+ * // Get recent published entries
793
+ * const events = await marvin.platform.eventLog.list({
794
+ * event_type: 'entry.published',
795
+ * limit: 50
796
+ * });
797
+ *
798
+ * // Get events by user
799
+ * const userEvents = await marvin.platform.eventLog.list({
800
+ * user_id: 'user-uuid',
801
+ * start_date: '2026-07-01T00:00:00Z'
802
+ * });
803
+ * ```
804
+ */
805
+ async list(params) {
806
+ const queryParams = new URLSearchParams();
807
+ if (params?.event_type) queryParams.append("event_type", params.event_type);
808
+ if (params?.entity_type) queryParams.append("entity_type", params.entity_type);
809
+ if (params?.entity_id) queryParams.append("entity_id", params.entity_id);
810
+ if (params?.user_id) queryParams.append("user_id", params.user_id);
811
+ if (params?.start_date) queryParams.append("start_date", params.start_date);
812
+ if (params?.end_date) queryParams.append("end_date", params.end_date);
813
+ if (params?.limit) queryParams.append("limit", params.limit.toString());
814
+ if (params?.offset) queryParams.append("offset", params.offset.toString());
815
+ const query = queryParams.toString();
816
+ const url = query ? `/api/platform/events?${query}` : "/api/platform/events";
817
+ return this.http.get(url);
818
+ }
819
+ /**
820
+ * Get a single event by its event_id
821
+ *
822
+ * @param eventId - The event_id to retrieve
823
+ * @returns Complete event log entry with full payload
824
+ *
825
+ * @example
826
+ * ```typescript
827
+ * const event = await marvin.platform.eventLog.get('event-uuid');
828
+ * console.log(event.event_data); // Full JSONB payload
829
+ * ```
830
+ */
831
+ async get(eventId) {
832
+ return this.http.get(`/api/platform/events/${eventId}`);
833
+ }
834
+ /**
835
+ * Get complete event history for a specific entity (entry, asset, etc.)
836
+ *
837
+ * @param entityId - The UUID of the entity
838
+ * @param options - Optional entity type filter and pagination
839
+ * @returns List of events for this entity ordered by occurred_at descending
840
+ *
841
+ * @example
842
+ * ```typescript
843
+ * // Get complete timeline for an entry
844
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
845
+ * entity_type: 'entry',
846
+ * limit: 100
847
+ * });
848
+ * ```
849
+ */
850
+ async getEntityHistory(entityId, options) {
851
+ const queryParams = new URLSearchParams();
852
+ if (options?.entity_type) queryParams.append("entity_type", options.entity_type);
853
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
854
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
855
+ const query = queryParams.toString();
856
+ const url = query ? `/api/platform/events/entity/${entityId}?${query}` : `/api/platform/events/entity/${entityId}`;
857
+ return this.http.get(url);
858
+ }
859
+ /**
860
+ * Get activity history for a specific user in the current workspace
861
+ *
862
+ * @param userId - The UUID of the user
863
+ * @param options - Optional filters and pagination
864
+ * @returns List of events triggered by this user ordered by occurred_at descending
865
+ *
866
+ * @example
867
+ * ```typescript
868
+ * // Get user activity for the last week
869
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
870
+ * start_date: '2026-07-01T00:00:00Z',
871
+ * event_type: 'entry.published',
872
+ * limit: 50
873
+ * });
874
+ * ```
875
+ */
876
+ async getUserActivity(userId, options) {
877
+ const queryParams = new URLSearchParams();
878
+ if (options?.event_type) queryParams.append("event_type", options.event_type);
879
+ if (options?.start_date) queryParams.append("start_date", options.start_date);
880
+ if (options?.end_date) queryParams.append("end_date", options.end_date);
881
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
882
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
883
+ const query = queryParams.toString();
884
+ const url = query ? `/api/platform/events/user/${userId}?${query}` : `/api/platform/events/user/${userId}`;
885
+ return this.http.get(url);
886
+ }
887
+ };
888
+
778
889
  // src/platform/auth.ts
779
890
  var AuthModule = class {
780
891
  constructor(http) {
@@ -828,6 +939,7 @@ var PlatformClient = class extends HttpClient {
828
939
  webhooks;
829
940
  user;
830
941
  events;
942
+ eventLog;
831
943
  session;
832
944
  theme;
833
945
  // Admin modules
@@ -854,6 +966,7 @@ var PlatformClient = class extends HttpClient {
854
966
  this.webhooks = new WebhooksModule(this);
855
967
  this.user = new UserModule(this);
856
968
  this.events = new EventsModule(this);
969
+ this.eventLog = new EventLogModule(this);
857
970
  this.session = new AuthModule(this);
858
971
  this.theme = new ThemeModule(this);
859
972
  this.adminUsers = new AdminUsersModule(this);
@@ -874,6 +987,7 @@ export {
874
987
  CollectionsModule,
875
988
  EntriesModule,
876
989
  EntryTypesModule,
990
+ EventLogModule,
877
991
  EventsModule,
878
992
  InvitesModule,
879
993
  NotificationsModule,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.11.0-next.1",
3
+ "version": "1.11.0-next.2",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",