@superatomai/sdk-web 0.0.11 → 0.0.12

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
@@ -479,11 +479,28 @@ z.object({
479
479
  to: MessageParticipantSchema.optional(),
480
480
  payload: UsersResponsePayloadSchema
481
481
  });
482
+ var DashboardQueryFiltersSchema = z.object({
483
+ dashboardId: z.string().optional(),
484
+ projectId: z.string().optional(),
485
+ createdBy: z.number().optional(),
486
+ updatedBy: z.number().optional(),
487
+ name: z.string().optional()
488
+ });
482
489
  var DashboardsRequestPayloadSchema = z.object({
483
- operation: z.enum(["create", "update", "delete", "getAll", "getOne"]),
490
+ operation: z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
484
491
  data: z.object({
492
+ id: z.number().optional(),
485
493
  dashboardId: z.string().optional(),
486
- dashboard: DSLRendererPropsSchema.optional()
494
+ projectId: z.string().optional(),
495
+ name: z.string().optional(),
496
+ description: z.string().optional(),
497
+ createdBy: z.number().optional(),
498
+ updatedBy: z.number().optional(),
499
+ dashboard: DSLRendererPropsSchema.optional(),
500
+ // Query operation fields
501
+ filters: DashboardQueryFiltersSchema.optional(),
502
+ limit: z.number().optional(),
503
+ sort: z.enum(["ASC", "DESC"]).optional()
487
504
  }).optional()
488
505
  });
