generated from kirishima-ship/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
196 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* @description Official source identifier by lavalink itself | ||
*/ | ||
export enum LavalinkSearchIdentifier { | ||
YTSearch = "ytsearch", | ||
YTMSearch = "ytmsearch", | ||
SCSearch = "scsearch" | ||
} | ||
|
||
/** | ||
* @description Official source supported by lavalink itself. | ||
*/ | ||
export enum LavalinkSource { | ||
Youtube = "youtube", | ||
Soundcloud = "soundcloud", | ||
Bandcamp = "bandcamp", | ||
Local = "local", | ||
Vimeo = "vimeo", | ||
Twitch = "twitch" | ||
} | ||
|
||
|
||
/** | ||
* @description A Websocket event type sent by lavalink. | ||
*/ | ||
export enum WebSocketType { | ||
WebSocketClosedEvent = "WebSocketClosedEvent", | ||
TrackStartEvent = "TrackStartEvent", | ||
TrackEndEvent = "TrackEndEvent", | ||
TrackExceptionEvent = "TrackExceptionEvent", | ||
TrackStuckEvent = "TrackStuckEvent" | ||
} | ||
|
||
/** | ||
* @description A Websocket close code sent by discord via lavalink. | ||
*/ | ||
export enum WebsocketCloseCode { | ||
UnknownError = 4000, | ||
UnknownOpCode = 4001, | ||
DecodeError = 4002, | ||
NotAuthenticated = 4003, | ||
AuthenticatedError = 4004, | ||
AlreadyAuthenticated = 4005, | ||
SessionInvalid = 4006, | ||
SessionTimeout = 4009, | ||
ServerNotFound = 4011, | ||
UnknownProtocol = 4012, | ||
Disconnected = 4014, | ||
VoiceServerCrashed = 4015, | ||
UnknownEncryptionMode = 4016 | ||
} | ||
|
||
|
||
/** | ||
* @description Routeplanner class. | ||
*/ | ||
export enum RoutePlannerClass { | ||
RotatingIpRoutePlanner = "RotatingIpRoutePlanner", | ||
NanoIpRoutePlanner = "NanoIpRoutePlanner", | ||
RotatingNanoIpRoutePlanner = "RotatingNanoIpRoutePlanner", | ||
BalancingIpRoutePlanner = "BalancingIpRoutePlanner" | ||
} | ||
|
||
/** | ||
* @description IpBlockType. | ||
*/ | ||
export enum IpBlockType { | ||
INet6Address = "Inet6Address", | ||
INet4Address = "Inet4Address" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import * as V3 from "./v3"; | ||
import * as V4 from "./v4"; | ||
|
||
export { V3 }; | ||
export { V3, V4 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { RoutePlannerClass, IpBlockType } from "../common"; | ||
|
||
/** | ||
* @description RouteplannerStatus sent by lavalink. | ||
*/ | ||
export interface RoutePlannerStatusResponse { | ||
class: RoutePlannerClass; | ||
details: { | ||
ipBlock: { | ||
type: IpBlockType; | ||
size: number; | ||
}; | ||
failingAddresses: { | ||
failingAddress: string; | ||
failingTimestamp: number; | ||
failingTime: string; | ||
}[]; | ||
blockIndex: number; | ||
currentAddressIndex: string; | ||
}; | ||
} | ||
|
||
export * from "./routes"; | ||
export * from "../common"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export const Routes = { | ||
/** | ||
* Route for: | ||
* - GET /v4/loadtracks | ||
*/ | ||
loadTracks(identifier: string) { | ||
return `/v4/loadtracks?identifier=${identifier}` as const; | ||
}, | ||
/** | ||
* Route for: | ||
* - GET /v4/decodetrack | ||
*/ | ||
decodeTrack(track: string) { | ||
return `/v4/decodetrack?track=${track}` as const; | ||
}, | ||
/** | ||
* Route for: | ||
* - POST /v4/decodetracks | ||
*/ | ||
decodeTracks() { | ||
return "/v4/decodetracks" as const; | ||
}, | ||
/** | ||
* Route for: | ||
* - GET /v4/routeplanner/status | ||
*/ | ||
routePlannerStatus() { | ||
return "/v4/routeplanner/status" as const; | ||
}, | ||
/** | ||
* Route for: | ||
* - POST /v4/routeplanner/free/address | ||
*/ | ||
routePlannerFreeAddress() { | ||
return "/v4/routeplanner/free/address" as const; | ||
}, | ||
/** | ||
* Route for: | ||
* - POST /v4/routeplanner/free/all | ||
*/ | ||
routePlannerFreeAll() { | ||
return "/v4/routeplanner/free/all" as const; | ||
}, | ||
/** | ||
* Route for: | ||
* - WebSocket /v4/websocket | ||
*/ | ||
websocket() { | ||
return "/v4/websocket" as const; | ||
}, | ||
|
||
/** | ||
* Route for: | ||
* - GET /version | ||
*/ | ||
version() { | ||
return "/version" as const; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
|
||
/** | ||
* @description A lavalink severity level when there's an error | ||
*/ | ||
export enum Severity { | ||
Common = "common", | ||
Suspicious = "suspicious", | ||
Fault = "failt" | ||
} | ||
|
||
/** | ||
* @description A load type returned by lavalink in loadtracks route. | ||
*/ | ||
export enum LoadType { | ||
Track = "track", | ||
Playlist = "playlist", | ||
Search = "search", | ||
Empty = "empty", | ||
Error = "error" | ||
} | ||
|
||
/** | ||
* @description A track reason when ended, sent by the lavalink server. | ||
*/ | ||
export enum TrackEndReason { | ||
Finished = "finished", | ||
LoadFailed = "loadFailed", | ||
Stopped = "stopped", | ||
Replaced = "replaced", | ||
Cleanup = "cleanup" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters