musicbrainz-api 1.1.0 → 1.2.1
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/entry-node.js +0 -1
- package/lib/musicbrainz-api.d.ts +1 -1
- package/lib/musicbrainz.types.d.ts +56 -21
- package/package.json +14 -10
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
[](https://app.codacy.com/gh/Borewit/musicbrainz-api/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
7
7
|
[](https://snyk.io/test/github/Borewit/musicbrainz-api?targetFile=package.json)
|
|
8
8
|
[](https://deepscan.io/dashboard#view=project&tid=5165&pid=6991&bid=63373)
|
|
9
|
-
[](https://discord.gg/958xT5X)
|
|
10
|
-
[](https://bundlejs.com/?q=musicbrainz-api)
|
|
11
9
|
|
|
12
10
|
# musicbrainz-api
|
|
13
11
|
|
package/lib/entry-node.js
CHANGED
package/lib/musicbrainz-api.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { XmlIsrc } from './xml/xml-isrc.js';
|
|
|
7
7
|
export { XmlIsrcList } from './xml/xml-isrc-list.js';
|
|
8
8
|
export { XmlRecording } from './xml/xml-recording.js';
|
|
9
9
|
export * from './musicbrainz.types.js';
|
|
10
|
-
export 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';
|
|
10
|
+
export type RelationsIncludes = 'area-rels' | 'artist-rels' | 'event-rels' | 'genre-rels' | 'instrument-rels' | 'label-rels' | 'place-rels' | 'recording-rels' | 'release-rels' | 'release-group-rels' | 'series-rels' | 'url-rels' | 'work-rels';
|
|
11
11
|
export type SubQueryIncludes =
|
|
12
12
|
/**
|
|
13
13
|
* include discids for all media in the releases
|
|
@@ -24,7 +24,7 @@ export interface IAnnotation {
|
|
|
24
24
|
text: string;
|
|
25
25
|
type: string;
|
|
26
26
|
}
|
|
27
|
-
export interface IArea extends ITypedEntity {
|
|
27
|
+
export interface IArea extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres {
|
|
28
28
|
type: 'Country' | 'Subdivision' | 'Municipality' | 'City' | 'District' | 'Island';
|
|
29
29
|
'iso-3166-1-codes'?: string[];
|
|
30
30
|
primary: boolean;
|
|
@@ -46,7 +46,7 @@ export interface IMatch {
|
|
|
46
46
|
score: number;
|
|
47
47
|
}
|
|
48
48
|
export type Gender = 'male' | 'female' | 'other' | 'not applicable';
|
|
49
|
-
export interface IArtist extends ITypedEntity, IMayHaveRelations {
|
|
49
|
+
export interface IArtist extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
50
50
|
name: string;
|
|
51
51
|
disambiguation: string;
|
|
52
52
|
'sort-name': string;
|
|
@@ -60,9 +60,6 @@ export interface IArtist extends ITypedEntity, IMayHaveRelations {
|
|
|
60
60
|
area?: IArea;
|
|
61
61
|
begin_area?: IArea;
|
|
62
62
|
end_area?: IArea;
|
|
63
|
-
genres?: IGenre[];
|
|
64
|
-
tags?: IArtistTag[];
|
|
65
|
-
rating?: IRating;
|
|
66
63
|
/**
|
|
67
64
|
* Only defined if 'releases' are includes
|
|
68
65
|
*/
|
|
@@ -88,7 +85,7 @@ export interface ICollection extends ITypedEntity {
|
|
|
88
85
|
editor: string;
|
|
89
86
|
'entity-type': string;
|
|
90
87
|
}
|
|
91
|
-
export interface IEvent extends ITypedEntity {
|
|
88
|
+
export interface IEvent extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
92
89
|
cancelled: boolean;
|
|
93
90
|
'life-span': IPeriod;
|
|
94
91
|
disambiguation: string;
|
|
@@ -97,7 +94,7 @@ export interface IEvent extends ITypedEntity {
|
|
|
97
94
|
name: string;
|
|
98
95
|
}
|
|
99
96
|
export type InstrumentType = 'Wind instrument' | 'String instrument' | 'Percussion instrument' | 'Electronic instrument' | 'Family' | 'Ensemble' | 'Other instrument';
|
|
100
|
-
export interface IInstrument extends ITypedEntity {
|
|
97
|
+
export interface IInstrument extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres {
|
|
101
98
|
disambiguation: string;
|
|
102
99
|
name: string;
|
|
103
100
|
type: InstrumentType;
|
|
@@ -106,7 +103,7 @@ export interface IInstrument extends ITypedEntity {
|
|
|
106
103
|
export type ReleaseQuality = 'normal' | 'high';
|
|
107
104
|
export type ReleaseStatus = 'Official' | 'Promotion' | 'Bootleg' | 'Pseudo-release' | 'Withdrawn' | 'Expunged' | 'Cancelled';
|
|
108
105
|
export type ReleasePackaging = 'Book' | 'Box' | 'Cardboard/Paper Sleeve' | 'Cassette Case' | 'Clamshell Case' | 'Digibook' | 'Digifile' | 'Digipak' | 'Discbox Slider' | 'Fatbox' | 'Gatefold Cover' | 'Jewel case' | 'Keep Case' | 'Longbox' | 'Metal Tin' | 'Plastic sleeve' | 'Slidepack' | 'Slim Jewel Case' | 'Snap Case' | 'SnapPack' | 'Super Jewel Box' | 'Other' | 'None';
|
|
109
|
-
export interface IRelease extends IEntity, IMayHaveRelations {
|
|
106
|
+
export interface IRelease extends IEntity, IMayHaveRelations, IMayHaveTagsAndGenres {
|
|
110
107
|
title: string;
|
|
111
108
|
'text-representation': {
|
|
112
109
|
'language': string;
|
|
@@ -130,13 +127,14 @@ export interface IRelease extends IEntity, IMayHaveRelations {
|
|
|
130
127
|
collections?: ICollection[];
|
|
131
128
|
'track-count'?: number;
|
|
132
129
|
count?: number;
|
|
130
|
+
'label-info'?: ILabelInfo[];
|
|
133
131
|
}
|
|
134
132
|
export interface IReleaseEvent {
|
|
135
133
|
area?: IArea;
|
|
136
134
|
date?: string;
|
|
137
135
|
}
|
|
138
136
|
export type MediaFormatType = 'Digital Media';
|
|
139
|
-
export interface IRecording extends IEntity, IMayHaveRelations {
|
|
137
|
+
export interface IRecording extends IEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
140
138
|
video: boolean;
|
|
141
139
|
length: number;
|
|
142
140
|
title: string;
|
|
@@ -171,7 +169,7 @@ export interface ICoverArtArchive {
|
|
|
171
169
|
artwork: boolean;
|
|
172
170
|
back: boolean;
|
|
173
171
|
}
|
|
174
|
-
export interface IReleaseGroup extends IEntity {
|
|
172
|
+
export interface IReleaseGroup extends IEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
175
173
|
count: number;
|
|
176
174
|
disambiguation?: string;
|
|
177
175
|
title: string;
|
|
@@ -221,6 +219,10 @@ export type ILabelMatch = ILabel & IMatch;
|
|
|
221
219
|
export interface ILabelList extends ISearchResult {
|
|
222
220
|
labels: ILabelMatch[];
|
|
223
221
|
}
|
|
222
|
+
export interface ILabelInfo {
|
|
223
|
+
label: ILabel | null;
|
|
224
|
+
'catalog-number': string | null;
|
|
225
|
+
}
|
|
224
226
|
export type IPlacesMatch = IPlace & IMatch;
|
|
225
227
|
export interface IPlaceList extends ISearchResult {
|
|
226
228
|
places: IPlacesMatch[];
|
|
@@ -272,29 +274,55 @@ export interface IRelation {
|
|
|
272
274
|
'type-id': string;
|
|
273
275
|
url?: IUrl;
|
|
274
276
|
release?: IRelease;
|
|
277
|
+
area?: IArea;
|
|
278
|
+
event?: IEvent;
|
|
279
|
+
genre?: IGenre;
|
|
280
|
+
instrument?: IInstrument;
|
|
281
|
+
label?: ILabel;
|
|
282
|
+
place?: IPlace;
|
|
283
|
+
recording?: IRecording;
|
|
284
|
+
release_group?: IReleaseGroup;
|
|
285
|
+
series?: ISeries;
|
|
286
|
+
work?: IWork;
|
|
275
287
|
}
|
|
276
288
|
export interface IMayHaveRelations {
|
|
277
289
|
relations?: IRelation[];
|
|
278
290
|
}
|
|
279
|
-
export interface IWork extends
|
|
291
|
+
export interface IWork extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
280
292
|
title: string;
|
|
293
|
+
disambiguation: string;
|
|
294
|
+
language: string;
|
|
295
|
+
languages: string[];
|
|
296
|
+
iswcs: string[];
|
|
297
|
+
attributes: IWorkAttribute[];
|
|
281
298
|
}
|
|
282
|
-
export interface
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
299
|
+
export interface IWorkAttribute extends ITypedEntity {
|
|
300
|
+
value: string;
|
|
301
|
+
}
|
|
302
|
+
export interface ILabel extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
303
|
+
country?: null | string;
|
|
286
304
|
name: string;
|
|
287
305
|
'sort-name': string;
|
|
288
|
-
'life-span'
|
|
306
|
+
'life-span'?: LifeSpan;
|
|
289
307
|
disambiguation?: string;
|
|
290
308
|
'label-code': null | string;
|
|
291
|
-
ipis
|
|
292
|
-
|
|
309
|
+
ipis?: string[];
|
|
310
|
+
isnis?: string[];
|
|
311
|
+
area?: IArea;
|
|
293
312
|
}
|
|
294
|
-
export interface IPlace extends
|
|
313
|
+
export interface IPlace extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
|
|
295
314
|
name: string;
|
|
315
|
+
disambiguation: string;
|
|
316
|
+
address: string;
|
|
317
|
+
coordinates: ICoordinates | null;
|
|
318
|
+
'life-span': LifeSpan;
|
|
319
|
+
area: IArea | null;
|
|
320
|
+
}
|
|
321
|
+
export interface ICoordinates {
|
|
322
|
+
latitude: number;
|
|
323
|
+
longitude: number;
|
|
296
324
|
}
|
|
297
|
-
export interface ISeries extends ITypedEntity {
|
|
325
|
+
export interface ISeries extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres {
|
|
298
326
|
name: string;
|
|
299
327
|
disambiguation: string;
|
|
300
328
|
}
|
|
@@ -304,15 +332,22 @@ export interface ITag {
|
|
|
304
332
|
export interface IUserVote {
|
|
305
333
|
count: number;
|
|
306
334
|
}
|
|
307
|
-
export type
|
|
335
|
+
export type IUserTag = ITag & IUserVote;
|
|
308
336
|
export interface IGenre extends IEntity, IUserVote {
|
|
309
337
|
name: string;
|
|
310
338
|
disambiguation: string;
|
|
311
339
|
}
|
|
340
|
+
export interface IMayHaveTagsAndGenres {
|
|
341
|
+
tags?: IUserTag[];
|
|
342
|
+
genres?: IGenre[];
|
|
343
|
+
}
|
|
312
344
|
export interface IRating {
|
|
313
345
|
value: number | null;
|
|
314
346
|
'votes-count': number;
|
|
315
347
|
}
|
|
348
|
+
export interface IMayHaveRating {
|
|
349
|
+
rating?: IRating;
|
|
350
|
+
}
|
|
316
351
|
export interface IUrl extends IEntity, IMayHaveRelations {
|
|
317
352
|
id: string;
|
|
318
353
|
resource: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "musicbrainz-api",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "MusicBrainz API client for reading and submitting metadata",
|
|
5
5
|
"exports": {
|
|
6
6
|
"node": {
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"rate-limit-threshold": "^0.2.0",
|
|
59
59
|
"spark-md5": "^3.0.2",
|
|
60
60
|
"tough-cookie": "^5.0.0",
|
|
61
|
-
"uuid": "^
|
|
61
|
+
"uuid": "^14.0.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@biomejs/biome": "2.
|
|
64
|
+
"@biomejs/biome": "2.4.14",
|
|
65
65
|
"@types/chai": "^5.0.0",
|
|
66
66
|
"@types/jsontoxml": "^1.0.5",
|
|
67
67
|
"@types/mocha": "^10.0.4",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@types/spark-md5": "^3",
|
|
72
72
|
"@types/tough-cookie": "^4.0.5",
|
|
73
73
|
"@types/uuid": "^11.0.0",
|
|
74
|
-
"c8": "^
|
|
74
|
+
"c8": "^11.0.0",
|
|
75
75
|
"chai": "^6.2.0",
|
|
76
76
|
"del-cli": "^7.0.0",
|
|
77
77
|
"mocha": "^11.0.1",
|
|
@@ -80,23 +80,27 @@
|
|
|
80
80
|
"sinon": "^21.0.0",
|
|
81
81
|
"source-map-support": "^0.5.21",
|
|
82
82
|
"ts-node": "^10.9.2",
|
|
83
|
-
"typescript": "^
|
|
83
|
+
"typescript": "^6.0.3"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map'",
|
|
87
|
-
"compile-lib": "tsc -p lib",
|
|
87
|
+
"compile-lib:dev": "tsc -p lib/tsconfig.json",
|
|
88
|
+
"compile-lib:prod": "tsc -p lib/tsconfig.prod.json",
|
|
88
89
|
"compile-test": "tsc -p test",
|
|
89
|
-
"compile": "yarn run compile-lib && yarn run compile-test",
|
|
90
|
+
"compile:dev": "yarn run compile-lib:dev && yarn run compile-test",
|
|
91
|
+
"compile:prod": "yarn run compile-lib:prod && yarn run compile-test",
|
|
90
92
|
"lint:md": "remark -u preset-lint-recommended .",
|
|
91
93
|
"lint:ts": "biome check",
|
|
92
94
|
"lint:fix": "biome check --write",
|
|
93
95
|
"lint": "yarn run lint:md && yarn run lint:ts",
|
|
94
|
-
"test": "mocha",
|
|
95
|
-
"build": "yarn run clean && yarn run compile",
|
|
96
|
+
"test": "TS_NODE_PROJECT=test/tsconfig.json mocha",
|
|
97
|
+
"build:dev": "yarn run clean && yarn run compile:dev",
|
|
98
|
+
"build:prod": "yarn run clean && yarn run compile:prod",
|
|
99
|
+
"build": "yarn run build:prod",
|
|
96
100
|
"start": "yarn run compile && yarn run lint && yarn run cover-test",
|
|
97
101
|
"test-coverage": "c8 yarn run test",
|
|
98
102
|
"send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
|
|
99
|
-
"prepublishOnly": "yarn run build",
|
|
103
|
+
"prepublishOnly": "yarn run build:prod",
|
|
100
104
|
"update-biome": "yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write && npm run lint:fix"
|
|
101
105
|
},
|
|
102
106
|
"nyc": {
|