489
506
  var DashboardsRequestMessageSchema = z.object({
@@ -514,11 +531,28 @@ z.object({
514
531
  to: MessageParticipantSchema.optional(),
515
532
  payload: DashboardsResponsePayloadSchema
516
533
  });
534
+ var ReportQueryFiltersSchema = z.object({
535
+ reportId: z.string().optional(),
536
+ projectId: z.string().optional(),
537
+ createdBy: z.number().optional(),
538
+ updatedBy: z.number().optional(),
539
+ name: z.string().optional()
540
+ });
517
541
  var ReportsRequestPayloadSchema = z.object({
518
- operation: z.enum(["create", "update", "delete", "getAll", "getOne"]),
542
+ operation: z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
519
543
  data: z.object({
544
+ id: z.number().optional(),
520
545
  reportId: z.string().optional(),
521
- report: DSLRendererPropsSchema2.optional()
546
+ projectId: z.string().optional(),
547
+ name: z.string().optional(),
548
+ description: z.string().optional(),
549
+ createdBy: z.number().optional(),
550
+ updatedBy: z.number().optional(),
551
+ report: DSLRendererPropsSchema2.optional(),
552
+ // Query operation fields
553
+ filters: ReportQueryFiltersSchema.optional(),
554
+ limit: z.number().optional(),
555
+ sort: z.enum(["ASC", "DESC"]).optional()
522
556
  }).optional()
523
557
  });
524
558
  var ReportsRequestMessageSchema = z.object({
@@ -549,10 +583,67 @@ z.object({
549
583
  to: MessageParticipantSchema.optional(),
550
584
  payload: ReportsResponsePayloadSchema
551
585
  });
586
+ var UIQueryFiltersSchema = z.object({
587
+ uiId: z.string().optional(),
588
+ projectId: z.string().optional(),
589
+ createdBy: z.number().optional(),
590
+ updatedBy: z.number().optional(),
591
+ name: z.string().optional()
592
+ });
593
+ var UIsRequestPayloadSchema = z.object({
594
+ operation: z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
595
+ data: z.object({
596
+ id: z.number().optional(),
597
+ uiId: z.string().optional(),
598
+ projectId: z.string().optional(),
599
+ name: z.string().optional(),
600
+ description: z.string().optional(),
601
+ createdBy: z.number().optional(),
602
+ updatedBy: z.number().optional(),
603
+ ui: DSLRendererPropsSchema.optional(),
604
+ // Query operation fields
605
+ filters: UIQueryFiltersSchema.optional(),
606
+ limit: z.number().optional(),
607
+ sort: z.enum(["ASC", "DESC"]).optional()
608
+ }).optional()
609
+ });
610
+ var UIsRequestMessageSchema = z.object({
611
+ id: z.string(),
612
+ type: z.literal("UIS"),
613
+ from: MessageParticipantSchema,
614
+ to: MessageParticipantSchema.optional(),
615
+ payload: UIsRequestPayloadSchema
616
+ });
617
+ var UIsResponsePayloadSchema = z.object({
618
+ success: z.boolean(),
619
+ error: z.string().optional(),
620
+ data: z.object({
621
+ uiId: z.union([z.string(), z.number()]).optional(),
622
+ ui: DSLRendererPropsSchema.optional(),
623
+ uis: z.array(z.object({
624
+ uiId: z.string(),
625
+ ui: DSLRendererPropsSchema.optional()
626
+ })).optional(),
627
+ count: z.number().optional(),
628
+ message: z.string().optional()
629
+ }).optional()
630
+ });
631
+ z.object({
632
+ id: z.string(),
633
+ type: z.literal("UIS_RES"),
634
+ from: MessageParticipantSchema,
635
+ to: MessageParticipantSchema.optional(),
636
+ payload: UIsResponsePayloadSchema
637
+ });
638
+ var DBUIBlockSchema = z.object({
639
+ id: z.string(),
640
+ component: z.record(z.string(), z.any()).nullable(),
641
+ analysis: z.string().nullable(),
642
+ user_prompt: z.string()
643
+ });
552
644
  var BookmarkDataSchema = z.object({
553
645
  id: z.number().optional(),
554
- uiblock: z.any(),
555
- // JSON object
646
+ uiblock: DBUIBlockSchema,
556
647
  created_at: z.string().optional(),
557
648
  updated_at: z.string().optional()
558
649
  });
@@ -562,7 +653,9 @@ var BookmarksRequestPayloadSchema = z.object({
562
653
  id: z.number().optional(),
563
654
  userId: z.number().optional(),
564
655
  threadId: z.string().optional(),
565
- uiblock: z.any().optional()
656
+ name: z.string().optional(),
657
+ description: z.string().optional(),
658
+ uiblock: DBUIBlockSchema.optional()
566
659
  }).optional()
567
660
  });
568
661
  var BookmarksRequestMessageSchema = z.object({
@@ -614,15 +707,18 @@ __export(services_exports, {
614
707
  createBookmark: () => createBookmark,
615
708
  createDashboard: () => createDashboard,
616
709
  createReport: () => createReport,
710
+ createUI: () => createUI,
617
711
  createUser: () => createUser,
618
712
  deleteBookmark: () => deleteBookmark,
619
713
  deleteDashboard: () => deleteDashboard,
620
714
  deleteReport: () => deleteReport,
715
+ deleteUI: () => deleteUI,
621
716
  deleteUser: () => deleteUser,
622
717
  getActions: () => getActions,
623
718
  getAllBookmarks: () => getAllBookmarks,
624
719
  getAllDashboards: () => getAllDashboards,
625
720
  getAllReports: () => getAllReports,
721
+ getAllUIs: () => getAllUIs,
626
722
  getAllUsers: () => getAllUsers,
627
723
  getBookmark: () => getBookmark,
628
724
  getBookmarksByThread: () => getBookmarksByThread,
@@ -630,7 +726,11 @@ __export(services_exports, {
630
726
  getComponentSuggestions: () => getComponentSuggestions,
631
727
  getDashboard: () => getDashboard,
632
728
  getReport: () => getReport,
729
+ getUI: () => getUI,
633
730
  getUser: () => getUser,
731
+ queryDashboards: () => queryDashboards,
732
+ queryReports: () => queryReports,
733
+ queryUIs: () => queryUIs,
634
734
  requestBundle: () => requestBundle,
635
735
  requestData: () => requestData,
636
736
  sendAuthLoginRequest: () => sendAuthLoginRequest,
@@ -641,6 +741,7 @@ __export(services_exports, {
641
741
  updateBookmark: () => updateBookmark,
642
742
  updateDashboard: () => updateDashboard,
643
743
  updateReport: () => updateReport,
744
+ updateUI: () => updateUI,
644
745
  updateUser: () => updateUser
645
746
  });
646
747
 
@@ -985,7 +1086,8 @@ async function getUser(client, username, timeout) {
985
1086
  }
986
1087
 
987
1088
  // src/services/dashboards/index.ts
988
- async function createDashboard(client, dashboardId, dashboard, timeout) {
1089
+ async function createDashboard(client, options, timeout) {
1090
+ const { dashboardId, projectId, name, description, createdBy, dashboard } = options;
989
1091
  const messageId = `dashboards_create_${Date.now()}`;
990
1092
  const message = DashboardsRequestMessageSchema.parse({
991
1093
  id: messageId,
@@ -996,6 +1098,10 @@ async function createDashboard(client, dashboardId, dashboard, timeout) {
996
1098
  operation: "create",
997
1099
  data: {
998
1100
  dashboardId,
1101
+ projectId,
1102
+ name,
1103
+ description,
1104
+ createdBy,
999
1105
  dashboard
1000
1106
  }
1001
1107
  }
@@ -1006,11 +1112,13 @@ async function createDashboard(client, dashboardId, dashboard, timeout) {
1006
1112
  success: payload.success,
1007
1113
  error: payload.error,
1008
1114
  message: payload.data?.message,
1115
+ id: payload.data?.id,
1009
1116
  dashboardId: payload.data?.dashboardId,
1010
1117
  dashboard: payload.data?.dashboard
1011
1118
  };
1012
1119
  }
1013
- async function updateDashboard(client, dashboardId, dashboard, timeout) {
1120
+ async function updateDashboard(client, options, timeout) {
1121
+ const { id, name, description, createdBy, updatedBy, dashboard } = options;
1014
1122
  const messageId = `dashboards_update_${Date.now()}`;
1015
1123
  const message = DashboardsRequestMessageSchema.parse({
1016
1124
  id: messageId,
@@ -1020,7 +1128,11 @@ async function updateDashboard(client, dashboardId, dashboard, timeout) {
1020
1128
  payload: {
1021
1129
  operation: "update",
1022
1130
  data: {
1023
- dashboardId,
1131
+ id,
1132
+ name,
1133
+ description,
1134
+ createdBy,
1135
+ updatedBy,
1024
1136
  dashboard
1025
1137
  }
1026
1138
  }
@@ -1031,11 +1143,12 @@ async function updateDashboard(client, dashboardId, dashboard, timeout) {
1031
1143
  success: payload.success,
1032
1144
  error: payload.error,
1033
1145
  message: payload.data?.message,
1146
+ id: payload.data?.id,
1034
1147
  dashboardId: payload.data?.dashboardId,
1035
1148
  dashboard: payload.data?.dashboard
1036
1149
  };
1037
1150
  }
1038
- async function deleteDashboard(client, dashboardId, timeout) {
1151
+ async function deleteDashboard(client, id, timeout) {
1039
1152
  const messageId = `dashboards_delete_${Date.now()}`;
1040
1153
  const message = DashboardsRequestMessageSchema.parse({
1041
1154
  id: messageId,
@@ -1045,7 +1158,7 @@ async function deleteDashboard(client, dashboardId, timeout) {
1045
1158
  payload: {
1046
1159
  operation: "delete",
1047
1160
  data: {
1048
- dashboardId
1161
+ id
1049
1162
  }
1050
1163
  }
1051
1164
  });
@@ -1055,7 +1168,7 @@ async function deleteDashboard(client, dashboardId, timeout) {
1055
1168
  success: payload.success,
1056
1169
  error: payload.error,
1057
1170
  message: payload.data?.message,
1058
- dashboardId: payload.data?.dashboardId
1171
+ id: payload.data?.id
1059
1172
  };
1060
1173
  }
1061
1174
  async function getAllDashboards(client, timeout) {
@@ -1079,7 +1192,7 @@ async function getAllDashboards(client, timeout) {
1079
1192
  message: payload.data?.message
1080
1193
  };
1081
1194
  }
1082
- async function getDashboard(client, dashboardId, timeout) {
1195
+ async function getDashboard(client, id, timeout) {
1083
1196
  const messageId = `dashboards_getone_${Date.now()}`;
1084
1197
  const message = DashboardsRequestMessageSchema.parse({
1085
1198
  id: messageId,
@@ -1089,7 +1202,7 @@ async function getDashboard(client, dashboardId, timeout) {
1089
1202
  payload: {
1090
1203
  operation: "getOne",
1091
1204
  data: {
1092
- dashboardId
1205
+ id
1093
1206
  }
1094
1207
  }
1095
1208
  });
@@ -1098,14 +1211,43 @@ async function getDashboard(client, dashboardId, timeout) {
1098
1211
  return {
1099
1212
  success: payload.success,
1100
1213
  error: payload.error,
1214
+ id: payload.data?.id,
1101
1215
  dashboardId: payload.data?.dashboardId,
1102
1216
  dashboard: payload.data?.dashboard,
1103
1217
  message: payload.data?.message
1104
1218
  };
1105
1219
  }
1220
+ async function queryDashboards(client, options = {}, timeout) {
1221
+ const { filters, limit, sort } = options;
1222
+ const messageId = `dashboards_query_${Date.now()}`;
1223
+ const message = DashboardsRequestMessageSchema.parse({
1224
+ id: messageId,
1225
+ type: "DASHBOARDS",
1226
+ from: { type: client.type },
1227
+ to: { type: "data-agent" },
1228
+ payload: {
1229
+ operation: "query",
1230
+ data: {
1231
+ filters,
1232
+ limit,
1233
+ sort
1234
+ }
1235
+ }
1236
+ });
1237
+ const response = await client.sendWithResponse(message, timeout);
1238
+ const payload = response.payload;
1239
+ return {
1240
+ success: payload.success,
1241
+ error: payload.error,
1242
+ dashboards: payload.data?.dashboards,
1243
+ count: payload.data?.count,
1244
+ message: payload.data?.message
1245
+ };
1246
+ }
1106
1247
 
1107
1248
  // src/services/reports/index.ts
1108
- async function createReport(client, reportId, report, timeout) {
1249
+ async function createReport(client, options, timeout) {
1250
+ const { reportId, projectId, name, description, createdBy, report } = options;
1109
1251
  const messageId = `reports_create_${Date.now()}`;
1110
1252
  const message = ReportsRequestMessageSchema.parse({
1111
1253
  id: messageId,
@@ -1116,6 +1258,10 @@ async function createReport(client, reportId, report, timeout) {
1116
1258
  operation: "create",
1117
1259
  data: {
1118
1260
  reportId,
1261
+ projectId,
1262
+ name,
1263
+ description,
1264
+ createdBy,
1119
1265
  report
1120
1266
  }
1121
1267
  }
@@ -1126,11 +1272,13 @@ async function createReport(client, reportId, report, timeout) {
1126
1272
  success: payload.success,
1127
1273
  error: payload.error,
1128
1274
  message: payload.data?.message,
1275
+ id: payload.data?.id,
1129
1276
  reportId: payload.data?.reportId,
1130
1277
  report: payload.data?.report
1131
1278
  };
1132
1279
  }
1133
- async function updateReport(client, reportId, report, timeout) {
1280
+ async function updateReport(client, options, timeout) {
1281
+ const { id, name, description, createdBy, updatedBy, report } = options;
1134
1282
  const messageId = `reports_update_${Date.now()}`;
1135
1283
  const message = ReportsRequestMessageSchema.parse({
1136
1284
  id: messageId,
@@ -1140,7 +1288,11 @@ async function updateReport(client, reportId, report, timeout) {
1140
1288
  payload: {
1141
1289
  operation: "update",
1142
1290
  data: {
1143
- reportId,
1291
+ id,
1292
+ name,
1293
+ description,
1294
+ createdBy,
1295
+ updatedBy,
1144
1296
  report
1145
1297
  }
1146
1298
  }
@@ -1151,11 +1303,12 @@ async function updateReport(client, reportId, report, timeout) {
1151
1303
  success: payload.success,
1152
1304
  error: payload.error,
1153
1305
  message: payload.data?.message,
1306
+ id: payload.data?.id,
1154
1307
  reportId: payload.data?.reportId,
1155
1308
  report: payload.data?.report
1156
1309
  };
1157
1310
  }
1158
- async function deleteReport(client, reportId, timeout) {
1311
+ async function deleteReport(client, id, timeout) {
1159
1312
  const messageId = `reports_delete_${Date.now()}`;
1160
1313
  const message = ReportsRequestMessageSchema.parse({
1161
1314
  id: messageId,
@@ -1165,7 +1318,7 @@ async function deleteReport(client, reportId, timeout) {
1165
1318
  payload: {
1166
1319
  operation: "delete",
1167
1320
  data: {
1168
- reportId
1321
+ id
1169
1322
  }
1170
1323
  }
1171
1324
  });
@@ -1175,7 +1328,7 @@ async function deleteReport(client, reportId, timeout) {
1175
1328
  success: payload.success,
1176
1329
  error: payload.error,
1177
1330
  message: payload.data?.message,
1178
- reportId: payload.data?.reportId
1331
+ id: payload.data?.id
1179
1332
  };
1180
1333
  }
1181
1334
  async function getAllReports(client, timeout) {
@@ -1199,7 +1352,7 @@ async function getAllReports(client, timeout) {
1199
1352
  message: payload.data?.message
1200
1353
  };
1201
1354
  }
1202
- async function getReport(client, reportId, timeout) {
1355
+ async function getReport(client, id, timeout) {
1203
1356
  const messageId = `reports_getone_${Date.now()}`;
1204
1357
  const message = ReportsRequestMessageSchema.parse({
1205
1358
  id: messageId,
@@ -1209,7 +1362,7 @@ async function getReport(client, reportId, timeout) {
1209
1362
  payload: {
1210
1363
  operation: "getOne",
1211
1364
  data: {
1212
- reportId
1365
+ id
1213
1366
  }
1214
1367
  }
1215
1368
  });
@@ -1218,14 +1371,43 @@ async function getReport(client, reportId, timeout) {
1218
1371
  return {
1219
1372
  success: payload.success,
1220
1373
  error: payload.error,
1374
+ id: payload.data?.id,
1221
1375
  reportId: payload.data?.reportId,
1222
1376
  report: payload.data?.report,
1223
1377
  message: payload.data?.message
1224
1378
  };
1225
1379
  }
1380
+ async function queryReports(client, options = {}, timeout) {
1381
+ const { filters, limit, sort } = options;
1382
+ const messageId = `reports_query_${Date.now()}`;
1383
+ const message = ReportsRequestMessageSchema.parse({
1384
+ id: messageId,
1385
+ type: "REPORTS",
1386
+ from: { type: client.type },
1387
+ to: { type: "data-agent" },
1388
+ payload: {
1389
+ operation: "query",
1390
+ data: {
1391
+ filters,
1392
+ limit,
1393
+ sort
1394
+ }
1395
+ }
1396
+ });
1397
+ const response = await client.sendWithResponse(message, timeout);
1398
+ const payload = response.payload;
1399
+ return {
1400
+ success: payload.success,
1401
+ error: payload.error,
1402
+ reports: payload.data?.reports,
1403
+ count: payload.data?.count,
1404
+ message: payload.data?.message
1405
+ };
1406
+ }
1226
1407
 
1227
1408
  // src/services/bookmarks/index.ts
1228
- async function createBookmark(client, userId, uiblock, threadId, timeout) {
1409
+ async function createBookmark(client, options, timeout) {
1410
+ const { userId, uiblock, threadId, name, description } = options;
1229
1411
  const messageId = `bookmarks_create_${Date.now()}`;
1230
1412
  const message = BookmarksRequestMessageSchema.parse({
1231
1413
  id: messageId,
@@ -1237,6 +1419,8 @@ async function createBookmark(client, userId, uiblock, threadId, timeout) {
1237
1419
  data: {
1238
1420
  userId,
1239
1421
  threadId,
1422
+ name,
1423
+ description,
1240
1424
  uiblock
1241
1425
  }
1242
1426
  }
@@ -1250,7 +1434,8 @@ async function createBookmark(client, userId, uiblock, threadId, timeout) {
1250
1434
  data: Array.isArray(payload.data) ? payload.data[0] : payload.data
1251
1435
  };
1252
1436
  }
1253
- async function updateBookmark(client, id, uiblock, timeout) {
1437
+ async function updateBookmark(client, options, timeout) {
1438
+ const { id, uiblock, threadId, name, description } = options;
1254
1439
  const messageId = `bookmarks_update_${Date.now()}`;
1255
1440
  const message = BookmarksRequestMessageSchema.parse({
1256
1441
  id: messageId,
@@ -1261,6 +1446,9 @@ async function updateBookmark(client, id, uiblock, timeout) {
1261
1446
  operation: "update",
1262
1447
  data: {
1263
1448
  id,
1449
+ threadId,
1450
+ name,
1451
+ description,
1264
1452
  uiblock
1265
1453
  }
1266
1454
  }
@@ -1412,6 +1600,166 @@ async function getActions(client, options) {
1412
1600
  };
1413
1601
  }
1414
1602
 
1603
+ // src/services/uis/index.ts
1604
+ async function createUI(client, options, timeout) {
1605
+ const { uiId, projectId, name, description, createdBy, ui } = options;
1606
+ const messageId = `uis_create_${Date.now()}`;
1607
+ const message = UIsRequestMessageSchema.parse({
1608
+ id: messageId,
1609
+ type: "UIS",
1610
+ from: { type: client.type },
1611
+ to: { type: "data-agent" },
1612
+ payload: {
1613
+ operation: "create",
1614
+ data: {
1615
+ uiId,
1616
+ projectId,
1617
+ name,
1618
+ description,
1619
+ createdBy,
1620
+ ui
1621
+ }
1622
+ }
1623
+ });
1624
+ const response = await client.sendWithResponse(message, timeout);
1625
+ const payload = response.payload;
1626
+ return {
1627
+ success: payload.success,
1628
+ error: payload.error,
1629
+ message: payload.data?.message,
1630
+ id: payload.data?.id,
1631
+ uiId: payload.data?.uiId,
1632
+ ui: payload.data?.ui
1633
+ };
1634
+ }
1635
+ async function updateUI(client, options, timeout) {
1636
+ const { id, name, description, createdBy, updatedBy, ui } = options;
1637
+ const messageId = `uis_update_${Date.now()}`;
1638
+ const message = UIsRequestMessageSchema.parse({
1639
+ id: messageId,
1640
+ type: "UIS",
1641
+ from: { type: client.type },
1642
+ to: { type: "data-agent" },
1643
+ payload: {
1644
+ operation: "update",
1645
+ data: {
1646
+ id,
1647
+ name,
1648
+ description,
1649
+ createdBy,
1650
+ updatedBy,
1651
+ ui
1652
+ }
1653
+ }
1654
+ });
1655
+ const response = await client.sendWithResponse(message, timeout);
1656
+ const payload = response.payload;
1657
+ return {
1658
+ success: payload.success,
1659
+ error: payload.error,
1660
+ message: payload.data?.message,
1661
+ id: payload.data?.id,
1662
+ uiId: payload.data?.uiId,
1663
+ ui: payload.data?.ui
1664
+ };
1665
+ }
1666
+ async function deleteUI(client, id, timeout) {
1667
+ const messageId = `uis_delete_${Date.now()}`;
1668
+ const message = UIsRequestMessageSchema.parse({
1669
+ id: messageId,
1670
+ type: "UIS",
1671
+ from: { type: client.type },
1672
+ to: { type: "data-agent" },
1673
+ payload: {
1674
+ operation: "delete",
1675
+ data: {
1676
+ id
1677
+ }
1678
+ }
1679
+ });
1680
+ const response = await client.sendWithResponse(message, timeout);
1681
+ const payload = response.payload;
1682
+ return {
1683
+ success: payload.success,
1684
+ error: payload.error,
1685
+ message: payload.data?.message,
1686
+ id: payload.data?.id
1687
+ };
1688
+ }
1689
+ async function getAllUIs(client, timeout) {
1690
+ const messageId = `uis_getall_${Date.now()}`;
1691
+ const message = UIsRequestMessageSchema.parse({
1692
+ id: messageId,
1693
+ type: "UIS",
1694
+ from: { type: client.type },
1695
+ to: { type: "data-agent" },
1696
+ payload: {
1697
+ operation: "getAll"
1698
+ }
1699
+ });
1700
+ const response = await client.sendWithResponse(message, timeout);
1701
+ const payload = response.payload;
1702
+ return {
1703
+ success: payload.success,
1704
+ error: payload.error,
1705
+ uis: payload.data?.uis,
1706
+ count: payload.data?.count,
1707
+ message: payload.data?.message
1708
+ };
1709
+ }
1710
+ async function getUI(client, id, timeout) {
1711
+ const messageId = `uis_getone_${Date.now()}`;
1712
+ const message = UIsRequestMessageSchema.parse({
1713
+ id: messageId,
1714
+ type: "UIS",
1715
+ from: { type: client.type },
1716
+ to: { type: "data-agent" },
1717
+ payload: {
1718
+ operation: "getOne",
1719
+ data: {
1720
+ id
1721
+ }
1722
+ }
1723
+ });
1724
+ const response = await client.sendWithResponse(message, timeout);
1725
+ const payload = response.payload;
1726
+ return {
1727
+ success: payload.success,
1728
+ error: payload.error,
1729
+ id: payload.data?.id,
1730
+ uiId: payload.data?.uiId,
1731
+ ui: payload.data?.ui,
1732
+ message: payload.data?.message
1733
+ };
1734
+ }
1735
+ async function queryUIs(client, options = {}, timeout) {
1736
+ const { filters, limit, sort } = options;
1737
+ const messageId = `uis_query_${Date.now()}`;
1738
+ const message = UIsRequestMessageSchema.parse({
1739
+ id: messageId,
1740
+ type: "UIS",
1741
+ from: { type: client.type },
1742
+ to: { type: "data-agent" },
1743
+ payload: {
1744
+ operation: "query",
1745
+ data: {
1746
+ filters,
1747
+ limit,
1748
+ sort
1749
+ }
1750
+ }
1751
+ });
1752
+ const response = await client.sendWithResponse(message, timeout);
1753
+ const payload = response.payload;
1754
+ return {
1755
+ success: payload.success,
1756
+ error: payload.error,
1757
+ uis: payload.data?.uis,
1758
+ count: payload.data?.count,
1759
+ message: payload.data?.message
1760
+ };
1761
+ }
1762
+
1415
1763
  // src/client.ts
1416
1764
  var SuperatomClient = class {
1417
1765
  constructor(config) {
@@ -1795,25 +2143,25 @@ var SuperatomClient = class {
1795
2143
  * Create a new dashboard
1796
2144
  * Delegates to dashboards service
1797
2145
  */
1798
- async createDashboard(dashboardId, dashboard, timeout) {
1799
- this.log("info", "Creating dashboard:", dashboardId);
1800
- return createDashboard(this, dashboardId, dashboard, timeout);
2146
+ async createDashboard(options, timeout) {
2147
+ this.log("info", "Creating dashboard:", options.dashboardId);
2148
+ return createDashboard(this, options, timeout);
1801
2149
  }
1802
2150
  /**
1803
2151
  * Update an existing dashboard
1804
2152
  * Delegates to dashboards service
1805
2153
  */
1806
- async updateDashboard(dashboardId, dashboard, timeout) {
1807
- this.log("info", "Updating dashboard:", dashboardId);
1808
- return updateDashboard(this, dashboardId, dashboard, timeout);
2154
+ async updateDashboard(options, timeout) {
2155
+ this.log("info", "Updating dashboard:", options.id);
2156
+ return updateDashboard(this, options, timeout);
1809
2157
  }
1810
2158
  /**
1811
2159
  * Delete a dashboard
1812
2160
  * Delegates to dashboards service
1813
2161
  */
1814
- async deleteDashboard(dashboardId, timeout) {
1815
- this.log("info", "Deleting dashboard:", dashboardId);
1816
- return deleteDashboard(this, dashboardId, timeout);
2162
+ async deleteDashboard(id, timeout) {
2163
+ this.log("info", "Deleting dashboard:", id);
2164
+ return deleteDashboard(this, id, timeout);
1817
2165
  }
1818
2166
  /**
1819
2167
  * Get all dashboards
@@ -1827,9 +2175,17 @@ var SuperatomClient = class {
1827
2175
  * Get a specific dashboard by ID
1828
2176
  * Delegates to dashboards service
1829
2177
  */
1830
- async getDashboard(dashboardId, timeout) {
1831
- this.log("info", "Fetching dashboard:", dashboardId);
1832
- return getDashboard(this, dashboardId, timeout);
2178
+ async getDashboard(id, timeout) {
2179
+ this.log("info", "Fetching dashboard:", id);
2180
+ return getDashboard(this, id, timeout);
2181
+ }
2182
+ /**
2183
+ * Query dashboards with filters
2184
+ * Delegates to dashboards service
2185
+ */
2186
+ async queryDashboards(options, timeout) {
2187
+ this.log("info", "Querying dashboards with filters:", options?.filters);
2188
+ return queryDashboards(this, options, timeout);
1833
2189
  }
1834
2190
  // ==================== Bookmark Management Methods ====================
1835
2191
  // These methods delegate to bookmark service for bookmark CRUD operations
@@ -1837,17 +2193,17 @@ var SuperatomClient = class {
1837
2193
  * Create a new bookmark
1838
2194
  * Delegates to bookmarks service
1839
2195
  */
1840
- async createBookmark(userId, uiblock, threadId, timeout) {
1841
- this.log("info", "Creating bookmark for user:", userId);
1842
- return createBookmark(this, userId, uiblock, threadId, timeout);
2196
+ async createBookmark(options, timeout) {
2197
+ this.log("info", "Creating bookmark for user:", options.userId);
2198
+ return createBookmark(this, options, timeout);
1843
2199
  }
1844
2200
  /**
1845
2201
  * Update an existing bookmark
1846
2202
  * Delegates to bookmarks service
1847
2203
  */
1848
- async updateBookmark(id, uiblock, timeout) {
1849
- this.log("info", "Updating bookmark:", id);
1850
- return updateBookmark(this, id, uiblock, timeout);
2204
+ async updateBookmark(options, timeout) {
2205
+ this.log("info", "Updating bookmark:", options.id);
2206
+ return updateBookmark(this, options, timeout);
1851
2207
  }
1852
2208
  /**
1853
2209
  * Delete a bookmark
@@ -1895,25 +2251,25 @@ var SuperatomClient = class {
1895
2251
  * Create a new report
1896
2252
  * Delegates to reports service
1897
2253
  */
1898
- async createReport(reportId, report, timeout) {
1899
- this.log("info", "Creating report:", reportId);
1900
- return createReport(this, reportId, report, timeout);
2254
+ async createReport(options, timeout) {
2255
+ this.log("info", "Creating report:", options.reportId);
2256
+ return createReport(this, options, timeout);
1901
2257
  }
1902
2258
  /**
1903
2259
  * Update an existing report
1904
2260
  * Delegates to reports service
1905
2261
  */
1906
- async updateReport(reportId, report, timeout) {
1907
- this.log("info", "Updating report:", reportId);
1908
- return updateReport(this, reportId, report, timeout);
2262
+ async updateReport(options, timeout) {
2263
+ this.log("info", "Updating report:", options.id);
2264
+ return updateReport(this, options, timeout);
1909
2265
  }
1910
2266
  /**
1911
2267
  * Delete a report
1912
2268
  * Delegates to reports service
1913
2269
  */
1914
- async deleteReport(reportId, timeout) {
1915
- this.log("info", "Deleting report:", reportId);
1916
- return deleteReport(this, reportId, timeout);
2270
+ async deleteReport(id, timeout) {
2271
+ this.log("info", "Deleting report:", id);
2272
+ return deleteReport(this, id, timeout);
1917
2273
  }
1918
2274
  /**
1919
2275
  * Get all reports
@@ -1927,9 +2283,67 @@ var SuperatomClient = class {
1927
2283
  * Get a specific report by ID
1928
2284
  * Delegates to reports service
1929
2285
  */
1930
- async getReport(reportId, timeout) {
1931
- this.log("info", "Fetching report:", reportId);
1932
- return getReport(this, reportId, timeout);
2286
+ async getReport(id, timeout) {
2287
+ this.log("info", "Fetching report:", id);
2288
+ return getReport(this, id, timeout);
2289
+ }
2290
+ /**
2291
+ * Query reports with filters
2292
+ * Delegates to reports service
2293
+ */
2294
+ async queryReports(options, timeout) {
2295
+ this.log("info", "Querying reports with filters:", options?.filters);
2296
+ return queryReports(this, options, timeout);
2297
+ }
2298
+ // ==================== UI Management Methods ====================
2299
+ // These methods delegate to uis service for admin UI CRUD operations
2300
+ /**
2301
+ * Create a new UI
2302
+ * Delegates to uis service
2303
+ */
2304
+ async createUI(options, timeout) {
2305
+ this.log("info", "Creating UI:", options.uiId);
2306
+ return createUI(this, options, timeout);
2307
+ }
2308
+ /**
2309
+ * Update an existing UI
2310
+ * Delegates to uis service
2311
+ */
2312
+ async updateUI(options, timeout) {
2313
+ this.log("info", "Updating UI:", options.id);
2314
+ return updateUI(this, options, timeout);
2315
+ }
2316
+ /**
2317
+ * Delete a UI
2318
+ * Delegates to uis service
2319
+ */
2320
+ async deleteUI(id, timeout) {
2321
+ this.log("info", "Deleting UI:", id);
2322
+ return deleteUI(this, id, timeout);
2323
+ }
2324
+ /**
2325
+ * Get all UIs
2326
+ * Delegates to uis service
2327
+ */
2328
+ async getAllUIs(timeout) {
2329
+ this.log("info", "Fetching all UIs");
2330
+ return getAllUIs(this, timeout);
2331
+ }
2332
+ /**
2333
+ * Get a specific UI by ID
2334
+ * Delegates to uis service
2335
+ */
2336
+ async getUI(id, timeout) {
2337
+ this.log("info", "Fetching UI:", id);
2338
+ return getUI(this, id, timeout);
2339
+ }
2340
+ /**
2341
+ * Query UIs with filters
2342
+ * Delegates to uis service
2343
+ */
2344
+ async queryUIs(options, timeout) {
2345
+ this.log("info", "Querying UIs with filters:", options?.filters);
2346
+ return queryUIs(this, options, timeout);
1933
2347
  }
1934
2348
  /**
1935
2349
  * Internal logging