mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
00fb4d1af7
- crypto → node:crypto - fs → node:fs - fs/promises → node:fs/promises - path → node:path - http → node:http - https → node:https - stream → node:stream - buffer → node:buffer - url → node:url - os → node:os - net → node:net - dns → node:dns - events → node:events - readline → node:readline - querystring → node:querystring - util → node:util
24 lines
618 B
TypeScript
24 lines
618 B
TypeScript
import path from "node:path";
|
|
import type { FileOperation } from "@server/models";
|
|
import { presentUser } from ".";
|
|
|
|
export default function presentFileOperation(data: FileOperation) {
|
|
return {
|
|
id: data.id,
|
|
type: data.type,
|
|
format: data.format,
|
|
name:
|
|
data.collection?.name ||
|
|
data.document?.titleWithDefault ||
|
|
path.basename(data.key || ""),
|
|
state: data.state,
|
|
error: data.error,
|
|
size: data.size,
|
|
collectionId: data.collectionId,
|
|
documentId: data.documentId,
|
|
user: presentUser(data.user),
|
|
createdAt: data.createdAt,
|
|
updatedAt: data.updatedAt,
|
|
};
|
|
}
|