Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/daemon/src/routes/marketplace-reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ interface ReviewsSyncConfig {
readonly lastSyncError: string | null;
}

// Production sync endpoint. Pre-configured so users only need to set enabled: true.
const REVIEWS_SYNC_URL = "https://reviews.signetai.sh/api/reviews/sync";

const DEFAULT_CONFIG: ReviewsSyncConfig = {
enabled: false,
endpointUrl: "",
endpointUrl: REVIEWS_SYNC_URL,
lastSyncAt: null,
lastSyncError: null,
};
Expand Down Expand Up @@ -140,7 +143,7 @@ function readConfig(): ReviewsSyncConfig {
if (!isRecord(raw)) return DEFAULT_CONFIG;
return {
enabled: raw.enabled === true,
endpointUrl: typeof raw.endpointUrl === "string" ? raw.endpointUrl : "",
endpointUrl: typeof raw.endpointUrl === "string" && raw.endpointUrl.length > 0 ? raw.endpointUrl : REVIEWS_SYNC_URL,
lastSyncAt: typeof raw.lastSyncAt === "string" ? raw.lastSyncAt : null,
lastSyncError: typeof raw.lastSyncError === "string" ? raw.lastSyncError : null,
};
Expand Down Expand Up @@ -344,7 +347,7 @@ export function mountMarketplaceReviewsRoutes(app: Hono): void {
try {
const response = await fetch(config.endpointUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
headers: { "Content-Type": "application/json", "X-Signet-Sync": "1" },
Comment thread
aaf2tbz marked this conversation as resolved.
body: JSON.stringify({
source: "signet-marketplace",
type: "reviews-sync",
Expand Down
Loading