import { Client } from "npm:@notionhq/client";
/**
* Learn more at
* https://developers.notion.com/reference/retrieve-a-page
*/
type Notion = {
token: string;
};
export async function main(
auth: Notion,
page_id: string,
filter_properties?: string[],
) {
const client = new Client({ auth: auth.token });
if (!filter_properties?.filter(Boolean).length) {
filter_properties = undefined;
}
return await client.pages.retrieve({
page_id,
filter_properties,
});
}
Submitted by admin 500 days ago
import { Resource } from "https://deno.land/x/windmill@v1.89.0/mod.ts";
import { Client } from "npm:@notionhq/client";
/**
* Learn more at
* https://developers.notion.com/reference/retrieve-a-page
*/
export async function main(
auth: Resource<"notion">,
page_id: string,
filter_properties?: string[],
) {
const client = new Client({ auth: auth.token });
if (!filter_properties?.filter(Boolean).length) {
filter_properties = undefined;
}
return await client.pages.retrieve({
page_id,
filter_properties,
});
}
Submitted by adam186 607 days ago