@superatomai/sdk-web 0.0.15 → 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/README.md +755 -755
- package/dist/index.cjs +21 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/package.json +41 -43
package/dist/index.d.cts
CHANGED
|
@@ -850,6 +850,7 @@ declare const DashboardQueryFiltersSchema: z.ZodObject<{
|
|
|
850
850
|
createdBy: z.ZodOptional<z.ZodNumber>;
|
|
851
851
|
updatedBy: z.ZodOptional<z.ZodNumber>;
|
|
852
852
|
name: z.ZodOptional<z.ZodString>;
|
|
853
|
+
published: z.ZodOptional<z.ZodBoolean>;
|
|
853
854
|
}, z.core.$strip>;
|
|
854
855
|
type DashboardQueryFilters = z.infer<typeof DashboardQueryFiltersSchema>;
|
|
855
856
|
/**
|
|
@@ -862,6 +863,7 @@ declare const ReportQueryFiltersSchema: z.ZodObject<{
|
|
|
862
863
|
createdBy: z.ZodOptional<z.ZodNumber>;
|
|
863
864
|
updatedBy: z.ZodOptional<z.ZodNumber>;
|
|
864
865
|
name: z.ZodOptional<z.ZodString>;
|
|
866
|
+
published: z.ZodOptional<z.ZodBoolean>;
|
|
865
867
|
}, z.core.$strip>;
|
|
866
868
|
type ReportQueryFilters = z.infer<typeof ReportQueryFiltersSchema>;
|
|
867
869
|
/**
|
|
@@ -1280,6 +1282,7 @@ interface User {
|
|
|
1280
1282
|
email?: string;
|
|
1281
1283
|
fullname?: string;
|
|
1282
1284
|
role?: string;
|
|
1285
|
+
userInfo?: Record<string, unknown>;
|
|
1283
1286
|
wsIds: string[];
|
|
1284
1287
|
}
|
|
1285
1288
|
/**
|
|
@@ -1290,10 +1293,11 @@ interface User {
|
|
|
1290
1293
|
* @param email - Email for the new user (optional)
|
|
1291
1294
|
* @param fullname - Full name for the new user (optional)
|
|
1292
1295
|
* @param role - Role for the new user (optional)
|
|
1296
|
+
* @param userInfo - Additional user info as JSON object (optional)
|
|
1293
1297
|
* @param timeout - Request timeout in milliseconds
|
|
1294
1298
|
* @returns Server response with success status
|
|
1295
1299
|
*/
|
|
1296
|
-
declare function createUser(client: SuperatomClient, username: string, password: string, email?: string, fullname?: string, role?: string, timeout?: number): Promise<{
|
|
1300
|
+
declare function createUser(client: SuperatomClient, username: string, password: string, email?: string, fullname?: string, role?: string, userInfo?: Record<string, unknown>, timeout?: number): Promise<{
|
|
1297
1301
|
success: boolean;
|
|
1298
1302
|
error?: string;
|
|
1299
1303
|
message?: string;
|
|
@@ -1315,6 +1319,7 @@ declare function updateUser(client: SuperatomClient, id: number, updates: {
|
|
|
1315
1319
|
email?: string;
|
|
1316
1320
|
fullname?: string;
|
|
1317
1321
|
role?: string;
|
|
1322
|
+
userInfo?: Record<string, unknown>;
|
|
1318
1323
|
}, timeout?: number): Promise<{
|
|
1319
1324
|
success: boolean;
|
|
1320
1325
|
error?: string;
|
|
@@ -1403,6 +1408,7 @@ interface Dashboard {
|
|
|
1403
1408
|
projectId?: string;
|
|
1404
1409
|
name?: string;
|
|
1405
1410
|
description?: string;
|
|
1411
|
+
published?: boolean;
|
|
1406
1412
|
dashboard?: DSLRendererProps$2;
|
|
1407
1413
|
createdBy?: number;
|
|
1408
1414
|
updatedBy?: number;
|
|
@@ -1417,6 +1423,7 @@ interface CreateDashboardOptions {
|
|
|
1417
1423
|
projectId: string;
|
|
1418
1424
|
name?: string;
|
|
1419
1425
|
description?: string;
|
|
1426
|
+
published?: boolean;
|
|
1420
1427
|
createdBy?: number;
|
|
1421
1428
|
dashboard?: DSLRendererProps$2;
|
|
1422
1429
|
}
|
|
@@ -1427,6 +1434,7 @@ interface UpdateDashboardOptions {
|
|
|
1427
1434
|
id: number;
|
|
1428
1435
|
name?: string;
|
|
1429
1436
|
description?: string;
|
|
1437
|
+
published?: boolean;
|
|
1430
1438
|
createdBy?: number;
|
|
1431
1439
|
updatedBy?: number;
|
|
1432
1440
|
dashboard?: DSLRendererProps$2;
|
|
@@ -1539,6 +1547,7 @@ interface Report {
|
|
|
1539
1547
|
projectId?: string;
|
|
1540
1548
|
name?: string;
|
|
1541
1549
|
description?: string;
|
|
1550
|
+
published?: boolean;
|
|
1542
1551
|
report?: DSLRendererProps$1;
|
|
1543
1552
|
createdBy?: number;
|
|
1544
1553
|
updatedBy?: number;
|
|
@@ -1553,6 +1562,7 @@ interface CreateReportOptions {
|
|
|
1553
1562
|
projectId: string;
|
|
1554
1563
|
name?: string;
|
|
1555
1564
|
description?: string;
|
|
1565
|
+
published?: boolean;
|
|
1556
1566
|
createdBy?: number;
|
|
1557
1567
|
report?: DSLRendererProps$1;
|
|
1558
1568
|
}
|
|
@@ -1563,6 +1573,7 @@ interface UpdateReportOptions {
|
|
|
1563
1573
|
id: number;
|
|
1564
1574
|
name?: string;
|
|
1565
1575
|
description?: string;
|
|
1576
|
+
published?: boolean;
|
|
1566
1577
|
createdBy?: number;
|
|
1567
1578
|
updatedBy?: number;
|
|
1568
1579
|
report?: DSLRendererProps$1;
|
|
@@ -2430,7 +2441,7 @@ declare class SuperatomClient {
|
|
|
2430
2441
|
* Create a new user
|
|
2431
2442
|
* Delegates to users service
|
|
2432
2443
|
*/
|
|
2433
|
-
createUser(username: string, password: string, email?: string, fullname?: string, role?: string, timeout?: number): Promise<{
|
|
2444
|
+
createUser(username: string, password: string, email?: string, fullname?: string, role?: string, userInfo?: Record<string, unknown>, timeout?: number): Promise<{
|
|
2434
2445
|
success: boolean;
|
|
2435
2446
|
error?: string;
|
|
2436
2447
|
message?: string;
|
|
@@ -2448,6 +2459,7 @@ declare class SuperatomClient {
|
|
|
2448
2459
|
email?: string;
|
|
2449
2460
|
fullname?: string;
|
|
2450
2461
|
role?: string;
|
|
2462
|
+
userInfo?: Record<string, unknown>;
|
|
2451
2463
|
}, timeout?: number): Promise<{
|
|
2452
2464
|
success: boolean;
|
|
2453
2465
|
error?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -850,6 +850,7 @@ declare const DashboardQueryFiltersSchema: z.ZodObject<{
|
|
|
850
850
|
createdBy: z.ZodOptional<z.ZodNumber>;
|
|
851
851
|
updatedBy: z.ZodOptional<z.ZodNumber>;
|
|
852
852
|
name: z.ZodOptional<z.ZodString>;
|
|
853
|
+
published: z.ZodOptional<z.ZodBoolean>;
|
|
853
854
|
}, z.core.$strip>;
|
|
854
855
|
type DashboardQueryFilters = z.infer<typeof DashboardQueryFiltersSchema>;
|
|
855
856
|
/**
|
|
@@ -862,6 +863,7 @@ declare const ReportQueryFiltersSchema: z.ZodObject<{
|
|
|
862
863
|
createdBy: z.ZodOptional<z.ZodNumber>;
|
|
863
864
|
updatedBy: z.ZodOptional<z.ZodNumber>;
|
|
864
865
|
name: z.ZodOptional<z.ZodString>;
|
|
866
|
+
published: z.ZodOptional<z.ZodBoolean>;
|
|
865
867
|
}, z.core.$strip>;
|
|
866
868
|
type ReportQueryFilters = z.infer<typeof ReportQueryFiltersSchema>;
|
|
867
869
|
/**
|
|
@@ -1280,6 +1282,7 @@ interface User {
|
|
|
1280
1282
|
email?: string;
|
|
1281
1283
|
fullname?: string;
|
|
1282
1284
|
role?: string;
|
|
1285
|
+
userInfo?: Record<string, unknown>;
|
|
1283
1286
|
wsIds: string[];
|
|
1284
1287
|
}
|
|
1285
1288
|
/**
|
|
@@ -1290,10 +1293,11 @@ interface User {
|
|
|
1290
1293
|
* @param email - Email for the new user (optional)
|
|
1291
1294
|
* @param fullname - Full name for the new user (optional)
|
|
1292
1295
|
* @param role - Role for the new user (optional)
|
|
1296
|
+
* @param userInfo - Additional user info as JSON object (optional)
|
|
1293
1297
|
* @param timeout - Request timeout in milliseconds
|
|
1294
1298
|
* @returns Server response with success status
|
|
1295
1299
|
*/
|
|
1296
|
-
declare function createUser(client: SuperatomClient, username: string, password: string, email?: string, fullname?: string, role?: string, timeout?: number): Promise<{
|
|
1300
|
+
declare function createUser(client: SuperatomClient, username: string, password: string, email?: string, fullname?: string, role?: string, userInfo?: Record<string, unknown>, timeout?: number): Promise<{
|
|
1297
1301
|
success: boolean;
|
|
1298
1302
|
error?: string;
|
|
1299
1303
|
message?: string;
|
|
@@ -1315,6 +1319,7 @@ declare function updateUser(client: SuperatomClient, id: number, updates: {
|
|
|
1315
1319
|
email?: string;
|
|
1316
1320
|
fullname?: string;
|
|
1317
1321
|
role?: string;
|
|
1322
|
+
userInfo?: Record<string, unknown>;
|
|
1318
1323
|
}, timeout?: number): Promise<{
|
|
1319
1324
|
success: boolean;
|
|
1320
1325
|
error?: string;
|
|
@@ -1403,6 +1408,7 @@ interface Dashboard {
|
|
|
1403
1408
|
projectId?: string;
|
|
1404
1409
|
name?: string;
|
|
1405
1410
|
description?: string;
|
|
1411
|
+
published?: boolean;
|
|
1406
1412
|
dashboard?: DSLRendererProps$2;
|
|
1407
1413
|
createdBy?: number;
|
|
1408
1414
|
updatedBy?: number;
|
|
@@ -1417,6 +1423,7 @@ interface CreateDashboardOptions {
|
|
|
1417
1423
|
projectId: string;
|
|
1418
1424
|
name?: string;
|
|
1419
1425
|
description?: string;
|
|
1426
|
+
published?: boolean;
|
|
1420
1427
|
createdBy?: number;
|
|
1421
1428
|
dashboard?: DSLRendererProps$2;
|
|
1422
1429
|
}
|
|
@@ -1427,6 +1434,7 @@ interface UpdateDashboardOptions {
|
|
|
1427
1434
|
id: number;
|
|
1428
1435
|
name?: string;
|
|
1429
1436
|
description?: string;
|
|
1437
|
+
published?: boolean;
|
|
1430
1438
|
createdBy?: number;
|
|
1431
1439
|
updatedBy?: number;
|
|
1432
1440
|
dashboard?: DSLRendererProps$2;
|
|
@@ -1539,6 +1547,7 @@ interface Report {
|
|
|
1539
1547
|
projectId?: string;
|
|
1540
1548
|
name?: string;
|
|
1541
1549
|
description?: string;
|
|
1550
|
+
published?: boolean;
|
|
1542
1551
|
report?: DSLRendererProps$1;
|
|
1543
1552
|
createdBy?: number;
|
|
1544
1553
|
updatedBy?: number;
|
|
@@ -1553,6 +1562,7 @@ interface CreateReportOptions {
|
|
|
1553
1562
|
projectId: string;
|
|
1554
1563
|
name?: string;
|
|
1555
1564
|
description?: string;
|
|
1565
|
+
published?: boolean;
|
|
1556
1566
|
createdBy?: number;
|
|
1557
1567
|
report?: DSLRendererProps$1;
|
|
1558
1568
|
}
|
|
@@ -1563,6 +1573,7 @@ interface UpdateReportOptions {
|
|
|
1563
1573
|
id: number;
|
|
1564
1574
|
name?: string;
|
|
1565
1575
|
description?: string;
|
|
1576
|
+
published?: boolean;
|
|
1566
1577
|
createdBy?: number;
|
|
1567
1578
|
updatedBy?: number;
|
|
1568
1579
|
report?: DSLRendererProps$1;
|
|
@@ -2430,7 +2441,7 @@ declare class SuperatomClient {
|
|
|
2430
2441
|
* Create a new user
|
|
2431
2442
|
* Delegates to users service
|
|
2432
2443
|
*/
|
|
2433
|
-
createUser(username: string, password: string, email?: string, fullname?: string, role?: string, timeout?: number): Promise<{
|
|
2444
|
+
createUser(username: string, password: string, email?: string, fullname?: string, role?: string, userInfo?: Record<string, unknown>, timeout?: number): Promise<{
|
|
2434
2445
|
success: boolean;
|
|
2435
2446
|
error?: string;
|
|
2436
2447
|
message?: string;
|
|
@@ -2448,6 +2459,7 @@ declare class SuperatomClient {
|
|
|
2448
2459
|
email?: string;
|
|
2449
2460
|
fullname?: string;
|
|
2450
2461
|
role?: string;
|
|
2462
|
+
userInfo?: Record<string, unknown>;
|
|
2451
2463
|
}, timeout?: number): Promise<{
|
|
2452
2464
|
success: boolean;
|
|
2453
2465
|
error?: string;
|
package/dist/index.js
CHANGED
|
@@ -446,6 +446,7 @@ var UsersRequestPayloadSchema = z.object({
|
|
|
446
446
|
password: z.string().optional(),
|
|
447
447
|
fullname: z.string().optional(),
|
|
448
448
|
role: z.string().optional(),
|
|
449
|
+
userInfo: z.record(z.string(), z.unknown()).optional(),
|
|
449
450
|
// Query operation fields
|
|
450
451
|
filters: UserQueryFiltersSchema.optional(),
|
|
451
452
|
limit: z.number().optional(),
|
|
@@ -497,7 +498,8 @@ var DashboardQueryFiltersSchema = z.object({
|
|
|
497
498
|
projectId: z.string().optional(),
|
|
498
499
|
createdBy: z.number().optional(),
|
|
499
500
|
updatedBy: z.number().optional(),
|
|
500
|
-
name: z.string().optional()
|
|
501
|
+
name: z.string().optional(),
|
|
502
|
+
published: z.boolean().optional()
|
|
501
503
|
});
|
|
502
504
|
var DashboardsRequestPayloadSchema = z.object({
|
|
503
505
|
operation: z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
@@ -507,6 +509,7 @@ var DashboardsRequestPayloadSchema = z.object({
|
|
|
507
509
|
projectId: z.string().optional(),
|
|
508
510
|
name: z.string().optional(),
|
|
509
511
|
description: z.string().optional(),
|
|
512
|
+
published: z.boolean().optional(),
|
|
510
513
|
createdBy: z.number().optional(),
|
|
511
514
|
updatedBy: z.number().optional(),
|
|
512
515
|
dashboard: DSLRendererPropsSchema.optional(),
|
|
@@ -549,7 +552,8 @@ var ReportQueryFiltersSchema = z.object({
|
|
|
549
552
|
projectId: z.string().optional(),
|
|
550
553
|
createdBy: z.number().optional(),
|
|
551
554
|
updatedBy: z.number().optional(),
|
|
552
|
-
name: z.string().optional()
|
|
555
|
+
name: z.string().optional(),
|
|
556
|
+
published: z.boolean().optional()
|
|
553
557
|
});
|
|
554
558
|
var ReportsRequestPayloadSchema = z.object({
|
|
555
559
|
operation: z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
@@ -559,6 +563,7 @@ var ReportsRequestPayloadSchema = z.object({
|
|
|
559
563
|
projectId: z.string().optional(),
|
|
560
564
|
name: z.string().optional(),
|
|
561
565
|
description: z.string().optional(),
|
|
566
|
+
published: z.boolean().optional(),
|
|
562
567
|
createdBy: z.number().optional(),
|
|
563
568
|
updatedBy: z.number().optional(),
|
|
564
569
|
report: DSLRendererPropsSchema2.optional(),
|
|
@@ -1065,7 +1070,7 @@ async function sendComponents(client, components) {
|
|
|
1065
1070
|
}
|
|
1066
1071
|
|
|
1067
1072
|
// src/services/users.ts
|
|
1068
|
-
async function createUser(client, username, password, email, fullname, role, timeout) {
|
|
1073
|
+
async function createUser(client, username, password, email, fullname, role, userInfo, timeout) {
|
|
1069
1074
|
const messageId = `users_create_${Date.now()}`;
|
|
1070
1075
|
const message = UsersRequestMessageSchema.parse({
|
|
1071
1076
|
id: messageId,
|
|
@@ -1079,7 +1084,8 @@ async function createUser(client, username, password, email, fullname, role, tim
|
|
|
1079
1084
|
password,
|
|
1080
1085
|
email,
|
|
1081
1086
|
fullname,
|
|
1082
|
-
role
|
|
1087
|
+
role,
|
|
1088
|
+
userInfo
|
|
1083
1089
|
}
|
|
1084
1090
|
}
|
|
1085
1091
|
});
|
|
@@ -1222,7 +1228,7 @@ async function queryUsers(client, options = {}, timeout) {
|
|
|
1222
1228
|
|
|
1223
1229
|
// src/services/dashboards/index.ts
|
|
1224
1230
|
async function createDashboard(client, options, timeout) {
|
|
1225
|
-
const { dashboardId, projectId, name, description, createdBy, dashboard } = options;
|
|
1231
|
+
const { dashboardId, projectId, name, description, published, createdBy, dashboard } = options;
|
|
1226
1232
|
const messageId = `dashboards_create_${Date.now()}`;
|
|
1227
1233
|
const message = DashboardsRequestMessageSchema.parse({
|
|
1228
1234
|
id: messageId,
|
|
@@ -1236,6 +1242,7 @@ async function createDashboard(client, options, timeout) {
|
|
|
1236
1242
|
projectId,
|
|
1237
1243
|
name,
|
|
1238
1244
|
description,
|
|
1245
|
+
published,
|
|
1239
1246
|
createdBy,
|
|
1240
1247
|
dashboard
|
|
1241
1248
|
}
|
|
@@ -1253,7 +1260,7 @@ async function createDashboard(client, options, timeout) {
|
|
|
1253
1260
|
};
|
|
1254
1261
|
}
|
|
1255
1262
|
async function updateDashboard(client, options, timeout) {
|
|
1256
|
-
const { id, name, description, createdBy, updatedBy, dashboard } = options;
|
|
1263
|
+
const { id, name, description, published, createdBy, updatedBy, dashboard } = options;
|
|
1257
1264
|
const messageId = `dashboards_update_${Date.now()}`;
|
|
1258
1265
|
const message = DashboardsRequestMessageSchema.parse({
|
|
1259
1266
|
id: messageId,
|
|
@@ -1266,6 +1273,7 @@ async function updateDashboard(client, options, timeout) {
|
|
|
1266
1273
|
id,
|
|
1267
1274
|
name,
|
|
1268
1275
|
description,
|
|
1276
|
+
published,
|
|
1269
1277
|
createdBy,
|
|
1270
1278
|
updatedBy,
|
|
1271
1279
|
dashboard
|
|
@@ -1382,7 +1390,7 @@ async function queryDashboards(client, options = {}, timeout) {
|
|
|
1382
1390
|
|
|
1383
1391
|
// src/services/reports/index.ts
|
|
1384
1392
|
async function createReport(client, options, timeout) {
|
|
1385
|
-
const { reportId, projectId, name, description, createdBy, report } = options;
|
|
1393
|
+
const { reportId, projectId, name, description, published, createdBy, report } = options;
|
|
1386
1394
|
const messageId = `reports_create_${Date.now()}`;
|
|
1387
1395
|
const message = ReportsRequestMessageSchema.parse({
|
|
1388
1396
|
id: messageId,
|
|
@@ -1396,6 +1404,7 @@ async function createReport(client, options, timeout) {
|
|
|
1396
1404
|
projectId,
|
|
1397
1405
|
name,
|
|
1398
1406
|
description,
|
|
1407
|
+
published,
|
|
1399
1408
|
createdBy,
|
|
1400
1409
|
report
|
|
1401
1410
|
}
|
|
@@ -1413,7 +1422,7 @@ async function createReport(client, options, timeout) {
|
|
|
1413
1422
|
};
|
|
1414
1423
|
}
|
|
1415
1424
|
async function updateReport(client, options, timeout) {
|
|
1416
|
-
const { id, name, description, createdBy, updatedBy, report } = options;
|
|
1425
|
+
const { id, name, description, published, createdBy, updatedBy, report } = options;
|
|
1417
1426
|
const messageId = `reports_update_${Date.now()}`;
|
|
1418
1427
|
const message = ReportsRequestMessageSchema.parse({
|
|
1419
1428
|
id: messageId,
|
|
@@ -1426,6 +1435,7 @@ async function updateReport(client, options, timeout) {
|
|
|
1426
1435
|
id,
|
|
1427
1436
|
name,
|
|
1428
1437
|
description,
|
|
1438
|
+
published,
|
|
1429
1439
|
createdBy,
|
|
1430
1440
|
updatedBy,
|
|
1431
1441
|
report
|
|
@@ -2485,9 +2495,9 @@ var SuperatomClient = class {
|
|
|
2485
2495
|
* Create a new user
|
|
2486
2496
|
* Delegates to users service
|
|
2487
2497
|
*/
|
|
2488
|
-
async createUser(username, password, email, fullname, role, timeout) {
|
|
2498
|
+
async createUser(username, password, email, fullname, role, userInfo, timeout) {
|
|
2489
2499
|
this.log("info", "Creating user:", username);
|
|
2490
|
-
return createUser(this, username, password, email, fullname, role, timeout);
|
|
2500
|
+
return createUser(this, username, password, email, fullname, role, userInfo, timeout);
|
|
2491
2501
|
}
|
|
2492
2502
|
/**
|
|
2493
2503
|
* Update an existing user
|
|
@@ -2536,7 +2546,7 @@ var SuperatomClient = class {
|
|
|
2536
2546
|
* Delegates to dashboards service
|
|
2537
2547
|
*/
|
|
2538
2548
|
async createDashboard(options, timeout) {
|
|
2539
|
-
this.log("info", "Creating dashboard:", options.dashboardId);
|
|
2549
|
+
this.log("info", "Creating dashboard:", options.dashboardId, options.projectId);
|
|
2540
2550
|
return createDashboard(this, options, timeout);
|
|
2541
2551
|
}
|
|
2542
2552
|
/**
|