diff --git a/vault/Dockerfile b/vault/Dockerfile index 47730d8..1154883 100644 --- a/vault/Dockerfile +++ b/vault/Dockerfile @@ -3,8 +3,6 @@ FROM node:22.16 WORKDIR /srv/proto COPY proto/ . -# RUN npm install -# RUN npm run build WORKDIR /srv/vault diff --git a/vault/character.ts b/vault/character.ts index 3099c45..b3f9c0c 100644 --- a/vault/character.ts +++ b/vault/character.ts @@ -3,258 +3,371 @@ * compiler version: 3.20.3 * source: character.proto * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as pb_1 from "google-protobuf"; -import * as grpc_1 from "@grpc/grpc-js"; +import * as pb_1 from 'google-protobuf' +import * as grpc_1 from '@grpc/grpc-js' export class Character extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - PlayerName?: string; - CharacterName?: string; - CharacterAlias?: string[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("PlayerName" in data && data.PlayerName != undefined) { - this.PlayerName = data.PlayerName; - } - if ("CharacterName" in data && data.CharacterName != undefined) { - this.CharacterName = data.CharacterName; - } - if ("CharacterAlias" in data && data.CharacterAlias != undefined) { - this.CharacterAlias = data.CharacterAlias; - } - } + #one_of_decls: number[][] = [] + constructor( + data?: + | any[] + | { + PlayerName?: string + CharacterName?: string + CharacterAlias?: string[] + }, + ) { + super() + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls, + ) + if (!Array.isArray(data) && typeof data == 'object') { + if ('PlayerName' in data && data.PlayerName != undefined) { + this.PlayerName = data.PlayerName + } + if ('CharacterName' in data && data.CharacterName != undefined) { + this.CharacterName = data.CharacterName + } + if ('CharacterAlias' in data && data.CharacterAlias != undefined) { + this.CharacterAlias = data.CharacterAlias + } } - get PlayerName() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + get PlayerName() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string + } + set PlayerName(value: string) { + pb_1.Message.setField(this, 1, value) + } + get CharacterName() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string + } + set CharacterName(value: string) { + pb_1.Message.setField(this, 2, value) + } + get CharacterAlias() { + return pb_1.Message.getFieldWithDefault(this, 3, []) as string[] + } + set CharacterAlias(value: string[]) { + pb_1.Message.setField(this, 3, value) + } + static fromObject(data: { + PlayerName?: string + CharacterName?: string + CharacterAlias?: string[] + }): Character { + const message = new Character({}) + if (data.PlayerName != null) { + message.PlayerName = data.PlayerName } - set PlayerName(value: string) { - pb_1.Message.setField(this, 1, value); + if (data.CharacterName != null) { + message.CharacterName = data.CharacterName } - get CharacterName() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if (data.CharacterAlias != null) { + message.CharacterAlias = data.CharacterAlias } - set CharacterName(value: string) { - pb_1.Message.setField(this, 2, value); + return message + } + toObject() { + const data: { + PlayerName?: string + CharacterName?: string + CharacterAlias?: string[] + } = {} + if (this.PlayerName != null) { + data.PlayerName = this.PlayerName } - get CharacterAlias() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as string[]; + if (this.CharacterName != null) { + data.CharacterName = this.CharacterName } - set CharacterAlias(value: string[]) { - pb_1.Message.setField(this, 3, value); + if (this.CharacterAlias != null) { + data.CharacterAlias = this.CharacterAlias } - static fromObject(data: { - PlayerName?: string; - CharacterName?: string; - CharacterAlias?: string[]; - }): Character { - const message = new Character({}); - if (data.PlayerName != null) { - message.PlayerName = data.PlayerName; - } - if (data.CharacterName != null) { - message.CharacterName = data.CharacterName; - } - if (data.CharacterAlias != null) { - message.CharacterAlias = data.CharacterAlias; - } - return message; - } - toObject() { - const data: { - PlayerName?: string; - CharacterName?: string; - CharacterAlias?: string[]; - } = {}; - if (this.PlayerName != null) { - data.PlayerName = this.PlayerName; - } - if (this.CharacterName != null) { - data.CharacterName = this.CharacterName; - } - if (this.CharacterAlias != null) { - data.CharacterAlias = this.CharacterAlias; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.PlayerName.length) - writer.writeString(1, this.PlayerName); - if (this.CharacterName.length) - writer.writeString(2, this.CharacterName); - if (this.CharacterAlias.length) - writer.writeRepeatedString(3, this.CharacterAlias); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Character { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Character(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.PlayerName = reader.readString(); - break; - case 2: - message.CharacterName = reader.readString(); - break; - case 3: - pb_1.Message.addToRepeatedField(message, 3, reader.readString()); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Character { - return Character.deserialize(bytes); + return data + } + serialize(): Uint8Array + serialize(w: pb_1.BinaryWriter): void + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter() + if (this.PlayerName.length) writer.writeString(1, this.PlayerName) + if (this.CharacterName.length) writer.writeString(2, this.CharacterName) + if (this.CharacterAlias.length) + writer.writeRepeatedString(3, this.CharacterAlias) + if (!w) return writer.getResultBuffer() + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Character { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Character() + while (reader.nextField()) { + if (reader.isEndGroup()) break + switch (reader.getFieldNumber()) { + case 1: + message.PlayerName = reader.readString() + break + case 2: + message.CharacterName = reader.readString() + break + case 3: + pb_1.Message.addToRepeatedField(message, 3, reader.readString()) + break + default: + reader.skipField() + } } + return message + } + serializeBinary(): Uint8Array { + return this.serialize() + } + static deserializeBinary(bytes: Uint8Array): Character { + return Character.deserialize(bytes) + } } export class CreateCharacterRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | {}) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { } + #one_of_decls: number[][] = [] + constructor(data?: any[] | {}) { + super() + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls, + ) + if (!Array.isArray(data) && typeof data == 'object') { } - static fromObject(data: {}): CreateCharacterRequest { - const message = new CreateCharacterRequest({}); - return message; - } - toObject() { - const data: {} = {}; - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CreateCharacterRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CreateCharacterRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CreateCharacterRequest { - return CreateCharacterRequest.deserialize(bytes); + } + static fromObject(data: {}): CreateCharacterRequest { + const message = new CreateCharacterRequest({}) + return message + } + toObject() { + const data: {} = {} + return data + } + serialize(): Uint8Array + serialize(w: pb_1.BinaryWriter): void + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter() + if (!w) return writer.getResultBuffer() + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader, + ): CreateCharacterRequest { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new CreateCharacterRequest() + while (reader.nextField()) { + if (reader.isEndGroup()) break + switch (reader.getFieldNumber()) { + default: + reader.skipField() + } } + return message + } + serializeBinary(): Uint8Array { + return this.serialize() + } + static deserializeBinary(bytes: Uint8Array): CreateCharacterRequest { + return CreateCharacterRequest.deserialize(bytes) + } } export class GetCharacterRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | {}) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { } + #one_of_decls: number[][] = [] + constructor(data?: any[] | {}) { + super() + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls, + ) + if (!Array.isArray(data) && typeof data == 'object') { } - static fromObject(data: {}): GetCharacterRequest { - const message = new GetCharacterRequest({}); - return message; - } - toObject() { - const data: {} = {}; - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetCharacterRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetCharacterRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GetCharacterRequest { - return GetCharacterRequest.deserialize(bytes); + } + static fromObject(data: {}): GetCharacterRequest { + const message = new GetCharacterRequest({}) + return message + } + toObject() { + const data: {} = {} + return data + } + serialize(): Uint8Array + serialize(w: pb_1.BinaryWriter): void + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter() + if (!w) return writer.getResultBuffer() + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader, + ): GetCharacterRequest { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new GetCharacterRequest() + while (reader.nextField()) { + if (reader.isEndGroup()) break + switch (reader.getFieldNumber()) { + default: + reader.skipField() + } } + return message + } + serializeBinary(): Uint8Array { + return this.serialize() + } + static deserializeBinary(bytes: Uint8Array): GetCharacterRequest { + return GetCharacterRequest.deserialize(bytes) + } } interface GrpcUnaryServiceInterface
{
- (message: P, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback {
- (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream {
- (metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback ;
- (metadata: grpc_1.Metadata, callback: grpc_1.requestCallback ;
- (options: grpc_1.CallOptions, callback: grpc_1.requestCallback ;
- (callback: grpc_1.requestCallback ;
+ (
+ metadata: grpc_1.Metadata,
+ options: grpc_1.CallOptions,
+ callback: grpc_1.requestCallback
+ (
+ metadata: grpc_1.Metadata,
+ callback: grpc_1.requestCallback
+ (
+ options: grpc_1.CallOptions,
+ callback: grpc_1.requestCallback
+ (callback: grpc_1.requestCallback
}
interface GrpcChunkServiceInterface {
- (metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream ;
- (options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream ;
+ (
+ metadata: grpc_1.Metadata,
+ options?: grpc_1.CallOptions,
+ ): grpc_1.ClientDuplexStream
+ (options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream
}
interface GrpcPromiseServiceInterface {
- (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): Promise