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

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,
@@ -328,6 +329,12 @@ var CollectionsModule = class {
328
329
  async getEntries(id) {
329
330
  return this.http.get(`/api/platform/collections/${id}/entries`);
330
331
  }
332
+ /**
333
+ * Reorder entries in a collection
334
+ */
335
+ async reorderEntries(id, entries) {
336
+ return this.http.patch(`/api/platform/collections/${id}/entries/order`, { entries });
337
+ }
331
338
  };
332
339
 
333
340
  // src/platform/resources.ts
@@ -995,6 +1002,117 @@ var EventsModule = class {
995
1002
  }
996
1003
  };
997
1004
 
1005
+ // src/platform/eventLog.ts
1006
+ var EventLogModule = class {
1007
+ constructor(http) {
1008
+ this.http = http;
1009
+ }
1010
+ http;
1011
+ /**
1012
+ * List events for the current workspace with optional filtering
1013
+ *
1014
+ * @param params - Query parameters for filtering events
1015
+ * @returns List of event log summaries
1016
+ *
1017
+ * @example
1018
+ * ```typescript
1019
+ * // Get recent published entries
1020
+ * const events = await marvin.platform.eventLog.list({
1021
+ * event_type: 'entry.published',
1022
+ * limit: 50
1023
+ * });
1024
+ *
1025
+ * // Get events by user
1026
+ * const userEvents = await marvin.platform.eventLog.list({
1027
+ * user_id: 'user-uuid',
1028
+ * start_date: '2026-07-01T00:00:00Z'
1029
+ * });
1030
+ * ```
1031
+ */
1032
+ async list(params) {
1033
+ const queryParams = new URLSearchParams();
1034
+ if (params?.event_type) queryParams.append("event_type", params.event_type);
1035
+ if (params?.entity_type) queryParams.append("entity_type", params.entity_type);
1036
+ if (params?.entity_id) queryParams.append("entity_id", params.entity_id);
1037
+ if (params?.user_id) queryParams.append("user_id", params.user_id);
1038
+ if (params?.start_date) queryParams.append("start_date", params.start_date);
1039
+ if (params?.end_date) queryParams.append("end_date", params.end_date);
1040
+ if (params?.limit) queryParams.append("limit", params.limit.toString());
1041
+ if (params?.offset) queryParams.append("offset", params.offset.toString());
1042
+ const query = queryParams.toString();
1043
+ const url = query ? `/api/platform/events?${query}` : "/api/platform/events";
1044
+ return this.http.get(url);
1045
+ }
1046
+ /**
1047
+ * Get a single event by its event_id
1048
+ *
1049
+ * @param eventId - The event_id to retrieve
1050
+ * @returns Complete event log entry with full payload
1051
+ *
1052
+ * @example
1053
+ * ```typescript
1054
+ * const event = await marvin.platform.eventLog.get('event-uuid');
1055
+ * console.log(event.event_data); // Full JSONB payload
1056
+ * ```
1057
+ */
1058
+ async get(eventId) {
1059
+ return this.http.get(`/api/platform/events/${eventId}`);
1060
+ }
1061
+ /**
1062
+ * Get complete event history for a specific entity (entry, asset, etc.)
1063
+ *
1064
+ * @param entityId - The UUID of the entity
1065
+ * @param options - Optional entity type filter and pagination
1066
+ * @returns List of events for this entity ordered by occurred_at descending
1067
+ *
1068
+ * @example
1069
+ * ```typescript
1070
+ * // Get complete timeline for an entry
1071
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
1072
+ * entity_type: 'entry',
1073
+ * limit: 100
1074
+ * });
1075
+ * ```
1076
+ */
1077
+ async getEntityHistory(entityId, options) {
1078
+ const queryParams = new URLSearchParams();
1079
+ if (options?.entity_type) queryParams.append("entity_type", options.entity_type);
1080
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
1081
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
1082
+ const query = queryParams.toString();
1083
+ const url = query ? `/api/platform/events/entity/${entityId}?${query}` : `/api/platform/events/entity/${entityId}`;
1084
+ return this.http.get(url);
1085
+ }
1086
+ /**
1087
+ * Get activity history for a specific user in the current workspace
1088
+ *
1089
+ * @param userId - The UUID of the user
1090
+ * @param options - Optional filters and pagination
1091
+ * @returns List of events triggered by this user ordered by occurred_at descending
1092
+ *
1093
+ * @example
1094
+ * ```typescript
1095
+ * // Get user activity for the last week
1096
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
1097
+ * start_date: '2026-07-01T00:00:00Z',
1098
+ * event_type: 'entry.published',
1099
+ * limit: 50
1100
+ * });
1101
+ * ```
1102
+ */
1103
+ async getUserActivity(userId, options) {
1104
+ const queryParams = new URLSearchParams();
1105
+ if (options?.event_type) queryParams.append("event_type", options.event_type);
1106
+ if (options?.start_date) queryParams.append("start_date", options.start_date);
1107
+ if (options?.end_date) queryParams.append("end_date", options.end_date);
1108
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
1109
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
1110
+ const query = queryParams.toString();
1111
+ const url = query ? `/api/platform/events/user/${userId}?${query}` : `/api/platform/events/user/${userId}`;
1112
+ return this.http.get(url);
1113
+ }
1114
+ };
1115
+
998
1116
  // src/platform/auth.ts
