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.mjs b/components/hootsuite/actions/list-social-profiles/list-social-profiles.mjs new file mode 100644 index 0000000000000..4dacd7647dfb8 --- /dev/null +++ b/components/hootsuite/actions/list-social-profiles/list-social-profiles.mjs @@ -0,0 +1,38 @@ +import hootsuite from "../../hootsuite.app.mjs"; + +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", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + 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({ $ }) { + try { + const response = await $.apps.hootsuite.listSocialProfiles({ + $, + }); + $.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}`); + } + }, +}; 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",