mirror of
https://github.com/zhigang1992/notion-api-worker.git
synced 2026-01-12 17:32:42 +08:00
Add file support
This commit is contained in:
@@ -37,7 +37,8 @@ export type ColumnType =
|
||||
| "title"
|
||||
| "multi_select"
|
||||
| "number"
|
||||
| "relation";
|
||||
| "relation"
|
||||
| "file";
|
||||
|
||||
export type ColumnSchemaType = {
|
||||
name: string;
|
||||
@@ -53,7 +54,8 @@ export type RowContentType =
|
||||
| string[]
|
||||
| { title: string; id: string }
|
||||
| UserType[]
|
||||
| DecorationType[];
|
||||
| DecorationType[]
|
||||
| { name: string; url: string }[];
|
||||
|
||||
export interface BaseValueType {
|
||||
id: string;
|
||||
|
||||
@@ -41,6 +41,10 @@ export const getNotionValue = (
|
||||
return val
|
||||
.filter(([symbol]) => symbol === "‣")
|
||||
.map(([_, relation]) => relation![0][1] as string);
|
||||
case "file":
|
||||
return val
|
||||
.filter((v) => v.length > 1)
|
||||
.map((v) => ({ name: v[0] as string, url: v[1]![0][1] as string }));
|
||||
default:
|
||||
console.log({ val, type });
|
||||
return "Not supported";
|
||||
|
||||
Reference in New Issue
Block a user