Skip to content

Commit 3449ed2

Browse files
akbar-kurnia1coderabbitai[bot]michelle0927
authored
feat (hootsuit): add list-social-profiles action (closes #19083) (#19096)
* feat (hootsuit): add list-social-profiles action (closes #19083) * Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/hootsuite/actions/list-social-profiles/list-social-profiles.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * updates * js -> .mjs --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Michelle Bergeron <michelle.bergeron@gmail.com>
1 parent 2265a7a commit 3449ed2

File tree

7 files changed

+45
-6
lines changed

7 files changed

+45
-6
lines changed

components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "hootsuite-create-media-upload-job",
66
name: "Create Media Upload Job",
77
description: "Creates a new Media Upload Job on your Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/createMedia)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "hootsuite-get-media-upload-status",
55
name: "Get Media Upload Status",
66
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)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import hootsuite from "../../hootsuite.app.mjs";
2+
3+
export default {
4+
key: "hootsuite-list-social-profiles",
5+
name: "List Social Profiles",
6+
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)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
hootsuite,
16+
},
17+
/**
18+
* Retrieves all social profiles for the authenticated Hootsuite account
19+
* @param {object} params - The parameters object
20+
* @param {object} params.props - The action props containing the hootsuite app
21+
* @returns {Promise<Array>} An array of social profile objects from Hootsuite
22+
*/
23+
async run({ $ }) {
24+
try {
25+
const response = await $.apps.hootsuite.listSocialProfiles({
26+
$,
27+
});
28+
$.export("$summary", `Successfully retrieved ${response?.data?.length} social profile${response?.data?.length === 1
29+
? ""
30+
: "s"}`);
31+
return response;
32+
} catch (error) {
33+
console.error("API call to Hootsuite failed:", error.response?.data || error.message);
34+
const errorMessage = error.response?.data?.errors?.[0]?.message || error.message || "Unknown error";
35+
throw new Error(`Failed to retrieve social profiles. Error: ${errorMessage}`);
36+
}
37+
},
38+
};

components/hootsuite/actions/schedule-message/schedule-message.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
key: "hootsuite-schedule-message",
1414
name: "Schedule Message",
1515
description: "Schedules a message on your Hootsuite account. [See the documentation](https://apidocs.hootsuite.com/docs/api/index.html#operation/scheduleMessage)",
16-
version: "0.0.2",
16+
version: "0.0.3",
1717
annotations: {
1818
destructiveHint: false,
1919
openWorldHint: true,

components/hootsuite/hootsuite.app.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export default {
3939
...opts,
4040
});
4141
},
42-
listSocialProfiles() {
42+
listSocialProfiles(opts = {}) {
4343
return this._makeRequest({
4444
path: "/socialProfiles",
45+
...opts,
4546
});
4647
},
4748
getMediaUploadStatus({

components/hootsuite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/hootsuite",
3-
"version": "0.2.1",
3+
"version": "0.3.0",
44
"description": "Pipedream Hootsuite Components",
55
"main": "hootsuite.app.mjs",
66
"keywords": [

components/hootsuite/sources/new-post-created/new-post-created.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import constants from "../common/constants.mjs";
55

66
export default {
77
name: "New Post Created",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
key: "hootsuite-new-post-created",
1010
description: "Emit new event on each new created post. [See docs here](https://platform.hootsuite.com/docs/api/index.html#operation/retrieveMessages).",
1111
type: "source",

0 commit comments

Comments
 (0)