@jitl/notion-api
Version:
The missing companion library for the official Notion public API.
1,645 lines (1,644 loc) • 204 kB
TypeScript
import { Client as NotionClient, Logger, LogLevel } from '@notionhq/client';
import { GetBlockResponse, GetDatabaseResponse, GetPageResponse, GetUserResponse, QueryDatabaseParameters } from '@notionhq/client/build/src/api-endpoints';
import { Assert } from '@notionhq/client/build/src/type-utils';
/** @private */
export declare const DEBUG: import("debug").Debugger;
declare const DEBUG_API: import("debug").Debugger;
declare type NotionClientLoggers = {
[K in LogLevel]: typeof DEBUG_API;
};
/**
* A logger for the @notionhq/client Client that logs to the @jitl/notion-api
* namespace.
* @category API
*/
export declare type NotionClientDebugLogger = Logger & NotionClientLoggers;
/**
* @category API
*
* A logger for the @notionhq/client Client that logs to the @jitl/notion-api
* namespace.
*
*
* @example
* ```typescript
* const client = new NotionClient({
* logger: NotionClientDebugLogger,
* // ...
* })
* ```
*/
export declare const NotionClientDebugLogger: NotionClientDebugLogger;
export {
/**
* The official @notionhq/client API Client.
* (Renamed for easy, unambiguous tab-completion/automatic import.)
*/
NotionClient, };
/**
* Object with no properties.
* @category API
*/
export declare type EmptyObject = Record<string, never>;
/**
* A page of results from the Notion API.
* @source
* @category API
*/
export interface PaginatedList<T> {
object: 'list';
results: T[];
next_cursor: string | null;
has_more: boolean;
}
/**
* Common arguments for paginated APIs.
* @source
* @category API
*/
export interface PaginatedArgs {
start_cursor?: string;
page_size?: number;
}
/**
* Iterate over all results in a paginated list API.
*
* ```typescript
* for await (const block of iteratePaginatedAPI(notion.blocks.children.list, {
* block_id: parentBlockId,
* })) {
* // Do something with block.
* }
* ```
*
* @param listFn API to call
* @param firstPageArgs These arguments are used for each page, with an updated `start_cursor`.
* @category API
*/
export declare function iteratePaginatedAPI<Args extends PaginatedArgs, Item>(listFn: (args: Args) => Promise<PaginatedList<Item>>, firstPageArgs: Args): AsyncIterableIterator<Item>;
/**
* Gather all an async iterable's items into an array.
* ```typescript
* const iterator = iteratePaginatedAPI(notion.blocks.children.list, { block_id: parentBlockId });
* const blocks = await asyncIterableToArray(iterator);
* const paragraphs = blocks.filter(block => isFullBlock(block, 'paragraph'))
* ```
* @category API
*/
export declare function asyncIterableToArray<T>(iterable: AsyncIterable<T>): Promise<Array<T>>;
/**
* A full Notion API page.
* @category Page
*/
export declare type Page = Extract<GetPageResponse, {
parent: unknown;
}>;
/**
* The Notion API may return a "partial" page object if your API token can't
* access the page.
*
* This function confirms that all page data is available.
* @category Page
*/
export declare function isFullPage(page: GetPageResponse): page is Page;
/**
* An extension of the Notion API page type that ads a `children` attribute
* forming a recursive tree of blocks.
* @category Page
*/
export declare type PageWithChildren = Page & {
children: BlockWithChildren[];
};
/**
* @category Page
*/
export declare function isPageWithChildren(page: GetPageResponse): page is PageWithChildren;
declare type AnyBlock = Extract<GetBlockResponse, {
type: string;
}>;
/**
* Type of any block.
* @category Block
*/
export declare type BlockType = AnyBlock['type'];
/**
* A full Notion API block.
* @category Block
*/
export declare type Block<Type extends BlockType = BlockType> = Extract<AnyBlock, {
type: Type;
}>;
/**
* The Notion API may return a "partial" block object if your API token can't
* access the block.
*
* This function confirms that all block data is available.
* @category Block
*/
export declare function isFullBlock(block: GetBlockResponse): block is Block;
/**
* The Notion API may return a "partial" block object if your API token can't
* access the block.
*
* This function confirms that all block data is available, and the block has
* type `blockType`.
* @category Block
*/
export declare function isFullBlock<Type extends BlockType>(block: GetBlockResponse, blockType: Type): block is Block<Type>;
/**
* Filter function returned by [[isFullBlockFilter]].
* @category Block
*/
export interface BlockFilterFunction<Type extends BlockType> {
(block: GetBlockResponse): block is Block<Type>;
(block: BlockWithChildren): block is BlockWithChildren<Type>;
}
/**
* Returns a filter type guard for blocks of the given `type`.
* See [[isFullBlock]] for more information.
*
* ```typescript
* const paragraphs: Array<Block<"paragraph">> = blocks.filter(isFullBlockFilter("paragraph"));
* ```
*
* @category Block
*/
export declare function isFullBlockFilter<Type extends BlockType>(type: Type): BlockFilterFunction<Type>;
declare type BlockTypeMap = {
[K in BlockType]: Block<K>;
};
/**
* Type-level map from a [[BlockType]] to the data of that block.
* @category Block
* @source
*/
export declare type BlockDataMap = {
[K in BlockType]: BlockTypeMap[K] extends {
[key in K]: unknown;
} ? BlockTypeMap[K][K] : never;
};
/**
* Generic way to get a block's data.
* @category Block
*/
export declare function getBlockData<Type extends BlockType>(block: Block<Type>): BlockDataMap[Type];
/**
* An extension of the Notion API block type that adds a `children` attribute
* forming a recursive tree of blocks.
* @category Block
*/
export declare type BlockWithChildren<Type extends BlockType = BlockType> = Block<Type> & {
children: BlockWithChildren[];
};
/**
* @category Block
*/
export declare function isBlockWithChildren(block: GetBlockResponse): block is BlockWithChildren;
/**
* Fetch all supported children of a block.
* @category Block
*/
export declare function getChildBlocks(notion: NotionClient, parentBlockId: string): Promise<Block[]>;
/**
* Recursively fetch all children of `parentBlockId` as `BlockWithChildren`.
* This function can be used to fetch an entire page's contents in one call.
* @category Block
*/
export declare function getChildBlocksWithChildrenRecursively(notion: NotionClient, parentId: string): Promise<BlockWithChildren[]>;
/**
* @category Block
*/
export declare function getBlockWithChildren(notion: NotionClient, blockId: string): Promise<BlockWithChildren | undefined>;
/**
* Recurse over the blocks and their children, calling `fn` on each block.
* @category Block
*/
export declare function visitChildBlocks(blocks: BlockWithChildren[], fn: (block: BlockWithChildren) => void): void;
declare const RICH_TEXT_BLOCK_PROPERTY = "rich_text";
/**
* Notion API rich text. An array of rich text tokens.
* @category Rich Text
*/
export declare type RichText = Block<'paragraph'>['paragraph'][typeof RICH_TEXT_BLOCK_PROPERTY];
/**
* A single token of rich text.
* @category Rich Text
*/
export declare type RichTextToken = RichText[number];
declare type AnyMention = Extract<RichTextToken, {
type: 'mention';
}>;
/**
* The type of mention.
* @category Rich Text
*/
export declare type MentionType = AnyMention['mention']['type'];
/**
* The data of a mention type.
* @category Rich Text
*/
export declare type MentionData<Type extends MentionType> = Extract<AnyMention['mention'], {
type: Type;
}>;
/**
* A mention token.
* (This type doesn't seem to work very well.)
* @category Rich Text
*/
export declare type Mention<Type extends MentionType = MentionType> = Omit<AnyMention, 'mention'> & {
mention: MentionData<Type>;
};
/**
* @returns Plaintext string of rich text.
* @category Rich Text
*/
export declare function richTextAsPlainText(richText: string | RichText | undefined): string;
declare type DateMentionData = MentionData<'date'>;
/**
* Notion date type.
* @category Date
*/
export declare type DateResponse = DateMentionData['date'];
/**
* Convert a Notion date's start into a Javascript Date object.
* @category Date
*/
export declare function notionDateStartAsDate(date: DateResponse | Date): Date;
/**
* Convert a Notion date's start into a Javascript Date object.
* @category Date
*/
export declare function notionDateStartAsDate(date: DateResponse | Date | undefined): Date | undefined;
/**
* Visit all text tokens in a block or page. Relations are treated as mention
* tokens. Does not consider children.
* @category Rich Text
*/
export declare function visitTextTokens(object: Block | Page, fn: (token: RichTextToken) => void): void;
/**
* Person or Bot
* @category User
*/
export declare type User = GetUserResponse;
/**
* Person
* @category User
*/
export declare type Person = Extract<User, {
type: 'person';
}>;
/**
* Bot
* @category User
*/
export declare type Bot = Extract<User, {
type: 'bot';
}>;
/**
* Any kind of filter in a database query.
* @category Query
*/
export declare type Filter = NonNullable<QueryDatabaseParameters['filter']>;
/**
* @category Query
*/
export declare type AnyPropertyFilter = Extract<Filter, {
type?: string;
}>;
/**
* Type of a property filter.
* @category Query
*/
export declare type PropertyFilterType = AnyPropertyFilter['type'];
/**
* Property filters in a database query.
* @category Query
*/
export declare type PropertyFilter<Type extends PropertyFilterType = PropertyFilterType> = Extract<AnyPropertyFilter, {
type?: Type;
}>;
/**
* @category Property
* @source
*/
declare type PropertyFilterTypeMap = {
[K in PropertyType]: PropertyFilter<K>;
};
/**
* Type-level map from property type to the inner filter of that property
* @category Property
* @source
*/
export declare type PropertyFilterDataMap = {
[K in PropertyType]: PropertyFilterTypeMap[K] extends {
[key in K]: unknown;
} ? PropertyFilterTypeMap[K][K] : never;
};
/**
* Filter builder functions.
* @category Query
*/
export declare const Filter: {
/**
* Syntax sugar for building a [[PropertyFilter]].
*/
readonly property: <Type extends "number" | "created_time" | "created_by" | "last_edited_time" | "last_edited_by" | "rich_text" | "date" | "url" | "select" | "multi_select" | "email" | "phone_number" | "checkbox" | "files" | "formula" | "title" | "people" | "relation" | "rollup" | undefined>(filter: PropertyFilter<Type>) => PropertyFilter<Type>;
/**
* Build a [[CompoundFilter]] from multiple arguments, or otherwise
* return the only filter.
*
* Note that the Notion API limits filter depth, but this function does not.
*/
readonly compound: (type: 'or' | 'and', ...filters: Array<Filter | undefined | false>) => Filter | undefined;
/**
* @returns True if `filter` is a [[CompoundFilter]].
*/
readonly isCompound: (filter: Filter) => filter is CompoundFilter;
/**
* Build an `and` [[CompoundFilter]] from multiple arguments, or otherwise
* return the only filter.
*
* Note that the Notion API limits filter depth, but this function does not.
*/
readonly and: (...filters: Array<Filter | undefined | false>) => Filter | undefined;
/**
* @returns True if `filter` is an `and` [[CompoundFilter]].
*/
readonly isAnd: (filter: Filter) => filter is {
and: (({
title: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "title" | undefined;
} | {
rich_text: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "rich_text" | undefined;
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
property: string;
type?: "number" | undefined;
} | {
checkbox: {
equals: boolean;
} | {
does_not_equal: boolean;
};
property: string;
type?: "checkbox" | undefined;
} | {
select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
does_not_equal: string;
};
property: string;
type?: "select" | undefined;
} | {
multi_select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "multi_select" | undefined;
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
property: string;
type?: "date" | undefined;
} | {
people: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "people" | undefined;
} | {
files: {
is_empty: true;
} | {
is_not_empty: true;
};
property: string;
type?: "files" | undefined;
} | {
url: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "url" | undefined;
} | {
email: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "email" | undefined;
} | {
phone_number: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "phone_number" | undefined;
} | {
relation: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "relation" | undefined;
} | {
created_by: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "created_by" | undefined;
} | {
created_time: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
property: string;
type?: "created_time" | undefined;
} | {
last_edited_by: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "last_edited_by" | undefined;
} | {
last_edited_time: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
property: string;
type?: "last_edited_time" | undefined;
} | {
formula: {
string: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
} | {
checkbox: {
equals: boolean;
} | {
does_not_equal: boolean;
};
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
};
property: string;
type?: "formula" | undefined;
} | {
rollup: {
any: {
rich_text: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
} | {
checkbox: {
equals: boolean;
} | {
does_not_equal: boolean;
};
} | {
select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
does_not_equal: string;
};
} | {
multi_select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
relation: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
} | {
people: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
files: {
is_empty: true;
} | {
is_not_empty: true;
};
};
} | {
none: {
rich_text: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
} | {
checkbox: {
equals: boolean;
} | {
does_not_equal: boolean;
};
} | {
select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
does_not_equal: string;
};
} | {
multi_select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
relation: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
} | {
people: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
files: {
is_empty: true;
} | {
is_not_empty: true;
};
};
} | {
every: {
rich_text: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
} | {
checkbox: {
equals: boolean;
} | {
does_not_equal: boolean;
};
} | {
select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
does_not_equal: string;
};
} | {
multi_select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
relation: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
} | {
people: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
} | {
files: {
is_empty: true;
} | {
is_not_empty: true;
};
};
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
};
property: string;
type?: "rollup" | undefined;
}) | {
created_time: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
timestamp: "created_time";
type?: "created_time" | undefined;
} | {
last_edited_time: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
timestamp: "last_edited_time";
type?: "last_edited_time" | undefined;
} | {
or: ({
title: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "title" | undefined;
} | {
rich_text: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "rich_text" | undefined;
} | {
number: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: number;
} | {
does_not_equal: number;
} | {
greater_than: number;
} | {
less_than: number;
} | {
greater_than_or_equal_to: number;
} | {
less_than_or_equal_to: number;
};
property: string;
type?: "number" | undefined;
} | {
checkbox: {
equals: boolean;
} | {
does_not_equal: boolean;
};
property: string;
type?: "checkbox" | undefined;
} | {
select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
does_not_equal: string;
};
property: string;
type?: "select" | undefined;
} | {
multi_select: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "multi_select" | undefined;
} | {
date: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
property: string;
type?: "date" | undefined;
} | {
people: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "people" | undefined;
} | {
files: {
is_empty: true;
} | {
is_not_empty: true;
};
property: string;
type?: "files" | undefined;
} | {
url: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "url" | undefined;
} | {
email: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "email" | undefined;
} | {
phone_number: {
equals: string;
} | {
does_not_equal: string;
} | {
contains: string;
} | {
does_not_contain: string;
} | {
starts_with: string;
} | {
ends_with: string;
} | ({
is_empty: true;
} | {
is_not_empty: true;
});
property: string;
type?: "phone_number" | undefined;
} | {
relation: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "relation" | undefined;
} | {
created_by: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "created_by" | undefined;
} | {
created_time: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {
next_week: {
[x: string]: never;
};
} | {
next_month: {
[x: string]: never;
};
} | {
next_year: {
[x: string]: never;
};
};
property: string;
type?: "created_time" | undefined;
} | {
last_edited_by: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
contains: string;
} | {
does_not_contain: string;
};
property: string;
type?: "last_edited_by" | undefined;
} | {
last_edited_time: ({
is_empty: true;
} | {
is_not_empty: true;
}) | {
equals: string;
} | {
before: string;
} | {
after: string;
} | {
on_or_before: string;
} | {
on_or_after: string;
} | {
past_week: {
[x: string]: never;
};
} | {
past_month: {
[x: string]: never;
};
} | {
past_year: {
[x: string]: never;
};
} | {