sonovault 4.0.0 → 4.2.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
@@ -43,8 +43,17 @@ for (const t of release.tracks ?? []) {
43
43
  console.log(t.disc_number, t.track_number, t.title); // 1 1 One More Time
44
44
  }
45
45
 
46
+ // One record groups every edition of an album, so pick the one you mean
47
+ for (const e of release.editions ?? []) {
48
+ console.log(e.id, e.format, e.release_date, e.track_count); // 16216 cd 2001-03-12 14
49
+ }
50
+ const deluxe = await sv.releases.get(7, { edition: 16216 });
51
+
46
52
  // Recording to composition (ISWC), for royalty and publishing workflows
47
53
  const work = await sv.tracks.iswc({ isrc: "GBDUW0000053" });
54
+
55
+ // What a label released on one day (from / until are inclusive YYYY-MM-DD)
56
+ const friday = await sv.labels.releases(1, { from: "2026-09-11", until: "2026-09-11" });
48
57
  ```
49
58
 
50
59
  ## Bulk resolve
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.0.0";
53
+ var VERSION = "4.2.0";
54
54
 
55
55
  // src/client.ts
56
56
  var SonoVault = class {
@@ -89,17 +89,27 @@ var SonoVault = class {
89
89
  this.artists = {
90
90
  search: (params) => this.request("/v1/artists/search", { query: params }),
91
91
  get: (id) => this.request(`/v1/artists/${id}`),
92
+ /** An artist's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD` release dates. */
92
93
  releases: (id, params = {}) => this.request(`/v1/artists/${id}/releases`, { query: params })
93
94
  };
94
95
  this.labels = {
95
96
  search: (params) => this.request("/v1/labels/search", { query: params }),
96
97
  get: (id) => this.request(`/v1/labels/${id}`),
98
+ /**
99
+ * A label's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD`
100
+ * release dates, so `{ from: "2026-09-11", until: "2026-09-11" }` lists one day.
101
+ */
97
102
  releases: (id, params = {}) => this.request(`/v1/labels/${id}/releases`, { query: params }),
98
103
  artists: (id, params = {}) => this.request(`/v1/labels/${id}/artists`, { query: params })
99
104
  };
100
105
  this.releases = {
101
106
  search: (params) => this.request("/v1/releases/search", { query: params }),
102
- get: (id) => this.request(`/v1/releases/${id}`),
107
+ /**
108
+ * One release with its tracklist and the editions behind it. Pass
109
+ * `edition` (an `id` from the response's `editions`) to render that
110
+ * edition's track numbering instead of the default consensus.
111
+ */
112
+ get: (id, params = {}) => this.request(`/v1/releases/${id}`, { query: params }),
103
113
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
104
114
  latest: (params = {}) => this.request("/v1/releases/new", { query: params })
105
115
  };
package/dist/index.d.cts CHANGED
@@ -66,6 +66,15 @@ interface Page<T> {
66
66
  results: T[];
67
67
  next_cursor: string | null;
68
68
  }
69
+ /** Query params for an artist's or a label's release list. */
70
+ type ReleaseListParams = {
71
+ limit?: number;
72
+ cursor?: string;
73
+ /** Only releases dated on or after this day (`YYYY-MM-DD`). Undated releases are left out when `from` or `until` is set. */
74
+ from?: string;
75
+ /** Only releases dated on or before this day (`YYYY-MM-DD`). Pass the same day as `from` for a single release date. */
76
+ until?: string;
77
+ };
69
78
  interface Artist {
70
79
  id: number;
71
80
  name: string;
@@ -115,11 +124,79 @@ interface Release {
115
124
  musicbrainz_release_group_ids?: string[];
116
125
  /**
117
126
  * The tracklist, in playing order (disc, then track number), with any track
118
- * whose position is unknown last.
127
+ * whose position is unknown last. Numbering comes from the edition named by
128
+ * `edition`, or from a consensus across the release's editions when none was
129
+ * named.
119
130
  */
120
131
  tracks?: ReleaseTrack[];
132
+ /**
133
+ * The real editions behind this release, at most 20. A SonoVault release
134
+ * groups every edition of an album onto one record, so the single, the
135
+ * album, the deluxe and the box set share one ID; these are the editions
136
+ * behind it. Chosen so each is a genuinely different edition rather than
137
+ * twenty pressings of the same one. Only returned by `releases.get()`.
138
+ */
139
+ editions?: ReleaseEdition[];
140
+ /**
141
+ * The edition whose numbering `tracks` uses. `null` unless an edition was
142
+ * requested. Only returned by `releases.get()`.
143
+ */
144
+ edition?: number | null;
121
145
  [key: string]: unknown;
122
146
  }
147
+ /**
148
+ * One real edition behind a release: a specific pressing, issue or digital
149
+ * album as one provider describes it. Pass its `id` to
150
+ * `releases.get(id, { edition })` to render that edition's track numbering.
151
+ */
152
+ interface ReleaseEdition {
153
+ id: number;
154
+ /** The provider describing this edition. */
155
+ source: "spotify" | "discogs" | "musicbrainz";
156
+ /** The edition's ID at that provider. */
157
+ external_id: string;
158
+ /**
159
+ * The provider's identity for the album across all its editions: a
160
+ * MusicBrainz release-group MBID or a Discogs master ID. `null` for Spotify,
161
+ * which has no such concept.
162
+ */
163
+ group_external_id: string | null;
164
+ /** The edition's own title, which often carries what makes it distinct. */
165
+ title: string | null;
166
+ edition_kind: "album" | "single" | "ep" | "compilation" | "live" | "remix" | "soundtrack" | "other" | null;
167
+ format: "cd" | "vinyl" | "cassette" | "digital" | "dvd" | "mixed" | "other" | null;
168
+ /** `false` for a release the provider marks unofficial, such as a bootleg. */
169
+ official: boolean | null;
170
+ /**
171
+ * The edition's release date, `YYYY-MM-DD`. Read it with `date_precision`: a
172
+ * month-precision date is reported as the first of the month.
173
+ */
174
+ release_date: string | null;
175
+ date_precision: "day" | "month" | "year" | null;
176
+ /** Barcode or UPC, digits only, so editions can be matched across providers. */
177
+ barcode: string | null;
178
+ /** Where the edition was issued, as the provider names it. Not an ISO code. */
179
+ country: string | null;
180
+ /** How many discs, records or tapes the edition spans. */
181
+ medium_count: number | null;
182
+ /**
183
+ * The provider's own total for the edition, including tracks SonoVault does
184
+ * not hold. Compare with `tracks_on_row` to see the gap.
185
+ */
186
+ track_count: number | null;
187
+ /** How many of this release's tracks sit on the edition. */
188
+ tracks_on_row: number;
189
+ /**
190
+ * The label that issued this pressing, as the provider names it. Pressings of
191
+ * one album often differ: the UK original and a US reissue each carry their own.
192
+ */
193
+ label: {
194
+ id: number;
195
+ name: string;
196
+ } | null;
197
+ /** The pressing's catalog number, from Discogs and MusicBrainz. */
198
+ catalog_no: string | null;
199
+ }
123
200
  interface Genre {
124
201
  id: number;
125
202
  name: string;
@@ -350,10 +427,8 @@ declare class SonoVault {
350
427
  cursor?: string;
351
428
  }) => Promise<Page<Artist>>;
352
429
  get: (id: number) => Promise<Artist>;
353
- releases: (id: number, params?: {
354
- limit?: number;
355
- cursor?: string;
356
- }) => Promise<Page<Release>>;
430
+ /** An artist's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD` release dates. */
431
+ releases: (id: number, params?: ReleaseListParams) => Promise<Page<Release>>;
357
432
  };
