@notionhq/client 2.2.6 → 2.2.8
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 +1 -0
- package/build/src/Client.d.ts.map +1 -1
- package/build/src/api-endpoints.d.ts +78 -42
- package/build/src/api-endpoints.d.ts.map +1 -1
- package/build/src/api-endpoints.js +9 -2
- package/build/src/api-endpoints.js.map +1 -1
- package/build/src/fetch-types.d.ts +12 -12
- package/build/src/fetch-types.d.ts.map +1 -1
- package/build/src/fetch-types.js.map +1 -1
- package/build/src/helpers.d.ts +5 -0
- package/build/src/helpers.d.ts.map +1 -1
- package/build/src/helpers.js +14 -1
- package/build/src/helpers.js.map +1 -1
- package/package.json +1 -1
package/build/package.json
CHANGED
package/build/src/Client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import type { Agent } from "http";
|
|
3
4
|
import { Logger, LogLevel } from "./logging";
|
|
4
5
|
import { GetBlockParameters, GetBlockResponse, UpdateBlockParameters, UpdateBlockResponse, DeleteBlockParameters, DeleteBlockResponse, AppendBlockChildrenParameters, AppendBlockChildrenResponse, ListBlockChildrenParameters, ListBlockChildrenResponse, ListDatabasesParameters, ListDatabasesResponse, GetDatabaseParameters, GetDatabaseResponse, QueryDatabaseParameters, QueryDatabaseResponse, CreateDatabaseParameters, CreateDatabaseResponse, UpdateDatabaseParameters, UpdateDatabaseResponse, CreatePageParameters, CreatePageResponse, GetPageParameters, GetPageResponse, UpdatePageParameters, UpdatePageResponse, GetUserParameters, GetUserResponse, ListUsersParameters, ListUsersResponse, SearchParameters, SearchResponse, GetSelfParameters, GetSelfResponse, GetPagePropertyParameters, GetPagePropertyResponse, CreateCommentParameters, CreateCommentResponse, ListCommentsParameters, ListCommentsResponse } from "./api-endpoints";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EACL,MAAM,EACN,QAAQ,EAGT,MAAM,WAAW,CAAA;AAQlB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAEhB,qBAAqB,EACrB,mBAAmB,EAEnB,qBAAqB,EACrB,mBAAmB,EAEnB,6BAA6B,EAC7B,2BAA2B,EAE3B,2BAA2B,EAC3B,yBAAyB,EAEzB,uBAAuB,EACvB,qBAAqB,EAErB,qBAAqB,EACrB,mBAAmB,EAEnB,uBAAuB,EACvB,qBAAqB,EAErB,wBAAwB,EACxB,sBAAsB,EAEtB,wBAAwB,EACxB,sBAAsB,EAEtB,oBAAoB,EACpB,kBAAkB,EAElB,iBAAiB,EACjB,eAAe,EAEf,oBAAoB,EACpB,kBAAkB,EAElB,iBAAiB,EACjB,eAAe,EAEf,mBAAmB,EACnB,iBAAiB,EAEjB,gBAAgB,EAChB,cAAc,EAEd,iBAAiB,EACjB,eAAe,EAEf,yBAAyB,EACzB,uBAAuB,EAEvB,uBAAuB,EACvB,qBAAqB,EAErB,sBAAsB,EACtB,oBAAoB,EAErB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,sCAAsC;IACtC,KAAK,CAAC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{
|
|
|
232
232
|
type: "formula";
|
|
233
233
|
formula: FormulaPropertyResponse;
|
|
234
234
|
id: string;
|
|
235
|
+
} | {
|
|
236
|
+
type: "unique_id";
|
|
237
|
+
unique_id: {
|
|
238
|
+
prefix: string | null;
|
|
239
|
+
number: number | null;
|
|
240
|
+
};
|
|
241
|
+
id: string;
|
|
235
242
|
} | {
|
|
236
243
|
type: "title";
|
|
237
244
|
title: Array<RichTextItemResponse>;
|
|
@@ -316,6 +323,7 @@ export type PageObjectResponse = {
|
|
|
316
323
|
last_edited_time: string;
|
|
317
324
|
archived: boolean;
|
|
318
325
|
url: string;
|
|
326
|
+
public_url: string | null;
|
|
319
327
|
};
|
|
320
328
|
export type PartialPageObjectResponse = {
|
|
321
329
|
object: "page";
|
|
@@ -521,14 +529,17 @@ export type DatabaseObjectResponse = {
|
|
|
521
529
|
} | null;
|
|
522
530
|
properties: Record<string, DatabasePropertyConfigResponse>;
|
|
523
531
|
parent: {
|
|
532
|
+
type: "database_id";
|
|
533
|
+
database_id: string;
|
|
534
|
+
} | {
|
|
524
535
|
type: "page_id";
|
|
525
536
|
page_id: string;
|
|
526
|
-
} | {
|
|
527
|
-
type: "workspace";
|
|
528
|
-
workspace: true;
|
|
529
537
|
} | {
|
|
530
538
|
type: "block_id";
|
|
531
539
|
block_id: string;
|
|
540
|
+
} | {
|
|
541
|
+
type: "workspace";
|
|
542
|
+
workspace: true;
|
|
532
543
|
};
|
|
533
544
|
created_by: PartialUserObjectResponse;
|
|
534
545
|
last_edited_by: PartialUserObjectResponse;
|
|
@@ -539,6 +550,7 @@ export type DatabaseObjectResponse = {
|
|
|
539
550
|
last_edited_time: string;
|
|
540
551
|
archived: boolean;
|
|
541
552
|
url: string;
|
|
553
|
+
public_url: string | null;
|
|
542
554
|
};
|
|
543
555
|
export type PartialBlockObjectResponse = {
|
|
544
556
|
object: "block";
|
|
@@ -1628,6 +1640,15 @@ export type FormulaPropertyItemObjectResponse = {
|
|
|
1628
1640
|
object: "property_item";
|
|
1629
1641
|
id: string;
|
|
1630
1642
|
};
|
|
1643
|
+
export type UniqueIdPropertyItemObjectResponse = {
|
|
1644
|
+
type: "unique_id";
|
|
1645
|
+
unique_id: {
|
|
1646
|
+
prefix: string | null;
|
|
1647
|
+
number: number | null;
|
|
1648
|
+
};
|
|
1649
|
+
object: "property_item";
|
|
1650
|
+
id: string;
|
|
1651
|
+
};
|
|
1631
1652
|
export type TitlePropertyItemObjectResponse = {
|
|
1632
1653
|
type: "title";
|
|
1633
1654
|
title: RichTextItemResponse;
|
|
@@ -1680,7 +1701,7 @@ export type RollupPropertyItemObjectResponse = {
|
|
|
1680
1701
|
object: "property_item";
|
|
1681
1702
|
id: string;
|
|
1682
1703
|
};
|
|
1683
|
-
export type PropertyItemObjectResponse = NumberPropertyItemObjectResponse | UrlPropertyItemObjectResponse | SelectPropertyItemObjectResponse | MultiSelectPropertyItemObjectResponse | StatusPropertyItemObjectResponse | DatePropertyItemObjectResponse | EmailPropertyItemObjectResponse | PhoneNumberPropertyItemObjectResponse | CheckboxPropertyItemObjectResponse | FilesPropertyItemObjectResponse | CreatedByPropertyItemObjectResponse | CreatedTimePropertyItemObjectResponse | LastEditedByPropertyItemObjectResponse | LastEditedTimePropertyItemObjectResponse | FormulaPropertyItemObjectResponse | TitlePropertyItemObjectResponse | RichTextPropertyItemObjectResponse | PeoplePropertyItemObjectResponse | RelationPropertyItemObjectResponse | RollupPropertyItemObjectResponse;
|
|
1704
|
+
export type PropertyItemObjectResponse = NumberPropertyItemObjectResponse | UrlPropertyItemObjectResponse | SelectPropertyItemObjectResponse | MultiSelectPropertyItemObjectResponse | StatusPropertyItemObjectResponse | DatePropertyItemObjectResponse | EmailPropertyItemObjectResponse | PhoneNumberPropertyItemObjectResponse | CheckboxPropertyItemObjectResponse | FilesPropertyItemObjectResponse | CreatedByPropertyItemObjectResponse | CreatedTimePropertyItemObjectResponse | LastEditedByPropertyItemObjectResponse | LastEditedTimePropertyItemObjectResponse | FormulaPropertyItemObjectResponse | UniqueIdPropertyItemObjectResponse | TitlePropertyItemObjectResponse | RichTextPropertyItemObjectResponse | PeoplePropertyItemObjectResponse | RelationPropertyItemObjectResponse | RollupPropertyItemObjectResponse;
|
|
1684
1705
|
export type CommentObjectResponse = {
|
|
1685
1706
|
object: "comment";
|
|
1686
1707
|
id: string;
|
|
@@ -5672,6 +5693,9 @@ export declare const listUsers: {
|
|
|
5672
5693
|
};
|
|
5673
5694
|
type CreatePageBodyParameters = {
|
|
5674
5695
|
parent: {
|
|
5696
|
+
page_id: IdRequest;
|
|
5697
|
+
type?: "page_id";
|
|
5698
|
+
} | {
|
|
5675
5699
|
database_id: IdRequest;
|
|
5676
5700
|
type?: "database_id";
|
|
5677
5701
|
};
|
|
@@ -5885,33 +5909,6 @@ type CreatePageBodyParameters = {
|
|
|
5885
5909
|
} | null;
|
|
5886
5910
|
content?: Array<BlockObjectRequest>;
|
|
5887
5911
|
children?: Array<BlockObjectRequest>;
|
|
5888
|
-
} | {
|
|
5889
|
-
parent: {
|
|
5890
|
-
page_id: IdRequest;
|
|
5891
|
-
type?: "page_id";
|
|
5892
|
-
};
|
|
5893
|
-
properties: {
|
|
5894
|
-
title?: {
|
|
5895
|
-
title: Array<RichTextItemRequest>;
|
|
5896
|
-
type?: "title";
|
|
5897
|
-
} | Array<RichTextItemRequest>;
|
|
5898
|
-
};
|
|
5899
|
-
icon?: {
|
|
5900
|
-
emoji: EmojiRequest;
|
|
5901
|
-
type?: "emoji";
|
|
5902
|
-
} | null | {
|
|
5903
|
-
external: {
|
|
5904
|
-
url: TextRequest;
|
|
5905
|
-
};
|
|
5906
|
-
type?: "external";
|
|
5907
|
-
} | null;
|
|
5908
|
-
cover?: {
|
|
5909
|
-
external: {
|
|
5910
|
-
url: TextRequest;
|
|
5911
|
-
};
|
|
5912
|
-
type?: "external";
|
|
5913
|
-
} | null;
|
|
5914
|
-
children?: Array<BlockObjectRequest>;
|
|
5915
5912
|
};
|
|
5916
5913
|
export type CreatePageParameters = CreatePageBodyParameters;
|
|
5917
5914
|
export type CreatePageResponse = PageObjectResponse | PartialPageObjectResponse;
|
|
@@ -6455,6 +6452,7 @@ type AppendBlockChildrenPathParameters = {
|
|
|
6455
6452
|
};
|
|
6456
6453
|
type AppendBlockChildrenBodyParameters = {
|
|
6457
6454
|
children: Array<BlockObjectRequest>;
|
|
6455
|
+
after?: IdRequest;
|
|
6458
6456
|
};
|
|
6459
6457
|
export type AppendBlockChildrenParameters = AppendBlockChildrenPathParameters & AppendBlockChildrenBodyParameters;
|
|
6460
6458
|
export type AppendBlockChildrenResponse = {
|
|
@@ -6469,7 +6467,7 @@ export declare const appendBlockChildren: {
|
|
|
6469
6467
|
readonly method: "patch";
|
|
6470
6468
|
readonly pathParams: readonly ["block_id"];
|
|
6471
6469
|
readonly queryParams: readonly [];
|
|
6472
|
-
readonly bodyParams: readonly ["children"];
|
|
6470
|
+
readonly bodyParams: readonly ["children", "after"];
|
|
6473
6471
|
readonly path: (p: AppendBlockChildrenPathParameters) => string;
|
|
6474
6472
|
};
|
|
6475
6473
|
type GetDatabasePathParameters = {
|
|
@@ -6545,10 +6543,6 @@ type UpdateDatabaseBodyParameters = {
|
|
|
6545
6543
|
};
|
|
6546
6544
|
type?: "multi_select";
|
|
6547
6545
|
name?: string;
|
|
6548
|
-
} | null | {
|
|
6549
|
-
status: EmptyObject;
|
|
6550
|
-
type?: "status";
|
|
6551
|
-
name?: string;
|
|
6552
6546
|
} | null | {
|
|
6553
6547
|
relation: {
|
|
6554
6548
|
single_property: EmptyObject;
|
|
@@ -6689,12 +6683,12 @@ type QueryDatabaseBodyParameters = {
|
|
|
6689
6683
|
};
|
|
6690
6684
|
export type QueryDatabaseParameters = QueryDatabasePathParameters & QueryDatabaseQueryParameters & QueryDatabaseBodyParameters;
|
|
6691
6685
|
export type QueryDatabaseResponse = {
|
|
6692
|
-
type: "
|
|
6693
|
-
|
|
6686
|
+
type: "page_or_database";
|
|
6687
|
+
page_or_database: EmptyObject;
|
|
6694
6688
|
object: "list";
|
|
6695
6689
|
next_cursor: string | null;
|
|
6696
6690
|
has_more: boolean;
|
|
6697
|
-
results: Array<PageObjectResponse | PartialPageObjectResponse>;
|
|
6691
|
+
results: Array<PageObjectResponse | PartialPageObjectResponse | PartialDatabaseObjectResponse | DatabaseObjectResponse>;
|
|
6698
6692
|
};
|
|
6699
6693
|
export declare const queryDatabase: {
|
|
6700
6694
|
readonly method: "post";
|
|
@@ -6727,6 +6721,9 @@ type CreateDatabaseBodyParameters = {
|
|
|
6727
6721
|
parent: {
|
|
6728
6722
|
page_id: IdRequest;
|
|
6729
6723
|
type?: "page_id";
|
|
6724
|
+
} | {
|
|
6725
|
+
database_id: IdRequest;
|
|
6726
|
+
type?: "database_id";
|
|
6730
6727
|
};
|
|
6731
6728
|
properties: Record<string, {
|
|
6732
6729
|
number: {
|
|
@@ -6754,9 +6751,6 @@ type CreateDatabaseBodyParameters = {
|
|
|
6754
6751
|
}>;
|
|
6755
6752
|
};
|
|
6756
6753
|
type?: "multi_select";
|
|
6757
|
-
} | {
|
|
6758
|
-
status: EmptyObject;
|
|
6759
|
-
type?: "status";
|
|
6760
6754
|
} | {
|
|
6761
6755
|
relation: {
|
|
6762
6756
|
single_property: EmptyObject;
|
|
@@ -6932,5 +6926,47 @@ export declare const listComments: {
|
|
|
6932
6926
|
readonly bodyParams: readonly [];
|
|
6933
6927
|
readonly path: () => string;
|
|
6934
6928
|
};
|
|
6929
|
+
type OauthTokenBodyParameters = {
|
|
6930
|
+
grant_type: string;
|
|
6931
|
+
code: string;
|
|
6932
|
+
redirect_uri?: string;
|
|
6933
|
+
external_account?: {
|
|
6934
|
+
key: string;
|
|
6935
|
+
name: string;
|
|
6936
|
+
};
|
|
6937
|
+
};
|
|
6938
|
+
export type OauthTokenParameters = OauthTokenBodyParameters;
|
|
6939
|
+
export type OauthTokenResponse = {
|
|
6940
|
+
access_token: string;
|
|
6941
|
+
token_type: "bearer";
|
|
6942
|
+
bot_id: string;
|
|
6943
|
+
workspace_icon: string | null;
|
|
6944
|
+
workspace_name: string | null;
|
|
6945
|
+
workspace_id: string;
|
|
6946
|
+
owner: {
|
|
6947
|
+
type: "user";
|
|
6948
|
+
user: {
|
|
6949
|
+
type: "person";
|
|
6950
|
+
person: {
|
|
6951
|
+
email: string;
|
|
6952
|
+
};
|
|
6953
|
+
name: string | null;
|
|
6954
|
+
avatar_url: string | null;
|
|
6955
|
+
id: IdRequest;
|
|
6956
|
+
object: "user";
|
|
6957
|
+
} | PartialUserObjectResponse;
|
|
6958
|
+
} | {
|
|
6959
|
+
type: "workspace";
|
|
6960
|
+
workspace: true;
|
|
6961
|
+
};
|
|
6962
|
+
duplicated_template_id: string | null;
|
|
6963
|
+
};
|
|
6964
|
+
export declare const oauthToken: {
|
|
6965
|
+
readonly method: "post";
|
|
6966
|
+
readonly pathParams: readonly [];
|
|
6967
|
+
readonly queryParams: readonly [];
|
|
6968
|
+
readonly bodyParams: readonly ["grant_type", "code", "redirect_uri", "external_account"];
|
|
6969
|
+
readonly path: () => string;
|
|
6970
|
+
};
|
|
6935
6971
|
export {};
|
|
6936
6972
|
//# sourceMappingURL=api-endpoints.d.ts.map
|