import { removeObjectEmptyFields } from "https://deno.land/x/windmill_helpers@v1.1.1/mod.ts";
import { Client } from "npm:@notionhq/client";
/**
* Learn more at
* https://developers.notion.com/reference/get-block-children
*/
type Notion = {
token: string;
};
export async function main(
auth: Notion,
block_id: string,
start_cursor?: string,
page_size?: number,
) {
const client = new Client({ auth: auth.token });
const args = removeObjectEmptyFields({
block_id,
start_cursor,
page_size,
});
return await client.blocks.children.list(args);
}
Submitted by admin 463 days ago
import { Resource } from "https://deno.land/x/windmill@v1.89.0/mod.ts";
import { removeObjectEmptyFields } from "https://deno.land/x/windmill_helpers@v1.1.1/mod.ts";
import { Client } from "npm:@notionhq/client";
/**
* Learn more at
* https://developers.notion.com/reference/get-block-children
*/
export async function main(
auth: Resource<"notion">,
block_id: string,
start_cursor?: string,
page_size?: number,
) {
const client = new Client({ auth: auth.token });
const args = removeObjectEmptyFields({
block_id,
start_cursor,
page_size,
});
return await client.blocks.children.list(args);
}
Submitted by adam186 570 days ago