358
433
  readonly labels: {
359
434
  search: (params: {
@@ -362,10 +437,11 @@ declare class SonoVault {
362
437
  cursor?: string;
363
438
  }) => Promise<Page<Label>>;
364
439
  get: (id: number) => Promise<Label>;
365
- releases: (id: number, params?: {
366
- limit?: number;
367
- cursor?: string;
368
- }) => Promise<Page<Release>>;
440
+ /**
441
+ * A label's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD`
442
+ * release dates, so `{ from: "2026-09-11", until: "2026-09-11" }` lists one day.
443
+ */
444
+ releases: (id: number, params?: ReleaseListParams) => Promise<Page<Release>>;
369
445
  artists: (id: number, params?: {
370
446
  limit?: number;
371
447
  cursor?: string;
@@ -378,7 +454,14 @@ declare class SonoVault {
378
454
  limit?: number;
379
455
  cursor?: string;
380
456
  }) => Promise<Page<Release>>;
381
- get: (id: number) => Promise<Release>;
457
+ /**
458
+ * One release with its tracklist and the editions behind it. Pass
459
+ * `edition` (an `id` from the response's `editions`) to render that
460
+ * edition's track numbering instead of the default consensus.
461
+ */
462
+ get: (id: number, params?: {
463
+ edition?: number;
464
+ }) => Promise<Release>;
382
465
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
383
466
  latest: (params?: {
384
467
  limit?: number;
@@ -505,4 +588,4 @@ declare function verifyWebhookSignature(options: {
505
588
  */
506
589
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
507
590
 
508
- export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, 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 TrackRelease, type Webhook, paginate, verifyWebhookSignature };
591
+ export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, 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 TrackRelease, type Webhook, paginate, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -66,6 +66,15 @@ interface Page<T> {
66
66
  results: T[];
67
67
  next_cursor: string | null;
68
68
  }
69
+ /** Query params for an artist's or a label's release list. */
70
+ type ReleaseListParams = {
71
+ limit?: number;
72
+ cursor?: string;
73
+ /** Only releases dated on or after this day (`YYYY-MM-DD`). Undated releases are left out when `from` or `until` is set. */
74
+ from?: string;
75
+ /** Only releases dated on or before this day (`YYYY-MM-DD`). Pass the same day as `from` for a single release date. */
76
+ until?: string;
77
+ };
69
78
  interface Artist {
70
79
  id: number;
71
80
  name: string;
@@ -115,11 +124,79 @@ interface Release {
115
124
  musicbrainz_release_group_ids?: string[];
116
125
  /**
117
126
  * The tracklist, in playing order (disc, then track number), with any track
118
- * whose position is unknown last.
127
+ * whose position is unknown last. Numbering comes from the edition named by
128
+ * `edition`, or from a consensus across the release's editions when none was
129
+ * named.
119
130
  */
120
131
  tracks?: ReleaseTrack[];
132
+ /**
133
+ * The real editions behind this release, at most 20. A SonoVault release
134
+ * groups every edition of an album onto one record, so the single, the
135
+ * album, the deluxe and the box set share one ID; these are the editions
136
+ * behind it. Chosen so each is a genuinely different edition rather than
137
+ * twenty pressings of the same one. Only returned by `releases.get()`.
138
+ */
139
+ editions?: ReleaseEdition[];
140
+ /**
141
+ * The edition whose numbering `tracks` uses. `null` unless an edition was
142
+ * requested. Only returned by `releases.get()`.
143
+ */
144
+ edition?: number | null;
121
145
  [key: string]: unknown;
122
146
  }
147
+ /**
148
+ * One real edition behind a release: a specific pressing, issue or digital
149
+ * album as one provider describes it. Pass its `id` to
150
+ * `releases.get(id, { edition })` to render that edition's track numbering.
151
+ */
152
+ interface ReleaseEdition {
153
+ id: number;
154
+ /** The provider describing this edition. */
155
+ source: "spotify" | "discogs" | "musicbrainz";
156
+ /** The edition's ID at that provider. */
157
+ external_id: string;
158
+ /**
159
+ * The provider's identity for the album across all its editions: a
160
+ * MusicBrainz release-group MBID or a Discogs master ID. `null` for Spotify,
161
+ * which has no such concept.
162
+ */
163
+ group_external_id: string | null;
164
+ /** The edition's own title, which often carries what makes it distinct. */
165
+ title: string | null;
166
+ edition_kind: "album" | "single" | "ep" | "compilation" | "live" | "remix" | "soundtrack" | "other" | null;
167
+ format: "cd" | "vinyl" | "cassette" | "digital" | "dvd" | "mixed" | "other" | null;
168
+ /** `false` for a release the provider marks unofficial, such as a bootleg. */
169
+ official: boolean | null;
170
+ /**
171
+ * The edition's release date, `YYYY-MM-DD`. Read it with `date_precision`: a
172
+ * month-precision date is reported as the first of the month.
173
+ */
174
+ release_date: string | null;
175
+ date_precision: "day" | "month" | "year" | null;
176
+ /** Barcode or UPC, digits only, so editions can be matched across providers. */
177
+ barcode: string | null;
178
+ /** Where the edition was issued, as the provider names it. Not an ISO code. */
179
+ country: string | null;
180
+ /** How many discs, records or tapes the edition spans. */
181
+ medium_count: number | null;
182
+ /**
183
+ * The provider's own total for the edition, including tracks SonoVault does
184
+ * not hold. Compare with `tracks_on_row` to see the gap.
185
+ */
186
+ track_count: number | null;
187
+ /** How many of this release's tracks sit on the edition. */
188
+ tracks_on_row: number;
189
+ /**
190
+ * The label that issued this pressing, as the provider names it. Pressings of
191
+ * one album often differ: the UK original and a US reissue each carry their own.
192
+ */
193
+ label: {
194
+ id: number;
195
+ name: string;
196
+ } | null;
197
+ /** The pressing's catalog number, from Discogs and MusicBrainz. */
198
+ catalog_no: string | null;
199
+ }
123
200
  interface Genre {
124
201
  id: number;
125
202
  name: string;
@@ -350,10 +427,8 @@ declare class SonoVault {
350
427
  cursor?: string;
351
428
  }) => Promise<Page<Artist>>;
352
429
  get: (id: number) => Promise<Artist>;
353
- releases: (id: number, params?: {
354
- limit?: number;
355
- cursor?: string;
356
- }) => Promise<Page<Release>>;
430
+ /** An artist's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD` release dates. */
431
+ releases: (id: number, params?: ReleaseListParams) => Promise<Page<Release>>;
357
432
  };
358
433
  readonly labels: {
359
434
  search: (params: {
@@ -362,10 +437,11 @@ declare class SonoVault {
362
437
  cursor?: string;
363
438
  }) => Promise<Page<Label>>;
364
439
  get: (id: number) => Promise<Label>;
365
- releases: (id: number, params?: {
366
- limit?: number;
367
- cursor?: string;
368
- }) => Promise<Page<Release>>;
440
+ /**
441
+ * A label's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD`
442
+ * release dates, so `{ from: "2026-09-11", until: "2026-09-11" }` lists one day.
443
+ */
444
+ releases: (id: number, params?: ReleaseListParams) => Promise<Page<Release>>;
369
445
  artists: (id: number, params?: {
370
446
  limit?: number;
371
447
  cursor?: string;
@@ -378,7 +454,14 @@ declare class SonoVault {
378
454
  limit?: number;
379
455
  cursor?: string;
380
456
  }) => Promise<Page<Release>>;
381
- get: (id: number) => Promise<Release>;
457
+ /**
458
+ * One release with its tracklist and the editions behind it. Pass
459
+ * `edition` (an `id` from the response's `editions`) to render that
460
+ * edition's track numbering instead of the default consensus.
461
+ */
462
+ get: (id: number, params?: {
463
+ edition?: number;
464
+ }) => Promise<Release>;
382
465
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
383
466
  latest: (params?: {
384
467
  limit?: number;
@@ -505,4 +588,4 @@ declare function verifyWebhookSignature(options: {
505
588
  */
506
589
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
507
590
 
508
- export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, 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 TrackRelease, type Webhook, paginate, verifyWebhookSignature };
591
+ export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, 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 TrackRelease, 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.0.0";
24
+ var VERSION = "4.2.0";
25
25
 
26
26
  // src/client.ts
27
27
  var SonoVault = class {
@@ -60,17 +60,27 @@ var SonoVault = class {
60
60
  this.artists = {
61
61
  search: (params) => this.request("/v1/artists/search", { query: params }),
62
62
  get: (id) => this.request(`/v1/artists/${id}`),
63
+ /** An artist's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD` release dates. */
63
64
  releases: (id, params = {}) => this.request(`/v1/artists/${id}/releases`, { query: params })
64
65
  };
65
66
  this.labels = {
66
67
  search: (params) => this.request("/v1/labels/search", { query: params }),
67
68
  get: (id) => this.request(`/v1/labels/${id}`),
69
+ /**
70
+ * A label's releases, newest first. `from` / `until` are inclusive `YYYY-MM-DD`
71
+ * release dates, so `{ from: "2026-09-11", until: "2026-09-11" }` lists one day.
72
+ */
68
73
  releases: (id, params = {}) => this.request(`/v1/labels/${id}/releases`, { query: params }),
69
74
  artists: (id, params = {}) => this.request(`/v1/labels/${id}/artists`, { query: params })
70
75
  };
71
76
  this.releases = {
72
77
  search: (params) => this.request("/v1/releases/search", { query: params }),
73
- get: (id) => this.request(`/v1/releases/${id}`),
78
+ /**
79
+ * One release with its tracklist and the editions behind it. Pass
80
+ * `edition` (an `id` from the response's `editions`) to render that
81
+ * edition's track numbering instead of the default consensus.
82
+ */
83
+ get: (id, params = {}) => this.request(`/v1/releases/${id}`, { query: params }),
74
84
  /** Newly released albums (GET /v1/releases/new). Paid tiers. */
75
85
  latest: (params = {}) => this.request("/v1/releases/new", { query: params })
76
86
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sonovault",
3
- "version": "4.0.0",
4
- "description": "TypeScript/Node client for the SonoVault music metadata API — ISRC, ISWC, genre, labels, release dates, and cross-platform IDs for 93M+ tracks.",
3
+ "version": "4.2.0",
4
+ "description": "TypeScript/Node client for the SonoVault music metadata API \u2014 ISRC, ISWC, genre, labels, release dates, and cross-platform IDs for 93M+ tracks.",
5
5
  "keywords": [
6
6
  "music",
7
7
  "metadata",