mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 05:23:38 +00:00
feat: add publication
This commit is contained in:
@@ -17,6 +17,7 @@ export * from "./booking-window-ws";
|
||||
export * from "./support-chat";
|
||||
export * from "./portal-content";
|
||||
export * from "./portal-content.defaults";
|
||||
export * from "./publications";
|
||||
|
||||
export enum TradeDirection {
|
||||
IMPORT = "IMPORT",
|
||||
|
||||
43
packages/types/src/freight/publications.ts
Normal file
43
packages/types/src/freight/publications.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Public document library for the freight portal (/publications): PDFs,
|
||||
* Markdown write-ups and PowerPoint decks about the platform, uploaded and
|
||||
* curated from the backoffice. Unlike `support-content`'s five fixed slugs,
|
||||
* this is a real table of many rows — each row is one whole file, replaced
|
||||
* wholesale rather than edited in place, so there is no version history here.
|
||||
*/
|
||||
|
||||
/** MinIO key prefix every uploaded publication file is stored under. */
|
||||
export const PUBLICATION_FILE_PREFIX = "publications/";
|
||||
|
||||
/** Mime types accepted for a publication upload. */
|
||||
export const PUBLICATION_ALLOWED_MIME_TYPES = [
|
||||
"application/pdf",
|
||||
"text/markdown",
|
||||
"text/x-markdown",
|
||||
"application/vnd.ms-powerpoint",
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
||||
] as const;
|
||||
|
||||
/** One document in the public library. */
|
||||
export interface Publication {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string | null;
|
||||
category: string | null;
|
||||
fileName: string;
|
||||
fileMimeType: string;
|
||||
fileSizeBytes: number;
|
||||
sortOrder: number;
|
||||
published: boolean;
|
||||
publishedAt: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shape the anonymous portal reads — no `fileKey` (that's a MinIO object
|
||||
* name, not a browser-reachable URL — a presigned MinIO URL isn't reachable
|
||||
* from the browser here, see `apiConfig.ts`'s `fileViewUrl`). The portal
|
||||
* builds the file's URL itself from `id` via `GET /api/publications/:id/file`.
|
||||
*/
|
||||
export type PublicationSummary = Omit<Publication, "published">;
|
||||
Reference in New Issue
Block a user