@hiai-gg/docsmint 0.5.7 → 0.5.8

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.
@@ -230336,6 +230336,7 @@ async function searchDocuments(ctx, request, adapters = {}) {
230336
230336
  const embeddingProvider = adapters.getEmbedding ?? getEmbedding;
230337
230337
  const expand2 = adapters.expand ?? expandQuery;
230338
230338
  const retrieveGraph = adapters.retrieveGraph ?? retrieveGraphCandidates;
230339
+ const filterRanked = adapters.filterRanked ?? applySearchFilters;
230339
230340
  const channelErrors = {};
230340
230341
  const embeddingCache = new Map;
230341
230342
  const getCachedEmbedding = (text4) => {
@@ -230473,7 +230474,7 @@ async function searchDocuments(ctx, request, adapters = {}) {
230473
230474
  });
230474
230475
  const filters = request.filters;
230475
230476
  const hasFilters = Boolean(filters && Object.values(filters).some((value) => Array.isArray(value) ? value.length > 0 : value !== undefined));
230476
- const filtered = hasFilters ? await applySearchFilters(ctx, ranked, filters, request.visibilityScope) : ranked;
230477
+ const filtered = hasFilters || request.visibilityScope !== undefined ? await filterRanked(ctx, ranked, filters ?? {}, request.visibilityScope) : ranked;
230477
230478
  const offset = (page - 1) * limit;
230478
230479
  const items = filtered.slice(offset, offset + limit);
230479
230480
  const graphContribution = items.some((item) => item.channels.includes("graph"));
@@ -230577,7 +230578,7 @@ async function applySearchFilters(ctx, items, filters, visibilityScope) {
230577
230578
  folderOwnerId: folders.ownerId,
230578
230579
  title: documents.title,
230579
230580
  createdAt: documents.createdAt
230580
- }).from(documents).leftJoin(folders, and(eq(folders.id, documents.folderId), eq(folders.ownerId, ctx.userId))).where(and(visibility, inArray(documents.id, ids))));
230581
+ }).from(documents).leftJoin(folders, and(eq(folders.id, documents.folderId), eq(folders.ownerId, ctx.userId))).where(and(visibility, isNull(documents.deletedAt), inArray(documents.id, ids))));
230581
230582
  const byId = new Map(rows.map((row) => [row.id, row]));
230582
230583
  let filtered = items.filter((item) => {
230583
230584
  const row = byId.get(item.documentId);
@@ -234279,7 +234280,7 @@ var swaggerConfig = {
234279
234280
  },
234280
234281
  info: {
234281
234282
  title: "DocsMint API",
234282
- version: "0.5.7",
234283
+ version: "0.5.8",
234283
234284
  description: "Self-hosted AI-first documentation platform. Full-text + semantic search, version history, sharing, and folder organization.",
234284
234285
  contact: { name: "HiAi-gg", url: "https://github.com/HiAi-gg/docsmint" },
234285
234286
  license: {