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>;
@@ -55,6 +55,9 @@ class VeloraClient extends events_1.EventEmitter {
55
55
  async next() {
56
56
  return this.httpClient.next();
57
57
  }
58
+ async previous() {
59
+ return this.httpClient.previous();
60
+ }
58
61
  async seek(position) {
59
62
  return this.httpClient.seek(position);
60
63
  }
@@ -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;
@@ -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';
@@ -65,6 +65,9 @@ export interface PauseResponse {
65
65
  export interface NextResponse {
66
66
  ok: boolean;
67
67
  }
68
+ export interface PreviousResponse {
69
+ ok: boolean;
70
+ }
68
71
  export interface SeekRequest extends Record<string, unknown> {
69
72
  position: number;
70
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "velora-node-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "author": "CrickDevs",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "description": "Node.js SDK for Velora local API with registration, HTTP endpoints, and WebSocket support",