@redseat/api 0.2.5 → 0.2.7

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/client.js CHANGED
@@ -185,4 +185,32 @@ export class RedseatClient {
185
185
  }
186
186
  return this.tokenData.token;
187
187
  }
188
+ /**
189
+ * Fetches all servers for the authenticated user.
190
+ * Returns IServerPrivate for owned servers, IServer for shared servers.
191
+ */
192
+ async getServers() {
193
+ const idToken = await this.getIdToken();
194
+ const baseUrl = this.redseatUrl ?? 'https://www.redseat.cloud';
195
+ const response = await axios.get(`${baseUrl}/api/servers`, {
196
+ headers: {
197
+ Authorization: `Bearer ${idToken}`
198
+ }
199
+ });
200
+ return response.data;
201
+ }
202
+ /**
203
+ * Fetches a single server by ID.
204
+ * Returns public server info (IServer).
205
+ */
206
+ async getServer(serverId) {
207
+ const idToken = await this.getIdToken();
208
+ const baseUrl = this.redseatUrl ?? 'https://www.redseat.cloud';
209
+ const response = await axios.get(`${baseUrl}/api/servers/${serverId}`, {
210
+ headers: {
211
+ Authorization: `Bearer ${idToken}`
212
+ }
213
+ });
214
+ return response.data;
215
+ }
188
216
  }
@@ -519,4 +519,18 @@ export interface RsRequest {
519
519
  audio?: string[];
520
520
  quality?: number;
521
521
  ignoreOriginDuplicate: boolean;
522
+ tagsLookup?: string[];
523
+ peopleLookup?: string[];
524
+ albumsLookup?: string[];
525
+ thumbnailUrl?: string;
526
+ originUrl?: string;
527
+ title?: string;
528
+ kind?: FileTypes;
529
+ }
530
+ export interface RsGroupDownload {
531
+ group: boolean;
532
+ groupThumbnailUrl?: string;
533
+ groupFilename?: string;
534
+ groupMime?: string;
535
+ requests: RsRequest[];
522
536
  }
package/dist/library.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IFile, ITag, IPerson, ISerie, IMovie, MediaRequest, IEpisode, ExternalImage, IBackupFile, ILibrary, SerieInMedia, DeletedQuery, RsDeleted, MovieSort, RsSort, SqlOrder, RsRequest, DetectedFaceResult, UnassignFaceResponse } from './interfaces.js';
1
+ import { IFile, ITag, IPerson, ISerie, IMovie, MediaRequest, IEpisode, ExternalImage, IBackupFile, ILibrary, SerieInMedia, DeletedQuery, RsDeleted, MovieSort, RsSort, SqlOrder, RsRequest, DetectedFaceResult, UnassignFaceResponse, RsGroupDownload } from './interfaces.js';
2
2
  import { EncryptFileOptions, EncryptedFile } from './encryption.js';
3
3
  export interface MediaForUpdate {
4
4
  name?: string;
@@ -331,4 +331,15 @@ export declare class LibraryApi {
331
331
  thumbMime?: string;
332
332
  progressCallback?: (loaded: number, total: number) => void;
333
333
  }): Promise<IFile>;
334
+ /**
335
+ * Upload a group of media files from URLs
336
+ * @param download - The group download request containing requests array
337
+ * @param options - Optional settings (spawn: true to run in background)
338
+ * @returns Array of created media files when spawn=false, or { downloading: true } when spawn=true
339
+ */
340
+ uploadGroup(download: RsGroupDownload, options?: {
341
+ spawn?: boolean;
342
+ }): Promise<IFile[] | {
343
+ downloading: boolean;
344
+ }>;
334
345
  }
package/dist/library.js CHANGED
@@ -824,4 +824,18 @@ export class LibraryApi {
824
824
  const res = await this.client.postForm(this.getUrl('/medias'), formData, config);
825
825
  return res.data;
826
826
  }
827
+ /**
828
+ * Upload a group of media files from URLs
829
+ * @param download - The group download request containing requests array
830
+ * @param options - Optional settings (spawn: true to run in background)
831
+ * @returns Array of created media files when spawn=false, or { downloading: true } when spawn=true
832
+ */
833
+ async uploadGroup(download, options) {
834
+ const params = {};
835
+ if (options?.spawn) {
836
+ params.spawn = 'true';
837
+ }
838
+ const res = await this.client.post(this.getUrl('/medias/download'), download, { params });
839
+ return res.data;
840
+ }
827
841
  }