@hermespilot/link 0.7.4 → 0.7.5-beta.0
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.
|
@@ -6454,7 +6454,7 @@ function isConversationMissingError(error) {
|
|
|
6454
6454
|
}
|
|
6455
6455
|
|
|
6456
6456
|
// src/constants.ts
|
|
6457
|
-
var LINK_VERSION = "0.7.
|
|
6457
|
+
var LINK_VERSION = "0.7.5-beta.0";
|
|
6458
6458
|
var LINK_COMMAND = "hermeslink";
|
|
6459
6459
|
var LINK_DEFAULT_PORT = 52379;
|
|
6460
6460
|
var LINK_RUNTIME_DIR_NAME = ".hermeslink";
|
|
@@ -24497,11 +24497,15 @@ function registerConversationRoutes(router, options) {
|
|
|
24497
24497
|
router.get("/api/v1/conversations", async (ctx) => {
|
|
24498
24498
|
const auth = await authenticateRequest(ctx, paths);
|
|
24499
24499
|
const language = readPreferredLanguage(ctx);
|
|
24500
|
-
|
|
24500
|
+
const cursor = readConversationListCursor(ctx.query);
|
|
24501
|
+
const forceSync = readConversationListForce(ctx.query);
|
|
24502
|
+
await prepareConversationListRead(conversations, logger, auth, {
|
|
24503
|
+
syncHermesSessions: forceSync || !cursor
|
|
24504
|
+
});
|
|
24501
24505
|
ctx.set("cache-control", "no-store");
|
|
24502
24506
|
const result = await conversations.listConversationPage({
|
|
24503
24507
|
limit: readLimit(ctx.query.limit),
|
|
24504
|
-
cursor
|
|
24508
|
+
cursor
|
|
24505
24509
|
});
|
|
24506
24510
|
const localized = localizeConversationListPage(result, language);
|
|
24507
24511
|
ctx.body = {
|
|
@@ -25014,7 +25018,15 @@ function registerConversationRoutes(router, options) {
|
|
|
25014
25018
|
}
|
|
25015
25019
|
);
|
|
25016
25020
|
}
|
|
25017
|
-
async function prepareConversationListRead(conversations, logger, auth) {
|
|
25021
|
+
async function prepareConversationListRead(conversations, logger, auth, options = {}) {
|
|
25022
|
+
if (options.syncHermesSessions) {
|
|
25023
|
+
await conversations.syncHermesSessions().catch((error) => {
|
|
25024
|
+
void logger.warn("hermes_session_sync_failed", {
|
|
25025
|
+
source: "conversation_list_read",
|
|
25026
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25027
|
+
});
|
|
25028
|
+
});
|
|
25029
|
+
}
|
|
25018
25030
|
await conversations.backfillCronOwnership({
|
|
25019
25031
|
accountId: auth.accountId,
|
|
25020
25032
|
appInstanceId: auth.appInstanceId
|
|
@@ -25030,6 +25042,13 @@ async function prepareConversationListRead(conversations, logger, auth) {
|
|
|
25030
25042
|
});
|
|
25031
25043
|
});
|
|
25032
25044
|
}
|
|
25045
|
+
function readConversationListCursor(query) {
|
|
25046
|
+
return readQueryString(query.cursor) ?? readQueryString(query.after) ?? readQueryString(query.page_cursor);
|
|
25047
|
+
}
|
|
25048
|
+
function readConversationListForce(query) {
|
|
25049
|
+
const raw = Array.isArray(query.force) ? query.force[0] : query.force;
|
|
25050
|
+
return readBoolean3(raw) === true;
|
|
25051
|
+
}
|
|
25033
25052
|
function localizeConversationListPage(page, language) {
|
|
25034
25053
|
return {
|
|
25035
25054
|
...page,
|
package/dist/cli/index.js
CHANGED
package/dist/http/app.js
CHANGED