@redseat/api 0.0.9 → 0.0.11
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/auth.d.ts +1 -1
- package/dist/auth.js +2 -2
- package/dist/library.d.ts +1 -0
- package/dist/library.js +5 -1
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export interface IToken {
|
|
|
2
2
|
token: string;
|
|
3
3
|
expires: number;
|
|
4
4
|
}
|
|
5
|
-
export declare function fetchServerToken(serverId: string, idToken: string): Promise<IToken>;
|
|
5
|
+
export declare function fetchServerToken(serverId: string, idToken: string, baseUrl?: string): Promise<IToken>;
|
package/dist/auth.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
export async function fetchServerToken(serverId, idToken) {
|
|
2
|
+
export async function fetchServerToken(serverId, idToken, baseUrl) {
|
|
3
3
|
const headers = {
|
|
4
4
|
headers: {
|
|
5
5
|
Authorization: `Bearer ${idToken}`
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
|
-
const req = await axios.get(
|
|
8
|
+
const req = await axios.get(`${baseUrl ?? 'https://www.redseat.cloud'}/servers/${serverId}/token`, headers);
|
|
9
9
|
return req.data;
|
|
10
10
|
}
|
package/dist/library.d.ts
CHANGED
|
@@ -170,6 +170,7 @@ export declare class LibraryApi {
|
|
|
170
170
|
listVideoConvertPlugins(): Promise<any[]>;
|
|
171
171
|
getMedia(mediaId: string, options?: {
|
|
172
172
|
type?: 'stream' | 'arraybuffer' | 'blob';
|
|
173
|
+
page?: number;
|
|
173
174
|
}): Promise<ReadableStream | ArrayBuffer | Blob>;
|
|
174
175
|
getThumb(mediaId: string, options?: {
|
|
175
176
|
type?: 'stream' | 'arraybuffer' | 'blob';
|
package/dist/library.js
CHANGED
|
@@ -412,7 +412,11 @@ export class LibraryApi {
|
|
|
412
412
|
}
|
|
413
413
|
async getMedia(mediaId, options) {
|
|
414
414
|
const type = options?.type ?? 'stream';
|
|
415
|
-
const
|
|
415
|
+
const params = {};
|
|
416
|
+
if (options?.page) {
|
|
417
|
+
params.page = options.page;
|
|
418
|
+
}
|
|
419
|
+
const res = await this.client.get(this.getUrl(`/medias/${mediaId}`), { responseType: type, params });
|
|
416
420
|
return res.data;
|
|
417
421
|
}
|
|
418
422
|
async getThumb(mediaId, options) {
|