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