Repository navigation
v1.14.0
- π¨ Overall improvement fe750f1
π¨ BREAKING CHANGES
This is quite a breaking update that requires significant migration effort but establishes a robust, future-proof foundation. The dual API architecture ensures compatibility with both "legacy" and newest Discogs implementations while providing enhanced functionality and type safety.
SearchParams Interface Complete Redesign
π¦ NEW:
- Required:
api: 'v2' | 'legacy'parameter to choose API version - Modern API (
api: 'v2'):artistIds?: number[](replacessearchType: 'artist_id')sellerIds?: number[]releaseIds?: number[](replacessearchType: 'release_id')wantlist?: string(replacessearchType: 'user')currencies?: Currency[](replaces singlecurrency)genres?: Genre[](replaces singlegenre)conditions?: Condition[](replaces singlecondition)priceRange?: {min: number, max: number}sellerRatingMin?: numberincludeGenericSleeves?: booleanincludeSleevelessMedia?: booleanshowUnavailable?: booleansellerRatingCountMin?: number
- Legacy API (
api: 'legacy'):query?: string(replacessearchType: 'q')artistId?: number(replacessearchType: 'artist_id')releaseId?: number(replacessearchType: 'release_id')masterId?: number(replacessearchType: 'master_id')labelId?: number(replacessearchType: 'label_id')
π RENAMED:
formatβformats(now array)formatDescriptionβformatDescriptions(now array)styleβstyles(now array)
ποΈ REMOVED:
searchType: SearchparametersearchValue?: string | numberparametergetSearchParamsFromUrl()functionyear?: numberparameter (useyearsinstead)lang?: Langparameter (legacy API only)
SearchResult Interface Restructure
π¦ NEW:
title: string(flattened from complex object)artist: Array<{id: number | null, name: string, url: string | null}>(enhanced with IDs/URLs)release: {id: number, name: string, url: string}(moved to top level with more data)formats: Array<string>(moved to top level)labels: Array<{id: number, name: string, url: string}>(enhanced with IDs/URLs)
π NULLABLE CHANGES:
Empty string fallbacks are replaced with null.
imageUrl: stringβimageUrl: string | nullseller.score: stringβseller.score: string | nullseller.notes: numberβseller.notes: number | nullcondition.sleeve.full: stringβcondition.sleeve.full: string | nullcondition.sleeve.short: stringβcondition.sleeve.short: string | nullprice.base: string | ''βprice.base: stringprice.shipping: string | ''βprice.shipping: string | nulldescription: stringβdescription: string | null
ποΈ REMOVED:
title.original: stringtitle.artist: stringtitle.item: stringtitle.formats: Array<string>labels: Array<string>(simple strings)
Removed
- URL parameter extraction utilities (
getSearchParamsFromUrl) - Legacy search type/value pattern
Migration Guide
Before
DiscogsMarketplace.search({
searchType: 'artist_id',
searchValue: 244819,
genre: 'Rock',
condition: ['Mint (M)']
})After
// Modern API (recommended)
DiscogsMarketplace.search({
api: 'v2',
artistIds: [244819],
genres: ['Rock'],
conditions: ['Mint (M)']
})
// Legacy API
DiscogsMarketplace.search({
api: 'legacy',
artistId: 244819,
genre: 'Rock',
conditions: ['Mint (M)']
})