musicbrainz-api 0.24.0 → 0.25.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
@@ -340,14 +340,21 @@ Searches can be performed using the generic search function: `query(entity: mb.E
340
340
 
341
341
  Arguments:
342
342
  - Entity type, which can be one of:
343
- - `artist`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Artist)
344
- - `label`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Label)
345
- - `recording`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Recording)
346
- - `release`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Release)
347
- - `release-group`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Release_Group)
348
- - `work`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Work)
349
- - `area`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Area)
350
- - `url`: [search fields](https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#URL)
343
+ - `annotation`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Annotation)
344
+ - `area`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Area)
345
+ - `artist`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Artist)
346
+ - `cdstub`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#CDStubs)
347
+ - `event`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Event)
348
+ - `instrument`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Instrument)
349
+ - `label`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Label)
350
+ - `place`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Place)
351
+ - `recording`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Recording)
352
+ - `release`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Release)
353
+ - `release-group`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Release_Group)
354
+ - `series`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Series)
355
+ - `tag`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Tag)
356
+ - `url`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#URL)
357
+ - `work`: [search fields](https://wiki.musicbrainz.org/MusicBrainz_API/Search#Work)
351
358
  - `query {query: string, offset: number, limit: number}`
352
359
  - `query.query`: supports the full Lucene Search syntax; you can find a detailed guide at [Lucene Search Syntax](https://lucene.apache.org/core/4_3_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description). For example, you can set conditions while searching for a name with the AND operator.
353
360
  - `query.offset`: optional, return search results starting at a given offset. Used for paging through more than one page of results.
@@ -132,16 +132,24 @@ export declare class MusicBrainzApi {
132
132
  browse(entity: 'work', query?: mb.IBrowseWorksQuery, inc?: WorkIncludes[]): Promise<mb.IBrowseWorksResult>;
133
133
  /**
134
134
  * Search an entity using a search query
135
- * @param query e.g.: '" artist: Madonna, track: Like a virgin"' or object with search terms: {artist: Madonna}
136
135
  * @param entity e.g. 'recording'
137
- * @param query Arguments
136
+ * @param query e.g.: '" artist: Madonna, track: Like a virgin"' or object with search terms: {artist: Madonna}
138
137
  */
138
+ search(entity: 'annotation', query: mb.ISearchQuery<(MiscIncludes | RelationsIncludes)>): Promise<mb.IAnnotationList>;
139
139
  search(entity: 'area', query: mb.ISearchQuery<AreaIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IAreaList>;
140
- search(artist: 'artist', query: mb.ISearchQuery<ArtistIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IArtistList>;
141
- search(artist: 'recording', query: mb.ISearchQuery<AreaIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IRecordingList>;
142
- search(artist: 'release', query: mb.ISearchQuery<ReleaseIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IReleaseList>;
143
- search(artist: 'release-group', query: mb.ISearchQuery<ReleaseGroupIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IReleaseGroupList>;
144
- search(artist: 'url', query: mb.ISearchQuery<UrlIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IUrlList>;
140
+ search(entity: 'artist', query: mb.ISearchQuery<ArtistIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IArtistList>;
141
+ search(entity: 'cdstub', query: mb.ISearchQuery<(MiscIncludes | RelationsIncludes)>): Promise<mb.ICdStubList>;
142
+ search(entity: 'event', query: mb.ISearchQuery<EventIncludes> & mb.ILinkedEntitiesEvent): Promise<mb.IEventList>;
143
+ search(entity: 'instrument', query: mb.ISearchQuery<InstrumentIncludes> & mb.ILinkedEntitiesInstrument): Promise<mb.IInstrumentList>;
144
+ search(entity: 'label', query: mb.ISearchQuery<LabelIncludes> & mb.ILinkedEntitiesLabel): Promise<mb.ILabelList>;
145
+ search(entity: 'place', query: mb.ISearchQuery<PlaceIncludes> & mb.ILinkedEntitiesPlace): Promise<mb.IPlaceList>;
146
+ search(entity: 'recording', query: mb.ISearchQuery<RecordingIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IRecordingList>;
147
+ search(entity: 'release', query: mb.ISearchQuery<ReleaseIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IReleaseList>;
148
+ search(entity: 'release-group', query: mb.ISearchQuery<ReleaseGroupIncludes> & mb.ILinkedEntitiesArea): Promise<mb.IReleaseGroupList>;
149
+ search(entity: 'series', query: mb.ISearchQuery<SeriesIncludes> & mb.ILinkedEntitiesSeries): Promise<mb.ISeriesList>;
150
+ search(entity: 'tag', query: mb.ISearchQuery<MiscIncludes | RelationsIncludes>): Promise<mb.ITagList>;
151
+ search(entity: 'url', query: mb.ISearchQuery<UrlIncludes> & mb.ILinkedEntitiesUrl): Promise<mb.IUrlList>;
152
+ search(entity: 'work', query: mb.ISearchQuery<WorkIncludes> & mb.ILinkedEntitiesWork): Promise<mb.IWorkList>;
145
153
  postRecording(xmlMetadata: XmlMetadata): Promise<void>;
146
154
  post(entity: mb.EntityType, xmlMetadata: XmlMetadata): Promise<void>;
147
155
  /**
@@ -18,6 +18,12 @@ export interface LifeSpan {
18
18
  begin: null | string;
19
19
  end: null | string;
20
20
  }
21
+ export interface IAnnotation {
22
+ entity: string;
23
+ name: string;
24
+ text: string;
25
+ type: string;
26
+ }
21
27
  export interface IArea extends ITypedEntity {
22
28
  type: 'Country' | 'Subdivision' | 'Municipality' | 'City' | 'District' | 'Island';
23
29
  'iso-3166-1-codes'?: string[];
@@ -61,6 +67,13 @@ export interface IArtist extends ITypedEntity {
61
67
  releases?: IRelease[];
62
68
  'release-groups'?: IReleaseGroup[];
63
69
  }
70
+ export interface ICdStub {
71
+ id: string;
72
+ title: string;
73
+ artist: string;
74
+ barcode: string;
75
+ comment: string;
76
+ }
64
77
  export interface IArtistCredit {
65
78
  artist: IArtist;
66
79
  joinphrase: string;
@@ -115,6 +128,7 @@ export interface IRelease extends IEntity {
115
128
  'release-group'?: IReleaseGroup;
116
129
  collections?: ICollection[];
117
130
  'track-count'?: number;
131
+ count?: number;
118
132
  }
119
133
  export interface IReleaseEvent {
120
134
  area?: IArea;
@@ -174,42 +188,73 @@ export interface IReleaseGroup extends IEntity {
174
188
  }[];
175
189
  releases?: IRelease[];
176
190
  }
177
- export interface IAreaMatch extends IArea, IMatch {
178
- }
179
- export interface IArtistMatch extends IArtist, IMatch {
180
- }
181
- export interface IRecordingMatch extends IRecording, IMatch {
182
- }
183
- export interface IReleaseGroupMatch extends IReleaseGroup, IMatch {
184
- }
185
- export interface IReleaseMatch extends IRelease, IMatch {
186
- count: number;
187
- }
188
191
  export interface ISearchResult {
189
192
  created: DateTimeFormat;
190
193
  count: number;
191
194
  offset: number;
192
195
  }
193
- export interface IArtistList extends ISearchResult {
194
- artists: IArtistMatch[];
196
+ export type IAnnotationMatch = IAnnotation & IMatch;
197
+ export interface IAnnotationList extends ISearchResult {
198
+ annotations: IAnnotationMatch[];
195
199
  }
200
+ export type IAreaMatch = IArea & IMatch;
196
201
  export interface IAreaList extends ISearchResult {
197
202
  areas: IAreaMatch[];
198
203
  }
204
+ export type IArtistMatch = IArtist & IMatch;
205
+ export interface IArtistList extends ISearchResult {
206
+ artists: IArtistMatch[];
207
+ }
208
+ export type ICdStubMatch = ICdStub & IMatch;
209
+ export interface ICdStubList extends ISearchResult {
210
+ cdstubs: ICdStubMatch[];
211
+ }
212
+ export type IEventMatch = IEvent & IMatch;
213
+ export interface IEventList extends ISearchResult {
214
+ events: IEventMatch[];
215
+ }
216
+ export type IInstrumentMatch = IInstrument & IMatch;
217
+ export interface IInstrumentList extends ISearchResult {
218
+ instruments: IInstrumentMatch[];
219
+ }
220
+ export type ILabelMatch = ILabel & IMatch;
221
+ export interface ILabelList extends ISearchResult {
222
+ labels: ILabelMatch[];
223
+ }
224
+ export type IPlacesMatch = IPlace & IMatch;
225
+ export interface IPlaceList extends ISearchResult {
226
+ places: IPlacesMatch[];
227
+ }
228
+ export type IReleaseMatch = IRelease & IMatch;
199
229
  export interface IReleaseList extends ISearchResult {
200
230
  releases: IReleaseMatch[];
201
231
  'release-count': number;
202
232
  }
233
+ export type IRecordingMatch = IRecording & IMatch;
203
234
  export interface IRecordingList extends ISearchResult {
204
235
  recordings: IRecordingMatch[];
205
236
  'recordings-count': number;
206
237
  }
238
+ export type IReleaseGroupMatch = IReleaseGroup & IMatch;
207
239
  export interface IReleaseGroupList extends ISearchResult {
208
240
  'release-groups': IReleaseGroupMatch[];
209
241
  }
242
+ export type ISeriesGroupMatch = ISeries & IMatch;
243
+ export interface ISeriesList extends ISearchResult {
244
+ series: ISeriesGroupMatch[];
245
+ }
246
+ export type ITagMatch = ITag & IMatch;
247
+ export interface ITagList extends ISearchResult {
248
+ tags: ITagMatch[];
249
+ }
250
+ export type IUrlMatch = IUrl & IMatch;
210
251
  export interface IUrlList extends ISearchResult {
211
252
  urls: IUrlMatch[];
212
253
  }
254
+ export type IWorkMatch = IWork & IMatch;
255
+ export interface IWorkList extends ISearchResult {
256
+ works: IWorkMatch[];
257
+ }
213
258
  export type RelationDirection = 'backward' | 'forward';
214
259
  export interface IRelation {
215
260
  artist?: IArtist;
@@ -253,30 +298,28 @@ export interface ISeries extends ITypedEntity {
253
298
  name: string;
254
299
  disambiguation: string;
255
300
  }
301
+ export interface ITag {
302
+ name: string;
303
+ }
256
304
  export interface IUrl extends IEntity {
257
305
  id: string;
258
306
  resource: string;
259
307
  relations?: IRelationList[];
260
308
  }
261
- export interface IUrlMatch extends IMatch, IUrl {
262
- }
263
- export interface IUrlSearchResult extends ISearchResult {
264
- urls: IUrlMatch[];
265
- }
266
- export interface IIsrcSearchResult extends ISearchResult {
267
- 'isrc': string;
268
- 'recordings': IRecording[];
269
- }
270
309
  export interface IExernalIds {
271
310
  [type: string]: string;
272
311
  }
273
312
  export interface IReleaseSearchResult extends ISearchResult {
274
313
  releases: IRelease[];
275
314
  }
315
+ /**
316
+ * Entities without MBID
317
+ */
318
+ export type OtherEntityTypes = 'annotation' | 'cdstub' | 'tag';
276
319
  /**
277
320
  * https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2#Subqueries
278
321
  */
279
- export type EntityType = 'area' | 'artist' | 'collection' | 'event' | 'instrument' | 'label' | 'place' | 'recording' | 'release' | 'release-group' | 'series' | 'work' | 'url';
322
+ export type EntityType = 'annotation' | 'area' | 'artist' | 'collection' | 'event' | 'instrument' | 'label' | 'place' | 'recording' | 'release' | 'release-group' | 'series' | 'work' | 'url';
280
323
  export type Relationships = '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';
281
324
  export declare enum LinkType {
282
325
  license = 302,
@@ -375,6 +418,13 @@ export interface ILinkedEntitiesLabel {
375
418
  collection?: string;
376
419
  release?: string;
377
420
  }
421
+ /**
422
+ * https://musicbrainz.org/doc/MusicBrainz_API#Subqueries
423
+ * /ws/2/place area, collection, release
424
+ */
425
+ export interface ILinkedEntitiesPlace {
426
+ place?: string;
427
+ }
378
428
  /**
379
429
  * https://musicbrainz.org/doc/MusicBrainz_API#Subqueries
380
430
  * /ws/2/place area, collection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musicbrainz-api",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "MusicBrainz API client for reading and submitting metadata",
5
5
  "exports": {
6
6
  "node": {