sonovault 2.0.0 → 3.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/dist/index.cjs CHANGED
@@ -50,7 +50,7 @@ var SonoVaultError = class extends Error {
50
50
  };
51
51
 
52
52
  // src/version.ts
53
- var VERSION = "2.0.0";
53
+ var VERSION = "3.0.0";
54
54
 
55
55
  // src/client.ts
56
56
  var SonoVault = class {
package/dist/index.d.cts CHANGED
@@ -30,8 +30,10 @@ interface Track {
30
30
  artists: TrackArtist[];
31
31
  isrc: string | null;
32
32
  duration: number | null;
33
- genre: string | null;
34
- subgenre: string | null;
33
+ /** Canonical genres. Empty array when the track is unclassified. */
34
+ genre: string[];
35
+ /** Canonical subgenres. Empty array when none apply. */
36
+ subgenre: string[];
35
37
  }
36
38
  /** A cursor-paginated page. `next_cursor` is null on the last page. */
37
39
  interface Page<T> {
@@ -66,10 +68,10 @@ interface Release {
66
68
  interface Genre {
67
69
  id: number;
68
70
  name: string;
69
- subgenres?: {
70
- id: number;
71
- name: string;
72
- }[];
71
+ /** Whether this is a top-level genre or a subgenre. */
72
+ type: "main" | "subgenre";
73
+ /** Name of the parent genre; null for a top-level genre. */
74
+ parent: string | null;
73
75
  [key: string]: unknown;
74
76
  }
75
77
  /** A track's ID on an external platform, with a deep link. */
@@ -81,6 +83,8 @@ interface PlatformLink {
81
83
  interface PlatformLinksResponse {
82
84
  track_id: number;
83
85
  title: string;
86
+ /** One representative ISRC for the track; null when none is known. */
87
+ isrc: string | null;
84
88
  links: PlatformLink[];
85
89
  [key: string]: unknown;
86
90
  }
@@ -135,11 +139,44 @@ interface IdentifyResponse {
135
139
  }
136
140
  interface Stream {
137
141
  id: string;
138
- url?: string;
139
- name?: string;
140
- status?: string;
142
+ url: string;
143
+ name: string | null;
144
+ status: "active" | "stopped";
145
+ detection_mode: "precise" | "balanced" | "broad";
146
+ /** Whether we email you when this stream goes down and when it recovers. */
147
+ outage_notifications: boolean;
148
+ created_at: string;
149
+ stopped_at: string | null;
141
150
  [key: string]: unknown;
142
151
  }
152
+ /**
153
+ * A stream's live state, as returned by `streams.get()`: the stream fields plus
154
+ * what is playing right now.
155
+ */
156
+ interface StreamStatus extends Stream {
157
+ /** What the monitor is doing now: `pending`, `running`, `errored` or `stopped`. */
158
+ runtime_status: string;
159
+ /** Why it is in that state (e.g. an auth wall on the host); null when it is fine. */
160
+ status_reason: string | null;
161
+ /** Null during ad breaks, talk, or audio we cannot place. */
162
+ now_playing: {
163
+ track: Track;
164
+ started_at: string;
165
+ } | null;
166
+ last_recognized_at: string | null;
167
+ /** Recognition tuning hint in force; null means auto (all recognisers). */
168
+ format: "electronic" | "classical" | "pop" | null;
169
+ }
170
+ /**
171
+ * The response to `streams.update()`. The API echoes back only the fields you
172
+ * changed, so everything but `id` is optional.
173
+ */
174
+ interface StreamUpdateResponse {
175
+ id: string;
176
+ format?: "electronic" | "classical" | "pop" | null;
177
+ detection_mode?: "precise" | "balanced" | "broad";
178
+ outage_notifications?: boolean;
179
+ }
143
180
  interface Webhook {
144
181
  id: string;
145
182
  url: string;
@@ -313,8 +350,8 @@ declare class SonoVault {
313
350
  list: () => Promise<{
314
351
  streams: Stream[];
315
352
  }>;
316
- get: (id: string) => Promise<Stream>;
317
- update: (id: string, body: Record<string, unknown>) => Promise<Stream>;
353
+ get: (id: string) => Promise<StreamStatus>;
354
+ update: (id: string, body: Record<string, unknown>) => Promise<StreamUpdateResponse>;
318
355
  history: (id: string, params?: {
319
356
  since?: string;
320
357
  }) => Promise<Record<string, unknown>>;
@@ -413,4 +450,4 @@ declare function verifyWebhookSignature(options: {
413
450
  */
414
451
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
415
452
 
416
- 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 Track, type TrackArtist, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
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 };
package/dist/index.d.ts CHANGED
@@ -30,8 +30,10 @@ interface Track {
30
30
  artists: TrackArtist[];
31
31
  isrc: string | null;
32
32
  duration: number | null;
33
- genre: string | null;
34
- subgenre: string | null;
33
+ /** Canonical genres. Empty array when the track is unclassified. */
34
+ genre: string[];
35
+ /** Canonical subgenres. Empty array when none apply. */
36
+ subgenre: string[];
35
37
  }
36
38
  /** A cursor-paginated page. `next_cursor` is null on the last page. */
37
39
  interface Page<T> {
@@ -66,10 +68,10 @@ interface Release {
66
68
  interface Genre {
67
69
  id: number;
68
70
  name: string;
69
- subgenres?: {
70
- id: number;
71
- name: string;
72
- }[];
71
+ /** Whether this is a top-level genre or a subgenre. */
72
+ type: "main" | "subgenre";
73
+ /** Name of the parent genre; null for a top-level genre. */
74
+ parent: string | null;
73
75
  [key: string]: unknown;
74
76
  }
75
77
  /** A track's ID on an external platform, with a deep link. */
@@ -81,6 +83,8 @@ interface PlatformLink {
81
83
  interface PlatformLinksResponse {
82
84
  track_id: number;
83
85
  title: string;
86
+ /** One representative ISRC for the track; null when none is known. */
87
+ isrc: string | null;
84
88
  links: PlatformLink[];
85
89
  [key: string]: unknown;
86
90
  }
@@ -135,11 +139,44 @@ interface IdentifyResponse {
135
139
  }
136
140
  interface Stream {
137
141
  id: string;
138
- url?: string;
139
- name?: string;
140
- status?: string;
142
+ url: string;
143
+ name: string | null;
144
+ status: "active" | "stopped";
145
+ detection_mode: "precise" | "balanced" | "broad";
146
+ /** Whether we email you when this stream goes down and when it recovers. */
147
+ outage_notifications: boolean;
148
+ created_at: string;
149
+ stopped_at: string | null;
141
150
  [key: string]: unknown;
142
151
  }
152
+ /**
153
+ * A stream's live state, as returned by `streams.get()`: the stream fields plus
154
+ * what is playing right now.
155
+ */
156
+ interface StreamStatus extends Stream {
157
+ /** What the monitor is doing now: `pending`, `running`, `errored` or `stopped`. */
158
+ runtime_status: string;
159
+ /** Why it is in that state (e.g. an auth wall on the host); null when it is fine. */
160
+ status_reason: string | null;
161
+ /** Null during ad breaks, talk, or audio we cannot place. */
162
+ now_playing: {
163
+ track: Track;
164
+ started_at: string;
165
+ } | null;
166
+ last_recognized_at: string | null;
167
+ /** Recognition tuning hint in force; null means auto (all recognisers). */
168
+ format: "electronic" | "classical" | "pop" | null;
169
+ }
170
+ /**
171
+ * The response to `streams.update()`. The API echoes back only the fields you
172
+ * changed, so everything but `id` is optional.
173
+ */
174
+ interface StreamUpdateResponse {
175
+ id: string;
176
+ format?: "electronic" | "classical" | "pop" | null;
177
+ detection_mode?: "precise" | "balanced" | "broad";
178
+ outage_notifications?: boolean;
179
+ }
143
180
  interface Webhook {
144
181
  id: string;
145
182
  url: string;
@@ -313,8 +350,8 @@ declare class SonoVault {
313
350
  list: () => Promise<{
314
351
  streams: Stream[];
315
352
  }>;
316
- get: (id: string) => Promise<Stream>;
317
- update: (id: string, body: Record<string, unknown>) => Promise<Stream>;
353
+ get: (id: string) => Promise<StreamStatus>;
354
+ update: (id: string, body: Record<string, unknown>) => Promise<StreamUpdateResponse>;
318
355
  history: (id: string, params?: {
319
356
  since?: string;
320
357
  }) => Promise<Record<string, unknown>>;
@@ -413,4 +450,4 @@ declare function verifyWebhookSignature(options: {
413
450
  */
414
451
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
415
452
 
416
- 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 Track, type TrackArtist, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
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 };
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ var SonoVaultError = class extends Error {
21
21
  };
22
22
 
23
23
  // src/version.ts
24
- var VERSION = "2.0.0";
24
+ var VERSION = "3.0.0";
25
25
 
26
26
  // src/client.ts
27
27
  var SonoVault = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonovault",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "TypeScript/Node client for the SonoVault music metadata API — ISRC, ISWC, genre, labels, release dates, and cross-platform IDs for 93M+ tracks.",
5
5
  "keywords": [
6
6
  "music",