@superatomai/sdk-node 0.0.21 → 0.0.22
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 +1 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -682,7 +682,7 @@ var BookmarkQueryFiltersSchema = import_zod3.z.object({
|
|
|
682
682
|
name: import_zod3.z.string().optional()
|
|
683
683
|
});
|
|
684
684
|
var BookmarksRequestPayloadSchema = import_zod3.z.object({
|
|
685
|
-
operation: import_zod3.z.enum(["create", "update", "delete", "getAll", "getOne", "
|
|
685
|
+
operation: import_zod3.z.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
686
686
|
data: import_zod3.z.object({
|
|
687
687
|
id: import_zod3.z.number().optional(),
|
|
688
688
|
userId: import_zod3.z.number().optional(),
|
|
@@ -7737,12 +7737,6 @@ async function handleBookmarksRequest(data, collections, sendMessage) {
|
|
|
7737
7737
|
case "getOne":
|
|
7738
7738
|
await handleGetOne5(id, bookmarkId, executeCollection, sendMessage, from.id);
|
|
7739
7739
|
break;
|
|
7740
|
-
case "getByUser":
|
|
7741
|
-
await handleGetByUser(id, userId, threadId, executeCollection, sendMessage, from.id);
|
|
7742
|
-
break;
|
|
7743
|
-
case "getByThread":
|
|
7744
|
-
await handleGetByThread(id, threadId, executeCollection, sendMessage, from.id);
|
|
7745
|
-
break;
|
|
7746
7740
|
case "query":
|
|
7747
7741
|
await handleQuery5(id, filters, limit, sort, executeCollection, sendMessage, from.id);
|
|
7748
7742
|
break;
|
|
@@ -7876,54 +7870,6 @@ async function handleGetOne5(id, bookmarkId, executeCollection, sendMessage, cli
|
|
|
7876
7870
|
}, sendMessage, clientId);
|
|
7877
7871
|
}
|
|
7878
7872
|
}
|
|
7879
|
-
async function handleGetByUser(id, userId, threadId, executeCollection, sendMessage, clientId) {
|
|
7880
|
-
if (!userId) {
|
|
7881
|
-
sendResponse7(id, {
|
|
7882
|
-
success: false,
|
|
7883
|
-
error: "userId is required"
|
|
7884
|
-
}, sendMessage, clientId);
|
|
7885
|
-
return;
|
|
7886
|
-
}
|
|
7887
|
-
try {
|
|
7888
|
-
const result = await executeCollection("bookmarks", "getByUser", { userId, threadId });
|
|
7889
|
-
sendResponse7(id, {
|
|
7890
|
-
success: true,
|
|
7891
|
-
data: result.data,
|
|
7892
|
-
count: result.count,
|
|
7893
|
-
message: `Retrieved ${result.count} bookmarks for user ${userId}`
|
|
7894
|
-
}, sendMessage, clientId);
|
|
7895
|
-
logger.info(`Retrieved bookmarks for user ${userId} (count: ${result.count})`);
|
|
7896
|
-
} catch (error) {
|
|
7897
|
-
sendResponse7(id, {
|
|
7898
|
-
success: false,
|
|
7899
|
-
error: error instanceof Error ? error.message : "Failed to get bookmarks by user"
|
|
7900
|
-
}, sendMessage, clientId);
|
|
7901
|
-
}
|
|
7902
|
-
}
|
|
7903
|
-
async function handleGetByThread(id, threadId, executeCollection, sendMessage, clientId) {
|
|
7904
|
-
if (!threadId) {
|
|
7905
|
-
sendResponse7(id, {
|
|
7906
|
-
success: false,
|
|
7907
|
-
error: "threadId is required"
|
|
7908
|
-
}, sendMessage, clientId);
|
|
7909
|
-
return;
|
|
7910
|
-
}
|
|
7911
|
-
try {
|
|
7912
|
-
const result = await executeCollection("bookmarks", "getByThread", { threadId });
|
|
7913
|
-
sendResponse7(id, {
|
|
7914
|
-
success: true,
|
|
7915
|
-
data: result.data,
|
|
7916
|
-
count: result.count,
|
|
7917
|
-
message: `Retrieved ${result.count} bookmarks for thread ${threadId}`
|
|
7918
|
-
}, sendMessage, clientId);
|
|
7919
|
-
logger.info(`Retrieved bookmarks for thread ${threadId} (count: ${result.count})`);
|
|
7920
|
-
} catch (error) {
|
|
7921
|
-
sendResponse7(id, {
|
|
7922
|
-
success: false,
|
|
7923
|
-
error: error instanceof Error ? error.message : "Failed to get bookmarks by thread"
|
|
7924
|
-
}, sendMessage, clientId);
|
|
7925
|
-
}
|
|
7926
|
-
}
|
|
7927
7873
|
async function handleQuery5(id, filters, limit, sort, executeCollection, sendMessage, clientId) {
|
|
7928
7874
|
try {
|
|
7929
7875
|
const result = await executeCollection("bookmarks", "query", {
|