From 516bd0451ea3e82ef829cd697e3bfa73deaf2831 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 25 Nov 2025 15:11:42 -0300 Subject: [PATCH 1/7] Adding missing parameters to get-page-by-id --- .../actions/get-page-by-id/get-page-by-id.mjs | 52 ++++++++++++++++++- components/confluence/common/constants.mjs | 13 +++++ components/confluence/common/utils.mjs | 29 +++++++++++ components/confluence/confluence.app.mjs | 6 +-- 4 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 components/confluence/common/constants.mjs create mode 100644 components/confluence/common/utils.mjs diff --git a/components/confluence/actions/get-page-by-id/get-page-by-id.mjs b/components/confluence/actions/get-page-by-id/get-page-by-id.mjs index 82dbacead4d5b..c01b67d36b43d 100644 --- a/components/confluence/actions/get-page-by-id/get-page-by-id.mjs +++ b/components/confluence/actions/get-page-by-id/get-page-by-id.mjs @@ -1,10 +1,12 @@ import confluence from "../../confluence.app.mjs"; +import { BODY_FORMAT_FULL_OPTIONS } from "../../common/constants.mjs"; +import { parseObjectEntries } from "../../common/utils.mjs"; export default { key: "confluence-get-page-by-id", name: "Get Page by ID", description: "Retrieve a page by its ID. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get)", - version: "0.0.2", + version: "0.1.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -19,6 +21,47 @@ export default { "pageId", ], }, + bodyFormat: { + type: "string", + label: "Body Format", + description: "The content format types to be returned in the `body` field of the response. If available, the representation will be available under a response field of the same name under the `body` field.", + optional: true, + options: BODY_FORMAT_FULL_OPTIONS, + }, + getDraft: { + type: "boolean", + label: "Get Draft", + description: "If true, retrieves the draft version of this page.", + optional: true, + default: false, + }, + status: { + type: "string[]", + label: "Status", + description: "Filter the page being retrieved by its status.", + optional: true, + options: [ + "current", + "archived", + "trashed", + "deleted", + "historical", + "draft", + ], + }, + version: { + type: "integer", + label: "Version", + description: "Allows you to retrieve a previously published version. Specify the previous version's number to retrieve its details.", + optional: true, + }, + additionalOptions: { + type: "object", + label: "Additional Options", + description: + "Additional parameters to send in the request. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get) for available parameters. Values will be parsed as JSON where applicable.", + optional: true, + }, }, async run({ $ }) { const cloudId = await this.confluence.getCloudId({ @@ -28,6 +71,13 @@ export default { $, cloudId, pageId: this.pageId, + params: { + "body-format": this.bodyFormat, + "get-draft": this.getDraft, + "status": this.status, + "version": this.version, + ...parseObjectEntries(this.additionalOptions), + }, }); $.export("$summary", `Successfully retrieved page with ID: ${this.pageId}`); return response; diff --git a/components/confluence/common/constants.mjs b/components/confluence/common/constants.mjs new file mode 100644 index 0000000000000..beb38a9292dbe --- /dev/null +++ b/components/confluence/common/constants.mjs @@ -0,0 +1,13 @@ +export const BODY_FORMAT_OPTIONS = [ + "storage", + "atlas_doc_format", +]; + +export const BODY_FORMAT_FULL_OPTIONS = [ + ...BODY_FORMAT_OPTIONS, + "view", + "export_view", + "anonymous_export_view", + "styled_view", + "editor", +]; diff --git a/components/confluence/common/utils.mjs b/components/confluence/common/utils.mjs new file mode 100644 index 0000000000000..52f696c9654e7 --- /dev/null +++ b/components/confluence/common/utils.mjs @@ -0,0 +1,29 @@ +import { ConfigurationError } from "@pipedream/platform"; + +function optionalParseAsJSON(value) { + try { + return JSON.parse(value); + } catch (e) { + return value; + } +} + +export function parseObjectEntries(value = {}) { + if (typeof value === "string") { + try { + value = JSON.parse(value); + } catch (e) { + throw new ConfigurationError(`Invalid JSON string provided: ${e.message}`); + } + } + + return Object.fromEntries( + Object.entries(value).map(([ + key, + value, + ]) => [ + key, + optionalParseAsJSON(value), + ]), + ); +} diff --git a/components/confluence/confluence.app.mjs b/components/confluence/confluence.app.mjs index 70c98b34fb2d6..99424ba3db120 100644 --- a/components/confluence/confluence.app.mjs +++ b/components/confluence/confluence.app.mjs @@ -1,4 +1,5 @@ import { axios } from "@pipedream/platform"; +import { BODY_FORMAT_OPTIONS } from "./common/constants.mjs"; export default { type: "app", @@ -192,10 +193,7 @@ export default { type: "string", label: "Body Format", description: "The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.", - options: [ - "storage", - "atlas_doc_format", - ], + options: BODY_FORMAT_OPTIONS, optional: true, }, subType: { From 30cc3798377f5311760abf7f1218788259043049 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 25 Nov 2025 15:15:35 -0300 Subject: [PATCH 2/7] Version bumps --- .../get-pages-in-space/get-pages-in-space.mjs | 21 +++++++------------ .../actions/get-pages/get-pages.mjs | 16 +++++++------- components/confluence/package.json | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/components/confluence/actions/get-pages-in-space/get-pages-in-space.mjs b/components/confluence/actions/get-pages-in-space/get-pages-in-space.mjs index 2b8d2e243094a..0edec6abbf091 100644 --- a/components/confluence/actions/get-pages-in-space/get-pages-in-space.mjs +++ b/components/confluence/actions/get-pages-in-space/get-pages-in-space.mjs @@ -4,7 +4,7 @@ export default { key: "confluence-get-pages-in-space", name: "Get Pages in Space", description: "Retrieve a list of pages in a space. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-spaces-id-pages-get)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, @@ -43,12 +43,6 @@ export default { "bodyFormat", ], }, - subType: { - propDefinition: [ - confluence, - "subType", - ], - }, cursor: { propDefinition: [ confluence, @@ -71,13 +65,12 @@ export default { cloudId, spaceId: this.spaceId, params: { - sort: this.sort, - status: this.status, - title: this.pageTitle, - bodyFormat: this.bodyFormat, - subType: this.subType, - cursor: this.cursor, - limit: this.limit, + "sort": this.sort, + "status": this.status, + "title": this.pageTitle, + "body-format": this.bodyFormat, + "cursor": this.cursor, + "limit": this.limit, }, }); $.export("$summary", `Successfully retrieved ${response.results.length} page${response.results.length === 1 diff --git a/components/confluence/actions/get-pages/get-pages.mjs b/components/confluence/actions/get-pages/get-pages.mjs index 0face2ab0123e..f8af53ea895b3 100644 --- a/components/confluence/actions/get-pages/get-pages.mjs +++ b/components/confluence/actions/get-pages/get-pages.mjs @@ -4,7 +4,7 @@ export default { key: "confluence-get-pages", name: "Get Pages", description: "Retrieve a list of pages. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-get)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, @@ -64,13 +64,13 @@ export default { $, cloudId, params: { - sort: this.sort, - status: this.status, - title: this.pageTitle, - bodyFormat: this.bodyFormat, - subType: this.subType, - cursor: this.cursor, - limit: this.limit, + "sort": this.sort, + "status": this.status, + "title": this.pageTitle, + "body-format": this.bodyFormat, + "subtype": this.subType, + "cursor": this.cursor, + "limit": this.limit, }, }); $.export("$summary", `Successfully retrieved ${response.results.length} page${response.results.length === 1 diff --git a/components/confluence/package.json b/components/confluence/package.json index 78ad91aa16a2d..d4afd2641eb26 100644 --- a/components/confluence/package.json +++ b/components/confluence/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/confluence", - "version": "0.3.0", + "version": "0.4.0", "description": "Pipedream Confluence Components", "main": "confluence.app.mjs", "keywords": [ From ccdd7c699e05c179f1da9663067b4cc996596ace Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 25 Nov 2025 15:32:03 -0300 Subject: [PATCH 3/7] Improving object check --- components/confluence/common/utils.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/confluence/common/utils.mjs b/components/confluence/common/utils.mjs index 52f696c9654e7..c9ab7d92e53d1 100644 --- a/components/confluence/common/utils.mjs +++ b/components/confluence/common/utils.mjs @@ -8,17 +8,17 @@ function optionalParseAsJSON(value) { } } -export function parseObjectEntries(value = {}) { - if (typeof value === "string") { +export function parseObjectEntries(obj = {}) { + if (typeof obj === "string") { try { - value = JSON.parse(value); + obj = JSON.parse(obj); } catch (e) { throw new ConfigurationError(`Invalid JSON string provided: ${e.message}`); } } return Object.fromEntries( - Object.entries(value).map(([ + Object.entries(obj || {}).map(([ key, value, ]) => [ From e27e80c645c54b6861ed77854ab64ac3ab2f049b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Falc=C3=A3o?= <48412907+GTFalcao@users.noreply.github.com> Date: Tue, 25 Nov 2025 15:38:17 -0300 Subject: [PATCH 4/7] Update components/confluence/common/utils.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- components/confluence/common/utils.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/confluence/common/utils.mjs b/components/confluence/common/utils.mjs index c9ab7d92e53d1..cced6fd6290d5 100644 --- a/components/confluence/common/utils.mjs +++ b/components/confluence/common/utils.mjs @@ -1,6 +1,10 @@ import { ConfigurationError } from "@pipedream/platform"; function optionalParseAsJSON(value) { + if (typeof value !== "string") { + return value; + } + try { return JSON.parse(value); } catch (e) { From a30be4241a4ba54e9183860e2be9faacaee45e17 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Tue, 25 Nov 2025 13:59:35 -0500 Subject: [PATCH 5/7] versions --- components/confluence/actions/create-page/create-page.mjs | 2 +- components/confluence/actions/create-post/create-post.mjs | 2 +- components/confluence/actions/delete-post/delete-post.mjs | 2 +- components/confluence/actions/search-content/search-content.mjs | 2 +- components/confluence/actions/update-post/update-post.mjs | 2 +- .../sources/new-page-or-blog-post/new-page-or-blog-post.mjs | 2 +- .../confluence/sources/watch-blog-posts/watch-blog-posts.mjs | 2 +- components/confluence/sources/watch-pages/watch-pages.mjs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/confluence/actions/create-page/create-page.mjs b/components/confluence/actions/create-page/create-page.mjs index 014c36cd45774..e992e3fb738b4 100644 --- a/components/confluence/actions/create-page/create-page.mjs +++ b/components/confluence/actions/create-page/create-page.mjs @@ -4,7 +4,7 @@ export default { key: "confluence-create-page", name: "Create Page", description: "Creates a new page in the space. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/confluence/actions/create-post/create-post.mjs b/components/confluence/actions/create-post/create-post.mjs index b8e28a79bef65..f092db3e92d2d 100644 --- a/components/confluence/actions/create-post/create-post.mjs +++ b/components/confluence/actions/create-post/create-post.mjs @@ -4,7 +4,7 @@ export default { key: "confluence-create-post", name: "Create Post", description: "Creates a new page or blog post on Confluence. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/#api-blogposts-post)", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/confluence/actions/delete-post/delete-post.mjs b/components/confluence/actions/delete-post/delete-post.mjs index 4e302535a38cd..01cde4e80fc40 100644 --- a/components/confluence/actions/delete-post/delete-post.mjs +++ b/components/confluence/actions/delete-post/delete-post.mjs @@ -4,7 +4,7 @@ export default { key: "confluence-delete-post", name: "Delete Post", description: "Removes a blog post from Confluence by its ID. Use with caution, the action is irreversible. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/#api-blogposts-id-delete)", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/confluence/actions/search-content/search-content.mjs b/components/confluence/actions/search-content/search-content.mjs index 2db2191066b5c..d7417c45818b0 100644 --- a/components/confluence/actions/search-content/search-content.mjs +++ b/components/confluence/actions/search-content/search-content.mjs @@ -4,7 +4,7 @@ export default { key: "confluence-search-content", name: "Search Content", description: "Searches for content using the Confluence Query Language (CQL). [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search#api-wiki-rest-api-search-get)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/confluence/actions/update-post/update-post.mjs b/components/confluence/actions/update-post/update-post.mjs index 13db6d9eb2e97..0349b24f4cd3c 100644 --- a/components/confluence/actions/update-post/update-post.mjs +++ b/components/confluence/actions/update-post/update-post.mjs @@ -5,7 +5,7 @@ export default { key: "confluence-update-post", name: "Update a Post", description: "Updates a page or blog post on Confluence by its ID. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/#api-blogposts-id-put)", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs b/components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs index ecc90c11b8c79..8baad62bac8ff 100644 --- a/components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs +++ b/components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs @@ -6,7 +6,7 @@ export default { key: "confluence-new-page-or-blog-post", name: "New Page or Blog Post", description: "Emit new event whenever a new page or blog post is created in a specified space", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", props: { diff --git a/components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs b/components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs index 00d0af2b7b21c..78deea38ad6f3 100644 --- a/components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs +++ b/components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs @@ -6,7 +6,7 @@ export default { key: "confluence-watch-blog-posts", name: "Watch Blog Posts", description: "Emit new event when a blog post is created or updated", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/confluence/sources/watch-pages/watch-pages.mjs b/components/confluence/sources/watch-pages/watch-pages.mjs index 1a52abe014395..e241b17a8e62c 100644 --- a/components/confluence/sources/watch-pages/watch-pages.mjs +++ b/components/confluence/sources/watch-pages/watch-pages.mjs @@ -6,7 +6,7 @@ export default { key: "confluence-watch-pages", name: "Watch Pages", description: "Emit new event when a page is created or updated in Confluence", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { From 13197e61dd6f6d6cc204e8d23cf1a7ab297f0fd6 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Tue, 25 Nov 2025 14:21:06 -0500 Subject: [PATCH 6/7] use bodyFormat propDefinition --- .../actions/get-page-by-id/get-page-by-id.mjs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/confluence/actions/get-page-by-id/get-page-by-id.mjs b/components/confluence/actions/get-page-by-id/get-page-by-id.mjs index c01b67d36b43d..b4c79ed4f9f0b 100644 --- a/components/confluence/actions/get-page-by-id/get-page-by-id.mjs +++ b/components/confluence/actions/get-page-by-id/get-page-by-id.mjs @@ -1,5 +1,4 @@ import confluence from "../../confluence.app.mjs"; -import { BODY_FORMAT_FULL_OPTIONS } from "../../common/constants.mjs"; import { parseObjectEntries } from "../../common/utils.mjs"; export default { @@ -22,11 +21,10 @@ export default { ], }, bodyFormat: { - type: "string", - label: "Body Format", - description: "The content format types to be returned in the `body` field of the response. If available, the representation will be available under a response field of the same name under the `body` field.", - optional: true, - options: BODY_FORMAT_FULL_OPTIONS, + propDefinition: [ + confluence, + "bodyFormat", + ], }, getDraft: { type: "boolean", From 3ca2d5fc614c776fd990665643bfed2c1cc691ce Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Tue, 25 Nov 2025 16:32:24 -0300 Subject: [PATCH 7/7] Adjusting options --- components/confluence/actions/get-page-by-id/get-page-by-id.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/confluence/actions/get-page-by-id/get-page-by-id.mjs b/components/confluence/actions/get-page-by-id/get-page-by-id.mjs index b4c79ed4f9f0b..c7167214bf292 100644 --- a/components/confluence/actions/get-page-by-id/get-page-by-id.mjs +++ b/components/confluence/actions/get-page-by-id/get-page-by-id.mjs @@ -1,5 +1,6 @@ import confluence from "../../confluence.app.mjs"; import { parseObjectEntries } from "../../common/utils.mjs"; +import { BODY_FORMAT_FULL_OPTIONS } from "../../common/constants.mjs"; export default { key: "confluence-get-page-by-id", @@ -25,6 +26,7 @@ export default { confluence, "bodyFormat", ], + options: BODY_FORMAT_FULL_OPTIONS, }, getDraft: { type: "boolean",