@superatomai/sdk-web 0.0.14 → 0.0.16
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 +35 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -9
- package/dist/index.d.ts +26 -9
- package/dist/index.js +35 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -320,7 +320,9 @@ var UserPromptSuggestionsResponseMessageSchema = zod.z.object({
|
|
|
320
320
|
to: MessageParticipantSchema.optional(),
|
|
321
321
|
payload: UserPromptSuggestionsResponsePayloadSchema
|
|
322
322
|
});
|
|
323
|
-
var BundleRequestPayloadSchema = zod.z.object({
|
|
323
|
+
var BundleRequestPayloadSchema = zod.z.object({
|
|
324
|
+
devbundlereq: zod.z.boolean().optional().default(false)
|
|
325
|
+
});
|
|
324
326
|
var BundleRequestMessageSchema = zod.z.object({
|
|
325
327
|
id: zod.z.string(),
|
|
326
328
|
type: zod.z.literal("BUNDLE_REQ"),
|
|
@@ -446,6 +448,7 @@ var UsersRequestPayloadSchema = zod.z.object({
|
|
|
446
448
|
password: zod.z.string().optional(),
|
|
447
449
|
fullname: zod.z.string().optional(),
|
|
448
450
|
role: zod.z.string().optional(),
|
|
451
|
+
userInfo: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
449
452
|
// Query operation fields
|
|
450
453
|
filters: UserQueryFiltersSchema.optional(),
|
|
451
454
|
limit: zod.z.number().optional(),
|
|
@@ -497,7 +500,8 @@ var DashboardQueryFiltersSchema = zod.z.object({
|
|
|
497
500
|
projectId: zod.z.string().optional(),
|
|
498
501
|
createdBy: zod.z.number().optional(),
|
|
499
502
|
updatedBy: zod.z.number().optional(),
|
|
500
|
-
name: zod.z.string().optional()
|
|
503
|
+
name: zod.z.string().optional(),
|
|
504
|
+
published: zod.z.boolean().optional()
|
|
501
505
|
});
|
|
502
506
|
var DashboardsRequestPayloadSchema = zod.z.object({
|
|
503
507
|
operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
@@ -507,6 +511,7 @@ var DashboardsRequestPayloadSchema = zod.z.object({
|
|
|
507
511
|
projectId: zod.z.string().optional(),
|
|
508
512
|
name: zod.z.string().optional(),
|
|
509
513
|
description: zod.z.string().optional(),
|
|
514
|
+
published: zod.z.boolean().optional(),
|
|
510
515
|
createdBy: zod.z.number().optional(),
|
|
511
516
|
updatedBy: zod.z.number().optional(),
|
|
512
517
|
dashboard: DSLRendererPropsSchema.optional(),
|
|
@@ -549,7 +554,8 @@ var ReportQueryFiltersSchema = zod.z.object({
|
|
|
549
554
|
projectId: zod.z.string().optional(),
|
|
550
555
|
createdBy: zod.z.number().optional(),
|
|
551
556
|
updatedBy: zod.z.number().optional(),
|
|
552
|
-
name: zod.z.string().optional()
|
|
557
|
+
name: zod.z.string().optional(),
|
|
558
|
+
published: zod.z.boolean().optional()
|
|
553
559
|
});
|
|
554
560
|
var ReportsRequestPayloadSchema = zod.z.object({
|
|
555
561
|
operation: zod.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
@@ -559,6 +565,7 @@ var ReportsRequestPayloadSchema = zod.z.object({
|
|
|
559
565
|
projectId: zod.z.string().optional(),
|
|
560
566
|
name: zod.z.string().optional(),
|
|
561
567
|
description: zod.z.string().optional(),
|
|
568
|
+
published: zod.z.boolean().optional(),
|
|
562
569
|
createdBy: zod.z.number().optional(),
|
|
563
570
|
updatedBy: zod.z.number().optional(),
|
|
564
571
|
report: DSLRendererPropsSchema2.optional(),
|
|
@@ -964,7 +971,7 @@ async function requestBundle(client, options) {
|
|
|
964
971
|
type: "BUNDLE_REQ",
|
|
965
972
|
from: { type: client.type },
|
|
966
973
|
to: { type: "data-agent" },
|
|
967
|
-
payload: {}
|
|
974
|
+
payload: { devbundlereq: options?.devbundlereq ?? false }
|
|
968
975
|
});
|
|
969
976
|
const chunks = [];
|
|
970
977
|
let totalChunks = 0;
|
|
@@ -1065,7 +1072,7 @@ async function sendComponents(client, components) {
|
|
|
1065
1072
|
}
|
|
1066
1073
|
|
|
1067
1074
|
// src/services/users.ts
|
|
1068
|
-
async function createUser(client, username, password, email, fullname, role, timeout) {
|
|
1075
|
+
async function createUser(client, username, password, email, fullname, role, userInfo, timeout) {
|
|
1069
1076
|
const messageId = `users_create_${Date.now()}`;
|
|
1070
1077
|
const message = UsersRequestMessageSchema.parse({
|
|
1071
1078
|
id: messageId,
|
|
@@ -1079,7 +1086,8 @@ async function createUser(client, username, password, email, fullname, role, tim
|
|
|
1079
1086
|
password,
|
|
1080
1087
|
email,
|
|
1081
1088
|
fullname,
|
|
1082
|
-
role
|
|
1089
|
+
role,
|
|
1090
|
+
userInfo
|
|
1083
1091
|
}
|
|
1084
1092
|
}
|
|
1085
1093
|
});
|
|
@@ -1095,7 +1103,7 @@ async function createUser(client, username, password, email, fullname, role, tim
|
|
|
1095
1103
|
role: payload.data?.role
|
|
1096
1104
|
};
|
|
1097
1105
|
}
|
|
1098
|
-
async function updateUser(client,
|
|
1106
|
+
async function updateUser(client, id, updates, timeout) {
|
|
1099
1107
|
const messageId = `users_update_${Date.now()}`;
|
|
1100
1108
|
const message = UsersRequestMessageSchema.parse({
|
|
1101
1109
|
id: messageId,
|
|
@@ -1105,7 +1113,7 @@ async function updateUser(client, username, updates, timeout) {
|
|
|
1105
1113
|
payload: {
|
|
1106
1114
|
operation: "update",
|
|
1107
1115
|
data: {
|
|
1108
|
-
|
|
1116
|
+
id,
|
|
1109
1117
|
...updates
|
|
1110
1118
|
}
|
|
1111
1119
|
}
|
|
@@ -1122,7 +1130,7 @@ async function updateUser(client, username, updates, timeout) {
|
|
|
1122
1130
|
role: payload.data?.role
|
|
1123
1131
|
};
|
|
1124
1132
|
}
|
|
1125
|
-
async function deleteUser(client,
|
|
1133
|
+
async function deleteUser(client, id, timeout) {
|
|
1126
1134
|
const messageId = `users_delete_${Date.now()}`;
|
|
1127
1135
|
const message = UsersRequestMessageSchema.parse({
|
|
1128
1136
|
id: messageId,
|
|
@@ -1132,7 +1140,7 @@ async function deleteUser(client, username, timeout) {
|
|
|
1132
1140
|
payload: {
|
|
1133
1141
|
operation: "delete",
|
|
1134
1142
|
data: {
|
|
1135
|
-
|
|
1143
|
+
id
|
|
1136
1144
|
}
|
|
1137
1145
|
}
|
|
1138
1146
|
});
|
|
@@ -1222,7 +1230,7 @@ async function queryUsers(client, options = {}, timeout) {
|
|
|
1222
1230
|
|
|
1223
1231
|
// src/services/dashboards/index.ts
|
|
1224
1232
|
async function createDashboard(client, options, timeout) {
|
|
1225
|
-
const { dashboardId, projectId, name, description, createdBy, dashboard } = options;
|
|
1233
|
+
const { dashboardId, projectId, name, description, published, createdBy, dashboard } = options;
|
|
1226
1234
|
const messageId = `dashboards_create_${Date.now()}`;
|
|
1227
1235
|
const message = DashboardsRequestMessageSchema.parse({
|
|
1228
1236
|
id: messageId,
|
|
@@ -1236,6 +1244,7 @@ async function createDashboard(client, options, timeout) {
|
|
|
1236
1244
|
projectId,
|
|
1237
1245
|
name,
|
|
1238
1246
|
description,
|
|
1247
|
+
published,
|
|
1239
1248
|
createdBy,
|
|
1240
1249
|
dashboard
|
|
1241
1250
|
}
|
|
@@ -1253,7 +1262,7 @@ async function createDashboard(client, options, timeout) {
|
|
|
1253
1262
|
};
|
|
1254
1263
|
}
|
|
1255
1264
|
async function updateDashboard(client, options, timeout) {
|
|
1256
|
-
const { id, name, description, createdBy, updatedBy, dashboard } = options;
|
|
1265
|
+
const { id, name, description, published, createdBy, updatedBy, dashboard } = options;
|
|
1257
1266
|
const messageId = `dashboards_update_${Date.now()}`;
|
|
1258
1267
|
const message = DashboardsRequestMessageSchema.parse({
|
|
1259
1268
|
id: messageId,
|
|
@@ -1266,6 +1275,7 @@ async function updateDashboard(client, options, timeout) {
|
|
|
1266
1275
|
id,
|
|
1267
1276
|
name,
|
|
1268
1277
|
description,
|
|
1278
|
+
published,
|
|
1269
1279
|
createdBy,
|
|
1270
1280
|
updatedBy,
|
|
1271
1281
|
dashboard
|
|
@@ -1382,7 +1392,7 @@ async function queryDashboards(client, options = {}, timeout) {
|
|
|
1382
1392
|
|
|
1383
1393
|
// src/services/reports/index.ts
|
|
1384
1394
|
async function createReport(client, options, timeout) {
|
|
1385
|
-
const { reportId, projectId, name, description, createdBy, report } = options;
|
|
1395
|
+
const { reportId, projectId, name, description, published, createdBy, report } = options;
|
|
1386
1396
|
const messageId = `reports_create_${Date.now()}`;
|
|
1387
1397
|
const message = ReportsRequestMessageSchema.parse({
|
|
1388
1398
|
id: messageId,
|
|
@@ -1396,6 +1406,7 @@ async function createReport(client, options, timeout) {
|
|
|
1396
1406
|
projectId,
|
|
1397
1407
|
name,
|
|
1398
1408
|
description,
|
|
1409
|
+
published,
|
|
1399
1410
|
createdBy,
|
|
1400
1411
|
report
|
|
1401
1412
|
}
|
|
@@ -1413,7 +1424,7 @@ async function createReport(client, options, timeout) {
|
|
|
1413
1424
|
};
|
|
1414
1425
|
}
|
|
1415
1426
|
async function updateReport(client, options, timeout) {
|
|
1416
|
-
const { id, name, description, createdBy, updatedBy, report } = options;
|
|
1427
|
+
const { id, name, description, published, createdBy, updatedBy, report } = options;
|
|
1417
1428
|
const messageId = `reports_update_${Date.now()}`;
|
|
1418
1429
|
const message = ReportsRequestMessageSchema.parse({
|
|
1419
1430
|
id: messageId,
|
|
@@ -1426,6 +1437,7 @@ async function updateReport(client, options, timeout) {
|
|
|
1426
1437
|
id,
|
|
1427
1438
|
name,
|
|
1428
1439
|
description,
|
|
1440
|
+
published,
|
|
1429
1441
|
createdBy,
|
|
1430
1442
|
updatedBy,
|
|
1431
1443
|
report
|
|
@@ -2485,25 +2497,25 @@ var SuperatomClient = class {
|
|
|
2485
2497
|
* Create a new user
|
|
2486
2498
|
* Delegates to users service
|
|
2487
2499
|
*/
|
|
2488
|
-
async createUser(username, password, email, fullname, role, timeout) {
|
|
2500
|
+
async createUser(username, password, email, fullname, role, userInfo, timeout) {
|
|
2489
2501
|
this.log("info", "Creating user:", username);
|
|
2490
|
-
return createUser(this, username, password, email, fullname, role, timeout);
|
|
2502
|
+
return createUser(this, username, password, email, fullname, role, userInfo, timeout);
|
|
2491
2503
|
}
|
|
2492
2504
|
/**
|
|
2493
2505
|
* Update an existing user
|
|
2494
2506
|
* Delegates to users service
|
|
2495
2507
|
*/
|
|
2496
|
-
async updateUser(
|
|
2497
|
-
this.log("info", "Updating user:",
|
|
2498
|
-
return updateUser(this,
|
|
2508
|
+
async updateUser(id, updates, timeout) {
|
|
2509
|
+
this.log("info", "Updating user:", id);
|
|
2510
|
+
return updateUser(this, id, updates, timeout);
|
|
2499
2511
|
}
|
|
2500
2512
|
/**
|
|
2501
2513
|
* Delete a user
|
|
2502
2514
|
* Delegates to users service
|
|
2503
2515
|
*/
|
|
2504
|
-
async deleteUser(
|
|
2505
|
-
this.log("info", "Deleting user:",
|
|
2506
|
-
return deleteUser(this,
|
|
2516
|
+
async deleteUser(id, timeout) {
|
|
2517
|
+
this.log("info", "Deleting user:", id);
|
|
2518
|
+
return deleteUser(this, id, timeout);
|
|
2507
2519
|
}
|
|
2508
2520
|
/**
|
|
2509
2521
|
* Get all users
|
|
@@ -2536,7 +2548,7 @@ var SuperatomClient = class {
|
|
|
2536
2548
|
* Delegates to dashboards service
|
|
2537
2549
|
*/
|
|
2538
2550
|
async createDashboard(options, timeout) {
|
|
2539
|
-
this.log("info", "Creating dashboard:", options.dashboardId);
|
|
2551
|
+
this.log("info", "Creating dashboard:", options.dashboardId, options.projectId);
|
|
2540
2552
|
return createDashboard(this, options, timeout);
|
|
2541
2553
|
}
|
|
2542
2554
|
/**
|