import { removeObjectEmptyFields } from "https://deno.land/x/windmill_helpers@v1.1.1/mod.ts";
import { Client } from "npm:@notionhq/client";
/**
* @param start_cursor If supplied, only results starting after the cursor will be returned.
*
* @param page_size The number of items in the response. Maximum is `100`.
*
* Learn more at
* https://developers.notion.com/reference/get-users
*/
type Notion = {
token: string;
};
export async function main(
auth: Notion,
start_cursor?: string | undefined,
page_size?: number | undefined,
) {
const client = new Client({ auth: auth.token });
const args = removeObjectEmptyFields({
page_size,
start_cursor,
});
return await client.users.list(args);
}
Submitted by admin 500 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";
/**
* @param start_cursor If supplied, only results starting after the cursor will be returned.
*
* @param page_size The number of items in the response. Maximum is `100`.
*
* Learn more at
* https://developers.notion.com/reference/get-users
*/
export async function main(
auth: Resource<"notion">,
start_cursor?: string | undefined,
page_size?: number | undefined,
) {
const client = new Client({ auth: auth.token });
const args = removeObjectEmptyFields({
page_size,
start_cursor,
});
return await client.users.list(args);
}
Submitted by adam186 607 days ago