@notionhq/client 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/build/package.json +1 -1
- package/build/src/Client.d.ts +5 -1
- package/build/src/Client.d.ts.map +1 -1
- package/build/src/Client.js +12 -0
- package/build/src/Client.js.map +1 -1
- package/build/src/api-endpoints.d.ts +11 -1
- package/build/src/api-endpoints.d.ts.map +1 -1
- package/build/src/api-endpoints.js +1 -0
- package/build/src/api-endpoints.js.map +1 -1
- package/build/src/index.d.ts +1 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -320,6 +320,14 @@ In some cases, due to backwards-incompatible changes across [Notion API versions
|
|
|
320
320
|
|
|
321
321
|
In these cases, we recommend upgrading your Notion API version header using the `Client()` constructor across all of your requests before upgrading to a newer version of the SDK.
|
|
322
322
|
|
|
323
|
+
## Contributing
|
|
324
|
+
|
|
325
|
+
While we value open-source contributions to this SDK, most of the client code is generated programmatically from the Notion API specification. Additions made directly to `src/api-endpoints.ts` or other generated code would be overwritten upon the next release.
|
|
326
|
+
|
|
327
|
+
If you'd like to contribute a feature or fix to the SDK's core functionality, we suggest opening an issue first to discuss it with us. This helps ensure your effort aligns with how the SDK is maintained.
|
|
328
|
+
|
|
329
|
+
However, contributions to documentation (including this README), examples, and bug reports are always welcome and greatly appreciated!
|
|
330
|
+
|
|
323
331
|
## Getting help
|
|
324
332
|
|
|
325
333
|
If you want to submit a feature request for Notion's API, or are experiencing any issues with the API platform, please email us at `developers@makenotion.com`.
|
package/build/package.json
CHANGED
package/build/src/Client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Agent } from "node:http";
|
|
2
2
|
import { type Logger, LogLevel } from "./logging";
|
|
3
|
-
import { type GetBlockParameters, type GetBlockResponse, type UpdateBlockParameters, type UpdateBlockResponse, type DeleteBlockParameters, type DeleteBlockResponse, type AppendBlockChildrenParameters, type AppendBlockChildrenResponse, type ListBlockChildrenParameters, type ListBlockChildrenResponse, type QueryDataSourceParameters, type QueryDataSourceResponse, type CreateDataSourceParameters, type CreateDataSourceResponse, type UpdateDataSourceParameters, type UpdateDataSourceResponse, type GetDataSourceParameters, type GetDataSourceResponse, type CreatePageParameters, type CreatePageResponse, type GetPageParameters, type GetPageResponse, type UpdatePageParameters, type UpdatePageResponse, type GetUserParameters, type GetUserResponse, type ListUsersParameters, type ListUsersResponse, type SearchParameters, type SearchResponse, type GetSelfParameters, type GetSelfResponse, type GetPagePropertyParameters, type GetPagePropertyResponse, type CreateCommentParameters, type CreateCommentResponse, type ListCommentsParameters, type ListCommentsResponse, type GetCommentParameters, type GetCommentResponse, type OauthTokenResponse, type OauthTokenParameters, type OauthIntrospectResponse, type OauthIntrospectParameters, type OauthRevokeResponse, type OauthRevokeParameters, type CreateFileUploadParameters, type CreateFileUploadResponse, type GetFileUploadResponse, type GetFileUploadParameters, type SendFileUploadParameters, type SendFileUploadResponse, type CompleteFileUploadParameters, type CompleteFileUploadResponse, type ListFileUploadsParameters, type ListFileUploadsResponse, GetDatabaseParameters, GetDatabaseResponse, CreateDatabaseResponse, CreateDatabaseParameters, UpdateDatabaseParameters, UpdateDatabaseResponse, ListDataSourceTemplatesResponse, ListDataSourceTemplatesParameters } from "./api-endpoints";
|
|
3
|
+
import { type GetBlockParameters, type GetBlockResponse, type UpdateBlockParameters, type UpdateBlockResponse, type DeleteBlockParameters, type DeleteBlockResponse, type AppendBlockChildrenParameters, type AppendBlockChildrenResponse, type ListBlockChildrenParameters, type ListBlockChildrenResponse, type QueryDataSourceParameters, type QueryDataSourceResponse, type CreateDataSourceParameters, type CreateDataSourceResponse, type UpdateDataSourceParameters, type UpdateDataSourceResponse, type GetDataSourceParameters, type GetDataSourceResponse, type CreatePageParameters, type CreatePageResponse, type GetPageParameters, type GetPageResponse, type UpdatePageParameters, type UpdatePageResponse, type MovePageParameters, type MovePageResponse, type GetUserParameters, type GetUserResponse, type ListUsersParameters, type ListUsersResponse, type SearchParameters, type SearchResponse, type GetSelfParameters, type GetSelfResponse, type GetPagePropertyParameters, type GetPagePropertyResponse, type CreateCommentParameters, type CreateCommentResponse, type ListCommentsParameters, type ListCommentsResponse, type GetCommentParameters, type GetCommentResponse, type OauthTokenResponse, type OauthTokenParameters, type OauthIntrospectResponse, type OauthIntrospectParameters, type OauthRevokeResponse, type OauthRevokeParameters, type CreateFileUploadParameters, type CreateFileUploadResponse, type GetFileUploadResponse, type GetFileUploadParameters, type SendFileUploadParameters, type SendFileUploadResponse, type CompleteFileUploadParameters, type CompleteFileUploadResponse, type ListFileUploadsParameters, type ListFileUploadsResponse, GetDatabaseParameters, GetDatabaseResponse, CreateDatabaseResponse, CreateDatabaseParameters, UpdateDatabaseParameters, UpdateDatabaseResponse, ListDataSourceTemplatesResponse, ListDataSourceTemplatesParameters } from "./api-endpoints";
|
|
4
4
|
import type { SupportedFetch } from "./fetch-types";
|
|
5
5
|
export interface ClientOptions {
|
|
6
6
|
auth?: string;
|
|
@@ -115,6 +115,10 @@ export default class Client {
|
|
|
115
115
|
* Update page properties
|
|
116
116
|
*/
|
|
117
117
|
update: (args: WithAuth<UpdatePageParameters>) => Promise<UpdatePageResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Move a page
|
|
120
|
+
*/
|
|
121
|
+
move: (args: WithAuth<MovePageParameters>) => Promise<MovePageResponse>;
|
|
118
122
|
properties: {
|
|
119
123
|
/**
|
|
120
124
|
* Retrieve page property
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EACL,KAAK,MAAM,EACX,QAAQ,EAGT,MAAM,WAAW,CAAA;AAQlB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAA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,GAAG,QAAQ,CAAA;AACjD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,eAAe,CAAA;AAE/E,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/build/src/Client.js
CHANGED
|
@@ -233,6 +233,18 @@ class Client {
|
|
|
233
233
|
auth: args === null || args === void 0 ? void 0 : args.auth,
|
|
234
234
|
});
|
|
235
235
|
},
|
|
236
|
+
/**
|
|
237
|
+
* Move a page
|
|
238
|
+
*/
|
|
239
|
+
move: (args) => {
|
|
240
|
+
return this.request({
|
|
241
|
+
path: api_endpoints_1.movePage.path(args),
|
|
242
|
+
method: api_endpoints_1.movePage.method,
|
|
243
|
+
query: (0, utils_1.pick)(args, api_endpoints_1.movePage.queryParams),
|
|
244
|
+
body: (0, utils_1.pick)(args, api_endpoints_1.movePage.bodyParams),
|
|
245
|
+
auth: args === null || args === void 0 ? void 0 : args.auth,
|
|
246
|
+
});
|
|
247
|
+
},
|
|
236
248
|
properties: {
|
|
237
249
|
/**
|
|
238
250
|
* Retrieve page property
|
package/build/src/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,uCAKkB;AAClB,qCAKiB;AACjB,mCAA8B;AAC9B,mDAiGwB;AACxB,kDAGwB;AAwCxB,MAAqB,MAAM;IAazB,YAAmB,OAAuB;;QAZ1C,+BAAc;QACd,mCAAmB;QACnB,iCAAe;QACf,oCAAkB;QAClB,oCAAkB;QAClB,wCAAsB;QACtB,gCAAsB;QACtB,gCAAyB;QACzB,oCAAkB;QAkJlB;;WAEG;QAEa,WAAM,GAAG;YACvB;;eAEG;YACH,QAAQ,EAAE,CACR,IAAkC,EACP,EAAE;gBAC7B,OAAO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A;IAChB,CAAC;;;AAtrBe,2BAAoB,GAAG,YAAY,AAAf,CAAe;kBAXhC,MAAM","sourcesContent":["import type { Agent } from \"node:http\"\nimport {\n type Logger,\n LogLevel,\n logLevelSeverity,\n makeConsoleLogger,\n} from \"./logging\"\nimport {\n buildRequestError,\n isHTTPResponseError,\n isNotionClientError,\n RequestTimeoutError,\n} from \"./errors\"\nimport { pick } from \"./utils\"\nimport {\n type GetBlockParameters,\n type GetBlockResponse,\n getBlock,\n type UpdateBlockParameters,\n type UpdateBlockResponse,\n updateBlock,\n type DeleteBlockParameters,\n type DeleteBlockResponse,\n deleteBlock,\n type AppendBlockChildrenParameters,\n type AppendBlockChildrenResponse,\n appendBlockChildren,\n type ListBlockChildrenParameters,\n type ListBlockChildrenResponse,\n listBlockChildren,\n type QueryDataSourceParameters,\n type QueryDataSourceResponse,\n queryDataSource,\n type CreateDataSourceParameters,\n type CreateDataSourceResponse,\n createDataSource,\n type UpdateDataSourceParameters,\n type UpdateDataSourceResponse,\n updateDataSource,\n type GetDataSourceParameters,\n type GetDataSourceResponse,\n getDataSource,\n type CreatePageParameters,\n type CreatePageResponse,\n createPage,\n type GetPageParameters,\n type GetPageResponse,\n getPage,\n type UpdatePageParameters,\n type UpdatePageResponse,\n updatePage,\n type GetUserParameters,\n type GetUserResponse,\n getUser,\n type ListUsersParameters,\n type ListUsersResponse,\n listUsers,\n type SearchParameters,\n type SearchResponse,\n search,\n type GetSelfParameters,\n type GetSelfResponse,\n getSelf,\n type GetPagePropertyParameters,\n type GetPagePropertyResponse,\n getPageProperty,\n type CreateCommentParameters,\n type CreateCommentResponse,\n createComment,\n type ListCommentsParameters,\n type ListCommentsResponse,\n listComments,\n type GetCommentParameters,\n type GetCommentResponse,\n getComment,\n type OauthTokenResponse,\n type OauthTokenParameters,\n oauthToken,\n type OauthIntrospectResponse,\n type OauthIntrospectParameters,\n oauthIntrospect,\n type OauthRevokeResponse,\n type OauthRevokeParameters,\n oauthRevoke,\n type CreateFileUploadParameters,\n type CreateFileUploadResponse,\n createFileUpload,\n type GetFileUploadResponse,\n type GetFileUploadParameters,\n getFileUpload,\n type SendFileUploadParameters,\n type SendFileUploadResponse,\n sendFileUpload,\n type CompleteFileUploadParameters,\n type CompleteFileUploadResponse,\n completeFileUpload,\n type ListFileUploadsParameters,\n type ListFileUploadsResponse,\n listFileUploads,\n GetDatabaseParameters,\n GetDatabaseResponse,\n getDatabase,\n CreateDatabaseResponse,\n CreateDatabaseParameters,\n createDatabase,\n UpdateDatabaseParameters,\n UpdateDatabaseResponse,\n updateDatabase,\n listDataSourceTemplates,\n ListDataSourceTemplatesResponse,\n ListDataSourceTemplatesParameters,\n} from \"./api-endpoints\"\nimport {\n version as PACKAGE_VERSION,\n name as PACKAGE_NAME,\n} from \"../package.json\"\nimport type { SupportedFetch } from \"./fetch-types\"\n\nexport interface ClientOptions {\n auth?: string\n timeoutMs?: number\n baseUrl?: string\n logLevel?: LogLevel\n logger?: Logger\n notionVersion?: string\n fetch?: SupportedFetch\n /** Silently ignored in the browser */\n agent?: Agent\n}\n\ntype FileParam = {\n filename?: string\n data: string | Blob\n}\n\nexport interface RequestParameters {\n path: string\n method: Method\n query?: QueryParams\n body?: Record<string, unknown>\n formDataParams?: Record<string, string | FileParam>\n headers?: Record<string, string>\n /**\n * To authenticate using public API token, `auth` should be passed as a\n * string. If you are trying to complete OAuth, then `auth` should be an object\n * containing your integration's client ID and secret.\n */\n auth?:\n | string\n | {\n client_id: string\n client_secret: string\n }\n}\n\nexport default class Client {\n #auth?: string\n #logLevel: LogLevel\n #logger: Logger\n #prefixUrl: string\n #timeoutMs: number\n #notionVersion: string\n #fetch: SupportedFetch\n #agent: Agent | undefined\n #userAgent: string\n\n static readonly defaultNotionVersion = \"2025-09-03\"\n\n public constructor(options?: ClientOptions) {\n this.#auth = options?.auth\n this.#logLevel = options?.logLevel ?? LogLevel.WARN\n this.#logger = options?.logger ?? makeConsoleLogger(PACKAGE_NAME)\n this.#prefixUrl = `${options?.baseUrl ?? \"https://api.notion.com\"}/v1/`\n this.#timeoutMs = options?.timeoutMs ?? 60_000\n this.#notionVersion = options?.notionVersion ?? Client.defaultNotionVersion\n this.#fetch = options?.fetch ?? fetch\n this.#agent = options?.agent\n this.#userAgent = `notionhq-client/${PACKAGE_VERSION}`\n }\n\n /**\n * Sends a request.\n */\n public async request<ResponseBody extends object>(\n args: RequestParameters\n ): Promise<ResponseBody> {\n const { path, method, query, body, formDataParams, auth } = args\n\n this.log(LogLevel.INFO, \"request start\", { method, path })\n\n // If the body is empty, don't send the body in the HTTP request\n const bodyAsJsonString =\n !body || Object.entries(body).length === 0\n ? undefined\n : JSON.stringify(body)\n\n const url = new URL(`${this.#prefixUrl}${path}`)\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined) {\n if (Array.isArray(value)) {\n for (const val of value) {\n url.searchParams.append(key, decodeURIComponent(val))\n }\n } else {\n url.searchParams.append(key, String(value))\n }\n }\n }\n }\n\n // Allow both client ID / client secret based auth as well as token based auth.\n let authorizationHeader: Record<string, string>\n if (typeof auth === \"object\") {\n // Client ID and secret based auth is **ONLY** supported when using the\n // `/oauth/token` endpoint. If this is the case, handle formatting the\n // authorization header as required by `Basic` auth.\n const unencodedCredential = `${auth.client_id}:${auth.client_secret}`\n const encodedCredential =\n Buffer.from(unencodedCredential).toString(\"base64\")\n authorizationHeader = { authorization: `Basic ${encodedCredential}` }\n } else {\n // Otherwise format authorization header as `Bearer` token auth.\n authorizationHeader = this.authAsHeaders(auth)\n }\n\n const headers: Record<string, string> = {\n // Request-level custom additional headers can be provided, but\n // don't allow them to override all other headers, e.g. the\n // standard user agent.\n ...args.headers,\n ...authorizationHeader,\n \"Notion-Version\": this.#notionVersion,\n \"user-agent\": this.#userAgent,\n }\n\n if (bodyAsJsonString !== undefined) {\n headers[\"content-type\"] = \"application/json\"\n }\n\n let formData: FormData | undefined\n if (formDataParams) {\n delete headers[\"content-type\"]\n\n formData = new FormData()\n for (const [key, value] of Object.entries(formDataParams)) {\n if (typeof value === \"string\") {\n formData.append(key, value)\n } else if (typeof value === \"object\") {\n formData.append(\n key,\n typeof value.data === \"object\"\n ? value.data\n : new Blob([value.data]),\n value.filename\n )\n }\n }\n }\n\n try {\n const response = await RequestTimeoutError.rejectAfterTimeout(\n this.#fetch(url.toString(), {\n method: method.toUpperCase(),\n headers,\n body: bodyAsJsonString ?? formData,\n agent: this.#agent,\n }),\n this.#timeoutMs\n )\n\n const responseText = await response.text()\n if (!response.ok) {\n throw buildRequestError(response, responseText)\n }\n\n const responseJson: ResponseBody = JSON.parse(responseText)\n this.log(LogLevel.INFO, \"request success\", {\n method,\n path,\n ...(\"request_id\" in responseJson && responseJson.request_id\n ? { requestId: responseJson.request_id }\n : {}),\n })\n return responseJson\n } catch (error: unknown) {\n if (!isNotionClientError(error)) {\n throw error\n }\n\n // Log the error if it's one of our known error types\n this.log(LogLevel.WARN, \"request fail\", {\n code: error.code,\n message: error.message,\n ...(\"request_id\" in error && error.request_id\n ? { requestId: error.request_id }\n : {}),\n })\n\n if (isHTTPResponseError(error)) {\n // The response body may contain sensitive information so it is logged separately at the DEBUG level\n this.log(LogLevel.DEBUG, \"failed response body\", {\n body: error.body,\n })\n }\n\n throw error\n }\n }\n\n /*\n * Notion API endpoints\n */\n\n public readonly blocks = {\n /**\n * Retrieve block\n */\n retrieve: (\n args: WithAuth<GetBlockParameters>\n ): Promise<GetBlockResponse> => {\n return this.request<GetBlockResponse>({\n path: getBlock.path(args),\n method: getBlock.method,\n query: pick(args, getBlock.queryParams),\n body: pick(args, getBlock.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update block\n */\n update: (\n args: WithAuth<UpdateBlockParameters>\n ): Promise<UpdateBlockResponse> => {\n return this.request<UpdateBlockResponse>({\n path: updateBlock.path(args),\n method: updateBlock.method,\n query: pick(args, updateBlock.queryParams),\n body: pick(args, updateBlock.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Delete block\n */\n delete: (\n args: WithAuth<DeleteBlockParameters>\n ): Promise<DeleteBlockResponse> => {\n return this.request<DeleteBlockResponse>({\n path: deleteBlock.path(args),\n method: deleteBlock.method,\n query: pick(args, deleteBlock.queryParams),\n body: pick(args, deleteBlock.bodyParams),\n auth: args?.auth,\n })\n },\n children: {\n /**\n * Append block children\n */\n append: (\n args: WithAuth<AppendBlockChildrenParameters>\n ): Promise<AppendBlockChildrenResponse> => {\n return this.request<AppendBlockChildrenResponse>({\n path: appendBlockChildren.path(args),\n method: appendBlockChildren.method,\n query: pick(args, appendBlockChildren.queryParams),\n body: pick(args, appendBlockChildren.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve block children\n */\n list: (\n args: WithAuth<ListBlockChildrenParameters>\n ): Promise<ListBlockChildrenResponse> => {\n return this.request<ListBlockChildrenResponse>({\n path: listBlockChildren.path(args),\n method: listBlockChildren.method,\n query: pick(args, listBlockChildren.queryParams),\n body: pick(args, listBlockChildren.bodyParams),\n auth: args?.auth,\n })\n },\n },\n }\n\n public readonly databases = {\n /**\n * Retrieve a database\n */\n retrieve: (\n args: WithAuth<GetDatabaseParameters>\n ): Promise<GetDatabaseResponse> => {\n return this.request<GetDatabaseResponse>({\n path: getDatabase.path(args),\n method: getDatabase.method,\n query: pick(args, getDatabase.queryParams),\n body: pick(args, getDatabase.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Create a database\n */\n create: (\n args: WithAuth<CreateDatabaseParameters>\n ): Promise<CreateDatabaseResponse> => {\n return this.request<CreateDatabaseResponse>({\n path: createDatabase.path(),\n method: createDatabase.method,\n query: pick(args, createDatabase.queryParams),\n body: pick(args, createDatabase.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update a database\n */\n update: (\n args: WithAuth<UpdateDatabaseParameters>\n ): Promise<UpdateDatabaseResponse> => {\n return this.request<UpdateDatabaseResponse>({\n path: updateDatabase.path(args),\n method: updateDatabase.method,\n query: pick(args, updateDatabase.queryParams),\n body: pick(args, updateDatabase.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly dataSources = {\n /**\n * Retrieve a data source\n */\n retrieve: (\n args: WithAuth<GetDataSourceParameters>\n ): Promise<GetDataSourceResponse> => {\n return this.request<GetDataSourceResponse>({\n path: getDataSource.path(args),\n method: getDataSource.method,\n query: pick(args, getDataSource.queryParams),\n body: pick(args, getDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Query a data source\n */\n query: (\n args: WithAuth<QueryDataSourceParameters>\n ): Promise<QueryDataSourceResponse> => {\n return this.request<QueryDataSourceResponse>({\n path: queryDataSource.path(args),\n method: queryDataSource.method,\n query: pick(args, queryDataSource.queryParams),\n body: pick(args, queryDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Create a data source\n */\n create: (\n args: WithAuth<CreateDataSourceParameters>\n ): Promise<CreateDataSourceResponse> => {\n return this.request<CreateDataSourceResponse>({\n path: createDataSource.path(),\n method: createDataSource.method,\n query: pick(args, createDataSource.queryParams),\n body: pick(args, createDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update a data source\n */\n update: (\n args: WithAuth<UpdateDataSourceParameters>\n ): Promise<UpdateDataSourceResponse> => {\n return this.request<UpdateDataSourceResponse>({\n path: updateDataSource.path(args),\n method: updateDataSource.method,\n query: pick(args, updateDataSource.queryParams),\n body: pick(args, updateDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List page templates that are available for a data source\n */\n listTemplates: (\n args: WithAuth<ListDataSourceTemplatesParameters>\n ): Promise<ListDataSourceTemplatesResponse> => {\n return this.request<ListDataSourceTemplatesResponse>({\n path: listDataSourceTemplates.path(args),\n method: listDataSourceTemplates.method,\n query: pick(args, listDataSourceTemplates.queryParams),\n body: pick(args, listDataSourceTemplates.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly pages = {\n /**\n * Create a page\n */\n create: (\n args: WithAuth<CreatePageParameters>\n ): Promise<CreatePageResponse> => {\n return this.request<CreatePageResponse>({\n path: createPage.path(),\n method: createPage.method,\n query: pick(args, createPage.queryParams),\n body: pick(args, createPage.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve a page\n */\n retrieve: (args: WithAuth<GetPageParameters>): Promise<GetPageResponse> => {\n return this.request<GetPageResponse>({\n path: getPage.path(args),\n method: getPage.method,\n query: pick(args, getPage.queryParams),\n body: pick(args, getPage.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update page properties\n */\n update: (\n args: WithAuth<UpdatePageParameters>\n ): Promise<UpdatePageResponse> => {\n return this.request<UpdatePageResponse>({\n path: updatePage.path(args),\n method: updatePage.method,\n query: pick(args, updatePage.queryParams),\n body: pick(args, updatePage.bodyParams),\n auth: args?.auth,\n })\n },\n properties: {\n /**\n * Retrieve page property\n */\n retrieve: (\n args: WithAuth<GetPagePropertyParameters>\n ): Promise<GetPagePropertyResponse> => {\n return this.request<GetPagePropertyResponse>({\n path: getPageProperty.path(args),\n method: getPageProperty.method,\n query: pick(args, getPageProperty.queryParams),\n body: pick(args, getPageProperty.bodyParams),\n auth: args?.auth,\n })\n },\n },\n }\n\n public readonly users = {\n /**\n * Retrieve a user\n */\n retrieve: (args: WithAuth<GetUserParameters>): Promise<GetUserResponse> => {\n return this.request<GetUserResponse>({\n path: getUser.path(args),\n method: getUser.method,\n query: pick(args, getUser.queryParams),\n body: pick(args, getUser.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List all users\n */\n list: (args: WithAuth<ListUsersParameters>): Promise<ListUsersResponse> => {\n return this.request<ListUsersResponse>({\n path: listUsers.path(),\n method: listUsers.method,\n query: pick(args, listUsers.queryParams),\n body: pick(args, listUsers.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Get details about bot\n */\n me: (args: WithAuth<GetSelfParameters>): Promise<GetSelfResponse> => {\n return this.request<GetSelfResponse>({\n path: getSelf.path(),\n method: getSelf.method,\n query: pick(args, getSelf.queryParams),\n body: pick(args, getSelf.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly comments = {\n /**\n * Create a comment\n */\n create: (\n args: WithAuth<CreateCommentParameters>\n ): Promise<CreateCommentResponse> => {\n return this.request<CreateCommentResponse>({\n path: createComment.path(),\n method: createComment.method,\n query: pick(args, createComment.queryParams),\n body: pick(args, createComment.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List comments\n */\n list: (\n args: WithAuth<ListCommentsParameters>\n ): Promise<ListCommentsResponse> => {\n return this.request<ListCommentsResponse>({\n path: listComments.path(),\n method: listComments.method,\n query: pick(args, listComments.queryParams),\n body: pick(args, listComments.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve a comment\n */\n retrieve: (\n args: WithAuth<GetCommentParameters>\n ): Promise<GetCommentResponse> => {\n return this.request<GetCommentResponse>({\n path: getComment.path(args),\n method: getComment.method,\n query: pick(args, getComment.queryParams),\n body: pick(args, getComment.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly fileUploads = {\n /**\n * Create a file upload\n */\n create: (\n args: WithAuth<CreateFileUploadParameters>\n ): Promise<CreateFileUploadResponse> => {\n return this.request<CreateFileUploadResponse>({\n path: createFileUpload.path(),\n method: createFileUpload.method,\n query: pick(args, createFileUpload.queryParams),\n body: pick(args, createFileUpload.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve a file upload\n */\n retrieve: (\n args: WithAuth<GetFileUploadParameters>\n ): Promise<GetFileUploadResponse> => {\n return this.request<GetFileUploadResponse>({\n path: getFileUpload.path(args),\n method: getFileUpload.method,\n query: pick(args, getFileUpload.queryParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List file uploads\n */\n list: (\n args: WithAuth<ListFileUploadsParameters>\n ): Promise<ListFileUploadsResponse> => {\n return this.request<ListFileUploadsResponse>({\n path: listFileUploads.path(),\n method: listFileUploads.method,\n query: pick(args, listFileUploads.queryParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Send a file upload\n *\n * Requires a `file_upload_id`, obtained from the `id` of the Create File\n * Upload API response.\n *\n * The `file` parameter contains the raw file contents or Blob/File object\n * under `file.data`, and an optional `file.filename` string.\n *\n * Supply a stringified `part_number` parameter when using file uploads\n * in multi-part mode.\n *\n * This endpoint sends HTTP multipart/form-data instead of JSON parameters.\n */\n send: (\n args: WithAuth<SendFileUploadParameters>\n ): Promise<SendFileUploadResponse> => {\n return this.request<SendFileUploadResponse>({\n path: sendFileUpload.path(args),\n method: sendFileUpload.method,\n query: pick(args, sendFileUpload.queryParams),\n formDataParams: pick(args, sendFileUpload.formDataParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Complete a file upload\n */\n complete: (\n args: WithAuth<CompleteFileUploadParameters>\n ): Promise<CompleteFileUploadResponse> => {\n return this.request<CompleteFileUploadResponse>({\n path: completeFileUpload.path(args),\n method: completeFileUpload.method,\n query: pick(args, completeFileUpload.queryParams),\n auth: args?.auth,\n })\n },\n }\n\n /**\n * Search\n */\n public search = (\n args: WithAuth<SearchParameters>\n ): Promise<SearchResponse> => {\n return this.request<SearchResponse>({\n path: search.path(),\n method: search.method,\n query: pick(args, search.queryParams),\n body: pick(args, search.bodyParams),\n auth: args?.auth,\n })\n }\n\n public readonly oauth = {\n /**\n * Get token\n */\n token: (\n args: OauthTokenParameters & {\n client_id: string\n client_secret: string\n }\n ): Promise<OauthTokenResponse> => {\n return this.request<OauthTokenResponse>({\n path: oauthToken.path(),\n method: oauthToken.method,\n query: pick(args, oauthToken.queryParams),\n body: pick(args, oauthToken.bodyParams),\n auth: {\n client_id: args.client_id,\n client_secret: args.client_secret,\n },\n })\n },\n /**\n * Introspect token\n */\n introspect: (\n args: OauthIntrospectParameters & {\n client_id: string\n client_secret: string\n }\n ): Promise<OauthIntrospectResponse> => {\n return this.request<OauthIntrospectResponse>({\n path: oauthIntrospect.path(),\n method: oauthIntrospect.method,\n query: pick(args, oauthIntrospect.queryParams),\n body: pick(args, oauthIntrospect.bodyParams),\n auth: {\n client_id: args.client_id,\n client_secret: args.client_secret,\n },\n })\n },\n /**\n * Revoke token\n */\n revoke: (\n args: OauthRevokeParameters & {\n client_id: string\n client_secret: string\n }\n ): Promise<OauthRevokeResponse> => {\n return this.request<OauthRevokeResponse>({\n path: oauthRevoke.path(),\n method: oauthRevoke.method,\n query: pick(args, oauthRevoke.queryParams),\n body: pick(args, oauthRevoke.bodyParams),\n auth: {\n client_id: args.client_id,\n client_secret: args.client_secret,\n },\n })\n },\n }\n\n /**\n * Emits a log message to the console.\n *\n * @param level The level for this message\n * @param args Arguments to send to the console\n */\n private log(\n level: LogLevel,\n message: string,\n extraInfo: Record<string, unknown>\n ) {\n if (logLevelSeverity(level) >= logLevelSeverity(this.#logLevel)) {\n this.#logger(level, message, extraInfo)\n }\n }\n\n /**\n * Transforms an API key or access token into a headers object suitable for an HTTP request.\n *\n * This method uses the instance's value as the default when the input is undefined. If neither are defined, it returns\n * an empty object\n *\n * @param auth API key or access token\n * @returns headers key-value object\n */\n private authAsHeaders(auth?: string): Record<string, string> {\n const headers: Record<string, string> = {}\n const authHeaderValue = auth ?? this.#auth\n if (authHeaderValue !== undefined) {\n headers[\"authorization\"] = `Bearer ${authHeaderValue}`\n }\n return headers\n }\n}\n\n/*\n * Type aliases to support the generic request interface.\n */\ntype Method = \"get\" | \"post\" | \"patch\" | \"delete\"\ntype QueryParams = Record<string, string | number | string[]> | URLSearchParams\n\ntype WithAuth<P> = P & { auth?: string }\n"]}
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,uCAKkB;AAClB,qCAKiB;AACjB,mCAA8B;AAC9B,mDAoGwB;AACxB,kDAGwB;AAwCxB,MAAqB,MAAM;IAazB,YAAmB,OAAuB;;QAZ1C,+BAAc;QACd,mCAAmB;QACnB,iCAAe;QACf,oCAAkB;QAClB,oCAAkB;QAClB,wCAAsB;QACtB,gCAAsB;QACtB,gCAAyB;QACzB,oCAAkB;QAkJlB;;WAEG;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ElC,IAAI,IAAA,0BAAgB,EAAC,KAAK,CAAC,IAAI,IAAA,0BAAgB,EAAC,uBAAA,IAAI,wBAAU,CAAC,EAAE,CAAC;YAChE,uBAAA,IAAI,sBAAQ,MAAZ,IAAI,EAAS,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACK,aAAa,CAAC,IAAa;QACjC,MAAM,OAAO,GAA2B,EAAE,CAAA;QAC1C,MAAM,eAAe,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,uBAAA,IAAI,oBAAM,CAAA;QAC1C,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAClC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,eAAe,EAAE,CAAA;QACxD,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;;;AAnsBe,2BAAoB,GAAG,YAAY,AAAf,CAAe;kBAXhC,MAAM","sourcesContent":["import type { Agent } from \"node:http\"\nimport {\n type Logger,\n LogLevel,\n logLevelSeverity,\n makeConsoleLogger,\n} from \"./logging\"\nimport {\n buildRequestError,\n isHTTPResponseError,\n isNotionClientError,\n RequestTimeoutError,\n} from \"./errors\"\nimport { pick } from \"./utils\"\nimport {\n type GetBlockParameters,\n type GetBlockResponse,\n getBlock,\n type UpdateBlockParameters,\n type UpdateBlockResponse,\n updateBlock,\n type DeleteBlockParameters,\n type DeleteBlockResponse,\n deleteBlock,\n type AppendBlockChildrenParameters,\n type AppendBlockChildrenResponse,\n appendBlockChildren,\n type ListBlockChildrenParameters,\n type ListBlockChildrenResponse,\n listBlockChildren,\n type QueryDataSourceParameters,\n type QueryDataSourceResponse,\n queryDataSource,\n type CreateDataSourceParameters,\n type CreateDataSourceResponse,\n createDataSource,\n type UpdateDataSourceParameters,\n type UpdateDataSourceResponse,\n updateDataSource,\n type GetDataSourceParameters,\n type GetDataSourceResponse,\n getDataSource,\n type CreatePageParameters,\n type CreatePageResponse,\n createPage,\n type GetPageParameters,\n type GetPageResponse,\n getPage,\n type UpdatePageParameters,\n type UpdatePageResponse,\n updatePage,\n type MovePageParameters,\n type MovePageResponse,\n movePage,\n type GetUserParameters,\n type GetUserResponse,\n getUser,\n type ListUsersParameters,\n type ListUsersResponse,\n listUsers,\n type SearchParameters,\n type SearchResponse,\n search,\n type GetSelfParameters,\n type GetSelfResponse,\n getSelf,\n type GetPagePropertyParameters,\n type GetPagePropertyResponse,\n getPageProperty,\n type CreateCommentParameters,\n type CreateCommentResponse,\n createComment,\n type ListCommentsParameters,\n type ListCommentsResponse,\n listComments,\n type GetCommentParameters,\n type GetCommentResponse,\n getComment,\n type OauthTokenResponse,\n type OauthTokenParameters,\n oauthToken,\n type OauthIntrospectResponse,\n type OauthIntrospectParameters,\n oauthIntrospect,\n type OauthRevokeResponse,\n type OauthRevokeParameters,\n oauthRevoke,\n type CreateFileUploadParameters,\n type CreateFileUploadResponse,\n createFileUpload,\n type GetFileUploadResponse,\n type GetFileUploadParameters,\n getFileUpload,\n type SendFileUploadParameters,\n type SendFileUploadResponse,\n sendFileUpload,\n type CompleteFileUploadParameters,\n type CompleteFileUploadResponse,\n completeFileUpload,\n type ListFileUploadsParameters,\n type ListFileUploadsResponse,\n listFileUploads,\n GetDatabaseParameters,\n GetDatabaseResponse,\n getDatabase,\n CreateDatabaseResponse,\n CreateDatabaseParameters,\n createDatabase,\n UpdateDatabaseParameters,\n UpdateDatabaseResponse,\n updateDatabase,\n listDataSourceTemplates,\n ListDataSourceTemplatesResponse,\n ListDataSourceTemplatesParameters,\n} from \"./api-endpoints\"\nimport {\n version as PACKAGE_VERSION,\n name as PACKAGE_NAME,\n} from \"../package.json\"\nimport type { SupportedFetch } from \"./fetch-types\"\n\nexport interface ClientOptions {\n auth?: string\n timeoutMs?: number\n baseUrl?: string\n logLevel?: LogLevel\n logger?: Logger\n notionVersion?: string\n fetch?: SupportedFetch\n /** Silently ignored in the browser */\n agent?: Agent\n}\n\ntype FileParam = {\n filename?: string\n data: string | Blob\n}\n\nexport interface RequestParameters {\n path: string\n method: Method\n query?: QueryParams\n body?: Record<string, unknown>\n formDataParams?: Record<string, string | FileParam>\n headers?: Record<string, string>\n /**\n * To authenticate using public API token, `auth` should be passed as a\n * string. If you are trying to complete OAuth, then `auth` should be an object\n * containing your integration's client ID and secret.\n */\n auth?:\n | string\n | {\n client_id: string\n client_secret: string\n }\n}\n\nexport default class Client {\n #auth?: string\n #logLevel: LogLevel\n #logger: Logger\n #prefixUrl: string\n #timeoutMs: number\n #notionVersion: string\n #fetch: SupportedFetch\n #agent: Agent | undefined\n #userAgent: string\n\n static readonly defaultNotionVersion = \"2025-09-03\"\n\n public constructor(options?: ClientOptions) {\n this.#auth = options?.auth\n this.#logLevel = options?.logLevel ?? LogLevel.WARN\n this.#logger = options?.logger ?? makeConsoleLogger(PACKAGE_NAME)\n this.#prefixUrl = `${options?.baseUrl ?? \"https://api.notion.com\"}/v1/`\n this.#timeoutMs = options?.timeoutMs ?? 60_000\n this.#notionVersion = options?.notionVersion ?? Client.defaultNotionVersion\n this.#fetch = options?.fetch ?? fetch\n this.#agent = options?.agent\n this.#userAgent = `notionhq-client/${PACKAGE_VERSION}`\n }\n\n /**\n * Sends a request.\n */\n public async request<ResponseBody extends object>(\n args: RequestParameters\n ): Promise<ResponseBody> {\n const { path, method, query, body, formDataParams, auth } = args\n\n this.log(LogLevel.INFO, \"request start\", { method, path })\n\n // If the body is empty, don't send the body in the HTTP request\n const bodyAsJsonString =\n !body || Object.entries(body).length === 0\n ? undefined\n : JSON.stringify(body)\n\n const url = new URL(`${this.#prefixUrl}${path}`)\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined) {\n if (Array.isArray(value)) {\n for (const val of value) {\n url.searchParams.append(key, decodeURIComponent(val))\n }\n } else {\n url.searchParams.append(key, String(value))\n }\n }\n }\n }\n\n // Allow both client ID / client secret based auth as well as token based auth.\n let authorizationHeader: Record<string, string>\n if (typeof auth === \"object\") {\n // Client ID and secret based auth is **ONLY** supported when using the\n // `/oauth/token` endpoint. If this is the case, handle formatting the\n // authorization header as required by `Basic` auth.\n const unencodedCredential = `${auth.client_id}:${auth.client_secret}`\n const encodedCredential =\n Buffer.from(unencodedCredential).toString(\"base64\")\n authorizationHeader = { authorization: `Basic ${encodedCredential}` }\n } else {\n // Otherwise format authorization header as `Bearer` token auth.\n authorizationHeader = this.authAsHeaders(auth)\n }\n\n const headers: Record<string, string> = {\n // Request-level custom additional headers can be provided, but\n // don't allow them to override all other headers, e.g. the\n // standard user agent.\n ...args.headers,\n ...authorizationHeader,\n \"Notion-Version\": this.#notionVersion,\n \"user-agent\": this.#userAgent,\n }\n\n if (bodyAsJsonString !== undefined) {\n headers[\"content-type\"] = \"application/json\"\n }\n\n let formData: FormData | undefined\n if (formDataParams) {\n delete headers[\"content-type\"]\n\n formData = new FormData()\n for (const [key, value] of Object.entries(formDataParams)) {\n if (typeof value === \"string\") {\n formData.append(key, value)\n } else if (typeof value === \"object\") {\n formData.append(\n key,\n typeof value.data === \"object\"\n ? value.data\n : new Blob([value.data]),\n value.filename\n )\n }\n }\n }\n\n try {\n const response = await RequestTimeoutError.rejectAfterTimeout(\n this.#fetch(url.toString(), {\n method: method.toUpperCase(),\n headers,\n body: bodyAsJsonString ?? formData,\n agent: this.#agent,\n }),\n this.#timeoutMs\n )\n\n const responseText = await response.text()\n if (!response.ok) {\n throw buildRequestError(response, responseText)\n }\n\n const responseJson: ResponseBody = JSON.parse(responseText)\n this.log(LogLevel.INFO, \"request success\", {\n method,\n path,\n ...(\"request_id\" in responseJson && responseJson.request_id\n ? { requestId: responseJson.request_id }\n : {}),\n })\n return responseJson\n } catch (error: unknown) {\n if (!isNotionClientError(error)) {\n throw error\n }\n\n // Log the error if it's one of our known error types\n this.log(LogLevel.WARN, \"request fail\", {\n code: error.code,\n message: error.message,\n ...(\"request_id\" in error && error.request_id\n ? { requestId: error.request_id }\n : {}),\n })\n\n if (isHTTPResponseError(error)) {\n // The response body may contain sensitive information so it is logged separately at the DEBUG level\n this.log(LogLevel.DEBUG, \"failed response body\", {\n body: error.body,\n })\n }\n\n throw error\n }\n }\n\n /*\n * Notion API endpoints\n */\n\n public readonly blocks = {\n /**\n * Retrieve block\n */\n retrieve: (\n args: WithAuth<GetBlockParameters>\n ): Promise<GetBlockResponse> => {\n return this.request<GetBlockResponse>({\n path: getBlock.path(args),\n method: getBlock.method,\n query: pick(args, getBlock.queryParams),\n body: pick(args, getBlock.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update block\n */\n update: (\n args: WithAuth<UpdateBlockParameters>\n ): Promise<UpdateBlockResponse> => {\n return this.request<UpdateBlockResponse>({\n path: updateBlock.path(args),\n method: updateBlock.method,\n query: pick(args, updateBlock.queryParams),\n body: pick(args, updateBlock.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Delete block\n */\n delete: (\n args: WithAuth<DeleteBlockParameters>\n ): Promise<DeleteBlockResponse> => {\n return this.request<DeleteBlockResponse>({\n path: deleteBlock.path(args),\n method: deleteBlock.method,\n query: pick(args, deleteBlock.queryParams),\n body: pick(args, deleteBlock.bodyParams),\n auth: args?.auth,\n })\n },\n children: {\n /**\n * Append block children\n */\n append: (\n args: WithAuth<AppendBlockChildrenParameters>\n ): Promise<AppendBlockChildrenResponse> => {\n return this.request<AppendBlockChildrenResponse>({\n path: appendBlockChildren.path(args),\n method: appendBlockChildren.method,\n query: pick(args, appendBlockChildren.queryParams),\n body: pick(args, appendBlockChildren.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve block children\n */\n list: (\n args: WithAuth<ListBlockChildrenParameters>\n ): Promise<ListBlockChildrenResponse> => {\n return this.request<ListBlockChildrenResponse>({\n path: listBlockChildren.path(args),\n method: listBlockChildren.method,\n query: pick(args, listBlockChildren.queryParams),\n body: pick(args, listBlockChildren.bodyParams),\n auth: args?.auth,\n })\n },\n },\n }\n\n public readonly databases = {\n /**\n * Retrieve a database\n */\n retrieve: (\n args: WithAuth<GetDatabaseParameters>\n ): Promise<GetDatabaseResponse> => {\n return this.request<GetDatabaseResponse>({\n path: getDatabase.path(args),\n method: getDatabase.method,\n query: pick(args, getDatabase.queryParams),\n body: pick(args, getDatabase.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Create a database\n */\n create: (\n args: WithAuth<CreateDatabaseParameters>\n ): Promise<CreateDatabaseResponse> => {\n return this.request<CreateDatabaseResponse>({\n path: createDatabase.path(),\n method: createDatabase.method,\n query: pick(args, createDatabase.queryParams),\n body: pick(args, createDatabase.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update a database\n */\n update: (\n args: WithAuth<UpdateDatabaseParameters>\n ): Promise<UpdateDatabaseResponse> => {\n return this.request<UpdateDatabaseResponse>({\n path: updateDatabase.path(args),\n method: updateDatabase.method,\n query: pick(args, updateDatabase.queryParams),\n body: pick(args, updateDatabase.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly dataSources = {\n /**\n * Retrieve a data source\n */\n retrieve: (\n args: WithAuth<GetDataSourceParameters>\n ): Promise<GetDataSourceResponse> => {\n return this.request<GetDataSourceResponse>({\n path: getDataSource.path(args),\n method: getDataSource.method,\n query: pick(args, getDataSource.queryParams),\n body: pick(args, getDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Query a data source\n */\n query: (\n args: WithAuth<QueryDataSourceParameters>\n ): Promise<QueryDataSourceResponse> => {\n return this.request<QueryDataSourceResponse>({\n path: queryDataSource.path(args),\n method: queryDataSource.method,\n query: pick(args, queryDataSource.queryParams),\n body: pick(args, queryDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Create a data source\n */\n create: (\n args: WithAuth<CreateDataSourceParameters>\n ): Promise<CreateDataSourceResponse> => {\n return this.request<CreateDataSourceResponse>({\n path: createDataSource.path(),\n method: createDataSource.method,\n query: pick(args, createDataSource.queryParams),\n body: pick(args, createDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update a data source\n */\n update: (\n args: WithAuth<UpdateDataSourceParameters>\n ): Promise<UpdateDataSourceResponse> => {\n return this.request<UpdateDataSourceResponse>({\n path: updateDataSource.path(args),\n method: updateDataSource.method,\n query: pick(args, updateDataSource.queryParams),\n body: pick(args, updateDataSource.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List page templates that are available for a data source\n */\n listTemplates: (\n args: WithAuth<ListDataSourceTemplatesParameters>\n ): Promise<ListDataSourceTemplatesResponse> => {\n return this.request<ListDataSourceTemplatesResponse>({\n path: listDataSourceTemplates.path(args),\n method: listDataSourceTemplates.method,\n query: pick(args, listDataSourceTemplates.queryParams),\n body: pick(args, listDataSourceTemplates.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly pages = {\n /**\n * Create a page\n */\n create: (\n args: WithAuth<CreatePageParameters>\n ): Promise<CreatePageResponse> => {\n return this.request<CreatePageResponse>({\n path: createPage.path(),\n method: createPage.method,\n query: pick(args, createPage.queryParams),\n body: pick(args, createPage.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve a page\n */\n retrieve: (args: WithAuth<GetPageParameters>): Promise<GetPageResponse> => {\n return this.request<GetPageResponse>({\n path: getPage.path(args),\n method: getPage.method,\n query: pick(args, getPage.queryParams),\n body: pick(args, getPage.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Update page properties\n */\n update: (\n args: WithAuth<UpdatePageParameters>\n ): Promise<UpdatePageResponse> => {\n return this.request<UpdatePageResponse>({\n path: updatePage.path(args),\n method: updatePage.method,\n query: pick(args, updatePage.queryParams),\n body: pick(args, updatePage.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Move a page\n */\n move: (args: WithAuth<MovePageParameters>): Promise<MovePageResponse> => {\n return this.request<MovePageResponse>({\n path: movePage.path(args),\n method: movePage.method,\n query: pick(args, movePage.queryParams),\n body: pick(args, movePage.bodyParams),\n auth: args?.auth,\n })\n },\n properties: {\n /**\n * Retrieve page property\n */\n retrieve: (\n args: WithAuth<GetPagePropertyParameters>\n ): Promise<GetPagePropertyResponse> => {\n return this.request<GetPagePropertyResponse>({\n path: getPageProperty.path(args),\n method: getPageProperty.method,\n query: pick(args, getPageProperty.queryParams),\n body: pick(args, getPageProperty.bodyParams),\n auth: args?.auth,\n })\n },\n },\n }\n\n public readonly users = {\n /**\n * Retrieve a user\n */\n retrieve: (args: WithAuth<GetUserParameters>): Promise<GetUserResponse> => {\n return this.request<GetUserResponse>({\n path: getUser.path(args),\n method: getUser.method,\n query: pick(args, getUser.queryParams),\n body: pick(args, getUser.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List all users\n */\n list: (args: WithAuth<ListUsersParameters>): Promise<ListUsersResponse> => {\n return this.request<ListUsersResponse>({\n path: listUsers.path(),\n method: listUsers.method,\n query: pick(args, listUsers.queryParams),\n body: pick(args, listUsers.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Get details about bot\n */\n me: (args: WithAuth<GetSelfParameters>): Promise<GetSelfResponse> => {\n return this.request<GetSelfResponse>({\n path: getSelf.path(),\n method: getSelf.method,\n query: pick(args, getSelf.queryParams),\n body: pick(args, getSelf.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly comments = {\n /**\n * Create a comment\n */\n create: (\n args: WithAuth<CreateCommentParameters>\n ): Promise<CreateCommentResponse> => {\n return this.request<CreateCommentResponse>({\n path: createComment.path(),\n method: createComment.method,\n query: pick(args, createComment.queryParams),\n body: pick(args, createComment.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List comments\n */\n list: (\n args: WithAuth<ListCommentsParameters>\n ): Promise<ListCommentsResponse> => {\n return this.request<ListCommentsResponse>({\n path: listComments.path(),\n method: listComments.method,\n query: pick(args, listComments.queryParams),\n body: pick(args, listComments.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve a comment\n */\n retrieve: (\n args: WithAuth<GetCommentParameters>\n ): Promise<GetCommentResponse> => {\n return this.request<GetCommentResponse>({\n path: getComment.path(args),\n method: getComment.method,\n query: pick(args, getComment.queryParams),\n body: pick(args, getComment.bodyParams),\n auth: args?.auth,\n })\n },\n }\n\n public readonly fileUploads = {\n /**\n * Create a file upload\n */\n create: (\n args: WithAuth<CreateFileUploadParameters>\n ): Promise<CreateFileUploadResponse> => {\n return this.request<CreateFileUploadResponse>({\n path: createFileUpload.path(),\n method: createFileUpload.method,\n query: pick(args, createFileUpload.queryParams),\n body: pick(args, createFileUpload.bodyParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Retrieve a file upload\n */\n retrieve: (\n args: WithAuth<GetFileUploadParameters>\n ): Promise<GetFileUploadResponse> => {\n return this.request<GetFileUploadResponse>({\n path: getFileUpload.path(args),\n method: getFileUpload.method,\n query: pick(args, getFileUpload.queryParams),\n auth: args?.auth,\n })\n },\n\n /**\n * List file uploads\n */\n list: (\n args: WithAuth<ListFileUploadsParameters>\n ): Promise<ListFileUploadsResponse> => {\n return this.request<ListFileUploadsResponse>({\n path: listFileUploads.path(),\n method: listFileUploads.method,\n query: pick(args, listFileUploads.queryParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Send a file upload\n *\n * Requires a `file_upload_id`, obtained from the `id` of the Create File\n * Upload API response.\n *\n * The `file` parameter contains the raw file contents or Blob/File object\n * under `file.data`, and an optional `file.filename` string.\n *\n * Supply a stringified `part_number` parameter when using file uploads\n * in multi-part mode.\n *\n * This endpoint sends HTTP multipart/form-data instead of JSON parameters.\n */\n send: (\n args: WithAuth<SendFileUploadParameters>\n ): Promise<SendFileUploadResponse> => {\n return this.request<SendFileUploadResponse>({\n path: sendFileUpload.path(args),\n method: sendFileUpload.method,\n query: pick(args, sendFileUpload.queryParams),\n formDataParams: pick(args, sendFileUpload.formDataParams),\n auth: args?.auth,\n })\n },\n\n /**\n * Complete a file upload\n */\n complete: (\n args: WithAuth<CompleteFileUploadParameters>\n ): Promise<CompleteFileUploadResponse> => {\n return this.request<CompleteFileUploadResponse>({\n path: completeFileUpload.path(args),\n method: completeFileUpload.method,\n query: pick(args, completeFileUpload.queryParams),\n auth: args?.auth,\n })\n },\n }\n\n /**\n * Search\n */\n public search = (\n args: WithAuth<SearchParameters>\n ): Promise<SearchResponse> => {\n return this.request<SearchResponse>({\n path: search.path(),\n method: search.method,\n query: pick(args, search.queryParams),\n body: pick(args, search.bodyParams),\n auth: args?.auth,\n })\n }\n\n public readonly oauth = {\n /**\n * Get token\n */\n token: (\n args: OauthTokenParameters & {\n client_id: string\n client_secret: string\n }\n ): Promise<OauthTokenResponse> => {\n return this.request<OauthTokenResponse>({\n path: oauthToken.path(),\n method: oauthToken.method,\n query: pick(args, oauthToken.queryParams),\n body: pick(args, oauthToken.bodyParams),\n auth: {\n client_id: args.client_id,\n client_secret: args.client_secret,\n },\n })\n },\n /**\n * Introspect token\n */\n introspect: (\n args: OauthIntrospectParameters & {\n client_id: string\n client_secret: string\n }\n ): Promise<OauthIntrospectResponse> => {\n return this.request<OauthIntrospectResponse>({\n path: oauthIntrospect.path(),\n method: oauthIntrospect.method,\n query: pick(args, oauthIntrospect.queryParams),\n body: pick(args, oauthIntrospect.bodyParams),\n auth: {\n client_id: args.client_id,\n client_secret: args.client_secret,\n },\n })\n },\n /**\n * Revoke token\n */\n revoke: (\n args: OauthRevokeParameters & {\n client_id: string\n client_secret: string\n }\n ): Promise<OauthRevokeResponse> => {\n return this.request<OauthRevokeResponse>({\n path: oauthRevoke.path(),\n method: oauthRevoke.method,\n query: pick(args, oauthRevoke.queryParams),\n body: pick(args, oauthRevoke.bodyParams),\n auth: {\n client_id: args.client_id,\n client_secret: args.client_secret,\n },\n })\n },\n }\n\n /**\n * Emits a log message to the console.\n *\n * @param level The level for this message\n * @param args Arguments to send to the console\n */\n private log(\n level: LogLevel,\n message: string,\n extraInfo: Record<string, unknown>\n ) {\n if (logLevelSeverity(level) >= logLevelSeverity(this.#logLevel)) {\n this.#logger(level, message, extraInfo)\n }\n }\n\n /**\n * Transforms an API key or access token into a headers object suitable for an HTTP request.\n *\n * This method uses the instance's value as the default when the input is undefined. If neither are defined, it returns\n * an empty object\n *\n * @param auth API key or access token\n * @returns headers key-value object\n */\n private authAsHeaders(auth?: string): Record<string, string> {\n const headers: Record<string, string> = {}\n const authHeaderValue = auth ?? this.#auth\n if (authHeaderValue !== undefined) {\n headers[\"authorization\"] = `Bearer ${authHeaderValue}`\n }\n return headers\n }\n}\n\n/*\n * Type aliases to support the generic request interface.\n */\ntype Method = \"get\" | \"post\" | \"patch\" | \"delete\"\ntype QueryParams = Record<string, string | number | string[]> | URLSearchParams\n\ntype WithAuth<P> = P & { auth?: string }\n"]}
|
|
@@ -2751,6 +2751,16 @@ type CreatePageBodyParameters = {
|
|
|
2751
2751
|
type: "template_id";
|
|
2752
2752
|
template_id: IdRequest;
|
|
2753
2753
|
};
|
|
2754
|
+
position?: {
|
|
2755
|
+
type: "after_block";
|
|
2756
|
+
after_block: {
|
|
2757
|
+
id: IdRequest;
|
|
2758
|
+
};
|
|
2759
|
+
} | {
|
|
2760
|
+
type: "page_start";
|
|
2761
|
+
} | {
|
|
2762
|
+
type: "page_end";
|
|
2763
|
+
};
|
|
2754
2764
|
};
|
|
2755
2765
|
export type CreatePageParameters = CreatePageBodyParameters;
|
|
2756
2766
|
export type CreatePageResponse = PageObjectResponse | PartialPageObjectResponse;
|
|
@@ -2761,7 +2771,7 @@ export declare const createPage: {
|
|
|
2761
2771
|
readonly method: "post";
|
|
2762
2772
|
readonly pathParams: readonly [];
|
|
2763
2773
|
readonly queryParams: readonly [];
|
|
2764
|
-
readonly bodyParams: readonly ["parent", "properties", "icon", "cover", "content", "children", "template"];
|
|
2774
|
+
readonly bodyParams: readonly ["parent", "properties", "icon", "cover", "content", "children", "template", "position"];
|
|
2765
2775
|
readonly path: () => string;
|
|
2766
2776
|
};
|
|
2767
2777
|
type GetPagePathParameters = {
|