Add device links API and sync workflow#94
Merged
Conversation
Add device links catalog and API support plus a GitHub Action to keep it synced. Introduces data/deviceLinks.json (pulled from msh.to), new lib and route files (src/lib/deviceLinks.ts, src/routes/deviceLinks.ts), and integrates them via changes to src/index.ts and src/routes/index.ts. The workflow (.github/workflows/sync-device-links.yml) fetches https://msh.to/api/urls, validates the payload with jq, pretty-prints to data/deviceLinks.json, and commits changes as github-actions[bot] on an hourly schedule (at :17) so the catalog is reviewable in-repo and no runtime dependency on msh.to is required.
|
shape's right, directly consumable. two things before merge:
good to go once those land. |
- biome.json: ignore data/** so the jq-formatted, Action-synced data/deviceLinks.json is not subject to biome's formatter (it would fail on every hourly sync otherwise). Fixes the red 'quality' check. - Drop originalUrl end-to-end (lib + synced catalog): msh.to's public /api/urls no longer exposes the redirect destination (review feedback), so /resource/deviceLinks doesn't surface it either. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
to meshtastic/Meshtastic-Android
that referenced
this pull request
Jun 10, 2026
…cher
Replace the bundled urls.json + marketplaces.json and the client-side DeviceLinkMatcher heuristic with a fetch of the now-live /resource/deviceLinks endpoint, which returns fully-resolved links (type, targets, regions). The client seeds from a bundled snapshot, refreshes from the network, and filters the cache - mirroring the DeviceHardware repository pattern.
- core/model: NetworkDeviceLink DTOs; DeviceLink drops originalUrl, adds targets
- core/network: ApiService.getDeviceLinks() + DeviceLinksRemoteDataSource
- core/database: device_link drops original_url, adds targets; DB v42 -> v43
- core/data: rewrite DeviceLinkRepositoryImpl (seed -> single-flight refresh); delete DeviceLinkMatcher + the MshTo datasource/model
- assets: replace urls.json + marketplaces.json with a device_links.json snapshot
Internal links are excluded from the directory per the API contract ("clients exclude 'internal' from purchase UI"). F-Droid and desktop fall back to the bundled snapshot when the API is unavailable, as they do for device hardware.
Follow-up to #5714; depends on meshtastic/api#94 and meshtastic/msh.to#3 (both merged).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add device links catalog and API support plus a GitHub Action to keep it synced. Introduces data/deviceLinks.json (pulled from msh.to), new lib and route files (src/lib/deviceLinks.ts, src/routes/deviceLinks.ts), and integrates them via changes to src/index.ts and src/routes/index.ts. The workflow (.github/workflows/sync-device-links.yml) fetches https://msh.to/api/urls, validates the payload with jq, pretty-prints to data/deviceLinks.json, and commits changes as github-actions[bot] on an hourly schedule (at :17) so the catalog is reviewable in-repo and no runtime dependency on msh.to is required.