-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] tomtom #10931 #18926
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
[Components] tomtom #10931 #18926
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds three TomTom search actions (autocomplete, nearby, POI), a constants module with extensions and languages, app-level request helpers and search methods, and bumps the TomTom component package to 0.1.0 with a new dependency. Changes
Sequence DiagramsequenceDiagram
participant Action as Action (autocomplete / nearby / POI)
participant App as tomtom.app
participant HTTP as HTTP Client
participant TomTom as TomTom API
Action->>App: this.app.<search>({ query?, language?, lat?, lon?, radius?, limit?, extension, $ })
App->>App: build path & params, include api_key via _makeRequest
App->>HTTP: axios GET { fullUrl, params }
HTTP->>TomTom: HTTP GET /search/2/<endpoint>/{query}.{extension} or /nearbySearch.{extension}
TomTom-->>HTTP: HTTP 200 { results: [...] }
HTTP-->>App: response
App-->>Action: response
Action->>Action: export summary (result count)
Action-->>User: return full response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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: 4
🧹 Nitpick comments (1)
components/tomtom/tomtom.app.mjs (1)
69-98: Consider adding default extension values to prevent undefined in URL paths.The
nearbySearchandpoiSearchmethods require anextensionparameter to construct valid API paths, but currently have no default value. While I've flagged the corresponding actions to pass the extension, adding sensible defaults (e.g.,"json") would make these methods more robust and prevent runtime errors if called without the parameter.Apply this diff to add default extension values:
async autocompleteSearch({ - extension, + extension = "json", query, ...args }) {async nearbySearch({ - extension, + extension = "json", ...args }) {async poiSearch({ - extension, + extension = "json", query, ...args }) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
components/tomtom/actions/autocomplete-search/autocomplete-search.mjs(1 hunks)components/tomtom/actions/nearby-search/nearby-search.mjs(1 hunks)components/tomtom/actions/poi-search/poi-search.mjs(1 hunks)components/tomtom/common/constants.mjs(1 hunks)components/tomtom/package.json(2 hunks)components/tomtom/tomtom.app.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 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/tomtom/tomtom.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/tomtom/package.json
🧬 Code graph analysis (4)
components/tomtom/actions/poi-search/poi-search.mjs (2)
components/tomtom/actions/autocomplete-search/autocomplete-search.mjs (1)
response(36-43)components/tomtom/actions/nearby-search/nearby-search.mjs (1)
response(48-57)
components/tomtom/actions/autocomplete-search/autocomplete-search.mjs (2)
components/tomtom/actions/nearby-search/nearby-search.mjs (1)
response(48-57)components/tomtom/actions/poi-search/poi-search.mjs (1)
response(54-64)
components/tomtom/actions/nearby-search/nearby-search.mjs (2)
components/tomtom/actions/autocomplete-search/autocomplete-search.mjs (1)
response(36-43)components/tomtom/actions/poi-search/poi-search.mjs (1)
response(54-64)
components/tomtom/tomtom.app.mjs (1)
components/notion/actions/common/base-page-builder.mjs (1)
extension(229-229)
⏰ 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). (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (7)
components/tomtom/package.json (1)
3-3: LGTM!The version bump to 0.1.0 is appropriate for these new features, and the
@pipedream/platformdependency is correctly added for the axios integration used in the app methods.Also applies to: 15-16
components/tomtom/common/constants.mjs (1)
1-7: LGTM!The extensions array is well-structured and covers the standard response formats.
components/tomtom/actions/autocomplete-search/autocomplete-search.mjs (1)
35-46: LGTM!The action correctly calls
autocompleteSearchwith all required parameters including the extension, and exports an appropriate summary.components/tomtom/actions/nearby-search/nearby-search.mjs (1)
58-59: LGTM!The summary export and response return are correctly implemented.
components/tomtom/actions/poi-search/poi-search.mjs (1)
65-67: LGTM!The summary export and response return are correctly implemented.
components/tomtom/tomtom.app.mjs (2)
7-47: LGTM!The prop definitions are well-structured and provide clear descriptions. Using constants for language and extension options ensures consistency across actions.
49-67: LGTM!The base URL and request helper are correctly implemented. The axios integration properly injects the API key into query parameters.
components/tomtom/actions/autocomplete-search/autocomplete-search.mjs
Outdated
Show resolved
Hide resolved
| props: { | ||
| app, | ||
| language: { | ||
| propDefinition: [ | ||
| app, | ||
| "language", | ||
| ], | ||
| }, | ||
| lat: { | ||
| propDefinition: [ | ||
| app, | ||
| "lat", | ||
| ], | ||
| }, | ||
| lon: { | ||
| propDefinition: [ | ||
| app, | ||
| "lon", | ||
| ], | ||
| }, | ||
| radius: { | ||
| propDefinition: [ | ||
| app, | ||
| "radius", | ||
| ], | ||
| }, | ||
| limit: { | ||
| propDefinition: [ | ||
| app, | ||
| "limit", | ||
| ], | ||
| }, | ||
| }, |
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.
Add the missing extension property.
The action doesn't define an extension prop, but the app.nearbySearch method (line 80 in tomtom.app.mjs) requires it to construct the API path. Without it, the extension will be undefined, resulting in an invalid API URL.
Add the extension prop to match the autocomplete-search pattern:
limit: {
propDefinition: [
app,
"limit",
],
},
+ extension: {
+ propDefinition: [
+ app,
+ "extension",
+ ],
+ },
},And pass it to the method call:
async run({ $ }) {
const response = await this.app.nearbySearch({
$,
+ extension: this.extension,
params: {
language: this.language,Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In components/tomtom/actions/nearby-search/nearby-search.mjs around lines 14 to
46, the action is missing an extension prop which app.nearbySearch
(tomtom.app.mjs line ~80) requires to build the API path; add an extension prop
entry matching the existing pattern (use propDefinition: [app, "extension"] like
the autocomplete-search implementation) and then ensure the extension value is
passed into the call to app.nearbySearch where nearby-search invokes it so the
API URL is constructed with the extension provided.
| props: { | ||
| app, | ||
| query: { | ||
| propDefinition: [ | ||
| app, | ||
| "query", | ||
| ], | ||
| }, | ||
| language: { | ||
| propDefinition: [ | ||
| app, | ||
| "language", | ||
| ], | ||
| }, | ||
| lat: { | ||
| propDefinition: [ | ||
| app, | ||
| "lat", | ||
| ], | ||
| }, | ||
| lon: { | ||
| propDefinition: [ | ||
| app, | ||
| "lon", | ||
| ], | ||
| }, | ||
| radius: { | ||
| propDefinition: [ | ||
| app, | ||
| "radius", | ||
| ], | ||
| }, | ||
| limit: { | ||
| propDefinition: [ | ||
| app, | ||
| "limit", | ||
| ], | ||
| }, | ||
| }, |
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.
Add the missing extension property.
Similar to the nearby-search action, this action doesn't define an extension prop, but the app.poiSearch method (line 89 in tomtom.app.mjs) requires it to construct the API path. Without it, the extension will be undefined, resulting in an invalid API URL.
Add the extension prop:
limit: {
propDefinition: [
app,
"limit",
],
},
+ extension: {
+ propDefinition: [
+ app,
+ "extension",
+ ],
+ },
},And pass it to the method call:
async run({ $ }) {
const response = await this.app.poiSearch({
$,
+ extension: this.extension,
query: this.query,
params: {Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In components/tomtom/actions/poi-search/poi-search.mjs around lines 14 to 52,
the props object is missing the required extension property which
tomtom.app.mjs's app.poiSearch expects to build the API path; add an extension
prop entry mirroring the nearby-search action (propDefinition: [app,
"extension"]) and then update the call-site that invokes app.poiSearch to pass
the extension argument so the API URL is constructed correctly.
| "value": "uk-UA", | ||
| "label": "Ukranian", | ||
| }, |
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.
Fix the typo in the language label.
Line 216 contains a spelling error: "Ukranian" should be "Ukrainian".
Apply this diff to fix the typo:
{
"value": "uk-UA",
- "label": "Ukranian",
+ "label": "Ukrainian",
},📝 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.
| "value": "uk-UA", | |
| "label": "Ukranian", | |
| }, | |
| { | |
| "value": "uk-UA", | |
| "label": "Ukrainian", | |
| }, |
🤖 Prompt for AI Agents
In components/tomtom/common/constants.mjs around lines 214 to 216, the language
label for locale "uk-UA" is misspelled as "Ukranian"; update the "label" value
to the correct spelling "Ukrainian" so the entry reads with "value": "uk-UA" and
"label": "Ukrainian".
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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!
For Integration QA: |
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
WHY
Summary by CodeRabbit
New Features
Chores