@superatomai/sdk-web 0.0.10 → 0.0.11
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 +76 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -3
- package/dist/index.d.ts +60 -3
- package/dist/index.js +76 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1248,6 +1248,8 @@ declare function getReport(client: SuperatomClient, reportId: string, timeout?:
|
|
|
1248
1248
|
*/
|
|
1249
1249
|
interface Bookmark {
|
|
1250
1250
|
id?: number;
|
|
1251
|
+
userId?: number;
|
|
1252
|
+
threadId?: string;
|
|
1251
1253
|
uiblock: any;
|
|
1252
1254
|
created_at?: string;
|
|
1253
1255
|
updated_at?: string;
|
|
@@ -1255,11 +1257,13 @@ interface Bookmark {
|
|
|
1255
1257
|
/**
|
|
1256
1258
|
* Create a new bookmark
|
|
1257
1259
|
* @param client - SuperatomClient instance
|
|
1260
|
+
* @param userId - User ID (required)
|
|
1258
1261
|
* @param uiblock - UIBlock JSON data
|
|
1262
|
+
* @param threadId - Thread ID (optional)
|
|
1259
1263
|
* @param timeout - Request timeout in milliseconds
|
|
1260
1264
|
* @returns Server response with success status
|
|
1261
1265
|
*/
|
|
1262
|
-
declare function createBookmark(client: SuperatomClient, uiblock: any, timeout?: number): Promise<{
|
|
1266
|
+
declare function createBookmark(client: SuperatomClient, userId: number, uiblock: any, threadId?: string, timeout?: number): Promise<{
|
|
1263
1267
|
success: boolean;
|
|
1264
1268
|
error?: string;
|
|
1265
1269
|
message?: string;
|
|
@@ -1318,6 +1322,35 @@ declare function getBookmark(client: SuperatomClient, id: number, timeout?: numb
|
|
|
1318
1322
|
data?: BookmarkData;
|
|
1319
1323
|
message?: string;
|
|
1320
1324
|
}>;
|
|
1325
|
+
/**
|
|
1326
|
+
* Get bookmarks by user ID (and optionally by thread ID)
|
|
1327
|
+
* @param client - SuperatomClient instance
|
|
1328
|
+
* @param userId - User ID to filter by
|
|
1329
|
+
* @param threadId - Optional thread ID to filter by
|
|
1330
|
+
* @param timeout - Request timeout in milliseconds
|
|
1331
|
+
* @returns Server response with list of bookmarks
|
|
1332
|
+
*/
|
|
1333
|
+
declare function getBookmarksByUser(client: SuperatomClient, userId: number, threadId?: string, timeout?: number): Promise<{
|
|
1334
|
+
success: boolean;
|
|
1335
|
+
error?: string;
|
|
1336
|
+
data?: BookmarkData[];
|
|
1337
|
+
count?: number;
|
|
1338
|
+
message?: string;
|
|
1339
|
+
}>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Get bookmarks by thread ID
|
|
1342
|
+
* @param client - SuperatomClient instance
|
|
1343
|
+
* @param threadId - Thread ID to filter by
|
|
1344
|
+
* @param timeout - Request timeout in milliseconds
|
|
1345
|
+
* @returns Server response with list of bookmarks
|
|
1346
|
+
*/
|
|
1347
|
+
declare function getBookmarksByThread(client: SuperatomClient, threadId: string, timeout?: number): Promise<{
|
|
1348
|
+
success: boolean;
|
|
1349
|
+
error?: string;
|
|
1350
|
+
data?: BookmarkData[];
|
|
1351
|
+
count?: number;
|
|
1352
|
+
message?: string;
|
|
1353
|
+
}>;
|
|
1321
1354
|
|
|
1322
1355
|
declare function getActions(client: SuperatomClient, options: {
|
|
1323
1356
|
SA_RUNTIME?: Record<string, unknown>;
|
|
@@ -1363,6 +1396,8 @@ declare const index_getAllDashboards: typeof getAllDashboards;
|
|
|
1363
1396
|
declare const index_getAllReports: typeof getAllReports;
|
|
1364
1397
|
declare const index_getAllUsers: typeof getAllUsers;
|
|
1365
1398
|
declare const index_getBookmark: typeof getBookmark;
|
|
1399
|
+
declare const index_getBookmarksByThread: typeof getBookmarksByThread;
|
|
1400
|
+
declare const index_getBookmarksByUser: typeof getBookmarksByUser;
|
|
1366
1401
|
declare const index_getComponentSuggestions: typeof getComponentSuggestions;
|
|
1367
1402
|
declare const index_getDashboard: typeof getDashboard;
|
|
1368
1403
|
declare const index_getReport: typeof getReport;
|
|
@@ -1379,7 +1414,7 @@ declare const index_updateDashboard: typeof updateDashboard;
|
|
|
1379
1414
|
declare const index_updateReport: typeof updateReport;
|
|
1380
1415
|
declare const index_updateUser: typeof updateUser;
|
|
1381
1416
|
declare namespace index {
|
|
1382
|
-
export { type index_Binding as Binding, index_BindingSchema as BindingSchema, type index_Bookmark as Bookmark, type DSLRendererProps$1 as DSLRendererProps, DSLRendererPropsSchema$1 as DSLRendererPropsSchema, type index_Dashboard as Dashboard, type index_Expression as Expression, index_ExpressionSchema as ExpressionSchema, type index_ForDirective as ForDirective, index_ForDirectiveSchema as ForDirectiveSchema, type index_QuerySpec as QuerySpec, index_QuerySpecSchema as QuerySpecSchema, type index_Report as Report, type DSLRendererProps as ReportDSLRendererProps, type index_UIComponent as UIComponent, index_UIComponentSchema as UIComponentSchema, type index_UIElement as UIElement, index_UIElementSchema as UIElementSchema, type index_User as User, index_createBookmark as createBookmark, index_createDashboard as createDashboard, index_createReport as createReport, index_createUser as createUser, index_deleteBookmark as deleteBookmark, index_deleteDashboard as deleteDashboard, index_deleteReport as deleteReport, index_deleteUser as deleteUser, index_getActions as getActions, index_getAllBookmarks as getAllBookmarks, index_getAllDashboards as getAllDashboards, index_getAllReports as getAllReports, index_getAllUsers as getAllUsers, index_getBookmark as getBookmark, index_getComponentSuggestions as getComponentSuggestions, index_getDashboard as getDashboard, index_getReport as getReport, index_getUser as getUser, index_requestBundle as requestBundle, index_requestData as requestData, index_sendAuthLoginRequest as sendAuthLoginRequest, index_sendAuthVerifyRequest as sendAuthVerifyRequest, index_sendComponents as sendComponents, index_sendUserPromptRequest as sendUserPromptRequest, index_sendUserPromptSuggestionsRequest as sendUserPromptSuggestionsRequest, index_updateBookmark as updateBookmark, index_updateDashboard as updateDashboard, index_updateReport as updateReport, index_updateUser as updateUser };
|
|
1417
|
+
export { type index_Binding as Binding, index_BindingSchema as BindingSchema, type index_Bookmark as Bookmark, type DSLRendererProps$1 as DSLRendererProps, DSLRendererPropsSchema$1 as DSLRendererPropsSchema, type index_Dashboard as Dashboard, type index_Expression as Expression, index_ExpressionSchema as ExpressionSchema, type index_ForDirective as ForDirective, index_ForDirectiveSchema as ForDirectiveSchema, type index_QuerySpec as QuerySpec, index_QuerySpecSchema as QuerySpecSchema, type index_Report as Report, type DSLRendererProps as ReportDSLRendererProps, type index_UIComponent as UIComponent, index_UIComponentSchema as UIComponentSchema, type index_UIElement as UIElement, index_UIElementSchema as UIElementSchema, type index_User as User, index_createBookmark as createBookmark, index_createDashboard as createDashboard, index_createReport as createReport, index_createUser as createUser, index_deleteBookmark as deleteBookmark, index_deleteDashboard as deleteDashboard, index_deleteReport as deleteReport, index_deleteUser as deleteUser, index_getActions as getActions, index_getAllBookmarks as getAllBookmarks, index_getAllDashboards as getAllDashboards, index_getAllReports as getAllReports, index_getAllUsers as getAllUsers, index_getBookmark as getBookmark, index_getBookmarksByThread as getBookmarksByThread, index_getBookmarksByUser as getBookmarksByUser, index_getComponentSuggestions as getComponentSuggestions, index_getDashboard as getDashboard, index_getReport as getReport, index_getUser as getUser, index_requestBundle as requestBundle, index_requestData as requestData, index_sendAuthLoginRequest as sendAuthLoginRequest, index_sendAuthVerifyRequest as sendAuthVerifyRequest, index_sendComponents as sendComponents, index_sendUserPromptRequest as sendUserPromptRequest, index_sendUserPromptSuggestionsRequest as sendUserPromptSuggestionsRequest, index_updateBookmark as updateBookmark, index_updateDashboard as updateDashboard, index_updateReport as updateReport, index_updateUser as updateUser };
|
|
1383
1418
|
}
|
|
1384
1419
|
|
|
1385
1420
|
type MessageHandler = (message: Message) => void;
|
|
@@ -1691,7 +1726,7 @@ declare class SuperatomClient {
|
|
|
1691
1726
|
* Create a new bookmark
|
|
1692
1727
|
* Delegates to bookmarks service
|
|
1693
1728
|
*/
|
|
1694
|
-
createBookmark(uiblock: any, timeout?: number): Promise<{
|
|
1729
|
+
createBookmark(userId: number, uiblock: any, threadId?: string, timeout?: number): Promise<{
|
|
1695
1730
|
success: boolean;
|
|
1696
1731
|
error?: string;
|
|
1697
1732
|
message?: string;
|
|
@@ -1738,6 +1773,28 @@ declare class SuperatomClient {
|
|
|
1738
1773
|
data?: Bookmark;
|
|
1739
1774
|
message?: string;
|
|
1740
1775
|
}>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Get bookmarks by user ID (and optionally by thread ID)
|
|
1778
|
+
* Delegates to bookmarks service
|
|
1779
|
+
*/
|
|
1780
|
+
getBookmarksByUser(userId: number, threadId?: string, timeout?: number): Promise<{
|
|
1781
|
+
success: boolean;
|
|
1782
|
+
error?: string;
|
|
1783
|
+
data?: Bookmark[];
|
|
1784
|
+
count?: number;
|
|
1785
|
+
message?: string;
|
|
1786
|
+
}>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Get bookmarks by thread ID
|
|
1789
|
+
* Delegates to bookmarks service
|
|
1790
|
+
*/
|
|
1791
|
+
getBookmarksByThread(threadId: string, timeout?: number): Promise<{
|
|
1792
|
+
success: boolean;
|
|
1793
|
+
error?: string;
|
|
1794
|
+
data?: Bookmark[];
|
|
1795
|
+
count?: number;
|
|
1796
|
+
message?: string;
|
|
1797
|
+
}>;
|
|
1741
1798
|
/**
|
|
1742
1799
|
* Create a new report
|
|
1743
1800
|
* Delegates to reports service
|
package/dist/index.d.ts
CHANGED
|
@@ -1248,6 +1248,8 @@ declare function getReport(client: SuperatomClient, reportId: string, timeout?:
|
|
|
1248
1248
|
*/
|
|
1249
1249
|
interface Bookmark {
|
|
1250
1250
|
id?: number;
|
|
1251
|
+
userId?: number;
|
|
1252
|
+
threadId?: string;
|
|
1251
1253
|
uiblock: any;
|
|
1252
1254
|
created_at?: string;
|
|
1253
1255
|
updated_at?: string;
|
|
@@ -1255,11 +1257,13 @@ interface Bookmark {
|
|
|
1255
1257
|
/**
|
|
1256
1258
|
* Create a new bookmark
|
|
1257
1259
|
* @param client - SuperatomClient instance
|
|
1260
|
+
* @param userId - User ID (required)
|
|
1258
1261
|
* @param uiblock - UIBlock JSON data
|
|
1262
|
+
* @param threadId - Thread ID (optional)
|
|
1259
1263
|
* @param timeout - Request timeout in milliseconds
|
|
1260
1264
|
* @returns Server response with success status
|
|
1261
1265
|
*/
|
|
1262
|
-
declare function createBookmark(client: SuperatomClient, uiblock: any, timeout?: number): Promise<{
|
|
1266
|
+
declare function createBookmark(client: SuperatomClient, userId: number, uiblock: any, threadId?: string, timeout?: number): Promise<{
|
|
1263
1267
|
success: boolean;
|
|
1264
1268
|
error?: string;
|
|
1265
1269
|
message?: string;
|
|
@@ -1318,6 +1322,35 @@ declare function getBookmark(client: SuperatomClient, id: number, timeout?: numb
|
|
|
1318
1322
|
data?: BookmarkData;
|
|
1319
1323
|
message?: string;
|
|
1320
1324
|
}>;
|
|
1325
|
+
/**
|
|
1326
|
+
* Get bookmarks by user ID (and optionally by thread ID)
|
|
1327
|
+
* @param client - SuperatomClient instance
|
|
1328
|
+
* @param userId - User ID to filter by
|
|
1329
|
+
* @param threadId - Optional thread ID to filter by
|
|
1330
|
+
* @param timeout - Request timeout in milliseconds
|
|
1331
|
+
* @returns Server response with list of bookmarks
|
|
1332
|
+
*/
|
|
1333
|
+
declare function getBookmarksByUser(client: SuperatomClient, userId: number, threadId?: string, timeout?: number): Promise<{
|
|
1334
|
+
success: boolean;
|
|
1335
|
+
error?: string;
|
|
1336
|
+
data?: BookmarkData[];
|
|
1337
|
+
count?: number;
|
|
1338
|
+
message?: string;
|
|
1339
|
+
}>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Get bookmarks by thread ID
|
|
1342
|
+
* @param client - SuperatomClient instance
|
|
1343
|
+
* @param threadId - Thread ID to filter by
|
|
1344
|
+
* @param timeout - Request timeout in milliseconds
|
|
1345
|
+
* @returns Server response with list of bookmarks
|
|
1346
|
+
*/
|
|
1347
|
+
declare function getBookmarksByThread(client: SuperatomClient, threadId: string, timeout?: number): Promise<{
|
|
1348
|
+
success: boolean;
|
|
1349
|
+
error?: string;
|
|
1350
|
+
data?: BookmarkData[];
|
|
1351
|
+
count?: number;
|
|
1352
|
+
message?: string;
|
|
1353
|
+
}>;
|
|
1321
1354
|
|
|
1322
1355
|
declare function getActions(client: SuperatomClient, options: {
|
|
1323
1356
|
SA_RUNTIME?: Record<string, unknown>;
|
|
@@ -1363,6 +1396,8 @@ declare const index_getAllDashboards: typeof getAllDashboards;
|
|
|
1363
1396
|
declare const index_getAllReports: typeof getAllReports;
|
|
1364
1397
|
declare const index_getAllUsers: typeof getAllUsers;
|
|
1365
1398
|
declare const index_getBookmark: typeof getBookmark;
|
|
1399
|
+
declare const index_getBookmarksByThread: typeof getBookmarksByThread;
|
|
1400
|
+
declare const index_getBookmarksByUser: typeof getBookmarksByUser;
|
|
1366
1401
|
declare const index_getComponentSuggestions: typeof getComponentSuggestions;
|
|
1367
1402
|
declare const index_getDashboard: typeof getDashboard;
|
|
1368
1403
|
declare const index_getReport: typeof getReport;
|
|
@@ -1379,7 +1414,7 @@ declare const index_updateDashboard: typeof updateDashboard;
|
|
|
1379
1414
|
declare const index_updateReport: typeof updateReport;
|
|
1380
1415
|
declare const index_updateUser: typeof updateUser;
|
|
1381
1416
|
declare namespace index {
|
|
1382
|
-
export { type index_Binding as Binding, index_BindingSchema as BindingSchema, type index_Bookmark as Bookmark, type DSLRendererProps$1 as DSLRendererProps, DSLRendererPropsSchema$1 as DSLRendererPropsSchema, type index_Dashboard as Dashboard, type index_Expression as Expression, index_ExpressionSchema as ExpressionSchema, type index_ForDirective as ForDirective, index_ForDirectiveSchema as ForDirectiveSchema, type index_QuerySpec as QuerySpec, index_QuerySpecSchema as QuerySpecSchema, type index_Report as Report, type DSLRendererProps as ReportDSLRendererProps, type index_UIComponent as UIComponent, index_UIComponentSchema as UIComponentSchema, type index_UIElement as UIElement, index_UIElementSchema as UIElementSchema, type index_User as User, index_createBookmark as createBookmark, index_createDashboard as createDashboard, index_createReport as createReport, index_createUser as createUser, index_deleteBookmark as deleteBookmark, index_deleteDashboard as deleteDashboard, index_deleteReport as deleteReport, index_deleteUser as deleteUser, index_getActions as getActions, index_getAllBookmarks as getAllBookmarks, index_getAllDashboards as getAllDashboards, index_getAllReports as getAllReports, index_getAllUsers as getAllUsers, index_getBookmark as getBookmark, index_getComponentSuggestions as getComponentSuggestions, index_getDashboard as getDashboard, index_getReport as getReport, index_getUser as getUser, index_requestBundle as requestBundle, index_requestData as requestData, index_sendAuthLoginRequest as sendAuthLoginRequest, index_sendAuthVerifyRequest as sendAuthVerifyRequest, index_sendComponents as sendComponents, index_sendUserPromptRequest as sendUserPromptRequest, index_sendUserPromptSuggestionsRequest as sendUserPromptSuggestionsRequest, index_updateBookmark as updateBookmark, index_updateDashboard as updateDashboard, index_updateReport as updateReport, index_updateUser as updateUser };
|
|
1417
|
+
export { type index_Binding as Binding, index_BindingSchema as BindingSchema, type index_Bookmark as Bookmark, type DSLRendererProps$1 as DSLRendererProps, DSLRendererPropsSchema$1 as DSLRendererPropsSchema, type index_Dashboard as Dashboard, type index_Expression as Expression, index_ExpressionSchema as ExpressionSchema, type index_ForDirective as ForDirective, index_ForDirectiveSchema as ForDirectiveSchema, type index_QuerySpec as QuerySpec, index_QuerySpecSchema as QuerySpecSchema, type index_Report as Report, type DSLRendererProps as ReportDSLRendererProps, type index_UIComponent as UIComponent, index_UIComponentSchema as UIComponentSchema, type index_UIElement as UIElement, index_UIElementSchema as UIElementSchema, type index_User as User, index_createBookmark as createBookmark, index_createDashboard as createDashboard, index_createReport as createReport, index_createUser as createUser, index_deleteBookmark as deleteBookmark, index_deleteDashboard as deleteDashboard, index_deleteReport as deleteReport, index_deleteUser as deleteUser, index_getActions as getActions, index_getAllBookmarks as getAllBookmarks, index_getAllDashboards as getAllDashboards, index_getAllReports as getAllReports, index_getAllUsers as getAllUsers, index_getBookmark as getBookmark, index_getBookmarksByThread as getBookmarksByThread, index_getBookmarksByUser as getBookmarksByUser, index_getComponentSuggestions as getComponentSuggestions, index_getDashboard as getDashboard, index_getReport as getReport, index_getUser as getUser, index_requestBundle as requestBundle, index_requestData as requestData, index_sendAuthLoginRequest as sendAuthLoginRequest, index_sendAuthVerifyRequest as sendAuthVerifyRequest, index_sendComponents as sendComponents, index_sendUserPromptRequest as sendUserPromptRequest, index_sendUserPromptSuggestionsRequest as sendUserPromptSuggestionsRequest, index_updateBookmark as updateBookmark, index_updateDashboard as updateDashboard, index_updateReport as updateReport, index_updateUser as updateUser };
|
|
1383
1418
|
}
|
|
1384
1419
|
|
|
1385
1420
|
type MessageHandler = (message: Message) => void;
|
|
@@ -1691,7 +1726,7 @@ declare class SuperatomClient {
|
|
|
1691
1726
|
* Create a new bookmark
|
|
1692
1727
|
* Delegates to bookmarks service
|
|
1693
1728
|
*/
|
|
1694
|
-
createBookmark(uiblock: any, timeout?: number): Promise<{
|
|
1729
|
+
createBookmark(userId: number, uiblock: any, threadId?: string, timeout?: number): Promise<{
|
|
1695
1730
|
success: boolean;
|
|
1696
1731
|
error?: string;
|
|
1697
1732
|
message?: string;
|
|
@@ -1738,6 +1773,28 @@ declare class SuperatomClient {
|
|
|
1738
1773
|
data?: Bookmark;
|
|
1739
1774
|
message?: string;
|
|
1740
1775
|
}>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Get bookmarks by user ID (and optionally by thread ID)
|
|
1778
|
+
* Delegates to bookmarks service
|
|
1779
|
+
*/
|
|
1780
|
+
getBookmarksByUser(userId: number, threadId?: string, timeout?: number): Promise<{
|
|
1781
|
+
success: boolean;
|
|
1782
|
+
error?: string;
|
|
1783
|
+
data?: Bookmark[];
|
|
1784
|
+
count?: number;
|
|
1785
|
+
message?: string;
|
|
1786
|
+
}>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Get bookmarks by thread ID
|
|
1789
|
+
* Delegates to bookmarks service
|
|
1790
|
+
*/
|
|
1791
|
+
getBookmarksByThread(threadId: string, timeout?: number): Promise<{
|
|
1792
|
+
success: boolean;
|
|
1793
|
+
error?: string;
|
|
1794
|
+
data?: Bookmark[];
|
|
1795
|
+
count?: number;
|
|
1796
|
+
message?: string;
|
|
1797
|
+
}>;
|
|
1741
1798
|
/**
|
|
1742
1799
|
* Create a new report
|
|
1743
1800
|
* Delegates to reports service
|
package/dist/index.js
CHANGED
|
@@ -557,9 +557,11 @@ var BookmarkDataSchema = z.object({
|
|
|
557
557
|
updated_at: z.string().optional()
|
|
558
558
|
});
|
|
559
559
|
var BookmarksRequestPayloadSchema = z.object({
|
|
560
|
-
operation: z.enum(["create", "update", "delete", "getAll", "getOne"]),
|
|
560
|
+
operation: z.enum(["create", "update", "delete", "getAll", "getOne", "getByUser", "getByThread"]),
|
|
561
561
|
data: z.object({
|
|
562
562
|
id: z.number().optional(),
|
|
563
|
+
userId: z.number().optional(),
|
|
564
|
+
threadId: z.string().optional(),
|
|
563
565
|
uiblock: z.any().optional()
|
|
564
566
|
}).optional()
|
|
565
567
|
});
|
|
@@ -623,6 +625,8 @@ __export(services_exports, {
|
|
|
623
625
|
getAllReports: () => getAllReports,
|
|
624
626
|
getAllUsers: () => getAllUsers,
|
|
625
627
|
getBookmark: () => getBookmark,
|
|
628
|
+
getBookmarksByThread: () => getBookmarksByThread,
|
|
629
|
+
getBookmarksByUser: () => getBookmarksByUser,
|
|
626
630
|
getComponentSuggestions: () => getComponentSuggestions,
|
|
627
631
|
getDashboard: () => getDashboard,
|
|
628
632
|
getReport: () => getReport,
|
|
@@ -1221,7 +1225,7 @@ async function getReport(client, reportId, timeout) {
|
|
|
1221
1225
|
}
|
|
1222
1226
|
|
|
1223
1227
|
// src/services/bookmarks/index.ts
|
|
1224
|
-
async function createBookmark(client, uiblock, timeout) {
|
|
1228
|
+
async function createBookmark(client, userId, uiblock, threadId, timeout) {
|
|
1225
1229
|
const messageId = `bookmarks_create_${Date.now()}`;
|
|
1226
1230
|
const message = BookmarksRequestMessageSchema.parse({
|
|
1227
1231
|
id: messageId,
|
|
@@ -1231,6 +1235,8 @@ async function createBookmark(client, uiblock, timeout) {
|
|
|
1231
1235
|
payload: {
|
|
1232
1236
|
operation: "create",
|
|
1233
1237
|
data: {
|
|
1238
|
+
userId,
|
|
1239
|
+
threadId,
|
|
1234
1240
|
uiblock
|
|
1235
1241
|
}
|
|
1236
1242
|
}
|
|
@@ -1335,6 +1341,55 @@ async function getBookmark(client, id, timeout) {
|
|
|
1335
1341
|
message: payload.message
|
|
1336
1342
|
};
|
|
1337
1343
|
}
|
|
1344
|
+
async function getBookmarksByUser(client, userId, threadId, timeout) {
|
|
1345
|
+
const messageId = `bookmarks_getbyuser_${Date.now()}`;
|
|
1346
|
+
const message = BookmarksRequestMessageSchema.parse({
|
|
1347
|
+
id: messageId,
|
|
1348
|
+
type: "BOOKMARKS",
|
|
1349
|
+
from: { type: client.type },
|
|
1350
|
+
to: { type: "data-agent" },
|
|
1351
|
+
payload: {
|
|
1352
|
+
operation: "getByUser",
|
|
1353
|
+
data: {
|
|
1354
|
+
userId,
|
|
1355
|
+
threadId
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
1360
|
+
const payload = response.payload;
|
|
1361
|
+
return {
|
|
1362
|
+
success: payload.success,
|
|
1363
|
+
error: payload.error,
|
|
1364
|
+
data: Array.isArray(payload.data) ? payload.data : payload.data ? [payload.data] : [],
|
|
1365
|
+
count: payload.count,
|
|
1366
|
+
message: payload.message
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
async function getBookmarksByThread(client, threadId, timeout) {
|
|
1370
|
+
const messageId = `bookmarks_getbythread_${Date.now()}`;
|
|
1371
|
+
const message = BookmarksRequestMessageSchema.parse({
|
|
1372
|
+
id: messageId,
|
|
1373
|
+
type: "BOOKMARKS",
|
|
1374
|
+
from: { type: client.type },
|
|
1375
|
+
to: { type: "data-agent" },
|
|
1376
|
+
payload: {
|
|
1377
|
+
operation: "getByThread",
|
|
1378
|
+
data: {
|
|
1379
|
+
threadId
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
const response = await client.sendWithResponse(message, timeout);
|
|
1384
|
+
const payload = response.payload;
|
|
1385
|
+
return {
|
|
1386
|
+
success: payload.success,
|
|
1387
|
+
error: payload.error,
|
|
1388
|
+
data: Array.isArray(payload.data) ? payload.data : payload.data ? [payload.data] : [],
|
|
1389
|
+
count: payload.count,
|
|
1390
|
+
message: payload.message
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1338
1393
|
|
|
1339
1394
|
// src/services/actions.ts
|
|
1340
1395
|
async function getActions(client, options) {
|
|
@@ -1782,9 +1837,9 @@ var SuperatomClient = class {
|
|
|
1782
1837
|
* Create a new bookmark
|
|
1783
1838
|
* Delegates to bookmarks service
|
|
1784
1839
|
*/
|
|
1785
|
-
async createBookmark(uiblock, timeout) {
|
|
1786
|
-
this.log("info", "Creating bookmark");
|
|
1787
|
-
return createBookmark(this, uiblock, timeout);
|
|
1840
|
+
async createBookmark(userId, uiblock, threadId, timeout) {
|
|
1841
|
+
this.log("info", "Creating bookmark for user:", userId);
|
|
1842
|
+
return createBookmark(this, userId, uiblock, threadId, timeout);
|
|
1788
1843
|
}
|
|
1789
1844
|
/**
|
|
1790
1845
|
* Update an existing bookmark
|
|
@@ -1818,6 +1873,22 @@ var SuperatomClient = class {
|
|
|
1818
1873
|
this.log("info", "Fetching bookmark:", id);
|
|
1819
1874
|
return getBookmark(this, id, timeout);
|
|
1820
1875
|
}
|
|
1876
|
+
/**
|
|
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
|
|
1886
|
+
* Delegates to bookmarks service
|
|
1887
|
+
*/
|
|
1888
|
+
async getBookmarksByThread(threadId, timeout) {
|
|
1889
|
+
this.log("info", "Fetching bookmarks for thread:", threadId);
|
|
1890
|
+
return getBookmarksByThread(this, threadId, timeout);
|
|
1891
|
+
}
|
|
1821
1892
|
// ==================== Report Management Methods ====================
|
|
1822
1893
|
// These methods delegate to report service for admin report CRUD operations
|
|
1823
1894
|
/**
|