Skip to content

v1.14.0

Choose a tag to compare

@KirianCaumes KirianCaumes released this 07 Sep 15:33
· 51 commits to master since this release
  • 🎨 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[] (replaces searchType: 'artist_id')
    • sellerIds?: number[]
    • releaseIds?: number[] (replaces searchType: 'release_id')
    • wantlist?: string (replaces searchType: 'user')
    • currencies?: Currency[] (replaces single currency)
    • genres?: Genre[] (replaces single genre)
    • conditions?: Condition[] (replaces single condition)
    • priceRange?: {min: number, max: number}
    • sellerRatingMin?: number
    • includeGenericSleeves?: boolean
    • includeSleevelessMedia?: boolean
    • showUnavailable?: boolean
    • sellerRatingCountMin?: number
  • Legacy API (api: 'legacy'):
    • query?: string (replaces searchType: 'q')
    • artistId?: number (replaces searchType: 'artist_id')
    • releaseId?: number (replaces searchType: 'release_id')
    • masterId?: number (replaces searchType: 'master_id')
    • labelId?: number (replaces searchType: 'label_id')

πŸ”„ RENAMED:

  • format β†’ formats (now array)
  • formatDescription β†’ formatDescriptions (now array)
  • style β†’ styles (now array)

πŸ—‘οΈ REMOVED:

  • searchType: Search parameter
  • searchValue?: string | number parameter
  • getSearchParamsFromUrl() function
  • year?: number parameter (use years instead)
  • lang?: Lang parameter (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 | null
  • seller.score: string β†’ seller.score: string | null
  • seller.notes: number β†’ seller.notes: number | null
  • condition.sleeve.full: string β†’ condition.sleeve.full: string | null
  • condition.sleeve.short: string β†’ condition.sleeve.short: string | null
  • price.base: string | '' β†’ price.base: string
  • price.shipping: string | '' β†’ price.shipping: string | null
  • description: string β†’ description: string | null

πŸ—‘οΈ REMOVED:

  • title.original: string
  • title.artist: string
  • title.item: string
  • title.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)']
})

v1.13.0...v1.14.0