velora-node-sdk 1.0.0 → 1.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/README.md
CHANGED
|
@@ -496,8 +496,4 @@ if (client.getPermissions().includes('write')) {
|
|
|
496
496
|
|
|
497
497
|
## Localhost only
|
|
498
498
|
|
|
499
|
-
The Velora local API only accepts connections from `127.0.0.1` or `::1`. The SDK enforces this at the client level.
|
|
500
|
-
|
|
501
|
-
## License
|
|
502
|
-
|
|
503
|
-
MIT
|
|
499
|
+
The Velora local API only accepts connections from `127.0.0.1` or `::1`. The SDK enforces this at the client level.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientConfig, RegisterAppRequest, HealthResponse, CurrentTrackResponse, PlaybackStateResponse, PlaybackQueueResponse, UserPublicResponse, PlayResponse, PauseResponse, NextResponse, SeekResponse, ToggleResponse } from '../types';
|
|
1
|
+
import { ClientConfig, RegisterAppRequest, HealthResponse, CurrentTrackResponse, PlaybackStateResponse, PlaybackQueueResponse, UserPublicResponse, PlayResponse, PauseResponse, NextResponse, PreviousResponse, SeekResponse, ToggleResponse } from '../types';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
export declare class VeloraClient extends EventEmitter {
|
|
4
4
|
private credentialManager;
|
|
@@ -18,6 +18,7 @@ export declare class VeloraClient extends EventEmitter {
|
|
|
18
18
|
play(trackId?: string): Promise<PlayResponse>;
|
|
19
19
|
pause(): Promise<PauseResponse>;
|
|
20
20
|
next(): Promise<NextResponse>;
|
|
21
|
+
previous(): Promise<PreviousResponse>;
|
|
21
22
|
seek(position: number): Promise<SeekResponse>;
|
|
22
23
|
toggle(): Promise<ToggleResponse>;
|
|
23
24
|
connectWebSocket(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CredentialManager } from '../auth/CredentialManager';
|
|
2
|
-
import { HealthResponse, CurrentTrackResponse, PlaybackStateResponse, PlaybackQueueResponse, UserPublicResponse, PlayResponse, PauseResponse, NextResponse, SeekResponse, ToggleResponse } from '../types/api';
|
|
2
|
+
import { HealthResponse, CurrentTrackResponse, PlaybackStateResponse, PlaybackQueueResponse, UserPublicResponse, PlayResponse, PauseResponse, NextResponse, PreviousResponse, SeekResponse, ToggleResponse } from '../types/api';
|
|
3
3
|
import { HttpRequestOptions } from '../types/client';
|
|
4
4
|
export declare class HttpClient {
|
|
5
5
|
private readonly baseUrl;
|
|
@@ -15,6 +15,7 @@ export declare class HttpClient {
|
|
|
15
15
|
play(trackId?: string): Promise<PlayResponse>;
|
|
16
16
|
pause(): Promise<PauseResponse>;
|
|
17
17
|
next(): Promise<NextResponse>;
|
|
18
|
+
previous(): Promise<PreviousResponse>;
|
|
18
19
|
seek(position: number): Promise<SeekResponse>;
|
|
19
20
|
toggle(): Promise<ToggleResponse>;
|
|
20
21
|
private requirePermission;
|
package/dist/http/HttpClient.js
CHANGED
|
@@ -45,6 +45,10 @@ class HttpClient {
|
|
|
45
45
|
this.requirePermission('write');
|
|
46
46
|
return this.request('POST', '/next');
|
|
47
47
|
}
|
|
48
|
+
async previous() {
|
|
49
|
+
this.requirePermission('write');
|
|
50
|
+
return this.request('POST', '/previous');
|
|
51
|
+
}
|
|
48
52
|
async seek(position) {
|
|
49
53
|
this.requirePermission('write');
|
|
50
54
|
if (typeof position !== 'number' || position < 0) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { VeloraClient } from './client';
|
|
2
|
-
export type { HealthResponse, TrackInfo, CurrentTrackResponse, RepeatMode, QueueTrack, PlaybackQueueResponse, PlaybackStateResponse, UserPublic, UserPublicResponse, PlayRequest, PlayResponse, PauseResponse, NextResponse, SeekRequest, SeekResponse, ToggleResponse, AppMetadata, RegisterAppRequest, PermissionType, RequestStatusResponse, RequestStatusPending, RequestStatusApproved, RequestStatusDenied, WebSocketEventEnvelope, TrackChangedData, PlaybackStateChangedData, ErrorResponse, ClientConfig, HttpRequestOptions, RetryPolicy, WebSocketOptions, AuthRequest, CredentialConfig, } from './types';
|
|
2
|
+
export type { HealthResponse, TrackInfo, CurrentTrackResponse, RepeatMode, QueueTrack, PlaybackQueueResponse, PlaybackStateResponse, UserPublic, UserPublicResponse, PlayRequest, PlayResponse, PauseResponse, NextResponse, PreviousResponse, SeekRequest, SeekResponse, ToggleResponse, AppMetadata, RegisterAppRequest, PermissionType, RequestStatusResponse, RequestStatusPending, RequestStatusApproved, RequestStatusDenied, WebSocketEventEnvelope, TrackChangedData, PlaybackStateChangedData, ErrorResponse, ClientConfig, HttpRequestOptions, RetryPolicy, WebSocketOptions, AuthRequest, CredentialConfig, } from './types';
|
|
3
3
|
export { VeloraError, NetworkError, AuthError, ValidationError, TimeoutError, RateLimitError, RequestError, classifyError, } from './types/errors';
|
package/dist/types/api.d.ts
CHANGED
package/package.json
CHANGED