musicbrainz-api 0.9.0 → 0.10.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 +0 -2
- package/lib/musicbrainz-api.d.ts +30 -3
- package/lib/musicbrainz-api.js +8 -0
- package/lib/musicbrainz.types.d.ts +16 -15
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -316,7 +316,6 @@ const places = await browseSeries();
|
|
|
316
316
|
| `query.release-group` | Release-group MBID |
|
|
317
317
|
| `query.work` | Work MBID |
|
|
318
318
|
|
|
319
|
-
|
|
320
319
|
### Browse works
|
|
321
320
|
```js
|
|
322
321
|
const places = await browseWorks();
|
|
@@ -327,7 +326,6 @@ const places = await browseWorks();
|
|
|
327
326
|
| `query.artist` | Artist MBID |
|
|
328
327
|
| `query.xollection` | Collection MBID |
|
|
329
328
|
|
|
330
|
-
|
|
331
329
|
### Browse urls
|
|
332
330
|
```js
|
|
333
331
|
const urls = await browseUrls();
|
package/lib/musicbrainz-api.d.ts
CHANGED
|
@@ -6,6 +6,27 @@ import { XmlMetadata } from './xml/xml-metadata';
|
|
|
6
6
|
import * as mb from './musicbrainz.types';
|
|
7
7
|
export * from './musicbrainz.types';
|
|
8
8
|
export declare type RelationsIncludes = 'area-rels' | 'artist-rels' | 'event-rels' | 'instrument-rels' | 'label-rels' | 'place-rels' | 'recording-rels' | 'release-rels' | 'release-group-rels' | 'series-rels' | 'url-rels' | 'work-rels';
|
|
9
|
+
export declare type SubQueryIncludes =
|
|
10
|
+
/**
|
|
11
|
+
* include discids for all media in the releases
|
|
12
|
+
*/
|
|
13
|
+
'discids'
|
|
14
|
+
/**
|
|
15
|
+
* include media for all releases, this includes the # of tracks on each medium and its format.
|
|
16
|
+
*/
|
|
17
|
+
| 'media'
|
|
18
|
+
/**
|
|
19
|
+
* include isrcs for all recordings
|
|
20
|
+
*/
|
|
21
|
+
| 'isrcs'
|
|
22
|
+
/**
|
|
23
|
+
* include artists credits for all releases and recordings
|
|
24
|
+
*/
|
|
25
|
+
| 'artist-credits'
|
|
26
|
+
/**
|
|
27
|
+
* include only those releases where the artist appears on one of the tracks, only valid on artists in combination with `releases`
|
|
28
|
+
*/
|
|
29
|
+
| 'various-artists';
|
|
9
30
|
export declare type MiscIncludes = 'aliases' | 'annotation' | 'tags' | 'genres' | 'ratings' | 'media';
|
|
10
31
|
export declare type AreaIncludes = MiscIncludes | RelationsIncludes;
|
|
11
32
|
export declare type ArtistIncludes = MiscIncludes | RelationsIncludes | 'recordings' | 'releases' | 'release-groups' | 'works';
|
|
@@ -15,9 +36,9 @@ export declare type GenreIncludes = MiscIncludes;
|
|
|
15
36
|
export declare type InstrumentIncludes = MiscIncludes | RelationsIncludes;
|
|
16
37
|
export declare type LabelIncludes = MiscIncludes | RelationsIncludes | 'releases';
|
|
17
38
|
export declare type PlaceIncludes = MiscIncludes | RelationsIncludes;
|
|
18
|
-
export declare type RecordingIncludes = MiscIncludes | RelationsIncludes | 'artists' | 'releases' | 'isrcs';
|
|
19
|
-
export declare type ReleasesIncludes = MiscIncludes | RelationsIncludes | 'artists' | 'collections' | 'labels' | 'recordings' | 'release-groups';
|
|
20
|
-
export declare type ReleaseGroupIncludes = MiscIncludes | RelationsIncludes | 'artists' | 'releases';
|
|
39
|
+
export declare type RecordingIncludes = MiscIncludes | RelationsIncludes | SubQueryIncludes | 'artists' | 'releases' | 'isrcs';
|
|
40
|
+
export declare type ReleasesIncludes = MiscIncludes | SubQueryIncludes | RelationsIncludes | 'artists' | 'collections' | 'labels' | 'recordings' | 'release-groups';
|
|
41
|
+
export declare type ReleaseGroupIncludes = MiscIncludes | SubQueryIncludes | RelationsIncludes | 'artists' | 'releases';
|
|
21
42
|
export declare type SeriesIncludes = MiscIncludes | RelationsIncludes;
|
|
22
43
|
export declare type WorkIncludes = MiscIncludes | RelationsIncludes;
|
|
23
44
|
export declare type UrlIncludes = RelationsIncludes;
|
|
@@ -83,6 +104,12 @@ export declare class MusicBrainzApi {
|
|
|
83
104
|
* @param inc Sub-queries
|
|
84
105
|
*/
|
|
85
106
|
lookupArtist(artistId: string, inc?: ArtistIncludes[]): Promise<mb.IArtist>;
|
|
107
|
+
/**
|
|
108
|
+
* Lookup collection
|
|
109
|
+
* @param collectionId Collection MBID
|
|
110
|
+
* @param inc List of additional information to be included about the entity. Any of the entities directly linked to the entity can be included.
|
|
111
|
+
*/
|
|
112
|
+
lookupCollection(collectionId: string, inc?: ArtistIncludes[]): Promise<mb.ICollection>;
|
|
86
113
|
/**
|
|
87
114
|
* Lookup instrument
|
|
88
115
|
* @param artistId Instrument MBID
|
package/lib/musicbrainz-api.js
CHANGED
|
@@ -157,6 +157,14 @@ class MusicBrainzApi {
|
|
|
157
157
|
lookupArtist(artistId, inc = []) {
|
|
158
158
|
return this.lookupEntity('artist', artistId, inc);
|
|
159
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Lookup collection
|
|
162
|
+
* @param collectionId Collection MBID
|
|
163
|
+
* @param inc List of additional information to be included about the entity. Any of the entities directly linked to the entity can be included.
|
|
164
|
+
*/
|
|
165
|
+
lookupCollection(collectionId, inc = []) {
|
|
166
|
+
return this.lookupEntity('collection', collectionId, inc);
|
|
167
|
+
}
|
|
160
168
|
/**
|
|
161
169
|
* Lookup instrument
|
|
162
170
|
* @param artistId Instrument MBID
|
|
@@ -56,6 +56,14 @@ export interface IArtistCredit {
|
|
|
56
56
|
joinphrase: string;
|
|
57
57
|
name: string;
|
|
58
58
|
}
|
|
59
|
+
export interface ICollection extends IEntity {
|
|
60
|
+
type: string;
|
|
61
|
+
name: string;
|
|
62
|
+
'type-id': string;
|
|
63
|
+
'recording-count': number;
|
|
64
|
+
editor: string;
|
|
65
|
+
'entity-type': string;
|
|
66
|
+
}
|
|
59
67
|
export interface IEvent extends IEntity {
|
|
60
68
|
cancelled: boolean;
|
|
61
69
|
type: string;
|
|
@@ -182,13 +190,13 @@ export interface IRelation {
|
|
|
182
190
|
'attribute-ids': any;
|
|
183
191
|
direction: RelationDirection;
|
|
184
192
|
'target-credit': string;
|
|
185
|
-
end: null |
|
|
193
|
+
end: null | unknown;
|
|
186
194
|
'source-credit': string;
|
|
187
195
|
ended: boolean;
|
|
188
|
-
'attribute-values':
|
|
196
|
+
'attribute-values': unknown;
|
|
189
197
|
attributes?: any[];
|
|
190
198
|
type: string;
|
|
191
|
-
begin?: null |
|
|
199
|
+
begin?: null | unknown;
|
|
192
200
|
'target-type'?: 'url';
|
|
193
201
|
'type-id': string;
|
|
194
202
|
url?: IUrl;
|
|
@@ -493,13 +501,6 @@ export interface IReleaseGroupsQuery extends IPagination {
|
|
|
493
501
|
collection?: string;
|
|
494
502
|
release?: string;
|
|
495
503
|
}
|
|
496
|
-
/**
|
|
497
|
-
* Browse series query <entity>: <MBID>
|
|
498
|
-
* https://wiki.musicbrainz.org/MusicBrainz_API#Linked_entities
|
|
499
|
-
*/
|
|
500
|
-
export interface IBrowseSeriesQuery extends IPagination {
|
|
501
|
-
recording?: string;
|
|
502
|
-
}
|
|
503
504
|
/**
|
|
504
505
|
* Browse release query <entity>: <MBID>
|
|
505
506
|
* https://wiki.musicbrainz.org/MusicBrainz_API#Linked_entities
|
|
@@ -533,27 +534,27 @@ export interface IBrowseArtistsResult {
|
|
|
533
534
|
'artist-offset': number;
|
|
534
535
|
}
|
|
535
536
|
export interface IBrowseCollectionsResult {
|
|
536
|
-
collections:
|
|
537
|
+
collections: ICollection[];
|
|
537
538
|
'collection-count': number;
|
|
538
539
|
'collection-offset': number;
|
|
539
540
|
}
|
|
540
541
|
export interface IBrowseEventsResult {
|
|
541
|
-
events:
|
|
542
|
+
events: IEvent[];
|
|
542
543
|
'event-count': number;
|
|
543
544
|
'event-offset': number;
|
|
544
545
|
}
|
|
545
546
|
export interface IBrowseInstrumentsResult {
|
|
546
|
-
instruments:
|
|
547
|
+
instruments: IInstrument[];
|
|
547
548
|
'instrument-count': number;
|
|
548
549
|
'instrument-offset': number;
|
|
549
550
|
}
|
|
550
551
|
export interface IBrowseLabelsResult {
|
|
551
|
-
label:
|
|
552
|
+
label: ILabel[];
|
|
552
553
|
'label-count': number;
|
|
553
554
|
'label-offset': number;
|
|
554
555
|
}
|
|
555
556
|
export interface IBrowsePlacesResult {
|
|
556
|
-
place:
|
|
557
|
+
place: IPlace[];
|
|
557
558
|
'place-count': number;
|
|
558
559
|
'place-offset': number;
|
|
559
560
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "musicbrainz-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "MusicBrainz API client for reading and submitting metadata",
|
|
5
5
|
"main": "lib/musicbrainz-api",
|
|
6
6
|
"types": "lib/musicbrainz-api",
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^5.13.0",
|
|
56
56
|
"@typescript-eslint/parser": "^5.13.0",
|
|
57
57
|
"chai": "^4.2.0",
|
|
58
|
-
"del-cli": "^
|
|
58
|
+
"del-cli": "^5.0.0",
|
|
59
59
|
"eslint": "^8.10.0",
|
|
60
60
|
"eslint-config-prettier": "^8.4.0",
|
|
61
|
-
"eslint-import-resolver-typescript": "^
|
|
61
|
+
"eslint-import-resolver-typescript": "^3.3.0",
|
|
62
62
|
"eslint-plugin-import": "^2.25.4",
|
|
63
|
-
"eslint-plugin-jsdoc": "^
|
|
63
|
+
"eslint-plugin-jsdoc": "^39.3.3",
|
|
64
64
|
"eslint-plugin-node": "^11.1.0",
|
|
65
|
-
"eslint-plugin-unicorn": "^
|
|
65
|
+
"eslint-plugin-unicorn": "^43.0.2",
|
|
66
66
|
"mocha": "^9.0.1",
|
|
67
67
|
"nyc": "^15.0.0",
|
|
68
|
-
"remark-cli": "^
|
|
68
|
+
"remark-cli": "^11.0.0",
|
|
69
69
|
"remark-preset-lint-recommended": "^6.1.2",
|
|
70
70
|
"ts-node": "^10.0.0",
|
|
71
71
|
"tslint": "^6.1.1",
|