@superatomai/sdk-web 0.0.11 → 0.0.13

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
@@ -188,7 +188,7 @@ var DSLRendererPropsSchema2 = zod.z.object({
188
188
  context: zod.z.record(zod.z.string(), zod.z.any()).optional()
189
189
  });
190
190
 
191
- // src/schemas.ts
191
+ // src/types.ts
192
192
  var MessageParticipantSchema = zod.z.object({
193
193
  id: zod.z.string().optional(),
194
194
  type: zod.z.string().optional()
@@ -431,14 +431,25 @@ var ComponentsSendMessageSchema = zod.z.object({
431
431
  to: MessageParticipantSchema.optional(),
432
432
  payload: ComponentsSendPayloadSchema
433
433
  });
434
+ var UserQueryFiltersSchema = zod.z.object({
435
+ username: zod.z.string().optional(),
436
+ email: zod.z.string().optional(),
437
+ role: zod.z.string().optional(),
438
+ fullname: zod.z.string().optional()
439
+ });
434
440
  var UsersRequestPayloadSchema = zod.z.object({
435
- operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne"]),
441
+ operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
436
442
  data: zod.z.object({
443
+ id: zod.z.number().optional(),
437
444
  username: zod.z.string().optional(),
438
445
  email: zod.z.string().email("Invalid email format").optional(),
439
446
  password: zod.z.string().optional(),
440
447
  fullname: zod.z.string().optional(),
441
- role: zod.z.string().optional()
448
+ role: zod.z.string().optional(),
449
+ // Query operation fields
450
+ filters: UserQueryFiltersSchema.optional(),
451
+ limit: zod.z.number().optional(),
452
+ sort: zod.z.enum(["ASC", "DESC"]).optional()
442
453
  }).optional()
443
454
  });
444
455
  var UsersRequestMessageSchema = zod.z.object({
@@ -481,11 +492,28 @@ zod.z.object({
481
492
  to: MessageParticipantSchema.optional(),
482
493
  payload: UsersResponsePayloadSchema
483
494
  });
495
+ var DashboardQueryFiltersSchema = zod.z.object({
496
+ dashboardId: zod.z.string().optional(),
497
+ projectId: zod.z.string().optional(),
498
+ createdBy: zod.z.number().optional(),
499
+ updatedBy: zod.z.number().optional(),
500
+ name: zod.z.string().optional()
501
+ });
484
502
  var DashboardsRequestPayloadSchema = zod.z.object({
485
- operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne"]),
503
+ operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
486
504
  data: zod.z.object({
505
+ id: zod.z.number().optional(),
487
506
  dashboardId: zod.z.string().optional(),
488
- dashboard: DSLRendererPropsSchema.optional()
507
+ projectId: zod.z.string().optional(),
508
+ name: zod.z.string().optional(),
509
+ description: zod.z.string().optional(),
510
+ createdBy: zod.z.number().optional(),
511
+ updatedBy: zod.z.number().optional(),
512
+ dashboard: DSLRendererPropsSchema.optional(),
513
+ // Query operation fields
514
+ filters: DashboardQueryFiltersSchema.optional(),
515
+ limit: zod.z.number().optional(),
516
+ sort: zod.z.enum(["ASC", "DESC"]).optional()
489
517
  }).optional()
490
518
  });
491
519
  var DashboardsRequestMessageSchema = zod.z.object({
@@ -516,11 +544,28 @@ zod.z.object({
516
544
  to: MessageParticipantSchema.optional(),
517
545
  payload: DashboardsResponsePayloadSchema
518
546
  });
547
+ var ReportQueryFiltersSchema = zod.z.object({
548
+ reportId: zod.z.string().optional(),
549
+ projectId: zod.z.string().optional(),
550
+ createdBy: zod.z.number().optional(),
551
+ updatedBy: zod.z.number().optional(),
552
+ name: zod.z.string().optional()
553
+ });
519
554
  var ReportsRequestPayloadSchema = zod.z.object({
520
- operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne"]),
555
+ operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
521
556
  data: zod.z.object({
557
+ id: zod.z.number().optional(),
522
558
  reportId: zod.z.string().optional(),
523
- report: DSLRendererPropsSchema2.optional()
559
+ projectId: zod.z.string().optional(),
560
+ name: zod.z.string().optional(),
561
+ description: zod.z.string().optional(),
562
+ createdBy: zod.z.number().optional(),
563
+ updatedBy: zod.z.number().optional(),
564
+ report: DSLRendererPropsSchema2.optional(),
565
+ // Query operation fields
566
+ filters: ReportQueryFiltersSchema.optional(),
567
+ limit: zod.z.number().optional(),
568
+ sort: zod.z.enum(["ASC", "DESC"]).optional()
524
569
  }).optional()
525
570
  });
526
571
  var ReportsRequestMessageSchema = zod.z.object({
@@ -551,20 +596,88 @@ zod.z.object({
551
596
  to: MessageParticipantSchema.optional(),
552
597
  payload: ReportsResponsePayloadSchema
553
598
  });
599
+ var UIQueryFiltersSchema = zod.z.object({
600
+ uiId: zod.z.string().optional(),
601
+ projectId: zod.z.string().optional(),
602
+ createdBy: zod.z.number().optional(),
603
+ updatedBy: zod.z.number().optional(),
604
+ name: zod.z.string().optional()
605
+ });
606
+ var UIsRequestPayloadSchema = zod.z.object({
607
+ operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
608
+ data: zod.z.object({
609
+ id: zod.z.number().optional(),
610
+ uiId: zod.z.string().optional(),
611
+ projectId: zod.z.string().optional(),
612
+ name: zod.z.string().optional(),
613
+ description: zod.z.string().optional(),
614
+ createdBy: zod.z.number().optional(),
615
+ updatedBy: zod.z.number().optional(),
616
+ ui: DSLRendererPropsSchema.optional(),
617
+ // Query operation fields
618
+ filters: UIQueryFiltersSchema.optional(),
619
+ limit: zod.z.number().optional(),
620
+ sort: zod.z.enum(["ASC", "DESC"]).optional()
621
+ }).optional()
622
+ });
623
+ var UIsRequestMessageSchema = zod.z.object({
624
+ id: zod.z.string(),
625
+ type: zod.z.literal("UIS"),
626
+ from: MessageParticipantSchema,
627
+ to: MessageParticipantSchema.optional(),
628
+ payload: UIsRequestPayloadSchema
629
+ });
630
+ var UIsResponsePayloadSchema = zod.z.object({
631
+ success: zod.z.boolean(),
632
+ error: zod.z.string().optional(),
633
+ data: zod.z.object({
634
+ uiId: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
635
+ ui: DSLRendererPropsSchema.optional(),
636
+ uis: zod.z.array(zod.z.object({
637
+ uiId: zod.z.string(),
638
+ ui: DSLRendererPropsSchema.optional()
639
+ })).optional(),
640
+ count: zod.z.number().optional(),
641
+ message: zod.z.string().optional()
642
+ }).optional()
643
+ });
644
+ zod.z.object({
645
+ id: zod.z.string(),
646
+ type: zod.z.literal("UIS_RES"),
647
+ from: MessageParticipantSchema,
648
+ to: MessageParticipantSchema.optional(),
649
+ payload: UIsResponsePayloadSchema
650
+ });
651
+ var DBUIBlockSchema = zod.z.object({
652
+ id: zod.z.string(),
653
+ component: zod.z.record(zod.z.string(), zod.z.any()).nullable(),
654
+ analysis: zod.z.string().nullable(),
655
+ user_prompt: zod.z.string()
656
+ });
554
657
  var BookmarkDataSchema = zod.z.object({
555
658
  id: zod.z.number().optional(),
556
- uiblock: zod.z.any(),
557
- // JSON object
659
+ uiblock: DBUIBlockSchema,
558
660
  created_at: zod.z.string().optional(),
559
661
  updated_at: zod.z.string().optional()
560
662
  });
663
+ var BookmarkQueryFiltersSchema = zod.z.object({
664
+ userId: zod.z.number().optional(),
665
+ threadId: zod.z.string().optional(),
666
+ name: zod.z.string().optional()
667
+ });
561
668
  var BookmarksRequestPayloadSchema = zod.z.object({
562
- operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "getByUser", "getByThread"]),
669
+ operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
563
670
  data: zod.z.object({
564
671
  id: zod.z.number().optional(),
565
672
  userId: zod.z.number().optional(),
566
673
  threadId: zod.z.string().optional(),
567
- uiblock: zod.z.any().optional()
674
+ name: zod.z.string().optional(),
675
+ description: zod.z.string().optional(),
676
+ uiblock: DBUIBlockSchema.optional(),
677
+ // Query operation fields
678
+ filters: BookmarkQueryFiltersSchema.optional(),
679
+ limit: zod.z.number().optional(),
680
+ sort: zod.z.enum(["ASC", "DESC"]).optional()
568
681
  }).optional()
569
682
  });
570
683
  var BookmarksRequestMessageSchema = zod.z.object({
@@ -616,23 +729,30 @@ __export(services_exports, {
616
729
  createBookmark: () => createBookmark,
617
730
  createDashboard: () => createDashboard,
618
731
  createReport: () => createReport,
732
+ createUI: () => createUI,
619
733
  createUser: () => createUser,
620
734
  deleteBookmark: () => deleteBookmark,
621
735
  deleteDashboard: () => deleteDashboard,
622
736
  deleteReport: () => deleteReport,
737
+ deleteUI: () => deleteUI,
623
738
  deleteUser: () => deleteUser,
624
739
  getActions: () => getActions,
625
740
  getAllBookmarks: () => getAllBookmarks,
626
741
  getAllDashboards: () => getAllDashboards,
627
742
  getAllReports: () => getAllReports,
743
+ getAllUIs: () => getAllUIs,
628
744
  getAllUsers: () => getAllUsers,
629
745
  getBookmark: () => getBookmark,
630
- getBookmarksByThread: () => getBookmarksByThread,
631
- getBookmarksByUser: () => getBookmarksByUser,
632
746
  getComponentSuggestions: () => getComponentSuggestions,
633
747
  getDashboard: () => getDashboard,
634
748
  getReport: () => getReport,
749
+ getUI: () => getUI,
635
750
  getUser: () => getUser,
751
+ queryBookmarks: () => queryBookmarks,
752
+ queryDashboards: () => queryDashboards,
753
+ queryReports: () => queryReports,
754
+ queryUIs: () => queryUIs,
755
+ queryUsers: () => queryUsers,
636
756
  requestBundle: () => requestBundle,
637
757
  requestData: () => requestData,
638
758
  sendAuthLoginRequest: () => sendAuthLoginRequest,
@@ -643,6 +763,7 @@ __export(services_exports, {
643
763
  updateBookmark: () => updateBookmark,
644
764
  updateDashboard: () => updateDashboard,
645
765
  updateReport: () => updateReport,
766
+ updateUI: () => updateUI,
646
767
  updateUser: () => updateUser
647
768
  });
648
769
 
@@ -985,9 +1106,37 @@ async function getUser(client, username, timeout) {
985
1106
  message: payload.data?.message
986
1107
  };
987
1108
  }
1109
+ async function queryUsers(client, options = {}, timeout) {
1110
+ const { filters, limit, sort } = options;
1111
+ const messageId = `users_query_${Date.now()}`;
1112
+ const message = UsersRequestMessageSchema.parse({
1113
+ id: messageId,
1114
+ type: "USERS",
1115
+ from: { type: client.type },
1116
+ to: { type: "data-agent" },
1117
+ payload: {
1118
+ operation: "query",
1119
+ data: {
1120
+ filters,
1121
+ limit,
1122
+ sort
1123
+ }
1124
+ }
1125
+ });
1126
+ const response = await client.sendWithResponse(message, timeout);
1127
+ const payload = response.payload;
1128
+ return {
1129
+ success: payload.success,
1130
+ error: payload.error,
1131
+ users: payload.data?.users,
1132
+ count: payload.data?.count,
1133
+ message: payload.data?.message
1134
+ };
1135
+ }
988
1136
 
989
1137
  // src/services/dashboards/index.ts
990
- async function createDashboard(client, dashboardId, dashboard, timeout) {
1138
+ async function createDashboard(client, options, timeout) {
1139
+ const { dashboardId, projectId, name, description, createdBy, dashboard } = options;
991
1140
  const messageId = `dashboards_create_${Date.now()}`;
992
1141
  const message = DashboardsRequestMessageSchema.parse({
993
1142
  id: messageId,
@@ -998,6 +1147,10 @@ async function createDashboard(client, dashboardId, dashboard, timeout) {
998
1147
  operation: "create",
999
1148
  data: {
1000
1149
  dashboardId,
1150
+ projectId,
1151
+ name,
1152
+ description,
1153
+ createdBy,
1001
1154
  dashboard
1002
1155
  }
1003
1156
  }
@@ -1008,11 +1161,13 @@ async function createDashboard(client, dashboardId, dashboard, timeout) {
1008
1161
  success: payload.success,
1009
1162
  error: payload.error,
1010
1163
  message: payload.data?.message,
1164
+ id: payload.data?.id,
1011
1165
  dashboardId: payload.data?.dashboardId,
1012
1166
  dashboard: payload.data?.dashboard
1013
1167
  };
1014
1168
  }
1015
- async function updateDashboard(client, dashboardId, dashboard, timeout) {
1169
+ async function updateDashboard(client, options, timeout) {
1170
+ const { id, name, description, createdBy, updatedBy, dashboard } = options;
1016
1171
  const messageId = `dashboards_update_${Date.now()}`;
1017
1172
  const message = DashboardsRequestMessageSchema.parse({
1018
1173
  id: messageId,
@@ -1022,7 +1177,11 @@ async function updateDashboard(client, dashboardId, dashboard, timeout) {
1022
1177
  payload: {
1023
1178
  operation: "update",
1024
1179
  data: {
1025
- dashboardId,
1180
+ id,
1181
+ name,
1182
+ description,
1183
+ createdBy,
1184
+ updatedBy,
1026
1185
  dashboard
1027
1186
  }
1028
1187
  }
@@ -1033,11 +1192,12 @@ async function updateDashboard(client, dashboardId, dashboard, timeout) {
1033
1192
  success: payload.success,
1034
1193
  error: payload.error,
1035
1194
  message: payload.data?.message,
1195
+ id: payload.data?.id,
1036
1196
  dashboardId: payload.data?.dashboardId,
1037
1197
  dashboard: payload.data?.dashboard
1038
1198
  };
1039
1199
  }
1040
- async function deleteDashboard(client, dashboardId, timeout) {
1200
+ async function deleteDashboard(client, id, timeout) {
1041
1201
  const messageId = `dashboards_delete_${Date.now()}`;
1042
1202
  const message = DashboardsRequestMessageSchema.parse({
1043
1203
  id: messageId,
@@ -1047,7 +1207,7 @@ async function deleteDashboard(client, dashboardId, timeout) {
1047
1207
  payload: {
1048
1208
  operation: "delete",
1049
1209
  data: {
1050
- dashboardId
1210
+ id
1051
1211
  }
1052
1212
  }
1053
1213
  });
@@ -1057,7 +1217,7 @@ async function deleteDashboard(client, dashboardId, timeout) {
1057
1217
  success: payload.success,
1058
1218
  error: payload.error,
1059
1219
  message: payload.data?.message,
1060
- dashboardId: payload.data?.dashboardId
1220
+ id: payload.data?.id
1061
1221
  };
1062
1222
  }
1063
1223
  async function getAllDashboards(client, timeout) {
@@ -1081,7 +1241,7 @@ async function getAllDashboards(client, timeout) {
1081
1241
  message: payload.data?.message
1082
1242
  };
1083
1243
  }
1084
- async function getDashboard(client, dashboardId, timeout) {
1244
+ async function getDashboard(client, id, timeout) {
1085
1245
  const messageId = `dashboards_getone_${Date.now()}`;
1086
1246
  const message = DashboardsRequestMessageSchema.parse({
1087
1247
  id: messageId,
@@ -1091,7 +1251,7 @@ async function getDashboard(client, dashboardId, timeout) {
1091
1251
  payload: {
1092
1252
  operation: "getOne",
1093
1253
  data: {
1094
- dashboardId
1254
+ id
1095
1255
  }
1096
1256
  }
1097
1257
  });
@@ -1100,14 +1260,43 @@ async function getDashboard(client, dashboardId, timeout) {
1100
1260
  return {
1101
1261
  success: payload.success,
1102
1262
  error: payload.error,
1263
+ id: payload.data?.id,
1103
1264
  dashboardId: payload.data?.dashboardId,
1104
1265
  dashboard: payload.data?.dashboard,
1105
1266
  message: payload.data?.message
1106
1267
  };
1107
1268
  }
1269
+ async function queryDashboards(client, options = {}, timeout) {
1270
+ const { filters, limit, sort } = options;
1271
+ const messageId = `dashboards_query_${Date.now()}`;
1272
+ const message = DashboardsRequestMessageSchema.parse({
1273
+ id: messageId,
1274
+ type: "DASHBOARDS",
1275
+ from: { type: client.type },
1276
+ to: { type: "data-agent" },
1277
+ payload: {
1278
+ operation: "query",
1279
+ data: {
1280
+ filters,
1281
+ limit,
1282
+ sort
1283
+ }
1284
+ }
1285
+ });
1286
+ const response = await client.sendWithResponse(message, timeout);
1287
+ const payload = response.payload;
1288
+ return {
1289
+ success: payload.success,
1290
+ error: payload.error,
1291
+ dashboards: payload.data?.dashboards,
1292
+ count: payload.data?.count,
1293
+ message: payload.data?.message
1294
+ };
1295
+ }
1108
1296
 
1109
1297
  // src/services/reports/index.ts
1110
- async function createReport(client, reportId, report, timeout) {
1298
+ async function createReport(client, options, timeout) {
1299
+ const { reportId, projectId, name, description, createdBy, report } = options;
1111
1300
  const messageId = `reports_create_${Date.now()}`;
1112
1301
  const message = ReportsRequestMessageSchema.parse({
1113
1302
  id: messageId,
@@ -1118,6 +1307,10 @@ async function createReport(client, reportId, report, timeout) {
1118
1307
  operation: "create",
1119
1308
  data: {
1120
1309
  reportId,
1310
+ projectId,
1311
+ name,
1312
+ description,
1313
+ createdBy,
1121
1314
  report
1122
1315
  }
1123
1316
  }
@@ -1128,11 +1321,13 @@ async function createReport(client, reportId, report, timeout) {
1128
1321
  success: payload.success,
1129
1322
  error: payload.error,
1130
1323
  message: payload.data?.message,
1324
+ id: payload.data?.id,
1131
1325
  reportId: payload.data?.reportId,
1132
1326
  report: payload.data?.report
1133
1327
  };
1134
1328
  }
1135
- async function updateReport(client, reportId, report, timeout) {
1329
+ async function updateReport(client, options, timeout) {
1330
+ const { id, name, description, createdBy, updatedBy, report } = options;
1136
1331
  const messageId = `reports_update_${Date.now()}`;
1137
1332
  const message = ReportsRequestMessageSchema.parse({
1138
1333
  id: messageId,
@@ -1142,7 +1337,11 @@ async function updateReport(client, reportId, report, timeout) {
1142
1337
  payload: {
1143
1338
  operation: "update",
1144
1339
  data: {
1145
- reportId,
1340
+ id,
1341
+ name,
1342
+ description,
1343
+ createdBy,
1344
+ updatedBy,
1146
1345
  report
1147
1346
  }
1148
1347
  }
@@ -1153,11 +1352,12 @@ async function updateReport(client, reportId, report, timeout) {
1153
1352
  success: payload.success,
1154
1353
  error: payload.error,
1155
1354
  message: payload.data?.message,
1355
+ id: payload.data?.id,
1156
1356
  reportId: payload.data?.reportId,
1157
1357
  report: payload.data?.report
1158
1358
  };
1159
1359
  }
1160
- async function deleteReport(client, reportId, timeout) {
1360
+ async function deleteReport(client, id, timeout) {
1161
1361
  const messageId = `reports_delete_${Date.now()}`;
1162
1362
  const message = ReportsRequestMessageSchema.parse({
1163
1363
  id: messageId,
@@ -1167,7 +1367,7 @@ async function deleteReport(client, reportId, timeout) {
1167
1367
  payload: {
1168
1368
  operation: "delete",
1169
1369
  data: {
1170
- reportId
1370
+ id
1171
1371
  }
1172
1372
  }
1173
1373
  });
@@ -1177,7 +1377,7 @@ async function deleteReport(client, reportId, timeout) {
1177
1377
  success: payload.success,
1178
1378
  error: payload.error,
1179
1379
  message: payload.data?.message,
1180
- reportId: payload.data?.reportId
1380
+ id: payload.data?.id
1181
1381
  };
1182
1382
  }
1183
1383
  async function getAllReports(client, timeout) {
@@ -1201,7 +1401,7 @@ async function getAllReports(client, timeout) {
1201
1401
  message: payload.data?.message
1202
1402
  };
1203
1403
  }
1204
- async function getReport(client, reportId, timeout) {
1404
+ async function getReport(client, id, timeout) {
1205
1405
  const messageId = `reports_getone_${Date.now()}`;
1206
1406
  const message = ReportsRequestMessageSchema.parse({
1207
1407
  id: messageId,
@@ -1211,7 +1411,7 @@ async function getReport(client, reportId, timeout) {
1211
1411
  payload: {
1212
1412
  operation: "getOne",
1213
1413
  data: {
1214
- reportId
1414
+ id
1215
1415
  }
1216
1416
  }
1217
1417
  });
@@ -1220,14 +1420,43 @@ async function getReport(client, reportId, timeout) {
1220
1420
  return {
1221
1421
  success: payload.success,
1222
1422
  error: payload.error,
1423
+ id: payload.data?.id,
1223
1424
  reportId: payload.data?.reportId,
1224
1425
  report: payload.data?.report,
1225
1426
  message: payload.data?.message
1226
1427
  };
1227
1428
  }
1429
+ async function queryReports(client, options = {}, timeout) {
1430
+ const { filters, limit, sort } = options;
1431
+ const messageId = `reports_query_${Date.now()}`;
1432
+ const message = ReportsRequestMessageSchema.parse({
1433
+ id: messageId,
1434
+ type: "REPORTS",
1435
+ from: { type: client.type },
1436
+ to: { type: "data-agent" },
1437
+ payload: {
1438
+ operation: "query",
1439
+ data: {
1440
+ filters,
1441
+ limit,
1442
+ sort
1443
+ }
1444
+ }
1445
+ });
1446
+ const response = await client.sendWithResponse(message, timeout);
1447
+ const payload = response.payload;
1448
+ return {
1449
+ success: payload.success,
1450
+ error: payload.error,
1451
+ reports: payload.data?.reports,
1452
+ count: payload.data?.count,
1453
+ message: payload.data?.message
1454
+ };
1455
+ }
1228
1456
 
1229
1457
  // src/services/bookmarks/index.ts
1230
- async function createBookmark(client, userId, uiblock, threadId, timeout) {
1458
+ async function createBookmark(client, options, timeout) {
1459
+ const { userId, uiblock, threadId, name, description } = options;
1231
1460
  const messageId = `bookmarks_create_${Date.now()}`;
1232
1461
  const message = BookmarksRequestMessageSchema.parse({
1233
1462
  id: messageId,
@@ -1239,6 +1468,8 @@ async function createBookmark(client, userId, uiblock, threadId, timeout) {
1239
1468
  data: {
1240
1469
  userId,
1241
1470
  threadId,
1471
+ name,
1472
+ description,
1242
1473
  uiblock
1243
1474
  }
1244
1475
  }
@@ -1252,7 +1483,8 @@ async function createBookmark(client, userId, uiblock, threadId, timeout) {
1252
1483
  data: Array.isArray(payload.data) ? payload.data[0] : payload.data
1253
1484
  };
1254
1485
  }
1255
- async function updateBookmark(client, id, uiblock, timeout) {
1486
+ async function updateBookmark(client, options, timeout) {
1487
+ const { id, uiblock, threadId, name, description } = options;
1256
1488
  const messageId = `bookmarks_update_${Date.now()}`;
1257
1489
  const message = BookmarksRequestMessageSchema.parse({
1258
1490
  id: messageId,
@@ -1263,6 +1495,9 @@ async function updateBookmark(client, id, uiblock, timeout) {
1263
1495
  operation: "update",
1264
1496
  data: {
1265
1497
  id,
1498
+ threadId,
1499
+ name,
1500
+ description,
1266
1501
  uiblock
1267
1502
  }
1268
1503
  }
@@ -1343,18 +1578,20 @@ async function getBookmark(client, id, timeout) {
1343
1578
  message: payload.message
1344
1579
  };
1345
1580
  }
1346
- async function getBookmarksByUser(client, userId, threadId, timeout) {
1347
- const messageId = `bookmarks_getbyuser_${Date.now()}`;
1581
+ async function queryBookmarks(client, options = {}, timeout) {
1582
+ const { filters, limit, sort } = options;
1583
+ const messageId = `bookmarks_query_${Date.now()}`;
1348
1584
  const message = BookmarksRequestMessageSchema.parse({
1349
1585
  id: messageId,
1350
1586
  type: "BOOKMARKS",
1351
1587
  from: { type: client.type },
1352
1588
  to: { type: "data-agent" },
1353
1589
  payload: {
1354
- operation: "getByUser",
1590
+ operation: "query",
1355
1591
  data: {
1356
- userId,
1357
- threadId
1592
+ filters,
1593
+ limit,
1594
+ sort
1358
1595
  }
1359
1596
  }
1360
1597
  });
@@ -1368,17 +1605,46 @@ async function getBookmarksByUser(client, userId, threadId, timeout) {
1368
1605
  message: payload.message
1369
1606
  };
1370
1607
  }
1371
- async function getBookmarksByThread(client, threadId, timeout) {
1372
- const messageId = `bookmarks_getbythread_${Date.now()}`;
1373
- const message = BookmarksRequestMessageSchema.parse({
1608
+
1609
+ // src/services/actions.ts
1610
+ async function getActions(client, options) {
1611
+ const messageId = `msg_${Date.now()}_${Math.random().toString(36).substring(7)}`;
1612
+ const message = ActionsRequestMessageSchema.parse({
1374
1613
  id: messageId,
1375
- type: "BOOKMARKS",
1614
+ type: "ACTIONS",
1376
1615
  from: { type: client.type },
1377
1616
  to: { type: "data-agent" },
1378
1617
  payload: {
1379
- operation: "getByThread",
1618
+ SA_RUNTIME: options.SA_RUNTIME
1619
+ }
1620
+ });
1621
+ const response = await client.sendWithResponse(message, options.timeout);
1622
+ const payload = response.payload;
1623
+ return {
1624
+ success: payload.success,
1625
+ data: payload.data,
1626
+ error: payload.error
1627
+ };
1628
+ }
1629
+
1630
+ // src/services/uis/index.ts
1631
+ async function createUI(client, options, timeout) {
1632
+ const { uiId, projectId, name, description, createdBy, ui } = options;
1633
+ const messageId = `uis_create_${Date.now()}`;
1634
+ const message = UIsRequestMessageSchema.parse({
1635
+ id: messageId,
1636
+ type: "UIS",
1637
+ from: { type: client.type },
1638
+ to: { type: "data-agent" },
1639
+ payload: {
1640
+ operation: "create",
1380
1641
  data: {
1381
- threadId
1642
+ uiId,
1643
+ projectId,
1644
+ name,
1645
+ description,
1646
+ createdBy,
1647
+ ui
1382
1648
  }
1383
1649
  }
1384
1650
  });
@@ -1387,30 +1653,137 @@ async function getBookmarksByThread(client, threadId, timeout) {
1387
1653
  return {
1388
1654
  success: payload.success,
1389
1655
  error: payload.error,
1390
- data: Array.isArray(payload.data) ? payload.data : payload.data ? [payload.data] : [],
1391
- count: payload.count,
1392
- message: payload.message
1656
+ message: payload.data?.message,
1657
+ id: payload.data?.id,
1658
+ uiId: payload.data?.uiId,
1659
+ ui: payload.data?.ui
1393
1660
  };
1394
1661
  }
1395
-
1396
- // src/services/actions.ts
1397
- async function getActions(client, options) {
1398
- const messageId = `msg_${Date.now()}_${Math.random().toString(36).substring(7)}`;
1399
- const message = ActionsRequestMessageSchema.parse({
1662
+ async function updateUI(client, options, timeout) {
1663
+ const { id, name, description, createdBy, updatedBy, ui } = options;
1664
+ const messageId = `uis_update_${Date.now()}`;
1665
+ const message = UIsRequestMessageSchema.parse({
1400
1666
  id: messageId,
1401
- type: "ACTIONS",
1667
+ type: "UIS",
1402
1668
  from: { type: client.type },
1403
1669
  to: { type: "data-agent" },
1404
1670
  payload: {
1405
- SA_RUNTIME: options.SA_RUNTIME
1671
+ operation: "update",
1672
+ data: {
1673
+ id,
1674
+ name,
1675
+ description,
1676
+ createdBy,
1677
+ updatedBy,
1678
+ ui
1679
+ }
1406
1680
  }
1407
1681
  });
1408
- const response = await client.sendWithResponse(message, options.timeout);
1682
+ const response = await client.sendWithResponse(message, timeout);
1409
1683
  const payload = response.payload;
1410
1684
  return {
1411
1685
  success: payload.success,
1412
- data: payload.data,
1413
- error: payload.error
1686
+ error: payload.error,
1687
+ message: payload.data?.message,
1688
+ id: payload.data?.id,
1689
+ uiId: payload.data?.uiId,
1690
+ ui: payload.data?.ui
1691
+ };
1692
+ }
1693
+ async function deleteUI(client, id, timeout) {
1694
+ const messageId = `uis_delete_${Date.now()}`;
1695
+ const message = UIsRequestMessageSchema.parse({
1696
+ id: messageId,
1697
+ type: "UIS",
1698
+ from: { type: client.type },
1699
+ to: { type: "data-agent" },
1700
+ payload: {
1701
+ operation: "delete",
1702
+ data: {
1703
+ id
1704
+ }
1705
+ }
1706
+ });
1707
+ const response = await client.sendWithResponse(message, timeout);
1708
+ const payload = response.payload;
1709
+ return {
1710
+ success: payload.success,
1711
+ error: payload.error,
1712
+ message: payload.data?.message,
1713
+ id: payload.data?.id
1714
+ };
1715
+ }
1716
+ async function getAllUIs(client, timeout) {
1717
+ const messageId = `uis_getall_${Date.now()}`;
1718
+ const message = UIsRequestMessageSchema.parse({
1719
+ id: messageId,
1720
+ type: "UIS",
1721
+ from: { type: client.type },
1722
+ to: { type: "data-agent" },
1723
+ payload: {
1724
+ operation: "getAll"
1725
+ }
1726
+ });
1727
+ const response = await client.sendWithResponse(message, timeout);
1728
+ const payload = response.payload;
1729
+ return {
1730
+ success: payload.success,
1731
+ error: payload.error,
1732
+ uis: payload.data?.uis,
1733
+ count: payload.data?.count,
1734
+ message: payload.data?.message
1735
+ };
1736
+ }
1737
+ async function getUI(client, id, timeout) {
1738
+ const messageId = `uis_getone_${Date.now()}`;
1739
+ const message = UIsRequestMessageSchema.parse({
1740
+ id: messageId,
1741
+ type: "UIS",
1742
+ from: { type: client.type },
1743
+ to: { type: "data-agent" },
1744
+ payload: {
1745
+ operation: "getOne",
1746
+ data: {
1747
+ id
1748
+ }
1749
+ }
1750
+ });
1751
+ const response = await client.sendWithResponse(message, timeout);
1752
+ const payload = response.payload;
1753
+ return {
1754
+ success: payload.success,
1755
+ error: payload.error,
1756
+ id: payload.data?.id,
1757
+ uiId: payload.data?.uiId,
1758
+ ui: payload.data?.ui,
1759
+ message: payload.data?.message
1760
+ };
1761
+ }
1762
+ async function queryUIs(client, options = {}, timeout) {
1763
+ const { filters, limit, sort } = options;
1764
+ const messageId = `uis_query_${Date.now()}`;
1765
+ const message = UIsRequestMessageSchema.parse({
1766
+ id: messageId,
1767
+ type: "UIS",
1768
+ from: { type: client.type },
1769
+ to: { type: "data-agent" },
1770
+ payload: {
1771
+ operation: "query",
1772
+ data: {
1773
+ filters,
1774
+ limit,
1775
+ sort
1776
+ }
1777
+ }
1778
+ });
1779
+ const response = await client.sendWithResponse(message, timeout);
1780
+ const payload = response.payload;
1781
+ return {
1782
+ success: payload.success,
1783
+ error: payload.error,
1784
+ uis: payload.data?.uis,
1785
+ count: payload.data?.count,
1786
+ message: payload.data?.message
1414
1787
  };
1415
1788
  }
1416
1789
 
@@ -1791,31 +2164,39 @@ var SuperatomClient = class {
1791
2164
  this.log("info", "Fetching user:", username);
1792
2165
  return getUser(this, username, timeout);
1793
2166
  }
2167
+ /**
2168
+ * Query users with filters, limit, and sort
2169
+ * Delegates to users service
2170
+ */
2171
+ async queryUsers(options = {}, timeout) {
2172
+ this.log("info", "Querying users with filters:", options.filters);
2173
+ return queryUsers(this, options, timeout);
2174
+ }
1794
2175
  // ==================== Dashboard Management Methods ====================
1795
2176
  // These methods delegate to dashboard service for admin dashboard CRUD operations
1796
2177
  /**
1797
2178
  * Create a new dashboard
1798
2179
  * Delegates to dashboards service
1799
2180
  */
1800
- async createDashboard(dashboardId, dashboard, timeout) {
1801
- this.log("info", "Creating dashboard:", dashboardId);
1802
- return createDashboard(this, dashboardId, dashboard, timeout);
2181
+ async createDashboard(options, timeout) {
2182
+ this.log("info", "Creating dashboard:", options.dashboardId);
2183
+ return createDashboard(this, options, timeout);
1803
2184
  }
1804
2185
  /**
1805
2186
  * Update an existing dashboard
1806
2187
  * Delegates to dashboards service
1807
2188
  */
1808
- async updateDashboard(dashboardId, dashboard, timeout) {
1809
- this.log("info", "Updating dashboard:", dashboardId);
1810
- return updateDashboard(this, dashboardId, dashboard, timeout);
2189
+ async updateDashboard(options, timeout) {
2190
+ this.log("info", "Updating dashboard:", options.id);
2191
+ return updateDashboard(this, options, timeout);
1811
2192
  }
1812
2193
  /**
1813
2194
  * Delete a dashboard
1814
2195
  * Delegates to dashboards service
1815
2196
  */
1816
- async deleteDashboard(dashboardId, timeout) {
1817
- this.log("info", "Deleting dashboard:", dashboardId);
1818
- return deleteDashboard(this, dashboardId, timeout);
2197
+ async deleteDashboard(id, timeout) {
2198
+ this.log("info", "Deleting dashboard:", id);
2199
+ return deleteDashboard(this, id, timeout);
1819
2200
  }
1820
2201
  /**
1821
2202
  * Get all dashboards
@@ -1829,9 +2210,17 @@ var SuperatomClient = class {
1829
2210
  * Get a specific dashboard by ID
1830
2211
  * Delegates to dashboards service
1831
2212
  */
1832
- async getDashboard(dashboardId, timeout) {
1833
- this.log("info", "Fetching dashboard:", dashboardId);
1834
- return getDashboard(this, dashboardId, timeout);
2213
+ async getDashboard(id, timeout) {
2214
+ this.log("info", "Fetching dashboard:", id);
2215
+ return getDashboard(this, id, timeout);
2216
+ }
2217
+ /**
2218
+ * Query dashboards with filters
2219
+ * Delegates to dashboards service
2220
+ */
2221
+ async queryDashboards(options, timeout) {
2222
+ this.log("info", "Querying dashboards with filters:", options?.filters);
2223
+ return queryDashboards(this, options, timeout);
1835
2224
  }
1836
2225
  // ==================== Bookmark Management Methods ====================
1837
2226
  // These methods delegate to bookmark service for bookmark CRUD operations
@@ -1839,17 +2228,17 @@ var SuperatomClient = class {
1839
2228
  * Create a new bookmark
1840
2229
  * Delegates to bookmarks service
1841
2230
  */
1842
- async createBookmark(userId, uiblock, threadId, timeout) {
1843
- this.log("info", "Creating bookmark for user:", userId);
1844
- return createBookmark(this, userId, uiblock, threadId, timeout);
2231
+ async createBookmark(options, timeout) {
2232
+ this.log("info", "Creating bookmark for user:", options.userId);
2233
+ return createBookmark(this, options, timeout);
1845
2234
  }
1846
2235
  /**
1847
2236
  * Update an existing bookmark
1848
2237
  * Delegates to bookmarks service
1849
2238
  */
1850
- async updateBookmark(id, uiblock, timeout) {
1851
- this.log("info", "Updating bookmark:", id);
1852
- return updateBookmark(this, id, uiblock, timeout);
2239
+ async updateBookmark(options, timeout) {
2240
+ this.log("info", "Updating bookmark:", options.id);
2241
+ return updateBookmark(this, options, timeout);
1853
2242
  }
1854
2243
  /**
1855
2244
  * Delete a bookmark
@@ -1876,20 +2265,12 @@ var SuperatomClient = class {
1876
2265
  return getBookmark(this, id, timeout);
1877
2266
  }
1878
2267
  /**
1879
- * Get bookmarks by user ID (and optionally by thread ID)
1880
- * Delegates to bookmarks service
1881
- */
1882
- async getBookmarksByUser(userId, threadId, timeout) {
1883
- this.log("info", "Fetching bookmarks for user:", userId);
1884
- return getBookmarksByUser(this, userId, threadId, timeout);
1885
- }
1886
- /**
1887
- * Get bookmarks by thread ID
2268
+ * Query bookmarks with filters, limit, and sort
1888
2269
  * Delegates to bookmarks service
1889
2270
  */
1890
- async getBookmarksByThread(threadId, timeout) {
1891
- this.log("info", "Fetching bookmarks for thread:", threadId);
1892
- return getBookmarksByThread(this, threadId, timeout);
2271
+ async queryBookmarks(options = {}, timeout) {
2272
+ this.log("info", "Querying bookmarks with filters:", options.filters);
2273
+ return queryBookmarks(this, options, timeout);
1893
2274
  }
1894
2275
  // ==================== Report Management Methods ====================
1895
2276
  // These methods delegate to report service for admin report CRUD operations
@@ -1897,25 +2278,25 @@ var SuperatomClient = class {
1897
2278
  * Create a new report
1898
2279
  * Delegates to reports service
1899
2280
  */
1900
- async createReport(reportId, report, timeout) {
1901
- this.log("info", "Creating report:", reportId);
1902
- return createReport(this, reportId, report, timeout);
2281
+ async createReport(options, timeout) {
2282
+ this.log("info", "Creating report:", options.reportId);
2283
+ return createReport(this, options, timeout);
1903
2284
  }
1904
2285
  /**
1905
2286
  * Update an existing report
1906
2287
  * Delegates to reports service
1907
2288
  */
1908
- async updateReport(reportId, report, timeout) {
1909
- this.log("info", "Updating report:", reportId);
1910
- return updateReport(this, reportId, report, timeout);
2289
+ async updateReport(options, timeout) {
2290
+ this.log("info", "Updating report:", options.id);
2291
+ return updateReport(this, options, timeout);
1911
2292
  }
1912
2293
  /**
1913
2294
  * Delete a report
1914
2295
  * Delegates to reports service
1915
2296
  */
1916
- async deleteReport(reportId, timeout) {
1917
- this.log("info", "Deleting report:", reportId);
1918
- return deleteReport(this, reportId, timeout);
2297
+ async deleteReport(id, timeout) {
2298
+ this.log("info", "Deleting report:", id);
2299
+ return deleteReport(this, id, timeout);
1919
2300
  }
1920
2301
  /**
1921
2302
  * Get all reports
@@ -1929,9 +2310,67 @@ var SuperatomClient = class {
1929
2310
  * Get a specific report by ID
1930
2311
  * Delegates to reports service
1931
2312
  */
1932
- async getReport(reportId, timeout) {
1933
- this.log("info", "Fetching report:", reportId);
1934
- return getReport(this, reportId, timeout);
2313
+ async getReport(id, timeout) {
2314
+ this.log("info", "Fetching report:", id);
2315
+ return getReport(this, id, timeout);
2316
+ }
2317
+ /**
2318
+ * Query reports with filters
2319
+ * Delegates to reports service
2320
+ */
2321
+ async queryReports(options, timeout) {
2322
+ this.log("info", "Querying reports with filters:", options?.filters);
2323
+ return queryReports(this, options, timeout);
2324
+ }
2325
+ // ==================== UI Management Methods ====================
2326
+ // These methods delegate to uis service for admin UI CRUD operations
2327
+ /**
2328
+ * Create a new UI
2329
+ * Delegates to uis service
2330
+ */
2331
+ async createUI(options, timeout) {
2332
+ this.log("info", "Creating UI:", options.uiId);
2333
+ return createUI(this, options, timeout);
2334
+ }
2335
+ /**
2336
+ * Update an existing UI
2337
+ * Delegates to uis service
2338
+ */
2339
+ async updateUI(options, timeout) {
2340
+ this.log("info", "Updating UI:", options.id);
2341
+ return updateUI(this, options, timeout);
2342
+ }
2343
+ /**
2344
+ * Delete a UI
2345
+ * Delegates to uis service
2346
+ */
2347
+ async deleteUI(id, timeout) {
2348
+ this.log("info", "Deleting UI:", id);
2349
+ return deleteUI(this, id, timeout);
2350
+ }
2351
+ /**
2352
+ * Get all UIs
2353
+ * Delegates to uis service
2354
+ */
2355
+ async getAllUIs(timeout) {
2356
+ this.log("info", "Fetching all UIs");
2357
+ return getAllUIs(this, timeout);
2358
+ }
2359
+ /**
2360
+ * Get a specific UI by ID
2361
+ * Delegates to uis service
2362
+ */
2363
+ async getUI(id, timeout) {
2364
+ this.log("info", "Fetching UI:", id);
2365
+ return getUI(this, id, timeout);
2366
+ }
2367
+ /**
2368
+ * Query UIs with filters
2369
+ * Delegates to uis service
2370
+ */
2371
+ async queryUIs(options, timeout) {
2372
+ this.log("info", "Querying UIs with filters:", options?.filters);
2373
+ return queryUIs(this, options, timeout);
1935
2374
  }
1936
2375
  /**
1937
2376
  * Internal logging