diff --git a/components/notion/actions/retrieve-block/retrieve-block.mjs b/components/notion/actions/retrieve-block/retrieve-block.mjs index de4baabe59443..c14647bd69097 100644 --- a/components/notion/actions/retrieve-block/retrieve-block.mjs +++ b/components/notion/actions/retrieve-block/retrieve-block.mjs @@ -4,7 +4,7 @@ export default { key: "notion-retrieve-block", name: "Retrieve Page Content", 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)", - version: "0.2.0", + version: "0.2.1", type: "action", props: { notion, @@ -42,14 +42,15 @@ export default { const subpagesOnly = retrieveChildren === "Sub-Pages Only"; const block = await this.notion.retrieveBlock(this.blockId); - if ([ + const shouldRetrieveChildren = [ true, "All Children", "Sub-Pages Only", - ].includes(retrieveChildren)) { + ].includes(retrieveChildren); + if (shouldRetrieveChildren) { block.children = await this.notion.retrieveBlockChildren(block, subpagesOnly); } - $.export("$summary", `Successfully retrieved block${retrieveChildren + $.export("$summary", `Successfully retrieved block${shouldRetrieveChildren ? ` with ${block.children.length ?? 0} ${subpagesOnly ? "sub-pages" : "children"}` diff --git a/components/notion/package.json b/components/notion/package.json index 40006891159ed..eb2fb03e09613 100644 --- a/components/notion/package.json +++ b/components/notion/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/notion", - "version": "0.6.0", + "version": "0.6.1", "description": "Pipedream Notion Components", "main": "notion.app.mjs", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac53778cc0680..db39d6065bc01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34555,6 +34555,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: