gerdur 2.0.0 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0 - 2026-08-31
4
+
5
+ ### Added
6
+
7
+ - **`gerdur-core@^2.1.0`** — the new search surface is re-exported from the
8
+ library: `searchPublicApi`, `searchTracks` / `searchAlbums` / `searchArtists` /
9
+ `searchPlaylists`, `buildAdvancedQuery`, `suggest`, plus the matching types.
10
+ - **`Session.searchAdvanced(filters, options?)`** — structured search against the
11
+ public REST API — a free-text query plus `{artist, album, track, label, durMin,
12
+ durMax, bpmMin, bpmMax}`, with `order` / `limit` / `index`. Returns public-API
13
+ track objects with `isrc` / `preview`; fetch a hit's gw track with
14
+ `getTrackInfo(id)` to download.
15
+ - **`Session.suggest(query, nb?)`** — `deezer.suggest` autocomplete.
16
+
17
+ _No CLI changes in this release — the interactive `gerdur` flow is unchanged._
18
+
3
19
  ## 2.0.0 - 2026-08-31
4
20
 
5
21
  ### Changed
package/README.md CHANGED
@@ -175,12 +175,22 @@ await session.downloadUrl('https://deezer.com/album/302127', 'flac', {
175
175
  const {tracks} = await session.parseUrl('https://deezer.com/track/3135556');
176
176
  const found = await session.search('daft punk', ['TRACK'], 10);
177
177
  const results = await session.downloadTracks(tracks, '320', {output: '{ART_NAME} - {SNG_TITLE}'});
178
+
179
+ // Structured search against the public REST API (isrc / preview / bpm-aware):
180
+ const hits = await session.searchAdvanced(
181
+ {query: 'one more time', artist: 'daft punk', durMin: 200},
182
+ {limit: 25, order: 'RANKING'},
183
+ );
184
+ const suggestions = await session.suggest('daft'); // autocomplete
178
185
  ```
179
186
 
180
- Session methods: `parseUrl`, `search`, `getUser`, `getTrackBuffer`, `downloadTrack`,
181
- `downloadTracks`, `downloadUrl`. Every download call is silent; `downloadTracks` /
182
- `downloadUrl` accept `concurrency` and an `onProgress` callback and return one
183
- `{path, written} | null` per track.
187
+ Session methods: `parseUrl`, `search`, `searchAdvanced`, `suggest`, `getUser`,
188
+ `getTrackBuffer`, `downloadTrack`, `downloadTracks`, `downloadUrl`. Every download
189
+ call is silent; `downloadTracks` / `downloadUrl` accept `concurrency` and an
190
+ `onProgress` callback and return one `{path, written} | null` per track.
191
+
192
+ `searchAdvanced` returns public-API track objects; fetch a hit's gw track with
193
+ `getTrackInfo(id)` before downloading it.
184
194
 
185
195
  ### Low-level: primitives
186
196
 
@@ -204,9 +214,11 @@ const {path, written} = (await downloadTrackToFile(track, 'flac', {output: '{ART
204
214
  So you don't need `gerdur-core` as a second dependency (call after `initDeezerApi`
205
215
  or `createSession`):
206
216
 
207
- `parseInfo`, `searchMusic`, `getUser`, `getTrackInfo`, `getAlbumInfo`, `getAlbumTracks`,
208
- `getPlaylistInfo`, `getPlaylistTracks`, `getArtistInfo`, `getDiscography`, `getLyrics`,
209
- `getTrackDownloadUrl`, `GeoBlocked`.
217
+ `parseInfo`, `searchMusic`, `searchPublicApi`, `searchTracks`, `searchAlbums`,
218
+ `searchArtists`, `searchPlaylists`, `buildAdvancedQuery`, `suggest`, `getUser`,
219
+ `getTrackInfo`, `getAlbumInfo`, `getAlbumTracks`, `getPlaylistInfo`,
220
+ `getPlaylistTracks`, `getArtistInfo`, `getDiscography`, `getLyrics`,
221
+ `getTrackDownloadUrl`, `resolveDownloadUrls`, `GeoBlocked`.
210
222
 
211
223
  ### Auth & config helpers
212
224
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gerdur",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "The crucial streaming module for dabox systems.",
5
5
  "author": "Christian",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -48,7 +48,7 @@
48
48
  "adm-zip": "^0.5.16",
49
49
  "chalk": "^4.1.2",
50
50
  "commander": "^9.5.0",
51
- "gerdur-core": "^2.0.0",
51
+ "gerdur-core": "^2.1.0",
52
52
  "dot-prop": "^6.0.1",
53
53
  "got": "^11.8.6",
54
54
  "gradient-string": "^2.0.2",
File without changes
@@ -59,5 +59,6 @@ export type { SessionOptions, DownloadTracksOptions, SearchType } from './lib/se
59
59
  export { getTrackBuffer, getTaggedTrack, downloadTrackToFile } from './lib/api-download';
60
60
  export type { Quality, GetTrackBufferOptions, DownloadTrackOptions, DownloadResult } from './lib/api-download';
61
61
  export { default as Config, globalConfigPath, resolveConfigFile } from './lib/config';
62
- export { initDeezerApi, parseInfo, searchMusic, getUser, getTrackInfo, getAlbumInfo, getAlbumTracks, getPlaylistInfo, getPlaylistTracks, getArtistInfo, getDiscography, getLyrics, getTrackDownloadUrl, resolveDownloadUrls, addTrackTags, getRichAlbum, normalizeContributors, toLrc, GeoBlocked, } from 'gerdur-core';
62
+ export { initDeezerApi, parseInfo, searchMusic, searchPublicApi, searchTracks, searchAlbums, searchArtists, searchPlaylists, buildAdvancedQuery, suggest, getUser, getTrackInfo, getAlbumInfo, getAlbumTracks, getPlaylistInfo, getPlaylistTracks, getArtistInfo, getDiscography, getLyrics, getTrackDownloadUrl, resolveDownloadUrls, addTrackTags, getRichAlbum, normalizeContributors, toLrc, GeoBlocked, } from 'gerdur-core';
63
63
  export type { AddTrackTagsOptions, TaggedTrack, TrackTagModel, RichAlbum, ResolvedUrl, NormalizedContributors, } from 'gerdur-core';
64
+ export type { advancedSearchFilters, searchOrder, searchEntity, publicApiSearchOptions, publicApiSearchResponse, searchResultTrack, searchResultAlbum, searchResultArtist, searchResultPlaylist, suggestResult, } from 'gerdur-core/types';
package/dist/src/index.js CHANGED
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.GeoBlocked = exports.toLrc = exports.normalizeContributors = exports.getRichAlbum = exports.addTrackTags = exports.resolveDownloadUrls = exports.getTrackDownloadUrl = exports.getLyrics = exports.getDiscography = exports.getArtistInfo = exports.getPlaylistTracks = exports.getPlaylistInfo = exports.getAlbumTracks = exports.getAlbumInfo = exports.getTrackInfo = exports.getUser = exports.searchMusic = exports.parseInfo = exports.initDeezerApi = exports.resolveConfigFile = exports.globalConfigPath = exports.Config = exports.downloadTrackToFile = exports.getTaggedTrack = exports.getTrackBuffer = exports.Session = exports.createSession = exports.getArl = exports.LoginError = exports.loginWithEmail = void 0;
36
+ exports.GeoBlocked = exports.toLrc = exports.normalizeContributors = exports.getRichAlbum = exports.addTrackTags = exports.resolveDownloadUrls = exports.getTrackDownloadUrl = exports.getLyrics = exports.getDiscography = exports.getArtistInfo = exports.getPlaylistTracks = exports.getPlaylistInfo = exports.getAlbumTracks = exports.getAlbumInfo = exports.getTrackInfo = exports.getUser = exports.suggest = exports.buildAdvancedQuery = exports.searchPlaylists = exports.searchArtists = exports.searchAlbums = exports.searchTracks = exports.searchPublicApi = exports.searchMusic = exports.parseInfo = exports.initDeezerApi = exports.resolveConfigFile = exports.globalConfigPath = exports.Config = exports.downloadTrackToFile = exports.getTaggedTrack = exports.getTrackBuffer = exports.Session = exports.createSession = exports.getArl = exports.LoginError = exports.loginWithEmail = void 0;
37
37
  // ─── Authentication ────────────────────────────────────────────────────────
38
38
  const email_login_1 = require("./lib/email-login");
39
39
  Object.defineProperty(exports, "loginWithEmail", { enumerable: true, get: function () { return email_login_1.loginWithEmail; } });
@@ -89,6 +89,13 @@ var gerdur_core_1 = require("gerdur-core");
89
89
  Object.defineProperty(exports, "initDeezerApi", { enumerable: true, get: function () { return gerdur_core_1.initDeezerApi; } });
90
90
  Object.defineProperty(exports, "parseInfo", { enumerable: true, get: function () { return gerdur_core_1.parseInfo; } });
91
91
  Object.defineProperty(exports, "searchMusic", { enumerable: true, get: function () { return gerdur_core_1.searchMusic; } });
92
+ Object.defineProperty(exports, "searchPublicApi", { enumerable: true, get: function () { return gerdur_core_1.searchPublicApi; } });
93
+ Object.defineProperty(exports, "searchTracks", { enumerable: true, get: function () { return gerdur_core_1.searchTracks; } });
94
+ Object.defineProperty(exports, "searchAlbums", { enumerable: true, get: function () { return gerdur_core_1.searchAlbums; } });
95
+ Object.defineProperty(exports, "searchArtists", { enumerable: true, get: function () { return gerdur_core_1.searchArtists; } });
96
+ Object.defineProperty(exports, "searchPlaylists", { enumerable: true, get: function () { return gerdur_core_1.searchPlaylists; } });
97
+ Object.defineProperty(exports, "buildAdvancedQuery", { enumerable: true, get: function () { return gerdur_core_1.buildAdvancedQuery; } });
98
+ Object.defineProperty(exports, "suggest", { enumerable: true, get: function () { return gerdur_core_1.suggest; } });
92
99
  Object.defineProperty(exports, "getUser", { enumerable: true, get: function () { return gerdur_core_1.getUser; } });
93
100
  Object.defineProperty(exports, "getTrackInfo", { enumerable: true, get: function () { return gerdur_core_1.getTrackInfo; } });
94
101
  Object.defineProperty(exports, "getAlbumInfo", { enumerable: true, get: function () { return gerdur_core_1.getAlbumInfo; } });
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { parseInfo, searchMusic } from 'gerdur-core';
3
3
  import type { Quality, DownloadTrackOptions, DownloadResult } from './api-download';
4
- import type { trackType, userType } from 'gerdur-core/types';
4
+ import type { trackType, userType, advancedSearchFilters, publicApiSearchOptions, publicApiSearchResponse, searchResultTrack, suggestResult } from 'gerdur-core/types';
5
5
  /** Search result categories accepted by {@link Session.search}. */
6
6
  export type SearchType = 'ALBUM' | 'ARTIST' | 'TRACK' | 'PLAYLIST' | 'RADIO' | 'SHOW' | 'USER' | 'LIVESTREAM' | 'CHANNEL';
7
7
  export interface SessionOptions {
@@ -52,6 +52,17 @@ export declare class Session {
52
52
  parseUrl(url: string): ReturnType<typeof parseInfo>;
53
53
  /** Search Deezer. Defaults to track results. */
54
54
  search(query: string, types?: SearchType[], limit?: number): ReturnType<typeof searchMusic>;
55
+ /**
56
+ * Search the public REST API with structured filters (`{artist, album, track,
57
+ * label, durMin, durMax, bpmMin, bpmMax}`) plus a free-text `query`. Returns
58
+ * public-API track objects (with `isrc`, `preview`); to download a result,
59
+ * fetch its gw track first with the re-exported `getTrackInfo(id)`.
60
+ *
61
+ * Deezer applies the operators loosely — see `buildAdvancedQuery`.
62
+ */
63
+ searchAdvanced(filters: advancedSearchFilters, options?: Omit<publicApiSearchOptions, 'type'>): Promise<publicApiSearchResponse<searchResultTrack>>;
64
+ /** `deezer.suggest` autocomplete — for "as you type" UIs. `nb` caps items per type. */
65
+ suggest(query: string, nb?: number): Promise<suggestResult>;
55
66
  /** Return a fully tagged audio Buffer for a track (nothing written to disk). */
56
67
  getTrackBuffer(track: trackType, quality?: Quality, options?: {}): Promise<Buffer | null>;
57
68
  /** Download a single track to disk. */
@@ -57,6 +57,21 @@ class Session {
57
57
  search(query, types = ['TRACK'], limit) {
58
58
  return (0, gerdur_core_1.searchMusic)(query, types, limit);
59
59
  }
60
+ /**
61
+ * Search the public REST API with structured filters (`{artist, album, track,
62
+ * label, durMin, durMax, bpmMin, bpmMax}`) plus a free-text `query`. Returns
63
+ * public-API track objects (with `isrc`, `preview`); to download a result,
64
+ * fetch its gw track first with the re-exported `getTrackInfo(id)`.
65
+ *
66
+ * Deezer applies the operators loosely — see `buildAdvancedQuery`.
67
+ */
68
+ searchAdvanced(filters, options = {}) {
69
+ return (0, gerdur_core_1.searchTracks)((0, gerdur_core_1.buildAdvancedQuery)(filters), options);
70
+ }
71
+ /** `deezer.suggest` autocomplete — for "as you type" UIs. `nb` caps items per type. */
72
+ suggest(query, nb) {
73
+ return (0, gerdur_core_1.suggest)(query, nb);
74
+ }
60
75
  /** Return a fully tagged audio Buffer for a track (nothing written to disk). */
61
76
  getTrackBuffer(track, quality = '320', options = {}) {
62
77
  return (0, api_download_1.getTrackBuffer)(track, quality, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gerdur",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "The crucial streaming module for dabox systems.",
5
5
  "author": "Christian",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -48,7 +48,7 @@
48
48
  "adm-zip": "^0.5.16",
49
49
  "chalk": "^4.1.2",
50
50
  "commander": "^9.5.0",
51
- "gerdur-core": "^2.0.0",
51
+ "gerdur-core": "^2.1.0",
52
52
  "dot-prop": "^6.0.1",
53
53
  "got": "^11.8.6",
54
54
  "gradient-string": "^2.0.2",