/** Import typings. */ import { API } from './interfaces'; /** * Options to config a Notion API agent instance. * * @category Library */ export interface CreateAgentOptions { /** Web address of the API server. Default: `"https://www.notion.so"`. */ server?: string; /** * Notion API token. Default: `""`. * {@link https://github.com/dragonman225/notionapi-agent/blob/master/documentation/obtain-token/obtain-token.md | How to get it ?} */ token?: string; /** Whether to trun on debug message. Default: `false`. */ debug?: boolean; } /** * Notion API agent instance. * * @category Library */ export interface Agent { /** * POST /api/v3/getActivityLog * * Get user activities of a navigable block, e.g. a page. * Equivalent to the "Updates" button in Notion's UI. * * @remark Must be authenticated even for public blocks. */ getActivityLog: (req: API.GetActivityLog.Request) => Promise; /** * POST /api/v3/getAssetsJson * * Get a list of static asset paths, current version number, and more. */ getAssetsJson: (req: API.GetAssetsJson.Request) => Promise; /** * POST /api/v3/getSnapshotsList * * @remark Must be authenticated even for public blocks. */ getSnapshotsList: (req: API.GetSnapshotsList.Request) => Promise; /** * POST /api/v3/getUserSharedPages * * Get ids of pages created with **+ New Page** button at the top level * of the user's workspace *AND* those not created at the top level of * the user's workspace but had been moved to the top level some time * after created. * * To always get the top level pages of the user's workspace, * use {@link Agent.loadUserContent}. */ getUserSharedPages: (req: API.GetUserSharedPages.Request) => Promise; /** * POST /api/v3/loadPageChunk * * Load some data related to a page. */ loadPageChunk: (req: API.LoadPageChunk.Request) => Promise; /** * POST /api/v3/loadUserContent * * Get top level page blocks (`block` in * {@link LoadUserContent.Response.recordMap}), * user information, and workspace information. */ loadUserContent: (req: API.LoadUserContent.Request) => Promise; /** * POST /api/v3/queryCollection * * Query a collection by id, view id, * with aggregate, filter, sort functions. * * To configure aggregate, filter, sort parameters, see * {@link QueryCollection.Request.query}. * * Set `limit` in {@link QueryCollection.Request.loader} * to limit maximum number of items in response data. */ queryCollection: (req: API.QueryCollection.Request) => Promise; /** * POST /api/v3/submitTransaction * * Make changes to documents and settings. */ submitTransaction: (req: API.SubmitTransaction.Request) => Promise; /** * POST /api/v3/syncRecordValues * * Get record values for array of record ids */ syncRecordValues: (req: API.SyncRecordValues.Request) => Promise; } /** * Create a Notion API agent. * @param opts A config object. * * @category Library */ export declare function createAgent(opts?: CreateAgentOptions): Agent; //# sourceMappingURL=agent.d.ts.map