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/post-search
*/
type Notion = {
token: string;
};
export async function main(
auth: Notion,
query?: string,
filter?: { property: string; value: string },
sort?: { timestamp: string; direction: string },
start_cursor?: string,
page_size?: number,
) {
const client = new Client({ auth: auth.token });
const args = removeObjectEmptyFields({
query,
filter,
sort,
start_cursor,
page_size,
});
return await client.search(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/post-search
*/
export async function main(
auth: Resource<"notion">,
query?: string,
filter?: { property: string; value: string },
sort?: { timestamp: string; direction: string },
start_cursor?: string,
page_size?: number,
) {
const client = new Client({ auth: auth.token });
const args = removeObjectEmptyFields({
query,
filter,
sort,
start_cursor,
page_size,
});
return await client.search(args);
}
Submitted by adam186 570 days ago