@secret-momo/notion 2.0.0 → 2.0.1
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/lib/notion-client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type PageObjectResponse } from '@notionhq/client';
|
|
1
|
+
import { type CreatePageParameters, type PageObjectResponse } from '@notionhq/client';
|
|
2
2
|
export declare class NotionClient {
|
|
3
3
|
private client;
|
|
4
4
|
constructor(authToken?: string);
|
|
5
|
+
createPage(args: CreatePageParameters): Promise<import("@notionhq/client").CreatePageResponse>;
|
|
5
6
|
traverseDataSource(cb: (item: PageObjectResponse) => void, dataSourceId?: string): Promise<void>;
|
|
6
7
|
appendDivider(blockId: string): Promise<void>;
|
|
7
8
|
appendMarkdown(pageId: string, markdown: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notion-client.d.ts","sourceRoot":"","sources":["../src/notion-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"notion-client.d.ts","sourceRoot":"","sources":["../src/notion-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK9F,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAS;gBAEX,SAAS,CAAC,EAAE,MAAM;IAQxB,UAAU,CAAC,IAAI,EAAE,oBAAoB;IAIrC,kBAAkB,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,EAAE,YAAY,CAAC,EAAE,MAAM;IAOhF,aAAa,CAAC,OAAO,EAAE,MAAM;IAO7B,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAQrD;;;;OAIG;IACG,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAiB/D;;;;OAIG;IACG,mBAAmB,CAAC,YAAY,EAAE,MAAM;IAI9C;;OAEG;IACG,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAiBhE;;OAEG;IACG,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAUjE"}
|
package/lib/notion-client.js
CHANGED
|
@@ -12,6 +12,9 @@ class NotionClient {
|
|
|
12
12
|
// 10 分钟超时的时间
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
async createPage(args) {
|
|
16
|
+
return this.client.pages.create(args);
|
|
17
|
+
}
|
|
15
18
|
async traverseDataSource(cb, dataSourceId) {
|
|
16
19
|
const data_source_id = dataSourceId ?? process.env.NOTION_DATA_SOURCE_ID ?? "";
|
|
17
20
|
const data = await this.client.dataSources.query({ data_source_id });
|