@notionhq/client 5.13.0 → 5.15.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/build/package.json +1 -1
- package/build/src/Client.d.ts +43 -1
- package/build/src/Client.d.ts.map +1 -1
- package/build/src/Client.js +139 -0
- package/build/src/Client.js.map +1 -1
- package/build/src/api-endpoints/blocks.d.ts +984 -0
- package/build/src/api-endpoints/blocks.d.ts.map +1 -0
- package/build/src/api-endpoints/blocks.js +89 -0
- package/build/src/api-endpoints/blocks.js.map +1 -0
- package/build/src/api-endpoints/comments.d.ts +112 -0
- package/build/src/api-endpoints/comments.d.ts.map +1 -0
- package/build/src/api-endpoints/comments.js +42 -0
- package/build/src/api-endpoints/comments.js.map +1 -0
- package/build/src/api-endpoints/common.d.ts +1939 -0
- package/build/src/api-endpoints/common.d.ts.map +1 -0
- package/build/src/api-endpoints/common.js +5 -0
- package/build/src/api-endpoints/common.js.map +1 -0
- package/build/src/api-endpoints/custom-emojis.d.ts +26 -0
- package/build/src/api-endpoints/custom-emojis.d.ts.map +1 -0
- package/build/src/api-endpoints/custom-emojis.js +16 -0
- package/build/src/api-endpoints/custom-emojis.js.map +1 -0
- package/build/src/api-endpoints/data-sources.d.ts +430 -0
- package/build/src/api-endpoints/data-sources.d.ts.map +1 -0
- package/build/src/api-endpoints/data-sources.js +64 -0
- package/build/src/api-endpoints/data-sources.js.map +1 -0
- package/build/src/api-endpoints/databases.d.ts +109 -0
- package/build/src/api-endpoints/databases.d.ts.map +1 -0
- package/build/src/api-endpoints/databases.js +53 -0
- package/build/src/api-endpoints/databases.js.map +1 -0
- package/build/src/api-endpoints/file-uploads.d.ts +138 -0
- package/build/src/api-endpoints/file-uploads.d.ts.map +1 -0
- package/build/src/api-endpoints/file-uploads.js +63 -0
- package/build/src/api-endpoints/file-uploads.js.map +1 -0
- package/build/src/api-endpoints/oauth.d.ts +90 -0
- package/build/src/api-endpoints/oauth.d.ts.map +1 -0
- package/build/src/api-endpoints/oauth.js +42 -0
- package/build/src/api-endpoints/oauth.js.map +1 -0
- package/build/src/api-endpoints/pages.d.ts +639 -0
- package/build/src/api-endpoints/pages.d.ts.map +1 -0
- package/build/src/api-endpoints/pages.js +102 -0
- package/build/src/api-endpoints/pages.js.map +1 -0
- package/build/src/api-endpoints/search.d.ts +36 -0
- package/build/src/api-endpoints/search.d.ts.map +1 -0
- package/build/src/api-endpoints/search.js +16 -0
- package/build/src/api-endpoints/search.js.map +1 -0
- package/build/src/api-endpoints/users.d.ts +53 -0
- package/build/src/api-endpoints/users.d.ts.map +1 -0
- package/build/src/api-endpoints/users.js +36 -0
- package/build/src/api-endpoints/users.js.map +1 -0
- package/build/src/api-endpoints/views.d.ts +504 -0
- package/build/src/api-endpoints/views.d.ts.map +1 -0
- package/build/src/api-endpoints/views.js +86 -0
- package/build/src/api-endpoints/views.js.map +1 -0
- package/build/src/api-endpoints/webhooks.d.ts +302 -0
- package/build/src/api-endpoints/webhooks.d.ts.map +1 -0
- package/build/src/api-endpoints/webhooks.js +5 -0
- package/build/src/api-endpoints/webhooks.js.map +1 -0
- package/build/src/api-endpoints.d.ts +13 -4078
- package/build/src/api-endpoints.d.ts.map +1 -1
- package/build/src/api-endpoints.js +31 -452
- package/build/src/api-endpoints.js.map +1 -1
- package/build/src/helpers.d.ts +5 -1
- package/build/src/helpers.d.ts.map +1 -1
- package/build/src/helpers.js +7 -0
- package/build/src/helpers.js.map +1 -1
- package/build/src/index.d.ts +2 -2
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +2 -1
- package/build/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../../src/api-endpoints/databases.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,wBAA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CAAC,EAAE,OAAO,CAAA;IAEnB,mBAAmB,CAAC,EAAE,wBAAwB,CAAA;IAE9C,IAAI,CAAC,EAAE,eAAe,CAAA;IAEtB,KAAK,CAAC,EAAE,gBAAgB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,CAAA;AAEnE,MAAM,MAAM,sBAAsB,GAC9B,6BAA6B,GAC7B,sBAAsB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;yBAcf,MAAM;CACR,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// cspell:disable-file
|
|
3
|
+
// Note: This is a generated file. DO NOT EDIT!
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createDatabase = exports.updateDatabase = exports.getDatabase = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Retrieve a database
|
|
8
|
+
*/
|
|
9
|
+
exports.getDatabase = {
|
|
10
|
+
method: "get",
|
|
11
|
+
pathParams: ["database_id"],
|
|
12
|
+
queryParams: [],
|
|
13
|
+
bodyParams: [],
|
|
14
|
+
path: (p) => `databases/${p.database_id}`,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Update a database
|
|
18
|
+
*/
|
|
19
|
+
exports.updateDatabase = {
|
|
20
|
+
method: "patch",
|
|
21
|
+
pathParams: ["database_id"],
|
|
22
|
+
queryParams: [],
|
|
23
|
+
bodyParams: [
|
|
24
|
+
"parent",
|
|
25
|
+
"title",
|
|
26
|
+
"description",
|
|
27
|
+
"is_inline",
|
|
28
|
+
"icon",
|
|
29
|
+
"cover",
|
|
30
|
+
"in_trash",
|
|
31
|
+
"is_locked",
|
|
32
|
+
],
|
|
33
|
+
path: (p) => `databases/${p.database_id}`,
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Create a database
|
|
37
|
+
*/
|
|
38
|
+
exports.createDatabase = {
|
|
39
|
+
method: "post",
|
|
40
|
+
pathParams: [],
|
|
41
|
+
queryParams: [],
|
|
42
|
+
bodyParams: [
|
|
43
|
+
"parent",
|
|
44
|
+
"title",
|
|
45
|
+
"description",
|
|
46
|
+
"is_inline",
|
|
47
|
+
"initial_data_source",
|
|
48
|
+
"icon",
|
|
49
|
+
"cover",
|
|
50
|
+
],
|
|
51
|
+
path: () => `databases`,
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=databases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databases.js","sourceRoot":"","sources":["../../../src/api-endpoints/databases.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AA4E/C;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,aAAa,CAAC;IAC3B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA4B,EAAU,EAAE,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE;CACpE,CAAA;AA0DV;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,CAAC,aAAa,CAAC;IAC3B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE;QACV,QAAQ;QACR,OAAO;QACP,aAAa;QACb,WAAW;QACX,MAAM;QACN,OAAO;QACP,UAAU;QACV,WAAW;KACZ;IAED,IAAI,EAAE,CAAC,CAA+B,EAAU,EAAE,CAChD,aAAa,CAAC,CAAC,WAAW,EAAE;CACtB,CAAA;AAwCV;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE;QACV,QAAQ;QACR,OAAO;QACP,aAAa;QACb,WAAW;QACX,qBAAqB;QACrB,MAAM;QACN,OAAO;KACR;IAED,IAAI,EAAE,GAAW,EAAE,CAAC,WAAW;CACvB,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type {\n IdRequest,\n IdResponse,\n InitialDataSourceRequest,\n PageCoverRequest,\n PageCoverResponse,\n PageIconRequest,\n PageIconResponse,\n ParentOfDatabaseResponse,\n RichTextItemRequest,\n RichTextItemResponse,\n} from \"./common\"\n\ntype DataSourceReferenceResponse = {\n // The ID of the data source.\n id: IdResponse\n // The name of the data source.\n name: string\n}\n\nexport type DatabaseObjectResponse = {\n // The database object type name.\n object: \"database\"\n // The ID of the database.\n id: IdResponse\n // The title of the database.\n title: Array<RichTextItemResponse>\n // The description of the database.\n description: Array<RichTextItemResponse>\n // The parent of the database. This is typically a page, block, or workspace, but can be\n // another database in the case of wikis.\n parent: ParentOfDatabaseResponse\n // Whether the database is inline.\n is_inline: boolean\n // Whether the database is in the trash.\n in_trash: boolean\n /** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */\n archived: boolean\n // Whether the database is locked from editing in the Notion app UI.\n is_locked: boolean\n // The time when the database was created.\n created_time: string\n // The time when the database was last edited.\n last_edited_time: string\n // The data sources of the database.\n data_sources: Array<DataSourceReferenceResponse>\n // The icon of the database.\n icon: PageIconResponse | null\n // The cover of the database.\n cover: PageCoverResponse | null\n // The URL of the database.\n url: string\n // The public URL of the database if it is publicly accessible.\n public_url: string | null\n}\n\nexport type PartialDatabaseObjectResponse = {\n // The database object type name.\n object: \"database\"\n // The ID of the database.\n id: IdResponse\n}\n\ntype GetDatabasePathParameters = {\n // ID of a Notion database, a container for one or more data sources.\n database_id: IdRequest\n}\n\nexport type GetDatabaseParameters = GetDatabasePathParameters\n\nexport type GetDatabaseResponse =\n | PartialDatabaseObjectResponse\n | DatabaseObjectResponse\n\n/**\n * Retrieve a database\n */\nexport const getDatabase = {\n method: \"get\",\n pathParams: [\"database_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetDatabasePathParameters): string => `databases/${p.database_id}`,\n} as const\n\ntype UpdateDatabasePathParameters = {\n // ID of a Notion database, a container for one or more data sources.\n database_id: IdRequest\n}\n\ntype UpdateDatabaseBodyParameters = {\n // The parent page or workspace to move the database to. If not provided, the database\n // will not be moved.\n parent?: {\n // The type of parent.\n type: \"page_id\" | \"workspace\"\n } & (\n | {\n // Always `page_id`\n type: \"page_id\"\n page_id: IdRequest\n }\n | {\n // Always `workspace`\n type: \"workspace\"\n // Always `true`\n workspace: true\n }\n )\n // The updated title of the database, if any. If not provided, the title will not be\n // updated.\n title?: Array<RichTextItemRequest>\n // The updated description of the database, if any. If not provided, the description will\n // not be updated.\n description?: Array<RichTextItemRequest>\n // Whether the database should be displayed inline in the parent page. If not provided,\n // the inline status will not be updated.\n is_inline?: boolean\n // The updated icon for the database, if any. If not provided, the icon will not be\n // updated.\n icon?: PageIconRequest\n // The updated cover image for the database, if any. If not provided, the cover will not\n // be updated.\n cover?: PageCoverRequest\n // Whether the database should be moved to or from the trash. If not provided, the trash\n // status will not be updated.\n in_trash?: boolean\n /** @deprecated Use `in_trash` instead. */\n archived?: boolean\n // Whether the database should be locked from editing in the Notion app UI. If not\n // provided, the locked state will not be updated.\n is_locked?: boolean\n}\n\nexport type UpdateDatabaseParameters = UpdateDatabasePathParameters &\n UpdateDatabaseBodyParameters\n\nexport type UpdateDatabaseResponse =\n | PartialDatabaseObjectResponse\n | DatabaseObjectResponse\n\n/**\n * Update a database\n */\nexport const updateDatabase = {\n method: \"patch\",\n pathParams: [\"database_id\"],\n queryParams: [],\n bodyParams: [\n \"parent\",\n \"title\",\n \"description\",\n \"is_inline\",\n \"icon\",\n \"cover\",\n \"in_trash\",\n \"is_locked\",\n ],\n\n path: (p: UpdateDatabasePathParameters): string =>\n `databases/${p.database_id}`,\n} as const\n\ntype CreateDatabaseBodyParameters = {\n // The parent page or workspace where the database will be created.\n parent: {\n // The type of parent.\n type: \"page_id\" | \"workspace\"\n } & (\n | {\n // Always `page_id`\n type: \"page_id\"\n page_id: IdRequest\n }\n | {\n // Always `workspace`\n type: \"workspace\"\n // Always `true`\n workspace: true\n }\n )\n // The title of the database.\n title?: Array<RichTextItemRequest>\n // The description of the database.\n description?: Array<RichTextItemRequest>\n // Whether the database should be displayed inline in the parent page. Defaults to false.\n is_inline?: boolean\n // Initial data source configuration for the database.\n initial_data_source?: InitialDataSourceRequest\n // The icon for the database.\n icon?: PageIconRequest\n // The cover image for the database.\n cover?: PageCoverRequest\n}\n\nexport type CreateDatabaseParameters = CreateDatabaseBodyParameters\n\nexport type CreateDatabaseResponse =\n | PartialDatabaseObjectResponse\n | DatabaseObjectResponse\n\n/**\n * Create a database\n */\nexport const createDatabase = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\n \"parent\",\n \"title\",\n \"description\",\n \"is_inline\",\n \"initial_data_source\",\n \"icon\",\n \"cover\",\n ],\n\n path: (): string => `databases`,\n} as const\n"]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { EmptyObject, IdRequest, IdResponse } from "./common";
|
|
2
|
+
export type FileUploadObjectResponse = {
|
|
3
|
+
object: "file_upload";
|
|
4
|
+
id: IdResponse;
|
|
5
|
+
created_time: string;
|
|
6
|
+
created_by: {
|
|
7
|
+
id: IdResponse;
|
|
8
|
+
type: "person" | "bot" | "agent";
|
|
9
|
+
};
|
|
10
|
+
last_edited_time: string;
|
|
11
|
+
in_trash: boolean;
|
|
12
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
13
|
+
archived: boolean;
|
|
14
|
+
expiry_time: string | null;
|
|
15
|
+
status: "pending" | "uploaded" | "expired" | "failed";
|
|
16
|
+
filename: string | null;
|
|
17
|
+
content_type: string | null;
|
|
18
|
+
content_length: number | null;
|
|
19
|
+
upload_url?: string;
|
|
20
|
+
complete_url?: string;
|
|
21
|
+
file_import_result?: {
|
|
22
|
+
imported_time: string;
|
|
23
|
+
} & ({
|
|
24
|
+
type: "success";
|
|
25
|
+
success: EmptyObject;
|
|
26
|
+
} | {
|
|
27
|
+
type: "error";
|
|
28
|
+
error: {
|
|
29
|
+
type: "validation_error" | "internal_system_error" | "download_error" | "upload_error";
|
|
30
|
+
code: string;
|
|
31
|
+
message: string;
|
|
32
|
+
parameter: string | null;
|
|
33
|
+
status_code: number | null;
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
number_of_parts?: {
|
|
37
|
+
total: number;
|
|
38
|
+
sent: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type CreateFileUploadBodyParameters = {
|
|
42
|
+
mode?: "single_part" | "multi_part" | "external_url";
|
|
43
|
+
filename?: string;
|
|
44
|
+
content_type?: string;
|
|
45
|
+
number_of_parts?: number;
|
|
46
|
+
external_url?: string;
|
|
47
|
+
};
|
|
48
|
+
export type CreateFileUploadParameters = CreateFileUploadBodyParameters;
|
|
49
|
+
export type CreateFileUploadResponse = FileUploadObjectResponse;
|
|
50
|
+
/**
|
|
51
|
+
* Create a file upload
|
|
52
|
+
*/
|
|
53
|
+
export declare const createFileUpload: {
|
|
54
|
+
readonly method: "post";
|
|
55
|
+
readonly pathParams: readonly [];
|
|
56
|
+
readonly queryParams: readonly [];
|
|
57
|
+
readonly bodyParams: readonly ["mode", "filename", "content_type", "number_of_parts", "external_url"];
|
|
58
|
+
readonly path: () => string;
|
|
59
|
+
};
|
|
60
|
+
type ListFileUploadsQueryParameters = {
|
|
61
|
+
status?: "pending" | "uploaded" | "expired" | "failed";
|
|
62
|
+
start_cursor?: string;
|
|
63
|
+
page_size?: number;
|
|
64
|
+
};
|
|
65
|
+
export type ListFileUploadsParameters = ListFileUploadsQueryParameters;
|
|
66
|
+
export type ListFileUploadsResponse = {
|
|
67
|
+
object: "list";
|
|
68
|
+
next_cursor: IdResponse | null;
|
|
69
|
+
has_more: boolean;
|
|
70
|
+
results: Array<FileUploadObjectResponse>;
|
|
71
|
+
type: "file_upload";
|
|
72
|
+
file_upload: EmptyObject;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* List file uploads
|
|
76
|
+
*/
|
|
77
|
+
export declare const listFileUploads: {
|
|
78
|
+
readonly method: "get";
|
|
79
|
+
readonly pathParams: readonly [];
|
|
80
|
+
readonly queryParams: readonly ["status", "start_cursor", "page_size"];
|
|
81
|
+
readonly bodyParams: readonly [];
|
|
82
|
+
readonly path: () => string;
|
|
83
|
+
};
|
|
84
|
+
type SendFileUploadPathParameters = {
|
|
85
|
+
file_upload_id: IdRequest;
|
|
86
|
+
};
|
|
87
|
+
type SendFileUploadFormDataParameters = {
|
|
88
|
+
file: {
|
|
89
|
+
filename?: string;
|
|
90
|
+
data: string | Blob;
|
|
91
|
+
};
|
|
92
|
+
part_number?: string;
|
|
93
|
+
};
|
|
94
|
+
export type SendFileUploadParameters = SendFileUploadPathParameters & SendFileUploadFormDataParameters;
|
|
95
|
+
export type SendFileUploadResponse = FileUploadObjectResponse;
|
|
96
|
+
/**
|
|
97
|
+
* Upload a file
|
|
98
|
+
*/
|
|
99
|
+
export declare const sendFileUpload: {
|
|
100
|
+
readonly method: "post";
|
|
101
|
+
readonly pathParams: readonly ["file_upload_id"];
|
|
102
|
+
readonly queryParams: readonly [];
|
|
103
|
+
readonly bodyParams: readonly [];
|
|
104
|
+
readonly formDataParams: readonly ["file", "part_number"];
|
|
105
|
+
readonly path: (p: SendFileUploadPathParameters) => string;
|
|
106
|
+
};
|
|
107
|
+
type CompleteFileUploadPathParameters = {
|
|
108
|
+
file_upload_id: IdRequest;
|
|
109
|
+
};
|
|
110
|
+
export type CompleteFileUploadParameters = CompleteFileUploadPathParameters;
|
|
111
|
+
export type CompleteFileUploadResponse = FileUploadObjectResponse;
|
|
112
|
+
/**
|
|
113
|
+
* Complete a multi-part file upload
|
|
114
|
+
*/
|
|
115
|
+
export declare const completeFileUpload: {
|
|
116
|
+
readonly method: "post";
|
|
117
|
+
readonly pathParams: readonly ["file_upload_id"];
|
|
118
|
+
readonly queryParams: readonly [];
|
|
119
|
+
readonly bodyParams: readonly [];
|
|
120
|
+
readonly path: (p: CompleteFileUploadPathParameters) => string;
|
|
121
|
+
};
|
|
122
|
+
type GetFileUploadPathParameters = {
|
|
123
|
+
file_upload_id: IdRequest;
|
|
124
|
+
};
|
|
125
|
+
export type GetFileUploadParameters = GetFileUploadPathParameters;
|
|
126
|
+
export type GetFileUploadResponse = FileUploadObjectResponse;
|
|
127
|
+
/**
|
|
128
|
+
* Retrieve a file upload
|
|
129
|
+
*/
|
|
130
|
+
export declare const getFileUpload: {
|
|
131
|
+
readonly method: "get";
|
|
132
|
+
readonly pathParams: readonly ["file_upload_id"];
|
|
133
|
+
readonly queryParams: readonly [];
|
|
134
|
+
readonly bodyParams: readonly [];
|
|
135
|
+
readonly path: (p: GetFileUploadPathParameters) => string;
|
|
136
|
+
};
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=file-uploads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-uploads.d.ts","sourceRoot":"","sources":["../../../src/api-endpoints/file-uploads.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,MAAM,wBAAwB,GAAG;IAErC,MAAM,EAAE,aAAa,CAAA;IACrB,EAAE,EAAE,UAAU,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,UAAU,CAAA;QAEd,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAA;KACjC,CAAA;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,OAAO,CAAA;IACjB,qHAAqH;IACrH,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAE1B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,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AM,uBAAuB,GAAG,2BAA2B,CAAA;AAEjE,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;uBAMd,2BAA2B,KAAG,MAAM;CAEtC,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// cspell:disable-file
|
|
3
|
+
// Note: This is a generated file. DO NOT EDIT!
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getFileUpload = exports.completeFileUpload = exports.sendFileUpload = exports.listFileUploads = exports.createFileUpload = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Create a file upload
|
|
8
|
+
*/
|
|
9
|
+
exports.createFileUpload = {
|
|
10
|
+
method: "post",
|
|
11
|
+
pathParams: [],
|
|
12
|
+
queryParams: [],
|
|
13
|
+
bodyParams: [
|
|
14
|
+
"mode",
|
|
15
|
+
"filename",
|
|
16
|
+
"content_type",
|
|
17
|
+
"number_of_parts",
|
|
18
|
+
"external_url",
|
|
19
|
+
],
|
|
20
|
+
path: () => `file_uploads`,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* List file uploads
|
|
24
|
+
*/
|
|
25
|
+
exports.listFileUploads = {
|
|
26
|
+
method: "get",
|
|
27
|
+
pathParams: [],
|
|
28
|
+
queryParams: ["status", "start_cursor", "page_size"],
|
|
29
|
+
bodyParams: [],
|
|
30
|
+
path: () => `file_uploads`,
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Upload a file
|
|
34
|
+
*/
|
|
35
|
+
exports.sendFileUpload = {
|
|
36
|
+
method: "post",
|
|
37
|
+
pathParams: ["file_upload_id"],
|
|
38
|
+
queryParams: [],
|
|
39
|
+
bodyParams: [],
|
|
40
|
+
formDataParams: ["file", "part_number"],
|
|
41
|
+
path: (p) => `file_uploads/${p.file_upload_id}/send`,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Complete a multi-part file upload
|
|
45
|
+
*/
|
|
46
|
+
exports.completeFileUpload = {
|
|
47
|
+
method: "post",
|
|
48
|
+
pathParams: ["file_upload_id"],
|
|
49
|
+
queryParams: [],
|
|
50
|
+
bodyParams: [],
|
|
51
|
+
path: (p) => `file_uploads/${p.file_upload_id}/complete`,
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve a file upload
|
|
55
|
+
*/
|
|
56
|
+
exports.getFileUpload = {
|
|
57
|
+
method: "get",
|
|
58
|
+
pathParams: ["file_upload_id"],
|
|
59
|
+
queryParams: [],
|
|
60
|
+
bodyParams: [],
|
|
61
|
+
path: (p) => `file_uploads/${p.file_upload_id}`,
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=file-uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-uploads.js","sourceRoot":"","sources":["../../../src/api-endpoints/file-uploads.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AAsF/C;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE;QACV,MAAM;QACN,UAAU;QACV,cAAc;QACd,iBAAiB;QACjB,cAAc;KACf;IAED,IAAI,EAAE,GAAW,EAAE,CAAC,cAAc;CAC1B,CAAA;AAyBV;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,CAAC;IACpD,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,GAAW,EAAE,CAAC,cAAc;CAC1B,CAAA;AAiBV;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;IACvC,IAAI,EAAE,CAAC,CAA+B,EAAU,EAAE,CAChD,gBAAgB,CAAC,CAAC,cAAc,OAAO;CACjC,CAAA;AAWV;;GAEG;AACU,QAAA,kBAAkB,GAAG;IAChC,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAmC,EAAU,EAAE,CACpD,gBAAgB,CAAC,CAAC,cAAc,WAAW;CACrC,CAAA;AAWV;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA8B,EAAU,EAAE,CAC/C,gBAAgB,CAAC,CAAC,cAAc,EAAE;CAC5B,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type { EmptyObject, IdRequest, IdResponse } from \"./common\"\n\nexport type FileUploadObjectResponse = {\n // Always `file_upload`\n object: \"file_upload\"\n id: IdResponse\n created_time: string\n created_by: {\n id: IdResponse\n // One of: `person`, `bot`, `agent`\n type: \"person\" | \"bot\" | \"agent\"\n }\n last_edited_time: string\n in_trash: boolean\n /** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */\n archived: boolean\n expiry_time: string | null\n // One of: `pending`, `uploaded`, `expired`, `failed`\n status: \"pending\" | \"uploaded\" | \"expired\" | \"failed\"\n filename: string | null\n content_type: string | null\n content_length: number | null\n upload_url?: string\n complete_url?: string\n file_import_result?: {\n // The time the file was imported into Notion. ISO 8601 format.\n imported_time: string\n } & (\n | {\n // Indicates a successful import.\n type: \"success\"\n // Empty object for success type.\n success: EmptyObject\n }\n | {\n // Indicates an error occurred during import.\n type: \"error\"\n // Details about the error that occurred during file import.\n error: {\n // The type of error that occurred during file import.\n type:\n | \"validation_error\"\n | \"internal_system_error\"\n | \"download_error\"\n | \"upload_error\"\n // A short string code representing the error.\n code: string\n // A human-readable message describing the error.\n message: string\n // The parameter related to the error, if applicable. Null if not applicable.\n parameter: string | null\n // The HTTP status code associated with the error, if available. Null if not applicable.\n status_code: number | null\n }\n }\n )\n number_of_parts?: { total: number; sent: number }\n}\n\ntype CreateFileUploadBodyParameters = {\n // How the file is being sent. Use `multi_part` for files larger than 20MB. Use\n // `external_url` for files that are temporarily hosted publicly elsewhere. Default is\n // `single_part`.\n mode?: \"single_part\" | \"multi_part\" | \"external_url\"\n // Name of the file to be created. Required when `mode` is `multi_part`. Otherwise\n // optional, and used to override the filename. Must include an extension, or have one\n // inferred from the `content_type` parameter.\n filename?: string\n // MIME type of the file to be created. Recommended when sending the file in multiple\n // parts. Must match the content type of the file that's sent, and the extension of the\n // `filename` parameter if any.\n content_type?: string\n // When `mode` is `multi_part`, the number of parts you are uploading. This must match\n // the number of parts as well as the final `part_number` you send.\n number_of_parts?: number\n // When `mode` is `external_url`, provide the HTTPS URL of a publicly accessible file to\n // import into your workspace.\n external_url?: string\n}\n\nexport type CreateFileUploadParameters = CreateFileUploadBodyParameters\n\nexport type CreateFileUploadResponse = FileUploadObjectResponse\n\n/**\n * Create a file upload\n */\nexport const createFileUpload = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\n \"mode\",\n \"filename\",\n \"content_type\",\n \"number_of_parts\",\n \"external_url\",\n ],\n\n path: (): string => `file_uploads`,\n} as const\n\ntype ListFileUploadsQueryParameters = {\n // If supplied, the endpoint will return file uploads with the specified status.\n status?: \"pending\" | \"uploaded\" | \"expired\" | \"failed\"\n // If supplied, this endpoint will return a page of results starting after the cursor\n // provided. If not supplied, this endpoint will return the first page of results.\n start_cursor?: string\n // The number of items from the full list desired in the response. Maximum: 100\n page_size?: number\n}\n\nexport type ListFileUploadsParameters = ListFileUploadsQueryParameters\n\nexport type ListFileUploadsResponse = {\n // Always `list`\n object: \"list\"\n next_cursor: IdResponse | null\n has_more: boolean\n results: Array<FileUploadObjectResponse>\n // Always `file_upload`\n type: \"file_upload\"\n file_upload: EmptyObject\n}\n\n/**\n * List file uploads\n */\nexport const listFileUploads = {\n method: \"get\",\n pathParams: [],\n queryParams: [\"status\", \"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (): string => `file_uploads`,\n} as const\n\ntype SendFileUploadPathParameters = {\n // Identifier for a Notion file upload object.\n file_upload_id: IdRequest\n}\n\ntype SendFileUploadFormDataParameters = {\n file: { filename?: string; data: string | Blob }\n part_number?: string\n}\n\nexport type SendFileUploadParameters = SendFileUploadPathParameters &\n SendFileUploadFormDataParameters\n\nexport type SendFileUploadResponse = FileUploadObjectResponse\n\n/**\n * Upload a file\n */\nexport const sendFileUpload = {\n method: \"post\",\n pathParams: [\"file_upload_id\"],\n queryParams: [],\n bodyParams: [],\n formDataParams: [\"file\", \"part_number\"],\n path: (p: SendFileUploadPathParameters): string =>\n `file_uploads/${p.file_upload_id}/send`,\n} as const\n\ntype CompleteFileUploadPathParameters = {\n // Identifier for a Notion file upload object.\n file_upload_id: IdRequest\n}\n\nexport type CompleteFileUploadParameters = CompleteFileUploadPathParameters\n\nexport type CompleteFileUploadResponse = FileUploadObjectResponse\n\n/**\n * Complete a multi-part file upload\n */\nexport const completeFileUpload = {\n method: \"post\",\n pathParams: [\"file_upload_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: CompleteFileUploadPathParameters): string =>\n `file_uploads/${p.file_upload_id}/complete`,\n} as const\n\ntype GetFileUploadPathParameters = {\n // Identifier for a Notion file upload object.\n file_upload_id: IdRequest\n}\n\nexport type GetFileUploadParameters = GetFileUploadPathParameters\n\nexport type GetFileUploadResponse = FileUploadObjectResponse\n\n/**\n * Retrieve a file upload\n */\nexport const getFileUpload = {\n method: \"get\",\n pathParams: [\"file_upload_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetFileUploadPathParameters): string =>\n `file_uploads/${p.file_upload_id}`,\n} as const\n"]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { IdRequest, PartialUserObjectResponse } from "./common";
|
|
2
|
+
type OauthTokenBodyParameters = {
|
|
3
|
+
grant_type: "authorization_code";
|
|
4
|
+
code: string;
|
|
5
|
+
redirect_uri?: string;
|
|
6
|
+
external_account?: {
|
|
7
|
+
key: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
grant_type: "refresh_token";
|
|
12
|
+
refresh_token: string;
|
|
13
|
+
};
|
|
14
|
+
export type OauthTokenParameters = OauthTokenBodyParameters;
|
|
15
|
+
export type OauthTokenResponse = {
|
|
16
|
+
access_token: string;
|
|
17
|
+
token_type: "bearer";
|
|
18
|
+
refresh_token: string | null;
|
|
19
|
+
bot_id: string;
|
|
20
|
+
workspace_icon: string | null;
|
|
21
|
+
workspace_name: string | null;
|
|
22
|
+
workspace_id: string;
|
|
23
|
+
owner: {
|
|
24
|
+
type: "user";
|
|
25
|
+
user: {
|
|
26
|
+
type: "person";
|
|
27
|
+
person: {
|
|
28
|
+
email: string;
|
|
29
|
+
};
|
|
30
|
+
name: string | null;
|
|
31
|
+
avatar_url: string | null;
|
|
32
|
+
id: IdRequest;
|
|
33
|
+
object: "user";
|
|
34
|
+
} | PartialUserObjectResponse;
|
|
35
|
+
} | {
|
|
36
|
+
type: "workspace";
|
|
37
|
+
workspace: true;
|
|
38
|
+
};
|
|
39
|
+
duplicated_template_id: string | null;
|
|
40
|
+
request_id?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Exchange an authorization code for an access and refresh token
|
|
44
|
+
*/
|
|
45
|
+
export declare const oauthToken: {
|
|
46
|
+
readonly method: "post";
|
|
47
|
+
readonly pathParams: readonly [];
|
|
48
|
+
readonly queryParams: readonly [];
|
|
49
|
+
readonly bodyParams: readonly ["grant_type", "code", "redirect_uri", "external_account", "refresh_token"];
|
|
50
|
+
readonly path: () => string;
|
|
51
|
+
};
|
|
52
|
+
type OauthRevokeBodyParameters = {
|
|
53
|
+
token: string;
|
|
54
|
+
};
|
|
55
|
+
export type OauthRevokeParameters = OauthRevokeBodyParameters;
|
|
56
|
+
export type OauthRevokeResponse = {
|
|
57
|
+
request_id?: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Revoke a token
|
|
61
|
+
*/
|
|
62
|
+
export declare const oauthRevoke: {
|
|
63
|
+
readonly method: "post";
|
|
64
|
+
readonly pathParams: readonly [];
|
|
65
|
+
readonly queryParams: readonly [];
|
|
66
|
+
readonly bodyParams: readonly ["token"];
|
|
67
|
+
readonly path: () => string;
|
|
68
|
+
};
|
|
69
|
+
type OauthIntrospectBodyParameters = {
|
|
70
|
+
token: string;
|
|
71
|
+
};
|
|
72
|
+
export type OauthIntrospectParameters = OauthIntrospectBodyParameters;
|
|
73
|
+
export type OauthIntrospectResponse = {
|
|
74
|
+
active: boolean;
|
|
75
|
+
scope?: string;
|
|
76
|
+
iat?: number;
|
|
77
|
+
request_id?: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Introspect a token
|
|
81
|
+
*/
|
|
82
|
+
export declare const oauthIntrospect: {
|
|
83
|
+
readonly method: "post";
|
|
84
|
+
readonly pathParams: readonly [];
|
|
85
|
+
readonly queryParams: readonly [];
|
|
86
|
+
readonly bodyParams: readonly ["token"];
|
|
87
|
+
readonly path: () => string;
|
|
88
|
+
};
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/api-endpoints/oauth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAEpE,KAAK,wBAAwB,GACz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;CAAE,CAAA;AAElD,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAA;AAE7D,MAAM,MAAM,mBAAmB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzD;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;yBAMZ,MAAM;CACR,CAAA;AAEV,KAAK,6BAA6B,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GAAG,6BAA6B,CAAA;AAErE,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;yBAMhB,MAAM;CACR,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// cspell:disable-file
|
|
3
|
+
// Note: This is a generated file. DO NOT EDIT!
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.oauthIntrospect = exports.oauthRevoke = exports.oauthToken = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Exchange an authorization code for an access and refresh token
|
|
8
|
+
*/
|
|
9
|
+
exports.oauthToken = {
|
|
10
|
+
method: "post",
|
|
11
|
+
pathParams: [],
|
|
12
|
+
queryParams: [],
|
|
13
|
+
bodyParams: [
|
|
14
|
+
"grant_type",
|
|
15
|
+
"code",
|
|
16
|
+
"redirect_uri",
|
|
17
|
+
"external_account",
|
|
18
|
+
"refresh_token",
|
|
19
|
+
],
|
|
20
|
+
path: () => `oauth/token`,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Revoke a token
|
|
24
|
+
*/
|
|
25
|
+
exports.oauthRevoke = {
|
|
26
|
+
method: "post",
|
|
27
|
+
pathParams: [],
|
|
28
|
+
queryParams: [],
|
|
29
|
+
bodyParams: ["token"],
|
|
30
|
+
path: () => `oauth/revoke`,
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Introspect a token
|
|
34
|
+
*/
|
|
35
|
+
exports.oauthIntrospect = {
|
|
36
|
+
method: "post",
|
|
37
|
+
pathParams: [],
|
|
38
|
+
queryParams: [],
|
|
39
|
+
bodyParams: ["token"],
|
|
40
|
+
path: () => `oauth/introspect`,
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=oauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/api-endpoints/oauth.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AA0C/C;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE;QACV,YAAY;QACZ,MAAM;QACN,cAAc;QACd,kBAAkB;QAClB,eAAe;KAChB;IAED,IAAI,EAAE,GAAW,EAAE,CAAC,aAAa;CACzB,CAAA;AAQV;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC,OAAO,CAAC;IAErB,IAAI,EAAE,GAAW,EAAE,CAAC,cAAc;CAC1B,CAAA;AAaV;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC,OAAO,CAAC;IAErB,IAAI,EAAE,GAAW,EAAE,CAAC,kBAAkB;CAC9B,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type { IdRequest, PartialUserObjectResponse } from \"./common\"\n\ntype OauthTokenBodyParameters =\n | {\n grant_type: \"authorization_code\"\n code: string\n redirect_uri?: string\n external_account?: { key: string; name: string }\n }\n | { grant_type: \"refresh_token\"; refresh_token: string }\n\nexport type OauthTokenParameters = OauthTokenBodyParameters\n\nexport type OauthTokenResponse = {\n access_token: string\n token_type: \"bearer\"\n refresh_token: string | null\n bot_id: string\n workspace_icon: string | null\n workspace_name: string | null\n workspace_id: string\n owner:\n | {\n type: \"user\"\n user:\n | {\n type: \"person\"\n person: { email: string }\n name: string | null\n avatar_url: string | null\n id: IdRequest\n object: \"user\"\n }\n | PartialUserObjectResponse\n }\n | { type: \"workspace\"; workspace: true }\n duplicated_template_id: string | null\n request_id?: string\n}\n\n/**\n * Exchange an authorization code for an access and refresh token\n */\nexport const oauthToken = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\n \"grant_type\",\n \"code\",\n \"redirect_uri\",\n \"external_account\",\n \"refresh_token\",\n ],\n\n path: (): string => `oauth/token`,\n} as const\n\ntype OauthRevokeBodyParameters = { token: string }\n\nexport type OauthRevokeParameters = OauthRevokeBodyParameters\n\nexport type OauthRevokeResponse = { request_id?: string }\n\n/**\n * Revoke a token\n */\nexport const oauthRevoke = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\"token\"],\n\n path: (): string => `oauth/revoke`,\n} as const\n\ntype OauthIntrospectBodyParameters = { token: string }\n\nexport type OauthIntrospectParameters = OauthIntrospectBodyParameters\n\nexport type OauthIntrospectResponse = {\n active: boolean\n scope?: string\n iat?: number\n request_id?: string\n}\n\n/**\n * Introspect a token\n */\nexport const oauthIntrospect = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\"token\"],\n\n path: (): string => `oauth/introspect`,\n} as const\n"]}
|