-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] sproutgigs #10910 #18323
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds three new SproutGigs actions (get-categories, get-zones, post-job), extends the SproutGigs app with propDefinitions, dynamic option loaders, axios-based request helpers and API methods, and updates package version and dependencies. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant A as Action (Get Categories / Get Zones)
participant APP as SproutGigs App
participant API as SproutGigs API
U->>A: Run action
A->>APP: getCategories() / getZones()
APP->>API: GET /jobs/get-*.php (auth via _makeRequest)
API-->>APP: 200 JSON (list)
APP-->>A: Return list
A-->>U: Export $summary (count) and return data
sequenceDiagram
autonumber
actor U as User
participant A as Action (Post Job)
participant APP as SproutGigs App
participant API as SproutGigs API
U->>A: Provide props (test, zoneId, categoryId, title, instructions, proofs, numTasks, taskValue)
A->>A: Build payload (test → 0/1, parse `proofs`)
A->>APP: postJob(payload)
APP->>API: POST /jobs/post-job.php (auth, JSON)
API-->>APP: 200 JSON (message, details)
APP-->>A: Return response
A-->>U: Export $summary (message) and return response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ 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. Comment |
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: 6
🧹 Nitpick comments (2)
components/sproutgigs/sproutgigs.app.mjs (2)
51-55
: Model proofs as structured objects in the UIAccepting JSON via string is error-prone. Prefer an array of objects to leverage UI validation.
Apply:
- proofs: { - type: "string", - label: "Proofs", - description: "Array of up to 4 proofs, each with description and type (text or screenshot), i.e.: `[{\"description\":\"Profile screenshot\",\"type\":\"screenshot\"}]`", - }, + proofs: { + type: "object[]", + label: "Proofs", + description: "Up to 4 proof objects: { description: string, type: 'text' | 'screenshot' }", + },If you adopt this, remove JSON.parse in the action (use the prior suggested diff).
71-87
: Harden HTTP requests: baseURL, timeout, and explicit JSON headersImproves reliability and clarity without changing behavior.
Apply:
- return axios($, { - ...otherOpts, - url: this._baseUrl() + path, - auth: { + return axios($, { + baseURL: this._baseUrl(), + url: path, + timeout: 10000, + headers: { + Accept: "application/json", + ...(otherOpts.headers ?? {}), + }, + ...otherOpts, + auth: { username: `${this.$auth.user_id}`, password: `${this.$auth.api_secret}`, ...auth, }, });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
components/sproutgigs/actions/get-categories/get-categories.mjs
(1 hunks)components/sproutgigs/actions/get-zones/get-zones.mjs
(1 hunks)components/sproutgigs/actions/post-job/post-job.mjs
(1 hunks)components/sproutgigs/package.json
(2 hunks)components/sproutgigs/sproutgigs.app.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/sproutgigs/package.json
🧬 Code graph analysis (4)
components/sproutgigs/actions/get-zones/get-zones.mjs (3)
components/sproutgigs/actions/get-categories/get-categories.mjs (1)
response
(13-16)components/sproutgigs/actions/post-job/post-job.mjs (1)
response
(61-75)components/sproutgigs/sproutgigs.app.mjs (2)
response
(18-18)response
(32-32)
components/sproutgigs/actions/get-categories/get-categories.mjs (3)
components/sproutgigs/actions/get-zones/get-zones.mjs (1)
response
(13-15)components/sproutgigs/actions/post-job/post-job.mjs (1)
response
(61-75)components/sproutgigs/sproutgigs.app.mjs (2)
response
(18-18)response
(32-32)
components/sproutgigs/sproutgigs.app.mjs (3)
components/sproutgigs/actions/get-categories/get-categories.mjs (1)
response
(13-16)components/sproutgigs/actions/get-zones/get-zones.mjs (1)
response
(13-15)components/sproutgigs/actions/post-job/post-job.mjs (1)
response
(61-75)
components/sproutgigs/actions/post-job/post-job.mjs (3)
components/sproutgigs/actions/get-categories/get-categories.mjs (1)
response
(13-16)components/sproutgigs/actions/get-zones/get-zones.mjs (1)
response
(13-15)components/sproutgigs/sproutgigs.app.mjs (2)
response
(18-18)response
(32-32)
🪛 GitHub Actions: Components Checks
components/sproutgigs/package.json
[error] 1-1: Lockfile specifiers do not match package.json for '@pipedream/platform'.
⏰ 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). (1)
- GitHub Check: pnpm publish
🔇 Additional comments (4)
components/sproutgigs/package.json (2)
3-3
: Version bump looks appropriateMinor version bump to 0.1.0 aligns with new actions and app methods.
15-17
: Good: no built-in Node modules added as depsMatches prior guidance to avoid native modules like fs in dependencies.
components/sproutgigs/actions/post-job/post-job.mjs (1)
60-76
: Confirm content type expected by SproutGigs for POSTIf the API expects form-encoded payloads, we’ll need to adjust headers/serialization.
Would you like me to check the latest SproutGigs docs and update headers/body accordingly?
components/sproutgigs/sproutgigs.app.mjs (1)
88-106
: App methods read cleanlyEndpoints and methods map 1:1 and are easy to reason about.
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.
Hi @lcaresia lgtm! Ready for QA!
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: 0
♻️ Duplicate comments (1)
components/sproutgigs/actions/post-job/post-job.mjs (1)
60-76
: Guard against invalid proofs input; validate numTasks/taskValue before API callJSON.parse on untrusted input will throw and crash the step; also enforce positive integer numTasks and positive numeric taskValue. Cap proofs to a safe maximum (docs suggest 4 — please verify). This prevents avoidable 4xxs and improves UX.
Apply:
- async run({ $ }) { - const response = await this.app.postJob({ - $, - data: { - test: this.test - ? 1 - : 0, - zone_id: this.zoneId, - category_id: this.categoryId, - title: this.title, - instructions: this.instructions, - proofs: JSON.parse(this.proofs), - num_tasks: this.numTasks, - task_value: this.taskValue, - }, - }); + async run({ $ }) { + // Validate numerics + const numTasks = Number(this.numTasks); + const taskValue = Number(this.taskValue); + if (!Number.isInteger(numTasks) || numTasks <= 0) { + throw new Error("numTasks must be a positive integer"); + } + if (!Number.isFinite(taskValue) || taskValue <= 0) { + throw new Error("taskValue must be a positive number"); + } + + // Parse and validate proofs + let proofs = this.proofs; + try { + if (typeof proofs === "string") { + const s = proofs.trim(); + proofs = s ? JSON.parse(s) : []; + } + } catch { + throw new Error('Invalid JSON for "proofs". Expected an array of objects: [{ "description": "...", "type": "text|screenshot" }].'); + } + if (!Array.isArray(proofs)) { + throw new Error('"proofs" must be an array'); + } + if (proofs.length > 4) { + proofs = proofs.slice(0, 4); + } + + const response = await this.app.postJob({ + $, + data: { + test: this.test ? 1 : 0, + zone_id: this.zoneId, + category_id: this.categoryId, + title: this.title, + instructions: this.instructions, + proofs, + num_tasks: numTasks, + task_value: taskValue, + }, + });
🧹 Nitpick comments (4)
components/sproutgigs/actions/post-job/post-job.mjs (4)
77-79
: Harden response check to handle different shapesSome APIs return status/message without an ok boolean. Check both to avoid swallowing errors.
- if (response.ok === false) { - throw new Error(`Job creation failed: ${response.message}`); - } + if (response?.ok === false || response?.status === "error") { + throw new Error(`Job creation failed: ${response?.message ?? "Unknown error"}`); + }
81-82
: Polish summary; include key contextUse a template literal and include the title for faster scanning in runs.
- $.export("$summary", "Successfully sent the request. Result message: " + response.message); + $.export("$summary", `Successfully posted "${this.title}". Result: ${response?.message ?? "OK"}`);
7-7
: Align action version with package changesThe package was bumped in this PR; consider setting the action version to 0.1.0 for consistency.
- version: "0.0.1", + version: "0.1.0",
41-46
: Prefer parsed JSON at the prop sourceIf feasible, make the
proofs
prop in sproutgigs.app.mjs use ajson
‑typed prop (or parse in the app) so actions receive an array and don’t need to JSON.parse user input.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/sproutgigs/actions/post-job/post-job.mjs
(1 hunks)components/sproutgigs/sproutgigs.app.mjs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- components/sproutgigs/sproutgigs.app.mjs
🧰 Additional context used
🧬 Code graph analysis (1)
components/sproutgigs/actions/post-job/post-job.mjs (3)
components/sproutgigs/sproutgigs.app.mjs (2)
response
(18-18)response
(32-32)components/sproutgigs/actions/get-categories/get-categories.mjs (1)
response
(13-16)components/sproutgigs/actions/get-zones/get-zones.mjs (1)
response
(13-15)
⏰ 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)
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/sproutgigs/actions/post-job/post-job.mjs (1)
60-83
: ```shell
#!/bin/bash
set -euo pipefailecho "1) Locate postJob definitions (repo-wide)"
rg -nC3 --hidden --no-ignore 'postJob\s*(' || trueecho
echo "2) Locate _makeRequest implementation/usages (repo-wide)"
rg -nC3 --hidden --no-ignore '_makeRequest\s*(' || true
rg -nC3 --hidden --no-ignore 'function _makeRequest' || true
rg -nC3 --hidden --no-ignore 'async _makeRequest' || trueecho
echo "3) Show the sproutgigs.app file around postJob and any _makeRequest implementation found in that file"
FILE="components/sproutgigs/sproutgigs.app.mjs"
if [ -f "$FILE" ]; then
nl -ba "$FILE" | sed -n '1,240p'
else
echo "File not found: $FILE"
fiecho
echo "4) Search for common response shape keys near _makeRequest call sites (ok/status/message)"
rg -nC2 --hidden --no-ignore '\bok\b' || true
rg -nC2 --hidden --no-ignore '\bstatus\b' || true
rg -nC2 --hidden --no-ignore '\bmessage\b' || true</blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
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
* Added actions * Added actions * Added actions
* Leonardo AI components * added unzoom image action * fixing link errors * more lint fixes * Merging pull request #18359 * fix: pagination prop and params struct * fix: no need for paginate here * chore: update version * chore: cleanup * chore: update package * feat: allow raw response * chore: bump package * fix: buffer response instead * Update components/google_drive/actions/download-file/download-file.mjs Co-authored-by: Jorge Cortes <[email protected]> * versions * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * feat: add content selector * chore: bump package * fix: comments * chore: bump versions * chore: fix versions * fixes: QA fixes * feat: add cursor to req * package.json --------- Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]> * Merging pull request #18361 * update siteId prop * pnpm-lock.yaml * package.json version * Google Sheets - update row refresh fields (#18369) * change prop order and refresh fields * bump package.json * Pipedrive - fix app name (#18370) * use pipedriveApp instead of app * bump package.json * Pipedrive - pipelineId integer (#18372) * pipelineId - integer * bump versions * Adding app scaffolding for lightspeed_ecom_c_series * Adding app scaffolding for financial_data * Adding app scaffolding for microsoft_authenticator * Merging pull request #18345 * updates * versions * versions * Merging pull request #18368 * updates * remove console.log * versions * Coinbase Developer Platform - New Wallet Event (#18342) * new component * pnpm-lock.yaml * updates * updates * Hubspot - update search-crm (#18360) * update search-crm * limit results to one page * update version * package.json version * Merging pull request #18347 * widget props * fix version * Adding app scaffolding for rundeck * Merging pull request #18378 * Update Taiga component with new actions and sources - Bump version to 0.1.0 in package.json and add dependency on @pipedream/platform. - Introduce new actions for creating, updating, and deleting issues, tasks, and user stories. - Add sources for tracking changes and deletions of issues and tasks. - Implement utility functions for parsing and cleaning objects in common/utils.mjs. - Enhance prop definitions for better integration with Taiga API. * pnpm update * Refactor Taiga actions to utilize parseObject utility - Added parseObject utility for tags, watchers, and points in update-issue, update-task, and update-userstory actions. - Removed the update-project action as it is no longer needed. - Enhanced base source to include secret key validation for webhook security. * Merging pull request #18382 * add testSources prop * pnpm-lock.yaml * fix * Merging pull request #18323 * Added actions * Added actions * Added actions * Merging pull request #18377 * Added actions * Update components/weaviate/actions/create-class/create-class.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Luan Cazarine <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Merging pull request #18376 * Adding app scaffolding for etrusted * Adding app scaffolding for intelliflo_office * Adding app scaffolding for thoughtspot * Adding app scaffolding for kordiam * Adding app scaffolding for ticketsauce * trustpilot fixes (#18152) * trustpilot fixes * more fixes * update versions * more version updates * fixes * Bump all Trustpilot actions to version 0.1.0 Major improvements and API updates across all actions: - Enhanced private API support with proper authentication - Improved parameter handling and validation - Better error handling and response structures - Added new conversation flow for product reviews - Fixed endpoint URLs to match latest API documentation - Streamlined request/response processing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * up version and clean up sources * merge * fix business ID * delete temp action * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-service-reviews/new-service-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * comments * Pagination * fixes * comments * missed some `$`'s * unduplicated * more fixes * final comments * more comments * . --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Adding app scaffolding for peekalink * 18314 twilio (#18350) * Update Twilio component versions and dependencies - Update Twilio Send Message action adding detailed description for 'from' prop and refactoring phone number validation logic. - Incremented action versions for several Twilio actions. * pnpm update * Updating LinkedIn API version (#18399) * Merging pull request #18394 * Databricks API - Jobs action components (#18371) * Notion property building improvements (#18381) * validate property types * versions * Google Business - add debug log (#18407) * add debug log * bump versions * Notion API Key - update @pipedream/notion version (#18409) * update @pipedream/notion dependency version * pnpm-lock.yaml * Adding app scaffolding for reduct_video * Adding app scaffolding for shopware * Adding app scaffolding for instamojo * Hubspot - bug fix to sources w/ property changes (#18379) * updates * versions * Google sheets type fix (#18411) * Fixing worksheetId prop type from string to integer * Version bumps --------- Co-authored-by: Leo Vu <[email protected]> * Merging pull request #18393 * new components * remove console.log * versions * update * Merging pull request #18408 * 403 error message * versions * update * Merging pull request #18419 * Changes per PR Review * Removes leonardo_ai_actions.mdc not indented for merging * synced lockfile after install * fully lock form-data for leonardo_ai * conflict solving * lint fixes * Chipped down Readme, implemented async options in gen motion --------- Co-authored-by: jocarino <[email protected]> Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]> Co-authored-by: michelle0927 <[email protected]> Co-authored-by: Andrew Chuang <[email protected]> Co-authored-by: danhsiung <[email protected]> Co-authored-by: Lucas Caresia <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Job <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Guilherme Falcão <[email protected]> Co-authored-by: Leo Vu <[email protected]>
WHY
Summary by CodeRabbit
New Features
Chores