Repository navigation
Add search and locations, fix session refresh, publish with images - #3
Merged
Merged
Conversation
- Add `search` command for marketplace listings with price, state, seller, PayLivery, recency, sort and raw facet filters (no login needed) - Add `locations` command to look up location ids for a postcode - `publish` resolves locationId from postCode/location; drop incorrect location ids from the docs - Store the rotated refresh token on refresh so sessions stay alive, and report an expired session instead of failing with 401 - `whoami` shows whether the session is active - `get` and `categories` work without login - Centralize client headers and update to the Android 8.67.0 identity
Both endpoints return the same numeric ad status, but list and get mapped it differently and neither knew sold (120), so sold ads showed as active or inactive. Map the status id in one place and add draft, pending, rejected and sold.
publish now saves the listing, uploads the template's images, and only then puts it live, so a listing never goes live without its photos. If an upload fails, the listing stays a draft. --draft was accepted but ignored; it now keeps the listing as a draft, and the new `activate` command puts it live.
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.
Summary
New commands
search [keyword...]: search marketplace listings without logging in. Filters for price, state, private/dealer, PayLivery, recency and sort, plus--facetsto list every available filter (category, condition, delivery, ...) with its--filtervalue. Supports--json.locations <postcode>: look up location ids for a postcode.activate <id>: put a draft live.Publishing
publishresolveslocationIdfrompostCodeandlocation, so templates no longer need it. The location ids in the docs were wrong (e.g. 900 for Wien), so I removed them.publishuploads the template'simagesbefore the listing goes live. If an upload fails, the listing stays a draft and the error contains its id.--draftwas accepted but ignored. It now keeps the listing as a draft.Session
willhaben login" error instead of a bare 401.whoamishows whether the session is active.Fixes
listandgetmapped the ad status differently, and neither knew sold (120). Sold ads showed as active or inactive. Both now use one mapping and know draft, pending, rejected and sold.getandcategorieswork without login.src/api/headers.ts) and use the Android 8.67.0 client identity.Testing
whoami,list,get,images, and token refresh. The refresh stores the rotated token and a second refresh with it works.listandgetreport the same status for all listings on a test account.publish --draftwith an image created a draft with its photo. It wasn't publicly searchable.activate,update, and publishing without--draft.