@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.mjs
CHANGED
|
@@ -642,7 +642,7 @@ var BookmarkQueryFiltersSchema = z3.object({
|
|
|
642
642
|
name: z3.string().optional()
|
|
643
643
|
});
|
|
644
644
|
var BookmarksRequestPayloadSchema = z3.object({
|
|
645
|
-
operation: z3.enum(["create", "update", "delete", "getAll", "getOne", "
|
|
645
|
+
operation: z3.enum(["create", "update", "delete", "getAll", "getOne", "query"]),
|
|
646
646
|
data: z3.object({
|
|
647
647
|
id: z3.number().optional(),
|
|
648
648
|
userId: z3.number().optional(),
|
|
@@ -7697,12 +7697,6 @@ async function handleBookmarksRequest(data, collections, sendMessage) {
|
|
|
7697
7697
|
case "getOne":
|
|
7698
7698
|
await handleGetOne5(id, bookmarkId, executeCollection, sendMessage, from.id);
|
|
7699
7699
|
break;
|
|
7700
|
-
case "getByUser":
|
|
7701
|
-
await handleGetByUser(id, userId, threadId, executeCollection, sendMessage, from.id);
|
|
7702
|
-
break;
|
|
7703
|
-
case "getByThread":
|
|
7704
|
-
await handleGetByThread(id, threadId, executeCollection, sendMessage, from.id);
|
|
7705
|
-
break;
|
|
7706
7700
|
case "query":
|
|
7707
7701
|
await handleQuery5(id, filters, limit, sort, executeCollection, sendMessage, from.id);
|
|
7708
7702
|
break;
|
|
@@ -7836,54 +7830,6 @@ async function handleGetOne5(id, bookmarkId, executeCollection, sendMessage, cli
|
|
|
7836
7830
|
}, sendMessage, clientId);
|
|
7837
7831
|
}
|
|
7838
7832
|
}
|
|
7839
|
-
async function handleGetByUser(id, userId, threadId, executeCollection, sendMessage, clientId) {
|
|
7840
|
-
if (!userId) {
|
|
7841
|
-
sendResponse7(id, {
|
|
7842
|
-
success: false,
|
|
7843
|
-
error: "userId is required"
|
|
7844
|
-
}, sendMessage, clientId);
|
|
7845
|
-
return;
|
|
7846
|
-
}
|
|
7847
|
-
try {
|
|
7848
|
-
const result = await executeCollection("bookmarks", "getByUser", { userId, threadId });
|
|
7849
|
-
sendResponse7(id, {
|
|
7850
|
-
success: true,
|
|
7851
|
-
data: result.data,
|
|
7852
|
-
count: result.count,
|
|
7853
|
-
message: `Retrieved ${result.count} bookmarks for user ${userId}`
|
|
7854
|
-
}, sendMessage, clientId);
|
|
7855
|
-
logger.info(`Retrieved bookmarks for user ${userId} (count: ${result.count})`);
|
|
7856
|
-
} catch (error) {
|
|
7857
|
-
sendResponse7(id, {
|
|
7858
|
-
success: false,
|
|
7859
|
-
error: error instanceof Error ? error.message : "Failed to get bookmarks by user"
|
|
7860
|
-
}, sendMessage, clientId);
|
|
7861
|
-
}
|
|
7862
|
-
}
|
|
7863
|
-
async function handleGetByThread(id, threadId, executeCollection, sendMessage, clientId) {
|
|
7864
|
-
if (!threadId) {
|
|
7865
|
-
sendResponse7(id, {
|
|
7866
|
-
success: false,
|
|
7867
|
-
error: "threadId is required"
|
|
7868
|
-
}, sendMessage, clientId);
|
|
7869
|
-
return;
|
|
7870
|
-
}
|
|
7871
|
-
try {
|
|
7872
|
-
const result = await executeCollection("bookmarks", "getByThread", { threadId });
|
|
7873
|
-
sendResponse7(id, {
|
|
7874
|
-
success: true,
|
|
7875
|
-
data: result.data,
|
|
7876
|
-
count: result.count,
|
|
7877
|
-
message: `Retrieved ${result.count} bookmarks for thread ${threadId}`
|
|
7878
|
-
}, sendMessage, clientId);
|
|
7879
|
-
logger.info(`Retrieved bookmarks for thread ${threadId} (count: ${result.count})`);
|
|
7880
|
-
} catch (error) {
|
|
7881
|
-
sendResponse7(id, {
|
|
7882
|
-
success: false,
|
|
7883
|
-
error: error instanceof Error ? error.message : "Failed to get bookmarks by thread"
|
|
7884
|
-
}, sendMessage, clientId);
|
|
7885
|
-
}
|
|
7886
|
-
}
|
|
7887
7833
|
async function handleQuery5(id, filters, limit, sort, executeCollection, sendMessage, clientId) {
|
|
7888
7834
|
try {
|
|
7889
7835
|
const result = await executeCollection("bookmarks", "query", {
|