-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat(wics): add WICS app integration with API connector #19234
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
feat(wics): add WICS app integration with API connector #19234
Conversation
- Implements WICS (for people) API integration for Pipedream - Added authentication support with API key and base URL configuration - Implemented core API methods: * getOrder(order_id): Retrieve a specific order from WICS * listOrders(params): Retrieve all orders with optional filtering * createOrder(data): Create new orders through WICS API - Added automatic request handling with proper headers and authorization - Resolves issue PipedreamHQ#19207 - Add WICS app integration This implementation follows Pipedream's app component conventions and supports the WICS API endpoint documented at https://docs.wics.nl/#orders-get-order
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
WalkthroughIntroduces a new WICS app integration module with configurable API credentials, a centralized HTTP request wrapper using Bearer authentication, and methods for order retrieval, listing, and creation, plus authentication verification. Changes
Sequence DiagramsequenceDiagram
participant App as WICS App
participant Client as Client
participant WICS as WICS API
Note over App: Configuration Phase
Client->>App: Initialize with api_key & base_url
App->>App: Store credentials
Note over App: Authentication Phase
Client->>App: call auth()
App->>App: _makeRequest({path: "/auth/verify"})
App->>WICS: POST /auth/verify<br/>(Authorization: Bearer api_key)
WICS-->>App: Verification response
App-->>Client: auth result
Note over App: Order Operations Phase
Client->>App: call getOrder(order_id)
App->>App: _makeRequest({path: "/orders/{order_id}"})
App->>WICS: GET /orders/{order_id}<br/>(Authorization: Bearer api_key)
WICS-->>App: Order data
App-->>Client: Order details
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/wics/wics.app.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.
Applied to files:
components/wics/wics.app.mjs
🧬 Code graph analysis (1)
components/wics/wics.app.mjs (1)
components/gmail/gmail.app.mjs (1)
axios(415-423)
🔇 Additional comments (2)
components/wics/wics.app.mjs (2)
24-33: Request wrapper looks solid; confirm WICS auth scheme and header usage
_makeRequestis structured correctly for Pipedream apps: passing$intoaxios, building the full URL, and centralizing headers. One thing to double‑check against WICS docs is whether authentication truly usesAuthorization: Bearer <api_key>versus a different header name or token scheme; if it differs, adjust the header here once and all methods will follow. Setting"Content-Type": "application/json"globally is fine, though you could omit it for pure GETs if you prefer.
53-57: Verify/auth/verifyis the right endpoint and method for auth testingThe
auth()helper delegating to_makeRequest({ path: "/auth/verify" })is fine structurally, but it assumes:
- WICS exposes a
/auth/verifyendpoint, and- It accepts a GET with Bearer auth and returns a 2xx on success.
Please confirm this matches the WICS API; if not, pointing
auth()at a known, cheap endpoint (e.g. a lightweightGET /orderswith restrictive params) may be more reliable.
| propDefinitions: { | ||
| api_key: { | ||
| type: "string", | ||
| secret: true, | ||
| label: "API Key", | ||
| description: "WICS API Key", | ||
| }, | ||
| base_url: { | ||
| type: "string", | ||
| label: "Base URL", | ||
| description: "WICS Base URL", | ||
| default: "https://api.wics.nl", | ||
| }, | ||
| }, | ||
| methods: { | ||
| _baseUrl() { | ||
| return this.$auth.base_url || "https://api.wics.nl"; | ||
| }, |
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.
🧹 Nitpick | 🔵 Trivial
Avoid duplicating the base URL default and consider normalizing trailing slashes
You hard‑code "https://api.wics.nl" both in propDefinitions.base_url.default and _baseUrl(), and _baseUrl() doesn’t normalize trailing slashes. To keep things DRY and avoid //orders when users include a trailing slash, consider centralizing and normalizing here:
- methods: {
- _baseUrl() {
- return this.$auth.base_url || "https://api.wics.nl";
- },
+ methods: {
+ _baseUrl() {
+ const baseUrl = this.$auth.base_url || "https://api.wics.nl";
+ return baseUrl.replace(/\/+$/, "");
+ },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| propDefinitions: { | |
| api_key: { | |
| type: "string", | |
| secret: true, | |
| label: "API Key", | |
| description: "WICS API Key", | |
| }, | |
| base_url: { | |
| type: "string", | |
| label: "Base URL", | |
| description: "WICS Base URL", | |
| default: "https://api.wics.nl", | |
| }, | |
| }, | |
| methods: { | |
| _baseUrl() { | |
| return this.$auth.base_url || "https://api.wics.nl"; | |
| }, | |
| propDefinitions: { | |
| api_key: { | |
| type: "string", | |
| secret: true, | |
| label: "API Key", | |
| description: "WICS API Key", | |
| }, | |
| base_url: { | |
| type: "string", | |
| label: "Base URL", | |
| description: "WICS Base URL", | |
| default: "https://api.wics.nl", | |
| }, | |
| }, | |
| methods: { | |
| _baseUrl() { | |
| const baseUrl = this.$auth.base_url || "https://api.wics.nl"; | |
| return baseUrl.replace(/\/+$/, ""); | |
| }, |
🤖 Prompt for AI Agents
In components/wics/wics.app.mjs around lines 6–23, you duplicate the base URL
default and don’t normalize trailing slashes; introduce a single constant like
DEFAULT_BASE_URL (use it for propDefinitions.base_url.default) and have
_baseUrl() return (this.$auth.base_url || DEFAULT_BASE_URL) with trailing
slashes stripped (e.g., remove any trailing '/' characters) so callers never get
a double-slash when concatenating paths. Ensure all concatenations add a single
'/' as needed elsewhere.
jcortes
left a 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.
Hi @kl2400033266 this is a great contribution however, it seems like it is missing the components, can you please take a look at the documentation here and if you have questions please let me know so I can help you out.
Also can you run a git rebase somthing like:
$ git pull origin master --rebase
and fix the conflicts you might have in your branch after pulling master, thanks
|
Dear maintainer, |
|
This PR is closed due to dubious code contribution! |
This implementation follows Pipedream's app component conventions and supports the WICS API endpoint documented at https://docs.wics.nl/#orders-get-order
WHY
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.