From e868ecc89f765a481096d7cf051a1764a99d4779 Mon Sep 17 00:00:00 2001 From: akbar-kurnia1 Date: Sun, 16 Nov 2025 14:45:27 +0700 Subject: [PATCH 1/7] feat (hootsuit): add list-social-profiles action (closes #19083) --- .../list-social-profiles.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 components/hootsuite/actions/list-social-profiles/list-social-profiles.js diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js new file mode 100644 index 0000000000000..9c9f6b823c5e8 --- /dev/null +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js @@ -0,0 +1,28 @@ +import { axios } from "@pipedream/platform"; + +export default { + props: { + hootsuite: { + type: "app", + app: "hootsuite", + }, + }, + + async run({ props }) { + const token = props.hootsuite.$auth.oauth_access_token; + const url = "https://api.hootsuite.com/v1/socialProfiles"; + try { + const response = await axios(this, { + method: "GET", + url: url, + headers: { + "Authorization": `Bearer ${token}`, + }, + }); + return response.data.data; + } catch (error) { + console.error("API call to Hootsuite failed:", error.response.data); + throw new Error(`Failed to retrieve social profiles. Error: ${error.response.data.errors[0].message}`); + } + }, +}; \ No newline at end of file From 2588e8f09a8a0d860116e136374626df6ebdc2f9 Mon Sep 17 00:00:00 2001 From: Akbar Kurniawan <100073066+akbar-kurnia1@users.noreply.github.com> Date: Sun, 16 Nov 2025 15:12:16 +0700 Subject: [PATCH 2/7] Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../actions/list-social-profiles/list-social-profiles.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js index 9c9f6b823c5e8..87a2c855b9349 100644 --- a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js @@ -1,6 +1,11 @@ import { axios } from "@pipedream/platform"; export default { + key: "hootsuite-list-social-profiles", + name: "List Social Profiles", + description: "Retrieves a list of social profiles for the authenticated Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/getSocialProfiles)", + version: "0.0.1", + type: "action", props: { hootsuite: { type: "app", From 8e22210054b8f0b2ffc578341b92c69a2d334948 Mon Sep 17 00:00:00 2001 From: Akbar Kurniawan <100073066+akbar-kurnia1@users.noreply.github.com> Date: Sun, 16 Nov 2025 15:12:32 +0700 Subject: [PATCH 3/7] Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../actions/list-social-profiles/list-social-profiles.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js index 87a2c855b9349..5884ee7090b67 100644 --- a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js @@ -18,10 +18,9 @@ export default { const url = "https://api.hootsuite.com/v1/socialProfiles"; try { const response = await axios(this, { - method: "GET", - url: url, + url, headers: { - "Authorization": `Bearer ${token}`, + Authorization: `Bearer ${token}`, }, }); return response.data.data; From 1ce6386fa7ee7e5e683382f7992b43c7299e7400 Mon Sep 17 00:00:00 2001 From: Akbar Kurniawan <100073066+akbar-kurnia1@users.noreply.github.com> Date: Sun, 16 Nov 2025 15:13:56 +0700 Subject: [PATCH 4/7] Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../actions/list-social-profiles/list-social-profiles.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js index 5884ee7090b67..28dc49cc84786 100644 --- a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js @@ -25,8 +25,9 @@ export default { }); return response.data.data; } catch (error) { - console.error("API call to Hootsuite failed:", error.response.data); - throw new Error(`Failed to retrieve social profiles. Error: ${error.response.data.errors[0].message}`); + console.error("API call to Hootsuite failed:", error.response?.data || error.message); + const errorMessage = error.response?.data?.errors?.[0]?.message || error.message || "Unknown error"; + throw new Error(`Failed to retrieve social profiles. Error: ${errorMessage}`); } }, }; \ No newline at end of file From 18f1ecced89ad4ef4ad870659be03048fd535035 Mon Sep 17 00:00:00 2001 From: Akbar Kurniawan <100073066+akbar-kurnia1@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:28:59 +0700 Subject: [PATCH 5/7] Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../actions/list-social-profiles/list-social-profiles.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js index 28dc49cc84786..3b3b6dac86170 100644 --- a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js @@ -13,6 +13,12 @@ export default { }, }, + /** + * Retrieves all social profiles for the authenticated Hootsuite account + * @param {object} params - The parameters object + * @param {object} params.props - The action props containing the hootsuite app + * @returns {Promise} An array of social profile objects from Hootsuite + */ async run({ props }) { const token = props.hootsuite.$auth.oauth_access_token; const url = "https://api.hootsuite.com/v1/socialProfiles"; From 444ffe59c16345f276c30fabdd52fc06f1f1b11a Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 17 Nov 2025 11:53:53 -0500 Subject: [PATCH 6/7] updates --- .../create-media-upload-job.mjs | 2 +- .../get-media-upload-status.mjs | 2 +- .../list-social-profiles.js | 31 +++++++++---------- .../schedule-message/schedule-message.mjs | 2 +- components/hootsuite/hootsuite.app.mjs | 3 +- components/hootsuite/package.json | 2 +- .../new-post-created/new-post-created.mjs | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs b/components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs index 8382fe5a9f51d..f7493de787472 100644 --- a/components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs +++ b/components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs @@ -5,7 +5,7 @@ export default { key: "hootsuite-create-media-upload-job", name: "Create Media Upload Job", description: "Creates a new Media Upload Job on your Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/createMedia)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs b/components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs index 84858ba59913c..a695b3d119d70 100644 --- a/components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs +++ b/components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs @@ -4,7 +4,7 @@ export default { key: "hootsuite-get-media-upload-status", name: "Get Media Upload Status", description: "Gets the status of a Media Upload Job on your Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/getMedia)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js index 3b3b6dac86170..4dacd7647dfb8 100644 --- a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.js @@ -1,4 +1,4 @@ -import { axios } from "@pipedream/platform"; +import hootsuite from "../../hootsuite.app.mjs"; export default { key: "hootsuite-list-social-profiles", @@ -6,34 +6,33 @@ export default { description: "Retrieves a list of social profiles for the authenticated Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/getSocialProfiles)", version: "0.0.1", type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, props: { - hootsuite: { - type: "app", - app: "hootsuite", - }, + hootsuite, }, - /** * Retrieves all social profiles for the authenticated Hootsuite account * @param {object} params - The parameters object * @param {object} params.props - The action props containing the hootsuite app * @returns {Promise} An array of social profile objects from Hootsuite */ - async run({ props }) { - const token = props.hootsuite.$auth.oauth_access_token; - const url = "https://api.hootsuite.com/v1/socialProfiles"; + async run({ $ }) { try { - const response = await axios(this, { - url, - headers: { - Authorization: `Bearer ${token}`, - }, + const response = await $.apps.hootsuite.listSocialProfiles({ + $, }); - return response.data.data; + $.export("$summary", `Successfully retrieved ${response?.data?.length} social profile${response?.data?.length === 1 + ? "" + : "s"}`); + return response; } catch (error) { console.error("API call to Hootsuite failed:", error.response?.data || error.message); const errorMessage = error.response?.data?.errors?.[0]?.message || error.message || "Unknown error"; throw new Error(`Failed to retrieve social profiles. Error: ${errorMessage}`); } }, -}; \ No newline at end of file +}; diff --git a/components/hootsuite/actions/schedule-message/schedule-message.mjs b/components/hootsuite/actions/schedule-message/schedule-message.mjs index cceb6e3229274..c8f2b4b46b140 100644 --- a/components/hootsuite/actions/schedule-message/schedule-message.mjs +++ b/components/hootsuite/actions/schedule-message/schedule-message.mjs @@ -13,7 +13,7 @@ export default { key: "hootsuite-schedule-message", name: "Schedule Message", description: "Schedules a message on your Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/scheduleMessage)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/hootsuite/hootsuite.app.mjs b/components/hootsuite/hootsuite.app.mjs index a279c0d8f0f1d..608b66e547b32 100644 --- a/components/hootsuite/hootsuite.app.mjs +++ b/components/hootsuite/hootsuite.app.mjs @@ -39,9 +39,10 @@ export default { ...opts, }); }, - listSocialProfiles() { + listSocialProfiles(opts = {}) { return this._makeRequest({ path: "/socialProfiles", + ...opts, }); }, getMediaUploadStatus({ diff --git a/components/hootsuite/package.json b/components/hootsuite/package.json index bde9fdc290e90..923b5e171677c 100644 --- a/components/hootsuite/package.json +++ b/components/hootsuite/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hootsuite", - "version": "0.2.1", + "version": "0.3.0", "description": "Pipedream Hootsuite Components", "main": "hootsuite.app.mjs", "keywords": [ diff --git a/components/hootsuite/sources/new-post-created/new-post-created.mjs b/components/hootsuite/sources/new-post-created/new-post-created.mjs index ed93aede9061b..5d9aa0aa19d2c 100644 --- a/components/hootsuite/sources/new-post-created/new-post-created.mjs +++ b/components/hootsuite/sources/new-post-created/new-post-created.mjs @@ -5,7 +5,7 @@ import constants from "../common/constants.mjs"; export default { name: "New Post Created", - version: "0.0.2", + version: "0.0.3", key: "hootsuite-new-post-created", description: "Emit new event on each new created post. [See docs here](https://platform.hootsuite.com/docs/api/index.html#operation/retrieveMessages).", type: "source", From 591d1fc7a853803cfa1d4cc983e5c12a5689c5fb Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 17 Nov 2025 12:03:30 -0500 Subject: [PATCH 7/7] js -> .mjs --- .../{list-social-profiles.js => list-social-profiles.mjs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename components/hootsuite/actions/list-social-profiles/{list-social-profiles.js => list-social-profiles.mjs} (100%) diff --git a/components/hootsuite/actions/list-social-profiles/list-social-profiles.js b/components/hootsuite/actions/list-social-profiles/list-social-profiles.mjs similarity index 100% rename from components/hootsuite/actions/list-social-profiles/list-social-profiles.js rename to components/hootsuite/actions/list-social-profiles/list-social-profiles.mjs