999
1117
  var AuthModule = class {
1000
1118
  constructor(http) {
@@ -1048,6 +1166,7 @@ var PlatformClient = class extends HttpClient {
1048
1166
  webhooks;
1049
1167
  user;
1050
1168
  events;
1169
+ eventLog;
1051
1170
  session;
1052
1171
  theme;
1053
1172
  // Admin modules
@@ -1074,6 +1193,7 @@ var PlatformClient = class extends HttpClient {
1074
1193
  this.webhooks = new WebhooksModule(this);
1075
1194
  this.user = new UserModule(this);
1076
1195
  this.events = new EventsModule(this);
1196
+ this.eventLog = new EventLogModule(this);
1077
1197
  this.session = new AuthModule(this);
1078
1198
  this.theme = new ThemeModule(this);
1079
1199
  this.adminUsers = new AdminUsersModule(this);
@@ -1095,6 +1215,7 @@ function createPlatformClient(config) {
1095
1215
  CollectionsModule,
1096
1216
  EntriesModule,
1097
1217
  EntryTypesModule,
1218
+ EventLogModule,
1098
1219
  EventsModule,
1099
1220
  InvitesModule,
1100
1221
  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
@@ -2650,6 +2743,13 @@ declare class CollectionsModule {
2650
2743
  * Get entries in a collection
2651
2744
  */
2652
2745
  getEntries(id: string): Promise<PlatformEntry[]>;
2746
+ /**
2747
+ * Reorder entries in a collection
2748
+ */
2749
+ reorderEntries(id: string, entries: Array<{
2750
+ entryId: string;
2751
+ sortOrder: number;
2752
+ }>): Promise<void>;
2653
2753
  }
2654
2754
 
2655
2755
  /**
@@ -3326,6 +3426,107 @@ declare class EventsModule {
3326
3426
  getOptions(): Promise<EventOption[]>;
3327
3427
  }
3328
3428
 
3429
+ /**
3430
+ * Event Log Module - Platform API
3431
+ *
3432
+ * Query audit trail and event history
3433
+ */
3434
+
3435
+ interface EventLogQueryParams {
3436
+ event_type?: string;
3437
+ entity_type?: string;
3438
+ entity_id?: string;
3439
+ user_id?: string;
3440
+ start_date?: string;
3441
+ end_date?: string;
3442
+ limit?: number;
3443
+ offset?: number;
3444
+ }
3445
+ declare class EventLogModule {
3446
+ private http;
3447
+ constructor(http: HttpClient);
3448
+ /**
3449
+ * List events for the current workspace with optional filtering
3450
+ *
3451
+ * @param params - Query parameters for filtering events
3452
+ * @returns List of event log summaries
3453
+ *
3454
+ * @example
3455
+ * ```typescript
3456
+ * // Get recent published entries
3457
+ * const events = await marvin.platform.eventLog.list({
3458
+ * event_type: 'entry.published',
3459
+ * limit: 50
3460
+ * });
3461
+ *
3462
+ * // Get events by user
3463
+ * const userEvents = await marvin.platform.eventLog.list({
3464
+ * user_id: 'user-uuid',
3465
+ * start_date: '2026-07-01T00:00:00Z'
3466
+ * });
3467
+ * ```
3468
+ */
3469
+ list(params?: EventLogQueryParams): Promise<EventLogSummary[]>;
3470
+ /**
3471
+ * Get a single event by its event_id
3472
+ *
3473
+ * @param eventId - The event_id to retrieve
3474
+ * @returns Complete event log entry with full payload
3475
+ *
3476
+ * @example
3477
+ * ```typescript
3478
+ * const event = await marvin.platform.eventLog.get('event-uuid');
3479
+ * console.log(event.event_data); // Full JSONB payload
3480
+ * ```
3481
+ */
3482
+ get(eventId: string): Promise<EventLogEntry>;
3483
+ /**
3484
+ * Get complete event history for a specific entity (entry, asset, etc.)
3485
+ *
3486
+ * @param entityId - The UUID of the entity
3487
+ * @param options - Optional entity type filter and pagination
3488
+ * @returns List of events for this entity ordered by occurred_at descending
3489
+ *
3490
+ * @example
3491
+ * ```typescript
3492
+ * // Get complete timeline for an entry
3493
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
3494
+ * entity_type: 'entry',
3495
+ * limit: 100
3496
+ * });
3497
+ * ```
3498
+ */
3499
+ getEntityHistory(entityId: string, options?: {
3500
+ entity_type?: string;
3501
+ limit?: number;
3502
+ offset?: number;
3503
+ }): Promise<EventLogSummary[]>;
3504
+ /**
3505
+ * Get activity history for a specific user in the current workspace
3506
+ *
3507
+ * @param userId - The UUID of the user
3508
+ * @param options - Optional filters and pagination
3509
+ * @returns List of events triggered by this user ordered by occurred_at descending
3510
+ *
3511
+ * @example
3512
+ * ```typescript
3513
+ * // Get user activity for the last week
3514
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
3515
+ * start_date: '2026-07-01T00:00:00Z',
3516
+ * event_type: 'entry.published',
3517
+ * limit: 50
3518
+ * });
3519
+ * ```
3520
+ */
3521
+ getUserActivity(userId: string, options?: {
3522
+ event_type?: string;
3523
+ start_date?: string;
3524
+ end_date?: string;
3525
+ limit?: number;
3526
+ offset?: number;
3527
+ }): Promise<EventLogSummary[]>;
3528
+ }
3529
+
3329
3530
  /**
3330
3531
  * Auth Module - Platform API
3331
3532
  *
@@ -3417,6 +3618,7 @@ declare class PlatformClient extends HttpClient {
3417
3618
  webhooks: WebhooksModule;
3418
3619
  user: UserModule;
3419
3620
  events: EventsModule;
3621
+ eventLog: EventLogModule;
3420
3622
  session: AuthModule;
3421
3623
  theme: ThemeModule;
3422
3624
  adminUsers: AdminUsersModule;
@@ -3429,4 +3631,4 @@ declare class PlatformClient extends HttpClient {
3429
3631
  */
3430
3632
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3431
3633
 
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 };
3634
+ 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
@@ -2650,6 +2743,13 @@ declare class CollectionsModule {
2650
2743
  * Get entries in a collection
2651
2744
  */
2652
2745
  getEntries(id: string): Promise<PlatformEntry[]>;
2746
+ /**
2747
+ * Reorder entries in a collection
2748
+ */
2749
+ reorderEntries(id: string, entries: Array<{
2750
+ entryId: string;
2751
+ sortOrder: number;
2752
+ }>): Promise<void>;
2653
2753
  }
2654
2754
 
2655
2755
  /**
@@ -3326,6 +3426,107 @@ declare class EventsModule {
3326
3426
  getOptions(): Promise<EventOption[]>;
3327
3427
  }
3328
3428
 
3429
+ /**
3430
+ * Event Log Module - Platform API
3431
+ *
3432
+ * Query audit trail and event history
3433
+ */
3434
+
3435
+ interface EventLogQueryParams {
3436
+ event_type?: string;
3437
+ entity_type?: string;
3438
+ entity_id?: string;
3439
+ user_id?: string;
3440
+ start_date?: string;
3441
+ end_date?: string;
3442
+ limit?: number;
3443
+ offset?: number;
3444
+ }
3445
+ declare class EventLogModule {
3446
+ private http;
3447
+ constructor(http: HttpClient);
3448
+ /**
3449
+ * List events for the current workspace with optional filtering
3450
+ *
3451
+ * @param params - Query parameters for filtering events
3452
+ * @returns List of event log summaries
3453
+ *
3454
+ * @example
3455
+ * ```typescript
3456
+ * // Get recent published entries
3457
+ * const events = await marvin.platform.eventLog.list({
3458
+ * event_type: 'entry.published',
3459
+ * limit: 50
3460
+ * });
3461
+ *
3462
+ * // Get events by user
3463
+ * const userEvents = await marvin.platform.eventLog.list({
3464
+ * user_id: 'user-uuid',
3465
+ * start_date: '2026-07-01T00:00:00Z'
3466
+ * });
3467
+ * ```
3468
+ */
3469
+ list(params?: EventLogQueryParams): Promise<EventLogSummary[]>;
3470
+ /**
3471
+ * Get a single event by its event_id
3472
+ *
3473
+ * @param eventId - The event_id to retrieve
3474
+ * @returns Complete event log entry with full payload
3475
+ *
3476
+ * @example
3477
+ * ```typescript
3478
+ * const event = await marvin.platform.eventLog.get('event-uuid');
3479
+ * console.log(event.event_data); // Full JSONB payload
3480
+ * ```
3481
+ */
3482
+ get(eventId: string): Promise<EventLogEntry>;
3483
+ /**
3484
+ * Get complete event history for a specific entity (entry, asset, etc.)
3485
+ *
3486
+ * @param entityId - The UUID of the entity
3487
+ * @param options - Optional entity type filter and pagination
3488
+ * @returns List of events for this entity ordered by occurred_at descending
3489
+ *
3490
+ * @example
3491
+ * ```typescript
3492
+ * // Get complete timeline for an entry
3493
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
3494
+ * entity_type: 'entry',
3495
+ * limit: 100
3496
+ * });
3497
+ * ```
3498
+ */
3499
+ getEntityHistory(entityId: string, options?: {
3500
+ entity_type?: string;
3501
+ limit?: number;
3502
+ offset?: number;
3503
+ }): Promise<EventLogSummary[]>;
3504
+ /**
3505
+ * Get activity history for a specific user in the current workspace
3506
+ *
3507
+ * @param userId - The UUID of the user
3508
+ * @param options - Optional filters and pagination
3509
+ * @returns List of events triggered by this user ordered by occurred_at descending
3510
+ *
3511
+ * @example
3512
+ * ```typescript
3513
+ * // Get user activity for the last week
3514
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
3515
+ * start_date: '2026-07-01T00:00:00Z',
3516
+ * event_type: 'entry.published',
3517
+ * limit: 50
3518
+ * });
3519
+ * ```
3520
+ */
3521
+ getUserActivity(userId: string, options?: {
3522
+ event_type?: string;
3523
+ start_date?: string;
3524
+ end_date?: string;
3525
+ limit?: number;
3526
+ offset?: number;
3527
+ }): Promise<EventLogSummary[]>;
3528
+ }
3529
+
3329
3530
  /**
3330
3531
  * Auth Module - Platform API
3331
3532
  *
@@ -3417,6 +3618,7 @@ declare class PlatformClient extends HttpClient {
3417
3618
  webhooks: WebhooksModule;
3418
3619
  user: UserModule;
3419
3620
  events: EventsModule;
3621
+ eventLog: EventLogModule;
3420
3622
  session: AuthModule;
3421
3623
  theme: ThemeModule;
3422
3624
  adminUsers: AdminUsersModule;
@@ -3429,4 +3631,4 @@ declare class PlatformClient extends HttpClient {
3429
3631
  */
3430
3632
  declare function createPlatformClient(config: PlatformClientConfig): PlatformClient;
3431
3633
 
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 };
3634
+ 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
@@ -108,6 +108,12 @@ var CollectionsModule = class {
108
108
  async getEntries(id) {
109
109
  return this.http.get(`/api/platform/collections/${id}/entries`);
110
110
  }
111
+ /**
112
+ * Reorder entries in a collection
113
+ */
114
+ async reorderEntries(id, entries) {
115
+ return this.http.patch(`/api/platform/collections/${id}/entries/order`, { entries });
116
+ }
111
117
  };
112
118
 
113
119
  // src/platform/resources.ts
@@ -775,6 +781,117 @@ var EventsModule = class {
775
781
  }
776
782
  };
777
783
 
784
+ // src/platform/eventLog.ts
785
+ var EventLogModule = class {
786
+ constructor(http) {
787
+ this.http = http;
788
+ }
789
+ http;
790
+ /**
791
+ * List events for the current workspace with optional filtering
792
+ *
793
+ * @param params - Query parameters for filtering events
794
+ * @returns List of event log summaries
795
+ *
796
+ * @example
797
+ * ```typescript
798
+ * // Get recent published entries
799
+ * const events = await marvin.platform.eventLog.list({
800
+ * event_type: 'entry.published',
801
+ * limit: 50
802
+ * });
803
+ *
804
+ * // Get events by user
805
+ * const userEvents = await marvin.platform.eventLog.list({
806
+ * user_id: 'user-uuid',
807
+ * start_date: '2026-07-01T00:00:00Z'
808
+ * });
809
+ * ```
810
+ */
811
+ async list(params) {
812
+ const queryParams = new URLSearchParams();
813
+ if (params?.event_type) queryParams.append("event_type", params.event_type);
814
+ if (params?.entity_type) queryParams.append("entity_type", params.entity_type);
815
+ if (params?.entity_id) queryParams.append("entity_id", params.entity_id);
816
+ if (params?.user_id) queryParams.append("user_id", params.user_id);
817
+ if (params?.start_date) queryParams.append("start_date", params.start_date);
818
+ if (params?.end_date) queryParams.append("end_date", params.end_date);
819
+ if (params?.limit) queryParams.append("limit", params.limit.toString());
820
+ if (params?.offset) queryParams.append("offset", params.offset.toString());
821
+ const query = queryParams.toString();
822
+ const url = query ? `/api/platform/events?${query}` : "/api/platform/events";
823
+ return this.http.get(url);
824
+ }
825
+ /**
826
+ * Get a single event by its event_id
827
+ *
828
+ * @param eventId - The event_id to retrieve
829
+ * @returns Complete event log entry with full payload
830
+ *
831
+ * @example
832
+ * ```typescript
833
+ * const event = await marvin.platform.eventLog.get('event-uuid');
834
+ * console.log(event.event_data); // Full JSONB payload
835
+ * ```
836
+ */
837
+ async get(eventId) {
838
+ return this.http.get(`/api/platform/events/${eventId}`);
839
+ }
840
+ /**
841
+ * Get complete event history for a specific entity (entry, asset, etc.)
842
+ *
843
+ * @param entityId - The UUID of the entity
844
+ * @param options - Optional entity type filter and pagination
845
+ * @returns List of events for this entity ordered by occurred_at descending
846
+ *
847
+ * @example
848
+ * ```typescript
849
+ * // Get complete timeline for an entry
850
+ * const entryHistory = await marvin.platform.eventLog.getEntityHistory('entry-uuid', {
851
+ * entity_type: 'entry',
852
+ * limit: 100
853
+ * });
854
+ * ```
855
+ */
856
+ async getEntityHistory(entityId, options) {
857
+ const queryParams = new URLSearchParams();
858
+ if (options?.entity_type) queryParams.append("entity_type", options.entity_type);
859
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
860
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
861
+ const query = queryParams.toString();
862
+ const url = query ? `/api/platform/events/entity/${entityId}?${query}` : `/api/platform/events/entity/${entityId}`;
863
+ return this.http.get(url);
864
+ }
865
+ /**
866
+ * Get activity history for a specific user in the current workspace
867
+ *
868
+ * @param userId - The UUID of the user
869
+ * @param options - Optional filters and pagination
870
+ * @returns List of events triggered by this user ordered by occurred_at descending
871
+ *
872
+ * @example
873
+ * ```typescript
874
+ * // Get user activity for the last week
875
+ * const userActivity = await marvin.platform.eventLog.getUserActivity('user-uuid', {
876
+ * start_date: '2026-07-01T00:00:00Z',
877
+ * event_type: 'entry.published',
878
+ * limit: 50
879
+ * });
880
+ * ```
881
+ */
882
+ async getUserActivity(userId, options) {
883
+ const queryParams = new URLSearchParams();
884
+ if (options?.event_type) queryParams.append("event_type", options.event_type);
885
+ if (options?.start_date) queryParams.append("start_date", options.start_date);
886
+ if (options?.end_date) queryParams.append("end_date", options.end_date);
887
+ if (options?.limit) queryParams.append("limit", options.limit.toString());
888
+ if (options?.offset) queryParams.append("offset", options.offset.toString());
889
+ const query = queryParams.toString();
890
+ const url = query ? `/api/platform/events/user/${userId}?${query}` : `/api/platform/events/user/${userId}`;
891
+ return this.http.get(url);
892
+ }
893
+ };
894
+
778
895
  // src/platform/auth.ts
779
896
  var AuthModule = class {
780
897
  constructor(http) {
@@ -828,6 +945,7 @@ var PlatformClient = class extends HttpClient {
828
945
  webhooks;
829
946
  user;
830
947
  events;
948
+ eventLog;
831
949
  session;
832
950
  theme;
833
951
  // Admin modules
@@ -854,6 +972,7 @@ var PlatformClient = class extends HttpClient {
854
972
  this.webhooks = new WebhooksModule(this);
855
973
  this.user = new UserModule(this);
856
974
  this.events = new EventsModule(this);
975
+ this.eventLog = new EventLogModule(this);
857
976
  this.session = new AuthModule(this);
858
977
  this.theme = new ThemeModule(this);
859
978
  this.adminUsers = new AdminUsersModule(this);
@@ -874,6 +993,7 @@ export {
874
993
  CollectionsModule,
875
994
  EntriesModule,
876
995
  EntryTypesModule,
996
+ EventLogModule,
877
997
  EventsModule,
878
998
  InvitesModule,
879
999
  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.3",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",