Skip to content

Commit c9c41ae

Browse files
committed
Updating notion-to-md to use stable version
1 parent e10500a commit c9c41ae

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

components/notion/actions/retrieve-block/retrieve-block.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "notion-retrieve-block",
55
name: "Retrieve Page Content",
66
description: "Get page content as block objects or markdown. Blocks can be text, lists, media, a page, among others. [See the documentation](https://developers.notion.com/reference/retrieve-a-block)",
7-
version: "0.2.1",
7+
version: "0.2.2",
88
type: "action",
99
props: {
1010
notion,

components/notion/notion.app.mjs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import notion from "@notionhq/client";
22
import NOTION_META from "./common/notion-meta-selection.mjs";
33
import { ConfigurationError } from "@pipedream/platform";
4-
import { NotionConverter } from "notion-to-md";
5-
import { DefaultExporter } from "notion-to-md/plugins/exporter";
4+
import { NotionToMarkdown } from "notion-to-md";
65

76
export default {
87
type: "app",
@@ -359,18 +358,13 @@ export default {
359358
return response.results;
360359
},
361360
async getPageAsMarkdown(pageId) {
362-
const client = this._getNotionClient();
361+
const notionClient = this._getNotionClient();
363362

364-
const buffer = {};
365-
const exporter = new DefaultExporter({
366-
outputType: "buffer",
367-
buffer,
363+
const n2m = new NotionToMarkdown({
364+
notionClient,
368365
});
369-
370-
const n2m = new NotionConverter(client).withExporter(exporter);
371-
await n2m.convert(pageId);
372-
373-
return Object.values(buffer)[0];
366+
const blocks = await n2m.pageToMarkdown(pageId);
367+
return n2m.toMarkdownString(blocks).parent;
374368
},
375369
},
376370
};

components/notion/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/notion",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "Pipedream Notion Components",
55
"main": "notion.app.mjs",
66
"keywords": [
@@ -14,7 +14,7 @@
1414
"@pipedream/platform": "^3.0.3",
1515
"@tryfabric/martian": "^1.2.4",
1616
"lodash-es": "^4.17.21",
17-
"notion-to-md": "^4.0.0-alpha.4"
17+
"notion-to-md": "^3.1.8"
1818
},
1919
"publishConfig": {
2020
"access": "public"

pnpm-lock.yaml

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)