sonovault 4.5.1 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![CI](https://github.com/rekordcloud/sonovault-js/actions/workflows/ci.yml/badge.svg)](https://github.com/rekordcloud/sonovault-js/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/sonovault)](https://www.npmjs.com/package/sonovault)
5
5
 
6
- TypeScript/Node client for the **[SonoVault](https://sonovault.now)** music metadata API. 93M+ tracks with ISRC, ISWC, genre, BPM, musical key, record label, canonical release dates, and cross-platform IDs for Spotify, Apple Music, Tidal, Beatport, Discogs, and MusicBrainz. One call resolves them all.
6
+ TypeScript/Node client for the **[SonoVault](https://sonovault.now)** music metadata API. 93M+ tracks with ISRC, ISWC, genre, BPM, musical key, record label, canonical release dates, and cross-platform IDs for Spotify, Apple Music, Tidal, Beatport, Discogs, MusicBrainz, YouTube, Deezer, and SoundCloud. One call resolves them all.
7
7
 
8
8
  - **One key, no OAuth.** A single `x-api-key` header, no approval queue.
9
9
  - **Free tier.** 1,000 requests/month, no credit card: [get an API key](https://sonovault.now).
@@ -50,6 +50,12 @@ for (const e of release.editions ?? []) {
50
50
  }
51
51
  const deluxe = await sv.releases.get(7, { edition: 16216 });
52
52
 
53
+ // Find an album's UPC from its name, or the release behind a barcode
54
+ const [found] = (await sv.releases.search({ title: "Discovery", artist: "Daft Punk" })).results;
55
+ console.log(found.digital_upc); // 724384960650
56
+ const byBarcode = await sv.releases.byUpc("724384960650"); // UPC-A or EAN-13, 404 if unknown
57
+ console.log(byBarcode.results[0].title); // Discovery
58
+
53
59
  // Recording to composition (ISWC), for royalty and publishing workflows
54
60
  const work = await sv.tracks.iswc({ isrc: "GBDUW0000053" });
55
61
 
@@ -148,7 +154,7 @@ Runnable scripts live in [`examples/`](examples/): find an ISRC, resolve cross-p
148
154
  | `sv.tracks` | `search`, `get`, `byIsrc`, `iswc`, `byIswc`, `links`, `resolve`, `identifyAudio`, `browse` |
149
155
  | `sv.artists` | `search`, `get`, `releases` |
150
156
  | `sv.labels` | `search`, `get`, `releases`, `artists` |
151
- | `sv.releases` | `search`, `get`, `latest` |
157
+ | `sv.releases` | `search`, `get`, `byUpc`, `latest` |
152
158
  | `sv.genres` | `list` |
153
159
  | `sv.suggestions` | `submit`, `list` |
154
160
  | `sv.streams` | `create`, `list`, `get`, `update`, `history`, `report`, `live`, `stop` |
package/dist/index.cjs CHANGED
@@ -50,7 +50,7 @@ var SonoVaultError = class extends Error {
50
50
  };
51
51
 
52
52
  // src/version.ts
53
- var VERSION = "4.5.1";
53
+ var VERSION = "4.7.0";
54
54
 
55
55
  // src/client.ts
56
56
  var SonoVault = class {
@@ -110,6 +110,14 @@ var SonoVault = class {
110
110
  * edition's track numbering instead of the default consensus.
111
111
  */
112
112
  get: (id, params = {}) => this.request(`/v1/releases/${id}`, { query: params }),
113
+ /**
114
+ * The release behind a UPC, EAN or GTIN barcode (GET /v1/releases/upc/:upc).
115
+ * Accepts 8 to 14 digits (spaces and hyphens are ignored); a 12-digit UPC-A
116
+ * and its 13-digit EAN form with a leading zero find the same release.
117
+ * Throws `SonoVaultError` with status 404 when no release carries the
118
+ * barcode. Free tier.
119
+ */
120
+ byUpc: (upc) => this.request(`/v1/releases/upc/${encodeURIComponent(upc)}`),
113
121
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
114
122
  latest: (params = {}) => this.request("/v1/releases/new", { query: params })
115
123
  };
package/dist/index.d.cts CHANGED
@@ -191,7 +191,7 @@ interface Release {
191
191
  * MusicBrainz and Discogs digital editions whose title matches the release).
192
192
  * 12 digits (UPC-A) when it fits, otherwise the 13-digit EAN. `null` when no
193
193
  * digital edition carries one. Returned by `releases.get()` and
194
- * `releases.new()`.
194
+ * `releases.latest()`, and on every result of `releases.search()`.
195
195
  */
196
196
  digital_upc?: string | null;
197
197
  [key: string]: unknown;
@@ -260,6 +260,12 @@ interface Genre {
260
260
  }
261
261
  /** A track's ID on an external platform, with a deep link. */
262
262
  interface PlatformLink {
263
+ /**
264
+ * The platform: `"spotify"`, `"beatport"`, `"discogs"`, `"musicbrainz"`,
265
+ * `"applemusic"`, `"tidal"`, `"youtube"`, `"deezer"` or `"soundcloud"`.
266
+ * A `"soundcloud"` link's `url` is the track's soundcloud.com permalink, or
267
+ * SoundCloud's embed player URL when no permalink is known.
268
+ */
263
269
  source: string;
264
270
  external_id: string;
265
271
  url: string | null;
@@ -288,7 +294,7 @@ interface IswcLookupResponse {
288
294
  }[];
289
295
  [key: string]: unknown;
290
296
  }
291
- type ResolveInputType = "track_name" | "isrc" | "sonovault_id" | "spotify_id" | "applemusic_id" | "tidal_id" | "beatport_id" | "discogs_id" | "musicbrainz_id";
297
+ type ResolveInputType = "track_name" | "isrc" | "sonovault_id" | "spotify_id" | "applemusic_id" | "tidal_id" | "beatport_id" | "discogs_id" | "musicbrainz_id" | "deezer_id" | "soundcloud_id";
292
298
  interface ResolveRequest {
293
299
  input_type: ResolveInputType;
294
300
  /**
@@ -399,6 +405,35 @@ interface StreamEvent {
399
405
  };
400
406
  [key: string]: unknown;
401
407
  }
408
+ /** One release carrying the barcode you looked up, from `releases.byUpc()`. */
409
+ interface UpcLookupResult {
410
+ id: number;
411
+ title: string;
412
+ artist: {
413
+ id: number;
414
+ name: string;
415
+ };
416
+ label: {
417
+ id: number;
418
+ name: string;
419
+ } | null;
420
+ release_date: string | null;
421
+ /**
422
+ * The UPC the release was delivered to digital stores with. Often the same
423
+ * as the barcode you asked for, but a release can carry several (CD, vinyl,
424
+ * reissue). `null` when no digital edition carries one.
425
+ */
426
+ digital_upc: string | null;
427
+ /** Formats of the editions that carry this barcode (`cd`, `vinyl`, `digital`, ...). */
428
+ formats: string[];
429
+ }
430
+ /** Response of `releases.byUpc()`. */
431
+ interface UpcLookupResponse {
432
+ /** The barcode, normalised: 12 digits (UPC-A) when it fits, otherwise the 13 or 14 digit EAN/GTIN. */
433
+ upc: string;
434
+ /** The releases that carry it, oldest first, at most 25. Usually one. */
435
+ results: UpcLookupResult[];
436
+ }
402
437
 
403
438
  interface SonoVaultOptions {
404
439
  /** Your API key — get a free one at https://sonovault.now (1,000 requests/month). */
@@ -461,6 +496,9 @@ declare class SonoVault {
461
496
  applemusic_id?: string;
462
497
  tidal_id?: string;
463
498
  youtube_id?: string;
499
+ deezer_id?: string;
500
+ /** SoundCloud track ID, a numeric string. */
501
+ soundcloud_id?: string;
464
502
  }) => Promise<PlatformLinksResponse>;
465
503
  /** Resolve up to 100 track names, ISRCs, or platform IDs in one request. */
466
504
  resolve: (body: ResolveRequest) => Promise<ResolveResponse>;
@@ -527,6 +565,14 @@ declare class SonoVault {
527
565
  get: (id: number, params?: {
528
566
  edition?: number;
529
567
  }) => Promise<Release>;
568
+ /**
569
+ * The release behind a UPC, EAN or GTIN barcode (GET /v1/releases/upc/:upc).
570
+ * Accepts 8 to 14 digits (spaces and hyphens are ignored); a 12-digit UPC-A
571
+ * and its 13-digit EAN form with a leading zero find the same release.
572
+ * Throws `SonoVaultError` with status 404 when no release carries the
573
+ * barcode. Free tier.
574
+ */
575
+ byUpc: (upc: string) => Promise<UpcLookupResponse>;
530
576
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
531
577
  latest: (params?: {
532
578
  limit?: number;
@@ -658,4 +704,4 @@ declare function verifyWebhookSignature(options: {
658
704
  */
659
705
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
660
706
 
661
- export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type KeySource, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackKey, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
707
+ export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type KeySource, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackKey, type TrackRelease, type UpcLookupResponse, type UpcLookupResult, type Webhook, paginate, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -191,7 +191,7 @@ interface Release {
191
191
  * MusicBrainz and Discogs digital editions whose title matches the release).
192
192
  * 12 digits (UPC-A) when it fits, otherwise the 13-digit EAN. `null` when no
193
193
  * digital edition carries one. Returned by `releases.get()` and
194
- * `releases.new()`.
194
+ * `releases.latest()`, and on every result of `releases.search()`.
195
195
  */
196
196
  digital_upc?: string | null;
197
197
  [key: string]: unknown;
@@ -260,6 +260,12 @@ interface Genre {
260
260
  }
261
261
  /** A track's ID on an external platform, with a deep link. */
262
262
  interface PlatformLink {
263
+ /**
264
+ * The platform: `"spotify"`, `"beatport"`, `"discogs"`, `"musicbrainz"`,
265
+ * `"applemusic"`, `"tidal"`, `"youtube"`, `"deezer"` or `"soundcloud"`.
266
+ * A `"soundcloud"` link's `url` is the track's soundcloud.com permalink, or
267
+ * SoundCloud's embed player URL when no permalink is known.
268
+ */
263
269
  source: string;
264
270
  external_id: string;
265
271
  url: string | null;
@@ -288,7 +294,7 @@ interface IswcLookupResponse {
288
294
  }[];
289
295
  [key: string]: unknown;
290
296
  }
291
- type ResolveInputType = "track_name" | "isrc" | "sonovault_id" | "spotify_id" | "applemusic_id" | "tidal_id" | "beatport_id" | "discogs_id" | "musicbrainz_id";
297
+ type ResolveInputType = "track_name" | "isrc" | "sonovault_id" | "spotify_id" | "applemusic_id" | "tidal_id" | "beatport_id" | "discogs_id" | "musicbrainz_id" | "deezer_id" | "soundcloud_id";
292
298
  interface ResolveRequest {
293
299
  input_type: ResolveInputType;
294
300
  /**
@@ -399,6 +405,35 @@ interface StreamEvent {
399
405
  };
400
406
  [key: string]: unknown;
401
407
  }
408
+ /** One release carrying the barcode you looked up, from `releases.byUpc()`. */
409
+ interface UpcLookupResult {
410
+ id: number;
411
+ title: string;
412
+ artist: {
413
+ id: number;
414
+ name: string;
415
+ };
416
+ label: {
417
+ id: number;
418
+ name: string;
419
+ } | null;
420
+ release_date: string | null;
421
+ /**
422
+ * The UPC the release was delivered to digital stores with. Often the same
423
+ * as the barcode you asked for, but a release can carry several (CD, vinyl,
424
+ * reissue). `null` when no digital edition carries one.
425
+ */
426
+ digital_upc: string | null;
427
+ /** Formats of the editions that carry this barcode (`cd`, `vinyl`, `digital`, ...). */
428
+ formats: string[];
429
+ }
430
+ /** Response of `releases.byUpc()`. */
431
+ interface UpcLookupResponse {
432
+ /** The barcode, normalised: 12 digits (UPC-A) when it fits, otherwise the 13 or 14 digit EAN/GTIN. */
433
+ upc: string;
434
+ /** The releases that carry it, oldest first, at most 25. Usually one. */
435
+ results: UpcLookupResult[];
436
+ }
402
437
 
403
438
  interface SonoVaultOptions {
404
439
  /** Your API key — get a free one at https://sonovault.now (1,000 requests/month). */
@@ -461,6 +496,9 @@ declare class SonoVault {
461
496
  applemusic_id?: string;
462
497
  tidal_id?: string;
463
498
  youtube_id?: string;
499
+ deezer_id?: string;
500
+ /** SoundCloud track ID, a numeric string. */
501
+ soundcloud_id?: string;
464
502
  }) => Promise<PlatformLinksResponse>;
465
503
  /** Resolve up to 100 track names, ISRCs, or platform IDs in one request. */
466
504
  resolve: (body: ResolveRequest) => Promise<ResolveResponse>;
@@ -527,6 +565,14 @@ declare class SonoVault {
527
565
  get: (id: number, params?: {
528
566
  edition?: number;
529
567
  }) => Promise<Release>;
568
+ /**
569
+ * The release behind a UPC, EAN or GTIN barcode (GET /v1/releases/upc/:upc).
570
+ * Accepts 8 to 14 digits (spaces and hyphens are ignored); a 12-digit UPC-A
571
+ * and its 13-digit EAN form with a leading zero find the same release.
572
+ * Throws `SonoVaultError` with status 404 when no release carries the
573
+ * barcode. Free tier.
574
+ */
575
+ byUpc: (upc: string) => Promise<UpcLookupResponse>;
530
576
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
531
577
  latest: (params?: {
532
578
  limit?: number;
@@ -658,4 +704,4 @@ declare function verifyWebhookSignature(options: {
658
704
  */
659
705
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
660
706
 
661
- export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type KeySource, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackKey, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
707
+ export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type KeySource, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackKey, type TrackRelease, type UpcLookupResponse, type UpcLookupResult, type Webhook, paginate, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ var SonoVaultError = class extends Error {
21
21
  };
22
22
 
23
23
  // src/version.ts
24
- var VERSION = "4.5.1";
24
+ var VERSION = "4.7.0";
25
25
 
26
26
  // src/client.ts
27
27
  var SonoVault = class {
@@ -81,6 +81,14 @@ var SonoVault = class {
81
81
  * edition's track numbering instead of the default consensus.
82
82
  */
83
83
  get: (id, params = {}) => this.request(`/v1/releases/${id}`, { query: params }),
84
+ /**
85
+ * The release behind a UPC, EAN or GTIN barcode (GET /v1/releases/upc/:upc).
86
+ * Accepts 8 to 14 digits (spaces and hyphens are ignored); a 12-digit UPC-A
87
+ * and its 13-digit EAN form with a leading zero find the same release.
88
+ * Throws `SonoVaultError` with status 404 when no release carries the
89
+ * barcode. Free tier.
90
+ */
91
+ byUpc: (upc) => this.request(`/v1/releases/upc/${encodeURIComponent(upc)}`),
84
92
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
85
93
  latest: (params = {}) => this.request("/v1/releases/new", { query: params })
86
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonovault",
3
- "version": "4.5.1",
3
+ "version": "4.7.0",
4
4
  "description": "TypeScript/Node client for the SonoVault music metadata API: ISRC, ISWC, genre, BPM, key, labels, release dates, and cross-platform IDs for 93M+ tracks.",
5
5
  "keywords": [
6
6
  "music",
@@ -14,6 +14,8 @@
14
14
  "beatport",
15
15
  "discogs",
16
16
  "musicbrainz",
17
+ "deezer",
18
+ "soundcloud",
17
19
  "audio-recognition"
18
20
  ],
19
21
  "homepage": "https://sonovault.now",