import type Client from "./Client";
import * as endpoints from "./api-endpoints";
import { type EndpointDefinition } from "./utils";
type WithoutIndexSignatures
= P extends unknown ? {
[K in keyof P as string extends K ? never : number extends K ? never : K]: P[K];
} : never;
type WithAuth
= P & {
auth?: string;
};
type OptionalWithAuth
= WithoutIndexSignatures
& {
auth?: string;
};
type EndpointClient = Pick & {
warnUnknownParams(args: Record, endpoint: EndpointDefinition): void;
};
export declare function createEndpointMethods(client: EndpointClient): {
users: {
/** Retrieve your token's bot user */
me: (args?: OptionalWithAuth | undefined) => Promise;
/** Retrieve a user */
retrieve: (args: WithAuth<{
user_id: endpoints.IdRequest;
}>) => Promise;
/** List all users */
list: (args?: OptionalWithAuth<{
start_cursor?: string | null;
page_size?: number;
}> | undefined) => Promise;
};
pages: {
/** Create a page */
create: (args: WithAuth) => Promise;
/** Retrieve a page */
retrieve: (args: WithAuth) => Promise;
/** Update page */
update: (args: WithAuth) => Promise;
/** Move a page */
move: (args: WithAuth) => Promise;
properties: {
/** Retrieve a page property item */
retrieve: (args: WithAuth) => Promise;
};
};
asyncTasks: {
/** Retrieve an async task */
retrieve: (args: WithAuth<{
task_id: string;
}>) => Promise;
};
blocks: {
/** Retrieve a block */
retrieve: (args: WithAuth<{
block_id: endpoints.IdRequest;
}>) => Promise;
/** Update a block */
update: (args: WithAuth) => Promise;
/** Delete a block */
delete: (args: WithAuth<{
block_id: endpoints.IdRequest;
}>) => Promise;
children: {
/** Retrieve block children */
list: (args: WithAuth) => Promise;
/** Append block children */
append: (args: WithAuth) => Promise;
};
meetingNotes: {
/** Create a meeting note */
create: (args: WithAuth<{
title?: string;
language?: "auto" | "en" | "zh-CN" | "zh-TW" | "es" | "fr" | "de" | "ja" | "ko" | "pt" | "ru" | "th" | "vi" | "id" | "da" | "fi" | "no" | "nl" | "it" | "sv" | "ar" | "he" | "pl";
options?: {
kickoff_summary?: boolean;
};
} & ({
source: {
type: "file_upload";
file_upload_id: endpoints.IdRequest;
};
parent: {
type: "page_id";
page_id: endpoints.IdRequest;
};
} | {
source: {
type: "block";
block_id: endpoints.IdRequest;
};
parent?: never;
})>) => Promise;
};
};
dataSources: {
/** Retrieve a data source */
retrieve: (args: WithAuth<{
data_source_id: endpoints.IdRequest;
}>) => Promise;
/** Update a data source */
update: (args: WithAuth) => Promise;
/** Query a data source */
query: (args: WithAuth) => Promise;
/** Create a data source */
create: (args: WithAuth<{
parent: endpoints.ParentOfDataSourceRequest;
properties: Record;
title?: Array;
icon?: endpoints.PageIconRequest | null;
}>) => Promise;
/** List templates in a data source */
listTemplates: (args: WithAuth) => Promise;
};
databases: {
/** Retrieve a database */
retrieve: (args: WithAuth<{
database_id: endpoints.IdRequest;
}>) => Promise;
/** Update a database */
update: (args: WithAuth) => Promise;
/** Create a database */
create: (args: WithAuth<{
parent: {
type: "page_id" | "workspace";
} & ({
type: "page_id";
page_id: endpoints.IdRequest;
} | {
type: "workspace";
workspace: true;
});
title?: Array;
description?: Array;
is_inline?: boolean;
initial_data_source?: endpoints.InitialDataSourceRequest;
database_type?: "tasks" | "projects" | "skills";
icon?: endpoints.PageIconRequest;
cover?: endpoints.PageCoverRequest;
}>) => Promise;
};
/** Search by title */
search: (args?: OptionalWithAuth<{
sort?: {
timestamp: "last_edited_time";
direction: "ascending" | "descending";
} | {
property: "relevance";
};
query?: string;
start_cursor?: string | null;
page_size?: number;
filter?: {
property: "object";
value: "page" | "data_source";
in_trash?: boolean;
} | {
in_trash: boolean;
};
}> | undefined) => Promise;
comments: {
/** Create a comment */
create: (args: WithAuth<{
attachments?: Array<{
file_upload_id: string;
type?: "file_upload";
}>;
display_name?: {
type: "integration";
} | {
type: "user";
} | {
type: "custom";
custom: {
name: string;
};
};
} & ({
parent: {
page_id: endpoints.IdRequest;
type?: "page_id";
} | {
block_id: endpoints.IdRequest;
type?: "block_id";
};
rich_text: Array;
} | {
parent: {
page_id: endpoints.IdRequest;
type?: "page_id";
} | {
block_id: endpoints.IdRequest;
type?: "block_id";
};
markdown: string;
} | {
discussion_id: endpoints.IdRequest;
rich_text: Array;
} | {
discussion_id: endpoints.IdRequest;
markdown: string;
})>) => Promise;
/** List comments */
list: (args: WithAuth<{
block_id: endpoints.IdRequest;
start_cursor?: string | null;
page_size?: number;
}>) => Promise;
/** Retrieve a comment */
retrieve: (args: WithAuth<{
comment_id: endpoints.IdRequest;
}>) => Promise;
/** Update a comment */
update: (args: WithAuth) => Promise;
/** Delete a comment */
delete: (args: WithAuth<{
comment_id: endpoints.IdRequest;
}>) => Promise;
};
fileUploads: {
/** Create a file upload */
create: (args?: OptionalWithAuth<{
mode?: "single_part" | "multi_part" | "external_url";
filename?: string;
content_type?: string;
number_of_parts?: number;
external_url?: string;
}> | undefined) => Promise;
};
views: {
/** List views */
list: (args?: OptionalWithAuth<{
database_id?: endpoints.IdRequest;
data_source_id?: endpoints.IdRequest;
start_cursor?: string | null;
page_size?: number;
}> | undefined) => Promise;
/** Retrieve a view */
retrieve: (args: WithAuth<{
view_id: endpoints.IdRequest;
}>) => Promise;
/** Delete a view */
delete: (args: WithAuth<{
view_id: endpoints.IdRequest;
}>) => Promise;
queries: {
/** Get view query results */
results: (args: WithAuth) => Promise;
/** Delete a view query */
delete: (args: WithAuth<{
view_id: endpoints.IdRequest;
query_id: endpoints.IdRequest;
}>) => Promise;
};
};
agents: {
/** Query agents */
query: (args?: OptionalWithAuth<{
query?: string;
filter?: {
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
} | {
and: Array<{
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
} | {
and: Array<{
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
}>;
} | {
or: Array<{
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
}>;
}>;
} | {
or: Array<{
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
} | {
and: Array<{
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
}>;
} | {
or: Array<{
property: "id";
id: {
equals: string;
};
} | {
property: "agent_type";
string: {
equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
};
} | {
property: "created_by";
people: {
contains: string;
};
} | {
property: "created_time";
date: {
after?: string;
before?: string;
};
} | {
property: "favorited";
checkbox: {
equals: boolean;
};
} | {
property: "connections";
mcp_server: {
contains: string;
};
} | {
property: "status";
status: {
in: Array<"active" | "disabled" | "deleted">;
};
} | {
property: "model_mode";
select: {
equals: "auto" | "pinned";
};
} | {
property: "agent_version";
number: {
equals: number;
};
} | {
property: "last_run_at";
date: {
after?: string;
before?: string;
};
}>;
}>;
};
sorts?: Array<{
property: "created_time" | "last_run_at";
direction: "ascending" | "descending";
}>;
start_cursor?: string | null;
page_size?: number;
verbose?: boolean;
include_deleted?: boolean;
}> | undefined) => Promise;
/** Get agent */
retrieve: (args: WithAuth) => Promise;
/** Delete agent */
delete: (args: WithAuth<{
agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
}>) => Promise;
/** Get agent insights */
retrieveInsights: (args: WithAuth) => Promise;
/** Update agent status */
updateStatus: (args: WithAuth) => Promise;
/** Update agent credit limit */
updateCreditLimit: (args: WithAuth) => Promise;
/** Apply many agent operations */
batch: (args: WithAuth<{
operations: Array<{
action: "update_status";
agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
fields: {
status: "active" | "disabled";
};
} | {
action: "update_credit_limit";
agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
fields: {
credit_limit: number | null;
};
} | {
action: "delete";
agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
}>;
}>) => Promise;
};
plugins: {
/** List skills plugins */
list: (args?: OptionalWithAuth<{
page_size?: number;
start_cursor?: string | null;
}> | undefined) => Promise;
/** Get a plugin directory */
retrieve: (args: WithAuth<{
id: string;
}>) => Promise;
};
skills: {
/** Get a skill directory */
retrieve: (args: WithAuth<{
id: endpoints.IdRequest;
}>) => Promise;
};
sessions: {
/** Update a session */
update: (args: WithAuth<{
message: string;
agent_id?: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
session_id?: endpoints.IdRequest;
attachments?: Array<{
file_upload: {
id: string;
};
type?: "file_upload";
name?: string;
}>;
metadata?: Record;
prompt_context?: string;
} | {
session_id: endpoints.IdRequest;
actions: Array<{
action_id: endpoints.IdRequest;
option_id: "approve" | "reject";
}>;
metadata?: Record;
} | {
session_id: endpoints.IdRequest;
continue_from: string;
}>) => Promise;
/** Retrieve a session */
retrieve: (args: WithAuth<{
session_id: endpoints.IdRequest;
}>) => Promise;
/** Query sessions */
query: (args?: OptionalWithAuth<{
query?: string;
filter?: {
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
} | {
and: Array<{
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
} | {
and: Array<{
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
}>;
} | {
or: Array<{
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
}>;
}>;
} | {
or: Array<{
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
} | {
and: Array<{
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
}>;
} | {
or: Array<{
property: "id";
string: {
equals: string;
};
} | {
property: "agent_id";
string: {
equals: string;
};
} | {
property: "status";
status: {
equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
};
} | {
property: "created_at" | "updated_at";
timestamp: {
before?: string;
after?: string;
on_or_before?: string;
on_or_after?: string;
};
}>;
}>;
};
sorts?: Array<{
property: "created_at" | "updated_at";
direction: "ascending" | "descending";
}>;
start_cursor?: string | null;
page_size?: number;
}> | undefined) => Promise;
/** Query session events */
queryEvents: (args: WithAuth) => Promise;
/** Cancel a session */
cancel: (args: WithAuth) => Promise;
};
};
export {};
//# sourceMappingURL=api-endpoint-methods.d.ts.map