musicbrainz-api 1.2.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 CHANGED
@@ -6,8 +6,6 @@
6
6
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2bc47b2006454bae8c737991f152e518)](https://app.codacy.com/gh/Borewit/musicbrainz-api/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
7
7
  [![Known Vulnerabilities](https://snyk.io/test/github/Borewit/musicbrainz-api/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/musicbrainz-api?targetFile=package.json)
8
8
  [![DeepScan grade](https://deepscan.io/api/teams/5165/projects/6991/branches/63373/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5165&pid=6991&bid=63373)
9
- [![Discord](https://img.shields.io/discord/460524735235883049.svg)](https://discord.gg/958xT5X)
10
- [![bundlejs.com badge](https://deno.bundlejs.com/?q=musicbrainz-api&badge)](https://bundlejs.com/?q=musicbrainz-api)
11
9
 
12
10
  # musicbrainz-api
13
11
 
@@ -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[];
@@ -286,25 +288,41 @@ export interface IRelation {
286
288
  export interface IMayHaveRelations {
287
289
  relations?: IRelation[];
288
290
  }
289
- export interface IWork extends IEntity {
291
+ export interface IWork extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
290
292
  title: string;
293
+ disambiguation: string;
294
+ language: string;
295
+ languages: string[];
296
+ iswcs: string[];
297
+ attributes: IWorkAttribute[];
291
298
  }
292
- export interface ILabel extends IEntity {
293
- asin: null | string;
294
- barcode: null | string;
295
- country: null | string;
299
+ export interface IWorkAttribute extends ITypedEntity {
300
+ value: string;
301
+ }
302
+ export interface ILabel extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
303
+ country?: null | string;
296
304
  name: string;
297
305
  'sort-name': string;
298
- 'life-span': LifeSpan;
306
+ 'life-span'?: LifeSpan;
299
307
  disambiguation?: string;
300
308
  'label-code': null | string;
301
- ipis: string[];
302
- area: IArea;
309
+ ipis?: string[];
310
+ isnis?: string[];
311
+ area?: IArea;
303
312
  }
304
- export interface IPlace extends IEntity {
313
+ export interface IPlace extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres, IMayHaveRating {
305
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;
306
324
  }
307
- export interface ISeries extends ITypedEntity {
325
+ export interface ISeries extends ITypedEntity, IMayHaveRelations, IMayHaveTagsAndGenres {
308
326
  name: string;
309
327
  disambiguation: string;
310
328
  }
@@ -314,15 +332,22 @@ export interface ITag {
314
332
  export interface IUserVote {
315
333
  count: number;
316
334
  }
317
- export type IArtistTag = ITag & IUserVote;
335
+ export type IUserTag = ITag & IUserVote;
318
336
  export interface IGenre extends IEntity, IUserVote {
319
337
  name: string;
320
338
  disambiguation: string;
321
339
  }
340
+ export interface IMayHaveTagsAndGenres {
341
+ tags?: IUserTag[];
342
+ genres?: IGenre[];
343
+ }
322
344
  export interface IRating {
323
345
  value: number | null;
324
346
  'votes-count': number;
325
347
  }
348
+ export interface IMayHaveRating {
349
+ rating?: IRating;
350
+ }
326
351
  export interface IUrl extends IEntity, IMayHaveRelations {
327
352
  id: string;
328
353
  resource: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musicbrainz-api",
3
- "version": "1.2.0",
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": "^13.0.0"
61
+ "uuid": "^14.0.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@biomejs/biome": "2.3.14",
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": "^10.1.2",
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,7 +80,7 @@
80
80
  "sinon": "^21.0.0",
81
81
  "source-map-support": "^0.5.21",
82
82
  "ts-node": "^10.9.2",
83
- "typescript": "^5.5.4"
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'",
@@ -93,7 +93,7 @@
93
93
  "lint:ts": "biome check",
94
94
  "lint:fix": "biome check --write",
95
95
  "lint": "yarn run lint:md && yarn run lint:ts",
96
- "test": "mocha",
96
+ "test": "TS_NODE_PROJECT=test/tsconfig.json mocha",
97
97
  "build:dev": "yarn run clean && yarn run compile:dev",
98
98
  "build:prod": "yarn run clean && yarn run compile:prod",
99
99
  "build": "yarn run build:prod",