-
Notifications
You must be signed in to change notification settings - Fork 5.4k
17712 actions for hootsuite #17982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
17712 actions for hootsuite #17982
Conversation
Actions - Create Media Upload Job - Get Media Upload Status - Schedule Message
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughAdded three Hootsuite actions (create media upload job, get media upload status, schedule message), supporting constants/utilities and new Hootsuite app API helpers/propDefinition; bumped package version and made a minor source cleanup. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action
participant HootsuiteApp
participant HootsuiteAPI
User->>Action: Provide inputs (file/filePath or fileId, message, profiles, targeting)
Action->>HootsuiteApp: initializeUpload / scheduleMessage / getMediaUploadStatus
HootsuiteApp->>HootsuiteAPI: HTTP request to /media or /messages or /socialProfiles
HootsuiteAPI-->>HootsuiteApp: Response (upload URL, mediaId, status, scheduledId)
HootsuiteApp-->>Action: Return API result
Action-->>User: Export summary and return data
Estimated code review effort🎯 4 (Complex) | ⏱️ ~35 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🧹 Nitpick comments (4)
components/hootsuite/common/utils.mjs (1)
1-24
: Review the function logic and consider edge cases.The
parseObject
function has some logical inconsistencies and potential edge cases:
Overly broad falsy check: Line 2 returns
undefined
for any falsy value including empty string""
, which might be a valid JSON string to parse.Function name mismatch: The function name suggests it parses objects, but it handles arrays, strings, and passes through other types unchanged.
Inconsistent behavior: Arrays get their string elements parsed, but if you pass an object, it's returned unchanged without any parsing attempt.
Consider these improvements:
export const parseObject = (obj) => { - if (!obj) return undefined; + if (obj === null || obj === undefined) return undefined; if (Array.isArray(obj)) { return obj.map((item) => { if (typeof item === "string") { try { return JSON.parse(item); } catch (e) { return item; } } return item; }); } if (typeof obj === "string") { try { return JSON.parse(obj); } catch (e) { return obj; } } return obj; };Alternative approach - be more explicit about the function's purpose:
-export const parseObject = (obj) => { +export const parseJsonStrings = (input) => {components/hootsuite/common/constants.mjs (1)
2692-2702
: Consider consistent data structure across all option arrays.The
STAFF_COUNT_RANGE_OPTIONS
uses a different structure (array of strings) compared to other option arrays which use{label, value}
objects. This inconsistency might cause issues in consuming code.For consistency, consider:
export const STAFF_COUNT_RANGE_OPTIONS = [ - "SIZE_1", - "SIZE_2_TO_10", - "SIZE_11_TO_50", - "SIZE_51_TO_200", - "SIZE_201_TO_500", - "SIZE_501_TO_1000", - "SIZE_1001_TO_5000", - "SIZE_5001_TO_10000", - "SIZE_10001_OR_MORE", + { label: "1", value: "SIZE_1" }, + { label: "2-10", value: "SIZE_2_TO_10" }, + { label: "11-50", value: "SIZE_11_TO_50" }, + { label: "51-200", value: "SIZE_51_TO_200" }, + { label: "201-500", value: "SIZE_201_TO_500" }, + { label: "501-1000", value: "SIZE_501_TO_1000" }, + { label: "1001-5000", value: "SIZE_1001_TO_5000" }, + { label: "5001-10000", value: "SIZE_5001_TO_10000" }, + { label: "10001+", value: "SIZE_10001_OR_MORE" }, ];components/hootsuite/actions/schedule-message/schedule-message.mjs (1)
1-339
: Missing "Suggest Content to Amplify" action.The PR objectives from issue #17712 mention implementing four actions, but only three are present in this PR. The "Suggest Content to Amplify" action is missing.
Would you like me to help implement the missing "Suggest Content to Amplify" action or create a follow-up issue to track this?
components/hootsuite/hootsuite.app.mjs (1)
31-41
: LGTM! Consider documenting the noHeaders parameter.The refactored _makeRequest method improves maintainability by using centralized URL and header methods. The noHeaders flag adds useful flexibility.
Consider adding JSDoc documentation for the noHeaders parameter:
+ /** + * Make an HTTP request to the Hootsuite API + * @param {Object} options - Request options + * @param {boolean} options.noHeaders - Skip adding auth headers (for endpoints that don't require auth) + */ _makeRequest({ $ = this, path, noHeaders = false, ...opts }) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs
(1 hunks)components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs
(1 hunks)components/hootsuite/actions/schedule-message/schedule-message.mjs
(1 hunks)components/hootsuite/common/constants.mjs
(1 hunks)components/hootsuite/common/utils.mjs
(1 hunks)components/hootsuite/hootsuite.app.mjs
(1 hunks)components/hootsuite/package.json
(2 hunks)components/hootsuite/sources/new-post-created/new-post-created.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/hootsuite/package.json
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs
components/hootsuite/actions/schedule-message/schedule-message.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/hootsuite/sources/new-post-created/new-post-created.mjs
📚 Learning: 2025-07-01T17:01:46.327Z
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/tinypng/actions/compress-image/compress-image.mjs:18-23
Timestamp: 2025-07-01T17:01:46.327Z
Learning: In TinyPNG compress-image action (components/tinypng/actions/compress-image/compress-image.mjs), the syncDir property uses accessMode: "read" because this action only reads input files and returns API responses without writing files to /tmp, unlike other TinyPNG actions that save processed files to disk.
Applied to files:
components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Applied to files:
components/hootsuite/hootsuite.app.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: The Salesloft API list endpoints (listPeople, listCadences, listUsers, listAccounts) return arrays directly in the response body, not wrapped in a metadata object with a nested data property. The _makeRequest method correctly returns response.data which contains the arrays that can be mapped over directly in propDefinitions.
Applied to files:
components/hootsuite/hootsuite.app.mjs
🔇 Additional comments (12)
components/hootsuite/package.json (2)
3-3
: LGTM - Appropriate version bump for new features.The minor version increment from 0.1.0 to 0.2.0 correctly reflects the addition of new actions and utilities in this release.
16-16
: Verify @pipedream/platform ^3.1.0 API compatibilityPlease confirm that the following imports and usages still exist and behave as expected in v3.1.0. A major version bump can introduce breaking changes:
• components/hootsuite/hootsuite.app.mjs
– import { axios } from "@pipedream/platform"
• components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs
– import { getFileStreamAndMetadata } from "@pipedream/platform"
• components/hootsuite/sources/new-post-created/new-post-created.mjs
– import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"
– usage at line 19:intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL
Run your full test suite (or smoke tests) against the upgraded dependency and update any renamed, moved, or removed APIs before merging.
components/hootsuite/sources/new-post-created/new-post-created.mjs (2)
1-1
: LGTM - Good import organization improvement.Moving the
DEFAULT_POLLING_SOURCE_TIMER_INTERVAL
import to the top of the file improves code organization and follows standard import practices.
8-8
: LGTM - Appropriate patch version increment.The version bump from 0.0.1 to 0.0.2 correctly reflects the maintenance changes made to this source component.
components/hootsuite/actions/get-media-upload-status/get-media-upload-status.mjs (1)
1-26
: LGTM - Well-structured action component.The action follows Pipedream conventions correctly:
- Proper component structure with key, name, description, version, and type
- Clear prop definition with appropriate type and description
- Correct usage of the hootsuite app method
- Well-formatted summary message following established patterns
- Appropriate return value
The implementation is clean and should work as expected for retrieving media upload status.
components/hootsuite/hootsuite.app.mjs (7)
23-25
: LGTM!Good refactoring to centralize the base URL configuration. This makes it easy to maintain and change API versions if needed.
26-30
: LGTM!Good refactoring to centralize header configuration. The OAuth Bearer token usage is correct for the Pipedream auth system.
42-46
: LGTM!Clean implementation of the listSocialProfiles method that follows the established pattern and supports the dynamic property definition.
47-54
: LGTM!Proper implementation of the media upload status method with correct parameter handling and path interpolation.
55-61
: LGTM!Correct implementation of the scheduleMessage method with proper HTTP method and flexible options handling.
62-67
: LGTM!Good refactoring of the getPosts method to use the centralized base URL and remove unnecessary async keyword. The changes maintain backward compatibility while improving consistency.
6-21
: Confirm Hootsuite socialProfiles Response ShapeThe new socialProfileIds propDefinition correctly uses an async options() fn and maps over the API response—but please verify the exact shape of the
/socialProfiles
endpoint:
- File: components/hootsuite/hootsuite.app.mjs
- Block:
async options() { const { data } = await this.listSocialProfiles(); return data.map(({ id: value, socialNetworkUsername: label }) => ({ label, value })); }- Ensure that
listSocialProfiles()
returns an object with adata
array of items, each having:
•id
(string)
•socialNetworkUsername
(string)If the endpoint wraps the list under a different key or uses a different field name, update the destructuring/mapping accordingly.
components/hootsuite/actions/create-media-upload-job/create-media-upload-job.mjs
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
components/hootsuite/actions/schedule-message/schedule-message.mjs
Outdated
Show resolved
Hide resolved
…hedule-message component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…ponent; refactor LinkedIn targeting logic for improved clarity
Resolves #17712
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores