feat(player): queue
This commit is contained in:
@@ -6,16 +6,20 @@ import 'library.proto';
|
|||||||
package player;
|
package player;
|
||||||
|
|
||||||
service Player {
|
service Player {
|
||||||
rpc PlayTrack(PlayTrackRequest) returns (PlayTrackResponse);
|
rpc PlayTrack(TrackRequest) returns (PlayTrackResponse);
|
||||||
rpc ResumeTrack(google.protobuf.Empty) returns (PauseState);
|
rpc ResumeTrack(google.protobuf.Empty) returns (PauseState);
|
||||||
rpc PauseTrack(google.protobuf.Empty) returns (PauseState);
|
rpc PauseTrack(google.protobuf.Empty) returns (PauseState);
|
||||||
rpc TogglePause(google.protobuf.Empty) returns (PauseState);
|
rpc TogglePause(google.protobuf.Empty) returns (PauseState);
|
||||||
rpc GetStatus(google.protobuf.Empty) returns (stream PlayerStatus);
|
rpc GetStatus(google.protobuf.Empty) returns (stream PlayerStatus);
|
||||||
rpc SeekPosition(SeekPositionRequest) returns (SeekPositionResponse);
|
rpc SeekPosition(SeekPositionRequest) returns (SeekPositionResponse);
|
||||||
rpc SetVolume(SetVolumeRequest) returns (SetVolumeResponse);
|
rpc SetVolume(SetVolumeRequest) returns (SetVolumeResponse);
|
||||||
|
rpc PlayTrackNext(TrackRequest) returns (Queue);
|
||||||
|
rpc AddTrackToQueue(TrackRequest) returns (Queue);
|
||||||
|
rpc SkipTrack(google.protobuf.Empty) returns (PlayerStatus);
|
||||||
|
rpc SkipToQueueIndex(SkipToQueueIndexRequest) returns (PlayerStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
message PlayTrackRequest {
|
message TrackRequest {
|
||||||
string hash = 1;
|
string hash = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +33,11 @@ message PlayerStatus {
|
|||||||
bool is_paused = 2;
|
bool is_paused = 2;
|
||||||
float volume = 3;
|
float volume = 3;
|
||||||
uint64 progress = 4;
|
uint64 progress = 4;
|
||||||
|
repeated library.Track queue = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Queue {
|
||||||
|
repeated library.Track tracks = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PauseState {
|
message PauseState {
|
||||||
@@ -50,3 +59,7 @@ message SetVolumeRequest {
|
|||||||
message SetVolumeResponse {
|
message SetVolumeResponse {
|
||||||
float volume = 1;
|
float volume = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message SkipToQueueIndexRequest {
|
||||||
|
uint32 index = 1;
|
||||||
|
}
|
||||||
|
|||||||
@@ -55,14 +55,22 @@
|
|||||||
console.log(`SKIP TO QUEUE INDEX ${index}`);
|
console.log(`SKIP TO QUEUE INDEX ${index}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const submitTogglePause: SubmitFunction = async () => {
|
const submitPlayerAction: SubmitFunction = async () => {
|
||||||
return async ({ update, result }) => {
|
return async ({ update, result }) => {
|
||||||
await update({
|
await update({
|
||||||
invalidateAll: false
|
invalidateAll: false
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.type === 'success' && result.data && 'isPaused' in result.data) {
|
if (result.type !== 'success' || !result.data) {
|
||||||
player.isPaused = result.data.isPaused;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('isPaused' in result.data) {
|
||||||
|
if (!('volume' in result.data)) {
|
||||||
|
player.isPaused = result.data.isPaused;
|
||||||
|
} else {
|
||||||
|
player.applyStatus(result.data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -93,9 +101,9 @@
|
|||||||
<form
|
<form
|
||||||
class="col-span-1 flex justify-center gap-1"
|
class="col-span-1 flex justify-center gap-1"
|
||||||
method="POST"
|
method="POST"
|
||||||
use:enhance={submitTogglePause}
|
use:enhance={submitPlayerAction}
|
||||||
>
|
>
|
||||||
<Button variant="outline" size="icon">
|
<Button variant="outline" size="icon" disabled>
|
||||||
<SkipBack />
|
<SkipBack />
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" formaction="/player?/toggle-pause" variant="outline" size="icon">
|
<Button type="submit" formaction="/player?/toggle-pause" variant="outline" size="icon">
|
||||||
@@ -105,7 +113,7 @@
|
|||||||
<Pause />
|
<Pause />
|
||||||
{/if}
|
{/if}
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" size="icon">
|
<Button type="submit" variant="outline" formaction="/player?/skip" size="icon">
|
||||||
<SkipForward />
|
<SkipForward />
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
@@ -116,7 +124,7 @@
|
|||||||
{#snippet child({ props })}
|
{#snippet child({ props })}
|
||||||
<Button {...props} variant="ghost" size="sm">
|
<Button {...props} variant="ghost" size="sm">
|
||||||
<List class="mr-2 size-4" />
|
<List class="mr-2 size-4" />
|
||||||
<span>15</span>
|
<span>{player.queue.length}</span>
|
||||||
</Button>
|
</Button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Popover.Trigger>
|
</Popover.Trigger>
|
||||||
@@ -125,34 +133,35 @@
|
|||||||
|
|
||||||
<Separator class="my-1" />
|
<Separator class="my-1" />
|
||||||
|
|
||||||
<div class="flex h-full flex-col gap-1 overflow-y-auto pr-3">
|
<form
|
||||||
{#each [] as _track, i}
|
class="flex h-full flex-col gap-1 overflow-y-auto pr-3"
|
||||||
|
method="POST"
|
||||||
|
use:enhance={submitPlayerAction}
|
||||||
|
>
|
||||||
|
{#each player.queue as track, i}
|
||||||
<button
|
<button
|
||||||
|
type="submit"
|
||||||
class="flex flex-row items-center gap-2 rounded-lg px-3 py-2 transition-all hover:bg-secondary"
|
class="flex flex-row items-center gap-2 rounded-lg px-3 py-2 transition-all hover:bg-secondary"
|
||||||
onclick={() => skipToQueueIndex(i)}
|
formaction="/player?/skip-to-queue-index&index={i}"
|
||||||
>
|
>
|
||||||
<div class="min-w-8 overflow-hidden rounded-md">
|
<div class="min-w-8 overflow-hidden rounded-md">
|
||||||
<img
|
<img src={getCoverUrl(track.hash)} class="aspect-square size-8" alt="Cover" />
|
||||||
src="https://i.scdn.co/image/ab67616d0000b2732c0ead8ce0dd1c6e2fca817f"
|
|
||||||
class="aspect-square size-8"
|
|
||||||
alt="Cover"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col overflow-hidden">
|
<div class="flex flex-col overflow-hidden">
|
||||||
<p
|
<p
|
||||||
class="w-full self-start overflow-hidden text-ellipsis text-nowrap text-left text-sm text-foreground/80"
|
class="w-full self-start overflow-hidden text-ellipsis text-nowrap text-left text-sm text-foreground/80"
|
||||||
>
|
>
|
||||||
Track name
|
{track.name}
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
class="w-full self-start overflow-hidden text-left text-xs text-muted-foreground"
|
class="w-full self-start overflow-hidden text-left text-xs text-muted-foreground"
|
||||||
>
|
>
|
||||||
Track artist
|
{track.artistName}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</form>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
</Popover.Root>
|
</Popover.Root>
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
import { enhance } from '$app/forms';
|
import { enhance } from '$app/forms';
|
||||||
import { getCoverUrl } from '$lib/covers';
|
import { getCoverUrl } from '$lib/covers';
|
||||||
import { getPlayerState } from '$lib/player.svelte';
|
import { getPlayerState } from '$lib/player.svelte';
|
||||||
|
import { AudioLines, Music2, ListMusic, ListEnd } from 'lucide-svelte';
|
||||||
// import { AudioLines } from 'lucide-svelte';
|
|
||||||
import { AudioLines } from 'lucide-svelte';
|
|
||||||
import type { SubmitFunction } from '../../../routes/tracks/[hash]/$types';
|
import type { SubmitFunction } from '../../../routes/tracks/[hash]/$types';
|
||||||
import type { Track } from '$lib/proto/library';
|
import type { Track } from '$lib/proto/library';
|
||||||
|
import * as ContextMenu from '$lib/components/ui/context-menu';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
track: Track;
|
track: Track;
|
||||||
@@ -14,21 +13,44 @@
|
|||||||
|
|
||||||
let { track }: Props = $props();
|
let { track }: Props = $props();
|
||||||
|
|
||||||
|
let isOpen = $state(false);
|
||||||
|
|
||||||
const player = getPlayerState();
|
const player = getPlayerState();
|
||||||
|
|
||||||
const submitPlayTrack: SubmitFunction = async () => {
|
const submitPlayTrack: SubmitFunction = async () => {
|
||||||
return async ({ update, result }) => {
|
return async ({ update, result }) => {
|
||||||
|
isOpen = false;
|
||||||
|
|
||||||
await update({
|
await update({
|
||||||
invalidateAll: false
|
invalidateAll: false
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.type === 'success' && result.data) {
|
if (result.type === 'success' && result.data && 'track' in result.data) {
|
||||||
|
player.queue = [];
|
||||||
player.currentlyPlaying = result.data.track ?? null;
|
player.currentlyPlaying = result.data.track ?? null;
|
||||||
player.progress = result.data.position;
|
player.progress = result.data.position;
|
||||||
player.isPaused = false;
|
player.isPaused = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const submitEnqueue: SubmitFunction = async () => {
|
||||||
|
return async ({ update, result }) => {
|
||||||
|
isOpen = false;
|
||||||
|
|
||||||
|
await update({
|
||||||
|
invalidateAll: false
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.type === 'success' && result.data && 'tracks' in result.data) {
|
||||||
|
player.queue = result.data.tracks;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
function contextMenuItemClicked(e: MouseEvent) {
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
@@ -37,24 +59,81 @@
|
|||||||
action="/tracks/{track.hash}?/play"
|
action="/tracks/{track.hash}?/play"
|
||||||
use:enhance={submitPlayTrack}
|
use:enhance={submitPlayTrack}
|
||||||
>
|
>
|
||||||
<div class="relative">
|
<ContextMenu.Root bind:open={isOpen}>
|
||||||
<button type="submit" class="relative overflow-hidden rounded-lg">
|
<ContextMenu.Trigger>
|
||||||
<img
|
<div class="relative">
|
||||||
class="aspect-square w-auto transition-all duration-150 hover:scale-105 hover:saturate-150"
|
<button type="submit" class="relative overflow-hidden rounded-lg">
|
||||||
src={getCoverUrl(track.hash)}
|
<img
|
||||||
alt={track.name}
|
class="aspect-square w-auto transition-all duration-150 hover:scale-105 hover:saturate-150"
|
||||||
/>
|
src={getCoverUrl(track.hash)}
|
||||||
</button>
|
alt={track.name}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="absolute bottom-6 left-2 size-4 animate-pulse"
|
class="absolute bottom-6 left-2 size-4 animate-pulse"
|
||||||
class:hidden={player.currentlyPlaying?.hash !== track.hash}
|
class:hidden={player.currentlyPlaying?.hash !== track.hash}
|
||||||
>
|
>
|
||||||
<AudioLines class="text-primary" />
|
<AudioLines class="text-primary" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative space-y-1 text-sm">
|
<div class="relative space-y-1 text-sm">
|
||||||
<h3 class="font-medium leading-none">{track.name}</h3>
|
<h3 class="font-medium leading-none">{track.name}</h3>
|
||||||
<p class="text-xs text-muted-foreground">{track.artistName}</p>
|
<p class="text-xs text-muted-foreground">{track.artistName}</p>
|
||||||
</div>
|
</div>
|
||||||
|
</ContextMenu.Trigger>
|
||||||
|
<ContextMenu.Content>
|
||||||
|
<ContextMenu.Item class="!p-0">
|
||||||
|
<form
|
||||||
|
class="flex w-full"
|
||||||
|
method="POST"
|
||||||
|
action="/tracks/{track.hash}?/play"
|
||||||
|
use:enhance={submitPlayTrack}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="flex w-full items-center px-2 py-1.5 focus:outline-0"
|
||||||
|
onclick={contextMenuItemClicked}
|
||||||
|
>
|
||||||
|
<Music2 class="mr-1 size-4" />
|
||||||
|
Play
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</ContextMenu.Item>
|
||||||
|
<ContextMenu.Item class="!p-0">
|
||||||
|
<form
|
||||||
|
class="flex w-full"
|
||||||
|
method="POST"
|
||||||
|
action="/tracks/{track.hash}?/play-next"
|
||||||
|
use:enhance={submitEnqueue}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="flex w-full items-center px-2 py-1.5 focus:outline-0"
|
||||||
|
onclick={contextMenuItemClicked}
|
||||||
|
>
|
||||||
|
<ListMusic class="mr-1 size-4" />
|
||||||
|
Play Next
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</ContextMenu.Item>
|
||||||
|
<ContextMenu.Item class="!p-0">
|
||||||
|
<form
|
||||||
|
class="flex w-full"
|
||||||
|
method="POST"
|
||||||
|
action="/tracks/{track.hash}?/add-to-queue"
|
||||||
|
use:enhance={submitEnqueue}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="flex w-full items-center px-2 py-1.5 focus:outline-0"
|
||||||
|
onclick={contextMenuItemClicked}
|
||||||
|
>
|
||||||
|
<ListEnd class="mr-1 size-4" />
|
||||||
|
Add to Queue
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</ContextMenu.Item>
|
||||||
|
</ContextMenu.Content>
|
||||||
|
</ContextMenu.Root>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class PlayerState {
|
|||||||
progress = $state<bigint>(0n);
|
progress = $state<bigint>(0n);
|
||||||
isPaused = $state(false);
|
isPaused = $state(false);
|
||||||
adjustingVolume = $state(false);
|
adjustingVolume = $state(false);
|
||||||
|
queue = $state<Track[]>([]);
|
||||||
#abortContoller: AbortController | null = null;
|
#abortContoller: AbortController | null = null;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -34,6 +35,7 @@ class PlayerState {
|
|||||||
this.progress = status.progress;
|
this.progress = status.progress;
|
||||||
this.currentlyPlaying = status.currentlyPlaying ?? null;
|
this.currentlyPlaying = status.currentlyPlaying ?? null;
|
||||||
this.isPaused = status.isPaused;
|
this.isPaused = status.isPaused;
|
||||||
|
this.queue = status.queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
abort() {
|
abort() {
|
||||||
|
|||||||
@@ -6,7 +6,18 @@ export function serializable<F, T extends object = object>(data: T): F {
|
|||||||
|
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
/// @ts-ignore
|
/// @ts-ignore
|
||||||
obj[key] = serializable(value);
|
if ('length' in value) {
|
||||||
|
/// @ts-ignore
|
||||||
|
obj[key] =
|
||||||
|
value.length > 0
|
||||||
|
? value.map((v) => {
|
||||||
|
return typeof v === 'object' ? serializable(v) : v;
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
} else {
|
||||||
|
/// @ts-ignore
|
||||||
|
obj[key] = serializable(value);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/// @ts-ignore
|
/// @ts-ignore
|
||||||
obj[key] = value;
|
obj[key] = value;
|
||||||
|
|||||||
@@ -32,14 +32,14 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryWriter } from '@protobuf-ts/runtime';
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
import { UnknownFieldHandler } from '@protobuf-ts/runtime';
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||||
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryReader } from '@protobuf-ts/runtime';
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||||
import type { PartialMessage } from '@protobuf-ts/runtime';
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||||
import { reflectionMergePartial } from '@protobuf-ts/runtime';
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
import { MessageType } from '@protobuf-ts/runtime';
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
/**
|
/**
|
||||||
* A generic empty message that you can re-use to avoid defining duplicated
|
* A generic empty message that you can re-use to avoid defining duplicated
|
||||||
* empty messages in your APIs. A typical example is to use it as the request
|
* empty messages in your APIs. A typical example is to use it as the request
|
||||||
@@ -52,34 +52,28 @@ import { MessageType } from '@protobuf-ts/runtime';
|
|||||||
*
|
*
|
||||||
* @generated from protobuf message google.protobuf.Empty
|
* @generated from protobuf message google.protobuf.Empty
|
||||||
*/
|
*/
|
||||||
export interface Empty {}
|
export interface Empty {
|
||||||
|
}
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class Empty$Type extends MessageType<Empty> {
|
class Empty$Type extends MessageType<Empty> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('google.protobuf.Empty', []);
|
super("google.protobuf.Empty", []);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<Empty>): Empty {
|
create(value?: PartialMessage<Empty>): Empty {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
if (value !== undefined) reflectionMergePartial<Empty>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<Empty>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty {
|
||||||
length: number,
|
return target ?? this.create();
|
||||||
options: BinaryReadOptions,
|
}
|
||||||
target?: Empty
|
internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
): Empty {
|
let u = options.writeUnknownFields;
|
||||||
return target ?? this.create();
|
if (u !== false)
|
||||||
}
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
internalBinaryWrite(
|
return writer;
|
||||||
message: Empty,
|
}
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message google.protobuf.Empty
|
* @generated MessageType for protobuf message google.protobuf.Empty
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
// @generated by protobuf-ts 2.9.4
|
// @generated by protobuf-ts 2.9.4
|
||||||
// @generated from protobuf file "library.proto" (package "library", syntax proto3)
|
// @generated from protobuf file "library.proto" (package "library", syntax proto3)
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
|
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
|
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||||
import { Library } from './library';
|
import { Library } from "./library";
|
||||||
import { stackIntercept } from '@protobuf-ts/runtime-rpc';
|
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { TrackList } from './library';
|
import type { TrackList } from "./library";
|
||||||
import type { Empty } from './google/protobuf/empty';
|
import type { Empty } from "./google/protobuf/empty";
|
||||||
import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
|
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
|
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf service library.Library
|
* @generated from protobuf service library.Library
|
||||||
*/
|
*/
|
||||||
export interface ILibraryClient {
|
export interface ILibraryClient {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: ListTracks(google.protobuf.Empty) returns (library.TrackList);
|
* @generated from protobuf rpc: ListTracks(google.protobuf.Empty) returns (library.TrackList);
|
||||||
*/
|
*/
|
||||||
listTracks(input: Empty, options?: RpcOptions): UnaryCall<Empty, TrackList>;
|
listTracks(input: Empty, options?: RpcOptions): UnaryCall<Empty, TrackList>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf service library.Library
|
* @generated from protobuf service library.Library
|
||||||
*/
|
*/
|
||||||
export class LibraryClient implements ILibraryClient, ServiceInfo {
|
export class LibraryClient implements ILibraryClient, ServiceInfo {
|
||||||
typeName = Library.typeName;
|
typeName = Library.typeName;
|
||||||
methods = Library.methods;
|
methods = Library.methods;
|
||||||
options = Library.options;
|
options = Library.options;
|
||||||
constructor(private readonly _transport: RpcTransport) {}
|
constructor(private readonly _transport: RpcTransport) {
|
||||||
/**
|
}
|
||||||
* @generated from protobuf rpc: ListTracks(google.protobuf.Empty) returns (library.TrackList);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: ListTracks(google.protobuf.Empty) returns (library.TrackList);
|
||||||
listTracks(input: Empty, options?: RpcOptions): UnaryCall<Empty, TrackList> {
|
*/
|
||||||
const method = this.methods[0],
|
listTracks(input: Empty, options?: RpcOptions): UnaryCall<Empty, TrackList> {
|
||||||
opt = this._transport.mergeOptions(options);
|
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||||
return stackIntercept<Empty, TrackList>('unary', this._transport, method, opt, input);
|
return stackIntercept<Empty, TrackList>("unary", this._transport, method, opt, input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,113 +1,93 @@
|
|||||||
// @generated by protobuf-ts 2.9.4
|
// @generated by protobuf-ts 2.9.4
|
||||||
// @generated from protobuf file "library.proto" (package "library", syntax proto3)
|
// @generated from protobuf file "library.proto" (package "library", syntax proto3)
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
import { Empty } from './google/protobuf/empty';
|
import { Empty } from "./google/protobuf/empty";
|
||||||
import { ServiceType } from '@protobuf-ts/runtime-rpc';
|
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryWriter } from '@protobuf-ts/runtime';
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
import { WireType } from '@protobuf-ts/runtime';
|
import { WireType } from "@protobuf-ts/runtime";
|
||||||
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryReader } from '@protobuf-ts/runtime';
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||||
import { UnknownFieldHandler } from '@protobuf-ts/runtime';
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||||
import type { PartialMessage } from '@protobuf-ts/runtime';
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||||
import { reflectionMergePartial } from '@protobuf-ts/runtime';
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
import { MessageType } from '@protobuf-ts/runtime';
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message library.TrackList
|
* @generated from protobuf message library.TrackList
|
||||||
*/
|
*/
|
||||||
export interface TrackList {
|
export interface TrackList {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: repeated library.Track tracks = 1;
|
* @generated from protobuf field: repeated library.Track tracks = 1;
|
||||||
*/
|
*/
|
||||||
tracks: Track[];
|
tracks: Track[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message library.Track
|
* @generated from protobuf message library.Track
|
||||||
*/
|
*/
|
||||||
export interface Track {
|
export interface Track {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: string hash = 1;
|
* @generated from protobuf field: string hash = 1;
|
||||||
*/
|
*/
|
||||||
hash: string;
|
hash: string;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: string name = 2;
|
* @generated from protobuf field: string name = 2;
|
||||||
*/
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: string artist_name = 3;
|
* @generated from protobuf field: string artist_name = 3;
|
||||||
*/
|
*/
|
||||||
artistName: string;
|
artistName: string;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: uint64 artist_id = 4;
|
* @generated from protobuf field: uint64 artist_id = 4;
|
||||||
*/
|
*/
|
||||||
artistId: bigint;
|
artistId: bigint;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: uint64 duration = 5;
|
* @generated from protobuf field: uint64 duration = 5;
|
||||||
*/
|
*/
|
||||||
duration: bigint;
|
duration: bigint;
|
||||||
}
|
}
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class TrackList$Type extends MessageType<TrackList> {
|
class TrackList$Type extends MessageType<TrackList> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('library.TrackList', [
|
super("library.TrackList", [
|
||||||
{ no: 1, name: 'tracks', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Track }
|
{ no: 1, name: "tracks", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Track }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<TrackList>): TrackList {
|
create(value?: PartialMessage<TrackList>): TrackList {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.tracks = [];
|
message.tracks = [];
|
||||||
if (value !== undefined) reflectionMergePartial<TrackList>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<TrackList>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackList): TrackList {
|
||||||
length: number,
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
options: BinaryReadOptions,
|
while (reader.pos < end) {
|
||||||
target?: TrackList
|
let [fieldNo, wireType] = reader.tag();
|
||||||
): TrackList {
|
switch (fieldNo) {
|
||||||
let message = target ?? this.create(),
|
case /* repeated library.Track tracks */ 1:
|
||||||
end = reader.pos + length;
|
message.tracks.push(Track.internalBinaryRead(reader, reader.uint32(), options));
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
default:
|
||||||
switch (fieldNo) {
|
let u = options.readUnknownField;
|
||||||
case /* repeated library.Track tracks */ 1:
|
if (u === "throw")
|
||||||
message.tracks.push(Track.internalBinaryRead(reader, reader.uint32(), options));
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
default:
|
if (u !== false)
|
||||||
let u = options.readUnknownField;
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
if (u === 'throw')
|
}
|
||||||
throw new globalThis.Error(
|
}
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
return message;
|
||||||
);
|
}
|
||||||
let d = reader.skip(wireType);
|
internalBinaryWrite(message: TrackList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
if (u !== false)
|
/* repeated library.Track tracks = 1; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
for (let i = 0; i < message.tracks.length; i++)
|
||||||
this.typeName,
|
Track.internalBinaryWrite(message.tracks[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||||
message,
|
let u = options.writeUnknownFields;
|
||||||
fieldNo,
|
if (u !== false)
|
||||||
wireType,
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
d
|
return writer;
|
||||||
);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: TrackList,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* repeated library.Track tracks = 1; */
|
|
||||||
for (let i = 0; i < message.tracks.length; i++)
|
|
||||||
Track.internalBinaryWrite(
|
|
||||||
message.tracks[i],
|
|
||||||
writer.tag(1, WireType.LengthDelimited).fork(),
|
|
||||||
options
|
|
||||||
).join();
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message library.TrackList
|
* @generated MessageType for protobuf message library.TrackList
|
||||||
@@ -115,102 +95,78 @@ class TrackList$Type extends MessageType<TrackList> {
|
|||||||
export const TrackList = new TrackList$Type();
|
export const TrackList = new TrackList$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class Track$Type extends MessageType<Track> {
|
class Track$Type extends MessageType<Track> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('library.Track', [
|
super("library.Track", [
|
||||||
{ no: 1, name: 'hash', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
|
{ no: 1, name: "hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
{ no: 2, name: 'name', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
|
{ no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
{ no: 3, name: 'artist_name', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
|
{ no: 3, name: "artist_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
{
|
{ no: 4, name: "artist_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
|
||||||
no: 4,
|
{ no: 5, name: "duration", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
||||||
name: 'artist_id',
|
]);
|
||||||
kind: 'scalar',
|
}
|
||||||
T: 4 /*ScalarType.UINT64*/,
|
create(value?: PartialMessage<Track>): Track {
|
||||||
L: 0 /*LongType.BIGINT*/
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
},
|
message.hash = "";
|
||||||
{
|
message.name = "";
|
||||||
no: 5,
|
message.artistName = "";
|
||||||
name: 'duration',
|
message.artistId = 0n;
|
||||||
kind: 'scalar',
|
message.duration = 0n;
|
||||||
T: 4 /*ScalarType.UINT64*/,
|
if (value !== undefined)
|
||||||
L: 0 /*LongType.BIGINT*/
|
reflectionMergePartial<Track>(this, message, value);
|
||||||
}
|
return message;
|
||||||
]);
|
}
|
||||||
}
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Track): Track {
|
||||||
create(value?: PartialMessage<Track>): Track {
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
while (reader.pos < end) {
|
||||||
message.hash = '';
|
let [fieldNo, wireType] = reader.tag();
|
||||||
message.name = '';
|
switch (fieldNo) {
|
||||||
message.artistName = '';
|
case /* string hash */ 1:
|
||||||
message.artistId = 0n;
|
message.hash = reader.string();
|
||||||
message.duration = 0n;
|
break;
|
||||||
if (value !== undefined) reflectionMergePartial<Track>(this, message, value);
|
case /* string name */ 2:
|
||||||
return message;
|
message.name = reader.string();
|
||||||
}
|
break;
|
||||||
internalBinaryRead(
|
case /* string artist_name */ 3:
|
||||||
reader: IBinaryReader,
|
message.artistName = reader.string();
|
||||||
length: number,
|
break;
|
||||||
options: BinaryReadOptions,
|
case /* uint64 artist_id */ 4:
|
||||||
target?: Track
|
message.artistId = reader.uint64().toBigInt();
|
||||||
): Track {
|
break;
|
||||||
let message = target ?? this.create(),
|
case /* uint64 duration */ 5:
|
||||||
end = reader.pos + length;
|
message.duration = reader.uint64().toBigInt();
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
default:
|
||||||
switch (fieldNo) {
|
let u = options.readUnknownField;
|
||||||
case /* string hash */ 1:
|
if (u === "throw")
|
||||||
message.hash = reader.string();
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
case /* string name */ 2:
|
if (u !== false)
|
||||||
message.name = reader.string();
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
break;
|
}
|
||||||
case /* string artist_name */ 3:
|
}
|
||||||
message.artistName = reader.string();
|
return message;
|
||||||
break;
|
}
|
||||||
case /* uint64 artist_id */ 4:
|
internalBinaryWrite(message: Track, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
message.artistId = reader.uint64().toBigInt();
|
/* string hash = 1; */
|
||||||
break;
|
if (message.hash !== "")
|
||||||
case /* uint64 duration */ 5:
|
writer.tag(1, WireType.LengthDelimited).string(message.hash);
|
||||||
message.duration = reader.uint64().toBigInt();
|
/* string name = 2; */
|
||||||
break;
|
if (message.name !== "")
|
||||||
default:
|
writer.tag(2, WireType.LengthDelimited).string(message.name);
|
||||||
let u = options.readUnknownField;
|
/* string artist_name = 3; */
|
||||||
if (u === 'throw')
|
if (message.artistName !== "")
|
||||||
throw new globalThis.Error(
|
writer.tag(3, WireType.LengthDelimited).string(message.artistName);
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
/* uint64 artist_id = 4; */
|
||||||
);
|
if (message.artistId !== 0n)
|
||||||
let d = reader.skip(wireType);
|
writer.tag(4, WireType.Varint).uint64(message.artistId);
|
||||||
if (u !== false)
|
/* uint64 duration = 5; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
if (message.duration !== 0n)
|
||||||
this.typeName,
|
writer.tag(5, WireType.Varint).uint64(message.duration);
|
||||||
message,
|
let u = options.writeUnknownFields;
|
||||||
fieldNo,
|
if (u !== false)
|
||||||
wireType,
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
d
|
return writer;
|
||||||
);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: Track,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* string hash = 1; */
|
|
||||||
if (message.hash !== '') writer.tag(1, WireType.LengthDelimited).string(message.hash);
|
|
||||||
/* string name = 2; */
|
|
||||||
if (message.name !== '') writer.tag(2, WireType.LengthDelimited).string(message.name);
|
|
||||||
/* string artist_name = 3; */
|
|
||||||
if (message.artistName !== '')
|
|
||||||
writer.tag(3, WireType.LengthDelimited).string(message.artistName);
|
|
||||||
/* uint64 artist_id = 4; */
|
|
||||||
if (message.artistId !== 0n) writer.tag(4, WireType.Varint).uint64(message.artistId);
|
|
||||||
/* uint64 duration = 5; */
|
|
||||||
if (message.duration !== 0n) writer.tag(5, WireType.Varint).uint64(message.duration);
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message library.Track
|
* @generated MessageType for protobuf message library.Track
|
||||||
@@ -219,6 +175,6 @@ export const Track = new Track$Type();
|
|||||||
/**
|
/**
|
||||||
* @generated ServiceType for protobuf service library.Library
|
* @generated ServiceType for protobuf service library.Library
|
||||||
*/
|
*/
|
||||||
export const Library = new ServiceType('library.Library', [
|
export const Library = new ServiceType("library.Library", [
|
||||||
{ name: 'ListTracks', options: {}, I: Empty, O: TrackList }
|
{ name: "ListTracks", options: {}, I: Empty, O: TrackList }
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,159 +1,157 @@
|
|||||||
// @generated by protobuf-ts 2.9.4
|
// @generated by protobuf-ts 2.9.4
|
||||||
// @generated from protobuf file "player.proto" (package "player", syntax proto3)
|
// @generated from protobuf file "player.proto" (package "player", syntax proto3)
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
|
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
|
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||||
import { Player } from './player';
|
import { Player } from "./player";
|
||||||
import type { SetVolumeResponse } from './player';
|
import type { SkipToQueueIndexRequest } from "./player";
|
||||||
import type { SetVolumeRequest } from './player';
|
import type { Queue } from "./player";
|
||||||
import type { SeekPositionResponse } from './player';
|
import type { SetVolumeResponse } from "./player";
|
||||||
import type { SeekPositionRequest } from './player';
|
import type { SetVolumeRequest } from "./player";
|
||||||
import type { PlayerStatus } from './player';
|
import type { SeekPositionResponse } from "./player";
|
||||||
import type { ServerStreamingCall } from '@protobuf-ts/runtime-rpc';
|
import type { SeekPositionRequest } from "./player";
|
||||||
import type { PauseState } from './player';
|
import type { PlayerStatus } from "./player";
|
||||||
import type { Empty } from './google/protobuf/empty';
|
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
||||||
import { stackIntercept } from '@protobuf-ts/runtime-rpc';
|
import type { PauseState } from "./player";
|
||||||
import type { PlayTrackResponse } from './player';
|
import type { Empty } from "./google/protobuf/empty";
|
||||||
import type { PlayTrackRequest } from './player';
|
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
|
import type { PlayTrackResponse } from "./player";
|
||||||
import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
|
import type { TrackRequest } from "./player";
|
||||||
|
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||||
|
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf service player.Player
|
* @generated from protobuf service player.Player
|
||||||
*/
|
*/
|
||||||
export interface IPlayerClient {
|
export interface IPlayerClient {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: PlayTrack(player.PlayTrackRequest) returns (player.PlayTrackResponse);
|
* @generated from protobuf rpc: PlayTrack(player.TrackRequest) returns (player.PlayTrackResponse);
|
||||||
*/
|
*/
|
||||||
playTrack(
|
playTrack(input: TrackRequest, options?: RpcOptions): UnaryCall<TrackRequest, PlayTrackResponse>;
|
||||||
input: PlayTrackRequest,
|
/**
|
||||||
options?: RpcOptions
|
* @generated from protobuf rpc: ResumeTrack(google.protobuf.Empty) returns (player.PauseState);
|
||||||
): UnaryCall<PlayTrackRequest, PlayTrackResponse>;
|
*/
|
||||||
/**
|
resumeTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState>;
|
||||||
* @generated from protobuf rpc: ResumeTrack(google.protobuf.Empty) returns (player.PauseState);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: PauseTrack(google.protobuf.Empty) returns (player.PauseState);
|
||||||
resumeTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState>;
|
*/
|
||||||
/**
|
pauseTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState>;
|
||||||
* @generated from protobuf rpc: PauseTrack(google.protobuf.Empty) returns (player.PauseState);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: TogglePause(google.protobuf.Empty) returns (player.PauseState);
|
||||||
pauseTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState>;
|
*/
|
||||||
/**
|
togglePause(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState>;
|
||||||
* @generated from protobuf rpc: TogglePause(google.protobuf.Empty) returns (player.PauseState);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: GetStatus(google.protobuf.Empty) returns (stream player.PlayerStatus);
|
||||||
togglePause(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState>;
|
*/
|
||||||
/**
|
getStatus(input: Empty, options?: RpcOptions): ServerStreamingCall<Empty, PlayerStatus>;
|
||||||
* @generated from protobuf rpc: GetStatus(google.protobuf.Empty) returns (stream player.PlayerStatus);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: SeekPosition(player.SeekPositionRequest) returns (player.SeekPositionResponse);
|
||||||
getStatus(input: Empty, options?: RpcOptions): ServerStreamingCall<Empty, PlayerStatus>;
|
*/
|
||||||
/**
|
seekPosition(input: SeekPositionRequest, options?: RpcOptions): UnaryCall<SeekPositionRequest, SeekPositionResponse>;
|
||||||
* @generated from protobuf rpc: SeekPosition(player.SeekPositionRequest) returns (player.SeekPositionResponse);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: SetVolume(player.SetVolumeRequest) returns (player.SetVolumeResponse);
|
||||||
seekPosition(
|
*/
|
||||||
input: SeekPositionRequest,
|
setVolume(input: SetVolumeRequest, options?: RpcOptions): UnaryCall<SetVolumeRequest, SetVolumeResponse>;
|
||||||
options?: RpcOptions
|
/**
|
||||||
): UnaryCall<SeekPositionRequest, SeekPositionResponse>;
|
* @generated from protobuf rpc: PlayTrackNext(player.TrackRequest) returns (player.Queue);
|
||||||
/**
|
*/
|
||||||
* @generated from protobuf rpc: SetVolume(player.SetVolumeRequest) returns (player.SetVolumeResponse);
|
playTrackNext(input: TrackRequest, options?: RpcOptions): UnaryCall<TrackRequest, Queue>;
|
||||||
*/
|
/**
|
||||||
setVolume(
|
* @generated from protobuf rpc: AddTrackToQueue(player.TrackRequest) returns (player.Queue);
|
||||||
input: SetVolumeRequest,
|
*/
|
||||||
options?: RpcOptions
|
addTrackToQueue(input: TrackRequest, options?: RpcOptions): UnaryCall<TrackRequest, Queue>;
|
||||||
): UnaryCall<SetVolumeRequest, SetVolumeResponse>;
|
/**
|
||||||
|
* @generated from protobuf rpc: SkipTrack(google.protobuf.Empty) returns (player.PlayerStatus);
|
||||||
|
*/
|
||||||
|
skipTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PlayerStatus>;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf rpc: SkipToQueueIndex(player.SkipToQueueIndexRequest) returns (player.PlayerStatus);
|
||||||
|
*/
|
||||||
|
skipToQueueIndex(input: SkipToQueueIndexRequest, options?: RpcOptions): UnaryCall<SkipToQueueIndexRequest, PlayerStatus>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf service player.Player
|
* @generated from protobuf service player.Player
|
||||||
*/
|
*/
|
||||||
export class PlayerClient implements IPlayerClient, ServiceInfo {
|
export class PlayerClient implements IPlayerClient, ServiceInfo {
|
||||||
typeName = Player.typeName;
|
typeName = Player.typeName;
|
||||||
methods = Player.methods;
|
methods = Player.methods;
|
||||||
options = Player.options;
|
options = Player.options;
|
||||||
constructor(private readonly _transport: RpcTransport) {}
|
constructor(private readonly _transport: RpcTransport) {
|
||||||
/**
|
}
|
||||||
* @generated from protobuf rpc: PlayTrack(player.PlayTrackRequest) returns (player.PlayTrackResponse);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: PlayTrack(player.TrackRequest) returns (player.PlayTrackResponse);
|
||||||
playTrack(
|
*/
|
||||||
input: PlayTrackRequest,
|
playTrack(input: TrackRequest, options?: RpcOptions): UnaryCall<TrackRequest, PlayTrackResponse> {
|
||||||
options?: RpcOptions
|
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||||
): UnaryCall<PlayTrackRequest, PlayTrackResponse> {
|
return stackIntercept<TrackRequest, PlayTrackResponse>("unary", this._transport, method, opt, input);
|
||||||
const method = this.methods[0],
|
}
|
||||||
opt = this._transport.mergeOptions(options);
|
/**
|
||||||
return stackIntercept<PlayTrackRequest, PlayTrackResponse>(
|
* @generated from protobuf rpc: ResumeTrack(google.protobuf.Empty) returns (player.PauseState);
|
||||||
'unary',
|
*/
|
||||||
this._transport,
|
resumeTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState> {
|
||||||
method,
|
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||||
opt,
|
return stackIntercept<Empty, PauseState>("unary", this._transport, method, opt, input);
|
||||||
input
|
}
|
||||||
);
|
/**
|
||||||
}
|
* @generated from protobuf rpc: PauseTrack(google.protobuf.Empty) returns (player.PauseState);
|
||||||
/**
|
*/
|
||||||
* @generated from protobuf rpc: ResumeTrack(google.protobuf.Empty) returns (player.PauseState);
|
pauseTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState> {
|
||||||
*/
|
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||||
resumeTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState> {
|
return stackIntercept<Empty, PauseState>("unary", this._transport, method, opt, input);
|
||||||
const method = this.methods[1],
|
}
|
||||||
opt = this._transport.mergeOptions(options);
|
/**
|
||||||
return stackIntercept<Empty, PauseState>('unary', this._transport, method, opt, input);
|
* @generated from protobuf rpc: TogglePause(google.protobuf.Empty) returns (player.PauseState);
|
||||||
}
|
*/
|
||||||
/**
|
togglePause(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState> {
|
||||||
* @generated from protobuf rpc: PauseTrack(google.protobuf.Empty) returns (player.PauseState);
|
const method = this.methods[3], opt = this._transport.mergeOptions(options);
|
||||||
*/
|
return stackIntercept<Empty, PauseState>("unary", this._transport, method, opt, input);
|
||||||
pauseTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState> {
|
}
|
||||||
const method = this.methods[2],
|
/**
|
||||||
opt = this._transport.mergeOptions(options);
|
* @generated from protobuf rpc: GetStatus(google.protobuf.Empty) returns (stream player.PlayerStatus);
|
||||||
return stackIntercept<Empty, PauseState>('unary', this._transport, method, opt, input);
|
*/
|
||||||
}
|
getStatus(input: Empty, options?: RpcOptions): ServerStreamingCall<Empty, PlayerStatus> {
|
||||||
/**
|
const method = this.methods[4], opt = this._transport.mergeOptions(options);
|
||||||
* @generated from protobuf rpc: TogglePause(google.protobuf.Empty) returns (player.PauseState);
|
return stackIntercept<Empty, PlayerStatus>("serverStreaming", this._transport, method, opt, input);
|
||||||
*/
|
}
|
||||||
togglePause(input: Empty, options?: RpcOptions): UnaryCall<Empty, PauseState> {
|
/**
|
||||||
const method = this.methods[3],
|
* @generated from protobuf rpc: SeekPosition(player.SeekPositionRequest) returns (player.SeekPositionResponse);
|
||||||
opt = this._transport.mergeOptions(options);
|
*/
|
||||||
return stackIntercept<Empty, PauseState>('unary', this._transport, method, opt, input);
|
seekPosition(input: SeekPositionRequest, options?: RpcOptions): UnaryCall<SeekPositionRequest, SeekPositionResponse> {
|
||||||
}
|
const method = this.methods[5], opt = this._transport.mergeOptions(options);
|
||||||
/**
|
return stackIntercept<SeekPositionRequest, SeekPositionResponse>("unary", this._transport, method, opt, input);
|
||||||
* @generated from protobuf rpc: GetStatus(google.protobuf.Empty) returns (stream player.PlayerStatus);
|
}
|
||||||
*/
|
/**
|
||||||
getStatus(input: Empty, options?: RpcOptions): ServerStreamingCall<Empty, PlayerStatus> {
|
* @generated from protobuf rpc: SetVolume(player.SetVolumeRequest) returns (player.SetVolumeResponse);
|
||||||
const method = this.methods[4],
|
*/
|
||||||
opt = this._transport.mergeOptions(options);
|
setVolume(input: SetVolumeRequest, options?: RpcOptions): UnaryCall<SetVolumeRequest, SetVolumeResponse> {
|
||||||
return stackIntercept<Empty, PlayerStatus>(
|
const method = this.methods[6], opt = this._transport.mergeOptions(options);
|
||||||
'serverStreaming',
|
return stackIntercept<SetVolumeRequest, SetVolumeResponse>("unary", this._transport, method, opt, input);
|
||||||
this._transport,
|
}
|
||||||
method,
|
/**
|
||||||
opt,
|
* @generated from protobuf rpc: PlayTrackNext(player.TrackRequest) returns (player.Queue);
|
||||||
input
|
*/
|
||||||
);
|
playTrackNext(input: TrackRequest, options?: RpcOptions): UnaryCall<TrackRequest, Queue> {
|
||||||
}
|
const method = this.methods[7], opt = this._transport.mergeOptions(options);
|
||||||
/**
|
return stackIntercept<TrackRequest, Queue>("unary", this._transport, method, opt, input);
|
||||||
* @generated from protobuf rpc: SeekPosition(player.SeekPositionRequest) returns (player.SeekPositionResponse);
|
}
|
||||||
*/
|
/**
|
||||||
seekPosition(
|
* @generated from protobuf rpc: AddTrackToQueue(player.TrackRequest) returns (player.Queue);
|
||||||
input: SeekPositionRequest,
|
*/
|
||||||
options?: RpcOptions
|
addTrackToQueue(input: TrackRequest, options?: RpcOptions): UnaryCall<TrackRequest, Queue> {
|
||||||
): UnaryCall<SeekPositionRequest, SeekPositionResponse> {
|
const method = this.methods[8], opt = this._transport.mergeOptions(options);
|
||||||
const method = this.methods[5],
|
return stackIntercept<TrackRequest, Queue>("unary", this._transport, method, opt, input);
|
||||||
opt = this._transport.mergeOptions(options);
|
}
|
||||||
return stackIntercept<SeekPositionRequest, SeekPositionResponse>(
|
/**
|
||||||
'unary',
|
* @generated from protobuf rpc: SkipTrack(google.protobuf.Empty) returns (player.PlayerStatus);
|
||||||
this._transport,
|
*/
|
||||||
method,
|
skipTrack(input: Empty, options?: RpcOptions): UnaryCall<Empty, PlayerStatus> {
|
||||||
opt,
|
const method = this.methods[9], opt = this._transport.mergeOptions(options);
|
||||||
input
|
return stackIntercept<Empty, PlayerStatus>("unary", this._transport, method, opt, input);
|
||||||
);
|
}
|
||||||
}
|
/**
|
||||||
/**
|
* @generated from protobuf rpc: SkipToQueueIndex(player.SkipToQueueIndexRequest) returns (player.PlayerStatus);
|
||||||
* @generated from protobuf rpc: SetVolume(player.SetVolumeRequest) returns (player.SetVolumeResponse);
|
*/
|
||||||
*/
|
skipToQueueIndex(input: SkipToQueueIndexRequest, options?: RpcOptions): UnaryCall<SkipToQueueIndexRequest, PlayerStatus> {
|
||||||
setVolume(
|
const method = this.methods[10], opt = this._transport.mergeOptions(options);
|
||||||
input: SetVolumeRequest,
|
return stackIntercept<SkipToQueueIndexRequest, PlayerStatus>("unary", this._transport, method, opt, input);
|
||||||
options?: RpcOptions
|
}
|
||||||
): UnaryCall<SetVolumeRequest, SetVolumeResponse> {
|
|
||||||
const method = this.methods[6],
|
|
||||||
opt = this._transport.mergeOptions(options);
|
|
||||||
return stackIntercept<SetVolumeRequest, SetVolumeResponse>(
|
|
||||||
'unary',
|
|
||||||
this._transport,
|
|
||||||
method,
|
|
||||||
opt,
|
|
||||||
input
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,109 +1,76 @@
|
|||||||
// @generated by protobuf-ts 2.9.4
|
// @generated by protobuf-ts 2.9.4
|
||||||
// @generated from protobuf file "settings.proto" (package "settings", syntax proto3)
|
// @generated from protobuf file "settings.proto" (package "settings", syntax proto3)
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
|
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
|
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||||
import { Settings } from './settings';
|
import { Settings } from "./settings";
|
||||||
import type { RefreshPathResponse } from './settings';
|
import type { RefreshPathResponse } from "./settings";
|
||||||
import type { RefreshPathRequest } from './settings';
|
import type { RefreshPathRequest } from "./settings";
|
||||||
import type { DeletePathResponse } from './settings';
|
import type { DeletePathResponse } from "./settings";
|
||||||
import type { DeletePathRequest } from './settings';
|
import type { DeletePathRequest } from "./settings";
|
||||||
import type { AddPathResponse } from './settings';
|
import type { AddPathResponse } from "./settings";
|
||||||
import type { AddPathRequest } from './settings';
|
import type { AddPathRequest } from "./settings";
|
||||||
import { stackIntercept } from '@protobuf-ts/runtime-rpc';
|
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { SettingsData } from './settings';
|
import type { SettingsData } from "./settings";
|
||||||
import type { Empty } from './google/protobuf/empty';
|
import type { Empty } from "./google/protobuf/empty";
|
||||||
import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
|
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
|
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf service settings.Settings
|
* @generated from protobuf service settings.Settings
|
||||||
*/
|
*/
|
||||||
export interface ISettingsClient {
|
export interface ISettingsClient {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: ListPaths(google.protobuf.Empty) returns (settings.SettingsData);
|
* @generated from protobuf rpc: ListPaths(google.protobuf.Empty) returns (settings.SettingsData);
|
||||||
*/
|
*/
|
||||||
listPaths(input: Empty, options?: RpcOptions): UnaryCall<Empty, SettingsData>;
|
listPaths(input: Empty, options?: RpcOptions): UnaryCall<Empty, SettingsData>;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: AddPath(settings.AddPathRequest) returns (settings.AddPathResponse);
|
* @generated from protobuf rpc: AddPath(settings.AddPathRequest) returns (settings.AddPathResponse);
|
||||||
*/
|
*/
|
||||||
addPath(input: AddPathRequest, options?: RpcOptions): UnaryCall<AddPathRequest, AddPathResponse>;
|
addPath(input: AddPathRequest, options?: RpcOptions): UnaryCall<AddPathRequest, AddPathResponse>;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: DeletePath(settings.DeletePathRequest) returns (settings.DeletePathResponse);
|
* @generated from protobuf rpc: DeletePath(settings.DeletePathRequest) returns (settings.DeletePathResponse);
|
||||||
*/
|
*/
|
||||||
deletePath(
|
deletePath(input: DeletePathRequest, options?: RpcOptions): UnaryCall<DeletePathRequest, DeletePathResponse>;
|
||||||
input: DeletePathRequest,
|
/**
|
||||||
options?: RpcOptions
|
* @generated from protobuf rpc: RefreshPath(settings.RefreshPathRequest) returns (settings.RefreshPathResponse);
|
||||||
): UnaryCall<DeletePathRequest, DeletePathResponse>;
|
*/
|
||||||
/**
|
refreshPath(input: RefreshPathRequest, options?: RpcOptions): UnaryCall<RefreshPathRequest, RefreshPathResponse>;
|
||||||
* @generated from protobuf rpc: RefreshPath(settings.RefreshPathRequest) returns (settings.RefreshPathResponse);
|
|
||||||
*/
|
|
||||||
refreshPath(
|
|
||||||
input: RefreshPathRequest,
|
|
||||||
options?: RpcOptions
|
|
||||||
): UnaryCall<RefreshPathRequest, RefreshPathResponse>;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf service settings.Settings
|
* @generated from protobuf service settings.Settings
|
||||||
*/
|
*/
|
||||||
export class SettingsClient implements ISettingsClient, ServiceInfo {
|
export class SettingsClient implements ISettingsClient, ServiceInfo {
|
||||||
typeName = Settings.typeName;
|
typeName = Settings.typeName;
|
||||||
methods = Settings.methods;
|
methods = Settings.methods;
|
||||||
options = Settings.options;
|
options = Settings.options;
|
||||||
constructor(private readonly _transport: RpcTransport) {}
|
constructor(private readonly _transport: RpcTransport) {
|
||||||
/**
|
}
|
||||||
* @generated from protobuf rpc: ListPaths(google.protobuf.Empty) returns (settings.SettingsData);
|
/**
|
||||||
*/
|
* @generated from protobuf rpc: ListPaths(google.protobuf.Empty) returns (settings.SettingsData);
|
||||||
listPaths(input: Empty, options?: RpcOptions): UnaryCall<Empty, SettingsData> {
|
*/
|
||||||
const method = this.methods[0],
|
listPaths(input: Empty, options?: RpcOptions): UnaryCall<Empty, SettingsData> {
|
||||||
opt = this._transport.mergeOptions(options);
|
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
||||||
return stackIntercept<Empty, SettingsData>('unary', this._transport, method, opt, input);
|
return stackIntercept<Empty, SettingsData>("unary", this._transport, method, opt, input);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: AddPath(settings.AddPathRequest) returns (settings.AddPathResponse);
|
* @generated from protobuf rpc: AddPath(settings.AddPathRequest) returns (settings.AddPathResponse);
|
||||||
*/
|
*/
|
||||||
addPath(input: AddPathRequest, options?: RpcOptions): UnaryCall<AddPathRequest, AddPathResponse> {
|
addPath(input: AddPathRequest, options?: RpcOptions): UnaryCall<AddPathRequest, AddPathResponse> {
|
||||||
const method = this.methods[1],
|
const method = this.methods[1], opt = this._transport.mergeOptions(options);
|
||||||
opt = this._transport.mergeOptions(options);
|
return stackIntercept<AddPathRequest, AddPathResponse>("unary", this._transport, method, opt, input);
|
||||||
return stackIntercept<AddPathRequest, AddPathResponse>(
|
}
|
||||||
'unary',
|
/**
|
||||||
this._transport,
|
* @generated from protobuf rpc: DeletePath(settings.DeletePathRequest) returns (settings.DeletePathResponse);
|
||||||
method,
|
*/
|
||||||
opt,
|
deletePath(input: DeletePathRequest, options?: RpcOptions): UnaryCall<DeletePathRequest, DeletePathResponse> {
|
||||||
input
|
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
||||||
);
|
return stackIntercept<DeletePathRequest, DeletePathResponse>("unary", this._transport, method, opt, input);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf rpc: DeletePath(settings.DeletePathRequest) returns (settings.DeletePathResponse);
|
* @generated from protobuf rpc: RefreshPath(settings.RefreshPathRequest) returns (settings.RefreshPathResponse);
|
||||||
*/
|
*/
|
||||||
deletePath(
|
refreshPath(input: RefreshPathRequest, options?: RpcOptions): UnaryCall<RefreshPathRequest, RefreshPathResponse> {
|
||||||
input: DeletePathRequest,
|
const method = this.methods[3], opt = this._transport.mergeOptions(options);
|
||||||
options?: RpcOptions
|
return stackIntercept<RefreshPathRequest, RefreshPathResponse>("unary", this._transport, method, opt, input);
|
||||||
): UnaryCall<DeletePathRequest, DeletePathResponse> {
|
}
|
||||||
const method = this.methods[2],
|
|
||||||
opt = this._transport.mergeOptions(options);
|
|
||||||
return stackIntercept<DeletePathRequest, DeletePathResponse>(
|
|
||||||
'unary',
|
|
||||||
this._transport,
|
|
||||||
method,
|
|
||||||
opt,
|
|
||||||
input
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @generated from protobuf rpc: RefreshPath(settings.RefreshPathRequest) returns (settings.RefreshPathResponse);
|
|
||||||
*/
|
|
||||||
refreshPath(
|
|
||||||
input: RefreshPathRequest,
|
|
||||||
options?: RpcOptions
|
|
||||||
): UnaryCall<RefreshPathRequest, RefreshPathResponse> {
|
|
||||||
const method = this.methods[3],
|
|
||||||
opt = this._transport.mergeOptions(options);
|
|
||||||
return stackIntercept<RefreshPathRequest, RefreshPathResponse>(
|
|
||||||
'unary',
|
|
||||||
this._transport,
|
|
||||||
method,
|
|
||||||
opt,
|
|
||||||
input
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,153 +1,127 @@
|
|||||||
// @generated by protobuf-ts 2.9.4
|
// @generated by protobuf-ts 2.9.4
|
||||||
// @generated from protobuf file "settings.proto" (package "settings", syntax proto3)
|
// @generated from protobuf file "settings.proto" (package "settings", syntax proto3)
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
import { Empty } from './google/protobuf/empty';
|
import { Empty } from "./google/protobuf/empty";
|
||||||
import { ServiceType } from '@protobuf-ts/runtime-rpc';
|
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
||||||
import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryWriter } from '@protobuf-ts/runtime';
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
import { WireType } from '@protobuf-ts/runtime';
|
import { WireType } from "@protobuf-ts/runtime";
|
||||||
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryReader } from '@protobuf-ts/runtime';
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||||
import { UnknownFieldHandler } from '@protobuf-ts/runtime';
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||||
import type { PartialMessage } from '@protobuf-ts/runtime';
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||||
import { reflectionMergePartial } from '@protobuf-ts/runtime';
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
import { MessageType } from '@protobuf-ts/runtime';
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.SettingsData
|
* @generated from protobuf message settings.SettingsData
|
||||||
*/
|
*/
|
||||||
export interface SettingsData {
|
export interface SettingsData {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: repeated settings.LibraryPath library_paths = 1;
|
* @generated from protobuf field: repeated settings.LibraryPath library_paths = 1;
|
||||||
*/
|
*/
|
||||||
libraryPaths: LibraryPath[];
|
libraryPaths: LibraryPath[];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.LibraryPath
|
* @generated from protobuf message settings.LibraryPath
|
||||||
*/
|
*/
|
||||||
export interface LibraryPath {
|
export interface LibraryPath {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: uint64 id = 1;
|
* @generated from protobuf field: uint64 id = 1;
|
||||||
*/
|
*/
|
||||||
id: bigint;
|
id: bigint;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: string path = 2;
|
* @generated from protobuf field: string path = 2;
|
||||||
*/
|
*/
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.AddPathRequest
|
* @generated from protobuf message settings.AddPathRequest
|
||||||
*/
|
*/
|
||||||
export interface AddPathRequest {
|
export interface AddPathRequest {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: string path = 1;
|
* @generated from protobuf field: string path = 1;
|
||||||
*/
|
*/
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.AddPathResponse
|
* @generated from protobuf message settings.AddPathResponse
|
||||||
*/
|
*/
|
||||||
export interface AddPathResponse {
|
export interface AddPathResponse {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: uint64 id = 1;
|
* @generated from protobuf field: uint64 id = 1;
|
||||||
*/
|
*/
|
||||||
id: bigint;
|
id: bigint;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.DeletePathRequest
|
* @generated from protobuf message settings.DeletePathRequest
|
||||||
*/
|
*/
|
||||||
export interface DeletePathRequest {
|
export interface DeletePathRequest {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: uint64 id = 1;
|
* @generated from protobuf field: uint64 id = 1;
|
||||||
*/
|
*/
|
||||||
id: bigint;
|
id: bigint;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.DeletePathResponse
|
* @generated from protobuf message settings.DeletePathResponse
|
||||||
*/
|
*/
|
||||||
export interface DeletePathResponse {}
|
export interface DeletePathResponse {
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.RefreshPathRequest
|
* @generated from protobuf message settings.RefreshPathRequest
|
||||||
*/
|
*/
|
||||||
export interface RefreshPathRequest {
|
export interface RefreshPathRequest {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: uint64 id = 1;
|
* @generated from protobuf field: uint64 id = 1;
|
||||||
*/
|
*/
|
||||||
id: bigint;
|
id: bigint;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message settings.RefreshPathResponse
|
* @generated from protobuf message settings.RefreshPathResponse
|
||||||
*/
|
*/
|
||||||
export interface RefreshPathResponse {}
|
export interface RefreshPathResponse {
|
||||||
|
}
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class SettingsData$Type extends MessageType<SettingsData> {
|
class SettingsData$Type extends MessageType<SettingsData> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.SettingsData', [
|
super("settings.SettingsData", [
|
||||||
{
|
{ no: 1, name: "library_paths", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => LibraryPath }
|
||||||
no: 1,
|
]);
|
||||||
name: 'library_paths',
|
}
|
||||||
kind: 'message',
|
create(value?: PartialMessage<SettingsData>): SettingsData {
|
||||||
repeat: 1 /*RepeatType.PACKED*/,
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
T: () => LibraryPath
|
message.libraryPaths = [];
|
||||||
}
|
if (value !== undefined)
|
||||||
]);
|
reflectionMergePartial<SettingsData>(this, message, value);
|
||||||
}
|
return message;
|
||||||
create(value?: PartialMessage<SettingsData>): SettingsData {
|
}
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettingsData): SettingsData {
|
||||||
message.libraryPaths = [];
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
if (value !== undefined) reflectionMergePartial<SettingsData>(this, message, value);
|
while (reader.pos < end) {
|
||||||
return message;
|
let [fieldNo, wireType] = reader.tag();
|
||||||
}
|
switch (fieldNo) {
|
||||||
internalBinaryRead(
|
case /* repeated settings.LibraryPath library_paths */ 1:
|
||||||
reader: IBinaryReader,
|
message.libraryPaths.push(LibraryPath.internalBinaryRead(reader, reader.uint32(), options));
|
||||||
length: number,
|
break;
|
||||||
options: BinaryReadOptions,
|
default:
|
||||||
target?: SettingsData
|
let u = options.readUnknownField;
|
||||||
): SettingsData {
|
if (u === "throw")
|
||||||
let message = target ?? this.create(),
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
end = reader.pos + length;
|
let d = reader.skip(wireType);
|
||||||
while (reader.pos < end) {
|
if (u !== false)
|
||||||
let [fieldNo, wireType] = reader.tag();
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
switch (fieldNo) {
|
}
|
||||||
case /* repeated settings.LibraryPath library_paths */ 1:
|
}
|
||||||
message.libraryPaths.push(
|
return message;
|
||||||
LibraryPath.internalBinaryRead(reader, reader.uint32(), options)
|
}
|
||||||
);
|
internalBinaryWrite(message: SettingsData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
break;
|
/* repeated settings.LibraryPath library_paths = 1; */
|
||||||
default:
|
for (let i = 0; i < message.libraryPaths.length; i++)
|
||||||
let u = options.readUnknownField;
|
LibraryPath.internalBinaryWrite(message.libraryPaths[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||||
if (u === 'throw')
|
let u = options.writeUnknownFields;
|
||||||
throw new globalThis.Error(
|
if (u !== false)
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
);
|
return writer;
|
||||||
let d = reader.skip(wireType);
|
}
|
||||||
if (u !== false)
|
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
|
||||||
this.typeName,
|
|
||||||
message,
|
|
||||||
fieldNo,
|
|
||||||
wireType,
|
|
||||||
d
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: SettingsData,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* repeated settings.LibraryPath library_paths = 1; */
|
|
||||||
for (let i = 0; i < message.libraryPaths.length; i++)
|
|
||||||
LibraryPath.internalBinaryWrite(
|
|
||||||
message.libraryPaths[i],
|
|
||||||
writer.tag(1, WireType.LengthDelimited).fork(),
|
|
||||||
options
|
|
||||||
).join();
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.SettingsData
|
* @generated MessageType for protobuf message settings.SettingsData
|
||||||
@@ -155,68 +129,54 @@ class SettingsData$Type extends MessageType<SettingsData> {
|
|||||||
export const SettingsData = new SettingsData$Type();
|
export const SettingsData = new SettingsData$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class LibraryPath$Type extends MessageType<LibraryPath> {
|
class LibraryPath$Type extends MessageType<LibraryPath> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.LibraryPath', [
|
super("settings.LibraryPath", [
|
||||||
{ no: 1, name: 'id', kind: 'scalar', T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
|
{ no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
|
||||||
{ no: 2, name: 'path', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }
|
{ no: 2, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<LibraryPath>): LibraryPath {
|
create(value?: PartialMessage<LibraryPath>): LibraryPath {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.id = 0n;
|
message.id = 0n;
|
||||||
message.path = '';
|
message.path = "";
|
||||||
if (value !== undefined) reflectionMergePartial<LibraryPath>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<LibraryPath>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LibraryPath): LibraryPath {
|
||||||
length: number,
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
options: BinaryReadOptions,
|
while (reader.pos < end) {
|
||||||
target?: LibraryPath
|
let [fieldNo, wireType] = reader.tag();
|
||||||
): LibraryPath {
|
switch (fieldNo) {
|
||||||
let message = target ?? this.create(),
|
case /* uint64 id */ 1:
|
||||||
end = reader.pos + length;
|
message.id = reader.uint64().toBigInt();
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
case /* string path */ 2:
|
||||||
switch (fieldNo) {
|
message.path = reader.string();
|
||||||
case /* uint64 id */ 1:
|
break;
|
||||||
message.id = reader.uint64().toBigInt();
|
default:
|
||||||
break;
|
let u = options.readUnknownField;
|
||||||
case /* string path */ 2:
|
if (u === "throw")
|
||||||
message.path = reader.string();
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
default:
|
if (u !== false)
|
||||||
let u = options.readUnknownField;
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
if (u === 'throw')
|
}
|
||||||
throw new globalThis.Error(
|
}
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
return message;
|
||||||
);
|
}
|
||||||
let d = reader.skip(wireType);
|
internalBinaryWrite(message: LibraryPath, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
if (u !== false)
|
/* uint64 id = 1; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
if (message.id !== 0n)
|
||||||
this.typeName,
|
writer.tag(1, WireType.Varint).uint64(message.id);
|
||||||
message,
|
/* string path = 2; */
|
||||||
fieldNo,
|
if (message.path !== "")
|
||||||
wireType,
|
writer.tag(2, WireType.LengthDelimited).string(message.path);
|
||||||
d
|
let u = options.writeUnknownFields;
|
||||||
);
|
if (u !== false)
|
||||||
}
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
}
|
return writer;
|
||||||
return message;
|
}
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: LibraryPath,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* uint64 id = 1; */
|
|
||||||
if (message.id !== 0n) writer.tag(1, WireType.Varint).uint64(message.id);
|
|
||||||
/* string path = 2; */
|
|
||||||
if (message.path !== '') writer.tag(2, WireType.LengthDelimited).string(message.path);
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.LibraryPath
|
* @generated MessageType for protobuf message settings.LibraryPath
|
||||||
@@ -224,61 +184,46 @@ class LibraryPath$Type extends MessageType<LibraryPath> {
|
|||||||
export const LibraryPath = new LibraryPath$Type();
|
export const LibraryPath = new LibraryPath$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class AddPathRequest$Type extends MessageType<AddPathRequest> {
|
class AddPathRequest$Type extends MessageType<AddPathRequest> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.AddPathRequest', [
|
super("settings.AddPathRequest", [
|
||||||
{ no: 1, name: 'path', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }
|
{ no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<AddPathRequest>): AddPathRequest {
|
create(value?: PartialMessage<AddPathRequest>): AddPathRequest {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.path = '';
|
message.path = "";
|
||||||
if (value !== undefined) reflectionMergePartial<AddPathRequest>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<AddPathRequest>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddPathRequest): AddPathRequest {
|
||||||
length: number,
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
options: BinaryReadOptions,
|
while (reader.pos < end) {
|
||||||
target?: AddPathRequest
|
let [fieldNo, wireType] = reader.tag();
|
||||||
): AddPathRequest {
|
switch (fieldNo) {
|
||||||
let message = target ?? this.create(),
|
case /* string path */ 1:
|
||||||
end = reader.pos + length;
|
message.path = reader.string();
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
default:
|
||||||
switch (fieldNo) {
|
let u = options.readUnknownField;
|
||||||
case /* string path */ 1:
|
if (u === "throw")
|
||||||
message.path = reader.string();
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
default:
|
if (u !== false)
|
||||||
let u = options.readUnknownField;
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
if (u === 'throw')
|
}
|
||||||
throw new globalThis.Error(
|
}
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
return message;
|
||||||
);
|
}
|
||||||
let d = reader.skip(wireType);
|
internalBinaryWrite(message: AddPathRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
if (u !== false)
|
/* string path = 1; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
if (message.path !== "")
|
||||||
this.typeName,
|
writer.tag(1, WireType.LengthDelimited).string(message.path);
|
||||||
message,
|
let u = options.writeUnknownFields;
|
||||||
fieldNo,
|
if (u !== false)
|
||||||
wireType,
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
d
|
return writer;
|
||||||
);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: AddPathRequest,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* string path = 1; */
|
|
||||||
if (message.path !== '') writer.tag(1, WireType.LengthDelimited).string(message.path);
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.AddPathRequest
|
* @generated MessageType for protobuf message settings.AddPathRequest
|
||||||
@@ -286,61 +231,46 @@ class AddPathRequest$Type extends MessageType<AddPathRequest> {
|
|||||||
export const AddPathRequest = new AddPathRequest$Type();
|
export const AddPathRequest = new AddPathRequest$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class AddPathResponse$Type extends MessageType<AddPathResponse> {
|
class AddPathResponse$Type extends MessageType<AddPathResponse> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.AddPathResponse', [
|
super("settings.AddPathResponse", [
|
||||||
{ no: 1, name: 'id', kind: 'scalar', T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
{ no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<AddPathResponse>): AddPathResponse {
|
create(value?: PartialMessage<AddPathResponse>): AddPathResponse {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.id = 0n;
|
message.id = 0n;
|
||||||
if (value !== undefined) reflectionMergePartial<AddPathResponse>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<AddPathResponse>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddPathResponse): AddPathResponse {
|
||||||
length: number,
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
options: BinaryReadOptions,
|
while (reader.pos < end) {
|
||||||
target?: AddPathResponse
|
let [fieldNo, wireType] = reader.tag();
|
||||||
): AddPathResponse {
|
switch (fieldNo) {
|
||||||
let message = target ?? this.create(),
|
case /* uint64 id */ 1:
|
||||||
end = reader.pos + length;
|
message.id = reader.uint64().toBigInt();
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
default:
|
||||||
switch (fieldNo) {
|
let u = options.readUnknownField;
|
||||||
case /* uint64 id */ 1:
|
if (u === "throw")
|
||||||
message.id = reader.uint64().toBigInt();
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
default:
|
if (u !== false)
|
||||||
let u = options.readUnknownField;
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
if (u === 'throw')
|
}
|
||||||
throw new globalThis.Error(
|
}
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
return message;
|
||||||
);
|
}
|
||||||
let d = reader.skip(wireType);
|
internalBinaryWrite(message: AddPathResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
if (u !== false)
|
/* uint64 id = 1; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
if (message.id !== 0n)
|
||||||
this.typeName,
|
writer.tag(1, WireType.Varint).uint64(message.id);
|
||||||
message,
|
let u = options.writeUnknownFields;
|
||||||
fieldNo,
|
if (u !== false)
|
||||||
wireType,
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
d
|
return writer;
|
||||||
);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: AddPathResponse,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* uint64 id = 1; */
|
|
||||||
if (message.id !== 0n) writer.tag(1, WireType.Varint).uint64(message.id);
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.AddPathResponse
|
* @generated MessageType for protobuf message settings.AddPathResponse
|
||||||
@@ -348,61 +278,46 @@ class AddPathResponse$Type extends MessageType<AddPathResponse> {
|
|||||||
export const AddPathResponse = new AddPathResponse$Type();
|
export const AddPathResponse = new AddPathResponse$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class DeletePathRequest$Type extends MessageType<DeletePathRequest> {
|
class DeletePathRequest$Type extends MessageType<DeletePathRequest> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.DeletePathRequest', [
|
super("settings.DeletePathRequest", [
|
||||||
{ no: 1, name: 'id', kind: 'scalar', T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
{ no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<DeletePathRequest>): DeletePathRequest {
|
create(value?: PartialMessage<DeletePathRequest>): DeletePathRequest {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.id = 0n;
|
message.id = 0n;
|
||||||
if (value !== undefined) reflectionMergePartial<DeletePathRequest>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<DeletePathRequest>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePathRequest): DeletePathRequest {
|
||||||
length: number,
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
options: BinaryReadOptions,
|
while (reader.pos < end) {
|
||||||
target?: DeletePathRequest
|
let [fieldNo, wireType] = reader.tag();
|
||||||
): DeletePathRequest {
|
switch (fieldNo) {
|
||||||
let message = target ?? this.create(),
|
case /* uint64 id */ 1:
|
||||||
end = reader.pos + length;
|
message.id = reader.uint64().toBigInt();
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
default:
|
||||||
switch (fieldNo) {
|
let u = options.readUnknownField;
|
||||||
case /* uint64 id */ 1:
|
if (u === "throw")
|
||||||
message.id = reader.uint64().toBigInt();
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
default:
|
if (u !== false)
|
||||||
let u = options.readUnknownField;
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
if (u === 'throw')
|
}
|
||||||
throw new globalThis.Error(
|
}
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
return message;
|
||||||
);
|
}
|
||||||
let d = reader.skip(wireType);
|
internalBinaryWrite(message: DeletePathRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
if (u !== false)
|
/* uint64 id = 1; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
if (message.id !== 0n)
|
||||||
this.typeName,
|
writer.tag(1, WireType.Varint).uint64(message.id);
|
||||||
message,
|
let u = options.writeUnknownFields;
|
||||||
fieldNo,
|
if (u !== false)
|
||||||
wireType,
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
d
|
return writer;
|
||||||
);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: DeletePathRequest,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* uint64 id = 1; */
|
|
||||||
if (message.id !== 0n) writer.tag(1, WireType.Varint).uint64(message.id);
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.DeletePathRequest
|
* @generated MessageType for protobuf message settings.DeletePathRequest
|
||||||
@@ -410,31 +325,24 @@ class DeletePathRequest$Type extends MessageType<DeletePathRequest> {
|
|||||||
export const DeletePathRequest = new DeletePathRequest$Type();
|
export const DeletePathRequest = new DeletePathRequest$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class DeletePathResponse$Type extends MessageType<DeletePathResponse> {
|
class DeletePathResponse$Type extends MessageType<DeletePathResponse> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.DeletePathResponse', []);
|
super("settings.DeletePathResponse", []);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<DeletePathResponse>): DeletePathResponse {
|
create(value?: PartialMessage<DeletePathResponse>): DeletePathResponse {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
if (value !== undefined) reflectionMergePartial<DeletePathResponse>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<DeletePathResponse>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePathResponse): DeletePathResponse {
|
||||||
length: number,
|
return target ?? this.create();
|
||||||
options: BinaryReadOptions,
|
}
|
||||||
target?: DeletePathResponse
|
internalBinaryWrite(message: DeletePathResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
): DeletePathResponse {
|
let u = options.writeUnknownFields;
|
||||||
return target ?? this.create();
|
if (u !== false)
|
||||||
}
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
internalBinaryWrite(
|
return writer;
|
||||||
message: DeletePathResponse,
|
}
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.DeletePathResponse
|
* @generated MessageType for protobuf message settings.DeletePathResponse
|
||||||
@@ -442,61 +350,46 @@ class DeletePathResponse$Type extends MessageType<DeletePathResponse> {
|
|||||||
export const DeletePathResponse = new DeletePathResponse$Type();
|
export const DeletePathResponse = new DeletePathResponse$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class RefreshPathRequest$Type extends MessageType<RefreshPathRequest> {
|
class RefreshPathRequest$Type extends MessageType<RefreshPathRequest> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.RefreshPathRequest', [
|
super("settings.RefreshPathRequest", [
|
||||||
{ no: 1, name: 'id', kind: 'scalar', T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
{ no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<RefreshPathRequest>): RefreshPathRequest {
|
create(value?: PartialMessage<RefreshPathRequest>): RefreshPathRequest {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.id = 0n;
|
message.id = 0n;
|
||||||
if (value !== undefined) reflectionMergePartial<RefreshPathRequest>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<RefreshPathRequest>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RefreshPathRequest): RefreshPathRequest {
|
||||||
length: number,
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
options: BinaryReadOptions,
|
while (reader.pos < end) {
|
||||||
target?: RefreshPathRequest
|
let [fieldNo, wireType] = reader.tag();
|
||||||
): RefreshPathRequest {
|
switch (fieldNo) {
|
||||||
let message = target ?? this.create(),
|
case /* uint64 id */ 1:
|
||||||
end = reader.pos + length;
|
message.id = reader.uint64().toBigInt();
|
||||||
while (reader.pos < end) {
|
break;
|
||||||
let [fieldNo, wireType] = reader.tag();
|
default:
|
||||||
switch (fieldNo) {
|
let u = options.readUnknownField;
|
||||||
case /* uint64 id */ 1:
|
if (u === "throw")
|
||||||
message.id = reader.uint64().toBigInt();
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
break;
|
let d = reader.skip(wireType);
|
||||||
default:
|
if (u !== false)
|
||||||
let u = options.readUnknownField;
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
if (u === 'throw')
|
}
|
||||||
throw new globalThis.Error(
|
}
|
||||||
`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
|
return message;
|
||||||
);
|
}
|
||||||
let d = reader.skip(wireType);
|
internalBinaryWrite(message: RefreshPathRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
if (u !== false)
|
/* uint64 id = 1; */
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(
|
if (message.id !== 0n)
|
||||||
this.typeName,
|
writer.tag(1, WireType.Varint).uint64(message.id);
|
||||||
message,
|
let u = options.writeUnknownFields;
|
||||||
fieldNo,
|
if (u !== false)
|
||||||
wireType,
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
d
|
return writer;
|
||||||
);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(
|
|
||||||
message: RefreshPathRequest,
|
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
/* uint64 id = 1; */
|
|
||||||
if (message.id !== 0n) writer.tag(1, WireType.Varint).uint64(message.id);
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.RefreshPathRequest
|
* @generated MessageType for protobuf message settings.RefreshPathRequest
|
||||||
@@ -504,31 +397,24 @@ class RefreshPathRequest$Type extends MessageType<RefreshPathRequest> {
|
|||||||
export const RefreshPathRequest = new RefreshPathRequest$Type();
|
export const RefreshPathRequest = new RefreshPathRequest$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class RefreshPathResponse$Type extends MessageType<RefreshPathResponse> {
|
class RefreshPathResponse$Type extends MessageType<RefreshPathResponse> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('settings.RefreshPathResponse', []);
|
super("settings.RefreshPathResponse", []);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<RefreshPathResponse>): RefreshPathResponse {
|
create(value?: PartialMessage<RefreshPathResponse>): RefreshPathResponse {
|
||||||
const message = globalThis.Object.create(this.messagePrototype!);
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
if (value !== undefined) reflectionMergePartial<RefreshPathResponse>(this, message, value);
|
if (value !== undefined)
|
||||||
return message;
|
reflectionMergePartial<RefreshPathResponse>(this, message, value);
|
||||||
}
|
return message;
|
||||||
internalBinaryRead(
|
}
|
||||||
reader: IBinaryReader,
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RefreshPathResponse): RefreshPathResponse {
|
||||||
length: number,
|
return target ?? this.create();
|
||||||
options: BinaryReadOptions,
|
}
|
||||||
target?: RefreshPathResponse
|
internalBinaryWrite(message: RefreshPathResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
): RefreshPathResponse {
|
let u = options.writeUnknownFields;
|
||||||
return target ?? this.create();
|
if (u !== false)
|
||||||
}
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
internalBinaryWrite(
|
return writer;
|
||||||
message: RefreshPathResponse,
|
}
|
||||||
writer: IBinaryWriter,
|
|
||||||
options: BinaryWriteOptions
|
|
||||||
): IBinaryWriter {
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message settings.RefreshPathResponse
|
* @generated MessageType for protobuf message settings.RefreshPathResponse
|
||||||
@@ -537,9 +423,9 @@ export const RefreshPathResponse = new RefreshPathResponse$Type();
|
|||||||
/**
|
/**
|
||||||
* @generated ServiceType for protobuf service settings.Settings
|
* @generated ServiceType for protobuf service settings.Settings
|
||||||
*/
|
*/
|
||||||
export const Settings = new ServiceType('settings.Settings', [
|
export const Settings = new ServiceType("settings.Settings", [
|
||||||
{ name: 'ListPaths', options: {}, I: Empty, O: SettingsData },
|
{ name: "ListPaths", options: {}, I: Empty, O: SettingsData },
|
||||||
{ name: 'AddPath', options: {}, I: AddPathRequest, O: AddPathResponse },
|
{ name: "AddPath", options: {}, I: AddPathRequest, O: AddPathResponse },
|
||||||
{ name: 'DeletePath', options: {}, I: DeletePathRequest, O: DeletePathResponse },
|
{ name: "DeletePath", options: {}, I: DeletePathRequest, O: DeletePathResponse },
|
||||||
{ name: 'RefreshPath', options: {}, I: RefreshPathRequest, O: RefreshPathResponse }
|
{ name: "RefreshPath", options: {}, I: RefreshPathRequest, O: RefreshPathResponse }
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -2,8 +2,30 @@ import { PlayerClient } from '$lib/proto/player.client';
|
|||||||
import { fail } from '@sveltejs/kit';
|
import { fail } from '@sveltejs/kit';
|
||||||
import { protoTransport } from '../../hooks.server';
|
import { protoTransport } from '../../hooks.server';
|
||||||
import type { Actions } from './$types';
|
import type { Actions } from './$types';
|
||||||
|
import { serializable } from '$lib/proto';
|
||||||
|
import type { PlayerStatus } from '$lib/proto/player';
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
|
skip: async () => {
|
||||||
|
const client = new PlayerClient(protoTransport);
|
||||||
|
|
||||||
|
const response = await client.skipTrack({});
|
||||||
|
|
||||||
|
return serializable<PlayerStatus>(response.response);
|
||||||
|
},
|
||||||
|
'skip-to-queue-index': async ({ url }) => {
|
||||||
|
const index = url.searchParams.get('index')?.toString();
|
||||||
|
|
||||||
|
if (!index) {
|
||||||
|
return fail(400);
|
||||||
|
}
|
||||||
|
|
||||||
|
const client = new PlayerClient(protoTransport);
|
||||||
|
|
||||||
|
const response = await client.skipToQueueIndex({ index: parseInt(index) });
|
||||||
|
|
||||||
|
return serializable<PlayerStatus>(response.response);
|
||||||
|
},
|
||||||
resume: async () => {
|
resume: async () => {
|
||||||
const client = new PlayerClient(protoTransport);
|
const client = new PlayerClient(protoTransport);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { fail } from '@sveltejs/kit';
|
|||||||
import { protoTransport } from '../../../hooks.server';
|
import { protoTransport } from '../../../hooks.server';
|
||||||
import type { Actions } from './$types';
|
import type { Actions } from './$types';
|
||||||
import { serializable } from '$lib/proto';
|
import { serializable } from '$lib/proto';
|
||||||
import type { PlayTrackResponse } from '$lib/proto/player';
|
import type { PlayTrackResponse, Queue } from '$lib/proto/player';
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
play: async ({ params }) => {
|
play: async ({ params }) => {
|
||||||
@@ -18,5 +18,23 @@ export const actions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return serializable<PlayTrackResponse>(response.response);
|
return serializable<PlayTrackResponse>(response.response);
|
||||||
|
},
|
||||||
|
'add-to-queue': async ({ params }) => {
|
||||||
|
const client = new PlayerClient(protoTransport);
|
||||||
|
|
||||||
|
const response = await client.addTrackToQueue({
|
||||||
|
hash: params.hash
|
||||||
|
});
|
||||||
|
|
||||||
|
return serializable<Queue>(response.response);
|
||||||
|
},
|
||||||
|
'play-next': async ({ params }) => {
|
||||||
|
const client = new PlayerClient(protoTransport);
|
||||||
|
|
||||||
|
const response = await client.playTrackNext({
|
||||||
|
hash: params.hash
|
||||||
|
});
|
||||||
|
|
||||||
|
return serializable<Queue>(response.response);
|
||||||
}
|
}
|
||||||
} satisfies Actions;
|
} satisfies Actions;
|
||||||
|
|||||||
Reference in New Issue
Block a user