sonovault 3.0.0 → 4.0.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 +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +57 -2
- package/dist/index.d.ts +57 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,12 @@ for (const link of links) {
|
|
|
37
37
|
console.log(link.source, link.url); // spotify https://open.spotify.com/track/...
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// An album's tracklist, in playing order
|
|
41
|
+
const release = await sv.releases.get(7);
|
|
42
|
+
for (const t of release.tracks ?? []) {
|
|
43
|
+
console.log(t.disc_number, t.track_number, t.title); // 1 1 One More Time
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
// Recording to composition (ISWC), for royalty and publishing workflows
|
|
41
47
|
const work = await sv.tracks.iswc({ isrc: "GBDUW0000053" });
|
|
42
48
|
```
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -35,6 +35,32 @@ interface Track {
|
|
|
35
35
|
/** Canonical subgenres. Empty array when none apply. */
|
|
36
36
|
subgenre: string[];
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* A track as embedded in a release, from `GET /v1/releases/:id`.
|
|
40
|
+
*
|
|
41
|
+
* Same as {@link Track} minus the `releases` array (the release is the object
|
|
42
|
+
* you are already looking at), plus this track's position on that release.
|
|
43
|
+
*/
|
|
44
|
+
interface ReleaseTrack {
|
|
45
|
+
id: number;
|
|
46
|
+
title: string;
|
|
47
|
+
artists: TrackArtist[];
|
|
48
|
+
isrc: string | null;
|
|
49
|
+
duration: number | null;
|
|
50
|
+
/** Canonical genres. Empty array when the track is unclassified. */
|
|
51
|
+
genre: string[];
|
|
52
|
+
/** Canonical subgenres. Empty array when none apply. */
|
|
53
|
+
subgenre: string[];
|
|
54
|
+
/** Disc the track sits on, counting from 1. Null when the position is unknown. */
|
|
55
|
+
disc_number: number | null;
|
|
56
|
+
/**
|
|
57
|
+
* Position on this release, counting from 1 within its disc. A position
|
|
58
|
+
* belongs to the pairing of track and release rather than to the track, so
|
|
59
|
+
* the same recording can be track 6 on an album and track 2 on a
|
|
60
|
+
* compilation. Null when the position is unknown.
|
|
61
|
+
*/
|
|
62
|
+
track_number: number | null;
|
|
63
|
+
}
|
|
38
64
|
/** A cursor-paginated page. `next_cursor` is null on the last page. */
|
|
39
65
|
interface Page<T> {
|
|
40
66
|
results: T[];
|
|
@@ -43,6 +69,18 @@ interface Page<T> {
|
|
|
43
69
|
interface Artist {
|
|
44
70
|
id: number;
|
|
45
71
|
name: string;
|
|
72
|
+
/** Country of origin, in English. Null when unknown. */
|
|
73
|
+
country?: string | null;
|
|
74
|
+
/** Year the artist or group started, or birth year for a solo act. */
|
|
75
|
+
formation_year?: number | null;
|
|
76
|
+
/** Full ISO date, present only when day-level precision is known. */
|
|
77
|
+
formation_date?: string | null;
|
|
78
|
+
/** Platform to handle or URL. Which keys appear varies by artist. */
|
|
79
|
+
social_links?: Record<string, string> | null;
|
|
80
|
+
/** Wikidata entity ID, e.g. `Q185828`. Null when unmapped. */
|
|
81
|
+
wikidata_id?: string | null;
|
|
82
|
+
/** MusicBrainz artist MBID. Null when unmapped. */
|
|
83
|
+
musicbrainz_id?: string | null;
|
|
46
84
|
[key: string]: unknown;
|
|
47
85
|
}
|
|
48
86
|
interface Label {
|
|
@@ -62,7 +100,24 @@ interface Release {
|
|
|
62
100
|
name: string;
|
|
63
101
|
} | null;
|
|
64
102
|
release_date?: string | null;
|
|
65
|
-
|
|
103
|
+
/**
|
|
104
|
+
* MusicBrainz release MBIDs, sorted. An array rather than a single value
|
|
105
|
+
* because a SonoVault release groups every edition of an album and each
|
|
106
|
+
* edition carries its own MBID, so you can pick the edition you need. Empty
|
|
107
|
+
* when unmapped. Only returned by `releases.get()`.
|
|
108
|
+
*/
|
|
109
|
+
musicbrainz_release_ids?: string[];
|
|
110
|
+
/**
|
|
111
|
+
* MusicBrainz release-group MBIDs: the identity of the album across all its
|
|
112
|
+
* editions, as opposed to any one pressing. Usually a single entry. Empty
|
|
113
|
+
* when unmapped. Only returned by `releases.get()`.
|
|
114
|
+
*/
|
|
115
|
+
musicbrainz_release_group_ids?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* The tracklist, in playing order (disc, then track number), with any track
|
|
118
|
+
* whose position is unknown last.
|
|
119
|
+
*/
|
|
120
|
+
tracks?: ReleaseTrack[];
|
|
66
121
|
[key: string]: unknown;
|
|
67
122
|
}
|
|
68
123
|
interface Genre {
|
|
@@ -450,4 +505,4 @@ declare function verifyWebhookSignature(options: {
|
|
|
450
505
|
*/
|
|
451
506
|
declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
|
|
452
507
|
|
|
453
|
-
export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,32 @@ interface Track {
|
|
|
35
35
|
/** Canonical subgenres. Empty array when none apply. */
|
|
36
36
|
subgenre: string[];
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* A track as embedded in a release, from `GET /v1/releases/:id`.
|
|
40
|
+
*
|
|
41
|
+
* Same as {@link Track} minus the `releases` array (the release is the object
|
|
42
|
+
* you are already looking at), plus this track's position on that release.
|
|
43
|
+
*/
|
|
44
|
+
interface ReleaseTrack {
|
|
45
|
+
id: number;
|
|
46
|
+
title: string;
|
|
47
|
+
artists: TrackArtist[];
|
|
48
|
+
isrc: string | null;
|
|
49
|
+
duration: number | null;
|
|
50
|
+
/** Canonical genres. Empty array when the track is unclassified. */
|
|
51
|
+
genre: string[];
|
|
52
|
+
/** Canonical subgenres. Empty array when none apply. */
|
|
53
|
+
subgenre: string[];
|
|
54
|
+
/** Disc the track sits on, counting from 1. Null when the position is unknown. */
|
|
55
|
+
disc_number: number | null;
|
|
56
|
+
/**
|
|
57
|
+
* Position on this release, counting from 1 within its disc. A position
|
|
58
|
+
* belongs to the pairing of track and release rather than to the track, so
|
|
59
|
+
* the same recording can be track 6 on an album and track 2 on a
|
|
60
|
+
* compilation. Null when the position is unknown.
|
|
61
|
+
*/
|
|
62
|
+
track_number: number | null;
|
|
63
|
+
}
|
|
38
64
|
/** A cursor-paginated page. `next_cursor` is null on the last page. */
|
|
39
65
|
interface Page<T> {
|
|
40
66
|
results: T[];
|
|
@@ -43,6 +69,18 @@ interface Page<T> {
|
|
|
43
69
|
interface Artist {
|
|
44
70
|
id: number;
|
|
45
71
|
name: string;
|
|
72
|
+
/** Country of origin, in English. Null when unknown. */
|
|
73
|
+
country?: string | null;
|
|
74
|
+
/** Year the artist or group started, or birth year for a solo act. */
|
|
75
|
+
formation_year?: number | null;
|
|
76
|
+
/** Full ISO date, present only when day-level precision is known. */
|
|
77
|
+
formation_date?: string | null;
|
|
78
|
+
/** Platform to handle or URL. Which keys appear varies by artist. */
|
|
79
|
+
social_links?: Record<string, string> | null;
|
|
80
|
+
/** Wikidata entity ID, e.g. `Q185828`. Null when unmapped. */
|
|
81
|
+
wikidata_id?: string | null;
|
|
82
|
+
/** MusicBrainz artist MBID. Null when unmapped. */
|
|
83
|
+
musicbrainz_id?: string | null;
|
|
46
84
|
[key: string]: unknown;
|
|
47
85
|
}
|
|
48
86
|
interface Label {
|
|
@@ -62,7 +100,24 @@ interface Release {
|
|
|
62
100
|
name: string;
|
|
63
101
|
} | null;
|
|
64
102
|
release_date?: string | null;
|
|
65
|
-
|
|
103
|
+
/**
|
|
104
|
+
* MusicBrainz release MBIDs, sorted. An array rather than a single value
|
|
105
|
+
* because a SonoVault release groups every edition of an album and each
|
|
106
|
+
* edition carries its own MBID, so you can pick the edition you need. Empty
|
|
107
|
+
* when unmapped. Only returned by `releases.get()`.
|
|
108
|
+
*/
|
|
109
|
+
musicbrainz_release_ids?: string[];
|
|
110
|
+
/**
|
|
111
|
+
* MusicBrainz release-group MBIDs: the identity of the album across all its
|
|
112
|
+
* editions, as opposed to any one pressing. Usually a single entry. Empty
|
|
113
|
+
* when unmapped. Only returned by `releases.get()`.
|
|
114
|
+
*/
|
|
115
|
+
musicbrainz_release_group_ids?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* The tracklist, in playing order (disc, then track number), with any track
|
|
118
|
+
* whose position is unknown last.
|
|
119
|
+
*/
|
|
120
|
+
tracks?: ReleaseTrack[];
|
|
66
121
|
[key: string]: unknown;
|
|
67
122
|
}
|
|
68
123
|
interface Genre {
|
|
@@ -450,4 +505,4 @@ declare function verifyWebhookSignature(options: {
|
|
|
450
505
|
*/
|
|
451
506
|
declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
|
|
452
507
|
|
|
453
|
-
export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED