@paroicms/server
Version:
The ParoiCMS server
64 lines (63 loc) • 2.35 kB
TypeScript
import type { Tracker } from "@paroicms/internal-server-lib";
import type { ParsedLNodeId, ScSortRule } from "@paroicms/public-anywhere-lib";
import type { Knex } from "knex";
import { type DocumentSeed } from "../../common/data-format.js";
import type { SiteContext } from "../../site-context/site-context.types.js";
export interface PagedDocumentsSeed {
items: DocumentSeed[];
offset: number;
total: number;
}
export declare function findOneDocumentSeed({ cn }: SiteContext, lNodeId: ParsedLNodeId): Promise<DocumentSeed>;
export declare function getDocuments(siteContext: Pick<SiteContext, "cn" | "siteSchema">, { parentId, pagination, sorting, }: {
parentId: ParsedLNodeId;
pagination?: {
offset: number;
limit: number;
};
sorting?: ScSortRule[];
}): Promise<{
total?: number;
documents: DocumentSeed[];
}>;
export interface PaginationOptions {
offset: number;
limit: number;
}
export declare function setLNodeReady(siteContext: SiteContext, { lNodeId, ready }: {
lNodeId: ParsedLNodeId;
ready: boolean;
}): Promise<void>;
export interface BreadcrumbItem {
documentId: ParsedLNodeId;
typeName: string;
title?: string;
}
export declare function getBreadcrumb(siteContext: Pick<SiteContext, "cn" | "siteSchema" | "logger">, tracker: Tracker, documentId: ParsedLNodeId, options?: {
ensurePublished?: boolean;
skipHome?: boolean;
skipCurrent?: boolean;
}): Promise<BreadcrumbItem[]>;
export declare function isOrphanNode(cn: Knex, nodeId: string): Promise<boolean>;
export declare function searchDocuments(siteContext: SiteContext, input: {
language: string;
queryString: string;
offset: number;
limit: number;
sorting?: ScSortRule[];
}): Promise<PagedDocumentsSeed>;
export declare function getParentLanguages(siteContext: SiteContext, nodeId: string): Promise<string[]>;
export declare function updateLNodeUpdatedAt(cn: Knex | Knex.Transaction, options: {
nodeId: string;
language?: string;
}): Promise<void>;
export declare function getChildDocuments(siteContext: Pick<SiteContext, "cn" | "siteSchema">, options: {
parentNodeId: string;
language: string;
missingInLanguage?: boolean;
pagination: PaginationOptions;
sorting?: ScSortRule[];
}): Promise<{
total: number;
items: DocumentSeed[];
}>;